KEndure ACE

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
285
Reaction score
70
First Language
English
Primarily Uses
RMXP
KEndure ACE

by Kyonides Arkanthes


Introduction

Use note tags to implement some Endure or Sturdy kind of passive skill or state.
You're free to define how many HP the hero or monster will get in return for surviving.
Since it's a state, its effects will definitely wear off at some point.
You may only take advantage of this feature once per battle.
Please follow the script instructions and set STATE_ID constat to your chosen State ID.

Download the DEMO

Script Section

Code:
# * KEndure ACE
#   Scripter : Kyonides Arkanthes
#   2020-08-04

# This scriptlet allows you to set Endure like states in your games!
# Your hero will not die for n turns.
# If he's cursed, he won't be able to get healed.

# * Note Tags * #
# -endure 25-      # 25 will be the hero's new HP
# -endure 1 curse- # 1 HP and cannot heal

# * Toggle Hero's No Heal Curse In Game - Position 0 through MAX
# $game_party.members[Position].endure_no_heal = true # Or false

module KEndure
  STATE_ID = 26
  HEAL_REMOVE_ENDURE = true # Remove Endure after being healed?
end

class Game_Battler
  alias :kyon_endure_gm_battler_hp :hp=
  alias :kyon_endure_gm_battler_obe :on_battle_end
  def no_endure?(nhp) nhp > @endure_hp and KEndure::HEAL_REMOVE_ENDURE end
  def hp=(nhp)
    if nhp < 1
      return @hp if state?(KEndure::STATE_ID)
      if !@used_endure and @endure_hp != 0
        add_state(KEndure::STATE_ID)
        @used_endure = true
        return @hp = [@endure_hp, mhp].min
      end
    end
    return @hp if @endure_no_heal
    remove_state(KEndure::STATE_ID) if no_endure?(nhp)
    kyon_endure_gm_battler_hp(nhp)
  end

  def on_battle_end
    kyon_endure_gm_battler_obe
    @used_endure = nil
  end

  def parse_endure_note(note)
    note = note[/-endure \w+-/i] || ''
    @endure_hp = note.scan(/\d+/)[0].to_i
    @endure_no_heal = true if note[/curse/i]
  end
  attr_accessor :endure_hp, :used_endure, :endure_no_heal
end

class Game_Actor
  alias :kyon_endure_gm_actor_init :initialize
  def initialize(actor_id)
    kyon_endure_gm_actor_init(actor_id)
    parse_endure_note($data_actors[@actor_id].note)
  end
end

class Game_Enemy
  alias :kyon_endure_gm_enemy_init :initialize
  def initialize(index, enemy_id)
    kyon_endure_gm_enemy_init(index, enemy_id)
    parse_endure_note($data_enemies[enemy_id].note)
  end
end
Terms & Conditions

Free for use in any game.
Include my nickname in your game credits. Mention this forum as well.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I started really going in on my project April of last year... I'm just now making starting the actual game... making assets (and not even all of them), whoooo... TIME SINK.


Imagine being a pleb and using --------------------.js :LZSwink:
Ami
--- Survival For RPGist Part 2 ---

Survivalist: Now,I going to Test you: Fishing with Spear
M.Spear Knight: Leave it to me.
(M.Spear Knight Spearing the Fish with His Battle Spear)
M.Spear Knight: How it is?
Survivalist: I know you did it,but...Is that the Spear for Battle,not for Fishing?
M.Spear Knight: But,is that same?
Survivalist: (Sigh)...Whatever

Forum statistics

Threads
102,942
Messages
996,161
Members
134,406
Latest member
ThighBaby34
Top