Commit 41771b29 authored by mercury233's avatar mercury233

fix

parent 9cb2c777
Pipeline #17376 passed with stages
in 34 seconds
......@@ -4,7 +4,6 @@ local s,id,o=GetID()
function c101110082.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
......
......@@ -25,7 +25,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
......
......@@ -25,7 +25,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
......
......@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
......@@ -43,19 +44,17 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
end
Duel.SpecialSummonComplete()
local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
......
......@@ -8,21 +8,22 @@ function c101111014.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,101111014)
e1:SetCondition(c101111014.sscon)
e1:SetTarget(c101111014.eqtg)
e1:SetOperation(c101111014.eqop)
c:RegisterEffect(e1)
--Atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c101111014.condition)
e3:SetValue(1500)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(c101111014.condition)
e2:SetValue(1500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
e3:SetValue(2000)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(2000)
c:RegisterEffect(e4)
end
function c101111014.sfilter(c)
return c:IsCode(101111014) and c:IsFaceup()
......@@ -41,6 +42,9 @@ function c101111014.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c101111014.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101111014.filter,tp,LOCATION_MZONE,0,1,1,c)
if c:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,0,0,0)
end
end
function c101111014.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -88,7 +88,6 @@ function c101111015.eqop(e,tp,eg,ep,ev,re,r,rp)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e3)
tc:RegisterFlagEffect(101111015,RESET_EVENT+RESETS_STANDARD,0,0)
end
end
function c101111015.eqlimit(e,c)
......
......@@ -27,6 +27,7 @@ function c101111016.initial_effect(c)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101111016,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
......
......@@ -26,7 +26,7 @@ function s.initial_effect(c)
e4:SetCode(EVENT_FLIP)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(s.descon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
......@@ -55,7 +55,7 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(aux.TRUE,1,e:GetHandler())
return not eg:IsContains(e:GetHandler())
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
......
......@@ -55,7 +55,7 @@ function c101111021.chainop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101111021.chainlm(re,rp,tp)
return tp==rp or not re:GetHandler():IsType(TYPE_MONSTER)
return tp==rp or not re:IsActiveType(TYPE_MONSTER)
end
function c101111021.desfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT+RACE_PLANT)
......
......@@ -3,6 +3,7 @@
function c101111022.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101111022,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
......@@ -12,18 +13,18 @@ function c101111022.initial_effect(c)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101111022,0))
e2:SetDescription(aux.Stringid(101111022,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c101111022.cost)
e2:SetCountLimit(1,101110122)
e2:SetCost(c101111022.cost)
e2:SetTarget(c101111022.sptg)
e2:SetOperation(c101111022.spop)
c:RegisterEffect(e2)
end
function c101111022.filter(c)
return c:IsCode(97169186,66788016)
return c:IsCode(97169186,66788016) and c:IsAbleToHand()
end
function c101111022.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101111022.filter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -5,7 +5,7 @@ function c101111023.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101111023,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,101111023)
......
......@@ -44,16 +44,16 @@ end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)
local g=Duel.GetMatchingGroup(s.tefilter,tp,0,LOCATION_MZONE,nil)
local b1 = ct>=2 and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,math.floor(ct/2),nil)
local b2 = #g>0 and not g:IsExists(aux.NOT(Card.IsAbleToExtra),1,nil)
local b1=ct>=2 and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,math.floor(ct/2),nil)
local b2=#g>0 and not g:IsExists(aux.NOT(Card.IsAbleToExtra),1,nil)
if chk==0 then return b1 or b2 end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)
local halfct=math.floor(ct/2)
local g=Duel.GetMatchingGroup(s.tefilter,tp,0,LOCATION_MZONE,nil)
local b1 = ct>=2 and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,halfct,nil)
local b2 = #g>0 and not g:IsExists(aux.NOT(Card.IsAbleToExtra),1,nil)
local b1=ct>=2 and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,halfct,nil)
local b2=#g>0 and not g:IsExists(aux.NOT(Card.IsAbleToExtra),1,nil)
if not b1 and not b2 then return end
local off=1
local ops={}
......
......@@ -43,7 +43,6 @@ function c101111032.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101111032.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101111032.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101111032.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
......@@ -68,13 +67,19 @@ function c101111032.filter(c)
return c:IsSetCard(0x3a) and c:IsType(TYPE_RITUAL) and c:IsAbleToHand() and c:IsFaceup()
end
function c101111032.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101111032.filter,tp,LOCATION_MZONE,0,1,nil) end
local rc=re:GetHandler()
if chk==0 then return (not rc:IsRelateToEffect(re) or rc:IsAbleToDeck())
and Duel.IsExistingMatchingCard(c101111032.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsAbleToDeck() and re:GetHandler():IsRelateToEffect(re) then
if rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
end
if re:GetActivateLocation()==LOCATION_GRAVE then
e:SetCategory(e:GetCategory()|CATEGORY_GRAVE_ACTION)
else
e:SetCategory(e:GetCategory()&~CATEGORY_GRAVE_ACTION)
end
end
function c101111032.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
......@@ -53,8 +53,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cfilter(c,tp,re)
local rc=re:GetHandler()
return re and re:IsActivated() and rc:IsType(TYPE_MONSTER) and c:IsSummonPlayer(1-tp)
return re and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) and c:IsSummonPlayer(1-tp)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp,re)
......
......@@ -72,6 +72,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local fg=(Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)+e:GetHandler()):Filter(Card.IsRelateToEffect,nil,e)
if fg:GetCount()~=2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -31,7 +31,6 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(1101)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
......
......@@ -65,11 +65,10 @@ end
function s.petg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=1<<c:GetSequence()
local b1 = zone~=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
local b2 = Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_MZONE,0,1,nil)
local b1=zone~=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
local b2=Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return b1 or b2 end
e:SetCategory(0)
if not b1 and not b2 then return end
local off=1
local ops={}
local opval={}
......
......@@ -12,7 +12,7 @@ function s.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
......@@ -48,12 +48,13 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(aux.indoval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetTargetRange(1,1)
e2:SetTarget(s.efilter)
e2:SetValue(0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local ch=Duel.GetCurrentChain()
if ch>1 then
......@@ -84,7 +85,7 @@ 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) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -19,7 +19,7 @@ function s.initial_effect(c)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
......
......@@ -56,7 +56,7 @@ function c101111043.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
end
end
......
......@@ -24,7 +24,7 @@ function c101111045.initial_effect(c)
e2:SetCode(EVENT_DETACH_MATERIAL)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101111046)
e2:SetCountLimit(1,101111045+100)
e2:SetCondition(c101111045.descon)
e2:SetTarget(c101111045.destg)
e2:SetOperation(c101111045.desop)
......@@ -59,13 +59,10 @@ function c101111045.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD+LOCATION_OVERLAY)
end
function c101111045.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if not g:GetFirst():IsAbleToHand() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function c101111045.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -2,7 +2,6 @@
--Script by 奥克斯 & mercury233
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,73542331)
--xyz summon
aux.AddXyzProcedure(c,nil,7,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop)
c:EnableReviveLimit()
......@@ -19,7 +18,6 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_REMOVE)
e2:SetCondition(s.mtcon)
......
......@@ -64,6 +64,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local xg=mg:Select(tp,1,ct,nil)
local tc1=xg:GetFirst()
while tc1 do
tc1:CancelToGrave()
local og=tc1:GetOverlayGroup()
if #og>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
......@@ -5,7 +5,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),3,99,s.spchk(c))
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),3,99,s.spchk)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -14,28 +14,28 @@ function s.initial_effect(c)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.limcon)
e2:SetOperation(s.limop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.limcon)
e3:SetOperation(s.limop)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CHAIN_END)
e3:SetOperation(s.limop2)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_CHAIN_END)
e4:SetOperation(s.limop2)
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(s.rmtg)
e4:SetOperation(s.rmop)
c:RegisterEffect(e4)
--remove
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
--send to GY
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOGRAVE)
......@@ -47,13 +47,18 @@ function s.initial_effect(c)
e5:SetOperation(s.tgop)
c:RegisterEffect(e5)
end
--pre update
function Auxiliary.LCheckGoal(sg,tp,lc,gf,lmat)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),#sg,#sg)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg,lc,tp))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc,tp)
and (not lmat or sg:IsContains(lmat))
end
function s.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x14d)
end
function s.spchk(c)
return function(g)
return Duel.IsExistingMatchingCard(s.cfilter,c:GetControler(),LOCATION_GRAVE,0,3,nil)
end
function s.spchk(g,lc,tp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,3,nil)
end
function s.splimit(e,se,sp,st,pos,tp)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
......
......@@ -12,6 +12,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(s.dtfcon)
......@@ -27,7 +28,9 @@ function s.dtfcon(e,tp,eg,ep,ev,re,r,rp)
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.filter(c,tp)
return (c:IsCode(77297908) or c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
return (c:IsCode(77297908) or c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM)
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)))
and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function s.dtftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsFaceup() end
......
......@@ -30,7 +30,6 @@ end
function c101111052.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,101111052)~=0 then return end
Duel.RegisterFlagEffect(tp,101111052,RESET_PHASE+PHASE_END,0,1)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101111052.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
......
......@@ -84,7 +84,7 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,1-tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -8,20 +8,22 @@ function c101111054.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101111054)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c101111054.cost)
e1:SetTarget(c101111054.target)
e1:SetOperation(c101111054.activate)
c:RegisterEffect(e1)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101111054,3))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101111054)
e3:SetTarget(c101111054.mattg)
e3:SetOperation(c101111054.matop)
c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101111054,3))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101111054)
e2:SetTarget(c101111054.mattg)
e2:SetOperation(c101111054.matop)
c:RegisterEffect(e2)
end
function c101111054.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -38,9 +40,15 @@ end
function c101111054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101111054.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
local spct=e:GetLabel()
if spct>0 then
e:SetCategory(e:GetCategory()|CATEGORY_GRAVE_SPSUMMON|CATEGORY_SPECIAL_SUMMON)
else
e:SetCategory(e:GetCategory()&~(CATEGORY_GRAVE_SPSUMMON|CATEGORY_SPECIAL_SUMMON))
end
end
function c101111054.spfilter(c,e,tp)
return c:IsSetCard(0x155) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x155) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101111054.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -65,10 +73,12 @@ function c101111054.matfilter(c,tp)
end
function c101111054.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101111054.matfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101111054.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand()
and Duel.IsExistingTarget(c101111054.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101111054.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c101111054.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -27,7 +27,6 @@ function s.thfilter(c,specify)
return c:IsSetCard(0x145) and (not specify or (c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER+TYPE_SPELL))) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil,true)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -66,7 +65,6 @@ function s.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g1=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if #g1==0 and #g2==0 then return end
......
......@@ -9,6 +9,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......
......@@ -37,8 +37,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -55,6 +54,8 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
elseif #sg==0 and tc:IsRelateToEffect(e) and s.rmfilter(tc) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function s.cfilter(c)
......
......@@ -50,6 +50,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
......
......@@ -18,6 +18,7 @@ function c101111062.initial_effect(c)
e2:SetTarget(c101111062.sptg)
e2:SetOperation(c101111062.spop)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101111062,1))
e3:SetCategory(CATEGORY_CONTROL)
......
......@@ -38,6 +38,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg1)
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
......
......@@ -4,7 +4,7 @@ function c101111064.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101111064,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
......
......@@ -56,9 +56,6 @@ function s.filter(c,e,tp)
return c:IsSetCard(0x2b) and c:IsCanBeEffectTarget(e)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function s.spchk(g)
return aux.dncheck(g)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -66,7 +63,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,nil,e,tp):SelectSubGroup(tp,s.spchk,false,1,ft)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,nil,e,tp):SelectSubGroup(tp,aux.dncheck,false,1,ft)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0)
end
......
......@@ -18,18 +18,24 @@ end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)~=0
end
function s.filter(c,tp)
function s.filter(c,b1,b2)
return (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_TRAP) and not c:IsCode(id)
and (Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and c:IsAbleToHand() or c:IsSSetable())
and (b1 and c:IsSSetable() or b2 and c:IsAbleToHand())
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,tp) end
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ct=ct-1 end
local b1=ct>0
local b2=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,b1,b2) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local th=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,true,th):GetFirst()
if not tc then return end
local b1,b2=tc:IsSSetable(),Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and tc:IsAbleToHand()
local b1=tc:IsSSetable()
local b2=th and tc:IsAbleToHand()
if b1 and (not b2 or Duel.SelectOption(tp,1153,1190)==0) then
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -17,6 +17,7 @@ function c101111071.initial_effect(c)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c101111071.etcon)
e2:SetTarget(c101111071.ettg)
e2:SetOperation(c101111071.etop)
c:RegisterEffect(e2)
end
......@@ -39,14 +40,16 @@ function c101111071.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c101111071.cfilter(c)
return (c:IsCode(93717133) or (c:IsType(TYPE_XYZ) and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133))) and c:IsFaceup()
end
function c101111071.etcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()~=tp and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT)
and c:GetReasonPlayer()==1-tp and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
and Duel.IsExistingMatchingCard(c101111071.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101111071.cfilter(c)
return c:IsFaceup() and (c:IsCode(93717133) or (c:IsType(TYPE_XYZ) and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133)))
end
function c101111071.ettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101111071.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
end
function c101111071.etop(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
......
......@@ -6,17 +6,18 @@ function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return (c:IsType(TYPE_MONSTER) or c:IsLocation(LOCATION_MZONE)) and c:IsAbleToRemove()
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(0x14) and s.filter(chkc) end
......@@ -25,7 +26,6 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,0x14,0x14,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,1-tp,LOCATION_DECK)
end
function s.sfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -43,9 +43,9 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e)
and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
......
......@@ -62,15 +62,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if lc:IsRelateToEffect(e) and lc:IsControler(tp)
and lc:IsFaceup() then
......
......@@ -17,7 +17,7 @@ function s.initial_effect(c)
--xyzmat to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
......@@ -29,24 +29,27 @@ end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x189) and c:IsType(TYPE_XYZ)
end
function s.condition(e)
return Duel.IsExistingMatchingCard(s.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil)
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local b1=#g1>1 and g1:IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN,REASON_RULE)
local b2=#g2>1 and g2:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE)
if chk==0 then return Duel.IsPlayerCanRemove(tp) and (b1 or b2) end
local b1=#g1>1 and Duel.IsPlayerCanRemove(tp)
and g1:IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN,REASON_RULE)
local b2=#g2>1 and Duel.IsPlayerCanRemove(1-tp)
and g2:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE)
if chk==0 then return b1 or b2 end
local g3=g1+g2
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g3,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanRemove(tp) then return end
local g1=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local b1=#g1>1 and g1:IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN,REASON_RULE)
local b2=#g2>1 and g2:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE)
local b1=#g1>1 and Duel.IsPlayerCanRemove(tp)
and g1:IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN,REASON_RULE)
local b2=#g2>1 and Duel.IsPlayerCanRemove(1-tp)
and g2:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE)
if b1 then
local ct=#g1-1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......@@ -88,6 +91,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and bc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.SpecialSummon(bc,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -50,6 +50,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
if #sg>0 then
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -20,6 +20,7 @@ function s.initial_effect(c)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
......@@ -41,12 +42,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
local tg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_MZONE,0,nil)
tg:AddCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rg=tg:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(rg)
Duel.BreakEffect()
res=Duel.SendtoHand(rg,nil,REASON_EFFECT)
end
end
......
......@@ -6,7 +6,7 @@ function c101111078.initial_effect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c101111078.condition)
e1:SetTarget(c101111078.target)
e1:SetOperation(c101111078.operation)
......@@ -15,9 +15,6 @@ end
function c101111078.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)-Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>=2
end
function c101111078.tgfilter(c)
return c:IsType(TYPE_MONSTER)
end
function c101111078.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mc=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local count=mc-1
......
......@@ -7,7 +7,7 @@ function c101111079.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c101111079.condtion)
e1:SetTarget(c101111079.target)
e1:SetOperation(c101111079.operation)
......
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