11-01-2024, 07:11 PM
Quickie coding...
This little script should take care of jumping.
You can disable enemies (by their Database ID) from delivering the jump effect when struck.
You can increase or decrease the amount of jump to specific enemies (by their Database ID) so weaker enemies COULD get more knockback, or bigger ones get less knockback.
Ditto for the Game_Player
It won't work for the LycanABS because the base mechanics are also used for weapon recoil... but you can see how simple it is.
I set the JUMP CHANGE values positive to 'increase' the jump. Setting negative values reduce jump.
These values get combined with the initial jump. The initial jump will never be below 0. When it hits 0, there IS no jump.
Code:
module JumpDefine
#----------------------------------------------------------------------------
ENEMY_JUMP_CHANGE = {} # DO NOT TOUCH
#----------------------------------------------------------------------------
# ENEMIES THAT DON'T JUMP
# -----------------------
# This is a simple array holding the IDs of enemies that do not react with a
# jump effect after being hit. The IDs are the Enemy Database IDs, and not
# the IDs of the events on any given map.
#
ENEMY_NO_JUMP = [4]
# ENEMIES THAT HAVE CHANGED JUMP VALUES
# -------------------------------------
# This is a simple section that lets you increase or decrease the amount of
# jump any given enemy may enact when struck. This allows you to reduce the
# jump effect for enemies assumed to be massive, or increase the amount of
# the jump effect for enemies assumed frail or lightweight.
#
ENEMY_JUMP_CHANGE[4] = 2 # Enemy 4 is light, and has 2 added to jump!
# PLAYER JUMP ALTERATIONS
# -----------------------
# This section allows the game developer to determine of the player performs
# a jump effect if struck, or any increase or decrease in the amount of jump
# being performed.
#
PLAYER_NO_JUMP = false # (Default: false) if true, there is no jump
PLAYER_JUMP_CHANGE = 3 # (Default: 0) The increase/decrease in jump
end
#==============================================================================
# ** MrMo_ABS
#------------------------------------------------------------------------------
# This class deals with the Action Battle System and controls all Player,
# Enemy and Companion Actions on the map.
#==============================================================================
class MrMo_ABS
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias woobis jump
#--------------------------------------------------------------------------
# * Jump
#--------------------------------------------------------------------------
def jump(object, attacker, plus)
#
# Acquire Enemy ID
id = get_enemy_id(object)
#
# Only for the player
if object.is_a?(Game_Player)
#
# Cancel/block jump if player doesn't jump
return if JumpDefine::PLAYER_NO_JUMP == true
plus += JumpDefine::PLAYER_JUMP_CHANGE
#
end
#
# Only for valid enemy IDs
unless id == 0
#
# Cancel/block jump if defined for the enemy
unless JumpDefine::ENEMY_NO_JUMP == [] || JumpDefine::ENEMY_NO_JUMP.nil?
return if JumpDefine::ENEMY_NO_JUMP.include?(id)
end
#
# Increase/decrease jump value if defined for the enemy
if JumpDefine::ENEMY_JUMP_CHANGE.has_key?(id)
plus += JumpDefine::ENEMY_JUMP_CHANGE[id]
plus = 0 if plus < 0
end
#
end
#
# Perform the original method
woobis(object, attacker, plus)
#
end
#--------------------------------------------------------------------------
# * Get Enemy ID from event
# event : Event
#--------------------------------------------------------------------------
def get_enemy_id(event)
#
# Assume invalid enemy ID
effective = 0
#
# Cycle through enemies on map
for enemy in @enemies.values
#
# If the on-map enemy's event is a match to the event
if event.id == enemy.event_id
# set the enemy ID from the on-map enemies
effective = enemy.enemy_id
end
#
end
#
# Return the enemy ID (invalid or not)
return effective
#
end
end
This little script should take care of jumping.
You can disable enemies (by their Database ID) from delivering the jump effect when struck.
You can increase or decrease the amount of jump to specific enemies (by their Database ID) so weaker enemies COULD get more knockback, or bigger ones get less knockback.
Ditto for the Game_Player
It won't work for the LycanABS because the base mechanics are also used for weapon recoil... but you can see how simple it is.
I set the JUMP CHANGE values positive to 'increase' the jump. Setting negative values reduce jump.
These values get combined with the initial jump. The initial jump will never be below 0. When it hits 0, there IS no jump.