| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 0 |  
| 最后登录 | 2020-4-12 |  
| 在线时间 | 9 小时 |  
 Lv1.梦旅人 
	梦石0 星屑105 在线时间9 小时注册时间2020-3-2帖子7 | 
| 
请问如何判断角色进入异常状态(中毒,黑暗之类)
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  我想在这两行加入判断异常状态的语句
 elsif (actor.hp.to_f/actor.mhp) < 0.25 && actor.hp != 0 #血量比<0.25并且没死
 draw_face(actor.face_name, actor.face_index+2, x, y, enabled)
 我改的是
 elsif actor.state?(2)||(actor.hp.to_f/actor.mhp) < 0.25 && actor.hp != 0 #血量比<0.25并且没死
 draw_face(actor.face_name, actor.face_index+2, x, y, enabled)
 但是没反应,是怎么回事啊
 
 def draw_actor_face(actor, x, y, enabled = true)    #重点部分    #上面的优先于下面的条件    if if $vic && actor.hp != 0 #胜利时      draw_face(actor.face_name, actor.face_index+7, x, y, enabled)    elsif $ating && actor.id == $atid #除了正在防御外,行动者的头像更改      draw_face(actor.face_name, actor.face_index+1, x, y, enabled)    elsif $tffing && actor.id == $tffid #如果受到回复,被回复者的头像更改      draw_face(actor.face_name, actor.face_index+4, x, y, enabled)    elsif $hpd && actor.id == $hpdid # 如果受到伤害,受到伤害者头像更变      draw_face(actor.face_name, actor.face_index+5, x, y, enabled)    elsif $ging && actor.id == $gid #正在防御者的头像更改      draw_face(actor.face_name, actor.face_index+6, x, y, enabled)    else    if (actor.hp.to_f/actor.mhp) >= 0.25 #血量比>=0.25      draw_face(actor.face_name, actor.face_index, x, y, enabled)    elsif (actor.hp.to_f/actor.mhp) < 0.25 && actor.hp != 0 #血量比<0.25并且没死      draw_face(actor.face_name, actor.face_index+2, x, y, enabled)    elsif actor.hp == 0#死了      draw_face(actor.face_name, actor.face_index+3, x, y, enabled)    end    end  endend
def draw_actor_face(actor, x, y, enabled = true) 
    #重点部分 
    #上面的优先于下面的条件 
    if if $vic && actor.hp != 0 #胜利时 
      draw_face(actor.face_name, actor.face_index+7, x, y, enabled) 
    elsif $ating && actor.id == $atid #除了正在防御外,行动者的头像更改 
      draw_face(actor.face_name, actor.face_index+1, x, y, enabled) 
    elsif $tffing && actor.id == $tffid #如果受到回复,被回复者的头像更改 
      draw_face(actor.face_name, actor.face_index+4, x, y, enabled) 
    elsif $hpd && actor.id == $hpdid # 如果受到伤害,受到伤害者头像更变 
      draw_face(actor.face_name, actor.face_index+5, x, y, enabled) 
    elsif $ging && actor.id == $gid #正在防御者的头像更改 
      draw_face(actor.face_name, actor.face_index+6, x, y, enabled) 
    else 
    if (actor.hp.to_f/actor.mhp) >= 0.25 #血量比>=0.25 
      draw_face(actor.face_name, actor.face_index, x, y, enabled) 
    elsif (actor.hp.to_f/actor.mhp) < 0.25 && actor.hp != 0 #血量比<0.25并且没死 
      draw_face(actor.face_name, actor.face_index+2, x, y, enabled) 
    elsif actor.hp == 0#死了 
      draw_face(actor.face_name, actor.face_index+3, x, y, enabled) 
    end 
    end 
  end 
end 
 | 
 |