Commit a206daf7 authored by POLYMER's avatar POLYMER

fix

parent 35cc5293
......@@ -14,6 +14,7 @@ function cm.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER)
e1:SetCode(EVENT_CHAINING)
e1:SetValue(11451480)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
......@@ -58,6 +59,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,3))+2
end
if op==2 then
e:SetCategory(CATEGORY_DISABLE)
else
e:SetCategory(0)
end
e:SetLabel(op)
end
function cm.matfilter(c,re,e)
......@@ -81,6 +87,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
--cm.repop(e,tp,eg,ep,ev,re,r,rp)
--cm.repop(e,1-tp,eg,ep,ev,re,r,rp)
end
end
end
......
......@@ -26,6 +26,7 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -37,6 +38,7 @@ function cm.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetType(EFFECT_TYPE_QUICK_F)
e3:SetCode(EVENT_CHAINING)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.descon)
e3:SetTarget(cm.destg)
......@@ -115,9 +117,15 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,Duel.GetCurrentChain())
if Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
local g=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,0,LOCATION_ONFIELD,1,nil,e)
if #g>0 then
local tc=g:GetFirst()
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
tc=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
else
Duel.SetTargetCard(tc)
end
e:GetHandler():SetCardTarget(tc)
e:GetLabelObject():AddCard(tc)
end
......
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--synchro summon
aux.AddSynchroProcedure(c,aux.Tuner(nil),aux.NonTuner(nil),1,99)
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,99)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,4))
......@@ -78,13 +78,16 @@ function cm.stfilterg(g,tp,tc,lv,smat)
local count=g:GetCount()
return g1:GetCount()==1 and g2:GetCount()==count-1 and g:GetSum(Card.GetLevel)==lv and Duel.GetLocationCountFromEx(tp,tp,g,tc)>0
end
function cm.sycon(e,c,smat,mg)
function cm.sycon(e,c,smat,mg1)
if c==nil then return true end
if c:IsFaceup() then return false end
local lv=e:GetLabel()
local tp=c:GetControler()
if not mg then
local mg
if not mg1 then
mg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
else
mg=mg1:Clone()
end
if smat then
mg:RemoveCard(smat)
......@@ -93,10 +96,13 @@ function cm.sycon(e,c,smat,mg)
return mg:CheckSubGroup(cm.stfilterg,2,nil,tp,c,lv,nil)
end
end
function cm.syop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg)
function cm.syop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg1)
local lv=e:GetLabel()
if not mg then
local mg
if not mg1 then
mg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
else
mg=mg1:Clone()
end
local g=Group.CreateGroup()
if smat then
......
......@@ -3,7 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,nil,2,true)
aux.AddFusionProcFunRep(c,s.mfilter,2,true)
--extra fusion
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
......@@ -49,6 +49,9 @@ function s.initial_effect(c)
e4:SetCondition(s.spcon2)
c:RegisterEffect(e4)
end
function s.mfilter(c)
return c:IsFusionType(TYPE_MONSTER)
end
function s.MgFilter(sg,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,sg,sc)>0
end
......
......@@ -79,7 +79,7 @@ function c21050101.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c21050101.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK)
and Duel.GetLocationCountFromEx(tp,tp,nil,tc)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,true,false)
and Duel.GetLocationCount(tp,tp,nil,tc)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,true,false)
and Duel.SelectYesNo(tp,aux.Stringid(21050101,1)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
......
......@@ -42,7 +42,7 @@ end
function c71403017.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c71403017.lffilter,1,nil)
end
function c71403017.regop(e,tp,eg,ep,ev,re,r,rp)GetFlagEffect
function c71403017.regop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c71403017.lffilter,nil)
if g:IsExists(c71403017.lffilter2,1,nil,0) then
Duel.RegisterFlagEffect(0,71403017,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
......
......@@ -36,6 +36,52 @@ function s.initial_effect(c)
e3:SetTarget(s.acttg)
e3:SetOperation(s.actop)
c:RegisterEffect(e3)
--adjust
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e01:SetCode(EVENT_ADJUST)
e01:SetRange(0xff)
e01:SetOperation(s.adjustop)
c:RegisterEffect(e01)
--
--[[if not s.globle_check then
s.globle_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_ACTIVATE_COST)
ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetCost(s.costchk)
ge1:SetTargetRange(1,0)
ge1:SetTarget(s.actarget)
ge1:SetOperation(s.costop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
local g=Duel.GetMatchingGroup(s.actfilter,0,0xff,0xff,nil)
for tc in aux.Next(g) do
local te=tc:GetActivateEffect()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetCode()==EVENT_FREE_CHAIN then
local ge2=te:Clone()
local con=ge2:GetCondition()
local property=ge2:GetProperty()
--ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
ge2:SetCode(EVENT_CUSTOM+id)
ge2:SetRange(LOCATION_DECK+LOCATION_GRAVE)
if property then
ge2:SetProperty(property|EFFECT_FLAG_DELAY)
else
ge2:SetProperty(EFFECT_FLAG_DELAY)
end
ge2:SetCondition(function (e,tp,eg,ep,ev,re,r,rp)
return rp==tp and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end)
tc:RegisterEffect(ge2)
end
end
end]]
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not s.globle_check then
s.globle_check=true
......@@ -50,35 +96,29 @@ function s.initial_effect(c)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
local g=Duel.GetMatchingGroup(s.actfilter,0,0xff,0xff,nil)
for tc in aux.Next(g) do
local te=tc:GetActivateEffect()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetCode()==EVENT_FREE_CHAIN then
local ge2=te:Clone()
local con=ge2:GetCondition()
local property=ge2:GetProperty()
--ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
ge2:SetCode(EVENT_CUSTOM+id)
ge2:SetRange(LOCATION_DECK+LOCATION_GRAVE)
if property then
ge2:SetProperty(property|EFFECT_FLAG_DELAY)
else
ge2:SetProperty(EFFECT_FLAG_DELAY)
end
ge2:SetCondition(function (e,tp,eg,ep,ev,re,r,rp)
return rp==tp and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end)
tc:RegisterEffect(ge2)
end
end
end)
Duel.RegisterEffect(e0,0)
local g=Duel.GetMatchingGroup(s.actfilter,0,0xff,0xff,nil)
for tc in aux.Next(g) do
local te=tc:GetActivateEffect()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetCode()==EVENT_FREE_CHAIN then
local ge2=te:Clone()
local con=ge2:GetCondition()
local property=ge2:GetProperty()
--ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
ge2:SetCode(EVENT_CUSTOM+id)
ge2:SetRange(LOCATION_DECK+LOCATION_GRAVE)
if property then
ge2:SetProperty(property|EFFECT_FLAG_DELAY)
else
ge2:SetProperty(EFFECT_FLAG_DELAY)
end
ge2:SetCondition(function (e,tp,eg,ep,ev,re,r,rp)
return rp==tp and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end)
tc:RegisterEffect(ge2)
end
end
end
e:Reset()
end
function s.spcfilter1(c)
return c:GetSequence()<5
......
......@@ -71,12 +71,6 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
elseif c:GetFlagEffect(2)>0 then
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,0x60)
c:ResetFlagEffect(2)
elseif c:GetFlagEffect(3)>0 then
local g=Duel.SelectMatchingCard(tp,cm.lfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then Duel.LinkSummon(tp,g:GetFirst(),nil) end
c:ResetFlagEffect(3)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......@@ -87,6 +81,12 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCondition(cm.tgcon)
e1:SetOperation(cm.tgop)
Duel.RegisterEffect(e1,tp)
c:ResetFlagEffect(2)
elseif c:GetFlagEffect(3)>0 then
local g=Duel.SelectMatchingCard(tp,cm.lfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then Duel.LinkSummon(tp,g:GetFirst(),nil) end
c:ResetFlagEffect(3)
end
end
function cm.lfilter(c)
return c:IsLinkSummonable(nil)
......
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