Luanuhuo = sgs.CreateTriggerSkill{
name = "Luanuhuo" ,
events = {sgs.TargetConfirmed},
frequency = sgs.Skill_Compulsory,
on_trigger = function(self, event, player, data)
local use = data:toCardUse()
if use.to:contains(player) then
if use.card:isVirtualCard() and (use.card:subcardsLength() ~= 1) then return false end
if ((use.card:isKindOf("Slash") and sgs.Sanguosha:getEngineCard(use.card:getEffectiveId()):isKindOf("Slash")) or (use.card:isKindOf("Peach") and sgs.Sanguosha:getEngineCard(use.card:getEffectiveId()):isKindOf("Peach")) or
(use.card:isKindOf("Analeptic") and sgs.Sanguosha:getEngineCard(use.card:getEffectiveId()):isKindOf("Analeptic"))) then
local nuhuo = use.card:getEffectiveId()
local card_list = player:getTag("Luanuhuo"):toIntList()
if card_list:length() > 0 then
for _, id in sgs.qlist(card_list) do
player:gainMark("@HH")
if id ~= nuhuo then
card_list:append(nuhuo)
end
end
else
card_list:append(nuhuo)
end
local d = sgs.QVariant()
d:setValue(card_list) -- QVariantList
player:setTag("Luanuhuo", d)
--local type_i = nuhuo.."|.|.|hand"
--player:getRoom():setPlayerCardLimitation(player, "use", type_i, false)
end
end
end
}
Luanuhuoeffect = sgs.CreateProhibitSkill{
name = "Luanuhuoeffect" ,
is_prohibited = function(self, from, to, card)
local canuse = true
local nuhuo = card:getEffectiveId()
local card_list = to:getTag("Luanuhuo"):toIntList()
if card_list:length() > 0 then
for _, id in sgs.qlist(card_list) do
if id == nuhuo then
canuse = false
end
end
else
canuse = false
end
if to:hasSkill(self:objectName()) then
return canuse
end
end
}