Turned fusion items into two separate items for the sake of them having different descriptions, fixed ability-changing items not doing so, added Zygarde Cube's Gen 8 effect

This commit is contained in:
Maruno17
2021-08-21 18:26:48 +01:00
parent 41ce9309d7
commit 45fba56455
10 changed files with 335 additions and 129 deletions

View File

@@ -1183,6 +1183,7 @@ BattleHandlers::TargetItemOnHit.add(:WEAKNESSPOLICY,
if target.pbCanRaiseStatStage?(:SPECIAL_ATTACK,target)
target.pbRaiseStatStageByCause(:SPECIAL_ATTACK,2,target,target.itemName,showAnim)
end
battle.pbDisplay(_INTL("The {1} was used up...", target.itemName))
target.pbHeldItemTriggered(item)
}
)

View File

@@ -711,6 +711,8 @@ def pbItemBall(item,quantity=1)
meName = (item.is_key_item?) ? "Key item get" : "Item get"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You found some \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
elsif item == :DNASPLICERS
pbMessage(_INTL("\\me[{1}]You found \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
elsif item.is_machine? # TM or HM
pbMessage(_INTL("\\me[{1}]You found \\c[1]{2} {3}\\c[0]!\\wtnp[30]",meName,itemname,GameData::Move.get(move).name))
elsif quantity>1
@@ -720,7 +722,7 @@ def pbItemBall(item,quantity=1)
else
pbMessage(_INTL("\\me[{1}]You found a \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
end
pbMessage(_INTL("You put the {1} away\\nin the <icon=bagPocket{2}>\\c[1]{3} Pocket\\c[0].",
pbMessage(_INTL("You put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.",
itemname,pocket,PokemonBag.pocketNames()[pocket]))
return true
end
@@ -754,6 +756,8 @@ def pbReceiveItem(item,quantity=1)
meName = (item.is_key_item?) ? "Key item get" : "Item get"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You obtained some \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
elsif item == :DNASPLICERS
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
elsif item.is_machine? # TM or HM
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2} {3}\\c[0]!\\wtnp[30]",meName,itemname,GameData::Move.get(move).name))
elsif quantity>1
@@ -764,7 +768,7 @@ def pbReceiveItem(item,quantity=1)
pbMessage(_INTL("\\me[{1}]You obtained a \\c[1]{2}\\c[0]!\\wtnp[30]",meName,itemname))
end
if $PokemonBag.pbStoreItem(item,quantity) # If item can be added
pbMessage(_INTL("You put the {1} away\\nin the <icon=bagPocket{2}>\\c[1]{3} Pocket\\c[0].",
pbMessage(_INTL("You put the {1} in\\nyour Bag's <icon=bagPocket{2}>\\c[1]{3}\\c[0] pocket.",
itemname,pocket,PokemonBag.pocketNames()[pocket]))
return true
end

View File

@@ -961,7 +961,7 @@ ItemHandlers::UseOnPokemon.add(:PRISONBOTTLE,proc { |item,pkmn,scene|
})
ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:KYUREM)
if !pkmn.isSpecies?(:KYUREM) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -969,51 +969,59 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
poke2 = $Trainer.party[chosen]
if pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:RESHIRAM) &&
!poke2.isSpecies?(:ZEKROM)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
newForm = 0
newForm = 1 if poke2.isSpecies?(:RESHIRAM)
newForm = 2 if poke2.isSpecies?(:ZEKROM)
pkmn.setForm(newForm) {
pkmn.fused = poke2
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:RESHIRAM) && !other_pkmn.isSpecies?(:ZEKROM)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
newForm = 0
newForm = 1 if other_pkmn.isSpecies?(:RESHIRAM)
newForm = 2 if other_pkmn.isSpecies?(:ZEKROM)
pkmn.setForm(newForm) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:DNASPLICERS, :DNASPLICERSUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:DNASPLICERSUSED,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:KYUREM) || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:DNASPLICERSUSED, :DNASPLICERS)
next true
})
ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 2
if !pkmn.isSpecies?(:NECROZMA) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -1021,47 +1029,56 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
poke2 = $Trainer.party[chosen]
if pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:SOLGALEO)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
pkmn.setForm(1) {
pkmn.fused = poke2
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:SOLGALEO)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
pkmn.setForm(1) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NSOLARIZER, :NSOLARIZERUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:NSOLARIZERUSED,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form != 1 || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NSOLARIZERUSED, :NSOLARIZER)
next true
})
ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 1
if !pkmn.isSpecies?(:NECROZMA) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -1069,42 +1086,51 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen<0
poke2 = $Trainer.party[chosen]
if pkmn==poke2
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif poke2.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif poke2.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !poke2.isSpecies?(:LUNALA)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
pkmn.setForm(2) {
pkmn.fused = poke2
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:LUNALA)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
pkmn.setForm(2) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NLUNARIZER, :NLUNARIZERUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:NLUNARIZERUSED,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form != 2 || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!",pkmn.name))
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:NLUNARIZERUSED, :NLUNARIZER)
next true
})
@@ -1124,6 +1150,7 @@ ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE,proc { |item,pkmn,scene|
newabil = (pkmn.ability_index + 1) % 2
newabilname = GameData::Ability.get((newabil == 0) ? abil1 : abil2).name
pkmn.ability_index = newabil
pkmn.ability = nil
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", pkmn.name, newabilname))
next true

View File

@@ -216,7 +216,7 @@ ItemHandlers::BattleUseOnBattler.add(:MAXMUSHROOMS,proc { |item, battler, scene|
})
ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:CALYREX)
if !pkmn.isSpecies?(:CALYREX) || !pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
@@ -224,46 +224,55 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
next false
end
# Fusing
if pkmn.fused.nil?
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:GLASTRIER) &&
!other_pkmn.isSpecies?(:SPECTRIER)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
newForm = 0
newForm = 1 if other_pkmn.isSpecies?(:GLASTRIER)
newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER)
pkmn.setForm(newForm) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
next true
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
next false if chosen < 0
other_pkmn = $Trainer.party[chosen]
if pkmn == other_pkmn
scene.pbDisplay(_INTL("It cannot be fused with itself."))
next false
elsif other_pkmn.egg?
scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
next false
elsif other_pkmn.fainted?
scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
next false
elsif !other_pkmn.isSpecies?(:GLASTRIER) &&
!other_pkmn.isSpecies?(:SPECTRIER)
scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
next false
end
# Unfusing
if $Trainer.party_full?
newForm = 0
newForm = 1 if other_pkmn.isSpecies?(:GLASTRIER)
newForm = 2 if other_pkmn.isSpecies?(:SPECTRIER)
pkmn.setForm(newForm) {
pkmn.fused = other_pkmn
$Trainer.remove_pokemon_at_index(chosen)
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:REINSOFUNITY, :REINSOFUNITYUSED)
next true
})
ItemHandlers::UseOnPokemon.add(:REINSOFUNITYUSED, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:CALYREX) || pkmn.fused.nil?
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
elsif $Trainer.party_full?
scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
next false
end
# Unfusing
pkmn.setForm(0) {
$Trainer.party[$Trainer.party.length] = pkmn.fused
pkmn.fused = nil
scene.pbHardRefresh
scene.pbDisplay(_INTL("{1} changed Forme!", pkmn.name))
}
$PokemonBag.pbChangeItem(:REINSOFUNITYUSED, :REINSOFUNITY)
next true
})
@@ -278,6 +287,7 @@ ItemHandlers::UseOnPokemon.add(:ABILITYPATCH, proc { |item, pkmn, scene|
end
new_ability_name = GameData::Ability.get(new_ability_id).name
pkmn.ability_index = 2
pkmn.ability = nil
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!",
pkmn.name, new_ability_name))
@@ -340,6 +350,34 @@ BattleHandlers::ItemOnSwitchIn.add(:ROOMSERVICE,
}
)
ItemHandlers::UseOnPokemon.add(:ZYGARDECUBE, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:ZYGARDE)
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
case scene.pbShowCommands(_INTL("What will you do with {1}?", pkmn.name),
[_INTL("Change form"), _INTL("Change Ability"), _INTL("Cancel")])
when 0 # Change form
newForm = (pkmn.form == 0) ? 1 : 0
pkmn.setForm(newForm) {
scene.pbRefresh
scene.pbDisplay(_INTL("{1} transformed!", pkmn.name))
}
next true
when 1 # Change ability
new_abil = (pkmn.ability_index + 1) % 2
pkmn.ability_index = new_abil
pkmn.ability = nil
scene.pbRefresh
scene.pbDisplay(_INTL("{1}'s Ability changed! Its Ability is now {2}!", pkmn.name, pkmn.ability.name))
next true
end
next false
})
=begin

View File

@@ -213,10 +213,13 @@ class TriadScene
def pbDisplay(text)
@sprites["helpwindow"].text = text
(Graphics.frame_rate*1.5).floor.times do
timer = 0.0
loop do
Graphics.update
Input.update
pbUpdate
timer += Graphics.delta_s
break if timer >= 1.5
end
end

View File

@@ -23,19 +23,12 @@ Some abilities have changed effects:
Pokémon. In Gen 8, speed- and priority-modifying effects aren't considered,
but in earlier Gens they are.
Some items have changed properties/effects:
- Zygarde Cube now changes a Zygarde's ability.
Other notes:
- In Gen 7+, Shaymin/Hoopa revert their form when withdrawn from storage rather
than when deposited. It still also reverts under other conditions. Shaymin
reverts its form when deposited in the Day Care (all Gens).
- If a battle ends because of Rocky Helmet damage, the side that the Rocky
Helmet holder is on should lose (Gen 7+) or win (Gen 6-).
- Maybe the DNA Splicers/N-Solarizer/N-Lunarizer/Reins of Unity should actually
be two items each (one that combines, one that splits) and they alternate upon
use. No reasonable game would have multiple sets of Pokémon to fuse at once,
so allowing just one of each fusion at a time is probably fine.
Can use Fly from within the Town Map if possible. (Good QoL, add if possible.)
(Will be implemented by me in the next PR)
@@ -161,6 +154,11 @@ Other changes:
Stick changed.
- Changes to evolutions due to removal of moss rock/ice rock/magnetic field.
- Form differences.
- Maybe the DNA Splicers/N-Solarizer/N-Lunarizer/Reins of Unity should actually
be two items each (one that combines, one that splits) and they alternate upon
use. No reasonable game would have multiple sets of Pokémon to fuse at once,
so allowing just one of each fusion at a time is probably fine.
- Zygarde Cube now changes a Zygarde's form/ability.
What happens to the PP of Iron Head when turned into/from Behemoth Blade/Bash
for Zacian/Zamazenta? It gets decreased to the total PP if it is higher than the