Project1
标题:
如何修改角色最大属性值?
[打印本页]
作者:
601372608
时间:
2015-3-8 19:13
标题:
如何修改角色最大属性值?
问题同上,如何把攻击力防御力精神敏捷调大一点?默认最大值是999,我想调到99999
哪位大神能帮帮我,教教我改哪里?
还有物品系统默认最多是99个,我想调成9999个,这些都该调哪里呢?
我用事件处理战斗系统,但是角色最大属性值太低了才999。而且武器防具那些最大属性都很少都是500
这些都应该调哪里呢?
作者:
欧买歌
时间:
2015-3-8 20:06
class Game_Battler
def maxhp_limit
return 999999
end
def maxhp
return [[base_maxhp + @maxhp_plus, 1].max, maxhp_limit].min
end
def maxmp
return [[base_maxmp + @maxmp_plus, 0].max, 999999].min
end
def atk
n = [[base_atk + @atk_plus, 1].max, 99999].min
for state in states do n *= state.atk_rate / 100.0 end
n = [[Integer(n), 1].max, 99999].min
return n
end
def def
n = [[base_def + @def_plus, 1].max, 99999].min
for state in states do n *= state.def_rate / 100.0 end
n = [[Integer(n), 1].max, 99999].min
return n
end
def spi
n = [[base_spi + @spi_plus, 1].max, 99999].min
for state in states do n *= state.spi_rate / 100.0 end
n = [[Integer(n), 1].max, 99999].min
return n
end
def agi
n = [[base_agi + @agi_plus, 1].max, 99999].min
for state in states do n *= state.agi_rate / 100.0 end
n = [[Integer(n), 1].max, 99999].min
return n
end
def maxhp=(new_maxhp)
@maxhp_plus += new_maxhp - self.maxhp
@maxhp_plus = [[@maxhp_plus, -999999].max, 999999].min
@hp = [@hp, self.maxhp].min
end
def maxmp=(new_maxmp)
@maxmp_plus += new_maxmp - self.maxmp
@maxmp_plus = [[@maxmp_plus, -999999].max, 999999].min
@mp = [@mp, self.maxmp].min
end
def atk=(new_atk)
@atk_plus += new_atk - self.atk
@atk_plus = [[@atk_plus, -99999].max, 99999].min
end
def def=(new_def)
@def_plus += new_def - self.def
@def_plus = [[@def_plus, -99999].max, 99999].min
end
def spi=(new_spi)
@spi_plus += new_spi - self.spi
@spi_plus = [[@spi_plus, -99999].max, 99999].min
end
def agi=(new_agi)
@agi_plus += new_agi - self.agi
@agi_plus = [[@agi_plus, -99999].max, 99999].min
end
end
复制代码
作者:
601372608
时间:
2015-3-9 09:42
欧买歌 发表于 2015-3-8 20:06
谢谢,我还想修改一下物品最大数量上限,把99个改成9999个,能帮我吗?
作者:
欧买歌
时间:
2015-3-9 16:33
class Game_Party
def gain_item(item, n, include_equip = false)
number = item_number(item)
case item
when RPG::Item
@items[item.id] = [[number + n, 0].max, 9999].min
when RPG::Weapon
@weapons[item.id] = [[number + n, 0].max, 9999].min
when RPG::Armor
@armors[item.id] = [[number + n, 0].max, 9999].min
end
n += number
if include_equip and n < 0
for actor in members
while n < 0 and actor.equips.include?(item)
actor.discard_equip(item)
n += 1
end
end
end
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1