Commit 9bb5b402 authored by DailyShana's avatar DailyShana

fix (45/45)

parent 92679e23
...@@ -11,6 +11,7 @@ function c15610297.initial_effect(c) ...@@ -11,6 +11,7 @@ function c15610297.initial_effect(c)
--battle --battle
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15610297,0)) e2:SetDescription(aux.Stringid(15610297,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetTarget(c15610297.distg) e2:SetTarget(c15610297.distg)
......
...@@ -29,7 +29,7 @@ end ...@@ -29,7 +29,7 @@ end
function c16832845.checkop(e,tp,eg,ep,ev,re,r,rp) function c16832845.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
while tc do while tc do
if tc:IsLevelAbove(7) and tc:IsPreviousLocation(LOCATION_MZONE) then if tc:GetOriginalLevel()>=7 and tc:IsPreviousLocation(LOCATION_MZONE) then
c16832845[tc:GetPreviousControler()]=true c16832845[tc:GetPreviousControler()]=true
end end
tc=eg:GetNext() tc=eg:GetNext()
...@@ -48,10 +48,17 @@ end ...@@ -48,10 +48,17 @@ end
function c16832845.target(e,tp,eg,ep,ev,re,r,rp,chk) function c16832845.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g:FilterCount(Card.IsControler,nil,1-tp)==0 then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),tp,LOCATION_GRAVE)
elseif g:FilterCount(Card.IsControler,nil,tp)==0 then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE)
else
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),PLAYER_ALL,LOCATION_GRAVE)
end
end end
function c16832845.spfilter(c,e,tp) function c16832845.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsLocation(LOCATION_REMOVED) and c:GetLevel()>0
end end
function c16832845.activate(e,tp,eg,ep,ev,re,r,rp) function c16832845.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
......
...@@ -11,7 +11,7 @@ function c30270176.initial_effect(c) ...@@ -11,7 +11,7 @@ function c30270176.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(c30270176.spcon) e2:SetCondition(c30270176.spcon)
e2:SetOperation(c30270176.spop) e2:SetOperation(c30270176.spop)
......
--方界波動 --方界波動
function c35058588.initial_effect(c) function c35058588.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35058588,0)) e1:SetDescription(aux.Stringid(35058588,0))
e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetCategory(CATEGORY_ATKCHANGE)
...@@ -12,6 +13,7 @@ function c35058588.initial_effect(c) ...@@ -12,6 +13,7 @@ function c35058588.initial_effect(c)
--add counter --add counter
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35058588,1)) e2:SetDescription(aux.Stringid(35058588,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
...@@ -46,6 +48,7 @@ function c35058588.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,6 +48,7 @@ function c35058588.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if hc:IsFaceup() and hc:IsRelateToEffect(e) then if hc:IsFaceup() and hc:IsRelateToEffect(e) then
Duel.BreakEffect()
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL) e2:SetCode(EFFECT_SET_ATTACK_FINAL)
...@@ -61,32 +64,37 @@ end ...@@ -61,32 +64,37 @@ end
function c35058588.tgfilter(c,e) function c35058588.tgfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e) return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end end
function c35058588.countertg(e,tp,eg,ep,ev,re,r,rp,chk) function c35058588.countertg(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:IsFaceup() end
local tg=Duel.GetMatchingGroup(c35058588.tgfilter,tp,0,LOCATION_MZONE,nil,e) local tg=Duel.GetMatchingGroup(c35058588.tgfilter,tp,0,LOCATION_MZONE,nil,e)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and tg:GetCount()>0 if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and tg:GetCount()>0
and Duel.IsExistingMatchingCard(c35058588.cfilter,tp,LOCATION_GRAVE,0,1,nil) end and Duel.IsExistingMatchingCard(c35058588.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c35058588.cfilter,tp,LOCATION_GRAVE,0,1,tg:GetCount(),nil) local g=Duel.SelectMatchingCard(tp,c35058588.cfilter,tp,LOCATION_GRAVE,0,1,tg:GetCount(),nil)
local ct=g:GetCount()
g:AddCard(e:GetHandler()) g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SelectTarget(tp,c35058588.tgfilter,tp,0,LOCATION_MZONE,g:GetCount(),g:GetCount(),nil,e) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=tg:Select(tp,ct,ct,nil)
Duel.SetTargetCard(sg)
end end
function c35058588.counterop(e,tp,eg,ep,ev,re,r,rp) function c35058588.counterop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
if tc:IsRelateToEffect(e) then
tc:AddCounter(0x1038,1) tc:AddCounter(0x1038,1)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetCondition(c15610297.condition) e1:SetCondition(c35058588.disable)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE) e2:SetCode(EFFECT_DISABLE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end
tc=g:GetNext() tc=g:GetNext()
end end
end end
function c35058588.disable(e)
return e:GetHandler():GetCounter(0x1038)>0
end
...@@ -30,7 +30,7 @@ function c3775068.initial_effect(c) ...@@ -30,7 +30,7 @@ function c3775068.initial_effect(c)
--special summon --special summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(3775068,1)) e4:SetDescription(aux.Stringid(3775068,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
...@@ -40,13 +40,13 @@ function c3775068.initial_effect(c) ...@@ -40,13 +40,13 @@ function c3775068.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c3775068.spcfilter(c) function c3775068.spcfilter(c)
return c:IsSetCard(0xe3) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsSetCard(0xe3) and c:IsAbleToGraveAsCost()
end end
function c3775068.sprcon(e,c) function c3775068.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c3775068.spcfilter,tp,LOCATION_MZONE,0,3,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
and Duel.GetLocationCount(tp,LOCATION_MZONE)>-3 and Duel.IsExistingMatchingCard(c3775068.spcfilter,tp,LOCATION_MZONE,0,3,nil)
end end
function c3775068.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c3775068.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
...@@ -103,15 +103,17 @@ function c3775068.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,15 +103,17 @@ function c3775068.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil) g=g:Select(tp,ft,ft,nil)
end end
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.IsExistingMatchingCard(c3775068.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) local sg=Duel.GetMatchingGroup(c3775068.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
and Duel.SelectYesNo(tp,aux.Stringid(3775068,2)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(3775068,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c3775068.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) sg=sg:Select(tp,1,1,nil)
if sg:GetCount()>0 and not sg:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then if not sg:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then
Duel.BreakEffect()
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
end end
end end
end
end end
--方界帝ゲイラ・ガイル --方界帝ゲイラ・ガイル
function c40392714.initial_effect(c) function c40392714.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--spsummon rule --spsummon rule
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(c40392714.spcon) e2:SetCondition(c40392714.spcon)
e2:SetOperation(c40392714.spop) e2:SetOperation(c40392714.spop)
...@@ -20,7 +14,7 @@ function c40392714.initial_effect(c) ...@@ -20,7 +14,7 @@ function c40392714.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY) e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c40392714.damcon) e3:SetCondition(c40392714.damcon)
e3:SetTarget(c40392714.damtg) e3:SetTarget(c40392714.damtg)
...@@ -28,7 +22,7 @@ function c40392714.initial_effect(c) ...@@ -28,7 +22,7 @@ function c40392714.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--special summon --special summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -41,7 +35,8 @@ function c40392714.filter(c) ...@@ -41,7 +35,8 @@ function c40392714.filter(c)
end end
function c40392714.spcon(e,c) function c40392714.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c40392714.filter,c:GetControler(),LOCATION_MZONE,0,1,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c40392714.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function c40392714.spop(e,tp,eg,ep,ev,re,r,rp,c) function c40392714.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c40392714.filter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c40392714.filter,tp,LOCATION_MZONE,0,1,1,nil)
...@@ -72,12 +67,11 @@ end ...@@ -72,12 +67,11 @@ end
function c40392714.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c40392714.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c40392714.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c40392714.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and c:IsRelateToBattle()
and Duel.IsExistingTarget(c40392714.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingTarget(c40392714.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and c:IsAbleToGrave() and not c:IsLocation(LOCATION_GRAVE) end
local ft=2 local ft=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)) ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40392714.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) local g=Duel.SelectTarget(tp,c40392714.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
...@@ -96,12 +90,14 @@ function c40392714.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,12 +90,14 @@ function c40392714.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil) sg=sg:Select(tp,ft,ft,nil)
end end
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.IsExistingMatchingCard(c40392714.thfilter,tp,LOCATION_DECK,0,1,nil) local g=Duel.GetMatchingGroup(c40392714.thfilter,tp,LOCATION_DECK,0,nil)
and Duel.SelectYesNo(tp,aux.Stringid(40392714,0)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(40392714,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c40392714.thfilter,tp,LOCATION_DECK,0,1,1,nil) g=g:Select(tp,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT) Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end
end end
--方界獣ダーク・ガネックス --方界獣ダーク・ガネックス
function c41114306.initial_effect(c) function c41114306.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(c41114306.spcon) e2:SetCondition(c41114306.spcon)
e2:SetOperation(c41114306.spop) e2:SetOperation(c41114306.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon --special summon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING) e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -32,7 +26,8 @@ function c41114306.filter(c) ...@@ -32,7 +26,8 @@ function c41114306.filter(c)
end end
function c41114306.spcon(e,c) function c41114306.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c41114306.filter,c:GetControler(),LOCATION_MZONE,0,1,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c41114306.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end end
function c41114306.spop(e,tp,eg,ep,ev,re,r,rp,c) function c41114306.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c41114306.filter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c41114306.filter,tp,LOCATION_MZONE,0,1,1,nil)
...@@ -50,11 +45,10 @@ end ...@@ -50,11 +45,10 @@ end
function c41114306.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c41114306.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c41114306.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c41114306.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsAbleToGrave()
and Duel.IsExistingTarget(c41114306.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c41114306.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=2 local ft=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)) ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c41114306.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) local g=Duel.SelectTarget(tp,c41114306.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
...@@ -73,12 +67,14 @@ function c41114306.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,12 +67,14 @@ function c41114306.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil) sg=sg:Select(tp,ft,ft,nil)
end end
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.IsExistingMatchingCard(c41114306.thfilter,tp,LOCATION_DECK,0,1,nil) local g=Duel.GetMatchingGroup(c41114306.thfilter,tp,LOCATION_DECK,0,nil)
and Duel.SelectYesNo(tp,aux.Stringid(41114306,0)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(41114306,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c41114306.thfilter,tp,LOCATION_DECK,0,1,1,nil) g=g:Select(tp,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT) Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end
end end
...@@ -42,26 +42,37 @@ function c42237854.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -42,26 +42,37 @@ function c42237854.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,g:GetCount(),0,0)
end end
function c42237854.tgfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function c42237854.activate(e,tp,eg,ep,ev,re,r,rp) function c42237854.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsFaceup,nil)
local tg0=g:Filter(Card.IsRelateToEffect,nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,42237854,0,0x21,0,0,4,RACE_MACHINE,ATTRIBUTE_EARTH) then return end or not Duel.IsPlayerCanSpecialSummonMonster(tp,42237854,0,0x21,0,0,4,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
c:AddMonsterAttribute(0,0,0,0,0) c:AddMonsterAttribute(0,0,0,0,0)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c42237854.atkval)
c:RegisterEffect(e1)
c:TrapMonsterComplete(TYPE_EFFECT) c:TrapMonsterComplete(TYPE_EFFECT)
if tg0:GetCount()<=0 or ft<=0 then return end Duel.SpecialSummonComplete()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c42237854.tgfilter,nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if g:GetCount()<=0 or ft<=0 then return end
local tg=nil local tg=nil
if ft<tg0:GetCount() then if ft<g:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
tg=tg0:FilterSelect(tp,c42237854.filter,ft,ft,nil) tg=g:FilterSelect(tp,c42237854.filter,ft,ft,nil)
else else
tg=tg0:Clone() tg=g:Clone()
end end
if tg:GetCount()>0 then if tg:GetCount()>0 then
Duel.BreakEffect()
local tc=tg:GetFirst() local tc=tg:GetFirst()
while tc do while tc do
local atk=tc:GetTextAttack() local atk=tc:GetTextAttack()
...@@ -70,24 +81,26 @@ function c42237854.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,24 +81,26 @@ function c42237854.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c42237854.eqlimit) e1:SetValue(c42237854.eqlimit)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(atk)
tc:RegisterEffect(e2)
end
tc=tg:GetNext() tc=tg:GetNext()
end end
Duel.EquipComplete() Duel.EquipComplete()
end end
Duel.SpecialSummonComplete() end
function c42237854.atkval(e,c)
local atk=0
local g=c:GetEquipGroup()
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(42237854)~=0 and tc:GetAttack()>=0 then
atk=atk+tc:GetAttack()
end
tc=g:GetNext()
end
return atk
end end
function c42237854.eqlimit(e,c) function c42237854.eqlimit(e,c)
return e:GetOwner()==c return e:GetOwner()==c
......
...@@ -33,39 +33,39 @@ function c43959432.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,39 +33,39 @@ function c43959432.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
c:TrapMonsterComplete(TYPE_EFFECT) c:TrapMonsterComplete(TYPE_EFFECT)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE_STEP_END) e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(c43959432.poscon) e1:SetCondition(c43959432.poscon)
e1:SetOperation(c43959432.posop) e1:SetOperation(c43959432.posop)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true) c:RegisterEffect(e1,true)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
if not Duel.Equip(tp,tc,c,false) then return end
e:SetLabelObject(tc)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c43959432.atkval)
e2:SetReset(RESET_EVENT+0x1fe0000) e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(c43959432.eqlimit) c:RegisterEffect(e2,true)
tc:RegisterEffect(e2,true) local e3=e2:Clone()
if atk>0 then e3:SetCode(EFFECT_UPDATE_DEFENCE)
local e3=Effect.CreateEffect(c) c:RegisterEffect(e3,true)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetValue(atk)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e4)
end
end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.BreakEffect()
if not Duel.Equip(tp,tc,c,false) then return end
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetReset(RESET_EVENT+0x1fe0000)
e4:SetValue(c43959432.eqlimit)
tc:RegisterEffect(e4,true)
e2:SetLabelObject(tc)
e3:SetLabelObject(tc)
end
end end
function c43959432.poscon(e,tp,eg,ep,ev,re,r,rp) function c43959432.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle() return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
...@@ -76,6 +76,13 @@ function c43959432.posop(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,6 +76,13 @@ function c43959432.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(c,POS_FACEUP_DEFENCE) Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end end
end end
function c43959432.atkval(e,c)
local tc=e:GetLabelObject()
if not tc or tc:GetEquipTarget()~=c then return 0 end
local atk=tc:GetAttack()
if atk<0 then atk=0 end
return atk
end
function c43959432.eqlimit(e,c) function c43959432.eqlimit(e,c)
return e:GetOwner()==c return e:GetOwner()==c
end end
...@@ -11,7 +11,7 @@ function c4998619.initial_effect(c) ...@@ -11,7 +11,7 @@ function c4998619.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(c4998619.spcon) e2:SetCondition(c4998619.spcon)
e2:SetOperation(c4998619.spop) e2:SetOperation(c4998619.spop)
...@@ -24,7 +24,7 @@ function c4998619.initial_effect(c) ...@@ -24,7 +24,7 @@ function c4998619.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--Special Summon --Special Summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
...@@ -38,7 +38,8 @@ function c4998619.filter(c) ...@@ -38,7 +38,8 @@ function c4998619.filter(c)
end end
function c4998619.spcon(e,c) function c4998619.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c4998619.filter,c:GetControler(),LOCATION_MZONE,0,3,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c4998619.filter,c:GetControler(),LOCATION_MZONE,0,3,nil)
end end
function c4998619.spop(e,tp,eg,ep,ev,re,r,rp,c) function c4998619.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c4998619.filter,tp,LOCATION_MZONE,0,3,3,nil) local g=Duel.SelectMatchingCard(tp,c4998619.filter,tp,LOCATION_MZONE,0,3,3,nil)
...@@ -79,15 +80,17 @@ function c4998619.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,15 +80,17 @@ function c4998619.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil) g=g:Select(tp,ft,ft,nil)
end end
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.IsExistingMatchingCard(c4998619.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) local sg=Duel.GetMatchingGroup(c4998619.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
and Duel.SelectYesNo(tp,aux.Stringid(4998619,0)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(4998619,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c4998619.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) sg=sg:Select(tp,1,1,nil)
if sg:GetCount()>0 and not sg:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then if not sg:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then
Duel.BreakEffect()
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
end end
end end
end
end end
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
function c71442223.initial_effect(c) function c71442223.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -30,29 +31,34 @@ end ...@@ -30,29 +31,34 @@ end
function c71442223.activate(e,tp,eg,ep,ev,re,r,rp) function c71442223.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if tc:IsRelateToEffect(e) and ft>0 then
if Duel.IsPlayerAffectedByEffect(1-tp,59822133) then ft=1 end
local tg=Group.FromCards(tc) local tg=Group.FromCards(tc)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c71442223.spfilter2,1-tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,1-tp,tc) local g=Duel.GetMatchingGroup(c71442223.spfilter2,1-tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,1-tp,tc)
if not g:IsExists(Card.IsHasEffect,1,nil,EFFECT_NECRO_VALLEY) then if g:IsExists(Card.IsHasEffect,1,nil,EFFECT_NECRO_VALLEY) then return end
if g:GetCount()<=ft then if ft>0 and g:GetCount()>0 then
c71442223.spsummon(g,1-tp) if Duel.IsPlayerAffectedByEffect(1-tp,59822133) then ft=1 end
tg:Merge(g) local sg=g:Clone()
else if g:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local fg=g:Select(1-tp,ft,ft,nil) sg=g:Select(1-tp,ft,ft,nil)
c71442223.spsummon(fg,1-tp)
tg:Merge(fg)
g:Remove(Card.IsLocation,nil,LOCATION_MZONE+LOCATION_GRAVE) g:Remove(Card.IsLocation,nil,LOCATION_MZONE+LOCATION_GRAVE)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
local sc=tg:GetFirst() local sc=sg:GetFirst()
while sc do while sc do
c71442223.counter(sc,c) Duel.SpecialSummonStep(sc,0,1-tp,1-tp,false,false,POS_FACEUP_ATTACK)
sc=tg:GetNext() sc=sg:GetNext()
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
tg:Merge(og)
end
local tc=tg:GetFirst()
while tc do
c71442223.counter(tc,c)
tc=tg:GetNext()
end
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c71442223.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g2=Duel.SelectMatchingCard(tp,c71442223.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
...@@ -60,14 +66,9 @@ function c71442223.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,14 +66,9 @@ function c71442223.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g2,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(g2,0,tp,tp,true,false,POS_FACEUP)
end end
end end
end
end end
function c71442223.spsummon(g,p) function c71442223.disable(e)
local sc=g:GetFirst() return e:GetHandler():GetCounter(0x1038)>0
while sc do
Duel.SpecialSummonStep(sc,0,p,p,false,false,POS_FACEUP_ATTACK)
sc=g:GetNext()
end
end end
function c71442223.counter(tc,ec) function c71442223.counter(tc,ec)
local e1=Effect.CreateEffect(ec) local e1=Effect.CreateEffect(ec)
...@@ -78,14 +79,12 @@ function c71442223.counter(tc,ec) ...@@ -78,14 +79,12 @@ function c71442223.counter(tc,ec)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
-- --
tc:AddCounter(0x1038,1) tc:AddCounter(0x1038,1)
--
local e2=Effect.CreateEffect(ec) local e2=Effect.CreateEffect(ec)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetCondition(c15610297.condition) e2:SetCondition(c71442223.disable)
e2:SetReset(RESET_EVENT+0x1fe0000) e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
--
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_DISABLE) e3:SetCode(EFFECT_DISABLE)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
......
...@@ -24,7 +24,6 @@ function c72664875.initial_effect(c) ...@@ -24,7 +24,6 @@ function c72664875.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--Halve LP --Halve LP
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetOperation(c72664875.hvop) e3:SetOperation(c72664875.hvop)
...@@ -33,17 +32,17 @@ function c72664875.initial_effect(c) ...@@ -33,17 +32,17 @@ function c72664875.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DESTROYING) e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetCondition(aux.bdocon) e4:SetCondition(aux.bdcon)
e4:SetTarget(c72664875.atktg) e4:SetTarget(c72664875.atktg)
e4:SetOperation(c72664875.atkop) e4:SetOperation(c72664875.atkop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--damage --damage
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_DAMAGE)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EVENT_DAMAGE)
e5:SetCondition(c72664875.damcon) e5:SetCondition(c72664875.damcon)
e5:SetTarget(c72664875.damtg) e5:SetTarget(c72664875.damtg)
e5:SetOperation(c72664875.damop) e5:SetOperation(c72664875.damop)
...@@ -59,17 +58,10 @@ function c72664875.hvop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,17 +58,10 @@ function c72664875.hvop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2)) Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end end
function c72664875.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function c72664875.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToBattle() and not e:GetHandler():IsHasEffect(EFFECT_EXTRA_ATTACK) end if chk==0 then return e:GetHandler():IsChainAttackable() end
end end
function c72664875.atkop(e,tp,eg,ep,ev,re,r,rp) function c72664875.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() Duel.ChainAttack()
if not c:IsRelateToBattle() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
end end
function c72664875.damcon(e,tp,eg,ep,ev,re,r,rp) function c72664875.damcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and ep==tp return bit.band(r,REASON_EFFECT)~=0 and ep==tp
...@@ -81,7 +73,6 @@ function c72664875.damtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -81,7 +73,6 @@ function c72664875.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ev) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ev)
end end
function c72664875.damop(e,tp,eg,ep,ev,re,r,rp) function c72664875.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
--方界帝ヴァルカン・ドラグニー --方界帝ヴァルカン・ドラグニー
function c77387463.initial_effect(c) function c77387463.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--spsummon rule --spsummon rule
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(c77387463.spcon) e2:SetCondition(c77387463.spcon)
e2:SetOperation(c77387463.spop) e2:SetOperation(c77387463.spop)
...@@ -20,7 +14,7 @@ function c77387463.initial_effect(c) ...@@ -20,7 +14,7 @@ function c77387463.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY) e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c77387463.damcon) e3:SetCondition(c77387463.damcon)
e3:SetTarget(c77387463.damtg) e3:SetTarget(c77387463.damtg)
...@@ -28,7 +22,7 @@ function c77387463.initial_effect(c) ...@@ -28,7 +22,7 @@ function c77387463.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--special summon --special summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -41,7 +35,8 @@ function c77387463.filter(c) ...@@ -41,7 +35,8 @@ function c77387463.filter(c)
end end
function c77387463.spcon(e,c) function c77387463.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c77387463.filter,c:GetControler(),LOCATION_MZONE,0,2,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c77387463.filter,c:GetControler(),LOCATION_MZONE,0,2,nil)
end end
function c77387463.spop(e,tp,eg,ep,ev,re,r,rp,c) function c77387463.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c77387463.filter,tp,LOCATION_MZONE,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,c77387463.filter,tp,LOCATION_MZONE,0,2,2,nil)
...@@ -72,12 +67,11 @@ end ...@@ -72,12 +67,11 @@ end
function c77387463.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c77387463.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c77387463.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c77387463.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and c:IsRelateToBattle()
and Duel.IsExistingTarget(c77387463.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingTarget(c77387463.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and c:IsAbleToGrave() and not c:IsLocation(LOCATION_GRAVE) end
local ft=3 local ft=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)) ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c77387463.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) local g=Duel.SelectTarget(tp,c77387463.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
...@@ -96,12 +90,14 @@ function c77387463.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -96,12 +90,14 @@ function c77387463.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil) sg=sg:Select(tp,ft,ft,nil)
end end
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.IsExistingMatchingCard(c77387463.thfilter,tp,LOCATION_DECK,0,1,nil) local g=Duel.GetMatchingGroup(c77387463.thfilter,tp,LOCATION_DECK,0,nil)
and Duel.SelectYesNo(tp,aux.Stringid(77387463,0)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(77387463,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c77387463.thfilter,tp,LOCATION_DECK,0,1,1,nil) g=g:Select(tp,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT) Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end
end end
--方界獣ブレード・ガルーディア --方界獣ブレード・ガルーディア
function c78509901.initial_effect(c) function c78509901.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCondition(c78509901.spcon) e2:SetCondition(c78509901.spcon)
e2:SetOperation(c78509901.spop) e2:SetOperation(c78509901.spop)
...@@ -24,7 +18,7 @@ function c78509901.initial_effect(c) ...@@ -24,7 +18,7 @@ function c78509901.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--special summon --special summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DESTROYING) e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -38,7 +32,8 @@ function c78509901.filter(c) ...@@ -38,7 +32,8 @@ function c78509901.filter(c)
end end
function c78509901.spcon(e,c) function c78509901.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.IsExistingMatchingCard(c78509901.filter,c:GetControler(),LOCATION_MZONE,0,2,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c78509901.filter,c:GetControler(),LOCATION_MZONE,0,2,nil)
end end
function c78509901.spop(e,tp,eg,ep,ev,re,r,rp,c) function c78509901.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c78509901.filter,tp,LOCATION_MZONE,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,c78509901.filter,tp,LOCATION_MZONE,0,2,2,nil)
...@@ -56,11 +51,10 @@ end ...@@ -56,11 +51,10 @@ end
function c78509901.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c78509901.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c78509901.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c78509901.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsAbleToGrave()
and Duel.IsExistingTarget(c78509901.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c78509901.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=3 local ft=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)) ft=math.min(ft,Duel.GetLocationCount(tp,LOCATION_MZONE)+1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c78509901.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) local g=Duel.SelectTarget(tp,c78509901.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
...@@ -79,12 +73,14 @@ function c78509901.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,12 +73,14 @@ function c78509901.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil) sg=sg:Select(tp,ft,ft,nil)
end end
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.IsExistingMatchingCard(c78509901.thfilter,tp,LOCATION_DECK,0,1,nil) local g=Duel.GetMatchingGroup(c78509901.thfilter,tp,LOCATION_DECK,0,nil)
and Duel.SelectYesNo(tp,aux.Stringid(78509901,0)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(78509901,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c78509901.thfilter,tp,LOCATION_DECK,0,1,1,nil) g=g:Select(tp,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT) Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end
end end
...@@ -4,6 +4,7 @@ function c78625592.initial_effect(c) ...@@ -4,6 +4,7 @@ function c78625592.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_ATTACK)
e1:SetTarget(c78625592.target) e1:SetTarget(c78625592.target)
e1:SetOperation(c78625592.operation) e1:SetOperation(c78625592.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -59,7 +60,6 @@ function c78625592.grcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -59,7 +60,6 @@ function c78625592.grcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c78625592.groperation(e,tp,eg,ep,ev,re,r,rp) function c78625592.groperation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetAttacker() and Duel.GetAttackTarget()==nil then Duel.NegateAttack() end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
function c8837932.initial_effect(c) function c8837932.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -28,17 +28,18 @@ function c8837932.initial_effect(c) ...@@ -28,17 +28,18 @@ function c8837932.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c8837932.cfilter(c) function c8837932.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xe3) and c:IsFaceup() return c:IsFaceup() and c:IsSetCard(0xe3)
end end
function c8837932.condition(e,tp,eg,ep,ev,re,r,rp) function c8837932.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c8837932.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c8837932.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function c8837932.spfilter(c,e,tp,tid) function c8837932.spfilter(c,e,tp,tid)
return c:IsReason(REASON_DESTROY) and c:IsType(TYPE_MONSTER) and c:GetTurnID()==tid return c:IsReason(REASON_DESTROY) and c:IsType(TYPE_MONSTER) and c:GetTurnID()==tid
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end end
function c8837932.target(e,tp,eg,ep,ev,re,r,rp,chk) function c8837932.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tid=Duel.GetTurnCount() local tid=Duel.GetTurnCount()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c8837932.spfilter(chkc,e,tp,tid) end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>0 if chk==0 then return ft>0
and Duel.IsExistingTarget(c8837932.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,tid) end and Duel.IsExistingTarget(c8837932.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,tid) end
...@@ -47,46 +48,48 @@ function c8837932.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -47,46 +48,48 @@ function c8837932.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectTarget(tp,c8837932.spfilter,tp,0,LOCATION_GRAVE,1,ft,nil,e,tp,tid) local g=Duel.SelectTarget(tp,c8837932.spfilter,tp,0,LOCATION_GRAVE,1,ft,nil,e,tp,tid)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end end
function c8837932.sfilter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c8837932.activate(e,tp,eg,ep,ev,re,r,rp) function c8837932.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 or not c:IsRelateToEffect(e) then return end if ft<=0 or not c:IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local sg=g:Filter(c8837932.sfilter,nil,e,tp)
if sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if sg:GetCount()>ft then if sg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil) sg=sg:Select(tp,ft,ft,nil)
end end
local sc=sg:GetFirst() local sc=sg:GetFirst()
while sc and Duel.SpecialSummonStep(sc,0,tp,1-tp,false,false,POS_FACEUP) do while sc do
if Duel.SpecialSummonStep(sc,0,tp,1-tp,false,false,POS_FACEUP) then
c:SetCardTarget(sc) c:SetCardTarget(sc)
--
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0) e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e1) sc:RegisterEffect(e1)
-- end
sc:AddCounter(0x1038,1) sc=sg:GetNext()
-- end
Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
local oc=og:GetFirst()
while oc do
oc:AddCounter(0x1038,1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK) e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetCondition(c15610297.condition) e2:SetCondition(c8837932.disable)
e2:SetReset(RESET_EVENT+0x1fe0000) e2:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e2) oc:RegisterEffect(e2)
--
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_DISABLE) e3:SetCode(EFFECT_DISABLE)
sc:RegisterEffect(e3) oc:RegisterEffect(e3)
sc=sg:GetNext() oc=og:GetNext()
end end
Duel.SpecialSummonComplete() end
function c8837932.disable(e)
return e:GetHandler():GetCounter(0x1038)>0
end end
function c8837932.dfilter(c,g) function c8837932.dfilter(c,g)
return g:IsContains(c) return g:IsContains(c)
......
--方界業 --方界業
function c9659580.initial_effect(c) function c9659580.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -10,7 +11,6 @@ function c9659580.initial_effect(c) ...@@ -10,7 +11,6 @@ function c9659580.initial_effect(c)
e2:SetDescription(aux.Stringid(9659580,1)) e2:SetDescription(aux.Stringid(9659580,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c9659580.lpcon) e2:SetCondition(c9659580.lpcon)
e2:SetOperation(c9659580.lpop) e2:SetOperation(c9659580.lpop)
...@@ -30,9 +30,10 @@ function c9659580.tgfilter(c) ...@@ -30,9 +30,10 @@ function c9659580.tgfilter(c)
return c:IsCode(15610297) and c:IsAbleToGrave() return c:IsCode(15610297) and c:IsAbleToGrave()
end end
function c9659580.filter(c) function c9659580.filter(c)
return c:IsFaceup() and c:IsSetCard(0xe3) and c:IsType(TYPE_MONSTER) and not c:IsCode(15610297) return c:IsFaceup() and c:IsSetCard(0xe3) and not c:IsCode(15610297)
end end
function c9659580.target(e,tp,eg,ep,ev,re,r,rp,chk) function c9659580.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c9659580.filter(chkc) end
if chk==0 then return true end if chk==0 then return true end
if Duel.IsExistingTarget(c9659580.filter,tp,LOCATION_MZONE,0,1,nil) if Duel.IsExistingTarget(c9659580.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c9659580.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c9659580.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil)
...@@ -42,30 +43,34 @@ function c9659580.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,30 +43,34 @@ function c9659580.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetOperation(c9659580.activate) e:SetOperation(c9659580.activate)
Duel.SelectTarget(tp,c9659580.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c9659580.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end end
end end
function c9659580.activate(e,tp,eg,ep,ev,re,r,rp) function c9659580.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9659580.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,99,nil) local g=Duel.SelectMatchingCard(tp,c9659580.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,99,nil)
if g:GetCount()>0 then if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
Duel.SendtoGrave(g,REASON_EFFECT) local og=Duel.GetOperatedGroup()
local n=g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE) local n=og:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and n>0 then if tc:IsRelateToEffect(e) and tc:IsFaceup() and n>0 then
Duel.BreakEffect() Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(n*800) e1:SetValue(n*800)
e1:SetReset(RESET_EVENT+0x1ff0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
end end
function c9659580.lpcon(e,tp,eg,ep,ev,re,r,rp) function c9659580.lpcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
return Duel.GetTurnPlayer()~=tp and rc and rc:IsSetCard(0xe3) and rc:IsType(TYPE_MONSTER) return Duel.GetTurnPlayer()~=tp and re:IsActiveType(TYPE_MONSTER) and rc and rc:IsSetCard(0xe3)
and eg:IsExists(Card.IsCode,1,nil,15610297) and eg:IsExists(Card.IsCode,1,nil,15610297)
end end
function c9659580.lpop(e,tp,eg,ep,ev,re,r,rp) function c9659580.lpop(e,tp,eg,ep,ev,re,r,rp)
......
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