yeah, weapons don't have access to the damage formula because it's the skills that you use which deals damage so either you do this via skill damage formula, or have a plugin that give you the capability to modify the damage of skills with weapons, more than how you currently can do it via editing the parameters of the weapons. Though seeing your needs, I don't think you need to involve the weapons themselves. All you'd need is to check the weapon type and the corresponding "skill" that improves the damage when using that weapon type.
This was a relationship in the engine I was looking for a little more clarification on--it helped tremendously, thank you! I just got working with a little of scripting through the Game_Actor class. At first, I tried using a script directly through the damage formula, but I couldn't get it to work.
This is what I had:
Spoiler
class Game_Battler < Game_BattlerBase
def profDam(a, b, v)
dam = 0
if !$game_actors[1].equips[0].nil
if $game_actors[1].equips[0].wtype_id == 10&&$game_switches[17] #<-the "gun license" switch
dam += 2
end
end
3 + dam + a.atk * 0.4 - b.def * 0.2
end
end
Then I called it from the damage formula box with :
profDam(a, b, v)
The game launched without any errors but my main attack skill did 0 damage, and using some debug printing I could tell that the script wasn't executing.
Moving on, I thought to just use the v[n] capability of the damage formula and change its value based on the gun license with a script elsewhere. Thinking of an entry point, I landed on the weapon or armor is equip method in Game_Actor called "change_equip_by_id". I aliased the method then appended it with the same code I tried in profDam earlier. I switch control variable[21] to 2 if the weapon equipped is a gun, and make sure to switch it back to 0 if the weapon is not a gun.
Here is the alias method:
Spoiler
class Game_Actor < Game_Battler
alias changeSlot change_equip_by_id
def change_equip_by_id(slot_id, item_id)
changeSlot(slot_id, item_id)
if $game_actors[1].equips[0] != nil
if $game_actors[1].equips[0].wtype_id == 10&&$game_switches[17]
$game_variables[21] = 2 #damage bonus
else
$game_variables[21] = 0
end
#p $game_variables[21]
end
end
end
And then the damage formula looks like:
3 + v[21] + a.atk * 0.4 - b.def * 0.2
This is a really useful entry point for me, because I can very easily make the damage variable grow as the player upgrades their gun skill. I was also looking for a place to make sure that the corresponding ammo type is set to the reload slot every time the player switches weapons, and this is the perfect place for that as well.
All in all, problem solved! Thanks again for both of your help.