class Game_Enemy
attr_accessor :level # 等级
alias old_initialize initialize
def initialize
old_initialize
@level = 0
end
end
module RPG
class enemy
attr_accessor :level
alias old_initialize initialize
def initialize
old_initialize
@level = 0
end
def name
name = @name.split(/,/)[0]
return @name != nil : ""
end
def level
level = @name.split(/,/)[1]
return @level != nil : ""
end
end
end
在Game_Enemy里新增一个level属性好了。
class Game_Enemy
attr_accessor :level # 等级
alias old_initialize initialize
def initialize
old_initialize
@level = 0
end
end
(论坛原因导致脚本变形,所以用引用……)
然后使用$game_troop.enemies[0].level来更改一号敌人的等级。
未经测试,写错请答复......
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |