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
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
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
#--------------------------------------------------------------------------
# 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
# 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
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
