Commit b5bedbc5 authored by VanillaSalt's avatar VanillaSalt

fix

parent 1d393459
...@@ -77,6 +77,7 @@ function c276357.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -77,6 +77,7 @@ function c276357.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c276357.desop(e,tp,eg,ep,ev,re,r,rp) function c276357.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
......
...@@ -7,7 +7,6 @@ function c3105404.initial_effect(c) ...@@ -7,7 +7,6 @@ function c3105404.initial_effect(c)
e1:SetCode(EVENT_DESTROYED) e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,3105404+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,3105404+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c3105404.condition)
e1:SetTarget(c3105404.target) e1:SetTarget(c3105404.target)
e1:SetOperation(c3105404.activate) e1:SetOperation(c3105404.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -24,12 +23,9 @@ function c3105404.initial_effect(c) ...@@ -24,12 +23,9 @@ function c3105404.initial_effect(c)
end end
function c3105404.filter(c,e,tp) function c3105404.filter(c,e,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))) and ((c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
and c:IsSetCard(0x1047) and c:GetBaseAttack()>0 and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsSetCard(0x1047) and c:GetBaseAttack()>0 and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
end end
function c3105404.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function c3105404.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c3105404.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c3105404.filter(chkc,e,tp) end if chkc then return eg:IsContains(chkc) and c3105404.filter(chkc,e,tp) end
if chk==0 then return eg:IsExists(c3105404.filter,1,nil,e,tp) end if chk==0 then return eg:IsExists(c3105404.filter,1,nil,e,tp) end
......
...@@ -14,9 +14,25 @@ function c313513.cfilter(c) ...@@ -14,9 +14,25 @@ function c313513.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x7) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsSetCard(0x7) and c:IsAbleToGraveAsCost()
end end
function c313513.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c313513.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c313513.cfilter,tp,LOCATION_ONFIELD,0,3,nil) end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local ct=-ft+1
local g=Duel.SelectMatchingCard(tp,c313513.cfilter,tp,LOCATION_ONFIELD,0,3,3,nil) local tg=Duel.GetMatchingGroup(c313513.cfilter,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return ct<=3 and tg:GetCount()>=3
and (ct<=0 or tg:IsExists(Card.IsLocation,ct,nil,LOCATION_MZONE)) end
local g=nil
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=tg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<3 then
tg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=tg:Select(tp,3-ct,3-ct,nil)
g:Merge(g2)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=tg:Select(tp,3,3,nil)
end
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -34,8 +50,7 @@ function c313513.filter(c,e,tp) ...@@ -34,8 +50,7 @@ function c313513.filter(c,e,tp)
return c:IsCode(83104731) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(83104731) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c313513.target(e,tp,eg,ep,ev,re,r,rp,chk) function c313513.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(c313513.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c313513.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c313513.dfilter(c) function c313513.dfilter(c)
......
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