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,670
Reaction score
15,291
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,282
Reaction score
755
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

A video update on the progress I've been making on the cutscenes. :kaosalute:

I wonder if color LUTs is possible for RPG Maker. It would be game changer and can replace the not so good looking tint screen
new mechanic in battle where you can mentally erase enemies when you deplete all their MP instead HP. this gives you a special item of their "memory". it's pretty to do in battle so far.
Apparently MZ lets you preview move routes in the move route editor without having to start up test game. That could save a lot of time during development compared to MV, especially for a long game that uses a lot of event movement for cutscenes.
A repost of an old meme I had made, now with music

Forum statistics

Threads
115,863
Messages
1,093,555
Members
151,084
Latest member
Tyriemedia
Top