Commit 7639a20c authored by Nemo Ma's avatar Nemo Ma

fix

parent 59d3709e
......@@ -71,18 +71,19 @@ function cm.ffilter(c,fc,sub,mg,sg)
end
function cm.getfusionfilter(c,tp,tc)
return c:IsPosition(POS_FACEDOWN) and c:IsAbleToDeckOrExtraAsCost() and c:IsSetCard(0x628) and Duel.GetLocationCountFromEx(tp,tp,c,tc)>0
return c:IsPosition(POS_FACEDOWN) and c:IsAbleToDeckAsCost() and c:IsSetCard(0x628) and Duel.GetLocationCountFromEx(tp,tp,c,tc)>0
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local c=e:GetHandler()
local tp=e:GetHandler():GetControler()
local g=Duel.GetMatchingGroup(cm.getfusionfilter,tp,LOCATION_ONFIELD,0,nil,tp,c)
return g:GetCount()>0
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.getfusionfilter,tp,LOCATION_ONFIELD,0,nil)
local g=Duel.GetMatchingGroup(cm.getfusionfilter,tp,LOCATION_ONFIELD,0,nil,tp,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=g:Select(tp,1,1,nil)
......
......@@ -3,17 +3,14 @@ local m=60000092
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
bgmhandle(c,m,4,0)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.recon)
e2:SetCost(cm.recost)
......@@ -37,7 +34,7 @@ function cm.initial_effect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCondition(cm.recon)
e5:SetCondition(cm.recon2)
e5:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e5)
end
......@@ -47,7 +44,6 @@ function cm.recon(e,tp,eg,ep,ev,re,r,rp)
return rc:IsSummonPlayer(tp) and rc:IsSetCard(0x628) and rc:IsSummonLocation(LOCATION_EXTRA)
end
function cm.recost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST)
......@@ -96,6 +92,69 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.recon(e)
function cm.recon2(e)
return e:GetHandler():IsFaceup()
end
function bgmhandle(c,code,count,bgmid,con,cost,tg,op)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
if con then e0:SetCondition(con) end
e0:SetCost((cost and {cost} or {function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if bgmid then Duel.Hint(HINT_MUSIC,0,aux.Stringid(code,bgmid)) end
end})[1])
if tg then e0:SetTarget(tg) end
if op then e0:SetOperation(op) end
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CANNOT_NEGATE)
e3:SetTargetRange(1,0)
e3:SetValue(function(e,re,tp)
return re:GetHandler():IsType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1,0)
e4:SetTarget(function(e,c)
return c:IsType(TYPE_FIELD) end)
c:RegisterEffect(e4)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_FZONE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(1082946)==0 then
c:RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,count)
c:SetTurnCounter(0)
end
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct>=count then
Duel.SendtoGrave(c,REASON_RULE)
c:ResetFlagEffect(1082946)
end end)
c:RegisterEffect(e0)
c:RegisterEffect(e1)
c:RegisterEffect(e2)
c:RegisterEffect(e3)
c:RegisterEffect(e4)
_G["c"..code][c] = e1
end
\ No newline at end of file
......@@ -39,7 +39,7 @@ function c98920109.initial_effect(c)
c:RegisterEffect(e5)
end
function c98920109.mfilter(c)
return not c:IsLinkType(TYPE_LINK) and c:IsLinkSetCard(0x129)
return not c:IsLinkType(TYPE_LINK) and c:IsLinkRace(RACE_FIEND)
end
function c98920109.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
......
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