突发奇想:阵亡后发动技能如何实现?
太阳神三国杀lua吧
全部回复
仅看楼主
level 9
chh317 楼主
【庇佑】你阵亡时,可将所有牌移除游戏,记为“佑”。在一名角色的判定牌生效前,你可以打出一张“佑”代替之。
困难1:阵亡后,移除游戏的牌放哪?
困难2:如何询问阵亡的角色进行操作?
或许可以模拟一个假死的状态实现这个技能吧。
好久没来了,分享个奇思妙想活跃下氛围[滑稽]
2019年02月10日 16点02分 1
level 9
chh317 楼主
阵亡后改判定算是做出来了,只是阵亡后全场身份都亮了,还怎么玩[喷]
2019年02月11日 06点02分 2
level 7
能看下代码吗
2019年02月13日 18点02分 4
level 9
chh317 楼主
b**iyouTG = sgs.CreateTriggerSkill{
name = "#b**iyouTG",
events = {sgs.AskForRetrial} ,
on_trigger = function(self, event, player, data)
local room = player:getRoom()
local p = player
while 1 do
p = p:getNext()
if p:isAlive() then
return
elseif p:getGeneralName() == "bjshenxiaojie" or p:getGeneral2Name() == "bjshenxiaojie" then
local ids = p:handCards()
if ids:length() == 0 then return end
if room:askForSkillInvoke(p, self:objectName()) then
room:fillAG(ids,p)
local id = room:askForAG(p, ids, true, "bjshenxiaojie")
room:clearAG(p)
if id >= 0 then
local judge = data:toJudge()
room:retrial(sgs.Sanguosha:getCard(id), p, judge, self:objectName())
end
end
return
end
end
end,
can_trigger = function(self, target)
return target
end,
}
b**iyoubury = sgs.CreateTriggerSkill{
name = "b**iyoubury",
frequency = sgs.Skill_NotFrequent,
events = {sgs.CardsMoveOneTime},
on_trigger = function(self, event, player, data)
local room = player:getRoom()
local shenxiaojietx = room:findPlayerBySkillName("b**iyou")
if shenxiaojietx then
room:detachSkillFromPlayer(shenxiaojietx, self:objectName())
return
end
local move = data:toMoveOneTime()
local p = player
shenxiaojietx = nil
if p:getGeneralName() == "bjshenxiaojie" or p:getGeneral2Name() == "bjshenxiaojie" then
shenxiaojietx = p
else
p = player:getNext()
while p:objectName() ~= player:objectName() do
if p:getGeneralName() == "bjshenxiaojie" or p:getGeneral2Name() == "bjshenxiaojie" then
shenxiaojietx = p
break
end
p = p:getNext()
end
end
if shenxiaojietx then
if move.from and move.from:objectName() == shenxiaojietx:objectName() then
if not (move.from_places:contains(sgs.Player_PlaceHand) or move.from_places:contains(sgs.Player_PlaceEquip) or move.from_places:contains(sgs.Player_PlaceDelayedTrick)) then
local moveA = sgs.CardsMoveStruct()
moveA.card_ids = move.card_ids
moveA.to_place = sgs.Player_PlaceHand
moveA.to = shenxiaojietx
room:moveCardsAtomic(moveA, true)
room:detachSkillFromPlayer(player, self:objectName())
end
end
end
end,
}
b**iyou = sgs.CreateTriggerSkill{
name = "b**iyou",
frequency = sgs.Skill_Frequent,
events = {sgs.Death},
on_trigger = function(self, event, player, data)
if player:isAlive() then return false end
local room = player:getRoom()
if room:askForSkillInvoke(player, self:objectName(), data) then
local all = player:getCards("he")
for _,card in sgs.qlist(all) do
player:addToPile("you", card:getId(), false)
end
local others = room:getAllPlayers()
for _,p in sgs.qlist(others) do
room:attachSkillToPlayer(p, "b**iyouTG")
end
room:attachSkillToPlayer(player:getNextAlive(), "b**iyoubury")
end
end,
can_trigger = function(self, target)
if target and target:hasSkill(self:objectName()) then
return not target:isNude()
end
return false
end
}
三个技能全都要给角色addSkill
我用的是1217
@AD唱歌黑化股份
2019年02月15日 12点02分 5
**随便替换成随便啥字母[冷]居然被打码了
2019年02月15日 12点02分
好的,我来试试[哈哈]
2019年02月15日 15点02分
level 7
分享一下我的方法
目前只适用于触发技
需要以下两点:
1.can_trigger部分,只写return target就行了
2.询问触发部分,
local me = room:findPlayer("Karthus", true) -- 这里的true表示包括死亡角色
if me:askForSkillInvoke(self:objectName(), data) then
...
2019年02月15日 16点02分 6
有一个问题,就是询问发动技能时,你的“确定”和“取消”按钮是灰色的,但你点他还是有效果的
2019年02月15日 16点02分
这里要感谢lz热心分享的代码
2019年02月15日 16点02分
2019年02月15日 16点02分
"Karthus"换成你的武将的name就行
2019年02月15日 16点02分
1