ruins of alph hidden chamber fix

This commit is contained in:
infinitefusion
2022-03-05 14:25:18 -05:00
parent 1aba4df441
commit ecb79c6336
12 changed files with 75 additions and 6 deletions

View File

@@ -243,20 +243,20 @@ end
#===============================================================================
class PokeBattle_Move_090 < PokeBattle_Move
def pbBaseType(user)
hp = pbHiddenPower(user)
hp = pbHiddenPower(user,user.hiddenPowerType)
return hp[0]
end
def pbBaseDamage(baseDmg,user,target)
return super if Settings::MECHANICS_GENERATION >= 6
hp = pbHiddenPower(user)
hp = pbHiddenPower(user,user.hiddenPowerType)
return hp[1]
end
end
def pbHiddenPower(pkmn)
def pbHiddenPower(pkmn,forcedType=nil)
# NOTE: This allows Hidden Power to be Fairy-type (if you have that type in
# your game). I don't care that the official games don't work like that.
iv = pkmn.iv
@@ -283,6 +283,9 @@ def pbHiddenPower(pkmn)
power |= (iv[:SPECIAL_DEFENSE]&2)<<4
power = powerMin+(powerMax-powerMin)*power/63
end
if forcedType != nil
return [forcedType,power]
end
return [type,power]
end

View File

@@ -86,6 +86,8 @@ class Pokemon
# @return [Integer] this Pokémon's personal ID
attr_accessor :personalID
attr_accessor :hiddenPowerType
# Max total IVs
IV_STAT_LIMIT = 31
# Max total EVs
@@ -118,6 +120,9 @@ class Pokemon
#=============================================================================
# Species and form
#=============================================================================
def hiddenPower=(type)
@hiddenPowerType = type
end
# Changes the Pokémon's species and re-calculates its statistics.
# @param species_id [Integer] id of the species to change this Pokémon to
@@ -1150,6 +1155,8 @@ class Pokemon
@iv = {}
@ivMaxed = {}
@ev = {}
@hiddenPowerType = nil
GameData::Stat.each_main do |s|
@iv[s.id] = rand(IV_STAT_LIMIT + 1)
@ev[s.id] = 0

View File

@@ -432,7 +432,7 @@ def pbMoveTutorAnnotations(move, movelist = nil)
return ret
end
def pbMoveTutorChoose(move,movelist=nil,bymachine=false,oneusemachine=false)
def pbMoveTutorChoose(move,movelist=nil,bymachine=false,oneusemachine=false,selectedPokemonVariable=nil)
ret = false
move = GameData::Move.get(move).id
if movelist!=nil && movelist.is_a?(Array)
@@ -450,6 +450,9 @@ def pbMoveTutorChoose(move,movelist=nil,bymachine=false,oneusemachine=false)
chosen = screen.pbChoosePokemon
break if chosen<0
pokemon = $Trainer.party[chosen]
if selectedPokemonVariable != nil
pbSet(selectedPokemonVariable,pokemon)
end
if pokemon.egg?
pbMessage(_INTL("Eggs can't be taught any moves.")) { screen.pbUpdate }
elsif pokemon.shadowPokemon?

View File

@@ -376,4 +376,60 @@ def Kernel.getRoamingMap(roamingArrayPos)
mapinfos=$RPGVX ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
text= mapinfos[curmap].name#,(curmap==$game_map.map_id) ? _INTL("(this map)") : "")
return text
end
def Kernel.listPlatesInBag()
list = []
list << PBItems::FISTPLATE if $PokemonBag.pbQuantity(:FISTPLATE)>=1
list << PBItems::SKYPLATE if $PokemonBag.pbQuantity(:SKYPLATE)>=1
list << PBItems::TOXICPLATE if $PokemonBag.pbQuantity(:TOXICPLATE)>=1
list << PBItems::EARTHPLATE if $PokemonBag.pbQuantity(:EARTHPLATE)>=1
list << PBItems::STONEPLATE if $PokemonBag.pbQuantity(:STONEPLATE)>=1
list << PBItems::INSECTPLATE if $PokemonBag.pbQuantity(:INSECTPLATE)>=1
list << PBItems::SPOOKYPLATE if $PokemonBag.pbQuantity(:SPOOKYPLATE)>=1
list << PBItems::IRONPLATE if $PokemonBag.pbQuantity(:IRONPLATE)>=1
list << PBItems::FLAMEPLATE if $PokemonBag.pbQuantity(:FLAMEPLATE)>=1
list << PBItems::SPLASHPLATE if $PokemonBag.pbQuantity(:SPLASHPLATE)>=1
list << PBItems::MEADOWPLATE if $PokemonBag.pbQuantity(:MEADOWPLATE)>=1
list << PBItems::ZAPPLATE if $PokemonBag.pbQuantity(:ZAPPLATE)>=1
list << PBItems::MINDPLATE if $PokemonBag.pbQuantity(:MINDPLATE)>=1
list << PBItems::ICICLEPLATE if $PokemonBag.pbQuantity(:ICICLEPLATE)>=1
list << PBItems::DRACOPLATE if $PokemonBag.pbQuantity(:DRACOPLATE)>=1
list << PBItems::DREADPLATE if $PokemonBag.pbQuantity(:DREADPLATE)>=1
list << PBItems::PIXIEPLATE if $PokemonBag.pbQuantity(:PIXIEPLATE)>=1
return list
end
def Kernel.getItemNamesAsString(list)
strList = ""
for i in 0..list.length-1
id = list[i]
name =PBItems.getName(id)
strList += name
if i != list.length-1 && list.length > 1
strList += ","
end
end
return strList
end
def Kernel.getPlateType(item)
return :FIGHTING if item == PBItems::FISTPLATE
return :FLYING if item == PBItems::SKYPLATE
return :POISON if item == PBItems::TOXICPLATE
return :GROUND if item == PBItems::EARTHPLATE
return :ROCK if item == PBItems::STONEPLATE
return :BUG if item == PBItems::INSECTPLATE
return :GHOST if item == PBItems::SPOOKYPLATE
return :STEEL if item == PBItems::IRONPLATE
return :FIRE if item == PBItems::FLAMEPLATE
return :WATER if item == PBItems::SPLASHPLATE
return :GRASS if item == PBItems::MEADOWPLATE
return :ELECTRIC if item == PBItems::ZAPPLATE
return :PSYCHIC if item == PBItems::MINDPLATE
return :ICE if item == PBItems::ICICLEPLATE
return :DRAGON if item == PBItems::DRACOPLATE
return :DARK if item == PBItems::DREADPLATE
return :FAIRY if item == PBItems::PIXIEPLATE
return -1
end