Commit 9bb5b402 authored by DailyShana's avatar DailyShana

fix (45/45)

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