Commit e6846935 authored by mercury233's avatar mercury233

fix

parent e4750418
......@@ -7,7 +7,8 @@ function c101102000.initial_effect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101102000)
e1:SetCountLimit(1,101102000+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c101102000.condition)
e1:SetTarget(c101102000.target)
e1:SetOperation(c101102000.activate)
......
......@@ -9,14 +9,14 @@ function c101102081.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_DAMAGE)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c101102081.sumcon)
e1:SetTarget(c101102081.sumtg)
e1:SetOperation(c101102081.sumop)
c:RegisterEffect(e1)
end
function c101102081.sumcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_BATTLE)>0 and ep==tp
return Duel.GetTurnPlayer()==1-tp
end
function c101102081.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -27,7 +27,8 @@ function c101102081.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local opt=Duel.SelectOption(tp,aux.Stringid(101102081,0),aux.Stringid(101102081,1))
if opt==0 then
Duel.Recover(tp,ev,REASON_EFFECT)
......
......@@ -8,7 +8,7 @@ function c101102082.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101102082)
e1:SetCountLimit(1,101102082+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101102082.spcon)
c:RegisterEffect(e1)
--add atk
......@@ -16,7 +16,7 @@ function c101102082.initial_effect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(c101102082.tgcon)
e2:SetTarget(c101102082.tgtg)
e2:SetOperation(c101102082.tgop)
......@@ -27,17 +27,18 @@ function c101102082.spfilter(c)
end
function c101102082.spcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(c101102082.spfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,nil)
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101102082.spfilter,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil)
end
function c101102082.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101102082.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,tp,500)
end
function c101102082.tgop(e,tp,eg,ep,ev,re,r,rp)
......@@ -45,9 +46,7 @@ function c101102082.tgop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
......
......@@ -15,9 +15,9 @@ function c101102083.initial_effect(c)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetDescription(aux.Stringid(101102083,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101102083)
e2:SetTarget(c101102083.target)
......
......@@ -28,7 +28,7 @@ function c101102084.initial_effect(c)
c:RegisterEffect(e3)
end
function c101102084.thfilter(c)
return c:IsSetCard(0x258) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:GetCode()~=101102084
return c:IsSetCard(0x258) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(101102084)
end
function c101102084.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101102084.thfilter,tp,LOCATION_DECK,0,1,nil) end
......@@ -48,13 +48,13 @@ end
function c101102084.spcostexcheck(c,e,tp)
local result=false
if c:IsType(TYPE_MONSTER) then
result=result or Duel.IsExistingMatchingCard(c101102084.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,101102087)
result=result or Duel.IsExistingMatchingCard(c101102084.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,101102087)
end
if c:IsType(TYPE_SPELL) then
result=result or Duel.IsExistingMatchingCard(c101102084.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,101102088)
result=result or Duel.IsExistingMatchingCard(c101102084.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,101102088)
end
if c:IsType(TYPE_TRAP) then
result=result or Duel.IsExistingMatchingCard(c101102084.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,101102089)
result=result or Duel.IsExistingMatchingCard(c101102084.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,101102089)
end
return result
end
......@@ -66,11 +66,11 @@ function c101102084.spcostfilter(c,e,tp,tc)
end
function c101102084.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
e:SetLabel(1)
e:SetLabel(100)
return Duel.IsExistingMatchingCard(c101102084.spcostfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler(),e,tp,e:GetHandler())
and e:GetHandler():IsReleasable()
end
Duel.Release(e:GetHandler(),REASON_COST+REASON_RELEASE)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cost=Duel.SelectMatchingCard(tp,c101102084.spcostfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler(),e,tp,e:GetHandler()):GetFirst()
e:SetLabel(cost:GetType())
......@@ -78,12 +78,9 @@ function c101102084.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101102084.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local label=e:GetLabel()
if label>0 then
e:SetLabel(0)
return true
end
return false
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return true
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......@@ -93,8 +90,8 @@ function c101102084.spopfilter(c,e,tp,typ)
or ((typ & TYPE_TRAP)>0 and c:IsCode(101102089)))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101102084.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local typ = e:GetLabel()
function c101102084.spop(e,tp,eg,ep,ev,re,r,rp)
local typ=e:GetLabel()
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101102084.spopfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp,typ)
......
......@@ -28,7 +28,7 @@ function c101102085.initial_effect(c)
c:RegisterEffect(e3)
end
function c101102085.thfilter(c)
return c:IsSetCard(0x258) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() and c:GetCode()~=101102085
return c:IsSetCard(0x258) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c101102085.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101102085.thfilter,tp,LOCATION_DECK,0,1,nil) end
......@@ -48,13 +48,13 @@ end
function c101102085.spcostexcheck(c,e,tp)
local result=false
if c:IsType(TYPE_MONSTER) then
result=result or Duel.IsExistingMatchingCard(c101102085.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,101102087)
result=result or Duel.IsExistingMatchingCard(c101102085.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,101102087)
end
if c:IsType(TYPE_SPELL) then
result=result or Duel.IsExistingMatchingCard(c101102085.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,101102088)
result=result or Duel.IsExistingMatchingCard(c101102085.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,101102088)
end
if c:IsType(TYPE_TRAP) then
result=result or Duel.IsExistingMatchingCard(c101102085.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,101102089)
result=result or Duel.IsExistingMatchingCard(c101102085.spcostexcheckfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,101102089)
end
return result
end
......@@ -66,11 +66,11 @@ function c101102085.spcostfilter(c,e,tp,tc)
end
function c101102085.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
e:SetLabel(1)
e:SetLabel(100)
return Duel.IsExistingMatchingCard(c101102085.spcostfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler(),e,tp,e:GetHandler())
and e:GetHandler():IsReleasable()
end
Duel.Release(e:GetHandler(),REASON_COST+REASON_RELEASE)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cost=Duel.SelectMatchingCard(tp,c101102085.spcostfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler(),e,tp,e:GetHandler()):GetFirst()
e:SetLabel(cost:GetType())
......@@ -78,12 +78,9 @@ function c101102085.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101102085.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local label=e:GetLabel()
if label>0 then
e:SetLabel(0)
return true
end
return false
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return true
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......@@ -93,8 +90,8 @@ function c101102085.spopfilter(c,e,tp,typ)
or ((typ & TYPE_TRAP)>0 and c:IsCode(101102089)))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101102085.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local typ = e:GetLabel()
function c101102085.spop(e,tp,eg,ep,ev,re,r,rp)
local typ=e:GetLabel()
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101102085.spopfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp,typ)
......
......@@ -47,16 +47,18 @@ end
function c101102086.sp2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c101102086.sp2costfilter(c)
function c101102086.sp2costfilter(c,tp,tc)
local tg=Group.FromCards(c,tc)
return c:IsAbleToRemoveAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
and Duel.GetMZoneCount(tp,tg)>0
end
function c101102086.sp2cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable()
and Duel.IsExistingMatchingCard(c101102086.sp2costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) end
Duel.Release(c,REASON_COST+REASON_RELEASE)
and Duel.IsExistingMatchingCard(c101102086.sp2costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c,tp,c) end
Duel.Release(c,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cost=Duel.SelectMatchingCard(tp,c101102086.sp2costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c)
local cost=Duel.SelectMatchingCard(tp,c101102086.sp2costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c,tp,c)
Duel.Remove(cost,POS_FACEUP,REASON_COST)
end
function c101102086.sp2tgfilter(c,e,tp)
......@@ -64,12 +66,12 @@ function c101102086.sp2tgfilter(c,e,tp)
and c:IsSetCard(0x258) and c:IsLevel(8) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c101102086.sp2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c101102086.sp2tgfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c101102086.sp2tgfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c101102086.sp2op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101102086.sp2tgfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101102086.sp2tgfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
end
\ No newline at end of file
......@@ -46,7 +46,7 @@ function c101102087.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x258)
end
function c101102087.ctval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and (re:GetActiveType() & TYPE_MONSTER)>0
return aux.tgoval(e,re,rp) and re:IsActiveType(TYPE_MONSTER)
end
function c101102087.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp
......@@ -82,12 +82,11 @@ function c101102087.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c101102087.thtgfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101102087.thtgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101102087.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
......@@ -22,6 +22,7 @@ function c101102088.initial_effect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetCode(EVENT_CHAINING)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101102088)
e3:SetCondition(c101102088.drcon)
......@@ -45,11 +46,11 @@ function c101102088.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x258)
end
function c101102088.ctval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and (re:GetActiveType() & TYPE_SPELL)>0
return aux.tgoval(e,re,rp) and re:IsActiveType(TYPE_SPELL)
end
function c101102088.drcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev)
and re:IsActiveType(TYPE_TRAP)
end
function c101102088.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
......@@ -72,19 +73,18 @@ function c101102088.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and c:GetPreviousControler()==tp
end
function c101102088.thtgfilter(c)
return c:IsSetCard(0x258) and c:IsType(TYPE_TRAP) and c:IsAbleToHand() and c:IsFaceup()
return c:IsSetCard(0x258) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsFaceup()
end
function c101102088.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101102088.thtgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101102088.thtgfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101102088.thtgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101102088.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
......@@ -22,6 +22,7 @@ function c101102089.initial_effect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetCode(EVENT_CHAINING)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101102089)
e3:SetCondition(c101102089.rmcon)
......@@ -45,20 +46,17 @@ function c101102089.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x258)
end
function c101102089.ctval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and (re:GetActiveType() & TYPE_MONSTER)>0
return aux.tgoval(e,re,rp) and re:IsActiveType(TYPE_TRAP)
end
function c101102089.rmcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and re:IsActiveType(TYPE_MONSTER)
end
function c101102089.cfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c101102089.rmcostfilter2(c,e)
function c101102089.rmtgfilter(c,e)
return c:IsAbleToRemove() and c:IsCanBeEffectTarget(e)
end
function c101102089.rmcostfilter(c,e,tp)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c101102089.rmcostfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,e)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c101102089.rmtgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,e)
end
function c101102089.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101102089.rmcostfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,e,tp) end
......@@ -66,11 +64,12 @@ function c101102089.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c101102089.rmcostfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,e,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101102089.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c101102089.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c101102089.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -83,19 +82,18 @@ function c101102089.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and c:GetPreviousControler()==tp
end
function c101102089.thtgfilter(c)
return c:IsSetCard(0x258) and c:IsType(TYPE_TRAP) and c:IsAbleToHand() and c:IsFaceup()
return c:IsSetCard(0x258) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() and c:IsFaceup()
end
function c101102089.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101102089.thtgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101102089.thtgfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101102089.thtgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101102089.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
......@@ -11,7 +11,7 @@ function c101102090.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)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101102090)
e1:SetCondition(c101102090.descon)
e1:SetTarget(c101102090.destg)
......@@ -46,15 +46,16 @@ end
function c101102090.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c101102090.destg(e,tp,eg,ep,ev,re,r,rp,chk)
function c101102090.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTORY)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101102090.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -91,10 +92,9 @@ function c101102090.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function c101102090.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101102090.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
......@@ -39,13 +39,15 @@ function c101102091.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and Duel.IsChainNegatable(ev)
end
function c101102091.cfilter(c,re)
function c101102091.cfilter(c,rtype)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsAbleToRemoveAsCost()
and c:IsType(re:GetActiveType()) and c:IsSetCard(0x258)
and (not c:IsOnField() or c:IsFaceup())
and c:IsType(rtype) and c:IsSetCard(0x258)
end
function c101102091.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101102091.cfilter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,re) end
local g=Duel.SelectMatchingCard(tp,c101102091.cfilter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,re)
local rtype=re:GetActiveType()&0x7
if chk==0 then return Duel.IsExistingMatchingCard(c101102091.cfilter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,rtype) end
local g=Duel.SelectMatchingCard(tp,c101102091.cfilter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,rtype)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101102091.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -69,11 +71,13 @@ function c101102091.thfilter(c,typ)
return c:IsAbleToHand() and c:IsSetCard(0x258) and c:IsFaceup()
end
function c101102091.gcheck(g)
return g:GetClassCount(Card.GetType)==#g
return g:FilterCount(Card.IsType,nil,TYPE_MONSTER)<=1
and g:FilterCount(Card.IsType,nil,TYPE_SPELL)<=1
and g:FilterCount(Card.IsType,nil,TYPE_TRAP)<=1
end
function c101102091.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101102091.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,3,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function c101102091.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101102091.thfilter,tp,LOCATION_REMOVED,0,nil)
......@@ -82,7 +86,6 @@ function c101102091.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=g:SelectSubGroup(tp,c101102091.gcheck,false,1,3)
if sg then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
......@@ -30,13 +30,6 @@ function c101102092.initial_effect(c)
e3:SetOperation(c101102092.drop)
c:RegisterEffect(e3)
end
function c101102092.atkvalfilter(c)
return c:IsFaceup() and c:IsSetCard(0x258)
end
function c101102092.atkval(e,c)
local tp=e:GetHandler():GetControler()
return Duel.GetMatchingGroupCount(c101102092.atkvalfilter,tp,LOCATION_REMOVED,0,nil)*100
end
function c101102092.spfilter(c,e,tp)
return c:IsSetCard(0x258) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
end
......@@ -50,12 +43,20 @@ function c101102092.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101102092.atkvalfilter(c)
return c:IsFaceup() and c:IsSetCard(0x258)
end
function c101102092.atkval(e,c)
local tp=e:GetHandler():GetControler()
local g=Duel.GetMatchingGroup(c101102092.atkvalfilter,tp,LOCATION_REMOVED,0,nil)
return g:GetClassCount(Card.GetCode)*100
end
function c101102092.drtgfilter(c)
return c:IsAbleToDeck() and c:IsSetCard(0x258) and c:IsType(TYPE_MONSTER)
end
function c101102092.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(c101102092.drtgfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101102092.drop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -11,10 +11,7 @@ function c101102093.initial_effect(c)
e1:SetTarget(c101102093.target)
e1:SetOperation(c101102093.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(101102093,ACTIVITY_CHAIN,c101102093.chainfilter)
end
function c101102093.chainfilter(re,tp,cid)
return false
Duel.AddCustomActivityCounter(101102093,ACTIVITY_CHAIN,aux.FALSE)
end
function c101102093.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
......@@ -26,7 +23,6 @@ function c101102093.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x258) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101102093.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1 and sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1
end
......
......@@ -32,7 +32,7 @@ function c101102094.initial_effect(c)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101102094,1))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -89,16 +89,19 @@ function c101102094.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local tc=e:GetHandler():GetEquipTarget()
e:SetLabelObject(tc)
return tc and tc:IsAbleToGrave() and Duel.IsExistingMatchingCard(c101102094.sptgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,tc:GetOriginalAttribute())
return tc and tc:IsAbleToGrave() and Duel.GetMZoneCount(tp,tc)>0
and Duel.IsExistingMatchingCard(c101102094.sptgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,tc:GetOriginalAttribute())
end
local tc=e:GetLabelObject()
tc:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101102094.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) then return end
if Duel.SendtoGrave(tc,REASON_EFFECT)>0 then
if Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101102094.sptgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,tc:GetOriginalAttribute())
if #g>0 then
......
......@@ -10,6 +10,7 @@ function c101102095.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101102095+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c101102095.target)
e1:SetOperation(c101102095.activate)
c:RegisterEffect(e1)
......@@ -19,7 +20,6 @@ function c101102095.initial_effect(c)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,101102095+EFFECT_COUNT_CODE_OATH)
e2:SetOperation(c101102095.activate)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
......@@ -52,12 +52,11 @@ function c101102095.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101102095.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) then return end
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101102095.tgfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101102095.tgfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT) then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -74,12 +73,11 @@ function c101102095.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101102095.drcon(e,tp,eg,ep,ev,re,r,rp)
local ec=Duel.GetAttacker()
local bc=ec:GetBattleTarget()
return ec:IsSetCard(0x258) and ec:IsControler(tp) and bc:IsControler(1-tp)
local ec,bc=Duel.GetBattleMonster(tp)
return bc and ec:IsSetCard(0x258) and ec:IsLevelAbove(8)
end
function c101102095.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......
......@@ -5,9 +5,9 @@ function c101102096.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101102096+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetOperation(c101102096.activate)
c:RegisterEffect(e1)
--destroy replace
......@@ -20,9 +20,9 @@ function c101102096.initial_effect(c)
e2:SetOperation(c101102096.repop)
c:RegisterEffect(e2)
end
function c101102096.filter(c,e,tp,zone)
function c101102096.filter(c,e,tp,check)
return c:IsSetCard(0x258) and c:IsLevelBelow(4)
and ((zone and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) or c:IsAbleToHand())
and ((check and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) or c:IsAbleToHand())
end
function c101102096.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101102096.filter,tp,LOCATION_DECK,0,nil,Duel.GetMZoneCount(tp)>0)
......@@ -39,6 +39,7 @@ function c101102096.activate(e,tp,eg,ep,ev,re,r,rp)
end
if opt==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -49,12 +50,13 @@ function c101102096.repfilter(c,tp)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c101102096.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c101102096.repfilter,1,nil,tp) end
if chk==0 then return e:GetHandler():IsAbleToRemove() and not e:GetHandler():IsStatus(STATUS_DESTROY_CONFIRMED)
and eg:IsExists(c101102096.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c101102096.repval(e,c)
return c101102096.repfilter(c,e:GetHandlerPlayer())
end
function c101102096.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
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