Commit 6436a37f authored by TanakaKotoha's avatar TanakaKotoha

fix

parent e48dcd1c
......@@ -18,8 +18,8 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_DECK)
e2:SetCost(cm.cost)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
e2:SetValue(1)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,cm.chainfilter)
......@@ -54,24 +54,22 @@ function cm.initial_effect(c)
cm.eList={[0]={},[1]={},}
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 and not Duel.CheckPhaseActivity() and Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function cm.sptg1(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,0,tp,false,false) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
srre.codechangeop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
Duel.Recover(tp,4000,REASON_EFFECT)
local lp=Duel.GetLP(tp)
if lp>=cm.lplist[tp] then return end
......@@ -89,7 +87,11 @@ end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 and not Duel.CheckPhaseActivity() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 and not Duel.CheckPhaseActivity() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandlerPlayer()
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
......
......@@ -32,6 +32,9 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_SSET)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e33=e3:Clone()
e33:SetCode(EVENT_MSET)
c:RegisterEffect(e33)
end
function cm.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
......
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