Commit 1cd944e4 authored by Nemo Ma's avatar Nemo Ma

Heavenly Maids

parent c662c829
--Heavenly Maid : Exotic Purge
function c33700204.initial_effect(c)
--Send 1 "Heavenly Maid" monster you control to the GY. If you do, send 1 card your opponent control to the GY. You can only activate 1 "Heavenly Maid : Exotic Purge" per turn.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33700204)
e1:SetCardTarget(CATEGORY_TOGRAVE)
e1:SetTarget(c33700204.tg)
e1:SetOperation(c33700204.op)
c:RegisterEffect(e1)
end
function c33700204.filter(c)
return c:IsSetCard(0x444) and c:IsAbleToGrave()
end
function c33700204.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33700204.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)
local g1=Duel.GetMatchingGroup(c33700204.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,1,0,0)
end
function c33700204.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c33700204.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
if g:GetCount()==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local dg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(dg)
Duel.SendtoGrave(dg)
end
--Heavenly Maid : Feast Preparation
function c33700205.initial_effect(c)
--Send 1 "Heavenly Maid" monster you control to the GY, if you do, Draw 2 cards, then return 1 card in your hand to the top or the bottom of your deck. You can only activate 1 "Heavenly Maid : Feast Preparation" per turn.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33700205)
e1:SetCardTarget(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetTarget(c33700205.tg)
e1:SetOperation(c33700205.op)
c:RegisterEffect(e1)
end
function c33700205.filter(c)
return c:IsSetCard(0x444) and c:IsAbleToGrave()
end
function c33700205.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33700205.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,2) end
local g1=Duel.GetMatchingGroup(c33700205.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c33700205.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c33700205.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
if g:GetCount()==0 or Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) or Duel.Draw(tp,2,REASON_EFFECT)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
local p=Duel.SelectOption(tp,aux.Stringid(33700205,0),aux.Stringid(33700205,1))
Duel.SendtoDeck(g,nil,p,REASON_EFFECT)
end
end
--Bond of Heavenly Maids
function c33700206.initial_effect(c)
--When a monster would be Summoned, OR a Spell/Trap Card is activated: Send 1 "Heavenly Maid" monster you control to the GY; negate the Summon or activation, and if you do, destroy that card. You can only activate 1 "Bond of Heavenly Maids" per turn.
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCountLimit(1,33700206)
e1:SetCondition(c33700206.condition1)
e1:SetCost(c33700206.cost)
e1:SetTarget(c33700206.target1)
e1:SetOperation(c33700206.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCountLimit(1,33700206)
e4:SetCondition(c33700206.condition2)
e4:SetCost(c33700206.cost)
e4:SetTarget(c33700206.target2)
e4:SetOperation(c33700206.activate2)
c:RegisterEffect(e4)
end
function c33700206.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x444) and c:IsAbleToGraveAsCost()
end
function c33700206.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(c33700206.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c33700206.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c33700206.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c33700206.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c33700206.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c33700206.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c33700206.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c33700206.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c33700206.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--Heavenly Maid : Cleaning
function c33700207.initial_effect(c)
--For the rest of the turn after this card is activated, if card(s) are discarded or sent to GY from your oppponent's hand, You can send "Heavenly Maid" monster(s) you control to the GY, up to the number of cards discarded/sent to GY, then add the same number of those card(s) to your Hand, also reveal those cards. These revealed card(s) are banished when they would be sent to the GY. You can only activate 1 "Heavenly Maid : Cleaning" per turn.
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33700207+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c33700207.activate)
c:RegisterEffect(e1)
end
function c33700207.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetTarget(c33700207.drop)
e1:SetValue(c33700207.drval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--[[
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c33700207.drcon1)
e1:SetOperation(c33700207.drop1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e5=e1:Clone()
e5:SetCode(EVENT_REMOVE)
Duel.RegisterEffect(e5,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c33700207.regcon)
e2:SetOperation(c33700207.regop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e4=e2:Clone()
e4:SetCode(EVENT_REMOVE)
Duel.RegisterEffect(e4,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetCondition(c33700207.drcon2)
e3:SetOperation(c33700207.drop2)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
]]
end
function c33700207.repfilter(c,tp)
return c:IsControler(1-tp) and c:IsLocation(LOCATION_HAND) and (c:GetDestination()==LOCATION_GRAVE or c:IsReason(REASON_DISCARD))
end
function c33700207.drop(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c33700207.hfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return eg:IsExists(c33700207.repfilter,1,nil,tp) and g:GetCount()>0 end
local msg=HINTMSG_TOGRAVE
if e:GetCode()==EVENT_REMOVE then msg=HINTMSG_DISCARD end
if Duel.SelectYesNo(tp,msg) then
local g=eg:Filter(c33700207.repfilter,nil,tp)
local ct=g:GetCount()
local sg=g:Select(tp,1,ct,nil)
local sct=sg:GetCount()
if sct<g:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
g=g:Select(tp,1,sct,nil)
end
Duel.Hint(HINT_CARD,0,33700207)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.BreakEffect()
Duel.SendtoHand(g,tp,REASON_EFFECT)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetOwner())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(function(e) return e:GetHandler():IsPublic() end)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
return true
else return false end
end
function c33700207.drval(e,c)
return false
end
function c33700207.cfilter(c,tp)
return c:GetPreviousControler()~=tp and (c:IsLocation(LOCATION_GRAVE) or c:IsReason(REASON_DISCARD)) and c:IsPreviousLocation(LOCATION_HAND)
end
function c33700207.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700207.cfilter,1,nil,tp)
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function c33700206.hfilter(c)
return c:IsFaceup() and c:IsSetCard(0x444) and c:IsAbleToGraveAsCost()
end
function c33700207.drop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33700207.hfilter,tp,LOCATION_MZONE,0,nil)
local msg=HINTMSG_TOGRAVE
if e:GetCode()==EVENT_REMOVE then msg=HINTMSG_DISCARD end
if g:GetCount()==0 or not Duel.SelectYesNo(tp,msg) then return end
local sg=g:Select(tp,1,eg:GetCount(),nil)
local ct,tg=sg:GetCount()
if ct<eg:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
tg=eg:Select(tp,1,ct2,nil)
else tg=eg:Clone() end
Duel.Hint(HINT_CARD,0,33700207)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.BreakEffect()
if Duel.SendtoHand(tg,tp,REASON_EFFECT)==0 then return end
local dg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
for tc in aux.Next(dg) do
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetOwner())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(function(e) return e:GetHandler():IsPublic() end)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
function c33700207.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700207.cfilter,1,nil,tp) and Duel.GetFlagEffect(tp,33700207)==0
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function c33700207.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,33700207,RESET_CHAIN,0,1)
end
function c33700207.drcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,33700207)>0
end
function c33700207.drop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,33700207)
local g=Duel.GetMatchingGroup(c33700207.hfilter,tp,LOCATION_MZONE,0,nil)
local msg=HINTMSG_TOGRAVE
if e:GetCode()==EVENT_REMOVE then msg=HINTMSG_DISCARD end
if g:GetCount()==0 or not Duel.SelectYesNo(tp,msg) then return end
local sg=g:Select(tp,1,eg:GetCount(),nil)
local ct,tg=sg:GetCount()
if ct<eg:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
tg=eg:Select(tp,1,ct2,nil)
else tg=eg:Clone() end
Duel.Hint(HINT_CARD,0,33700207)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.BreakEffect()
if Duel.SendtoHand(tg,tp,REASON_EFFECT)==0 then return end
local dg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
for tc in aux.Next(dg) do
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetOwner())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetCondition(function(e) return e:GetHandler():IsPublic() end)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
--Heavenly Maid : Secret Whisper
function c33700208.initial_effect(c)
--Return 3 "Heavenly Maid" cards from your GY to your deck, if you do, Draw 1 card. And if it's a "Heavenly Maid" monster, you can Special Summon it. If this card is activated in your opponent's turn, you can draw 1 more card. You can only activate 1 "Heavenly Maid : Secret Whisper" per turn.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33700208)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetTarget(c33700208.tg)
e1:SetOperation(c33700208.op)
c:RegisterEffect(e1)
end
function c33700208.filter(c)
return c:IsSetCard(0x444) and c:IsAbleToDeck()
end
function c33700208.tg(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(c33700208.filter,tp,LOCATION_GRAVE,0,3,nil)
and Duel.IsPlayerCanDraw(tp,1) end
local g=Duel.GetMatchingGroup(c33700208.filter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33700208.spfilter(c,e,tp)
return c:IsSetCard(0x444) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33700208.op(e,tp,eg,ep,ev,re,r,rp)
--Return 3 "Heavenly Maid" cards from your GY to your deck,
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c33700208.filter,tp,LOCATION_GRAVE,0,3,3,nil)
if g:GetCount()==3 then
Duel.HintSelection(g)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)<3 or g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<3 then return end
--if you do, Draw 1 card. If this card is activated in your opponent's turn, you can draw 1 more card.
local d=1
if Duel.GetTurnPlayer()~=tp then d=d+1 end
Duel.Draw(tp,d,REASON_EFFECT)
local dg=Duel.GetOperatedGroup():Filter(Card.IsLocation,tp,LOCATION_HAND)
--And if it's a "Heavenly Maid" monster, you can Special Summon it.
local sg=dg:Filter(c33700208.spfilter,nil,e,tp)
if sg:GetCount()>0 then
if sg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,1,1,nil)
end
Duel.ConfirmCards(1-tp,sg)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--Heavenly Maid Rollcall
function c33700209.initial_effect(c)
--Once per turn, When a "Heavenly Maid" monster is Normal or Special Summoned, you can Special Summon 1 "Heavenly Maid" monster from your hand or GY.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33700209,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c33700209.condition)
e2:SetCost(c33700209.cost)
e2:SetTarget(c33700209.target)
e2:SetOperation(c33700209.activate)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
end
function c33700209.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x444)
end
function c33700209.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700209.cfilter,1,nil,tp)
end
function c33700209.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(33700209)==0 end
e:GetHandler():RegisterFlagEffect(33700209,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c33700209.filter(c,e,tp)
return c:IsSetCard(0x444) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33700209.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c33700209.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c33700209.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33700209.filter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Irregular Existence
function c33700210.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Neither player take battle damage if no monsters are destroyed by that battle (excludes Direct Attacks).
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(c33700210.actcon)
e2:SetOperation(c33700210.ndop)
c:RegisterEffect(e2)
end
function c33700210.actcon(e)
return Duel.GetAttackTarget()~=nil
end
function c33700210.ndop(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(ev)
Duel.ChangeBattleDamage(ep,0)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetLabel(ep)
e3:SetLabelObject(e)
e3:SetOperation(c33700210.damage)
e3:SetReset(RESET_PHASE+PHASE_DAMAGE)
e:GetHandler():RegisterEffect(e3)
end
function c33700210.damage(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(e:GetLabel(),e:GetLabelObject():GetLabel(),REASON_BATTLE)
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