Save-Point
KNoRevive 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)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KNoRevive XP (/thread-8127.html)



KNoRevive XP - kyonides - 08-05-2020

KNoRevive XP

by Kyonides Arkanthes


Introduction

This scriptlet will stop you from reviving certain heroes or mercenaries but it also provides a method to define exceptions.

Code:
# * KNoRevive XP
#   Scripter : Kyonides Arkanthes
#   2020-08-04

# Certain heroes or mercenaries cannot be revived anymore!
# You may define skills and items that might bypass this restriction.

module KNoRevive
  POPUP_LABEL = '' # Cannot be revived Popup Message
  # List of Actors that cannot be revived
  DEAD_ACTOR_IDS = []
  EXCEPTION_SKILL_IDS = []
  EXCEPTION_ITEM_IDS = []
  def self.dead_skill?(aid, sid)
    DEAD_ACTOR_IDS.include?(aid) and !EXCEPTION_SKILL_IDS.include?(sid)
  end

  def self.dead_item?(aid, iid)
    DEAD_ACTOR_IDS.include?(aid) and !EXCEPTION_ITEM_IDS.include?(iid)
  end
end

class Game_Battler
  alias :kyon_norevive_gm_battler_se :skill_effect
  alias :kyon_norevive_gm_battler_ie :item_effect
  def skill_effect(user, skill)
    if @hp == 0 and skill.power < 0 and KNoRevive.dead_skill?(self.id, skill.id)
      @damage = KNoRevive::POPUP_LABEL
      return false
    end
    kyon_norevive_gm_battler_se(user, skill)
  end

  def item_effect(item)
    if @hp == 0 and KNoRevive.dead_item?(self.id, item.id)
      @damage = KNoRevive::POPUP_LABEL if $game_temp.in_battle
      return false
    end
    kyon_norevive_gm_battler_ie(item)
  end
end

Terms & Conditions

Free for use in any game.
Include my nickname in your game credits.
Mention this board as well.
Give me a free copy of your completed game if you include at least 2 of my scripts! Laughing + Tongue sticking out