Commit e7a9b177 authored by POLYMER's avatar POLYMER

fix

parent b9f71f49
function c10111134.initial_effect(c)
--魔心英雄 恶灭魔
local m=10111134
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,10111128)
--remove
--特殊召唤
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111134,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,10111134)
e1:SetTarget(c10111134.rmtg)
e1:SetOperation(c10111134.rmop)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
--暂时除外+攻击力上升
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10111134,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101111340)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c10111134.thtg)
e2:SetOperation(c10111134.thop)
e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
--special summon
--卡组检索
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10111134,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_HAND)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101111341)
e3:SetCondition(c10111134.spcon)
e3:SetTarget(c10111134.sptg)
e3:SetOperation(c10111134.spop)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function c10111134.rmfilter(c)
end
----------------------------------------------------------------
function cm.filter(c,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER)
and c:IsControler(tp) and not c:IsCode(m)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,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 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)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
----------------------------------------------------------------
function cm.rmfilter(c)
return c:IsFacedown() and c:IsAbleToRemove()
end
function c10111134.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10111134.rmfilter,tp,0,LOCATION_EXTRA,1,nil) end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function c10111134.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c10111134.rmfilter,tp,0,LOCATION_EXTRA,nil)
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,0,LOCATION_EXTRA,nil)
if g:GetCount()==0 then return end
Duel.ShuffleExtra(1-tp)
local tc=g:RandomSelect(tp,1):GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
Duel.ShuffleExtra(1-tp)
local atk=tc:GetAttack()
local c=e:GetHandler()
local og2=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local tc=og2:GetFirst()
while tc do
tc:RegisterFlagEffect(10111134,RESET_EVENT+RESETS_STANDARD,0,1)
tc=og2:GetNext()
if atk<0 then atk=0 end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
og2:KeepAlive()
local fid=c:GetFieldID()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk/2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(atk/2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e2:SetLabelObject(og2)
e2:SetCountLimit(1)
e2:SetCondition(c10111134.retcon)
e2:SetOperation(c10111134.retop)
Duel.RegisterEffect(e2,tp)
end
c:RegisterEffect(e2)
end
function c10111134.retfilter(c)
return c:GetFlagEffect(10111134)~=0
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function c10111134.retcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c10111134.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c10111134.retfilter,nil,e:GetLabel())
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
g:DeleteGroup()
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
function c10111134.thfilter(c)
return aux.IsCodeOrListed(c,10111128) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
-----------------------------------------------------------------------------------
function cm.thfilter(c)
return aux.IsCodeListed(c,10111128) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c10111134.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10111134.thfilter,tp,LOCATION_DECK,0,1,nil) end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10111134.thop(e,tp,eg,ep,ev,re,r,rp)
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10111134.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c10111134.cfilter(c,tp)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsCode(10111134) and c:IsControler(tp)
end
function c10111134.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10111134.cfilter,1,nil,tp)
end
function c10111134.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 c10111134.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
\ No newline at end of file
function c10111137.initial_effect(c)
--魔心英雄 教义魔
local m=10111137
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,10111128)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c10111137.ffilter,3,true)
local e0=Effect.CreateEffect(c)
aux.AddFusionProcFunRep(c,cm.ffilter,3,true)
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(c10111137.splimit)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--lp
--lp
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,10111137)
e1:SetCondition(c10111137.thcon1)
e1:SetOperation(c10111137.lpop)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) end)
e1:SetOperation(cm.lpop)
c:RegisterEffect(e1)
--look
--look
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10111137,0))
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101111370)
e2:SetCondition(c10111137.drcon)
e2:SetTarget(c10111137.tgtg)
e2:SetOperation(c10111137.tgop)
e2:SetCondition(cm.tgcon)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c10111137.reptg)
e3:SetValue(c10111137.repval)
e3:SetTarget(cm.reptg)
e3:SetValue(cm.repval)
c:RegisterEffect(e3)
end
function c10111137.splimit(e,se,sp,st)
local sc=se:GetHandler()
return sc:IsCode(10111128)
end
function c10111137.ffilter(c,fc,sub,mg,sg)
-------------------------------------------------
function cm.ffilter(c,fc,sub,mg,sg)
return c:IsFusionSetCard(0x8) and c:IsLevelAbove(6) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c10111137.thcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
-------------------------------------------------
function cm.splimit(e,se,sp,st)
local sc=se:GetHandler()
return sc:IsCode(10111128)
end
function c10111137.lpop(e,tp,eg,ep,ev,re,r,rp)
-------------------------------------------------
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end
function c10111137.drcon(e,tp,eg,ep,ev,re,r,rp)
-------------------------------------------------
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc~=e:GetHandler() and tc:IsSummonType(SUMMON_TYPE_FUSION) and tc:IsSummonPlayer(tp)
and tc:IsSetCard(0x8)
return eg:GetCount()==1 and tc~=e:GetHandler() and tc:IsSummonPlayer(tp)
and tc:IsSetCard(0x8) and tc:IsSummonType(SUMMON_TYPE_FUSION)
end
function c10111137.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,PLAYER_ALL,LOCATION_EXTRA)
end
function c10111137.tgop(e,tp,eg,ep,ev,re,r,rp)
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
......@@ -89,23 +94,24 @@ function c10111137.tgop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c10111137.repfilter(c,tp)
-------------------------------------------------
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x8) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c10111137.rmfilter(c)
function cm.rmfilter(c)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c10111137.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c10111137.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c10111137.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c10111137.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
return true
end
return false
end
function c10111137.repval(e,c)
return c10111137.repfilter(c,e:GetHandlerPlayer())
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
\ No newline at end of file
......@@ -30,6 +30,8 @@ function cm.initial_effect(c)
e3:SetValue(function(e,c) local res=c:GetFlagEffect(m)>0 c:ResetFlagEffect(m) return res end)
Duel.RegisterEffect(e3,0)
local _MoveToField=Duel.MoveToField
local _IsCanOverlay=Card.IsCanOverlay
local _Overlay=Duel.Overlay
local _Equip=Duel.Equip
function Duel.MoveToField(c,tp,...)
if c:IsLocation(LOCATION_EXTRA) and c:IsHasEffect(m) then
......@@ -40,6 +42,33 @@ function cm.initial_effect(c)
end
return _MoveToField(c,tp,...)
end
function Card.IsCanOverlay(c,...)
local tp=c:GetPreviousControler()
if c:IsLocation(LOCATION_EXTRA) and c:IsHasEffect(m) then
return false
elseif c:IsLocation(LOCATION_EXTRA) and c:GetOriginalCode()==m then
if not cm.spcost(nil,nil,tp,c) then return false end
end
return _IsCanOverlay(c,...)
end
function Duel.Overlay(xc,v,...)
local t=Auxiliary.GetValueType(v)
local g=Group.CreateGroup()
if t=="Card" then g:AddCard(v) else g=v end
for c in aux.Next(g) do
local tp=c:GetPreviousControler()
if c:IsLocation(LOCATION_EXTRA) and c:IsHasEffect(m) then
g:RemoveCard(c)
elseif c:IsLocation(LOCATION_EXTRA) and c:GetOriginalCode()==m then
if not cm.spcost(nil,nil,tp,c) then
g:RemoveCard(c)
else
cm.spcop(nil,tp,nil,nil,nil,nil,nil,nil,c)
end
end
end
return _Overlay(xc,g,...)
end
function Duel.Equip(tp,c,mc,...)
if c:IsLocation(LOCATION_EXTRA) and c:IsHasEffect(m) then
return false
......
......@@ -56,7 +56,7 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_ONFIELD,0,3,3,nil)
Duel.SendtoGrave(g,REASON_COST)
Duel.SendtoGrave(g,REASON_SPSUMMON)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_SPELL
......@@ -75,6 +75,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
if #g==0 then return end
local tc=g:GetFirst()
if c:IsRelateToEffect(e) and tc==c then c:CancelToGrave() end
if tc:IsOnField() then Duel.HintSelection(Group.FromCards(tc)) end
if Duel.SendtoHand(tc,1-tp,REASON_EFFECT)>0 then
if tc:IsPreviousLocation(LOCATION_HAND) then Duel.ShuffleHand(tp) end
if not tc:IsLocation(LOCATION_HAND+LOCATION_EXTRA) or not tc:IsControler(1-tp) then return end
......
......@@ -17,6 +17,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
cm.hand_effect=cm.hand_effect or {}
cm.hand_effect[c]=e1
local e6=e1:Clone()
e6:SetCode(EVENT_CUSTOM+m+1)
e6:SetCondition(aux.TRUE)
c:RegisterEffect(e6)
--shuffle
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11451416,1))
......@@ -29,6 +33,19 @@ function cm.initial_effect(c)
e2:SetTarget(cm.shtg)
e2:SetOperation(cm.shop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local _Overlay=Duel.Overlay
function Duel.Overlay(xc,v,...)
local t=Auxiliary.GetValueType(v)
local g=Group.CreateGroup()
if t=="Card" then g:AddCard(v) else g=v end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.RaiseEvent(g:Filter(Card.IsLocation,nil,LOCATION_DECK),EVENT_CUSTOM+m+1,e,0,0,0,0)
end
return _Overlay(xc,v,...)
end
end
end
function cm.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and not (c:IsLocation(LOCATION_DECK) and c:IsControler(tp))
......@@ -140,10 +157,10 @@ function cm.clfilter(c,tp,seq)
return aux.GetColumn(c,tp)==seq
end
function cm.filter2(c,e)
return (c:IsPosition(POS_FACEDOWN_DEFENSE) or c:IsCanTurnSet()) and c:GetSequence()<=4 and not c:IsImmuneToEffect(e) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
return (c:IsPosition(POS_FACEDOWN_DEFENSE) or c:IsCanTurnSet()) and c:GetSequence()<=4 and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.ctfilter(c,e)
return (c:IsPosition(POS_FACEDOWN_DEFENSE) or c:IsCanTurnSet()) and c:IsControlerCanBeChanged() and not c:IsImmuneToEffect(e) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
return (c:IsPosition(POS_FACEDOWN_DEFENSE) or c:IsCanTurnSet()) and c:IsControlerCanBeChanged() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.mzfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() and c:IsControler(tp) and c:GetSequence()<=4
......
......@@ -26,6 +26,10 @@ function cm.initial_effect(c)
e1:SetCondition(cm.condition1)
e1:SetOperation(cm.operation1)
c:RegisterEffect(e1)
local e10=e1:Clone()
e10:SetCode(EVENT_CUSTOM+m+1)
e10:SetCondition(aux.TRUE)
c:RegisterEffect(e10)
--hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m+2,0))
......@@ -36,6 +40,10 @@ function cm.initial_effect(c)
e2:SetCondition(cm.condition2)
e2:SetOperation(cm.operation2)
c:RegisterEffect(e2)
local e20=e2:Clone()
e20:SetCode(EVENT_CUSTOM+m+2)
e20:SetCondition(aux.TRUE)
c:RegisterEffect(e20)
--mzone
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m+3,0))
......@@ -101,6 +109,22 @@ function cm.initial_effect(c)
e9:SetTargetRange(1,0)
e9:SetValue(cm.actlimit)
c:RegisterEffect(e9)
if not cm.global_check then
cm.global_check=true
local _Overlay=Duel.Overlay
function Duel.Overlay(xc,v,...)
local t=Auxiliary.GetValueType(v)
local g=Group.CreateGroup()
if t=="Card" then g:AddCard(v) else g=v end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.RaiseEvent(g:Filter(Card.IsLocation,nil,LOCATION_DECK),EVENT_CUSTOM+m+1,e,0,0,0,0)
end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
Duel.RaiseEvent(g:Filter(Card.IsLocation,nil,LOCATION_HAND),EVENT_CUSTOM+m+2,e,0,0,0,0)
end
return _Overlay(xc,v,...)
end
end
end
function cm.condition0(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
......
......@@ -55,6 +55,19 @@ function cm.initial_effect(c)
e6:SetTargetRange(0,LOCATION_MZONE)
e6:SetTarget(cm.distg2)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
local _Overlay=Duel.Overlay
function Duel.Overlay(xc,v,...)
local t=Auxiliary.GetValueType(v)
local g=Group.CreateGroup()
if t=="Card" then g:AddCard(v) else g=v end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
Duel.RaiseEvent(g:Filter(Card.IsLocation,nil,LOCATION_HAND),EVENT_CUSTOM+m+1,e,0,0,0,0)
end
return _Overlay(xc,v,...)
end
end
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500) end
......@@ -138,11 +151,21 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CLIENT_HINT)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetLabel(loc)
e1:SetCondition(cm.descon)
e1:SetCost(cm.descost)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
if sid==1 then
e1:SetCondition(cm.descon)
local e6=e1:Clone()
e6:SetCode(EVENT_CUSTOM+m+1)
e6:SetCondition(aux.TRUE)
c:RegisterEffect(e6)
elseif sid==2 then
e1:SetCode(EVENT_LEAVE_FIELD)
else
e1:SetCode(EVENT_LEAVE_GRAVE)
end
c:RegisterEffect(e1)
end
end
......@@ -151,7 +174,7 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter2,1,nil,loc)
end
function cm.spfilter2(c,loc)
return not c:IsLocation(loc) and c:IsPreviousLocation(loc)
return c:IsPreviousLocation(loc) and not (c:IsLocation(loc) and c:IsControler(c:GetPreviousControler()))
end
function cm.distg(e,c)
return c:IsFacedown()
......
......@@ -91,6 +91,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetDecktopGroup(tp,1)
if not g or #g==0 then return end
g:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM)
g:AddCard(c)
if Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
......@@ -83,7 +83,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,tc,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then
local e1=Effect.CreateEffect(tg:GetFirst())
e1:SetDescription(aux.Stringid(tg:GetFirst():GetOriginalCode(),7))
......@@ -107,7 +107,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,tc,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then
local e1=Effect.CreateEffect(tg:GetFirst())
e1:SetDescription(aux.Stringid(tg:GetFirst():GetOriginalCode(),7))
......
......@@ -83,7 +83,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,tc,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then
local e1=Effect.CreateEffect(tg:GetFirst())
e1:SetDescription(aux.Stringid(tg:GetFirst():GetOriginalCode(),7))
......@@ -107,7 +107,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,tc,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then
local e1=Effect.CreateEffect(tg:GetFirst())
e1:SetDescription(aux.Stringid(tg:GetFirst():GetOriginalCode(),7))
......
......@@ -82,7 +82,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,tc,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then
local e1=Effect.CreateEffect(tg:GetFirst())
e1:SetDescription(aux.Stringid(tg:GetFirst():GetOriginalCode(),7))
......@@ -106,7 +106,7 @@ function cm.initial_effect(c)
local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,1,1,nil)
local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,tc,nil,tp,tc):CancelableSelect(tp,1,1,nil)
if tg and #tg>0 then
local e1=Effect.CreateEffect(tg:GetFirst())
e1:SetDescription(aux.Stringid(tg:GetFirst():GetOriginalCode(),7))
......
......@@ -51,8 +51,22 @@ function cm.initial_effect(c)
e5:SetCondition(cm.sumcon3)
e5:SetOperation(cm.sumop)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EVENT_CUSTOM+m+1)
e6:SetCondition(aux.TRUE)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
local _Overlay=Duel.Overlay
function Duel.Overlay(xc,v,...)
local t=Auxiliary.GetValueType(v)
local g=Group.CreateGroup()
if t=="Card" then g:AddCard(v) else g=v end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
Duel.RaiseEvent(g:Filter(Card.IsLocation,nil,LOCATION_HAND),EVENT_CUSTOM+m+1,e,0,0,0,0)
end
return _Overlay(xc,v,...)
end
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_ACTIVATING)
......
......@@ -27,6 +27,10 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_LEAVE_GRAVE)
e4:SetCondition(aux.TRUE)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EVENT_CUSTOM+m+1)
e5:SetCondition(aux.TRUE)
c:RegisterEffect(e5)
if not cm.global_check then
cm.global_check=true
cm[0]={}
......@@ -41,6 +45,16 @@ function cm.initial_effect(c)
ge2:SetCode(EVENT_LEAVE_GRAVE)
ge2:SetOperation(cm.chkop2)
Duel.RegisterEffect(ge2,0)
local _Overlay=Duel.Overlay
function Duel.Overlay(xc,v,...)
local t=Auxiliary.GetValueType(v)
local g=Group.CreateGroup()
if t=="Card" then g:AddCard(v) else g=v end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.RaiseEvent(g:Filter(Card.IsLocation,nil,LOCATION_DECK),EVENT_CUSTOM+m+1,e,0,0,0,0)
end
return _Overlay(xc,v,...)
end
end
if not cm.global_check2 then
cm.global_check2=true
......
......@@ -172,7 +172,7 @@ function c21185825.op(e,tp,eg,ep,ev,re,r,rp)
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetProperty(0x1002000)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......@@ -182,7 +182,7 @@ function c21185825.op(e,tp,eg,ep,ev,re,r,rp)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetProperty(0x1000000+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(-math.ceil(atk/2))
......
......@@ -6,7 +6,7 @@ function cm.initial_effect(c)
aux.AddCodeList(c,53718002)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_TOGRAVE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
......
......@@ -6,13 +6,13 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x11e0)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK+LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(s.cost)
c:RegisterEffect(e2)
local e3=SNNM.Act(c,e2)
e3:SetRange(LOCATION_DECK+LOCATION_GRAVE)
......
......@@ -10,7 +10,7 @@ function s.initial_effect(c)
c:RegisterEffect(e0)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
......
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