Commit 75db966b authored by Nemo Ma's avatar Nemo Ma

fix

parent 236e31cc
...@@ -97,11 +97,8 @@ function cm.initial_effect(c) ...@@ -97,11 +97,8 @@ function cm.initial_effect(c)
local og=oc:GetOverlayGroup() local og=oc:GetOverlayGroup()
og=og:Select(sp,min,max,nil) og=og:Select(sp,min,max,nil)
local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT) local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local dc=og:GetFirst()
local c=nil
if dc then c=dc:GetOverlayTarget() end
local ct=Duel.SendtoGrave(og,r) local ct=Duel.SendtoGrave(og,r)
if c and e then Duel.RaiseSingleEvent(c,EVENT_DETACH_MATERIAL,e,0,0,0,0) end if ct>0 and e then Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0) end
return ct return ct
else else
return _CRemoveOverlayCard(oc,sp,min,max,r) return _CRemoveOverlayCard(oc,sp,min,max,r)
...@@ -181,7 +178,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -181,7 +178,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local ct2=Duel.GetFlagEffectLabel(1-tp,m) local ct2=Duel.GetFlagEffectLabel(1-tp,m)
if not ct1 or not ct2 or (ct1==0 and ct2==0) then return end if not ct1 or not ct2 or (ct1==0 and ct2==0) then return end
if not cm.r then if not cm.r then
local result=0 --[[local result=0
local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(2,8) local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(2,8)
local ct={} local ct={}
local c=g:GetFirst() local c=g:GetFirst()
...@@ -193,7 +190,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -193,7 +190,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
result=result+(ct[g:RandomSelect(2,1):GetFirst()]<<(3*i)) result=result+(ct[g:RandomSelect(2,1):GetFirst()]<<(3*i))
end end
g:DeleteGroup() g:DeleteGroup()
cm.r=result&0xffffffff cm.r=result&0xffffffff--]]
cm.r=Duel.GetFieldGroup(0,LOCATION_DECK+LOCATION_HAND,LOCATION_DECK+LOCATION_EXTRA):GetSum(Card.GetCode)
end end
local g1=Group.CreateGroup() local g1=Group.CreateGroup()
local g2=Group.CreateGroup() local g2=Group.CreateGroup()
...@@ -248,7 +246,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -248,7 +246,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
g1:AddCard(Duel.CreateToken(tp,tab1[i])) g1:AddCard(Duel.CreateToken(tp,tab1[i]))
end end
if #g1>0 then if #g1>0 then
if KOISHI_CHECK then Duel.ConfirmCards(tp,g1) end --if KOISHI_CHECK then Duel.ConfirmCards(tp,g1) end
local codes={} local codes={}
for tc in aux.Next(g1) do for tc in aux.Next(g1) do
local code=tc:GetCode() local code=tc:GetCode()
...@@ -320,7 +318,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -320,7 +318,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
g2:AddCard(Duel.CreateToken(1-tp,tab2[i])) g2:AddCard(Duel.CreateToken(1-tp,tab2[i]))
end end
if #g2>0 then if #g2>0 then
if KOISHI_CHECK then Duel.ConfirmCards(1-tp,g2) end --if KOISHI_CHECK then Duel.ConfirmCards(1-tp,g2) end
local codes={} local codes={}
for tc in aux.Next(g2) do for tc in aux.Next(g2) do
local code=tc:GetCode() local code=tc:GetCode()
......
...@@ -24,12 +24,6 @@ function cm.initial_effect(c) ...@@ -24,12 +24,6 @@ function cm.initial_effect(c)
e4:SetTarget(cm.actarget) e4:SetTarget(cm.actarget)
e4:SetOperation(cm.costop) e4:SetOperation(cm.costop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC_G)
e5:SetRange(LOCATION_DECK)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
c:RegisterEffect(e5)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
...@@ -71,11 +65,37 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,11 +65,37 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.actarget(e,te,tp) function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler() return te:GetHandler()==e:GetHandler()
end end
function cm.costop(e,tp,eg,ep,ev,re,r,rp) function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=e:GetHandler() local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
c:CreateEffectRelation(te)
local c=e:GetHandler()
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:GetColumnGroupCount()>0 return c:GetColumnGroupCount()>0
......
...@@ -41,6 +41,7 @@ function cm.initial_effect(c) ...@@ -41,6 +41,7 @@ function cm.initial_effect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED) e5:SetCode(EVENT_DESTROYED)
e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,15004458)
e5:SetCondition(cm.pencon) e5:SetCondition(cm.pencon)
e5:SetTarget(cm.pentg) e5:SetTarget(cm.pentg)
e5:SetOperation(cm.penop) e5:SetOperation(cm.penop)
......
...@@ -59,6 +59,7 @@ function cm.initial_effect(c) ...@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED) e5:SetCode(EVENT_DESTROYED)
e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,15004465)
e5:SetCondition(cm.pencon) e5:SetCondition(cm.pencon)
e5:SetTarget(cm.pentg) e5:SetTarget(cm.pentg)
e5:SetOperation(cm.penop) e5:SetOperation(cm.penop)
......
...@@ -78,7 +78,7 @@ function c22348084.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,7 +78,7 @@ function c22348084.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(22348080) e1:SetValue(22348080)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+RESETS_STANDARD+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
......
...@@ -158,9 +158,9 @@ function c22348132.ddop(e,tp,eg,ep,ev,re,r,rp) ...@@ -158,9 +158,9 @@ function c22348132.ddop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(aux.TURE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) then if Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(aux.TURE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) then
Duel.BreakEffect() Duel.BreakEffect()
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil) local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(aux.TURE,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) then if Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(aux.TURE,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,LOCATION_HAND,1,nil) then
Duel.BreakEffect() Duel.BreakEffect()
local dg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil) local dg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND,LOCATION_HAND,nil)
Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end end
end end
......
local m=53728021 local m=53728021
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="大征啼鸟 歼星激流" cm.name="大征啼鸟 歼星激流"
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2)
SNNM.AnouguryLink(c) SNNM.AnouguryLink(c)
......
...@@ -41,17 +41,28 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,17 +41,28 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() then
local res=false local z=0x0
local lg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local lg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_SZONE,0,nil,EFFECT_LINK_SPELL_KOISHI)
for tc in aux.Next(lg) do if tc:GetLinkedGroup():IsContains(c) then res=true end end for tc in aux.Next(lg) do
local seq=tc:GetSequence()
local le={tc:IsHasEffect(EFFECT_LINK_SPELL_KOISHI)}
for _,v in pairs(le) do
local val=v:GetValue()
if aux.GetValueType(val)=="function" then val=val(v,c,tp) end
if val&0x40~=0 then z=z|(1<<(seq-1)) end
if val&0x80~=0 then z=z|(1<<seq) end
if val&0x100~=0 then z=z|(1<<(seq+1)) end
end
end
local res=c:IsLinkState() or z&(1<<(c:GetSequence()))~=0
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if res and not Duel.IsExistingMatchingCard(function(c)return c:IsFaceup() and c:IsType(TYPE_LINK)end,tp,LOCATION_MZONE,0,1,nil) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(20590515,2)) then if res and not Duel.IsExistingMatchingCard(function(c)return c:IsFaceup() and c:IsType(TYPE_LINK)end,tp,LOCATION_MZONE,0,1,nil) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(20590515,2)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil) local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg) Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
end end
end end
end end
...@@ -66,8 +77,7 @@ function cm.spr(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,8 +77,7 @@ function cm.spr(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and e:GetHandler():GetFlagEffect(m)>0
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(m)>0
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToHand() return c:IsRace(RACE_PYRO) and c:IsAbleToHand()
......
...@@ -30,8 +30,9 @@ function cm.con(e,tp) ...@@ -30,8 +30,9 @@ function cm.con(e,tp)
Duel.DisableActionCheck(true) Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(1-tp,m) local dc=Duel.CreateToken(1-tp,m)
local res=dc:GetActivateEffect():IsActivatable(1-tp,false,false) local res=dc:GetActivateEffect():IsActivatable(1-tp,false,false)
Duel.DisableActionCheck(false) Duel.DisableActionCheck(false)
return res local ph=Duel.GetCurrentPhase()
return res and Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -25,7 +25,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,7 +25,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c814391cm73.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
......
...@@ -35,10 +35,10 @@ end ...@@ -35,10 +35,10 @@ end
function c98920083.discon(e,tp,eg,ep,ev,re,r,rp) function c98920083.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c98920083.disfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c98920083.disfilter,tp,LOCATION_MZONE,0,1,nil)
and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and not c:IsPublic()
end end
function c98920083.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c98920083.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end end
function c98920083.disop(e,tp,eg,ep,ev,re,r,rp) function c98920083.disop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -13,12 +13,13 @@ function c98920151.initial_effect(c) ...@@ -13,12 +13,13 @@ function c98920151.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--eff gain --eff gain
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(98920151,1)) e3:SetDescription(aux.Stringid(98920151,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,98920151) e3:SetCountLimit(1,98920151)
e3:SetCondition(c98920151.drcon)
e3:SetOperation(c98920151.effop) e3:SetOperation(c98920151.effop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
......
...@@ -19,7 +19,7 @@ function c98920185.initial_effect(c) ...@@ -19,7 +19,7 @@ function c98920185.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,78990928) e2:SetCountLimit(1,98930185)
e2:SetCondition(c98920185.rscon) e2:SetCondition(c98920185.rscon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
......
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