Commit 15d4a4bb authored by REIKAI's avatar REIKAI 💬

update lua

parent 7dedce69
No preview for this file type
......@@ -13,29 +13,32 @@ function cm.desfilter(c)
return c:IsRace(RACE_DINOSAUR) and (c:IsFaceup() or not c:IsOnField())
end
function cm.desop(e,tp)
if rsop.SelectDestroy(tp,cm.desfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)<=0 then return end
local c=rscf.GetFaceUpSelf(e)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local op=rsop.SelectOption(tp,true,{m,2},#g>0,{m,3},c and true or false,{m,4})
if op==1 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
elseif op==2 then
g:SelectDestroy(tp,aux.TRUE,1,1,nil,{})
elseif op==3 then
if c:GetFlagEffect(m)<=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(rsreset.est)
c:RegisterEffect(e1)
c:RegisterFlagEffect(m,rsreset.est,0,1)
e:SetLabelObject(e1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 and Duel.Destroy(sg,REASON_EFFECT)>0 then
local c=rscf.GetFaceUpSelf(e)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local op=rsop.SelectOption(tp,true,{m,2},#g>0,{m,3},c and true or false,{m,4})
if op==1 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
elseif op==2 then
g:SelectDestroy(tp,aux.TRUE,1,1,nil,{})
elseif op==3 then
if c:GetFlagEffect(m)<=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(rsreset.est)
c:RegisterEffect(e1)
c:RegisterFlagEffect(m,rsreset.est,0,1)
e:SetLabelObject(e1)
end
local ce=e:GetLabelObject()
local ct=ce:GetValue()+1
ce:SetValue(ct)
c:SetHint(CHINT_NUMBER,ct)
end
local ce=e:GetLabelObject()
local ct=ce:GetValue()+1
ce:SetValue(ct)
c:SetHint(CHINT_NUMBER,ct)
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