Commit 6d5aa680 authored by POLYMER's avatar POLYMER

fix

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