Commit 4514f832 authored by Tachibana's avatar Tachibana

ndyd

parent 05cd4688
......@@ -23,8 +23,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,0,2,2,e:GetHandler())
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) then
if g and Duel.SendtoGrave(g,REASON_EFFECT)>0 then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -52,15 +52,15 @@ function cm.initial_effect(c)
e6:SetOperation(cm.addc)
c:RegisterEffect(e6)
--activate cost
local c7=Effect.CreateEffect(c)
c7:SetType(EFFECT_TYPE_FIELD)
c7:SetCode(EFFECT_ACTIVATE_COST)
c7:SetRange(LOCATION_MZONE)
c7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
c7:SetTargetRange(0,1)
c7:SetCost(cm.costchk)
c7:SetOperation(cm.costop)
c:RegisterEffect(c7)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_ACTIVATE_COST)
e7:SetRange(LOCATION_MZONE)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetTargetRange(0,1)
e7:SetCost(cm.costchk)
e7:SetOperation(cm.costop)
c:RegisterEffect(e7)
--accumulate
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
......@@ -70,6 +70,7 @@ function cm.initial_effect(c)
e8:SetTargetRange(0,1)
c:RegisterEffect(e8)
end
cm.Armageddon=1
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
local ct=math.floor(ev/1000)
if ct>0 then
......@@ -115,21 +116,18 @@ function cm.addc(e,tp,eg,ep,ev,re,r,rp)
c:AddCounter(0x7f3,d)
end
end
function cm.damfilter(c,tp)
return c:GetCounter(0x7f3)>0 and c:IsHasEffect(17061230,tp)
function cm.damfilter(c)
return c:GetCounter(0x7f3)>0 and c.Armageddon==1
end
function cm.costchk(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,17061230)
local g=Duel.GetMatchingGroup(cm.damfilter,tp,LOCATION_ONFIELD,nil,nil,tp)
local tc=g:GetFirst()
local sum=0
local sg=Duel.GetMatchingGroup(cm.damfilter,tp,0,LOCATION_ONFIELD,nil)
local tc=sg:GetFirst()
local count=0
while tc do
local sct=tc:GetCounter(0x7f3)
tc:RemoveCounter(tp,0x7f3,sct,0)
sum=sum+sct
tc=g:GetNext()
count=count+tc:GetCounter(0x7f3)
tc=sg:GetNext()
end
return Duel.CheckLPCost(tp,sum*300)
return Duel.CheckLPCost(tp,count*300)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,17061230)
......
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