Added generic item icon support for HMs/TRs, moves taught by TR are now relearnable, tweaked determination of valid Mega forms

This commit is contained in:
Maruno17
2021-04-22 21:08:34 +01:00
parent 70b9f65558
commit 4ae84f9b5d
8 changed files with 83 additions and 73 deletions

View File

@@ -6,7 +6,7 @@ class Pokemon
def getMegaForm(checkItemOnly = false)
ret = 0
GameData::Species.each do |data|
next if data.species != @species
next if data.species != @species || data.unmega_form != form_simple
if data.mega_stone && hasItem?(data.mega_stone)
ret = data.form
break
@@ -31,7 +31,6 @@ class Pokemon
megaForm = self.getMegaForm
return megaForm > 0 && megaForm == form_simple
end
alias isMega? mega?
def makeMega
megaForm = self.getMegaForm
@@ -57,24 +56,23 @@ class Pokemon
# NOTE: These are treated as form changes in Essentials.
#=============================================================================
def hasPrimalForm?
v = MultipleForms.call("getPrimalForm",self)
return v!=nil
v = MultipleForms.call("getPrimalForm", self)
return !v.nil?
end
def primal?
v = MultipleForms.call("getPrimalForm",self)
return v!=nil && v==@form
v = MultipleForms.call("getPrimalForm", self)
return !v.nil? && v == @form
end
alias isPrimal? primal?
def makePrimal
v = MultipleForms.call("getPrimalForm",self)
self.form = v if v!=nil
v = MultipleForms.call("getPrimalForm", self)
self.form = v if !v.nil?
end
def makeUnprimal
v = MultipleForms.call("getUnprimalForm",self)
if v!=nil; self.form = v
v = MultipleForms.call("getUnprimalForm", self)
if !v.nil?; self.form = v
elsif primal?; self.form = 0
end
end

View File

@@ -193,6 +193,8 @@ class Pokemon
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'
deprecated_method_alias :isMega?, :mega?, removal_in: 'v20'
deprecated_method_alias :isPrimal?, :primal?, removal_in: 'v20'
end
# (see Pokemon#initialize)