Commit 03268b89 authored by Nemo Ma's avatar Nemo Ma

fix

parent 20418ad1
......@@ -1418,7 +1418,7 @@ function Scl.RegisterEffect(reg_obj, reg_eff)
local owner, handler, ignore = Scl.GetRegisterInfo(reg_obj)
if type(handler) == "number" then
Duel.RegisterEffect(reg_eff, handler)
else
elseif aux.GetValueType(handler) == "Card" then
handler:RegisterEffect(reg_eff, ignore)
end
return reg_eff, reg_eff:GetFieldID()
......@@ -3229,7 +3229,7 @@ end
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 == "ExtraOperation", 2.extra_operate_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
......@@ -4717,7 +4717,7 @@ function Scl.ActivateSepllOrTrap(tc, actp, apply_effect, lim_zone)
local tg = te:GetTarget() or aux.TRUE
local op = te:GetOperation() or aux.TRUE
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
if zone == LOCATION_FZONE then
Duel.RaiseEvent(tc, 4179255, te, 0, tp, tp, Duel.GetCurrentChain())
......@@ -5306,7 +5306,7 @@ end
3. Love.IsLinkSeries(c) -- equal to Scl.IsLinkSeries(c, "YiFanJiang")
4. Love.IsPreviousSeries(c) -- equal to Scl.IsPreviousSeries(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)
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)
......@@ -6862,9 +6862,9 @@ Scl.RaiseGlobalSetEvent()
--[[
10100000 -- Scl's library QQ852415212
10100000 -- Scl's library QQ852415212
60152900 -- LaiBill's library QQ529508379
60152900 -- LaiBill's library QQ529508379
B2Sayaka -- "Miki Sayaka"
......
......@@ -43,7 +43,7 @@ rscode.Phase_Leave_Flag = FLAG_PHASE_OPERATE_SCL
rscode.Extra_Synchro_Material = EFFECT_EXTRA_SYNCHRO_MATERIAL_SCL
rscode.Extra_Xyz_Material = EFFECT_EXTRA_XYZ_MATERIAL_SCL
rscode.Utility_Xyz_Material = EFFECT_UTILITY_XYZ_MATERIAL_SCL
rscode.Previous_Set_Code = FLAG_PREVIOUS_XYZ_MATERIAL_SCL
rscode.Previous_Set_Code = FLAG_PREVIOUS_XYZ_MATERIAL_SCL
rscode.Pre_Complete_Proc = EFFECT_COMPLETE_SUMMON_PROC_SCL
rscode.Set = EVENT_SET_SCL
......@@ -64,103 +64,103 @@ rsloc.all = 0xff
s.sum_list = {
["sp"] = "SpecialSummon", ["adv"] = "TributeSummon", ["rit"] = "RitualSummon"
, ["fus"] = "FusionSummon", ["syn"] = "SynchroSummon", ["xyz"] = "XyzSummon"
, ["link"] = "LinkSummon", ["pen"] = "PendulumSummon"
["sp"] = "SpecialSummon", ["adv"] = "TributeSummon", ["rit"] = "RitualSummon"
, ["fus"] = "FusionSummon", ["syn"] = "SynchroSummon", ["xyz"] = "XyzSummon"
, ["link"] = "LinkSummon", ["pen"] = "PendulumSummon"
}
s.flag_list = {
["tg"] = "Target", ["ptg"] = "PlayerTarget", ["de"] = "Delay", ["dsp"] = "DamageStep"
, ["dcal"] = "DamageCalculation", ["ii"] = "IgnoreImmune", ["sa"] = "SetAvailable", ["ir"] = "IgnoreZone"
, ["sr"] = "BuffZone", ["bs"] = "BothSide", ["uc"] = "Uncopyable"
, ["ch"] = "ClientHint", ["lz"] = "LimitActivateZone", ["atg"] = "AbsoluteTarget"
, ["sp"] = "SummonParama", ["ep"] = "EventPlayer", ["oa"] = "Oath" , ["ntr"] = "NoTurnReset"
, ["neg~"] = "!NegateActivation"
, ["cn"] = "!NegateEffect", ["dise~"] = "!NegateEffect2"
, ["cd"] = "!NegateEffect" , ["dis~"] = "!NegateEffect"
["tg"] = "Target", ["ptg"] = "PlayerTarget", ["de"] = "Delay", ["dsp"] = "DamageStep"
, ["dcal"] = "DamageCalculation", ["ii"] = "IgnoreImmune", ["sa"] = "SetAvailable", ["ir"] = "IgnoreZone"
, ["sr"] = "BuffZone", ["bs"] = "BothSide", ["uc"] = "Uncopyable"
, ["ch"] = "ClientHint", ["lz"] = "LimitActivateZone", ["atg"] = "AbsoluteTarget"
, ["sp"] = "SummonParama", ["ep"] = "EventPlayer", ["oa"] = "Oath" , ["ntr"] = "NoTurnReset"
, ["neg~"] = "!NegateActivation"
, ["cn"] = "!NegateEffect", ["dise~"] = "!NegateEffect2"
, ["cd"] = "!NegateEffect" , ["dis~"] = "!NegateEffect"
}
s.ctgy_list = {
["des"] = "Destroy"
, ["rdes"] = "DestroyReplace"
, ["res"] = "Tribute"
, ["rm"] = "Banish"
, ["rmd"] = "BanishFacedown"
, ["se"] = "Search"
, ["th"] = "Add2Hand"
, ["rth"] = "Return2Hand"
, ["td"] = "ShuffleIn2Deck"
, ["tdt"] = "ShuffleIn2DeckTop"
, ["tdb"] = "ShuffleIn2DeckBottom"
, ["ptdt"] = "PlaceOnDeckTop"
, ["ptdb"] = "PlaceOnDeckBottom"
, ["te"] = "Return2Extra"
, ["tde"] = "ShuffleIn2Deck/ExtraAsCost"
, ["pte"] = "Add2ExtraFaceup"
, ["tg"] = "Send2GY"
, ["rtg"] = "Return2GY"
, ["dtg"] = "Discard2GY"
, ["dish"] = "Discard"
, ["dh"] = "Discard"
, ["dishf"] = "DiscardWithFilter"
, ["dhf"] = "DiscardWithFilter"
, ["disd"] = "SendDeckTop2GY"
, ["dd"] = "SendDeckTop2GY"
, ["dr"] = "Draw"
, ["dam"] = "Damage"
, ["rec"] = "GainLP"
, ["sum"] = "NormalSummon"
, ["tk"] = "Token"
, ["sp"] = "SpecialSummon"
, ["cp"] = "ChangePosition"
, ["pos"] = "ChangePosition"
, ["upa"] = "Change2AttackPosition"
, ["upd"] = "Change2FaceupDefensePosition"
, ["dpd"] = "Change2FacedownDefensePosition"
, ["posd"] = "Change2DefensePosition"
, ["ctrl"] = "ChangeControl"
, ["con"] = "ChangeControl"
, ["sctrl"] = "SwitchControl"
, ["dis"] = "NegateEffect"
, ["diss"] = "NegateSummon"
, ["neg"] = "NegateActivation"
, ["eq"] = "Equip"
, ["atk"] = "ChangeATK"
, ["def"] = "ChangeDEF"
, ["ct"] = "PlaceCounter"
, ["pct"] = "PlaceCounter"
, ["rmct"] = "RemoveCounter"
, ["coin"] = "TossCoin"
, ["dice"] = "TossDice"
, ["an"] = "AnnounceCard"
, ["lv"] = "ChangLevel"
, ["fus"] = "FusionSummon"
, ["ga"] = "GYAction"
, ["gsp"] = "SpecialSummonFromGY"
, ["lg"] = "LeaveGY"
, ["cf"] = "Look"
, ["rv"] = "Reveal"
, ["rvep"] = "RevealUntilEP"
, ["tf"] = "PlaceOnField"
, ["act"] = "ActivateCard"
, ["rf"] = "Return2Field"
, ["rtf"] = "Return2Field"
, ["ae"] = "ApplyEffect"
, ["set"] = "SetSpell/Trap"
, ["sset"] = "SetSpell/Trap"
, ["xmat"] = "AttachXyzMaterial"
, ["axmat"] = "AttachXyzMaterial"
, ["rxmat"] = "DetachXyzMaterial"
, ["rmxmat"] = "DetachXyzMaterial"
, ["ms"] = "MoveZone"
, ["dum"] = "Dummy"
, ["self"] = "Self"
, ["oppo"] = "Opponent"
["des"] = "Destroy"
, ["rdes"] = "DestroyReplace"
, ["res"] = "Tribute"
, ["rm"] = "Banish"
, ["rmd"] = "BanishFacedown"
, ["se"] = "Search"
, ["th"] = "Add2Hand"
, ["rth"] = "Return2Hand"
, ["td"] = "ShuffleIn2Deck"
, ["tdt"] = "ShuffleIn2DeckTop"
, ["tdb"] = "ShuffleIn2DeckBottom"
, ["ptdt"] = "PlaceOnDeckTop"
, ["ptdb"] = "PlaceOnDeckBottom"
, ["te"] = "Return2Extra"
, ["tde"] = "ShuffleIn2Deck/ExtraAsCost"
, ["pte"] = "Add2ExtraFaceup"
, ["tg"] = "Send2GY"
, ["rtg"] = "Return2GY"
, ["dtg"] = "Discard2GY"
, ["dish"] = "Discard"
, ["dh"] = "Discard"
, ["dishf"] = "DiscardWithFilter"
, ["dhf"] = "DiscardWithFilter"
, ["disd"] = "SendDeckTop2GY"
, ["dd"] = "SendDeckTop2GY"
, ["dr"] = "Draw"
, ["dam"] = "Damage"
, ["rec"] = "GainLP"
, ["sum"] = "NormalSummon"
, ["tk"] = "Token"
, ["sp"] = "SpecialSummon"
, ["cp"] = "ChangePosition"
, ["pos"] = "ChangePosition"
, ["upa"] = "Change2AttackPosition"
, ["upd"] = "Change2FaceupDefensePosition"
, ["dpd"] = "Change2FacedownDefensePosition"
, ["posd"] = "Change2DefensePosition"
, ["ctrl"] = "ChangeControl"
, ["con"] = "ChangeControl"
, ["sctrl"] = "SwitchControl"
, ["dis"] = "NegateEffect"
, ["diss"] = "NegateSummon"
, ["neg"] = "NegateActivation"
, ["eq"] = "Equip"
, ["atk"] = "ChangeATK"
, ["def"] = "ChangeDEF"
, ["ct"] = "PlaceCounter"
, ["pct"] = "PlaceCounter"
, ["rmct"] = "RemoveCounter"
, ["coin"] = "TossCoin"
, ["dice"] = "TossDice"
, ["an"] = "AnnounceCard"
, ["lv"] = "ChangLevel"
, ["fus"] = "FusionSummon"
, ["ga"] = "GYAction"
, ["gsp"] = "SpecialSummonFromGY"
, ["lg"] = "LeaveGY"
, ["cf"] = "Look"
, ["rv"] = "Reveal"
, ["rvep"] = "RevealUntilEP"
, ["tf"] = "PlaceOnField"
, ["act"] = "ActivateCard"
, ["rf"] = "Return2Field"
, ["rtf"] = "Return2Field"
, ["ae"] = "ApplyEffect"
, ["set"] = "SetSpell/Trap"
, ["sset"] = "SetSpell/Trap"
, ["xmat"] = "AttachXyzMaterial"
, ["axmat"] = "AttachXyzMaterial"
, ["rxmat"] = "DetachXyzMaterial"
, ["rmxmat"] = "DetachXyzMaterial"
, ["ms"] = "MoveZone"
, ["dum"] = "Dummy"
, ["self"] = "Self"
, ["oppo"] = "Opponent"
}
......@@ -296,7 +296,7 @@ rsef.CreatEvent_Set = Scl.RaiseGlobalSetEvent
rsef.SetChainLimit= Scl.SetChainLimit
s.clone_list = {
["code"] = "Code", ["desc"] = "Description", ["flag"] = "Property", ["cate"] = "Category",
["code"] = "Code", ["desc"] = "Description", ["flag"] = "Property", ["cate"] = "Category",
["reset"] = "Reset", ["type"] = "Type", ["con"] = "Condition", ["tg"] = "Target", ["cost"] = "Cost",
["op"] = "Operation", ["value"] = "Value", ["loc"] = "Zone", ["tgrng"] = "TargetRange"
}
......@@ -316,21 +316,21 @@ rsef.QO_OPPONENT_TURN = Scl.CloneEffectAsQucikEffect
rsef.RegisterSolve = Scl.RegisterSolvePart
Effect.RegisterSolve = Scl.RegisterSolvePart
function s.get_default_range(reg_obj)
local reg_range
local reg_owner, reg_handler = Scl.GetRegisterInfo(reg_obj)
if aux.GetValueType(reg_handler) ~= "Card" then return nil end
--(TYPE_PENDULUM , LOCATION_PZONE must manual input)
local type_list = { TYPE_MONSTER, TYPE_FIELD, TYPE_SPELL + TYPE_TRAP }
local reg_obj = { LOCATION_MZONE, LOCATION_FZONE, LOCATION_SZONE }
for idx, card_type in pairs(type_list) do
if reg_handler:IsType(card_type) then
reg_range = reg_obj[idx]
break
end
end
--after begain duel
--if Duel.GetTurnCount() > 0 then reg_range = reg_handler:GetLocation() end
return reg_range
local reg_range
local reg_owner, reg_handler = Scl.GetRegisterInfo(reg_obj)
if aux.GetValueType(reg_handler) ~= "Card" then return nil end
--(TYPE_PENDULUM , LOCATION_PZONE must manual input)
local type_list = { TYPE_MONSTER, TYPE_FIELD, TYPE_SPELL + TYPE_TRAP }
local reg_obj = { LOCATION_MZONE, LOCATION_FZONE, LOCATION_SZONE }
for idx, card_type in pairs(type_list) do
if reg_handler:IsType(card_type) then
reg_range = reg_obj[idx]
break
end
end
--after begain duel
--if Duel.GetTurnCount() > 0 then reg_range = reg_handler:GetLocation() end
return reg_range
end
function s.switch_old_string(desc_obj, ctgy, flag, buff_code)
local desc_obj2 = type(desc_obj) == "string" and s.ctgy_list[desc_obj] or desc_obj
......@@ -516,7 +516,7 @@ function rsef.FV_ExtraMaterial_Self(reg_obj, mat, val_obj, tg, tgrng_obj, con, r
elseif mat == "link" then
att = "ExtraLinkMaterial"
end
local val_obj2 = val_obj or { function(e, c, mg) return c == e:GetHandler(), true end }
local val_obj2 = val_obj or { function(e, c, mg) return c == e:GetHandler(), true end }
local _, _, flag2 = s.switch_old_string(0, 0, flag)
local lim_obj2 = s.switch_old_count_limit(lim_obj)
return Scl.CreateFieldBuffEffect(reg_obj, att, val_obj2, tg, tgrng_obj, LOCATION_EXTRA, con, rst_obj, desc_obj, lim_obj2, flag2)
......@@ -557,7 +557,7 @@ end
function rsef.STO_Flip(reg_obj, desc_obj, lim_obj, ctgy, flag, con, cost, tg, op, rst_obj)
local desc_obj2, ctgy2, flag2 = s.switch_old_string(desc_obj, ctgy, flag)
local lim_obj2 = s.switch_old_count_limit(lim_obj)
return Scl.CreateFlipOptionalEffect(reg_obj, desc_obj2, lim_obj2, ctgy2, flag2, con, cost, tg, op, rst_obj)
return Scl.CreateFlipOptionalEffect(reg_obj, desc_obj2, lim_obj2, ctgy2, flag2, con, cost, tg, op, rst_obj)
end
function rsef.STF_Flip(reg_obj, desc_obj, lim_obj, ctgy, flag, con, cost, tg, op, rst_obj)
local desc_obj2, ctgy2, flag2 = s.switch_old_string(desc_obj, ctgy, flag)
......@@ -625,7 +625,7 @@ function rsef.SC(reg_obj, code, desc_obj, lim_obj, flag, con, op, rst_obj)
return Scl.CreateSingleTriggerContinousEffect(reg_obj, code, desc_obj, lim_obj2, flag2, con, op, rst_obj)
end
function rsef.SC_Easy(reg_obj, code, flag, con, op, reset_obj)
return rsef.SC(reg_obj, code, nil, nil, flag, con, op, reset_obj)
return rsef.SC(reg_obj, code, nil, nil, flag, con, op, reset_obj)
end
function rsef.SC_DestroyReplace(reg_obj, lim_obj, repfilter, tg, op, con, flag, rst_obj)
local _, _, flag2 = s.switch_old_string(0, 0, flag)
......@@ -717,25 +717,25 @@ rstg.token = scl.target_special_summon_token
rssf.CheckTokenSummonable = Scl.IsCanSpecialSummonToken
rssf.SpecialSummonToken = Scl.SpecialSummonToken
function rstg.neg(dn_str, ex_tg)
return function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
dn_str = dn_str or "dum"
return function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
dn_str = dn_str or "dum"
local dn_str2 = s.ctgy_list[dn_str]
local c = e:GetHandler()
local rc = re:GetHandler()
if chkc then return ex_tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc) end
if chk == 0 then return (dn_str ~= "rm" or aux.nbcon(tp, re)) and (ex_tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)) end
local op_cate = Scl.Category_List[dn_str2][2]
local c = e:GetHandler()
local rc = re:GetHandler()
if chkc then return ex_tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc) end
if chk == 0 then return (dn_str ~= "rm" or aux.nbcon(tp, re)) and (ex_tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)) end
local op_cate = Scl.Category_List[dn_str2][2]
local ctgy_list = type(op_cate) == "number" and {op_cate} or op_cate
if #ctgy_list > 0 and rc:IsRelateToEffect(re) then
if #ctgy_list > 0 and rc:IsRelateToEffect(re) then
local res = rsop.Operation_Solve(eg, dn_str, REASON_EFFECT, { }, 0, e, tp, eg, ep, ev, re, r, rp)
if res then
for ctgy in pairs(ctgy_list) do
Duel.SetOperationInfo(0, ctgy, eg, 1, 0, 0)
end
end
end
ex_tg(e, tp, eg, ep, ev, re, r, rp, 1)
end
end
ex_tg(e, tp, eg, ep, ev, re, r, rp, 1)
end
end
function rsop.neg(dn_str, ex_op)
return function(...)
......@@ -749,11 +749,11 @@ function rsop.dis(dn_str, ex_op)
end
function s.get_effect_array(checkfun, endfun, list_typ, a1, a2, a3, ...)
local arr = { }
if type(a1) == "table" and (not a2 or (type(a2) == "table" )) and (not a3 or type(a3) == "table") then
arr = { a1, a2, a3, ... }
else
arr = { { a1, a2, a3, ... } }
end
if type(a1) == "table" and (not a2 or (type(a2) == "table" )) and (not a3 or type(a3) == "table") then
arr = { a1, a2, a3, ... }
else
arr = { { a1, a2, a3, ... } }
end
local cache_arr = Scl.CloneArray(arr)
--boom nil
for idx, arr2 in pairs(arr) do
......@@ -1001,31 +1001,31 @@ end
rscon.excard = scl.cond_is_card_exists
rscon.excard2 = scl.cond_is_card_faceup_exists
function rscon.sumtolz(link_filter, sum_filter)
return function(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local zone = 0
local link_group = Group.CreateGroup()
if rsof.Check_Boolean(link_filter) then
link_group = rsgf.Mix2(c)
else
link_group = Duel.GetMatchingGroup(link_filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, e, tp, eg, ep, ev, re, rp)
end
for tc in aux.Next(link_group) do
zone = zone | tc:GetLinkedZone(tp)
end
return eg:IsExists(rscon.sumtolz_filter, 1, nil, zone, sum_filter, e, tp, eg, ep, ev, re, rp)
end
return function(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local zone = 0
local link_group = Group.CreateGroup()
if rsof.Check_Boolean(link_filter) then
link_group = rsgf.Mix2(c)
else
link_group = Duel.GetMatchingGroup(link_filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, e, tp, eg, ep, ev, re, rp)
end
for tc in aux.Next(link_group) do
zone = zone | tc:GetLinkedZone(tp)
end
return eg:IsExists(rscon.sumtolz_filter, 1, nil, zone, sum_filter, e, tp, eg, ep, ev, re, rp)
end
end
function rscon.sumtolz_filter(c, zone, sum_filter, e, tp, eg, ep, ev, re, rp)
if sum_filter and not sum_filter(c, e, tp, eg, ep, ev, re, rp) then return false end
local seq = c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then
if c:IsControler(1 - tp) then seq = seq + 16 end
else
seq = c:GetPreviousSequence()
if c:GetPreviousControler() == 1 - tp then seq = seq + 16 end
end
return bit.extract(zone, seq) ~= 0
if sum_filter and not sum_filter(c, e, tp, eg, ep, ev, re, rp) then return false end
local seq = c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then
if c:IsControler(1 - tp) then seq = seq + 16 end
else
seq = c:GetPreviousSequence()
if c:GetPreviousControler() == 1 - tp then seq = seq + 16 end
end
return bit.extract(zone, seq) ~= 0
end
function rsop.SelectExPara(a1, ...)
return Scl.SetExtraSelectAndOperateParama(s.ctgy_list[a1], ...)
......@@ -1060,15 +1060,15 @@ end
rsop.GetOperatedCorrectlyCount = Scl.GetCorrectlyOperatedCount
rsop.CheckOperateCorrectly = Scl.IsCorrectlyOperated
function rsop.ToDeckDraw(dp, dct, is_break, check_count)
local res, ct, g = rsop.CheckOperateCorrectly(rsloc.de, check_count)
if not res then return 0 end
if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK) then
Duel.ShuffleDeck(dp)
end
if is_break then
Duel.BreakEffect()
end
return Duel.Draw(dp, dct, REASON_EFFECT)
local res, ct, g = rsop.CheckOperateCorrectly(rsloc.de, check_count)
if not res then return 0 end
if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK) then
Duel.ShuffleDeck(dp)
end
if is_break then
Duel.BreakEffect()
end
return Duel.Draw(dp, dct, REASON_EFFECT)
end
rsop.SendtoHand = Scl.Send2Hand
function rsop.MoveToField_Activate(tc, movep, targetp, zone, pos, enable, zone)
......@@ -1108,26 +1108,26 @@ function rscf.DefineCard(code, inside_series_str)
return m, cm
end
function rscf.DefineSet(setmeta, seriesstring, type_int)
local prefixlist1 = { "", "Fus", "Link", "Pre", "Ori" }
local prefixlist1_fun = { "", "Fusion", "Link", "Previous", "Original" }
local prefixlist2 = { "", "M", "S", "T", "ST" }
local prefixlist2_fun = { nil, TYPE_MONSTER, TYPE_SPELL, TYPE_TRAP, TYPE_SPELL + TYPE_TRAP }
local suffixlist1 = { "", "_th", "_tg", "_td", "_rm", "_sp1", "_sp2" }
local suffixlist1_fun = { nil, Card.IsAbleToHand, Card.IsAbleToGrave, Card.IsAbleToDeck, Card.IsAbleToRemove, rscf.spfilter(), rscf.spfilter2() }
type_int = type_int or ""
for idx1, prefix1 in pairs(prefixlist1) do
for idx2, prefix2 in pairs(prefixlist2) do
for idx3, suffix1 in pairs(suffixlist1) do
setmeta["Is"..prefix1.."Set"..prefix2..type_int..suffix1] = rscf.DefineSet_Fun(prefixlist1_fun[idx1], prefixlist2_fun[idx2], suffixlist1_fun[idx3], seriesstring)
end
end
end
local prefixlist1 = { "", "Fus", "Link", "Pre", "Ori" }
local prefixlist1_fun = { "", "Fusion", "Link", "Previous", "Original" }
local prefixlist2 = { "", "M", "S", "T", "ST" }
local prefixlist2_fun = { nil, TYPE_MONSTER, TYPE_SPELL, TYPE_TRAP, TYPE_SPELL + TYPE_TRAP }
local suffixlist1 = { "", "_th", "_tg", "_td", "_rm", "_sp1", "_sp2" }
local suffixlist1_fun = { nil, Card.IsAbleToHand, Card.IsAbleToGrave, Card.IsAbleToDeck, Card.IsAbleToRemove, rscf.spfilter(), rscf.spfilter2() }
type_int = type_int or ""
for idx1, prefix1 in pairs(prefixlist1) do
for idx2, prefix2 in pairs(prefixlist2) do
for idx3, suffix1 in pairs(suffixlist1) do
setmeta["Is"..prefix1.."Set"..prefix2..type_int..suffix1] = rscf.DefineSet_Fun(prefixlist1_fun[idx1], prefixlist2_fun[idx2], suffixlist1_fun[idx3], seriesstring)
end
end
end
end
function rscf.DefineSet_Fun(prefix1, prefix2, suffix1, seriesstring)
return function(c, ...)
return rscf["Check"..prefix1.."SetCard"](c, seriesstring) and (not prefix2 or c:IsType(prefix2))
and (not suffix1 or suffix1(c, ...))
end
return function(c, ...)
return rscf["Check"..prefix1.."SetCard"](c, seriesstring) and (not prefix2 or c:IsType(prefix2))
and (not suffix1 or suffix1(c, ...))
end
end
function s.get_quick_buff_new_arr(...)
local arr = { ... }
......@@ -1202,10 +1202,10 @@ rscf.IsDarkSynchro = Scl.IsDarkSynchro
rscf.IsDarkTuner = Scl.IsDarkTuner
rscf.DarkTuner = Scl.DarkTuner
function rscf.fufilter(f, ...)
local ext_paramms = { ... }
return function(target)
return f(target, table.unpack(ext_paramms)) and target:IsFaceup()
end
local ext_paramms = { ... }
return function(target)
return f(target, table.unpack(ext_paramms)) and target:IsFaceup()
end
end
function rscf.spfilter(f1, ...)
local list = { ... }
......@@ -1362,7 +1362,7 @@ rscon.negcon = function(dn_filter, pl_fun)
dn_filter = dn_list[dn_filter]
end
if pl_fun then pl_fun = pl_fun and 1 or 0 end
return rscon.disneg("neg", dn_filter, pl_fun)(...)
return rscon.neg(dn_filter, pl_fun)(...)
end
end
rscon.discon = function(dn_filter, pl_fun)
......@@ -1372,7 +1372,7 @@ rscon.discon = function(dn_filter, pl_fun)
dn_filter = dn_list[dn_filter]
end
if pl_fun then pl_fun = pl_fun and 1 or 0 end
return rscon.disneg("dis", dn_filter, pl_fun)(...)
return rscon.dis(dn_filter, pl_fun)(...)
end
end
rsef.QO_NEGATE = function(reg_list, dn_type, lim_list, dn_str, range, con, cost, desc_list, cate, flag, reset_list)
......@@ -1462,200 +1462,200 @@ function rsgf.SelectOperate(sel_hint, g, sp, filter, minct, maxct, except_obj, s
end
function rsef.INDESTRUCTABLE_List(inds_list)
local inds_list2 = string.gsub(inds_list, "battle", "indb")
inds_list2 = string.gsub(inds_list2, "effect", "inde")
inds_list2 = string.gsub(inds_list2, "ct", "indct")
inds_list2 = string.gsub(inds_list2, "all", "ind")
return inds_list2
local inds_list2 = string.gsub(inds_list, "battle", "indb")
inds_list2 = string.gsub(inds_list2, "effect", "inde")
inds_list2 = string.gsub(inds_list2, "ct", "indct")
inds_list2 = string.gsub(inds_list2, "all", "ind")
return inds_list2
end
--Single Val Effect: Cannot destroed
function rsef.SV_INDESTRUCTABLE(reg_list, inds_list, val_list, con, reset_list, flag, desc_list, lim_list)
local inds_list2 = rsef.INDESTRUCTABLE_List(inds_list)
return rsef.SV_Card(reg_list, inds_list2, val_list, nil, flag, con, reset_list, desc_list, lim_list)
local inds_list2 = rsef.INDESTRUCTABLE_List(inds_list)
return rsef.SV_Card(reg_list, inds_list2, val_list, nil, flag, con, reset_list, desc_list, lim_list)
end
--Field Val Effect: Cannot destroed
function rsef.FV_INDESTRUCTABLE(reg_list, inds_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local inds_list2 = rsef.INDESTRUCTABLE_List(inds_list)
return rsef.FV_Card(reg_list, inds_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list, lim_list)
local inds_list2 = rsef.INDESTRUCTABLE_List(inds_list)
return rsef.FV_Card(reg_list, inds_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list, lim_list)
end
--Single Val Effect: Immue effects
function rsef.SV_IMMUNE_EFFECT(reg_list, val, con, reset_list, flag, desc_list)
return rsef.SV_Card(reg_list, "im", val, flag, nil, con, reset_list, desc_list)
return rsef.SV_Card(reg_list, "im", val, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Immue effects
function rsef.FV_IMMUNE_EFFECT(reg_list, val, tg, tg_range_list, con, reset_list, flag, desc_list)
return rsef.FV_Card(reg_list, "im", val, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
return rsef.FV_Card(reg_list, "im", val, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Single Val Effect: Directly set ATK & DEF
function rsef.SV_SET(reg_list, set_list, val_list, con, reset_list, flag, desc_list)
return rsef.SV_Card(reg_list, set_list, val_list, flag, nil, con, reset_list, desc_list)
return rsef.SV_Card(reg_list, set_list, val_list, flag, nil, con, reset_list, desc_list)
end
--Single Val Effect: Directly set other card attribute, except ATK & DEF
function rsef.SV_CHANGE(reg_list, change_list, val_list, con, reset_list, flag, desc_list)
return rsef.SV_Card(reg_list, change_list, val_list, flag, nil, con, reset_list, desc_list)
return rsef.SV_Card(reg_list, change_list, val_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Directly set other card attribute, except ATK & DEF
function rsef.FV_CHANGE(reg_list, change_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
return rsef.FV_Card(reg_list, change_list, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
return rsef.FV_Card(reg_list, change_list, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Single Val Effect: Update attribute
function rsef.SV_UPDATE(reg_list, up_list, val_list, con, reset_list, flag, desc_list)
local str_list = Scl.UniformSclParamaFormat(up_list)
local str_list = Scl.UniformSclParamaFormat(up_list)
local str = ""
for idx, string in pairs(str_list) do
for idx, string in pairs(str_list) do
if idx > 1 then
str = str .. ","
end
str = str .. string .. "+"
end
return rsef.SV_Card(reg_list, str, val_list, flag, nil, con, reset_list, desc_list)
end
return rsef.SV_Card(reg_list, str, val_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Updata some card attributes
function rsef.FV_UPDATE(reg_list, up_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local str_list = Scl.UniformSclParamaFormat(up_list)
local str_list = Scl.UniformSclParamaFormat(up_list)
local str = ""
for idx, string in pairs(str_list) do
for idx, string in pairs(str_list) do
if idx > 1 then
str = str .. ","
end
str = str .. string .. "+"
end
return rsef.FV_Card(reg_list, str, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
return rsef.FV_Card(reg_list, str, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Single Val Effect: Add attribute
function rsef.SV_ADD(reg_list, add_list, val_list, con, reset_list, flag, desc_list)
return rsef.SV_UPDATE(reg_list, add_list, val_list, flag, nil, con, reset_list, desc_list)
return rsef.SV_UPDATE(reg_list, add_list, val_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Directly set other card attribute, except ATK & DEF
function rsef.FV_ADD(reg_list, add_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
return rsef.FV_UPDATE(reg_list, add_list, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
return rsef.FV_UPDATE(reg_list, add_list, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Single Val Effect: Material lim_
function rsef.SV_CANNOT_BE_MATERIAL(reg_list, mat_list, val_list, con, reset_list, flag, desc_list)
local flag2 = rsef.GetRegisterProperty(nil, flag)
flag2 = flag2 | (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
local str_list = Scl.UniformSclParamaFormat(mat_list)
local str_list2 = { }
local string2
for _, string in pairs(str_list) do
string2 = string.sub(string,1,1)
table.insert(str_list2, string2.."mat~")
end
return rsef.SV_Card(reg_list, str_list2, val_list, flag2, nil, con, reset_list, desc_list)
local flag2 = rsef.GetRegisterProperty(nil, flag)
flag2 = flag2 | (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
local str_list = Scl.UniformSclParamaFormat(mat_list)
local str_list2 = { }
local string2
for _, string in pairs(str_list) do
string2 = string.sub(string,1,1)
table.insert(str_list2, string2.."mat~")
end
return rsef.SV_Card(reg_list, str_list2, val_list, flag2, nil, con, reset_list, desc_list)
end
--Single Val Effect: Cannot be battle or card effect target
function rsef.SV_CANNOT_BE_TARGET(reg_list, tg_list, val_list, con, reset_list, flag, desc_list)
local tg_list2 = string.gsub(tg_list, "battle", "tgb~")
tg_list2 = string.gsub(tg_list2, "effect", "tge~")
return rsef.SV_Card(reg_list, tg_list2, val_list, flag, nil, con, reset_list, desc_list)
local tg_list2 = string.gsub(tg_list, "battle", "tgb~")
tg_list2 = string.gsub(tg_list2, "effect", "tge~")
return rsef.SV_Card(reg_list, tg_list2, val_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Cannot be battle or card effect target
function rsef.FV_CANNOT_BE_TARGET(reg_list, tg_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local tg_list2 = string.gsub(tg_list, "battle", "tgb~")
tg_list2 = string.gsub(tg_list2, "effect", "tge~")
return rsef.FV_Card(reg_list, tg_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
local tg_list2 = string.gsub(tg_list, "battle", "tgb~")
tg_list2 = string.gsub(tg_list2, "effect", "tge~")
return rsef.FV_Card(reg_list, tg_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Cannot disable
function rsef.CANNOT_DISABLE_List(dis_list)
local compare_list = { ["dise"] = "dise~", ["dis"] = "dis~", ["act"] = "neg~", ["sum"] = "dsum~", ["sp"] = "dsp~", ["fp"] = "dfp", ["neg"] = "neg~" }
local dis_list2 = Scl.SplitString(dis_list,",")
local dis_list3 = ""
for _, str in pairs(dis_list2) do
dis_list3 = dis_list3 .. compare_list[str] .. ","
end
dis_list3 = string.sub(dis_list3, 1, -2)
return dis_list3
local compare_list = { ["dise"] = "dise~", ["dis"] = "dis~", ["act"] = "neg~", ["sum"] = "dsum~", ["sp"] = "dsp~", ["fp"] = "dfp", ["neg"] = "neg~" }
local dis_list2 = Scl.SplitString(dis_list,",")
local dis_list3 = ""
for _, str in pairs(dis_list2) do
dis_list3 = dis_list3 .. compare_list[str] .. ","
end
dis_list3 = string.sub(dis_list3, 1, -2)
return dis_list3
end
--Single Val Effect: Cannot disable
function rsef.SV_CANNOT_DISABLE(reg_list, dis_list, val_list, con, reset_list, flag, desc_list, range)
local dis_list2 = rsef.CANNOT_DISABLE_List(dis_list)
return rsef.SV_Card(reg_list, dis_list2, val_list, flag, range, con, reset_list, desc_list)
local dis_list2 = rsef.CANNOT_DISABLE_List(dis_list)
return rsef.SV_Card(reg_list, dis_list2, val_list, flag, range, con, reset_list, desc_list)
end
function rsef.SV_CANNOT_DISABLE_val(e, ct)
local te = Duel.GetChainInfo(ct, CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler() == e:GetHandler()
local te = Duel.GetChainInfo(ct, CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler() == e:GetHandler()
end
--Field Val Effect: Cannot Disable
function rsef.FV_CANNOT_DISABLE(reg_list, dis_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local dis_list2 = rsef.CANNOT_DISABLE_List(dis_list)
return rsef.FV_Card(reg_list, dis_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
local dis_list2 = rsef.CANNOT_DISABLE_List(dis_list)
return rsef.FV_Card(reg_list, dis_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Limit List
function rsef.LIMIT_List(lim_list)
local str_list = Scl.UniformSclParamaFormat(lim_list)
local str_list2 = { }
for _, string in pairs(str_list) do
if string ~= "dis" and string ~= "distm" and string ~= "dise"
and string ~= "sbp" and string ~= "sm1" and string ~= "sm2"
and string ~= "sdp" and string ~= "ssp" then
string = string.."~"
end
string = string.gsub(string, "datk~", "atkd~")
table.insert(str_list2, string)
end
return str_list2
local str_list = Scl.UniformSclParamaFormat(lim_list)
local str_list2 = { }
for _, string in pairs(str_list) do
if string ~= "dis" and string ~= "distm" and string ~= "dise"
and string ~= "sbp" and string ~= "sm1" and string ~= "sm2"
and string ~= "sdp" and string ~= "ssp" then
string = string.."~"
end
string = string.gsub(string, "datk~", "atkd~")
table.insert(str_list2, string)
end
return str_list2
end
--Single Val Effect: Other Limit
function rsef.SV_LIMIT(reg_list, lim_list, val_list, con, reset_list, flag, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.SV_Card(reg_list, str_list2, val_list, flag, nil, con, reset_list, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.SV_Card(reg_list, str_list2, val_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Other Limit
function rsef.FV_LIMIT(reg_list, lim_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.FV_Card(reg_list, str_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.FV_Card(reg_list, str_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Other Limit (affect Player)
function rsef.FV_LIMIT_PLAYER(reg_list, lim_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.FV_Player(reg_list, str_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.FV_Player(reg_list, str_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Leave field list
function rsef.REDIRECT_LIST(leave_list)
local str_list = Scl.UniformSclParamaFormat(leave_list)
local str_list2 = { }
for _, string in pairs(str_list) do
if string == "leave" then
table.insert(str_list2, "rlf")
else
table.insert(str_list2, "r"..string)
end
end
return str_list2
local str_list = Scl.UniformSclParamaFormat(leave_list)
local str_list2 = { }
for _, string in pairs(str_list) do
if string == "leave" then
table.insert(str_list2, "rlf")
else
table.insert(str_list2, "r"..string)
end
end
return str_list2
end
--Single Val Effect: Leave field redirect
function rsef.SV_REDIRECT(reg_list, leave_list, val_list, con, reset_list, flag, desc_list)
local str_list2 = rsef.REDIRECT_LIST(leave_list)
return rsef.SV_Card(reg_list, str_list2, val_list, flag, nil, con, reset_list, desc_list)
local str_list2 = rsef.REDIRECT_LIST(leave_list)
return rsef.SV_Card(reg_list, str_list2, val_list, flag, nil, con, reset_list, desc_list)
end
--Field Val Effect: Leave field redirect
function rsef.FV_REDIRECT(reg_list, leave_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local str_list2 = rsef.REDIRECT_LIST(leave_list)
local flag2 = rsef.GetRegisterProperty(nil, flag) | (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SET_AVAILABLE)
if tg_range_list and (tg_range_list[1] == 0xff and tg_range_list[2] == 0xff) then
flag2 = flag2 | EFFECT_FLAG_IGNORE_RANGE
end
return rsef.FV_Card(reg_list, str_list2, val_list, tg, tg_range_list, flag2, nil, con, reset_list, desc_list)
local str_list2 = rsef.REDIRECT_LIST(leave_list)
local flag2 = rsef.GetRegisterProperty(nil, flag) | (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SET_AVAILABLE)
if tg_range_list and (tg_range_list[1] == 0xff and tg_range_list[2] == 0xff) then
flag2 = flag2 | EFFECT_FLAG_IGNORE_RANGE
end
return rsef.FV_Card(reg_list, str_list2, val_list, tg, tg_range_list, flag2, nil, con, reset_list, desc_list)
end
--Single Val Effect: Activate Trap / Quick Spell immediately
function rsef.SV_ACTIVATE_IMMEDIATELY(reg_list, act_list, con, reset_list, flag, desc_list)
local act_list2
local reg_owner, reg_handler = Scl.GetRegisterInfo(reg_list)
if reg_handler:IsComplexType(TYPE_QUICKPLAY + TYPE_SPELL) then
act_list2 = string.gsub(act_list, "hand", "qah")
act_list2 = string.gsub(act_list2, "set", "qas")
elseif reg_handler:IsComplexType(TYPE_TRAP) then
act_list2 = string.gsub(act_list, "hand", "tah")
act_list2 = string.gsub(act_list2, "set", "tas")
end
return rsef.SV_Card(reg_list, act_list2, 1, flag, 0xff, con, reset_list, desc_list)
local act_list2
local reg_owner, reg_handler = Scl.GetRegisterInfo(reg_list)
if reg_handler:IsComplexType(TYPE_QUICKPLAY + TYPE_SPELL) then
act_list2 = string.gsub(act_list, "hand", "qah")
act_list2 = string.gsub(act_list2, "set", "qas")
elseif reg_handler:IsComplexType(TYPE_TRAP) then
act_list2 = string.gsub(act_list, "hand", "tah")
act_list2 = string.gsub(act_list2, "set", "tas")
end
return rsef.SV_Card(reg_list, act_list2, 1, flag, 0xff, con, reset_list, desc_list)
end
--cost: tribute self
function rscost.releaseself(check_mzone, check_exzone)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if chk == 0 then return c:IsReleasable() and (not check_mzone or Duel.GetMZoneCount(tp, c, tp) > 0) and (not check_exzone or Duel.GetLocationCountFromEx(tp, tp, c, exmzone) > 0) end
Duel.Release(c, REASON_COST)
end
return function(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if chk == 0 then return c:IsReleasable() and (not check_mzone or Duel.GetMZoneCount(tp, c, tp) > 0) and (not check_exzone or Duel.GetLocationCountFromEx(tp, tp, c, exmzone) > 0) end
Duel.Release(c, REASON_COST)
end
end
rsof.Table_List = Scl.IsArrayContains_Single
\ No newline at end of file
--死汰ガエル
function c112538374.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(112538374,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -9,36 +11,42 @@ function c112538374.initial_effect(c)
e1:SetTarget(c112538374.sptg)
e1:SetOperation(c112538374.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(112538374,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,112538474)
e2:SetCountLimit(1,112538375)
e2:SetCost(c112538374.hspcost)
e2:SetTarget(c112538374.hsptg)
e2:SetOperation(c112538374.hspop)
c:RegisterEffect(e2)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(112538374,2))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1,112538376)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(c112538374.retcon)
e2:SetTarget(c112538374.rettg)
e2:SetOperation(c112538374.retop)
c:RegisterEffect(e2)
--search
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_REMOVED)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetCountLimit(1,112538574)
e4:SetCondition(c112538374.retcon)
e4:SetTarget(c112538374.rettg)
e4:SetOperation(c112538374.retop)
e4:SetDescription(aux.Stringid(112538374,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,112538377)
e4:SetTarget(c112538374.thtg)
e4:SetOperation(c112538374.thop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_REMOVE)
e5:SetCountLimit(1,112538674)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetTarget(c112538374.thtg)
e5:SetOperation(c112538374.thop)
c:RegisterEffect(e5)
end
function c112538374.costfilter(c)
return c:IsRace(RACE_AQUA) and c:IsDiscardable()
end
......@@ -52,7 +60,7 @@ function c112538374.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c112538374.spfilter(c,e,tp)
return not c:IsCode(112538374) and c:IsSetCard(0x12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x12) and not c:IsCode(112538374) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c112538374.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -67,14 +75,15 @@ function c112538374.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c112538374.rfilter(c)
return not c:IsCode(112538374) and c:IsRace(RACE_AQUA) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(2)
and c:IsAbleToGraveAsCost()
return c:IsLevelBelow(2) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_AQUA)
and not c:IsCode(112538374) and c:IsAbleToGraveAsCost()
end
function c112538374.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c112538374.rfilter,tp,LOCATION_DECK,0,2,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c112538374.rfilter,tp,LOCATION_DECK,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c112538374.rfilter,tp,LOCATION_DECK,0,2,2,nil)
local g=Duel.SelectMatchingCard(tp,c112538374.rfilter,tp,LOCATION_DECK,0,2,2,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c112538374.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -84,36 +93,34 @@ function c112538374.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c112538374.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c112538374.retcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
return Duel.GetTurnPlayer()~=tp
end
function c112538374.retfilter(c)
function c112538374.dffilter(c)
return c:IsRace(RACE_AQUA) and c:IsAbleToDeck()
end
function c112538374.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c112538374.retfilter,tp,LOCATION_GRAVE,0,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c112538374.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Group.CreateGroup()
if c:IsRelateToEffect(e) and c:IsFaceup() then
sg:AddCard(c)
end
local g=Duel.GetMatchingGroup(c112538374.retfilter,tp,LOCATION_GRAVE,0,nil)
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c112538374.dffilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg:Merge(g:Select(tp,1,1,nil))
end
if sg:GetCount()==2 then
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local tc=g:GetFirst()
local gg=Group.FromCards(c,tc)
Duel.SetTargetCard(g)
Duel.SendtoDeck(gg,nil,2,REASON_EFFECT)
end
end
function c112538374.thfilter(c)
return c:IsRace(RACE_AQUA) and not c:IsCode(112538374) and c:IsAbleToHand()
end
......@@ -128,4 +135,4 @@ function c112538374.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
end
......@@ -45,7 +45,7 @@ function cm.filter1(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function cm.filter2(c)
return aux.IsCodeListed(c,99518961) and c:IsType(TYPE_MONSTER)
return aux.IsCodeListed(c,99518961) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.filter3(c,e,tp)
return c:IsLevelBelow(3) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -171,6 +171,8 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
if #BATTLE_ACT_CHECK>0 then
local hash={}
local class=0
......
......@@ -169,6 +169,8 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
if #BATTLE_ACT_CHECK>0 then
local hash={}
local class=0
......
......@@ -147,6 +147,8 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
if #BATTLE_CARD_CHECK>0 then
local hash={}
local class=0
......
......@@ -218,6 +218,8 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
if #BATTLE_CARD_CHECK>0 then
local hash={}
local class=0
......
......@@ -167,6 +167,8 @@ function cm.sfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
local g=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local class=g:GetClassCount(Card.GetCode)
if class>0 then
......
......@@ -191,6 +191,8 @@ function cm.sfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
local g=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local class=g:GetClassCount(Card.GetCode)
if class>0 then
......
......@@ -153,6 +153,8 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
if BATTLE_PHASE_CHECK>0 then
local class=BATTLE_PHASE_CHECK
if class>0 then
......
......@@ -159,6 +159,8 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and c:IsLocation(LOCATION_MZONE) and c:IsDisabled() then return end
if BATTLE_PHASE_CHECK>0 then
local class=BATTLE_PHASE_CHECK
if class>0 then
......
......@@ -81,7 +81,7 @@ function cm.actarget2(e,te,tp)
return not CONVIATRESS_BUFF[te]
end
function cm.extfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782))
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782)) and c:IsAbleToGraveAsCost()
end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -86,7 +86,7 @@ function cm.actarget2(e,te,tp)
return not CONVIATRESS_BUFF[te]
end
function cm.extfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782))
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782)) and c:IsAbleToGraveAsCost()
end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -86,7 +86,7 @@ function cm.actarget2(e,te,tp)
return not CONVIATRESS_BUFF[te]
end
function cm.extfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782))
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782)) and c:IsAbleToGraveAsCost()
end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -130,7 +130,7 @@ function cm.actarget2(e,te,tp)
return not CONVIATRESS_BUFF[te]
end
function cm.extfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782))
return (c:IsLocation(LOCATION_HAND) or c:IsStatus(STATUS_EFFECT_ENABLED)) and (c:IsHasEffect(11451779) or c:IsHasEffect(11451780) or c:IsHasEffect(11451781) or c:IsHasEffect(11451782)) and c:IsAbleToGraveAsCost()
end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -251,11 +251,11 @@ function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if not e:GetHandler():IsRelateToEffect(e) then return end
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(m,1))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -37,8 +37,7 @@ function c117981478.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c117981478.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonCount(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c117981478.spfilter(c,e,tp)
return c:IsSetCard(0xdd) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -130,7 +130,7 @@ function c118776531.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c118776531.mpfilter(c)
return c:IsFaceup() and c:IsCode(21377582)
return c:IsFaceup() and c:IsCode(21377582,57761191)
end
function c118776531.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -20,7 +20,7 @@ function cm.chainfilter(re,tp,cid)
return not re:GetActivateLocation()==LOCATION_HAND
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
if chk==0 then return e:GetHandler():IsDiscardable() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......@@ -29,7 +29,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_HAND
......
......@@ -89,7 +89,7 @@ end
function cm.exsetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
return #mg>0 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or mc:IsSSetable()) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
return #mg>0 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or c:IsSSetable()) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cm.exsetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -89,7 +89,7 @@ end
function cm.exsetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
return #mg>0 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or mc:IsSSetable()) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
return #mg>0 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or c:IsSSetable()) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cm.exsetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_DECK)end)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.spop)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
......
......@@ -103,13 +103,18 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(te1)
end
if tc.aozora_field_effect then
local te2=tc.aozora_field_effect:Clone()
if te2:GetType()&(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_QUICK_F)~=0 then
te2:SetType(EFFECT_TYPE_IGNITION)
te2:SetCode(0)
end
local te=tc.aozora_field_effect
local dest,cat,con,cost,tg,op=te:GetDescription(),te:GetCategory(),te:GetCondition(),te:GetCost(),te:GetTarget(),te:GetOperation()
local te2=Effect.CreateEffect(c)
if dest then te2:SetDescription(dest) end
if cat then te2:SetCategory(cat) end
te2:SetType(EFFECT_TYPE_IGNITION)
te2:SetRange(LOCATION_SZONE)
te2:SetCountLimit(1)
if con then te2:SetCondition(con) end
if cost then te2:SetCost(cost) end
if tg then te2:SetTarget(tg) end
if op then te2:SetOperation(op) end
te2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
c:RegisterEffect(te2)
end
......
......@@ -620,7 +620,7 @@ function cm.actarget3(e,tc,tp)
return Duel.GetLocationCount(p,LOCATION_SZONE)>0 and tc:IsType(TYPE_FIELD) and c:IsLocation(LOCATION_FZONE) and c:IsControler(p) and tc:GetControler()==p and tc~=c
end
function cm.pcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(function(c,tp)return c:GetReasonPlayer()~=tp and c:IsPreviousLocation(LOCATION_DECK) and not c:IsLocation(LOCATION_DECK)end,1,nil,tp) and e:GetHandler():GetSequence()>4
return eg:IsExists(function(c,tp)return c:GetReasonPlayer()==1-tp and c:IsPreviousLocation(LOCATION_DECK) and not c:IsLocation(LOCATION_DECK)end,1,nil,tp) and e:GetHandler():GetSequence()>4
end
function cm.pfilter(c,tp)
return not c:IsLocation(LOCATION_FZONE) and c:GetOriginalType()&TYPE_FIELD~=0 and c:GetActivateEffect():IsActivatable(tp,true,true)
......
......@@ -362,7 +362,7 @@ function cm.IsSumReleasable(c,sc)
end
return res
end
function cm.fselect(g,c)
function cm.fselect(g,c,tp)
local res=true
for tc in aux.Next(g) do if not cm.IsSumReleasable(tc,c) then res=false end end
return res and Duel.GetMZoneCount(tp,g)>0
......@@ -375,14 +375,14 @@ function cm.sumcon(e,c,minc)
if mi<minc then mi=minc end
if ma<mi then return false end
local g=Group.__add(Duel.GetTributeGroup(c),Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,m))
return ma>0 and g:CheckSubGroup(cm.fselect,mi,ma,c)
return ma>0 and g:CheckSubGroup(cm.fselect,mi,ma,c,tp)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp,c,minc)
local mi,ma=c:GetTributeRequirement()
if minc and mi<minc then mi=minc end
local g=Group.__add(Duel.GetTributeGroup(c),Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,m))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:SelectSubGroup(tp,cm.fselect,true,mi,ma,c)
local sg=g:SelectSubGroup(tp,cm.fselect,true,mi,ma,c,tp)
c:SetMaterial(sg)
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.RegisterFlagEffect(tp,m+2500,RESET_PHASE+PHASE_END,0,1) end
Duel.SendtoGrave(sg,REASON_RELEASE+REASON_SUMMON+REASON_MATERIAL)
......@@ -399,7 +399,7 @@ function cm.otcon1(e,c,minc)
if mi<minc then mi=minc end
if ma<mi then return false end
local g=Group.__add(Duel.GetTributeGroup(c),Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,m))
return ma>0 and g:CheckSubGroup(cm.fselect,mi,ma,c)
return ma>0 and g:CheckSubGroup(cm.fselect,mi,ma,c,tp)
else
local mg=Duel.GetMatchingGroup(cm.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
......@@ -412,7 +412,7 @@ function cm.otop1(e,tp,eg,ep,ev,re,r,rp,c,minc)
if minc and mi<minc then mi=minc end
local g=Group.__add(Duel.GetTributeGroup(c),Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,m))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:SelectSubGroup(tp,cm.fselect,true,mi,ma,c)
local sg=g:SelectSubGroup(tp,cm.fselect,true,mi,ma,c,tp)
c:SetMaterial(sg)
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.RegisterFlagEffect(tp,m+2500,RESET_PHASE+PHASE_END,0,1) end
Duel.SendtoGrave(sg,REASON_RELEASE+REASON_SUMMON+REASON_MATERIAL)
......@@ -428,7 +428,7 @@ function cm.otcon2(e,c,minc)
local tp=c:GetControler()
if Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,tp,LOCATION_DECK,0,1,nil,m) and Duel.GetFlagEffect(tp,m+2500)==0 then
local g=Group.__add(Duel.GetTributeGroup(c),Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,m))
return minc<=3 and g:CheckSubGroup(cm.fselect,3,3,c)
return minc<=3 and g:CheckSubGroup(cm.fselect,3,3,c,tp)
else
return minc<=3 and Duel.CheckTribute(c,3)
end
......@@ -437,7 +437,7 @@ function cm.otop2(e,tp,eg,ep,ev,re,r,rp,c,minc)
if Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,tp,LOCATION_DECK,0,1,nil,m) and Duel.GetFlagEffect(tp,m+2500)==0 then
local g=Group.__add(Duel.GetTributeGroup(c),Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,m))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:SelectSubGroup(tp,cm.fselect,true,3,3,c)
local sg=g:SelectSubGroup(tp,cm.fselect,true,3,3,c,tp)
c:SetMaterial(sg)
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.RegisterFlagEffect(tp,m+2500,RESET_PHASE+PHASE_END,0,1) end
Duel.SendtoGrave(sg,REASON_RELEASE+REASON_SUMMON+REASON_MATERIAL)
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
--e1:SetCost(cm.thcost)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
......@@ -34,51 +34,6 @@ function cm.initial_effect(c)
e10:SetTarget(cm.actarget)
e10:SetOperation(cm.costop)
c:RegisterEffect(e10)
if not cm.khonsu then
cm.khonsu=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
cm[0]=Duel.SetOperationInfo
Duel.SetOperationInfo=function(...)
local f1,f2=Duel.GetFlagEffect(0,m),Duel.GetFlagEffect(1,m)
if f1>0 then return cm[0](0,CATEGORY_TOGRAVE,nil,1,1,LOCATION_DECK) end
if f2>0 then return cm[0](0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_DECK) end
if f1==0 and f2==0 then return cm[0](...) end
end
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(function(c)return c:GetActivateEffect()end,0,0xff,0xff,nil)
local reg=Card.RegisterEffect
Card.RegisterEffect=function(sc,se,bool)
if se:IsHasType(EFFECT_TYPE_ACTIVATE) then
local tg=se:GetTarget()
if tg then
se:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end
if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,chk) end
tg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetFlagEffect(tp,m)>0 then Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end
end)
else
se:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetFlagEffect(tp,m)>0 then Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end
end)
end
end
reg(sc,se,bool)
end
for tc in aux.Next(g) do
if tc.initial_effect then
tc:ReplaceEffect(tc:GetOriginalCode(),0)
end
end
Card.RegisterEffect=reg
e:Reset()
end
function cm.mfilter(c,xyzc)
return c:IsXyzType(TYPE_MONSTER) and c:IsXyzLevel(xyzc,7)
......@@ -113,7 +68,7 @@ function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local cat=re:GetCategory()
re:SetCategory(CATEGORY_TOGRAVE)
re:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_END)
......@@ -124,7 +79,7 @@ function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
Duel.ResetFlagEffect(1-tp,m)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local cat,re=e:GetLabel(),e:GetLabelObject()
......@@ -143,7 +98,7 @@ function cm.actarget(e,te,tp)
return te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m+500)>0 then return end
if Duel.GetFlagEffect(e:GetHandler():GetControler(),m+500)>0 then return end
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
Duel.RegisterFlagEffect(tp,m+500,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(e:GetHandler():GetControler(),m+500,RESET_PHASE+PHASE_END,0,1)
end
......@@ -94,6 +94,16 @@ function cm.initial_effect(c)
if not Party_time_globle_check then
Party_time_globle_check=true
Party_time_table={}
function Party_time_rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function Party_time_chain_target(e,te,tp)
return Group.CreateGroup()
end
function Party_time_chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function Party_time_RandomSelect(g,tp,count)
if #g<=0 then return end
if count>#g then count=#g end
......@@ -117,15 +127,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_DECK) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_DECK) then
return _SendtoDeck(tg,1-tg:GetControler(),seq,reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoDeck(tg,tp,seq,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoDeck(tgc,tp,seq,reason)
end
return _SendtoDeck(sg,1-sg:GetFirst():GetControler(),seq,reason)
end
......@@ -139,15 +150,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_HAND) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_HAND|LOCATION_DECK) then
return _SendtoHand(tg,1-tg:GetControler(),reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND)
local sg=tg:Filter(Party_time_rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND|LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoHand(tg,tp,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoHand(tgc,tp,reason)
end
return _SendtoHand(sg,1-sg:GetFirst():GetControler(),reason)
end
......@@ -164,7 +176,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local sg=g:Clone()
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
sg:Merge(ag)
end
......@@ -184,7 +196,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local g=Duel.GetMatchingGroup(f,tp,s,o,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -205,7 +217,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -226,7 +238,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -249,8 +261,8 @@ function cm.initial_effect(c)
ce:SetType(EFFECT_TYPE_FIELD)
ce:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ce:SetTargetRange(1,0)
ce:SetTarget(cm.chain_target)
ce:SetOperation(cm.chain_operation)
ce:SetTarget(Party_time_chain_target)
ce:SetOperation(Party_time_chain_operation)
ce:SetValue(aux.TRUE)
end
return ce
......@@ -265,7 +277,7 @@ function cm.initial_effect(c)
if not cg or cg:GetCount()<=0 then return end
local cg2=cg:Clone()
if aux.GetValueType(ag)=="Group" and Duel.GetFlagEffect(0,7439099)==0 then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
cg2:Merge(ag)
end
......@@ -285,7 +297,7 @@ function cm.initial_effect(c)
local ag=Party_time_table[7439100+id]
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
--
aux.SubGroupCaptured=Group.CreateGroup()
......@@ -305,9 +317,9 @@ function cm.initial_effect(c)
local cg=Group.CreateGroup()
local eg=g:Clone()
local eg1=g:Clone()
local eg2=eg:Filter(cm.rfilter,nil,7439100+id)
local eg2=eg:Filter(Party_time_rfilter,nil,7439100+id)
local sg1=sg:Clone()
local sg2=sg:Filter(cm.rfilter,nil,7439100+id)
local sg2=sg:Filter(Party_time_rfilter,nil,7439100+id)
if not aux.GCheckAdditional then
eg:Sub(eg2)
eg1:Sub(eg2)
......@@ -370,30 +382,30 @@ function cm.initial_effect(c)
end
--_CheckGroupRecursiveCapture=aux.CheckGroupRecursiveCapture
--function aux.CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
-- if Duel.GetCurrentChain()~=0 and Duel.GetFlagEffect(0,7439099)~=0 then
-- local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
-- local ag=Party_time_table[7439100+id]
-- if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
-- sg:AddCard(c)
-- local sg2=sg:Clone()
-- local pg=sg:Filter(cm.rfilter,nil,7439100+id)
-- sg2:Sub(pg)
-- if aux.GCheckAdditional and (c:GetFlagEffectLabel(7439100)~=id and not aux.GCheckAdditional(sg2,c,g,f,min,max,ext_params) ) then
-- sg:RemoveCard(c)
-- return false
-- end
-- local res=#sg>=min and #sg<=max and f(sg2,table.unpack(ext_params))
-- if res then
-- aux.SubGroupCaptured:Clear()
-- aux.SubGroupCaptured:Merge(sg)
-- else
-- res=#sg<max and g:IsExists(aux. CheckGroupRecursiveCapture,1,sg2,sg,g,f,min,max,ext_params)
-- end
-- sg:RemoveCard(c)
-- return res
-- end
-- end
-- return _CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
-- if Duel.GetCurrentChain()~=0 and Duel.GetFlagEffect(0,7439099)~=0 then
-- local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
-- local ag=Party_time_table[7439100+id]
-- if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
-- sg:AddCard(c)
-- local sg2=sg:Clone()
-- local pg=sg:Filter(Party_time_rfilter,nil,7439100+id)
-- sg2:Sub(pg)
-- if aux.GCheckAdditional and (c:GetFlagEffectLabel(7439100)~=id and not aux.GCheckAdditional(sg2,c,g,f,min,max,ext_params) ) then
-- sg:RemoveCard(c)
-- return false
-- end
-- local res=#sg>=min and #sg<=max and f(sg2,table.unpack(ext_params))
-- if res then
-- aux.SubGroupCaptured:Clear()
-- aux.SubGroupCaptured:Merge(sg)
-- else
-- res=#sg<max and g:IsExists(aux. CheckGroupRecursiveCapture,1,sg2,sg,g,f,min,max,ext_params)
-- end
-- sg:RemoveCard(c)
-- return res
-- end
-- end
-- return _CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
--end
_IsCanBeRitualMaterial=Card.IsCanBeRitualMaterial
function Card.IsCanBeRitualMaterial(c,sc)
......@@ -414,7 +426,7 @@ function cm.initial_effect(c)
local g=Duel.GetMatchingGroup(f,tp,LOCATION_HAND,0,cg,...)
if not g or g:GetCount()<=0 then return false end
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -427,16 +439,6 @@ function cm.initial_effect(c)
end
end
end
function cm.chain_target(e,te,tp)
return Group.CreateGroup()
end
function cm.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function cm.rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_DECK,0,1,nil)
end
......
......@@ -94,6 +94,16 @@ function cm.initial_effect(c)
if not Party_time_globle_check then
Party_time_globle_check=true
Party_time_table={}
function Party_time_rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function Party_time_chain_target(e,te,tp)
return Group.CreateGroup()
end
function Party_time_chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function Party_time_RandomSelect(g,tp,count)
if #g<=0 then return end
if count>#g then count=#g end
......@@ -106,8 +116,7 @@ function cm.initial_effect(c)
for i=1,id-1,1 do tc=cg:GetNext() end
end
sg:AddCard(tc)
g:RemoveCard(tc)
cg:DeleteGroup()
cg:RemoveCard(tc)
end
--Duel.HintSelection(g)
Duel.HintSelection(sg)
......@@ -118,15 +127,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_DECK) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_DECK) then
return _SendtoDeck(tg,1-tg:GetControler(),seq,reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoDeck(tg,tp,seq,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoDeck(tgc,tp,seq,reason)
end
return _SendtoDeck(sg,1-sg:GetFirst():GetControler(),seq,reason)
end
......@@ -140,15 +150,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_HAND) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_HAND|LOCATION_DECK) then
return _SendtoHand(tg,1-tg:GetControler(),reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND)
local sg=tg:Filter(Party_time_rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND|LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoHand(tg,tp,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoHand(tgc,tp,reason)
end
return _SendtoHand(sg,1-sg:GetFirst():GetControler(),reason)
end
......@@ -165,7 +176,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local sg=g:Clone()
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
sg:Merge(ag)
end
......@@ -185,7 +196,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local g=Duel.GetMatchingGroup(f,tp,s,o,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -206,7 +217,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -227,7 +238,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -250,8 +261,8 @@ function cm.initial_effect(c)
ce:SetType(EFFECT_TYPE_FIELD)
ce:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ce:SetTargetRange(1,0)
ce:SetTarget(cm.chain_target)
ce:SetOperation(cm.chain_operation)
ce:SetTarget(Party_time_chain_target)
ce:SetOperation(Party_time_chain_operation)
ce:SetValue(aux.TRUE)
end
return ce
......@@ -266,7 +277,7 @@ function cm.initial_effect(c)
if not cg or cg:GetCount()<=0 then return end
local cg2=cg:Clone()
if aux.GetValueType(ag)=="Group" and Duel.GetFlagEffect(0,7439099)==0 then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
cg2:Merge(ag)
end
......@@ -286,7 +297,7 @@ function cm.initial_effect(c)
local ag=Party_time_table[7439100+id]
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
--
aux.SubGroupCaptured=Group.CreateGroup()
......@@ -306,9 +317,9 @@ function cm.initial_effect(c)
local cg=Group.CreateGroup()
local eg=g:Clone()
local eg1=g:Clone()
local eg2=eg:Filter(cm.rfilter,nil,7439100+id)
local eg2=eg:Filter(Party_time_rfilter,nil,7439100+id)
local sg1=sg:Clone()
local sg2=sg:Filter(cm.rfilter,nil,7439100+id)
local sg2=sg:Filter(Party_time_rfilter,nil,7439100+id)
if not aux.GCheckAdditional then
eg:Sub(eg2)
eg1:Sub(eg2)
......@@ -369,6 +380,33 @@ function cm.initial_effect(c)
end
return _SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
--_CheckGroupRecursiveCapture=aux.CheckGroupRecursiveCapture
--function aux.CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
-- if Duel.GetCurrentChain()~=0 and Duel.GetFlagEffect(0,7439099)~=0 then
-- local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
-- local ag=Party_time_table[7439100+id]
-- if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
-- sg:AddCard(c)
-- local sg2=sg:Clone()
-- local pg=sg:Filter(Party_time_rfilter,nil,7439100+id)
-- sg2:Sub(pg)
-- if aux.GCheckAdditional and (c:GetFlagEffectLabel(7439100)~=id and not aux.GCheckAdditional(sg2,c,g,f,min,max,ext_params) ) then
-- sg:RemoveCard(c)
-- return false
-- end
-- local res=#sg>=min and #sg<=max and f(sg2,table.unpack(ext_params))
-- if res then
-- aux.SubGroupCaptured:Clear()
-- aux.SubGroupCaptured:Merge(sg)
-- else
-- res=#sg<max and g:IsExists(aux. CheckGroupRecursiveCapture,1,sg2,sg,g,f,min,max,ext_params)
-- end
-- sg:RemoveCard(c)
-- return res
-- end
-- end
-- return _CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
--end
_IsCanBeRitualMaterial=Card.IsCanBeRitualMaterial
function Card.IsCanBeRitualMaterial(c,sc)
if Duel.GetCurrentChain()~=0 then
......@@ -388,7 +426,7 @@ function cm.initial_effect(c)
local g=Duel.GetMatchingGroup(f,tp,LOCATION_HAND,0,cg,...)
if not g or g:GetCount()<=0 then return false end
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -401,16 +439,6 @@ function cm.initial_effect(c)
end
end
end
function cm.chain_target(e,te,tp)
return Group.CreateGroup()
end
function cm.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function cm.rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function cm.actcon(e)
local g=Duel.GetMatchingGroup(cm.cfilter,e:GetHandlerPlayer(),LOCATION_DECK,0,1,nil)
return g:GetClassCount(Card.GetCode)>=3
......
......@@ -94,6 +94,16 @@ function cm.initial_effect(c)
if not Party_time_globle_check then
Party_time_globle_check=true
Party_time_table={}
function Party_time_rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function Party_time_chain_target(e,te,tp)
return Group.CreateGroup()
end
function Party_time_chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function Party_time_RandomSelect(g,tp,count)
if #g<=0 then return end
if count>#g then count=#g end
......@@ -117,15 +127,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_DECK) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_DECK) then
return _SendtoDeck(tg,1-tg:GetControler(),seq,reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoDeck(tg,tp,seq,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoDeck(tgc,tp,seq,reason)
end
return _SendtoDeck(sg,1-sg:GetFirst():GetControler(),seq,reason)
end
......@@ -139,15 +150,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_HAND) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_HAND|LOCATION_DECK) then
return _SendtoHand(tg,1-tg:GetControler(),reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND)
local sg=tg:Filter(Party_time_rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND|LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoHand(tg,tp,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoHand(tgc,tp,reason)
end
return _SendtoHand(sg,1-sg:GetFirst():GetControler(),reason)
end
......@@ -164,7 +176,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local sg=g:Clone()
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
sg:Merge(ag)
end
......@@ -184,7 +196,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local g=Duel.GetMatchingGroup(f,tp,s,o,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -205,7 +217,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -226,7 +238,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -249,8 +261,8 @@ function cm.initial_effect(c)
ce:SetType(EFFECT_TYPE_FIELD)
ce:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ce:SetTargetRange(1,0)
ce:SetTarget(cm.chain_target)
ce:SetOperation(cm.chain_operation)
ce:SetTarget(Party_time_chain_target)
ce:SetOperation(Party_time_chain_operation)
ce:SetValue(aux.TRUE)
end
return ce
......@@ -265,7 +277,7 @@ function cm.initial_effect(c)
if not cg or cg:GetCount()<=0 then return end
local cg2=cg:Clone()
if aux.GetValueType(ag)=="Group" and Duel.GetFlagEffect(0,7439099)==0 then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
cg2:Merge(ag)
end
......@@ -285,7 +297,7 @@ function cm.initial_effect(c)
local ag=Party_time_table[7439100+id]
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
--
aux.SubGroupCaptured=Group.CreateGroup()
......@@ -305,9 +317,9 @@ function cm.initial_effect(c)
local cg=Group.CreateGroup()
local eg=g:Clone()
local eg1=g:Clone()
local eg2=eg:Filter(cm.rfilter,nil,7439100+id)
local eg2=eg:Filter(Party_time_rfilter,nil,7439100+id)
local sg1=sg:Clone()
local sg2=sg:Filter(cm.rfilter,nil,7439100+id)
local sg2=sg:Filter(Party_time_rfilter,nil,7439100+id)
if not aux.GCheckAdditional then
eg:Sub(eg2)
eg1:Sub(eg2)
......@@ -368,6 +380,33 @@ function cm.initial_effect(c)
end
return _SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
--_CheckGroupRecursiveCapture=aux.CheckGroupRecursiveCapture
--function aux.CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
-- if Duel.GetCurrentChain()~=0 and Duel.GetFlagEffect(0,7439099)~=0 then
-- local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
-- local ag=Party_time_table[7439100+id]
-- if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
-- sg:AddCard(c)
-- local sg2=sg:Clone()
-- local pg=sg:Filter(Party_time_rfilter,nil,7439100+id)
-- sg2:Sub(pg)
-- if aux.GCheckAdditional and (c:GetFlagEffectLabel(7439100)~=id and not aux.GCheckAdditional(sg2,c,g,f,min,max,ext_params) ) then
-- sg:RemoveCard(c)
-- return false
-- end
-- local res=#sg>=min and #sg<=max and f(sg2,table.unpack(ext_params))
-- if res then
-- aux.SubGroupCaptured:Clear()
-- aux.SubGroupCaptured:Merge(sg)
-- else
-- res=#sg<max and g:IsExists(aux. CheckGroupRecursiveCapture,1,sg2,sg,g,f,min,max,ext_params)
-- end
-- sg:RemoveCard(c)
-- return res
-- end
-- end
-- return _CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
--end
_IsCanBeRitualMaterial=Card.IsCanBeRitualMaterial
function Card.IsCanBeRitualMaterial(c,sc)
if Duel.GetCurrentChain()~=0 then
......@@ -387,7 +426,7 @@ function cm.initial_effect(c)
local g=Duel.GetMatchingGroup(f,tp,LOCATION_HAND,0,cg,...)
if not g or g:GetCount()<=0 then return false end
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -400,16 +439,6 @@ function cm.initial_effect(c)
end
end
end
function cm.chain_target(e,te,tp)
return Group.CreateGroup()
end
function cm.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function cm.rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
end
......
......@@ -94,6 +94,16 @@ function cm.initial_effect(c)
if not Party_time_globle_check then
Party_time_globle_check=true
Party_time_table={}
function Party_time_rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function Party_time_chain_target(e,te,tp)
return Group.CreateGroup()
end
function Party_time_chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function Party_time_RandomSelect(g,tp,count)
if #g<=0 then return end
if count>#g then count=#g end
......@@ -117,15 +127,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_DECK) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_DECK) then
return _SendtoDeck(tg,1-tg:GetControler(),seq,reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoDeck(tg,tp,seq,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoDeck(tgc,tp,seq,reason)
end
return _SendtoDeck(sg,1-sg:GetFirst():GetControler(),seq,reason)
end
......@@ -139,15 +150,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_HAND) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_HAND|LOCATION_DECK) then
return _SendtoHand(tg,1-tg:GetControler(),reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND)
local sg=tg:Filter(Party_time_rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND|LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoHand(tg,tp,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoHand(tgc,tp,reason)
end
return _SendtoHand(sg,1-sg:GetFirst():GetControler(),reason)
end
......@@ -164,7 +176,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local sg=g:Clone()
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
sg:Merge(ag)
end
......@@ -184,7 +196,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local g=Duel.GetMatchingGroup(f,tp,s,o,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -205,7 +217,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -226,7 +238,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -249,8 +261,8 @@ function cm.initial_effect(c)
ce:SetType(EFFECT_TYPE_FIELD)
ce:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ce:SetTargetRange(1,0)
ce:SetTarget(cm.chain_target)
ce:SetOperation(cm.chain_operation)
ce:SetTarget(Party_time_chain_target)
ce:SetOperation(Party_time_chain_operation)
ce:SetValue(aux.TRUE)
end
return ce
......@@ -265,7 +277,7 @@ function cm.initial_effect(c)
if not cg or cg:GetCount()<=0 then return end
local cg2=cg:Clone()
if aux.GetValueType(ag)=="Group" and Duel.GetFlagEffect(0,7439099)==0 then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
cg2:Merge(ag)
end
......@@ -285,7 +297,7 @@ function cm.initial_effect(c)
local ag=Party_time_table[7439100+id]
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
--
aux.SubGroupCaptured=Group.CreateGroup()
......@@ -305,9 +317,9 @@ function cm.initial_effect(c)
local cg=Group.CreateGroup()
local eg=g:Clone()
local eg1=g:Clone()
local eg2=eg:Filter(cm.rfilter,nil,7439100+id)
local eg2=eg:Filter(Party_time_rfilter,nil,7439100+id)
local sg1=sg:Clone()
local sg2=sg:Filter(cm.rfilter,nil,7439100+id)
local sg2=sg:Filter(Party_time_rfilter,nil,7439100+id)
if not aux.GCheckAdditional then
eg:Sub(eg2)
eg1:Sub(eg2)
......@@ -368,6 +380,33 @@ function cm.initial_effect(c)
end
return _SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
--_CheckGroupRecursiveCapture=aux.CheckGroupRecursiveCapture
--function aux.CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
-- if Duel.GetCurrentChain()~=0 and Duel.GetFlagEffect(0,7439099)~=0 then
-- local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
-- local ag=Party_time_table[7439100+id]
-- if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
-- sg:AddCard(c)
-- local sg2=sg:Clone()
-- local pg=sg:Filter(Party_time_rfilter,nil,7439100+id)
-- sg2:Sub(pg)
-- if aux.GCheckAdditional and (c:GetFlagEffectLabel(7439100)~=id and not aux.GCheckAdditional(sg2,c,g,f,min,max,ext_params) ) then
-- sg:RemoveCard(c)
-- return false
-- end
-- local res=#sg>=min and #sg<=max and f(sg2,table.unpack(ext_params))
-- if res then
-- aux.SubGroupCaptured:Clear()
-- aux.SubGroupCaptured:Merge(sg)
-- else
-- res=#sg<max and g:IsExists(aux. CheckGroupRecursiveCapture,1,sg2,sg,g,f,min,max,ext_params)
-- end
-- sg:RemoveCard(c)
-- return res
-- end
-- end
-- return _CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
--end
_IsCanBeRitualMaterial=Card.IsCanBeRitualMaterial
function Card.IsCanBeRitualMaterial(c,sc)
if Duel.GetCurrentChain()~=0 then
......@@ -387,7 +426,7 @@ function cm.initial_effect(c)
local g=Duel.GetMatchingGroup(f,tp,LOCATION_HAND,0,cg,...)
if not g or g:GetCount()<=0 then return false end
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -400,16 +439,6 @@ function cm.initial_effect(c)
end
end
end
function cm.chain_target(e,te,tp)
return Group.CreateGroup()
end
function cm.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function cm.rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_HAND+LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil)
end
......
......@@ -94,6 +94,16 @@ function cm.initial_effect(c)
if not Party_time_globle_check then
Party_time_globle_check=true
Party_time_table={}
function Party_time_rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function Party_time_chain_target(e,te,tp)
return Group.CreateGroup()
end
function Party_time_chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function Party_time_RandomSelect(g,tp,count)
if #g<=0 then return end
if count>#g then count=#g end
......@@ -117,15 +127,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_DECK) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_DECK) then
return _SendtoDeck(tg,1-tg:GetControler(),seq,reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoDeck(tg,tp,seq,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoDeck(tgc,tp,seq,reason)
end
return _SendtoDeck(sg,1-sg:GetFirst():GetControler(),seq,reason)
end
......@@ -139,15 +150,16 @@ function cm.initial_effect(c)
if Duel.GetCurrentChain()~=0 then
local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(m)==7439100+id and tg:IsLocation(LOCATION_HAND) then
if not tp and aux.GetValueType(tg)=="Card" and tg:GetFlagEffectLabel(7439100)==7439100+id and tg:IsLocation(LOCATION_HAND|LOCATION_DECK) then
return _SendtoHand(tg,1-tg:GetControler(),reason)
end
if not tp and aux.GetValueType(tg)=="Group" then
local sg=tg:Filter(cm.rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND)
local sg=tg:Filter(Party_time_rfilter,nil,7439100+id):Filter(Card.IsLocation,nil,LOCATION_HAND|LOCATION_DECK)
if sg and sg:GetCount()>0 then
tg:Sub(sg)
if tg and tg:GetCount()>0 then
_SendtoHand(tg,tp,reason)
local tgc=tg:Clone()
tgc:Sub(sg)
if tgc and tgc:GetCount()>0 then
_SendtoHand(tgc,tp,reason)
end
return _SendtoHand(sg,1-sg:GetFirst():GetControler(),reason)
end
......@@ -164,7 +176,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local sg=g:Clone()
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
sg:Merge(ag)
end
......@@ -184,7 +196,7 @@ function cm.initial_effect(c)
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
local g=Duel.GetMatchingGroup(f,tp,s,o,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -205,7 +217,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -226,7 +238,7 @@ function cm.initial_effect(c)
local g=Duel.GetReleaseGroup(sp)
local g=g:Filter(f,cg,...)
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -249,8 +261,8 @@ function cm.initial_effect(c)
ce:SetType(EFFECT_TYPE_FIELD)
ce:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ce:SetTargetRange(1,0)
ce:SetTarget(cm.chain_target)
ce:SetOperation(cm.chain_operation)
ce:SetTarget(Party_time_chain_target)
ce:SetOperation(Party_time_chain_operation)
ce:SetValue(aux.TRUE)
end
return ce
......@@ -265,7 +277,7 @@ function cm.initial_effect(c)
if not cg or cg:GetCount()<=0 then return end
local cg2=cg:Clone()
if aux.GetValueType(ag)=="Group" and Duel.GetFlagEffect(0,7439099)==0 then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
cg2:Merge(ag)
end
......@@ -285,7 +297,7 @@ function cm.initial_effect(c)
local ag=Party_time_table[7439100+id]
if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
--
aux.SubGroupCaptured=Group.CreateGroup()
......@@ -305,9 +317,9 @@ function cm.initial_effect(c)
local cg=Group.CreateGroup()
local eg=g:Clone()
local eg1=g:Clone()
local eg2=eg:Filter(cm.rfilter,nil,7439100+id)
local eg2=eg:Filter(Party_time_rfilter,nil,7439100+id)
local sg1=sg:Clone()
local sg2=sg:Filter(cm.rfilter,nil,7439100+id)
local sg2=sg:Filter(Party_time_rfilter,nil,7439100+id)
if not aux.GCheckAdditional then
eg:Sub(eg2)
eg1:Sub(eg2)
......@@ -368,6 +380,33 @@ function cm.initial_effect(c)
end
return _SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
--_CheckGroupRecursiveCapture=aux.CheckGroupRecursiveCapture
--function aux.CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
-- if Duel.GetCurrentChain()~=0 and Duel.GetFlagEffect(0,7439099)~=0 then
-- local id=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
-- local ag=Party_time_table[7439100+id]
-- if id~=0 and Duel.GetFlagEffect(0,7439100+id)~=0 then
-- sg:AddCard(c)
-- local sg2=sg:Clone()
-- local pg=sg:Filter(Party_time_rfilter,nil,7439100+id)
-- sg2:Sub(pg)
-- if aux.GCheckAdditional and (c:GetFlagEffectLabel(7439100)~=id and not aux.GCheckAdditional(sg2,c,g,f,min,max,ext_params) ) then
-- sg:RemoveCard(c)
-- return false
-- end
-- local res=#sg>=min and #sg<=max and f(sg2,table.unpack(ext_params))
-- if res then
-- aux.SubGroupCaptured:Clear()
-- aux.SubGroupCaptured:Merge(sg)
-- else
-- res=#sg<max and g:IsExists(aux. CheckGroupRecursiveCapture,1,sg2,sg,g,f,min,max,ext_params)
-- end
-- sg:RemoveCard(c)
-- return res
-- end
-- end
-- return _CheckGroupRecursiveCapture(c,sg,g,f,min,max,ext_params)
--end
_IsCanBeRitualMaterial=Card.IsCanBeRitualMaterial
function Card.IsCanBeRitualMaterial(c,sc)
if Duel.GetCurrentChain()~=0 then
......@@ -387,7 +426,7 @@ function cm.initial_effect(c)
local g=Duel.GetMatchingGroup(f,tp,LOCATION_HAND,0,cg,...)
if not g or g:GetCount()<=0 then return false end
if aux.GetValueType(ag)=="Group" then
ag=ag:Filter(cm.rfilter,nil,7439100+id)
ag=ag:Filter(Party_time_rfilter,nil,7439100+id)
if ag:GetCount()~=0 then
g:Merge(ag)
end
......@@ -400,16 +439,6 @@ function cm.initial_effect(c)
end
end
end
function cm.chain_target(e,te,tp)
return Group.CreateGroup()
end
function cm.chain_operation(e,te,tp,tc,mat,sumtype)
if not sumtype then sumtype=SUMMON_TYPE_FUSION end
Duel.SpecialSummon(tc,sumtype,tp,tp,false,false,POS_FACEUP)
end
function cm.rfilter(c,id)
return c:GetFlagEffectLabel(7439100)==id
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_HAND,0,1,nil)
end
......
......@@ -96,9 +96,7 @@ function c79083105.zntg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.IsPlayerAffectedByEffect(tp,79083810) and
Duel.IsPlayerAffectedByEffect(tp,79083910) and
Duel.IsPlayerAffectedByEffect(tp,79083010) and
Duel.IsPlayerAffectedByEffect(tp,79084010) and
Duel.IsPlayerAffectedByEffect(tp,79084110) and
Duel.IsPlayerAffectedByEffect(tp,79084210)
Duel.IsPlayerAffectedByEffect(tp,79084010)
if chk==0 then return not b1 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79083104,0))
local zone=Duel.SelectField(tp,1,LOCATION_ONFIELD,0,flag)
......@@ -273,12 +271,12 @@ function c79083105.srfilter(c,e,tp,check)
end
function c79083105.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingMatchingCard(c79083105.srfilter,tp,LOCATION_DECK,0,1,nil,e,tp,check) end
if chk==0 then return Duel.IsExistingMatchingCard(c79083105.srfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,check) end
end
function c79083105.srop(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c79083105.srfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,check)
local g=Duel.SelectMatchingCard(tp,c79083105.srfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,check)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not (check and tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) and tc:IsType(TYPE_MONSTER) and tc:IsType(TYPE_RITUAL)) or Duel.SelectOption(tp,1190,1152)==0) then
......
......@@ -33,8 +33,8 @@ function c87490445.initial_effect(c)
end
function c87490445.sxxcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(87490445)==0 end
c:RegisterFlagEffect(87490445,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
if chk==0 then return c:GetFlagEffect(87491445)==0 end
c:RegisterFlagEffect(87491445,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c87490445.sxxtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -72,7 +72,7 @@ function c87490445.sxxop2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c87490445.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(87490445)<2 and re:GetHandlerPlayer()~=tp and Duel.IsChainDisablable(ev) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and re:IsActiveType(TYPE_MONSTER)
return c:GetFlagEffect(87490445)<2 and re:GetHandlerPlayer()~=tp and Duel.IsChainDisablable(ev) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and re:IsActiveType(TYPE_MONSTER)
end
function c87490445.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
--魔女术大贤者
function c98920086.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),c98920086.matfilter,true)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920086,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,98920086)
e1:SetCondition(c98920086.thcon)
e1:SetTarget(c98920086.thtg)
e1:SetOperation(c98920086.thop)
c:RegisterEffect(e1)
--cannot be target/effect indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c98920086.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920086,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c98920086.atkcon)
e1:SetCost(c98920086.atkcost)
e1:SetOperation(c98920086.atkop)
c:RegisterEffect(e1)
end
function c98920086.matfilter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c98920086.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c98920086.thfilter(c)
return c:IsSetCard(0x128,0x150) and c:IsAbleToHand()
end
function c98920086.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98920086.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c98920086.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c98920086.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c98920086.indcon(e)
return ep==tp and Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,4,nil,RACE_SPELLCASTER)
end
function c98920086.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
if not c then return false end
if c:IsControler(1-tp) then c=Duel.GetAttacker() end
e:SetLabelObject(c)
return c and c:IsRace(RACE_SPELLCASTER) and c:IsRelateToBattle()
end
function c98920086.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and c:IsHasEffect(83289866,tp)
end
function c98920086.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98920086.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c98920086.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(83289866,tp)
if te then
te:UseCountLimit(tp)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c98920086.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
if c:IsFaceup() and c:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(c:GetAttack()*2)
c:RegisterEffect(e1)
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