From 12bbd2084bfb7f62582ec008928aa968b65d9ce5 Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Sun, 26 Dec 2021 14:03:38 -0500 Subject: [PATCH] multitype ABILITY --- Data/Scripts/014_Pokemon/001_Pokemon.rb | 10 +++ Data/Scripts/050_AddOns/GeneralUtils.rb | 106 ++++++++++++++++-------- Data/System.rxdata | Bin 27488 -> 27489 bytes 3 files changed, 82 insertions(+), 34 deletions(-) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index b5fa4a10b..84154dc73 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -312,11 +312,17 @@ class Pokemon # @return [Symbol] this Pokémon's first type def type1 + if @ability == :MULTITYPE && species_data.type1 == :NORMAL + return getHeldPlateType() + end return species_data.type1 end # @return [Symbol] this Pokémon's second type, or the first type if none is defined def type2 + if @ability == :MULTITYPE && species_data.type2 == :NORMAL + return getHeldPlateType() + end sp_data = species_data return sp_data.type2 || sp_data.type1 end @@ -336,6 +342,10 @@ class Pokemon return self.types.include?(type) end + def getHeldPlateType() + return getArceusPlateType(@item) + end + #============================================================================= # Gender #============================================================================= diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index 0eeedcefb..49f2fdd33 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -69,25 +69,24 @@ def CanLearnMove(pokemon, move) end def pbPokemonIconFile(pokemon) - bitmapFileName=pbCheckPokemonIconFiles(pokemon.species, pokemon.isEgg?) + bitmapFileName = pbCheckPokemonIconFiles(pokemon.species, pokemon.isEgg?) return bitmapFileName end -def pbCheckPokemonIconFiles(speciesNum,egg=false, dna=false) +def pbCheckPokemonIconFiles(speciesNum, egg = false, dna = false) if egg - bitmapFileName=sprintf("Graphics/Icons/iconEgg") + bitmapFileName = sprintf("Graphics/Icons/iconEgg") return pbResolveBitmap(bitmapFileName) else - bitmapFileName=sprintf("Graphics/Icons/icon%03d",speciesNum) - ret=pbResolveBitmap(bitmapFileName) + bitmapFileName = sprintf("Graphics/Icons/icon%03d", speciesNum) + ret = pbResolveBitmap(bitmapFileName) return ret if ret end - ret=pbResolveBitmap("Graphics/Icons/iconDNA.png") + ret = pbResolveBitmap("Graphics/Icons/iconDNA.png") return ret if ret return pbResolveBitmap("Graphics/Icons/iconDNA.png") end - def getDexNumberForSpecies(species) return species if species.is_a?(Integer) if species.is_a?(Symbol) @@ -109,29 +108,29 @@ def dexNum(species) return getDexNumberForSpecies(species) end -def getRandomCustomFusion(returnRandomPokemonIfNoneFound=true,customPokeList=[],maxPoke=-1,recursionLimit=3) - if customPokeList.length==0 +def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3) + if customPokeList.length == 0 customPokeList = getCustomSpeciesList() end randPoke = [] if customPokeList.length >= 5000 - chosen=false - i=0 #loop pas plus que 3 fois pour pas lag + chosen = false + i = 0 #loop pas plus que 3 fois pour pas lag while chosen == false - fusedPoke = customPokeList[rand(customPokeList.length)] - poke1 = getBasePokemonID(fusedPoke,false) - poke2 = getBasePokemonID(fusedPoke,true) + fusedPoke = customPokeList[rand(customPokeList.length)] + poke1 = getBasePokemonID(fusedPoke, false) + poke2 = getBasePokemonID(fusedPoke, true) if ((poke1 <= maxPoke && poke2 <= maxPoke) || i >= recursionLimit) || maxPoke == -1 - randPoke << getBasePokemonID(fusedPoke,false) - randPoke << getBasePokemonID(fusedPoke,true) + randPoke << getBasePokemonID(fusedPoke, false) + randPoke << getBasePokemonID(fusedPoke, true) chosen = true end end else if returnRandomPokemonIfNoneFound - randPoke << rand(maxPoke)+1 - randPoke << rand(maxPoke)+1 + randPoke << rand(maxPoke) + 1 + randPoke << rand(maxPoke) + 1 end end @@ -180,7 +179,7 @@ def getAllNonLegendaryPokemon() end def getPokemonEggGroups(species) - return GameData::Species.get(species).egg_groups + return GameData::Species.get(species).egg_groups end def generateEggGroupTeam(eggGroup) @@ -204,8 +203,6 @@ def obtainBadgeMessage(badgeName) Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!", $Trainer.name, badgeName)) end - - def getAllNonLegendaryPokemon() list = [] for i in 1..143 @@ -276,36 +273,35 @@ end def Kernel.setRocketPassword(variableNum) abilityIndex = rand(233) - speciesIndex =rand(PBSpecies.maxValue-1) + speciesIndex = rand(PBSpecies.maxValue - 1) word1 = PBSpecies.getName(speciesIndex) word2 = GameData::Ability.get(abilityIndex).name - password = _INTL("{1}'s {2}",word1,word2) - pbSet(variableNum,password) + password = _INTL("{1}'s {2}", word1, word2) + pbSet(variableNum, password) end - def getGenericPokemonCryText(pokemonSpecies) case pokemonSpecies when 25 return "Pika!" - when 16,17,18,21,22,144,145,146,227,417,418,372 #birds + when 16, 17, 18, 21, 22, 144, 145, 146, 227, 417, 418, 372 #birds return "Squawk!" - when 163,164 - return "Hoot!" #owl + when 163, 164 + return "Hoot!" #owl else return "Guaugh!" end end -def obtainPokemonSpritePath(id,includeCustoms=true) - head=getBasePokemonID(param.to_i,false) - body=getBasePokemonID(param.to_i,true) - return obtainPokemonSpritePath(body,head,includeCustoms) +def obtainPokemonSpritePath(id, includeCustoms = true) + head = getBasePokemonID(param.to_i, false) + body = getBasePokemonID(param.to_i, true) + return obtainPokemonSpritePath(body, head, includeCustoms) end -def obtainPokemonSpritePath(bodyId, headId,include_customs=true) - hasCustom=false +def obtainPokemonSpritePath(bodyId, headId, include_customs = true) + hasCustom = false picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId) if include_customs @@ -318,5 +314,47 @@ def obtainPokemonSpritePath(bodyId, headId,include_customs=true) return picturePath end +def getArceusPlateType(heldItem) + return :NORMAL if heldItem == nil + case heldItem + when :FISTPLATE + return :FIGHTING + when :SKYPLATE + return :FLYING + when :TOXICPLATE + return :POISON + when :EARTHPLATE + return :GROUND + when :STONEPLATE + return :ROCK + when :INSECTPLATE + return :BUG + when :SPOOKYPLATE + return :GHOST + when :IRONPLATE + return :STEEL + when :FLAMEPLATE + return :FIRE + when :SPLASHPLATE + return :WATER + when :MEADOWPLATE + return :GRASS + when :ZAPPLATE + return :ELECTRIC + when :MINDPLATE + return :PSYCHIC + when :ICICLEPLATE + return :ICE + when :DRACOPLATE + return :DRAGON + when :DREADPLATE + return :DARK + when :PIXIEPLATE + return :FAIRY + else + return :NORMAL + end +end + diff --git a/Data/System.rxdata b/Data/System.rxdata index 44c1264510bae3ec5019232967fe3a287a9f0a86..0545475f38338b1243ae41b1c27ab7907862046f 100644 GIT binary patch delta 20 ccmaEGjq%|%#tk#XSXs;tYq4&gBX%SN0AcnBd;kCd delta 19 bcmaEOjq$-X#tk#XSeV6TMs1!eb|eG