GW Special Damage
Version: 1.0
Author: Mr G W
Date: (DD/MM/YYYY) - 30/8/2011
Version History
- <Version 1.0> 2011.8.30 - Original Release
Planned Future Versions
Description
Allows weapons to deal special damage to certain enemies.
Features
- Allows creation of weaknesses and resistances independent to the enemy's elemental weaknesses.
Screenshots
None.
Instructions
Place where it says Materials. Use the note tags to apply the effects you want.
Script
=begin
==================================================================================================
==================================================================================================
Special Damage
Version 1.0
By Mr G W - Rmrk.net
Date (DD/MM/YYYY) - 30/8/2011
<Version 1.0> 2011.8.30 - Original Release
Allows weapons to deal more or less damage depending on the enemy, without
interfering with the elements. This is useful for making weaknesses.
Due to how the element system works, weapons/skills that have multiple elements,
the element with the highest damage is chosen, which may has his disadvantages.
Example:
Werewolf
Weakness: Slash, Silver
Knight
Resistant: Slash
Neutral: Silver
Warlord
Resistant: Slash
Immune: Silver
Following this example, a Silver Sword (Slash + Silver) would do extra damage to
the werewolf, but neutral damage to the Knight, despite his Slash resistance.
The warlord, would take the lowered damage due to his resistance to slash and
immunity to silver.
Now lets say you have a Silver Ray dealing only Silver damage.
It would do extra damage to the Werewolf, neutral to knight and no damage to
warlord.
Now lets say you want both the Silver Sword to deal extra damage
to Werewolf and reduced damage to the Knight and Warlord, while the Silver Ray
deals neutral damage to the Knight and the Warlord. You would need to play
around with the elements to achieve that.
With this script, this is much easier.
For items/skills.
<special: id dmg>
ID - The damage type identifier.
Dmg - The damage modifier. 100 = No change.
For enemies
<special: id>
ID - The damage type modifier. If it matches the actor weapon/skill/item, the
enemy's damage will be modified.
Example:
Holy Water - <special: 1 200>
Demon - <special: 1>
The demon takes 200% (double) damage from the Holy Water.
Use the <special> tag on a skill or item to inherit the from weapons.
==================================================================================================
==================================================================================================
Compatibility:
This script aliases make_attack_damage_value.
This script should work with other combat-related scripts unless they override
these methods and are placed below this script. If the overriding script
is placed above this one, then this script should work properly.
=end
$imported = {} if $imported == nil
$imported["GWSpecial"] = true
class Game_Battler
alias gw_special_make_obj_damage_value make_obj_damage_value
def make_obj_damage_value(user, obj)
gw_special_make_obj_damage_value(user, obj)
@hp_damage *= special_damage(user,0) if obj.skill_special == true
@hp_damage /= 100 if obj.skill_special == true
@hp_damage *= special_damage(user,1) if obj.skill_special == true
@hp_damage /= 100 if obj.skill_special == true
@hp_damage *= skill_special_damage(user,obj) if obj.skill_special == false
@hp_damage /= 100 if obj.skill_special == false
end
def skill_special_damage(user, obj)
multi = 100
return multi unless user.actor?
return multi unless obj.special[0] == enemy.special
multi = obj.special[1]
return multi
end #Def
alias gw_make_attack_damage_value make_attack_damage_value
def make_attack_damage_value(attacker)
gw_make_attack_damage_value(attacker)
@hp_damage *= special_damage(attacker,0)
@hp_damage /= 100
@hp_damage *= special_damage(attacker,1)
@hp_damage /= 100
end
def special_damage(attacker, weapon)
multi = 100
return multi unless attacker.actor?
return multi if attacker.weapons[weapon] == nil
return multi unless attacker.weapons[weapon].special[0] == enemy.special
multi = attacker.weapons[weapon].special[1]
return multi
end #Def
end #Class
class RPG::BaseItem
def skill_special
self.note.scan(/<special>/i){
return true}
return false
end
def special
self.note[/<special: ([-0-9]+) ([-0-9]+)>/]
return [$1.to_i, $2.to_i]
end
end
class RPG::Enemy
def special
self.note[/<special: ([-0-9]+)>/]
return $1.to_i
end
end
You can also get it from the attachment.
Credit
Thanks
- People who made scripts - I've been learning on my own, so other scripts help me understand how RGSS works.
Support
Just post here. If i don't answer, it's because I can't be on.
Any errors or glitches, feel free to post.
Known Compatibility Issues
This script aliases make_attack_damage_value.
This script should work with other combat-related scripts unless they override
these methods and are placed below this script. If the overriding script
is placed above this one, then this script should work properly.
Demo
None.
Author's Notes
Nothing to say for now.
Restrictions
For commercial use, contact me first. You can use this script how you want as long as you credit.