Commit 6d5aa680 authored by POLYMER's avatar POLYMER

fix

parent 40c44f05
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.desfilter(c) function cm.desfilter(c)
return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5 return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5
......
...@@ -7,13 +7,14 @@ function cm.initial_effect(c) ...@@ -7,13 +7,14 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e4=e1:Clone()
e2:SetCondition(cm.hcon) e4:SetCondition(cm.hcon)
e2:SetTarget(cm.htg) e4:SetTarget(cm.htg)
e2:SetOperation(cm.hop) e4:SetOperation(cm.hop)
c:RegisterEffect(e2) c:RegisterEffect(e4)
--change effect type --change effect type
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
...@@ -35,10 +36,10 @@ function cm.initial_effect(c) ...@@ -35,10 +36,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.desfilter(c) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5 if chk==0 then return true end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -50,18 +50,18 @@ function cm.spcost(e,c,tp,st) ...@@ -50,18 +50,18 @@ function cm.spcost(e,c,tp,st)
return Duel.GetFlagEffect(tp,m)~=0 or Duel.IsPlayerAffectedByEffect(tp,60010230) return Duel.GetFlagEffect(tp,m)~=0 or Duel.IsPlayerAffectedByEffect(tp,60010230)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() Duel.RegisterFlagEffect(1,m,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(0,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.fil(c) function cm.fil(c)
return c:IsCanHaveCounter(0x62a) and Duel.IsCanAddCounter(tp,0x62a,1,c) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:GetCounter(0x62a)<14 return c:IsCanHaveCounter(0x62a) and Duel.IsCanAddCounter(tp,0x62a,1,c) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:GetCounter(0x62a)<14
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.fil,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.fil,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.fil,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.fil,tp,LOCATION_MZONE,0,e:GetHandler())
for tc in aux.Next(g) do for tc in aux.Next(g) do
tc:AddCounter(0x62a,8) tc:AddCounter(0x62a,8)
end end
......
...@@ -3,7 +3,7 @@ local cm,m,o=GetID() ...@@ -3,7 +3,7 @@ local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
...@@ -35,12 +35,12 @@ function cm.initial_effect(c) ...@@ -35,12 +35,12 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Recover(tp,1000,REASON_EFFECT) Duel.Recover(tp,1000,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,m,0,0,1) Duel.RegisterFlagEffect(tp,m+40000000,0,0,1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -57,17 +57,26 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,17 +57,26 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
function cm.kop(e,tp,eg,ep,ev,re,r,rp) function cm.kop(e,tp,eg,ep,ev,re,r,rp)
local num=Duel.GetFlagEffect(tp,m) local num=Duel.GetFlagEffect(tp,m+40000000)
if Duel.GetLP(tp)==0 and num~=0 then --Debug.Message(Duel.GetLP(tp)==0)
--Debug.Message(num~=0)
if Duel.GetLP(tp)<=0 and num~=0 then
--Debug.Message("1")
Duel.SetLP(tp,8000) Duel.SetLP(tp,8000)
Duel.ResetFlagEffect(tp,m) if num~=1 then
Duel.ResetFlagEffect(tp,m+40000000)
for i=1,num-1 do for i=1,num-1 do
Duel.RegisterFlagEffect(tp,m,0,0,1) Duel.RegisterFlagEffect(tp,m+40000000,0,0,1)
end
else
Duel.ResetFlagEffect(tp,m+40000000)
end end
end end
end end
function cm.nlosecon(e,tp,eg,ep,ev,re,r,rp) function cm.nlosecon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)~=0 return Duel.GetFlagEffect(e:GetHandler(),m+40000000)~=0
end end
function cm.hcon(e,tp,eg,ep,ev,re,r,rp) function cm.hcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -3,7 +3,7 @@ local cm,m,o=GetID() ...@@ -3,7 +3,7 @@ local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_COUNTER+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -6,11 +6,13 @@ function cm.initial_effect(c) ...@@ -6,11 +6,13 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetProperty(0)
e2:SetCondition(cm.hcon) e2:SetCondition(cm.hcon)
e2:SetTarget(cm.htg) e2:SetTarget(cm.htg)
e2:SetOperation(cm.hop) e2:SetOperation(cm.hop)
...@@ -26,7 +28,7 @@ function cm.initial_effect(c) ...@@ -26,7 +28,7 @@ function cm.initial_effect(c)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
...@@ -36,7 +38,7 @@ function cm.initial_effect(c) ...@@ -36,7 +38,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -26,7 +26,7 @@ function cm.initial_effect(c) ...@@ -26,7 +26,7 @@ function cm.initial_effect(c)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_SZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_SZONE,1,nil) end
......
...@@ -51,8 +51,8 @@ function cm.xyzop(e,tp,chk) ...@@ -51,8 +51,8 @@ function cm.xyzop(e,tp,chk)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer() Duel.RegisterFlagEffect(1,m,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,m+10000000,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(0,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp) function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -83,19 +83,14 @@ function cm.acon(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,19 +83,14 @@ function cm.acon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_SZONE) return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_SZONE)
end end
function cm.afil(c,e,tp)
return c:IsCanHaveCounter(0x62a) and Duel.IsCanAddCounter(tp,0x62a,1,c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4)
end
function cm.atg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.atg(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(aux.TRUE,tp,LOCATION_GRAVE,0,1,nil) end
and Duel.IsExistingMatchingCard(cm.afil,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.aop(e,tp,eg,ep,ev,re,r,rp) function cm.aop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE,0,1,5,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,cm.afil,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -96,6 +96,6 @@ end ...@@ -96,6 +96,6 @@ end
function cm.rop(e,tp,eg,ep,ev,re,r,rp) function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Remove(tc,nil,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)~=0 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)~=0 end
......
...@@ -6,11 +6,13 @@ function cm.initial_effect(c) ...@@ -6,11 +6,13 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetProperty(0)
e2:SetCondition(cm.hcon) e2:SetCondition(cm.hcon)
e2:SetTarget(cm.htg) e2:SetTarget(cm.htg)
e2:SetOperation(cm.hop) e2:SetOperation(cm.hop)
...@@ -37,7 +39,7 @@ function cm.initial_effect(c) ...@@ -37,7 +39,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.sfilter(c,e) function cm.sfilter(c,e)
return c:IsType(TYPE_SPELL) return c:IsType(TYPE_SPELL)
...@@ -139,7 +141,7 @@ function cm.acon(e,tp,eg,ep,ev,re,r,rp) ...@@ -139,7 +141,7 @@ function cm.acon(e,tp,eg,ep,ev,re,r,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_SZONE) return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_SZONE)
end end
function cm.afil(c) function cm.afil(c)
return c:IsLevelBelow(5) and c:GetTextAttack()>0 return c:IsCanHaveCounter(0x62a) and Duel.IsCanAddCounter(tp,0x62a,1,c) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:GetTextAttack()>0
end end
function cm.acost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.acost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.afil,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,cm.afil,1,nil) end
......
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -90,6 +90,8 @@ function cm.dtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -90,6 +90,8 @@ function cm.dtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
end end
function cm.dop(e,tp,eg,ep,ev,re,r,rp) function cm.dop(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.IsPlayerAffectedByEffect(tp,m) then loc=LOCATION_ONFIELD end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,loc,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,loc,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
......
...@@ -36,7 +36,7 @@ function cm.initial_effect(c) ...@@ -36,7 +36,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -92,9 +92,12 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,9 +92,12 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
if tc:GetCounter(0x62a)~=0 then num=num+tc:GetCounter(0x62a) end if tc:GetCounter(0x62a)~=0 then num=num+tc:GetCounter(0x62a) end
end end
if Duel.Release(sg,REASON_EFFECT) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
if sg:GetCount()==0 and Duel.Release(sg,REASON_EFFECT)~=0 then if sg:GetCount()==0 and Duel.Release(sg,REASON_EFFECT)~=0 then
e:GetHandler():AddCounter(0x62a,num) e:GetHandler():AddCounter(0x62a,num)
end end
end
end end
......
...@@ -36,10 +36,11 @@ function cm.initial_effect(c) ...@@ -36,10 +36,11 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND) and not e:GetHandler():IsLocation(LOCATION_HAND) return not e:GetHandler():IsLocation(LOCATION_HAND)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end local num=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return num>0 and Duel.IsPlayerCanDraw(tp,num) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
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