- 81
- Posts
- 9
- Years
- Seen Sep 7, 2019
In its own script above main
For the cube, create a new item in items.txt indexed (Change it to fit key items in your game)
In PItem_Items place
anywhere outside of any def
Search
for in PScreen_Bag and under it put
In the same script search for
under it put
The variables are reserved for the moves (Can be changed, One of these has to be on for the cube to work, otherwise it'll say you can't do nothing with it)
Call the Zygarde Core/Stone mechanic using "[S-HIGHLIGHT]pbZygardeConstruct[/S-HIGHLIGHT]"
If any edits are made or mistakes are found please let me know. This is free to use with credit of course.
#Note! This also uses a windowskin called "blacktextskin" so you want to make sure you either change those or create a window skin with that name
Code:
#Zygarde Cube and Core mechanic by BlackStarG5
#Free to use with credit!!
ZYGARDECELLS = 107 #Variable reserved for this
COREEXTREMESPEED = 276 #Switch reserved for this
CORETHOUSANDARROWS = 277 #Switch reserved for this
COREDRAGONDANCE = 278 #Switch reserved for this
CORETHOUSANDWAVES = 279 #Switch reserved for this
CORECOREENFORCER = 280 #Switch reserved for this
def pbZygardeConstruct
loop do
choices = ["Assembly","Separation","What is assembly?","What is separation?","Quit"]
cmd = Kernel.pbMessage(_INTL("What would you like to do?"), choices, choices.length - 1)
if choices[cmd]=="Assembly"
choices = ["Using Zygarde and the Zygarde Cube","Using the Zygarde Cube only","What assembly methods are available?","Quit"]
cmd = Kernel.pbMessage(_INTL("Please select how you'd like to assemble Zygarde."), choices, choices.length - 1)
if choices[cmd]=="Using Zygarde and the Zygarde Cube"
Kernel.pbMessage(_INTL("Please select Zygarde."))
pbChooseAblePokemon(1,3)
poke=$Trainer.party[$game_variables[1]]
if poke.species==PBSpecies::ZYGARDE
if $game_variables[ZYGARDECELLS]>9 && poke.form==1
if $game_variables[ZYGARDECELLS]>=50 && poke.form==1
Kernel.pbMessage(_INTL("The 50% stored in the Zygarde Cube will be used to assemble Zygarde 50% Forme!"))
choices = ["Yes","No"]
cmd = Kernel.pbMessage(_INTL("Is that OK?"), choices, choices.length - 1)
if choices[cmd]=="Yes"
poke=pbGetPokemon(1)
poke.form=0
$game_variables[ZYGARDECELLS]-=40
Kernel.pbMessage(_INTL("Cells have appeared! Zygarde transformed to Zygarde 50% Forme!"))
Kernel.pbMessage(_INTL("The remaining Cells disappeared."))
Kernel.pbMessage(_INTL("Zygarde has gone into a Poke Ball!"))
break
elsif choices[cmd]=="No"
Kernel.pbMessage(_INTL("Quitting the assembly operation!"))
return false
end
else
Kernel.pbMessage(_INTL("You do not have enough Cells!"))
end
elsif poke.form==0 && $game_variables[ZYGARDECELLS]>=50
Kernel.pbMessage(_INTL("From your chosen Zygarde and the 50% now in the Zygarde Cube, the unified Zygarde with the Power Construct Ability will be assembled!"))
choices = ["Yes","No"]
cmd = Kernel.pbMessage(_INTL("Is that OK?"), choices, choices.length - 1)
if choices[cmd]=="Yes"
poke.setAbility(2)
$game_variables[ZYGARDECELLS]-=50
Kernel.pbMessage(_INTL("Zygarde has been reassembled!"))
Kernel.pbMessage(_INTL("It's the unified Zygarde with the the Power Construct Ability!"))
Kernel.pbMessage(_INTL("Zygarde has gone into a Poke Ball!"))
break
elsif choices[cmd]=="No"
Kernel.pbMessage(_INTL("Quitting the assembly operation!"))
break
return false
end
else
Kernel.pbMessage(_INTL("You do not have enough Cells!"))
end
else
Kernel.pbMessage(_INTL("You cannot assemble Pokemon other than Zygarde!"))
Kernel.pbMessage(_INTL("Quitting the assembly operation!"))
return false
end
elsif choices[cmd]=="Using the Zygarde Cube only"
if $game_variables[ZYGARDECELLS]>10
if $game_variables[ZYGARDECELLS]<49
Kernel.pbMessage(_INTL("Zygarde will be assembled with the Cores and Cells within the Zygarde Cube only!"))
Kernel.pbMessage(_INTL("The 10% stored in the Zygarde Cube will be used to assemble Zygarde 10% Forme!"))
choices = ["Yes","No"]
cmd = Kernel.pbMessage(_INTL("Is that OK?"), choices, choices.length - 1)
if choices[cmd]=="Yes"
p=PokeBattle_Pokemon.new(:ZYGARDE,30,$Trainer)
p.form=1
p.makeNotShiny
p.pbLearnMove(:SAFEGUARD)
p.pbLearnMove(:BIND)
p.pbLearnMove(:DIG)
p.pbLearnMove(:LANDSWRATH)
p.setAbility(0)
p.calcStats
Kernel.pbAddPokemon(p)
$game_variables[ZYGARDECELLS]-=10
break
Kernel.pbMessage(_INTL("A new Zygarde has been assembled!"))
Kernel.pbMessage(_INTL("It's Zygarde 10% Forme!"))
Kernel.pbMessage(_INTL("Zygarde has gone into a Poke Ball!"))
elsif choices[cmd]=="No"
break
Kernel.pbMessage(_INTL("Quitting the assembly operation!"))
return false
end
end
else
Kernel.pbMessage(_INTL("You do not have enough Cells!"))
end
if $game_variables[ZYGARDECELLS]>49
if $game_variables[ZYGARDECELLS]<100
Kernel.pbMessage(_INTL("Zygarde will be assembled with the Cores and Cells within the Zygarde Cube only!"))
Kernel.pbMessage(_INTL("The 50% stored in the Zygarde Cube will be used to assemble Zygarde 50% Forme!"))
choices = ["Yes","No"]
cmd = Kernel.pbMessage(_INTL("Is that OK?"), choices, choices.length - 1)
if choices[cmd]=="Yes"
p=PokeBattle_Pokemon.new(:ZYGARDE,50,$Trainer)
p.form=0
p.makeNotShiny
p.pbLearnMove(:SAFEGUARD)
p.pbLearnMove(:BIND)
p.pbLearnMove(:SANDSTORM)
p.pbLearnMove(:HAZE)
p.setAbility(0)
p.calcStats
Kernel.pbAddPokemon(p)
$game_variables[ZYGARDECELLS]-=50
break
Kernel.pbMessage(_INTL("A new Zygarde has been assembled!"))
Kernel.pbMessage(_INTL("It's Zygarde 50% Forme!"))
Kernel.pbMessage(_INTL("Zygarde has gone into a Poke Ball!"))
elsif choices[cmd]=="No"
break
Kernel.pbMessage(_INTL("Quitting the assembly operation!"))
return false
end
end
end
if $game_variables[ZYGARDECELLS]>99
if $game_variables[ZYGARDECELLS]>99
Kernel.pbMessage(_INTL("Zygarde will be assembled with the Cores and Cells within the Zygarde Cube only!"))
Kernel.pbMessage(_INTL("The 50% stored in the Zygarde Cube will be used to assemble Zygarde 50% Forme!"))
Kernel.pbMessage(_INTL("The Zygarde will have the Power Construct Ability."))
choices = ["Yes","No"]
cmd = Kernel.pbMessage(_INTL("Is that OK?"), choices, choices.length - 1)
if choices[cmd]=="Yes"
p=PokeBattle_Pokemon.new(:ZYGARDE,50,$Trainer)
p.form=0
p.makeNotShiny
p.pbLearnMove(:SAFEGUARD)
p.pbLearnMove(:BIND)
p.pbLearnMove(:SANDSTORM)
p.pbLearnMove(:HAZE)
p.setAbility(2)
p.calcStats
Kernel.pbAddPokemon(p)
$game_variables[ZYGARDECELLS]-=50
break
Kernel.pbMessage(_INTL("A new Zygarde has been assembled!"))
Kernel.pbMessage(_INTL("It's Zygarde 50% Forme!"))
Kernel.pbMessage(_INTL("Zygarde has gone into a Poke Ball!"))
elsif choices[cmd]=="No"
break
Kernel.pbMessage(_INTL("Quitting the assembly operation!"))
return false
end
end
end
elsif choices[cmd]=="What assembly methods are available?"
Kernel.pbMessage(_INTL("There are two ways to achieve Zygarde assembly."))
Kernel.pbMessage(_INTL("One is to take a Zygarde in your party and add to it the Cells stored in the Zygarde Cube!"))
Kernel.pbMessage(_INTL("The other way is to assemble the Cells stored in the Zygarde Cube to form a whole new Zygarde!"))
elsif choices[cmd]=="Quit"
return false
end
elsif choices[cmd]=="Separation"
Kernel.pbMessage(_INTL("Please select the Zygarde you'd like to speparate into cells"))
pbChooseAblePokemon(1,3)
poke=$Trainer.party[$game_variables[1]]
party=$Trainer.party[$game_variables[1]]
if poke.species==PBSpecies::ZYGARDE
if $Trainer.party.length>1
Kernel.pbMessage(_INTL("Once separated, the separated Zygarde cannot be put back together."))
Kernel.pbMessage(_INTL("You'll lose all it's moves, Ribbons-\\neverything about it."))
choices = ["Yes","No"]
cmd = Kernel.pbMessage(_INTL("Would you like to separate the Zygarde you've selected?"), choices, choices.length - 1)
if choices[cmd]=="Yes"
if poke.form==1 && !isConst?(poke.ability,PBAbilities,:POWERCONSTRUCT)
Kernel.pbMessage(_INTL("Zygarde has separated."))
Kernel.pbMessage(_INTL("The percentage the Zygarde Cube has increased by was 10."))
$game_variables[ZYGARDECELLS]+=10
$Trainer.party.delete_at($game_variables[1])
elsif poke.form==1 && isConst?(poke.ability,PBAbilities,:POWERCONSTRUCT)
Kernel.pbMessage(_INTL("Zygarde has separated."))
Kernel.pbMessage(_INTL("The percentage the Zygarde Cube has increased by was 100."))
$game_variables[ZYGARDECELLS]+=100
$Trainer.party.delete_at($game_variables[1])
elsif poke.form==0 && !isConst?(poke.ability,PBAbilities,:POWERCONSTRUCT)
Kernel.pbMessage(_INTL("Zygarde has separated."))
Kernel.pbMessage(_INTL("The percentage the Zygarde Cube has increased by was 50."))
$game_variables[ZYGARDECELLS]+=50
$Trainer.party.delete_at($game_variables[1])
elsif poke.form==0 && isConst?(poke.ability,PBAbilities,:POWERCONSTRUCT)
Kernel.pbMessage(_INTL("Zygarde has separated."))
Kernel.pbMessage(_INTL("The percentage the Zygarde Cube has increased by was 100."))
$game_variables[ZYGARDECELLS]+=100
$Trainer.party.delete_at($game_variables[1])
end
elsif choices[cmd]=="No"
Kernel.pbMessage(_INTL("Quitting the separation operation!"))
return false
end
else
Kernel.pbMessage(_INTL("That is your only Pokemon. It can't be divided."))
return false
end
else
Kernel.pbMessage(_INTL("The Pokemon can only be Zygarde."))
return false
end
elsif choices[cmd]=="What is assembly?"
Kernel.pbMessage(_INTL("It is called assembly when Zygarde is formed from the cells stored in the Zygarde Cube!"))
elsif choices[cmd]=="What is separation?"
Kernel.pbMessage(_INTL("It is called separation when Zygarde is broken down into cells which are then stored in the Zygarde Cube!"))
elsif choices[cmd]=="Quit"
return false
end
end
end
ItemHandlers::UseFromBag.add(:ZYGARDECUBE,proc{|item|
pbChooseAblePokemon(1,3)
poke=$Trainer.party[$game_variables[1]]
if poke.species==PBSpecies::ZYGARDE
choices = ["Teach Move", "Change Forms"]
#choices.push("Change Forms") if isConst?(poke.ability,PBAbilities,:POWERCONSTRUCT)
if poke.species==PBSpecies::ZYGARDE
cmd = Kernel.pbMessage(_INTL("What would you like to do?"), choices, choices.length - 1)
if choices[cmd]=="Teach Move"
choices = []
choices.push("Extreme Speed") if $game_switches[COREEXTREMESPEED] # Switch for Z-Core 1
choices.push("Thousand Arrows") if $game_switches[CORETHOUSANDARROWS] # Switch for Z-Core 2
choices.push("Dragon Dance") if $game_switches[COREDRAGONDANCE] # Switch for Z-Core 3
choices.push("Thousand Waves") if $game_switches[CORETHOUSANDWAVES] # Switch for Z-Core 4
choices.push("Core Enforcer") if $game_switches[CORECOREENFORCER] # Switch for Z-Core 5
choices.push("Cancel")
cmd = Kernel.pbMessage(_INTL("What would you like to teach it?"), choices, choices.length - 1)
if choices[cmd]=="Extreme Speed"
move=getConst(PBMoves,:EXTREMESPEED)
pbLearnMove(poke,move)
elsif choices[cmd]=="Thousand Arrows"
move=getConst(PBMoves,:THOUSANDARROWS)
pbLearnMove(poke,move)
elsif choices[cmd]=="Dragon Dance"
move=getConst(PBMoves,:DRAGONDANCE)
pbLearnMove(poke,move)
elsif choices[cmd]=="Thousand Waves"
move=getConst(PBMoves,:THOUSANDWAVES)
pbLearnMove(poke,move)
elsif choices[cmd]=="Core Enforcer"
move=getConst(PBMoves,:COREENFORCER)
pbLearnMove(poke,move)
elsif choices[cmd]=="Cancel"
return 1
end
elsif choices[cmd]=="Change Forms"
if !isConst?(poke.ability,PBAbilities,:POWERCONSTRUCT)
Kernel.pbMessage(_INTL("Only a Zygarde with the Power Construct Ability can change its Forme."))
return 1
end
choices = []
choices.push("10%")
choices.push("50%")
choices.push("Cancel")
cmd = Kernel.pbMessage(_INTL("What form would you like?"), choices, choices.length - 1)
if choices[cmd]=="10%"
if poke.form==0
newform=poke.form==1
poke.form=1
Kernel.pbMessage(_INTL("{1} changed Form!",poke.name))
#@scene.pbEndScene
else
Kernel.pbMessage(_INTL("It's already 10%!"))
return 1
end
elsif choices[cmd]=="50%"
if poke.form>=1
newform=poke.form==0
poke.form=0
Kernel.pbMessage(_INTL("{1} changed Form!",poke.name))
else
Kernel.pbMessage(_INTL("It's already 50%!"))
return 1
end
end
elsif choices[cmd]=="Cancel"
return false
end
else
Kernel.pbMessage(_INTL("You can't do anything with it."))
return 1
end
else
Kernel.pbMessage(_INTL("It won't have any effect."))
return 1
end
next 1 # Continue
})
For the cube, create a new item in items.txt indexed (Change it to fit key items in your game)
Code:
XXX,ZYGARDECUBE,Zygarde Cube,8,0,"An item to store Zygarde Cores and Cells. You can also use it to teach Zygarde moves.",2,0,6,
In PItem_Items place
Code:
def pbIsZCube?(item)
return true if isConst?(item,PBItems,:ZYGARDECUBE)
return false
end
Search
Code:
commands[cmdUse=commands.length]=_INTL("Use") if ItemHandlers.hasOutHandler(item) || (pbIsMachine?(item) && $Trainer.party.length>0)
Code:
commands[cmdCheck=commands.length]=_INTL("Check") if pbIsZCube?(item)
In the same script search for
Code:
if cmdUse>=0 && command==cmdUse # Use item
ret=pbUseItem(@bag,item,@scene)
# 0=Item wasn't used; 1=Item used; 2=Close Bag to use in field
break if ret==2 # End screen
@scene.pbRefresh
next
Code:
elsif cmdCheck>=0 && command==cmdCheck # Check Zygarde Cube
Kernel.pbMessage(_INTL("\\w[blacktextskin]\\c[8]You have collected {1}/100 Zygarde Cores and Zygarde Cells.",$game_variables[107]))
Kernel.pbMessage(_INTL("\\w[blacktextskin]\\c[8]You have {1} in the Zygarde Cube now.",$game_variables[107]))
@scene.pbRefresh
The variables are reserved for the moves (Can be changed, One of these has to be on for the cube to work, otherwise it'll say you can't do nothing with it)
Call the Zygarde Core/Stone mechanic using "[S-HIGHLIGHT]pbZygardeConstruct[/S-HIGHLIGHT]"
If any edits are made or mistakes are found please let me know. This is free to use with credit of course.
#Note! This also uses a windowskin called "blacktextskin" so you want to make sure you either change those or create a window skin with that name
Last edited: