Commit ee38b16f authored by POLYMER's avatar POLYMER

fix

parent a2bf35f1
......@@ -57,6 +57,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetCountLimit(1)
e2:SetLabel(c:GetFieldID())
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
if 1~=1 then
......@@ -71,7 +72,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=c:GetFieldID() then
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else
......
......@@ -57,6 +57,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetCountLimit(1)
e2:SetLabel(c:GetFieldID())
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
if 1~=1 then
......@@ -71,7 +72,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=c:GetFieldID() then
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else
......
......@@ -66,6 +66,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetCountLimit(1)
e2:SetLabel(c:GetFieldID())
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
if 1~=1 then
......@@ -80,7 +81,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=c:GetFieldID() then
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else
......
......@@ -90,6 +90,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetCountLimit(1)
e2:SetLabel(c:GetFieldID())
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
if 1~=1 then
......@@ -104,7 +105,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=c:GetFieldID() then
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else
......
......@@ -52,6 +52,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetCountLimit(1)
e2:SetLabel(c:GetFieldID())
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
if 1~=1 then
......@@ -66,7 +67,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=c:GetFieldID() then
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else
......
......@@ -53,6 +53,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetCountLimit(1)
e2:SetLabel(c:GetFieldID())
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
if 1~=1 then
......@@ -67,7 +68,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=c:GetFieldID() then
if c:GetFlagEffect(m)==0 or not c:IsLocation(LOCATION_HAND) or not c:IsPublic() or c:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else
......
......@@ -50,16 +50,16 @@ function cm.initial_effect(c)
if c:IsLocation(LOCATION_HAND) and e:GetCode()==EFFECT_PUBLIC and e:IsHasType(EFFECT_TYPE_SINGLE) and #extg>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.HintSelection(Group.FromCards(c))
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=extg:GetFirst()
if #extg>1 then tc=extg:Select(tp,1,1,nil):GetFirst() end
if tc then
Duel.Hint(HINT_CARD,0,m)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.ConfirmCards(1-tp,c)
_RegisterEffect(tc,e,bool)
local eid=_RegisterEffect(tc,e,bool)
Duel.Draw(tp,1,REASON_EFFECT)
return
return eid
end
end
end
......
......@@ -24,17 +24,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
--[[local ge0=Effect.CreateEffect(c)
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ge0:SetTargetRange(1,1)
ge0:SetOperation(cm.clear0)
Duel.RegisterEffect(ge0,0)--]]
ge0:SetTarget(cm.chktg)
ge0:SetOperation(cm.check0)
Duel.RegisterEffect(ge0,0)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.check0)
ge1:SetOperation(cm.check1)
Duel.RegisterEffect(ge1,0)
local ge5=Effect.CreateEffect(c)
ge5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -52,15 +53,28 @@ function cm.initial_effect(c)
ge6:SetLabelObject(cm[0])
end
end
local _IsCanBeSpecialSummoned=Card.IsCanBeSpecialSummoned
function cm.chktg(e,te,tp)
e:SetLabelObject(te)
return true
end
function cm.check0(e,tp,eg,ep,ev,re,r,rp)
local re=e:GetLabelObject()
local tg=re:GetTarget()
if tg then
local _IsCanBeSpecialSummoned=Card.IsCanBeSpecialSummoned
function Card.IsCanBeSpecialSummoned(c,e,st,...)
if st&SUMMON_TYPE_RITUAL>0 then cm[1]=true end
return _IsCanBeSpecialSummoned(c,e,st,...)
end
tg(e,tp,eg,ep,ev,re,r,rp,0)
--tg(e,tp,eg,ep,ev,re,r,rp,0)
--Card.IsCanBeSpecialSummoned=_IsCanBeSpecialSummoned
if cm[1] then cm[re]=true end
cm[1]=nil
end
end
function cm.check1(e,tp,eg,ep,ev,re,r,rp)
local tg=re:GetTarget()
if tg then
Card.IsCanBeSpecialSummoned=_IsCanBeSpecialSummoned
if cm[1] then cm[re]=true end
cm[1]=nil
......@@ -99,7 +113,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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 then
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local sg=Group.CreateGroup()
for tc in aux.Next(cm[0]) do
local con=tc.condition3
......@@ -109,6 +123,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if #sg==0 then return end
local tc=sg:Select(tp,1,1,nil):GetFirst()
tc.operation3(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
end
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -56,10 +56,10 @@ function cm.initial_effect(c)
KDlobal["Effects"]["c115002"]=e2
end
function cm.spfilter1(c,fc,tp)
return c:IsCode(15000351) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckAsCost() and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_GRAVE+LOCATION_MZONE,0,1,nil,fc,c:GetLocation())
return c:IsCode(15000351) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckOrExtraAsCost() and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_GRAVE+LOCATION_MZONE,0,1,nil,fc,c:GetLocation())
end
function cm.spfilter2(c,fc,loc)
return c:IsCode(115001) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckAsCost() and bit.band(loc,c:GetLocation())==0
return c:IsCode(115001) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToDeckOrExtraAsCost() and bit.band(loc,c:GetLocation())==0
end
function cm.spcon(e,c)
if c==nil then return true end
......
--飞球造物·胸寄生球
local m=13254072
local cm=_G["c"..m]
xpcall(function() dofile("expansions/script/tama.lua") end,function() dofile("script/tama.lua") end)
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_EQUIP)
......@@ -13,11 +12,10 @@ function cm.initial_effect(c)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetLabelObject(e2)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
......@@ -35,9 +33,9 @@ function cm.initial_effect(c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and aux.NegateEffectMonsterFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -87,20 +85,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(cm.tglimit)
tc:RegisterEffect(e1,true)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetRange(LOCATION_ONFIELD)
e1:SetLabelObject(e:GetLabelObject())
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1,true)
end
end
function cm.aclimit(e,re,tp)
return re==e:GetLabelObject()
end
function cm.tglimit(e,re,tp)
local rc=re:GetHandler()
return rc and rc:IsCode(e:GetLabel())
......
......@@ -41,7 +41,7 @@ function c60002008.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if (tc:IsSummonable(true,nil) or tc:IsMSetable(true,nil)) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(60002008,2)) then
if (tc:IsSummonable(true,nil) or tc:IsMSetable(true,nil)) and Duel.SelectYesNo(tp,aux.Stringid(60002008,2)) then
local s1=tc:IsSummonable(true,nil)
local s2=tc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
......
......@@ -39,15 +39,13 @@ function c60159945.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c60159945.spfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,c)>0
end
function c60159945.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c60159945.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c60159945.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c60159945.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,c60159945.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
......
......@@ -86,7 +86,7 @@ function c9910053.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
end
function c9910053.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and Duel.GetFlagEffect(tp,9910053)<2 and ep~=tp
return rp==1-tp and Duel.IsChainDisablable(ev) and Duel.GetFlagEffect(tp,9910053)<2
end
function c9910053.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,9910053)
......
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