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
44,113
Reaction score
15,526
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,367
Reaction score
799
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

I love it when a plan comes together, and especially when Ruby decides to work with me when I decide to code. :kaopride:
Got sick and had to take a few days off work in order to get tested and make sure it wasn't the big one. Felt a lot better today and thought to myself, "Hey now, I can't get tested until tomorrow anyway, I can get so much character art done today!"
....I watched Youtube and browsed this site for hours instead.
>.>
But at least I'm doing the art now! Yaaaaay.......
1638314262144.png
Didn't wanna spam the feed by posting Denzel's spritelayer separae, but I'm real happy with how this concept is coming along so wanted to share it, innit :D
EVXA wrote on Avery's profile.
Not sure how often you take time to play the games sent to you, but if you could give my game a shout & review on steam maybe that would be amazing, only if you like the game of course, I'd love to know which games have been your favorites over the years too.
I'm seeing my god daughter's school play next week. Being the mild agoraphobe I am this makes me nervous. Thus I had a dream that it was actually a plot by my best friend to take me clubbing at an establishment where it is customary to throw a harpoon at staff members to reward good service.

Forum statistics

Threads
117,090
Messages
1,104,490
Members
153,088
Latest member
Abishkar
Top