Commit 6b241dec authored by POLYMER's avatar POLYMER

fix

parent a11a27c1
......@@ -5924,20 +5924,6 @@
79250026 0
79250027 0
89390013 0
16104600 0
16104602 0
16104604 0
16104606 0
16104608 0
16104610 0
16104612 0
16104614 0
16104616 0
16104618 0
16104620 0
16104622 0
16104624 0
16108100 0
98500506 0
14010216 0
53797052 0
......@@ -6270,6 +6256,20 @@
211000010 0
211000011 0
211000012 0
98500100 0
98500110 0
98500120 0
98500130 0
98500140 0
98500150 0
98500160 0
98500170 0
98500180 0
98500190 0
98500200 0
98500210 0
98500220 0
98500230 0
#limit
33403513 1
82204250 0
......
No preview for this file type
--异种 达摩不倒翁
function c16104600.initial_effect(c)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104600,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104600)
e1:SetCondition(c16104600.condition)
e1:SetCost(c16104600.cost)
e1:SetTarget(c16104600.target)
e1:SetOperation(c16104600.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104600,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500183)
e2:SetTarget(c16104600.hsptg)
e2:SetOperation(c16104600.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104600,2))
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500183)
e3:SetTarget(c16104600.destg)
e3:SetOperation(c16104600.desop)
c:RegisterEffect(e3)
end
function c16104600.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104600.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104600,9),aux.Stringid(16104600,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104600.filter(c)
return c:IsSetCard(0x985) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function c16104600.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16104600.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16104600.filter2(c)
return (c:IsSummonable(true,nil) or c:IsMSetable(true,nil)) and c:IsSetCard(0x985) and c:IsType(TYPE_MONSTER)
end
function c16104600.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16104600.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
if Duel.IsExistingMatchingCard(c16104600.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104600,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g2=Duel.SelectMatchingCard(tp,c16104600.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g2:GetFirst()
if tc:IsSummonable(true,nil) and (not tc:IsMSetable(true,nil) or Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
end
end
end
end
function c16104600.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104600.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104600.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and (Duel.IsExistingTarget(c16104600.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500000) and Duel.IsExistingTarget(c16104600.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500000) then
local g=Duel.SelectTarget(tp,c16104600.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104600.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104600.filter4(c)
return c:IsFacedown()
end
function c16104600.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local g2=Duel.GetMatchingGroup(c16104600.filter4,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g2)
end
end
end
end
function c16104600.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsExistingMatchingCard(c16104600.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function c16104600.desop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(c16104600.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(16104600,4)},
{b2,aux.Stringid(16104600,5)})
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.HintSelection(g)
Duel.Destroy(tc,REASON_EFFECT)
end
elseif op==2 then
local g=Duel.GetMatchingGroup(c16104600.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
tc=sg:GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
if Duel.IsExistingTarget(c16104600.filter4,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104600,6)) then
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
local g2=Duel.GetFieldGroup(1-tp,0,LOCATION_DECK)
if g:GetCount()>0 and g2:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.ConfirmCards(tp,g2)
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
end
end
end
\ No newline at end of file
--异种 白
function c16104602.initial_effect(c)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104602,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104602)
e1:SetCondition(c16104602.condition)
e1:SetCost(c16104602.cost)
e1:SetTarget(c16104602.target)
e1:SetOperation(c16104602.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104602,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500185)
e2:SetTarget(c16104602.hsptg)
e2:SetOperation(c16104602.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104602,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500185)
e3:SetTarget(c16104602.destg)
e3:SetOperation(c16104602.desop)
c:RegisterEffect(e3)
end
function c16104602.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown() and re:IsActiveType(TYPE_MONSTER)
end
function c16104602.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104602,9),aux.Stringid(16104602,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104602.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104602.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
end
function c16104602.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 and Duel.SelectYesNo(tp,aux.Stringid(16104602,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104602.filter3,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function c16104602.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104602.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104602.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and (Duel.IsExistingTarget(c16104602.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104602.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104602.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104602.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104602.filter4(c)
return c:IsFacedown()
end
function c16104602.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local g2=Duel.GetMatchingGroup(c16104602.filter4,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g2)
end
end
end
end
function c16104602.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
end
function c16104602.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)~=0 then
Duel.BreakEffect()
if Duel.IsExistingTarget(c16104602.filter4,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104602,4)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
--异种 亡魂
function c16104604.initial_effect(c)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104604,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104604)
e1:SetCondition(c16104604.condition)
e1:SetCost(c16104604.cost)
e1:SetTarget(c16104604.target)
e1:SetOperation(c16104604.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104604,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500187)
e2:SetTarget(c16104604.hsptg)
e2:SetOperation(c16104604.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104604,2))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500187)
e3:SetTarget(c16104604.destg)
e3:SetOperation(c16104604.desop)
c:RegisterEffect(e3)
end
function c16104604.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104604.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104604,9),aux.Stringid(16104604,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104604.filter(c)
return c:IsSetCard(0x985) and c:IsAbleToHand()
end
function c16104604.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16104604.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c16104604.filter2(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil) and c:IsSetCard(0x985)
end
function c16104604.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16104604.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
if Duel.IsExistingMatchingCard(c16104604.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104604,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g2=Duel.SelectMatchingCard(tp,c16104604.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g2:GetFirst()
if tc:IsSummonable(true,nil) and (not tc:IsMSetable(true,nil) or Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
end
end
end
end
function c16104604.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104604.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104604.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and (Duel.IsExistingTarget(c16104604.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500000) and Duel.IsExistingTarget(c16104604.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500000) then
local g=Duel.SelectTarget(tp,c16104604.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104604.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104604.filter4(c)
return c:IsFacedown()
end
function c16104604.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local g2=Duel.GetMatchingGroup(c16104604.filter4,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g2)
end
end
end
end
function c16104604.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) or Duel.IsExistingMatchingCard(c16104604.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function c16104604.desop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(c16104604.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(16104604,4)},
{b2,aux.Stringid(16104604,5)})
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.HintSelection(g)
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
end
end
elseif op==2 then
local g=Duel.GetMatchingGroup(c16104604.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
end
end
if Duel.IsExistingTarget(c16104604.filter4,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104604,6)) then
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.ShuffleHand(1-tp)
end
end
end
--异种 蝶
function c16104606.initial_effect(c)
--be target
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104606,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104606)
e1:SetCondition(c16104606.condition)
e1:SetCost(c16104606.cost)
e1:SetTarget(c16104606.target)
e1:SetOperation(c16104606.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104606,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500189)
e2:SetTarget(c16104606.hsptg)
e2:SetOperation(c16104606.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104606,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500189)
e3:SetTarget(c16104606.destg)
e3:SetOperation(c16104606.desop)
c:RegisterEffect(e3)
end
function c16104606.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104606.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104606,9),aux.Stringid(16104606,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104606.filter(c)
return c:IsSetCard(0x985) and c:IsAbleToHand()
end
function c16104606.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16104606.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16104606.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16104606.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c16104606.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104606.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104606.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and (Duel.IsExistingTarget(c16104606.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104606.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104606.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104606.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104606.filter4(c)
return c:IsFacedown()
end
function c16104606.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local g2=Duel.GetMatchingGroup(c16104606.filter4,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g2)
end
end
end
end
function c16104606.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c16104606.desop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.IsExistingTarget(c16104606.filter4,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104606,4)) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_PUBLIC)
e2:SetTargetRange(0,LOCATION_HAND)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
--异种 刽子手
function c16104608.initial_effect(c)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104608,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104608)
e1:SetCondition(c16104608.condition)
e1:SetCost(c16104608.cost)
e1:SetTarget(c16104608.target)
e1:SetOperation(c16104608.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104608,1))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500191)
e2:SetTarget(c16104608.hsptg)
e2:SetOperation(c16104608.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104608,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500191)
e3:SetTarget(c16104608.destg)
e3:SetOperation(c16104608.desop)
c:RegisterEffect(e3)
end
function c16104608.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104608.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104608,9),aux.Stringid(16104608,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104608.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104608.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104608.filter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c16104608.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
if Duel.IsExistingMatchingCard(c16104608.filter2,tp,LOCATION_MZONE,0,1,e:GetHandler()) then
Duel.SetChainLimit(c16104608.chainlm)
end
end
function c16104608.filter2(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE)
end
function c16104608.chainlm(e,rp,tp)
return tp==rp
end
function c16104608.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c16104608.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function c16104608.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104608.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104608.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (e:GetHandler():IsSummonable(true,nil) or e:GetHandler():IsMSetable(true,nil)) and (Duel.IsExistingTarget(c16104608.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104608.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104608.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104608.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c16104608.filter4(c)
return c:IsFacedown()
end
function c16104608.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e0:SetCountLimit(1,98500510)
e0:SetReset(RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END)
e0:SetOperation(c16104608.efilter)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_MSET)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e4:SetCountLimit(1,98500510)
e4:SetReset(RESET_PHASE+PHASE_END)
-- e4:SetLabelObject(c)
e4:SetOperation(c16104608.efilter)
Duel.RegisterEffect(e4,tp)
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return false end
local ts={}
local index=1
if e:GetHandler():IsSummonable(true,nil) then
ts[index]=aux.Stringid(16104608,7)
index=index+1
end
if e:GetHandler():IsMSetable(true,nil) then
ts[index]=aux.Stringid(16104608,8)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104608,7) then
Duel.Summon(tp,c,true,nil)
elseif ts[opt+1]==aux.Stringid(16104608,8) then
Duel.MSet(tp,c,true,nil)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
end
end
end
function c16104608.efilter(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.GetMatchingGroup(c16104608.filter4,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g2)
end
function c16104608.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
end
function c16104608.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.HintSelection(g)
if Duel.Destroy(tc,POS_FACEUP,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
--异种 番兵
function c16104610.initial_effect(c)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104610,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104610)
e1:SetCondition(c16104610.condition)
e1:SetCost(c16104610.cost)
e1:SetTarget(c16104610.target)
e1:SetOperation(c16104610.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104610,1))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500193)
e2:SetTarget(c16104610.hsptg)
e2:SetOperation(c16104610.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104610,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500193)
e3:SetTarget(c16104610.destg)
e3:SetOperation(c16104610.desop)
c:RegisterEffect(e3)
end
function c16104610.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown() and not re:IsActiveType(TYPE_MONSTER)
end
function c16104610.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104610,9),aux.Stringid(16104610,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104610.filter(c)
return c:IsFacedown() or c:IsFaceup() and c:IsControlerCanBeChanged()
end
function c16104610.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c16104610.filter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c16104610.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c16104610.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c16104610.filter,tp,0,LOCATION_MZONE,1,nil)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,c16104610.filter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if Duel.GetControl(tc,tp,PHASE_MAIN1,2)~=0 and Duel.IsExistingMatchingCard(c16104610.filter3,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104610,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104610.filter3,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function c16104610.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104610.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104610.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (e:GetHandler():IsSummonable(true,nil) or e:GetHandler():IsMSetable(true,nil)) and (Duel.IsExistingTarget(c16104610.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500000) and Duel.IsExistingTarget(c16104610.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500000) then
local g=Duel.SelectTarget(tp,c16104610.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104610.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c16104610.filter4(c)
return c:IsFacedown()
end
function c16104610.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e0:SetCountLimit(1,98500520)
e0:SetReset(RESET_EVENT+0x7e0000)
e0:SetOperation(c16104610.efilter)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_MSET)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e4:SetCountLimit(1,98500520)
e4:SetReset(RESET_PHASE+PHASE_END)
-- e4:SetLabelObject(c)
e4:SetOperation(c16104610.efilter)
Duel.RegisterEffect(e4,tp)
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return false end
local ts={}
local index=1
if e:GetHandler():IsSummonable(true,nil) then
ts[index]=aux.Stringid(16104610,7)
index=index+1
end
if e:GetHandler():IsMSetable(true,nil) then
ts[index]=aux.Stringid(16104610,8)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104610,7) then
Duel.Summon(tp,c,true,nil)
elseif ts[opt+1]==aux.Stringid(16104610,8) then
Duel.MSet(tp,c,true,nil)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
end
end
end
function c16104610.efilter(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.GetMatchingGroup(c16104610.filter4,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(g2)
end
function c16104610.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
end
function c16104610.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)~=0 then
Duel.BreakEffect()
if Duel.IsExistingTarget(c16104610.filter4,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(16104610,4)) then
local g2=Duel.SelectMatchingCard(tp,c16104610.filter,tp,0,LOCATION_MZONE,1,1,nil)
local tc2=g2:GetFirst()
Duel.GetControl(tc2,tp,PHASE_END,1)
end
end
end
end
--异种 吞食者
function c16104612.initial_effect(c)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104612,0))
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_ANNOUNCE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SUMMON)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104612)
e1:SetCondition(c16104612.condition)
e1:SetCost(c16104612.cost)
e1:SetTarget(c16104612.target)
e1:SetOperation(c16104612.operation)
c:RegisterEffect(e1)
local e4=e1:Clone()
e4:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e5)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104612,1))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500195)
e2:SetTarget(c16104612.hsptg)
e2:SetOperation(c16104612.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104612,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500196)
e3:SetTarget(c16104612.destg)
e3:SetOperation(c16104612.desop)
c:RegisterEffect(e3)
end
function c16104612.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown() and tp~=ep and Duel.GetCurrentChain()==0
end
function c16104612.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104612,9),aux.Stringid(16104612,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104612.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_HAND,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c16104612.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if Duel.ConfirmCards(tp,g2)~=0 then
Duel.ShuffleHand(1-tp)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
function c16104612.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104612.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104612.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (e:GetHandler():IsSummonable(true,nil) or e:GetHandler():IsMSetable(true,nil)) and (Duel.IsExistingTarget(c16104612.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104612.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104612.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104612.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c16104612.filter4(c)
return c:IsFacedown()
end
function c16104612.hspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return false end
local ts={}
local index=1
if e:GetHandler():IsSummonable(true,nil) then
ts[index]=aux.Stringid(16104612,7)
index=index+1
end
if e:GetHandler():IsMSetable(true,nil) then
ts[index]=aux.Stringid(16104612,8)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104612,7) then
Duel.Summon(tp,c,true,nil)
elseif ts[opt+1]==aux.Stringid(16104612,8) then
Duel.MSet(tp,c,true,nil)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16104612.tg)
e1:SetValue(c16104612.efilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c16104612.tg(e,c)
return c:IsFacedown()
end
function c16104612.efilter(e,te)
return te:GetHandler():GetControler()~=e:GetHandlerPlayer()
end
function c16104612.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,16104612)==0 end
end
function c16104612.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c16104612.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,16104612,RESET_PHASE+PHASE_END,0,0)
end
function c16104612.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE and re:IsActiveType(TYPE_MONSTER)
end
This diff is collapsed.
--异种 八姐妹
function c16104616.initial_effect(c)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104616,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ANNOUNCE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104616)
e1:SetCondition(c16104616.condition)
e1:SetCost(c16104616.cost)
e1:SetTarget(c16104616.target)
e1:SetOperation(c16104616.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104616,1))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500197)
e2:SetTarget(c16104616.hsptg)
e2:SetOperation(c16104616.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104616,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500198)
e3:SetTarget(c16104616.destg)
e3:SetOperation(c16104616.desop)
c:RegisterEffect(e3)
--tribute limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRIBUTE_LIMIT)
e4:SetValue(c16104616.tlimit)
c:RegisterEffect(e4)
--summon with 3 tribute
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(16104616,2))
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e5:SetCondition(c16104616.ttcon)
e5:SetOperation(c16104616.ttop)
e5:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_LIMIT_SET_PROC)
c:RegisterEffect(e6)
end
function c16104616.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104616.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104616,9),aux.Stringid(16104616,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104616.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c16104616.filter2(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c16104616.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_HAND,1,nil) and ((Duel.IsExistingMatchingCard(c16104616.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or (Duel.IsExistingMatchingCard(c16104616.filter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c16104616.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if Duel.ConfirmCards(tp,g2)~=0 then
Duel.ShuffleHand(1-tp)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
local ts={}
local index=1
if Duel.IsExistingMatchingCard(c16104616.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
ts[index]=aux.Stringid(16104616,3)
index=index+1
end
if Duel.IsExistingMatchingCard(c16104616.filter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
ts[index]=aux.Stringid(16104616,4)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104616,3) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104616.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
local tc=g:GetFirst()
Duel.SSet(tp,tc)
if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
elseif ts[opt+1]==aux.Stringid(16104616,4) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104616.filter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
end
end
end
end
function c16104616.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104616.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104616.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (e:GetHandler():IsSummonable(true,nil) or e:GetHandler():IsMSetable(true,nil)) and (Duel.IsExistingTarget(c16104616.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104616.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104616.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104616.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c16104616.filter4(c)
return c:IsFacedown()
end
function c16104616.hspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return false end
local ts={}
local index=1
if e:GetHandler():IsSummonable(true,nil) then
ts[index]=aux.Stringid(16104616,7)
index=index+1
end
if e:GetHandler():IsMSetable(true,nil) then
ts[index]=aux.Stringid(16104616,8)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104616,7) then
Duel.Summon(tp,c,true,nil)
elseif ts[opt+1]==aux.Stringid(16104616,8) then
Duel.MSet(tp,c,true,nil)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16104616.tg)
e1:SetValue(c16104616.efilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c16104616.tg(e,c)
return c:IsFacedown()
end
function c16104616.efilter(e,te)
return te:GetHandler():GetControler()~=e:GetHandlerPlayer()
end
function c16104616.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function c16104616.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
g1:Merge(g2)
Duel.HintSelection(g1)
if Duel.SendtoHand(g1,tp,REASON_EFFECT)~=2 then
local ts={}
local index=1
if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) then
ts[index]=aux.Stringid(16104616,5)
index=index+1
end
if e:GetHandler():IsCanTurnSet() then
ts[index]=aux.Stringid(16104616,6)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(1-tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104616,5) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g3=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoDeck(g3,nil,SEQ_DECKSHUFFLE,REASON_RULE)
elseif ts[opt+1]==aux.Stringid(16104616,6) then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
end
function c16104616.tlimit(e,c)
return not c:IsPosition(POS_FACEDOWN)
end
function c16104616.ttcon(e,c,minc)
if c==nil then return true end
return minc<=2 and Duel.CheckTribute(c,2)
end
function c16104616.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,2,2)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c16104616.setcon(e,c,minc)
if not c then return true end
return false
end
--异种 泰坦
function c16104618.initial_effect(c)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104618,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ANNOUNCE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104618)
e1:SetCondition(c16104618.condition)
e1:SetCost(c16104618.cost)
e1:SetTarget(c16104618.target)
e1:SetOperation(c16104618.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104618,1))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500201)
e2:SetTarget(c16104618.hsptg)
e2:SetOperation(c16104618.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104618,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500202)
e3:SetTarget(c16104618.destg)
e3:SetOperation(c16104618.desop)
c:RegisterEffect(e3)
--tribute limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRIBUTE_LIMIT)
e4:SetValue(c16104618.tlimit)
c:RegisterEffect(e4)
--summon with 3 tribute
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(16104618,2))
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e5:SetCondition(c16104618.ttcon)
e5:SetOperation(c16104618.ttop)
e5:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_LIMIT_SET_PROC)
c:RegisterEffect(e6)
--change pos
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(16104618,1))
e7:SetCategory(CATEGORY_POSITION)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1,98500203)
e7:SetTarget(c16104618.postg2)
e7:SetOperation(c16104618.posop2)
c:RegisterEffect(e7)
end
function c16104618.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104618.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104618,9),aux.Stringid(16104618,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104618.filter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsSSetable()
end
function c16104618.filter2(c,e,tp)
return c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsAttackBelow(3000)
end
function c16104618.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil) and ((Duel.IsExistingMatchingCard(c16104618.filter,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or (Duel.IsExistingMatchingCard(c16104618.filter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c16104618.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if Duel.ConfirmCards(tp,g2)~=0 then
Duel.ShuffleDeck(1-tp)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_DECK,nil,ac)
if g:GetCount()>0 then
Duel.NegateEffect(ev)
local ts={}
local index=1
if Duel.IsExistingMatchingCard(c16104618.filter,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
ts[index]=aux.Stringid(16104618,3)
index=index+1
end
if Duel.IsExistingMatchingCard(c16104618.filter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
ts[index]=aux.Stringid(16104618,4)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104618,3) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104618.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
Duel.SSet(tp,tc)
if tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
elseif ts[opt+1]==aux.Stringid(16104618,4) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16104618.filter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
end
end
function c16104618.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104618.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104618.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (e:GetHandler():IsSummonable(true,nil) or e:GetHandler():IsMSetable(true,nil)) and (Duel.IsExistingTarget(c16104618.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104618.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104618.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104618.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c16104618.filter4(c)
return c:IsFacedown()
end
function c16104618.hspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return false end
local ts={}
local index=1
if e:GetHandler():IsSummonable(true,nil) then
ts[index]=aux.Stringid(16104618,7)
index=index+1
end
if e:GetHandler():IsMSetable(true,nil) then
ts[index]=aux.Stringid(16104618,8)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104618,7) then
Duel.Summon(tp,c,true,nil)
elseif ts[opt+1]==aux.Stringid(16104618,8) then
Duel.MSet(tp,c,true,nil)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16104618.tg)
e1:SetValue(c16104618.efilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c16104618.tg(e,c)
return c:IsFacedown()
end
function c16104618.efilter(e,te)
return te:GetHandler():GetControler()~=e:GetHandlerPlayer()
end
function c16104618.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function c16104618.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g1)
if Duel.SendtoDeck(g1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g2=Duel.SelectMatchingCard(tp,c16104618.filter3,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g2)
if Duel.ChangePosition(g2,POS_FACEDOWN_DEFENSE)~=1 then
Duel.SendtoDeck(g2,nil,SEQ_DECKSHUFFLE,REASON_RULE)
end
end
end
function c16104618.tlimit(e,c)
return not c:IsPosition(POS_FACEDOWN)
end
function c16104618.ttcon(e,c,minc)
if c==nil then return true end
return minc<=3 and Duel.CheckTribute(c,3)
end
function c16104618.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c16104618.postg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104618.filter3(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16104618.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c16104618.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104618.posop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain():Filter(c16104618.filter3,nil)
if g:GetCount()~=1 then return end
for tc in aux.Next(g) do
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
--异种 蛟
function c16104620.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,10,4)
aux.AddXyzProcedureLevelFree(c,c16104620.mfilter,nil,3,3)
--spsummon limit
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.xyzlimit)
c:RegisterEffect(e0)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104620,2))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104620)
e1:SetCondition(c16104620.condition)
e1:SetCost(c16104620.cost)
e1:SetTarget(c16104620.target)
e1:SetOperation(c16104620.operation)
c:RegisterEffect(e1)
--flip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104620,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,98500206)
e2:SetCondition(c16104620.copcon)
e2:SetOperation(c16104620.copop)
c:RegisterEffect(e2)
--turn set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104620,4))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,98500207)
e3:SetCost(c16104620.cost2)
e3:SetTarget(c16104620.postg)
e3:SetOperation(c16104620.posop)
c:RegisterEffect(e3)
end
function c16104620.mfilter(c)
return c:IsType(TYPE_FLIP)
end
function c16104620.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104620.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104620,9),aux.Stringid(16104620,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104620.filter(c)
return c:IsPosition(POS_FACEDOWN)
end
function c16104620.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16104620.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function c16104620.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c16104620.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
function c16104620.copfilter(c)
return c:IsType(TYPE_EFFECT)
end
function c16104620.copcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(c16104620.copfilter,1,nil)
end
function c16104620.copop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetOverlayGroup():Filter(c16104620.copfilter,nil)
local tc=g:GetFirst()
while tc do
local code=tc:GetOriginalCode()
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
tc=g:GetNext()
end
end
function c16104620.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c16104620.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104620.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104620.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16104620.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c16104620.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104620.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 and tc:GetControler()==1-tp then
if Duel.SelectYesNo(tp,aux.Stringid(16104620,5)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tc2=Duel.SelectMatchingCard(tp,c16104620.posfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.ChangePosition(tc2,POS_FACEDOWN_DEFENSE)
end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
--异国的招待
function c16104622.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16104622+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Remove + Normal Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104622,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,98500207)
e3:SetTarget(c16104622.rmtg)
e3:SetOperation(c16104622.rmop)
c:RegisterEffect(e3)
--extra material
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e4:SetTargetRange(LOCATION_SZONE,0)
e4:SetTarget(c16104622.exrtg)
e4:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_HAND,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
--change effect type
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetCode(16104622)
e6:SetRange(LOCATION_FZONE)
e6:SetTargetRange(1,0)
c:RegisterEffect(e6)
--destroy
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(16104622,1))
e7:SetCategory(CATEGORY_DRAW+CATEGORY_POSITION)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e7:SetRange(LOCATION_FZONE)
e7:SetCountLimit(1)
e7:SetCode(EVENT_PHASE+PHASE_END)
e7:SetTarget(c16104622.target)
e7:SetOperation(c16104622.activate)
c:RegisterEffect(e7)
end
function c16104622.rmcfilter(c)
return c:IsSetCard(0x985) and c:IsAbleToHand()
end
function c16104622.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16104622.rmcfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16104622.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16104622.rmcfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c16104622.exrtg(e,c)
return c:IsFacedown()
end
function c16104622.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c16104622.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,0,nil)
local ct=g:GetCount()
if ct>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
local g2=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,0,nil)
local ct2=g2:GetCount()
local g3=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,0,LOCATION_MZONE,nil)
local ct3=g3:GetCount()
if ct3>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_POSCHANGE)
local g4=Duel.SelectMatchingCard(1-tp,Card.IsCanTurnSet,tp,0,LOCATION_MZONE,1,ct2,nil)
Duel.ChangePosition(g4,POS_FACEDOWN_DEFENSE)
Duel.BreakEffect()
local g5=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local ct5=g5:GetCount()
Duel.Draw(1-tp,ct5,REASON_EFFECT)
local g6=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local ct6=g6:GetCount()
Duel.Draw(tp,ct6,REASON_EFFECT)
end
end
end
--异种 兔子
function c16104624.initial_effect(c)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16104624,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16104624)
e1:SetCondition(c16104624.condition)
e1:SetCost(c16104624.cost)
e1:SetOperation(c16104624.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16104624,1))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,98500204)
e2:SetTarget(c16104624.hsptg)
e2:SetOperation(c16104624.hspop)
c:RegisterEffect(e2)
--flip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16104624,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,98500205)
e3:SetOperation(c16104624.desop)
c:RegisterEffect(e3)
--tribute limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRIBUTE_LIMIT)
e4:SetValue(c16104624.tlimit)
c:RegisterEffect(e4)
--summon with 3 tribute
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(16104624,2))
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e5:SetCondition(c16104624.ttcon)
e5:SetOperation(c16104624.ttop)
e5:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_LIMIT_SET_PROC)
c:RegisterEffect(e6)
--change pos
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(16104624,1))
e7:SetCategory(CATEGORY_POSITION)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetTarget(c16104624.postg2)
e7:SetOperation(c16104624.posop2)
c:RegisterEffect(e7)
end
function c16104624.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown()
end
function c16104624.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(16104624,9),aux.Stringid(16104624,10))
if op==0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_ATTACK)
else
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function c16104624.filter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsSSetable()
end
function c16104624.filter2(c,e,tp)
return c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_ATTACK)
end
function c16104624.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
rc:CancelToGrave()
local ts={}
local index=1
if c:IsType(TYPE_MONSTER) then
ts[index]=aux.Stringid(16104624,3)
index=index+1
end
if c:IsType(TYPE_MONSTER) then
ts[index]=aux.Stringid(16104624,4)
index=index+1
end
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104624,3) then
Duel.SendtoHand(rc,tp,REASON_EFFECT)
if rc:IsLocation(LOCATION_HAND) and rc:GetOwner()==1-tp then
Duel.ShuffleHand(1-tp)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_CHAINING)
if re:IsActiveType(TYPE_MONSTER) then
e1:SetCondition(c16104624.setcon)
elseif re:IsActiveType(TYPE_SPELL) then
e1:SetCondition(c16104624.setcon2)
elseif re:IsActiveType(TYPE_TRAP) then
e1:SetCondition(c16104624.setcon3)
end
e1:SetOperation(c16104624.setop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
elseif ts[opt+1]==aux.Stringid(16104624,4) then
Duel.NegateEffect(ev)
end
end
function c16104624.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(c16104624.filter3,tp,LOCATION_MZONE,0,1,nil)
end
function c16104624.setcon2(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_SPELL) and Duel.IsExistingMatchingCard(c16104624.filter3,tp,LOCATION_MZONE,0,1,nil)
end
function c16104624.setcon3(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_TRAP) and Duel.IsExistingMatchingCard(c16104624.filter3,tp,LOCATION_MZONE,0,1,nil)
end
function c16104624.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(16104624,5)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104624.filter3,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function c16104624.filter3(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16104624.filter4(c)
return c:IsFacedown()
end
function c16104624.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104624.filter3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (e:GetHandler():IsSummonable(true,nil) or e:GetHandler():IsMSetable(true,nil)) and (Duel.IsExistingTarget(c16104624.filter3,tp,LOCATION_MZONE,0,1,nil) or (Duel.IsPlayerAffectedByEffect(tp,98500080) and Duel.IsExistingTarget(c16104624.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if Duel.IsPlayerAffectedByEffect(tp,98500080) then
local g=Duel.SelectTarget(tp,c16104624.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else
local g=Duel.SelectTarget(tp,c16104624.filter3,tp,LOCATION_MZONE,0,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c16104624.hspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return false end
local ts={}
local index=1
if e:GetHandler():IsSummonable(true,nil) then
ts[index]=aux.Stringid(16104624,7)
index=index+1
end
if e:GetHandler():IsMSetable(true,nil) then
ts[index]=aux.Stringid(16104624,8)
index=index+1
end
local c=e:GetHandler()
local opt=Duel.SelectOption(tp,table.unpack(ts))
if ts[opt+1]==aux.Stringid(16104624,7) then
Duel.Summon(tp,c,true,nil)
elseif ts[opt+1]==aux.Stringid(16104624,8) then
Duel.MSet(tp,c,true,nil)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16104624.tg)
e1:SetValue(c16104624.efilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c16104624.tg(e,c)
return c:IsFacedown()
end
function c16104624.efilter(e,te)
return te:GetHandler():GetControler()~=e:GetHandlerPlayer()
end
function c16104624.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16104624.filter5)
e1:SetValue(aux.indoval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetValue(aux.tgoval)
Duel.RegisterEffect(e2,tp)
end
function c16104624.filter5(e,c)
return c:IsType(TYPE_FLIP)
end
function c16104624.tlimit(e,c)
return not c:IsPosition(POS_FACEDOWN)
end
function c16104624.ttcon(e,c,minc)
if c==nil then return true end
return minc<=3 and Duel.CheckTribute(c,3)
end
function c16104624.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c16104624.postg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16104624.filter3(chkc) end
if chk==0 then return Duel.IsExistingTarget(c16104624.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c16104624.filter3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16104624.posop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain():Filter(c16104624.filter3,nil)
if g:GetCount()~=1 then return end
for tc in aux.Next(g) do
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) and
Duel.SelectYesNo(tp,aux.Stringid(16104624,11)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c16104624.filter3,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
end
\ No newline at end of file
--里魂的显化
function c16108100.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--act in set turn
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCondition(c16108100.actcon)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16108100,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,98500099)
e2:SetTarget(c16108100.tstg)
e2:SetOperation(c16108100.tsop)
c:RegisterEffect(e2)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16108100,1))
e3:SetCategory(CATEGORY_ANNOUNCE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,98500100)
e3:SetTarget(c16108100.target)
e3:SetOperation(c16108100.activate)
c:RegisterEffect(e3)
end
function c16108100.afilter(c)
return c:IsPosition(POS_FACEUP)
end
function c16108100.afilter2(c)
return c:IsPosition(POS_FACEDOWN)
end
function c16108100.actcon(e)
return Duel.IsExistingMatchingCard(c16108100.afilter2,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) and not Duel.IsExistingMatchingCard(c16108100.afilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c16108100.spfilter(c,e,tp)
return c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c16108100.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c16108100.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c16108100.tsop(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),2)
if ft<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16108100.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,ft,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) then
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(16108100,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabel(fid)
e2:SetLabelObject(tc)
e2:SetCondition(c16108100.tgcon)
e2:SetOperation(c16108100.tgop)
Duel.RegisterEffect(e2,tp)
end
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
Duel.BreakEffect()
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
function c16108100.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(16108100)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c16108100.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetLabelObject(),REASON_EFFECT)
end
function c16108100.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local code=e:GetHandler():GetCode()
--c:IsSetCard(0x51) and not c:IsCode(code)
getmetatable(e:GetHandler()).announce_filter={0x985,OPCODE_ISSETCARD,code,OPCODE_ISCODE,OPCODE_NOT,OPCODE_AND}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c16108100.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
--effect gain
local cp={}
local func=Card.RegisterEffect
Card.RegisterEffect=function(tc,e,f)
if e:GetType()&EFFECT_TYPE_FLIP~=0 or (e:GetCode()&EVENT_FLIP~=0 and (e:GetType()&EFFECT_TYPE_QUICK_O~=0 or e:GetType()&EFFECT_TYPE_TRIGGER_O~=0) and e:GetType()&EFFECT_TYPE_SINGLE~=0 ) then
table.insert(cp,e:Clone())
end
return func(tc,e,f)
end
Duel.CreateToken(tp,ac)
for i,v in ipairs(cp) do
local pro=v:GetProperty()
if pro&EFFECT_FLAG_DELAY~=0 then
v:SetProperty(pro-EFFECT_FLAG_DELAY)
end
v:SetCode(EVENT_FREE_CHAIN)
v:SetType(EFFECT_TYPE_QUICK_O)
v:SetRange(LOCATION_MZONE)
v:SetCountLimit(1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetLabel(ac)
e1:SetTarget(c16108100.eftg)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(v)
Duel.RegisterEffect(e1,tp)
end
Card.RegisterEffect=func
end
function c16108100.eftg(e,c)
return c:IsOriginalCodeRule(e:GetLabel())
end
......@@ -27,7 +27,7 @@ function c28315944.initial_effect(c)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_POSITION)
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,28315944)
......
......@@ -27,7 +27,7 @@ function c28316347.initial_effect(c)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_RELEASE)
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_RELEASE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,28316347)
......
......@@ -172,7 +172,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Equip(tp,ec,tc,true) then
local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetLabelObject(tc)
e1:SetValue(cm.eqlimit)
......
......@@ -68,21 +68,21 @@ function c65850095.activate1(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ttc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ttc:RegisterEffect(e2)
if ttc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ttc:RegisterEffect(e3)
end
end
......
......@@ -38,7 +38,7 @@ function c65850100.matfilter(c)
return c:IsLinkSetCard(0xa35)
end
function c65850100.filter1(c)
return c:IsSetCard(0xa35) and c:IsAbleToDeck()
return c:IsSetCard(0xa35) and c:IsAbleToDeckOrExtraAsCost() and aux.NecroValleyFilter()
end
function c65850100.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65850100.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,nil) end
......@@ -47,9 +47,6 @@ function c65850100.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c65850100.spfilter(c,e,tp)
return c:IsSetCard(0xa35) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and aux.NecroValleyFilter()
end
function c65850100.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
......
......@@ -260,6 +260,51 @@ function Auxiliary.PreloadUds()
c:RegisterEffect(e1)
end
end
function Auxiliary.AddFusionProcMixRep(c,sub,insf,fun1,minc,maxc,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local val={fun1,...}
local fun={}
local mat={}
for i=1,#val do
if type(val[i])=='function' then
fun[i]=function(c,fc,sub,mg,sg) return val[i](c,fc,sub,mg,sg) and not c:IsHasEffect(6205579) end
elseif type(val[i])=='table' then
fun[i]=function(c,fc,sub,mg,sg)
for _,fcode in ipairs(val[i]) do
if type(fcode)=='function' then
if fcode(c,fc,sub,mg,sg) and not c:IsHasEffect(6205579) then return true end
else
if c:IsFusionCode(fcode) or (sub and c:CheckFusionSubstitute(fc)) then return true end
end
end
return false
end
for _,fcode in ipairs(val[i]) do
if type(fcode)~='function' then mat[fcode]=true end
end
else
fun[i]=function(c,fc,sub) return c:IsFusionCode(val[i]) or (sub and c:CheckFusionSubstitute(fc)) end
mat[val[i]]=true
end
end
local mt=getmetatable(c)
if mt.material==nil then
mt.material=mat
end
if mt.material_count==nil then
mt.material_count={#fun+minc-1,#fun+maxc-1}
end
for index,_ in pairs(mat) do
Auxiliary.AddCodeList(c,index)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(Auxiliary.FConditionMixRep(insf,sub,fun[1],minc,maxc,table.unpack(fun,2)))
e1:SetOperation(Auxiliary.FOperationMixRep(insf,sub,fun[1],minc,maxc,table.unpack(fun,2)))
c:RegisterEffect(e1)
end
--require("script/procedure.lua")
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment