Proto Damage Cap
Authors: game_guy
Version: 1.0
Type: Battle Add-On
Key Term: Battle Add-on
IntroductionApplies a simple damage cap like in most rpg's. You can only do 9999 damage at the max for example. But in most rpg's you can also break that damage cap with certain skills, weapons, or armors.
Features
- Set damage cap to whatever
- Change damage cap in game
- Toggle damage cap in game
- Excluded weapons, items, armors, and skills and enemies
ScreenshotsN/A
DemoN/A
Script
#===============================================================================
# Proto Damage Cap
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro:
# Applies a simple damage cap like in most rpg's. You can only do 9999 damage
# at the max for example. But in most rpg's you can also break that damage
# cap with certain skills, weapons, or armors.
#
# Features:
# Set damage cap to whatever
# Change damage cap in game
# Toggle damage cap in game
# Excluded weapons, items, armors, and skills and enemies
#
# Instructions:
# Go down to the config below and configure everything there.
#
# Script Calls:
# This can turn the damage cap on or off
# $game_system.cap_on = true/false : true = on, false = off
# This can change the damage cap in game
# $game_system.damage_cap = x : x = a number
#
# Compatibility:
# Not tested with SDK.
# Should work with about every battle system.
#
# Credits:
# game_guy ~ For making it
# GAX72 ~ For requesting it
# anagura.raziel ~ For requesting more features
#===============================================================================
module GG_Cap
#===========================================
# This is the max damage cap set for
# anything. Items, skills, attacks, etc.
#===========================================
Damage_Cap = 9999
#===========================================
# Any weapon placed in the array below is
# equipped, the damage cap won't apply to
# that actor.
#===========================================
Exclude_Weapons = [2, 3, 4]
#===========================================
# Any armor placed in the array below is
# equipped, the damage cap won't apply to
# that actor.
#===========================================
Exclude_Armors = [1, 2, 3]
#===========================================
# Any skill placed in the array below is
# used, the damage cap won't apply to
# that skill.
#===========================================
Exclude_Skills = [7, 8, 9, 57]
#===========================================
# Any skill placed in the array below is
# used, the damage cap won't apply to
# that skill.
#===========================================
Exclude_Items = [1, 2, 3]
#===========================================
# Any enemy placed in the array below,
# the damage cap won't apply to
# that enemy. This also means
# the cap will not apply to any skill
# that enemy uses.
#===========================================
Exclude_Enemies = [29, 30]
end
class Game_System
attr_accessor :damage_cap
attr_accessor :cap_on
alias gg_init_damage_cap_lat initialize
def initialize
@damage_cap = GG_Cap::Damage_Cap
@cap_on = true
gg_init_damage_cap_lat
end
end
class Game_Battler
include GG_Cap
alias gg_dmg_cap_atk_effect_lat attack_effect
def attack_effect(attacker)
return if !$game_system.cap_on
dmg = $game_system.damage_cap
last_hp = self.hp
result = gg_dmg_cap_atk_effect_lat(attacker)
if result && self.damage.is_a?(Integer)
if attacker.is_a?(Game_Actor)
flag = false
actor = attacker
Exclude_Armors.each{|a|
flag = (actor.armor1_id == a or
actor.armor2_id == a or
actor.armor3_id == a or
actor.armor4_id == a)
break if flag == true}
if Exclude_Weapons.include?(attacker.weapon_id)
flag = true
end
unless flag
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, dmg].min
self.hp -= Integer(self.damage)
end
elsif attacker.is_a?(Game_Enemy)
unless Exclude_Enemies.include?(self.id)
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, dmg].min
self.hp -= Integer(self.damage)
end
end
end
return result
end
alias gg_dmg_cap_skil_effect_lat skill_effect
def skill_effect(user, skill)
return if !$game_system.cap_on
dmg = $game_system.damage_cap
last_hp = self.hp
result = gg_dmg_cap_skil_effect_lat(user, skill)
if result && self.damage.is_a?(Integer)
if user.is_a?(Game_Actor)
if !Exclude_Skills.include?(skill.id)
if self.damage < 0
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, -dmg].max
self.hp -= Integer(self.damage)
else
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, dmg].min
self.hp -= Integer(self.damage)
end
end
elsif user.is_a?(Game_Enemy)
if !Exclude_Enemies.include?(self.id) ||
!Exclude_Skills.include?(skill.id)
if self.damage < 0
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, -dmg].max
self.hp -= Integer(self.damage)
else
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, dmg].min
self.hp -= Integer(self.damage)
end
end
end
end
return result
end
alias gg_dmg_cap_item_effect_lat item_effect
def item_effect(item)
return if !$game_system.cap_on
dmg = $game_system.damage_cap
result = gg_dmg_cap_item_effect(item)
if result && self.damamge.is_a?(Integer)
if !Exclude_Items.include?(item.id)
if self.damage < 0
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, -dmg].max
self.hp -= Integer(self.damage)
else
self.hp = last_hp
self.hp = self.hp
self.damage = [self.damage, dmg].min
self.hp -= Integer(self.damage)
end
end
end
end
end
InstructionsIn script.
Place below your custom battle system, unless its blizz-abs because I know it works.
CompatibilityNot tested with SDK.
Should work with any battle system.
Credits and Thanks
- game_guy ~ For making it
- GAX72 ~ For requesting it
- anagura.raziel ~ For requesting more features
Author's NotesEnjoy! :D
Lol, I was thinking "Wasn't GAX looking for something like this?" and then I saw that he requested it. xD
Awesome, thank you so much.
Hey, I get an error when trying to use recovery items from the menu.
Script 'Proto Damage Cap [Game_Guy]' Line 166:
NoMethodError occured.
undefined method 'gg_dmg_cap_item_effect' for
#<Game_Actor: 0x3da40d8>
I tried adding the items to the script (in the exclude items section) which didn't help.
Also, This script is the very last one before main.
PS: on an arguably related note, how's your modify max amount script coming along?
Great job.
I didn't know this marvel was here.
Ok, just tried it on a new project (with no other scripts) and still get the error
Bump. Does anybody know how to resolve this? I think the script is perfect aside from the error.
Sorry to trouble anyone. :huh:
Have tested the script, but from just looking at the code above, looks like the method name is missing the "_lat" from the end of the alias name.
On line 166, change the "gg_dmg_cap_item_effect" to "gg_dmg_cap_item_effect_lat". See if thats the problem.
fixed the error in question, however a new one appeared.
can't quite recall the exact error but on the next line down was a simple spelling error.
something like "damamge" which I changed to "damage".
Now the items don't get consumed, nor does it update your new HP\SP on the menu until you exit the menu and return. (actually, that's probably what happens to the items too, they may get consumed but you can't see it until you leave the menu, then come back.)
Anyway, it occured to me that maybe I could just remove the whole section regarding items which is what I did. I just wish I'd thought of that weeks ago, lol.
Gonna play test for a while.
Thanks ForeverZer0