Administrators Amethyst Posted November 14, 2013 Administrators Share Posted November 14, 2013 Before we move on to getting the new content into the game, it's probably best we patch-up the existing things. It'll be much easier to say "6th gen content is incomplete" than to say "Uhhh yeah some stuff from 6th gen works but some stuff from 4th/5th gen doesn't......." SO Let's be clear on exactly everything that needs doing, and as help becomes available, we can hopefully knock some of these things off the list. Stench- OKDrizzle- OKSpeed Boost- OKBattle Armor- OKSturdy- OKDamp- OKLimber- OKSand Veil- OKStatic- OKVolt Absorb- OKWater Absorb- OKOblivious- OKCloud Nine- OKCompound Eyes- OKInsomnia- OKColor Change- OKImmunity- OKFlash Fire- OKShield Dust- OKOwn Tempo- OKSuction Cups- OKIntimidate- OKShadow Tag- OKRough Skin- OKWonder Guard- OKLevitate- OKEffect Spore- OKSynchronize- OKClear Body- OKNatural Cure- OKLightningrod- Should absorb non-damaging moves as wellSerene Grace- OKSwift Swim- OKChlorophyll- OKIlluminate- OKTrace- OKHuge Power- OKPoison Point- OK Inner Focus- OKMagma Armor- OKWater Veil- OKMagnet Pull- OKSoundproof- OKRain Dish- OKSandstream- OKPressure- OKThick Fat- OKEarly Bird- OKFlame Body- OKRun Away- OKKeen Eye- OKHyper Cutter- OKPickup- OKTruant- OKHustle- OKCute Charm- OKPlus- OK Minus- OK Forecast- OK Sticky Hold- OK Shed Skin- OK Guts- OK Marvel Scale- OK Liquid Ooze- OK Overgrow- OK Blaze- OK Torrent- OKSwarm- OK Rock Head- OK Drought- OK Arena Trap- OK Vital Spirit- OK White Smoke- OK Pure Power- OK Shell Armor- OK Airlock- OKTangled Feet- OKMotor Drive- Should absorb non-damaging moves as wellRivalry- OKSteadfast- OKSnow Cloak- OK Gluttony- OKAnger Point- OKUnburden- OKHeatproof- OKSimple- OKDry Skin- Should absorb non-damaging moves as wellDownload- OKIron Fist- OKPoison Heal- OKAdaptability- OKSkill Link- OKHydration- OKSolar Power- OKQuick Feet- OKNormalize- OKSniper- OKMagic Guard- Needs to be coded with Life Orb, after Life Orb is added. Theoretically OK otherwise. Needs to be tested.No Guard- OKStall- OKTechnician- OKLeaf Guard- OKKlutz- OKMold Breaker- OKSuper Luck- OKAftermath- OKAntici... ...pation- OKForewarn- OKUnaware- OKTinted Lens- OKFilter- OKSlow Start- OKScrappy- OKStorm Drain- Should absorb non-damaging moves as wellIce Body- OKSolid Rock- OKSnow Warning- OKHoney Gather- OKFrisk- OK Reckless- OKMultitype- OKFlower Gift- OKBad Dreams- OKPickpocket- OK Sheer Force- OK Contrary- OKUnnerve- OKDefiant- OKDefeatist- OKCursed Body- OKHealer- OK Friend Guard- OK Weak Armor- OK Heavy Metal- OK Light Metal- OK Multiscale- OKToxic Boost- OK Flare Boost- OKHarvest- Not yet implemented Telepathy- Not yet implementedMoody- OK Overcoat- Should now resist powder attacks too Poison Touch- OK Regenerator- OK Big Pecks- OK Sand Rush- OK Wonder Skin- OK Analytic- Not yet implemented Illusion- Not yet implemented Imposter- Currently crashes if the imposter ditto is leading the party Infiltrator- "Currently doesn't work against Mist or Safeguard." Now should hit through Substitute tooMummy- OK Moxie- OK Justified- OKRattled- OK Magic Bounce- "In double battles, if a Pokémon with Magic Bounce gets hit by a non-attacking move that attacks both Pokémon on the team, it protects its ally as well. This should not happen; only the Pokémon with Magic Bounce should be protected."Sap Sipper- "This should work fully with non-damaging Grass moves (e.g. Leech Seed), but currently doesn't. Only exception is Aromatherapy." There may be more exceptions with 6th gen. "Should only up Attack once for the whole of a multi-hitting Grass move." Should absorb non-damaging moves as well Prankster- OK Sand Force- OKIron Barbs- OK Zen Mode- OK Victory Star- OKTurbo Blaze- Not yet implemented Teravolt- Not yet implemented If you're familiar with Ruby and want to take a shot at fixing some of these things, please PM me. I'll do what I can to get you set up with a copy of RMXP and our latest script version. All changes to the code, however, will need to be documented. So, when posting a fix for one of these things, please post it in this topic. I'll then merge it into my master copy of the scripts. Link to comment Share on other sites More sharing options...
Guhorden Posted November 16, 2013 Share Posted November 16, 2013 (edited) Hello! Here are my changes so far. More to come. Drizzle- Needs to be changed to weather lasting 5 turns after the user is switched in. Damp Rock increases this amount to 8. --- Done, 11/14/2013 (Edited for all weathers) File: PokeBattle_BattlerFunction: pbAbilitiesOnSwitchInLine number approx: 761 # Weather if isConst?(ability,PBAbilities,:DRIZZLE) && onactive @battle.weather=PBWeather::RAINDANCE # UPDATE - 11/14 # Changed weatherduration=5 unless DAMPROCK, then 8 #@battle.weatherduration=-1 @battle.weatherduration=5 @battle.weatherduration=8 if isConst?(self.item,PBItems,:DAMPROCK) @battle.pbDisplay(_INTL("{1}'s Drizzle made it rain!",pbThis)) end if isConst?(ability,PBAbilities,:SANDSTREAM) && onactive @battle.weather=PBWeather::SANDSTORM @battle.weatherduration=5 @battle.weatherduration=8 if isConst?(self.item,PBItems,:SMOOTHROCK) @battle.pbDisplay(_INTL("{1}'s Sand Stream whipped up a sandstorm!",pbThis)) end if isConst?(ability,PBAbilities,:DROUGHT) && onactive @battle.weather=PBWeather::SUNNYDAY @battle.weatherduration=5 @battle.weatherduration=8 if isConst?(self.item,PBItems,:HEATROCK) @battle.pbDisplay(_INTL("{1}'s Drought intensified the sun's rays!",pbThis)) end if isConst?(ability,PBAbilities,:SNOWWARNING) && onactive @battle.weather=PBWeather::HAIL @battle.weatherduration=5 @battle.weatherduration=8 if isConst?(self.item,PBItems,:ICYROCK) @battle.pbDisplay(_INTL("{1}'s Snow Warning made it hail!",pbThis)) end Static- Must no longer affect Electric Types --- Done, 11/14/2013 - electric types can't be paralyzed anymore. File: PokeBattle_EffectsFunction: pbCanParalyze?Line number approx: 245 def pbCanParalyze?(showMessages) return false if hp<=0 # UPDATE 11/14 # Electric type can no longer be paralyzed if pbHasType?(:ELECTRIC) #@battle.pbDisplay("DEBUG - remove me, you can't be paralyzed") return false end Volt Absorb- Needs to be changed to work with non-damaging Electric Moves. --- Done, 11/15/2013Water Absorb- Needs to be changed to work with non-damaging Water Moves --- Done, 11/15/2013 File: PokeBattle_BattlerFunction: pbSuccessCheckLine number approx: 1634 # UPDATE 11/15 # first pass at fixing non-damaging moves not applying things like VOLTABSORB # this may have unintended side affects, although it seems functional so far. # Any potential problems are likely just verbose messages in a battle # changed from: #if thismove.basedamage>0 && thismove.function!=0x02 && # Struggle # thismove.function!=0x111 # Future Sight # to: if thismove.function!=0x02 && thismove.function!=0x111 type=thismove.pbType(thismove.type,user,target) # changed from: typemod=thismove.pbTypeModifier(type,user,target) typemod=thismove.pbTypeModMessages(type,user,target) A little further down from the above... # UPDATE 11/16 # should fix problems mentioned above # debugging #@battle.pbDisplay(_INTL("{1}", typemod)) return false if typemod == 0 # this was commented out and replaced by the above line # make sure you change typemod in the above changes! #if typemod==0 #@battle.pbDisplay(_INTL("It doesn't affect\r\n{1}...",target.pbThis(true))) #return false #end Oblivious- Must now block Taunt as well. --- Done, 11/16/2013 File: PokeBattle_MoveEffectsClass: PokeBattle_Move_0BAFunction: pbEffectLine number approx: 4404 # this was unchanged - just a reference of where the following needs to be placed. if opponent.effects[PBEffects::Taunt]>0 @battle.pbDisplay(_INTL("But it failed!")) return -1 end # UPDATE 11/16/2013 # Oblivious now protects from taunt if isConst?(opponent.ability,PBAbilities,:OBLIVIOUS) @battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true))) return -1 end Color Change- "Should only activate after the last hit of a multi-hit move; currently activates after the first hit." --- Done, 11/16/2013 File: PokeBattle_BattlerFunction: pbProcessMultiHitMoveLine number approx: 2128 # UPDATE 11/16 # in order to get COLORCHANGE to work as intended, pbAbilitEffect # needs to be aware of if it is the `final hit`. # This isn't a very elegant solution - but it gets the job done. # changed from: @battle.pbAbilityEffect(thismove,user,target,damage) @battle.pbAbilityEffect(thismove,user,target,damage, i == numhits - 1) # last iteration, regardless of actual hits File: PokeBattle_BattleFunction: pbAbilityEffect (changed the declaration here)Line number approx: 1864 # UPDATE 11/16 # changed to understand if it was the final hit # only used for COLORCHANGE # A better solution should ultimately be taken, but this will work. # change from: def pbAbilityEffect(move,user,target,damage) def pbAbilityEffect(move,user,target,damage,finalhit=false) File: PokeBattle_BattleFunction: pbAbilityEffectLine number approx: 2002 ishHint: Search for :COLORCHANGE - it's only used once in the code - this goes within the if statement that uses it. # UPDATE 11/16 # first attempt at changing multi-hit functionality # (Also very sloppy) # replace these lines: # target.type1=type # target.type2=type # pbDisplay(_INTL("{1}'s {2} made it the {3} type!",target.pbThis, # PBAbilities.getName(target.ability),PBTypes.getName(type))) # with: if !move.pbIsMultiHit target.type1=type target.type2=type pbDisplay(_INTL("{1}'s {2} made it the {3} type!",target.pbThis, PBAbilities.getName(target.ability),PBTypes.getName(type))) elsif finalhit target.type1=type target.type2=type pbDisplay(_INTL("{1}'s {2} made it the {3} type!", target.pbThis, PBAbilities.getName(target.ability), PBTypes.getName(type) )) end Flash Fire- Needs to be changed to work with non-damaging Fire Moves --- Done, 11/16/2013 - Should be fixed generically for any future non-damaging fire moves. File: PokeBattle_EffectsFunction: pbCanBurnFromFireMove?Line number approx: 183 # UPDATE 11/16 # moved above if pbHasType? ... # allows for non-damaging fire moves to proc FLASHFIRE # move this if/end block above if pbHasType? ... end if isConst?(self.ability,PBAbilities,:FLASHFIRE) && isConst?(move.type,PBTypes,:FIRE) if !@effects[PBEffects::FlashFire] @effects[PBEffects::FlashFire]=true @battle.pbDisplay(_INTL("{1}'s {2} raised its Fire power!",pbThis,PBAbilities.getName(self.ability))) else @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",pbThis,PBAbilities.getName(self.ability),move.name)) end return false end if pbHasType?(:FIRE) && !isConst?(self.item,PBItems,:RINGTARGET) @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages return false end # was originally here ... Edited November 16, 2013 by Amethyst Link to comment Share on other sites More sharing options...
Guhorden Posted November 17, 2013 Share Posted November 17, 2013 Second batch of updates. More to come. Shield Dust- "Should negate only effects that affect the bearer, but currently negates all additional effects regardless." --- Done, 11/16/2013 - Flag `m` will need to be added to the appropriate moves. File: PokeBattle_BattlerFunction: pbProcessNonMultiHitMoveLine number approx: 1952 # Additional effect # UPDATE 11/16 # Began using a new flag to determine if SHIELDDUST should be ignored (flag m) # This allows for the pbEffect of a move to deal damage and the pbAdditionalEffect # to affect self # changed from: if target.damagestate.calcdamage>0 && #!isConst?(target.ability,PBAbilities,:SHIELDDUST) if target.damagestate.calcdamage>0 && (!isConst?(target.ability,PBAbilities,:SHIELDDUST) || thismove.hasFlags?("m")) This change is similar to the above for a different functionFile: PokeBattle_BattlerFunction: pbProcessMultiHitMoveLine number approx: 2072 # Additional effect # UPDATE 11/16 # exact same as the process pbProcessNonMultiHitMove changes # changed from: if !isConst?(target.ability,PBAbilities,:SHIELDDUST) if !isConst?(target.ability,PBAbilities,:SHIELDDUST) || thismove.hasFlags?("m") *** This one is important - I added this function to simplify flag usageFile: PokeBattle_MoveGeneral area: Place it after the `About the move` comment blockLine number approx: 136 # UPDATE 11/16 # simplifies flag usage - can now ask hasFlags?("m") # to determine if flag `m` is set. # or also hasFlags?("abcdef") will also work if all flags are set # This makes it much easier for anyone not versed in bitwise operations # to define new flags. # Note: I tested most edge cases of this - although I could've missed something def hasFlags?(flag) # must be a string return false if !flag.is_a? String flag.each_byte do |c| # must be a lower case letter return false if c > 122 || c < 97 n = c - 97 # number of bits to shift # if the nth bit isn't set return false if (@flags & (1 << n)) == 0 end return true end Suction Cups- Out of battle effect needs to be added: Increases hook rate when fishing from 65% to 98% --- Done, 11/16/2013Sticky Hold- Out of battle effect needs to be added: Increases hook rate when fishing from 65% to 98% --- Done, 11/16/2013 File: PokemonFieldFunction: pbFishingLine number approx: 1590 # UPDATE 11/16 # now set to 98 if first Pokemon has SUCTIONCUPS or STICKYHOLD abl = $Trainer.party[0].ability increase = isConst?(abl, PBAbilities, :SUCTIONCUPS) || isConst?(abl, PBAbilities, :STICKYHOLD) # changed from: bitechance=65 # changed from: hookchance=65 bitechance= increase ? 98 : 65 hookchance= increase ? 98 : 65 Shadow Tag- "A special message should be shown if fleeing is prevented because of this ability. What message?" ANSWER: "The wild Wobbuffet prevents escape with Shadow Tag!" - so that needs to be coded in. -- Also must not effect Ghost types --- Done, 11/16/2013 - This should hopefully address all abilities that prevent escape having a generic message. Only tested for Shadow Tag. File: PokeBattle_BattleFunction: pbCanSwitch?Line number approx: 1034 # ignore first if/end, it was unchanged - just a reference for where the update belongs. # Multi-Turn Attacks/Mean Look if !pbCanSwitchLax?(idxPokemon,pkmnidxTo,showMessages) return false end # UPDATE 11/16/2013 # Ghost type can now escape from anything if thispkmn.pbHasType?(:GHOST) return true end File: PokeBattle_BattleFunction: pbCanSwitch?Line number approx: 1088 if opp abilityname=PBAbilities.getName(opp.ability) pbDisplayPaused(_INTL("{1}'s {2} prevents switching!",opp.pbThis,abilityname)) if showMessages # UPDATE 11/16 # now displays the proper fleeing message iff you are attempting to flee # Note: not very elegant, but it should work. pbDisplayPaused(_INTL("{1} prevents escaping with {2}!", opp.pbThis, abilityname)) if !showMessages && pkmnidxTo == -1 return false end File: PokeBattle_BattleFunction: pbRunLine number approx: 1433 # if/end is a reference point if !duringBattle && !pbCanSwitch?(idxPokemon,-1,false) # TODO: Use real messages # UPDATE 11/16 # changes to pbCanSwitch? made the following message redundant. #pbDisplayPaused(_INTL("Can't escape!")) return 0 end Rough Skin- May stop EXP from being awarded; please test. --- ??? Could not reproduce for Rough Skin, Iron Barbs or Aftermath.Aftermath- Currently seems to negate EXP Gain- needs to be fixed --- Could not reproduceEffect Spore- Should no longer effect Grass types. Also must no longer paralyze electric types- but should not have a great chance of giving them other statuses instead. --- Done, 11/16/2013 File: PokeBattle_BattleFunction: pbAbilityEffectLine number approx: 1904 # UPDATE 11/16/2013 # effect spore no longer affects grass types # changed from: if isConst?(target.ability,PBAbilities,:EFFECTSPORE) && self.pbRandom(10)<3 if !target.pbHasType?(:GRASS) && isConst?(target.ability,PBAbilities,:EFFECTSPORE) && self.pbRandom(10)<3 Synchronize- "Bad poison is currently passed on as regular poison, and should be bad poison." Also out of battle, should make wild Pokemon have a 50% chance of having the same nature as the bearer, when leading the party. --- Done, 11/17/2013 - In combat portion - will address out of combat stuff soon. File: PokeBattle_BattleFunction: pbAbilityEffectLine number approx: 2065 # UPDATE 11/17/2013 # allows for transfering of `badly poisoned` instead of just poison. #changed from: tbattler.pbPoison(sbattler) tbattler.pbPoison(sbattler, sbattler.statusCount == 1) Bounceback - Fixed a bug where it was stating that the receiving Pokemon was the one that bounced the move back --- 11/17/2013 File: PokeBattle_BattlerFunction: pbChangeTargetLine number approx: 1477 # Target refers to the move's old user # UPDATE 11/17/2013 # not a listed bug - but I came across it. # was previously stating the incorrect Pokemon name (not the one that bounced it back # but instead the one that received it). # changed from: @battle.pbDisplay(_INTL("{1} bounced the {2} back!",target.pbThis,thismove.name)) @battle.pbDisplay(_INTL("{1} bounced the {2} back!",user.pbThis,thismove.name)) Lightningrod- Needs to be changed to work with non-damaging Electric Moves. --- Should have been fixed by my previous tweaks to get Voltabsorb working - I think I've seen it, not confirmed. Keen Eye- Should now ignore all enemy evasion boosts --- Done, 11/17/2013 - not tested File: PokeBattle_MoveFunction: pbAccuracyCheckLine number approx: 359 # UPDATE 11/17/2013 # keen eye should now ignore evasion increases # since in the above nothing can lower evasion, this will work # this is not a solution if the above code can lower evasion - that would # be counter-intuitive to keen-eye. evasion = 1 if isConst?(attacker.ability,PBAbilities,:KEENEYE) return @battle.pbRandom(100)<(baseaccuracy*accuracy/evasion) Pickup- Ame broke it, she doesn't know why, halp --- Done, 11/17/2013Arena Trap- Needs to no longer affect Ghost types --- Done, 11/16/2013 - See Shadow Tag. Link to comment Share on other sites More sharing options...
Guhorden Posted November 20, 2013 Share Posted November 20, 2013 (edited) Round 3: Double battles fix - Can no longer use items indefinitely in a double battle --- 11/17/2013 File: PokeBattle_ActualSceneFunction: pbCommandMenuExLine number approx: 2111 # UPDATE 11/17/2013 # Fix for being able to take potions indefinitely in a double battle # changed from: elsif Input.trigger?(Input:: && index==2 && @lastcmd[0]!=2 elsif Input.trigger?(Input:: && index==2 && @lastcmd[0]!=2 && @lastcmd[0]!=1 # UPDATE --- Remove #Kernel.pbMessage(_INTL("Within pbCommandMenuEx: {1}", @lastcmd[0])) Magnet Pull- When out of battle, should increase the chance of finding Steel Types by 50% --- Done, 11/19/2013 File: PokemonEncountersGeneral location: After pbMapEncounter, before pbEncounteredPokemonLine number approx: 185-229 # UPDATE 11/18/2013 # the following functions were copied from PokeBattle_Pokemon and slightly # modified to fit the needs for this problem. # they are used to determine the type of possible pokemon encounters def hasType?(species, type) if type.is_a?(String) || type.is_a?(Symbol) return isConst?(type1(species),PBTypes,type)||isConst?(type2(species),PBTypes,type) else return type1==type || type2==type end end # Returns this Pokémon's first type. def type1(species) dexdata=pbOpenDexData pbDexDataOffset(dexdata,species,8) ret=dexdata.fgetb dexdata.close return ret end # Returns this Pokémon's second type. def type2(species) dexdata=pbOpenDexData pbDexDataOffset(dexdata,species,9) ret=dexdata.fgetb dexdata.close return ret end # adjusts the chances of finding a Pokemon of type by mult # Note: This does NOT increase the find chance by mult (strictly speaking) # Since a random number is created between 0 <= r < sum of chances # Increasing these numbers will shift around the find rate of all of them. def shiftChances(chances, enctype, type, mult) for i in 0...chances.length pkmn = @enctypes[enctype][i] chances[i] *= mult if hasType?(pkmn[0], type) chances[i] = 1 if chances[i] < 1 chances[i] = chances[i].to_i end return chances end # end of update File: Same as aboveFunction: pbEncounteredPokemonLine number approx: 238 chances=EncounterTypes::EnctypeChances[enctype] # UPDATE 11/18/2013 # I assumed multiple abilities would change the encounter rate. # (Apparently it's only Magnet Pull) # But if more exist in the future, this will make it easy to add them # First Pokemon has Magnet Pull if !$Trainer.party[0].egg? abl = $Trainer.party[0].ability if isConst?(abl,PBAbilities,:MAGNETPULL) chances = shiftChances(chances, enctype, :STEEL, 1.5) end end # end of update Cute Charm- "When out of battle: If the bearer is at the front of the party, 2/3 chance of wild Pokémon being the opposite gender to the bearer, regardless of gender ratios (if possible)." --- Done, 11/19/2013Synchronize- Out of battle, should make wild Pokemon have a 50% chance of having the same nature as the bearer, when leading the party. --- Done, 11/19/2013 File: PokemonEncounterModifiersGeneral area: Bottom of the fileLine number approx: Anything after 20 # UPDATE 11/19/2013 # Cute Charm now gives a 2/3 chance of being opposite gender Events.onWildPokemonCreate+=proc {|sender,e| pokemon=e[0] if !$Trainer.party[0].egg? ourpkmn = $Trainer.party[0] abl = ourpkmn.ability if isConst?(abl, PBAbilities, :CUTECHARM) && rand(3) < 2 pokemon.setGender(ourpkmn.gender == 0 ? 1 : 0) end end } # UPDATE 11/19/2013 # sync will now give a 50% chance of encountered pokemon having # the same nature as the party leader Events.onWildPokemonCreate+=proc {|sender,e| pokemon=e[0] if !$Trainer.party[0].egg? ours = $Trainer.party[0] if isConst?(ours.ability, PBAbilities, :SYNCHRONIZE) && rand(2) == 0 pokemon.setNature(ours.nature) end end } Pressure- May have some inconsistencies in-battle (What inconsistencies?). Out of battle, should increase the chance of finding higher levels by 50% --- Done, 11/19/2013Hustle- Should, when leading out of battle, increase the chance of finding higher leveled wild pokemon by 50% --- Done, 11/19/2013Vital Spirit- "When out of battle if bearer is at the front of the party, ups chance of wild Pokémon being a higher level by 50%." --- Done, 11/19/2013 File: PokemonEncountersFunction: pbEncounteredPokemonLine number approx: 267 return nil if !encounter # UPDATE 11/19/2013 # pressure, hustle and vital spirit will now have a 150% chance of # finding higher leveled pokemon in encounters if !Trainer.party[0].egg? abl = $Trainer.party[0].ability if (isConst?(abl, PBAbilities, :PRESSURE) || isConst?(abl, PBAbilities, :HUSTLE) || isConst?(abl, PBAbilities, :VITALSPIRIT)) && rand(2) == 0 # increase the lower bound to half way in-between lower and upper encounter[1] += (encounter[2] - encounter[1]) / 2 end end # end of update level=encounter[1]+rand(1+encounter[2]-encounter[1]) return [encounter[0],level] Edited November 20, 2013 by Guhorden Link to comment Share on other sites More sharing options...
Guhorden Posted November 24, 2013 Share Posted November 24, 2013 Updates round 4: Unburden- Not yet implemented --- Done, 11/19/2013 File: PokeBattle_BattlerFunction: item=(value)Line number approx: 114 def item=(value) # UPDATE 11/19/2013 # Initial pass for implementing UNBURDEN # pokemon has lost their item if @item != 0 && value == 0 if isConst?(@ability, PBAbilities, :UNBURDEN) && !@unburdened @speed *= 2 @unburdened = true end end # end update @item=value @pokemon.item=value if @pokemon end Add this to the bottom of the list of attr_accessor fields in the top of this file # UPDATE 11/19/2013 # Added to prevent unburdened attr_accessor :unburdened File: same as aboveFunction header: def initialize(btl,index)Line number approx: 143Add this into the initialize function: @unburdened = false Fix Fling --- Done, 11/21/2013 File: PokeBattle_MoveEffectsClass PokeBattle_Move_0F7Line number approx: 6115 ################################################################################ # User flings its item at the target. Power and effect depend on the item. ################################################################################ class PokeBattle_Move_0F7 < PokeBattle_Move # UPDATE 11/21/2013 # fix for fling not working at all # Ruby wasn't initializing this instance variable like other languages would # In my lack of knowledge of the language, I just made return from a function instead. def getDamagearray return { 130 => [:IRONBALL], 100 => [:ARMORFOSSIL,:CLAWFOSSIL,:COVERFOSSIL,:DOMEFOSSIL,:HARDSTONE, :HELIXFOSSIL,:OLDAMBER,:PLUMEFOSSIL,:RAREBONE,:ROOTFOSSIL, :SKULLFOSSIL], 90 => [:DEEPSEATOOTH,:DRACOPLATE,:DREADPLATE,:EARTHPLATE,:FISTPLATE, :FLAMEPLATE,:GRIPCLAW,:ICICLEPLATE,:INSECTPLATE,:IRONPLATE, :MEADOWPLATE,:MINDPLATE,:SKYPLATE,:SPLASHPLATE,:SPOOKYPLATE, :STONEPLATE,:THICKCLUB,:TOXICPLATE,:ZAPPLATE], 80 => [:DAWNSTONE,:DUSKSTONE,:ELECTIRIZER,:MAGMARIZER,:ODDKEYSTONE, :OVALSTONE,:PROTECTOR,:QUICKCLAW,:RAZORCLAW,:SHINYSTONE, :STICKYBARB], 70 => [:BURNDRIVE,:CHILLDRIVE,:DOUSEDRIVE,:DRAGONFANG,:POISONBARB, :POWERANKLET,:POWERBAND,:POWERBELT,:POWERBRACER,:POWERLENS, :POWERWEIGHT,:SHOCKDRIVE], 60 => [:ADAMANTORB,:DAMPROCK,:HEATROCK,:LUSTROUSORB,:MACHOBRACE, :ROCKYHELMET,:STICK], 50 => [:DUBIOUSDISC,:SHARPBEAK], 40 => [:EVIOLITE,:ICYROCK,:LUCKYPUNCH], 30 => [:ABILITYURGE,:ABSORBBULB,:AMULETCOIN,:ANTIDOTE,:AWAKENING, :BALMMUSHROOM,:BERRYJUICE,:BIGMUSHROOM,:BIGNUGGET,:BIGPEARL, :BINDINGBAND,:BLACKBELT,:BLACKFLUTE,:BLACKGLASSES,:BLACKSLUDGE, :BLUEFLUTE,:BLUESHARD,:BURNHEAL,:CALCIUM,:CARBOS, :CASTELIACONE,:CELLBATTERY,:CHARCOAL,:CLEANSETAG,:COMETSHARD, :DAMPMULCH,:DEEPSEASCALE,:DIREHIT,:DIREHIT2,:DIREHIT3, :DRAGONSCALE,:EJECTBUTTON,:ELIXIR,:ENERGYPOWDER,:ENERGYROOT, :ESCAPEROPE,:ETHER,:EVERSTONE,:EXPSHARE,:FIRESTONE, :FLAMEORB,:FLOATSTONE,:FLUFFYTAIL,:FRESHWATER,:FULLHEAL, :FULLRESTORE,:GOOEYMULCH,:GREENSHARD,:GROWTHMULCH,:GUARDSPEC, :HEALPOWDER,:HEARTSCALE,:HONEY,:HPUP,:HYPERPOTION, :ICEHEAL,:IRON,:ITEMDROP,:ITEMURGE,:KINGSROCK, :LAVACOOKIE,:LEAFSTONE,:LEMONADE,:LIFEORB,:LIGHTBALL, :LIGHTCLAY,:LUCKYEGG,:MAGNET,:MAXELIXIR,:MAXETHER, :MAXPOTION,:MAXREPEL,:MAXREVIVE,:METALCOAT,:METRONOME, :MIRACLESEED,:MOOMOOMILK,:MOONSTONE,:MYSTICWATER,:NEVERMELTICE, :NUGGET,:OLDGATEAU,:PARLYZHEAL,:PEARL,:PEARLSTRING, :POKEDOLL,:POKETOY,:POTION,:PPMAX,:PPUP, :PRISMSCALE,:PROTEIN,:RAGECANDYBAR,:RARECANDY,:RAZORFANG, :REDFLUTE,:REDSHARD,:RELICBAND,:RELICCOPPER,:RELICCROWN, :RELICGOLD,:RELICSILVER,:RELICSTATUE,:RELICVASE,:REPEL, :RESETURGE,:REVIVALHERB,:REVIVE,:SACREDASH,:SCOPELENS, :SHELLBELL,:SHOALSALT,:SHOALSHELL,:SMOKEBALL,:SODAPOP, :SOULDEW,:SPELLTAG,:STABLEMULCH,:STARDUST,:STARPIECE, :SUNSTONE,:SUPERPOTION,:SUPERREPEL,:SWEETHEART,:THUNDERSTONE, :TINYMUSHROOM,:TOXICORB,:TWISTEDSPOON,:UPGRADE,:WATERSTONE, :WHITEFLUTE,:XACCURACY,:XACCURACY2,:XACCURACY3,:XACCURACY6, :XATTACK,:XATTACK2,:XATTACK3,:XATTACK6,:XDEFEND, :XDEFEND2,:XDEFEND3,:XDEFEND6,:XSPDEF,:XSPDEF2, :XSPDEF3,:XSPDEF6,:XSPECIAL,:XSPECIAL2,:XSPECIAL3, :XSPECIAL6,:XSPEED,:XSPEED2,:XSPEED3,:XSPEED6, :YELLOWFLUTE,:YELLOWSHARD,:ZINC], 20 => [:CLEVERWING,:GENIUSWING,:HEALTHWING,:MUSCLEWING,:PRETTYWING, :RESISTWING,:SWIFTWING], 10 => [:AIRBALLOON,:BIGROOT,:BLUESCARF,:BRIGHTPOWDER,:CHOICEBAND, :CHOICESCARF,:CHOICESPECS,:DESTINYKNOT,:EXPERTBELT,:FOCUSBAND, :FOCUSSASH,:FULLINCENSE,:GREENSCARF,:LAGGINGTAIL,:LAXINCENSE, :LEFTOVERS,:LUCKINCENSE,:MENTALHERB,:METALPOWDER,:MUSCLEBAND, :ODDINCENSE,:PINKSCARF,:POWERHERB,:PUREINCENSE,:QUICKPOWDER, :REAPERCLOTH,:REDCARD,:REDSCARF,:RINGTARGET,:ROCKINCENSE, :ROSEINCENSE,:SEAINCENSE,:SHEDSHELL,:SILKSCARF,:SILVERPOWDER, :SMOOTHROCK,:SOFTSAND,:SOOTHEBELL,:WAVEINCENSE,:WHITEHERB, :WIDELENS,:WISEGLASSES,:YELLOWSCARF,:ZOOMLENS] } end def pbMoveFailed(attacker,opponent) return trueif attacker.item==0 || @battle.pbIsUnlosableItem(attacker,attacker.item(true)) || pbIsPokeBall?(attacker.item(true)) || isConst?(attacker.ability,PBAbilities,:KLUTZ) || attacker.effects[PBEffects::Embargo]>0 # This was added damagearray=getDamagearray # removed the @ signs in front of the rest of them for i in damagearray.keys data=damagearray[i] if data for j in data return false if isConst?(attacker.item,PBItems,j) end end end return false if pbIsBerry?(attacker.item) return true end def pbBaseDamage(basedmg,attacker,opponent) # Added - also removed @ symbols damagearray = getDamagearray for i in damagearray.keys data=damagearray[i] if data for j in data return i if isConst?(attacker.item,PBItems,j) end end end return 10 if pbIsBerry?(attacker.item) return 1 end Klutz- Not yet implemented --- ? Looks like it is implemented...Ending a round moves the cursor back to FIGHT instead of the previously selected value --- 11/21/2013 File: PokeBattle_ActualSceneFunction: pbCommandMenuExLine number approx: 2098 # UPDATE 11/21/2013 # end of round will put the cursor back on FIGHT now #changed from: cw2.index=@lastcmd[index] cw2.index=0 Sheer Force- Not yet implemented --- Done, 11/21/2013 I don't like this solution, but it should work fine.File: PokeBattle_BattlerFunction: pbProcessNonMultiHitMoveLine number approx: 1962 and 1996 end # UPDATE 11/21/2013 # Implementation of sheer force # Note: this is not ideal - I had to change an immutable field to be mutable # for this to work. temp = thismove.basedamage thismove.basedamage = (thismove.basedamage * 1.3).to_i if isConst?(user.ability, PBAbilities, :SHEERFORCE) && thismove.addlEffect > 0 damage=thismove.pbEffect(user,target) # Recoil/drain, etc. are applied here thismove.basedamage = temp if user.hp<=0 user.pbFaint # no return end if @battle.pbRandom(100)<addleffect # UPDATE 11/21/2013 # Prevent additional effects from applying if sheer force thismove.pbAdditionalEffect(user,target) if !isConst?(user.ability, PBAbilities, :SHEERFORCE) end File: PokeBattle_MoveClass: PokeBattle_MoveLine number approx: 24 (among the list of attr_reader and such) # UPDATE 11/21/2013 # Changed from immutable to mutable to allow for sheer force # changed from: attr_reader(:basedamage) attr_accessor(:basedamage) Stall- Not yet implemented --- Done, 11/23/2013 File: PokeBattle_BattleFunction: def pbPriorityLine number approx: 890 # UPDATE 11/23/2013 # implementing STALL def pbPriority if @usepriority # use stored priority if round isn't over yet return @priority end speeds=[] quickclaw=[] stall=[] # <--- Add this here lagtail=[] # <--- This too incense=[] # <--- ... and this priorities=[] temp=[] @priority.clear maxpri=0 minpri=0 # Calculate each Pokémon's speed ### Simplified below #speeds[0]=@battlers[0].pbSpeed #speeds[1]=@battlers[1].pbSpeed #speeds[2]=@battlers[2].pbSpeed #speeds[3]=@battlers[3].pbSpeed #quickclaw[0]=isConst?(@battlers[0].item,PBItems,:QUICKCLAW) #quickclaw[1]=isConst?(@battlers[1].item,PBItems,:QUICKCLAW) #quickclaw[2]=isConst?(@battlers[2].item,PBItems,:QUICKCLAW) #quickclaw[3]=isConst?(@battlers[3].item,PBItems,:QUICKCLAW) ### # Find the maximum and minimum priority for i in 0..3 ### add these here speeds[i] = @battlers[i].pbSpeed quickclaw[i] = isConst?(@battlers[i].item, PBItems, :QUICKCLAW) stall[i] = isConst?(@battlers[i].ability, PBAbilities, :STALL) lagtail[i] = isConst?(@battlers[i].item, PBItems, :LAGGINGTAIL) incense[i] = isConst?(@battlers[i].item, PBItems, :FULLINCENSE) ### # For this function, switching and using items Same file/function, slightly lower downLine number approx: 961 for i in 1..n-1 if quickclaw[temp[i]] && usequickclaw cmp=(quickclaw[temp[i-1]]) ? 0 : -1 #Rank higher if without Quick Claw, or equal if with it elsif quickclaw[temp[i-1]] && usequickclaw cmp=1 # Rank lower # UPDATE 11/23/2013 # stall ability # add the following two elsif blocks #### # ignored if we have full incense or lagging tail elsif stall[temp[i]] && !(incense[temp[i]] || lagtail[temp[i]]) # if they also have stall if stall[temp[i-1]] && !(incense[temp[i-1]] || lagtail[temp[i-1]]) # higher speed -> lower priority cmp=speeds[temp[i]] > speeds[temp[i-1]] ? 1 : -1 elsif lagtail[temp[i-1]] || incense[temp[i-1]] cmp=-1 else cmp=1 end elsif stall[temp[i-1]] && !(incense[temp[i-1]] || lagtail[temp[i-1]]) cmp= lagtail[temp[i]] || incense[temp[i]] ? 1 : -1 # end of update elsif speeds[temp[i]]!=speeds[temp[i-1]] cmp=(speeds[temp[i]]>speeds[temp[i-1]]) ? -1 : 1 #Rank higher to higher-speed battler else cmp=0 end Link to comment Share on other sites More sharing options...
Guhorden Posted November 30, 2013 Share Posted November 30, 2013 (edited) More updates: Pickpocket- "Should fail if the ability Sheer Force applies to the attack." --- Done, 11/29/2013 File: PokeBattle_BattleFunction: pbAbilityEffectLine number approx: 2003 # UPDATE 11/29/2013 # Pickpocket now fails if user has sheer force # changed from: if isConst?(target.ability,PBAbilities,:PICKPOCKET) && target.hp>0 if isConst?(target.ability,PBAbilities,:PICKPOCKET) && target.hp>0 && !isConst?(user.ability, PBAbilities, :SHEERFORCE) # end update Contrary- Not yet implemented --- Done, 11/29/2013 File: PokeBattle_EffectsFunction: pbIncreaseStatLine number approx: 396 # UPDATE 11/29/2013 # Contrary # calls reduce stat from here if we have contrary # Added an extra parameter to determine if this was called from reduce stat # changed from: def pbIncreaseStat(stat,increment,showMessages,moveid=nil,attacker=nil,upanim=true) def pbIncreaseStat(stat,increment,showMessages,moveid=nil,attacker=nil,upanim=true, cont_call=false) # here we call reduce instead if isConst?(self.ability, PBAbilities, :CONTRARY) && !cont_call ret=pbReduceStat(stat,increment,showMessages,moveid,attacker,upanim,false,true) if !ret return pbReduceStat(stat,increment,showMessages,moveid,attacker,upanim,true,true) else return ret end end # end of update File: PokeBattle_EffectsFunction: pbReduceStatLine number approx: 538 # UPDATE 11/29/2013 # Contrary # Call increase stat if we have contrary # Added another parameter to determine if we called from within increase # changed from: def pbReduceStat(stat,increment,showMessages,moveid=nil,attacker=nil,downanim=true,selfreduce=false) def pbReduceStat(stat,increment,showMessages,moveid=nil,attacker=nil,downanim=true,selfreduce=false, cont_call=false) # here we call increase if we have contrary return pbIncreaseStat(stat,increment,showMessages,moveid,attacker,downanim,true) if isConst?(self.ability, PBAbilities, :CONTRARY) && !cont_call # end of update Default stat increase/decrease messages are no longer displayed when they shouldn't be --- 11/30/2013 File: PokeBattle_EffectsFunction: pbIncreaseStatLine number approx: 454 (Will be slightly off at this time - I've made undocumented changes to my own) if pbCanIncreaseStatStage?(stat,showMessages) @battle.pbAnimation(moveid,attacker,self) if moveid pbIncreaseStatBasic(stat,increment) @battle.pbCommonAnimation("StatUp",self,nil) if upanim # UPDATE 11/30/2013 # Defiant / other ad hoc messages # add the `if showMessages` to the end of these lines if increment==3 @battle.pbDisplay(arrStatTexts[2]) if showMessages elsif increment==2 @battle.pbDisplay(arrStatTexts[1]) if showMessages else @battle.pbDisplay(arrStatTexts[0]) if showMessages end File: same as aboveFunction: pbReduceStatLine number approx: 594 @battle.pbAnimation(moveid,attacker,self) if moveid pbReduceStatBasic(stat,increment) @battle.pbCommonAnimation("StatDown",self,nil) if downanim # UPDATE 11/30/2013 # ad hoc messages fix # add the `if showMessages` condition after the pbDisplay s below if increment==2 @battle.pbDisplay(arrStatTexts[1]) if showMessages else @battle.pbDisplay(arrStatTexts[0]) if showMessages end # end update Defiant- Not yet implemented --- Done, 11/30/2013 File: PokeBattle_EffectsFunction: pbReduceStatLine number approx: 603First update text is from the previous (for a positioning reference for the Defiant update) # UPDATE 11/30/2013 # ad hoc messages fix # add the `if showMessages` condition after the pbDisplay s below if increment==2 @battle.pbDisplay(arrStatTexts[1]) if showMessages else @battle.pbDisplay(arrStatTexts[0]) if showMessages end # end update # UPDATE 11/30/2013 # Defiant if !selfreduce && isConst?(self.ability, PBAbilities, :DEFIANT) pbIncreaseStat(PBStats::ATTACK,2,false) @battle.pbDisplay(_INTL("Defiant sharply raised {1}'s Attack!", pbThis)) if showMessages end # end of update return true Friend Guard- Not yet implemented --- Done, 11/29/2013 File: PokeBattle_MoveFunction: pbCalcDamageLine number approx: 881 (This is likely off slightly - it goes at the end of the function)Code above and below is for placement reference. #Damage weighting if (options&NOWEIGHTING)==0 random=85+@battle.pbRandom(16) damage=(damage*random/100).floor end if opponent.damagestate.critical damage*=2 end # UPDATE 11/29/2013 # Friend Guard # will now lower damage taken if ally has friend guard if @battle.doublebattle && isConst?(opponent.pbPartner.ability, PBAbilities, :FRIENDGUARD) damage=(damage*0.75).floor end # end of update damage=1 if damage<1 opponent.damagestate.calcdamage=damage return damage end Edited December 3, 2013 by Guhorden Link to comment Share on other sites More sharing options...
Recommended Posts