Commit 4e182ff0 authored by TanakaKotoha's avatar TanakaKotoha

fix

parent 7f3d6ac0
......@@ -37,7 +37,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
--cannot be target/battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD++EFFECT_TYPE_CONTINUOUS)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.actop)
......
......@@ -48,6 +48,17 @@ function cm.initial_effect(c)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
--Damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
end
function cm.spcost(e,c,tp)
return Duel.GetFlagEffect(tp,m)==0 or not c:IsLocation(LOCATION_DECK)
......@@ -80,7 +91,6 @@ function cm.spcon(e,c)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,0,nil)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -105,18 +115,4 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(dg)
Duel.CalculateDamage(dg:GetFirst(),c,true)
end
Duel.BreakEffect()
local tg=Duel.GetFieldGroup(tp,LOCATION_DECK,LOCATION_DECK)
local seed=tg:RandomSelect(tp,1)
local code=seed:GetFirst():GetOriginalCode()
local ct=code%cc+1
if ct==1 then
Duel.Damage(tp,atk,REASON_EFFECT)
elseif ct==2 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
else
local dg=g:RandomSelect(1-tp,1)
Duel.HintSelection(dg)
Duel.CalculateDamage(dg:GetFirst(),c,true)
end
end
\ No newline at end of file
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