# ==============================================================================
# Z26 : XParameters Zetu Engine X
# ------------------------------------------------------------------------------
# To use this script, edit the STATS array to include all new parameters
# needed. These stats can hold strings (If edited in an Event) as long as
# that stat is NOT listed in 'actor_level_formulas'.
# ==============================================================================
# =========================================================================
# Syntax:
# (Game_Battler).xstats.(STAT) => Stat of the Actor
# Regexp (In equipment note)
# <stat var: X Y> => Increases stat X by Y amount.
# =========================================================================
# =========================================================================
# Examples
# $game_party.members[0].xstats.char #=> Party leader's char
# $game_actors[3].xstats.dex += 3 #=> Adds 3 to Actor ID 3's dex
# =========================================================================
#==============================================================================#
# ZETU'S XSTAT PARAMETERS #
# By: Zetu #
#==============================================================================#
module Z26
STATS = ['age', 'tx', 'rng', 'str', 'spd', 'prof', 'save', 'skl', 'ac', 'char',
'kick', 'punch', 'physbon', 'attsplbon', 'healsplbon', 'mglv', 'sklv', 'mgu',
'sku', 'mcred', 'mxwgt', 'curwgt', 'physr', 'mr', 'fr', 'er', 'war', 'wir',
'stmr', 'dr', 'lr', 'bldr', 'hvyr', 'projr', 'pr', 'imbind', 'imcom',
'imcond', 'imsub', 'imshape', 'imfire', 'imearth', 'imwater', 'imwind',
'imstorm', 'imdark', 'imlight', 'impoison', 'imhvy', 'imbld', 'improj', 'imconf',
'imburn', 'imshock', 'imdrown', 'climb', 'swim', 'crush', 'jump', 'pkup', 'canmove',
'canatt', 'twa', 'ta', 'thra', 'tm', 'hassummon', 'hascomm', 'isbind',
'iscond', 'iscom', 'istrap', 'issub', 'isshape', 'ispoison', 'isconf',
'isdrown', 'isshock', 'isburn', 'poisonrds', 'shaperds', 'condrds',
'summonrds', 'hascommandrds', 'commandrds', 'bindrds', 'traprds', 'subrds',
'burnrds' 'drownrds', 'shockrds', 'traprds', 'trapisdeath', 'subisdeath',
'poisonisdeath', 'shapeisdeath', 'commandisdeath', 'condisdeath', 'confisdeath',
'confrds', 'bindisdeath', 'conddam', 'poisdam', 'comdam', 'binddam',
'trapdam', 'confdam', 'shapedam', 'burndam', 'shockdam', 'drowndam',
'traphascond', 'subhascond', 'confhascond', 'poishascond', 'shockhascond',
'burnhascond', 'drownhascond', 'comhascond', 'bindhascond', 'haseffect', 'effid',
'effrds', 'travdamr', 'travdam', 'deadrds', 'lasttownmap', 'condid', 'deaths',
'slantwalk', 'pointflight', 'score', 'battlekills', 'secretsfound', 'youthelixir',
'totaldamagedealt', 'totaldamagetaken', 'isobscure', 'morphlevel', 'chhgt', 'chwgt',
'size', 'sizerds', 'issize', 'sizeisdeath', 'sizehascond', 'sizedam', 'oldage',
'isold', 'isreading', 'cantransfer', 'canmenu', 'canclimb', 'canswim', 'canjump',
'teleporting', 'flying', 'digging', 'canmoveonland'] #All Lowercase. No Symbols or Spaces
REGEXP = /<stat[ ]*var[: ]+(.*)[ ]+(\d+)>/i
#==================do not edit below==========================================
SYMBOLS = []
for stat in STATS
SYMBOLS.push(eval(':'+stat))
end
Xstats = Struct.new(*SYMBOLS)
end
class Game_Actor < Game_Battler
attr_accessor :xstats
alias z26_s setup unless $@
def setup(actor_id)
z26_s(actor_id)
@xstats = Z26::Xstats.new(*([0]*Z26::STATS.size))
for item in equips.compact
z26variate_equip(item)
end
for stat in Z26::STATS
z26variate_stats(stat, @level)
end
end
alias z26_change_equip change_equip
def change_equip(equip_type, item, test = false)
last_item = equips[equip_type]
z26_change_equip(equip_type, item, test)
z26variate_equip(item)
z26variate_equip(last_item, false)
end
def z26variate_equip(item, adding = true)
return if item.nil?
for line in item.note.split(/[\r\n]+/).each{ |a|
case a
when /<weapon[ ]var:[ ](.*)[ ](\d+)>/i
if Z26::STATS.include?($1)
if adding
eval("@xstats.#{$1} += #{$2}")
else
eval("@xstats.#{$1} -= #{$2}")
end
end
end
}
end
end
end