Commit 51e3f389 authored by Nemo Ma's avatar Nemo Ma

f

parent a1fd3202
...@@ -82,7 +82,9 @@ scl.black_hole_count = 0 ...@@ -82,7 +82,9 @@ scl.black_hole_count = 0
Scl.Mandatory_Effect_Target_Check = false Scl.Mandatory_Effect_Target_Check = false
--Using for function "Scl.RegisterZone" to recording effects' appliable zones. --Using for function "Scl.RegisterZone" to recording effects' appliable zones.
Scl.Effect_Zone_List = { } Scl.Effect_Zone_List = { }
--Using for some functions that call the old library (c10199990.lua), like rsop.target2/rstg.target2/rscost.cost2/rsop.target3/rstg.target3/rscost.cost3
Scl.Last_Selected_Group = Group.CreateGroup()
Scl.Last_Selected_Group:KeepAlive()
--Attach extra effect --Attach extra effect
EFFECT_ADDITIONAL_EFFECT_SCL = id + 100 EFFECT_ADDITIONAL_EFFECT_SCL = id + 100
...@@ -1326,6 +1328,8 @@ function Scl.RegisterActivateCountLimit(reg_eff, lim_obj) ...@@ -1326,6 +1328,8 @@ function Scl.RegisterActivateCountLimit(reg_eff, lim_obj)
if (type(val) == "number" and (val == 3 or val == 0x1)) or if (type(val) == "number" and (val == 3 or val == 0x1)) or
(type(val) == "string" and val == "Share") then (type(val) == "string" and val == "Share") then
lim_code = EFFECT_COUNT_CODE_SINGLE lim_code = EFFECT_COUNT_CODE_SINGLE
elseif type(val) == "string" and val == "Chain" then
lim_code = EFFECT_COUNT_CODE_CHAIN
else else
lim_code = lim_obj[2] lim_code = lim_obj[2]
end end
...@@ -3433,15 +3437,10 @@ end ...@@ -3433,15 +3437,10 @@ end
6.oppo max count (default == oppo min count): your opponent's max operate count. 6.oppo max count (default == oppo min count): your opponent's max operate count.
//return list_typ, category_str, category, category_arr, category_str_arr, replace_operation, self_minct, self_maxct, oppo_minct, oppo_maxct //return list_typ, category_str, category, category_arr, category_str_arr, replace_operation, self_minct, self_maxct, oppo_minct, oppo_maxct
3. 3.
{ 1.list_typ == "ExtraCheck", 2.extra_check_function } { 1.list_typ == "ExtraCost/ExtraTarget", 2.extra_cost_function/extra_target_function }
Paramas explain:
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
4.
{ 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_cost_function/extra_target_function: add an additional cost/target to the effect cost/target, call extra_check_function(e, tp, eg, ..., chk, chkc) .
//return list_typ, extra_operate_function //return list_typ, extra_function
]]-- ]]--
function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r, rp) function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r, rp)
--1.list type ("Cost", "~Target", "Target","PlayerTarget","Operation","ExtraCheck","ExtraOperation") --1.list type ("Cost", "~Target", "Target","PlayerTarget","Operation","ExtraCheck","ExtraOperation")
...@@ -3776,6 +3775,8 @@ function s.do_cost_or_target_or_operation(e, tp, eg, ep, ev, re, r, rp, current_ ...@@ -3776,6 +3775,8 @@ function s.do_cost_or_target_or_operation(e, tp, eg, ep, ev, re, r, rp, current_
local total_sel_group2 = total_sel_group:Clone() local total_sel_group2 = total_sel_group:Clone()
total_sel_group2:Merge(mandatory_group) total_sel_group2:Merge(mandatory_group)
if need_operate then if need_operate then
Scl.Last_Selected_Group:Clear()
Scl.Last_Selected_Group:Merge(current_sel_group)
if not s.operate_selected_cost_or_operat_objects(mandatory_group, total_sel_group2, category_str, replace_operation, reason, e, tp, eg, ep, ev, re, r, rp) then if not s.operate_selected_cost_or_operat_objects(mandatory_group, total_sel_group2, category_str, replace_operation, reason, e, tp, eg, ep, ev, re, r, rp) then
return false return false
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID() local s,id = GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e1 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "Equip", nil, local e1 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "Equip", {1, "Chain"},
"Equip", "Target", "Hand,MonsterZone", s.eqcon, nil, "Equip", "Target", "Hand,MonsterZone", s.eqcon, nil,
s.eqtg, s.eqop) s.eqtg, s.eqop)
local e2 = Scl.CreateFieldTriggerContinousEffect(c, "BeforeEffectResolving", nil, nil, nil, "Spell&TrapZone", s.cecon, s.ceop) local e2 = Scl.CreateFieldTriggerContinousEffect(c, "BeforeEffectResolving", nil, nil, nil, "Spell&TrapZone", s.cecon, s.ceop)
......
...@@ -792,11 +792,12 @@ function s.get_effect_array(checkfun, endfun, list_typ, a1, a2, a3, ...) ...@@ -792,11 +792,12 @@ function s.get_effect_array(checkfun, endfun, list_typ, a1, a2, a3, ...)
end end
end end
end end
local ex_type = list_typ == "Cost" and "ExtraCost" or "ExtraTarget"
if checkfun then if checkfun then
table.insert(cache_arr, 1, { "ExtraCheck", checkfun }) table.insert(cache_arr, 1, { ex_type, s.chk_fun(checkfun) })
end end
if endfun then if endfun then
table.insert(cache_arr,{ "ExtraOperation", s.end_fun(endfun) }) table.insert(cache_arr,{ ex_type, s.end_fun(endfun) })
end end
local cache_arr2 = Scl.CloneArray(cache_arr) local cache_arr2 = Scl.CloneArray(cache_arr)
--switch string --switch string
...@@ -876,9 +877,23 @@ function s.get_effect_array(checkfun, endfun, list_typ, a1, a2, a3, ...) ...@@ -876,9 +877,23 @@ function s.get_effect_array(checkfun, endfun, list_typ, a1, a2, a3, ...)
end end
return cache_arr2 return cache_arr2
end end
function s.chk_fun(chkfun)
return function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
if chkc then
return true
end
if chk == 0 then
return chkfun(e, tp, eg, ep, ev, re, r, rp, 0)
end
return true
end
end
function s.end_fun(endfun) function s.end_fun(endfun)
return function(g1, g2, ...) return function(e, tp, eg, ep, ev, re, r, rp, chk)
return endfun(g1, ...) if chk == 0 then
return true
end
return endfun(Scl.Last_Selected_Group, e, tp, eg, ep, ev, re, r, rp)
end end
end end
function rstg.target0(checkfun, endfun, ...) function rstg.target0(checkfun, endfun, ...)
...@@ -1263,9 +1278,9 @@ function rscf.rdesfilter(f1, ...) ...@@ -1263,9 +1278,9 @@ function rscf.rdesfilter(f1, ...)
end end
function rscf.IsComplexType(c, type1, type2, ...) function rscf.IsComplexType(c, type1, type2, ...)
if type(type2) == "boolean" then if type(type2) == "boolean" then
return Scl.IsType(c, type1, ...) return Scl.IsCardType(c, type1, ...)
else else
return Scl.IsType(c, 0, type1, type2, ...) return Scl.IsCardType(c, 0, type1, type2, ...)
end end
end end
Card.IsComplexType = rscf.IsComplexType Card.IsComplexType = rscf.IsComplexType
...@@ -1369,10 +1384,12 @@ end ...@@ -1369,10 +1384,12 @@ end
rsop.CheckOperateSuccess = rsop.CheckOperateCorrectly rsop.CheckOperateSuccess = rsop.CheckOperateCorrectly
rsef.SV = rsef.SV_Card
rsef.SV_UTILITY_XYZ_MATERIAL = rsef.SV_UtilityXyzMaterial rsef.SV_UTILITY_XYZ_MATERIAL = rsef.SV_UtilityXyzMaterial
rsef.SV_ACTIVATE_SPECIAL = rsef.SV_ActivateDirectly_Special rsef.SV_ACTIVATE_SPECIAL = rsef.SV_ActivateDirectly_Special
rsef.SV_CANNOT_DISABLE_S = rsef.SV_CannotDisable_NoEffect rsef.SV_CANNOT_DISABLE_S = rsef.SV_CannotDisable_NoEffect
rsef.SV_EXTRA_MATERIAL = rsef.SV_ExtraMaterial rsef.SV_EXTRA_MATERIAL = rsef.SV_ExtraMaterial
rsef.FV = rsef.FV_Player --- only 33700938 33700940 call this function, and all of them call this function to register a player buff, so don't need to define rsef.FV_Card.
rsef.FV_EXTRA_MATERIAL = rsef.FV_ExtraMaterial rsef.FV_EXTRA_MATERIAL = rsef.FV_ExtraMaterial
rsef.FV_EXTRA_MATERIAL_SELF = rsef.FV_ExtraMaterial_Self rsef.FV_EXTRA_MATERIAL_SELF = rsef.FV_ExtraMaterial_Self
rsef.ACT_EQUIP = rsef.A_Equip rsef.ACT_EQUIP = rsef.A_Equip
......
--方舟骑士将火照影 --方舟骑士将火照影
c29091651.named_with_Arknight=1
function c29091651.initial_effect(c) function c29091651.initial_effect(c)
We're no strangers to love aux.AddCodeList(c,29008292)
你我对于爱情均非陌生之人 --Activate
You know the rules and so do I local e1=Effect.CreateEffect(c)
你对规则知根晓底我也如此 e1:SetCategory(CATEGORY_RELEASE+CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON)
A full commitment's what I'm thinking of e1:SetType(EFFECT_TYPE_ACTIVATE)
我想给的就是一份真心忠贞 e1:SetCode(EVENT_FREE_CHAIN)
You wouldn't get this from any other guy e1:SetTarget(c29091651.target)
这你将不会从其他人那得到 e1:SetOperation(c29091651.activate)
I just wanna tell you how I'm feeling c:RegisterEffect(e1)
我只想告诉你我的感受体会 end
Gotta make you understand function c29091651.filter(c,e,tp)
渴望让你也能懂得我的心意 return c:IsCode(29008292)
Never gonna give you up end
永远不会将你放弃 function c29091651.filter2(c,e,tp)
Never gonna let you down return bit.band(c:GetType(),0x81)==0x81 and c:IsCode(29008292) and Duel.GetLP(tp)>c:GetLevel()*400
永远不会让你失望 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true)
Never gonna run around and desert you end
永远不会四处招摇将你抛弃 function c29091651.target(e,tp,eg,ep,ev,re,r,rp,chk)
Never gonna make you cry if chk==0 then
绝对不会让你哭泣 local mg=Duel.GetRitualMaterial(tp)
Never gonna say goodbye local b1=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,c29091651.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
绝对不会说出再见 local b2=Duel.IsExistingMatchingCard(c29091651.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
Never gonna tell a lie and hurt you return b1 or b2
绝对不会口出谎言将你伤害 end
We've known each other for so long Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
我们相识相知已然太长太久 end
Your heart's been aching but you're too shy to say it function c29091651.activate(e,tp,eg,ep,ev,re,r,rp)
你心一直作痛你却羞于出口 local g=Group.CreateGroup()
Inside we both know what's been going on local mg=Duel.GetRitualMaterial(tp)
内心你我都清楚发生着什么 local g1=Duel.GetMatchingGroup(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,c29091651.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
We know the game and we're gonna play it local g2=Duel.GetMatchingGroup(c29091651.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
我们深谙这场游戏将要继续 g:Merge(g1)
And if you ask me how I'm feeling g:Merge(g2)
而若你问我此刻我是何情感 if g:GetCount()==0 then return end
Don't tell me you're too blind to see Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
别告诉我你已盲目视而不见 local tc=g:Select(tp,1,1,nil):GetFirst()
Never gonna give you up if g1:IsContains(tc) and (not g2:IsContains(tc) or Duel.SelectOption(tp,aux.Stringid(29091651,0),aux.Stringid(29091651,1))==0) then
永远不会将你放弃 mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Never gonna let you down if tc.mat_filter then
永远不会让你失望 mg=mg:Filter(tc.mat_filter,tc,tp)
Never gonna run around and desert you else
永远不会四处招摇将你抛弃 mg:RemoveCard(tc)
Never gonna make you cry end
绝对不会让你哭泣 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Never gonna say goodbye aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
绝对不会说出再见 local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
Never gonna tell a lie and hurt you aux.GCheckAdditional=nil
绝对不会口出谎言将你伤害 if not mat or mat:GetCount()==0 then return end
No I'm never gonna give you up tc:SetMaterial(mat)
永远不会将你放弃 Duel.ReleaseRitualMaterial(mat)
No I'm never gonna let you down Duel.BreakEffect()
永远不会让你失望 Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
No I'll never run around and hurt you tc:CompleteProcedure()
永远不会四处招摇将你伤害 else
Never ever desert you local dam=tc:GetLevel()*400
永远不会将你抛弃 if Duel.Damage(tp,dam,REASON_EFFECT)~=dam then return end
We've known each other for so long tc:SetMaterial(nil)
我们相识相知已然太长太久 Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
Your heart's been aching but tc:CompleteProcedure()
你的心一直隐隐作痛你却是 end
Never gonna give you up
永远不会将你放弃
Never gonna let you down
永远不会让你失望
Never gonna run around and desert you
永远不会寻花问柳将你抛弃
Never gonna make you cry
绝对不会让你哭泣
Never gonna say goodbye
绝对不会说出再见
Never gonna tell a lie and hurt you
绝对不会对你欺瞒将你伤害
No I'm never gonna give you up
永远不会将你放弃
No I'm never gonna let you down
永远不会让你失望
No I'll never run around and hurt you
永远不会寻花问柳将你伤害
I'll never, ever desert you
我将永不将你抛弃
end end
...@@ -29,6 +29,7 @@ function cm.initial_effect(c) ...@@ -29,6 +29,7 @@ function cm.initial_effect(c)
--indes --indes
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(0x04) e4:SetRange(0x04)
e4:SetTargetRange(0x0c,0x08) e4:SetTargetRange(0x0c,0x08)
...@@ -38,7 +39,7 @@ function cm.initial_effect(c) ...@@ -38,7 +39,7 @@ function cm.initial_effect(c)
--cannot be target --cannot be target
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e5:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetRange(0x04) e5:SetRange(0x04)
e5:SetTargetRange(0x0c,0x08) e5:SetTargetRange(0x0c,0x08)
...@@ -120,5 +121,5 @@ end ...@@ -120,5 +121,5 @@ end
function cm.tgifilter(e,c) function cm.tgifilter(e,c)
local g=Duel.GetMatchingGroup(cm.immtg,e:GetHandlerPlayer(),0x04,0,nil) local g=Duel.GetMatchingGroup(cm.immtg,e:GetHandlerPlayer(),0x04,0,nil)
return g:IsContains(c) or Duel.GetMatchingGroup(cm.immtg2,e:GetHandlerPlayer(),0x08,0x08,nil,g):IsContains(c) return (g:IsContains(c) and c:IsFaceup()) or Duel.GetMatchingGroup(cm.immtg2,e:GetHandlerPlayer(),0x08,0x08,nil,g):IsContains(c)
end end
\ No newline at end of file
...@@ -13,59 +13,38 @@ function cm.initial_effect(c) ...@@ -13,59 +13,38 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTarget(cm.intg) e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc01))
e3:SetValue(360) e3:SetValue(360)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand --tohand
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,m) e4:SetCountLimit(1,m)
e4:SetTarget(cm.target) e4:SetTarget(cm.target)
e4:SetOperation(cm.operation) e4:SetOperation(cm.operation)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1,m)
e5:SetTarget(cm.tgtg)
e5:SetOperation(cm.tgop)
c:RegisterEffect(e5)
end
function cm.intg(e,c)
return c~=e:GetHandler() and c:IsSetCard(0xc01) and c:IsType(TYPE_MONSTER)
end end
function cm.filter(c) function cm.filter(c)
return c:IsSetCard(0xc01) and c:IsType(TYPE_TRAP) and c:IsAbleToHand() local b1=c:IsType(TYPE_TRAP) and c:IsAbleToHand()
local b2=bit.band(c:GetType(),0x20004)==0x20004 and c:IsLocation(LOCATION_DECK) and c:IsAbleToGrave()
return c:IsSetCard(0xc01) and (b1 or b2)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then if g:GetCount()<=0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT) local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,g) local b1=tc:IsType(TYPE_TRAP) and tc:IsAbleToHand()
local b2=bit.band(tc:GetType(),0x20004)==0x20004 and tc:IsLocation(LOCATION_DECK) and tc:IsAbleToGrave()
if b1 and (not b2 or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end end
end end
function cm.tgfilter(c)
return c:IsSetCard(0xc01) and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_TRAP) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
\ No newline at end of file
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