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

fix

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