mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Fixed animations played by an event command being mispositioned, fixed Geomancy, removed $PokemonGlobal.playerID, tweaked player/bag object creation, overrode type effectiveness for Shadow moves, bug fixes
This commit is contained in:
@@ -142,10 +142,6 @@ class Pokemon
|
||||
$Trainer.pokedex.register(self)
|
||||
end
|
||||
|
||||
def setForm(value)
|
||||
self.form = value
|
||||
end
|
||||
|
||||
def form_simple=(value)
|
||||
@form = value
|
||||
calc_stats
|
||||
@@ -183,7 +179,6 @@ class Pokemon
|
||||
def egg?
|
||||
return @steps_to_hatch > 0
|
||||
end
|
||||
alias isEgg? egg?
|
||||
|
||||
# @return [GameData::GrowthRate] this Pokémon's growth rate
|
||||
def growth_rate
|
||||
@@ -232,13 +227,11 @@ class Pokemon
|
||||
def able?
|
||||
return !egg? && @hp > 0
|
||||
end
|
||||
alias isAble? able?
|
||||
|
||||
# @return [Boolean] whether the Pokémon is fainted
|
||||
def fainted?
|
||||
return !egg? && @hp <= 0
|
||||
end
|
||||
alias isFainted? fainted?
|
||||
|
||||
# Heals all HP of this Pokémon.
|
||||
def heal_HP
|
||||
@@ -339,15 +332,12 @@ class Pokemon
|
||||
|
||||
# @return [Boolean] whether this Pokémon is male
|
||||
def male?; return self.gender == 0; end
|
||||
alias isMale? male?
|
||||
|
||||
# @return [Boolean] whether this Pokémon is female
|
||||
def female?; return self.gender == 1; end
|
||||
alias isFemale? female?
|
||||
|
||||
# @return [Boolean] whether this Pokémon is genderless
|
||||
def genderless?; return self.gender == 2; end
|
||||
alias isGenderless? genderless?
|
||||
|
||||
# @return [Boolean] whether this Pokémon species is restricted to only ever being one
|
||||
# gender (or genderless)
|
||||
@@ -355,7 +345,6 @@ class Pokemon
|
||||
gender_ratio = species_data.gender_ratio
|
||||
return [:AlwaysMale, :AlwaysFemale, :Genderless].include?(gender_ratio)
|
||||
end
|
||||
alias isSingleGendered? singleGendered?
|
||||
|
||||
#=============================================================================
|
||||
# Shininess
|
||||
@@ -372,7 +361,6 @@ class Pokemon
|
||||
end
|
||||
return @shiny
|
||||
end
|
||||
alias isShiny? shiny?
|
||||
|
||||
#=============================================================================
|
||||
# Ability
|
||||
@@ -516,7 +504,8 @@ class Pokemon
|
||||
# an item at all
|
||||
def hasItem?(check_item = nil)
|
||||
return !@item.nil? if check_item.nil?
|
||||
return self.item == check_item
|
||||
held_item = self.item
|
||||
return held_item && held_item == check_item
|
||||
end
|
||||
|
||||
# @return [Array<Symbol>] the items this species can be found holding in the wild
|
||||
@@ -557,7 +546,6 @@ class Pokemon
|
||||
return false if !move_data
|
||||
return @moves.any? { |m| m.id == move_data.id }
|
||||
end
|
||||
alias knowsMove? hasMove?
|
||||
|
||||
# Returns the list of moves this Pokémon can learn by levelling up.
|
||||
# @return [Array<Array<Integer,Symbol>>] this Pokémon's move list, where every element is [level, move ID]
|
||||
@@ -786,7 +774,6 @@ class Pokemon
|
||||
def foreign?(trainer)
|
||||
return @owner.id != trainer.id || @owner.name != trainer.name
|
||||
end
|
||||
alias isForeign? foreign?
|
||||
|
||||
# @return [Time] the time when this Pokémon was obtained
|
||||
def timeReceived
|
||||
|
||||
@@ -63,12 +63,13 @@ class Pokemon
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Move objects known by Pokémon.
|
||||
# Legacy move object known by Pokémon.
|
||||
#===============================================================================
|
||||
# @deprecated Use {Pokemon#Move} instead. PBMove is slated to be removed in v20.
|
||||
class PBMove
|
||||
attr_reader :id, :pp, :ppup
|
||||
|
||||
def self.copy(move)
|
||||
def self.convert(move)
|
||||
ret = Pokemon::Move.new(move.id)
|
||||
ret.ppup = move.ppup
|
||||
ret.pp = move.pp
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
# These will be removed in a future Essentials version.
|
||||
#===============================================================================
|
||||
|
||||
# @deprecated Use {Pokemon} instead. PokeBattle_Pokemon is slated to be removed
|
||||
# in v20.
|
||||
# @deprecated Use {Pokemon} instead. PokeBattle_Pokemon is slated to be removed in v20.
|
||||
class PokeBattle_Pokemon
|
||||
attr_reader :name, :species, :form, :formTime, :forcedForm, :fused
|
||||
attr_reader :personalID, :exp, :hp, :status, :statusCount
|
||||
@@ -42,7 +41,7 @@ class PokeBattle_Pokemon
|
||||
ret.nature_for_stats = pkmn.natureOverride
|
||||
ret.item = pkmn.item
|
||||
ret.mail = PokemonMail.convert(pkmn.mail) if pkmn.mail
|
||||
pkmn.moves.each { |m| ret.moves.push(PBMove.copy(m)) if m && m.id > 0 }
|
||||
pkmn.moves.each { |m| ret.moves.push(PBMove.convert(m)) if m && m.id > 0 }
|
||||
if pkmn.firstmoves
|
||||
pkmn.firstmoves.each { |m| ret.add_first_move(m) }
|
||||
end
|
||||
@@ -168,12 +167,21 @@ class Pokemon
|
||||
self.shiny = false
|
||||
end
|
||||
|
||||
deprecated_method_alias :isEgg?, :egg?, removal_in: 'v20'
|
||||
deprecated_method_alias :isAble?, :able?, removal_in: 'v20'
|
||||
deprecated_method_alias :isFainted?, :fainted?, removal_in: 'v20'
|
||||
deprecated_method_alias :isShiny?, :shiny?, removal_in: 'v20'
|
||||
deprecated_method_alias :setForm, :form=, removal_in: 'v20'
|
||||
deprecated_method_alias :setGender, :gender=, removal_in: 'v20'
|
||||
deprecated_method_alias :isMale?, :male?, removal_in: 'v20'
|
||||
deprecated_method_alias :isFemale?, :female?, removal_in: 'v20'
|
||||
deprecated_method_alias :isGenderless?, :genderless?, removal_in: 'v20'
|
||||
deprecated_method_alias :isSingleGendered?, :singleGendered?, removal_in: 'v20'
|
||||
deprecated_method_alias :setAbility, :ability_index=, removal_in: 'v20'
|
||||
deprecated_method_alias :setNature, :nature=, removal_in: 'v20'
|
||||
deprecated_method_alias :setItem, :item=, removal_in: 'v20'
|
||||
|
||||
deprecated_method_alias :healStatus, :heal_status, removal_in: 'v20'
|
||||
deprecated_method_alias :knowsMove?, :hasMove?, removal_in: 'v20'
|
||||
deprecated_method_alias :resetMoves, :reset_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :pbLearnMove, :learn_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbDeleteMove, :forget_move, removal_in: 'v20'
|
||||
@@ -183,6 +191,7 @@ class Pokemon
|
||||
deprecated_method_alias :pbRemoveFirstMove, :remove_first_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbClearFirstMoves, :clear_first_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :pbUpdateShadowMoves, :update_shadow_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :isForeign?, :foreign?, removal_in: 'v20'
|
||||
deprecated_method_alias :calcStats, :calc_stats, removal_in: 'v20'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user