level 9
技能:你可弃置一枚XX标记,永久获得场上存活角色的一个技能。
2013年01月04日 21点01分
1
level 15
这段代码对应的是上面那个的技能
Cong_YingziCard = sgs.CreateSkillCard{
name = "Cong_YingziCard",
target_fixed = false,
will_throw = true,
filter = function(self, targets, to_select)
return #targets == 0
end,
on_effect = function(self, effect)
local source = effect.from
local target = effect.to
local room = source:getRoom()
local skill_list = target:getVisibleSkillList()
for _,skill in sgs.qlist(skill_list) do
if skill:getLocation() == sgs.Skill_Right then
choice = room:askForChoice(source, skill:objectName(), "yes+no")
if choice == "yes" then
room:acquireSkill(source, skill:objectName())
source:loseMark("@Cong_miku", 3)
break
end
end
end
end
}
目前我做了这样一个对每个技能都进行询问的效果,其实应该可以做出列表选择的方式,不知道“..”运算符可否
2013年01月05日 03点01分
3
碉堡了!!!!!
2013年01月05日 03点01分
level 15
把上面那段的效果部分改变一下,下面这种就可以直接选择技能了
on_effect = function(self, effect)
local source = effect.from
local target = effect.to
local room = source:getRoom()
local skill_list = target:getVisibleSkillList()
local choices = ""
for _,skill in sgs.qlist(skill_list) do
if skill:getLocation() == sgs.Skill_Right then
choices = choices .. skill:objectName() .. "+"
end
end
choices = choices .. "no"
choice = room:askForChoice(source, self:objectName(), choices)
if choice ~= "no" then
room:acquireSkill(source, choice)
source:loseMark("@Cong_miku", 3)
end
end
2013年01月05日 04点01分
4
好厉害!前边那个choice = ""是什么意思??
2013年01月05日 09点01分
回复 seast37 :初始化字符串
2013年01月05日 14点01分