Commit 1c19674d authored by VanillaSalt's avatar VanillaSalt

fix

parent 9213d982
......@@ -3,6 +3,7 @@ function c12275533.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12275533,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
......@@ -39,7 +40,7 @@ function c12275533.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c12275533.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,tp,0,false,false) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c12275533.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -9,10 +9,10 @@ function c13391185.initial_effect(c)
e1:SetCondition(c13391185.eqcon1)
e1:SetValue(TYPE_NORMAL+TYPE_MONSTER)
c:RegisterEffect(e1)
--spsummon
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13391185,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
......@@ -31,7 +31,7 @@ function c13391185.eqcon2(e)
return eg and eg:IsExists(Card.IsSetCard,1,nil,0x207a)
end
function c13391185.thcon(e,tp,eg,ep,ev,re,r,rp)
return c13391185.eqcon2(e) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
return c13391185.eqcon2(e)
end
function c13391185.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,13391185)==0 end
......@@ -43,12 +43,12 @@ end
function c13391185.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c13391185.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13391185.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c13391185.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c13391185.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x207a) and c:IsType(TYPE_EQUIP)
return c:IsFaceup() and c:IsSetCard(0x207a) and c:IsType(TYPE_EQUIP) and c:IsDestructable()
end
function c13391185.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -63,7 +63,7 @@ function c14553285.descost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x3001,2,REASON_COST)
end
function c14553285.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
......
......@@ -16,7 +16,7 @@ end
function c1539051.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c1539051.gfilter,tp,LOCATION_MZONE,0,nil)
local ct=g:GetClassCount(Card.GetOriginalCode)
local ct=g:GetClassCount(Card.GetCode)
e:SetLabel(ct)
return ct>0 and Duel.IsPlayerCanDraw(tp,ct)
end
......@@ -27,6 +27,6 @@ end
function c1539051.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c1539051.gfilter,tp,LOCATION_MZONE,0,nil)
local ct=g:GetClassCount(Card.GetOriginalCode)
local ct=g:GetClassCount(Card.GetCode)
Duel.Draw(p,ct,REASON_EFFECT)
end
......@@ -45,7 +45,7 @@ function c18807108.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c18807108.rcon(e)
return e:GetOwner():IsRelateToCard(e:GetHandler())
return not e:GetHandler():IsImmuneToEffect(e) and e:GetOwner():IsRelateToCard(e:GetHandler())
end
function c18807108.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -32,7 +32,7 @@ function c20686759.filter(c)
return c:IsFaceup() and c:IsSetCard(0x26)
end
function c20686759.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and c20686759.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c20686759.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20686759.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c20686759.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......@@ -46,7 +46,7 @@ function c20686759.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c20686759.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec and ec:IsReason(REASON_DESTROY)
end
function c20686759.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -40,7 +40,7 @@ function c26285788.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function c26285788.effectcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(26285789)>0
return Duel.GetFlagEffect(tp,26285789)>0
end
function c26285788.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
......@@ -50,7 +50,7 @@ function c26285788.filter2(c)
end
function c26285788.effectop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,26285789)
local ct=Duel.GetFlagEffect(26285789)
local ct=Duel.GetFlagEffect(tp,26285789)
if ct==1 then
Duel.Draw(tp,1,REASON_EFFECT)
elseif ct==2 then
......
......@@ -29,7 +29,8 @@ function c27827272.filter2(c,atk)
return c:IsFaceup() and c:IsDefenceBelow(atk) and c:IsDestructable()
end
function c27827272.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c27827272.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c27827272.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c27827272.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c27827272.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local dg=Duel.GetMatchingGroup(c27827272.filter2,tp,0,LOCATION_MZONE,nil,g:GetFirst():GetAttack())
......
......@@ -50,8 +50,8 @@ function c28201945.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c28201945.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft)
local tc=g:GetFirst()
if tc then
if ft>0 and tc:IsAbleToHand() and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(28201945,1)) then
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectYesNo(tp,aux.Stringid(28201945,1))) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
......@@ -63,10 +63,7 @@ function c28423537.splimit(e,c,tp,sumtp,sumpos)
return not c:IsRace(RACE_FIEND)
end
function c28423537.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Destroy(c,REASON_EFFECT)
end
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c28423537.rfilter(c)
return c:IsSetCard(0x45) and c:IsAbleToRemoveAsCost()
......
......@@ -2,9 +2,8 @@
function c29616929.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c29616929.condition)
e1:SetTarget(c29616929.target)
......@@ -30,17 +29,17 @@ function c29616929.checkop(e,tp,eg,ep,ev,re,r,rp)
end
function c29616929.condition(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
return ep~=tp and loc==LOCATION_MZONE and re:GetHandler():GetFlagEffect(29616929)>0 and Duel.IsChainNegatable(ev)
return ep~=tp and loc==LOCATION_MZONE and re:GetHandler():GetFlagEffect(29616929)>0 and Duel.IsChainDisablable(ev)
end
function c29616929.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c29616929.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
......
......@@ -48,7 +48,7 @@ function c30230789.filter(c)
return c:IsSetCard(0x11) and c:IsAbleToHand()
end
function c30230789.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30230789.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c30230789.op(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -68,8 +68,8 @@ function c31480215.splimit(e,c,tp,sumtp,sumpos)
return not c:IsAttribute(ATTRIBUTE_WIND)
end
function c31480215.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,31480215)==0 and Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_TOKEN) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_TOKEN)
if chk==0 then return Duel.GetFlagEffect(tp,31480215)==0 and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x101b) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x101b)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,31480215,RESET_PHASE+PHASE_END,0,1)
end
......
......@@ -15,6 +15,7 @@ function c31764700.initial_effect(c)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_BATTLE_END)
e3:SetOperation(c31764700.batop)
c:RegisterEffect(e3)
......@@ -37,14 +38,16 @@ end
function c31764700.batop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc then
if bc and c:IsAttackPos() then
e:SetLabel(bc:GetAttack())
e:SetLabelObject(bc)
else
e:SetLabelObject(nil)
end
end
function c31764700.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetHandler():GetBattleTarget()
if chk==0 then return bc and e:GetHandler():IsAttackPos() end
local bc=e:GetLabelObject():GetLabelObject()
if chk==0 then return bc end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetLabelObject():GetLabel())
if bc:IsDestructable() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
......@@ -52,7 +55,7 @@ function c31764700.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c31764700.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
local bc=e:GetHandler():GetBattleTarget()
local bc=e:GetLabelObject():GetLabelObject()
if bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
end
......
......@@ -125,7 +125,7 @@ function c31930787.dircost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c31930787.dirop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsFacedown() and not c:IsRelateToEffect(e) then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
......
......@@ -14,7 +14,7 @@ end
function c33184236.cfilter(c,tp)
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return c:IsControler(tp) and c:IsSetCard(0x11) and ((pp==0x1 and np==0x4) or (pp==0x4 and np==0x1) or (pp==0x8 and np==0x1))
return c:IsControler(tp) and c:IsSetCard(0x11) and ((pp==0x1 and np==0x4) or (pp==0x4 and np==0x1))
end
function c33184236.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33184236.cfilter,1,nil,tp)
......
......@@ -17,7 +17,7 @@ function c38167722.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST)
end
function c38167722.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 end
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
......@@ -27,16 +27,16 @@ function c38167722.cfilter(c)
end
function c38167722.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local dis=false
if Duel.IsChainDisablable(0) then
local g=Duel.GetMatchingGroup(c38167722.cfilter,p,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(1-p,aux.Stringid(38167722,0)) then
Duel.Hint(HINT_SELECTMSG,1-p,HINTMSG_CONFIRM)
local sg=g:Select(1-p,1,1,nil)
Duel.ConfirmCards(p,sg)
Duel.ShuffleHand(1-p)
dis=true
local g=Duel.GetMatchingGroup(c38167722.cfilter,p,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(1-p,aux.Stringid(38167722,0)) then
Duel.Hint(HINT_SELECTMSG,1-p,HINTMSG_CONFIRM)
local sg=g:Select(1-p,1,1,nil)
Duel.ConfirmCards(p,sg)
Duel.ShuffleHand(1-p)
if Duel.IsChainDisablable(0) then
Duel.NegateEffect(0)
return
end
end
if not dis then Duel.Draw(p,d,REASON_EFFECT) end
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -5,6 +5,7 @@ function c39019325.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c39019325.target)
e1:SetOperation(c39019325.activate)
......@@ -18,11 +19,12 @@ end
function c39019325.dfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c39019325.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c39019325.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c39019325.rfilter(chkc,e) end
if chk==0 then return Duel.IsExistingTarget(c39019325.rfilter,tp,LOCATION_MZONE,0,1,nil,e)
and Duel.IsExistingMatchingCard(c39019325.dfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectTarget(tp,c39019325.rfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e)
local rg=Duel.SelectTarget(tp,c39019325.rfilter,tp,LOCATION_MZONE,0,1,1,nil,e)
local g=Duel.GetMatchingGroup(c39019325.dfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
......
......@@ -12,15 +12,17 @@ function c43487744.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(53129443)
end
function c43487744.activate(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetValue(c43487744.indval)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(ev)
e1:SetLabel(cid)
Duel.RegisterEffect(e1,tp)
end
function c43487744.indval(e,re,rp)
return Duel.GetCurrentChain()==e:GetLabel()
return Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)==e:GetLabel()
end
......@@ -31,7 +31,6 @@ function c43841694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g2=Duel.SelectTarget(tp,c43841694.filter2,tp,LOCATION_REMOVED,0,1,2,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
end
function c43841694.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -8,7 +8,7 @@ function c44656491.initial_effect(c)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c44656491.atktarget)
......
......@@ -43,7 +43,7 @@ end
function c48576971.effcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_BATTLE)
return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_BATTLE) and ec:GetPreviousControler()==tp
end
function c48576971.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -32,18 +32,18 @@ function c5037726.cfilter(c)
end
function c5037726.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local dis=false
if Duel.IsChainDisablable(0) then
local g=Duel.GetMatchingGroup(c5037726.cfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(5037726,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM)
local sg=g:Select(1-tp,1,1,nil)
Duel.ConfirmCards(tp,sg)
Duel.ShuffleHand(1-tp)
dis=true
local g=Duel.GetMatchingGroup(c5037726.cfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(5037726,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM)
local sg=g:Select(1-tp,1,1,nil)
Duel.ConfirmCards(tp,sg)
Duel.ShuffleHand(1-tp)
if Duel.IsChainDisablable(0) then
Duel.NegateEffect(0)
return
end
end
if not dis and tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -59,10 +59,10 @@ function c51589188.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c51589188.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c51589188.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51589188.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
if chkc then return chkc:IsOnField() and c51589188.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51589188.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c51589188.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,c51589188.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c51589188.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -30,7 +30,7 @@ function c57827484.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
......@@ -23,7 +23,8 @@ function c58185394.sdfilter(c)
return c:IsFaceup() and c:IsCode(99171160)
end
function c58185394.sdcon(e)
return not Duel.IsExistingMatchingCard(c58185394.sdfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and not Duel.IsExistingMatchingCard(c58185394.sdfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c58185394.dmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -49,7 +49,7 @@ end
function c66976526.cfilter(c,tp)
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return c:IsSetCard(0x11) and c:IsControler(tp) and ((pp==0x1 and np==0x4) or (pp==0x4 and np==0x1) or (pp==0x8 and np==0x1))
return c:IsSetCard(0x11) and c:IsControler(tp) and ((pp==0x1 and np==0x4) or (pp==0x4 and np==0x1))
end
function c66976526.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c66976526.cfilter,1,nil,tp)
......
......@@ -26,12 +26,16 @@ function c67949763.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c67949763.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>2
and Duel.IsPlayerCanSpecialSummonMonster(tp,67949764,0x87,0x4011,atk,0,1,RACE_FIEND,ATTRIBUTE_DARK) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>2 then
local rfid=tc:GetRealFieldID()
local atk=0
local cr=false
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
atk=tc:GetAttack()
cr=true
end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,67949764,0x87,0x4011,atk,0,1,RACE_FIEND,ATTRIBUTE_DARK) then return end
if cr then
local de=Effect.CreateEffect(e:GetHandler())
de:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
de:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -39,8 +43,6 @@ function c67949763.activate(e,tp,eg,ep,ev,re,r,rp)
de:SetOperation(c67949763.desop)
de:SetLabel(rfid)
tc:RegisterEffect(de,true)
atk=tc:GetAttack()
cr=true
end
for i=1,3 do
local token=Duel.CreateToken(tp,67949764)
......
......@@ -23,17 +23,20 @@ function c69402394.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c69402394.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<2 or Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<2 then return end
if Duel.IsChainDisablable(0) and Duel.SelectYesNo(1-tp,aux.Stringid(69402394,0)) then
if Duel.SelectYesNo(1-tp,aux.Stringid(69402394,0)) then
Duel.DiscardHand(1-tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g1=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,2,2,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISCARD)
local g2=Duel.SelectMatchingCard(1-tp,aux.TRUE,1-tp,LOCATION_HAND,0,2,2,nil)
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_DISCARD)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
Duel.Draw(1-tp,2,REASON_EFFECT)
if Duel.IsChainDisablable(0) then
Duel.NegateEffect(0)
return
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g1=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,2,2,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISCARD)
local g2=Duel.SelectMatchingCard(1-tp,aux.TRUE,1-tp,LOCATION_HAND,0,2,2,nil)
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_DISCARD)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
Duel.Draw(1-tp,2,REASON_EFFECT)
end
......@@ -65,8 +65,8 @@ function c7452945.eqcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp)
end
function c7452945.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,c7452945)==0 end
Duel.RegisterFlagEffect(tp,c7452945,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return Duel.GetFlagEffect(tp,7452945)==0 end
Duel.RegisterFlagEffect(tp,7452945,RESET_PHASE+PHASE_END,0,1)
end
function c7452945.eqfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x107a) and c:IsRace(RACE_WARRIOR)
......
......@@ -60,7 +60,7 @@ end
function c75180828.desfilter(c)
return c:IsDestructable()
end
function c75180828.destg(e,tp,eg,ep,ev,re,r,rp,chk)
function c75180828.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c75180828.desfilter(chkc) end
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(c75180828.descount,tp,LOCATION_GRAVE,0,nil)
......
......@@ -4,14 +4,14 @@ function c8323633.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c8323633.target)
e1:SetOperation(c8323633.operation)
c:RegisterEffect(e1)
end
function c8323633.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
function c8323633.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,564)
local ac=Duel.AnnounceCard(tp)
local c=e:GetHandler()
c:SetHint(CHINT_CARD,ac)
--remove
local e1=Effect.CreateEffect(c)
......
......@@ -41,12 +41,6 @@ function c83746708.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c83746708.filter(c)
return c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)
end
function c83746708.value(e,c)
local g=Duel.GetMatchingGroup(c83746708.filter,tp,LOCATION_ONFIELD,0,nil)
return g:GetCount()*500
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil,TYPE_SPELL+TYPE_TRAP)*500
end
......@@ -15,7 +15,7 @@ end
function c87836938.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local et=c:GetEquipCount()
if et>0 and c:IsReason(REASON_EFFECT) and c:IsLocation(LOCATION_GRAVE) then
if et>0 and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsLocation(LOCATION_GRAVE) then
e:SetLabel(et)
return true
else return false end
......
......@@ -22,7 +22,7 @@ function c93671934.initial_effect(c)
c:RegisterEffect(e3)
end
function c93671934.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,1000,REASON_EFFECT)
Duel.Recover(eg:GetFirst():GetControler(),1000,REASON_EFFECT)
end
function c93671934.filter(c)
return c:GetEquipTarget()~=nil or c:IsReason(REASON_LOST_TARGET)
......@@ -31,5 +31,11 @@ function c93671934.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c93671934.filter,1,nil)
end
function c93671934.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT)
local g=eg:Filter(c93671934.filter,nil)
if g:IsExists(Card.IsControler,1,nil,tp) then
Duel.Damage(tp,1000,REASON_EFFECT)
end
if g:IsExists(Card.IsControler,1,nil,1-tp) then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
......@@ -27,15 +27,20 @@ function c967928.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_DP)
e1:SetCode(EFFECT_CANNOT_DRAW)
if Duel.GetTurnPlayer()==p and Duel.GetCurrentPhase()==PHASE_DRAW then
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN,2)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c967928.skipcon)
else
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetLabel(0)
end
e1:SetCondition(c967928.skipcon)
Duel.RegisterEffect(e1,p)
local e2=e1:Clone()
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetValue(0)
Duel.RegisterEffect(e2,p)
else
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -48,7 +53,7 @@ function c967928.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c967928.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetCurrentPhase()==PHASE_DRAW
end
function c967928.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
......
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