Help with get weapon stat

Hello All,

Background:
I have a functioning evented ABS project that I am fine tuning. the trouble I am having, is I am trying to get the ATK power of the weapon that actor[0] has equipped.

So when I call the equiped weapon for use, instead of setting conditional branches to check for each individual weapon and each weapon type, I can just grab the ATK strength from any weapon that is equipped, shrinking the amout of eventing required.

I have been working through a few threads trying to find a way to get at this and I get more errors than solutions.

http://www.rpgmakervxace.net/topic/11986-how-to-make-a-simple-check-if-actor-doesnt-have-a-weapon-equipped/

http://www.rpgmakervxace.net/topic/26772-custom-script-to-determine-if-a-weapon-type-is-equipped-in-the-second-weapon-slot/

and see scripts

 

Spoiler
#--------------------------------------------------------------------------
# Battler Additions
#--------------------------------------------------------------------------
class Game_Battler < Game_BattlerBase
def wtype_equipped?(wtype_id)
return weapons.any? {|weapon| weapon.wtype_id == wtype_id }
end

def atype_equipped?(atype_id)
return armors.any? {|armor| armor.atype_id == atype_id}
end
end

#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# A battler class with methods for sprites and actions added. This class
# is used as a super class of the Game_Actor class and Game_Enemy class.
#==============================================================================

class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# * Get Weapons Attack Power
# slot : weapon slot
# combined : if true combine power of dual wielding weapons
#--------------------------------------------------------------------------
def w_atk(slot = 0, combined = false)
# Return Attack if Enemy
return atk if enemy?
# Set Initial Value
value = 0
# If Combined and Dual wielding
if combined and dual_wield?
# Increase Value by attack power of weapons
weapons.each {|w| value += w.params.at(2)}
else
# Increase Value by attack power of weapon at slot
value += weapons.at(slot).params.at(2) and !weapons.at(slot).nil?
end
# Return Value
return value
end
end
end
How I am using:
Conditional Branch: Script: $game_party.leader.wtype_equipped?(1)
>Script: $game_variables[#] = w_atk(slot = 0, combined = false)
 
Is there a way using features, notes, or script to capture the value located at Weapons>Parameter Changes>ATK to a $game_variable?

Or can someone correct the way I am trying to access the function?
 
Thanks
Bump in da night

Any Ideas?

To give an example I have an evented work-around right now

The main points to notice are:

$game_party.leader.wtype_equipped?(1)

(1 represents AXE weapon Type - is the all I need to branch.  It does not matter what kind of Axe unit (i.e. weapon_id[1], weapon_id[2], etc) it is only important what the ATK power is.)

Followed By:

Condition Branch: Eric is Handaxe Equiped

(This branch will need to be repeated for each weapon Axe Item(i.e. weapon_id[1] equipped?, weapon_id[2] equipped?, etc))

Regardless of what Axe is equipped the annimation will be the same, but the ATK will be different.  There is no need to check each weapon individually and assign a value if we can just pull from the currently equipped weapon slot and get the ATK value.

wp.png
You can only bump every 72 hours.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-get-weapon-stat.37711/