Commit 1745db5f authored by Nemo Ma's avatar Nemo Ma

fix

parent 4a47186c
...@@ -7261,5 +7261,5 @@ s.record_previous_inside_series() ...@@ -7261,5 +7261,5 @@ s.record_previous_inside_series()
s.previous_xyz_material_record() s.previous_xyz_material_record()
s.record_official_filter() s.record_official_filter()
s.add_current_effect_check() s.add_current_effect_check()
s.add_type_normal_spell_or_trap_scl() --s.add_type_normal_spell_or_trap_scl()
Scl.RaiseGlobalSetEvent() Scl.RaiseGlobalSetEvent()
\ No newline at end of file
--能量体 --能量体
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end --rescripted 20230705
local m=10174034 if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local cm=_G["c"..m] local s,id = GetID()
function cm.initial_effect(c) function s.initial_effect(c)
local e1=rsef.SV_UPDATE(c,"atk",cm.val) local e1 = Scl.CreateSingleBuffEffect(c, "+ATK", s.val, "MonsterZone")
local e2=rsef.I(c,{m,0},1,"des","tg",LOCATION_MZONE,cm.con(2000),rscost.cost(Card.IsDiscardable,"dish",LOCATION_HAND),rstg.target(aux.TRUE,"des",0,LOCATION_ONFIELD),cm.desop) local e2 = Scl.CreateIgnitionEffect(c, "Destroy", 1, "Destroy", "Target", "MonsterZone", s.descon,
local e3=rsef.SV_IMMUNE_EFFECT(c,cm.imval,cm.con(4000)) { "PlayerCost", "Discard", 1 },
{ "Target", "Destroy", aux.TRUE, 0, "OnField" }, s.desop)
local e4 = Scl.CreateSingleBuffEffect(c, "UnaffectedByOpponentsActivatedEffects", 1, "MonsterZone", s.uecon)
end end
function cm.val(e,c) function s.val(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)*1000 return Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_ONFIELD)*1000
end end
function cm.con(atk) function s.descon(e,tp)
return function(e) return e:GetHandler():IsAttackAbove(2000)
return e:GetHandler():IsAttackAbove(atk)
end
end end
function cm.desop(e,tp) function s.desop(e,tp)
local tc=rscf.GetTargetCard() local _, tc = Scl.GetTargetsReleate2Chain()
if tc then if tc then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
end end
function cm.imval(e,re) function s.uecon(e,tp)
return re:GetOwnerPlayer()~=e:GetOwnerPlayer() and re:IsActivated() return e:GetHandler():IsAttackAbove(4000)
end end
\ No newline at end of file
...@@ -226,8 +226,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -226,8 +226,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler() local tep=tc:GetControler()
local cost=te:GetCost() local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
......
...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir ...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir
local s,id = Scl.SetID(130006034, "LordOfChain") local s,id = Scl.SetID(130006034, "LordOfChain")
function s.initial_effect(c) function s.initial_effect(c)
local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand") local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand")
local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg) local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg, s.mixop)
if not s.chain_id_scl then
s.chain_id_scl = {}
end
end end
function s.get_count(zone) function s.get_count(zone)
local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone) local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone)
...@@ -11,13 +14,15 @@ function s.get_count(zone) ...@@ -11,13 +14,15 @@ function s.get_count(zone)
end end
function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_ONFIELD) local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_ONFIELD)
local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and Duel.GetCurrentChain() > 2 local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and cct > 1
if chk == 0 then return b1 or b2 end if chk == 0 then return b1 or b2 end
local op = b1 and 1 or 2 --local op = b1 and 1 or 2
if b1 and b2 then --if b1 and b2 then
op = Scl.SelectOption(tp, true, "Damage", true, {id, 0}) --op = Scl.SelectOption(tp, true, "Damage", true, {id, 0})
end --end
local op = b2 and 2 or 1
if op == 1 then if op == 1 then
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetCategory(CATEGORY_DAMAGE) e:SetCategory(CATEGORY_DAMAGE)
...@@ -25,7 +30,6 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,7 +30,6 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(100) Duel.SetTargetParam(100)
Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1-tp, 100) Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1-tp, 100)
Duel.ChangeChainOperation(0,s.op1)
else else
e:SetProperty(0) e:SetProperty(0)
c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1) c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1)
...@@ -41,18 +45,20 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,18 +45,20 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
e:SetCategory(ctgy) e:SetCategory(ctgy)
Duel.ChangeChainOperation(0,s.op2)
end end
s.chain_id_scl[cct] = op
end end
function s.op1(e,tp) function s.mixop(e,tp,eg,ep,ev,re,r,rp)
local cct = Duel.GetCurrentChain()
local op = s.chain_id_scl[cct]
if op == 1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end else
function s.op2(e,tp)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain() local cct = Duel.GetCurrentChain()
if cct >= 3 then if cct >= 3 then
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if c:IsRelateToChain(0) and
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then
Scl.SelectAndOperateCards("Send2GY",tp,Card.IsAbleToGrave,tp,"OnField","OnField",1,1,nil)() Scl.SelectAndOperateCards("Send2GY",tp,Card.IsAbleToGrave,tp,"OnField","OnField",1,1,nil)()
end end
...@@ -63,6 +69,7 @@ function s.op2(e,tp) ...@@ -63,6 +69,7 @@ function s.op2(e,tp)
if cct >= 7 then if cct >= 7 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.tgcon, s.tgop, RESET_EP_SCL) local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.tgcon, s.tgop, RESET_EP_SCL)
end end
end
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and Scl.IsSeries(c, "LordOfChain") return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and Scl.IsSeries(c, "LordOfChain")
......
...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir ...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir
local s,id = Scl.SetID(130006035, "LordOfChain") local s,id = Scl.SetID(130006035, "LordOfChain")
function s.initial_effect(c) function s.initial_effect(c)
local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand") local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand")
local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg) local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg, s.mixop)
if not s.chain_id_scl then
s.chain_id_scl = {}
end
end end
function s.get_count(zone) function s.get_count(zone)
local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone) local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone)
...@@ -11,13 +14,15 @@ function s.get_count(zone) ...@@ -11,13 +14,15 @@ function s.get_count(zone)
end end
function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_HAND) local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_HAND)
local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and Duel.GetCurrentChain() > 2 local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and cct > 1
if chk == 0 then return b1 or b2 end if chk == 0 then return b1 or b2 end
local op = b1 and 1 or 2 --local op = b1 and 1 or 2
if b1 and b2 then --if b1 and b2 then
op = Scl.SelectOption(tp, true, "GainLP", true, {id, 0}) --op = Scl.SelectOption(tp, true, "Damage", true, {id, 0})
end --end
local op = b2 and 2 or 1
if op == 1 then if op == 1 then
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetCategory(CATEGORY_RECOVER) e:SetCategory(CATEGORY_RECOVER)
...@@ -25,11 +30,9 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,11 +30,9 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(100) Duel.SetTargetParam(100)
Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 100) Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 100)
Duel.ChangeChainOperation(0,s.op1)
else else
e:SetProperty(0) e:SetProperty(0)
c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1) c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1)
local cct = Duel.GetCurrentChain()
local ctgy = 0 local ctgy = 0
if cct >= 3 then if cct >= 3 then
ctgy = ctgy + CATEGORY_SPECIAL_SUMMON + CATEGORY_HANDES ctgy = ctgy + CATEGORY_SPECIAL_SUMMON + CATEGORY_HANDES
...@@ -41,16 +44,16 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,16 +44,16 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
ctgy = ctgy + CATEGORY_DRAW ctgy = ctgy + CATEGORY_DRAW
end end
e:SetCategory(ctgy) e:SetCategory(ctgy)
Duel.ChangeChainOperation(0,s.op2)
end end
e:SetLabel(op) s.chain_id_scl[cct] = op
end end
function s.op1(e,tp) function s.mixop(e,tp,eg,ep,ev,re,r,rp)
local cct = Duel.GetCurrentChain()
local op = s.chain_id_scl[cct]
if op == 1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT) Duel.Recover(p,d,REASON_EFFECT)
end else
function s.op2(e,tp)
local cct = Duel.GetCurrentChain()
local c = e:GetHandler() local c = e:GetHandler()
if cct >= 3 then if cct >= 3 then
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
...@@ -64,6 +67,7 @@ function s.op2(e,tp) ...@@ -64,6 +67,7 @@ function s.op2(e,tp)
if cct >= 9 then if cct >= 9 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.drcon, s.drop, RESET_EP_SCL) local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.drcon, s.drop, RESET_EP_SCL)
end end
end
end end
function s.thfilter(c,e,tp) function s.thfilter(c,e,tp)
return c:IsAbleToHand() and Scl.IsSeries(c, "LordOfChain") return c:IsAbleToHand() and Scl.IsSeries(c, "LordOfChain")
......
...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir ...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir
local s,id = Scl.SetID(130006036, "LordOfChain") local s,id = Scl.SetID(130006036, "LordOfChain")
function s.initial_effect(c) function s.initial_effect(c)
local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand") local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand")
local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg) local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg, s.mixop)
if not s.chain_id_scl then
s.chain_id_scl = {}
end
end end
function s.get_count(zone) function s.get_count(zone)
local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone) local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone)
...@@ -11,22 +14,22 @@ function s.get_count(zone) ...@@ -11,22 +14,22 @@ function s.get_count(zone)
end end
function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_DECK) local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_DECK)
local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and Duel.GetCurrentChain() > 2 local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and cct > 1
if chk == 0 then return b1 or b2 end if chk == 0 then return b1 or b2 end
local op = b1 and 1 or 2 --local op = b1 and 1 or 2
if b1 and b2 then --if b1 and b2 then
op = Scl.SelectOption(tp, true, "ChangeDEF", true, {id, 0}) --op = Scl.SelectOption(tp, true, "Damage", true, {id, 0})
end --end
local op = b2 and 2 or 1
if op == 1 then if op == 1 then
e:SetProperty(0) e:SetProperty(0)
e:SetCategory(CATEGORY_DEFCHANGE) e:SetCategory(CATEGORY_DEFCHANGE)
c:RegisterFlagEffect(id, RESET_CHAIN, 0, 1) c:RegisterFlagEffect(id, RESET_CHAIN, 0, 1)
Duel.ChangeChainOperation(0,s.op1)
else else
e:SetProperty(0) e:SetProperty(0)
c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1) c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1)
local cct = Duel.GetCurrentChain()
local ctgy = 0 local ctgy = 0
if cct >= 3 then if cct >= 3 then
ctgy = ctgy + CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE ctgy = ctgy + CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE
...@@ -38,19 +41,19 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,19 +41,19 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
ctgy = ctgy + CATEGORY_DISABLE ctgy = ctgy + CATEGORY_DISABLE
end end
e:SetCategory(ctgy) e:SetCategory(ctgy)
Duel.ChangeChainOperation(0,s.op2)
end end
e:SetLabel(op) s.chain_id_scl[cct] = op
end end
function s.op1(e,tp) function s.mixop(e,tp,eg,ep,ev,re,r,rp)
local cct = Duel.GetCurrentChain()
local op = s.chain_id_scl[cct]
if op == 1 then
local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do for tc in aux.Next(g) do
Scl.AddSingleBuff({e:GetHandler(),tc},"+DEF", -300) Scl.AddSingleBuff({e:GetHandler(),tc},"+DEF", -300)
end end
end else
function s.op2(e,tp)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
if cct >= 3 then if cct >= 3 then
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then
...@@ -64,7 +67,7 @@ function s.op2(e,tp) ...@@ -64,7 +67,7 @@ function s.op2(e,tp)
local f = function(tc) local f = function(tc)
return tc:IsFaceup() and tc:IsDefense(0) return tc:IsFaceup() and tc:IsDefense(0)
end end
local g = Duel.GetMatchingGroup(f,tp,LOCATION_MZONE,LOCATION_MZONE) local g = Duel.GetMatchingGroup(f,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g > 0 then if #g > 0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
...@@ -72,6 +75,7 @@ function s.op2(e,tp) ...@@ -72,6 +75,7 @@ function s.op2(e,tp)
if cct >= 11 then if cct >= 11 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "BeforeEffectResolving", nil, nil, nil, nil, s.discon, s.disop, RESET_EP_SCL) local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "BeforeEffectResolving", nil, nil, nil, nil, s.discon, s.disop, RESET_EP_SCL)
end end
end
end end
function s.discon(e,tp,eg,ep,ev,re) function s.discon(e,tp,eg,ep,ev,re)
return ev >= 2 and ep ~= tp return ev >= 2 and ep ~= tp
......
...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir ...@@ -3,7 +3,10 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir
local s,id = Scl.SetID(130006037, "LordOfChain") local s,id = Scl.SetID(130006037, "LordOfChain")
function s.initial_effect(c) function s.initial_effect(c)
local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand") local e1 = Scl.CreateSingleBuffEffect(c, "Reveal", 1, "Hand")
local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg) local e2 = Scl.CreateQuickMandatoryEffect(c, "ActivateEffect", nil, nil, nil, nil, "Hand,MonsterZone", nil, nil, s.mixtg,s.mixop)
if not s.chain_id_scl then
s.chain_id_scl = {}
end
end end
function s.get_count(zone) function s.get_count(zone)
local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone) local ct = Duel.GetFieldGroupCount(0, zone, 0) - Duel.GetFieldGroupCount(0, 0, zone)
...@@ -11,21 +14,21 @@ function s.get_count(zone) ...@@ -11,21 +14,21 @@ function s.get_count(zone)
end end
function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_GRAVE) local b1 = (c:IsOnField() or c:IsPublic()) and c:GetFlagEffect(id) < s.get_count(LOCATION_GRAVE)
local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and Duel.GetCurrentChain() > 2 local b2 = c:IsLocation(LOCATION_HAND) and c:GetFlagEffect(id + 100) == 0 and cct > 1
if chk == 0 then return b1 or b2 end if chk == 0 then return b1 or b2 end
local op = b1 and 1 or 2 --local op = b1 and 1 or 2
if b1 and b2 then --if b1 and b2 then
op = Scl.SelectOption(tp, true, "ChangeATK", true, {id, 0}) --op = Scl.SelectOption(tp, true, "Damage", true, {id, 0})
end --end
local op = b2 and 2 or 1
if op == 1 then if op == 1 then
e:SetProperty(0) e:SetProperty(0)
e:SetCategory(CATEGORY_ATKCHANGE) e:SetCategory(CATEGORY_ATKCHANGE)
c:RegisterFlagEffect(id, RESET_CHAIN, 0, 1) c:RegisterFlagEffect(id, RESET_CHAIN, 0, 1)
Duel.ChangeChainOperation(0,s.op1)
else else
c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1) c:RegisterFlagEffect(id + 100, RESET_CHAIN, 0, 1)
local cct = Duel.GetCurrentChain()
local ctgy = 0 local ctgy = 0
if cct >= 3 then if cct >= 3 then
ctgy = ctgy + CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE + CATEGORY_GRAVE_ACTION ctgy = ctgy + CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE + CATEGORY_GRAVE_ACTION
...@@ -37,18 +40,19 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -37,18 +40,19 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk)
ctgy = ctgy + CATEGORY_DISABLE ctgy = ctgy + CATEGORY_DISABLE
end end
e:SetCategory(ctgy) e:SetCategory(ctgy)
Duel.ChangeChainOperation(0,s.op2)
end end
s.chain_id_scl[cct] = op
end end
function s.op1(e,tp) function s.mixop(e,tp,eg,ep,ev,re,r,rp)
local cct = Duel.GetCurrentChain()
local op = s.chain_id_scl[cct]
if op == 1 then
local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do for tc in aux.Next(g) do
Scl.AddSingleBuff({e:GetHandler(),tc},"+ATK", 400) Scl.AddSingleBuff({e:GetHandler(),tc},"+ATK", 400)
end end
end else
function s.op2(e,tp)
local c = e:GetHandler() local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
if cct >= 3 then if cct >= 3 then
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then
...@@ -65,4 +69,5 @@ function s.op2(e,tp) ...@@ -65,4 +69,5 @@ function s.op2(e,tp)
local e1 = Scl.CreateFieldBuffEffect({c, tp}, "NegateEffect", 1, f, {"OnField", "OnField"}, nil, nil, RESET_EP_SCL) local e1 = Scl.CreateFieldBuffEffect({c, tp}, "NegateEffect", 1, f, {"OnField", "OnField"}, nil, nil, RESET_EP_SCL)
local e2 = Scl.CreateFieldBuffEffect({c, tp}, "=Name", 32274490, f, {"OnField", "OnField"}, nil, nil, RESET_EP_SCL) local e2 = Scl.CreateFieldBuffEffect({c, tp}, "=Name", 32274490, f, {"OnField", "OnField"}, nil, nil, RESET_EP_SCL)
end end
end
end end
\ No newline at end of file
...@@ -3,8 +3,8 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir ...@@ -3,8 +3,8 @@ if not pcall(function() require("expansions/script/c130001000") end) then requir
local s,id = Scl.SetID(130006038, "LordOfChain") local s,id = Scl.SetID(130006038, "LordOfChain")
function s.initial_effect(c) function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c, "FreeChain", nil, nil, "Send2GY,Draw", "!NegateEffect,!NegateActivation", s.con, nil, local e1 = Scl.CreateActivateEffect(c, "FreeChain", nil, nil, "Send2GY,Draw", "!NegateEffect,!NegateActivation", s.con, nil,
{ { "~Target", "Send2GY", Card.IsAbleToGrave, 0, "OnField", s.ct }, { {"~Target", "Send2GY", Card.IsAbleToGrave, 0, "OnField", s.ct },
{ "PlayerTarget", "Draw", s.ct} }, s.op) { "PlayerTarget", "Draw", s.ct } }, s.op)
local e2 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "ShuffleIn2Deck", {1, id, "Chain"}, "ShuffleIn2Deck,AddFromDeck2Hand", nil, "Hand", s.scon, nil, s.stg,s.sop) local e2 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "ShuffleIn2Deck", {1, id, "Chain"}, "ShuffleIn2Deck,AddFromDeck2Hand", nil, "Hand", s.scon, nil, s.stg,s.sop)
end end
function s.ct(e,tp) function s.ct(e,tp)
...@@ -12,7 +12,7 @@ function s.ct(e,tp) ...@@ -12,7 +12,7 @@ function s.ct(e,tp)
return #g > 0 and 1 or 0 return #g > 0 and 1 or 0
end end
function s.con(e,tp) function s.con(e,tp)
return Duel.CheckPhaseActivity() return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity()
end end
function s.op(e,tp) function s.op(e,tp)
local g = Scl.GetMatchingGroup(Card.IsPublic, tp, "Hand", 0, nil) local g = Scl.GetMatchingGroup(Card.IsPublic, tp, "Hand", 0, nil)
......
...@@ -60,6 +60,7 @@ function c9910731.conop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,6 +60,7 @@ function c9910731.conop(e,tp,eg,ep,ev,re,r,rp)
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end if sg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then Duel.ShuffleHand(1-tp) end
local c=e:GetHandler() local c=e:GetHandler()
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
tc:RegisterFlagEffect(9910731,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,2,0,aux.Stringid(9910731,5))
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
......
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