mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed Toxic damage only going up to 15/16 of total HP, minor code fixes
This commit is contained in:
@@ -352,7 +352,7 @@ class Battle
|
|||||||
next if b.status != :POISON
|
next if b.status != :POISON
|
||||||
if b.statusCount>0
|
if b.statusCount>0
|
||||||
b.effects[PBEffects::Toxic] += 1
|
b.effects[PBEffects::Toxic] += 1
|
||||||
b.effects[PBEffects::Toxic] = 15 if b.effects[PBEffects::Toxic]>15
|
b.effects[PBEffects::Toxic] = 16 if b.effects[PBEffects::Toxic]>16
|
||||||
end
|
end
|
||||||
if b.hasActiveAbility?(:POISONHEAL)
|
if b.hasActiveAbility?(:POISONHEAL)
|
||||||
if b.canHeal?
|
if b.canHeal?
|
||||||
@@ -622,7 +622,7 @@ class Battle
|
|||||||
b.effects[PBEffects::CounterTarget] = -1
|
b.effects[PBEffects::CounterTarget] = -1
|
||||||
b.effects[PBEffects::Electrify] = false
|
b.effects[PBEffects::Electrify] = false
|
||||||
b.effects[PBEffects::Endure] = false
|
b.effects[PBEffects::Endure] = false
|
||||||
b.effects[PBEffects::FirstPledge] = 0
|
b.effects[PBEffects::FirstPledge] = nil
|
||||||
b.effects[PBEffects::Flinch] = false
|
b.effects[PBEffects::Flinch] = false
|
||||||
b.effects[PBEffects::FocusPunch] = false
|
b.effects[PBEffects::FocusPunch] = false
|
||||||
b.effects[PBEffects::FollowMe] = 0
|
b.effects[PBEffects::FollowMe] = 0
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class Battle::Battler
|
|||||||
attr_accessor :item_id
|
attr_accessor :item_id
|
||||||
attr_accessor :moves
|
attr_accessor :moves
|
||||||
attr_accessor :gender
|
attr_accessor :gender
|
||||||
attr_accessor :iv
|
|
||||||
attr_accessor :attack
|
attr_accessor :attack
|
||||||
attr_accessor :spatk
|
attr_accessor :spatk
|
||||||
attr_accessor :speed
|
attr_accessor :speed
|
||||||
@@ -109,7 +108,7 @@ class Battle::Battler
|
|||||||
|
|
||||||
def status=(value)
|
def status=(value)
|
||||||
@effects[PBEffects::Truant] = false if @status == :SLEEP && value != :SLEEP
|
@effects[PBEffects::Truant] = false if @status == :SLEEP && value != :SLEEP
|
||||||
@effects[PBEffects::Toxic] = 0 if value != :POISON
|
@effects[PBEffects::Toxic] = 0 if value != :POISON || self.statusCount == 0
|
||||||
@status = value
|
@status = value
|
||||||
@pokemon.status = value if @pokemon
|
@pokemon.status = value if @pokemon
|
||||||
self.statusCount = 0 if value != :POISON && value != :SLEEP
|
self.statusCount = 0 if value != :POISON && value != :SLEEP
|
||||||
@@ -129,7 +128,8 @@ class Battle::Battler
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
def happiness; return @pokemon ? @pokemon.happiness : 0; end
|
def happiness; return @pokemon ? @pokemon.happiness : 0; end
|
||||||
def affection_level; return @pokemon ? @pokemon.affection_level : 2; end
|
def affection_level; return @pokemon ? @pokemon.affection_level : 2; end
|
||||||
def nature; return @pokemon ? @pokemon.nature : 0; end
|
def gender; return @pokemon ? @pokemon.gender : 0; end
|
||||||
|
def nature; return @pokemon ? @pokemon.nature : nil; end
|
||||||
def pokerusStage; return @pokemon ? @pokemon.pokerusStage : 0; end
|
def pokerusStage; return @pokemon ? @pokemon.pokerusStage : 0; end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -300,10 +300,9 @@ class Battle::Battler
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Returns the active types of this Pokémon. The array should not include the
|
# Returns the active types of this Pokémon. The array should not include the
|
||||||
# same type more than once, and should not include any invalid type numbers
|
# same type more than once, and should not include any invalid types.
|
||||||
# (e.g. -1).
|
|
||||||
def pbTypes(withType3=false)
|
def pbTypes(withType3=false)
|
||||||
ret = @types.clone
|
ret = @types.uniq
|
||||||
# Burn Up erases the Fire-type.
|
# Burn Up erases the Fire-type.
|
||||||
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
|
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
|
||||||
# Roost erases the Flying-type. If there are no types left, adds the Normal-
|
# Roost erases the Flying-type. If there are no types left, adds the Normal-
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class Battle::Battler
|
|||||||
@types = []
|
@types = []
|
||||||
@ability_id = nil
|
@ability_id = nil
|
||||||
@item_id = nil
|
@item_id = nil
|
||||||
@gender = 0
|
|
||||||
@attack = @defense = @spatk = @spdef = @speed = 0
|
@attack = @defense = @spatk = @spdef = @speed = 0
|
||||||
@status = :NONE
|
@status = :NONE
|
||||||
@statusCount = 0
|
@statusCount = 0
|
||||||
@@ -31,8 +30,6 @@ class Battle::Battler
|
|||||||
@pokemonIndex = -1
|
@pokemonIndex = -1
|
||||||
@participants = []
|
@participants = []
|
||||||
@moves = []
|
@moves = []
|
||||||
@iv = {}
|
|
||||||
GameData::Stat.each_main { |s| @iv[s.id] = 0 }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Used by Future Sight only, when Future Sight's user is no longer in battle.
|
# Used by Future Sight only, when Future Sight's user is no longer in battle.
|
||||||
@@ -46,7 +43,6 @@ class Battle::Battler
|
|||||||
@totalhp = pkmn.totalhp
|
@totalhp = pkmn.totalhp
|
||||||
@types = pkmn.types
|
@types = pkmn.types
|
||||||
# ability and item intentionally not copied across here
|
# ability and item intentionally not copied across here
|
||||||
@gender = pkmn.gender
|
|
||||||
@attack = pkmn.attack
|
@attack = pkmn.attack
|
||||||
@defense = pkmn.defense
|
@defense = pkmn.defense
|
||||||
@spatk = pkmn.spatk
|
@spatk = pkmn.spatk
|
||||||
@@ -58,8 +54,6 @@ class Battle::Battler
|
|||||||
@pokemonIndex = idxParty
|
@pokemonIndex = idxParty
|
||||||
@participants = []
|
@participants = []
|
||||||
# moves intentionally not copied across here
|
# moves intentionally not copied across here
|
||||||
@iv = {}
|
|
||||||
GameData::Stat.each_main { |s| @iv[s.id] = pkmn.iv[s.id] }
|
|
||||||
@dummy = true
|
@dummy = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -80,7 +74,6 @@ class Battle::Battler
|
|||||||
@types = pkmn.types
|
@types = pkmn.types
|
||||||
@ability_id = pkmn.ability_id
|
@ability_id = pkmn.ability_id
|
||||||
@item_id = pkmn.item_id
|
@item_id = pkmn.item_id
|
||||||
@gender = pkmn.gender
|
|
||||||
@attack = pkmn.attack
|
@attack = pkmn.attack
|
||||||
@defense = pkmn.defense
|
@defense = pkmn.defense
|
||||||
@spatk = pkmn.spatk
|
@spatk = pkmn.spatk
|
||||||
@@ -95,8 +88,6 @@ class Battle::Battler
|
|||||||
pkmn.moves.each_with_index do |m,i|
|
pkmn.moves.each_with_index do |m,i|
|
||||||
@moves[i] = Battle::Move.from_pokemon_move(@battle,m)
|
@moves[i] = Battle::Move.from_pokemon_move(@battle,m)
|
||||||
end
|
end
|
||||||
@iv = {}
|
|
||||||
GameData::Stat.each_main { |s| @iv[s.id] = pkmn.iv[s.id] }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbInitEffects(batonPass)
|
def pbInitEffects(batonPass)
|
||||||
@@ -186,7 +177,7 @@ class Battle::Battler
|
|||||||
@effects[PBEffects::Encore] = 0
|
@effects[PBEffects::Encore] = 0
|
||||||
@effects[PBEffects::EncoreMove] = nil
|
@effects[PBEffects::EncoreMove] = nil
|
||||||
@effects[PBEffects::Endure] = false
|
@effects[PBEffects::Endure] = false
|
||||||
@effects[PBEffects::FirstPledge] = 0
|
@effects[PBEffects::FirstPledge] = nil
|
||||||
@effects[PBEffects::FlashFire] = false
|
@effects[PBEffects::FlashFire] = false
|
||||||
@effects[PBEffects::Flinch] = false
|
@effects[PBEffects::Flinch] = false
|
||||||
@effects[PBEffects::FocusPunch] = false
|
@effects[PBEffects::FocusPunch] = false
|
||||||
@@ -275,7 +266,7 @@ class Battle::Battler
|
|||||||
@effects[PBEffects::Torment] = false
|
@effects[PBEffects::Torment] = false
|
||||||
@effects[PBEffects::Toxic] = 0
|
@effects[PBEffects::Toxic] = 0
|
||||||
@effects[PBEffects::Transform] = false
|
@effects[PBEffects::Transform] = false
|
||||||
@effects[PBEffects::TransformSpecies] = 0
|
@effects[PBEffects::TransformSpecies] = nil
|
||||||
@effects[PBEffects::Trapping] = 0
|
@effects[PBEffects::Trapping] = 0
|
||||||
@effects[PBEffects::TrappingMove] = nil
|
@effects[PBEffects::TrappingMove] = nil
|
||||||
@effects[PBEffects::TrappingUser] = -1
|
@effects[PBEffects::TrappingUser] = -1
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ class Battle::Move::PledgeMove < Battle::Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
user.effects[PBEffects::FirstPledge] = 0
|
user.effects[PBEffects::FirstPledge] = nil
|
||||||
return if !@pledgeSetup
|
return if !@pledgeSetup
|
||||||
@battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...",
|
@battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...",
|
||||||
user.pbThis,@pledgeOtherUser.pbThis(true)))
|
user.pbThis,@pledgeOtherUser.pbThis(true)))
|
||||||
|
|||||||
@@ -380,8 +380,7 @@ class Battle::Move::TrapUserAndTargetInBattle < Battle::Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# No Pokémon can switch out or flee until the end of the next round, as long as
|
# No Pokémon can switch out or flee until the end of the next round. (Fairy Lock)
|
||||||
# the user remains active. (Fairy Lock)
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle::Move::TrapAllBattlersInBattleForOneTurn < Battle::Move
|
class Battle::Move::TrapAllBattlersInBattleForOneTurn < Battle::Move
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
|
|||||||
Reference in New Issue
Block a user