Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Break Status [Fixed]

ikos

Member

Hey all,
This is my first script, so it may be rather primitive. Let me know what you think, critique is always appreciate.

Break Status
Break status, in my diction, is a Status Ailment where the next attack will "Break" or Insta-kill the actor/enemy.

example:
  • Ikos is inflicted with Frozen (tagged for Breakable)
  • Slime attacks Ikos
  • Ikos falls

Instructions
Cut and paste in Materials.
Type in which Status ailments are Breakable.

Code:
=begin
module Ikos
  BreakStates = [9] #Enter the ID of the desired Breakable Status here
end

class Game_Battler
  alias_method :ikos_breakstate_oldhp, :hp=
  def hp=(health)
    for i in 0...Ikos::BreakStates.size
      if @states.include?(Ikos::BreakStates[i])
        health = 0
        break
      end
    end
    self.ikos_breakstate_oldhp(health)
  end
end

Compatibility
This should work with anything. I've yet to see any issues.

Hope this is useful guys. If you use it, just slap my name in the credits or something.

~Ikos out :thumb:
 
I suggest re-writing your code a little bit.
Code:
module Ikos
  BreakStates = [9] #Enter the ID of the desired Breakable Status here
end

class Game_Battler
  alias_method :ikos_breakstate_oldhp, :hp=
  def hp=(health)
    for i in 0...Ikos::BreakStates.size
      if @states.include?(Ikos::BreakStates[i])
        health = 0
        break
      end
    end
    self.ikos_breakstate_oldhp(health)
  end
end

Ok. The things I did:

Changed Ikos_breakstate_oldhp to ikos_breakstate_oldhp (method names should not be capital).
Added a break if they find that you do have a break state (prevents searching multiple states so it'll be quicker).
Added scope to the aliased method name.

Good work. A nice little addon skill effect. :)
 

ikos

Member

SephirothSpawn":3govxmqo said:
I suggest re-writing your code a little bit.
Code:
module Ikos
  BreakStates = [9] #Enter the ID of the desired Breakable Status here
end

class Game_Battler
  alias_method :ikos_breakstate_oldhp, :hp=
  def hp=(health)
    for i in 0...Ikos::BreakStates.size
      if @states.include?(Ikos::BreakStates[i])
        health = 0
        break
      end
    end
    self.ikos_breakstate_oldhp(health)
  end
end

Ok. The things I did:

Changed Ikos_breakstate_oldhp to ikos_breakstate_oldhp (method names should not be capital).
Added a break if they find that you do have a break state (prevents searching multiple states so it'll be quicker).
Added scope to the aliased method name.

Good work. A nice little addon skill effect. :)

Thanks a lot, Seph. :)
I appreciate the help and the explanations why.
 
This is great. Simple, yet an effective and original notion, too. I take it this is also flexible with the RPG Tankentai Battle System, too, correct?
 
Hyper Wind":6w8la6bu said:
This is great. Simple, yet an effective and original notion, too. I take it this is also flexible with the RPG Tankentai Battle System, too, correct?
I'm no scripter, but as far as I can tell, you should have no problem.
 
Reason why I wonder is because the Tankentai battle system is an individual script which acts on it's own altering the Scene_Battle and Game_Battler functions.
 

ikos

Member

Hyper Wind":2skkadbp said:
Reason why I wonder is because the Tankentai battle system is an individual script which acts on it's own altering the Scene_Battle and Game_Battler functions.

It works with the Tankentiai.
That is the battle system which I've tested it with.
So you shouldn't have any problems. There aren't any edits to previous modules or scripts so it should be A-Okay. :thumb:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top