Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Guys, for Power Construct I made this:
- In 'PokeBattle_Battler' added:
- attr_accessor :captured
- attr_accessor :startform # Greninja, Zygarde and Minior
- attr_accessor :originalhp # Zygarde
- In ' def pbInitPokemon(pkmn,pkmnIndex)':
- @iv[4] = pkmn.iv[4]
- @iv[5] = pkmn.iv[5]
- @startform = @form # Minior
- @originalhp = @hp # Zygarde
- end
- Inside ' def pbFaint(showMessage=true)':
- @pokemon.makeUnmega if self.isMega?
- @pokemon.makeUnprimal if self.isPrimal?
- if isConst?(self.species,PBSpecies,:GRENINJA); self.form=0; end
- if isConst?(self.species,PBSpecies,:MIMIKYU); self.form=0; end
- if isConst?(self.species,PBSpecies,:ZYGARDE) && self.form==2
- if self.startform>0; self.form=startform; else; self.form=rand(2); end
- end
- @fainted=true
- # reset choice
- And works perfectly when Pokémon dies inside the battle.
- To trigger the ability, I added below Moxie's code (inside PokeBattle_Battle script):
- for i in priority
- next if i.fainted?
- # Power Construct
- if i.hasWorkingAbility(:POWERCONSTRUCT) && isConst?(i.species,PBSpecies,:ZYGARDE)
- if i.hp<((i.totalhp/2).floor) && i.form!=2
- i.startform=i.form
- i.originalhp=i.hp
- i.form=2
- pbDisplay(_INTL("You sense the presence of many!"))
- pbCommonAnimation("PowerConstruct",i,nil)
- i.pbUpdate(true)
- scene.pbChangePokemon(i,i.pokemon)
- i.type1=getConst(PBTypes,:DRAGON); i.type2=getConst(PBTypes,:GROUND)
- pbCommonAnimation("PowerConstruct2",i,nil)
- pbDisplay(_INTL("{1} transformed into its Complete Forme!",i.pbThis))
- PBDebug.log("[Form changed] #{i.pbThis} changed to form #{i.form}")
- end
- end
- But if I add here:
- def pbAfterBattle(decision,canlose)
- for i in $Trainer.party
- (i.makeUnmega rescue nil); (i.makeUnprimal rescue nil)
- if isConst?(i.species,PBSpecies,:GRENINJA); i.form=0; end
- if isConst?(i.species,PBSpecies,:MIMIKYU); i.form=0; end
- if isConst?(i.species,PBSpecies,:ZYGARDE) && i.form==2
- if i.startform>0; i.form=startform
- else; i.form=rand(2)
- end
- if originalhp>i.totalhp; i.hp=i.totalhp
- else; i.hp=originalhp
- end
- end
- end
- if $PokemonGlobal.partner
- After battle, give me error because the game didn't recognize 'startform' (possibly originalhp too). Here the issue:
- ---------------------------
- Pokemon Essentials
- ---------------------------
- [Pokémon Essentials version 17.2]
- Exception: RuntimeError
- Message: Script error within event 16 (coords 26,6), map 3 (Red's house):
- Exception: NoMethodError
- Message: PField_Battles:395:in `pbAfterBattle'undefined method `startform' for #<PokeBattle_Pokemon:0x9ae2ea8>
- ***Full script:
- #pbDoubleWildBattle(:KAKUNA,95,:METAPOD,100)
- pbWildBattle(:REGIGIGAS,55)
- Interpreter:243:in `pbExecuteScript'
- PField_Battles:390:in `each'
- PField_Battles:390:in `pbAfterBattle'
- PField_Battles:102:in `pbWildBattle'
- PField_Battles:98:in `pbBattleAnimation'
- PField_Battles:98:in `pbWildBattle'
- (eval):2:in `pbExecuteScript'
- Interpreter:1606:in `eval'
- Interpreter:243:in `pbExecuteScript'
- Interpreter:1606:in `command_355'
- Interpreter:276:in `pbExecuteScript'
- Interpreter:1606:in `command_355'
- Interpreter:494:in `execute_command'
- Interpreter:193:in `update'
- Interpreter:106:in `loop'
- Interpreter:198:in `update'
- Scene_Map:163:in `update'
- Scene_Map:161:in `loop'
- Scene_Map:170:in `update'
- Scene_Map:234:in `main'
- What could be?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement