技能名= sgs.CreateViewAsSkill{ name="技能名", n = 几张牌,view_filter = function(self, selected, to_select)return to_select:getSuit()==sgs.Card_Diamond and not to_select:花色()end,view_as = function(self, cards)if #cards == 1 thenlocal card = cards[1]local new_card = sgs.Sanguosha:cloneCard("当做什么牌", card:getSuit(), card:getNumber())new_card:addSubcard(card)new_card:setSkillName(self:objectName())return new_cardendend,}
比如把一张方片牌当做无中生有
就要写:
xxx= sgs.CreateViewAsSkill{ name="xxx", n = 1,view_filter = function(self, selected, to_select)return to_select:getSuit()==sgs.Card_Diamond and not to_select:isEquipped()end,view_as = function(self, cards)if #cards == 1 thenlocal card = cards[1]local new_card = sgs.Sanguosha:cloneCard("ex_nihilo", card:getSuit(), card:getNumber())new_card:addSubcard(card)new_card:setSkillName(self:objectName())return new_cardendend,}