Skip to content

Commit

Permalink
fixed boss battles events
Browse files Browse the repository at this point in the history
  • Loading branch information
Manurocker95 committed Aug 1, 2023
1 parent af2a41c commit f78c042
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
18 changes: 10 additions & 8 deletions Plugins/Elite Battle DX/[000] Scripts/Battle Core/Battler Info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ def getBattlerPokemon(battler)
def getBattlerAltitude(battler)
return 0 if battler.nil? || battler.displaySpecies.nil?

ret = EliteBattle.get_data(battler.displaySpecies, :Species, :ALTITUDE, (battler.displayForm rescue 0))
return ret

dat = GameData::SpeciesMetrics.get(battler.displaySpecies)
return 0 if dat.nil?
ret = (dat.front_sprite_altitude rescue 0)
ret = 0 if ret.nil?
return ret
if !EliteBattle::FORCE_EBDX_ALTITUDE
dat = GameData::SpeciesMetrics.get(battler.displaySpecies)
return 0 if dat.nil?
ret = (dat.front_sprite_altitude rescue 0)
ret = 0 if ret.nil?
return ret
end

ret = EliteBattle.get_data(battler.displaySpecies, :Species, :ALTITUDE, (battler.displayForm rescue 0))
return ret
end
#-------------------------------------------------------------------------------
def playBattlerCry(battler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def self.wildBattle(data, partysize = 1, canEscape = true, canLose = false, play
genwildpoke = data.is_a?(Pokemon) ? data : self.generateWild(data)
handled = [nil]
# wild battle override
Events.onWildBattleOverride.trigger(genwildpoke, genwildpoke.species, genwildpoke.level, handled)
EventHandlers.trigger(:on_calling_wild_battle, genwildpoke.species, genwildpoke.level, handled)
return handled[0] if handled[0] != nil
# Skip battle if the player has no able Pokémon, or if holding Ctrl in Debug mode
if $player.able_pokemon_count == 0 || ($DEBUG && Input.press?(Input::CTRL))
Expand All @@ -73,7 +73,7 @@ def self.wildBattle(data, partysize = 1, canEscape = true, canLose = false, play
end
# Record information about party Pokémon to be used at the end of battle (e.g.
# comparing levels for an evolution check)
Events.onStartBattle.trigger(nil)
EventHandlers.trigger(:on_start_battle)
# Generate wild Pokémon based on the species and level
foeParty = [genwildpoke]
# Calculate who the trainers and their party are
Expand Down Expand Up @@ -131,7 +131,7 @@ def self.wildBattle(data, partysize = 1, canEscape = true, canLose = false, play
Input.update
pbSet(outcomeVar, decision)
# Used by the Poké Radar to update/break the chain
Events.onWildBattleEnd.trigger(nil, genwildpoke.species, genwildpoke.level, decision)
EventHandlers.trigger(:on_wild_battle_end, genwildpoke.species, genwildpoke.level, decision)
# return full decision outcome
return (decision != 2 && decision != 5)
end
Expand Down
3 changes: 3 additions & 0 deletions Plugins/Elite Battle DX/[003] Config/Config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ module EliteBattle

# ZUD plugins clear cached data so EBDX gets stuck. Setting this to true skips the cache and directly loads the game.
SKIP_CACHED_DATA = false

#if set to false, pokemon_metrics.txt is checked first (default Essentials file). If not, that file is skipped.
FORCE_EBDX_ALTITUDE = true
end
#-------------------------------------------------------------------------------
# Adds additional "camera" vectors for when the camera is idling
Expand Down
10 changes: 9 additions & 1 deletion Plugins/Elite Battle DX/meta.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name = Elite Battle: DX
Version = 1.3.7
Version = 1.4.0 (E20)
Essentials = 20.1
Conflicts = Elite Battle System
Requires = Luka's Scripting Utilities,3.3
Expand All @@ -8,6 +8,14 @@ Credits = Luka S.J.,Maruno,Marin,Pokecheck.org,PinkCatDragon,Tebited15,BadSam
#====================================================================
# Change log
#====================================================================
# 1.1.3 - Considered as 1.4.0
# - HotFix in BossBattles regarding wrong names for event handling
#
# 1.1.2 - Considered as 1.3.9
# - Force by config if pokemon_metrics.txt is checked by EBDX to set altitude or not.
#
# 1.1.1 - Considered as 1.3.8
# - Fixed hatch scene.
#
# 1.1.0 - Considered as 1.3.7
# - Added move animations. Included credits.
Expand Down

0 comments on commit f78c042

Please sign in to comment.