Commit 56944a92 authored by VanillaSalt's avatar VanillaSalt

fix

parent e9a6c705
...@@ -17,7 +17,7 @@ function c10678778.initial_effect(c) ...@@ -17,7 +17,7 @@ function c10678778.initial_effect(c)
--destroy --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10678778,1)) e2:SetDescription(aux.Stringid(10678778,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
...@@ -28,12 +28,15 @@ function c10678778.initial_effect(c) ...@@ -28,12 +28,15 @@ function c10678778.initial_effect(c)
e2:SetOperation(c10678778.desop) e2:SetOperation(c10678778.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c10678778.rmfilter(c)
return c:IsFacedown() and c:IsAbleToRemove()
end
function c10678778.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function c10678778.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_EXTRA,0)>0 end if chk==0 then return Duel.IsExistingMatchingCard(c10678778.rmfilter,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end end
function c10678778.rmop(e,tp,eg,ep,ev,re,r,rp) function c10678778.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_EXTRA,0) local g=Duel.GetMatchingGroup(c10678778.rmfilter,tp,0,LOCATION_EXTRA,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
local tc=g:RandomSelect(tp,1):GetFirst() local tc=g:RandomSelect(tp,1):GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
...@@ -54,7 +57,7 @@ function c10678778.descost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,7 +57,7 @@ function c10678778.descost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c10678778.filter(c,tp) function c10678778.filter(c,tp)
local ctype=bit.band(c:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) local ctype=bit.band(c:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
return c:IsFaceup() and ctype~=0 and c:IsAbleToHand() return c:IsFaceup() and ctype~=0 and c:IsAbleToExtra()
and Duel.IsExistingMatchingCard(c10678778.filter2,tp,0,LOCATION_MZONE,1,nil,ctype) and Duel.IsExistingMatchingCard(c10678778.filter2,tp,0,LOCATION_MZONE,1,nil,ctype)
end end
function c10678778.filter2(c,ctype) function c10678778.filter2(c,ctype)
...@@ -63,16 +66,16 @@ end ...@@ -63,16 +66,16 @@ end
function c10678778.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c10678778.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(1-tp) and c10678778.filter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(1-tp) and c10678778.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c10678778.filter,tp,0,LOCATION_REMOVED,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c10678778.filter,tp,0,LOCATION_REMOVED,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c10678778.filter,tp,0,LOCATION_REMOVED,1,1,nil,tp) local g=Duel.SelectTarget(tp,c10678778.filter,tp,0,LOCATION_REMOVED,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
local ctype=bit.band(g:GetFirst():GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) local ctype=bit.band(g:GetFirst():GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
local dg=Duel.GetMatchingGroup(c10678778.filter2,tp,0,LOCATION_MZONE,nil,ctype) local dg=Duel.GetMatchingGroup(c10678778.filter2,tp,0,LOCATION_MZONE,nil,ctype)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
end end
function c10678778.desop(e,tp,eg,ep,ev,re,r,rp) function c10678778.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)~=0 then
local ctype=bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) local ctype=bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c10678778.filter2,tp,0,LOCATION_MZONE,1,1,nil,ctype) local g=Duel.SelectMatchingCard(tp,c10678778.filter2,tp,0,LOCATION_MZONE,1,1,nil,ctype)
......
...@@ -40,8 +40,7 @@ function c13611090.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,8 +40,7 @@ function c13611090.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(tc:GetDefence()*2) e2:SetValue(tc:GetDefence()*2)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler()) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE) e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END) e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e3:SetCondition(c13611090.rdcon) e3:SetCondition(c13611090.rdcon)
...@@ -49,7 +48,6 @@ function c13611090.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +48,6 @@ function c13611090.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
end end
function c13611090.rdcon(e,tp,eg,ep,ev,re,r,rp) function c13611090.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep~=tp
end end
......
...@@ -40,9 +40,8 @@ function c98301564.costchange(e,re,rp,val) ...@@ -40,9 +40,8 @@ function c98301564.costchange(e,re,rp,val)
return val return val
end end
end end
function c98301564.regcon(e,tp,eg,ep,ev,re,r,rp) function c98301564.regcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE) return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end end
function c98301564.cfilter(c) function c98301564.cfilter(c)
return c:IsType(TYPE_TRAP) and c:IsType(TYPE_COUNTER) and c:IsAbleToHand() return c:IsType(TYPE_TRAP) and c:IsType(TYPE_COUNTER) and c:IsAbleToHand()
...@@ -63,4 +62,3 @@ function c98301564.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,4 +62,3 @@ function c98301564.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end end
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