Commit bc67490d authored by Fluorohydride's avatar Fluorohydride

Merge pull request #313 from VanillaSalt/patch35

fix
parents 36749e0d a305b09e
......@@ -13,6 +13,7 @@ function c13857930.initial_effect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c13857930.condition)
e3:SetTarget(c13857930.target)
e3:SetOperation(c13857930.activate)
......
......@@ -10,14 +10,14 @@ function c15684835.initial_effect(c)
e1:SetOperation(c15684835.operation)
c:RegisterEffect(e1)
end
function c15684835.filter(c,tp)
return c:IsFaceup() and c:IsControler(1-tp)
function c15684835.filter(c,e,tp)
return c:IsFaceup() and c:IsControler(1-tp) and c:IsCanBeEffectTarget(e)
end
function c15684835.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) end
if chk==0 then return eg:IsExists(c15684835.filter,1,nil,tp) end
if chkc then return eg:IsContains(chkc) and c15684835.filter(chkc,e,tp) end
if chk==0 then return eg:IsExists(c15684835.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=eg:FilterSelect(tp,c15684835.filter,1,1,nil,tp)
local g=eg:FilterSelect(tp,c15684835.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
......
......@@ -6,6 +6,7 @@ function c17732278.initial_effect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c17732278.condition)
e1:SetTarget(c17732278.target)
e1:SetOperation(c17732278.activate)
......
......@@ -54,15 +54,14 @@ function c19441018.descost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c19441018.filter1(c)
return c:IsDestructable()
return c:IsDestructable() and Duel.IsExistingTarget(c19441018.filter2,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c19441018.filter2(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c19441018.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c19441018.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c19441018.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c19441018.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c19441018.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
......@@ -20,6 +20,7 @@ function c303660.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(c303660.etarget)
......
......@@ -21,10 +21,12 @@ end
function c3056267.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local mon=Duel.SelectTarget(tp,c3056267.swapfilter,tp,0,LOCATION_MZONE,1,1,nil)
mon:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_CONTROL,mon,2,0,0)
if Duel.IsExistingTarget(c3056267.swapfilter,tp,0,LOCATION_MZONE,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local mon=Duel.SelectTarget(tp,c3056267.swapfilter,tp,0,LOCATION_MZONE,1,1,nil)
mon:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_CONTROL,mon,2,0,0)
end
end
function c3056267.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -5,6 +5,7 @@ function c36088082.initial_effect(c)
e1:SetDescription(aux.Stringid(36088082,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c36088082.regcon)
e1:SetOperation(c36088082.regop)
c:RegisterEffect(e1)
......
......@@ -14,12 +14,14 @@ function c38815069.filter(c)
return c:IsSetCard(0x38) and c:IsAbleToDeck()
end
function c38815069.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and c38815069.filter(chkc) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c38815069.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c38815069.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
if Duel.IsExistingTarget(c38815069.filter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c38815069.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function c38815069.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -37,8 +37,7 @@ function c3891471.filter(c,e,tp)
return c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c3891471.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp
and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c3891471.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c3891471.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -37,7 +37,7 @@ end
function c3954901.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -48,7 +48,7 @@ function c39984786.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c39984786.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -56,7 +56,7 @@ function c40732515.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c40732515.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c40732515.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -20,12 +20,13 @@ function c40884383.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c40884383.filter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c40884383.filter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c40884383.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,e:GetHandler())
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c)
end
end
......@@ -26,9 +26,9 @@ function c41777.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c41777.filter(chkc,e,tp) end
if chk==0 then
if e:GetLabel()==1 then
local res=Duel.IsExistingTarget(c41777.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
e:SetLabel(0)
return res
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c41777.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
else
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c41777.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
......
......@@ -13,16 +13,16 @@ function c43573231.initial_effect(c)
e1:SetOperation(c43573231.adop)
c:RegisterEffect(e1)
end
function c43573231.cfilter(c,tp)
function c43573231.cfilter(c,e,tp)
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return c:IsControler(tp) and ((pp==0x1 and np==0x4) or (pp==0x4 and np==0x1) or (pp==0x8 and np==0x1))
return c:IsControler(tp) and ((pp==0x1 and np==0x4) or (pp==0x4 and np==0x1) or (pp==0x8 and np==0x1)) and c:IsCanBeEffectTarget(e)
end
function c43573231.adtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c43573231.cfilter(chkc,1-tp) end
if chk==0 then return eg:IsExists(c43573231.cfilter,1,nil,1-tp) end
if chkc then return eg:IsContains(chkc) and c43573231.cfilter(chkc,e,1-tp) end
if chk==0 then return eg:IsExists(c43573231.cfilter,1,nil,e,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=eg:FilterSelect(tp,c43573231.cfilter,1,1,nil,1-tp)
local g=eg:FilterSelect(tp,c43573231.cfilter,1,1,nil,e,1-tp)
Duel.SetTargetCard(g)
end
function c43573231.adop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -40,6 +40,7 @@ end
function c44635489.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c44635489.filter(chkc,e:GetHandler():GetLevel()) end
if chk==0 then return Duel.IsExistingTarget(c44635489.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,e:GetHandler(),e:GetHandler():GetLevel()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c44635489.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,e:GetHandler(),e:GetHandler():GetLevel())
end
function c44635489.lvop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -121,6 +121,7 @@ function c4545683.spfilter(c,e,tp,ec)
return c:GetFlagEffect(4545683)~=0 and c:GetEquipTarget()==ec and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c4545683.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c4545683.spfilter(chkc,e,tp,e:GetHandler()) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c4545683.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -61,7 +61,7 @@ function c47111934.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c47111934.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c47111934.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -29,7 +29,7 @@ function c47126872.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c47126872.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c47126872.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -24,7 +24,7 @@ function c48343627.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c48343627.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -26,10 +26,11 @@ function c48370501.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c48370501.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48370501,1))
local g=Duel.SelectMatchingCard(tp,c48370501.filter,tp,LOCATION_DECK,0,1,1,nil,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,c48370501.filter,tp,LOCATION_DECK,0,1,1,nil,c)
if g:GetCount()>0 then
Duel.Equip(tp,g:GetFirst(),e:GetHandler())
Duel.Equip(tp,g:GetFirst(),c)
end
end
......@@ -27,7 +27,7 @@ end
function c50684552.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c50684552.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c50684552.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -14,6 +14,7 @@ function c51555725.initial_effect(c)
e2:SetDescription(aux.Stringid(51555725,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c51555725.condition)
e2:SetTarget(c51555725.target)
......@@ -31,7 +32,8 @@ end
function c51555725.filter(c)
return c:IsFaceup() and c:IsSetCard(0x24) and c:IsDestructable()
end
function c51555725.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c51555725.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c51555725.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c51555725.filter,tp,LOCATION_MZONE,0,1,1,nil)
......
......@@ -29,7 +29,7 @@ function c52824910.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c52824910.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -23,13 +23,13 @@ function c54913680.filter(c,e,tp)
end
function c54913680.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingTarget(c54913680.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c54913680.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c54913680.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c54913680.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c54913680.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -19,7 +19,7 @@ end
function c56043446.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
......@@ -39,9 +39,10 @@ function c56768355.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c56768355.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,e:GetHandler())
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c)
end
end
function c56768355.indcon(e)
......
......@@ -58,7 +58,7 @@ function c59509952.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c59509952.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c59509952.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -25,7 +25,7 @@ end
function c60434101.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c60434101.filter(chkc,c:GetAttack()) end
if chk==0 then return Duel.IsExistingMatchingCard(c60434101.filter,tp,0,LOCATION_MZONE,1,nil,c:GetAttack()) end
if chk==0 then return Duel.IsExistingTarget(c60434101.filter,tp,0,LOCATION_MZONE,1,nil,c:GetAttack()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c60434101.filter,tp,0,LOCATION_MZONE,1,1,nil,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
......
......@@ -181,7 +181,7 @@ function c67030233.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c67030233.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c67030233.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -26,7 +26,7 @@ function c68124775.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c68124775.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c68124775.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -18,14 +18,14 @@ function c70284332.initial_effect(c)
e2:SetOperation(c70284332.desop)
c:RegisterEffect(e2)
end
function c70284332.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsType(TYPE_SYNCHRO) and c:IsControlerCanBeChanged()
function c70284332.filter(c,e,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeEffectTarget(e) and c:IsControlerCanBeChanged()
end
function c70284332.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c70284332.filter(chkc,1-tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(c70284332.filter,1,nil,1-tp) end
if chkc then return eg:IsContains(chkc) and c70284332.filter(chkc,e,1-tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(c70284332.filter,1,nil,e,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=eg:FilterSelect(tp,c70284332.filter,1,1,nil,1-tp)
local g=eg:FilterSelect(tp,c70284332.filter,1,1,nil,e,1-tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
......
......@@ -11,7 +11,7 @@ function c70391588.initial_effect(c)
c:RegisterEffect(e1)
end
function c70391588.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsCanBeEffectTarget(e)
and Duel.IsPlayerCanSpecialSummonMonster(tp,70391589,0,0x4011,0,0,c:GetLevel(),RACE_SPELLCASTER,ATTRIBUTE_DARK)
end
function c70391588.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -91,7 +91,7 @@ function c71645242.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local atk=g:GetSum(Card.GetAttack)
local sc=g:FilterCount(Card.IsControler,nil,tp)
if chk==0 then return e:GetHandler():IsDestructable(e) and g:GetCount()>0 and (Duel.GetLocationCount(tp,LOCATION_MZONE)>-sc)
and Duel.IsExistingMatchingCard(c71645242.filter2,tp,LOCATION_GRAVE,0,1,nil,atk,e,tp) end
and Duel.IsExistingTarget(c71645242.filter2,tp,LOCATION_GRAVE,0,1,nil,atk,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectTarget(tp,c71645242.filter2,tp,LOCATION_GRAVE,0,1,1,nil,atk,e,tp)
e:SetLabel(atk)
......
......@@ -56,15 +56,15 @@ function c72192100.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c72192100.filter(c,e,tp)
return c:IsCode(35975813) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c72192100.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) end
if chkc then return eg:IsContains(chkc) and c72192100.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(c72192100.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,c72192100.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g:GetFirst())
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c72192100.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -20,10 +20,10 @@ function c72204747.filter2(c,lv,e,sp)
end
function c72204747.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c72204747.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c72204747.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp)
if chk==0 then return Duel.IsExistingTarget(c72204747.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(72204747,0))
local sg=Duel.SelectTarget(tp,c72204747.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SelectTarget(tp,c72204747.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c72204747.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -42,12 +42,13 @@ function c74367458.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c74367458.filter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c74367458.filter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c74367458.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,e:GetHandler())
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c)
end
end
......@@ -34,6 +34,7 @@ function c76297408.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c76297408.rfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(76297408,1)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.PayLPCost(tp,500)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,c76297408.rfilter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
......
......@@ -196,7 +196,7 @@ function c7841112.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c7841112.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c7841112.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -10,6 +10,7 @@ end
function c81332143.activate(e,tp,eg,ep,ev,re,r,rp)
local opt=0
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_HAND,0,1,nil,14731897) and Duel.SelectYesNo(tp,aux.Stringid(81332143,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_HAND,0,1,1,nil,14731897)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
......
......@@ -63,7 +63,7 @@ function c85602018.spop(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(c85602018.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(85602018,0)) then
Duel.Hint(HINT_CARD,0,85602018)
Duel.Hint(HINT_OPSELECTED,tp,HINTMSG_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c85602018.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
e:GetLabelObject():SetLabel(2)
......
......@@ -22,6 +22,7 @@ function c86778566.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabel(opt)
if opt==0 then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
else e:SetProperty(0) end
end
......@@ -33,7 +34,7 @@ function c86778566.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
......@@ -46,7 +47,7 @@ function c86778566.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
end
end
......@@ -4,7 +4,7 @@ function c86840720.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86840720,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_MZONE)
......@@ -18,8 +18,8 @@ function c86840720.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function c86840720.filter(c,e,tp)
return c:IsSetCard(0x35) and c:GetPreviousLocation()==LOCATION_HAND and c:GetControler()==tp
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x35) and c:IsPreviousLocation(LOCATION_HAND) and c:IsControler(tp)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86840720.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c86840720.filter(chkc,e,tp) end
......
......@@ -20,12 +20,13 @@ function c90407382.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(c90407382.filter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c90407382.filter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c90407382.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,e:GetHandler())
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c)
end
end
......@@ -17,11 +17,13 @@ function c92854392.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local at=Duel.GetAttackTarget()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=at end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,at) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,at)
end
function c92854392.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangeAttackTarget(tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
......
......@@ -27,18 +27,17 @@ function c93108433.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g2=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,g1:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,g2,g2:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,g2:GetCount())
end
function c93108433.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g2=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local tc=g1:GetFirst()
if tc:IsRelateToEffect(e) then
if g2:GetCount()==0 then return end
Duel.SendtoDeck(g1,nil,2,REASON_EFFECT)
Duel.SendtoDeck(g2,nil,2,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=g:GetCount()
if ct>0 and tc:IsRelateToEffect(e) then
g:AddCard(tc)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,g2:GetCount(),REASON_EFFECT)
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
......@@ -22,7 +22,7 @@ function c94374859.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():GetControler()==tp
end
function c94374859.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToGrave() end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,1,nil)
......
......@@ -39,7 +39,7 @@ function c9848939.filter(c)
return c:IsType(TYPE_DUAL) and c:IsAbleToHand()
end
function c9848939.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c9848939.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c9848939.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9848939.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -12,19 +12,26 @@ end
function c99189322.filter(c)
return c:GetFlagEffect(36690018)~=0
end
function c99189322.rfilter(c)
return c:IsSetCard(0x5) and c:IsAbleToRemove()
end
function c99189322.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c99189322.filter(chkc) end
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c99189322.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,0x5) end
and Duel.IsExistingTarget(c99189322.rfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c99189322.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c99189322.rfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:SetLabelObject(g:GetFirst())
end
function c99189322.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and c99189322.filter(tc) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local regc=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,0x5):GetFirst()
if not regc then return end
local regc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==regc then tc=g:GetNext() end
if tc:IsRelateToEffect(e) and tc:IsFaceup() and c99189322.filter(tc) and regc:IsRelateToEffect(e) then
Duel.Remove(regc,POS_FACEUP,REASON_EFFECT)
local regfun=regc.arcanareg
if not regfun then return 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