Flat Number State Effects

I have scoured the Script List for this but haven't found what I'm looking for.

My game uses very small numbers and I'd like to refrain from using the %-based State effects. Rather, I'd like for States to give a flat bonus to the character affected by that state.

For example,

Bravery (+1 Attack), Bravery+ (+3 Attack), etc. ; instead of the usual % based increase.

Poison (3 damage a turn); instead of the % based slip damage.

Arcane Knack (Spells cost -1 MP) ; instead of the usual half mp cost.

Cheers to anyone who can help!

I've moved this thread to Script Requests. Thank you.

Hm, let's see where all those percents take place:

Poison and MP regen (and all related HP/MP stuff) happens in Game_Battler's regenerate_hp/mp. Here, we can see that damage = -(mhp * hrg).to_i, or Max HP times Health Regen, meaning that 100% hrg is 1.0; hrg should be 0 by default if there is no regen. For a flat number, it's probably best if we do (hrg * 100).to_i.

Hm, if I'm reading this correctly, param_rate in Game_BattlerBase is the stat alteration straight from the state. This value is calculated in the second like of param, and at default, this should be = 1.0 (no state) * 1.0 (no buff). Oh, but we do know that unlike health regen, this is originally a 100% going into a 10% reduction, or a 100 default becoming 10 "boost".

MP cost is also under Game_BattlerBase as skill_mp_cost. Here, we have skill's mp_st times magic cost reduction, so another 1.0 here at default. Like params, it's 100% by default.

Also, I don't know how these rates are grouped. I think a previous discussion said that these results are multiplicative, which makes sense given the percent-based interface.

---

Fortunately, you're not the first asking about flat stuff. Not sure that people asked for a general flat rate, though, so you many need more than one script. Here's some scripts to give you a starting point:

Yanfly's Lunatic States
Hime's Parameter Bonuses
Victor's Custom Slip Effect
In case you're not sure how to go about editing the scripts, here are some snippets. Paste these into an empty slot under "Materials".

Flat buffs:
Code:
  class Game_BattlerBase
    def param_buff_rate(param_id)
      @buffs[param_id]
    end
  end

  class Game_BattlerBase
    def param(param_id)
      value = param_base(param_id) + param_plus(param_id)
      value *= param_rate(param_id)
      value += param_buff_rate(param_id)
      [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
    end
  end

Flat poison and regen:
Code:
  class Game_Battler < Game_BattlerBase
    def regenerate_hp
      damage = -(100 * hrg).to_i
      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

Flat MP cost reduction:
Code:
 class Game_BattlerBase
    def skill_mp_cost(skill)
      if mcr == 1.0
        (skill.mp_cost).to_i
      else
        (skill.mp_cost - (100 * mcr)).to_i
      end
    end
  end
Thanks Harosata, I'll see if I can work it myself if not I'll check out Aoi's snippets.

With this I should be good!

Original thread: https://forums.rpgmakerweb.com/threads/flat-number-state-effects.83596/