There's just no love for the monsters. C'mon. Not every monster attacks by brute strength, ya know? We werewolves are a dextrous lot.
Oh, alright. I cobbled this up. Basically, I made a module for you to pick and choose what weapons ... AND MONSTERS.... apply a stat other than strength to the self.damage calculation. If you don't have a weapon or monster defined within, it defaults back to strength..
For this, I also directly edited the Game_Battler class's
attack_effect method. It's cheesy and simple, putting in a section that reads from the config and decides which stat to use. But as one said: "If it's stupid and it works, it's not stupid."
😀
If you have any other script that modifies the attack_effect method, put this one above that method. This one overwrites changes while other scripts may merely add new options. I hope it's easy enough to understand.
Code:
module DVCalc
#--------------------------------------------------------------------------
WEAPON, MONSTER = {}, {} # Do Not Touch
#--------------------------------------------------------------------------
# The basic idea is to make MONSTER or WEAPON entries like below. What is
# in the brackets [ ] is the ID of the monster or weapon from the database.
# Valid entries on the right are the 4 stats "Str", "Agi", "Dex" and "Int".
# If no monster or weapon has an entry, it defaults to "Str" as normal.
# I set up Knives to use Agility
WEAPON[13] = "Agi"
WEAPON[14] = "Agi"
WEAPON[15] = "Agi"
WEAPON[16] = "Agi"
# I set up Bows and Guns to use Dexterity
WEAPON[17] = "Dex"
WEAPON[18] = "Dex"
WEAPON[19] = "Dex"
WEAPON[20] = "Dex"
WEAPON[21] = "Dex"
WEAPON[22] = "Dex"
WEAPON[23] = "Dex"
WEAPON[24] = "Dex"
# I set up a bunch of 'Demon' and 'Angel' types for Intelligence attacks
MONSTER[1] = "Int"
MONSTER[7] = "Int"
MONSTER[8] = "Int"
MONSTER[16] = "Int"
MONSTER[23] = "Int"
MONSTER[24] = "Int"
MONSTER[25] = "Int"
MONSTER[31] = "Int"
MONSTER[32] = "Int"
# Some rather reptilian or aquatics use their speed
MONSTER[10] = "Agi"
MONSTER[11] = "Agi"
MONSTER[15] = "Agi"
MONSTER[18] = "Agi"
MONSTER[19] = "Agi"
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Clear critical flag
self.critical = false
# First hit detection
hit_result = (rand(100) < attacker.hit)
# If hit occurs
if hit_result == true
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
# ---------------------------------------------------------------------
# Start of Change Here
# ---------------------------------------------------------------------
stat = attacker.str
hash = (attacker.is_a?(Game_Enemy)) ? DVCalc::MONSTER : DVCalc::WEAPON
id = (attacker.is_a?(Game_Enemy)) ? attacker.id : attacker.weapon_id
stat_id = hash[id] if hash.has_key?(id)
unless stat_id.nil?
case stat_id
when "Str" ; stat = attacker.str
when "Dex" ; stat = attacker.dex
when "Agi" ; stat = attacker.agi
when "Int" ; stat = attacker.int
else ; stat = attacker.str
end
end
self.damage = atk * (20 + stat) / 20
# ---------------------------------------------------------------------
# End of Change Here
# ---------------------------------------------------------------------
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Critical correction
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# Guard correction
if self.guarding?
self.damage /= 2
end
end
# Dispersion
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Second hit detection
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# If hit occurs
if hit_result == true
# State Removed by Shock
remove_states_shock
# Substract damage from HP
self.hp -= self.damage
# State change
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# When missing
else
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# End Method
return true
end
end