查看: 1116|回复: 4

关于青魔法学会提示的问题

  [复制链接]
梦石
0
星屑
50
在线时间
231 小时
注册时间
2007-12-17
回帖
384
发表于 2008-3-6 22:46:39 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
脚本:
http://rpg.blue/web/htm/news13.htm

照理说按照下面的脚本,在学会了敌人的特技以后不会再出现"学会该特技"的提示了,可是为什么角色被已经学会了的特技打中还是会反复出现这样的提示呢?

for target in $scene.target_battlers
if target.is_a?(Game_Actor)
  skill=$scene.skill
  c = target.class_id == 1 ? true:false
  if c and not target.skills.include?(skill)
    target.learn_skill(skill.id)
    textinfo = target.name + " 学会了 "
    textinfo += "\\c[4]["+skill.name+"]"
    $game_temp.message_text = textinfo
  end
end
end
版务信息:本贴由楼主自主结贴~
头像被屏蔽
梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-2-18
回帖
1385
发表于 2008-3-6 22:55:30 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

梦石
0
星屑
50
在线时间
231 小时
注册时间
2007-12-17
回帖
384
 楼主| 发表于 2008-3-6 23:03:37 | 显示全部楼层
如果我想再多一个条件判断:角色的状态为 54 时才可以学会是不是可以写成这样?
for target in $scene.target_battlers
if target.is_a?(Game_Actor)
  skill=$scene.skill
  c = target.class_id == 13 ? true:false
  if c and not target.skill_learn?(skill.id) and target.states.include?(54)
    target.learn_skill(skill.id)
    textinfo = target.name + " 学会了 "
    textinfo += "\\c[4]["+skill.name+"]"
    $game_temp.message_text = textinfo
  end
end;end
回复

使用道具 举报

梦石
0
星屑
50
在线时间
231 小时
注册时间
2007-12-17
回帖
384
 楼主| 发表于 2008-3-6 23:09:50 | 显示全部楼层
写成上面这样战斗时就出错了。。SyntaxError
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-2-18
回帖
1385
发表于 2008-3-6 23:12:45 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部