Commit 950a106f authored by zengsxing's avatar zengsxing

fix

parent 7a7b4548
......@@ -4,6 +4,14 @@ function s.initial_effect(c)
--fusion
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,46986414,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT+ATTRIBUTE_DARK),1,true,true)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(s.condition)
e0:SetOperation(s.regop)
c:RegisterEffect(e0)
--alt summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -14,24 +22,24 @@ function s.initial_effect(c)
e1:SetOperation(s.spop)
e1:SetValue(SUMMON_TYPE_SPECIAL)
c:RegisterEffect(e1)
--name
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_CODE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(46986414)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(s.splimit)
c:RegisterEffect(e2)
--change name
aux.EnableChangeCode(c,46986414,LOCATION_MZONE+LOCATION_GRAVE)
--search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
......@@ -50,12 +58,21 @@ function s.spcon(e,c)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) or e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_FUSION) or c:GetFlagEffect(id)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and Duel.GetFlagEffect(sp,id)==0
end
function s.thfilter(c)
return c:IsAbleToHand() and (c:IsCode(46986414) or aux.IsCodeListed(c,46986414))
......
......@@ -16,8 +16,7 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.atkcon)
e2:SetCountLimit(1,id)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
......@@ -47,7 +46,11 @@ function s.imop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
c:RegisterEffect(e1)
end
function s.efilter(e,te)
......@@ -56,9 +59,6 @@ end
function s.atkfilter(c)
return c:IsType(TYPE_SPELL) and c:IsFaceupEx()
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)>0 and e:GetHandler()==Duel.GetAttacker()
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(s.atkfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil)>0 end
end
......@@ -69,7 +69,7 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
......@@ -84,7 +84,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToChain(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -9,7 +9,7 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1) --activate
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsCode(46986414,38033121) and c:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.fusfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
......@@ -26,7 +26,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) or not Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==1 then return end
if not tc or not tc:IsRelateToChain(e) or not Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==1 then return end
local code=tc:GetCode()
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......@@ -36,6 +36,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if sc then
sc:SetMaterial(mg)
Duel.SpecialSummon(sc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
sc:CompleteProcedure()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -45,17 +46,17 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(s.rmcon)
e1:SetOperation(s.rmop)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return e:GetLabel()~=Duel.GetTurnCount() and tc and tc:IsOnField()
return tc and tc:GetFlagEffect(id)~=0 and e:GetLabel()~=Duel.GetTurnCount()
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc and tc:IsOnField() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
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