Commit 362407d9 authored by Huangnan's avatar Huangnan

fix

parent cd4563dd
Pipeline #39640 failed with stages
in 9 minutes and 36 seconds
No preview for this file type
--侍神·森岭 萤草
local m=96071010--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))--提示文本
e1:SetCategory(CATEGORY_RECOVER)--回复效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.retg)--效果判定
e1:SetOperation(cm.reop)--效果处理
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_COIN+CATEGORY_RECOVER+CATEGORY_ATKCHANGE)--加入手卡+硬币效果+攻击变化效果
e2:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--atk spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)--含特殊召唤的效果
e3:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地区域+除外区域
e3:SetCountLimit(1,m+2)
e3:SetTarget(cm.asptg)
e3:SetOperation(cm.aspop)
c:RegisterEffect(e3)
--recover/damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+3)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
--recover
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:GetAttack()>0
end
function cm.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:GetAttack()>0 then
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
--to hand
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
--atk up
function cm.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
local self=Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)
local opp=Duel.GetFieldGroupCount(1-tp,LOCATION_EXTRA,0)
local diff=math.abs(self-opp)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(diff*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--recover Ex
function cm.recfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1)
end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.recfilter,tp,LOCATION_ONFIELD+LOCATION_EXTRA,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.recfilter,tp,LOCATION_ONFIELD+LOCATION_EXTRA,0,nil)
local rec=g:GetClassCount(Card.GetCode)*400
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.recfilter,tp,LOCATION_ONFIELD+LOCATION_EXTRA,0,nil)
local rec=g:GetClassCount(Card.GetCode)*400
Duel.Recover(tp,rec,REASON_EFFECT)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local coin=Duel.TossCoin(tp,1)
if coin==1 then
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(m,2))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,2))
cm.recop(e,tp,eg,ep,ev,re,r,rp)
else
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(m,3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,3))
cm.atkop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.BreakEffect()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--atk spsummon
function cm.asptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(nil,tp,LOCATION_PZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.aspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetValue(tc:GetLeftScale()*300)
c:RegisterEffect(e3)
end
end
--recover/damage
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- 效果选择
local opt=Duel.SelectOption(tp,aux.Stringid(m,5),aux.Stringid(m,6))
local sel=e:GetLabel()
-- 选项1:检查额外卡组
if opt==0 then
-- 合并双方额外卡组
local ex_group=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
local op_ex_group=Duel.GetFieldGroup(1-tp,LOCATION_EXTRA,0)
ex_group:Merge(op_ex_group)
if #ex_group==0 then return end
-- 随机选择1张
local sg=ex_group:RandomSelect(tp,1)
local card=sg:GetFirst()
local owner=card:GetOwner() -- 获取卡片的原本持有者
-- 确认与洗切
Duel.ConfirmCards(tp,sg)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleExtra(owner) -- 只洗切卡片原本所在的额外卡组
-- 效果处理
if card:IsType(TYPE_MONSTER) and card:GetAttack()>=2400 then
Duel.Recover(tp,card:GetAttack(),REASON_EFFECT)
else
-- 攻击力翻倍
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
-- 选项2:伤害+ATK提升
elseif opt==1 then
-- 计算额外卡组总数
local extra_count=0
for p=0,1 do
extra_count=extra_count+Duel.GetFieldGroupCount(p,LOCATION_EXTRA,0)
end
local dam=extra_count*100
-- 造成伤害
if dam>0 and Duel.Damage(1-tp,dam,REASON_EFFECT)>0 then
-- ATK提升
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(dam)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--侍神·森岭 薫
local m=96071014--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
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:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.negcon)--效果条件
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
--pendulum to Extra
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOEXTRA)--加入额外卡组
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)--自己状态变化时触发+诱发选发效果
e3:SetCode(EVENT_SUMMON_SUCCESS)--通常召唤成功时
e3:SetProperty(EFFECT_FLAG_DELAY)--场合型诱发效果
e3:SetCountLimit(1,m+2)
e3:SetTarget(cm.pentg)
e3:SetOperation(cm.penop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)--特殊召唤成功时
c:RegisterEffect(e4)
--effect gain
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_BE_MATERIAL)
e5:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e5:SetCondition(cm.effcon)
e5:SetOperation(cm.effop)
c:RegisterEffect(e5)
--destroy replace
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)--场上卡片变化时触发+事件触发永续效果
e6:SetCode(EFFECT_DESTROY_REPLACE)--代替破坏
e6:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)--手卡+场上+墓地区域
e6:SetTarget(cm.reptg)
e6:SetValue(cm.repval)--属性设置
e6:SetOperation(cm.repop)
c:RegisterEffect(e6)
end
--spsummon
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xef1) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+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
--special summon
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.filter(c,e,tp)
return c:IsSetCard(0xef1) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.negtg(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 Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
end
--pendulum to Extra
function cm.penfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xef1) and not c:IsCode(m) and (c:IsLocation(LOCATION_DECK) or c:IsLocation(LOCATION_GRAVE))
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.penfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOEXTRA)
local g=Duel.SelectMatchingCard(tp,cm.penfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoExtraP(g,nil,REASON_EFFECT,POS_FACEUP)
end
end
--effect gain
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_FUSION+REASON_SYNCHRO+REASON_XYZ+REASON_LINK)~=0 and e:GetHandler():GetReasonCard():IsSetCard(0xef1)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
-- 不可破坏效果
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetCountLimit(3)
e1:SetValue(cm.valcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
end
function cm.valcon(e,re,r,rp)
local c=e:GetHandler()
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
-- 立即执行降攻防操作
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
return true
else
return false
end
end
--destroy replace
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsSetCard(0xef1) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.repfilter,1,c,tp) and c:IsAbleToRemove()
and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
\ No newline at end of file
--侍神·森岭 山兔
local m=96071017--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--to ex and to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOEXTRA+CATEGORY_DICE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tehtg)
e1:SetOperation(cm.tehop)
c:RegisterEffect(e1)
--set quick
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_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.seqcon)--效果条件
e2:SetCost(cm.seqcost)
e2:SetTarget(cm.seqtg)
e2:SetOperation(cm.seqop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DICE)--特殊召唤效果+骰子效果
e3:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外区域
e3:SetCountLimit(1,m+2)
e3:SetCost(cm.spscost)
e3:SetTarget(cm.spstg)
e3:SetOperation(cm.spsop)
c:RegisterEffect(e3)
--Count Down
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetLabel(6)
e4:SetOperation(cm.cdop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
cm.toss_dice=true
--to ex and to hand
function cm.tefil(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToExtra() and c:IsFaceup() and c:IsSetCard(0xef1) and not c:IsCode(m)
end
function cm.tehtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(cm.tefil,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
local g=Duel.SelectTarget(tp,cm.tefil,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0xef1)
end
function cm.tehop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoExtraP(tc,nil,REASON_EFFECT)~=0 then
Duel.BreakEffect()
local x=Duel.TossDice(tp,1)
local g=Duel.GetDecktopGroup(tp,x)
Duel.ConfirmDecktop(tp,x)
if g:IsExists(cm.thfilter,1,nil) then
local bg=g:Filter(cm.thfilter,nil)
local sg=bg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
Duel.ShuffleDeck(tp)
end
end
--set quick
function cm.seqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.seqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.seqfilter(c)
return c:IsSetCard(0x3ef1) and (c:IsType(TYPE_QUICKPLAY) or c:GetType()==TYPE_TRAP) and c:IsSSetable()
end
function cm.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.seqfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cm.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.seqfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local sc=g:GetFirst()
if sc and Duel.SSet(tp,sc)~=0 then
if sc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
end
if sc:IsType(TYPE_TRAP) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
end
end
end
--spsummon
function cm.spcfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsAbleToHandAsCost()
end
function cm.spscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function cm.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_ONFIELD)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function cm.spsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=Duel.TossDice(tp,1)*600
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
--Count Down
function cm.cdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,m)~=0 then return end
Duel.RegisterFlagEffect(tp,m,0,0,0)
local max=e:GetLabel()
c:SetHint(CHINT_TURN,max)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TOSS_DICE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetLabel(0,max)
e1:SetOperation(cm.loopop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,4))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
end
function cm.loopop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local current,max=e:GetLabel()
current=current+1
if current>=max then
c:SetHint(CHINT_TURN,0)
Duel.Hint(HINT_CARD,0,m)
cm.action(e,tp,eg,ep,ev,re,r,rp)
c:SetHint(CHINT_TURN,max)
e:SetLabel(0,max)
else
c:SetHint(CHINT_TURN,max-current)
e:SetLabel(current,max)
end
end
--Action
function cm.action(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- 骰子初始化处理
local dice=Duel.TossDice(tp,1)
-- 攻守提升效果
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTarget(cm.atktg)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(dice*100)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2,tp)
if dice==6 then
-- 永续攻击力下降效果
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(-dice*100)
e3:SetReset(RESET_DISABLE) -- 整局有效
Duel.RegisterEffect(e3,tp)
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(c:GetCode(),5)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function cm.atktg(e,c)
return c:IsCode(96071017)
end
\ No newline at end of file
--侍神·森岭 寻鹿之迹
local m=96071028--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOEXTRA)--回手卡效果+检索卡组效果+送去额外效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetCode(EVENT_FREE_CHAIN)--自由时点
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e1:SetTarget(cm.thtg)--效果判定
e1:SetOperation(cm.thop)--效果处理
c:RegisterEffect(e1)
--lv change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetType(EFFECT_TYPE_IGNITION)--启动效果
e3:SetRange(LOCATION_GRAVE)--墓地区域
e3:SetCountLimit(1)--回合发动次数
e3:SetCost(cm.lvcost)
e3:SetTarget(cm.lvtg)
e3:SetOperation(cm.lvop)
c:RegisterEffect(e3)
end
--tohand
function cm.thfilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.penfilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM) and c:IsAbleToExtra()
end
function cm.grfilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM) and c:IsFaceup()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local hasFiveTypes=Duel.GetMatchingGroupCount(cm.grfilter,tp,LOCATION_EXTRA,0,nil)>=5-- 检测额外卡组中表侧的灵摆怪兽种类数量
local ops={}
-- 构建选项表
table.insert(ops,aux.Stringid(m,0)) -- 效果1:从卡组·墓地把1只「侍神」怪兽加入手卡
table.insert(ops,aux.Stringid(m,1)) -- 效果2:加入自己的额外卡组的「侍神」灵摆怪兽
if hasFiveTypes then
table.insert(ops,aux.Stringid(m,2)) -- 两方选择
end
if chk==0 then return #ops>0 end
local sel=Duel.SelectOption(tp, table.unpack(ops))
-- 设置效果标签
if hasFiveTypes and sel==2 then
e:SetLabel(3) -- 特殊标记两方执行
else
e:SetLabel(sel)
end
end
-- 执行效果
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local sel=e:GetLabel()
-- 效果1:检索侍神怪兽
if sel==0 or sel==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
-- 效果2:加入额外卡组
if sel==1 or sel==3 then
-- 获取所有符合条件的灵摆怪兽
local g=Duel.GetMatchingGroup(cm.penfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if #g<1 then return end -- 确保至少有1张卡片可选择
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOEXTRA)
-- 选择1只灵摆怪兽
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
local selectedCard=sg:GetFirst()
-- 发送选择到额外卡组
Duel.SendtoExtraP(selectedCard,tp,REASON_EFFECT,POS_FACEUP)
end
end
end
--lv change
function cm.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:GetLevel()>0
end
function cm.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK)
local lv=Duel.AnnounceLevel(tp,1,12)
e:SetLabel(lv)
end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
--森岭神风·竞速切换
local m=96071030--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)--回手卡效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetCode(EVENT_FREE_CHAIN)--自由时点
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e1:SetTarget(cm.target)--效果判定
e1:SetOperation(cm.activate)--发动处理
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)--特殊召唤效果+回手卡效果
e2:SetType(EFFECT_TYPE_IGNITION)--主动效果
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)--取效果对象
e2:SetRange(LOCATION_GRAVE)--墓地区域
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.spcost)--代价cost
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e2)
end
--Activate
function cm.penfilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_PZONE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.penfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
--spsummon
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function cm.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsAbleToHand()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) 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_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp)
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
\ No newline at end of file
--森岭之闲暇风息
local m=96071032--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RECOVER)--回复效果
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)--以玩家为对象的效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetCode(EVENT_FREE_CHAIN)--自由时点
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e1:SetTarget(cm.retg)--效果判定
e1:SetOperation(cm.reop)--效果处理
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e2:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e2:SetCost(cm.cost)--代价cost
e2:SetTarget(cm.target)--效果判定
e2:SetOperation(cm.operation)--效果处理
c:RegisterEffect(e2)
--XYZsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e3:SetType(EFFECT_TYPE_IGNITION)--启动效果
e3:SetRange(LOCATION_GRAVE)--墓地区域
e3:SetCountLimit(1,m+1)
e3:SetCost(cm.spcost)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
--recover
function cm.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_ONFIELD)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local rt=Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_ONFIELD)*300
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Recover(p,rt,REASON_EFFECT)
end
--spsummon
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.spfilter1(c,e,tp)
return c:IsCode(96071001) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,c,e,tp)
end
function cm.spfilter2(c,e,tp)
return c:IsCode(96071014) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_ONFIELD)>0 end
Duel.SetTargetPlayer(tp)
local rt=Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_ONFIELD)*300
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Recover(p,rt,REASON_EFFECT)
Duel.BreakEffect()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,g1:GetFirst(),e,tp)
g1:Merge(g2)
if g1:GetCount()==2 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end
end
--XYZsummon
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.supfilter(c,e,tp)
return c:IsSetCard(0xef1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function cm.xyzfilter(c,e,tp,mc)
return c:IsSetCard(0xef1) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.matfilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(cm.supfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=Duel.SelectMatchingCard(tp,cm.supfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,cm.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g1:GetFirst())
local tc=g2:GetFirst()
tc:SetMaterial(g1)
Duel.Overlay(tc,g1)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=Duel.SelectMatchingCard(tp,cm.matfilter,tp,LOCATION_PZONE,0,1,1,nil,e)
Duel.HintSelection(sg)
Duel.Overlay(tc,sg)
end
end
\ No newline at end of file
--山牙·迅风援护战术
local m=96071034--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)--改变攻击力效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)--取对象效果+伤害步骤时
e1:SetCode(EVENT_FREE_CHAIN)--自由时点
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e1:SetCost(cm.atkcost)--效果条件
e1:SetTarget(cm.atktg)--效果判定
e1:SetOperation(cm.atkop)--效果处理
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)--回手卡
e2:SetType(EFFECT_TYPE_IGNITION)--启动效果
e2:SetRange(LOCATION_GRAVE)--墓地区域
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
--atk
function cm.atkfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xef1) and c:IsAbleToGraveAsCost()
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.atkfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(g:GetFirst():GetBaseAttack())
end
function cm.atkfilter2(c)
return c:IsType(TYPE_PENDULUM) and c:IsFaceup()
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.atkfilter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.atkfilter2,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(cm.distg)
e2:SetLabel(tc:GetFieldID())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_DISABLE_EFFECT)
Duel.RegisterEffect(e3,tp)
end
end
function cm.distg(e,c)
if c:GetFlagEffect(m)>0 then return true end
if c:IsSummonLocation(LOCATION_EXTRA) and c:GetBattleTarget()~=nil and c:GetBattleTarget():GetFieldID()==e:GetLabel() then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
Duel.AdjustInstantly(e:GetHandler())
return true
end
return false
end
--to hand
function cm.cfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToDeckAsCost()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,e:GetHandler())
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
\ No newline at end of file
--天翔鹤斩·伞剑
local m=96071035--卡密编号
local set=0x3ef1--侍神·森岭字段
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_ATKCHANGE)--改变攻击力效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)--取对象效果+可以在伤害步骤发动
e1:SetCode(EVENT_FREE_CHAIN)--自由时点
e1:SetHintTiming(TIMING_DAMAGE_STEP)--时点提示
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e1:SetTarget(cm.target)--效果判定
e1:SetOperation(cm.activate)--效果处理
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)--破坏效果
e2:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)--公共id(发动无效不计次数)
e2:SetCost(cm.descost)--代价cost
e2:SetTarget(cm.destg)--效果判定
e2:SetOperation(cm.desop)--效果处理
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)--回手卡效果
e3:SetType(EFFECT_TYPE_IGNITION)--起动效果
e3:SetRange(LOCATION_GRAVE)--墓地
e3:SetCountLimit(1,m+1)
e3:SetCost(cm.thcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
--Activate
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0xef1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_EXTRA,0,nil,TYPE_PENDULUM)*300
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
tc:RegisterEffect(e1)
end
end
--destroy
function cm.costfilter(c)
return c:IsSetCard(0xef1) and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER and c:IsAbleToRemoveAsCost()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=Duel.GetFirstTarget()
local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_EXTRA,0,nil,TYPE_PENDULUM)*300
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
tc:RegisterEffect(e1)
end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--to hand
function cm.cfilter(c)
return c:IsSetCard(0xef1) and c:IsAbleToDeckAsCost()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,e:GetHandler())
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
\ No newline at end of file
--侍神·森岭之风林火山 山风
local m=96071038--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableChangeCode(c,96071001,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsXyzType,TYPE_PENDULUM),7,2)--超量召唤手续
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--pzone specialsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--特殊召唤效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--double damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.dbcon)
e2:SetTarget(cm.dbtg)
e2:SetOperation(cm.dbop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetRange(LOCATION_EXTRA)--额外
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetType(EFFECT_TYPE_IGNITION)--起动效果
e4:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e4:SetCountLimit(1,m+2)
e4:SetCost(cm.pencost)
e4:SetTarget(cm.pentg)
e4:SetOperation(cm.penop)
c:RegisterEffect(e4)
--cannot target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)--只对自己有效
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)--不能成为效果对象
e5:SetRange(LOCATION_MZONE)--怪兽区域
e5:SetCondition(cm.indcon)
e5:SetValue(aux.tgoval)
c:RegisterEffect(e5)
--indes
local e6=e5:Clone()
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)--不会被效果破坏
e6:SetValue(aux.indoval)
c:RegisterEffect(e6)
--actlimit
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)--对玩家效果
e7:SetCode(EFFECT_CANNOT_ACTIVATE)--不能发动效果
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(0,1)
e7:SetValue(1)
e7:SetCondition(cm.actcon)
c:RegisterEffect(e7)
--chain
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)--场上卡片变化时触发+事件触发永续效果
e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)--效果不会被无效
e8:SetCode(EVENT_CHAINING)--效果发动时
e8:SetRange(LOCATION_MZONE)
e8:SetCondition(cm.chcon)
e8:SetOperation(cm.chop)
c:RegisterEffect(e8)
--atkup
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_CHAIN_END)--连锁结束
e9:SetRange(LOCATION_MZONE)
e9:SetCondition(cm.atkcon)
e9:SetOperation(cm.atkop)
e9:SetLabelObject(e8)
c:RegisterEffect(e9)
--multi attack
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_EXTRA_ATTACK)--多次攻击
e10:SetValue(1)
e10:SetCondition(cm.makcon)
c:RegisterEffect(e10)
end
cm.pendulum_level=7--当作7星怪兽进行灵摆
--pzone specialsummon
function cm.sptg(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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.mfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsCanOverlay()
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if c:IsType(TYPE_XYZ)
and Duel.GetMatchingGroupCount(aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_GRAVE,0,nil)>0
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Overlay(c,g)
end
end
--double damage
function cm.dbcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.dbfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:GetFlagEffect(m)==0
end
function cm.dbtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.dbfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.dbfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.dbop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e1:SetCondition(function(e) return e:GetHandler():GetBattleTarget()~=nil end)
e1:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--special summon
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.filter2(c,e,tp)
return c:IsCode(96071001) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.ShuffleDeck(tp)
end
end
--pendulum
function cm.pencost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--cannot target
function cm.indcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH)
end
--actlimit
function cm.actcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER) and Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
--chain
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==1 then
e:SetLabel(0)
else
e:SetLabel(1)
end
end
--atkup
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local res=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(0)
return res==1
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
--multi attack
function cm.makcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND)
end
\ No newline at end of file
--山牙·迅风援护战术
local m=96071041--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableChangeCode(c,96071004,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsXyzType,TYPE_PENDULUM),6,2)--超量召唤手续
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--pzone specialsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--特殊召唤效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--atk down
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_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.adwcon)
e2:SetOperation(cm.adwop)
c:RegisterEffect(e2)
--pendulum set/spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetRange(LOCATION_EXTRA)--额外
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.rpcon)
e3:SetTarget(cm.rptg)
e3:SetOperation(cm.rpop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetType(EFFECT_TYPE_IGNITION)--起动效果
e4:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e4:SetCountLimit(1,m+2)
e4:SetCost(cm.pencost)
e4:SetTarget(cm.pentg)
e4:SetOperation(cm.penop)
c:RegisterEffect(e4)
--disable attack
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,5))
e5:SetCategory(CATEGORY_RECOVER)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetRange(LOCATION_MZONE)--怪兽区域
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetCost(cm.atkcost)
e5:SetOperation(cm.atkop)
c:RegisterEffect(e5)
--immune
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)--自己变化触发
e6:SetCode(EFFECT_IMMUNE_EFFECT)--效果免疫
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)--只对自己有效
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(cm.tgcon)
e6:SetValue(cm.efilter)
c:RegisterEffect(e6)
end
cm.pendulum_level=6--当作6星怪兽进行灵摆
--pzone specialsummon
function cm.sptg(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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.mfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
-- 从卡组检索灵摆怪兽
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--atk down
function cm.adwcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.adwop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(math.ceil(tc:GetDefense()/2))
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--pendulum set/spsummon
function cm.rpcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.rpfilter(c,e,tp)
return c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM) and (not c:IsForbidden()
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function cm.rptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rpfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
end
function cm.rpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.SelectMatchingCard(tp,cm.rpfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local op=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
else
op=Duel.SelectOption(tp,aux.Stringid(m,3))
end
if op==0 then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--pendulum
function cm.pencost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--disable attack
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local b=Duel.GetAttacker()
if Duel.NegateAttack() and b and b:IsRelateToBattle() and b:IsFaceup() then
Duel.Recover(tp,b:GetAttack(),REASON_EFFECT)
end
end
--immune
function cm.tgcon(e)
return e:GetHandler():IsDefensePos()
end
function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
\ No newline at end of file
--侍神·森岭之驰骋纵横 小鹿男
local m=96071044--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableChangeCode(c,96071007,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsXyzType,TYPE_PENDULUM),5,2)--超量召唤手续
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--pzone specialsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)--特殊召唤效果+改变表示形式效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--copy
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_EXTRA)--额外卡组
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.cpcon)
e2:SetTarget(cm.cptg)
e2:SetOperation(cm.cpop)
c:RegisterEffect(e2)
--xyz summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e3:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetRange(LOCATION_EXTRA)--额外卡组
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetType(EFFECT_TYPE_IGNITION)--起动效果
e4:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e4:SetCountLimit(1,m+2)
e4:SetCost(cm.pencost)
e4:SetTarget(cm.pentg)
e4:SetOperation(cm.penop)
c:RegisterEffect(e4)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,5))
e4:SetCategory(CATEGORY_DISABLE)--效果无效
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)--怪兽区域
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER)--怪兽表侧表示存在时点提示
e4:SetCountLimit(1)
e4:SetTarget(cm.target)
e4:SetCost(cm.cost)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end
cm.pendulum_level=5--当作5星怪兽进行灵摆
--pzone specialsummon
function cm.sptg(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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local cg=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if cg:GetCount()>0 then
Duel.BreakEffect()
Duel.HintSelection(cg)
Duel.ChangePosition(cg:GetFirst(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
end
--copy
function cm.cpcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.filter(c)
local typ=c:GetType()
return c:IsFaceupEx() and c:IsSetCard(0xef1) and (typ==TYPE_SPELL or typ==TYPE_TRAP)
and c:CheckActivateEffect(false,true,false)
end
function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil):GetFirst()
local te,ceg,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
Duel.ClearTargetCard()
tc:CreateEffectRelation(e)
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
if not (te and te:GetHandler():IsRelateToEffect(e)) then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp)
end
end
--xyz summon
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(cm.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.xyzfilter(c,e,tp,mc)
return c:IsSetCard(0xef1) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local mg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
if #mg>0 then
local mc=mg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mc)
local sc=g:GetFirst()
if sc then
local og=mc:GetOverlayGroup()
if og:GetCount()~=0 then
Duel.Overlay(sc,og)
end
sc:SetMaterial(Group.FromCards(mc))
Duel.Overlay(sc,Group.FromCards(mc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
--pendulum
function cm.pencost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--negate
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e,false) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
\ No newline at end of file
--墨客·慈乌稚子 姑获鸟
local m=96071057--卡密编号
local set1=0x3ef1--侍神·森岭字段
local set2=0x5ef1--侍神·京都堺字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableChangeCode(c,96071053,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--xyz summon
aux.AddXyzProcedure(c,nil,5,2)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)--回手卡效果+检索卡组效果+含特殊召唤效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetCost(cm.tgcost)--代价cost
e1:SetTarget(cm.tgtg)--效果判定
e1:SetOperation(cm.tgop)--效果处理
c:RegisterEffect(e1)
--pendulum set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.pencon)--效果条件
e2:SetTarget(cm.pentg)
e2:SetOperation(cm.penop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)--怪兽区域
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--disable spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)--无效召唤效果+破坏效果
e4:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_SUMMON)--召唤之际
e4:SetCondition(cm.condition)
e4:SetCost(cm.cost)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_FLIP_SUMMON)--翻转召唤之际
c:RegisterEffect(e5)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON)--特殊召唤之际
c:RegisterEffect(e5)
end
cm.pendulum_level=5--当作5星怪兽进行灵摆
--special summon
function cm.cfilter(c)
return c:IsLevelBelow(4) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function cm.tgcost(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)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetLabel(g:GetFirst():GetLevel())
end
function cm.thfilter(c)
return c:IsLevelBelow(4) and c:IsSetCard(0xef1) and c:IsAbleToHand()
end
function cm.tgtg(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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.tgop(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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--pendulum set
function cm.pcfilter(c)
return c:IsFaceup() and c:IsLevelBelow(4)
end
function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() and Duel.IsExistingMatchingCard(cm.pcfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.setfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4) and c:IsAbleToHand()
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_ONFIELD) and cm.setfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) and Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--spsummon
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4) and c:IsSetCard(0xef1) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
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_DECK+LOCATION_EXTRA+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(1600)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
--disable spsummon
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
\ No newline at end of file
--游侠·森林之姬 白狼
local m=96071059--卡密编号
local set1=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableChangeCode(c,96071055,LOCATION_MZONE+LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--xyz summon
aux.AddXyzProcedure(c,nil,5,2)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--pendulum/spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e1:SetType(EFFECT_TYPE_IGNITION)--起动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOGRAVE)--送去墓地效果
e2:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.tgcon)--效果条件
e2:SetCost(cm.tgcost)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)--破坏效果
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e3:SetCountLimit(1,m+2)
e3:SetCost(cm.gspcost)
e3:SetTarget(cm.gsptg)
e3:SetOperation(cm.gspop)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)--自己状态变化时触发
e4:SetCode(EFFECT_UPDATE_ATTACK)--增减攻击力
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)--只对自己有效
e4:SetRange(LOCATION_MZONE)--怪兽区域
e4:SetCondition(cm.atkcon)
e4:SetValue(cm.atkval)
c:RegisterEffect(e4)
end
cm.pendulum_level=5--当作5星怪兽进行灵摆
--pendulum/spsummon
function cm.spfilter(c,e,tp,mc)
return c:IsSetCard(0xef1) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and not c:IsCode(m)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.matfilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Group.FromCards(c)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc then
Duel.BreakEffect()
tc:SetMaterial(mg)
Duel.Overlay(tc,mg)
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
tc:CompleteProcedure()
if Duel.IsExistingMatchingCard(cm.matfilter,tp,LOCATION_PZONE,0,1,nil,e)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=Duel.SelectMatchingCard(tp,cm.matfilter,tp,LOCATION_PZONE,0,1,1,nil,e)
Duel.HintSelection(sg)
Duel.Overlay(tc,sg)
end
end
end
end
end
function cm.mfilter(c)
return c:IsType(TYPE_PENDULUM)
end
--search
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--special summon
function cm.gspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.gsptg(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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.gspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
if #cg==0 then return end
Duel.BreakEffect()
Duel.Destroy(cg,REASON_EFFECT)
end
end
--atk up
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(cm.atkfilter,c:GetControler(),LOCATION_EXTRA,0,nil)*700
end
\ No newline at end of file
--七野森岭之威慑
local m=96071061--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)--无效召唤+破坏效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetCode(EVENT_SPSUMMON)--特殊召唤之际
e1:SetCondition(cm.condition1)--效果条件
e1:SetCost(cm.cost)--代价cost
e1:SetTarget(cm.target1)--效果判定
e1:SetOperation(cm.activate1)--效果处理
c:RegisterEffect(e1)
--Activate(effect)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)--发动无效
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)--伤害步骤时+伤害计算时
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)--效果发动时
e2:SetCondition(cm.condition2)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target2)
e2:SetOperation(cm.activate2)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上变化触发+诱发选发效果
e3:SetProperty(EFFECT_FLAG_DELAY)--场合诱发
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)--墓地区域
e3:SetCountLimit(1,m)--卡名次数限制
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
end
--Activate(summon)
function cm.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xef1) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,REASON_COST,true,nil) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,REASON_COST,true,nil)
Duel.Release(g,REASON_COST)
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
--Activate(effect)
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function cm.target2(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)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--set
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and aux.exccon(e)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
\ No newline at end of file
--侍神·森岭 镰鼬
local m=96071067--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
-- 破坏效果
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m) --每回合只能使用一次
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.atkcon)
e2:SetCost(cm.atkcost)
e2:SetTarget(cm.atktg)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e3:SetCountLimit(1,m+2)
e3:SetCost(cm.gspcost)
e3:SetTarget(cm.gsptg)
e3:SetOperation(cm.gspop)
c:RegisterEffect(e3)
-- 攻击提升效果
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetCondition(cm.attackcon)
e4:SetValue(cm.attack_val)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
-- 多次攻击与伤害
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLED) -- 攻击后(可发动效果)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCondition(cm.atkcon2)
e5:SetOperation(cm.atkop2)
c:RegisterEffect(e5)
-- 战斗效果
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_BATTLE_START)
e6:SetCondition(cm.battle_condition)
e6:SetOperation(cm.battle_operation)
c:RegisterEffect(e6)
end
-- 破坏效果
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc~=c and chkc:IsDestructable() end
if chk==0 then
return c:IsDestructable() and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
-- 提示选择要破坏的卡片
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
-- 选择目标卡片
local g = Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
g:AddCard(c) -- 将自己加入破坏目标
-- 设置操作信息
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
-- 如果目标是怪兽,获取攻击力并设置伤害信息
if g:GetFirst():IsType(TYPE_MONSTER) then
local atk=g:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
end
-- 执行效果
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
if Duel.Destroy(tc,REASON_EFFECT)~=0 and tc:IsType(TYPE_MONSTER) then
Duel.BreakEffect()
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
-- 破坏自身
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
--atk down
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:GetBaseAttack()~=c:GetAttack()
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local diff=math.abs(tc:GetBaseAttack()-tc:GetAttack())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(diff)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--special summon
function cm.gspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.gsptg(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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.gspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
-- 计算攻击力提升
function cm.attackcon(e)
return Duel.GetFlagEffect(tp,m)>=3
end
function cm.attack_val(e,c)
return Duel.GetFlagEffect(tp,m)*300
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsCode(m) then
Duel.RegisterFlagEffect(tp,m,nil,0,1)
end
tc=eg:GetNext()
end
end
-- 攻击时的条件
function cm.atkcon2(e)
return Duel.GetFlagEffect(tp,m)>=6
end
-- 攻击时的操作
function cm.atkop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COIN)
local coin_result=Duel.TossCoin(tp,1) -- 进行投掷硬币
if coin_result==1 then
if c:IsRelateToEffect(e) then
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
-- 保持原有返回逻辑
Duel.BreakEffect()
-- 确保返回时状态正确
Duel.ReturnToField(c, POS_FACEUP)
end
end
else
-- 给与对方900伤害
Duel.Damage(1-tp,900,REASON_EFFECT)
end
end
-- 战斗效果的条件
function cm.battle_condition(e)
return Duel.GetFlagEffect(tp,m)>=9
end
-- 战斗效果的操作
function cm.battle_operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- 使对方怪兽效果无效化
local tc=Duel.GetAttackTarget()
if tc and Duel.GetCurrentPhase()==PHASE_BATTLE then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--侍神·森岭 虫师
local m=96071070 -- 卡密编号
local set=0x3ef1 -- 侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
-- 灵摆属性
aux.EnablePendulumAttribute(c)
-- 取除指示物
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m) --每回合只能使用一次
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
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:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.reccon)
e2:SetTarget(cm.rectg)
e2:SetOperation(cm.recop)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_ONFIELD+LOCATION_EXTRA)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(cm.adcon)
e3:SetTarget(cm.adtg)
e3:SetValue(cm.adval)
c:RegisterEffect(e3)
--counter
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_COUNTER)--指示物效果
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)--自己状态变化时触发+诱发选发效果
e4:SetCode(EVENT_SUMMON_SUCCESS)--通常召唤成功时
e4:SetProperty(EFFECT_FLAG_DELAY)--场合型诱发效果
e4:SetTarget(cm.cttg)
e4:SetOperation(cm.ctop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)--特殊召唤成功时
c:RegisterEffect(e5)
--to hand
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,4))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)--场合型诱发效果
e6:SetCode(EVENT_TO_HAND)
e6:SetCondition(cm.thcon)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
c:RegisterEffect(e6)
end
-- 取除指示物
function cm.filter(c)
return c:GetCounter(0)~=0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local sg = Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local totalCount=0 -- 记录取除的总指示物数量
-- 遍历群组,移除所有指示物并统计数量
for tc in aux.Next(sg) do
local count=tc:GetCounter(0) -- 获取当前卡片上的所有指示物数量
totalCount=totalCount+count -- 累加到总数量
tc:RemoveCounter(tp,0,count,REASON_EFFECT) -- 移除所有的指示物
end
if totalCount>0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0,e,REASON_EFFECT,tp,tp,totalCount) -- 触发事件
Duel.Damage(1-tp,totalCount*200,REASON_EFFECT) -- 给与对方伤害
end
end
--recover
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.recfilter(c)
return c:GetCounter(0)>0 -- 检查指示物大于0
end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.recfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
local count=Duel.GetMatchingGroupCount(cm.recfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,count*200)
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.recfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local count=0
for tc in aux.Next(sg) do
count=count+tc:GetCounter(0) -- 仅统计数量,不移除指示物
end
if count>0 then
Duel.Recover(tp,count*200,REASON_EFFECT) -- 正确使用Recover函数
end
end
--atkdown
function cm.adcon(e)
return e:GetHandler():IsFaceup() and Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function cm.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x104f)~=0 and bc:IsSetCard(0xef1)
end
function cm.adval(e,c)
return c:GetCounter(0x104f)*-200
end
--counter
function cm.ctfilter(c)
return c:IsFaceup() and c:IsCanAddCounter(0x104f,1)
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ctfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x104f)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(cm.ctfilter,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x104f,1)
tc=g:GetNext()
end
end
--to hand
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function cm.thfilter(c,e,tp)
return c:IsLevelAbove(5) and c:IsSetCard(0xef1) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false)) and c:IsFaceupEx()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if tc then
if not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or Duel.SelectOption(tp,1190,1152)==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
This diff is collapsed.
--神道化 苍风一目连
local m=96071077--卡密编号
local set=0xef1--侍神字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,96071000,96071004)
aux.EnablePendulumAttribute(c)
--fusion summon
c:EnableReviveLimit()
--revive limit
aux.EnableReviveLimitPendulumSummonable(c,LOCATION_EXTRA)--可以进行灵摆召唤
--spsummon 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)--特殊召唤条件
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--pzone specialsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤效果
e1:SetType(EFFECT_TYPE_IGNITION)--主动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetCost(cm.spcost)--代价cost
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--special summon
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_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.pencon)
e2:SetTarget(cm.pentg)
e2:SetOperation(cm.penop)
c:RegisterEffect(e2)
--add counter
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_COUNTER)--指示物效果
e3:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetRange(LOCATION_MZONE)--怪兽区域
e3:SetCountLimit(1,m+2)
e3:SetCost(cm.cost)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--attackup
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_RECOVER)--改变攻击效果+回复效果
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)--伤害计算时
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.atkcon)
e4:SetTarget(cm.rectg)
e4:SetOperation(cm.atkop)
c:RegisterEffect(e4)
--Lost Lp
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,4))
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(cm.damcon)
e5:SetCost(cm.damcost)
e5:SetTarget(cm.damtg)
e5:SetOperation(cm.damop)
c:RegisterEffect(e5)
--shuffle
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)--永续效果
e6:SetCode(EVENT_CHAINING)--效果发动时
e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)--效果不会被无效
e6:SetCondition(cm.shucon)
e6:SetTarget(cm.shutg)
e6:SetOperation(cm.shuop)
c:RegisterEffect(e6)
end
cm.card_code_list={96071000}--记述卡名编号
cm.assault_name=96071004--卡名记述编号
cm.pendulum_level=10--当作10星怪兽进行灵摆
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(96071000) or not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
--special summon
function cm.rfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and (c:IsControler(tp) or c:IsFaceup())
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function cm.filter(c,tp)
return c:GetControler()==tp or c:IsAbleToChangeControler()
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) 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 Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,tp) then
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
Duel.Overlay(c,g)
end
end
--pendulum set
function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lp=math.ceil((Duel.GetLP(tp)+Duel.GetLP(1-tp))/2)
Duel.SetLP(tp,lp)
Duel.SetLP(1-tp,lp)
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--add counter
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
-- 允许去除任意数量素材
local maxct=c:GetOverlayCount()
local ct=Duel.AnnounceNumber(tp,1,maxct)
local rmct=c:RemoveOverlayCard(tp,ct,ct,REASON_COST)
e:SetLabel(rmct)
-- 禁止对手连锁
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,nil)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
for i=1,ct do
-- 选择目标并添加指示物
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local g=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,1,nil,0x1019,1)
if #g==0 then return end
local tc=g:GetFirst()
tc:AddCounter(0x1019,1)
-- 注册代替破坏效果(智能覆盖)
if not tc:IsHasEffect(EFFECT_DESTROY_REPLACE) then
-- 代替破坏效果
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetLabelObject(tc) -- 绑定指示物宿主
e1:SetTarget(cm.reptg)
e1:SetOperation(cm.repop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
function cm.reptg(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 c:IsCanRemoveCounter(tp,0x1019,1,REASON_EFFECT) end
return true
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(tp,0x1019,1,REASON_EFFECT)
end
--attackup
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon()
end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x1019)
if chk==0 then return ct>0 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*500)
end
function cm.atkop(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_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)--增减攻击力
e1:SetValue(cm.atkval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
local ct=c:GetCounter(0x1019)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if c:IsRelateToEffect(e) and ct>0 then
Duel.Recover(p,ct*500,REASON_EFFECT)
end
end
function cm.atkval(e,c)
return Duel.GetCounter(0,1,1,0x1019)*1000
end
--Lost Lp
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
local te,p=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return te and te:GetHandler():IsSetCard(0xef1) and p==tp and rp==1-tp
end
function cm.damfilter(c)
return c:GetCounter(0x1019)>0
end
function cm.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCounter(tp,1,1,0x1019)>0 end
local g=Duel.GetMatchingGroup(cm.damfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
local sum=0
while tc do
local sct=tc:GetCounter(0x1019)
tc:RemoveCounter(tp,0x1019,sct,0)
sum=sum+sct
tc=g:GetNext()
end
e:SetLabel(sum)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetLabel())
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(ct*500)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetOperation(cm.lpop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local dam=e:GetLabel()
Duel.SetLP(1-tp,Duel.GetLP(1-tp)-dam)
end
--shuffle
function cm.shucon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.shutg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>1 end
end
function cm.shuop(e,tp,eg,ep,ev,re,r,rp)
local res0=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
local res1=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>1
if res0 and res1 then
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
end
end
\ No newline at end of file
--神道化 渺念萤草
local m=96071079--卡密编号
local set=0xef1--侍神字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,96071000,96071010)
aux.EnablePendulumAttribute(c)--灵摆属性
--fusion summon
c:EnableReviveLimit()
--revive limit
aux.EnableReviveLimitPendulumSummonable(c,LOCATION_EXTRA)--可以进行灵摆召唤
--spsummon 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)--特殊召唤条件
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--pzone specialsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤效果
e1:SetType(EFFECT_TYPE_IGNITION)--主动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--To hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)--加入手卡
e2:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.pencon)
e2:SetTarget(cm.pentg)
e2:SetOperation(cm.penop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_RECOVER)--使效果无效效果+回复效果
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e3:SetRange(LOCATION_MZONE)--怪兽区域
e3:SetCountLimit(1)
e3:SetCost(cm.discost)--代价cost
e3:SetTarget(cm.distg)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
--atk
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,4))
e4:SetCategory(CATEGORY_ATKCHANGE)--改变攻击效果
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)--诱发必发效果
e4:SetCode(EVENT_RECOVER)--回复生命值时
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.incon)
e4:SetOperation(cm.atkop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_SINGLE)--自己状态变化时触发
e5:SetCode(EFFECT_EXTRA_ATTACK)--增加攻击次数
e5:SetValue(2)
c:RegisterEffect(e5)
end
cm.card_code_list={96071000}--记述卡名编号
cm.assault_name=96071010--卡名记述编号
cm.pendulum_level=4--当作4星怪兽进行灵摆
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(96071000) or not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
--pzone specialsummon
function cm.mfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsCanOverlay() and not c:IsCode(m)
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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if c:IsType(TYPE_XYZ)
and Duel.GetMatchingGroupCount(aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)>0
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.Overlay(c,g)
end
end
--To hand
function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.tcfilter(c)
return c:IsCode(96071000) and c:IsAbleToHand()
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--disable
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.disfilter(c)
return c:IsFaceup() and (c:GetAttack()>0 or aux.NegateMonsterFilter(c))
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,cm.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetBaseAttack())
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)--暂时改变攻击力
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)--效果无效(技能抽取)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)--效果无效(圣杯)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(RESET_TURN_SET)--变里侧重置
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetValue(0)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
Duel.Recover(tp,tc:GetBaseAttack(),REASON_EFFECT)
end
end
--atk
function cm.incon(e)
return e:GetHandler():GetOverlayCount()>0
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)--复制继承属性
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ev)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
\ No newline at end of file
--流光之箭·萤光弓
local m=96071081--卡密编号
local set=0x3ef1--侍神·森岭字段
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:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.xcon)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.recon)
e3:SetTarget(cm.retg)
e3:SetOperation(cm.reop)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_XMATERIAL)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.econ)
e4:SetValue(cm.atfval)
c:RegisterEffect(e4)
--to hand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,m+1)
e5:SetCost(cm.thcost)
e5:SetTarget(cm.thtg)
e5:SetOperation(cm.thop)
c:RegisterEffect(e5)
end
--activate
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler():IsCanOverlay()
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.Overlay(tc,Group.FromCards(c))
if tc and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_EXTRA,0,1,nil,96071055) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=g:GetFirst()
if tc and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and tc:GetAttack()>0 then
Duel.BreakEffect()
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
end
end
--get effect
function cm.xcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0xef1)
end
function cm.atkval(e,c)
local atk=c:GetAttack()-c:GetBaseAttack()
return c:GetBaseAttack()+atk*2
end
--recover
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsType(TYPE_PENDULUM)
end
function cm.retg(e,tp,eg,ep,ev,re,r,rp,chk)
local rec=math.ceil(e:GetHandler():GetAttack())
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local rec=math.ceil(c:GetAttack())
Duel.BreakEffect()
Duel.Recover(p,rec,REASON_EFFECT)
end
--atk up
function cm.econ(e)
local c=e:GetHandler()
return aux.IsCodeListed(c,96071000)
end
function cm.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.atfval(e,c)
local c=e:GetHandler()
return c:GetOverlayGroup():GetSum(cm.lv_or_rk())*300
end
function cm.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
--to hand
function cm.rfilter(c)
return c:IsFaceup() and c:IsAttackAbove(2000) and c:IsReleasableByEffect()
end
function cm.costfilter(c,tp)
return (c:IsControler(tp) or c:IsFaceup()) and c:IsAttackAbove(2000) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingTarget(cm.rfilter,tp,0,LOCATION_MZONE,1,c)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,REASON_COST,true,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,costfilter,1,1,REASON_COST,true,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--山神使 古笼火
local m=96071083--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableChangeCode(c,96071086,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)--特殊召唤效果
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.sptg)--效果判定
e1:SetOperation(cm.spop)--效果处理
c:RegisterEffect(e1)
--pendulum to Extra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOEXTRA)--加入额外卡组
e2:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.pencon)
e2:SetTarget(cm.pentg)
e2:SetOperation(cm.penop)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_QUICK_O)--选发效果
e3:SetCode(EVENT_FREE_CHAIN)--自由时点
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e3:SetCountLimit(1,m+2)
e3:SetTarget(cm.mattg)
e3:SetOperation(cm.matop)
c:RegisterEffect(e3)
--get effect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_XMATERIAL)--超量素材赋予效果
e4:SetCode(EFFECT_PIERCE)--贯穿伤害
e4:SetCondition(cm.condition)
c:RegisterEffect(e4)
--get effect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_XMATERIAL)--超量素材赋予效果
e5:SetCode(EFFECT_UPDATE_ATTACK)--攻击力变化
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)--只对自己生效
e5:SetRange(LOCATION_MZONE)--怪兽区域
e5:SetCondition(cm.condition)
e5:SetValue(cm.xval)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_UPDATE_DEFENSE)--守备力变化
c:RegisterEffect(e6)
end
--special summon
function cm.filter(c,e,tp)
return c:IsCode(96071004) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.ShuffleDeck(tp)
end
end
--pendulum to Extra
function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.penfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xef1) and not c:IsCode(m) and (c:IsLocation(LOCATION_DECK) or c:IsLocation(LOCATION_GRAVE))
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.penfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOEXTRA)
local g=Duel.SelectMatchingCard(tp,cm.penfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoExtraP(g,nil,REASON_EFFECT,POS_FACEUP)
end
end
--material
function cm.xyzfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsType(TYPE_XYZ)
end
function cm.mafilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_MONSTER)
end
function cm.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.mafilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if not tc or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.mafilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.Overlay(tc,g)
if c:IsRelateToEffect(e) and (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED)) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
end
--get effect
function cm.condition(e)
return e:GetHandler():IsSetCard(0xef1)
end
function cm.xval(e,c)
return e:GetHandler():GetOverlayCount()*300
end
\ No newline at end of file
--海神使 古笼火
local m=96071086--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
if not _G["destroyed_96071086_count"] then
_G["destroyed_96071086_count"]={}
end
aux.EnableChangeCode(c,96071083,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)--当作卡名
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--selfdes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(cm.descon)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_PZONE)
e2:SetCondition(cm.actcon)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_PZONE)
e3:SetCode(EVENT_CHAIN_END)
e3:SetOperation(cm.subop)
c:RegisterEffect(e3)
--to pzone
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e4:SetCode(EVENT_FREE_CHAIN)--自由时点
e4:SetRange(LOCATION_EXTRA)--额外
e4:SetCountLimit(1,m+1)
e4:SetCondition(cm.plcon)--效果条件
e4:SetTarget(cm.pltg)
e4:SetOperation(cm.plop)
c:RegisterEffect(e4)
--material
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,2))
e5:SetType(EFFECT_TYPE_QUICK_O)--选发效果
e5:SetCode(EVENT_FREE_CHAIN)--自由时点
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)--取对象效果
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)--墓地+除外
e5:SetCountLimit(1,m+2)
e5:SetTarget(cm.mattg)
e5:SetOperation(cm.matop)
c:RegisterEffect(e5)
--damage
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,3))
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e6:SetCode(EVENT_DESTROYED)
e6:SetCondition(cm.damcon)
e6:SetTarget(cm.damtg)
e6:SetOperation(cm.damop)
c:RegisterEffect(e6)
-- 注册全局监听一次(只在首个执行时运行)
if not cm.global_check then
cm.global_check = true
local ge=Effect.CreateEffect(c)
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_DESTROYED)
ge:SetOperation(cm.check_count)
Duel.RegisterEffect(ge,0)
end
end
--selfdes
function cm.descon(e)
return not Duel.IsExistingMatchingCard(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),0xef1)
end
--actlimit
function cm.actfilter1(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0xef1) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.actfilter1,1,nil,tp)
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(cm.chlimit)
elseif Duel.GetCurrentChain()==1 then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(cm.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function cm.resetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:ResetFlagEffect(m)
e:Reset()
end
function cm.subop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)~=0 then
Duel.SetChainLimitTillChainEnd(cm.chlimit)
end
end
--to pzone
function cm.plcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.pltg(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 cm.plop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--material
function cm.xyzfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsType(TYPE_XYZ)
end
function cm.mafilter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc) end
if chk==0 then
return Duel.IsExistingTarget(cm.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.mafilter,tp,0,LOCATION_GRAVE,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.mafilter,tp,0,LOCATION_GRAVE,1,1,nil)
if #g>0 then
Duel.Overlay(tc,g)
if c:IsRelateToEffect(e) and (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED)) then
-- 先移除这张卡(要从场外移入额外卡组)
Duel.SendtoExtraP(c,nil,REASON_EFFECT)
-- 这里默认表侧加入额外卡组,通常SendtoExtraP会处理为面向玩家,如果游戏环境支持表侧,需要特殊处理。
end
end
end
--damage
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
local p=1-tp
local times=_G["destroyed_96071086_count"] and (_G["destroyed_96071086_count"][tp] or 0) or 0
local dam=times*500
if dam==0 then dam=500 end
Duel.SetTargetPlayer(p)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,dam)
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)
end
-- 破坏计数器逻辑
function cm.check_count(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsCode(m) and (tc:IsReason(REASON_EFFECT) or tc:IsReason(REASON_BATTLE)) then
local owner=tc:GetOwner()
_G["destroyed_96071086_count"][owner] = (_G["destroyed_96071086_count"][owner] or 0) + 1
end
end
end
\ No newline at end of file
--侍神·森岭 以津真天
local m=96071088--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetOperation(cm.penop)--效果处理
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)--诱发即时效果
e2:SetCode(EVENT_FREE_CHAIN)--自由时点
e2:SetRange(LOCATION_EXTRA)--额外
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.descon)
e2:SetCost(cm.descost)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--Count Down
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetLabel(4)
e3:SetOperation(cm.cdop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--dice
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,5))
e5:SetCategory(CATEGORY_DICE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetTarget(cm.target)
e5:SetOperation(cm.operation)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e6)
--damage reduce
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e7:SetValue(aux.ChangeBattleDamage(1,HALF_DAMAGE))
c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_IMMUNE_EFFECT)
e8:SetValue(cm.efilter)
c:RegisterEffect(e8)
end
--draw
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetValue(2)
Duel.RegisterEffect(e1,tp)
end
--to deck
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--Count Down
function cm.cdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,m)~=0 then return end
Duel.RegisterFlagEffect(tp,m,0,0,0)
local max=e:GetLabel()
c:SetHint(CHINT_TURN,max)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetLabel(0,max)
e1:SetCondition(cm.loopcon)
e1:SetOperation(cm.loopop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
end
--chain
function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.loopcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(cm.cfilter,1,nil,1-tp)
end
function cm.loopop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local current,max=e:GetLabel()
current=current+1
if current>=max then
c:SetHint(CHINT_TURN,0)
Duel.Hint(HINT_CARD,0,m)
cm.action(e,tp,eg,ep,ev,re,r,rp)
c:SetHint(CHINT_TURN,max)
e:SetLabel(0,max)
else
c:SetHint(CHINT_TURN,max-current)
e:SetLabel(current,max)
end
end
function cm.thfilter(c)
return c:IsCode(96071091) and c:IsAbleToHand()
end
function cm.action(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
if Duel.ConfirmCards(1-tp,g) and dg:GetCount()>0 and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_TRAP)>=3
and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--dice
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local dice=Duel.TossDice(tp,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(dice*1)
c:RegisterEffect(e1)
end
end
--damage reduce
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:GetOwner()~=e:GetOwner()
and te:IsActiveType(TYPE_TRAP)
end
\ No newline at end of file
--侍神·森岭 鸩
local m=96071092--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x1009)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)--启动效果
e1:SetRange(LOCATION_PZONE)--灵摆区域
e1:SetCountLimit(1,m)--卡名次数限制
e1:SetTarget(cm.pentg)
e1:SetOperation(cm.penop)--效果处理
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.damcon)
e2:SetCost(cm.damcost)
e2:SetTarget(cm.damtg)
e2:SetOperation(cm.damop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--Count Down
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_DICE+CATEGORY_COUNTER)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetLabel(2)
e4:SetOperation(cm.cdop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
--Destroy(damage)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DESTROY)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e6:SetCode(EVENT_DESTROYED)
e6:SetCondition(cm.descon)
e6:SetOperation(cm.desop)
c:RegisterEffect(e6)
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_DESTROYED)
ge1:SetCondition(cm.regcon)
ge1:SetOperation(cm.regop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(cm.spcfilter,1,nil,0) then v=v+1 end
if eg:IsExists(cm.spcfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,e:GetLabel())
end
--Activate
function cm.penfilter(c,e,tp)
return c:IsSetCard(0xef1) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.penfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.penfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--damage
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local d=Duel.GetMatchingGroupCount(Card.IsSetCard,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,0xef1)*200
Duel.Damage(p,d,REASON_EFFECT)
end
--spsummon
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return ev==tp or ev==PLAYER_ALL
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,false,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 c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--Count Down
function cm.cdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,m)~=0 then return end
Duel.RegisterFlagEffect(tp,m,0,0,0)
local max=e:GetLabel()
c:SetHint(CHINT_TURN,max)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetLabel(0,max)
e1:SetCondition(cm.loopcon)
e1:SetOperation(cm.loopop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
end
--chain
function cm.loopcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and (bit.band(r,REASON_BATTLE)~=0 or (bit.band(r,REASON_EFFECT)~=0 and rp==1-tp))
end
function cm.loopop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local current,max=e:GetLabel()
current=current+1
if current>=max then
c:SetHint(CHINT_TURN,0)
Duel.Hint(HINT_CARD,0,m)
cm.action(e,tp,eg,ep,ev,re,r,rp)
c:SetHint(CHINT_TURN,max)
e:SetLabel(0,max)
else
c:SetHint(CHINT_TURN,max-current)
e:SetLabel(current,max)
end
end
function cm.action(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- 获取对方场上全部表侧怪兽
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
-- 批量处理指示物和效果
for tc in aux.Next(g) do
-- 放置毒指示物(使用0x1009作为标识)
tc:AddCounter(0x1009,1)
local origATK=tc:GetBaseAttack() -- 记录原始攻击力
-- 效果无效化系统(含双重锁定)
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)
-- 攻击禁止系统
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
-- 动态攻击力下降系统
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetValue(function(e)
return -500 * e:GetHandler():GetCounter(0x1009)
end)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
-- 破坏处理触发器
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ADJUST)
e5:SetLabel(origATK)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(function(e)
return e:GetHandler():GetAttack()<=0
and e:GetHandler():GetCounter(0x1009)>0
end)
e5:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local dam=e:GetLabel()
if Duel.Destroy(e:GetHandler(),REASON_EFFECT)>0 then
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
e:Reset()
end)
tc:RegisterEffect(e5)
end
end
--Destroy(damage)
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local dice=Duel.TossDice(tp,1)
if dice>0 then
local dam=dice*400
Duel.Damage(1-tp,dam,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
This diff is collapsed.
--文射之箭·无我
local m=96071098--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,2))
e0:SetType(EFFECT_TYPE_SINGLE)--自己状态变化时触发
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)--陷阱可以从手卡发动
e0:SetCondition(cm.handcon)--效果条件
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY)--伤害效果-破坏效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetCode(EVENT_FREE_CHAIN)--自由时点
e1:SetCost(cm.descost)--cost代价
e1:SetTarget(cm.destg)--效果判定
e1:SetOperation(cm.desop)--效果处理
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤的效果
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)--诱发选发效果
e2:SetCode(EVENT_DESTROYED)--被破坏时
e2:SetProperty(EFFECT_FLAG_DELAY)--场合型诱发效果
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
--act in hand
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0xef1)
end
function cm.handcon(e)
return Duel.IsExistingMatchingCard(cm.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
--destroy
function cm.costfilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,0xe,1,nil) end
Duel.SetTargetPlayer(1-tp)
local dam=Duel.GetFieldGroupCount(1-tp,0xe,0)*200
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
if chk==0 then return c:IsDestructable() and cg:GetCount()>0 end
cg:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,cg,cg:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetFieldGroupCount(1-tp,0xe,0)*200
Duel.Damage(p,dam,REASON_EFFECT)
local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 and cg:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(cg,REASON_EFFECT)
end
end
--search
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_SZONE)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xef1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--萤光闪烁
local m=96071099--卡密编号
local set=0x3ef1--侍神·森岭字段
local cm=_G["c"..m]
function cm.initial_effect(c)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,2))
e0:SetType(EFFECT_TYPE_SINGLE)--自己状态变化时触发
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)--陷阱可以从手卡发动
e0:SetCondition(cm.handcon)--效果条件
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER+CATEGORY_SEARCH)--伤害效果+回复效果+检索卡组效果
e1:SetType(EFFECT_TYPE_ACTIVATE)--魔陷发动
e1:SetCode(EVENT_DAMAGE)--造成战斗/效果伤害时
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)--可以再伤害步骤发动+可以再伤害计算时发动
e1:SetTarget(cm.target)--效果判定
e1:SetOperation(cm.operation)--效果处理
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_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_DECK)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
--act in hand
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM)
end
function cm.handcon(e)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_EXTRA,0,nil)
return g:GetClassCount(Card.GetCode)>=1
end
--Activate
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ev)
end
function cm.filter(c)
return c:IsSetCard(0xef1) and c:IsAbleToHand()
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT,true)
Duel.Damage(1-tp,ev,REASON_EFFECT,true)
Duel.RDComplete()
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--special summon
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE) and Duel.GetFieldGroupCount(e:GetHandler():GetControler(),LOCATION_HAND,0)<=2 and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetTargetPlayer(tp)
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ht<4 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,4-ht)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,ft,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ht<4 then
Duel.Draw(p,4-ht,REASON_EFFECT)
end
end
end
\ No newline at end of file
This diff is collapsed.
--雅乐之神 源博雅
local m=96071105--卡密编号
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)--灵摆属性
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)--破坏效果
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.descon)
e2:SetCost(cm.descost)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCountLimit(1,m+2)
e3:SetCost(cm.thcost)
e3:SetTarget(cm.thtarget)
e3:SetOperation(cm.thoperation)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)--含特殊召唤效果
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)--场上所有卡状态变化时触发+诱发选发效果
e4:SetCode(EVENT_CHAINING)--效果发动时
e4:SetRange(LOCATION_HAND)
e4:SetProperty(EFFECT_FLAG_DELAY)--场合诱发
e4:SetCountLimit(1,m+3)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
--cos
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,5))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)--自己状态变化时触发+诱发选发效果
e5:SetCode(EVENT_SUMMON_SUCCESS)--通常召唤成功时
e5:SetProperty(EFFECT_FLAG_DELAY)--场合型诱发效果
e5:SetTarget(cm.costg)
e5:SetOperation(cm.cosop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SPSUMMON_SUCCESS)--特殊召唤成功时
c:RegisterEffect(e6)
end
--atk
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0xef1)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_ONFIELD+LOCATION_EXTRA,0,nil)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT)
end
--Destroy
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--to hand
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,REASON_COST,true,e:GetHandler(),0xef1) end
local g=Duel.SelectReleaseGroupEx(tp,Card.IsSetCard,1,1,REASON_COST,true,e:GetHandler(),0xef1)
Duel.Release(g,REASON_COST)
end
function cm.thtarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return c:IsAbleToHand() and (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED))
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cm.exfilter(c)
return c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM) and c:IsAbleToExtra()
end
function cm.thoperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,c)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local teg=Duel.SelectMatchingCard(tp,cm.exfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
if teg:GetCount()>0 then
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.SendtoExtraP(teg,nil,REASON_EFFECT)
end
end
end
end
end
--spsummon
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
local te,p=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return te and te:GetHandler():IsSetCard(0xef1) and p==tp and rp==1-tp
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.IsPlayerCanDiscardDeck(tp,1) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xef1) and c:IsType(TYPE_PENDULUM)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.DiscardDeck(tp,1,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local ct=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_EXTRA,0,nil)
if ct>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
Duel.SpecialSummonComplete()
end
--cos
function cm.costg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(1-tp,nil,1,REASON_RULE,false,nil) end
end
function cm.cosop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectReleaseGroupEx(1-tp,nil,1,1,REASON_RULE,false,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Release(g,REASON_RULE,1-tp)
end
end
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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