本帖最后由 芯☆淡茹水 于 2013-5-7 01:43 编辑
{:2_282:} 我知道什么原因了
LZ设置的每20秒恢复一滴血。当到20秒时,脚本自动处理恢复血,处理完后,还没到第21秒,然后又继续处理,,,,,一直处理到21秒后停止处理
So,,,,,
先在地图场景,生成完窗口后定义:@wait_count = 0
然后在 刷新 -- 循环下插入
if @wait_count > 0 @wait_count -= 1 end time = Graphics.frame_count / Graphics.frame_rate if time % 20 == 0 and @wait_count == 0 for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.hp < actor.maxhp actor.hp += 1 end end @wait_count = 40 end
if @wait_count > 0
@wait_count -= 1
end
time = Graphics.frame_count / Graphics.frame_rate
if time % 20 == 0 and @wait_count == 0
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.hp < actor.maxhp
actor.hp += 1
end
end
@wait_count = 40
end
|