Save-Point
KRiskPoints XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: KRiskPoints XP (/thread-8116.html)



KRiskPoints XP - kyonides - 08-01-2020

KRiskPoints XP

by Kyonides Arkanthes


Introduction

This is a quite simple scriptlet that lets you create a state that randomly changes your hero's life or mana points every turn till it wears off.
Nope, Aluxes, it won't revive you if a ghost or a lizard has killed you already! Laughing

Script

Code:
# * KRiskPoints XP - Default Battle System Version
#   Scripter : Kyonides Arkanthes
#   2020-07-31

# This scriptlet will let you create a state with the ability to set an actor's
# Life or Mana Points randomly every turn he or she is afflicted by that.
# I think this is a great addition for bosses and mini bosses.

# Add a state to the States DB and come back here to set the STATE_ID constant
# to the chosen state ID. By the way, you may prefer to create a Skill that
# inflicts this state to the hero.
# A hero might even get afflicted by both kinds of states.
# This state will not revive its target. My sympaties, Aluxes! XD

module KRiskPoints
  LIFE_STATE_ID = 20
  MANA_STATE_ID = 21
end

class Scene_Battle
  alias :kyon_hprisk_ups1 :update_phase4_step1
  def update_phase4_step1
    if @active_battler and @active_battler.hp > 0
      if @active_battler.state?(KRiskPoints::LIFE_STATE_ID)
        @active_battler.hp = rand(@active_battler.maxhp + 1)
      end
      if @active_battler.state?(KRiskPoints::MANA_STATE_ID)
        @active_battler.sp = rand(@active_battler.maxsp + 1)
      end
    end
    kyon_hprisk_ups1
  end
end

Terms & Conditions

Free for use in any non commercial games.
Don't forget to include my nickname in your game credits!
Include the forum's URL as well.
Give me a free copy of your completed game if you include at least 2 of my scripts! Laughing + Tongue sticking out