Commit daad2c47 authored by POLYMER's avatar POLYMER

fix

parent e7a9b177
No preview for this file type
......@@ -49,6 +49,7 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge3,0)
end
end
s.has_text_type=TYPE_SPIRIT
function cm.MergedDelayEventCheck1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()<=0 or not eg then return end
local c=e:GetHandler()
......
......@@ -30,24 +30,52 @@ function cm.initial_effect(c)
e3:SetTarget(cm.sumtg1)
e3:SetOperation(cm.sumop1)
c:RegisterEffect(e3)
local e31=e3:Clone()
e31:SetCode(EVENT_CUSTOM+m+1)
c:RegisterEffect(e31)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(m,1))
e4:SetCondition(cm.sumcon2)
e4:SetTarget(cm.sumtg2)
e4:SetOperation(cm.sumop2)
c:RegisterEffect(e4)
local e41=e4:Clone()
e41:SetCode(EVENT_CUSTOM+m+1)
c:RegisterEffect(e41)
local e5=e3:Clone()
e5:SetDescription(aux.Stringid(m,2))
e5:SetCondition(cm.sumcon3)
e5:SetTarget(cm.sumtg)
e5:SetOperation(cm.sumop)
c:RegisterEffect(e5)
local e51=e5:Clone()
e51:SetCode(EVENT_CUSTOM+m+1)
c:RegisterEffect(e51)
local e6=e3:Clone()
e6:SetDescription(aux.Stringid(m,4))
c:RegisterEffect(e6)
local e61=e6:Clone()
e61:SetCode(EVENT_CUSTOM+m+1)
c:RegisterEffect(e61)
local e7=e4:Clone()
e7:SetDescription(aux.Stringid(m,4))
c:RegisterEffect(e7)
local e71=e7:Clone()
e71:SetCode(EVENT_CUSTOM+m+1)
c:RegisterEffect(e71)
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.filter(c)
return c:IsType(TYPE_FLIP) and c:IsAbleToHand()
......@@ -104,7 +132,7 @@ function cm.smfilter(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)<0 then return end
if Duel.Draw(tp,1,REASON_EFFECT)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.smfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
......@@ -127,7 +155,7 @@ function cm.sumtg1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.sumop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)<0 then return end
if Duel.Draw(tp,1,REASON_EFFECT)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,Card.IsSummonable,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,true,nil)
local tc=g:GetFirst()
......@@ -142,7 +170,7 @@ function cm.sumtg2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.sumop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)<0 then return end
if Duel.Draw(tp,1,REASON_EFFECT)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,Card.IsMSetable,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,true,nil)
local tc=g:GetFirst()
......
......@@ -22,17 +22,19 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,58538870) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,12143771) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,85936485)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)+Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)>=1 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)+Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)>=1 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end --and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local m=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if not og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then return end
local sg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,e,tp)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if m>0 and #sg>0 and ft>0 then
if #sg>0 and ft>0 then
if #sg<ft then ft=#sg end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -99,14 +99,14 @@ end
function cm.chkop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ref=c:GetReasonEffect()
if (c:IsReason(REASON_COST) or c:IsReason(REASON_MATERIAL)) and ref and ref:GetCode()==EFFECT_SPSUMMON_PROC and ref:GetHandler():IsRace(RACE_INSECT) then
if (c:IsReason(REASON_COST) or c:IsReason(REASON_MATERIAL) or c:IsReason(REASON_SPSUMMON)) and ref and ref:GetCode()==EFFECT_SPSUMMON_PROC and ref:GetHandler():IsRace(RACE_INSECT) then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,7))
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ref=c:GetReasonEffect()
return (c:IsReason(REASON_COST) or c:IsReason(REASON_MATERIAL)) and ref and ref:GetCode()==EFFECT_SPSUMMON_PROC and ref:GetHandler():IsRace(RACE_INSECT) and not c:IsPreviousLocation(LOCATION_REMOVED)
return (c:IsReason(REASON_COST) or c:IsReason(REASON_MATERIAL) or c:IsReason(REASON_SPSUMMON)) and ref and ref:GetCode()==EFFECT_SPSUMMON_PROC and ref:GetHandler():IsRace(RACE_INSECT) and not c:IsPreviousLocation(LOCATION_REMOVED)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
......
......@@ -275,6 +275,7 @@ function cm.erop(e,tp,eg,ep,ev,re,r,rp)
if #tg>0 then
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
local rg=Duel.GetDecktopGroup(tp,ct)
......
......@@ -156,7 +156,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=eg:FilterSelect(tp,cm.thfilter,1,1,nil,e)
if #g>0 then
......
--在此的印痕-
local m=11451684
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -18,6 +17,7 @@ function cm.initial_effect(c)
e2:SetOperation(cm.acop)
c:RegisterEffect(e2)
end
s.has_text_type=TYPE_DUAL
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) end
......
......@@ -193,7 +193,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g==0 then return end
local tc=g:GetFirst():GetEquipTarget()
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 and tc:IsFaceup() then
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsFaceup() then
local sg=Duel.GetMatchingGroup(cm.dfilter,tp,LOCATION_DECK,0,nil,tp)
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_SZONE) and not c:IsStatus(STATUS_LEAVE_CONFIRMED) then sg:AddCard(c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
......
......@@ -78,6 +78,8 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local sg2=g2:SelectSubGroup(1-tp,cm.fselect,false,1,3)
if Duel.SendtoDeck(sg1+sg2,nil,2,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK):IsExists(Card.IsControler,1,nil,tp) then Duel.ShuffleDeck(tp) end
if Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK):IsExists(Card.IsControler,1,nil,1-tp) then Duel.ShuffleDeck(1-tp) end
local ct1=#Group.__band(og,sg1)
local ct2=#Group.__band(og,sg2)
if ct1==0 and ct2==0 then return end
......
......@@ -159,8 +159,10 @@ end
function cm.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local lk=math.ceil(Duel.SendtoDeck(g,nil,2,REASON_EFFECT):FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)/2)
Debug.Message(lk)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local lk=math.ceil(og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)/2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
......
......@@ -82,6 +82,8 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
g=g:Filter(Card.IsAbleToDeck,nil)
if #g==0 then return end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
Duel.Draw(tp,ct,REASON_EFFECT)
else
......
......@@ -11,6 +11,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
s.has_text_type=TYPE_DUAL
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
......
......@@ -157,6 +157,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local ng=sg:Filter(Card.IsType,nil,TYPE_NORMAL)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
og=Group.__band(og,ng)
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
Duel.Draw(tp,ct,REASON_EFFECT)
......
......@@ -62,7 +62,7 @@ function cm.qop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) 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(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -67,7 +67,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
......
......@@ -87,7 +87,7 @@ function cm.tnop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
......
......@@ -98,7 +98,16 @@ function s.prop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,ca,tc)
ca:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
ca:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4))
......@@ -110,47 +119,21 @@ function s.prop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1)
e1:SetTarget(s.target0)
e1:SetOperation(s.prop0)
local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_SINGLE)
e00:SetCode(EFFECT_UPDATE_ATTACK)
e00:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_SINGLE)
e01:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetTarget(s.eftg)
e3:SetLabelObject(e1)
ca:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
e4:SetTarget(s.eftg)
e4:SetLabelObject(e00)
ca:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
e5:SetTarget(s.eftg)
e5:SetLabelObject(e01)
ca:RegisterEffect(e5)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
ca:RegisterEffect(e2)
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_EQUIP)
e20:SetCode(EFFECT_UPDATE_ATTACK)
e20:SetValue(500)
e20:SetReset(RESET_EVENT+RESETS_STANDARD)
ca:RegisterEffect(e20)
else
c:CancelToGrave(false)
end
......
......@@ -21,7 +21,7 @@ function s.initial_effect(c)
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CANNOT_NEGATE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(s.regop)
c:RegisterEffect(e2)
if not s.global_flag then
......@@ -106,7 +106,8 @@ function s.chainreg(e, tp, eg, ep, ev, re, r, rp)
e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + 0x1fc0000 + RESET_CHAIN, 0, 1)
end
function s.drcon(e, tp, eg, ep, ev, re, r, rp)
return ep ~= tp and e:GetHandler():GetFlagEffect(id) ~= 0
local c=e:GetHandler()
return Duel.GetTurnPlayer()~=tp and c:IsPreviousControler(tp) and rp==1-tp and e:GetHandler():GetFlagEffect(id) ~= 0
end
function s.drop(e, tp, eg, ep, ev, re, r, rp)
Duel.Hint(HINT_CARD, 0, id)
......
......@@ -2,10 +2,10 @@
local cm,m=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,34022290)
aux.AddCodeList(c,34022290)
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,34022290,18175965,true,true)
--special summon rule
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
......@@ -15,48 +15,48 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sprtg)
e2:SetOperation(cm.sprop)
c:RegisterEffect(e2)
--equip
--equip
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_EQUIP)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(cm.eqtg)
e5:SetOperation(cm.eqop)
c:RegisterEffect(e5)
--
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(0x04)
e4:SetCountLimit(1)
e4:SetCondition(cm.tgcon)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(0x04)
e4:SetCountLimit(1)
e4:SetCondition(cm.tgcon)
e4:SetTarget(cm.tgtg)
e4:SetOperation(cm.tgop)
c:RegisterEffect(e4)
--
--
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(0x14)
e3:SetCondition(cm.tdcon)
e3:SetCost(cm.tdcost)
e3:SetRange(0x14)
e3:SetCondition(cm.tdcon)
e3:SetCost(cm.tdcost)
e3:SetTarget(cm.tdtg)
e3:SetOperation(cm.tdop)
c:RegisterEffect(e3)
end
function cm.sprfilter(c)
return not c:IsPublic() and c:IsSetCard(0x52) and c:IsType(0x1) and c:IsLevelBelow(5)
return not c:IsPublic() and c:IsSetCard(0x52) and c:IsType(0x1) and c:IsLevelBelow(5)
end
function cm.sprcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(cm.sprfilter,c:GetControler(),0x02,0,1,nil)
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsExistingMatchingCard(cm.sprfilter,c:GetControler(),0x02,0,1,nil)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp)
......@@ -68,11 +68,11 @@ end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local tc=e:GetLabelObject()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,tc:GetFieldID(),66)
end
......@@ -106,7 +106,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.contfilter(c)
return c:IsPreviousLocation(0x0c) and c:GetPreviousTypeOnField()&TYPE_EQUIP~=0
return c:IsPreviousLocation(0x0c) and c:GetPreviousTypeOnField()&TYPE_EQUIP~=0
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -114,11 +114,11 @@ function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgfilter2(c,tc)
return c:IsFaceup() and tc:CheckEquipTarget(c)
return c:IsFaceup() and tc:CheckEquipTarget(c)
end
function cm.tgfilter(c,tp)
return c:GetType()==0x40002 and c:CheckUniqueOnField(tp) and not c:IsForbidden() and Duel.IsExistingMatchingCard(cm.tgfilter2,tp,0x04,0,1,nil,c)
return c:GetType()==0x40002 and c:CheckUniqueOnField(tp) and not c:IsForbidden() and Duel.IsExistingMatchingCard(cm.tgfilter2,tp,0x04,0,1,nil,c)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -128,14 +128,14 @@ end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tgfilter),tp,0x10,0,1,1,nil,tp):GetFirst()
if tc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local ec=Duel.SelectMatchingCard(tp,cm.tgfilter2,tp,0x04,0,1,1,nil,tc):GetFirst()
if ec and Duel.Equip(tp,tc,ec) then
--送去墓地时效果适用
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local ec=Duel.SelectMatchingCard(tp,cm.tgfilter2,tp,0x04,0,1,1,nil,tc):GetFirst()
if ec and Duel.Equip(tp,tc,ec) then
--送去墓地时效果适用
local Equip_table_effect=cm.geteffect(tc)
if #Equip_table_effect==1 then
local effect=table.unpack(Equip_table_effect)
......@@ -256,13 +256,13 @@ function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local c=e:GetHandler()
if chk==0 then return c:IsAbleToExtraAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
end
function cm.tgtfilter(c)
return c:IsCode(18175965) and c:IsAbleToHand()
return c:IsCode(18175965) and c:IsAbleToHand()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -274,7 +274,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgtfilter,tp,0x01,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
......@@ -51,7 +51,7 @@ function c65850005.rmop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.IsExistingMatchingCard(c65850005.filter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(65850005,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c65850005.setfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c65850005.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
......
......@@ -43,19 +43,29 @@ end
function c67200350.filter(c,atk)
return c:IsType(TYPE_PENDULUM) and c:IsAttackBelow(atk)
end
function c67200350.cfilter(c,tp)
return c:IsFaceup() and c:IsSummonPlayer(1-tp)
end
function c67200350.tgfilter(c,tp,g)
return g:IsContains(c) and Duel.IsExistingMatchingCard(c67200350.filter,tp,LOCATION_DECK,0,1,nil,c:GetAttack())
end
function c67200350.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if not eg then return false end
local tc=eg:GetFirst()
local atk=tc:GetAttack()
if chkc then return chkc==tc end
if chk==0 then return ep~=tp and tc:IsFaceup() and tc:IsOnField() and tc:IsCanBeEffectTarget(e) and Duel.IsExistingMatchingCard(c67200350.filter,tp,LOCATION_DECK,0,1,nil,atk) end
Duel.SetTargetCard(eg)
local g=eg:Filter(c67200350.cfilter,nil,tp)
--local atk=tc:GetAttack()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c67200350.tgfilter(chkc,tp,g) end
if chk==0 then return Duel.IsExistingTarget(c67200350.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp,g) end
if g:GetCount()==1 then
Duel.SetTargetCard(g)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c67200350.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp,g)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,eg,1,0,0)
end
function c67200350.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
local tc=Duel.GetFirstTarget()
local atk=tc:GetAttack()
if not c:IsRelateToEffect(e) then return end
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
......
--女儿的加护
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetCondition(c98346619.actcon)
e1:SetTarget(c98346619.acttg)
e1:SetOperation(c98346619.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(c98346619.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c98346619.desop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_TARGET)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_SZONE)
c:RegisterEffect(e4)
--attackchange
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_ATTACK_FINAL)
e5:SetValue(0)
c:RegisterEffect(e5)
--indes
e6=e5:Clone()
e6:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e6:SetValue(1)
c:RegisterEffect(e6)
--immune effect
e7=e6:Clone()
e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetValue(c98346619.efilter)
c:RegisterEffect(e7)
--draw
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(id,0))
e8:SetCategory(CATEGORY_DRAW)
e8:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetCode(EVENT_TO_GRAVE)
e8:SetCountLimit(1,id)
e8:SetCondition(c98346619.drcon)
e8:SetTarget(c98346619.drtg)
e8:SetOperation(c98346619.drop)
c:RegisterEffect(e8)
end
function c98346619.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xaf7)
end
function c98346619.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c98346619.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c98346619.actfilter(c)
return c:IsFaceup() and c:IsAttackPos()
end
function c98346619.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c98346619.actfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c98346619.actfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK)
Duel.SelectTarget(tp,c98346619.actfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c98346619.activate(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
c:SetCardTarget(tc)
end
end
function c98346619.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c98346619.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c98346619.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c98346619.drcon(e,tp,eg,ep,ev,re,r,rp)
local loc=e:GetHandler():GetPreviousLocation()
return loc&(LOCATION_HAND|LOCATION_DECK)==0
end
function c98346619.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c98346619.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
......@@ -7,11 +7,11 @@ function c9910732.initial_effect(c)
--flag
QutryYgzw.AddTgFlag(c)
--set other monster
local costom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,9910732,EVENT_SPSUMMON_SUCCESS)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9910732,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+9910732)
e1:SetCode(costom_code)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,9910732)
......@@ -19,7 +19,6 @@ function c9910732.initial_effect(c)
e1:SetTarget(c9910732.somtg)
e1:SetOperation(c9910732.somop)
c:RegisterEffect(e1)
aux.RegisterMergedDelayedEvent(c,9910732,EVENT_SPSUMMON_SUCCESS)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
......
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