Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Projectile Update Patch for Falcao's ABS
- Made by: Sixth
- This little script will make the update method in the Projectile class more
- expandable by separating the different things it updates into their own methods.
- It also adds the possibility of guarding properly with any tool, regardless if
- it is equipped on the 1st tool slot or on a skill/item tool slot. This was not
- possible before, because the guard would end as soon as the tool's destroy time
- is elapsed (so, the ability to hold the guard button were missing for any tool
- slot except the 2nd one - armor by default).
- And while messing with these methods, I also changed the check for shield type
- tools. You can now set any tool to be a shield type, not only armors!
- Although, using armors for that is the most logical thing to do still. :P
- Place this patch right below the - Pearl Battler Settings script!
- v1.1 - Fixed the "still guarding?" check.
- =end
- class Projectile < Game_Character
- alias fix_key_press8827 initialize
- def initialize(*args)
- @key_used = $game_player.last_key
- fix_key_press8827(*args)
- end
- def update
- super
- return if check_and_trigger_effects # Separated by Sixth!
- @precombi = @user.doingcombo > 0 if @precombi.nil?
- update_tool_token
- if @target_effect[0]
- follow_char(@target_effect[1]) if !moving?
- @tool_distance = 0
- end
- @tool_distance = 0 if @tool_special == "area"
- update_timer
- # Tool special shield engine - Separated by Sixth!
- return if update_shield_engine
- update_hookshotdef if @customsteps != nil # update hookshot
- update_boomerand if @tool_special == "boomerang" # update boomerang
- update_spiral if @tool_special == "spiral" # update spiral
- return if @transparent and @customsteps != nil # return is tranparent
- update_damage # update damage
- end
- def check_and_trigger_effects
- if magical_item?
- case @item.scope
- when 0 # scope 0 apply the effect to the user
- apply_self_effect(@user, true)
- return true
- when 7 # heal one ally
- apply_effectto_selection
- return true
- when 8 # heall all
- apply_effectto_all_allies
- return true
- when 9 # revive one ally
- apply_effectto_selection
- return true
- when 10 # revive all
- apply_effectto_all_allies
- return true
- when 11 # to the user
- apply_self_effect(@user, true)
- return true
- end
- end
- end
- def update_shield_engine
- if @tool_special == "shield" # Removed the armor check! by Sixth
- if !@user.battler_guarding[0]
- if @tool_invoke > 0
- @user.battler.melee_attack_apply(@user.battler,@tool_invoke)
- else
- @user.battler.item_apply(@user.battler, $data_skills[2])
- end
- @user.battler_guarding[0] = true
- @user.battler_guarding[1] = @tool_guardrate
- # shield directions
- elsif @user.battler_guarding[0]
- if @user.battler.is_a?(Game_Actor)
- if @user.is_a?(Game_Player)
- if $game_player.last_key == @key_used && PearlKey.press?(@key_used) &&
- @tool_destroy_delay <= @originaldestory_delay - 16
- @tool_destroy_delay = 10
- @user.anime_speed = 10
- end
- @user.direction = 2 if Input.dir4 == 2
- @user.direction = 4 if Input.dir4 == 4
- @user.direction = 6 if Input.dir4 == 6
- @user.direction = 8 if Input.dir4 == 8
- end
- else
- if @user.is_a?(Game_Event) and @user.agroto_f != nil
- @user.turn_toward_character(@user.agroto_f)
- else
- @user.turn_toward_character($game_player)
- end
- end
- end
- if @tool_destroy_delay == 0
- @user.battler.remove_state(9)
- @user.battler_guarding = [false, nil]
- end
- return true
- end
- end
- end
- class Game_Player < Game_Character
- attr_accessor :last_key
- def trigger_tool?(key, type)
- if type == :keys && PearlKey.trigger?(key)
- @last_key = key
- return true
- end
- return true if @mouse_exist && Mouse.trigger?(0) && type == :mouse &&
- @mouse_over == key
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement