Project1

标题: 求教两句if脚本的写法,关于行动类型的 [打印本页]

作者: stella    时间: 2008-2-13 18:38
标题: 求教两句if脚本的写法,关于行动类型的
如果现在活跃的战斗者,他行动的类型是攻击或者使用特技,那么........


如果现在活跃的战斗者,他行动的类型是使用物品或者防御,那么......... [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 禾西    时间: 2008-2-13 20:54
if @active_battler.current_action.kind < 2
else
作者: stella    时间: 2008-2-13 21:38
if @active_battler.current_action.kind < 2  是指什么呢?

是指第一个攻击或者使用特技?还是第二个使用物品或者防御??
作者: 魔影    时间: 2008-2-13 23:34
if @active_battler.current_action.basic == 0 and
   @active_battler.current_action.kind == 0           #普通攻击

end


if @active_battler.current_action.kind == 1    #特技

end


if @active_battler.current_action.kind == 2    #物品

end

作者: stella    时间: 2008-2-14 00:10
以下引用魔影于2008-2-13 15:34:58的发言:

if @active_battler.current_action.basic == 0 and
  @active_battler.current_action.kind == 0           #普通攻击

end


if @active_battler.current_action.kind == 1    #特技

end


if @active_battler.current_action.kind == 2    #物品

end



那么,如果行动的类型是攻击或者使用特技就可以写成下面这样???还有,防御应该怎么写?

if (@active_battler.current_action.basic == 0 and @active_battler.current_action.kind == 0) or (@active_battler.current_action.kind == 1)

作者: 魔影    时间: 2008-2-14 00:23
应该可以,


if @active_battler.current_action.basic == 1 and
@active_battler.current_action.kind == 0         #防御 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1