Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # This patch overwrite some methods from these scripts:
- # 1. XAS
- # 2. Dash & Backdash Skill
- #
- # Put this patch below "GamePad Extender" script.
- #===============================================================================
- #===============================================================================
- # ■ XAS ACTION
- #===============================================================================
- module XAS_ACTION
- #--------------------------------------------------------------------------
- # ● Can Shoot
- #--------------------------------------------------------------------------
- def can_shoot?(skill)
- if self.battler == nil and self.tool_id > 0
- @battler = self.action.user.battler
- end
- return false if self.battler == nil
- return false if skill == nil
- return true if ignore_can_shoot?(skill)
- enough_cost = true
- return false if tools_on_map?(skill.id)
- if self.battler.state_mute
- seal_effect
- return false
- end
- if self.battler.cast_action[4].between?(1,self.battler.cast_action[1] -1)
- return false
- end
- return false if check_cast_action?(skill)
- return false if check_auto_target_select?(skill)
- unless enough_skill_cost?(skill)
- if $game_options
- volume = 100 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 100
- end
- Audio.se_play("Audio/SE/" + XAS_SOUND::ACTION_COST , volume.to_i, 100)
- return false
- end
- return true
- end
- end
- #===============================================================================
- # ■ Game Player
- #===============================================================================
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # ● check_treasure_here
- #--------------------------------------------------------------------------
- def check_treasure_here
- for event in $game_map.events_xy(@x, @y)
- if event.treasure != nil
- name_pop = true
- case event.treasure[0]
- when 1
- item = $data_items[event.treasure[1]]
- if can_execute_field_item_effect?(item)
- name_pop = false
- else
- $game_party.gain_item(item, 1)
- end
- $game_map.need_refresh = true
- when 2
- item = $data_weapons[event.treasure[1]]
- $game_party.gain_item($data_weapons[event.treasure[1]], 1,false)
- when 3
- item = $data_armors[event.treasure[1]]
- $game_party.gain_item(item, 1,false)
- end
- if $game_options
- volume = 100 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 100
- end
- Audio.se_play("Audio/SE/" + XAS_SOUND::ITEM_DROP , volume.to_i, 100)
- event.erase
- if item != nil
- if item.note =~ /<Drop Animation = (\d+)>/
- self.animation_id = $1.to_i
- end
- if XAS_DAMAGE_POP::DAMAGE_ITEM_POP and name_pop
- self.battler.damage = item.name.to_s
- self.battler.damage_pop = true
- self.battler.damage_type = "Item"
- end
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● Check Actor Level
- #--------------------------------------------------------------------------
- def check_actor_level
- return if $game_party.in_battle
- return if self.battler == nil
- return if self.battler.old_level == self.battler.level
- reset_old_level(false)
- if self.battler.level > 1
- if $game_options
- volume = 100 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 100
- end
- Audio.se_play("Audio/SE/" + XAS_SOUND::LEVEL_UP , volume.to_i, 100)
- if XAS_WORD::ENABLE_WORD
- $game_player.battler.damage = XAS_WORD::LEVEL_UP
- $game_player.battler.damage_pop = true
- end
- end
- $game_player.need_refresh = true
- end
- #--------------------------------------------------------------------------
- # ● Throw Event
- #--------------------------------------------------------------------------
- def throw_event
- for event in $game_map.events.values
- if event.throw_active and not jumping?
- $game_temp.can_throw = true
- event.throw_action(event.throw)
- return if $game_temp.can_throw == false
- $game_temp.pickup_lock_time = event.jump_count
- $game_temp.throw_position[0] = event.x
- $game_temp.throw_position[1] = event.y
- event.throw_active = false
- $game_temp.pickup_lock = false
- if $game_options
- volume = 100 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 100
- end
- Audio.se_play("Audio/SE/" + THROW_SE, volume.to_i, 100)
- action_id = MOG_PICK_THROW::THROW_ACTION_ID
- $game_player.shoot(action_id) unless (event.tool_id > 0 and event.action.first_impact_time > 0)
- end
- end
- if event == nil or event.erased or event.dead?
- $game_map.reset_pickup
- end
- end
- #--------------------------------------------------------------------------
- # ● Check Event Pickup
- #--------------------------------------------------------------------------
- def check_event_pickup(triggers)
- front_x = $game_map.x_with_direction(@x, @direction)
- front_y = $game_map.y_with_direction(@y, @direction)
- for event in $game_map.events_xy(front_x, front_y)
- if event.throw > 0 and not (jumping? or event.dead?)
- event.throw_active = true
- $game_temp.pickup_lock = true
- event.jump(0,0)
- $game_temp.pickup_lock_time = event.jump_count
- event.x = @x
- event.y = @y
- if $game_options
- volume = 100 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 100
- end
- Audio.se_play("Audio/SE/" + PICK_UP_SE, volume.to_i, 100)
- @dash_active = false
- @shield = false
- reset_cast_temp
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Update Dash Command
- #--------------------------------------------------------------------------
- alias old_update_dash_button_2 update_dash_button
- def update_dash_button
- if @rush_cooldown > 0
- @rush_cooldown -= 1
- end
- if rush_accessories_equipped? && !$game_map.interpreter.running?
- # YIN
- if @wait_cast_time && @wait_cast_time <= 0
- if @stored_action
- @rush_btn_released = true
- @rush_cooldown = Kadafi::RushCooldown
- self.battler.cast_action = @stored_action
- self.shoot(self.battler.cast_action[0])
- @stored_action = nil
- @wait_cast_time = nil
- return
- end
- end
- if Input.press?(Kadafi::RushButton) && @rush_cooldown == 0
- if @wait_cast_time && @wait_cast_time > 0
- @wait_cast_time -= 1
- end
- # Check if the character is currently casting a skill
- # and if it is, store it.
- if self.battler.cast_action[0] != 0
- @wait_cast_time = (self.battler.cast_action[4] - self.battler.cast_action[1]).abs
- @stored_action = self.battler.cast_action.clone
- self.battler.cast_action[0] = 0
- self.battler.cast_action[1] = 0
- self.battler.cast_action[2] = 0
- self.battler.cast_action[3] = 0
- self.battler.cast_action[4] = 0
- end
- @rush_btn_released = false
- @rush_delay += 1
- if @rush_delay > Kadafi::RushDelay
- if !@rush_se_played
- @dash_stance = VE_DEFAULT_RUSH_SUFIX
- if $game_options
- volume = Kadafi::RushSEVolume * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = Kadafi::RushSEVolume
- end
- Audio.se_play("Audio/SE/" + Kadafi::RushSE, volume.to_i, 100) rescue nil
- @rush_se_played = true
- end
- end
- else
- if !@rush_btn_released
- @rush_btn_released = true
- @rush_cooldown = Kadafi::RushCooldown
- if @stored_action
- self.battler.cast_action = @stored_action
- self.shoot(self.battler.cast_action[0])
- @stored_action = nil
- @wait_cast_time = nil
- end
- end
- @dash_stance = VE_DEFAULT_DASH_SUFIX
- @rush_se_played = false
- @rush_delay = 0
- end
- end
- old_update_dash_button_2
- end
- # Update input for backdash
- def update_backdash_button # And front dash!
- backdash_distance = 2 # Also used as frontdash distance
- if @backdash_cooldown # Also used as frontdash cooldown
- @backdash_cooldown -= 1
- return if @backdash_cooldown > 0
- end
- if Input.trigger?(PadConfig.dash)
- if backstep_accessories_equipped?
- @backdash_cooldown = 27
- # YIN
- pose_suffix = Kadafi::DashBackSuffix
- make_pose(pose_suffix, @backdash_cooldown - 12)
- image_only_on_dash(true)
- if $game_options
- volume = 80 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 80
- end
- Audio.se_play('Audio/ME/dash', volume.to_i, 150)
- d = 10 - direction
- a = 0
- if @diagonal_direction != 0
- backdash_distance = (backdash_distance * OrangeMovement::Tile_Sections/Math.sqrt(2)).to_i/OrangeMovement::Tile_Sections
- end
- backdash_distance.times do
- OrangeMovement::Tile_Sections.times do
- if @diagonal_direction != 0
- case @diagonal_direction
- when 1
- if (diagonal_passable?(@x+a, @y-a, 6, 8) && diagonal_passable?(@x+(a*2), @y-(a*2), 6, 8))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x+a, @y-a, 6, 8)
- a += my_step_size
- end
- when 3
- if (diagonal_passable?(@x-a, @y-a, 4, 8) && diagonal_passable?(@x-(a*2), @y-(a*2), 4, 8))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x-a, @y-a, 4, 8)
- a += my_step_size
- end
- when 7
- if (diagonal_passable?(@x+a, @y+a, 6, 2) && diagonal_passable?(@x+(a*2), @y+(a*2), 6, 2))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x+a, @y+a, 6, 2)
- a += my_step_size
- end
- when 9
- if (diagonal_passable?(@x-a, @y+a, 4, 2) && diagonal_passable?(@x-(a*2), @y+(a*2), 4, 2))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x-a, @y+a, 4, 2)
- a += my_step_size
- end
- end
- else
- case @direction
- when 2; a += my_step_size if passable?(@x, @y-a, d)
- when 4; a += my_step_size if passable?(@x+a, @y, d)
- when 6; a += my_step_size if passable?(@x-a, @y, d)
- when 8; a += my_step_size if passable?(@x, @y+a, d)
- end
- end
- end
- end
- if @diagonal_direction != 0
- case @diagonal_direction
- when 1
- @x += a
- @y -= a
- when 3
- @x -= a
- @y -= a
- when 7
- @x += a
- @y += a
- when 9
- @x -= a
- @y += a
- end
- else
- case @direction
- when 2
- @x += 0
- @y -= a
- when 8
- @x += 0
- @y += a
- when 4
- @x += a
- @y += 0
- when 6
- @x -= a
- @y += 0
- end
- end
- @jump_peak = 3 + a.abs - @move_speed
- #~ p @jump_peak
- @jump_count = @jump_peak * 3.9
- @stop_count = 0
- straighten
- # Front Dash
- elsif forwardstep_accessories_equipped?
- @backdash_cooldown = 27
- # YIN
- pose_suffix = Kadafi::DashForwardSuffix
- make_pose(pose_suffix, @backdash_cooldown - 12)
- image_only_on_dash(true)
- if $game_options
- volume = 80 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 80
- end
- Audio.se_play('Audio/ME/dash', volume.to_i, 150)
- d = direction
- a = 0
- if @diagonal_direction != 0
- backdash_distance = (backdash_distance * OrangeMovement::Tile_Sections/Math.sqrt(2)).to_i/OrangeMovement::Tile_Sections
- end
- backdash_distance.times do
- OrangeMovement::Tile_Sections.times do
- if @diagonal_direction != 0
- case @diagonal_direction
- when 1
- if (diagonal_passable?(@x-a, @y+a, 6, 8) && diagonal_passable?(@x-(a*2), @y+(a*2), 6, 8))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x-a, @y+a, 6, 8)
- a += my_step_size
- end
- when 3
- if (diagonal_passable?(@x+a, @y+a, 4, 8) && diagonal_passable?(@x+(a*2), @y+(a*2), 4, 8))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x+a, @y+a, 4, 8)
- a += my_step_size
- end
- when 7
- if (diagonal_passable?(@x-a, @y-a, 6, 2) && diagonal_passable?(@x-(a*2), @y-(a*2), 6, 2))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x-a, @y-a, 6, 2)
- a += my_step_size
- end
- when 9
- if (diagonal_passable?(@x+a, @y-a, 4, 2) && diagonal_passable?(@x+(a*2), @y-(a*2), 4, 2))
- a += (my_step_size * 2)
- elsif diagonal_passable?(@x+a, @y-a, 4, 2)
- a += my_step_size
- end
- end
- else
- case @direction
- when 2; a += my_step_size if passable?(@x, @y+a, d)
- when 4; a += my_step_size if passable?(@x-a, @y, d)
- when 6; a += my_step_size if passable?(@x+a, @y, d)
- when 8; a += my_step_size if passable?(@x, @y-a, d)
- end
- end
- end
- end
- if @diagonal_direction != 0
- case @diagonal_direction
- when 1
- @x -= a
- @y += a
- when 3
- @x += a
- @y += a
- when 7
- @x -= a
- @y -= a
- when 9
- @x += a
- @y -= a
- end
- else
- case @direction
- when 2
- @x += 0
- @y += a
- when 8
- @x += 0
- @y -= a
- when 4
- @x -= a
- @y += 0
- when 6
- @x += a
- @y += 0
- end
- end
- @jump_peak = 3 + a.abs - @move_speed
- @jump_count = @jump_peak * 3.9
- @stop_count = 0
- straighten
- end
- end
- end
- end
- #==============================================================================
- # ■ Game_Character
- #==============================================================================
- class Game_Character < Game_CharacterBase
- #--------------------------------------------------------------------------
- # ● Update CT Wait
- #--------------------------------------------------------------------------
- def update_ct_wait
- if self.battler.ct == self.battler.ct_max and self.battler.ct_wait == true
- self.battler.ct_wait = false
- if $game_temp.ct_sound_time >= XAS_CT_SYSTEM::CT_FULL_SE_ENABLE_TIME
- se = XAS_CT_SYSTEM::CT_FULL_SE
- if se != nil
- if $game_options
- volume = 70 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 70
- end
- Audio.se_play("Audio/SE/" + se , volume.to_i, 100)
- end
- end
- $game_temp.ct_sound_time = 0
- end
- return if self.battler.ct_wait
- if self.battler.ct < self.battler.ct_max
- if self.battler.shield or self.dash_active
- if self.battler.ct == 0
- self.battler.ct_wait = true
- self.battler.shield = false
- self.dash_active = false
- se = XAS_CT_SYSTEM::CT_WAIT_SE
- if se != nil
- if $game_options
- volume = 100 * $game_options.master_volume
- volume *= $game_options.se_volume
- else
- volume = 100
- end
- Audio.se_play("Audio/SE/" + se , volume.to_i, 100)
- end
- end
- return
- end
- self.battler.ct_wait = true
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement