Commit 10fad4b3 authored by POLYMER's avatar POLYMER

fix

parent 9b21b3f4
...@@ -76,11 +76,14 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,11 +76,14 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0) local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
g:KeepAlive() g:KeepAlive()
local fid=c:GetFieldID()
for tc in aux.Next(g) do tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid) end
-- --
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g) e1:SetLabelObject(g)
e1:SetOperation(cm.tdop) e1:SetOperation(cm.tdop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
...@@ -108,7 +111,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -108,7 +111,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject():Filter(function(c) return c:GetFlagEffectLabel(m) and c:GetFlagEffectLabel(m)==e:GetLabel() and c:IsLocation(LOCATION_REMOVED) end,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end end
function cm.distg(e,c) function cm.distg(e,c)
......
...@@ -94,6 +94,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,6 +94,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
Duel.ResetFlagEffect(0,id) Duel.ResetFlagEffect(0,id)
--Debug.Message("3")
local mg=tg:Filter(Card.IsType,nil,TYPE_MONSTER) local mg=tg:Filter(Card.IsType,nil,TYPE_MONSTER)
if #mg>0 then if #mg>0 then
local tc=mg:GetFirst() local tc=mg:GetFirst()
...@@ -101,9 +102,11 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,9 +102,11 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
local cregister=Card.RegisterEffect local cregister=Card.RegisterEffect
Card.RegisterEffect=function(card,effect,flag) Card.RegisterEffect=function(card,effect,flag)
if effect and (effect:IsHasType(EFFECT_TYPE_IGNITION) or effect:IsHasType(EFFECT_TYPE_TRIGGER_F) or effect:IsHasType(EFFECT_TYPE_TRIGGER_O) or effect:IsHasType(EFFECT_TYPE_QUICK_F) or effect:IsHasType(EFFECT_TYPE_QUICK_O)) and bit.band(effect:GetCode(),EVENT_FLIP)==0 then --Debug.Message("2")
if effect and (effect:IsHasType(EFFECT_TYPE_IGNITION) or effect:IsHasType(EFFECT_TYPE_TRIGGER_F) or effect:IsHasType(EFFECT_TYPE_TRIGGER_O) or effect:IsHasType(EFFECT_TYPE_QUICK_F) or effect:IsHasType(EFFECT_TYPE_QUICK_O)) then
--Debug.Message("22")
local type=effect:GetType() local type=effect:GetType()
local prop=effect:GetProperty() local prop={effect:GetProperty()}
if effect:IsHasType(EFFECT_TYPE_TRIGGER_O) then if effect:IsHasType(EFFECT_TYPE_TRIGGER_O) then
effect:SetType(EFFECT_TYPE_QUICK_O) effect:SetType(EFFECT_TYPE_QUICK_O)
effect:SetRange(LOCATION_MZONE) effect:SetRange(LOCATION_MZONE)
...@@ -126,9 +129,10 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -126,9 +129,10 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
end end
-- --
--prop=prop&(~EFFECT_FLAG_DELAY) --prop=prop&(~EFFECT_FLAG_DELAY)
if bit.band(prop,EFFECT_FLAG_DELAY)==EFFECT_FLAG_DELAY then if bit.band(prop[1],EFFECT_FLAG_DELAY)==EFFECT_FLAG_DELAY then
prop=bit.bxor(prop,EFFECT_FLAG_DELAY) prop[1]=bit.bxor(prop[1],EFFECT_FLAG_DELAY)
if Duel.GetFlagEffect(0,id)==0 then if Duel.GetFlagEffect(0,id)==0 then
--Debug.Message("0")
Duel.RegisterFlagEffect(0,id,0,0,1) Duel.RegisterFlagEffect(0,id,0,0,1)
--raise event --raise event
local e3=Effect.CreateEffect(card) local e3=Effect.CreateEffect(card)
...@@ -140,10 +144,12 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -140,10 +144,12 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
--prop=prop|EFFECT_FLAG_SET_AVAILABLE --prop=prop|EFFECT_FLAG_SET_AVAILABLE
if bit.band(prop,EFFECT_FLAG_SET_AVAILABLE)==0 then if bit.band(prop[1],EFFECT_FLAG_SET_AVAILABLE)==0 then
prop=prop+EFFECT_FLAG_SET_AVAILABLE prop[1]=prop[1]+EFFECT_FLAG_SET_AVAILABLE
end
if prop[2] then effect:SetProperty(prop[1],prop[2])
else effect:SetProperty(prop[1])
end end
effect:SetProperty(prop)
--Debug.Message(effect:GetType()) --Debug.Message(effect:GetType())
--Debug.Message(effect:GetProperty()) --Debug.Message(effect:GetProperty())
--Debug.Message("--------") --Debug.Message("--------")
...@@ -331,9 +337,10 @@ function s.rstop(e,tp,eg,ep,ev,re,r,rp) ...@@ -331,9 +337,10 @@ function s.rstop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
end end
function s.op(e,tp,eg,ep,ev,re,r,rp) function s.op(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message("0") --Debug.Message("1")
local c=e:GetLabelObject() local c=e:GetLabelObject()
Duel.RaiseEvent(c,EVENT_SPSUMMON_SUCCESS,e,REASON_EFFECT,e:GetHandlerPlayer(),0,0) Duel.RaiseEvent(c,EVENT_SPSUMMON_SUCCESS,e,REASON_EFFECT,e:GetHandlerPlayer(),0,0)
--Duel.RaiseSingleEvent(c,EVENT_SPSUMMON_SUCCESS,e,REASON_EFFECT,e:GetHandlerPlayer(),0,0)
--[[ --[[
--reset&RaiseSingleEvent --reset&RaiseSingleEvent
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -357,7 +364,7 @@ function s.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -357,7 +364,7 @@ function s.op(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
end end
function s.rstop2(e,tp,eg,ep,ev,re,r,rp) function s.rstop2(e,tp,eg,ep,ev,re,r,rp)
Debug.Message("1") --Debug.Message("1")
if e:GetLabel()~=1 then e:SetLabel(1) return end if e:GetLabel()~=1 then e:SetLabel(1) return end
e:GetLabelObject():Reset() e:GetLabelObject():Reset()
e:Reset() e:Reset()
...@@ -380,7 +387,7 @@ function s.costop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -380,7 +387,7 @@ function s.costop2(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(s.costop3) e2:SetOperation(s.costop3)
Duel.RegisterEffect(e2,c:GetControler()) Duel.RegisterEffect(e2,c:GetControler())
-- --
Debug.Message("2") --Debug.Message("2")
e:GetLabelObject():Reset() e:GetLabelObject():Reset()
e:Reset() e:Reset()
end end
......
...@@ -85,7 +85,7 @@ end ...@@ -85,7 +85,7 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(s.xfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(s.xfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
local g=Duel.SelectMatchingCard(p,aux.NecroValleyFilter(s.xfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,3,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.xfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,3,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local ct=g:GetCount() local ct=g:GetCount()
......
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