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

fix

parent 4a47186c
...@@ -685,7 +685,7 @@ function s.create_buff_list() ...@@ -685,7 +685,7 @@ function s.create_buff_list()
["!AttackAnnounce"] = { EFFECT_CANNOT_ATTACK_ANNOUNCE }, ["!AttackAnnounce"] = { EFFECT_CANNOT_ATTACK_ANNOUNCE },
["!AttackDirectly"] = { EFFECT_CANNOT_DIRECT_ATTACK }, ["!AttackDirectly"] = { EFFECT_CANNOT_DIRECT_ATTACK },
["MustAttack"] = { EFFECT_MUST_ATTACK, true }, ["MustAttack"] = { EFFECT_MUST_ATTACK, true },
["MustAttackMonster"] = { EFFECT_MUST_ATTACK, true }, ["MustAttackMonster"] = { EFFECT_MUST_ATTACK, true },
["!BeTributed"] = { { "!BeTributed4TributeSummon", "!BeTributedExcept4TributeSummon" } }, ["!BeTributed"] = { { "!BeTributed4TributeSummon", "!BeTributedExcept4TributeSummon" } },
["!BeTributed4TributeSummon"] = { EFFECT_UNRELEASABLE_SUM }, ["!BeTributed4TributeSummon"] = { EFFECT_UNRELEASABLE_SUM },
["!BeTributedExcept4TributeSummon"] = { EFFECT_UNRELEASABLE_NONSUM }, ["!BeTributedExcept4TributeSummon"] = { EFFECT_UNRELEASABLE_NONSUM },
...@@ -1352,7 +1352,7 @@ function Scl.RegisterActivateCountLimit(reg_eff, lim_obj) ...@@ -1352,7 +1352,7 @@ function Scl.RegisterActivateCountLimit(reg_eff, lim_obj)
lim_code = lim_code + EFFECT_COUNT_CODE_SINGLE lim_code = lim_code + EFFECT_COUNT_CODE_SINGLE
elseif (type(val) == "number" and val == 4) or elseif (type(val) == "number" and val == 4) or
(type(val) == "string" and val == "Chain") then (type(val) == "string" and val == "Chain") then
lim_code = lim_code + EFFECT_COUNT_CODE_CHAIN lim_code = lim_code + EFFECT_COUNT_CODE_CHAIN
else else
lim_code = lim_code + val lim_code = lim_code + val
end end
...@@ -3406,7 +3406,7 @@ end ...@@ -3406,7 +3406,7 @@ end
2.extra_check_function: add an additional check to the effect cost/target, call extra_check_function(e, tp, eg, ...) to check. 2.extra_check_function: add an additional check to the effect cost/target, call extra_check_function(e, tp, eg, ...) to check.
//return list_typ, extra_check_function //return list_typ, extra_check_function
4. 4.
{ 1.list_typ == "ExtraOperation", 2.extra_operate_function } { 1.list_typ == "ExtraOperation", 2.extra_operate_function }
Paramas explain: Paramas explain:
2.extra_operate_function: add an additional operate to the effect cost/target, call extra_operate_function(current list's selected card(s), all above lists's selected card(s),e, tp, eg, ...) to operate. 2.extra_operate_function: add an additional operate to the effect cost/target, call extra_operate_function(current list's selected card(s), all above lists's selected card(s),e, tp, eg, ...) to operate.
//return list_typ, extra_operate_function //return list_typ, extra_operate_function
...@@ -3415,7 +3415,7 @@ function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r ...@@ -3415,7 +3415,7 @@ function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r
--1.list type ("Cost", "~Target", "Target","PlayerTarget","Operation","ExtraCheck","ExtraOperation") --1.list type ("Cost", "~Target", "Target","PlayerTarget","Operation","ExtraCheck","ExtraOperation")
local list_typ = arr[1] local list_typ = arr[1]
if list_typ ~= "PlayerTarget" and list_typ ~= "PlayerCost" and list_typ ~= "ExtraCheck" and list_typ ~= "ExtraOperation" then if list_typ ~= "PlayerTarget" and list_typ ~= "PlayerCost" and list_typ ~= "ExtraCheck" and list_typ ~= "ExtraOperation" then
--2.category string, replace operation --2.category string, replace operation
local category_obj = type(arr[2]) == "table" and arr[2] or { arr[2] } local category_obj = type(arr[2]) == "table" and arr[2] or { arr[2] }
local category_str, replace_operation = table.unpack(category_obj) local category_str, replace_operation = table.unpack(category_obj)
local category, category_arr, category_str_arr = Scl.GetNumFormatCategory(category_str) local category, category_arr, category_str_arr = Scl.GetNumFormatCategory(category_str)
...@@ -5083,7 +5083,7 @@ function Scl.ActivateCard(tc, actp, apply_effect, lim_zone) ...@@ -5083,7 +5083,7 @@ function Scl.ActivateCard(tc, actp, apply_effect, lim_zone)
local tg = te:GetTarget() or aux.TRUE local tg = te:GetTarget() or aux.TRUE
local op = te:GetOperation() or aux.TRUE local op = te:GetOperation() or aux.TRUE
tg(te, actp, ceg, cep, cev, cre, cr, crp, 1) tg(te, actp, ceg, cep, cev, cre, cr, crp, 1)
op(te, actp, ceg, cep, cev, cre, cr, crp) op(te, actp, ceg, cep, cev, cre, cr, crp)
end end
if zone == LOCATION_FZONE then if zone == LOCATION_FZONE then
Duel.RaiseEvent(tc, 4179255, te, 0, tp, tp, Duel.GetCurrentChain()) Duel.RaiseEvent(tc, 4179255, te, 0, tp, tp, Duel.GetCurrentChain())
...@@ -5103,9 +5103,9 @@ end ...@@ -5103,9 +5103,9 @@ end
function Scl.Return2Field(card_obj, pos, zone) function Scl.Return2Field(card_obj, pos, zone)
local e, _, tp = Scl.GetCurrentEffectInfo() local e, _, tp = Scl.GetCurrentEffectInfo()
zone = zone or 0x3f1f3f1f zone = zone or 0x3f1f3f1f
local mzone = { [tp] = zone & 0x001f, [1 - tp] = (zone & 0x001f0000) / 0x0010000 } local mzone = { [tp] = zone & 0x001f, [1 - tp] = (zone & 0x001f0000) / 0x0010000 }
local szone = { [tp] = (zone & 0x1f00) / 0x100, [1 - tp] = (zone & 0x1f000000) / 0x1000000 } local szone = { [tp] = (zone & 0x1f00) / 0x100, [1 - tp] = (zone & 0x1f000000) / 0x1000000 }
local fzone = { [tp] = zone & 0x2000, [1 - tp] = zone & 0x20000000 } local fzone = { [tp] = zone & 0x2000, [1 - tp] = zone & 0x20000000 }
local sg = Scl.Mix2Group(card_obj) local sg = Scl.Mix2Group(card_obj)
local mon = sg:Filter(Scl.IsPreviouslyInZone, nil, "MonsterZone") local mon = sg:Filter(Scl.IsPreviouslyInZone, nil, "MonsterZone")
local st = sg:Filter(Scl.IsPreviouslyInZone, nil, "Spell&TrapZone") local st = sg:Filter(Scl.IsPreviouslyInZone, nil, "Spell&TrapZone")
...@@ -5696,7 +5696,7 @@ end ...@@ -5696,7 +5696,7 @@ end
3. Love.IsLinkSeries(c) -- equal to Scl.IsLinkSeries(c, "YiFanJiang") 3. Love.IsLinkSeries(c) -- equal to Scl.IsLinkSeries(c, "YiFanJiang")
4. Love.IsPreviousSeries(c) -- equal to Scl.IsPreviousSeries(c, "YiFanJiang") 4. Love.IsPreviousSeries(c) -- equal to Scl.IsPreviousSeries(c, "YiFanJiang")
5. Love.IsOriginalSeries(c) -- equal to Scl.IsOriginalSeries(c, "YiFanJiang") 5. Love.IsOriginalSeries(c) -- equal to Scl.IsOriginalSeries(c, "YiFanJiang")
6~10 Love.IsXXXXSeriesMonster(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_MONSTER) 6~10 Love.IsXXXXSeriesMonster(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_MONSTER)
11~15 Love.IsXXXXSeriesSpell(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL) 11~15 Love.IsXXXXSeriesSpell(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL)
16~20 Love.IsXXXXSeriesTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_TRAP) 16~20 Love.IsXXXXSeriesTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_TRAP)
21~25 Love.IsXXXXSeriesSpellOrTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL + TYPE_TRAP) 21~25 Love.IsXXXXSeriesSpellOrTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL + TYPE_TRAP)
...@@ -5766,14 +5766,14 @@ end ...@@ -5766,14 +5766,14 @@ end
--Get target player and that num-format value for an effect that register player target information in Effect.SetTarget --Get target player and that num-format value for an effect that register player target information in Effect.SetTarget
--//return target player, target value --//return target player, target value
--[[ --[[
>>eg1. Duel.SetTargetPlayer(tp) >>eg1. Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000) Duel.SetTargetParam(1000)
Scl.GetPlayerTargetParamas() Scl.GetPlayerTargetParamas()
>> return tp, 1000 >> return tp, 1000
--]] --]]
function Scl.GetPlayerTargetParamas() function Scl.GetPlayerTargetParamas()
local player, value = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM) local player, value = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
return player, value return player, value
end end
--Add normal summon or set procedure --Add normal summon or set procedure
...@@ -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,27 +45,30 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,27 +45,30 @@ 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 p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function s.op2(e,tp)
local c = e:GetHandler()
local cct = Duel.GetCurrentChain() local cct = Duel.GetCurrentChain()
if cct >= 3 then local op = s.chain_id_scl[cct]
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if op == 1 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Scl.SelectAndOperateCards("Send2GY",tp,Card.IsAbleToGrave,tp,"OnField","OnField",1,1,nil)() Duel.Damage(p,d,REASON_EFFECT)
else
local c = e:GetHandler()
local cct = Duel.GetCurrentChain()
if cct >= 3 then
if c:IsRelateToChain(0) and
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then
Scl.SelectAndOperateCards("Send2GY",tp,Card.IsAbleToGrave,tp,"OnField","OnField",1,1,nil)()
end
end
if cct >= 5 then
Scl.SelectAndOperateCards("SpecialSummon",tp,s.spfilter,tp,"Deck",0,1,1,nil,e,tp)()
end
if cct >= 7 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.tgcon, s.tgop, RESET_EP_SCL)
end end
end
if cct >= 5 then
Scl.SelectAndOperateCards("SpecialSummon",tp,s.spfilter,tp,"Deck",0,1,1,nil,e,tp)()
end
if cct >= 7 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.tgcon, s.tgop, RESET_EP_SCL)
end end
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,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(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,28 +44,29 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,28 +44,29 @@ 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
function s.op1(e,tp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end end
function s.op2(e,tp) function s.mixop(e,tp,eg,ep,ev,re,r,rp)
local cct = Duel.GetCurrentChain() local cct = Duel.GetCurrentChain()
local c = e:GetHandler() local op = s.chain_id_scl[cct]
if cct >= 3 then if op == 1 then
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then Duel.Recover(p,d,REASON_EFFECT)
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT,nil) else
local c = e:GetHandler()
if cct >= 3 then
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.DiscardHand(1-tp,nil,1,1,REASON_EFFECT,nil)
end
end
if cct >= 5 then
Scl.SelectAndOperateCards("Add2Hand",tp,s.thfilter,tp,"Deck",0,1,1,nil,e,tp)()
end
if cct >= 9 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.drcon, s.drop, RESET_EP_SCL)
end end
end
if cct >= 5 then
Scl.SelectAndOperateCards("Add2Hand",tp,s.thfilter,tp,"Deck",0,1,1,nil,e,tp)()
end
if cct >= 9 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "AfterEffectResolving", nil, nil, nil, nil, s.drcon, s.drop, RESET_EP_SCL)
end end
end end
function s.thfilter(c,e,tp) function s.thfilter(c,e,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(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,40 +41,41 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,40 +41,41 @@ 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
e:SetLabel(op)
end
function s.op1(e,tp)
local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
Scl.AddSingleBuff({e:GetHandler(),tc},"+DEF", -300)
end end
s.chain_id_scl[cct] = op
end end
function s.op2(e,tp) function s.mixop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local cct = Duel.GetCurrentChain() local cct = Duel.GetCurrentChain()
if cct >= 3 then local op = s.chain_id_scl[cct]
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if op == 1 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local dg = Duel.GetDecktopGroup(1-tp, 3) for tc in aux.Next(g) do
if #dg > 0 then Scl.AddSingleBuff({e:GetHandler(),tc},"+DEF", -300)
Duel.Remove(dg,POS_FACEDOWN,REASON_EFFECT) end
else
local c = e:GetHandler()
if cct >= 3 then
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
local dg = Duel.GetDecktopGroup(1-tp, 3)
if #dg > 0 then
Duel.Remove(dg,POS_FACEDOWN,REASON_EFFECT)
end
end end
end end
end if cct >= 5 then
if cct >= 5 then local f = function(tc)
local f = function(tc) return tc:IsFaceup() and tc:IsDefense(0)
return tc:IsFaceup() and tc:IsDefense(0) end
local g = Duel.GetMatchingGroup(f,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g > 0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end end
local g = Duel.GetMatchingGroup(f,tp,LOCATION_MZONE,LOCATION_MZONE) if cct >= 11 then
if #g > 0 then local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "BeforeEffectResolving", nil, nil, nil, nil, s.discon, s.disop, RESET_EP_SCL)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
end end
if cct >= 11 then
local e1 = Scl.CreateFieldTriggerContinousEffect({c, tp}, "BeforeEffectResolving", nil, nil, nil, nil, s.discon, s.disop, RESET_EP_SCL)
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,32 +40,34 @@ function s.mixtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -37,32 +40,34 @@ 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 g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
Scl.AddSingleBuff({e:GetHandler(),tc},"+ATK", 400)
end
end
function s.op2(e,tp)
local c = e:GetHandler()
local cct = Duel.GetCurrentChain() local cct = Duel.GetCurrentChain()
if cct >= 3 then local op = s.chain_id_scl[cct]
if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and if op == 1 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then local g = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Scl.SelectAndOperateCards("Banish", tp, Card.IsAbleToRemove, tp, "GY", "GY", 1, 1, nil)() for tc in aux.Next(g) do
Scl.AddSingleBuff({e:GetHandler(),tc},"+ATK", 400)
end end
end else
if cct >= 5 then local c = e:GetHandler()
Scl.SelectAndOperateCards("SpecialSummon", tp, aux.NecroValleyFilter(Scl.IsCanBeSpecialSummonedNormaly2), tp, "GY", "GY", 1, 1, nil, e, tp)() if cct >= 3 then
end if c:IsRelateToChain(0) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and
if cct >= 13 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) > 0 then
local f = function(te,tc) Scl.SelectAndOperateCards("Banish", tp, Card.IsAbleToRemove, tp, "GY", "GY", 1, 1, nil)()
return not Scl.IsSeries(tc, "LordOfChain") end
end
if cct >= 5 then
Scl.SelectAndOperateCards("SpecialSummon", tp, aux.NecroValleyFilter(Scl.IsCanBeSpecialSummonedNormaly2), tp, "GY", "GY", 1, 1, nil, e, tp)()
end
if cct >= 13 then
local f = function(te,tc)
return not Scl.IsSeries(tc, "LordOfChain")
end
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)
end end
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)
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