Commit 615fff08 authored by Huangnan's avatar Huangnan

fix

parent 20d4a867
Pipeline #40695 failed with stages
in 5 minutes and 47 seconds
......@@ -41,7 +41,6 @@ function s.initial_effect(c)
end
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -80,9 +79,9 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.immval(e,te)
local res=te:IsActivated(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and te:GetOwner()~=e:GetHandler() and te:GetOwner():IsSetCard(0x6a7d)
local c=e:GetHandler()
local res=te:IsActivated(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and te:GetOwner()~=c and te:GetOwner():IsSetCard(0x6a7d)
if res then
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET-RESET_TOFIELD-RESET_LEAVE,0,1)
end
return false
......@@ -110,7 +109,8 @@ function s.op(e,tp,eg,ep,ev,re,r,rp)
if #g==0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.HintSelection(tg)
if #tg>0 and Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tg:GetFirst():IsLocation(LOCATION_DECK+LOCATION_EXTRA) and Duel.IsPlayerCanDiscardDeck(tp,2) then
if #tg>0 and Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tg:GetFirst():IsLocation(LOCATION_DECK+LOCATION_EXTRA)
and Duel.IsPlayerCanDiscardDeck(tp,1) then
Duel.BreakEffect()
Duel.DisableShuffleCheck()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
......@@ -118,12 +118,11 @@ function s.op(e,tp,eg,ep,ev,re,r,rp)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_MZONE and (rc:GetFlagEffect(id)>0 or rc:GetFlagEffect(id+o)>0) and rc:GetControler()==1-tp
local loc,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER)
return re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_MZONE and (rc:GetFlagEffect(id)>0 or rc:GetFlagEffect(id+o)>0) and p==1-tp
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if not rc:GetControler()==1-tp then return end
Duel.NegateEffect(ev)
if rc:GetFlagEffect(id+o)>0 then
rc:ResetFlagEffect(id+o)
......
--朔月黑塔
--
local cm,m,o=GetID()
function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
......@@ -82,12 +81,14 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.SelectMatchingCard(tp,cm.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
local xc=g2:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tg=sg:Select(tp,0,1,nil)
Duel.Overlay(xc,tg)
local fc=tg:GetFirst()
sg:RemoveCard(fc)
Duel.HintSelection(sg)
Duel.SendtoDeck(sg,nil,nil,REASON_EFFECT)
local tg=sg:Select(tp,1,1,nil)
if #tg>0 then
Duel.Overlay(xc,tg)
local fc=tg:GetFirst()
sg:RemoveCard(fc)
Duel.HintSelection(sg)
Duel.SendtoDeck(sg,nil,nil,REASON_EFFECT)
end
else
Duel.HintSelection(sg)
Duel.SendtoDeck(sg,nil,nil,REASON_EFFECT)
......
......@@ -163,7 +163,7 @@ function s.flaglabel(e,tp,eg,ep,ev,re,r,rp)
end
function s.recopOUT(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
local sg=Duel.Group(s.cfilter,tp,0,LOCATION_HAND,nil,1-tp)
local sg=eg:Filter(Card.IsLocation,nil,LOCATION_HAND):Filter(s.cfilter,nil,1-tp)
local g=Duel.Group(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,sg)
if #g==0 or not Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
Duel.SendtoDeck(sg,tp,SEQ_DECKTOP,REASON_EFFECT)
......
......@@ -2,7 +2,6 @@
local s,id,o=GetID()
s.MoJin=true
function s.initial_effect(c)
aux.AddCodeList(c,5012604)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
......@@ -45,7 +44,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsFacedown() and c.MoJin==true
return c:IsFacedown() and c.MoJin
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -82,10 +81,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.tdfilter(c)
return c:IsAbleToDeck() and c.MoJin==true
return c:IsAbleToDeck() and c.MoJin
end
function s.thfilter(c)
return c:IsAbleToHand() and c:IsFaceup() and c.MoJin==true
return c:IsAbleToHand() and c:IsFaceup() and c.MoJin
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
......
......@@ -2,7 +2,6 @@
local s,id,o=GetID()
s.MoJin=true
function s.initial_effect(c)
aux.AddCodeList(c,5012604)
c:SetSPSummonOnce(id)
--link summon
c:EnableReviveLimit()
......
--托尔
local s,id,o=GetID()
c5012621.MoJin=true
s.MoJin=true
function s.initial_effect(c)
aux.AddCodeList(c,5012604)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(1102)
......
......@@ -5,15 +5,16 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCost(cm.cost)
e2:SetDescription(aux.Stringid(m,1))
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
......@@ -33,22 +34,28 @@ function cm.initial_effect(c)
e5:SetCondition(cm.descon)
e5:SetOperation(cm.desop)
c:RegisterEffect(e5)
aux.RegisterMergedDelayedEvent(c,m,EVENT_TO_GRAVE)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cm.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_GRAVE) and c:IsControler(1-tp) and c:IsReason(REASON_EFFECT)
end
function cm.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) and c:IsReason(REASON_EFFECT)
function cm.spfilter(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
local mg=eg:Filter(cm.cfilter,nil,tp):Filter(cm.spfilter,nil,e,tp)
if chkc then return mg:IsContains(chkc) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and #mg>0 end
local g=mg
if #mg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=mg:Select(tp,1,1,nil)
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -59,7 +59,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabel(g:GetFirst():GetCode())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g then
......
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