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,720
Reaction score
15,304
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,289
Reaction score
760
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

About the Deer, I had to cut some piece of video due the *swearing* Youtube copyrights issues...
A caveman pokes his head in...
I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.

Forum statistics

Threads
116,002
Messages
1,094,794
Members
151,303
Latest member
rinchi4
Top