mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Revamped classes Pokemon, PBMove and PokemonMail
This commit is contained in:
@@ -47,8 +47,8 @@ class PokeBattle_Move
|
||||
# This is the code actually used to generate a PokeBattle_Move object. The
|
||||
# object generated is a subclass of this one which depends on the move's
|
||||
# function code (found in the script section PokeBattle_MoveEffect).
|
||||
def PokeBattle_Move.pbFromPBMove(battle, move)
|
||||
validate move => PBMove
|
||||
def PokeBattle_Move.from_pokemon_move(battle, move)
|
||||
validate move => Pokemon::Move
|
||||
moveFunction = move.function_code || "000"
|
||||
className = sprintf("PokeBattle_Move_%s", moveFunction)
|
||||
if Object.const_defined?(className)
|
||||
|
||||
@@ -1720,8 +1720,8 @@ class PokeBattle_Move_05C < PokeBattle_Move
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
user.eachMoveWithIndex do |m,i|
|
||||
next if m.id!=@id
|
||||
newMove = PBMove.new(target.lastRegularMoveUsed)
|
||||
user.moves[i] = PokeBattle_Move.pbFromPBMove(@battle,newMove)
|
||||
newMove = Pokemon::Move.new(target.lastRegularMoveUsed)
|
||||
user.moves[i] = PokeBattle_Move.from_pokemon_move(@battle,newMove)
|
||||
@battle.pbDisplay(_INTL("{1} learned {2}!",user.pbThis,newMove.name))
|
||||
user.pbCheckFormOnMovesetChange
|
||||
break
|
||||
@@ -1770,9 +1770,9 @@ class PokeBattle_Move_05D < PokeBattle_Move
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
user.eachMoveWithIndex do |m,i|
|
||||
next if m.id!=@id
|
||||
newMove = PBMove.new(target.lastRegularMoveUsed)
|
||||
newMove = Pokemon::Move.new(target.lastRegularMoveUsed)
|
||||
user.pokemon.moves[i] = newMove
|
||||
user.moves[i] = PokeBattle_Move.pbFromPBMove(@battle,newMove)
|
||||
user.moves[i] = PokeBattle_Move.from_pokemon_move(@battle,newMove)
|
||||
@battle.pbDisplay(_INTL("{1} learned {2}!",user.pbThis,newMove.name))
|
||||
user.pbCheckFormOnMovesetChange
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user