Commit 13a60c23 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into master

parents cf11db84 3edb0ce3
......@@ -12,6 +12,7 @@ function c10045474.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10045474,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c10045474.handcon)
......
......@@ -56,8 +56,8 @@ end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (e:GetHandler():IsAbleToGrave()
or Duel.IsExistingMatchingCard(s.tgfilter1,tp,LOCATION_DECK,0,1,nil))
and Duel.IsExistingMatchingCard(s.tgfilter2,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_ONFIELD+LOCATION_DECK)
and Duel.IsExistingMatchingCard(s.tgfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_MZONE+LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -67,7 +67,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local sg1=g:Select(tp,1,1,nil)
if Duel.SendtoGrave(sg1,REASON_EFFECT)>0 and sg1:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg2=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_ONFIELD,0,1,1,nil)
local sg2=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_MZONE,0,1,1,nil)
if #sg2>0 then
Duel.BreakEffect()
Duel.SendtoGrave(sg2,REASON_EFFECT)
......
......@@ -13,6 +13,7 @@ function c11743119.initial_effect(c)
e1:SetOperation(c11743119.eqop)
c:RegisterEffect(e1)
end
c11743119.has_text_type=TYPE_UNION
function c11743119.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=e:GetLabelObject()
......
......@@ -74,7 +74,7 @@ function c12071500.activate(e,tp,eg,ep,ev,re,r,rp)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2,SUMMON_TYPE_FUSION)
fop(ce,e,tp,tc,mat2,SUMMON_VALUE_DARK_FUSION)
end
tc:CompleteProcedure()
end
......
......@@ -11,6 +11,7 @@ function c12079734.initial_effect(c)
e1:SetOperation(c12079734.operation)
c:RegisterEffect(e1)
end
c12079734.has_text_type=TYPE_UNION
function c12079734.filter1(c,ec)
return c:IsType(TYPE_UNION) and c:CheckUnionTarget(ec) and aux.CheckUnionEquip(c,ec)
end
......
......@@ -12,6 +12,7 @@ function c12524259.initial_effect(c)
e1:SetOperation(c12524259.activate)
c:RegisterEffect(e1)
end
c12524259.has_text_type=TYPE_UNION
function c12524259.tgfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
and Duel.IsExistingMatchingCard(c12524259.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c,tp)
......
......@@ -13,6 +13,7 @@ function c12541409.initial_effect(c)
c:RegisterEffect(e1)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12541409,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -18,7 +18,7 @@ function c12744567.initial_effect(c)
e2:SetDescription(aux.Stringid(12744567,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c12744567.spcon)
e2:SetTarget(c12744567.sptg)
......@@ -48,12 +48,12 @@ function c12744567.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c12744567.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayCount()>0
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousOverlayCountOnField()>0
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,48739166)
end
function c12744567.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,48739166) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
local rec=e:GetHandler():GetBaseAttack()
Duel.SetTargetPlayer(tp)
......
......@@ -12,6 +12,7 @@ function c14883228.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(14883228,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c14883228.handcon)
......
......@@ -5,7 +5,7 @@ function c14886469.initial_effect(c)
e1:SetDescription(aux.Stringid(14886469,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,14886469)
e1:SetCondition(c14886469.spcon)
......
......@@ -40,6 +40,7 @@ function c1561110.initial_effect(c)
e4:SetOperation(c1561110.spop2)
c:RegisterEffect(e4)
end
c1561110.has_text_type=TYPE_UNION
function c1561110.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
......
......@@ -12,6 +12,7 @@ function c15693423.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15693423,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c15693423.handcon)
......
......@@ -37,6 +37,7 @@ function c15943341.activate(e,tp,eg,ep,ev,re,r,rp)
local og=Duel.GetOperatedGroup()
if og:IsExists(c15943341.checkfilter,1,nil,tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(15943341,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
......
......@@ -21,7 +21,7 @@ function c20785975.initial_effect(c)
e2:SetDescription(aux.Stringid(20785975,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c20785975.spcon)
e2:SetTarget(c20785975.sptg)
......@@ -55,12 +55,12 @@ function c20785975.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c20785975.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayCount()>0
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousOverlayCountOnField()>0
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,94380860)
end
function c20785975.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,94380860) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20785975.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -17,6 +17,7 @@ end
function c21593977.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21593977,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetTargetRange(LOCATION_HAND,0)
......
......@@ -23,7 +23,7 @@ function c21639276.initial_effect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,21639277)
e3:SetCondition(c21639276.rmcon)
......@@ -55,10 +55,10 @@ function c21639276.rmcfilter(c)
end
function c21639276.rmcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_TRAP) and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
and Duel.IsExistingMatchingCard(c21639276.rmcfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c21639276.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil,tp,POS_FACEDOWN)
and Duel.IsExistingMatchingCard(c21639276.rmcfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil,tp,POS_FACEDOWN) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
end
......
......@@ -19,6 +19,7 @@ function c21723081.initial_effect(c)
e2:SetOperation(c21723081.operation)
c:RegisterEffect(e2)
end
c21723081.has_text_type=TYPE_UNION
function c21723081.cfilter(c)
return c:IsFaceup() and (c:IsCode(91998119) or c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,91998119))
end
......
......@@ -6,7 +6,6 @@ function c23002292.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c23002292.condition)
e1:SetCost(c23002292.cost)
e1:SetTarget(c23002292.target)
e1:SetOperation(c23002292.activate)
c:RegisterEffect(e1)
......@@ -14,6 +13,8 @@ function c23002292.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCost(c23002292.cost)
e2:SetDescription(aux.Stringid(23002292,1))
c:RegisterEffect(e2)
end
function c23002292.condition(e,tp,eg,ep,ev,re,r,rp)
......@@ -22,9 +23,7 @@ function c23002292.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c23002292.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c23002292.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable(true)
......
......@@ -61,8 +61,8 @@ function c23998625.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c23998625.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT) and c:GetOverlayCount()==0
and c:IsLocation(LOCATION_GRAVE)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT)
and c:GetPreviousOverlayCountOnField()==0 and c:IsLocation(LOCATION_GRAVE)
end
function c23998625.spfilter(c,e,tp)
return c:IsCode(97403510) and e:GetHandler():IsCanBeXyzMaterial(c)
......
......@@ -34,6 +34,7 @@ function c24425055.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(24425055,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -23,6 +23,8 @@ function c24701235.initial_effect(c)
e6:SetCategory(CATEGORY_DRAW)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
e6:SetCondition(c24701235.condition)
e6:SetTarget(c24701235.target)
e6:SetOperation(c24701235.operation)
c:RegisterEffect(e6)
......@@ -42,8 +44,11 @@ end
function c24701235.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPIRIT)
end
function c24701235.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c24701235.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c24701235.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24701235.cfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......
......@@ -40,6 +40,7 @@ function c2511.acttg(e,c)
end
function c2511.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(2511,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -34,6 +34,7 @@ function c25132288.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-500)
c:RegisterEffect(e1)
local e2=e1:Clone()
......@@ -44,6 +45,7 @@ function c25132288.operation(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(-1500)
tc:RegisterEffect(e3)
local e4=e3:Clone()
......
......@@ -70,6 +70,7 @@ function c25209168.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=stg:Select(tp,1,1,nil):GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(25209168,3))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -23,6 +23,7 @@ function c2547033.initial_effect(c)
c:RegisterEffect(e2)
--act in set turn
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(2547033,1))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -9,6 +9,7 @@ function c26931058.initial_effect(c)
e1:SetOperation(c26931058.efop)
c:RegisterEffect(e1)
end
c26931058.has_text_type=TYPE_UNION
function c26931058.filter1(c,tp)
return c:IsFaceup() and c:IsType(TYPE_UNION)
and Duel.IsExistingMatchingCard(c26931058.filter2,tp,LOCATION_MZONE,0,1,c,c)
......
......@@ -14,6 +14,7 @@ function c27012990.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27012990,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c27012990.handcon)
......
......@@ -59,6 +59,7 @@ function c27923575.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.SSet(tp,tg)
for tc in aux.Next(tg) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(27923575,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -87,7 +87,7 @@ function c2819435.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,2819436,0xfa,TYPES_TOKEN_MONSTER,2000,2000,6,RACE_WYRM,ATTRIBUTE_WATER)
and e:GetHandler():GetFlagEffect(2819435)==0
and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) end
and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,0,1,nil,TYPE_TOKEN) end
e:GetHandler():RegisterFlagEffect(2819435,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
......
......@@ -21,8 +21,9 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
......@@ -51,11 +52,13 @@ end
function s.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PYRO)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.afilter(c)
......
......@@ -75,6 +75,7 @@ function c29649320.setop(e,tp,eg,ep,ev,re,r,rp)
local sg=Group.FromCards(c,tc)
if Duel.SSet(tp,sg)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29649320,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -7,6 +7,7 @@ function c29762407.initial_effect(c)
c:RegisterEffect(e1)
--Trap activate in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29762407,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -29,8 +29,7 @@ function c29905795.op(e,tp,eg,ep,ev,re,r,rp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)>0 and tc:IsLocation(LOCATION_GRAVE)
and c:IsRelateToEffect(e) then
if tc and Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -18,6 +18,7 @@ function c30012506.initial_effect(c)
e5:SetOperation(c30012506.thop)
c:RegisterEffect(e5)
end
c30012506.has_text_type=TYPE_UNION
function c30012506.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
......
......@@ -12,11 +12,13 @@ function c30907810.initial_effect(c)
c:RegisterEffect(e1)
--activate from hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(30907810,2))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e3:SetTargetRange(LOCATION_HAND,0)
e3:SetValue(32841045)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -2,11 +2,13 @@
function c31629407.initial_effect(c)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31629407,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(32841045)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -2,11 +2,13 @@
function c32841045.initial_effect(c)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32841045,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(32841045)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -7,6 +7,7 @@ function c33773528.initial_effect(c)
c:RegisterEffect(e0)
--Trap activate in set turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33773528,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -18,6 +18,7 @@ function c3405259.initial_effect(c)
e5:SetOperation(c3405259.spop2)
c:RegisterEffect(e5)
end
c3405259.has_text_type=TYPE_UNION
function c3405259.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
......
......@@ -14,6 +14,7 @@ function c34302287.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(34302287,1))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c34302287.handcon)
......
......@@ -6,7 +6,7 @@ function c36326160.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCountLimit(1,36326160)
e1:SetCondition(c36326160.spcon)
e1:SetTarget(c36326160.sptg)
......
......@@ -61,6 +61,7 @@ function c36346532.setop(e,tp,eg,ep,ev,re,r,rp)
local sc=g:GetFirst()
if sc and Duel.SSet(tp,sc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(36346532,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -81,6 +81,7 @@ function c36429703.setop(e,tp,eg,ep,ev,re,r,rp)
if tc and Duel.SSet(tp,tc)~=0 then
if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(36429703,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
......
......@@ -9,8 +9,9 @@ function c36609518.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCountLimit(1,36609518)
e1:SetCondition(c36609518.descon)
e1:SetTarget(c36609518.destg)
e1:SetOperation(c36609518.desop)
c:RegisterEffect(e1)
......@@ -34,10 +35,12 @@ end
function c36609518.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x152)
end
function c36609518.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c36609518.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c36609518.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(c36609518.cfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
......
......@@ -16,6 +16,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
--quick activate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e3:SetTargetRange(LOCATION_SZONE,0)
......
......@@ -13,11 +13,13 @@ function c37649320.initial_effect(c)
c:RegisterEffect(e1)
--activate trap in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37649320,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xd4))
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetValue(37649320)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
......
......@@ -51,7 +51,7 @@ function c3828844.thop(e,tp,eg,ep,ev,re,r,rp)
end
function c3828844.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayCount()>0
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousOverlayCountOnField()>0
end
function c3828844.spfilter(c,e,tp)
if not (c:IsRankAbove(5) and c:IsRace(RACE_PLANT) and c:IsType(TYPE_XYZ)
......
......@@ -24,6 +24,7 @@ function c39778366.initial_effect(c)
e2:SetOperation(c39778366.thop)
c:RegisterEffect(e2)
end
c39778366.has_text_type=TYPE_UNION
function c39778366.filter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsType(TYPE_NORMAL+TYPE_UNION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -19,6 +19,7 @@ function c39890958.initial_effect(c)
e5:SetOperation(c39890958.sumop)
c:RegisterEffect(e5)
end
c39890958.has_text_type=TYPE_UNION
function c39890958.filter(c)
return c:IsRace(RACE_MACHINE)
end
......
......@@ -10,7 +10,7 @@ function c41908872.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCountLimit(1,41908872)
e1:SetCondition(c41908872.spcon)
e1:SetTarget(c41908872.sptg)
......
......@@ -20,12 +20,9 @@ end
function c42469671.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c42469671.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c42469671.desfilter(c)
return c:IsFaceup()
end
function c42469671.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c42469671.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
if g:GetCount()~=0 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,g:GetCount())
......@@ -35,34 +32,32 @@ function c42469671.sgfilter(c,p)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(p)
end
function c42469671.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c42469671.desfilter,tp,0,LOCATION_MZONE,nil)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
local dc=Duel.GetOperatedGroup():FilterCount(c42469671.sgfilter,nil,1-tp)
if dc~=0 and Duel.GetTurnPlayer()==tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.SelectYesNo(tp,aux.Stringid(42469671,0)) then
Duel.BreakEffect()
Duel.Draw(tp,dc,REASON_EFFECT)
--cannot attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c42469671.atkcon)
e1:SetTarget(c42469671.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--check
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOperation(c42469671.checkop)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
if dc~=0 and Duel.IsTurnPlayer(tp) and Duel.IsMainPhase() and Duel.IsPlayerCanDraw(tp,dc)
and Duel.SelectYesNo(tp,aux.Stringid(42469671,0)) then
Duel.BreakEffect()
Duel.Draw(tp,dc,REASON_EFFECT)
--cannot attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c42469671.atkcon)
e1:SetTarget(c42469671.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--check
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOperation(c42469671.checkop)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
end
function c42469671.checkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -121,7 +121,7 @@ function c42589641.hdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
function c42589641.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>0 and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
return e:GetHandler():GetPreviousOverlayCountOnField()>0 and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c42589641.spfilter(c,e,tp)
return c:IsSetCard(0x9c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -20,7 +20,9 @@ function c43618262.cfop(e,tp,eg,ep,ev,re,r,rp)
if g:FilterCount(Card.IsAbleToHand,nil,tp)==0 then return end
Duel.ConfirmDecktop(1-p,5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.PreserveSelectDeckSequence(true)
local tc=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil,tp):GetFirst()
Duel.PreserveSelectDeckSequence(false)
local num=math.floor(3000/100)
local t={}
for i=1,num do
......
--ジェット・ロイド
function c43697559.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43697559,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
......
......@@ -14,8 +14,31 @@ end
function c44487250.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c44487250.only_filter(c,onlyc,tp)
local require_count=c==onlyc and 2 or 1
return c:CheckRemoveOverlayCard(tp,require_count,REASON_COST)
end
function c44487250.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
if chk==0 then
local c=e:GetHandler()
if c:IsLocation(LOCATION_HAND) then
local fromhand_effects={c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND)}
local available_fromhand_effects={}
for _,te in ipairs(fromhand_effects) do
local cost=te:GetCost()
if te:CheckCountLimit(tp) and (not cost or cost(te,tp,eg,ep,ev,re,r,rp,0,e)) then
table.insert(available_fromhand_effects,te)
end
end
if #available_fromhand_effects==1 and available_fromhand_effects[1]:GetValue()==85551711 then
return Duel.IsExistingMatchingCard(c44487250.only_filter,tp,LOCATION_MZONE,0,1,nil,available_fromhand_effects[1]:GetHandler(),tp)
else
return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST)
end
else
return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST)
end
end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function c44487250.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -58,7 +58,7 @@ function c44968687.spfilter(c,tp)
end
function c44968687.spcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroupEx(c:GetControler(),Card.IsCode,1,REASON_SPSUMMON,false,nil,c:GetControler())
return Duel.CheckReleaseGroupEx(c:GetControler(),c44968687.spfilter,1,REASON_SPSUMMON,false,nil,c:GetControler())
end
function c44968687.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(c44968687.spfilter,nil,tp)
......
......@@ -16,6 +16,7 @@ function c46181000.initial_effect(c)
e1:SetOperation(c46181000.operation)
c:RegisterEffect(e1)
end
c46181000.has_text_type=TYPE_UNION
function c46181000.filter(c,e,sp)
return c:IsType(TYPE_UNION) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
......
......@@ -15,9 +15,10 @@ function c46435376.initial_effect(c)
e2:SetDescription(aux.Stringid(46435376,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,46435377)
e2:SetCondition(c46435376.tgcon)
e2:SetTarget(c46435376.tgtg)
e2:SetOperation(c46435376.tgop)
c:RegisterEffect(e2)
......@@ -32,12 +33,14 @@ function c46435376.hdop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
function c46435376.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c46435376.tgfilter(c)
return c:IsSetCard(0xb) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c46435376.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
and Duel.IsExistingMatchingCard(c46435376.tgfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c46435376.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c46435376.tgop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -20,58 +20,61 @@ function c47778083.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c47778083.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c47778083.filter,1-tp,0,LOCATION_GRAVE,1,nil,e,1-tp)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,1-tp)>0
end
local turnp=Duel.GetTurnPlayer()
Duel.Hint(HINT_SELECTMSG,turnp,HINTMSG_SPSUMMON)
local sg=Duel.SelectTarget(turnp,c47778083.filter,turnp,0,LOCATION_GRAVE,1,1,nil,e,turnp)
Duel.Hint(HINT_SELECTMSG,1-turnp,HINTMSG_SPSUMMON)
local og=Duel.SelectTarget(1-turnp,c47778083.filter,1-turnp,0,LOCATION_GRAVE,1,1,nil,e,1-turnp)
local sc=sg:GetFirst()
local oc=og:GetFirst()
local g=Group.FromCards(sc,oc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
e:SetLabelObject(sc)
local tg=Group.CreateGroup()
for p in aux.TurnPlayers() do
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(p,c47778083.filter,p,0,LOCATION_GRAVE,1,1,nil,e,p)
tg:Merge(g)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,2,0,0)
end
function c47778083.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)==0 then return end
local sc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local oc=g:GetFirst()
if oc==sc then oc=g:GetNext() end
if sc:IsRelateToEffect(e) then
Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCondition(c47778083.descon)
e1:SetOperation(c47778083.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
sc:RegisterEffect(e1,true)
end
if oc:IsRelateToEffect(e) then
Duel.SpecialSummonStep(oc,0,1-tp,1-tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCondition(c47778083.descon)
e1:SetOperation(c47778083.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
oc:RegisterEffect(e1,true)
local tg=Duel.GetTargetsRelateToChain()
if #tg==0 then return end
local c=e:GetHandler()
local fid=c:GetFieldID()
local sg=Group.CreateGroup()
for p in aux.TurnPlayers() do
local tc=tg:Filter(Card.IsControler,nil,1-p):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,p,p,false,false,POS_FACEUP) then
tc:RegisterFlagEffect(47778083,RESET_EVENT+RESETS_STANDARD,0,1,fid)
tg:RemoveCard(tc)
sg:AddCard(tc)
end
end
Duel.SpecialSummonComplete()
if #sg==0 then return end
sg:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCondition(c47778083.descon)
e1:SetOperation(c47778083.desop)
e1:SetLabel(fid,Duel.GetTurnCount())
e1:SetLabelObject(sg)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c47778083.desfilter(c,fid)
return c:GetFlagEffectLabel(47778083)==fid
end
function c47778083.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
local fid,turnc=e:GetLabel()
if Duel.GetTurnCount()==turnc then return false end
local g=e:GetLabelObject()
if not g:IsExists(c47778083.desfilter,1,nil,fid) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c47778083.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
local fid,turnc=e:GetLabel()
local g=e:GetLabelObject()
local tg=g:Filter(c47778083.desfilter,nil,fid)
Duel.Destroy(tg,REASON_EFFECT)
end
......@@ -5,6 +5,7 @@ function c4896788.initial_effect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c4896788.drcon)
e2:SetOperation(c4896788.drop)
......
......@@ -3,6 +3,7 @@ function c49826746.initial_effect(c)
aux.AddCodeList(c,80280737)
--Trap activate in set turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49826746,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -43,6 +43,7 @@ function c50237654.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SSet(tp,dc,tp,false)==0 then return end
if dc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50237654,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
......@@ -51,6 +52,7 @@ function c50237654.drop(e,tp,eg,ep,ev,re,r,rp)
end
if dc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50237654,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -2,11 +2,13 @@
function c5230799.initial_effect(c)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5230799,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(32841045)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -15,7 +15,7 @@ function c52404456.initial_effect(c)
e2:SetDescription(aux.Stringid(52404456,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetProperty(EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c52404456.shcon)
e2:SetTarget(c52404456.shtg)
......
......@@ -32,7 +32,7 @@ function c52843699.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCountLimit(1,88232397)
e3:SetCountLimit(1,52843700)
e3:SetCost(c52843699.cost)
e3:SetTarget(c52843699.target)
e3:SetOperation(c52843699.operation)
......
......@@ -13,6 +13,7 @@ function c52945066.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(52945066,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c52945066.handcon)
......
......@@ -10,11 +10,13 @@ function c55428242.initial_effect(c)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55428242,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(c55428242.etarget)
e2:SetValue(55428242)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
......
......@@ -46,6 +46,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and Duel.SSet(tp,tc)>0 then
if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58019984,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
......@@ -54,6 +55,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58019984,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -12,6 +12,7 @@ function c59839761.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59839761,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c59839761.handcon)
......
......@@ -38,6 +38,7 @@ function c60990740.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableShuffleCheck()
if tc:GetType()==TYPE_TRAP and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(60990740,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -4,9 +4,10 @@ function c61245403.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,61245403)
e1:SetCondition(c61245403.thcon1)
e1:SetTarget(c61245403.thtg1)
e1:SetOperation(c61245403.thop1)
c:RegisterEffect(e1)
......@@ -22,12 +23,14 @@ function c61245403.initial_effect(c)
e2:SetOperation(c61245403.thop2)
c:RegisterEffect(e2)
end
function c61245403.thcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)==0
end
function c61245403.thfilter1(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function c61245403.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_FZONE,0,nil)
if chk==0 then return #g==0 and Duel.IsExistingMatchingCard(c61245403.thfilter1,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c61245403.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c61245403.thop1(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,6 +14,7 @@ function c61397885.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(61397885,1))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c61397885.handcon)
......
......@@ -39,13 +39,6 @@ function s.initial_effect(c)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetLabelObject(e3)
e4:SetOperation(s.chk)
c:RegisterEffect(e4)
end
function s.dmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
......@@ -87,8 +80,10 @@ function s.filter(c,e,tp)
return c:IsSetCard(0x81) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabel()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local ct=e:GetHandler():GetPreviousOverlayCountOnField()
if chk==0 then return ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
e:SetLabel(ct)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
......@@ -97,6 +92,3 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,e:GetLabel(),nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function s.chk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(e:GetHandler():GetOverlayCount())
end
......@@ -23,6 +23,7 @@ function c66399653.initial_effect(c)
aux.RegisterMergedDelayedEvent(c,66399653,EVENT_SUMMON_SUCCESS,g)
aux.RegisterMergedDelayedEvent(c,66399653,EVENT_SPSUMMON_SUCCESS,g)
end
c66399653.has_text_type=TYPE_UNION
function c66399653.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsType(TYPE_UNION) and c:IsAbleToHand()
......
......@@ -36,13 +36,6 @@ function c67557908.initial_effect(c)
e3:SetTarget(c67557908.sptg)
e3:SetOperation(c67557908.spop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(c67557908.regop)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
end
aux.xyz_number[67557908]=4
function c67557908.descon(e,tp,eg,ep,ev,re,r,rp)
......@@ -69,14 +62,11 @@ function c67557908.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
function c67557908.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetOverlayCount()
e:GetLabelObject():SetLabel(ct)
end
function c67557908.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_XYZ) and e:GetLabel()>0
local ct=c:GetPreviousOverlayCountOnField()
e:SetLabel(ct)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_XYZ) and ct>0
end
function c67557908.spfilter(c,e,tp)
return c:IsCode(94942656) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -12,8 +12,9 @@ function c6767771.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCountLimit(1,6767771)
e2:SetCondition(c6767771.discon)
e2:SetTarget(c6767771.distg)
e2:SetOperation(c6767771.disop)
c:RegisterEffect(e2)
......@@ -35,9 +36,11 @@ end
function c6767771.disfilter(c)
return ((c:IsSetCard(0x181) and c:IsLocation(LOCATION_MZONE)) or c:IsCode(56099748)) and c:IsFaceup()
end
function c6767771.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c6767771.disfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c6767771.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3)
and Duel.IsExistingMatchingCard(c6767771.disfilter,tp,LOCATION_ONFIELD,0,1,nil) end
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
......
......@@ -2,6 +2,7 @@
function c68018709.initial_effect(c)
--act qp in hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68018709,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
......
......@@ -2,11 +2,13 @@
function c68024506.initial_effect(c)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68024506,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(32841045)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -2,11 +2,13 @@
function c68246154.initial_effect(c)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68246154,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(32841045)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -14,6 +14,7 @@ function c69973414.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(69973414,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c69973414.handcon)
......
......@@ -17,7 +17,6 @@ function c703897.initial_effect(c)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,703897)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c703897.thcost)
e2:SetTarget(c703897.thtg)
e2:SetOperation(c703897.thop)
......
......@@ -44,6 +44,7 @@ function c70389815.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(70389815,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
......
......@@ -37,6 +37,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70825459,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -15,11 +15,13 @@ function c71791814.initial_effect(c)
c:RegisterEffect(e1)
--activate from hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71791814,4))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetValue(32841045)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
......@@ -54,7 +54,7 @@ function c71921856.atkval(e,c)
end
function c71921856.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetOverlayCount()
local ct=c:GetPreviousOverlayCountOnField()
e:SetLabel(ct)
return c:IsReason(REASON_DESTROY) and c:GetReasonPlayer()==1-tp
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and ct>0
......
......@@ -11,6 +11,7 @@ function c72083436.initial_effect(c)
e1:SetOperation(c72083436.daop)
c:RegisterEffect(e1)
end
c72083436.has_text_type=TYPE_UNION
function c72083436.cfilter(c)
return c:IsType(TYPE_UNION)
end
......
......@@ -11,6 +11,7 @@ function c72930878.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(72930878,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c72930878.handcon)
......
......@@ -44,7 +44,7 @@ function c73289035.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c73289035.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetOverlayCount()
local ct=e:GetHandler():GetPreviousOverlayCountOnField()
e:SetLabel(ct)
return rp==1-tp and bit.band(r,REASON_EFFECT)~=0 and ct>0
and e:GetHandler():IsPreviousPosition(POS_FACEUP)
......
......@@ -6,7 +6,7 @@ function c73478096.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCountLimit(1,73478096)
e1:SetCondition(c73478096.spcon)
e1:SetTarget(c73478096.sptg)
......@@ -22,17 +22,18 @@ function c73478096.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c73478096.spfilter(c)
function c73478096.cfilter(c)
return c:IsSetCard(0x55,0x7b) and c:IsType(TYPE_MONSTER) and c:IsFaceupEx()
end
function c73478096.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
local c=e:GetHandler()
return not c:IsPreviousLocation(LOCATION_ONFIELD)
and Duel.IsExistingMatchingCard(c73478096.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,c)
end
function c73478096.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.IsExistingMatchingCard(c73478096.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,c) end
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c73478096.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -66,6 +66,7 @@ function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -12,6 +12,7 @@ function c73632127.initial_effect(c)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(73632127,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -6,7 +6,7 @@ function c73810864.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCountLimit(1,73810864)
e1:SetCondition(c73810864.spcon)
e1:SetTarget(c73810864.sptg)
......
......@@ -23,7 +23,7 @@ function c73898890.initial_effect(c)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,897409)
e2:SetCountLimit(1,73898891)
e2:SetCost(c73898890.spcost)
e2:SetCondition(c73898890.spcon)
e2:SetTarget(c73898890.sptg)
......
......@@ -13,6 +13,7 @@ function c74414885.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74414885,1))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c74414885.handcon)
......
......@@ -9,15 +9,16 @@ function s.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCost(s.cost)
c:RegisterEffect(e2)
--Special Summon
local e3=Effect.CreateEffect(c)
......@@ -38,14 +39,8 @@ function s.cfilter(c)
return c:GetType()==TYPE_TRAP and c:IsDiscardable()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if not c:IsStatus(STATUS_SET_TURN) then return true end
local ct=#{c:IsHasEffect(EFFECT_TRAP_ACT_IN_SET_TURN,tp)}
local dis=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil)
if chk==0 then return ct>1 or dis end
if ct==1 or dis and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked()
......
......@@ -18,6 +18,7 @@ function c77411244.initial_effect(c)
e5:SetOperation(c77411244.thop)
c:RegisterEffect(e5)
end
c77411244.has_text_type=TYPE_UNION
function c77411244.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
......
......@@ -8,6 +8,7 @@ function c77432167.initial_effect(c)
c:RegisterEffect(e0)
--act in set turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(77432167,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
......
......@@ -43,7 +43,7 @@ function c77799846.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c77799846.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetOverlayCount()>0
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetPreviousOverlayCountOnField()>0
end
function c77799846.rfilter(c)
return c:IsSetCard(0x85) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
......
......@@ -19,7 +19,8 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
......@@ -43,13 +44,15 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.ConfirmCards(1-tp,tc)
end
end
function s.spfilter(c)
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x6)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_ONFIELD,0,1,nil) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -13,6 +13,7 @@ function c78349103.initial_effect(c)
e5:SetOperation(c78349103.sop)
c:RegisterEffect(e5)
end
c78349103.has_text_type=TYPE_UNION
function c78349103.filter(c)
return c:IsRace(RACE_MACHINE)
end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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