加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 Luciffer 于 2012-11-12 22:58 编辑
想做一个能够根据战斗次数提高攻击的武器脚本
自己写的脚本如下
class Game_Actor < Game_Battler attr_reader :bloodtime def Bloodability for weapon in weapons.compact return true if weapon.Bloodswitch end return false end def Bloodtime if Bloodability @bloodtime += 1 end end def base_atk n = actor.parameters[2, @level] for item in equips.compact do n += item.atk end if Bloodability == true n += @bloodtime end if n > 999 n = 999 end return n end end class RPG::BaseItem def Bloodswitch self.note.split(/[\r\n]+/).each { |line| return true if line =~ /\[BLOOD\]/ } return false end end
class Game_Actor < Game_Battler
attr_reader :bloodtime
def Bloodability
for weapon in weapons.compact
return true if weapon.Bloodswitch
end
return false
end
def Bloodtime
if Bloodability
@bloodtime += 1
end
end
def base_atk
n = actor.parameters[2, @level]
for item in equips.compact do n += item.atk end
if Bloodability == true
n += @bloodtime
end
if n > 999
n = 999
end
return n
end
end
class RPG::BaseItem
def Bloodswitch
self.note.split(/[\r\n]+/).each { |line|
return true if line =~ /\[BLOOD\]/
}
return false
end
end
|