Commit d78ed6bf authored by 花桃白音's avatar 花桃白音

del cards from 333s希冀之魂&221s元素指示物

parent 99626039
No preview for this file type
--右刻铭·观测系统
--
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg1)
e3:SetOperation(s.penop1)
c:RegisterEffect(e3)
local e2=e3:Clone()
e2:SetDescription(aux.Stringid(id,2))
e2:SetTarget(s.pentg2)
e2:SetOperation(s.penop2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_SUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.counterfilter2)
end
function s.counterfilter(c)
return c:GetBaseAttack()==c:GetBaseDefense()
end
function s.counterfilter2(re,tp,cid)
local rc=re:GetHandler()
return not re:IsActiveType(TYPE_MONSTER) or rc:GetBaseAttack()==rc:GetBaseDefense()
end
--通用自肃2(附带不能特招)
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTarget(s.sumlimit)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTarget(s.sumlimit)
Duel.RegisterEffect(e3,tp)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sumlimit(e,c)
return not c:GetBaseAttack()==c:GetBaseDefense()
end
function s.setfilter1(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_EARTH)
end
function s.pentg1(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))
and Duel.IsExistingMatchingCard(s.setfilter1,tp,LOCATION_DECK,0,1,nil) end
end
function s.penop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g = Duel.GetMatchingGroup(s.setfilter1,tp,LOCATION_DECK,0,nil)
if g and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
local c = e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
end
end
end
function s.setfilter2(c)
return c:IsCode(22100000)
end
function s.pentg2(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))
and Duel.IsExistingMatchingCard(s.setfilter2,tp,LOCATION_DECK,0,1,nil) end
end
function s.penop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g = Duel.GetMatchingGroup(s.setfilter2,tp,LOCATION_DECK,0,nil)
if g and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))then
local tc=g:GetFirst()
if Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
end
end
end
--前刻铭·模拟系统
--
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg1)
e3:SetOperation(s.penop1)
c:RegisterEffect(e3)
local e2=e3:Clone()
e2:SetDescription(aux.Stringid(id,2))
e2:SetTarget(s.pentg2)
e2:SetOperation(s.penop2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_SUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.counterfilter2)
end
function s.counterfilter(c)
return c:GetBaseAttack()==c:GetBaseDefense()
end
function s.counterfilter2(re,tp,cid)
local rc=re:GetHandler()
return not re:IsActiveType(TYPE_MONSTER) or rc:GetBaseAttack()==rc:GetBaseDefense()
end
--通用自肃2(附带不能特招)
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTarget(s.sumlimit)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTarget(s.sumlimit)
Duel.RegisterEffect(e3,tp)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sumlimit(e,c)
return not c:GetBaseAttack()==c:GetBaseDefense()
end
function s.setfilter1(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_WATER)
end
function s.pentg1(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))
and Duel.IsExistingMatchingCard(s.setfilter1,tp,LOCATION_DECK,0,1,nil) end
end
function s.penop1(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local g = Duel.GetMatchingGroup(s.setfilter1,tp,LOCATION_DECK,0,nil)
if g and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
end
end
end
function s.setfilter2(c)
return c:IsCode(22100000)
end
function s.pentg2(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))
and Duel.IsExistingMatchingCard(s.setfilter2,tp,LOCATION_DECK,0,1,nil) end
end
function s.penop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g = Duel.GetMatchingGroup(s.setfilter2,tp,LOCATION_DECK,0,nil)
if g and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))then
local tc=g:GetFirst()
if Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
end
end
end
--荒芜·东星极·右卫枢
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--to hand
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--retrun to deck
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(0x36)
e12:SetCondition(s.con)
e12:SetCost(s.tdcost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local mtp = e:GetHandler():GetOwner()
local gg = Duel.GetMatchingGroup(nil,mtp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(mtp,22134500)<=0 then
Duel.RegisterFlagEffect(mtp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(s.tgfilter,tp,LOCATION_DECK,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
local geg = Duel.GetMatchingGroup(s.tgfilter1,tp,LOCATION_DECK,0,nil)
local reg = Duel.GetMatchingGroup(s.tgfilter2,tp,LOCATION_DECK,0,nil)
if geg:GetCount() <=0 or ((geg:GetCount() * reg:GetCount())>0 and Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))==1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
elseif reg:GetCount() <=0 or ((geg:GetCount() * reg:GetCount())>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter1,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
function s.tgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function s.tgfilter1(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToGrave()
end
function s.tgfilter2(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToRemove()
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local wh = e:GetHandler():GetLocation()
e:SetLabel(wh)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
if chk==0 then return (b1 or b2 or b3 or b4) end
if b1 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION,nil,1,0,0)
elseif b3 then
e:SetCategory(CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b4 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = e:GetLabel()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
local bb = c:GetLocation()==LOCATION_DECK
if wh==LOCATION_HAND then
if not (b1 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_MZONE then
if not (b2 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_GRAVE then
if not (b3 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_REMOVED then
if not (b4 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToHand()
end
function s.tdfilter2(c)
return c:IsAbleToDeck()
end
--枯竭·北星极·前卫枢
--
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--to remove or extra
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_REMOVE+CATEGORY_TOEXTRA)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--retrun to deck
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(0x36)
e12:SetCondition(s.con)
e12:SetCost(s.tdcost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local mtp = e:GetHandler():GetOwner()
local gg = Duel.GetMatchingGroup(nil,mtp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(mtp,22134500)<=0 then
Duel.RegisterFlagEffect(mtp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(s.tgfilter,tp,LOCATION_DECK,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
local geg = Duel.GetMatchingGroup(s.tgfilter1,tp,LOCATION_DECK,0,nil)
local reg = Duel.GetMatchingGroup(s.tgfilter2,tp,LOCATION_DECK,0,nil)
if geg:GetCount() <=0 or ((geg:GetCount() * reg:GetCount())>0 and Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))==1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoExtraP(g,nil,REASON_EFFECT)
elseif reg:GetCount() <=0 or ((geg:GetCount() * reg:GetCount())>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.tgfilter1,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
end
function s.tgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and (c:IsAbleToHand() or c:IsAbleToExtra())
end
function s.tgfilter1(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function s.tgfilter2(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToExtra()
end
function s.tgfilter3(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToRemove()
end
function s.tgfilter4(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and (c:IsAbleToRemove() or c:IsAbleToExtra())
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter4,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE+CATEGORY_TOEXTRA,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local geg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tgfilter3),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
local reg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tgfilter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if geg:GetCount() <=0 or ((geg:GetCount() * reg:GetCount())>0 and Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))==1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tgfilter2),tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoExtraP(g,nil,REASON_EFFECT)
elseif reg:GetCount() <=0 or ((geg:GetCount() * reg:GetCount())>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tgfilter3),tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local wh = e:GetHandler():GetLocation()
e:SetLabel(wh)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
if chk==0 then return (b1 or b2 or b3 or b4) end
if b1 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION,nil,1,0,0)
elseif b3 then
e:SetCategory(CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b4 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = e:GetLabel()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
local bb = c:GetLocation()==LOCATION_DECK
if wh==LOCATION_HAND then
if not (b1 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_MZONE then
if not (b2 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_GRAVE then
if not (b3 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_REMOVED then
if not (b4 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToHand()
end
function s.tdfilter2(c)
return c:IsAbleToDeck()
end
--荒芜之地·粉碎奇迹
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--pendulum set
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--retrun to deck
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(0x36)
e12:SetCondition(s.con)
e12:SetCost(s.tdcost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(s.tgfilter,tp,LOCATION_DECK,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
local thg = Duel.GetMatchingGroup(s.tgfilter1,tp,LOCATION_DECK,0,nil)
local exg = Duel.GetMatchingGroup(s.tgfilter2,tp,LOCATION_DECK,0,nil)
if thg:GetCount() <=0 or ((thg:GetCount() * exg:GetCount())>0 and Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))==1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoExtraP(g,nil,REASON_EFFECT)
elseif exg:GetCount() <=0 or ((thg:GetCount() * exg:GetCount())>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.tgfilter1,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
end
function s.tgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and (c:IsAbleToHand() or c:IsAbleToExtra())
end
function s.tgfilter1(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function s.tgfilter2(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToExtra()
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsType(TYPE_PENDULUM)
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,1,nil)
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local wh = e:GetHandler():GetLocation()
e:SetLabel(wh)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
if chk==0 then return (b1 or b2 or b3 or b4) end
if b1 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION,nil,1,0,0)
elseif b3 then
e:SetCategory(CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b4 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = e:GetLabel()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
local bb = c:GetLocation()==LOCATION_DECK
if wh==LOCATION_HAND then
if not (b1 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_MZONE then
if not (b2 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_GRAVE then
if not (b3 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_REMOVED then
if not (b4 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToHand()
end
function s.tdfilter2(c)
return c:IsAbleToDeck()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
--枯竭之水·凝固奇迹
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--pendulum set
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--retrun to deck
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(0x36)
e12:SetCondition(s.con)
e12:SetCost(s.tdcost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(s.tgfilter,tp,LOCATION_DECK,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
local thg = Duel.GetMatchingGroup(s.tgfilter1,tp,LOCATION_DECK,0,nil)
local exg = Duel.GetMatchingGroup(s.tgfilter2,tp,LOCATION_DECK,0,nil,tp)
if thg:GetCount() <=0 or ((thg:GetCount() * exg:GetCount())>0 and Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))==1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.tgfilter2,tp,LOCATION_DECK,0,1,1,nil,tp)
if not g then return end
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
elseif exg:GetCount() <=0 or ((thg:GetCount() * exg:GetCount())>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.tgfilter1,tp,LOCATION_DECK,0,1,1,nil)
if not g then return end
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
end
function s.tgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and (c:IsAbleToHand() or c:IsType(TYPE_PENDULUM))
end
function s.tgfilter1(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function s.tgfilter2(c,tp)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_WATER) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_PENDULUM)
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,1,nil)
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local wh = e:GetHandler():GetLocation()
e:SetLabel(wh)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
if chk==0 then return (b1 or b2 or b3 or b4) end
if b1 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION,nil,1,0,0)
elseif b3 then
e:SetCategory(CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b4 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = e:GetLabel()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,0,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,c) and wh == LOCATION_MZONE
local b3 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_GRAVE
local b4 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) and wh == LOCATION_REMOVED
local bb = c:GetLocation()==LOCATION_DECK
if wh==LOCATION_HAND then
if not (b1 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_MZONE then
if not (b2 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
elseif wh==LOCATION_GRAVE then
if not (b3 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_REMOVED then
if not (b4 and bb) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToHand()
end
function s.tdfilter2(c)
return c:IsAbleToDeck()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
--东星极·右方之岩
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--to hand
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--hand to remove & extra to grave
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e12:SetCondition(s.con)
e12:SetCost(s.cost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(aux.NecroValleyFilter(s.thgfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local thg = Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thgfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if thg:GetCount()>0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
end
end
end
function s.thgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand() and
((c:IsLocation(LOCATION_EXTRA) and c:IsPosition(POS_FACEUP)) or c:IsLocation(LOCATION_DECK))
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_EXTRA+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA+LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_EXTRA+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_EXTRA
if chk==0 then return (b1 or b2) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) end
if b1 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_DESTROY,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = c:GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_EXTRA
if not ((wh==LOCATION_HAND or wh==LOCATION_EXTRA) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) )then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if wh==LOCATION_HAND then
if not (b1 and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_EXTRA then
if not (b2 and Duel.Destroy(c,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToDeck()
end
function s.tdfilter2(c)
return c:IsAbleToHand()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
--北星极·前方之水
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--to hand
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--hand to remove & extra to grave
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e12:SetCondition(s.con)
e12:SetCost(s.cost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(aux.NecroValleyFilter(s.thgfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local thg = Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thgfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if thg:GetCount()>0 then
Duel.SendtoExtraP(thg,nil,REASON_EFFECT)
end
end
end
function s.thgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToExtra()
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand() and
((c:IsLocation(LOCATION_EXTRA) and c:IsPosition(POS_FACEUP)) or c:IsLocation(LOCATION_DECK))
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_EXTRA+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA+LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_EXTRA+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_EXTRA and c:IsAbleToRemove()
if chk==0 then return (b1 or b2) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) end
if b1 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = c:GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_EXTRA and c:IsAbleToRemove()
if not ((wh==LOCATION_HAND or wh==LOCATION_EXTRA) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) )then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if wh==LOCATION_HAND then
if not (b1 and Duel.Destroy(c,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_EXTRA then
if not (b2 and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToDeck()
end
function s.tdfilter2(c)
return c:IsAbleToRemove()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
--右卫枢·失落
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--to hand
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--hand to remove & extra to grave
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e12:SetCondition(s.con)
e12:SetCost(s.cost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(s.thgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local thg = Duel.SelectMatchingCard(tp,s.thgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
if thg:GetCount()>0 then
Duel.SendtoGrave(thg,REASON_EFFECT)
end
end
end
function s.thgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToGrave() and (c:IsPosition(POS_FACEUP) or c:IsLocation(LOCATION_DECK))
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return 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_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_EXTRA
if chk==0 then return (b1 or b2) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) end
if b1 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_DESTROY,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = c:GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and wh == LOCATION_EXTRA
if not ((wh==LOCATION_HAND or wh==LOCATION_EXTRA) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) )then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if wh==LOCATION_HAND then
if not (b1 and Duel.Destroy(c,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_EXTRA then
if not (b2 and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToDeck()
end
function s.tdfilter2(c)
return c:IsAbleToHand()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
--右卫枢·失落
local s,id,o=GetID()
local Ccnt = 0
function s.initial_effect(c)
-- 让这张卡就算被无效也能放指示物
-- 以后定义哪张卡可以放指示物要在这里输入0x760
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e31:SetCode(EFFECT_COUNTER_PERMIT|0x760)
e31:SetRange(LOCATION_PZONE+LOCATION_MZONE)
c:RegisterEffect(e31)
--pendulum summon
aux.EnablePendulumAttribute(c)
--add counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
-- 用于让卡被无效之后指示物也不会被去除
-- 检测是否出现指示物跳变
local ec1=Effect.CreateEffect(c)
ec1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec1:SetCode(EVENT_CHAIN_SOLVED)
ec1:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec1:SetOperation(s.chkcop)
c:RegisterEffect(ec1)
-- 检测指示物是否属于自主减少
local ec0=Effect.CreateEffect(c)
ec0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec0:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec0:SetCode(EVENT_REMOVE_COUNTER+0x760)
ec0:SetOperation(s.chkncop)
c:RegisterEffect(ec0)
-- 指示物跳变时,检测这次变化是否是由效果无效而引起的,如果是,则加上失去的那些
local ec2=Effect.CreateEffect(c)
ec2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ec2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec2:SetRange(LOCATION_MZONE+LOCATION_PZONE)
ec2:SetCode(EVENT_CUSTOM+id)
ec2:SetOperation(s.htccop)
c:RegisterEffect(ec2)
-- 特殊召唤时,清除指示物设置
local ec3=Effect.CreateEffect(c)
ec3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
ec3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ec3:SetRange(LOCATION_MZONE)
ec3:SetCode(EVENT_SPSUMMON)
ec3:SetOperation(s.resetcop)
c:RegisterEffect(ec3)
local ec30=ec3:Clone()
ec30:SetCode(EVENT_SUMMON)
c:RegisterEffect(ec30)
local ec31=ec3:Clone()
ec31:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(ec31)
--special summon by PZONE
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.con)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(s.con)
e3:SetCost(s.cost)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
--to hand
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,5))
e10:SetCategory(CATEGORY_TOHAND)
e10:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e10:SetProperty(EFFECT_FLAG_DELAY)
e10:SetRange(LOCATION_MZONE)
e10:SetCode(EVENT_SUMMON_SUCCESS)
e10:SetCondition(s.con)
e10:SetCost(s.cost)
e10:SetTarget(s.thtg)
e10:SetOperation(s.thop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e11)
--hand to remove & extra to grave
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(id,6))
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e12:SetCondition(s.con)
e12:SetCost(s.cost)
e12:SetTarget(s.tdtg)
e12:SetOperation(s.tdop)
c:RegisterEffect(e12)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
--cannot be fusion&... material
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(s.fuslimit)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e8)
local e9=e7:Clone()
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e9)
--辅助判断卡组里有没有同名卡
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
--游戏开始后的第一个抽卡阶段检测卡组里有没有同名卡,卡号(2134500)标识每张卡都不用改
--会多次检测,但是只会施加一个标识
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(nil,tp,0x3,0,nil)
if aux.dncheck(gg) and Duel.GetFlagEffect(tp,22134500)<=0 then
Duel.RegisterFlagEffect(tp,22134500,0,0,0)
end
end
--通用自肃1,卡号(2134500)标识每张卡都不用改
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,22134500)>=1
end
--通用自肃2
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and e:GetHandler():GetFlagEffect(FLAG_ID_CHAINING)>0 then
e:GetHandler():AddCounter(0x760,1)
end
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not(re:GetHandler():GetBaseAttack()==re:GetHandler():GetBaseDefense())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Card.IsCanBeSpecialSummoned(c,e,0,tp,false,false) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT)then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x760,e,REASON_EFFECT,tp,tp,count)
local ct=Duel.GetMatchingGroupCount(aux.NecroValleyFilter(s.thgfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if ct==0 or (not Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local thg = Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thgfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if thg:GetCount()>0 then
Duel.SendtoExtraP(thg,nil,REASON_EFFECT)
end
end
end
function s.thgfilter(c)
return c:IsCanHaveCounter(0x760) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToExtra()
end
function s.pentg(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) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function s.thfilter(c)
return 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_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local wh = e:GetHandler():GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_HAND
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_EXTRA and c:IsAbleToRemove()
if chk==0 then return (b1 or b2) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) end
if b1 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
elseif b2 then
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local wh = c:GetLocation()
local b1 = Duel.IsExistingMatchingCard(s.tdfilter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_EXTRA
local b2 = Duel.IsExistingMatchingCard(s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c) and wh == LOCATION_HAND and c:IsAbleToRemove()
if not ((wh==LOCATION_HAND or wh==LOCATION_EXTRA) and Duel.IsCanRemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) )then return end
if not Duel.RemoveCounter(tp,1,0,0x760,5,REASON_EFFECT) then return end
if wh==LOCATION_EXTRA then
if not (b1 and Duel.Destroy(c,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.tdfilter1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif wh==LOCATION_HAND then
if not (b2 and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.tdfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function s.tdfilter1(c)
return c:IsAbleToDeck()
end
function s.tdfilter2(c)
return c:IsAbleToRemove()
end
-- 用于让卡被无效之后指示物也不会被去除
function s.chkcop(e,tp,eg,ep,ev,re,r,rp)
local cnt = e:GetHandler():GetCounter(0x760)
local chc = Ccnt
if chc > 0 then
if chc>=cnt and cnt<=1 and e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = chc
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,0,0)
return
end
end
Ccnt = cnt
end
function s.chkncop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(22134501)==0 then
Ccnt = e:GetHandler():GetCounter(0x760)
end
end
function s.htccop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:GetFlagEffect(22134501)<=0 and c:IsDisabled() and c:IsLocation(LOCATION_PZONE+LOCATION_MZONE) then
local cnt = Ccnt
if not (Duel.IsCanAddCounter(c:GetOwner(),0x760,cnt,c) and cnt >0) then return end
c:AddCounter(0x760,cnt)
end
end
function s.resetcop(e,tp,eg,ep,ev,re,r,rp)
Ccnt = 0
end
local m=33330300
local token={33330321}
local cm=_G["c"..m]
cm.name="THE TRUTH 真理之眼"
--配 置 信 息
cm.draw=1 --抽 卡 数
function cm.initial_effect(c)
c:EnableReviveLimit()
--Fusion
aux.AddFusionProcMix(c,false,true,cm.mfilter1,cm.mfilter2,cm.mfilter3)
--Special Summon Rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
e1:SetValue(SUMMON_TYPE_FUSION)
c:RegisterEffect(e1)
--Token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetTarget(cm.tktg)
e2:SetOperation(cm.tkop)
c:RegisterEffect(e2)
--Draw
-- local e3=Effect.CreateEffect(c)
-- e3:SetDescription(aux.Stringid(m,1))
-- e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
--e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
--e3:SetCode(EVENT_TO_GRAVE)
-- e3:SetProperty(EFFECT_FLAG_DELAY)
-- e3:SetCondition(cm.tdcon)
-- e3:SetTarget(cm.tdtg)
-- e3:SetOperation(cm.tdop)
-- c:RegisterEffect(e3)
--local e4=e3:Clone()
-- e4:SetCode(EVENT_REMOVE)
--c:RegisterEffect(e4)
--Special Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_REMOVE)
c:RegisterEffect(e4)
end
--Fusion
function cm.mfilter1(c)
return c:IsRace(RACE_WARRIOR) and c:IsLevel(2) and c:IsType(TYPE_TUNER)
end
function cm.mfilter2(c)
return c:IsRace(RACE_MACHINE)
end
function cm.mfilter3(c)
return c:IsAttribute(ATTRIBUTE_LIGHT)
end
--Special Summon Rule
function cm.mfilter(c,fc)
return (cm.mfilter1(c) or cm.mfilter2(c) or cm.mfilter3(c)) and c:IsFaceup()
and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
return c:CheckFusionMaterial(mg,nil,tp)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
local g=Duel.SelectFusionMaterial(tp,c,mg,nil,tp)
Duel.HintSelection(g)
c:SetMaterial(g)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
--Token
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,token[1],0,0x4011,-2,-2,10,RACE_CYBERSE,ATTRIBUTE_LIGHT)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.GetMZoneCount(tp)<1
or not Duel.IsPlayerCanSpecialSummonMonster(tp,token[1],0,0x4011,-2,-2,10,RACE_CYBERSE,ATTRIBUTE_LIGHT)
or not tc:IsRelateToEffect(e)
or tc:IsFacedown() then return end
local tk=Duel.CreateToken(tp,token[1])
Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tk:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(tc:GetAttack())
tk:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_DEFENSE_FINAL)
e3:SetValue(tc:GetDefense())
tk:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CHANGE_CODE)
e4:SetValue(tc:GetCode())
tk:RegisterEffect(e4)
--Destroy
local e5=Effect.CreateEffect(e:GetHandler())
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetOperation(cm.desop)
e5:SetReset(RESET_PHASE+PHASE_END)
tk:RegisterEffect(e5,true)
if tc:IsType(TYPE_EFFECT) then
--Copy Effect
tk:CopyEffect(tc:GetCode(),RESET_EVENT+RESETS_STANDARD)
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_ADD_TYPE)
e6:SetValue(TYPE_EFFECT)
e6:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e6,true)
local e7=e6:Clone()
e7:SetCode(EFFECT_REMOVE_TYPE)
e7:SetValue(TYPE_NORMAL)
tc:RegisterEffect(e7,true)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
--Special Summon
function cm.spfilter(c,e,tp)
return (c:IsSetCard(0x9552) or c.HopeSoul) and c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.thfilter(c)
return c:GetSummonLocation()~=LOCATION_HAND
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local sg=Duel.GetMatchingGroup(cm.thfilter,tp,0,LOCATION_MZONE,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
\ No newline at end of file
local m=33330301
local cm=_G["c"..m]
cm.name="希冀之魂 洛斯特"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
function cm.initial_effect(c)
--Cannot Release
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e2)
--Cannot Link
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--Battle
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetTarget(cm.bttg)
e4:SetOperation(cm.btop)
c:RegisterEffect(e4)
--Search
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCountLimit(1,33330299)
e5:SetTarget(cm.thtg)
e5:SetOperation(cm.thop)
c:RegisterEffect(e5)
end
--Battle
function cm.bttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACKTARGET)
Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetChainLimit(aux.FALSE)
end
function cm.btop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.CalculateDamage(c,tc)
end
end
--Search
function cm.thfilter(c)
return (c:IsSetCard(0x9552) or c.HopeSoul) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
local m=33330302
local tg={33330301,33330322}
local cm=_G["c"..m]
cm.name="希冀之魂 史莱姆之心"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
cm.atk=1000 --攻 击 力 上 升 数 值
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.tktg)
e2:SetOperation(cm.tkop)
c:RegisterEffect(e2)
end
cm.card_code_list={tg[1]}
--Special Summon
function cm.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x9552) or c.HopeSoul)
end
function cm.spfilter(c,e,tp)
return c:IsCode(tg[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
local tc=Duel.GetFirstMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP)
end
end
--Token
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,tg[2],0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_LIGHT)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(cm.atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,tg[2],0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_LIGHT) then return end
local tk1=Duel.CreateToken(tp,tg[2])
Duel.SpecialSummon(tk1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local tk2=Duel.CreateToken(tp,tg[2])
Duel.SpecialSummon(tk2,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
local m=33330303
local tg={33330301}
local cm=_G["c"..m]
cm.name="希冀之魂 剧毒之花 薇奈特西斯"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
cm.atk=500 --攻 击 力 上 升 数 值
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.efftg)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
cm.card_code_list={tg[1]}
--Special Summon
function cm.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x9552) or c.HopeSoul)
end
function cm.spfilter(c,e,tp)
return c:IsCode(tg[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
local tc=Duel.GetFirstMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP)
end
end
--Effect
function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCondition(cm.atkcon)
e1:SetOperation(cm.atkop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if not tc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(TYPE_NORMAL)
tc:RegisterEffect(e3,true)
end
end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
return c:IsRelateToBattle() and c:IsFaceup() and not tc:IsRace(RACE_PYRO)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(cm.atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
\ No newline at end of file
local m=33330304
local tg={33330301}
local cm=_G["c"..m]
cm.name="希冀之魂 魔方之眼"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
cm.selfDestroy=true --使 用 效 果 会 破 坏 自 身
cm.damage=400 --伤 害 基 数
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.efftg)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
cm.card_code_list={tg[1]}
--Special Summon
function cm.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x9552) or c.HopeSoul)
end
function cm.spfilter(c,e,tp)
return c:IsCode(tg[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
local tc=Duel.GetFirstMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP)
end
end
--Effect
function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if not tc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(TYPE_NORMAL)
tc:RegisterEffect(e3,true)
end
end
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetColumnGroup()
if cm.selfDestroy then g:AddCard(e:GetHandler()) end
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,cm.damage*g:GetCount())
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=c:GetColumnGroup()
if cm.selfDestroy then g:AddCard(c) end
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct>0 then
Duel.Damage(1-tp,cm.damage*ct,REASON_EFFECT)
end
end
end
\ No newline at end of file
local m=33330305
local tg={33330301}
local cm=_G["c"..m]
cm.name="希冀之魂 门之守卫 歌利亚"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.efftg)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
cm.card_code_list={tg[1]}
--Special Summon
function cm.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x9552) or c.HopeSoul)
end
function cm.spfilter(c,e,tp)
return c:IsCode(tg[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
local tc=Duel.GetFirstMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP)
end
end
--Effect
function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if not tc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(TYPE_NORMAL)
tc:RegisterEffect(e3,true)
end
end
end
\ No newline at end of file
local m=33330306
local tg={33330301}
local cm=_G["c"..m]
cm.name="希冀之魂 寒渊之蛇 奥妮克希亚"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
cm.mustRemove=true --必 须 除 外
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.efftg)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
cm.card_code_list={tg[1]}
--Special Summon
function cm.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x9552) or c.HopeSoul)
end
function cm.spfilter(c,e,tp)
return c:IsCode(tg[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
local tc=Duel.GetFirstMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP)
end
end
--Effect
function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(cm.rmop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if not tc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(TYPE_NORMAL)
tc:RegisterEffect(e3,true)
end
end
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc and tc:GetAttack()<e:GetHandler():GetAttack() then
Duel.Remove(tc,POS_FACEUP,cm.mustRemove and REASON_RULE or REASON_EFFECT)
end
end
\ No newline at end of file
--THE DRAWER 玄墨
local m=33330319
local cm=_G["c"..m]
cm.name="THE DRAWER"
function c33330319.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c33330319.tfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
---- local e2=Effect.CreateEffect(c)
-- e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
-- e2:SetType(EFFECT_TYPE_IGNITION)
-- e2:SetRange(LOCATION_GRAVE)
-- e2:SetCountLimit(1,33330319)
-- e2:SetCost(c33330319.spcost)
-- e2:SetTarget(c33330319.sptg)
-- e2:SetOperation(c33330319.spop)
-- c:RegisterEffect(e2)
--end
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17031211,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,33330319)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33330319,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c33330319.tgtg)
e2:SetOperation(c33330319.tgop)
c:RegisterEffect(e2)
--nontuner
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e4)
end
function c33330319.tfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.spcfilter(c,ft,tp)
return ft>0 or (c:IsControler(tp) and c:GetSequence()<5)
end
function cm.costfilter(c)
return c:IsFaceup() and c:IsLevelBelow(2)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if ft<0 then return false end
if ft==0 then
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil)
else
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft==0 then
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.Release(g,REASON_COST)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- if not c:IsRelateToEffect(e) then return end
-- Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
---to deck
function c33330319.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_WARRIOR) and c:IsAbleToGrave()
end
function c33330319.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33330319.tgfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c33330319.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=Duel.SelectMatchingCard(tp,c33330319.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local lv=tc:GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
local m=33330320
local cm=_G["c"..m]
cm.name="THE SOUL 魂之影像"
--配 置 信 息
cm.draw=1 --抽 卡 数
function cm.initial_effect(c)
c:EnableReviveLimit()
--Fusion
aux.AddFusionProcMix(c,false,true,cm.mfilter1,cm.mfilter2)
--Special Summon Rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
e1:SetValue(SUMMON_TYPE_FUSION)
c:RegisterEffect(e1)
--To Deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
--Special Summon
-- local e3=Effect.CreateEffect(c)
-- e3:SetDescription(aux.Stringid(m,1))
-- e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
-- e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
-- e3:SetCode(EVENT_TO_GRAVE)
-- e3:SetProperty(EFFECT_FLAG_DELAY)
-- e3:SetCondition(cm.spcon)
-- e3:SetTarget(cm.sptg)
-- e3:SetOperation(cm.spop)
-- c:RegisterEffect(e3)
-- local e4=e3:Clone()
--- e4:SetCode(EVENT_REMOVE)
-- c:RegisterEffect(e4)
--Draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(cm.tdcon1)
e3:SetTarget(cm.tdtg1)
e3:SetOperation(cm.tdop1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_REMOVE)
c:RegisterEffect(e4)
end
--Fusion
function cm.mfilter1(c)
return c:IsRace(RACE_WARRIOR) and c:IsLevel(2) and c:IsType(TYPE_TUNER)
end
function cm.mfilter2(c)
return c:IsAttribute(ATTRIBUTE_LIGHT)
end
--Special Summon Rule
function cm.mfilter(c,fc)
return (cm.mfilter1(c) or cm.mfilter2(c)) and c:IsFaceup()
and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGrave()
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
return c:CheckFusionMaterial(mg,nil,tp)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
local g=Duel.SelectFusionMaterial(tp,c,mg,nil,tp)
Duel.HintSelection(g)
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_COST)
end
--To Deck
function cm.tdfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
local tc=g:GetFirst()
if tc:IsSetCard(0x9552) or tc.HopeSoul then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,cm.draw)
end
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if (tc:IsSetCard(0x9552) or tc.HopeSoul) and tc:IsLocation(LOCATION_DECK)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
--Draw
function cm.tdfilter1(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToDeck()
end
function cm.shuffle1(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_DECK)
end
function cm.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.tdtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.tdfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
if chk==0 then return g:GetCount()>0 and Duel.IsPlayerCanDraw(tp,cm.draw) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,cm.draw)
end
function cm.tdop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tdfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
if og:IsExists(cm.shuffle1,1,nil,tp) then Duel.ShuffleDeck(tp) end
if og:IsExists(cm.shuffle1,1,nil,1-tp) then Duel.ShuffleDeck(1-tp) end
Duel.BreakEffect()
Duel.Draw(tp,cm.draw,REASON_EFFECT)
end
end
\ No newline at end of file
local m=33330323
local tg={33330301}
local cm=_G["c"..m]
cm.name="希冀之魂 埃尔赫南骑士"
--配 置 信 息
cm.HopeSoul=true --内 置 字 段
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Synchro
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(cm.synop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
cm.card_code_list={tg[1]}
--Special Summon
function cm.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x9552) or c.HopeSoul)
end
function cm.spfilter(c,e,tp)
return c:IsCode(tg[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp)>0 and Duel.GetMZoneCount(1-tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetMZoneCount(tp)<1 or Duel.GetMZoneCount(1-tp)<1 then return end
local tc=Duel.GetFirstMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP)
end
end
--Synchro
function cm.synop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
\ No newline at end of file
--THE DRAWER 白
local m=33330350
local token={33330351}
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--ritual summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.tktg)
e2:SetOperation(cm.tkop)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c)
local ft=Duel.GetMZoneCount(tp)
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,c)
end
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetMZoneCount(tp)
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,token[1],0,0x4011,-2,-2,10,RACE_CYBERSE,ATTRIBUTE_LIGHT)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.GetMZoneCount(tp)<1
or not Duel.IsPlayerCanSpecialSummonMonster(tp,token[1],0,0xa55f,-2,-2,1,RACE_WARRIOR,ATTRIBUTE_LIGHT)
or not tc:IsRelateToEffect(e)
or tc:IsFacedown() then return end
local tk=Duel.CreateToken(tp,token[1])
Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tk:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(tc:GetAttack())
tk:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_DEFENSE_FINAL)
e3:SetValue(tc:GetDefense())
tk:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetValue(tc:GetAttack())
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
e5:SetValue(tc:GetDefense())
c:RegisterEffect(e5)
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