Commit 27c62858 authored by Huangnan's avatar Huangnan

物语纪录fix.v2

parent 8215d5e5
--物语纪录·不死之忍 --物语纪录·不死之忍
function c1009029.initial_effect(c) function c1009029.initial_effect(c)
--xyzlimit --xyzlimit
c:EnableReviveLimit() c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false) aux.EnablePendulumAttribute(c,false)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x20c),7,2) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x20c),7,2)
--pendulum set --pendulum set
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(c1009029.pctg) e1:SetTarget(c1009029.pctg)
e1:SetOperation(c1009029.pcop) e1:SetOperation(c1009029.pcop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--negate attack --negate attack
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(c1009029.condition) e2:SetCondition(c1009029.condition)
e2:SetCost(c1009029.cost) e2:SetCost(c1009029.cost)
e2:SetOperation(c1009029.operation) e2:SetOperation(c1009029.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--summon success --summon success
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c1009029.regcon) e2:SetCondition(c1009029.regcon)
e2:SetOperation(c1009029.regop) e2:SetOperation(c1009029.regop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK) e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c1009029.valcheck) e3:SetValue(c1009029.valcheck)
e3:SetLabelObject(e2) e3:SetLabelObject(e2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--extra attack --extra attack
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EXTRA_ATTACK) e4:SetCode(EFFECT_EXTRA_ATTACK)
e4:SetValue(2) e4:SetValue(2)
e4:SetCondition(c1009029.effcon) e4:SetCondition(c1009029.effcon)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--destroy --destroy
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(1009029,1)) e5:SetDescription(aux.Stringid(1009029,1))
e5:SetCategory(CATEGORY_TODECK) e5:SetCategory(CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_IGNITION) e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1) e5:SetCountLimit(1)
e5:SetCondition(c1009029.effcon) e5:SetCondition(c1009029.effcon)
e5:SetCost(c1009029.remcost) e5:SetCost(c1009029.remcost)
e5:SetTarget(c1009029.remtg) e5:SetTarget(c1009029.remtg)
e5:SetOperation(c1009029.remop) e5:SetOperation(c1009029.remop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--pendulum --pendulum
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY) e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED) e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c1009029.pencon) e4:SetCondition(c1009029.pencon)
e4:SetTarget(c1009029.pentg) e4:SetTarget(c1009029.pentg)
e4:SetOperation(c1009029.penop) e4:SetOperation(c1009029.penop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
c1009029.pendulum_level=7 c1009029.pendulum_level=7
function c1009029.condition(e,tp,eg,ep,ev,re,r,rp) function c1009029.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp return Duel.GetTurnPlayer()~=tp
end end
function c1009029.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c1009029.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x520c) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x520c) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x520c) local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x520c)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c1009029.operation(e,tp,eg,ep,ev,re,r,rp) function c1009029.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.NegateAttack() then if e:GetHandler():IsRelateToEffect(e) and Duel.NegateAttack() then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1) Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end end
end end
function c1009029.pcfilter(c) function c1009029.pcfilter(c)
return c:IsSetCard(0x520c) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() return c:IsSetCard(0x520c) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end end
function c1009029.pctg(e,tp,eg,ep,ev,re,r,rp,chk) function c1009029.pctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and Duel.IsExistingMatchingCard(c1009029.pcfilter,tp,LOCATION_DECK,0,1,nil) end and Duel.IsExistingMatchingCard(c1009029.pcfilter,tp,LOCATION_DECK,0,1,nil) end
end end
function c1009029.pcop(e,tp,eg,ep,ev,re,r,rp) function c1009029.pcop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c1009029.pcfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c1009029.pcfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end end
end end
function c1009029.regcon(e,tp,eg,ep,ev,re,r,rp) function c1009029.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) and e:GetLabel()==1 return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) and e:GetLabel()==1
end end
function c1009029.regop(e,tp,eg,ep,ev,re,r,rp) function c1009029.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
c:RegisterFlagEffect(1009029,RESET_EVENT+RESETS_STANDARD,0,1) c:RegisterFlagEffect(1009029,RESET_EVENT+RESETS_STANDARD,0,1)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(1009029,3)) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(1009029,3))
end end
function c1009029.valcheck(e,c) function c1009029.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial()
if g:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_ADVANCE) then if g:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_ADVANCE) then
e:GetLabelObject():SetLabel(1) e:GetLabelObject():SetLabel(1)
else else
e:GetLabelObject():SetLabel(0) e:GetLabelObject():SetLabel(0)
end end
end end
function c1009029.effcon(e) function c1009029.effcon(e)
return e:GetHandler():GetFlagEffect(1009029)>0 return e:GetHandler():GetFlagEffect(1009029)>0
end end
function c1009029.remcost(e,tp,eg,ep,ev,re,r,rp,chk) function c1009029.remcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c1009029.th1filter(c,p) function c1009029.th1filter(c,p)
return c:GetOwner()==p and c:IsAbleToRemove() return c:GetOwner()==p and c:IsAbleToRemove()
end end
function c1009029.remtg(e,tp,eg,ep,ev,re,r,rp,chk) function c1009029.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,0,0x1c) local g=Duel.GetFieldGroup(tp,0,0x18)
local dc=g:FilterCount(c1009029.th1filter,nil,1-tp) local dc=g:FilterCount(c1009029.th1filter,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end end
function c1009029.sgfilter(c,p) function c1009029.sgfilter(c,p)
return c:IsLocation(LOCATION_REMOVED) and c:IsControler(p) return c:IsLocation(LOCATION_REMOVED) and c:IsControler(p)
end end
function c1009029.remop(e,tp,eg,ep,ev,re,r,rp) function c1009029.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,0x1c) local g=Duel.GetFieldGroup(tp,0,0x18)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(c1009029.sgfilter,nil,1-tp) local ct=og:FilterCount(c1009029.sgfilter,nil,1-tp)
if ct>0 then if ct>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*200) e1:SetValue(ct*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
function c1009029.pencon(e,tp,eg,ep,ev,re,r,rp) function c1009029.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end end
function c1009029.pentg(e,tp,eg,ep,ev,re,r,rp,chk) function c1009029.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_PZONE,LOCATION_PZONE)>0 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_PZONE,LOCATION_PZONE)>0 end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,LOCATION_PZONE) local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,LOCATION_PZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c1009029.penop(e,tp,eg,ep,ev,re,r,rp) function c1009029.penop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,LOCATION_PZONE) local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,LOCATION_PZONE)
if Duel.Destroy(g,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then if Duel.Destroy(g,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end end
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