本帖最后由 魔法丶小肉包 于 2017-5-15 00:38 编辑
如果楼主只是想描绘出“力量”这个属性的值的话,可以用用看↓
使用了此脚本之后,力量将会在状态画面描绘出来,但其值是受到角色的最大hp所控制的(并不是力量控制mhp,而是mhp控制力量),只是感觉上是多了一个属性
如果楼主是想加一个真实的属性,并且是由这个属性去控制mhp的话,就需要另外去写了
class Window_Status < Window_Selectable def draw_block3(y) draw_parameters(32, y) draw_equipments(288, y) change_color(system_color) draw_text(32, y + line_height * 6, 180, line_height, "力量") change_color(normal_color) draw_text(32+120, y + line_height * 6, 36, line_height, $game_variables[1],2) end end class Game_Actor < Game_Battler def initialize(actor_id) super() setup(actor_id) @last_skill = Game_BaseItem.new $game_variables[1] = (self.mhp/10.0).to_i end def level_up @level += 1 self.class.learnings.each do |learning| learn_skill(learning.skill_id) if learning.level == @level end $game_variables[1] = (self.mhp/10.0).to_i end end
class Window_Status < Window_Selectable
def draw_block3(y)
draw_parameters(32, y)
draw_equipments(288, y)
change_color(system_color)
draw_text(32, y + line_height * 6, 180, line_height, "力量")
change_color(normal_color)
draw_text(32+120, y + line_height * 6, 36, line_height, $game_variables[1],2)
end
end
class Game_Actor < Game_Battler
def initialize(actor_id)
super()
setup(actor_id)
@last_skill = Game_BaseItem.new
$game_variables[1] = (self.mhp/10.0).to_i
end
def level_up
@level += 1
self.class.learnings.each do |learning|
learn_skill(learning.skill_id) if learning.level == @level
end
$game_variables[1] = (self.mhp/10.0).to_i
end
end
|