fastpager200

Villager
Member
Joined
Dec 19, 2015
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Title says it all, really. HRG parameter effects only really let you change things by percentage and I'm looking to have a HRG on a specific state remove a specific number of health every turn rather than just a percentage, and I'm gonna assume this needs a script.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,703
Reaction score
15,298
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSS3 (VX Ace) Script Requests. Thank you.

 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,283
Reaction score
758
First Language
English
Primarily Uses
RMVXA
Try this
Ruby:
module R2_HRG_Damage
  HRG_STATES = [2, 8]
  HRG_DAMAGE = 20
  HRG_VARIABLE = 1 # Use a variable to change the damage amount
  HRG_SWITCH = false # if true it will use the variable
end

class Game_Battler < Game_BattlerBase
  def regenerate_hp
    stdam = false
    hrgdam = 0
    state_ids = self.states.collect {|obj| obj.id }
    state_ids.each { |stid|
    if R2_HRG_Damage::HRG_STATES.include?(stid)
      if R2_HRG_Damage::HRG_SWITCH == true
        hrgdam = $game_variables[R2_HRG_Damage::HRG_VARIABLE]
      else
        hrgdam = R2_HRG_Damage::HRG_DAMAGE
      end
      stdam = true
    end
    }
    if stdam == true
      damage = hrgdam
    else
      damage = -(mhp * hrg).to_i
    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
 

fastpager200

Villager
Member
Joined
Dec 19, 2015
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Try this
Ruby:
module R2_HRG_Damage
  HRG_STATES = [2, 8]
  HRG_DAMAGE = 20
  HRG_VARIABLE = 1 # Use a variable to change the damage amount
  HRG_SWITCH = false # if true it will use the variable
end

class Game_Battler < Game_BattlerBase
  def regenerate_hp
    stdam = false
    hrgdam = 0
    state_ids = self.states.collect {|obj| obj.id }
    state_ids.each { |stid|
    if R2_HRG_Damage::HRG_STATES.include?(stid)
      if R2_HRG_Damage::HRG_SWITCH == true
        hrgdam = $game_variables[R2_HRG_Damage::HRG_VARIABLE]
      else
        hrgdam = R2_HRG_Damage::HRG_DAMAGE
      end
      stdam = true
    end
    }
    if stdam == true
      damage = hrgdam
    else
      damage = -(mhp * hrg).to_i
    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
I had to change "stdam = false" to "true" but this works! Thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

you know, some days you get resentful that game dev is even considered a "fun job" and other days it's like, welp, time to roll up my sleeves and code these molotov cocktails
If you suck at playing trumpets, that is probably why.
Been sick with a stomach virus for seven days now. Not going to work tomorrow because I'm still contagious according to my doctor.
Much as I love my job, I really hate playing "office politics". It would be nice if I didn't have to pretend to be someone else all day long.
I wanna get back into showing off Battlers and other assets I create again. But i'm always haunted by the "It's not good/realistic enough" voices that keep me from doing so.

Maybe I should get back to it, I did enjoy showing off whatever I came up with!

Forum statistics

Threads
115,958
Messages
1,094,378
Members
151,220
Latest member
Dolton
Top