Way to Make DoT Effects Differ for Enemies?

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Hey ^_^ So I ran into a minor problem that I think I might need a small script to fix.

I have an 'On Fire' state that most fire spells have a chance of inflicting. It deals more damage over time than Poison, but unlike Poison, it will be removed after X number of turns or X number of steps taken. It's designed to be a very short duration but high damage state. The damage is something like -18% HRG. On player characters, this is an 'oh ****!' moment, but still managable (the 'Water' item is readily available at the local store and even if not, the rest of the party can try to top up their HP until it wears off).

However. I was just fighting a Boss and despite giving him some resistance to most states, I never made him immune (I don't believe in it unless there's a lore-based reason or something obvious, like if he was made of fire himself). Thus, I luckily made him succumb to 'On Fire'. After spending a moment chuckling to myself about the thought of him running around screaming, my face fell immediately flat when he lost 72 HP (of his 400 maximum) in one sitting.

I suppose I've never successfully applied Poison to anything in RPGs before, or perhaps they just weren't as effective, so I never anticipated that something like this would be so...... effective... against a boss. But of course, the more HP you have, the more damage you take.

In short - I don't want this. I think dealing a percentage based damage is really faulty, as poison is poison (it's going to eat your body away regardless of how much health you have) and fire is fire. I do understand that dealing percentage damage is helpful on the one hand because it means that even if you have high HP, it's still a threat, but in the case of bosses who are supposed to take a while to go down regardless, it's just not practical. I need a way to make it so that certain enemies take reduced damage from DoT effects. Any suggestions?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Code:
class Game_Battler
  def regenerate_hp
    damage = -(mhp * hrg).to_i
    if enemy? && damage > 0 
      damage = [damage, <PUT DAMAGE CAP HERE>].min
    end
    perform_map_damage_effect if $game_party.in_battle && damage > 0
    @result.hp_damage = [damage, max_slip_damage].min
    self.hp -= @result.hp_damage
  end
end
What it does? it will keep the percentage DoT, but will cap the damage. For example if the enemy got stacked by many states (let it be poison and fire all together, or other sources of DoT), and all the DoT value is 20%. Then you put the threshold of the DoT cap is 150, then the DoT damage will never goes past 150 even if 20% of their HP is more than 150.

Edit; fixed the formula
 

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
That sounds great,\. but I assume it applies to all enemies rather than individual ones? For example, if I wanted regular enemies to suffer regular 'On Fire' damage but the bosses to have the damage cap, would that be possible? If not then it doesn't matter, as it would make enemies a little more challenging if they too had limits to the damage they took from states. :) I don't want the player to have TOOO easy a time, haha.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
Maybe give your bosses a state. All enemies with that state are immune to Poison but receive 150 HP damage. I'd do that in the damage formula

if b.state?(129); 150; end; normal damage formula here.

On phone, so can't check that formula, but it should be something like that.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
If you want it to only works for a specific enemy ID, then
Code:
class Game_Battler
  def regenerate_hp
   damage = -(mhp * hrg).to_i
   if enemy? && damage > 0 && @enemy_id == <PUT ENEMY ID HERE>
     damage = [damage, <PUT DAMAGE CAP HERE>].min
   end
   perform_map_damage_effect if $game_party.in_battle && damage > 0
   @result.hp_damage = [damage, max_slip_damage].min
   self.hp -= @result.hp_damage
  end
end
If you want this to apply to multiple enemy ID then.
Code:
class Game_Battler
  def regenerate_hp
   damage = -(mhp * hrg).to_i
   if enemy? && damage > 0 && [1,2,3,4,5,6,<PUT MORE ID HERE>].include?(@enemy_id)
     damage = [damage, <PUT DAMAGE CAP HERE>].min
   end
   perform_map_damage_effect if $game_party.in_battle && damage > 0
   @result.hp_damage = [damage, max_slip_damage].min
   self.hp -= @result.hp_damage
  end
end
If you want that each enemy has its own damage cap
Code:
ENEMY_CAP = {
  1 => 150,
  2 => 200,
  # ENEMY ID => DOT CAP,
}
class Game_Battler
  def regenerate_hp
   damage = -(mhp * hrg).to_i
   if enemy? && damage > 0 
     damage = [damage, (ENEMY_CAP[@enemy_id] || max_slip_damage)].min
   end
   perform_map_damage_effect if $game_party.in_battle && damage > 0
   @result.hp_damage = [damage, max_slip_damage].min
   self.hp -= @result.hp_damage
  end
end
 

Psykai

Veteran
Veteran
Joined
Dec 8, 2017
Messages
104
Reaction score
4
First Language
English
Primarily Uses
RMVXA
The individual damage cap per enemy one looks perfect :) Thank you so much! I'm a bit distracted with other sections of the game but I'll be playtesting my newest dungeon and boss sometime this week so I'll let you know if there's any problems.

Thank you in general for helping with all of my questions lately and for being so patient and friendly and making sure to explain things in a way my idiot brain can comprehend. I really appreciate it and I understand how frustrating it probably is for you veterans to deal with so many silly questions all the time, so thanks again for your time and efforts :)

EDIT: I inflicted On Fire on a boss and discoved it doesn't show floating damage numbers, so I can't tell if he IS taking the reduced damage or not. :S Prior to installing the script, floating numbers worked fine. Should the script be placed differently in the order?
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top