+- 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: I ACED THIS BATTLER INVULNERABILITY (/thread-11577.html)
I ACED THIS BATTLER INVULNERABILITY - DerVVulfman - 05-21-2025
I ACED THIS BATTLER INVULNERABILITY Version: 1.0
Introduction
This script makes it possible to make actors and/or enemies invulnerable to all damage, or remove such invulnerabilities. It uses simple script calls.
Script
The Script
Code:
#==============================================================================
# ** I ACED THIS BATTLER INVULNERABILITY
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 05-20-2025 (mm/dd/yyyy)
# RGSS / RPGMaker XP
#==============================================================================
#
# INTRODUCTION:
# =============
# This script makes it possible to make actors and/or enemies invulnerable to
# all damage, or remove such invulnerabilities. It uses simple script calls.
#
# ----------------------------------------------------------------------
#
# USAGE:
# ======
# You use script calls within the Troop Database.
#
# To make an enemy indestructible, use:
# * $game_troop.dmg_unaffected(index, true)
# And to remove its indestructible state, use:
# * $game_troop.dmg_unaffected(index, false)
#
# Likewise, to make an actor indestructible, use:
# * $game_party.dmg_unaffected(index, true)
# And to remove its indestructible state, use:
# * $game_party.dmg_unaffected(index, false)
#
# Remember, it uses the index position of the enemies or actors, and the index
# position '0' for the $game_party.actors array is the lead party member.
#
# The $game_troop.enemies is oddly in reverse order. By that, the last enemy
# you added into the troop is postition '0', not the first enemy added.
#
# ----------------------------------------------------------------------
#
# NON-ENGLISH ADAPTATION:
# =======================
# When the 'target' is invulnerable, a "MISS" damage pop will appear. If this
# is to be changed, go to line #158 in this script.
#
#==============================================================================
#
# COMPATABILITY:
# ==============
#
# Designed for RPGMaker XP.
#
#
#==============================================================================
#
# TERMS and CONDITIONS:
# =====================
#
# Free for use, even in commercial scripts. However, I require due credit for
# myself, and Ace_V who inspired this simple scriptette.
#
#
#==============================================================================
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :dmg_unaffected # Unaffected by combat flag
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias ace_v_unaffected_initialize initialize
alias ace_v_unaffected_attack_effect attack_effect
alias ace_v_unaffected_skill_effect skill_effect
alias ace_v_unaffected_item_effect item_effect
alias ace_v_unaffected_slip_damage_effect slip_damage_effect
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
#
ace_v_unaffected_initialize # Run the original method
@dmg_unaffected = false # Add the unaffected flag
#
end
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
#
if @dmg_unaffected == true # If flagged unaffected
ace_v_unaffected_damage_pop # Run the damage pop
return true # Exit the method true
end
ace_v_unaffected_attack_effect(attacker) # Run the original method
#
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
#
if @dmg_unaffected == true # If flagged unaffected
ace_v_unaffected_damage_pop # Run the damage pop
return true # Exit the method true
end
ace_v_unaffected_skill_effect(user, skill) # Run the original method
#
end
#--------------------------------------------------------------------------
# * Application of Item Effects
# item : item
#--------------------------------------------------------------------------
def item_effect(item)
#
if @dmg_unaffected == true # If flagged unaffected
ace_v_unaffected_damage_pop # Run the damage pop
return true # Exit the method true
end
ace_v_unaffected_item_effect(item) # Run the original method
#
end
#--------------------------------------------------------------------------
# * Application of Slip Damage Effects
#--------------------------------------------------------------------------
def slip_damage_effect
#
if @dmg_unaffected == true # If flagged unaffected
return true # Exit the method true
end
ace_v_unaffected_slip_damage_effect # Run the original method
#
end
#--------------------------------------------------------------------------
# * Application of Miss damage pop
#--------------------------------------------------------------------------
def ace_v_unaffected_damage_pop
#
self.damage = "Miss" # This is the pop text
#
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Apply/remove unaffected damage flag
# index : actor index in actor party array
# boolean : (true/false)
#--------------------------------------------------------------------------
def dmg_unaffected(index, boolean)
#
return unless boolean == true || boolean == false # Exit unless true/false
return if @actors[index].nil? # Exit if non-existant
@actors[index].dmg_unaffected = boolean # Set the value
return true
#
end
end
#==============================================================================
# ** Game_Troop
#------------------------------------------------------------------------------
# This class deals with troops. Refer to "$game_troop" for the instance of
# this class.
#==============================================================================
class Game_Troop
#--------------------------------------------------------------------------
# * Apply/remove unaffected damage flag
# index : enemy index in enemy troop array
# boolean : (true/false)
#--------------------------------------------------------------------------
def dmg_unaffected(index, boolean)
#
return unless boolean == true || boolean == false # Exit unless true/false
return if @enemies[index].nil? # Exit if non-existant
@enemies[index].dmg_unaffected = boolean # Set the value
return true
#
end
end
Instructions
Pretty simple instructions... in the script.
Compatibility
Designed for RPGMaker XP.
Terms and Conditions
Free for use, even in commercial scripts. However, I require due credit for myself, and Ace_V who inspired this simple scriptette.
RE: I ACED THIS BATTLER INVULNERABILITY - Ace_V - 05-21-2025