Commit b4091034 authored by Tachibana's avatar Tachibana

nmbd

parent bd0729bb
--Spiral Drill Impact!
function c32912377.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c32912377.condition)
e1:SetTarget(c32912377.target)
e1:SetOperation(c32912377.activate)
c:RegisterEffect(e1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c32912377.condition)
e1:SetTarget(c32912377.target)
e1:SetOperation(c32912377.activate)
c:RegisterEffect(e1)
end
function c32912377.cfilter(c)
return c:IsFaceup() and c:IsCode(32912371,32912372)
return c:IsFaceup() and c:IsCode(32912371,32912372)
end
function c32912377.condition(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c32912377.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
return ct>0 and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
local ct=Duel.GetMatchingGroupCount(c32912377.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
return ct>0 and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
end
function c32912377.filter(c)
return c:IsFaceup() and c:IsSetCard(0xa15)
return c:IsFaceup() and c:IsSetCard(0xa15)
end
function c32912377.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c32912377.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if ct<=1 then return Duel.IsExistingMatchingCard(c32912377.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
return true
end
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c32912377.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if ct<=1 then return Duel.IsExistingMatchingCard(c32912377.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
return true
end
end
function c32912377.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c32912377.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local ct=g:GetCount()
if ct>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c32912377.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local tc=g:GetFirst()
local atk=tc:GetBaseAttack()+tc:GetBaseDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
end
end
if ct>=2 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISEFFECT)
e3:SetValue(c32912377.effectfilter)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
if ct>=3 then
local g=Duel.GetMatchingGroup(c32912377.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTarget(c32912377.indtg)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(e:GetHandler())
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetCondition(c32912377.damcon)
e5:SetOperation(c32912377.damop)
tc:RegisterEffect(e5)
tc=g:GetNext()
end
end
local g=Duel.GetMatchingGroup(c32912377.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local ct=g:GetCount()
if ct>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c32912377.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local tc=g:GetFirst()
local atk=tc:GetBaseAttack()+tc:GetBaseDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
end
end
if ct>=2 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISEFFECT)
e3:SetValue(c32912377.effectfilter)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
if ct>=3 then
local g=Duel.GetMatchingGroup(c32912377.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTarget(c32912377.indtg)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(e:GetHandler())
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetCondition(c32912377.damcon)
e5:SetOperation(c32912377.damop)
tc:RegisterEffect(e5)
tc=g:GetNext()
end
end
end
function c32912377.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return tc:IsSetCard(0xa15)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return tc:IsSetCard(0xa15)
end
function c32912377.indtg(e,c)
return c:IsSetCard(0xa15)
return c:IsSetCard(0xa15)
end
function c32912377.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
return ep~=tp
end
function c32912377.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
\ No newline at end of file
......@@ -35,7 +35,7 @@ function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
function cm.actfilter(c,e,tp)
return c:IsCode(33310101) and c:GetActivateEffect() and c:GetActivateEffect():IsActivatable(tp,true,true)
......
......@@ -93,5 +93,5 @@ function c33400312.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetBattleTarget()~=nil
end
function c33400312.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
\ No newline at end of file
......@@ -96,5 +96,5 @@ function c33700061.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp
end
function c33700061.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
\ No newline at end of file
......@@ -54,7 +54,7 @@ function cm.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and e:GetHandler():IsSummonType(0x534)
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(1,ev/2)
end
function cm.f1(c,e,tp)
return c:IsCode(37564765) and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.f2,tp,LOCATION_EXTRA,0,1,nil,e,tp,Group.FromCards(e:GetHandler(),nc)) and c:IsFaceup()
......
......@@ -87,5 +87,5 @@ function cm.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(1,ev/2)
end
......@@ -125,5 +125,5 @@ function c60151011.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and e:GetHandler():GetBattleTarget()~=nil
end
function c60151011.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(1,ev/2)
end
\ No newline at end of file
......@@ -92,7 +92,7 @@ function c60152311.e2opcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetBattleTarget()~=nil
end
function c60152311.e2opop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
function c60152311.e99tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0xcb26) and c:IsType(TYPE_MONSTER)
......
......@@ -38,7 +38,7 @@ function c65020129.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and ((b~=nil and b:IsSetCard(0xcda4)) or a:IsSetCard(0xcda4))
end
function c65020129.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
function c65020129.tgfil(c,tp)
return c:IsSetCard(0xcda4) and c:IsSSetable() and (Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or c:IsType(TYPE_FIELD))
......
......@@ -70,7 +70,7 @@ function c81012056.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and tc:IsType(TYPE_PENDULUM) and bit.band(tc:GetType(),0x81)==0x81 and tc:GetBattleTarget()~=nil
end
function c81012056.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
Duel.ChangeBattleDamage(1,ev*2)
end
function c81012056.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler() and e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
......
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