#============================================================================== # ■ VXAce-RGSS3-8-opt ステート連動練度 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # 特定ステート付与の時に得意/不得意属性とします #------------------------------------------------------------------------------ # [データベース設定方法] # ステートのメモ欄に @attr_taste[属性ID,0:解除/1:得意/2:不得意] を入力 # 例) @attr_taste[3,0] # 炎を得意・不得意を解除 # @attr_taste[3,1] # 炎を得意に設定 # @attr_taste[3,2] # 炎を不得意に設定 #============================================================================== #============================================================================== # ■ RPG::State #============================================================================== class RPG::State < RPG::BaseItem #------------------------------------------------------------------------- # ● ステート連動練度 #------------------------------------------------------------------------- def attr_taste(attr_id) result = @note.scan(/@attr_taste\[(\d+),(\d+)\]/) return 3 if result.nil? or result.empty? val = result.select {|r| r[0].to_i == attr_id } v = val[0][1].to_i v.nil? or 0 > v or v > 2 ? 3 : v end end module SysUpdate #-------------------------------------------------------------------------- # ● ステート連動練度 #-------------------------------------------------------------------------- def self.state_taste(actor, attr_id) taste = [0,0,0,0] actor.states.each do |s| taste[s.attr_taste(attr_id)] += 1 end return ATTR_NORMAL if taste[0] > 0 # 解除があれば、無条件解除 return ATTR_GOOD if taste[1] > 0 and taste[1] > taste[2] return ATTR_BAD if taste[2] > 0 and taste[2] > taste[1] actor.attr[attr_id].taste end #-------------------------------------------------------------------------- # ● 熟練度取得 [再定義] #-------------------------------------------------------------------------- def self.attr_attack(actor, elements) attr = best_attr(actor, elements) return 1 if attr.id == 0 or attr.level == 0 rate = attr_rate(attr.id, actor.id) * (attr.level-1) #~ return calc_taste(actor.attr[attr.id].taste, rate) return calc_taste(state_taste(actor, attr.id), rate) end end