Commit 315f3944 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #331 from VanillaSalt/patch39

fix
parents e3d747ce 60a5280f
......@@ -21,24 +21,28 @@ end
function c14772491.spfilter(c,e,tp)
return c:IsSetCard(0x1f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c14772491.filter(c)
return c:IsFaceup() and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c14772491.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c14772491.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c14772491.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c14772491.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c14772491.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c14772491.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local cp=tc:GetControler()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.GetLocationCount(cp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c14772491.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local sc=g:GetFirst()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(sc,0,tp,cp,false,false,POS_FACEUP)
c:SetCardTarget(tc)
c:SetCardTarget(sc)
e:GetLabelObject():SetLabelObject(sc)
......
......@@ -31,7 +31,8 @@ function c17475251.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c17475251.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17475251.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c17475251.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c17475251.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -5,7 +5,6 @@ function c2356994.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--summon,flip
local e2=Effect.CreateEffect(c)
......@@ -34,14 +33,13 @@ function c2356994.skipop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(0,1)
if Duel.GetTurnPlayer()~=tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c2356994.bpcon)
e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,2)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_OPPO_TURN,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
......
......@@ -8,6 +8,7 @@ function c23998625.initial_effect(c)
e1:SetDescription(aux.Stringid(23998625,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCountLimit(1)
e1:SetTarget(c23998625.atktg)
e1:SetOperation(c23998625.atkop)
c:RegisterEffect(e1)
......
......@@ -47,14 +47,15 @@ function c2521011.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c2521011.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,2521011) end
if chk==0 then return Duel.GetFlagEffect(tp,2521011)==0 end
Duel.RegisterFlagEffect(tp,2521011,RESET_PHASE+PHASE_END,0,1)
end
function c2521011.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function c2521011.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c2521011.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c2521011.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c2521011.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -46,7 +46,7 @@ function c35842855.filter(c)
return c:IsDestructable()
end
function c35842855.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c35842855.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c35842855.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c35842855.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c35842855.filter,tp,0,LOCATION_MZONE,1,1,nil)
......
......@@ -38,8 +38,8 @@ function c37781520.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c37781520.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37781520.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c37781520.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c37781520.cfilter,tp,LOCATION_HAND,0,3,e:GetHandler()) end
Duel.DiscardHand(tp,c37781520.cfilter,3,3,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c37781520.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -33,7 +33,8 @@ function c43748308.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function c43748308.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c43748308.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c43748308.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c43748308.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -27,7 +27,8 @@ function c44860890.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c44860890.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c44860890.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c44860890.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c44860890.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -38,7 +38,7 @@ function c57836546.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()~=2 or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local tc=g:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK) then
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
tc:RegisterFlagEffect(57836546,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
tc=g:GetNext()
......
......@@ -24,7 +24,7 @@ end
function c60470713.cfilter(c,tp)
return c:IsControler(tp) and c:GetPreviousControler()==tp
and (c:IsPreviousLocation(LOCATION_GRAVE) or (c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)))
and c:IsSetCard(0x71)
and c:IsSetCard(0x71) and not c:IsLocation(LOCATION_EXTRA)
end
function c60470713.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and eg:IsExists(c60470713.cfilter,1,nil,tp)
......
......@@ -29,7 +29,8 @@ function c6353603.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c6353603.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6353603.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c6353603.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c6353603.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -31,7 +31,8 @@ function c70355994.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c70355994.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c70355994.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c70355994.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c70355994.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -36,7 +36,7 @@ function c75132317.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function c75132317.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c75132317.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c75132317.setop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -11,12 +11,12 @@ function c93599951.initial_effect(c)
c:RegisterEffect(e1)
end
function c93599951.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.GetAttackTarget()
return tp~=Duel.GetTurnPlayer()
end
function c93599951.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local a=Duel.GetAttacker()
if chk==0 then return a:IsCanBeEffectTarget(e) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,a) end
if chk==0 then return a and a:IsCanBeEffectTarget(e) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,a) end
Duel.SetTargetCard(a)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,a)
......@@ -24,8 +24,10 @@ function c93599951.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c93599951.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local a=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if tc:IsDefencePos() then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
Duel.ChangeAttacker(tc)
end
end
......@@ -43,7 +43,8 @@ function c96381979.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c96381979.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96381979.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c96381979.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c96381979.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
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