public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers
Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: KPermaDamage ACE
  • Original author: kyonides
  • Original date: February 4, 2023
  • Source thread: https://forums.rpgmakerweb.com/threads/kpermadamage-ace.154676/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace)

Summary

KPermaDamage ACE by Kyonides Arkanthes​ Introduction Would Eric love to lose n amount of HP or MP every time he moves in any direction?

Archived First Post

KPermaDamage ACE

by Kyonides Arkanthes


Introduction

Would Eric love to lose n amount of HP or MP every time he moves in any direction?
Well, now he gotta live with it if he does and it happens to have the "wrong" note tag.
Plus, he could also die if his MP goes kaboom. :S
And there is also the dreadful perma-death. :S

Read the notes on which note tags are required for Actors.

FAQ

Question:
Isn't that redundant or unnecessary?
Answer: Who cares?

Ruby:
# * KPermaDamage ACE * #
#   Scripter : Kyonides Arkanthes
#   v1.0.1 - 2023-02-04

# Make certain Heroes permanently lose HP or MP or even collapse for having
# no more MP left!

# * Note Tags * #
# _perma hp dmg Number_
# _perma mp dmg Number_
# _mp death_
# _perma death_

# The only way to cure the permanent HP or MP damage or the MP Death would be
# the following Script Calls:

# $game_actors[ActorID].perma_hp_dmg = 0
# $game_actors[ActorID].perma_mp_dmg = 0
# $game_actors[ActorID].mp_death = nil
# $game_actors[ActorID].perma_death = nil

module KPermaDmg
  REGEX_HP = /_perma hp dmg (\d+)_/i
  REGEX_MP = /_perma mp dmg (\d+)_/i
  REGEX_MP_DEATH = /_mp death_/i
  REGEX_PERMA_DEATH = /_perma death_/i
end

class Game_BattlerBase
  alias :kyon_gm_btlr_hp_set :hp=
  alias :kyon_gm_btlr_mp_set :mp=
  alias :kyon_gm_btlr_rec_all :recover_all
  def hp=(new_hp)
    return 0 if @perma_death
    kyon_gm_btlr_hp_set(new_hp)
  end

  def mp=(new_mp)
    return 0 if @perma_death
    kyon_gm_btlr_mp_set(new_mp)
  end

  def recover_all
    return if @perma_death
    kyon_gm_btlr_rec_all
  end
end

class Game_Actor
  alias :kyon_gm_act_setup :setup
  alias :kyon_gm_act_refr :refresh
  def setup(actor_id)
    kyon_gm_act_setup(actor_id)
    setup_permanent_damage
  end

  def check_note(regex)
    (actor.note =~ regex) != nil
  end

  def setup_permanent_damage
    self.actor.note[KPermaDmg::REGEX_HP]
    @perma_hp_dmg = $1.to_i
    self.actor.note[KPermaDmg::REGEX_MP]
    @perma_mp_dmg = $1.to_i
    @mp_death = check_note(KPermaDmg::REGEX_MP_DEATH)
    @perma_death = check_note(KPermaDmg::REGEX_PERMA_DEATH)
  end

  def permanent_damage
    self.hp -= @perma_hp_dmg
    self.mp -= @perma_mp_dmg
  end

  def refresh_mp_death
    if @mp == 0
      @hp = 0
      add_state(death_state_id)
    else
      @hp = 1 if @hp == 0
      remove_state(death_state_id)
    end
  end

  def refresh
    kyon_gm_act_refr
    refresh_mp_death if @mp_death
  end
  attr_accessor :perma_hp_dmg, :perma_mp_dmg, :mp_death, :perma_death
end

class Game_Party
  def permanent_damage
    @actors.each{|aid| $game_actors[aid].permanent_damage }
  end
end

class Game_Player
  alias :kyon_gm_plyr_incr_steps :increase_steps
  def increase_steps
    kyon_gm_plyr_incr_steps
    $game_party.permanent_damage
  end
end

Download Up-to-Date RGSS Scripts

Terms & Conditions

Free as in beer.
Include my nickname in your game credits.
Do not repost it!

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

License / Terms Note

Include my nickname in your game credits. Do not repost it!

Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#rgss3#script-archive

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar