Classes that DO 1.5x damage for skills with certain elements

Hiya, guys! I don't know if this actually requires a script-- and I'd rather use as few and as small of scripts as possible-- but I need to make it so that certain Classes do 1.5x damage for Skills that are of either of two specified Elements. (NOTE: Do damage, not take damage. I'm not talking about "element rate".) Basically we're doing STAB (same-type attack bonus) from Pokémon; but if you don't know what that is, ignore this sentence.


For example, if Class "Fighter" uses a skill with damage of the "normal" element, he does 1x damage (no modification). But if he uses a skill with damage of the "fire" element, he does 1.5x damage.


Thanks!
Hi,


If you don't have multiple attack elements, you could define additional elements as "offensive elements".


Instead of creating skills of that element, you could use the attackers element rate within your damage formulas.


For example, if you use element 22 as "Fire Attack", modify the damage formulas of your fire skills like this:
( original formula ) * a.element_rate(22)
Hi,


If you don't have multiple attack elements, you could define additional elements as "offensive elements".


Instead of creating skills of that element, you could use the attackers element rate within your damage formulas.


For example, if you use element 22 as "Fire Attack", modify the damage formulas of your fire skills like this:
( original formula ) * a.element_rate(22)



Oh wow. So here's a thought: I already use a lot of element rates for each class. Can I substitute a.element_rate with a.something_else that I haven't already used for my classes? That brings up an important question, actually: where is a list of the other things that can be defined in a formula (such as "element_rate") that aren't listed in the tooltip help?


Thanks a ton!
You can continue using your existing element rates as defense. The idea was to create a complementary element for each existing one that would only be used in the damage formulas (so you have "Fire" and "Fire Attack" to manipulate damage taken and done). You can create up to 99 unique elements in the editor.


This solution could be problematic if you use "Normal Attack" elements for your skills though.


The damage formula is executed as plain ruby script code, so there are a lot of possibilities. I haven't looked through the forums if someone created a collection of commands to use in the damage formula, but there is a thread in the "Tutorials" section with some suggestions:


How to make the most of custom formulae part 1


For a list of methods you can use with your attacker or target, you could use  msgbox a.methods  for an overview or by looking through the Game_BattlerBase, Game_Battler (for both, enemies and actors) or Game_Enemy / Game_Actor scripts.


Here is also a list of some commands you could use (quickly assembled, so it's far from complete):

Spoiler
Some commands for battlers, combine them with a. or b. :


  hit, eva, cri, cev, ...            : You can use Ex-/Sp-Param names as well


  max_tp                  : Battlers Maximum TP (always 100 by default)


  element_rate(number)    : Element Rate; number = Elements Database ID


  debuff_rate(number)     : Debuff Rate; number = Parameter Index (0=MHP to 7=LUK)


  state_rate(number)      : State Rate; number = States Database ID


  speed                   : Speed value calculated for this turn. The higher the value, the earlier the battler can act.


  atk_speed               : Battlers Attack Speed (Feature)


  atk_times_add           : Number of Additional Attacks (Feature)


  action_plus_set.length  : Maximum Number of additional Actions (Feature)


  actions.length          : Number of remaining Actions for this turn (including the current one)


  states.length           : Number of states applied to that battler


  state_icons.length      : Number of displayable state icons (e.g. number of visible states)


  buff_icons.length       : Number of different buffs on that battler


  feature_objects.length  : Total Number of Features given to that battler


  restriction             : Restriction caused by states (between 0='None' and 4='Cannot Move')


  confusion_level         : Similar to "Restriction", but is also 0 if the battler 'Cannot Move' or is hidden


  luk_effect_rate(battler)  : LUK Chance modifier when adding states/debuffs [usually battler= a (the attacker)]


  hp_rate, mp_rate, tp_rate : HP/MP/TP rate; between 1 (full) and 0 (empty)


  collapse_type           : Battlers Collapse Effect (0=Default to 3='Not Disappear')


  slot_type               : 1 if the battler is supposed to wield two weapons, 0 otherwise


  death_state_id          : Battlers Death State ID (always 1 by default)


  attack_skill_id         : Battlers Attack Skill ID (always 1 by default)


  guard_skill_id          : Battlers Guard Skill ID (always 2 by default)


Some miscellaneous commands, not to be combined with a battler:


  $game_party.gold                  : Gold possessed by the party


  $game_party.members.length        : Number of party members (reduced to battle party during battle)


  $game_party.highest_level         : Highest level within the party


  $game_party.item_number(item)      : Number of Items held (item= $data_items[ID] / $data_weapons[ID] / $data_armors[ID] ) 


  $game_troop.alive_members.length  : Number of Enemies left alive


  $game_system.battle_count         : Number of Battles (including the current one)


  $game_system.save_count           : Number of Saves


  $game_timer.sec                   : Number of Seconds left on the timer
You can continue using your existing element rates as defense. The idea was to create a complementary element for each existing one that would only be used in the damage formulas (so you have "Fire" and "Fire Attack" to manipulate damage taken and done). You can create up to 99 unique elements in the editor.


This solution could be problematic if you use "Normal Attack" elements for your skills though.



I'm not sure what you're saying, but I did come up with a solution. I have normal element rates, which determine defenses, and I have damage element rates, too.


So, for example, The appropriate Class has a rate for the element "Fire", but he also has a rate for the element "Fire Efficiency". "Fire Efficiency" is only used in the appropriate Class, where it's set to " * 150% ", and in the damage formula, where it's " * element_rate(12) " or whatever the ID for that element is.


I don't know if it works yet as I have been trying to work out another damage kink, but tell me what you think!

Original thread: https://forums.rpgmakerweb.com/threads/classes-that-do-1-5x-damage-for-skills-with-certain-elements.59785/