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,688
Reaction score
15,295
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 Profile Posts

Finally got my website fixed and the security sorted so it's been a productive day. Can I go to sleep now? I mean... I don't need to work right?
It's always a good idea to refresh yourself on what your plugins do. I'm working on a map with opening walls, and I was about to tear my hair out over how much image editing and hand-constructing of autotiles I'd have to do, when I looked again and saw @Shaz 's Tile Changer could copy areas from another map.
"sorry it took me so long to respond" - can we please agree not to say that anymore unless it actually took a long time?! (Like 36hrs at least) I mean, I'm running out of funny responses here xD
Ugh... 4:53AM over here and I can't sleep so why not just game make.
I just love the MV feature that allows you to create your own animations!

Forum statistics

Threads
115,914
Messages
1,093,990
Members
151,172
Latest member
ShuBun-Kin
Top