Commit fb4f547d authored by Huangnan's avatar Huangnan

fix

parent 44be82bf
Pipeline #40777 passed with stage
in 5 minutes and 7 seconds
No preview for this file type
expansions/pics/12802075.jpg

35.9 KB | W: | H:

expansions/pics/12802075.jpg

94.7 KB | W: | H:

expansions/pics/12802075.jpg
expansions/pics/12802075.jpg
expansions/pics/12802075.jpg
expansions/pics/12802075.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -39,11 +39,13 @@ function c60150510.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c60150510.thtgf(c)
return c:GetSequence()<5 and c:IsAbleToHand()
end
function c60150510.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c60150510.thtgf,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c60150510.thtgf,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c60150510.thop(e,tp,eg,ep,ev,re,r,rp)
......
--*天晶部队 见习工人
local m=60151708
local cm=_G["c"..m]
function cm.initial_effect(c)
function c60151708.initial_effect(c)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.target)
e1:SetTarget(c60151708.target)
e1:SetCountLimit(1,m)
e1:SetOperation(cm.operation)
e1:SetOperation(c60151708.operation)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -28,17 +26,17 @@ function cm.initial_effect(c)
e3:SetOperation(c60151708.spop2)
c:RegisterEffect(e3)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c60151708.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
function c60151708.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--immune effect
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.ffilter)
e1:SetTarget(c60151708.ffilter)
e1:SetValue(500)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
......@@ -46,7 +44,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_DEFENSE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(cm.ffilter)
e3:SetTarget(c60151708.ffilter)
e3:SetValue(500)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
......@@ -54,12 +52,12 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.ffilter)
e2:SetTarget(c60151708.ffilter)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.ffilter(c,e,tp)
function c60151708.ffilter(e,c)
return c:IsSetCard(0x3b26) and c:IsFaceup()
end
function c60151708.spcon2(e,tp,eg,ep,ev,re,r,rp)
......
--ヴォルクドラモン
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,s.mfilter,nil,3,3)
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(s.sumsuc)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
--destroy meteor
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--random attack smoke
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.con)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
--core break selfdes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_SELF_DESTROY)
e4:SetCondition(s.descon)
c:RegisterEffect(e4)
end
function s.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(id,3))
end
function s.mfilter(c)
return c:IsRace(RACE_DINOSAUR) and c:IsAttackAbove(3000)
end
function s.filter(c,ec)
return c:IsCode(63920001) and c:CheckEquipTarget(ec)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsLocation(LOCATION_MZONE)
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP+CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown()
or not c:IsLocation(LOCATION_MZONE) or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,c)
if g:GetCount()>0 then
Duel.Equip(tp,g:GetFirst(),c)
end
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,g:GetCount()*300)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local ct=Duel.Destroy(g,REASON_EFFECT)
if ct>0 then
Duel.Damage(tp,ct*300,REASON_EFFECT)
Duel.Damage(1-tp,ct*300,REASON_EFFECT)
Duel.RDComplete()
end
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return not at:IsOriginalCodeRule(id)
end
function s.filter1(c)
return not c:IsOriginalCodeRule(id)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local a,d=Duel.GetBattleMonster(0)
local ad=Group.FromCards(a,d)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,ad) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local b=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,a)
if b:GetCount()>0 and a:IsAttackable() and not a:IsImmuneToEffect(e) then
local tc=b:RandomSelect(1-tp,1):GetFirst()
Duel.CalculateDamage(a,tc)
end
end
function s.descon(e)
local c=e:GetHandler()
return c:GetOverlayCount()==0 and c:IsPosition(POS_FACEUP_DEFENSE)
end
\ No newline at end of file
--噬炎魂 网格代码
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(1)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(s.eqlimit)
c:RegisterEffect(e3)
--atk up
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,0))
e5:SetCategory(CATEGORY_ATKCHANGE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(s.cost)
e5:SetOperation(s.op)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e6:SetRange(LOCATION_SZONE)
e6:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e6:SetTarget(s.eftg)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
--material
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(id,1))
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_BATTLED)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e7:SetCondition(s.orucon1)
e7:SetTarget(s.orutarget)
e7:SetOperation(s.oruoperation)
local e8=e7:Clone()
e8:SetCode(EVENT_BATTLE_DAMAGE)
e8:SetCondition(s.orucon2)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e9:SetRange(LOCATION_SZONE)
e9:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e9:SetTarget(s.eftg)
e9:SetLabelObject(e7)
c:RegisterEffect(e9)
end
function s.eqlimit(e,c)
return c:IsOriginalCodeRule(63920000)
end
function s.filter(c)
return c:IsFaceup() and c:IsOriginalCodeRule(63920000)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function s.eftg(e,c)
return e:GetHandler():GetEquipTarget()==c
end
function s.cfilter(c)
return c:GetOriginalAttribute()==ATTRIBUTE_WATER and c:IsAbleToRemoveAsCost()
and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
local tc=g:GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_COST)
e:SetLabel(tc:GetAttack())
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=e:GetLabel()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function s.orufilter(c)
return c:GetOriginalAttribute()==ATTRIBUTE_WATER and c:IsFaceupEx() and c:IsCanOverlay()
end
function s.orutarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and s.orufilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingTarget(s.orufilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,s.orufilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,1,e:GetHandler())
end
function s.oruoperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
end
end
function s.orucon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and bc~=nil and bc:IsStatus(STATUS_BATTLE_DESTROYED)
end
function s.orucon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
end
--绯红编年史的空想者
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,79100530)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,id)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.tdcon)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
--cannot be target
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetValue(aux.imval1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e8:SetValue(aux.tgoval)
c:RegisterEffect(e8)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function s.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.IsCodeListed(c,79100530) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,3,3,nil)
if #g>0 then
Duel.ConfirmCards(1-tp,g)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local oc=g:Select(1-tp,1,1,nil):GetFirst()
g:RemoveCard(oc)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local rc=re:GetHandler()
if not rc:IsRelateToEffect(re) then return end
if chk==0 then return rc:IsAbleToDeck() and not rc:IsLocation(LOCATION_DECK) end
Duel.SetTargetCard(rc)
if rc:IsLocation(LOCATION_GRAVE) then
e:SetCategory(CATEGORY_GRAVE_ACTION)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(re) then
if tc:IsAbleToDeck() and not tc:IsLocation(LOCATION_DECK) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
\ No newline at end of file
--绯红编年史的夜蔷薇
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,79100530)
c:EnableReviveLimit()
--change name
aux.EnableChangeCode(c,79100530,LOCATION_MZONE+LOCATION_GRAVE)
--todeck&remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.tdcost)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,id)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
end
function s.cfilter(c)
return c:IsSetCard(0xa10) and c:IsAbleToRemoveAsCost()
end
function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.tdfilter(c)
return c:IsType(TYPE_MONSTER) and (c:IsAbleToDeck() or c:IsAbleToRemove())
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if not tc then return end
local op=aux.SelectFromOptions(tp,{tc:IsAbleToDeck(),1193},{tc:IsAbleToRemove(),1192})
if op==1 then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
else Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
end
function s.filter(c)
return aux.IsCodeListed(c,79100530) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then Duel.SSet(tp,tc) end
end
\ No newline at end of file
--绯红编年史的转换
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,79100530)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+1)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsSetCard(0xa10) and c:IsAbleToGrave()
end
function s.spfilter1(c,e,tp)
return c:IsCode(79100530) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spfilter2(c,e,tp)
return c:IsSetCard(0xa10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spfilter3(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 then
local sg=g:GetFirst()
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
local g1=Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
local g2=Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b1=g1
local b2=g2 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,79100530)
if not (b1 or b2 or Duel.SelectYesNo(tp,aux.Stringid(id,1))) then return end
Duel.BreakEffect()
if b1 and not b2 then
local sg1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter1),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=sg1:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif b2 and not b1 then
local sg2=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=sg2:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif b1 and b2 then
local tg1=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
local tg2=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_GRAVE,0,nil,e,tp)
tg1:Merge(tg2)
local tc=tg1:Select(tp,1,1,nil)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_HAND)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--形而上学 虚无主义
local m=79100560
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,79100530,79100540)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.tgcon)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsRace(RACE_FIEND)
end
function cm.check(c,e,tp)
return c:IsCode(79100530) and c:IsReleasableByEffect() and Duel.IsExistingMatchingCard(cm.spcheck,tp,LOCATION_DECK,0,1,c,e,tp)
end
function cm.spcheck(c,e,tp)
return c:IsCode(79100540) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
end
function cm.ritspcheck(c,tp)
return c:IsAbleToGrave() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.ritspcheck,tp,LOCATION_HAND,0,e:GetHandler(),tp)
if mg2:GetCount()>0 then
mg:Merge(mg2)
end
local a=Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,cm.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
local b=Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e,tp)
if chk==0 then
return a or b
end
local op=0
if a and b then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif a then
op=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b then
op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
end
Duel.SetTargetParam(op)
if op==1 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
elseif op==2 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function cm.IsCanBeRitualMaterial(c,rc)
if c:IsType(TYPE_MONSTER) then
return c:IsCanBeRitualMaterial(rc)
else
return true
end
end
function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(cm.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
end
if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp)
else
mg:RemoveCard(c)
end
local lv=level_function(c)
local res=mg:CheckSubGroup(cm.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
return res
end
function cm.RitualCheckAdditionalLevel(c,rc)
local raw_level=c:GetRitualLevel(rc)
local lv1=raw_level&0xffff
local lv2=raw_level>>16
if lv2>0 then
return math.min(lv1,lv2)
else
return lv1
end
end
function cm.RitualCheckAdditional(c,lv,greater_or_equal)
if greater_or_equal=="Equal" then
return function(g)
return (not Auxiliary.RGCheckAdditional or Auxiliary.RGCheckAdditional(g)) and g:GetSum(cm.RitualCheckAdditionalLevel,c)<=lv
end
else
return function(g,ec)
if ec then
return (not Auxiliary.RGCheckAdditional or Auxiliary.RGCheckAdditional(g,ec)) and g:GetSum(cm.RitualCheckAdditionalLevel,c)-cm.RitualCheckAdditionalLevel(ec,c)<=lv
else
return not Auxiliary.RGCheckAdditional or Auxiliary.RGCheckAdditional(g)
end
end
end
end
function cm.RitualCheckGreater(g,c,lv)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(cm.lvget,lv,c)
end
function cm.lvget(c,rc)
if c:GetRitualLevel(rc)>0 then
return c:GetRitualLevel(rc)
else
return 4
end
end
function cm.RitualCheckEqual(g,c,lv)
return g:CheckWithSumEqual(cm.lvget,lv,#g,#g,c)
end
function cm.RitualCheck(g,tp,c,lv,greater_or_equal)
return cm["RitualCheck"..greater_or_equal](g,c,lv) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c))
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local param=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if param==0 then
::cancel::
local mg=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.ritspcheck,tp,LOCATION_HAND,0,nil,tp)
if mg2:GetCount()>0 then
mg:Merge(mg2)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,cm.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(cm.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectSubGroup(tp,cm.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
if not mat then goto cancel end
tc:SetMaterial(mat)
local mat1=mat:Filter(Card.IsType,nil,TYPE_SPELL+TYPE_TRAP)
mat:Sub(mat1)
Duel.ReleaseRitualMaterial(mat)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_RITUAL)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
end
else
if Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e,tp) then
local mg=Duel.GetMatchingGroup(cm.check,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=mg:Select(tp,1,1,nil)
Duel.ReleaseRitualMaterial(rg)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spcheck,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=sg:GetFirst()
if tc then
tc:SetMaterial(rg)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
end
function cm.tgfilter(c)
return c:IsSetCard(0xa10) and c:IsType(TYPE_TRAP) and c:IsAbleToGrave()
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_HAND)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--绯红编年史的谜题
local m=79100570
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,79100530)
--DISABLE!
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.seqtg)
e1:SetOperation(cm.seqop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.tgcon)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
end
function cm.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
local zone=Duel.SelectField(tp,1,0,LOCATION_MZONE,0xe000e0)
e:SetLabel(zone)
Duel.Hint(HINT_ZONE,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,1-tp,LOCATION_ONFIELD)
end
function cm.seqfilter(c,seq)
local loc=LOCATION_MZONE
if seq>8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 and seq<=7 then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE
and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
return cseq==seq or cloc==loc and math.abs(cseq-seq)==1
end
function cm.disfilter(c,tp,zone)
if c:GetControler()==tp then
zone=((zone&0xffff)<<16)|((zone>>16)&0xffff)
end
return (2^c:GetSequence())*0x10000&zone~=0
end
function cm.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=e:GetLabel()
local seq=math.log(zone>>16,2)
local tc1=Duel.GetMatchingGroup(cm.disfilter,tp,0,LOCATION_MZONE,nil,tp,zone):GetFirst()
if tc1 then
Duel.NegateRelatedChain(tc1,RESET_CHAIN)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e2)
if tc1:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e3)
end
end
if not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,79100530) then return end
Duel.BreakEffect()
ag=Duel.GetMatchingGroup(cm.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq)
local tc=ag:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_CHAIN)
tc=ag:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_ONFIELD)
e1:SetTarget(cm.dis2able)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(zone)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(cm.dis3op)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabel(zone)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(cm.dis2able)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetLabel(zone)
Duel.RegisterEffect(e3,tp)
end
function cm.dis2able(e,c)
local zone=e:GetLabel()
local seq=math.log(zone>>16,2)
local aloc=0
if bit.band(zone,0x1f001f)~=0 then aloc=LOCATION_MZONE end
if bit.band(zone,0x1f001f00)~=0 then aloc=LOCATION_SZONE end
if bit.band(zone,0x20002000)~=0 then aloc=LOCATION_FZONE end
local loc=LOCATION_MZONE
if seq>8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 and seq<=7 then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
return cseq==seq or cloc==loc and math.abs(cseq-seq)==1
end
function cm.dis3op(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetLabel()
local seq=math.log(zone>>16,2)
local aloc=0
if bit.band(zone,0x1f001f)~=0 then aloc=LOCATION_MZONE end
if bit.band(zone,0x1f001f00)~=0 then aloc=LOCATION_SZONE end
if bit.band(zone,0x20002000)~=0 then aloc=LOCATION_FZONE end
local loc=LOCATION_MZONE
if seq>8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 and seq<=7 then return end
local cloc,cseq,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE,CHAININFO_TRIGGERING_CONTROLER)
if cloc==LOCATION_SZONE and cseq>=5 then return end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE and (seq==1 and cseq==5 or seq==3 and cseq==6) then
if cseq==seq or cloc==loc and math.abs(cseq-seq)==1 and p~=tp and re:IsActivated() and cloc&LOCATION_ONFIELD~=0 then
Duel.NegateEffect(ev)
end
end
end
function cm.tgfilter(c)
return c:IsSetCard(0xa10) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave()
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_HAND)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SendtoGrave(tc,REASON_EFFECT)
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