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

f

parent a1fd3202
......@@ -82,7 +82,9 @@ scl.black_hole_count = 0
Scl.Mandatory_Effect_Target_Check = false
--Using for function "Scl.RegisterZone" to recording effects' appliable zones.
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
EFFECT_ADDITIONAL_EFFECT_SCL = id + 100
......@@ -1326,6 +1328,8 @@ function Scl.RegisterActivateCountLimit(reg_eff, lim_obj)
if (type(val) == "number" and (val == 3 or val == 0x1)) or
(type(val) == "string" and val == "Share") then
lim_code = EFFECT_COUNT_CODE_SINGLE
elseif type(val) == "string" and val == "Chain" then
lim_code = EFFECT_COUNT_CODE_CHAIN
else
lim_code = lim_obj[2]
end
......@@ -3433,15 +3437,10 @@ end
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
3.
{ 1.list_typ == "ExtraCheck", 2.extra_check_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 }
{ 1.list_typ == "ExtraCost/ExtraTarget", 2.extra_cost_function/extra_target_function }
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.
//return list_typ, extra_operate_function
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_function
]]--
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")
......@@ -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()
total_sel_group2:Merge(mandatory_group)
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
return false
end
......
......@@ -2,7 +2,7 @@
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
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,
s.eqtg, s.eqop)
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, ...)
end
end
end
local ex_type = list_typ == "Cost" and "ExtraCost" or "ExtraTarget"
if checkfun then
table.insert(cache_arr, 1, { "ExtraCheck", checkfun })
table.insert(cache_arr, 1, { ex_type, s.chk_fun(checkfun) })
end
if endfun then
table.insert(cache_arr,{ "ExtraOperation", s.end_fun(endfun) })
table.insert(cache_arr,{ ex_type, s.end_fun(endfun) })
end
local cache_arr2 = Scl.CloneArray(cache_arr)
--switch string
......@@ -876,9 +877,23 @@ function s.get_effect_array(checkfun, endfun, list_typ, a1, a2, a3, ...)
end
return cache_arr2
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)
return function(g1, g2, ...)
return endfun(g1, ...)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return true
end
return endfun(Scl.Last_Selected_Group, e, tp, eg, ep, ev, re, r, rp)
end
end
function rstg.target0(checkfun, endfun, ...)
......@@ -1263,9 +1278,9 @@ function rscf.rdesfilter(f1, ...)
end
function rscf.IsComplexType(c, type1, type2, ...)
if type(type2) == "boolean" then
return Scl.IsType(c, type1, ...)
return Scl.IsCardType(c, type1, ...)
else
return Scl.IsType(c, 0, type1, type2, ...)
return Scl.IsCardType(c, 0, type1, type2, ...)
end
end
Card.IsComplexType = rscf.IsComplexType
......@@ -1369,10 +1384,12 @@ end
rsop.CheckOperateSuccess = rsop.CheckOperateCorrectly
rsef.SV = rsef.SV_Card
rsef.SV_UTILITY_XYZ_MATERIAL = rsef.SV_UtilityXyzMaterial
rsef.SV_ACTIVATE_SPECIAL = rsef.SV_ActivateDirectly_Special
rsef.SV_CANNOT_DISABLE_S = rsef.SV_CannotDisable_NoEffect
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_SELF = rsef.FV_ExtraMaterial_Self
rsef.ACT_EQUIP = rsef.A_Equip
......
--方舟骑士将火照影
c29091651.named_with_Arknight=1
function c29091651.initial_effect(c)
We're no strangers to love
你我对于爱情均非陌生之人
You know the rules and so do I
你对规则知根晓底我也如此
A full commitment's what I'm thinking of
我想给的就是一份真心忠贞
You wouldn't get this from any other guy
这你将不会从其他人那得到
I just wanna tell you how I'm feeling
我只想告诉你我的感受体会
Gotta make you understand
渴望让你也能懂得我的心意
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
绝对不会口出谎言将你伤害
We've known each other for so long
我们相识相知已然太长太久
Your heart's been aching but you're too shy to say it
你心一直作痛你却羞于出口
Inside we both know what's been going on
内心你我都清楚发生着什么
We know the game and we're gonna play it
我们深谙这场游戏将要继续
And if you ask me how I'm feeling
而若你问我此刻我是何情感
Don't tell me you're too blind to see
别告诉我你已盲目视而不见
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
永远不会四处招摇将你伤害
Never ever desert you
永远不会将你抛弃
We've known each other for so long
我们相识相知已然太长太久
Your heart's been aching but
你的心一直隐隐作痛你却是
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
我将永不将你抛弃
aux.AddCodeList(c,29008292)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c29091651.target)
e1:SetOperation(c29091651.activate)
c:RegisterEffect(e1)
end
function c29091651.filter(c,e,tp)
return c:IsCode(29008292)
end
function c29091651.filter2(c,e,tp)
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)
end
function c29091651.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
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)
return b1 or b2
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c29091651.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
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")
local g2=Duel.GetMatchingGroup(c29091651.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
g:Merge(g1)
g:Merge(g2)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
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)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
else
local dam=tc:GetLevel()*400
if Duel.Damage(tp,dam,REASON_EFFECT)~=dam then return end
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
......@@ -29,6 +29,7 @@ function cm.initial_effect(c)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(0x04)
e4:SetTargetRange(0x0c,0x08)
......@@ -38,7 +39,7 @@ function cm.initial_effect(c)
--cannot be target
local e5=Effect.CreateEffect(c)
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:SetRange(0x04)
e5:SetTargetRange(0x0c,0x08)
......@@ -120,5 +121,5 @@ end
function cm.tgifilter(e,c)
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
\ No newline at end of file
......@@ -13,59 +13,38 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTarget(cm.intg)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc01))
e3:SetValue(360)
c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
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
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
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
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
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)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
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
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