Commit df618492 authored by Huangnan's avatar Huangnan

fix

parent 54892714
No preview for this file type
......@@ -17,6 +17,7 @@ function c17033090.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_MOVE)
e2:SetCountLimit(3,id)
e2:SetOperation(s.recop)
c:RegisterEffect(e2)
--
......
--冥府的女主人·奈芙缇丝
local cm,m,o=GetID()
function cm.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--n
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(cm.con)
e1:SetOperation(cm.op)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
s.effect_record={}
end
end
cm.SetCard_XdMcy=true
if not cm.nzr_change_operation then
cm.nzr_change_operation=true
cm._set_code=Effect.SetCode
Effect.SetCode=function (e,code,...)
if (code==EFFECT_CANNOT_REMOVE or code==EFFECT_CANNOT_TO_DECK or code==EFFECT_CANNOT_TO_GRAVE or code==EFFECT_CANNOT_TO_GRAVE_AS_COST) and Duel.GetFlagEffect(tp,m)~=0 then
cm._set_code(e,nil,...)
else
cm._set_code(e,code,...)
--检查表中是否存在元素
function s.checkintab(tab,v)
for _,ve in ipairs(tab) do
if ve==v then
return true
end
end
return false
end
function cm.chainlm(e,rp,tp)
return tp==rp
--检查是否有限制效果存在
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
and (Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_TO_GRAVE)
or Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_REMOVE)
or Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_TO_DECK))
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return (rc.SetCard_XdMcy) and rc:IsControler(tp) and not rc:IsCode(m)
--展示手卡作为cost
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
--主要操作
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.Hint(HINT_CARD,tp,m)
Duel.SetChainLimit(cm.chainlm)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.SendtoGrave(c,REASON_COST)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local sg=g:Filter(cm.filter,nil,g)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
--处理"不能送去墓地"效果
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_TO_GRAVE) then
local effect_record={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_TO_GRAVE)}
for _,ke in ipairs(effect_record) do
if not s.checkintab(s.effect_record,ke) then
local old_con=ke:GetCondition()
ke:SetCondition(function(ce,ctp,...)
return not Duel.IsPlayerAffectedByEffect(ctp,id) and (not old_con or old_con(ce,ctp,...))
end)
table.insert(s.effect_record,ke)
end
end
end
end
function cm.filter(c,g)
return c:GetSequence()==(#g-1)
end
--处理"不能被除外"效果
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_REMOVE) then
local effect_record={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_REMOVE)}
for _,ke in ipairs(effect_record) do
if not s.checkintab(s.effect_record,ke) then
local old_con=ke:GetCondition()
ke:SetCondition(function(ce,ctp,...)
return not Duel.IsPlayerAffectedByEffect(ctp,id) and (not old_con or old_con(ce,ctp,...))
end)
table.insert(s.effect_record,ke)
end
end
end
--处理"不能回到卡组"效果
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_TO_DECK) then
local effect_record={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_TO_DECK)}
for _,ke in ipairs(effect_record) do
if not s.checkintab(s.effect_record,ke) then
local old_con=ke:GetCondition()
ke:SetCondition(function(ce,ctp,...)
return not Duel.IsPlayerAffectedByEffect(ctp,id) and (not old_con or old_con(ce,ctp,...))
end)
table.insert(s.effect_record,ke)
end
end
end
--注册效果豁免标记
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(id)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--防止连锁
Duel.SetChainLimit(function(e,ep,tp)
return ep==tp
end)
--送去墓地并除外卡组顶牌
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
local g=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
\ No newline at end of file
......@@ -1216,6 +1216,7 @@
#AIC 2770356815 610 0x7c0-0x7cf
!setname 0x37c0 火取
!setname 0x97c0 狂剑
!setname 0x57c0 义侠
#星夜流云 3039056274 612 0x480-0x48f
!setname 0x3480 云轮
......
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