zhicai = sgs.CreateFilterSkill{
name = "zhicai",
view_filter = function(self, to_select)
local room = sgs.Sanguosha:currentRoom()
local place = room:getCardPlace(to_select:getEffectiveId())
return place == sgs.Player_PlaceJudge and (to_select:getSuit()==sgs.Card_Diamond or to_select:getSuit()==sgs.Card_Spade)
end,
view_as = function(self, card)
local id = card:getId()
local suit = card:getSuit()
local point = card:getNumber()
if sgs.Self:getTag("le"):toInt()>0 and suit==sgs.Card_Diamond then
suit=sgs.Card_Heart
elseif sgs.Self:getTag("bi"):toInt()>0 and suit==sgs.Card_Spade then
suit=sgs.Card_Club
end
local peach1 = sgs.Sanguosha:cloneCard(card:objectName(), suit, point)
peach1:setSkillName(self:objectName())
local vs_card = sgs.Sanguosha:getWrappedCard(id)
vs_card:takeOver(peach1)
return vs_card
end
}
zhicai1 = sgs.CreateTriggerSkill{
name = "#zhicai1",
frequency =sgs.Skill_Compulsory,
events = {sgs.AskForRetrial,sgs.FinishJudge},
on_trigger = function(self, event, player, data)
if player:hasSkill("zhicai") then
local cards=player:getJudgingArea()
if event==sgs.AskForRetrial then
for _,card in sgs.qlist(cards) do
if card:isKindOf("Indulgence") then
room:get("le")
elseif card:isKindOf("SupplyShortage") then
room:get("bi")
end
end
end
if event==sgs.FinishJudge then
if player:getTag("le") then
room:removeTag("le")
end
if player:getTag("bi") then
room:removeTag("bi")
end
end
end
end,
}
name = "zhicai",
view_filter = function(self, to_select)
local room = sgs.Sanguosha:currentRoom()
local place = room:getCardPlace(to_select:getEffectiveId())
return place == sgs.Player_PlaceJudge and (to_select:getSuit()==sgs.Card_Diamond or to_select:getSuit()==sgs.Card_Spade)
end,
view_as = function(self, card)
local id = card:getId()
local suit = card:getSuit()
local point = card:getNumber()
if sgs.Self:getTag("le"):toInt()>0 and suit==sgs.Card_Diamond then
suit=sgs.Card_Heart
elseif sgs.Self:getTag("bi"):toInt()>0 and suit==sgs.Card_Spade then
suit=sgs.Card_Club
end
local peach1 = sgs.Sanguosha:cloneCard(card:objectName(), suit, point)
peach1:setSkillName(self:objectName())
local vs_card = sgs.Sanguosha:getWrappedCard(id)
vs_card:takeOver(peach1)
return vs_card
end
}
zhicai1 = sgs.CreateTriggerSkill{
name = "#zhicai1",
frequency =sgs.Skill_Compulsory,
events = {sgs.AskForRetrial,sgs.FinishJudge},
on_trigger = function(self, event, player, data)
if player:hasSkill("zhicai") then
local cards=player:getJudgingArea()
if event==sgs.AskForRetrial then
for _,card in sgs.qlist(cards) do
if card:isKindOf("Indulgence") then
room:get("le")
elseif card:isKindOf("SupplyShortage") then
room:get("bi")
end
end
end
if event==sgs.FinishJudge then
if player:getTag("le") then
room:removeTag("le")
end
if player:getTag("bi") then
room:removeTag("bi")
end
end
end
end,
}