Added code for Gen 8 alternate forms

This commit is contained in:
Maruno17
2021-07-08 23:04:21 +01:00
parent ba6806aa5b
commit d5aeeaca7b
6 changed files with 150 additions and 29 deletions

View File

@@ -271,9 +271,10 @@ Hunger Switch
At the end of each round, switches the bearer's form (if it is Morpeko). At the end of each round, switches the bearer's form (if it is Morpeko).
Ice Face Ice Face
When bearer is hit by a physical move while in its initial form, it takes no When bearer is hit by a physical move while in its initial form (including
damage and its form changes. At he end of a round in which hail weather started, hitting itself in confusion), it takes no damage and its form changes. At the
the bearer regains its initial form. end of a round in which hail weather started, and immediately upon switching in
while hail weather exists, the bearer regains its initial form.
Gulp Missile Gulp Missile
After using Surf/Dive, changes the bearer's form depending on its HP. If hit by After using Surf/Dive, changes the bearer's form depending on its HP. If hit by

View File

@@ -198,7 +198,9 @@ def pbDayCareGenerateEgg
egg.form = newForm egg.form = newForm
end end
# Inheriting regional form # Inheriting regional form
if [:RATTATA, :SANDSHREW, :VULPIX, :DIGLETT, :MEOWTH, :GEODUDE, :GRIMER].include?(babyspecies) if [:RATTATA, :SANDSHREW, :VULPIX, :DIGLETT, :MEOWTH, :GEODUDE, :GRIMER,
:PONYTA, :SLOWPOKE, :FARFETCHD, :ARTICUNO, :ZAPDOS, :MOLTRES, :CORSOLA,
:ZIGZAGOON, :DARUMAKA, :YAMASK, :STUNFISK].include?(babyspecies)
if mother.form==1 if mother.form==1
egg.form = 1 if mother.hasItem?(:EVERSTONE) egg.form = 1 if mother.hasItem?(:EVERSTONE)
elsif father.species_data.get_baby_species(true, mother.item_id, father.item_id) == babyspecies elsif father.species_data.get_baby_species(true, mother.item_id, father.item_id) == babyspecies

View File

@@ -588,12 +588,125 @@ MultipleForms.register(:NECROZMA,{
} }
}) })
MultipleForms.register(:CRAMORANT, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:TOXEL, {
"getFormOnCreation" => proc { |pkmn|
next 1 if [:LONELY, :BOLD, :RELAXED, :TIMID, :SERIOUS, :MODEST, :MILD,
:QUIET, :BASHFUL, :CALM, :GENTLE, :CAREFUL].include?(pkmn.nature_id)
next 0
}
})
MultipleForms.copy(:TOXEL, :TOXTRICITY)
MultipleForms.register(:SINISTEA, {
"getFormOnCreation" => proc { |pkmn|
next 1 if rand(100) == 0
next 0
}
})
MultipleForms.copy(:SINISTEA, :POLTEAGEIST)
# A Milcery will always have the same flavor, but it is randomly chosen.
MultipleForms.register(:MILCERY, {
"getForm" => proc { |pkmn|
num_flavors = 9
sweets = [:STRAWBERRYSWEET, :BERRYSWEET, :LOVESWEET, :STARSWEET,
:CLOVERSWEET, :FLOWERSWEET, :RIBBONSWEET]
if sweets.include?(pkmn.item_id)
next sweets.index(pkmn.item_id) + (pkmn.personalID % num_flavors) * sweets.length
end
next 0
}
})
MultipleForms.register(:ALCREMIE, {
"getFormOnCreation" => proc { |pkmn|
num_flavors = 9
num_sweets = 7
next rand(num_flavors * num_sweets)
}
})
MultipleForms.register(:EISCUE, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0 if pkmn.fainted? || endBattle
}
})
MultipleForms.register(:INDEEDEE, {
"getForm" => proc { |pkmn|
next pkmn.gender
}
})
MultipleForms.register(:MORPEKO, {
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0 if pkmn.fainted? || endBattle
}
})
MultipleForms.register(:ZACIAN, {
"getFormOnEnteringBattle" => proc { |pkmn, wild|
next 1 if pkmn.hasItem?(:RUSTEDSWORD)
next 0
},
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:ZAMAZENTA, {
"getFormOnEnteringBattle" => proc { |pkmn, wild|
next 1 if pkmn.hasItem?(:RUSTEDSHIELD)
next 0
},
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
}
})
MultipleForms.register(:URSHIFU, {
"getForm" => proc { |pkmn|
next rand(2)
}
})
MultipleForms.register(:CALYREX, {
"onSetForm" => proc { |pkmn, form, oldForm|
case form
when 0 # Normal
if pkmn.hasMove?(:GLACIALLANCE)
pkmn.forget_move(:GLACIALLANCE)
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, GameData::Move.get(:GLACIALLANCE).name))
end
if pkmn.hasMove?(:ASTRALBARRAGE)
pkmn.forget_move(:ASTRALBARRAGE)
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, GameData::Move.get(:ASTRALBARRAGE).name))
end
pbLearnMove(pkmn, :CONFUSION) if pkmn.numMoves == 0
when 1 # Ice Rider
pbLearnMove(pkmn, :GLACIALLANCE, true)
when 2 # Shadow Rider
pbLearnMove(pkmn, :ASTRALBARRAGE, true)
end
}
})
#=============================================================================== #===============================================================================
# Regional forms # Regional forms
#===============================================================================
# These species don't have visually different regional forms, but they need to # These species don't have visually different regional forms, but they need to
# evolve into different forms depending on the location where they evolved. # evolve into different forms depending on the location where they evolved.
#===============================================================================
# Alolan forms
MultipleForms.register(:PIKACHU, { MultipleForms.register(:PIKACHU, {
"getForm" => proc { |pkmn| "getForm" => proc { |pkmn|
next if pkmn.form_simple >= 2 next if pkmn.form_simple >= 2
@@ -607,3 +720,18 @@ MultipleForms.register(:PIKACHU, {
}) })
MultipleForms.copy(:PIKACHU, :EXEGGCUTE, :CUBONE) MultipleForms.copy(:PIKACHU, :EXEGGCUTE, :CUBONE)
# Galarian forms
MultipleForms.register(:KOFFING, {
"getForm" => proc { |pkmn|
next if pkmn.form_simple >= 2
if $game_map
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
next 1 if map_metadata && map_metadata.town_map_position &&
map_metadata.town_map_position[0] == 2 # Galar region
end
next 0
}
})
MultipleForms.copy(:KOFFING, :MIMEJR)

View File

@@ -82,27 +82,10 @@ New evolution methods:
Add AI for new moves/items/abilities. Add AI for new moves/items/abilities.
Code for the form differences: Zacian/Zamazenta need code that changes their movesets upon entering/leaving
- Cramorant (in battle only) battle. Can't use "onSetForm" since that's called after the battler is
- Toxel/Toxtricity (depends on nature) initialized and pbOnEnteringBattle doesn't have access to the battler (could
- Sinistea/Polteageist (form 1 is rare and not inheritable by breeding) change this).
- Milcery (depends on held item and random number)
- Alcremie (random)
- Eiscue (in battle only)
- Indeedee (gender)
- Morpeko (in battle only)
- Zacian
- Zamazenta
- Kubfu (no code needed; form is manually set just before evolution)
- Urshifu
- Calyrex (fising, learns move upon fusion/defusion)
- Galarian forms (make sure breeding inherits them)(Koffing and Mime Jr. are the
same)
I think there are some alternate forms which don't have a hidden ability while
their base forms do. I don't think the compiler supports this, and instead
treats Abilities and HiddenAbilities separately. Can work around this by setting
HiddenAbilities to be the same as Abilities. I'm not too happy with this.
#=============================================================================== #===============================================================================
# Low priority or ignorable # Low priority or ignorable
@@ -120,14 +103,19 @@ Town Map added to the pause menu. (Don't bother adding.)
Remote access to storage boxes. See the Pokémon Box Link item. Remote access to storage boxes. See the Pokémon Box Link item.
New evolution methods: New evolution methods:
- Milcery: spinning while holding an item. (Doesn't suit our control scheme, - Milcery: spinning while holding an item. (Doesn't suit our control scheme.
we're not adding a way to easily spin on the spot just for this, cf. We're not adding a way to easily spin on the spot just for this, cf.
not having to turn your computer upside-down to evolve Inkay.) not having to turn your computer upside-down to evolve Inkay.)
- Galarian Yamask: going to a particular spot after a battle in which it lost - Galarian Yamask: going to a particular spot after a battle in which it lost
49+ HP from a single attack and hasn't fainted since then; 49+ HP from a single attack and hasn't fainted since then;
healing doesn't affect this. (Utter nonsense, find a better healing doesn't affect this. (Utter nonsense, find a better
way.) way.)
I think there are some alternate forms which don't have a hidden ability while
their base forms do. I don't think the compiler supports this, and instead
treats Abilities and HiddenAbilities separately. Can work around this by setting
HiddenAbilities to be the same as Abilities. I'm not too happy with this.
#=============================================================================== #===============================================================================
# Implemented # Implemented
#=============================================================================== #===============================================================================

View File

@@ -1397,6 +1397,7 @@ Moves = 1,ASTONISH,1,PROTECT,4,HAZE,8,NIGHTSHADE,12,DISABLE,16,BRUTALSWING,20,CR
TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQUAKE,ENDURE,ENERGYBALL,FACADE,FAKETEARS,HEX,IMPRISON,IRONDEFENSE,NASTYPLOT,PAYBACK,POLTERGEIST,PROTECT,PSYCHIC,RAINDANCE,REST,ROCKSLIDE,ROCKTOMB,ROUND,SAFEGUARD,SANDSTORM,SHADOWBALL,SLEEPTALK,SNORE,SUBSTITUTE,THIEF,TOXICSPIKES,TRICKROOM,WILLOWISP,WONDERROOM,ZENHEADBUTT TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQUAKE,ENDURE,ENERGYBALL,FACADE,FAKETEARS,HEX,IMPRISON,IRONDEFENSE,NASTYPLOT,PAYBACK,POLTERGEIST,PROTECT,PSYCHIC,RAINDANCE,REST,ROCKSLIDE,ROCKTOMB,ROUND,SAFEGUARD,SANDSTORM,SHADOWBALL,SLEEPTALK,SNORE,SUBSTITUTE,THIEF,TOXICSPIKES,TRICKROOM,WILLOWISP,WONDERROOM,ZENHEADBUTT
Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power. Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power.
Generation = 8 Generation = 8
Evolutions = RUNERIGUS,Level,34
#------------------------------- #-------------------------------
[DEERLING,1] [DEERLING,1]
FormName = Summer Form FormName = Summer Form

View File

@@ -1397,6 +1397,7 @@ Moves = 1,ASTONISH,1,PROTECT,4,HAZE,8,NIGHTSHADE,12,DISABLE,16,BRUTALSWING,20,CR
TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQUAKE,ENDURE,ENERGYBALL,FACADE,FAKETEARS,HEX,IMPRISON,IRONDEFENSE,NASTYPLOT,PAYBACK,POLTERGEIST,PROTECT,PSYCHIC,RAINDANCE,REST,ROCKSLIDE,ROCKTOMB,ROUND,SAFEGUARD,SANDSTORM,SHADOWBALL,SLEEPTALK,SNORE,SUBSTITUTE,THIEF,TOXICSPIKES,TRICKROOM,WILLOWISP,WONDERROOM,ZENHEADBUTT TutorMoves = ALLYSWITCH,ATTRACT,BRUTALSWING,CALMMIND,DARKPULSE,EARTHPOWER,EARTHQUAKE,ENDURE,ENERGYBALL,FACADE,FAKETEARS,HEX,IMPRISON,IRONDEFENSE,NASTYPLOT,PAYBACK,POLTERGEIST,PROTECT,PSYCHIC,RAINDANCE,REST,ROCKSLIDE,ROCKTOMB,ROUND,SAFEGUARD,SANDSTORM,SHADOWBALL,SLEEPTALK,SNORE,SUBSTITUTE,THIEF,TOXICSPIKES,TRICKROOM,WILLOWISP,WONDERROOM,ZENHEADBUTT
Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power. Pokedex = A clay slab with cursed engravings took possession of a Yamask. The slab is said to be absorbing the Yamask's dark power.
Generation = 8 Generation = 8
Evolutions = RUNERIGUS,Level,34
#------------------------------- #-------------------------------
[DEERLING,1] [DEERLING,1]
FormName = Summer Form FormName = Summer Form