Commit a920d6cd authored by POLYMER's avatar POLYMER

fix

parent b70ba3e2
...@@ -60,15 +60,19 @@ end ...@@ -60,15 +60,19 @@ end
function s.eqfilter2(c) function s.eqfilter2(c)
return aux.IsCodeListed(c,12866755) and c:IsType(TYPE_FUSION) return aux.IsCodeListed(c,12866755) and c:IsType(TYPE_FUSION)
end end
function s.eqfilter3(c,tp)
return (c:IsRace(RACE_WARRIOR) or c:IsRace(RACE_FIEND)) and
c:CheckUniqueOnField(tp) and not c:IsForbidden() and aux.IsCodeListed(c,12866755) and c:IsType(TYPE_FUSION)
end
function s.check(g) function s.check(g)
return g:IsExists(s.eqfilter2,1,nil) return g:IsExists(s.eqfilter2,1,nil)
end end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.eqfilter1,tp,LOCATION_GRAVE,0,nil,e,tp) local g=Duel.GetMatchingGroup(s.eqfilter1,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.eqfilter1(chkc,e,tp) and chkc:IsControler(tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.eqfilter3(chkc,e,tp) and chkc:IsControler(tp) end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>0 and #g>0 end if chk==0 then return ft>0 and Duel.IsExistingTarget(s.eqfilter3,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ct=math.min(ft,2) local ct=math.min(ft,2)
local sg=g:SelectSubGroup(tp,s.check,false,1,ct) local sg=g:SelectSubGroup(tp,s.check,false,1,ct)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
local s,id=GetID() local s,id=GetID()
s.ui_hint_effect = s.ui_hint_effect or {} s.ui_hint_effect = s.ui_hint_effect or {}
local CORE_ID = 40020353 local CORE_ID = 40020353
local ArmedIntervention = CORE_ID local ArmedIntervention = CORE_ID
local ArmedIntervention_UI = CORE_ID + 10000 local ArmedIntervention_UI = CORE_ID + 10000
--CB --CB
s.named_with_CelestialBeing=1 s.named_with_CelestialBeing=1
...@@ -27,6 +27,7 @@ function s.Exia(c) ...@@ -27,6 +27,7 @@ function s.Exia(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.named_with_Exia return m and m.named_with_Exia
end end
function s.initial_effect(c) function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -123,7 +124,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -123,7 +124,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.tdfilter(c) function s.tdfilter(c)
return (c:IsType(TYPE_MONSTER) and c:IsLevelAbove(5))or c:IsCode(40020383) and c:IsAbleToDeck() return ((c:IsType(TYPE_MONSTER) and c:IsLevelAbove(5)) or c:IsCode(40020383)) and c:IsAbleToDeck()
end end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -133,12 +134,11 @@ function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -133,12 +134,11 @@ function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.descheck(g, lv_limit) function s.descheck(g, lv_limit)
local sum = g:GetSum(function(c) local sum = 0
local val = 0 for c in aux.Next(g) do
if c:GetLevel()>0 then val = val + c:GetLevel() end if c:GetLevel()>0 then sum = sum + c:GetLevel() end
if c:GetRank()>0 then val = val + c:GetRank() end if c:GetRank()>0 then sum = sum + c:GetRank() end
return val end
end)
return sum <= lv_limit return sum <= lv_limit
end end
...@@ -157,9 +157,13 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) ...@@ -157,9 +157,13 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(3) e1:SetValue(3)
e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local current_lv = c:GetLevel() local current_lv = c:GetLevel()
local dg = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil) local dg = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
if #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
if #dg>0 and dg:CheckSubGroup(s.descheck, 1, #dg, current_lv)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
local sg = dg:SelectSubGroup(tp, s.descheck, false, 1, #dg, current_lv) local sg = dg:SelectSubGroup(tp, s.descheck, false, 1, #dg, current_lv)
if sg and #sg>0 then if sg and #sg>0 then
...@@ -170,4 +174,4 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) ...@@ -170,4 +174,4 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end end
\ No newline at end of file
...@@ -27,7 +27,9 @@ function s.Exia(c) ...@@ -27,7 +27,9 @@ function s.Exia(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.named_with_Exia return m and m.named_with_Exia
end end
function s.initial_effect(c) function s.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
...@@ -41,7 +43,31 @@ function s.initial_effect(c) ...@@ -41,7 +43,31 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.drawcon)
e2:SetTarget(s.drawtg)
e2:SetOperation(s.drawop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(s.copycon) -- 增加条件检查标记
e3:SetTarget(s.copytg)
e3:SetOperation(s.copyop)
c:RegisterEffect(e3)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local owner=c:GetOwner() local owner=c:GetOwner()
...@@ -74,6 +100,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -74,6 +100,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.SelectMatchingCard(tp,s.costfilter,tp,loc,0,1,1,nil,tp,loc) local rg=Duel.SelectMatchingCard(tp,s.costfilter,tp,loc,0,1,1,nil,tp,loc)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -85,32 +112,14 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,32 +112,14 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c) c:RegisterFlagEffect(id, RESET_EVENT+0x1fe0000, 0, 1)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.drawtg)
e1:SetOperation(s.drawop)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(s.copycon)
e2:SetTarget(s.copytg)
e2:SetOperation(s.copyop)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end end
end end
function s.drawcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)>0
end
function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local c1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) local c1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
...@@ -119,6 +128,7 @@ function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -119,6 +128,7 @@ function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,0)
end end
function s.drawop(e,tp,eg,ep,ev,re,r,rp) function s.drawop(e,tp,eg,ep,ev,re,r,rp)
local c1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) local c1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local c2=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) local c2=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
...@@ -132,8 +142,9 @@ function s.drawop(e,tp,eg,ep,ev,re,r,rp) ...@@ -132,8 +142,9 @@ function s.drawop(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(turn_p, PHASE_MAIN2, RESET_PHASE+PHASE_END, 1) Duel.SkipPhase(turn_p, PHASE_MAIN2, RESET_PHASE+PHASE_END, 1)
end end
end end
function s.copycon(e,tp,eg,ep,ev,re,r,rp) function s.copycon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp and e:GetHandler():GetFlagEffect(id)>0
end end
function s.copyfilter(c) function s.copyfilter(c)
...@@ -154,4 +165,4 @@ function s.copyop(e,tp,eg,ep,ev,re,r,rp) ...@@ -154,4 +165,4 @@ function s.copyop(e,tp,eg,ep,ev,re,r,rp)
local code=tc:GetOriginalCode() local code=tc:GetOriginalCode()
c:CopyEffect(code, RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END, 1) c:CopyEffect(code, RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END, 1)
end end
end end
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
local s,id=GetID() local s,id=GetID()
s.ui_hint_effect = s.ui_hint_effect or {} s.ui_hint_effect = s.ui_hint_effect or {}
local CORE_ID = 40020353 local CORE_ID = 40020353
local ArmedIntervention = CORE_ID local ArmedIntervention = CORE_ID
local ArmedIntervention_UI = CORE_ID + 10000 local ArmedIntervention_UI = CORE_ID + 10000
--CB --CB
s.named_with_CelestialBeing=1 s.named_with_CelestialBeing=1
...@@ -28,12 +28,12 @@ function s.initial_effect(c) ...@@ -28,12 +28,12 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0) e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e2:SetTarget(s.estg) e2:SetTarget(s.estg)
e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -69,7 +69,7 @@ function s.lvtg(e,c) ...@@ -69,7 +69,7 @@ function s.lvtg(e,c)
end end
function s.estg(e,c) function s.estg(e,c)
return s.CelestialBeing(c) and c:IsAttribute(ATTRIBUTE_WATER) return s.CelestialBeing(c)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return s.CelestialBeing(c) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(5) return s.CelestialBeing(c) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(5)
......
...@@ -49,7 +49,7 @@ function s.matcheck(e,c) ...@@ -49,7 +49,7 @@ function s.matcheck(e,c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE) e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetValue(att) e1:SetValue(att)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
......
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