Commit a585c9d5 authored by VanillaSalt's avatar VanillaSalt

fix

parent 1c71e31b
......@@ -98,23 +98,24 @@ function c28265983.descon2(e,tp,eg,ep,ev,re,r,rp)
end
function c28265983.descost2(e,tp,eg,ep,ev,re,r,rp,chk)
local lp=Duel.GetLP(tp)-Duel.GetLP(1-tp)
if chk==0 then return Duel.CheckLPCost(tp,lp) end
if chk==0 then return Duel.CheckLPCost(tp,lp) and Duel.GetFlagEffect(tp,28265984)==0 end
Duel.PayLPCost(tp,lp)
e:SetLabel(lp)
Duel.RegisterFlagEffect(tp,28265984,RESET_PHASE+RESET_END,0,1)
end
function c28265983.desfilter2(c,num)
return c:IsFaceup() and c:IsDestructable() and c:GetAttack()<=num
return c:IsFaceup() and c:IsAttackBelow(num) and c:IsDestructable()
end
function c28265983.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
local lp=Duel.GetLP(tp)-Duel.GetLP(1-tp)
if chk==0 then return Duel.IsExistingMatchingCard(c28265983.desfilter2,tp,0,LOCATION_MZONE,1,nil,lp) and Duel.GetFlagEffect(tp,28265984)==0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_MZONE)
Duel.RegisterFlagEffect(tp,28265984,RESET_PHASE+RESET_END,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c28265983.desfilter2,tp,0,LOCATION_MZONE,1,nil,lp) end
local g=Duel.GetMatchingGroup(c28265983.desfilter2,tp,0,LOCATION_MZONE,nil,e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c28265983.desop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local num=e:GetLabel()
local g=Duel.GetMatchingGroup(c28265983.desfilter1,tp,0,LOCATION_MZONE,nil)
local g=Duel.GetMatchingGroup(c28265983.desfilter2,tp,0,LOCATION_MZONE,nil,num)
if g:GetCount()==0 then return end
local dg=Group.CreateGroup()
repeat
......
......@@ -48,6 +48,7 @@ function c28865322.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c28865322.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
......
......@@ -11,7 +11,7 @@ function c31044787.initial_effect(c)
c:RegisterEffect(e1)
end
function c31044787.filter(c)
return c:IsFaceup() and c:GetAttack()>0 and c:IsAbleToDeck()
return c:IsFaceup() and c:GetAttack()>0
end
function c31044787.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c31044787.filter,tp,0,LOCATION_MZONE,nil)
......@@ -20,7 +20,7 @@ function c31044787.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c31044787.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_MZONE)
end
function c31044787.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c31044787.filter,tp,0,LOCATION_MZONE,nil)
......@@ -28,11 +28,11 @@ function c31044787.activate(e,tp,eg,ep,ev,re,r,rp)
local lp=Duel.GetLP(tp)
local sg=Group.CreateGroup()
while atk>lp and g:GetCount()>0 do
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
sg:AddCard(tc)
g:RemoveCard(tc)
atk=g:GetSum(Card.GetAttack)
atk=atk-tc:GetAttack()
end
Duel.SendtoDeck(sg,nil,2,REASON_RULE)
end
......@@ -16,6 +16,7 @@ function c31222701.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31222701.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
local g=Duel.GetMatchingGroup(c31222701.filter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c31222701.thfilter1(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
......
......@@ -39,8 +39,14 @@ function c39387565.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c39387565.spop1)
c39387565.sptg1(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(c39387565.nop)
end
end
end
function c39387565.nop(e,tp,eg,ep,ev,re,r,rp)
end
function c39387565.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3b)
end
......
......@@ -22,6 +22,7 @@ function c65472618.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c65472618.regcon)
e3:SetTarget(c65472618.regtg)
e3:SetOperation(c65472618.regop)
c:RegisterEffect(e3)
end
......@@ -29,7 +30,7 @@ function c65472618.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not bc then return false end
if tc:IsControler(1-tp) then tc,bc=bc,tc end
if tc:IsControler(1-tp) then bc=tc end
e:SetLabelObject(bc)
return bc:IsFaceup()
end
......@@ -38,6 +39,7 @@ function c65472618.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD+REASON_COST,nil)
end
function c65472618.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsFaceup() and bc:IsControler(1-tp) then
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -57,6 +59,12 @@ function c65472618.regcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp 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)))
end
function c65472618.thfilter(c)
return c:IsAttackBelow(2000) and c:IsRace(RACE_WARRIOR+RACE_SPELLCASTER) and not c:IsCode(65472618)
end
function c65472618.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65472618.thfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c65472618.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -66,12 +74,13 @@ function c65472618.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c65472618.thfilter(c)
return c:IsAttackBelow(2000) and c:IsRace(RACE_WARRIOR+RACE_SPELLCASTER) and not c:IsCode(65472618) and c:IsAbleToHand()
function c65472618.thfilter2(c)
return c65472618.thfilter(c) and c:IsAbleToHand()
end
function c65472618.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,65472618)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c65472618.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c65472618.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -8,7 +8,7 @@ function c65872270.initial_effect(c)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
......@@ -31,7 +31,7 @@ end
function c65872270.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if c65872270.descon(e,tp,eg,ep,ev,re,r,rp) and c65872270.destg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(65872270,0)) then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e:SetOperation(c65872270.desop)
c65872270.destg(e,tp,eg,ep,ev,re,r,rp,1)
else
......@@ -46,11 +46,11 @@ function c65872270.descon(e,tp,eg,ep,ev,re,r,rp)
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c65872270.desfilter(c)
return c:IsSetCard(0xc8) and c:IsDestructable()
return c:IsFaceup() and c:IsSetCard(0xc8) and c:IsDestructable()
end
function c65872270.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65872270.desfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil)
and e:GetHandler():GetFlagEffect(65872270)==0 end
e:GetHandler():RegisterFlagEffect(65872270,RESET_PHASE+RESET_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
......@@ -67,7 +67,7 @@ function c65872270.desop(e,tp,eg,ep,ev,re,r,rp)
if ct2>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rg=g:Select(tp,1,ct2,nil)
local rg=g:Select(tp,ct2,ct2,nil)
Duel.SendtoHand(rg,nil,REASON_EFFECT)
end
end
......@@ -75,7 +75,7 @@ function c65872270.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c65872270.thfilter(c)
return c:IsSetCard(0xc8) and c:IsFaceup() and c:IsAbleToHand()
return c:IsFaceup() and c:IsSetCard(0xc8) and c:IsAbleToHand()
end
function c65872270.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65872270.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
......@@ -86,5 +86,6 @@ function c65872270.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c65872270.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -25,7 +25,7 @@ function c67310848.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(67310848)~=0
end
function c67310848.thfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsAbleToHand()
return c:GetLevel()==7 and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c67310848.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67310848.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -20,7 +20,7 @@ end
function c67443336.target(e,tp,eg,ep,ev,re,r,rp,chk)
local t=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
local s=Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_ONFIELD,0)
if chk==0 then return Duel.IsPlayerCanDraw(t-s) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,t-s) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(t-s)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,t-s)
......@@ -29,5 +29,7 @@ function c67443336.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local t=Duel.GetFieldGroupCount(p,0,LOCATION_ONFIELD)
local s=Duel.GetFieldGroupCount(p,LOCATION_HAND+LOCATION_ONFIELD,0)
Duel.Draw(p,t-s,REASON_EFFECT)
if t>s then
Duel.Draw(p,t-s,REASON_EFFECT)
end
end
......@@ -13,7 +13,7 @@ function c67616300.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCondition(c67616300.damcon1)
e2:SetValue(c67616300.damval)
e2:SetValue(0)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetTargetRange(0,1)
......@@ -64,9 +64,6 @@ function c67616300.damcon2(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(1-tp)<Duel.GetLP(tp)
end
function c67616300.damval(e,re,val,r,rp,rc)
return 0
end
function c67616300.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
......
......@@ -51,7 +51,7 @@ end
function c70479321.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=e:GetLabelObject()
if chkc then return chkc==tc end
if chk==0 then return tc:IsOnField() and tc:IsCanBeEffectTarget() end
if chk==0 then return tc:IsOnField() and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
end
function c70479321.atkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -51,6 +51,7 @@ function c79555535.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c79555535.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
......@@ -38,7 +38,8 @@ function c92693205.descon(e,tp,eg,ep,ev,re,r,rp)
end
function c92693205.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c92693205.desop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c92693205.cfilter,tp,LOCATION_MZONE,0,e:GetHandler())
......
......@@ -44,7 +44,7 @@ function c92746535.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return sc:IsDestructable()
and Duel.IsExistingMatchingCard(c92746535.thfilter,tp,LOCATION_DECK,0,1,nil,sc:GetOriginalCode()) end
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c92746535.thop(e,tp,eg,ep,ev,re,r,rp)
......
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