| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| (()=> { |
| 'use strict'; |
|
|
| |
| |
| |
| const _Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers; |
| Game_CharacterBase.prototype.initMembers = function() { |
| _Game_CharacterBase_initMembers.apply(this, arguments); |
| this._jumpSpeed = 0; |
| this._jumpHeight = 0; |
| }; |
|
|
| Game_CharacterBase.prototype.getJumpSpeedRate = function() { |
| return this._jumpSpeed / 100; |
| }; |
|
|
| Game_CharacterBase.prototype.getJumpHeightRate = function() { |
| return this._jumpHeight / 100; |
| }; |
|
|
| Game_CharacterBase.prototype.setJumpSpeed = function(value) { |
| this._jumpSpeed = value > 0 ? value : 0; |
| }; |
|
|
| Game_CharacterBase.prototype.setJumpHeight = function(value) { |
| this._jumpHeight = value; |
| }; |
|
|
| const _Game_CharacterBase_jumpHeight = Game_CharacterBase.prototype.jumpHeight; |
| Game_CharacterBase.prototype.jumpHeight = function() { |
| let height; |
| const rate = this.getJumpSpeedRate(); |
| if (rate > 0) { |
| height = (this._jumpPeak * this._jumpPeak - |
| Math.pow(Math.abs(this._jumpCount * rate - this._jumpPeak), 2)) / 2; |
| } else { |
| height =_Game_CharacterBase_jumpHeight.apply(this, arguments); |
| } |
| return this._jumpHeight !== 0 ? Math.floor(height * this.getJumpHeightRate()) : height |
| }; |
|
|
| const _Game_CharacterBase_jump = Game_CharacterBase.prototype.jump; |
| Game_CharacterBase.prototype.jump = function(xPlus, yPlus) { |
| _Game_CharacterBase_jump.apply(this, arguments); |
| const rate = this.getJumpSpeedRate(); |
| if (rate > 0) { |
| this._jumpCount = Math.floor(this._jumpPeak * 2 / rate); |
| } |
| }; |
|
|
| |
| |
| |
| const _Game_Event_initialize = Game_Event.prototype.initialize; |
| Game_Event.prototype.initialize = function(mapId, eventId) { |
| _Game_Event_initialize.apply(this, arguments); |
| this.initJumpCustomize(); |
| }; |
|
|
| Game_Event.prototype.initJumpCustomize = function() { |
| const jumpSpeed = PluginManagerEx.findMetaValue(this.event(), ['JumpSpeed', 'ジャンプ速度']); |
| if (jumpSpeed > 0) { |
| this.setJumpSpeed(jumpSpeed); |
| } |
| const jumpHeight = PluginManagerEx.findMetaValue(this.event(), ['JumpHeight', 'ジャンプ高度']); |
| if (jumpHeight) { |
| this.setJumpHeight(jumpHeight); |
| } |
| }; |
| })(); |
|
|