准算啊准算,你叫我怎样好呢???
太阳神三国杀lua吧
全部回复
仅看楼主
level 12
zhunsuan=sgs.CreateTriggerSkill
{
name="zhunsuan",
events={sgs.CardFinished, sgs.PhaseChange,sgs.TurnStart,sgs.CardResponsed},
can_trigger = function(self, target)
return true
end,
on_trigger=function(self, event, player, data)
local room = player:getRoom()
local cq = room:findPlayerBySkillName(self:objectName())
if event==sgs.CardFinished then
if player:hasSkill(self:objectName()) then return end
local card=data:toCardUse().card
if not card:inherits("BasicCard") then return false end
local x=cq:getMark("zhunsuan")
cq:speak(x)
local y=card:getNumber()
player:speak(y)
if math.min(x-2,y)==y or math.min(x+1,y)==x+1 then return false end
if room:getCardPlace(card:getEffectiveId()) == sgs.Player_DiscardedPile then
cq:obtainCard(card)
end
elseif event==sgs.PhaseChange then
if (player:getPhase() ~= sgs.Player_Finish) then return false end
if not player:hasSkill(self:objectName()) then return end
local choice=room:askForChoice(player,"zhunsuan","1+2
+3
+4+5+6+7+8+9+10+11+12+13+cancel")
if choice=="cancel" then return false end
local log2=sgs.LogMessage()
log2.from =player
log2.type="#InvokeSkill"
log2.arg="zhunsuan"
room:sendLog(log2)
room:setPlayerMark(player, "zhunsuan", choice)
local log=sgs.LogMessage() --LOG这个坑
log.type ="#Zhunsuan" log.from=player
log.arg=choice
room:sendLog(log)
elseif event==sgs.TurnStart then
if not player:hasSkill(self:objectName()) then return end
room:setPlayerMark(player, "zhunsuan", 0)
elseif event==sgs.CardResponsed then
if player:hasSkill(self:objectName()) then return end
local cd=data:toCard()
if not cd:inherits("BasicCard") then return false end
local x=cq:getMark("zhunsuan")
cq:speak(x)
local y=cd:getNumber()
player:speak(y)
if math.min(x-2,y)==y or math.min(x+1,y)==x+1 then return false end
if room:getCardPlace(cd:getEffectiveId()) == sgs.Player_DiscardedPile then
cq:obtainCard(cd)
end
end
end,
}
@brianvong @Ailue
2013年01月02日 05点01分 1
level 12
话说到底怎么去一个区间?我怀疑是逻辑上的问题。。。
2013年01月02日 05点01分 2
虽不知,但觉得取区间的话,用n=x-y然后n<2 and n>-2不知行不行?
2013年01月02日 17点01分
level 12
2013年01月02日 07点01分 3
技能是什么?
2013年01月02日 11点01分
@brianvong 缤纷三台陈群准算
2013年01月02日 14点01分
回复 拆迁队总司令 :....求描述..
2013年01月02日 14点01分
@brianvong 回合结束阶段,你可以声明一个数字,直到你下回合开始,其他角色使用或打出的基本牌,若点数与你声明的数字之差<2,则你获得这张牌。
2013年01月03日 00点01分
level 13
DiscardPile吧。。。
2013年01月02日 11点01分 4
...目测吧主的是涅盘lua...
2013年01月02日 11点01分
level 12
已解决
2013年01月03日 05点01分 5
1