mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added checks that prevent aliasing a method if the alias method already exists, fixed Symbiosis not working properly for opponents
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# class Object
|
# class Object
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Object
|
class Object
|
||||||
alias full_inspect inspect
|
alias full_inspect inspect unless method_defined?(:full_inspect)
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
return "#<#{self.class}>"
|
return "#<#{self.class}>"
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Spriteset_Map
|
class Spriteset_Map
|
||||||
alias _animationSprite_initialize initialize
|
alias _animationSprite_initialize initialize unless method_defined?(:_animationSprite_initialize)
|
||||||
alias _animationSprite_update update
|
alias _animationSprite_update update unless method_defined?(:_animationSprite_update)
|
||||||
alias _animationSprite_dispose dispose
|
alias _animationSprite_dispose dispose unless method_defined?(:_animationSprite_dispose)
|
||||||
|
|
||||||
def initialize(map = nil)
|
def initialize(map = nil)
|
||||||
@usersprites = []
|
@usersprites = []
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ end
|
|||||||
# ? CLASS Sprite_Character edit
|
# ? CLASS Sprite_Character edit
|
||||||
#===================================================
|
#===================================================
|
||||||
class Sprite_Character < RPG::Sprite
|
class Sprite_Character < RPG::Sprite
|
||||||
alias shadow_initialize initialize
|
alias shadow_initialize initialize unless method_defined?(:shadow_initialize)
|
||||||
|
|
||||||
def initialize(viewport, character = nil)
|
def initialize(viewport, character = nil)
|
||||||
@ombrelist = []
|
@ombrelist = []
|
||||||
@@ -153,7 +153,7 @@ class Sprite_Character < RPG::Sprite
|
|||||||
@ombrelist.clear
|
@ombrelist.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
alias shadow_update update
|
alias shadow_update update unless method_defined?(:shadow_update)
|
||||||
|
|
||||||
def update
|
def update
|
||||||
shadow_update
|
shadow_update
|
||||||
@@ -178,7 +178,8 @@ end
|
|||||||
class Spriteset_Map
|
class Spriteset_Map
|
||||||
attr_accessor :shadows
|
attr_accessor :shadows
|
||||||
|
|
||||||
alias shadow_initialize initialize
|
alias shadow_initialize initialize unless method_defined?(:shadow_initialize)
|
||||||
|
|
||||||
def initialize(map = nil)
|
def initialize(map = nil)
|
||||||
@shadows = []
|
@shadows = []
|
||||||
warn = false
|
warn = false
|
||||||
|
|||||||
@@ -566,7 +566,8 @@ end
|
|||||||
class Game_Event < Game_Character
|
class Game_Event < Game_Character
|
||||||
attr_accessor :pe_refresh
|
attr_accessor :pe_refresh
|
||||||
|
|
||||||
alias nf_particles_game_map_initialize initialize
|
alias nf_particles_game_map_initialize initialize unless method_defined?(:nf_particles_game_map_initialize)
|
||||||
|
|
||||||
def initialize(map_id, event, map = nil)
|
def initialize(map_id, event, map = nil)
|
||||||
@pe_refresh = false
|
@pe_refresh = false
|
||||||
begin
|
begin
|
||||||
@@ -576,7 +577,8 @@ class Game_Event < Game_Character
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias nf_particles_game_map_refresh refresh
|
alias nf_particles_game_map_refresh refresh unless method_defined?(:nf_particles_game_map_refresh)
|
||||||
|
|
||||||
def refresh
|
def refresh
|
||||||
nf_particles_game_map_refresh
|
nf_particles_game_map_refresh
|
||||||
@pe_refresh = true
|
@pe_refresh = true
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ class Battle::Battler
|
|||||||
return if fainted?
|
return if fainted?
|
||||||
return if self.item
|
return if self.item
|
||||||
@battle.pbPriority(true).each do |b|
|
@battle.pbPriority(true).each do |b|
|
||||||
next if b.opposes?
|
next if b.opposes?(self)
|
||||||
next if !b.hasActiveAbility?(:SYMBIOSIS)
|
next if !b.hasActiveAbility?(:SYMBIOSIS)
|
||||||
next if !b.item || b.unlosableItem?(b.item)
|
next if !b.item || b.unlosableItem?(b.item)
|
||||||
next if unlosableItem?(b.item)
|
next if unlosableItem?(b.item)
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::RaiseUserEvasion1 # Double Team
|
class Battle::Move::RaiseUserEvasion1 # Double Team
|
||||||
alias __clauses__pbMoveFailed? pbMoveFailed?
|
unless method_defined?(:__clauses__pbMoveFailed?)
|
||||||
|
alias __clauses__pbMoveFailed? pbMoveFailed?
|
||||||
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user, targets)
|
def pbMoveFailed?(user, targets)
|
||||||
if !damagingMove? && @battle.rules["evasionclause"]
|
if !damagingMove? && @battle.rules["evasionclause"]
|
||||||
@@ -117,7 +119,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
|
class Battle::Move::RaiseUserEvasion2MinimizeUser # Minimize
|
||||||
alias __clauses__pbMoveFailed? pbMoveFailed?
|
unless method_defined?(:__clauses__pbMoveFailed?)
|
||||||
|
alias __clauses__pbMoveFailed? pbMoveFailed?
|
||||||
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user, targets)
|
def pbMoveFailed?(user, targets)
|
||||||
if !damagingMove? && @battle.rules["evasionclause"]
|
if !damagingMove? && @battle.rules["evasionclause"]
|
||||||
@@ -131,7 +135,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::UserTargetSwapAbilities # Skill Swap
|
class Battle::Move::UserTargetSwapAbilities # Skill Swap
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["skillswapclause"]
|
if @battle.rules["skillswapclause"]
|
||||||
@@ -145,7 +151,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::FixedDamage20 # Sonic Boom
|
class Battle::Move::FixedDamage20 # Sonic Boom
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["sonicboomclause"]
|
if @battle.rules["sonicboomclause"]
|
||||||
@@ -159,7 +167,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::FixedDamage40 # Dragon Rage
|
class Battle::Move::FixedDamage40 # Dragon Rage
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["sonicboomclause"]
|
if @battle.rules["sonicboomclause"]
|
||||||
@@ -173,7 +183,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::OHKO
|
class Battle::Move::OHKO
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["ohkoclause"]
|
if @battle.rules["ohkoclause"]
|
||||||
@@ -187,7 +199,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::OHKOIce
|
class Battle::Move::OHKOIce
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["ohkoclause"]
|
if @battle.rules["ohkoclause"]
|
||||||
@@ -201,7 +215,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::OHKOHitsUndergroundTarget
|
class Battle::Move::OHKOHitsUndergroundTarget
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["ohkoclause"]
|
if @battle.rules["ohkoclause"]
|
||||||
@@ -215,9 +231,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::UserFaintsExplosive # Self-Destruct
|
class Battle::Move::UserFaintsExplosive # Self-Destruct
|
||||||
unless @__clauses__aliased
|
unless method_defined?(:__clauses__pbMoveFailed?)
|
||||||
alias __clauses__pbMoveFailed? pbMoveFailed?
|
alias __clauses__pbMoveFailed? pbMoveFailed?
|
||||||
@__clauses__aliased = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user, targets)
|
def pbMoveFailed?(user, targets)
|
||||||
@@ -247,7 +262,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
|
class Battle::Move::StartPerishCountsForAllBattlers # Perish Song
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["perishsongclause"] &&
|
if @battle.rules["perishsongclause"] &&
|
||||||
@@ -262,7 +279,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Move::AttackerFaintsIfUserFaints # Destiny Bond
|
class Battle::Move::AttackerFaintsIfUserFaints # Destiny Bond
|
||||||
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
unless method_defined?(:__clauses__pbFailsAgainstTarget?)
|
||||||
|
alias __clauses__pbFailsAgainstTarget? pbFailsAgainstTarget?
|
||||||
|
end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if @battle.rules["perishsongclause"] &&
|
if @battle.rules["perishsongclause"] &&
|
||||||
|
|||||||
@@ -272,7 +272,8 @@ class Battle::Scene
|
|||||||
rockAnim.dispose
|
rockAnim.dispose
|
||||||
end
|
end
|
||||||
|
|
||||||
alias __safari__pbThrowSuccess pbThrowSuccess
|
alias __safari__pbThrowSuccess pbThrowSuccess unless method_defined?(:__safari__pbThrowSuccess)
|
||||||
|
|
||||||
def pbThrowSuccess
|
def pbThrowSuccess
|
||||||
__safari__pbThrowSuccess
|
__safari__pbThrowSuccess
|
||||||
pbWildBattleSuccess if @battle.is_a?(SafariBattle)
|
pbWildBattleSuccess if @battle.is_a?(SafariBattle)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Bug Catching Contest battle scene (the visuals of the battle)
|
# Bug Catching Contest battle scene (the visuals of the battle)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle::Scene
|
class Battle::Scene
|
||||||
alias _bugContest_pbInitSprites pbInitSprites
|
alias _bugContest_pbInitSprites pbInitSprites unless method_defined?(:_bugContest_pbInitSprites)
|
||||||
|
|
||||||
def pbInitSprites
|
def pbInitSprites
|
||||||
_bugContest_pbInitSprites
|
_bugContest_pbInitSprites
|
||||||
|
|||||||
@@ -172,14 +172,16 @@ end
|
|||||||
class Battle::AI
|
class Battle::AI
|
||||||
attr_accessor :battlePalace
|
attr_accessor :battlePalace
|
||||||
|
|
||||||
alias _battlePalace_initialize initialize
|
alias _battlePalace_initialize initialize unless method_defined?(:_battlePalace_initialize)
|
||||||
|
|
||||||
def initialize(*arg)
|
def initialize(*arg)
|
||||||
_battlePalace_initialize(*arg)
|
_battlePalace_initialize(*arg)
|
||||||
@justswitched = [false, false, false, false]
|
@justswitched = [false, false, false, false]
|
||||||
end
|
end
|
||||||
|
|
||||||
alias _battlePalace_pbEnemyShouldWithdraw? pbEnemyShouldWithdraw?
|
unless method_defined?(:_battlePalace_pbEnemyShouldWithdraw?)
|
||||||
|
alias _battlePalace_pbEnemyShouldWithdraw? pbEnemyShouldWithdraw?
|
||||||
|
end
|
||||||
|
|
||||||
def pbEnemyShouldWithdraw?(idxBattler)
|
def pbEnemyShouldWithdraw?(idxBattler)
|
||||||
return _battlePalace_pbEnemyShouldWithdraw?(idxBattler) if !@battlePalace
|
return _battlePalace_pbEnemyShouldWithdraw?(idxBattler) if !@battlePalace
|
||||||
|
|||||||
@@ -211,7 +211,9 @@ end
|
|||||||
class Battle::AI
|
class Battle::AI
|
||||||
attr_accessor :battleArena
|
attr_accessor :battleArena
|
||||||
|
|
||||||
alias _battleArena_pbEnemyShouldWithdraw? pbEnemyShouldWithdraw?
|
unless method_defined?(:_battleArena_pbEnemyShouldWithdraw?)
|
||||||
|
alias _battleArena_pbEnemyShouldWithdraw? pbEnemyShouldWithdraw?
|
||||||
|
end
|
||||||
|
|
||||||
def pbEnemyShouldWithdraw?(idxBattler)
|
def pbEnemyShouldWithdraw?(idxBattler)
|
||||||
return _battleArena_pbEnemyShouldWithdraw?(idxBattler) if !@battleArena
|
return _battleArena_pbEnemyShouldWithdraw?(idxBattler) if !@battleArena
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ end
|
|||||||
# Shadow Pokémon in battle.
|
# Shadow Pokémon in battle.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle
|
class Battle
|
||||||
alias __shadow__pbCanUseItemOnPokemon? pbCanUseItemOnPokemon?
|
unless method_defined?(:__shadow__pbCanUseItemOnPokemon?)
|
||||||
|
alias __shadow__pbCanUseItemOnPokemon? pbCanUseItemOnPokemon?
|
||||||
|
end
|
||||||
|
|
||||||
def pbCanUseItemOnPokemon?(item, pkmn, battler, scene, showMessages = true)
|
def pbCanUseItemOnPokemon?(item, pkmn, battler, scene, showMessages = true)
|
||||||
ret = __shadow__pbCanUseItemOnPokemon?(item, pkmn, battler, scene, showMessages)
|
ret = __shadow__pbCanUseItemOnPokemon?(item, pkmn, battler, scene, showMessages)
|
||||||
@@ -184,7 +186,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Battle::Battler
|
class Battle::Battler
|
||||||
alias __shadow__pbInitPokemon pbInitPokemon
|
alias __shadow__pbInitPokemon pbInitPokemon unless method_defined?(:__shadow__pbInitPokemon)
|
||||||
|
|
||||||
def pbInitPokemon(*arg)
|
def pbInitPokemon(*arg)
|
||||||
if self.pokemonIndex > 0 && inHyperMode?
|
if self.pokemonIndex > 0 && inHyperMode?
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Pokemon
|
|||||||
attr_accessor :shadow_moves
|
attr_accessor :shadow_moves
|
||||||
attr_accessor :heart_gauge_step_counter
|
attr_accessor :heart_gauge_step_counter
|
||||||
|
|
||||||
alias __shadow_expeq exp=
|
alias __shadow_expeq exp= unless method_defined?(:__shadow_expeq)
|
||||||
def exp=(value)
|
def exp=(value)
|
||||||
if shadowPokemon?
|
if shadowPokemon?
|
||||||
@saved_exp += value - @exp
|
@saved_exp += value - @exp
|
||||||
@@ -19,7 +19,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias __shadow_hpeq hp=
|
alias __shadow_hpeq hp= unless method_defined?(:__shadow_hpeq)
|
||||||
def hp=(value)
|
def hp=(value)
|
||||||
__shadow_hpeq(value)
|
__shadow_hpeq(value)
|
||||||
@hyper_mode = false if @hp <= 0
|
@hyper_mode = false if @hp <= 0
|
||||||
@@ -107,7 +107,7 @@ class Pokemon
|
|||||||
return (self.heart_gauge == 0 || @hp == 0) ? false : @hyper_mode
|
return (self.heart_gauge == 0 || @hp == 0) ? false : @hyper_mode
|
||||||
end
|
end
|
||||||
|
|
||||||
alias __shadow__changeHappiness changeHappiness
|
alias __shadow__changeHappiness changeHappiness unless method_defined?(:__shadow__changeHappiness)
|
||||||
def changeHappiness(method)
|
def changeHappiness(method)
|
||||||
return if shadowPokemon? && heartStage >= 4
|
return if shadowPokemon? && heartStage >= 4
|
||||||
__shadow__changeHappiness(method)
|
__shadow__changeHappiness(method)
|
||||||
@@ -212,7 +212,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias __shadow_clone clone
|
alias __shadow_clone clone unless method_defined?(:__shadow_clone)
|
||||||
def clone
|
def clone
|
||||||
ret = __shadow_clone
|
ret = __shadow_clone
|
||||||
if @saved_ev
|
if @saved_ev
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class Player < Trainer
|
|||||||
attr_accessor :has_snag_machine
|
attr_accessor :has_snag_machine
|
||||||
attr_accessor :seen_purify_chamber
|
attr_accessor :seen_purify_chamber
|
||||||
|
|
||||||
alias __shadowPkmn__initialize initialize
|
alias __shadowPkmn__initialize initialize unless method_defined?(:__shadowPkmn__initialize)
|
||||||
def initialize(name, trainer_type)
|
def initialize(name, trainer_type)
|
||||||
__shadowPkmn__initialize(name, trainer_type)
|
__shadowPkmn__initialize(name, trainer_type)
|
||||||
@has_snag_machine = false
|
@has_snag_machine = false
|
||||||
|
|||||||
Reference in New Issue
Block a user