Commit e37de8e6 authored by Nemo Ma's avatar Nemo Ma

fix

parent e1595301
--怒号光明
function c29009961.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,29009961)
e1:SetCondition(c29009961.condition)
e1:SetTarget(c29009961.target)
e1:SetOperation(c29009961.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,29009961)
e2:SetCost(c29009961.cost)
e2:SetTarget(c29009961.tg)
e2:SetOperation(c29009961.op)
c:RegisterEffect(e2)
end
--negate
function c29009961.stf(c)
return c:IsFaceup() and c:IsSetCard(0x87af)
end
function c29009961.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(c29009961.stf,tp,LOCATION_MZONE,0,1,nil)
end
function c29009961.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c29009961.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
--Effect 2
function c29009961.csf(c)
return c29009961.stf(c) and (c:IsAbleToHandAsCost() or c:IsAbleToExtraAsCost())
end
function c29009961.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29009961.csf,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,c29009961.csf,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc:IsAbleToExtraAsCost() then
Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_COST)
else
Duel.SendtoHand(tc,nil,REASON_COST)
end
end
function c29009961.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=c:IsAbleToDeck()
local b2=Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 and b2 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c29009961.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0
and c:IsLocation(LOCATION_DECK) then
Duel.DisableShuffleCheck()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......@@ -2,61 +2,51 @@
c29065513.named_with_Arknight=1
function c29065513.initial_effect(c)
aux.AddCodeList(c,29065500)
--fusion material
c:EnableReviveLimit()
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
aux.AddFusionProcCode2(c,29065500,29065508,true,true)
--change name
aux.EnableChangeCode(c,29065500)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,29065513+EFFECT_COUNT_CODE_DUEL)
e1:SetTarget(c29065513.xxtg)
e1:SetOperation(c29065513.xxop)
c:RegisterEffect(e1)
end
function c29065513.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) end
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(c29065513.efilter)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
e2:SetOwnerPlayer(tp)
c:RegisterEffect(e2)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,29065513+EFFECT_COUNT_CODE_DUEL)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetTarget(c29065513.xxtg)
e1:SetOperation(c29065513.xxop)
c:RegisterEffect(e1)
end
function c29065513.branded_fusion_check(tp,sg,fc)
return aux.gffcheck(sg,Card.IsFusionCode,29065500,Card.IsFusionCode,29065508)
end
function c29065513.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackable() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c29065513.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if c:IsAttackable() and c:IsRelateToEffect(e) and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACKTARGET)
local tc=g:GetMinGroup(Card.GetAttack):Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(c29065513.efilter)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
e2:SetOwnerPlayer(tp)
c:RegisterEffect(e2)
Duel.CalculateDamage(c,tc)
end
end
function c29065513.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function c29065513.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:GetMaxGroup(Card.GetAttack):Select(tp,1,1,nil):GetFirst()
Duel.CalculateDamage(c,tc)
end
end
--方舟骑士升变
c29065533.named_with_Arknight=1
function c29065533.initial_effect(c)
aux.AddCodeList(c,29065500)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29065533+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c29065533.actg)
e1:SetOperation(c29065533.acop)
e1:SetCost(c29065533.cost)
e1:SetTarget(c29065533.target)
e1:SetOperation(c29065533.activate)
c:RegisterEffect(e1)
end
function c29065533.rmfil(c)
return c:IsCode(29065500,29065508) and c:IsAbleToRemove()
function c29065533.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c29065533.gck(g)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c29065533.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:GetOriginalCode()==29065513 and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c29065533.actg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c29065533.rmfil,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,nil)
if chk==0 then return g:CheckSubGroup(c29065533.gck,2,2) and Duel.IsExistingMatchingCard(c29065533.spfil,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_MZONE+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
function c29065533.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
end
function c29065533.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c29065533.rmfil,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,nil)
local sg=Duel.GetMatchingGroup(c29065533.spfil,tp,LOCATION_EXTRA,0,nil,e,tp)
if g:CheckSubGroup(c29065533.gck,2,2) and sg:GetCount()>0 then
local rg=g:SelectSubGroup(tp,c29065533.gck,false,2,2)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
local tc=sg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
tc:RegisterFlagEffect(29065533,RESET_EVENT+RESETS_STANDARD,0,1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabel(Duel.GetTurnCount()+1)
e2:SetLabelObject(tc)
e2:SetCondition(c29065533.descon)
e2:SetOperation(c29065533.desop)
Duel.RegisterEffect(e2,tp)
end
end
function c29065533.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(29065533)~=0 then
return Duel.GetTurnCount()==e:GetLabel()
else
e:Reset()
return false
function c29065533.filter1(c,e)
return c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c29065533.filter2(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,29065500) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.branded_fusion_check or c29065533.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c29065533.fcheck(tp,sg,fc)
return sg:GetCount()<=2 and sg:IsExists(Card.IsFusionCode,1,nil,29065500)
end
function c29065533.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c29065533.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c29065533.filter0,nil)
local mg2=Duel.GetMatchingGroup(c29065533.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c29065533.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c29065533.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c29065533.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.SetLP(tp,Duel.GetLP(tp)/2)
function c29065533.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c29065533.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c29065533.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c29065533.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c29065533.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
aux.FCheckAdditional=tc.branded_fusion_check or c29065533.fcheck
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
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