- 1
- Posts
- 7
- Years
- Seen Mar 5, 2019
So I'm working on a game (well learning how to RMXP-Essentials using other games already made really) and I have these three game design rules I am trying to implement.
Rule 1: No type is weak to itself. (Just a Types.txt modification.)
Rule 2: No type is resistant to itself. (Just a Types.txt modification.)
Rule 3: If a Pokémon has two types, A and B, and A is weak to B, then in that case the Pokémon's B type will protect it from enemy attacks of type B to eliminate a weakness.
I need to put the finishing touches on this blob of script but I am not sure where it goes.
def pbNewIdea? (attacker,opponent)
if isConst?(type,PBTypes,:NORMAL) && opponent.hasType?(:NORMAL)
|| ifConst?(type,PBTypes,:FIRE) && opponent.hasTYpe?(:FIRE)
|| if Const?(type,PBTypes:WATER) && opponent.hasType?(:WATER)
|| if Const?(typePBTypes:ELECTRIC) && opponent.hasType?(:ELECTRIC)
|| if Const?(typePBTypes:GRASS) && opponent.hasType?(:GRASS)
|| if Const?(typePBTypes:ICE) && opponent.hastType?(:ICE)
|| if Const?(typePBTypes:FIGHTING) && opponent.hastType?(:FIGHTING)
|| if Const?(typePBTypes:POISON) && opponent.hastType?(:POISON)
|| if Const?(typePBTypes:GROUND) && opponent.hastType?(:GROUND)
|| if Const?(typePBTypes:FLYING) && opponent.hastType?(:FLYING)
|| if Const?(typePBTypes:PSYCHIC) && opponent.hastType?(:PSYCHIC)
||if Const?(typePBTypes:BUG) && opponent.hastType?(:BUG)
|| if Const?(typePBTypes:ROCK) && opponent.hastType?(:ROCK)
||if Const?(typePBTypes:GHOST) && opponent.hastType?(:GHOST)
|| if Const?(typePBTypes:DRAGON) && opponent.hastType?(:DRAGON)
|| if Const?(typePBTypes:DARK) && opponent.hastType?(:ARK)
|| if Const?(typePBTypes:STEEL) && opponent.hastType?(:STEEL)
|| if Const?(typePBTypes:FAIRY) && opponent.hastType?(:FAIRY)
I don't want to change a Pokémon's type with these rules, just override a Pokémon's weaknesses by changing the damage's effectiveness multiplier and having the game spit out a message like "... Bulbasaur is familiar with the poison! It took normal damage."
Examples of how it should play out in game.
- Tangela takes 2x supereffective damage from Poison Sting. (So this code shouldn't impact that at all.)
- Bulbasaur takes 1x normal damage from Poison Sting. (Despite poison not being resistant to itself anymore.
- Kabutops takes 1x normal damage from Hydro Pump (Despite water not being resistant to itself anymore.)
- Scyther takes 1x normal damage from Flying (Flying was never resistant to itself but because of Rule #3 a dual type Pokémon with flying isn't weak to flying.)
- Nidoking ought to still resist Poison moves. But not as strongly as before. Rule three messes with weaknesses only.
- Tentacruel should *not* resist Poison.
- If Bulbasaur loses it's Poison type thanks to some new field effect or move then this rule doesn't appl and depending on the new type2 Bulbasaur would receive damage according to types.txt
Not sure which part I want to be modifying though I prefer not to have to create an effect/s since I would then have to give every move in the game another effect to get this working. Putting this as an additional ability on each Pokémon also seems strange.
If I closed the code correctly and put it right after
Rule 1: No type is weak to itself. (Just a Types.txt modification.)
Rule 2: No type is resistant to itself. (Just a Types.txt modification.)
Rule 3: If a Pokémon has two types, A and B, and A is weak to B, then in that case the Pokémon's B type will protect it from enemy attacks of type B to eliminate a weakness.
I need to put the finishing touches on this blob of script but I am not sure where it goes.
Spoiler:
def pbNewIdea? (attacker,opponent)
if isConst?(type,PBTypes,:NORMAL) && opponent.hasType?(:NORMAL)
|| ifConst?(type,PBTypes,:FIRE) && opponent.hasTYpe?(:FIRE)
|| if Const?(type,PBTypes:WATER) && opponent.hasType?(:WATER)
|| if Const?(typePBTypes:ELECTRIC) && opponent.hasType?(:ELECTRIC)
|| if Const?(typePBTypes:GRASS) && opponent.hasType?(:GRASS)
|| if Const?(typePBTypes:ICE) && opponent.hastType?(:ICE)
|| if Const?(typePBTypes:FIGHTING) && opponent.hastType?(:FIGHTING)
|| if Const?(typePBTypes:POISON) && opponent.hastType?(:POISON)
|| if Const?(typePBTypes:GROUND) && opponent.hastType?(:GROUND)
|| if Const?(typePBTypes:FLYING) && opponent.hastType?(:FLYING)
|| if Const?(typePBTypes:PSYCHIC) && opponent.hastType?(:PSYCHIC)
||if Const?(typePBTypes:BUG) && opponent.hastType?(:BUG)
|| if Const?(typePBTypes:ROCK) && opponent.hastType?(:ROCK)
||if Const?(typePBTypes:GHOST) && opponent.hastType?(:GHOST)
|| if Const?(typePBTypes:DRAGON) && opponent.hastType?(:DRAGON)
|| if Const?(typePBTypes:DARK) && opponent.hastType?(:ARK)
|| if Const?(typePBTypes:STEEL) && opponent.hastType?(:STEEL)
|| if Const?(typePBTypes:FAIRY) && opponent.hastType?(:FAIRY)
I don't want to change a Pokémon's type with these rules, just override a Pokémon's weaknesses by changing the damage's effectiveness multiplier and having the game spit out a message like "... Bulbasaur is familiar with the poison! It took normal damage."
Examples of how it should play out in game.
- Tangela takes 2x supereffective damage from Poison Sting. (So this code shouldn't impact that at all.)
- Bulbasaur takes 1x normal damage from Poison Sting. (Despite poison not being resistant to itself anymore.
- Kabutops takes 1x normal damage from Hydro Pump (Despite water not being resistant to itself anymore.)
- Scyther takes 1x normal damage from Flying (Flying was never resistant to itself but because of Rule #3 a dual type Pokémon with flying isn't weak to flying.)
- Nidoking ought to still resist Poison moves. But not as strongly as before. Rule three messes with weaknesses only.
- Tentacruel should *not* resist Poison.
- If Bulbasaur loses it's Poison type thanks to some new field effect or move then this rule doesn't appl and depending on the new type2 Bulbasaur would receive damage according to types.txt
Not sure which part I want to be modifying though I prefer not to have to create an effect/s since I would then have to give every move in the game another effect to get this working. Putting this as an additional ability on each Pokémon also seems strange.
If I closed the code correctly and put it right after
Last edited: