Commit e102d580 authored by Nemo Ma's avatar Nemo Ma

append0418

parent fda639af
......@@ -9,8 +9,9 @@ Featuring:
- Additional supports of Anifriends in HASS
- Cards from new card packs: SBRT, ALAW and HTUD
- More cards from HTUD
- Cards from FUIP and NCNL packs
523 cards in total as of 190515
651 cards in total as of 210418
Credits to scripters:
人形, AlphaKretin, Nanahira, Lyris, real_scl, justfish and more
人形, AlphaKretin, Nanahira, Lyris, real_scl, justfish, RAIKAI, T and more
No preview for this file type
local m=33700650
local cm=_G["c"..m]
sr_ptsh=sr_ptsh or {}
sr_ptsh.loaded_metatable_list={}
function sr_ptsh.load_metatable(code)
local m1=_G["c"..code]
if m1 then return m1 end
local m2=sr_ptsh.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
sr_ptsh.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
function sr_ptsh.check_set(c,setcode,v,f,...)
local codet=nil
if type(c)=="number" then
codet={c}
elseif type(c)=="table" then
codet=c
elseif type(c)=="userdata" then
local f=f or Card.GetCode
codet={f(c)}
end
local ncodet={...}
for i,code in pairs(codet) do
for i,ncode in pairs(ncodet) do
if code==ncode then return true end
end
local mt=sr_ptsh.load_metatable(code)
if mt and mt["named_with_"..setcode] and (not v or mt["named_with_"..setcode]==v) then return true end
end
return false
end
function sr_ptsh.check_set_ptsh(c) --破天神狐
return sr_ptsh.check_set(c,"ptsh")
end
--
function sr_ptsh.Cmeffect(c,code)
--special summon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_MSET)
e1:SetRange(0x3ff)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(aux.TargetBoolFunction(sr_ptsh.limitfilter,code))
c:RegisterEffect(e1)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_MONSTER_SSET)
e11:SetValue(TYPE_SPELL)
c:RegisterEffect(e11)
return e1 and e11
end
function sr_ptsh.limitfilter(c,code) --破天神狐
return c:IsCode(code)
end
function sr_ptsh.efeffect(c,cod,cate,code,pro)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(cod,0))
e2:SetCategory(cate)
e2:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE)
e2:SetCode(code)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
if pro then
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+pro)
end
e2:SetCost(sr_ptsh.cost)
if c.condition then
e2:SetCondition(c.condition)
end
e2:SetTarget(c.target)
e2:SetOperation(c.operation)
c:RegisterEffect(e2)
return e2
end
function sr_ptsh.opeffect(c,code,cate)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(code,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCost(sr_ptsh.cost)
e1:SetCondition(sr_ptsh.opcon)
e1:SetTarget(sr_ptsh.optg)
e1:SetOperation(sr_ptsh.opop)
c:RegisterEffect(e1)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(code,2))
e2:SetCategory(cate)
e2:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCost(sr_ptsh.cost)
e2:SetCondition(sr_ptsh.opcon1)
e2:SetTarget(sr_ptsh.optg1)
e2:SetOperation(sr_ptsh.opop1)
c:RegisterEffect(e2)
return e1 and e2
end
function sr_ptsh.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m)==0 and aux.exccon(e) end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
c:CreateEffectRelation(e)
c:CancelToGrave(false)
c:RegisterFlagEffect(m,RESET_EVENT+EVENT_CHAIN_END,0,1)
end
function sr_ptsh.opcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function sr_ptsh.optg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local c=e:GetHandler()
c:CancelToGrave(true)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function sr_ptsh.opop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function sr_ptsh.opcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function sr_ptsh.opop1(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():CancelToGrave(true)
end
function sr_ptsh.optg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
-- Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT)
c:RegisterEffect(e2)
--remain field
if c.geteffect then
c.geteffect(e,tp,eg,ep,ev,re,r,rp)
end
end
if not cm then return end
cm.named_with_ptsh=true
--破天神狐 捌〇〇·六五七三七五七九
function cm.initial_effect(c)
local e1=sr_ptsh.Cmeffect(c,m)
local e2=sr_ptsh.efeffect(c,m,CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES,EVENT_TO_HAND)
local e3=sr_ptsh.opeffect(c,m)
end
function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if not ep or not eg then return false end
return eg:IsExists(cm.cfilter,1,nil,1-tp) and r==REASON_EFFECT and Duel.GetTurnPlayer()==1-tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local cc=eg:GetCount()
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,cc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.ffilter(c,e,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_HAND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=eg:Filter(cm.ffilter,nil,e,1-tp)
if sg:GetCount()==0 then
else
local c=e:GetHandler()
if Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.geteffect(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e2:SetCountLimit(1)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return sr_ptsh.check_set_ptsh(c) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,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
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 壹贰〇〇·六九七七七七六五
local m=33700651
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
local e1=sr_ptsh.Cmeffect(c,m)
local e2=sr_ptsh.efeffect(c,m,CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER,EVENT_DAMAGE,EFFECT_FLAG_DELAY)
local e4=sr_ptsh.efeffect(c,m,CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER,EVENT_BATTLE_DAMAGE,EFFECT_FLAG_DELAY)
local e3=sr_ptsh.opeffect(c,m)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and Duel.GetTurnPlayer()==1-tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return 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)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev*2)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Recover(tp,ev*2,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.geteffect(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--tohand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetRange(LOCATION_SZONE)
e3:SetValue(cm.val)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
c:RegisterEffect(e3)
end
function cm.val(e,re,dam,r,rp,rc)
return dam/2
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 壹柒〇〇·七六八九七八六九
local m=33700652
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
local e1=sr_ptsh.Cmeffect(c,m)
local e2=sr_ptsh.efeffect(c,m,CATEGORY_SPECIAL_SUMMON+CATEGORY_NEGATE,EVENT_CHAINING,EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
local e3=sr_ptsh.opeffect(c,m)
end
function cm.tfilter(c,tp)
return c:IsFacedown() and c:IsControler(tp)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsExists(cm.tfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,1,0,0)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Card.CancelToGrave(re:GetHandler())
Duel.SendtoHand(re:GetHandler(),nil,REASON_EFFECT)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.geteffect(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_SZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e3:SetCondition(cm.damcon)
e3:SetOperation(cm.damop)
c:RegisterEffect(e3)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e1:SetCondition(cm.damcon1)
e1:SetOperation(cm.damop)
c:RegisterEffect(e1)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
e:GetHandler():RegisterFlagEffect(m+100,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and c:GetFlagEffect(m+100)~=0 and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local lp=Duel.GetLP(1-tp)
Duel.SetLP(1-tp,math.max(0,lp-5000))
end
function cm.damcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsFaceup()
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 壹玖〇〇·七一七三七八六五
local m=33700653
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
local e1=sr_ptsh.Cmeffect(c,m)
local e2=sr_ptsh.efeffect(c,m,CATEGORY_POSITION,EVENT_SPSUMMON_SUCCESS)
local e3=sr_ptsh.opeffect(c,m)
end
function cm.filter(c,tp)
return c:IsFaceup() and c:GetSummonPlayer()~=tp and c:IsCanTurnSet()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
local g=eg:Filter(cm.filter,nil,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.geteffect(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e2:SetCountLimit(1)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return sr_ptsh.check_set_ptsh(c) and c:IsFaceup()
end
function cm.tgfilter(c)
return c:IsFacedown()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local tt=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_ONFIELD,0,nil)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return #tt>0 and Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,#tt,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#tt,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoGrave(g,REASON_RULE)
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 贰贰〇〇·六五九零八五八二
local m=33700654
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
local e1=sr_ptsh.Cmeffect(c,m)
local e2=sr_ptsh.efeffect(c,m,CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE,EVENT_CUSTOM+m,EFFECT_FLAG_DELAY)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_NEGATED)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e3=sr_ptsh.opeffect(c,m)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_PLAYER)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,e,0,dp,0,0)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
if not tc then return end
local c=e:GetHandler()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.geteffect(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e2:SetValue(800)
c:RegisterEffect(e2)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e2:SetValue(-800)
c:RegisterEffect(e2)
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 贰伍〇〇·七六六九六五七二
local m=33700655
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
local e1=sr_ptsh.Cmeffect(c,m)
local e2=sr_ptsh.efeffect(c,m,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE,EVENT_CHAINING,EFFECT_FLAG_DELAY)
local e3=sr_ptsh.opeffect(c,m)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return rp==1-tp and loc~=LOCATION_ONFIELD
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_DECK,c)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and #g>10 end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_DECK,c)
local ct=11
if #g<11 then
ct=#g
end
local tt=g:Select(1-tp,ct,ct,REASON_EFFECT)
Duel.SendtoGrave(tt,REASON_EFFECT)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.geteffect(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--to grave
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_SZONE)
e5:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e5:SetCondition(cm.descon)
e5:SetOperation(cm.desop)
c:RegisterEffect(e5)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return sr_ptsh.check_set_ptsh(re:GetHandler())
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,5,REASON_EFFECT)
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 ~异世界少女的日常被理不尽的祈愿撕裂之卷
local m=33700656
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function cm.filter(c)
return sr_ptsh.check_set_ptsh(c) and c:IsType(TYPE_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT)
tc:RegisterEffect(e2)
local e11=Effect.CreateEffect(e:GetHandler())
e11:SetType(EFFECT_TYPE_FIELD)
e11:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e11:SetCode(EFFECT_CANNOT_ACTIVATE)
e11:SetTargetRange(1,0)
e11:SetValue(cm.aclimit)
e11:SetLabel(tc:GetCode())
e11:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e11,tp)
tc=g:GetNext()
end
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
function cm.tdfilter(c,tp)
return sr_ptsh.check_set_ptsh(c) and c:IsFaceup() and (c:IsLocation(LOCATION_SZONE) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 )
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),tp) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_ONFIELD,0,nil)
local tg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
local tt=0
local st=tg:Filter(aux.dncheck,nil)
local ct=g:Filter(Card.IsLocation,nil,LOCATION_SZONE)
local gt=Duel.GetLocationCount(tp,LOCATION_SZONE)
tt=math.min(st,ct+gt)
if tt==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local mg=g:Select(tp,1,tt,c)
if mg:GetCount()==0 then return end
Duel.SendtoDeck(mg,nil,2,REASON_EFFECT)
local pg=Duel.GetOperatedGroup():IsLocation(LOCATION_DECK)
if pg:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,pg:GetCount(),pg:GetCount(),nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 ~意外的报告,有趣的展开,和随便的觉悟之卷
local m=33700657
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:GetSummonPlayer()==tp and tc:IsFaceup() and re:GetHandler()==tc
end
function cm.filter(c,code)
return sr_ptsh.check_set_ptsh(c) and c:IsType(TYPE_MONSTER) and c:IsCode(code)
end
function cm.filter1(c)
return sr_ptsh.check_set_ptsh(c) and c:IsType(TYPE_MONSTER)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tc:GetCode()) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT)
tc:RegisterEffect(e2)
--atk down
local atk=tc:GetAttack()
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TEMP_REMOVE-RESET_TURN_SET)
e2:SetValue(-atk)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 ~危险的计划,热情的鼓动带来的无上时机之卷
local m=33700658
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.filter(c)
return sr_ptsh.check_set_ptsh(c) and c:IsAbleToGraveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,0,1,1,c)
local seq=g:GetFirst():GetSequence()
Duel.SendtoGrave(g,REASON_COST)
g:KeepAlive()
e:SetLabelObject(g:GetFirst())
if not g:GetFirst():IsType(TYPE_MONSTER) then
e:SetLabel(seq)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject()
if tc:IsType(TYPE_MONSTER) then
e:SetCategory(CATEGORY_ATKCHANGE)
else
e:SetCategory(CATEGORY_DISABLE)
end
end
function cm.val(c)
return sr_ptsh.check_set_ptsh(c) and c:IsFaceup()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc:IsType(TYPE_MONSTER) then
local atk=tc:GetAttack()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESET_PHASE+PHASE_END)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.val)
e2:SetValue(atk)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e3,tp)
else
local seq=e:GetLabel()
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e4:SetTarget(cm.distg)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetLabel(seq)
Duel.RegisterEffect(e4,tp)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(cm.disop)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetLabel(seq)
Duel.RegisterEffect(e5,tp)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e6:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e6:SetTarget(cm.distg)
e6:SetReset(RESET_PHASE+PHASE_END)
e6:SetLabel(c:GetSequence())
Duel.RegisterEffect(e6,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.distg1)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_SET_ATTACK)
e2:SetValue(0)
c:RegisterEffect(e2)
end
end
function cm.distg(e,c)
local seq=e:GetLabel()
local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.GetColumn(c,tp)==seq
end
function cm.distg1(e,c)
local seq=e:GetLabel()
local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and aux.GetColumn(c,tp)==seq
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if loc&LOCATION_SZONE~=0 and seq<=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and ((rp==tp and seq==tseq) or (rp==1-tp and seq==4-tseq)) then
Duel.NegateEffect(ev)
end
end
function cm.filter1(c,e,tp)
return sr_ptsh.check_set_ptsh(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.filter1,tp,LOCATION_SZONE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
if not pcall(function() require("expansions/script/c33700650") end) then require("script/c33700650") end
--破天神狐 ~那藏身于世界远端的,作为次元之锚定点的,由光和云·雾和雨·希望和祈祷纺织出的梦想城寨·破天城
local m=33700659
local cm=_G["c"..m]
cm.named_with_ptsh=true
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot set
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_MSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(0,1)
e4:SetTarget(cm.val)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_SSET)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_TURN_SET)
c:RegisterEffect(e6)
local e7=e4:Clone()
e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e7:SetTarget(cm.sumlimit)
c:RegisterEffect(e7)
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return bit.band(sumpos,POS_FACEDOWN)>0 or not se:GetHandler():IsCode(m)
end
function cm.val(e,c,sump,sumtype,sumpos,targetp,se)
if not se then return true end
return not se:GetHandler():IsCode(m)
end
function cm.filter(c)
return sr_ptsh.check_set_ptsh(c) and c:IsType(TYPE_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,3,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
if g:GetCount()>=1 then
--indes
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(aux.TRUE)
e2:SetValue(aux.tgoval)
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
Duel.RegisterEffect(e2,tp)
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(aux.TRUE)
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
Duel.RegisterEffect(e2,tp)
end
if g:GetCount()>=2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
if g:GetCount()==2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
e2:SetTargetRange(1,1)
Duel.RegisterEffect(e2,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_DP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END,3)
Duel.RegisterEffect(e1,tp)
end
end
\ No newline at end of file
--捧杀
local m=33701335
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(cm.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
if e:GetOwner():IsRelateToChain(ev) then
e:GetOwner():CancelToGrave(false)
end
end
function cm.filter(c)
return c:IsFaceup() and c:GetAttack()>c:GetBaseAttack()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
--Atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(cm.eqlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.damcon)
e3:SetOperation(cm.damop)
c:RegisterEffect(e3)
else
c:CancelToGrave(false)
end
end
function cm.eqlimit(e,c)
return c:GetAttack()>c:GetBaseAttack()
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget():GetControler()==Duel.GetTurnPlayer()
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local m1={}
local n1={}
local ct=1
local op=1
m1[ct]=aux.Stringid(m,0) n1[ct]=1 ct=ct+1
m1[ct]=aux.Stringid(m,1) n1[ct]=2 ct=ct+1
local sp=Duel.SelectOption(tp,table.unpack(m1))
op=n1[sp+1]
if op==1 then
Duel.Damage(c:GetEquipTarget():GetAttack())
else
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_HAND)
c:RegisterEffect(e1)
Duel.SendtoGrave(c:GetEquipTarget(),REASON_RULE)
e1:Reset()
end
end
--吃瘪啦!
local m=33701336
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.handcon)
c:RegisterEffect(e2)
end
function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,1-tp) and Duel.GetCurrentPhase()<PHASE_MAIN1 and Duel.GetTurnPlayer()~=tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(eg)
local ct=eg:GetCount()
if ct>=2 then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,eg:GetCount()-1)
end
end
function cm.filter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.filter,nil,e,1-tp)
local ct=g:GetCount()
if ct>=2 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local sg=g:Select(1-tp,ct-1,ct-1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_RULE)
local rg=Duel.GetOperatedGroup()
local tc=rg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
tc:RegisterEffect(e1)
tc=rg:GetNext()
end
end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(tp,e:GetHandler())
end
function cm.repfilter(c,tp)
return c:IsControler(1-tp) and c:IsLocation(LOCATION_DECK) and c:GetDestination()==LOCATION_HAND and c:IsAbleToRemove()
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) end
local g=eg:Filter(cm.repfilter,nil,tp)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_HAND_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+0x1de0000+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_REMOVE)
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon1)
e1:SetOperation(cm.thop1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
return true
end
function cm.thfilter1(c)
return c:GetFlagEffect(m)~=0
end
function cm.thcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.thfilter1,1,nil)
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.thfilter1,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
function cm.repval(e,c)
return false
end
--眼前一片白!
local m=33701337
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.condition1)
e2:SetCost(cm.cost1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROY)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetOperation(cm.checkop1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return cm[tp]>=6
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return cm[tp+2]>=5 and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_END,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,2)
else
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_END,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetCountLimit(1)
e1:SetOperation(cm.op)
e1:SetReset(EVENT_PHASE+PHASE_DRAW)
Duel.RegisterEffect(e1,tp)
Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_EP)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
Duel.RegisterEffect(e2,tp)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_MZONE) then
cm[tc:GetControler()]=cm[tc:GetControler()]+1
end
tc=eg:GetNext()
end
end
function cm.checkop1(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_ONFIELD) then
cm[tc:GetControler()+2]=cm[tc:GetControler()+2]+1
end
tc=eg:GetNext()
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
end
--散华·玉玺之殇
local m=33701338
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Effect Draw
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.pdrcon)
e2:SetOperation(cm.pdrop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DRAW)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.condition)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
end
function cm.pdrcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.pdrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetDrawCount(1-tp)
if Duel.SelectYesNo(1-tp,aux.Stringid(m,0)) then
--Effect Draw
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(0,1)
e1:SetValue(ct+1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DRAW)
c:RegisterEffect(e1)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
local m1={}
local n1={}
local ct=1
local op=1
m1[ct]=aux.Stringid(m,0) n1[ct]=1 ct=ct+1
m1[ct]=aux.Stringid(m,1) n1[ct]=2 ct=ct+1
local sp=Duel.SelectOption(tp,table.unpack(m1))
op=n1[sp+1]
if op==1 then
local ct=2
if Duel.GetCurrentPhase()==PHASE_DRAW then ct=5 end
Duel.DiscardDeck(ep,ct,REASON_EFFECT)
else
local ct=2000
if Duel.GetCurrentPhase()==PHASE_DRAW then ct=5000 end
Duel.Recover(tp,eg:GetCount()*ct,REASON_EFFECT)
end
end
--破·坏·拳
local m=33701339
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local res=1-Duel.RockPaperScissors(false)
Duel.Damage(res,1000,REASON_EFFECT)
local c=e:GetHandler()
if Duel.GetFlagEffect(res,m)==0 then
Duel.RegisterFlagEffect(res,m,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,1,ev)
else
local label=Duel.GetFlagEffectLabel(res,m)
Duel.SetFlagEffectLabel(res,m,label+ev)
end
if Duel.GetFlagEffect(res,m)>=3000 then
Duel.Damage(res,4999,REASON_EFFECT)
end
end
--宇宙融合·日月
local m=33701340
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
end
function cm.filter1(c,e)
return c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function cm.sfilter0(c,e,tp)
local lv=c:GetLevel()
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and Duel.IsExistingMatchingCard(cm.sfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp,lv)
end
function cm.sfilter1(c,tp,lv)
local rlv=lv-c:GetLevel()
local rg=Duel.GetMatchingGroup(cm.sfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,c)
return rlv>0 and c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
and rg:CheckWithSumEqual(Card.GetLevel,rlv,1,63)
end
function cm.sfilter2(c)
return c:GetLevel()>0 and not c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter0,nil)
local mg2=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res1=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res1=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
local res2=aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(cm.sfilter0,tp,LOCATION_EXTRA,0,1,nil,e,tp)
if chk==0 then
return res1 or res2
end
local op=1
if res1 or res2 then
local m={}
local n={}
local ct=1
if res1 then m[ct]=aux.Stringid(m,0) n[ct]=1 ct=ct+1 end
if res2 then m[ct]=aux.Stringid(m,1) n[ct]=2 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
end
e:SetLabel(op)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetLabel() then return end
local op=e:GetLabel()
if op==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
else
if aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) and Duel.IsExistingMatchingCard(cm.sfilter0,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,cm.sfilter0,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local lv=g1:GetFirst():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.sfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp,lv)
local rlv=lv-g2:GetFirst():GetLevel()
local rg=Duel.GetMatchingGroup(cm.sfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,g2:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=rg:SelectWithSumEqual(tp,Card.GetLevel,rlv,1,63)
g2:Merge(g3)
Duel.Remove(g2,POS_FACEUP,REASON_EFFECT)
Duel.SpecialSummon(g1,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
end
end
end
--是小钱硬币哟!
local m=33701341
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.rectg)
e1:SetOperation(cm.recop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_RECOVER)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.drcon)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(400)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,400)
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return ev<=400
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
--切蒲英炮
local m=33701342
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_RECOVER)
ge2:SetOperation(cm.checkop1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(cm.operation)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local lp1=Duel.GetLP(tp)
local lp2=Duel.GetLP(1-tp)
local op=0
if lp1<lp2 then op=0
elseif lp1>lp2 then op=1
else op=2
end
if op==0 then
Duel.Damage(1-tp,cm[tp],REASON_EFFECT,true)
elseif op==1 then
Duel.Recover(tp,cm[tp],REASON_EFFECT,true)
else
Duel.Damage(tp,3000,REASON_EFFECT,true)
Duel.Damage(1-tp,3000,REASON_EFFECT,true)
Duel.RDComplete()
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
cm[tc:GetOwnerPlayer()]=cm[tc:GetOwnerPlayer()]+1
end
function cm.checkop1(e,tp,eg,ep,ev,re,r,rp)
cm[tc:GetOwnerPlayer()]=cm[tc:GetOwnerPlayer()+2]+1
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
end
--物欲探测器
local m=33701343
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetCounterLimit(0x1443,3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.thcon1)
e2:SetOperation(cm.thop1)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_BOTH_SIDE+EFFECT_FLAG_PLAYER_TARGET)
e3:SetCondition(cm.rccon)
e3:SetCost(cm.rccost)
e3:SetOperation(cm.rcop)
c:RegisterEffect(e3)
--self destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EFFECT_SELF_DESTROY)
e4:SetCondition(cm.descon)
c:RegisterEffect(e4)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1200) end
local lp=Duel.GetLP(tp)
local m=math.floor(math.min(lp,3600)/1200)
local t={}
for i=1,m do
t[i]=i*1200
end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,ac)
e:SetLabel(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanAddCounter(tp,0x1443,e:GetLabel(),c) end
c:AddCounter(0x1443,e:GetLabel())
end
function cm.cfilter(c,tp)
return c:IsControler(1-tp) and not c:IsReason(REASON_DRAW) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.thfilter(c,tpe)
return c:IsType(tpe) and c:IsAbleToHand()
end
function cm.thcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and eg:GetCount()==1
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.SelectYesNo(aux.Stringid(m,1)) then
local rtype=bit.band(eg:GetFirst():GetType(),0x7)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,rtype)
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoHand(sg,tp,REASON_EFFECT)>0 then
e:GetHandler():RemoveCounter(tp,0x1443,1,REASON_EFFECT)
end
end
end
function cm.rccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOwner()~=tp
end
function cm.rccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
local lp=Duel.GetLP(tp)
local m=e:GetHandler():GetCounter(0x1443)
local t={}
for i=1,m do
t[i]=i*1000
end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,ac)
e:SetLabel(m)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:RemoveCounter(tp,0x1443,e:GetLabel(),REASON_EFFECT)
end
end
function cm.descon(e)
return e:GetHandler():GetCounter(0x1443)==0
end
--兵精粮足
local m=33701344
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_DRAW)
e2:SetCountLimit(1)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
--disable search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TO_HAND)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
c:RegisterEffect(e3)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsLocation(LOCATION_HAND) and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)==1) or Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)==0
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,3)
e1:SetCondition(cm.sdcon)
e1:SetOperation(cm.sdop)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
end
function cm.sdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.sdop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
e:GetHandler():SetTurnCounter(ct+1)
if ct==2 then
Duel.SendtoGrave(e:GetHandler(),REASON_RULE)
else e:SetLabel(e:GetLabel()+1) end
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetTurnPlayer()
Duel.Draw(p,1,REASON_EFFECT)
end
--欲望的调料
local m=33701345
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.ctcon)
e2:SetOperation(cm.ctop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(cm.ctcon1)
e4:SetOperation(cm.ctop1)
c:RegisterEffect(e4)
end
function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1,m)
e:GetHandler():AddCounter(0x1443,eg:GetCount())
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
if g:GetCount()>0 and e:GetHandler():IsCanRemoveCounter(tp,0x1443,3,REASON_EFFECT) and Duel.SelectYesNo(aux.Stringid(m,0)) then
e:GetHandler():RemoveCounter(tp,0x1443,3,REASON_EFFECT)
local sg=g:Select(tp,1,1,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function cm.ctcon1(e,tp,eg,ep,ev,re,r,rp)
return rp==tp
end
function cm.ctop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1,m)
if e:GetHandler():IsCanRemoveCounter(tp,0x1443,1,REASON_EFFECT) then
e:GetHandler():RemoveCounter(tp,0x1443,1,REASON_EFFECT)
else
local sg=eg:Clone()
sg:AddCard(e:GetHandler())
Duel.Destroy(sg,REASON_EFFECT)
end
end
--新世代虚拟YouTuber YUA
local m=33701348
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,aux.TRUE,cm.xyzcheck,5,5)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP,1)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.xyzcheck(g)
return g:GetClassCount(Card.GetLevel)==1
end
function cm.cfilter(c)
return c:IsCanBeXyzMaterial(nil) and c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsSummonLocation(LOCATION_EXTRA)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,3,nil) and Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,3,3,nil)
if g:IsExists(Card.IsControler,1,nil,1-tp) then
e:SetTargetRange(POS_FACEUP,0)
end
local sg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=g:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(g)
Duel.Overlay(c,g)
g:DeleteGroup()
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1)
e3:SetOperation(cm.op)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetLabelObject(c)
Duel.RegisterEffect(e3,tp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp,c)
Duel.GetControl(e:GetLabelObject(),1-tp)
e:Reset()
end
--虚拟YouTuber 李紫音
local m=33701349
local cm=_G["c"..m]
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,cm.cfilter1,cm.cfilter2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
c:EnableReviveLimit()
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
--indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1)
e3:SetCondition(cm.indcon)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,1)
e4:SetValue(HALF_DAMAGE)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_DIRECT_ATTACK)
e5:SetCondition(cm.dircon)
c:RegisterEffect(e5)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e11:SetValue(1)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e12)
local e13=e11:Clone()
e13:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e13)
local e14=e11:Clone()
e14:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e14)
end
function cm.cfilter1(c)
return c:IsType(TYPE_TUNER) and c:IsLevelBelow(1)
end
function cm.cfilter2(c)
return not c:IsType(TYPE_TUNER) and c:IsLevelBelow(1)
end
function cm.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function cm.indcon(e)
return e:GetHandler():IsAttackPos()
end
function cm.dircon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1
end
--无言的威胁
local m=33701359
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(cm.condition1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(cm.chainop)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCondition(cm.actcon)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
Duel.RegisterEffect(e2,tp)
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then
Duel.SetChainLimit(cm.chainlm)
end
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
function cm.actcon(e)
local ph=Duel.GetCurrentPhase()
return (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
--全灵的一扫(WIP)
local m=33701360
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function cm.filter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsPreviousLocation(LOCATION_EXTRA) and Duel.IsPlayerCanSendtoGrave(c:GetControler(),c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local p=tc:GetControler()
local t1=false
local t2=Duel.IsPlayerCanSendtoGrave(p,tc)
if t1 or t2 then
local m={}
local n={}
local ct=1
if t1 then m[ct]=aux.Stringid(m,1) n[ct]=1 ct=ct+1 end
if t2 then m[ct]=aux.Stringid(m,2) n[ct]=2 ct=ct+1 end
local sp=Duel.SelectOption(p,table.unpack(m))
op=n[sp+1]
end
if op==1 then
elseif op==2 then
Duel.SendtoGrave(tc,REASON_RULE)
end
end
--Power of Anger
local m=33701361
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,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_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT))
end
function cm.thfilter(c,e,tp)
if not (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4)) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
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,e,tp) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and tc:IsAttack(1200) and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.IsPlayerCanSpecialSummonMonster(tp,35514097,0,0x4011,1200,1200,4,RACE_MACHINE,ATTRIBUTE_LIGHT) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
for i=1,2 do
local token=Duel.CreateToken(tp,35514097)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
end
end
end
--勇壮
local m=33701362
local cm=_G["c"..m]
function cm.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET++EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.cfilter(c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(cm.filter,0,LOCATION_MZONE,0,2,c,c:GetCode())
end
function cm.filter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local atk=0
local def=0
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,tc,tc:GetCode())
local bc=g:GetFirst()
while bc do
atk=atk+bc:GetAttack()
def=def+bc:GetDefense()
bc=g:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(def)
tc:RegisterEffect(e2)
if tc:IsRace(RACE_MACHINE) or tc:IsRace(RACE_PSYCHO) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(1)
e1:SetCondition(cm.actcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
function cm.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
--开幕雷击
local m=33701363
local cm=_G["c"..m]
function cm.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.damtg)
e1:SetOperation(cm.damop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TURN_END)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,aux.FALSE)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
if Duel.GetActivityCount(m,tp,ACTIVITY_CHAIN)==1 then
Duel.BreakEffect()
Duel.Damage(p,1000,REASON_EFFECT)
end
if cm[e:GetOwnerPlayer()]==0 then
Duel.BreakEffect()
Duel.Damage(p,3000,REASON_EFFECT)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
cm[Duel.GetTurnPlayer()]=cm[Duel.GetTurnPlayer()]+1
end
--突袭的眠气
local m=33701365
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local ng=Group.CreateGroup()
local dg=Group.CreateGroup()
if Duel.GetCurrentChain()>0 then
for i=1,(Duel.GetCurrentChain()-1) do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te:IsHasType(EFFECT_TYPE_ACTIVATE) or te:IsActiveType(TYPE_MONSTER) then
local tc=te:GetHandler()
ng:AddCard(tc)
if tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
end
end
Duel.SetTargetCard(dg)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,ng,ng:GetCount(),0,0)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCurrentChain()>0 then
local dg=Group.CreateGroup()
for i=1,ev do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if (te:IsHasType(EFFECT_TYPE_ACTIVATE) or te:IsActiveType(TYPE_MONSTER))
and Duel.NegateActivation(i) and tc:IsRelateToEffect(e) and tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
end
end
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.GetTurnPlayer()~=tp then
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_END,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
else
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_END,RESET_PHASE+PHASE_END,1)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetCountLimit(1)
e1:SetOperation(cm.op)
e1:SetReset(EVENT_PHASE+PHASE_DRAW)
Duel.RegisterEffect(e1,tp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetValue(cm.aclimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsLocation(LOCATION_HAND)
end
--廻散华·晦阳岚影仇讨
local m=33701367
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLE_DESTROYED)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return cm[tp]>=cm[1-tp]
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=cm[tp]+cm[1-tp]
local c=e:GetHandler()
if ct>=7 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetTargetRange(0,1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
elseif ct>=13 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
cm[tc:GetControler()]=cm[tc:GetControler()]+1
tc=eg:GetNext()
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--五月的蝇
local m=33701368
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return cm[1-tp]>(math.floor(Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)/2)) and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)>=5
end
function cm.filter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsPreviousLocation(LOCATION_EXTRA) and c:IsSummonPlayer(1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
local ct=g:GetCount()-Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)
if chk==0 then return eg:IsExists(cm.filter,1,nil,tp) and Duel.IsPlayerCanSendtoGrave(1-tp) and ct>0 and g:IsExists(Card.IsAbleToGrave,1,nil,1-tp,REASON_RULE) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,ct,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,math.floor(Duel.GetLP(1-tp)/2))
if not Duel.IsPlayerCanSendtoGrave(1-tp) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
local ct=g:GetCount()-Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:FilterSelect(1-tp,Card.IsAbleToGrave,ct,ct,nil,1-tp,REASON_RULE)
Duel.SendtoGrave(sg,REASON_RULE)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_MZONE) and tc:IsPreviousLocation(LOCATION_EXTRA) then
cm[tc:GetSummonPlayer()]=cm[tc:GetSummonPlayer()]+1
end
tc=eg:GetNext()
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--缝合怪融合
local m=33701369
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cm.costfilter(c)
return c:IsType(TYPE_FUSION) and not c:IsType(TYPE_EFFECT) and not c:IsPublic() and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_DECK,0,nil)
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
--破灭前夕
local m=33701370
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()>=30
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,100)
Duel.SetLP(1-tp,100)
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCondition(cm.damcon)
e1:SetOperation(cm.damop)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
Duel.RegisterEffect(e1,tp)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,100,REASON_EFFECT,true)
Duel.Damage(1-tp,100,REASON_EFFECT,true)
Duel.RDComplete()
end
--定命的书信
local m=33701371
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.condition1)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.activate1)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local ex,tg,tc,p,d=Duel.GetOperationInfo(ev,CATEGORY_DRAW)
return ep~=tp and ex and (p==tp or d>0) and Duel.GetTurnPlayer()==1-tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
local g=Duel.GetDecktopGroup(tp,ct)
return g:FilterCount(Card.IsAbleToHand,nil)>0
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_SOLVED,2)
Duel.RegisterEffect(e1,tp)
end
function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_DECK) and c:GetDestination()==LOCATION_HAND and c:IsReason(REASON_DRAW)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) and e:GetLabelObject()==re end
local g=eg:Filter(cm.repfilter,nil,tp)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_HAND_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+0x1de0000+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct==0 then return end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmDecktop(tp,ct)
if g:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsAbleToHand() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
end
else
Duel.ShuffleDeck(tp)
end
end
function cm.repval(e,c)
return true
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
local ex,tg,tc,p,d=Duel.GetOperationInfo(ev,CATEGORY_DRAW)
return ep~=tp and ex and (p~=tp or d>0) and Duel.GetTurnPlayer()==tp
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetTarget(cm.reptg1)
e1:SetValue(cm.repval)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_SOLVED,2)
Duel.RegisterEffect(e1,tp)
end
function cm.reptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,1-tp) and e:GetLabelObject()==re end
local g=eg:Filter(cm.repfilter,nil,tp)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_HAND_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+0x1de0000+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
Duel.ConfirmCards(tp,tc)
end
--非法融合
local m=33701372
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cm.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and not c:IsType(TYPE_EFFECT) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.filter3(c)
return c:IsCanBeFusionMaterial()
end
function cm.ffilter(c,e,tp)
return c:IsType(TYPE_FUSION) and not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if hg:GetCount()==0 then return end
Duel.ConfirmCards(tp,hg)
local chkf=tp
local mg1=hg:Filter(cm.filter3,nil)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
else
Duel.Damage(tp,3000,REASON_EFFECT)
end
end
--面对风暴
local m=33701373
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_EXTRA,0,1,nil)
end
function cm.spfilter(c,e,tp)
return c:IsFacedown() and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not se:GetHandler():IsCode(e:GetOwner():GetCount()) and c:IsLocation(LOCATION_EXTRA)
end
--烈天的一击
local m=33701374
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.cfilter(c)
return c:IsFaceup() and (c:IsRace(RACE_PSYCHO) or c:IsRace(RACE_MACHINE))
end
function cm.tgfilter(c,tc)
return c:IsFaceup() and (c:IsAttackBelow(tc:GetAttack()) or c:IsDefenseBelow(tc:GetDefense()))
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_SZONE,0)==1
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.cfilter(chkc) end
if chk==0 then return g:GetCount()==ct and ct==1 and g:GetFirst():IsCanBeEffectTarget(e) end
local tc=g:GetFirst()
e:SetTargetCard(tc)
local sg=Duel.GetMatchingGroup(cm.tgfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#sg,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetFirstTarget()
local c=e:GetHandler()
if not tc:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
g=Duel.GetOperatedGroup()
end
if cm[tp+2]==0 then
local maxAtk=0
local sg=Group.CreateGroup()
if g:GetCount()>0 then
sg,maxAtk=g:GetMaxGroup(Card.GetAttack)
end
if maxAtk<tc:GetAttack() then maxAtk=tc:GetAttack() end
if maxAtk<tc:GetDefense() then maxAtk=tc:GetDefense() end
Duel.BreakEffect()
Duel.Damage(tp,maxAtk,REASON_EFFECT)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp and 1-ep==rp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
cm[ep]=cm[ep]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
if cm[0]>=4000 then cm[2]=1 else cm[2]=0 end
if cm[1]>=4000 then cm[3]=1 else cm[3]=0 end
cm[0]=0
cm[1]=0
end
--世代碾替
local m=33701375
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_TODECK+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local op=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,1))
if op==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REVERSE_DECK)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil)
if rg:GetCount()>0 then
Duel.BreakEffect()
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
local tg=Duel.GetFieldGroup(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0)
if tg:GetCount()>0 then
Duel.BreakEffect()
Duel.Draw(tp,tg:GetCount(),REASON_EFFECT)
end
tg=tg:Filter(Card.IsAbleToDeck,nil)
if tg:GetCount()>0 then
Duel.BreakEffect()
Duel.SortDecktop(tp,tp,tg:GetCount())
for i=1,tg:GetCount() do
local mg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(mg:GetFirst(),1)
end
end
else
Duel.Recover(tp,4000,REASON_EFFECT,true)
Duel.Recover(1-tp,4000,REASON_EFFECT,true)
Duel.RDComplete()
end
end
--天之志雷马
local m=33701376
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.dmtg)
e2:SetOperation(cm.dmop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(TIMING_DAMAGE_STEP)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.condition)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetOperation(cm.atkop1)
c:RegisterEffect(e4)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp and bit.band(r,REASON_EFFECT)~=0 and re:GetHandler()==c and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ev)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,math.floor(Duel.GetLP(p)/2),REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
local bc=c:GetBattleTarget()
if bc~=nil then e:SetLabelObject(bc) end
return ph==PHASE_DAMAGE and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
and not Duel.IsDamageCalculated()
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=e:GetLabelObject()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
local t2=c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsRelateToBattle()
local op=0
local m={}
local n={}
local ct=1
m[ct]=aux.Stringid(m,2) n[ct]=1 ct=ct+1
if t2 then m[ct]=aux.Stringid(m,3) n[ct]=2 ct=ct+1 end
m[ct]=aux.Stringid(m,4) n[ct]=3 ct=ct+1
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
if op==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(cm.efilter)
e1:SetOwnerPlayer(tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
elseif op==2 then
Duel.SendtoGrave(bc,REASON_EFFECT)
elseif op==3 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e2)
end
end
function cm.atkop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetTurnPlayer()==tp then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(math.ceil(c:GetAttack()/2))
c:RegisterEffect(e1)
end
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
--沙包化
local m=33701377
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)*4)
local t2=Duel.IsPlayerCanDraw(tp)
local op=0
local m={}
local n={}
local ct=1
m[ct]=aux.Stringid(m,0) n[ct]=1 ct=ct+1
if t2 then m[ct]=aux.Stringid(m,1) n[ct]=2 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
Duel.BreakEffect()
if op==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(cm.damval)
Duel.RegisterEffect(e1,tp)
else op==2 then
Duel.Draw(tp,3,REASON_EFFECT)
end
end
function cm.damval(e,re,val,r,rp)
return val*2
end
--威压的存在感
local m=33701378
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_INACTIVATE)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(cm.effectfilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISEFFECT)
e3:SetRange(LOCATION_SZONE)
e3:SetValue(cm.effectfilter)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(cm.actcona)
e4:SetValue(cm.actlimit)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0)
e4:SetCondition(cm.actconb)
e5:SetValue(cm.actlimit)
c:RegisterEffect(e5)
end
function cm.lvcheck(g,g1)
if g1:GetCount()==0 then
if g:GetCount()>0 then return true
else return false end
end
local lvmax=g:GetSum(Card.GetLevel)
local rkmax=g:GetSum(Card.GetRank)
local lkmax=g:GetSum(Card.GetLink)
local lvmax1=g1:GetSum(Card.GetLevel)
local rkmax1=g1:GetSum(Card.GetRank)
local lkmax1=g1:GetSum(Card.GetLink)
local t1=(lvmax>0 and lvmax>lvmax1) or (lvmax<=0 and lvmax1<=0)
local t2=(rkmax>0 and rkmax>rkmax1) or (rkmax<=0 and rkmax1<=0)
local t3=(lkmax>0 and lkmax>lkmax1) or (lkmax<=0 and lkmax1<=0)
return t1 and t2 and t3
end
function cm.effectfilter(e,ct)
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
if not te:IsActiveType(TYPE_MONSTER) then return false end
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
return cm.lvcheck(g,g1)
end
function cm.actcona(e)
local tp=e:GetHandler():GetControler()
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g1=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
return cm.lvcheck(g,g1)
end
function cm.actconb(e)
local tp=e:GetHandler():GetControler()
local g=Duel.GetFieldGroup(1-tp,LOCATION_MZONE,0)
local g1=Duel.GetFieldGroup(1-tp,0,LOCATION_MZONE)
return cm.lvcheck(g,g1)
end
function cm.actlimit(e,re,tp)
if not re:IsActiveType(TYPE_MONSTER) then return false end
local rc=re:GetHandler()
local min=0
local rclv=0
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
if g:GetCount()==0 then return true end
if rc:GetLevel()>0 then
local tc=g:GetFirst()
min=tc:GetLevel()
rclv=rc:GetLevel()
while tc do
local lv=tc:GetLevel()
if lv>0 and min>tc:GetLevel() then min=tc:GetLevel() end
tc=g:GetNext()
end
end
if rc:GetRank()>0 then
local tc=g:GetFirst()
min=tc:GetRank()
rclv=rc:GetRank()
while tc do
local lv=tc:GetRank()
if lv>0 and min>tc:GetRank() then min=tc:GetRank() end
tc=g:GetNext()
end
end
if rc:GetLink()>0 then
local tc=g:GetFirst()
min=tc:GetLink()
rclv=rc:GetLink()
while tc do
local lv=tc:GetLink()
if lv>0 and min>tc:GetLink() then min=tc:GetLink() end
tc=g:GetNext()
end
end
return rclv>=min end
end
--鳥澄珠鳥 ~远东的托特神~
local m=33701379
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetValue(SUMMON_TYPE_XYZ)
e2:SetCondition(cm.sprcon)
e2:SetOperation(cm.sprop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.discon)
e4:SetCost(cm.discost)
e4:SetTarget(cm.distg)
e4:SetOperation(cm.disop)
c:RegisterEffect(e4)
end
function cm.sprfilter(c)
return c:IsCanBeXyzMaterial(nil)
end
function cm.sprfilter1(c,tp,sg,sc)
local sg1=Group.Clone(sg)
sg1:AddCard(c)
return c:IsCanBeXyzMaterial(nil) and Duel.GetLocationCountFromEx(tp,tp,sg1,sc)>0
end
function cm.ccfilter(c)
return bit.band(c:GetType(),TYPE_NORMAL+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_FUSION+TYPE_SPELL+TYPE_TRAP)
end
function cm.ccfilter1(c)
return bit.band(c:GetType(),TYPE_MONSTER+TYPE_EFFECT)==TYPE_MONSTER+TYPE_EFFECT
end
function cm.fselect(g,tp,sc)
return g:GetClassCount(cm.ccfilter)==(g:GetCount()-1) and g:GetClassCount(Card.GetCode)==g:GetCount() and g:IsExists(cm.ccfilter1,1,nil) and g:IsExists(cm.sprfilter1,g:GetCount(),nil,tp,g,sc)
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND,LOCATION_ONFIELD,LOCATION_GRAVE,0,nil)
return g:CheckSubGroup(cm.fselect,9,9,tp,c)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND,LOCATION_ONFIELD,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=g:SelectSubGroup(tp,cm.fselect,false,9,9,tp,c)
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and Duel.IsChainNegatable(ev)
end
function cm.cfilter(c)
return c:IsPublic() and c:IsCode(83764718)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabelObject(g:GetFirst())
g:GetFirst():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ConfirmCards(1-tp,g)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
local tc=g:GetLabelObject()
local c=e:GetHandler()
if tc and tc:GetFlagEffect(m)>0 and tc:IsDiscardable(REASON_EFFECT) and c:IsRelateToEffect(e) and c:CheckRemoveOverlayCard(tp,9,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT)
e:GetHandler():RemoveOverlayCard(tp,9,9,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
end
--虚拟YouTuber 响木 青 · 新章
local m=33701394
local cm=_G["c"..m]
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE),2,true)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_EXTRA)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.cfilter(c,tp)
return c:GetPreviousControler()==tp
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and Duel.GetTurnPlayer()~=tp
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,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
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(cm.eftg)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetTarget(cm.eftg)
e2:SetValue(cm.indval)
c:RegisterEffect(e2)
end
end
function cm.eftg(e,c)
local seq=c:GetSequence()
local tp=e:GetHandler():GetControler()
local mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local sg=Duel.GetFieldGroup(tp,LOCATION_SZONE,0)
local t1=mg:IsContains(e:GetHandler()) and mg:IsContains(c)
local t2=sg:IsContains(e:GetHandler()) and sg:IsContains(c)
return e:GetHandler():GetColumnGroup():IsContains(c) or (seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1 and (t1 or t2))
end
function cm.indval(e,re,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g:IsContains(e:GetHandler()) and e:GetHandlerPlayer()==rp
end
--电拟神召·隐
local m=33701395
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter(c,att)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:GetAttribute()&att~=0
end
function cm.cfilter(c,e,tp)
return c:IsSetCard(0x445) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsPublic() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,2,nil,c:GetAttribute())
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
Duel.ConfirmCards(g,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabelObject() then e:SetTargetCard(e:GetLabelObject()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetLabelObject(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if not (c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e)) then return end
local mat1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,2,2,nil,tc:GetAttribute())
tc:SetMaterial(mat1)
if tc:IsType(TYPE_XYZ) and Duel.SelectYesNo(aux.Stringid(m,0)) then
Duel.Overlay(tc,mat1)
else
Duel.Remove(mat1,POS_FACEDOWN,REASON_EFFECT+REASON_MATERIAL)
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
--血本无归
local m=33701387
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--coin
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COIN+CATEGORY_DRAW+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetCondition(cm.cocon)
e2:SetTarget(cm.cotg)
e2:SetOperation(cm.coop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TOSS_COIN)
ge1:SetProperty(EFFECT_FLAG_DELAY)
ge1:SetOperation(cm.tossop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_TOSS_DICE)
ge2:SetOperation(cm.diceop)
Duel.RegisterEffect(ge2)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
cm.toss_coin=true
function cm.cocon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(m)
end
function cm.cotg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function cm.coop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COIN)
local coin=Duel.AnnounceCoin(tp)
local res=Duel.TossCoin(tp,1)
if coin~=res then
local t1=Duel.IsPlayerCanDraw(tp)
local op=0
local m={}
local n={}
local ct=1
if t1 then m[ct]=aux.Stringid(m,1) n[ct]=1 ct=ct+1 end
m[ct]=aux.Stringid(m,2) n[ct]=2 ct=ct+1
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
Duel.BreakEffect()
if op==1 then
Duel.Draw(tp,1,REASON_EFFECT)
else op==2 then
Duel.Recover(tp,1000,REASON_EFFECT)
end
else
c:RegisterFlagEffect(c,m,RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
if tp:GetFlagEffect()<=0 then
Duel.RegisterFlagEffect(c,m,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetOperation(cm.desop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if cm[tp]>=3 then
Duel.Hint(HINT_CARD,1,m)
if Duel.SelectYesNo(1-tp,aux.Stringid(m,3)) then
local g=Duel.SelectMatchingCard(1-tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,cm[tp]*2,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function cm.tossop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==e:GetHandlerPlayer() then
for i=1,ev do
cm[0]=cm[0]+1
end
else
for i=1,ev do
cm[1]=cm[1]+1
end
end
end
function cm.diceop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct1=bit.band(ev,0xffff)
local ct2=bit.rshift(ev,16)
if ep==e:GetHandlerPlayer() then
for i=1,ct1 do
cm[0]=cm[0]+1
end
for i=1,ct2 do
cm[1]=cm[1]+1
end
else
for i=1,ct2 do
cm[0]=cm[0]+1
end
for i=1,ct1 do
cm[1]=cm[1]+1
end
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--空之幻影
local m=33701398
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetChainLimit(aux.FALSE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetTurnPlayer()~=tp then
if Duel.GetCurrentPhase()>PHASE_MAIN1 then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_END,RESET_PHASE+PHASE_END,1)
else
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
else
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_END,RESET_PHASE+PHASE_END,1)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetCountLimit(1)
e1:SetOperation(cm.op)
e1:SetReset(EVENT_PHASE+PHASE_DRAW)
Duel.RegisterEffect(e1,tp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_EP)
e2:SetTargetRange(0,1)
e2:SetReset(RESET_PHASE+PHASE_MAIN1+RESET_OPPO_TURN)
Duel.RegisterEffect(e2,tp)
--
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetOperation(cm.op1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(1-tp,aux.Stringid(m,0)) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
--
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1)
e3:SetCondition(cm.con2)
e3:SetOperation(cm.op2)
e3:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e3,tp)
end
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=g:Select(tp,1,1,nil)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
end
--REPLY OF THE VIRTUAL
local m=33701400
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function cm.filter(c,e,tp)
return (c:IsSetCard(0x445) or c:IsSetCard(0x344c)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK)==0 then return end
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(cm.atkcon)
e2:SetValue(cm.atktg)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetLabel(fid)
e3:SetLabelObject(Group.FromCards(tc,c))
e3:SetCondition(cm.tgcon)
e3:SetOperation(cm.tgop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3)
end
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetFirst()
if tc:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoGrave(tc,REASON_EFFECT)
local c=e:GetNext()
if c:GetFlagEffectLabel(m)~=e:GetLabel() then
Duel.SendtoDeck(c,REASON_EFFECT)
end
end
function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.atkcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:GetControler()==e:GetHandlerPlayer()
end
function cm.atktg(e,c)
return c~=e:GetHandler():GetEquipTarget()
end
--吼啦迷迭吼啦哟!
local m=33701401
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DRAW)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.SetChainLimit(aux.FALSE)
end
function cm.negfilter(c)
return c:IsFaceup()--PSCT
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g1:GetCount()<2 then return end
if g1:GetCount()>=5 and cm[tp]<=0 then
Duel.SendtoHand(g1,1-tp,REASON_EFFECT)
local g2=Duel.GetFieldCard(cm.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if g2:GetCount()>0 then
Duel.BreakEffect()
local tc=g2:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetValue(0)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e5)
tc=g2:GetNext()
end
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local ag1=g1:Select(tp,2,2,nil)
Duel.SendtoHand(ag1,1-tp,REASON_EFFECT)
local g2=Duel.GetFieldCard(cm.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if g2:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
g2=g2:Select(tp,2,2,nil)
Duel.BreakEffect()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetValue(0)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e5)
tc=g2:GetNext()
end
end
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
cm[ep]=cm[ep]+1
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--Niko ~是松饼!~
local m=33701402
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_REMOVE)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local ct=eg:FilterCount(cm.damfilter,nil,tp)
Duel.Recover(tp,300,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(300)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
function cm.ccfilter(c)
return bit.band(c:GetType(),0x7)
end
function cm.fselect(g)
return g:GetClassCount(cm.ccfilter)==g:GetCount()
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:CheckSubGroup(cm.fselect,3,3) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,cm.fselect,false,3,3)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetLabel(0)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
e:GetHandler():SetTurnCounter(ct+1)
if ct==1 then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
else e:SetLabel(1) end
end
......@@ -32,16 +32,17 @@ function c33710920.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Filter(c33710920.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c33710920.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
if sg1:GetCount()>0then
if sg1:GetCount()>0 then
local sg=sg1:Clone()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local c=e:GetHandler()
if sg1:IsContains(tc) then
local mat1=mg1:SelectSubGroup(tp,c33710920.filter3,true,1,mg1:GetCount(),tp,tc,e)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -56,6 +57,17 @@ function c33710920.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(mat1:GetSum(Card.GetDefense))
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetCode(EFFECT_DISABLE)
e1_1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1_1)
local e2_1=Effect.CreateEffect(c)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_DISABLE_EFFECT)
e2_1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2_1)
end
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
......@@ -112,4 +112,16 @@ function c33711010.drawop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
e:Reset()
end
\ No newline at end of file
end
--赤子之心
function c33711101.initial_effect(c)
c:SetUniqueOnField(1,0,33711101)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_RECOVER)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
e2:SetTarget(c33711101.retg)
e2:SetOperation(c33711101.reop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c33711101.damcon1)
e3:SetOperation(c33711101.damop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_DAMAGE)
e4:SetCondition(c33711101.damcon2)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EFFECT_CANNOT_LOSE_KOISHI)
e5:SetCondition(c33711101.clcon)
e5:SetTargetRange(1,0)
e5:SetValue(1)
c:RegisterEffect(e5)
--
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetRange(LOCATION_SZONE)
e6:SetCode(EVENT_ADJUST)
e6:SetCondition(c33711101.chcon)
e6:SetOperation(c33711101.chop)
c:RegisterEffect(e6)
if not c33711101.global_check then
c33711101.global_check=true
LPdam={}
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_HAND)
ge1:SetOperation(c33711101.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c33711101.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if Duel.GetFlagEffect(tc:GetControler(),133711101)>1 then return end
Duel.RegisterFlagEffect(tc:GetControler(),133711101,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
function c33711101.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local code=33711100+Duel.GetTurnCount()
if chk==0 then return Duel.GetFlagEffect(tp,code)==0 and Duel.GetTurnCount()>1 end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,nil,tp,0)
end
function c33711101.reop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local num=0
if LPdam[Duel.GetTurnCount()-1] then
num=LPdam[Duel.GetTurnCount()-1]
end
if Duel.GetFlagEffect(1-tp,133711101)>0 then
Duel.Recover(tp,(4000+num)*2,REASON_EFFECT)
else
Duel.Recover(tp,4000+num,REASON_EFFECT)
end
end
function c33711101.damcon1(e,tp,eg,ep,ev,re,r,rp)
return true
end
function c33711101.damcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_BATTLE)==0
end
function c33711101.damop(e,tp,eg,ep,ev,re,r,rp)
if (ep~=tp and eg:GetFirst():IsControler(tp)) or (ep~=tp and bit.band(r,REASON_BATTLE)==0 and re:GetHandler():IsControler(tp)) then
Duel.RegisterFlagEffect(tp,33711101+Duel.GetTurnCount(),RESET_PHASE+PHASE_END,0,3)
end
if (ep==tp and eg:GetFirst():IsControler(1-tp)) or (ep==tp and bit.band(r,REASON_BATTLE)==0 and re:GetHandler():IsControler(1-tp)) then
if LPdam[Duel.GetTurnCount()] then
LPdam[Duel.GetTurnCount()]=LPdam[Duel.GetTurnCount()]+ev
else
LPdam[Duel.GetTurnCount()]=ev
end
end
end
function c33711101.clcon(e,tp)
return e:GetHandler():IsAbleToGraveAsCost() and e:GetHandler():GetFlagEffect(33711101)==0 and Duel.GetTurnPlayer()~=e:GetHandler():GetControler()
end
function c33711101.chcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)==0
end
function c33711101.chop(e,tp)
if Duel.GetTurnPlayer()~=e:GetHandler():GetControler() and Duel.SelectYesNo(tp,aux.Stringid(33711101,2)) then
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
local ex1=Effect.CreateEffect(e:GetHandler())
ex1:SetType(EFFECT_TYPE_FIELD)
ex1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ex1:SetRange(LOCATION_GRAVE)
ex1:SetCode(EFFECT_CANNOT_LOSE_KOISHI)
ex1:SetTargetRange(1,0)
ex1:SetValue(1)
e:GetHandler():RegisterEffect(ex1,true)
Duel.SetLP(tp,4000)
ex1:Reset()
else
e:GetHandler():RegisterFlagEffect(33711101,RESET_EVENT+RESETS_STANDARD,0,0)
end
end
\ No newline at end of file
--动物朋友 青龙 ~孤高的水波~
function c33711102.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,aux.FilterBoolFunction(Card.IsSetCard,0x442),nil,3,99)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(LOCATION_OVERLAY,0)
e1:SetTarget(c33711102.rmtg)
e1:SetValue(LOCATION_HAND)
c:RegisterEffect(e1)
--be mat
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33711102,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,33711102)
e2:SetCost(c33711102.bmcost)
e2:SetTarget(c33711102.bmtg)
e2:SetOperation(c33711102.bmop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c33711102.reptg)
c:RegisterEffect(e3)
end
function c33711102.rmtg(e,c)
return e:GetHandler():GetOverlayGroup():IsContains(c)
end
function c33711102.bmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local sum=e:GetHandler():GetOverlayGroup():GetCount()
if chk==0 then return e:GetHandler():GetOverlayCount()>0
and e:GetHandler():CheckRemoveOverlayCard(tp,e:GetHandler():GetOverlayCount(),REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,e:GetHandler():GetOverlayCount(),e:GetHandler():GetOverlayCount(),REASON_COST)
local sum1=e:GetHandler():GetOverlayGroup():GetCount()
e:SetLabel(sum-sum1)
end
function c33711102.bmfilter(c,mc)
return c:IsCanBeXyzMaterial(c,mc) and c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER)
end
function c33711102.bmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c33711102.bmfilter,tp,LOCATION_DECK,0,nil,e:GetHandler())
if chk==0 then return g:GetClassCount(Card.GetCode)>=e:GetHandler():GetOverlayCount() and e:GetHandler():IsType(TYPE_XYZ) end
end
function c33711102.bmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsType(TYPE_XYZ) then return end
local num=e:GetLabel()
local rg=Duel.GetMatchingGroup(c33711102.bmfilter,tp,LOCATION_DECK,0,nil,e:GetHandler())
local g=Group.CreateGroup()
Duel.BreakEffect()
for i=1,num do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=rg:Select(tp,1,1,nil):GetFirst()
if tc then
g:AddCard(tc)
rg:Remove(Card.IsCode,nil,tc:GetCode())
end
end
Duel.Overlay(e:GetHandler(),g)
end
function c33711102.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
if true then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
return true
else return false end
end
\ No newline at end of file
--动物朋友 朱雀 ~净化的炎舞~
function c33711103.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.FilterBoolFunction(Card.IsSetCard,0x442),2,99)
--De
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33711103,1))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,33711103)
e1:SetTarget(c33711103.netg)
e1:SetOperation(c33711103.neop)
c:RegisterEffect(e1)
--Destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c33711103.desreptg)
e2:SetOperation(c33711103.desrepop)
c:RegisterEffect(e2)
end
function c33711103.netg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c33711103.neop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local oc=og:GetFirst()
if oc:IsSetCard(0x442) then
if Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 then
if Duel.SelectEffectYesNo(tp,aux.Stringid(33711103,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
elseif Duel.GetFieldGroupCount(tp,0,LOCATION_HAND+LOCATION_DECK)>0 and Duel.SelectYesNo(tp,aux.Stringid(33711103,3)) then
local b1=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0
local b2=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
local op=1
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(33711103,4),aux.Stringid(33711103,5))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(33711103,4))
else
op=Duel.SelectOption(tp,aux.Stringid(33711103,5))+1
end
if op==0 then
local g=Duel.GetDecktopGroup(1-tp,1)
Duel.Destroy(g,REASON_EFFECT)
else
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local sg=g:RandomSelect(tp,1)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
end
end
function c33711103.repfilter(c)
return c:IsSetCard(0x442)
and c:IsAbleToDeck()
end
function c33711103.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(c33711103.repfilter,tp,LOCATION_GRAVE,0,1,nil) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c33711103.repfilter,tp,LOCATION_GRAVE,0,1,1,nil)
e:SetLabelObject(g:GetFirst())
return true
else return false end
end
function c33711103.desrepop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,tp,0,REASON_EFFECT+REASON_REPLACE)
end
\ No newline at end of file
--动物朋友 白虎 ~席卷的风切~
function c33711104.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c33711104.ffilter,3,false)
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE,0,Duel.SendtoGrave,REASON_COST+REASON_MATERIAL)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33711104,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c33711104.thtg)
e1:SetOperation(c33711104.thop)
c:RegisterEffect(e1)
--Destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c33711104.desreptg)
e2:SetOperation(c33711104.desrepop)
c:RegisterEffect(e2)
end
function c33711104.ffilter(c)
return c:IsSetCard(0x442)
end
function c33711104.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c33711104.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33711104.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c33711104.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c33711104.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
local sg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,sg)
if sg:GetClassCount(Card.GetCode)==sg:GetCount() then
Duel.Draw(tp,1,REASON_DESTROY)
end
end
end
end
function c33711104.repfilter(c)
return c:IsSetCard(0x442)
and c:IsDiscardable(REASON_EFFECT)
end
function c33711104.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(c33711104.repfilter,tp,LOCATION_HAND,0,1,nil) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c33711104.repfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabelObject(g:GetFirst())
return true
else return false end
end
function c33711104.desrepop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT+REASON_REPLACE)
end
\ No newline at end of file
--动物朋友 玄武 ~震撼的地落~
function c33711105.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c33711105.matfilter,2)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33711105,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33711105)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c33711105.sptg)
e1:SetOperation(c33711105.spop)
c:RegisterEffect(e1)
--Cannot be Break
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33711105,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,33711106)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c33711105.cost)
e2:SetOperation(c33711105.operation)
c:RegisterEffect(e2)
--cannot be target/indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c33711105.indcon)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
c:RegisterEffect(e4)
end
function c33711105.matfilter(c)
return c:IsSetCard(0x442)
end
function c33711105.spfilter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) and c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER)
end
function c33711105.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=e:GetHandler():GetLinkedZone(tp)
if chk==0 then return Duel.IsExistingMatchingCard(c33711105.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33711105.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c33711105.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,zone)
if zone~=0 and sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
function c33711105.tdfilter(c)
return c:IsSetCard(0x442) and c:IsAbleToDeckAsCost()
end
function c33711105.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33711105.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c33711105.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c33711105.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c33711105.cndestg)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
Duel.RegisterEffect(e2,tp)
end
function c33711105.cndestg(e,c)
return c:IsSetCard(0x442) and c:IsFaceup()
end
function c33711105.cntgfilter(c)
return c:IsSetCard(0x442) and c:IsFaceup()
end
function c33711105.indcon(e)
return e:GetHandler():GetLinkedGroupCount()>0 and e:GetHandler():GetLinkedGroup():IsExists(c33711105.cntgfilter,1,nil)
end
\ No newline at end of file
--~自我收容的个人宇宙~
local m=33711106
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x1442)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
e1:SetLabel(1)
c:RegisterEffect(e1)
local e12=e1:Clone()
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetRange(LOCATION_HAND)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetLabel(2)
e12:SetCost(cm.cost)
c:RegisterEffect(e12)
local e13=e1:Clone()
e13:SetRange(LOCATION_GRAVE)
e13:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O)
e13:SetCost(cm.cost)
e13:SetLabel(3)
c:RegisterEffect(e13)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetTarget(cm.disable)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
--maintain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetOperation(cm.mtop)
c:RegisterEffect(e4)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
c:CreateEffectRelation(e)
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsCanRemoveCounter(tp,0x1442,1,REASON_COST) then
e:GetHandler():RemoveCounter(tp,1,1,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
if Duel.GetTurnPlayer()==1-tp then
local disg=Duel.GetMatchingGroup(cm.disfilter,1-tp,LOCATION_HAND,0,c)
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,31,nil,1-tp,POS_FACEDOWN,REASON_COST) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
local op1=0
if b1 and b2 and b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1))
elseif b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,2))+1
else return end
if op1==0 or op2==0 or op3==0 then cm.selop1(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==1 or op2==1 or op3==1 then cm.selop2(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==2 or op2==2 or op3==2 then cm.selop3(e,1-tp,eg,ep,ev,re,r,rp) end
end
end
end
function cm.disable(e,c)
return c~=e:GetHandler() and c:IsFaceup()
end
function cm.disfilter(c)
return c:IsAbleToGrave()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
local c=e:GetHandler()
local el=e:GetLabel()
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_COST) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
if chk==0 then
if el==1 then
return b1 or b2 or b3
elseif el==2 then
return ( b1 and b2 ) or ( b2 and b3 ) or ( b1 and b3 )
elseif el==3 then
return b1 and b2 and b3
end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local el=e:GetLabel()
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
local c=e:GetHandler()
local el=e:GetLabel()
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_COST) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
local op1=-1
local op2=-1
local op3=-1
local tt={aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3)}
if el==1 then
if b1 and b2 and b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op1=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,2))+1
else return end
end
if el==2 then
if b1 and b2 and b3 then
op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
table.remove(tt,op1+1)
op2=Duel.SelectOption(tp,table.unpack(tt))
if op1==0 then op2=op1+1 end
if op1==1 and op2==0 then op2=1 end
elseif b1 then op1=0
if b2 then op2=1
elseif b3 then op2=2
end
elseif b2 and b3 then op1=1 op2=2
end
end
if el==3 and b1 and b2 and b3 then op1=0 op2=1 op3=2 end
if op1==0 or op2==0 or op3==0 then cm.selop1(e,tp,eg,ep,ev,re,r,rp) end
if op1==1 or op2==1 or op3==1 then cm.selop2(e,tp,eg,ep,ev,re,r,rp) end
if op1==2 or op2==2 or op3==2 then cm.selop3(e,tp,eg,ep,ev,re,r,rp) end
end
function cm.selop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g1=disg:SelectSubGroup(tp,aux.dncheck,true,4,4)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoGrave(g1,REASON_EFFECT)
c:AddCounter(0x1442,1)
end
function cm.selop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Damage(tp,4200,REASON_EFFECT)
c:AddCounter(0x1442,1)
end
function cm.selop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rm=Duel.GetDecktopGroup(tp,31)
Duel.Remove(rm,POS_FACEDOWN,REASON_EFFECT)
c:AddCounter(0x1442,1)
end
\ No newline at end of file
--FREEDOM DIVE
local m=33711107
local cm=_G["c"..m]
function cm.initial_effect(c)
cm[c]=0
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
local c=e:GetHandler()
local op=Duel.SelectOption(tp,m*16,m*16+1)
cm[c]=1-op
if op==0 then
c:SetEntityCode(m)
else
c:SetEntityCode(m+1)
end
end)
c:RegisterEffect(e1)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,LOCATION_HAND+LOCATION_MZONE)
e2:SetTarget(cm.exstg)
c:RegisterEffect(e2)
--ADD Damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(cm.val)
c:RegisterEffect(e3)
local e3_1=Effect.CreateEffect(c)
e3_1:SetCategory(CATEGORY_DAMAGE)
e3_1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3_1:SetRange(LOCATION_FZONE)
e3_1:SetCode(EVENT_BATTLE_DAMAGE)
e3_1:SetCondition(cm.damcon1)
e3_1:SetOperation(cm.damop)
c:RegisterEffect(e3_1)
local e3_2=e3_1:Clone()
e3_2:SetCode(EVENT_DAMAGE)
e3_2:SetCondition(cm.damcon2)
c:RegisterEffect(e3_2)
--cannot disable summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,LOCATION_HAND+LOCATION_MZONE)
e4:SetTarget(cm.sumval)
c:RegisterEffect(e4)
--Effect Draw
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DRAW_COUNT)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(1,1)
e5:SetValue(cm.drval)
c:RegisterEffect(e5)
--recover
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_RECOVER)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_RECOVER)
e6:SetRange(LOCATION_FZONE)
e6:SetCondition(cm.rmcon)
e6:SetOperation(cm.rmop)
c:RegisterEffect(e6)
--cannot summon
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_CANNOT_MSET)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetRange(LOCATION_FZONE)
e7:SetTargetRange(1,1)
e7:SetTarget(cm.splimit)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e8)
end
function cm.exstg(e,c)
return c:IsControler(cm[e:GetHandler()])
end
function cm.GetData(g,f)
local v=0
for tc in aux.Next(g) do
v=v|f(tc)
end
return v
end
function cm.GetNorthPlayer(c,tp)
--Debug.Message(cm[c])
if cm[c]==0 then
return tp
else
return 1-tp
end
end
function cm.GetDataCount(g,f)
local v=cm.GetData(g,f)
local col=1
local count=0
while col<=v do
if col&v>0 then count=count+1 end
col=col<<1
end
return count
end
function cm.val(e,re,dam,r,rp,rc)
local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
if rp==sp then
return dam*2
else
return dam
end
end
function cm.damcon1(e,tp,eg,ep,ev,re,r,rp)
local sp=cm.GetNorthPlayer(e:GetHandler(),tp)
return Duel.GetLP(1-ep)>0 and rp==1-sp
end
function cm.damcon2(e,tp,eg,ep,ev,re,r,rp)
local sp=cm.GetNorthPlayer(e:GetHandler(),tp)
return Duel.GetLP(1-ep)>0 and bit.band(r,REASON_BATTLE)==0 and re and re:GetHandlerPlayer()==1-sp and re:GetHandler()~=e:GetHandler() and ep~=rp
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Damage(ep,ev,REASON_EFFECT)
end
function cm.sumval(e,c)
local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
return c:IsControler(sp)
end
function cm.drval(e)
local tp=Duel.GetTurnPlayer()
local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
local dr=Duel.GetDrawCount(tp)
if tp==1-sp then
return 2
else
return dr
end
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local sp=cm.GetNorthPlayer(e:GetHandler(),tp)
return ep==1-sp and re:GetHandler()~=e:GetHandler()
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
tp=cm.GetNorthPlayer(e:GetHandler(),tp)
Duel.Recover(1-tp,ev,REASON_EFFECT)
end
function cm.splimit(e,c)
local sp=cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
return c:IsControler(1-sp)
end
\ No newline at end of file
--加帕里:变为动物朋友
local m=33711109
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e1_1=e1:Clone()
e1_1:SetRange(LOCATION_GRAVE)
e1_1:SetCost(cm.cost)
c:RegisterEffect(e1_1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(0x7f)
e2:SetCode(EVENT_EQUIP)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.reccon)
e4:SetTarget(cm.retarget)
e4:SetOperation(cm.remop)
c:RegisterEffect(e4)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
local vg=Group.CreateGroup()
if sg:GetCount()>0 then
vg=sg:Filter(Card.IsSetCard,nil,0x442)
end
if chk==0 then return vg:GetCount()>=2 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
c:CreateEffectRelation(e)
e:SetLabel(2)
end
function cm.target(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_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
--e2
function cm.thfil(c)
return c:IsSetCard(0x442) and c:IsAbleToGrave() and c:IsType(TYPE_MONSTER) and c:IsLevelBelow(6)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfil,tp,LOCATION_DECK,0,1,nil) and eg:IsContains(e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.thfil,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local xg=Duel.GetOperatedGroup()
local tc=c:GetEquipTarget()
if xg:GetCount()>0 then
local code=xg:GetFirst():GetOriginalCode()
tc:ReplaceEffect(code,0)
end
--change setcard
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_ADD_SETCODE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_MZONE)
e0:SetValue(0x442)
tc:RegisterEffect(e0,true)
end
end
end
--e4
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.retarget(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,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc,false,true)
Duel.EquipComplete()
end
end
\ No newline at end of file
--临终幻象
local m=33711110
local cm=_G["c"..m]
function c33711110.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_SPSUMMON,TIMING_BATTLE_START)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_TURN_END)
ge2:SetOperation(cm.clear)
Duel.RegisterEffect(ge2,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
cm[ep]=cm[ep]+ev
cm[ep+2]=cm[ep+2]+ev
else
cm[ep+2]=cm[ep+2]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local ph=Duel.GetCurrentPhase()
return (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) and cm[tp]>0
end
function cm.spfilter(c,e,tp,g)
return c:IsCanBeSpecialSummoned(e,0,tp,true,true) and g:CheckSubGroup(cm.subfilter,1,3,c) and c:IsAttackBelow(cm[tp])
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
local vg=g:SelectSubGroup(tp,cm.subfilter,true,1,3,tc)
Duel.SendtoGrave(vg,REASON_EFFECT)
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetCode(EFFECT_DISABLE)
e1_1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1_1)
local e2_1=Effect.CreateEffect(c)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_DISABLE_EFFECT)
e2_1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2_1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetCondition(cm.relcon)
e2:SetOperation(cm.relop)
Duel.RegisterEffect(e2,tp)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.SpecialSummonComplete()
end
end
function cm.relcon(e,tp,eg,ep,ev,re,r,rp)
return true
end
function cm.relop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)~=0 and tc:IsReleasable() then
Duel.Release(tc,REASON_EFFECT)
Duel.Recover(tp,tc:GetDefense(),REASON_EFFECT)
else
Duel.Damage(tp,cm[tp+2],REASON_EFFECT)
end
e:Reset()
end
function cm.synfilter(g,c)
return c:IsSynchroSummonable(nil,g,g:GetCount(),g:GetCount())
end
function cm.xyzfilter(g,c)
return c:IsXyzSummonable(g,g:GetCount(),g:GetCount())
end
function cm.fusfilter(g,c)
local res=c:CheckFusionMaterial(g,nil,PLAYER_NONE)
return res
end
function cm.linkfilter(g,c)
return c:IsLinkSummonable(g,nil,g:GetCount(),g:GetCount())
end
function cm.subfilter(g,c)
return cm.synfilter(g,c) or cm.xyzfilter(g,c) or cm.fusfilter(g,c) or cm.linkfilter(g,c)
end
--g:CheckSubGroup(cm.subfilter,1,g:GetCount(),c)
\ No newline at end of file
--VLiver Chigusa Hana SP
local m=33711112
local cm=_G["c"..m]
function c33711112.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.hspcon)
e1:SetValue(cm.hspval)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
--code
local e2_1=Effect.CreateEffect(c)
e2_1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2_1:SetCode(EVENT_ADJUST)
e2_1:SetRange(LOCATION_MZONE)
e2_1:SetCondition(cm.codecon)
e2_1:SetOperation(cm.code)
c:RegisterEffect(e2_1)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.atkval)
c:RegisterEffect(e3)
--attack limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(cm.atlimit)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetTarget(cm.eftg)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
--synchro limit
local e4_1=Effect.CreateEffect(c)
e4_1:SetType(EFFECT_TYPE_SINGLE)
e4_1:SetCode(EFFECT_TUNER_MATERIAL_LIMIT)
e4_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4_1:SetTarget(cm.synlimit)
c:RegisterEffect(e4_1)
--fusion limit
local e5_1=Effect.CreateEffect(c)
e5_1:SetType(EFFECT_TYPE_SINGLE)
e5_1:SetCode(EFFECT_TUNE_MAGICIAN_F)
e5_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5_1:SetValue(cm.fuslimit)
c:RegisterEffect(e5_1)
--xyz limit
local e6_1=Effect.CreateEffect(c)
e6_1:SetType(EFFECT_TYPE_SINGLE)
e6_1:SetCode(EFFECT_TUNE_MAGICIAN_X)
e6_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6_1:SetValue(cm.xyzlimit)
c:RegisterEffect(e6_1)
end
function cm.synlimit(e,c)
return cm.IsLeft(c,e:GetHandler())
end
function cm.fuslimit(e,c)
return not cm.IsLeft(c,e:GetHandler())
end
function cm.xyzlimit(e,c)
return not cm.IsLeft(c,e:GetHandler())
end
function cm.eftg(e,c)
return cm.IsLeft(c,e:GetHandler())
end
function cm.cfilter(c,tp)
local Col=aux.GetColumn(c,tp)
return cm.GetLeftGroupCount(tp,Col)==0 and not c:IsLocation(LOCATION_FZONE)
end
function cm.cfilter1(c)
return not c:IsLocation(LOCATION_FZONE)
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local flag=0
local lg1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local lg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
if lg1:GetCount()==0 then
return true
end
if lg:GetCount()>0 then
for tc in aux.Next(lg) do
local Col=aux.GetColumn(tc,tp)
for i=0,4 do
if i-Col<1 then
flag=flag|(1<<(i))
end
end
end
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,flag)>0
end
function cm.hspval(e,c)
if c==nil then return true end
local tp=c:GetControler()
local flag=0
local lg1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local lg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if lg1:GetCount()==0 then
for i=0,4 do
flag=flag|(1<<(i))
end
return 0,flag
end
if lg:GetCount()>0 then
for tc in aux.Next(lg) do
local Col=aux.GetColumn(tc,tp)
for i=0,4 do
if i-Col<1 then
flag=flag|(1<<(i))
end
end
end
end
return 0,flag
end
function cm.efilter(e,te)
if te:GetHandler():IsLocation(LOCATION_ONFIELD) then
return false
end
return cm.IsLeft(te:GetHandler(),e:GetHandler())
end
function cm.codecon(e)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.code(e)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
function cm.atkval(e,c)
return not c:IsImmuneToEffect(e) and cm.IsLeft(c,e:GetHandler())
end
function cm.atlimit(e,c)
return c:GetFlagEffect(m)>0 and cm.IsLeft(e:GetHandler(),c)
end
function cm.IsLeftCol(Col,Col1)
end
function cm.IsLeft(c,mc)
local tp=mc:GetControler()
local Col=aux.GetColumn(mc,tp)
return cm.IsLeftCard(c,tp,Col)
end
function cm.IsLeftCard(c,tp,Col)
local Col_1=aux.GetColumn(c,tp)
if c:IsType(TYPE_FIELD) then return true end
return Col_1-Col<0
end
function cm.IsLeftGroup(g,tp,Col)
for c in aux.Next(g) do
if not cm.IsLeftCard(c,tp,Col) then
return false
end
end
return true
end
function cm.GetLeftGroup(tp,Col)
local g=Duel.GetFieldGroup(0,LOCATION_ONFIELD,LOCATION_ONFIELD)
local sg=Group.CreateGroup()
for c in aux.Next(g) do
if cm.IsLeftCard(c,tp,Col) then
sg:AddCard(c)
end
end
return sg
end
function cm.GetLeftGroupCount(tp,Col)
local sg=cm.GetLeftGroup(tp,Col)
return sg:GetCount()
end
\ No newline at end of file
--Lily White ~夏祭~
local CTR_PETAL = 0x234
function c33711113.initial_effect(c)
c:EnableCounterPermit(CTR_PETAL)
--xyz summon
aux.AddXyzProcedure(c,nil,5,7,c33711113.ovfilter,aux.Stringid(33711113,0),7)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33711113,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c33711113.atkcon)
e1:SetOperation(c33711113.atkop)
c:RegisterEffect(e1)
--ADD COUNTER
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33711113,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,33711113)
e2:SetCost(c33711113.bmcost)
e2:SetTarget(c33711113.bmtg)
e2:SetOperation(c33711113.bmop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c33711113.desreptg)
e3:SetValue(c33711113.desrepval)
e3:SetOperation(c33711113.desrepop)
c:RegisterEffect(e3)
--To Pzone
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(33711113,4))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_EXTRA)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetCost(c33711113.topcost)
e4:SetTarget(c33711113.toptarget)
e4:SetOperation(c33711113.topop)
c:RegisterEffect(e4)
--changeDam
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_PZONE)
e5:SetCode(EFFECT_CHANGE_DAMAGE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0)
e5:SetValue(0)
c:RegisterEffect(e5)
--Effect Draw
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_DRAW_COUNT)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)<Duel.GetLocationCount(tp,0,LOCATION_ONFIELD)
end)
e6:SetTargetRange(1,0)
e6:SetValue(2)
c:RegisterEffect(e6)
end
function c33711113.ovfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and (c:IsLevelAbove(10) or (c:IsLevelBelow(4) and Duel.IsExistingMatchingCard(Card.IsType,c:GetControler(),LOCATION_ONFIELD,0,1,nil,TYPE_TOKEN)))
end
function c33711113.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c33711113.atkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(CTR_PETAL,2)
end
end
function c33711113.bmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local sum=e:GetHandler():GetOverlayGroup():GetCount()
if chk==0 then return e:GetHandler():GetOverlayCount()>0
and e:GetHandler():CheckRemoveOverlayCard(tp,e:GetHandler():GetOverlayCount(),REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,e:GetHandler():GetOverlayCount(),e:GetHandler():GetOverlayCount(),REASON_COST)
local sum1=e:GetHandler():GetOverlayGroup():GetCount()
e:SetLabel(sum-sum1)
end
function c33711113.bmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Deul.IsCanAddCounter(tp,CTR_PETAL,1,e:GetHandler()) end
end
function c33711113.bmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not e:GetHandler():IsType(TYPE_XYZ) then return end
e:GetHandler():AddCounter(CTR_PETAL,e:GetLabel())
end
function c33711113.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c33711113.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c33711113.repfilter,1,nil,tp)
and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,1,REASON_EFFECT+REASON_REPLACE) end
e:SetLabel(eg:GetCount())
return Duel.SelectEffectYesNo(tp,c,96)
end
function c33711113.desrepval(e,c)
return c33711113.repfilter(c,e:GetHandlerPlayer())
end
function c33711113.desrepop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,1,REASON_EFFECT+REASON_REPLACE)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local sg=g:RandomSelect(tp,e:GetLabel())
Duel.Destroy(sg,REASON_EFFECT+REASON_REPLACE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetDescription(aux.Stringid(m,2))
e1:SetLabelObject(sg)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetCurrentPhase())
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCondition(c33711113.retcon2)
e1:SetOperation(c33711113.retop2)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_CARD,0,33711113)
end
function c33711113.retcon2(e,tp)
return Duel.GetCurrentPhase()~=e:GetLabel()
end
function c33711113.retop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),tp,REASON_EFFECT+REASON_RETURN)
end
function c33711113.topcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,1,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,CTR_PETAL,1,REASON_COST)
end
function c33711113.toptarget(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 c33711113.topop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--Lily White - Snow Falling Streets
local CTR_PETAL = 0x234
function c33711114.initial_effect(c)
c:EnableCounterPermit(CTR_PETAL)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,aux.FilterBoolFunction(Card.IsType,TYPE_TOKEN),5,5,false)
aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE,0,Duel.Release,REASON_COST+REASON_MATERIAL)
--add counter
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33711114, 0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c33711114.cttg)
e1:SetOperation(c33711114.ctop)
c:RegisterEffect(e1)
--cannot be Destroyed
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TOKEN))
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
--SpecialSummon counter
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(33711114, 1))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c33711114.ctcost)
e4:SetTarget(c33711114.target2)
e4:SetOperation(c33711114.activate2)
c:RegisterEffect(e4)
--SpecialSummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(33711114, 2))
e5:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(c33711114.ctcost1)
e5:SetTarget(c33711114.tg1)
e5:SetOperation(c33711114.op1)
c:RegisterEffect(e5)
end
function c33711114.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return true
end
Duel.SetOperationInfo(0, CATEGORY_COUNTER, nil, 2, 0, CTR_PETAL)
end
function c33711114.ctop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(CTR_PETAL, 2)
end
end
function c33711114.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,CTR_PETAL,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,CTR_PETAL,1,REASON_COST)
end
function c33711114.filter2(c,tp)
return c:GetSummonPlayer()~=tp
end
function c33711114.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c33711114.filter2,1,nil,tp) end
local g=eg:Filter(c33711114.filter2,nil,tp)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c33711114.filter3(c,e,tp)
return c:IsFaceup() and c:GetAttack()>=1500 and c:GetSummonPlayer()~=tp
and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE)
end
function c33711114.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c33711114.filter3,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED)
end
end
function c33711114.ctcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,CTR_PETAL,4,REASON_COST) end
Duel.RemoveCounter(tp,1,0,CTR_PETAL,4,REASON_COST)
end
function c33711114.tfilter1(c,e,tp)
return c::IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsCode(33711115)
end
function c33711114.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() and Duel.IsExistingMatchingCard(c33711114.tfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c33711114.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToExtra() and Duel.IsExistingMatchingCard(c33711114.tfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
if Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c33711114.tfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--动物朋友 荷兰乳牛
local m=33711401
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--Recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.rcost)
e2:SetTarget(cm.rtg)
e2:SetOperation(cm.rop)
c:RegisterEffect(e2)
--send to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetTarget(cm.ttg)
e3:SetOperation(cm.top)
c:RegisterEffect(e3)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,nil) and mg:GetClassCount(Card.GetCode)==#mg
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function cm.rcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.rfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442) and c:IsDefenseAbove(0)
end
function cm.rtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and cm.rfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.rfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=Duel.SelectTarget(tp,cm.rfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,tg:GetFirst():GetDefense(),nil,tp,0)
end
function cm.rop(e,tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Recover(tp,tc:GetDefense(),REASON_EFFECT)
end
end
function cm.ttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_DECK)
end
function cm.rfilter2(c)
return c:IsSetCard(0x442) and c:IsAttackAbove(0)
end
function cm.top(e,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<1 then return end
local ac=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 then
ac=Duel.AnnounceNumber(tp,1,2,3)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 then
ac=Duel.AnnounceNumber(tp,1,2)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
ac=Duel.AnnounceNumber(tp,1)
end
local tg=Duel.GetDecktopGroup(tp,ac)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil)
Duel.Recover(tp,rg:GetSum(Card.GetAttack),REASON_EFFECT)
else
Duel.Damage(tp,#sg*2000,REASON_EFFECT)
end
end
end
\ No newline at end of file
--动物朋友 御神牛様
local m=33711402
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,3,3,cm.lcheck)
c:EnableReviveLimit()
--Sps
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_DESTROYED)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.lcheck(g,lc)
return g:IsExists(Card.IsSetCard,1,nil,0x442) and g:GetClassCount(Card.GetCode)==#g and g:GetSum(Card.GetLevel)>=21
end
function cm.spfilter(c,tp,zone)
local seq=c:GetPreviousSequence()
if c:GetPreviousControler()~=tp then seq=seq+16 end
return c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0 and c:IsSetCard(0x442)
end
function cm.spfilter1(c,e,tp,tc)
local code=tc:GetCode()
if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)<=0 then return false end
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP)
end
function cm.spop(e,tp,eg)
local sg=eg:Filter(cm.spfilter,nil,tp,e:GetHandler():GetLinkedZone())
if sg:GetCount()>0 then
for tc in aux.Next(sg) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spg=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
if spg:GetCount()>0 then
Duel.SpecialSummonStep(spg:GetFirst(),0,tp,tp,true,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--肉欲之壶
local m=33711403
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK+CATEGORY_TOEXTRA+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.cfilter1(c)
return c:IsAbleToExtra()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local num=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local num2=Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)
if chk==0 then
return (Duel.IsPlayerCanDraw(tp,1) and num>=5) or num2>=5
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local num=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local num2=Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)
local a1=num2>=5
local a2=num2>=10
local a3=Duel.IsPlayerCanDraw(tp,1) and num>=5
local a4=Duel.IsPlayerCanDraw(tp,2) and num>=10
local op=5
if a1 and a2 and a3 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3),aux.Stringid(m,4))
elseif a1 and a2 and a3 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif a1 and a2 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,4))
if op==2 then
op=3
end
elseif a1 and a3 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,3),aux.Stringid(m,4))+1
if op==1 then
op=0
end
elseif a2 and a3 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3),aux.Stringid(m,4))+1
elseif a1 and a2 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif a1 and a3 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,3))
if op==1 then
op=2
end
elseif a1 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,4))
if op==1 then
op=3
end
elseif a2 and a3 then
op=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))+1
elseif a2 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,4))+1
if op==2 then
op=3
end
elseif a3 and a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))+2
elseif a1 then
op=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif a2 then
op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
elseif a3 then
op=Duel.SelectOption(tp,aux.Stringid(m,3))+2
elseif a4 then
op=Duel.SelectOption(tp,aux.Stringid(m,4))+3
end
if op==0 then
local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
local sg=g:RandomSelect(tp,5)
local sg1=sg:Filter(Card.IsFaceup,nil)
local sg2=Group.__sub(sg,sg1)
Duel.Remove(sg2,POS_FACEDOWN,0)
Duel.SendtoDeck(sg2,1-tp,2,REASON_EFFECT)
Duel.Remove(sg1,POS_FACEDOWN,0)
Duel.SendtoExtraP(sg1,1-tp,REASON_EFFECT)
local sg3=sg:Filter(cm.filter,nil,tp)
if sg3:GetCount()>4 then
Duel.Recover(tp,2000,REASON_EFFECT)
end
end
if op==1 then
local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
local sg=g:RandomSelect(tp,10)
local sg1=sg:Filter(Card.IsType,nil,TYPE_PENDULUM)
local sg2=Group.__sub(sg,sg1)
Duel.SendtoDeck(sg2,1-tp,2,REASON_EFFECT)
Duel.SendtoExtraP(sg1,1-tp,REASON_EFFECT)
Duel.ShuffleExtra(1-tp)
local sg3=sg:Filter(cm.filter,nil,tp)
if sg3:GetCount()>4 and sg3:GetCount()<10 then
Duel.Recover(tp,2000,REASON_EFFECT)
end
if sg3:GetCount()>9 then
Duel.Recover(tp,4000,REASON_EFFECT)
end
end
if op==2 then
local g=Duel.GetDecktopGroup(tp,5)
if Duel.SendtoDeck(g,1-tp,2,REASON_EFFECT)==5 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
if op==3 then
local g=Duel.GetDecktopGroup(tp,10)
if Duel.SendtoDeck(g,1-tp,2,REASON_EFFECT)==10 then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
function cm.filter(c,tp)
return c:IsLocation(LOCATION_EXTRA) and c:IsControler(1-tp)
end
\ No newline at end of file
--
function c33711404.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Destroy & Remove
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(c33711404.op1)
c:RegisterEffect(e1)
--Seqcheck
if not c33711404.global_check then
c33711404.global_check=true
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetOperation(c33711404.op3)
Duel.RegisterEffect(e3,0)
end
--Movetofield
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(c33711404.op4)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetOperation(c33711404.op5)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
--
function c33711404.op3(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:GetFlagEffect(33711404)>0 then
tc:ResetFlagEffect(33711404)
end
if not tc:IsLocation(LOCATION_FZONE) then
local col=aux.GetColumn(tc)
if tc:GetDestination()==LOCATION_REMOVED then
tc:RegisterFlagEffect(33711404,0,0,0,col)
elseif tc:IsReason(REASON_DESTROY) then
tc:RegisterFlagEffect(33711405,0,0,0,col)
end
end
end
end
--
function c33711404.ofilter1(c,col)
return col==aux.GetColumn(c) and c:IsAbleToRemove()
end
function c33711404.ofilter2(c,col)
return col==aux.GetColumn(c)
end
function c33711404.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=0
local dg1=Group.CreateGroup()
local dg2=Group.CreateGroup()
for tc in aux.Next(eg) do
local col=tc:GetFlagEffectLabel(33711404)
local col2=tc:GetFlagEffectLabel(33711405)
if col then
local sg=Duel.GetMatchingGroup(c33711404.ofilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,col)
dg1:Merge(sg)
end
if col2 then
local sg=Duel.GetMatchingGroup(c33711404.ofilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,col2)
dg2:Merge(sg)
end
end
if dg1:GetCount()>0 then
Duel.Hint(HINT_CARD,1-tp,c:GetOriginalCode())
Duel.Remove(dg1,POS_FACEUP,REASON_EFFECT)
end
if dg2:GetCount()>0 then
Duel.Hint(HINT_CARD,1-tp,c:GetOriginalCode())
Duel.Destroy(dg2,REASON_EFFECT)
end
end
--
function c33711404.op4(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c33711404.op5(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
Duel.Damage(tp,2000,REASON_RULE)
local c=e:GetHandler()
if c:IsForbidden() then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE,0)<1 then return end
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
--
--梁木刺
local m=33711405
local cm=_G["c"..m]
function cm.initial_effect(c)
--AnnounceLevel
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_ANNOUNCE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetLabelObject(e1)
e2:SetCost(cm.effcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if c:IsLocation(LOCATION_HAND) then
return e:GetHandler():IsDiscardable()
else
return c:IsAbleToGraveAsCost()
end
end
if c:IsLocation(LOCATION_HAND) then
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
else
Duel.SendtoGrave(c,REASON_COST)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp)
Duel.SetTargetParam(ac)
e:SetLabel(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetLabel(ac)
e2:SetOperation(cm.regop)
Duel.RegisterEffect(e2,tp)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsCode(e:GetLabel()) then
Duel.Damage(rp,2000,REASON_EFFECT)
end
end
function cm.rmfilter(c,code)
return c:IsAbleToRemoveAsCost() and c:IsCode(code)
end
function cm.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
local code=e:GetLabelObject():GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil,code) and not e:GetHandler():IsControler(tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,code)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,0,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--猫梦镜
local m=33711406
local cm=_G["c"..m]
function cm.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_TOHAND+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.discon)
e1:SetCost(cm.discost)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_DECK)
end
function cm.tgfilter(c)
return c:IsDefense(1800) and c:IsAbleToGrave()
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,g)
local sg=g:Filter(cm.tgfilter,nil)
if sg:GetCount()>0 then
sg=sg:Select(tp,1,1,nil)
if Duel.SendtoGrave(sg,REASON_EFFECT)==0 then return end
local sg=Duel.GetOperatedGroup()
local tc=sg:GetFirst()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 then
if tc:IsLocation(LOCATION_GRAVE) and c:IsAbleToGrave() and tc:IsControler(1-tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
if Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end
end
end
end
end
--动物朋友 Unico
local m=33711407
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(cm.ffilter),4,true)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EFFECT_SPSUMMON_CONDITION)
e5:SetValue(cm.splimit1)
c:RegisterEffect(e5)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_PZONE)
e0:SetTargetRange(1,0)
e0:SetCondition(cm.splimcon)
e0:SetTarget(cm.splimit)
c:RegisterEffect(e0)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.rccost)
e1:SetTarget(cm.rctg)
e1:SetOperation(cm.rcop)
c:RegisterEffect(e1)
--imm
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetCondition(cm.imcon)
e2:SetTarget(aux.TargetBoolFunction(aux.AND(Card.IsSetCard,Card.IsFaceup),0x442))
e2:SetValue(function(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end)
e2:SetTargetRange(LOCATION_ONFIELD,0)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.discon)
e3:SetCost(cm.discost)
e3:SetTarget(cm.distg)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
--leave field
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(cm.setcon)
e4:SetOperation(cm.setop)
c:RegisterEffect(e4)
end
function cm.ffilter(c,fc)
return c:IsSetCard(0x442) and (c:IsType(TYPE_XYZ) or c:IsType(TYPE_FUSION) or c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_LINK))
end
function cm.splimit1(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function cm.filter22(c)
if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end
return c:IsSetCard(0x442)
end
function cm.imcon(e,tp)
local g=Duel.GetMatchingGroup(cm.filter22,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local num1=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD,nil)
return g:GetClassCount(Card.GetCode)>num1
end
function cm.splimcon(e)
return not e:GetHandler():IsForbidden()
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.rcfilter(c)
return c:IsSetCard(0x442) and not c:IsPublic()
end
function cm.rccost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if chk==0 then return Duel.GetMatchingGroupCount(cm.rcfilter,tp,LOCATION_HAND,0,nil)>0 end
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function cm.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x442)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local num=Duel.GetMatchingGroupCount(cm.rcfilter,tp,LOCATION_HAND,0,nil)
local num1=Duel.Recover(p,num*500,REASON_EFFECT)
local num2=num1//1000
local tg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=tg:Select(tp,1,math.min(#tg,num2),nil)
Duel.SendtoHand(thg,tp,REASON_EFFECT)
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev)
end
function cm.disfilter(c)
return c:IsDiscardable() and c:IsSetCard(0x442)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,false)
end
end
\ No newline at end of file
--动物朋友 牦牛
local m=33711408
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--Recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.rcost)
e2:SetTarget(cm.rtg)
e2:SetOperation(cm.rop)
c:RegisterEffect(e2)
--send to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetTarget(cm.ttg)
e3:SetOperation(cm.top)
c:RegisterEffect(e3)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,nil) and mg:GetClassCount(Card.GetCode)==#mg
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function cm.rcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.rtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.rop(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.ttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_DECK)
end
function cm.rfilter2(c)
return c:IsSetCard(0x442)
end
function cm.top(e,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<1 then return end
local ac=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 then
ac=Duel.AnnounceNumber(tp,1,2,3)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 then
ac=Duel.AnnounceNumber(tp,1,2)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
ac=Duel.AnnounceNumber(tp,1)
end
local tg=Duel.GetDecktopGroup(tp,ac)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,#rg,nil)
if sg1:GetCount()>0 then
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
end
else
local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if num<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,#sg,nil)
if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--恐怖谷
local m=33711409
local cm=_G["c"..m]
function cm.initial_effect(c)
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.con)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.con(e,tp)
return Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,nil)==1
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
end
function cm.operation(e,tp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) end
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,tc)
for sc in aux.Next(mg) do
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,0,0,aux.Stringid(m,2))
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(tc:GetRace())
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(tc:GetAttribute())
sc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(tc:GetAttack())
sc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_DEFENSE)
e4:SetValue(tc:GetDefense())
sc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e5:SetValue(1)
sc:RegisterEffect(e5)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e8:SetValue(1)
sc:RegisterEffect(e8)
end
cm[0]=tc:GetRace()
cm[1]=tc:GetAttribute()
cm[2]=tc:GetAttack()
cm[3]=tc:GetDefense()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetOperation(cm.cop)
Duel.RegisterEffect(e0,tp)
end
end
function cm.afilter(c)
return c:IsFaceup() and c:GetFlagEffect(m)==0
end
function cm.op(e,tp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.afilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for sc in aux.Next(mg) do
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,0,0,aux.Stringid(m,2))
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(cm[0])
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(cm[1])
sc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DELAY)
e3:SetValue(cm[2])
sc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_DEFENSE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DELAY)
e4:SetValue(cm[3])
sc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e5:SetValue(1)
sc:RegisterEffect(e5)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e8:SetValue(1)
sc:RegisterEffect(e8)
end
end
\ No newline at end of file
--恍殇华·永劫锥心复归
local m=33711410
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetRange(LOCATION_SZONE)
e2:SetLabelObject(e1)
e2:SetCountLimit(1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
if cm.check==nil then
cm.check=true
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1_1:SetCode(EVENT_TO_GRAVE)
e1_1:SetOperation(cm.op1_1)
Duel.RegisterEffect(e1_1,0)
local e1_2=Effect.CreateEffect(c)
e1_2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1_2:SetCode(EVENT_REMOVE)
e1_2:SetOperation(cm.op1_1)
Duel.RegisterEffect(e1_2,0)
end
end
--
function cm.op1_1(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsReason(REASON_DESTROY) then
local sp=tc:GetReasonPlayer()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,Duel.GetTurnCount())
end
end
end
function cm.spfilter1(c,e,tp)
if not c:IsFaceup() then return false end
if Duel.GetTurnPlayer()==tp then
return c:GetFlagEffect(m)>0 and c:GetFlagEffectLabel(m)==Duel.GetTurnCount()-1
else
return c:GetFlagEffect(m)>0 and c:GetFlagEffectLabel(m)==Duel.GetTurnCount()-2
end
end
function cm.target(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.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.spfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
e:SetLabel(tc:GetCode())
end
function cm.spfilter(c,e,tp)
return c:IsCode(e:GetLabelObject():GetLabel()) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_DEFENSE) and c:IsFaceup()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local tc=Duel.GetFirstTarget()
if Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP_DEFENSE)~=0 and Duel.GetTurnPlayer()~=tp then
Duel.SetLP(tp,Duel.GetLP(tp)/2)
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment