Merged species Type1/Type2 into Types, did the same for Pokemon and Battler

This commit is contained in:
Maruno17
2021-11-22 23:55:28 +00:00
parent a5f91f62ea
commit 00c2df5772
33 changed files with 3756 additions and 5552 deletions

View File

@@ -6,8 +6,7 @@ class Battle::Battler
attr_reader :pokemon
attr_accessor :pokemonIndex
attr_accessor :species
attr_accessor :type1
attr_accessor :type2
attr_accessor :types
attr_accessor :ability_id
attr_accessor :item_id
attr_accessor :moves
@@ -304,8 +303,7 @@ class Battle::Battler
# same type more than once, and should not include any invalid type numbers
# (e.g. -1).
def pbTypes(withType3=false)
ret = [@type1]
ret.push(@type2) if @type2!=@type1
ret = @types.clone
# Burn Up erases the Fire-type.
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
# Roost erases the Flying-type. If there are no types left, adds the Normal-

View File

@@ -20,7 +20,7 @@ class Battle::Battler
@form = 0
@level = 0
@hp = @totalhp = 0
@type1 = @type2 = nil
@types = []
@ability_id = nil
@item_id = nil
@gender = 0
@@ -44,8 +44,7 @@ class Battle::Battler
@level = pkmn.level
@hp = pkmn.hp
@totalhp = pkmn.totalhp
@type1 = pkmn.type1
@type2 = pkmn.type2
@types = pkmn.types
# ability and item intentionally not copied across here
@gender = pkmn.gender
@attack = pkmn.attack
@@ -78,8 +77,7 @@ class Battle::Battler
@level = pkmn.level
@hp = pkmn.hp
@totalhp = pkmn.totalhp
@type1 = pkmn.type1
@type2 = pkmn.type2
@types = pkmn.types
@ability_id = pkmn.ability_id
@item_id = pkmn.item_id
@gender = pkmn.gender
@@ -312,8 +310,7 @@ class Battle::Battler
@spdef = @pokemon.spdef
@speed = @pokemon.speed
if fullChange
@type1 = @pokemon.type1
@type2 = @pokemon.type2
@types = @pokemon.types
@ability_id = @pokemon.ability_id
end
end

View File

@@ -127,13 +127,11 @@ class Battle::Battler
newTypes.push(:NORMAL) if newTypes.length == 0
newType3 = newType.effects[PBEffects::Type3]
newType3 = nil if newTypes.include?(newType3)
@type1 = newTypes[0]
@type2 = (newTypes.length == 1) ? newTypes[0] : newTypes[1]
@types = newTypes.clone
@effects[PBEffects::Type3] = newType3
else
newType = GameData::Type.get(newType).id
@type1 = newType
@type2 = newType
@types = [newType]
@effects[PBEffects::Type3] = nil
end
@effects[PBEffects::BurnUp] = false
@@ -141,8 +139,7 @@ class Battle::Battler
end
def pbResetTypes
@type1 = @pokemon.type1
@type2 = @pokemon.type2
@types = @pokemon.types
@effects[PBEffects::Type3] = nil
@effects[PBEffects::BurnUp] = false
@effects[PBEffects::Roost] = false