Added "airborne" event name tag, can have Safari battles with no party, fixed Micle Berry, fixed data box not refreshing when Illusion is broken, added triggers for more EoR animations

This commit is contained in:
Maruno17
2024-04-27 00:10:28 +01:00
parent 494e646fd5
commit 04985eab5c
7 changed files with 12 additions and 5 deletions
@@ -206,11 +206,12 @@ class Game_Character
end
def bush_depth
return 0 if respond_to?("name") && name[/airborne/i]
return @bush_depth || 0
end
def calculate_bush_depth
if @tile_id > 0 || @always_on_top || jumping?
if @tile_id > 0 || @always_on_top || jumping? || (respond_to?("name") && name[/airborne/i])
@bush_depth = 0
return
end
@@ -171,6 +171,7 @@ class Battle
priority.each do |battler|
next if !battler.effects[PBEffects::AquaRing]
next if !battler.canHeal?
pbCommonAnimation("AquaRing", battler)
hpGain = battler.totalhp / 16
hpGain = (hpGain * 1.3).floor if battler.hasActiveItem?(:BIGROOT)
battler.pbRecoverHP(hpGain)
@@ -180,6 +181,7 @@ class Battle
priority.each do |battler|
next if !battler.effects[PBEffects::Ingrain]
next if !battler.canHeal?
pbCommonAnimation("Ingrain", battler)
hpGain = battler.totalhp / 16
hpGain = (hpGain * 1.3).floor if battler.hasActiveItem?(:BIGROOT)
battler.pbRecoverHP(hpGain)
@@ -259,6 +261,7 @@ class Battle
priority.each do |battler|
battler.effects[PBEffects::Nightmare] = false if !battler.asleep?
next if !battler.effects[PBEffects::Nightmare] || !battler.takesIndirectDamage?
pbCommonAnimation("Nightmare", battler)
battler.pbTakeEffectDamage(battler.totalhp / 4) do |hp_lost|
pbDisplay(_INTL("{1} is locked in a nightmare!", battler.pbThis))
end
@@ -266,6 +269,7 @@ class Battle
# Curse
priority.each do |battler|
next if !battler.effects[PBEffects::Curse] || !battler.takesIndirectDamage?
pbCommonAnimation("Curse", battler)
battler.pbTakeEffectDamage(battler.totalhp / 4) do |hp_lost|
pbDisplay(_INTL("{1} is afflicted by the curse!", battler.pbThis))
end
@@ -393,6 +393,7 @@ class Battle::Scene
shadowSprite.setPokemonBitmap(pkmn)
# Set visibility of battler's shadow
shadowSprite.visible = pkmn.species_data.shows_shadow? if shadowSprite && !back
@sprites["dataBox_#{idxBattler}"].refresh
end
def pbResetCommandsIndex(idxBattler)
@@ -499,7 +499,7 @@ class Battle::AI::AIBattler
when :ASPEARBERRY, :CHERIBERRY, :CHESTOBERRY, :PECHABERRY, :RAWSTBERRY
# Status cure
cured_status = {
:ASPEAR => :FROZEN,
:ASPEARBERRY => :FROZEN,
:CHERIBERRY => :PARALYSIS,
:CHESTOBERRY => :SLEEP,
:PECHABERRY => :POISON,
@@ -346,7 +346,7 @@ Battle::ItemEffects::HPHeal.add(:MAGOBERRY,
Battle::ItemEffects::HPHeal.add(:MICLEBERRY,
proc { |item, battler, battle, forced|
next false if !forced && !battler.canConsumePinchBerry?
next false if !battler.effects[PBEffects::MicleBerry]
next false if battler.effects[PBEffects::MicleBerry]
battle.pbCommonAnimation("EatBerry", battler) if !forced
battler.effects[PBEffects::MicleBerry] = true
itemName = GameData::Item.get(item).name
+3 -1
View File
@@ -146,6 +146,7 @@ EventHandlers.add(:on_step_taken, :pick_up_soot,
EventHandlers.add(:on_step_taken, :grass_rustling,
proc { |event|
next if !$scene.is_a?(Scene_Map)
next if event.respond_to?("name") && event.name[/airborne/i]
event.each_occupied_tile do |x, y|
next if !$map_factory.getTerrainTagFromCoords(event.map.map_id, x, y, true).shows_grass_rustle
spriteset = $scene.spriteset(event.map_id)
@@ -158,6 +159,7 @@ EventHandlers.add(:on_step_taken, :grass_rustling,
EventHandlers.add(:on_step_taken, :still_water_ripple,
proc { |event|
next if !$scene.is_a?(Scene_Map)
next if event.respond_to?("name") && event.name[/airborne/i]
event.each_occupied_tile do |x, y|
next if !$map_factory.getTerrainTagFromCoords(event.map.map_id, x, y, true).shows_water_ripple
spriteset = $scene.spriteset(event.map_id)
@@ -207,7 +209,7 @@ EventHandlers.add(:on_player_change_direction, :trigger_encounter,
)
def pbBattleOnStepTaken(repel_active)
return if $player.able_pokemon_count == 0
return if $player.able_pokemon_count == 0 && !pbInSafari?
return if !$PokemonEncounters.encounter_possible_here?
encounter_type = $PokemonEncounters.encounter_type
return if !encounter_type
@@ -759,7 +759,6 @@ module BattleAnimationEditor
return false
end
if usealpha
# TODO: This should account for sprite.angle as well.
bitmapX = sprite.src_rect.x
bitmapY = sprite.src_rect.y
bitmapX += sprite.ox