Jump to content

How would you implement this game feature? Some sort of "Global Typing Rule" idea.


Shiya

Recommended Posts

Alright so basically I am messing with the typical weakness/resistance relationships with the changes below but it's not enough to just change the weaknesses and resistances thanks to design rule #3.  Rules 1 and 2 are listed as it wouldn't make much sense on it's own.

Spoiler


Rule 1: No type is weak to itself.
Rule 2: No type is resistant to itself.
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. 

 

So rules 1 and 2 require no real difficult work.  Just have to edit the types.txt and recompile.  Easy.  Rule 3 makes me think I might actually have to do one of these:

- Do something like

 

......
if Pokémon is dual type then runBLAH

   if Pokémon's type A is weak to B then Pokémon takes normal damage from B for this battle.  Otherwise runBLEM
     if Pokémon's type B is weak to type A then Pokémon takes normal damage from A for this battle.  Otherwise End

   End

End

 

The idea is that bit of code or script would run after all Pokémon hit the field and whenever a new Pokémon hits the field.  It would only bother checking Rule 3 (by running BLAH) and the inverse of Rule 3 (BEM) if a Pokémon was dual type.  These values would have to be stored temporarily of course and erase themselves.  This would also put into temporary memory conditions that certain types of moves, for the duration of the battle at least, dealt more or less damage to Pokémon referenced by another standalone specific value.  Weird things would happen if you referenced by name (cheating the game by naming the Pokémon something silly so all weaknesses are ignored for example).   I mean I can have an idea of how this would be done but ... if it's been done or it doesn't need to be a whole new addition to the battle system then no reason for it.

So... if somebody has another way of going about this (before I go through the migraine of figuring out the code structure and learning syntax)  I'm all game.   I suppose I can learn how to code this but.. if there is a few lines or a batch of code from any open source projects ya'll know of I'd love to hear it.

Link to comment
Share on other sites

  • Global Mods

Couldn't you just have an override for when a supereffective move is used, if its type matches either of the defending pokemons types, it's changed to neutral damage? (check it only with incoming SE moves to prevent any resisted moves being changed to neutral, and reducing overall number of checks)

Link to comment
Share on other sites

Just now, DreamblitzX said:

Couldn't you just have an override for when a supereffective move is used, if its type matches either of the defending pokemons types, it's changed to neutral damage? (check it only with incoming SE moves to prevent any resisted moves being changed to neutral, and reducing overall number of checks)

That does sound expedient.   Brilliant.  As far as actually changing it to neutral damage it would be a matter of just adding a 2.0 multiplier right after the 0.5 multiplier right?  Or would you actually remove the 0.5 from the damage calculations. 

Link to comment
Share on other sites

  • Global Mods
1 minute ago, Shiya said:

That does sound expedient.   Brilliant.  As far as actually changing it to neutral damage it would be a matter of just adding a 2.0 multiplier right after the 0.5 multiplier right?  Or would you actually remove the 0.5 from the damage calculations. 

You're reducing SE damage, so it would be a matter of adding a 0.5x, though you might want to find a way to stop the sound and supereffective message ingame.

Link to comment
Share on other sites

Oops, yeah don't want to make Bulbasaur take 4x damage from Nidoran's Poison Sting.  XD  

Really this solution should work quite nicely for these critters as well:
 

Spoiler

Beedrill (Bug, Flying , Poison)
Veno-moth (Bug, Flying , Poison)
Tyran-itar (Ground, Rock, Dark)
Dustox (Bug, Flying , Poison)
Vibrava  (Ground, Dragon, Flying)
Flygon (Ground, Dragon, Flying)
Solrock (Psychic, Rock, Fire)
Drapion (Poison, Bug, Dark)
Hydreigon (Dark, Dragon, Flying)
Valca-rona (Bug, Fire, Flying)
Inkay (Psychic, Water, Dark)
Mala-mar (Psychic, Dark, Water)
Dragal-ge (Water, Poison, Dragon)
Decidueye (Grass, Flying, Ghost)
Mega Altaria (Fairy, Flying, Dragon)


I've got to break for today I've thought about Pokémon way too much.  I got an exciting day tomorrow as well.  Thanks for the help and catching what would have been terrible for the trainers on route 1.

EDIT:  So I've been checking out all the different scripts to see which parts I need to mod.  It looks like I can just add a few into PokeBattle_Move. Specifically something like this but I'm not sure what the Syntax is..

I know am thinking I will need to use something like this but am not super sure where to put it inside the PokeBattle_Move area.. maybe add it onto def pbTypeModifier?
-----------------------------------------------------------------------------------------------------------------------
def pbTypeModifier (type, attacker, opponent,zorovar=false)


//all the existing things like modifications because of Items and terrain first then mine below//
 

    return 8 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)

....

-----------------------------------------------------------------------------------------------------------------------

Another player wanted to add a new type and was told to modify the defpbCalcDamage function much later on for adjusting type on type damage shown here
https://www.pokecommunity.com/showthread.php?p=9401592

 

if I did it that way it might be okay.. I'd kind of like for the type to be checked before any abilities like Dry Skin or wacky items I might implement but I don't really understand why the battle system is made the way it is.

 

For now I'm going to try messing around with the pbTypeModifier section and see if I can't get it to compile and if successful test it out by going to the Ghost gym and using my Golett. 

 

 

Edited by Shiya
Didn't want to double post.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...