Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Changes to [GTBS] Scene_Battle / [GTBS] Game_Battler
- ATB Update 1.0
- Change list:
- - Changed how skill cast time works, now it waits a specific amount of turns that pass
- example: a skill cast time set to 1, would activate after the next battlers turn
- while a skill with cast time 5, would w8 until the next 5 battlers pass.
- setup skill_wait with, see more in [GTBS] Skill Setup
- skill_wait[Cast_time, ATB_recover, End_Turn]
- - Haven't tested if enemies cast time works.
- - Added haste/slow into atb math
- haste speeds up atb and slow slows it down.
- Look at [GTBS] General Settings for HASTE_ID and SLOW_ID
- By Quasi (http://quasixi.wordpress.com/)
- - 2/12/14
- =end
- module Quasi
- # Change values to the speed to increase/decrease while they have
- # Haste or Slow
- ATB_HASTE = 1.5
- ATB_SLOW = 0.5
- end
- class Scene_Battle_TBS
- @atb_updated = false
- #----------------------------------------------------------------------------
- # Process Battlers - Main battler update thread
- #----------------------------------------------------------------------------
- def process_atb
- while @active_battler == nil
- process_forced_action
- for battler in tactics_all
- battler.check_casting
- end
- return if @using_skill
- @use_spell = next_wait_skill(tactics_all)
- return unless @use_spell.empty?
- next_battler = next_atb_battler(tactics_all)
- if next_battler
- next_battler.reset_atb
- set_active_battler(next_battler)
- @atb_updated = false
- #return
- else
- update_atb(tactics_all)
- end
- end
- end
- #--------------------------------------------------------------------------
- #* update_atb
- #-------------------------------------------------------------------------
- def update_atb(list_battlers)
- @scasting = [] if @scasting == nil
- for battler in list_battlers
- next if battler.paralyzed? or battler.sleeping? or battler.knocked_out? or battler.hidden?
- battler.atb_update
- if battler.casting? and !battler.muted?
- if battler.enemy?
- id = 10 + battler.index #enemies start at array index 10+
- else
- id = battler.id
- end
- if @scasting[id] == nil or @scasting[battler.id] < 0
- @scasting[id] = GTBS::skill_wait(battler.skill_cast[0].id)[0]
- end
- if @scasting[id] <= 0
- battler.up_cast(false, 0)
- end
- if @atb_updated == false
- battler.up_cast(false, @scasting[id])
- @scasting[id] -= 1
- @atb_updated = true
- end
- end
- end
- end
- end
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- # GTBS Game Battler edits - Part 1 (New/revised variables/methods)
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
- class Game_Battler < Game_BattlerBase
- #--------------------------------------------------------------------------
- # * Updates current casting time, or resets it
- #--------------------------------------------------------------------------
- def up_cast(reset = false, cast = 0)
- if cast > 0
- @skillcasting = cast
- else
- @skillcasting = 0
- end
- end
- #--------------------------------------------------------------------------
- # Update ATB using AGI for the actor
- #--------------------------------------------------------------------------
- def promptness
- agi = self.agi
- cast = casting? ? GTBS.skill_wait(@skill_cast[0].id)[1] / 100.0 : 1.0
- slow = is_slow? ? Quasi::ATB_SLOW : 1.0
- haste = is_haste? ? Quasi::ATB_HASTE : 1.0
- atb = agi * cast * slow * haste
- return atb
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement