Commit ee072422 authored by mercury233's avatar mercury233

fix

parent 6b785e61
......@@ -68,7 +68,7 @@ function c100200206.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c100200206.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and c:IsPreviousLocation(LOCATION_MZONE)
return c:IsPreviousLocation(LOCATION_MZONE)
end
function c100200206.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -92,7 +92,7 @@ function c100200206.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100200206.thfilter,tp,LOCATION_DECK,0,1,1,nil,lv)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -5,7 +5,6 @@ function c100281062.initial_effect(c)
aux.AddCodeList(c,46986414,38033121)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100281062+EFFECT_COUNT_CODE_OATH)
......@@ -14,7 +13,7 @@ function c100281062.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100281062,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
......@@ -42,15 +41,15 @@ end
function c100281062.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(46986414,38033121) and c:IsSummonPlayer(tp)
end
function c100281062.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100281062.cfilter,1,nil,tp)
end
function c100281062.tgfilter(c,e,tp,g)
return g:IsContains(c) and Duel.IsExistingMatchingCard(c100281062.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetCode())
end
function c100281062.spfilter(c,e,tp,code)
return c:IsCode(46986414,38033121) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(code)
end
function c100281062.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100281062.cfilter,1,nil,tp)
end
function c100281062.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(c100281062.cfilter,nil,tp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100281062.tgfilter(chkc,e,tp,g) end
......@@ -69,7 +68,7 @@ function c100281062.spop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local code=tc:GetCode()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100281062.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,code)
local g=Duel.SelectMatchingCard(tp,c100281062.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,code)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -13,7 +13,7 @@ function c100281063.initial_effect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100281063)
e2:SetCondition(c100281063.drcon)
......
......@@ -20,7 +20,6 @@ function c100312001.initial_effect(c)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_FAIRY))
e2:SetValue(1)
c:RegisterEffect(e2)
--banish
local e3=Effect.CreateEffect(c)
......
......@@ -8,6 +8,7 @@ function c100312033.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,100312033+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100312033.target)
e1:SetOperation(c100312033.activate)
......
......@@ -22,7 +22,7 @@ function c100312040.initial_effect(c)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_BATTLE_PHASE,TIMINGS_CHECK_MONSTER+TIMING_BATTLE_PHASE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c100312040.qkcon)
c:RegisterEffect(e2)
--to hand
......@@ -37,14 +37,11 @@ function c100312040.initial_effect(c)
e3:SetOperation(c100312040.thop)
c:RegisterEffect(e3)
end
function c100312040.cfilter(c)
return c:IsCode(56433456) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
function c100312040.qkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(56433456) or Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,56433456)
end
function c100312040.noqkcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100312040.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
end
function c100312040.qkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100312040.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
return not c100312040.qkcon(e,tp,eg,ep,ev,re,r,rp)
end
function c100312040.poscostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsType(TYPE_MONSTER)
......
......@@ -9,7 +9,7 @@ function c100312052.initial_effect(c)
--to grave or to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100312052,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
......@@ -40,22 +40,18 @@ end
function c100312052.thfilter(c)
return c:IsCode(91188343) and c:IsAbleToHand()
end
function c100312052.cfilter(c)
return c:IsCode(56433456) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c100312052.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b=Duel.IsExistingMatchingCard(c100312052.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
local b=Duel.IsEnvironment(56433456) or Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,56433456)
if chk==0 then return Duel.IsExistingMatchingCard(c100312052.tgfilter,tp,LOCATION_DECK,0,1,nil)
or b and Duel.IsExistingMatchingCard(c100312052.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
or b and Duel.IsExistingMatchingCard(c100312052.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c100312052.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.IsExistingMatchingCard(c100312052.tgfilter,tp,LOCATION_DECK,0,1,nil)
local b=Duel.IsExistingMatchingCard(c100312052.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
if b and Duel.IsExistingMatchingCard(c100312052.thfilter,tp,LOCATION_DECK,0,1,nil) and (not a or Duel.SelectYesNo(tp,aux.Stringid(100312052,2))) then
local b=Duel.IsEnvironment(56433456) or Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,56433456)
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100312052.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if b and #tg>0 and (not a or Duel.SelectYesNo(tp,aux.Stringid(100312052,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100312052.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=tg:Select(tp,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......@@ -68,12 +64,13 @@ function c100312052.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c100312052.costfilter(c)
return c:IsRace(RACE_FAIRY)
function c100312052.costfilter(c,tp)
return c:IsRace(RACE_FAIRY) and (c:IsFaceup() or c:IsControler(tp))
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,c)
end
function c100312052.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100312052.costfilter,1,nil) end
local rg=Duel.SelectReleaseGroup(tp,c100312052.costfilter,1,1,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100312052.costfilter,1,nil,tp) end
local rg=Duel.SelectReleaseGroup(tp,c100312052.costfilter,1,1,nil,tp)
Duel.Release(rg,REASON_COST)
end
function c100312052.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -19,7 +19,7 @@ function c100417001.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100417001+100)
e2:SetCondition(c100417001.sccon)
......
......@@ -19,6 +19,7 @@ function c100417002.initial_effect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100417002+100)
e2:SetCondition(c100417002.drcon1)
......
......@@ -19,6 +19,7 @@ function c100417003.initial_effect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_BECOME_TARGET)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100417003+100)
e2:SetCondition(c100417003.atkcon)
......@@ -63,8 +64,8 @@ function c100417003.atkop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(math.floor(-tc:GetAttack()/2))
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
......
......@@ -3,41 +3,41 @@
--Script by REIKAI
function c100417005.initial_effect(c)
--spsummon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(100417005,0))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_HAND)
e0:SetCountLimit(1,100417005)
e0:SetCost(c100417005.spcost)
e0:SetTarget(c100417005.sptg)
e0:SetOperation(c100417005.spop)
c:RegisterEffect(e0)
--Special Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100417005,1))
e1:SetDescription(aux.Stringid(100417005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,100417005+100)
e1:SetCost(c100417005.spcost1)
e1:SetTarget(c100417005.sptg1)
e1:SetOperation(c100417005.spop1)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100417005)
e1:SetCost(c100417005.spcost)
e1:SetTarget(c100417005.sptg)
e1:SetOperation(c100417005.spop)
c:RegisterEffect(e1)
--recover(battle)
--Special Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100417005,2))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCountLimit(1)
e2:SetCondition(aux.bdocon)
e2:SetTarget(c100417005.rctg)
e2:SetOperation(c100417005.rcop)
e2:SetDescription(aux.Stringid(100417005,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,100417005+100)
e2:SetCost(c100417005.spcost1)
e2:SetTarget(c100417005.sptg1)
e2:SetOperation(c100417005.spop1)
c:RegisterEffect(e2)
--recover(battle)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100417005,2))
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCountLimit(1)
e3:SetCondition(aux.bdocon)
e3:SetTarget(c100417005.rctg)
e3:SetOperation(c100417005.rcop)
c:RegisterEffect(e3)
end
function c100417005.rfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsSetCard(0x26f)
return Duel.GetMZoneCount(tp,c)>0 and c:IsSetCard(0x26f) and (c:IsFaceup() or c:IsControler(tp))
end
function c100417005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100417005.rfilter,1,nil,tp) end
......@@ -64,15 +64,16 @@ function c100417005.spfilter(c,e,tp)
end
function c100417005.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c100417005.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
and Duel.IsExistingMatchingCard(c100417005.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100417005.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
if tg:GetCount()>0 then
if Duel.SendtoGrave(tg,REASON_EFFECT)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100417005.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -37,7 +37,7 @@ function c100417006.initial_effect(c)
c:RegisterEffect(e3)
end
function c100417006.spfilter(c,tp)
return c:IsSetCard(0x26f) and (c:IsControler(tp) or c:IsFaceup())
return Duel.GetMZoneCount(tp,c)>0 and c:IsSetCard(0x26f) and (c:IsControler(tp) or c:IsFaceup())
end
function c100417006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100417006.spfilter,1,nil,tp) end
......
......@@ -66,12 +66,12 @@ end
function c100417007.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100417007.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100417007.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100417007.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100417007.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......
......@@ -37,7 +37,8 @@ function c100417008.thfilter(c)
end
function c100417008.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingMatchingCard(c100417008.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c100417008.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c100417008.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
......@@ -15,9 +15,9 @@ function c100417009.initial_effect(c)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100417009)
e2:SetCondition(c100417009.descon2)
e2:SetTarget(c100417009.destg2)
e2:SetOperation(c100417009.desop2)
e2:SetCondition(c100417009.descon)
e2:SetTarget(c100417009.destg)
e2:SetOperation(c100417009.desop)
c:RegisterEffect(e2)
--Cannot Break
local e3=Effect.CreateEffect(c)
......@@ -29,19 +29,19 @@ function c100417009.initial_effect(c)
e3:SetOperation(c100417009.limop)
c:RegisterEffect(e3)
end
function c100417009.descon2(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
if not ac:IsSetCard(0x26f) or not ac:IsControler(tp) then return false end
function c100417009.descon(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetBattleMonster(tp)
if not (ac and ac:IsFaceup() and ac:IsSetCard(0x26f)) then return false end
local bc=ac:GetBattleTarget()
e:SetLabelObject(bc)
return bc and bc:IsControler(1-tp) and bc:IsRelateToBattle()
end
function c100417009.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c100417009.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return bc end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end
function c100417009.desop2(e,tp,eg,ep,ev,re,r,rp)
function c100417009.desop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc and bc:IsControler(1-tp) and bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
......@@ -59,12 +59,14 @@ function c100417009.limop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100417009.cfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(100417009,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
......@@ -4,7 +4,6 @@
function c100417010.initial_effect(c)
--ACT
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
......@@ -35,13 +34,11 @@ function c100417010.acfilter(c,tp)
return c:IsSetCard(0x26f) and c:IsControler(tp) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function c100417010.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsExists(c100417010.acfilter,1,nil,tp) then return false end
return rp~=tp
return rp==1-tp and tg and tg:IsExists(c100417010.acfilter,1,nil,tp)
end
function c100417010.distg(e,tp,eg,ep,ev,re,r,rp,chk)
function c100417010.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......@@ -59,30 +56,31 @@ function c100417010.cfilter(c)
end
function c100417010.limcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_SZONE) and Duel.GetMatchingGroupCount(c100417010.cfilter,tp,LOCATION_MZONE,0,nil)>0
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_SZONE)
and Duel.GetMatchingGroupCount(c100417010.cfilter,tp,LOCATION_MZONE,0,nil)>0
end
function c100417010.limop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c100417010.cfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c100417010.tgval)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(c100417010.tgval)
e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c100417010.tgval)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100417010,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(c100417010.tgval)
e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2,true)
tc=g:GetNext()
end
end
......
......@@ -40,8 +40,9 @@ function c100417011.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
Duel.AdjustInstantly(tc)
if Duel.IsExistingMatchingCard(c100417011.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.Recover(tp,tc:GetTextAttack(),REASON_EFFECT)
Duel.Recover(tp,tc:GetBaseAttack(),REASON_EFFECT)
end
end
end
\ No newline at end of file
......@@ -14,17 +14,18 @@ function c100417012.initial_effect(c)
e1:SetOperation(c100417012.desop)
c:RegisterEffect(e1)
end
function c100417012.filter(c,tp)
return c:IsFacedown() or (c:IsFaceup() and Duel.IsExistingMatchingCard(c100417012.cfilter,tp,LOCATION_MZONE,0,1,nil))
function c100417012.filter(c,check)
return c:IsFacedown() or c:IsFaceup() and check
end
function c100417012.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x26f)
end
function c100417012.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c100417012.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c100417012.filter,tp,0,LOCATION_ONFIELD,1,nil,tp) end
local check=Duel.IsExistingMatchingCard(c100417012.cfilter,tp,LOCATION_MZONE,0,1,nil)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c100417012.filter(chkc,check) end
if chk==0 then return Duel.IsExistingTarget(c100417012.filter,tp,0,LOCATION_ONFIELD,1,nil,check) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c100417012.filter,tp,0,LOCATION_ONFIELD,1,1,nil,tp)
local g=Duel.SelectTarget(tp,c100417012.filter,tp,0,LOCATION_ONFIELD,1,1,nil,check)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100417012.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -28,15 +28,9 @@ function c100417013.initial_effect(c)
e2:SetOperation(c100417013.spop)
c:RegisterEffect(e2)
end
function c100417013.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417013.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x271)
end
function c100417013.cfilter1(c)
return c:IsFaceup() and c:IsCode(100417014)
end
function c100417013.effcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100417013.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
......@@ -45,17 +39,22 @@ function c100417013.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100417013.cfilter1(c)
return c:IsFaceup() and c:IsCode(100417014)
end
function c100417013.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(c100417013.cfilter1,tp,LOCATION_MZONE,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
and Duel.IsExistingMatchingCard(c100417013.cfilter1,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
end
end
function c100417013.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417013.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c100417013.filter,1,nil)
return rp==1-tp and eg:IsExists(c100417013.filter,1,nil)
end
function c100417013.spfilter(c,e,tp,mc)
return c:IsSetCard(0x271) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
......
......@@ -27,9 +27,6 @@ function c100417014.initial_effect(c)
e2:SetOperation(c100417014.spop)
c:RegisterEffect(e2)
end
function c100417014.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417014.effspfilter(c,e,tp)
return c:IsSetCard(0x271) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......@@ -46,13 +43,16 @@ function c100417014.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100417014.effspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(c100417014.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
and Duel.IsExistingMatchingCard(c100417014.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
end
end
function c100417014.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417014.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c100417014.filter,1,nil)
return rp==1-tp and eg:IsExists(c100417014.filter,1,nil)
end
function c100417014.spfilter(c,e,tp,mc)
return c:IsSetCard(0x271) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
......
......@@ -35,6 +35,7 @@ function c100417015.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100417015.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c100417015.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function c100417015.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -49,16 +50,16 @@ end
function c100417015.effop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(c100417015.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
and Duel.IsExistingMatchingCard(c100417015.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
end
end
function c100417015.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417015.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c100417015.filter,1,nil)
return rp==1-tp and eg:IsExists(c100417015.filter,1,nil)
end
function c100417015.spfilter(c,e,tp,mc)
return c:IsSetCard(0x271) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
......
......@@ -28,9 +28,6 @@ function c100417016.initial_effect(c)
e2:SetOperation(c100417016.spop)
c:RegisterEffect(e2)
end
function c100417016.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417016.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x271)
end
......@@ -49,13 +46,16 @@ end
function c100417016.effop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(c100417016.cfilter1,tp,LOCATION_MZONE,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
and Duel.IsExistingMatchingCard(c100417016.cfilter1,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
end
end
function c100417016.filter(c)
return c:IsPreviousLocation(LOCATION_GRAVE)
end
function c100417016.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(c100417016.filter,1,nil)
return rp==1-tp and eg:IsExists(c100417016.filter,1,nil)
end
function c100417016.spfilter(c,e,tp,mc)
return c:IsSetCard(0x271) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
......
......@@ -77,9 +77,9 @@ end
function c100417020.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100417020.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -9,7 +9,7 @@ function c100417021.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100417021+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(TIMING_MAIN_END)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c100417021.condition)
e1:SetCost(c100417021.cost)
e1:SetTarget(c100417021.target)
......
......@@ -9,6 +9,7 @@ function c100417022.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100417022+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c100417022.cost)
e1:SetCondition(c100417022.condition)
e1:SetTarget(c100417022.target)
......@@ -23,7 +24,7 @@ function c100417022.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100417022.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c100417022.cfilter(c,code)
......@@ -34,7 +35,7 @@ function c100417022.spfilter1(c,e,tp)
and Duel.IsExistingMatchingCard(c100417022.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c100417022.spfilter2(c,e,tp,mc,att)
function c100417022.spfilter2(c,e,tp,mc)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x271) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
and not Duel.IsExistingMatchingCard(c100417022.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
......@@ -47,11 +48,10 @@ function c100417022.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100417022.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100417022.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetAttribute())
local g=Duel.SelectMatchingCard(tp,c100417022.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
......
......@@ -11,7 +11,7 @@ function c100417023.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_FZONE)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100417023.eftg)
......@@ -49,11 +49,11 @@ end
function c100417023.efilter(e,re,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSummonLocation(LOCATION_GRAVE) and re:GetActivateLocation()==LOCATION_MZONE
end
function c100417023.cfilter(c,tp,sumt)
return c:IsFaceup() and c:IsSetCard(0x271) and c:IsSummonType(sumt) and c:IsSummonPlayer(tp)
function c100417023.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x271) and c:IsSummonType(SUMMON_TYPE_XYZ) and c:IsSummonPlayer(tp)
end
function c100417023.bancon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100417023.cfilter,1,nil,tp,SUMMON_TYPE_XYZ)
return eg:IsExists(c100417023.cfilter,1,nil,tp)
end
function c100417023.bantg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -15,16 +15,16 @@ function c100417024.initial_effect(c)
c:RegisterEffect(e1)
end
function c100417024.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c100417024.spfilter1(c,e,tp)
return c:IsSetCard(0x271) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c100417024.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
and Duel.IsExistingMatchingCard(c100417024.spfilter2,tp,LOCATION_DECK,0,1,c,e,tp,c)
end
function c100417024.spfilter2(c,e,tp,code)
function c100417024.spfilter2(c,e,tp,ec)
return c:IsSetCard(0x271) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and aux.IsCodeListed(c,code)
and aux.IsCodeListed(ec,c:GetCode())
end
function c100417024.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
......@@ -38,7 +38,7 @@ function c100417024.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c100417024.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g1==0 then return end
local g2=Duel.SelectMatchingCard(tp,c100417024.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1:GetFirst():GetCode())
local g2=Duel.SelectMatchingCard(tp,c100417024.spfilter2,tp,LOCATION_DECK,0,1,1,g1,e,tp,g1:GetFirst())
g1:Merge(g2)
local tc=g1:GetFirst()
while tc do
......
......@@ -20,8 +20,11 @@ function c100417025.chainfilter(re,tp,cid)
local rc=re:GetHandler()
return not (re:IsActiveType(TYPE_MONSTER) and rc:IsLocation(LOCATION_MZONE) and not rc:IsSummonType(SUMMON_TYPE_SPECIAL))
end
function c100417025.cfilter0(c)
return c:IsCode(100417125) and c:IsFaceup()
end
function c100417025.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,100417125)
return not Duel.IsExistingMatchingCard(c100417025.cfilter0,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100417025.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100417025,tp,ACTIVITY_CHAIN)==0 end
......@@ -29,7 +32,7 @@ function c100417025.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTargetRange(1,0)
e1:SetValue(c100417025.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
......@@ -42,7 +45,7 @@ function c100417025.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,100417125,0,TYPES_TOKEN_MONSTER,2000,2000,4,RACE_FAIRY,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function c100417025.cfilter(c)
return c:IsCode(100417029) and c:IsFaceup()
......
......@@ -25,7 +25,7 @@ function c100417026.initial_effect(c)
e2:SetTarget(c100417026.thtg)
e2:SetOperation(c100417026.thop)
c:RegisterEffect(e2)
--set
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100417026,2))
e3:SetType(EFFECT_TYPE_IGNITION)
......@@ -40,7 +40,7 @@ function c100417026.cfilter(c)
return c:IsCode(100417125) and c:IsFaceup()
end
function c100417026.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100417026.cfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingMatchingCard(c100417026.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100417026.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -51,7 +51,7 @@ function c100417026.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c100417026.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
......@@ -82,6 +82,11 @@ function c100417026.sop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c100417026.stfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
......@@ -50,7 +50,7 @@ function c100417027.cfilter(c)
return c:IsCode(100417125) and c:IsFaceup()
end
function c100417027.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100417027.cfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingMatchingCard(c100417027.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100417027.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -64,7 +64,7 @@ function c100417027.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c100417027.atkcon(e)
return not Duel.IsExistingMatchingCard(c100417027.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
return not Duel.IsExistingMatchingCard(c100417027.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c100417027.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,100417027)>0
......@@ -76,7 +76,6 @@ function c100417027.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100417027.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c100417027.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c100417027.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -36,7 +36,7 @@ end
function c100417028.spcon(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then return false end
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
or Duel.IsExistingMatchingCard(c100417028.cfilter,tp,LOCATION_MZONE,0,1,nil)
or Duel.IsExistingMatchingCard(c100417028.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100417028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -49,7 +49,7 @@ function c100417028.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c100417028.negcon(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c100417028.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
if not Duel.IsExistingMatchingCard(c100417028.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then return false end
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c100417028.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -57,6 +57,7 @@ function c100417029.thop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT)
......
......@@ -25,7 +25,6 @@ function c100417030.initial_effect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetValue(c100417030.atkval)
c:RegisterEffect(e3)
--grave to equip
......
......@@ -21,7 +21,7 @@ function c100417035.cfilter(c)
return c:IsCode(100417125) and c:IsFaceup()
end
function c100417035.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100417035.cfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingMatchingCard(c100417035.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100417035.tgfilter(c,tp)
return c:IsFaceup() and c:GetEquipCount()>0 and c:GetEquipGroup():IsExists(c100417035.cfilter2,1,nil)
......
......@@ -48,7 +48,7 @@ function c101105084.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c101105084.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lg,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101105084.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
e:SetLabel(g:GetFirst():GetRace())
end
function c101105084.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -17,7 +17,7 @@ function c101105086.initial_effect(c)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--When a monster your opponent controls activates its effect (Quick Effect): You can Tribute 1 Insect monster; destroy it.
--destroy chain
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
......
......@@ -39,7 +39,8 @@ end
function c101105087.tdfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c101105087.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c101105087.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0
and Duel.IsExistingTarget(c101105087.tdfilter1,tp,LOCATION_GRAVE,0,1,nil)
......@@ -49,7 +50,7 @@ function c101105087.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectTarget(tp,c101105087.tdfilter2,tp,0,LOCATION_GRAVE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101105087.spop(e,tp,eg,ep,ev,re,r,rp)
......@@ -63,15 +64,13 @@ function c101105087.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101105087.schfilter(c)
return c:IsSetCard(0x270) and c:IsType(TYPE_TRAP+TYPE_SPELL) and c:IsAbleToHand()
return c:IsSetCard(0x270) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c101105087.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101105087.schfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105087.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105087.schfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -34,7 +34,8 @@ function c101105090.filter(c,e,tp)
end
function c101105090.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101105090.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c101105090.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105090.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101105090.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......@@ -53,7 +54,7 @@ function c101105090.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c101105090.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:IsRace(RACE_INSECT)
and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:IsRace(RACE_INSECT)
end
function c101105090.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105090.cfilter,1,nil,tp)
......
......@@ -3,7 +3,7 @@
function c101105091.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,101105091)
......
......@@ -51,8 +51,7 @@ function c101107002.drfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c101107002.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101107002.drfilter,tp,LOCATION_MZONE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
local ct=Duel.GetMatchingGroupCount(c101107002.drfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
......@@ -61,11 +60,11 @@ function c101107002.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101107002.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c101107002.drfilter,p,LOCATION_MZONE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
local ct=Duel.GetMatchingGroupCount(c101107002.drfilter,p,LOCATION_MZONE,0,nil)
if ct>0 and Duel.Draw(p,ct,REASON_EFFECT)==ct then
local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if tg:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=tg:Select(p,ct,ct,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
......
......@@ -26,12 +26,11 @@ function c101107003.initial_effect(c)
c:RegisterEffect(e2)
end
function c101107003.cfilter(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and (c:IsRace(RACE_SPELLCASTER) or aux.IsCodeListed(c,46986414) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and Duel.GetMZoneCount(tp,c)>0
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost()
and (c:IsRace(RACE_SPELLCASTER) or aux.IsCodeListed(c,46986414) and c:IsType(TYPE_SPELL+TYPE_TRAP))
end
function c101107003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return
Duel.IsExistingMatchingCard(c101107003.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp)
end
if chk==0 then return Duel.IsExistingMatchingCard(c101107003.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101107003.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
......
......@@ -73,7 +73,8 @@ function c101107034.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101107034.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101107034.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
......
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