Commit 93625877 authored by POLYMER's avatar POLYMER

fix

parent fc2ee127
......@@ -77,7 +77,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local lv=lc:GetLevel()
return c:IsLevelAbove(lv) and Duel.GetFlagEffect(tp,130006118)~=0
end
function s.lvfilter(e,c)
function s.val(e,c)
local p=c:GetControler()
local ccode=c:GetCode()
local ct=0
......@@ -86,29 +86,16 @@ function s.lvfilter(e,c)
ct=ct+1
end
end
return ct>0
return ct*2
end
function s.lvfilter(e,c)
return s.val(e,c)>0
end
function s.lvval(e,c)
local p=c:GetControler()
local ccode=c:GetCode()
local ct=0
for _,fcode in ipairs(s[p]) do
if fcode==ccode then
ct=ct+1
end
end
return ct*2
return s.val(e,c)*2
end
function s.atkval(e,c)
local p=c:GetControler()
local ccode=c:GetCode()
local ct=0
for _,fcode in ipairs(s[p]) do
if fcode==ccode then
ct=ct+1
end
end
return ct*500
return s.val(e,c)*500
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
......@@ -204,20 +191,20 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sel=opval[op]
if sel==1 then
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
sg=Duel.GetMatchingGroup(s.costfilter1,tp,LOCATION_HAND,0,c)
elseif sel==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc=rg:Select(tp,1,1,nil)
Duel.Remove(rc,POS_FACEUP,REASON_COST)
sg=Duel.GetMatchingGroup(s.costfilter1,tp,LOCATION_HAND,0,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=sg:Select(tp,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.costfilter1,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
local code=tc:GetCode()
e:SetLabel(code)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
if tc then
local code=tc:GetCode()
e:SetLabel(code)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
end
function s.filter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
......
......@@ -2,6 +2,7 @@
local s,id,o=GetID()
s.UnJustice=1
function s.initial_effect(c)
aux.AddCodeList(c,130006118)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......
--闪耀的支援者 七草叶月
function c28316053.initial_effect(c)
--atkup
--support
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28316053,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -12,27 +11,8 @@ function c28316053.initial_effect(c)
e1:SetCondition(aux.dscon)
e1:SetCost(c28316053.cost)
e1:SetTarget(c28316053.sutg)
e1:SetOperation(c28316053.atkop)
e1:SetOperation(c28316053.suop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28316053,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCost(c28316053.cost)
e2:SetTarget(c28316053.sutg)
e2:SetOperation(c28316053.indop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(28316053,2))
e3:SetOperation(c28316053.nocop)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetDescription(aux.Stringid(28316053,3))
e4:SetOperation(c28316053.datop)
c:RegisterEffect(e4)
--destroy replace
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -56,10 +36,26 @@ function c28316053.sutg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c28316053.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c28316053.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local phase=Duel.GetCurrentPhase()
local ops,opval={},{}
ops[1]=aux.Stringid(28316053,0)
opval[1]=0
if phase~=PHASE_DAMAGE then
ops[2]=aux.Stringid(28316053,1)
opval[2]=1
ops[3]=aux.Stringid(28316053,2)
opval[3]=2
ops[4]=aux.Stringid(28316053,3)
opval[4]=3
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
end
function c28316053.atkop(e,tp,eg,ep,ev,re,r,rp)
function c28316053.suop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local sel=e:GetLabel()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and sel==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -69,37 +65,35 @@ function c28316053.atkop(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
function c28316053.indop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
end
end
function c28316053.nocop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetLabel(1)
e1:SetValue(c28316053.effectfilter)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetLabel(2)
Duel.RegisterEffect(e2,tp)
e1:SetLabelObject(e2)
e2:SetLabelObject(tc)
elseif tc:IsFaceup() and tc:IsRelateToEffect(e) and sel==1 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetValue(1)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e4)
elseif tc:IsFaceup() and tc:IsRelateToEffect(e) and sel==2 then
local e5=Effect.CreateEffect(e:GetHandler())
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_INACTIVATE)
e5:SetLabel(1)
e5:SetValue(c28316053.effectfilter)
Duel.RegisterEffect(e5,tp)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_DISEFFECT)
e6:SetLabel(2)
Duel.RegisterEffect(e6,tp)
e5:SetLabelObject(e6)
e6:SetLabelObject(tc)
elseif tc:IsFaceup() and tc:IsRelateToEffect(e) and sel==3 then
local e7=Effect.CreateEffect(e:GetHandler())
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_DIRECT_ATTACK)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e7)
end
end
function c28316053.effectfilter(e,ct)
......@@ -113,16 +107,6 @@ function c28316053.effectfilter(e,ct)
end
return tc and tc==te:GetHandler()
end
function c28316053.datop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c28316053.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x283) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
......
......@@ -5454,7 +5454,7 @@ function cm.ActivatedAsSpellorTrapCheck(c)
local xe={rc:IsHasEffect(53765099)}
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if v:GetLabelObject() and rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
for _,v in pairs(xe) do if v:GetLabelObject() and aux.GetValueType(v:GetLabelObject())=="Effect" and rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
if b and typ and typ~=0 and rc:IsHasEffect(53765098) then
local e1=Effect.CreateEffect(rc)
e1:SetCode(EFFECT_CHANGE_TYPE)
......@@ -7448,3 +7448,74 @@ function cm.bltmadjustop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp)
--Duel.ConfirmCards(tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
end
function cm.Intersection(table1, table2)
local commonElements = {}
local elementsInTable1 = {}
for _, value in ipairs(table1) do
elementsInTable1[value] = true
end
for _, value in ipairs(table2) do
if elementsInTable1[value] then
table.insert(commonElements, value)
end
end
return #commonElements > 0, commonElements
end
function cm.Merge(table1, table2)
for _, v in ipairs(table2) do
local isDuplicate = false
for _, val in ipairs(table1) do
if val == v then
isDuplicate = true
break
end
end
if not isDuplicate then
table.insert(table1, v)
end
end
end
function cm.Merged(array1, array2)
local merged = {}
-- 添加第一个数组的元素到 merged 中
for _, v in ipairs(array1) do
merged[v] = true
end
-- 添加第二个数组的元素到 merged 中
for _, v in ipairs(array2) do
merged[v] = true
end
-- 构建最终的结果数组
local result = {}
for k, _ in pairs(merged) do
table.insert(result, k)
end
return result
end
function cm.Remove(tbl,value)
for i=#tbl, 1, -1 do
if tbl[i] == value then
table.remove(tbl, i)
end
end
return tbl
end
function cm.AllExist(table1, table2)
for _, value in ipairs(table2) do
local found = false
for _, v in ipairs(table1) do
if v == value then
found = true
break
end
end
if not found then
return false
end
end
return true
end
......@@ -16,7 +16,7 @@ function c60152905.initial_effect(c)
e1:SetOperation(c60152905.e1op)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(60152905,ACTIVITY_CHAIN,c60152905.chainfilter)
Duel.AddCustomActivityCounter(60152905,ACTIVITY_CHAIN,aux.FALSE)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60152905,1))
......@@ -42,10 +42,6 @@ function c60152905.initial_effect(c)
e3:SetOperation(c60152905.e3op)
c:RegisterEffect(e3)
end
function c60152905.chainfilter(re,tp,cid)
local tp=re:GetControler()
return not (re:IsControler(1-tp))
end
function c60152905.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil)==0
end
......@@ -108,7 +104,7 @@ function c60152905.e1op(e,tp,eg,ep,ev,re,r,rp)
end
end
function c60152905.e2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(60152905,tp,ACTIVITY_CHAIN)>0
return Duel.GetCustomActivityCount(60152905,1-tp,ACTIVITY_CHAIN)>0
end
function c60152905.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local p=PLAYER_ALL
......
......@@ -291,7 +291,7 @@ function c60152913.e22904op(e,tp,eg,ep,ev,re,r,rp)
end
end
function c60152913.e22905con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(60152905,tp,ACTIVITY_CHAIN)>0
return Duel.GetCustomActivityCount(60152905,1-tp,ACTIVITY_CHAIN)>0
end
function c60152913.e22905tg(e,tp,eg,ep,ev,re,r,rp,chk)
local p=PLAYER_ALL
......
......@@ -16,7 +16,7 @@ function c60152926.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,6012926)
e2:SetCountLimit(1,60152926)
e2:SetCost(c60152926.thcost)
e2:SetTarget(c60152926.thtg)
e2:SetOperation(c60152926.thop)
......
......@@ -82,7 +82,7 @@ function c60152927.e5tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if Duel.IsExistingMatchingCard(c60152927.filter2,c:GetControler(),0,LOCATION_MZONE,1,nil) then
if Duel.IsExistingMatchingCard(c60152927.filter2,tp,0,LOCATION_MZONE,1,nil) then
sg=Duel.GetMatchingGroup(c60152927.exfilter0,tp,LOCATION_DECK,0,nil)
end
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,c60152927.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
......@@ -93,7 +93,7 @@ function c60152927.e5op(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if Duel.IsExistingMatchingCard(c60152927.filter2,c:GetControler(),0,LOCATION_MZONE,1,nil) then
if Duel.IsExistingMatchingCard(c60152927.filter2,tp,0,LOCATION_MZONE,1,nil) then
sg=Duel.GetMatchingGroup(c60152927.exfilter0,tp,LOCATION_DECK,0,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
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