Project1
标题:
如何在特定状态可使用特定技能
[打印本页]
作者:
clannad
时间:
2011-3-23 23:18
标题:
如何在特定状态可使用特定技能
就是比方说技能“十字剑”在附加了状态“沉默”的情况下可以使用,这个该怎么办?
作者:
Wind2010
时间:
2011-3-24 12:30
$louse_can_use_skill = []
# 上面是初始化
#===============================================================================
# 自定义内容
# 定义方法:
# $louse_can_use_skill.push([技能ID,状态ID])
# 定义后只有在该状态下才能使用该技能
# 咳咳SP不够自然也不能用
#===============================================================================
$louse_can_use_skill.push([57,5])
#===============================================================================
# 脚本内容
#===============================================================================
$louse_states_id = []
$louse_skills_id = []
for shizi in $louse_can_use_skill
$louse_states_id.push(shizi[1])
$louse_skills_id.push(shizi[0])
end
class Game_Battler
def skill_can_use?(skill_id)
if $data_skills[skill_id].sp_cost > self.sp
return false
end
if dead?
return false
end
if $data_skills[skill_id].atk_f == 0 and self.restriction == 1
return false
end
occasion = $data_skills[skill_id].occasion
if $game_temp.in_battle
for i in 0...$louse_skills_id.size
shizi_skill = $louse_skills_id[i]
if skill_id == shizi_skill
return self.state?($louse_states_id[i])
end
end
return (occasion == 0 or occasion == 1)
else
return (occasion == 0 or occasion == 2)
end
end
end
复制代码
作者:
clannad
时间:
2011-3-24 15:57
回复
Wind2010
的帖子
哦!!!!好的,prefect!!!
谢谢啊
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1