Commit 7e53d50f authored by 未闻皂名's avatar 未闻皂名

2022/3/11 模块化Max2

parent 3aca33df
-- Rush Duel 操作 -- Rush Duel 操作
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 内部方法: 选择匹配卡片, 执行操作 -- 内部方法: 选择匹配卡片, 执行操作
function RushDuel._private_action_select_match(hint, filter, tp, s_range, o_range, min, max, expect, hint_selection, confirm, action, ...) function RushDuel._private_action_select_match(hint, filter, tp, s_range, o_range, min, max, expect, hint_selection, confirm, action, ...)
...@@ -68,77 +67,77 @@ function RushDuel._set_spell_trap(g, e, tp, break_effect) ...@@ -68,77 +67,77 @@ function RushDuel._set_spell_trap(g, e, tp, break_effect)
end end
-- 操作: 选择匹配卡片 -- 操作: 选择匹配卡片
function RushDuel.SelectAndDoAction(hint, filter, tp, s, o, min, max, expect, action) function RushDuel.SelectAndDoAction(hint, filter, tp, s_range, o_range, min, max, expect, action)
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_select_match(hint, filter, tp, s, o, min, max, expect, hint_selection, false, action) return RushDuel._private_action_select_match(hint, filter, tp, s_range, o_range, min, max, expect, hint_selection, false, action)
end end
-- 可选操作: 选择匹配卡片 -- 可选操作: 选择匹配卡片
function RushDuel.CanSelectAndDoAction(desc, hint, filter, tp, s, o, min, max, expect, action) function RushDuel.CanSelectAndDoAction(desc, hint, filter, tp, s_range, o_range, min, max, expect, action)
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_can_select_match(desc, hint, filter, tp, s, o, min, max, expect, hint_selection, false, action) return RushDuel._private_action_can_select_match(desc, hint, filter, tp, s_range, o_range, min, max, expect, hint_selection, false, action)
end end
-- 操作: 选择子卡片组 -- 操作: 选择子卡片组
function RushDuel.SelectGroupAndDoAction(hint, filter, check, tp, s, o, min, max, expect, action) function RushDuel.SelectGroupAndDoAction(hint, filter, check, tp, s_range, o_range, min, max, expect, action)
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_select_group(hint, filter, check, tp, s, o, min, max, expect, hint_selection, false, action) return RushDuel._private_action_select_group(hint, filter, check, tp, s_range, o_range, min, max, expect, hint_selection, false, action)
end end
-- 可选操作: 选择子卡片组 -- 可选操作: 选择子卡片组
function RushDuel.CanSelectGroupAndDoAction(desc, hint, filter, check, tp, s, o, min, max, expect, action) function RushDuel.CanSelectGroupAndDoAction(desc, hint, filter, check, tp, s_range, o_range, min, max, expect, action)
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_can_select_group(desc, hint, filter, check, tp, s, o, min, max, expect, hint_selection, false, action) return RushDuel._private_action_can_select_group(desc, hint, filter, check, tp, s_range, o_range, min, max, expect, hint_selection, false, action)
end end
-- 操作: 选择怪兽特殊召唤 -- 操作: 选择怪兽特殊召唤
function RushDuel.SelectAndSpecialSummon(filter, e, tp, s, o, min, max, expect, pos, break_effect) function RushDuel.SelectAndSpecialSummon(filter, e, tp, s_range, o_range, min, max, expect, pos, break_effect)
local ct = RushDuel.GetMZoneCount(tp, max) local ct = RushDuel.GetMZoneCount(tp, max)
if ct >= min then if ct >= min then
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_select_match(HINTMSG_SPSUMMON, filter, tp, s, o, min, ct, expect, hint_selection, false, RushDuel._special_summon, e, tp, pos, break_effect) return RushDuel._private_action_select_match(HINTMSG_SPSUMMON, filter, tp, s_range, o_range, min, ct, expect, hint_selection, false, RushDuel._special_summon, e, tp, pos, break_effect)
end end
return 0 return 0
end end
-- 可选操作: 选择怪兽特殊召唤 -- 可选操作: 选择怪兽特殊召唤
function RushDuel.CanSelectAndSpecialSummon(desc, filter, e, tp, s, o, min, max, expect, pos, break_effect) function RushDuel.CanSelectAndSpecialSummon(desc, filter, e, tp, s_range, o_range, min, max, expect, pos, break_effect)
local ct = RushDuel.GetMZoneCount(tp, max) local ct = RushDuel.GetMZoneCount(tp, max)
if ct >= min then if ct >= min then
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_can_select_match(desc, HINTMSG_SPSUMMON, filter, tp, s, o, min, ct, expect, hint_selection, false, RushDuel._special_summon, e, tp, pos, break_effect) return RushDuel._private_action_can_select_match(desc, HINTMSG_SPSUMMON, filter, tp, s_range, o_range, min, ct, expect, hint_selection, false, RushDuel._special_summon, e, tp, pos, break_effect)
end end
return 0 return 0
end end
-- 操作: 选择魔法·陷阱卡盖放 -- 操作: 选择魔法·陷阱卡盖放
function RushDuel.SelectAndSet(filter, e, tp, s, o, min, max, expect, break_effect) function RushDuel.SelectAndSet(filter, e, tp, s_range, o_range, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max) local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then if ct >= min then
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_select_match(HINTMSG_SET, filter, tp, s, o, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect) return RushDuel._private_action_select_match(HINTMSG_SET, filter, tp, s_range, o_range, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect)
end end
return 0 return 0
end end
-- 可选操作: 选择魔法·陷阱卡盖放 -- 可选操作: 选择魔法·陷阱卡盖放
function RushDuel.CanSelectAndSet(desc, filter, e, tp, s, o, min, max, expect, break_effect) function RushDuel.CanSelectAndSet(desc, filter, e, tp, s_range, o_range, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max) local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then if ct >= min then
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_can_select_match(desc, HINTMSG_SET, filter, tp, s, o, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect) return RushDuel._private_action_can_select_match(desc, HINTMSG_SET, filter, tp, s_range, o_range, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect)
end end
return 0 return 0
end end
-- 操作: 选择魔法·陷阱卡盖放 (子卡片组) -- 操作: 选择魔法·陷阱卡盖放 (子卡片组)
function RushDuel.CanSelectGroupAndSet(filter, check, e, tp, s, o, min, max, expect, break_effect) function RushDuel.CanSelectGroupAndSet(filter, check, e, tp, s_range, o_range, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max) local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then if ct >= min then
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_select_group(HINTMSG_SET, filter, check, tp, s, o, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect) return RushDuel._private_action_select_group(HINTMSG_SET, filter, check, tp, s_range, o_range, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect)
end end
return 0 return 0
end end
-- 可选操作: 选择魔法·陷阱卡盖放 (子卡片组) -- 可选操作: 选择魔法·陷阱卡盖放 (子卡片组)
function RushDuel.CanSelectGroupAndSet(desc, filter, check, e, tp, s, o, min, max, expect, break_effect) function RushDuel.CanSelectGroupAndSet(desc, filter, check, e, tp, s_range, o_range, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max) local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then if ct >= min then
local hint_selection = RushDuel._private_is_include_public(s, o) local hint_selection = RushDuel._private_is_include_public(s_range, o_range)
return RushDuel._private_action_can_select_group(desc, HINTMSG_SET, filter, check, tp, s, o, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect) return RushDuel._private_action_can_select_group(desc, HINTMSG_SET, filter, check, tp, s_range, o_range, min, ct, expect, hint_selection, false, RushDuel._set_spell_trap, e, tp, break_effect)
end end
return 0 return 0
end end
...@@ -236,10 +235,23 @@ function RushDuel.SendToOpponentDeckTop(target, player) ...@@ -236,10 +235,23 @@ function RushDuel.SendToOpponentDeckTop(target, player)
return ct return ct
end end
end end
-- 操作: 返回对方卡组下面 (排序)
function RushDuel.SendToOpponentDeckBottom(target, player)
local g = RushDuel.ToMaximunGroup(target)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, 1, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, 1, REASON_EFFECT, player, 1 - player)
return ct
end
end
-- 可选操作: 抽卡 -- 可选操作: 抽卡
function RushDuel.CanDraw(desc, player, count) function RushDuel.CanDraw(desc, player, count, break_effect)
if Duel.IsPlayerCanDraw(player, count) and Duel.SelectYesNo(player, desc) then if Duel.IsPlayerCanDraw(player, count) and Duel.SelectYesNo(player, desc) then
if break_effect then
Duel.BreakEffect()
end
Duel.Draw(player, count, REASON_EFFECT) Duel.Draw(player, count, REASON_EFFECT)
end end
end end
-- Rush Duel 赋予Buff -- Rush Duel 赋予Buff
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 赋予: 攻守升降 -- 赋予: 攻守升降
function RushDuel.AttachAtkDef(e, c, atk, def, reset) function RushDuel.AttachAtkDef(e, card, atk, def, reset)
if atk ~= nil and atk ~= 0 then if atk ~= nil and atk ~= 0 then
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_UPDATE_ATTACK, atk, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_UPDATE_ATTACK, atk, reset)
end end
if def ~= nil and def ~= 0 and RushDuel.IsCanChangeDef(c) then if def ~= nil and def ~= 0 and RushDuel.IsCanChangeDef(card) then
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_UPDATE_DEFENSE, def, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_UPDATE_DEFENSE, def, reset)
end end
end end
-- 赋予: 等级升降 -- 赋予: 等级升降
function RushDuel.AttachLevel(e, c, lv, reset) function RushDuel.AttachLevel(e, card, level, reset)
return RushDuel.CreateSingleEffect(e, nil, c, EFFECT_UPDATE_LEVEL, lv, reset) return RushDuel.CreateSingleEffect(e, nil, card, EFFECT_UPDATE_LEVEL, level, reset)
end end
-- 赋予: 直接攻击 -- 赋予: 直接攻击
function RushDuel.AttachDirectAttack(e, c, desc, reset) function RushDuel.AttachDirectAttack(e, card, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_DIRECT_ATTACK, nil, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_DIRECT_ATTACK, nil, reset)
end end
-- 赋予: 贯通 -- 赋予: 贯通
function RushDuel.AttachPierce(e, c, desc, reset) function RushDuel.AttachPierce(e, card, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_PIERCE, nil, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_PIERCE, nil, reset)
end end
-- 赋予: 多次攻击 -- 赋予: 多次攻击
function RushDuel.AttachExtraAttack(e, c, value, desc, reset) function RushDuel.AttachExtraAttack(e, card, value, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_EXTRA_ATTACK, value, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_EXTRA_ATTACK, value, reset)
end end
-- 赋予: 全体攻击 -- 赋予: 全体攻击
function RushDuel.AttachAttackAll(e, c, value, desc, reset) function RushDuel.AttachAttackAll(e, card, value, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_ATTACK_ALL, value, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_ATTACK_ALL, value, reset)
end end
-- 赋予: 双重解放 -- 赋予: 双重解放
function RushDuel.AttachDoubleTribute(e, c, value, desc, reset) function RushDuel.AttachDoubleTribute(e, card, value, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_DOUBLE_TRIBUTE, value, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_DOUBLE_TRIBUTE, value, reset)
end
-- 赋予: 效果战斗抗性
function RushDuel.AttachBattleIndes(e, card, value, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_INDESTRUCTABLE_BATTLE, value, reset)
end end
-- 赋予: 效果破坏抗性 -- 赋予: 效果破坏抗性
function RushDuel.AttachEffectIndes(e, c, value, desc, reset) function RushDuel.AttachEffectIndes(e, card, value, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_INDESTRUCTABLE_EFFECT, value, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_INDESTRUCTABLE_EFFECT, value, reset)
end end
-- 赋予: 攻击宣言特效 -- 赋予: 攻击宣言特效
function RushDuel.AttachAttackAnnounce(e, c, operation, desc, reset) function RushDuel.AttachAttackAnnounce(e, card, operation, desc, reset)
local e1 = Effect.CreateEffect(e:GetHandler()) local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
...@@ -50,45 +53,45 @@ function RushDuel.AttachAttackAnnounce(e, c, operation, desc, reset) ...@@ -50,45 +53,45 @@ function RushDuel.AttachAttackAnnounce(e, c, operation, desc, reset)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
end end
e1:SetReset(reset) e1:SetReset(reset)
c:RegisterEffect(e1) card:RegisterEffect(e1)
end end
-- 赋予: 不能直接攻击 -- 赋予: 不能直接攻击
function RD.AttachCannotDirectAttack(e, c, desc, reset) function RushDuel.AttachCannotDirectAttack(e, card, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_CANNOT_DIRECT_ATTACK, nil, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_CANNOT_DIRECT_ATTACK, nil, reset)
end end
-- 赋予: 不能选择攻击目标 -- 赋予: 不能选择攻击目标
function RD.AttachCannotSelectBattleTarget(e, c, value, desc, reset) function RushDuel.AttachCannotSelectBattleTarget(e, card, value, desc, reset)
return RushDuel.CreateSingleEffect(e, desc, c, EFFECT_CANNOT_SELECT_BATTLE_TARGET, value, reset) return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_CANNOT_SELECT_BATTLE_TARGET, value, reset)
end end
-- 赋予: 变更原本攻守 -- 赋予: 变更原本攻守
function RushDuel.SetBaseAtkDef(e, c, atk, def, reset) function RushDuel.SetBaseAtkDef(e, card, atk, def, reset)
if atk ~= nil then if atk ~= nil then
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_SET_BASE_ATTACK, atk, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_SET_BASE_ATTACK, atk, reset)
end end
if def ~= nil and RushDuel.IsCanChangeDef(c) then if def ~= nil and RushDuel.IsCanChangeDef(card) then
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_SET_BASE_DEFENSE, def, nil, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_SET_BASE_DEFENSE, def, nil, reset)
end end
end end
-- 赋予: 交换原本攻守 -- 赋予: 交换原本攻守
function RushDuel.SwapBaseAtkDef(e, c, reset) function RushDuel.SwapBaseAtkDef(e, card, reset)
if RushDuel.IsCanChangeDef(c) then if RushDuel.IsCanChangeDef(card) then
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_SWAP_BASE_AD, nil, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_SWAP_BASE_AD, nil, reset)
end end
end end
-- 赋予: 交换当前攻守 -- 赋予: 交换当前攻守
function RushDuel.SwapAtkDef(e, c, reset) function RushDuel.SwapAtkDef(e, card, reset)
if RushDuel.IsCanChangeDef(c) then if RushDuel.IsCanChangeDef(card) then
local atk = c:GetAttack() local atk = card:GetAttack()
local def = c:GetDefense() local def = card:GetDefense()
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_SET_ATTACK_FINAL, def, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_SET_ATTACK_FINAL, def, reset)
RushDuel.CreateSingleEffect(e, nil, c, EFFECT_SET_DEFENSE_FINAL, atk, reset) RushDuel.CreateSingleEffect(e, nil, card, EFFECT_SET_DEFENSE_FINAL, atk, reset)
end end
end end
-- 赋予: 改变属性 -- 赋予: 改变属性
function RushDuel.ChangeAttribute(e, c, attribute, reset) function RushDuel.ChangeAttribute(e, card, attribute, reset)
return RushDuel.CreateSingleEffect(e, nil, c, EFFECT_CHANGE_ATTRIBUTE, attribute, reset) return RushDuel.CreateSingleEffect(e, nil, card, EFFECT_CHANGE_ATTRIBUTE, attribute, reset)
end end
-- 赋予: 改变种族 -- 赋予: 改变种族
function RushDuel.ChangeRace(e, c, race, reset) function RushDuel.ChangeRace(e, card, race, reset)
return RushDuel.CreateSingleEffect(e, nil, c, EFFECT_CHANGE_RACE, race, reset) return RushDuel.CreateSingleEffect(e, nil, card, EFFECT_CHANGE_RACE, race, reset)
end end
-- Rush Duel 基础 -- Rush Duel 基础
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 新种族 -- 新种族
RACE_CYBORG = 0x2000000 -- 电子人 RACE_CYBORG = 0x2000000 -- 电子人
...@@ -47,7 +46,7 @@ function RushDuel.CreateHintEffect(e, desc, player, s_range, o_range, reset) ...@@ -47,7 +46,7 @@ function RushDuel.CreateHintEffect(e, desc, player, s_range, o_range, reset)
Duel.RegisterEffect(e1, player) Duel.RegisterEffect(e1, player)
return e1 return e1
end end
-- 创建效果: 不能攻击 (自肃) -- 创建效果: 不能攻击 (对玩家效果)
function RushDuel.CreateAttackLimitEffect(e, target, player, s_range, o_range, reset) function RushDuel.CreateAttackLimitEffect(e, target, player, s_range, o_range, reset)
local e1 = Effect.CreateEffect(e:GetHandler()) local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -61,7 +60,7 @@ function RushDuel.CreateAttackLimitEffect(e, target, player, s_range, o_range, r ...@@ -61,7 +60,7 @@ function RushDuel.CreateAttackLimitEffect(e, target, player, s_range, o_range, r
Duel.RegisterEffect(e1, player) Duel.RegisterEffect(e1, player)
return e1 return e1
end end
-- 创建效果: 不能直接攻击 (自肃) -- 创建效果: 不能直接攻击 (对玩家效果)
function RushDuel.CreateCannotDirectAttackEffect(e, target, player, s_range, o_range, reset) function RushDuel.CreateCannotDirectAttackEffect(e, target, player, s_range, o_range, reset)
local e1 = Effect.CreateEffect(e:GetHandler()) local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -75,7 +74,21 @@ function RushDuel.CreateCannotDirectAttackEffect(e, target, player, s_range, o_r ...@@ -75,7 +74,21 @@ function RushDuel.CreateCannotDirectAttackEffect(e, target, player, s_range, o_r
Duel.RegisterEffect(e1, player) Duel.RegisterEffect(e1, player)
return e1 return e1
end end
-- 创建效果: 不能召唤怪兽 (自肃) -- 创建效果: 不能选择攻击目标 (对玩家效果)
function RushDuel.CreateCannotSelectBattleTargetEffect(e, target, player, s_range, o_range, reset)
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(s_range, o_range)
if target ~= nil then
e1:SetTarget(target)
end
e1:SetReset(reset)
Duel.RegisterEffect(e1, player)
return e1
end
-- 创建效果: 不能召唤怪兽 (对玩家效果)
function RushDuel.CreateCannotSummonEffect(e, desc, target, player, s_range, o_range, reset) function RushDuel.CreateCannotSummonEffect(e, desc, target, player, s_range, o_range, reset)
local e1 = Effect.CreateEffect(e:GetHandler()) local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetDescription(desc) e1:SetDescription(desc)
...@@ -90,7 +103,22 @@ function RushDuel.CreateCannotSummonEffect(e, desc, target, player, s_range, o_r ...@@ -90,7 +103,22 @@ function RushDuel.CreateCannotSummonEffect(e, desc, target, player, s_range, o_r
Duel.RegisterEffect(e1, player) Duel.RegisterEffect(e1, player)
return e1 return e1
end end
-- 创建效果: 不能特殊召唤怪兽 (自肃) -- 创建效果: 不能盖放怪兽 (对玩家效果)
function RushDuel.CreateCannotSetMonsterEffect(e, desc, target, player, s_range, o_range, reset)
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetDescription(desc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_MSET)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(s_range, o_range)
if target ~= nil then
e1:SetTarget(target)
end
e1:SetReset(reset)
Duel.RegisterEffect(e1, player)
return e1
end
-- 创建效果: 不能特殊召唤怪兽 (对玩家效果)
function RushDuel.CreateCannotSpecialSummonEffect(e, desc, target, player, s_range, o_range, reset) function RushDuel.CreateCannotSpecialSummonEffect(e, desc, target, player, s_range, o_range, reset)
local e1 = Effect.CreateEffect(e:GetHandler()) local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetDescription(desc) e1:SetDescription(desc)
......
-- Rush Duel 条件 -- Rush Duel 条件
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 条件: 是否为传说卡 -- 条件: 是否为传说卡
function RushDuel.IsLegendCode(card, ...) function RushDuel.IsLegendCode(card, ...)
......
-- Rush Duel 代价 -- Rush Duel 代价
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 内部方法: 选择匹配卡片, 执行操作 -- 内部方法: 选择匹配卡片, 执行操作
function RushDuel._private_cost_select_match(hint, filter, s_range, o_range, min, max, except_self, action) function RushDuel._private_cost_select_match(hint, filter, s_range, o_range, min, max, except_self, action)
...@@ -72,7 +71,7 @@ end ...@@ -72,7 +71,7 @@ end
-- 代价: 选择子卡片组, 返回卡组 (排序) -- 代价: 选择子卡片组, 返回卡组 (排序)
function RushDuel.CostSendGroupToDeckSort(filter, check, field, min, max, except_self, sequence, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after) function RushDuel.CostSendGroupToDeckSort(filter, check, field, min, max, except_self, sequence, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_deck_sort(sequence, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after) local action = RushDuel._private_action_send_deck_sort(sequence, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_group(HINTMSG_TOGRAVE, filter, check, field, 0, min, max, except_self, action) return RushDuel._private_cost_select_group(HINTMSG_TODECK, filter, check, field, 0, min, max, except_self, action)
end end
-- 代价: 支付LP -- 代价: 支付LP
......
-- Rush Duel 辅助函数 -- Rush Duel 辅助函数
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 为效果设置标签 -- 为效果设置标签
function RushDuel.SetLabelAndObject(effect, target, set_label, set_object) function RushDuel.SetLabelAndObject(effect, target, set_label, set_object)
......
-- Rush Duel 极大 -- Rush Duel 极大
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
TYPE_MAXIMUM = 0x400 -- 极大怪兽 TYPE_MAXIMUM = 0x400 -- 极大怪兽
SUMMON_TYPE_MAXIMUM = 0x45000000 -- 极大模式 SUMMON_TYPE_MAXIMUM = 0x45000000 -- 极大模式
......
-- Rush Duel 规则 -- Rush Duel 规则
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 初始化 -- 初始化
function RushDuel.Init() function RushDuel.Init()
......
-- Rush Duel 对象 -- Rush Duel 对象
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
RD = RushDuel
-- 对玩家效果: 抽卡 - 对象 -- 对玩家效果: 抽卡 - 对象
function RushDuel.TargetDraw(player, count) function RushDuel.TargetDraw(player, count)
......
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
end end
--Draw --Draw
function cm.setfilter(c) function cm.setfilter(c)
return RushDuel.IsLegendCode(c,list[1]) and c:IsSSetable() return RD.IsLegendCode(c,list[1]) and c:IsSSetable()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0 return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0
......
...@@ -17,7 +17,7 @@ function cm.costfilter(c) ...@@ -17,7 +17,7 @@ function cm.costfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGraveAsCost()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsAttribute(ATTRIBUTE_DARK) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) return c:IsAttribute(ATTRIBUTE_DARK)
...@@ -45,16 +45,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,16 +45,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),e,tp,LOCATION_GRAVE,0,1,1,nil,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local sg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_GRAVE,0,nil) local sg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_GRAVE,0,nil)
if sg:CheckSubGroup(cm.excheck,3,3) if sg:CheckSubGroup(cm.excheck,3,3) then
and Duel.IsPlayerCanDraw(tp,1) RD.CanDraw(aux.Stringid(m,1),tp,1,true)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
end end
\ No newline at end of file
...@@ -19,51 +19,29 @@ end ...@@ -19,51 +19,29 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.posfilter(c) function cm.filter(c)
return not c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return not c:IsPosition(POS_FACEUP_DEFENSE) and RD.IsCanChangePosition(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter1,tp,LOCATION_MZONE,0,nil)==3 return Duel.GetMatchingGroupCount(cm.confilter1,tp,LOCATION_MZONE,0,nil)==3
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-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.posfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,2,nil, function(g)
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,LOCATION_MZONE,0,1,2,nil) if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 and Duel.GetFlagEffect(tp,m)==0 then
if g:GetCount()>0 then RD.CreateHintEffect(e,aux.Stringid(m,1),tp,0,1,RESET_PHASE+PHASE_END)
Duel.HintSelection(g) RD.CreateCannotDirectAttackEffect(e,nil,tp,0,LOCATION_MZONE,RESET_PHASE+PHASE_END)
if Duel.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 and Duel.GetFlagEffect(tp,m)==0 then local e1=RD.CreateCannotSelectBattleTargetEffect(e,nil,tp,0,LOCATION_MZONE,RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) e1:SetCondition(cm.atkcon)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetValue(cm.atklmt)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(cm.atkcon)
e2:SetValue(cm.atklmt)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--Hint
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(0,1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
end end)
end end
function cm.atkcon(e) function cm.atkcon(e)
return Duel.IsExistingMatchingCard(Card.IsDefensePos,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(Card.IsDefensePos,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
......
...@@ -24,28 +24,14 @@ end ...@@ -24,28 +24,14 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ug=Duel.GetMatchingGroup(cm.upfilter,tp,LOCATION_MZONE,0,nil) local ug=Duel.GetMatchingGroup(cm.upfilter,tp,LOCATION_MZONE,0,nil)
if ug:GetCount()==0 then return end if ug:GetCount()==0 then return end
local tc=ug:GetFirst() ug:ForEach(function(tc)
while tc do RD.AttachAtkDef(e,tc,600,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) end)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=ug:GetNext()
end
local dg=Duel.GetMatchingGroup(cm.downfilter,tp,0,LOCATION_MZONE,nil) local dg=Duel.GetMatchingGroup(cm.downfilter,tp,0,LOCATION_MZONE,nil)
if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
tc=dg:GetFirst() dg:ForEach(function(tc)
while tc do RD.AttachAtkDef(e,tc,-1200,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) end)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=dg:GetNext()
end
end end
end end
\ No newline at end of file
...@@ -13,25 +13,17 @@ function cm.initial_effect(c) ...@@ -13,25 +13,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.desfilter(c) function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
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.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end)
end end
\ No newline at end of file
...@@ -19,7 +19,7 @@ function cm.confilter(c,tp) ...@@ -19,7 +19,7 @@ function cm.confilter(c,tp)
and c:GetPreviousLevelOnField()>=7 and c:GetPreviousLevelOnField()>=7
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelAbove(7) and c:IsRace(RACE_WYRM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelAbove(7) and c:IsRace(RACE_WYRM) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp) return eg:IsExists(cm.confilter,1,nil,tp)
...@@ -30,10 +30,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,10 +30,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),e,tp,LOCATION_GRAVE,0,1,1,nil,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
...@@ -21,24 +21,16 @@ function cm.thfilter(c) ...@@ -21,24 +21,16 @@ function cm.thfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand() return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
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.IsPlayerCanDiscardDeck(tp,1) end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,1,REASON_EFFECT)==0 then return end if RD.SendDeckTopToGraveAndExists(tp,1,cm.exfilter,1,nil) then
local g=Duel.GetOperatedGroup() RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if g:IsExists(cm.exfilter,1,nil) RD.SendToHandAndExists(g,1-tp)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,nil) end)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end end
end end
\ No newline at end of file
...@@ -19,34 +19,14 @@ end ...@@ -19,34 +19,14 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsLevel(7,8) return c:IsFaceup() and c:IsLevel(7,8)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveToDeck(cm.costfilter,5,5)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,5,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,5,5,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,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)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst() local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) RD.AttachAtkDef(e,tc,2000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE) RD.AttachPierce(e,tc,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_UPDATE_ATTACK) end)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end end
\ No newline at end of file
...@@ -16,22 +16,19 @@ end ...@@ -16,22 +16,19 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_WARRIOR) return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_WARRIOR)
end end
function cm.posfilter(c) function cm.filter(c)
return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return c:IsAttackPos() and RD.IsCanChangePosition(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
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.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,0,LOCATION_MZONE,1,2,nil) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end end
\ No newline at end of file
...@@ -31,14 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,14 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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 g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() g:ForEach(function(tc)
while tc do RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) end)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end end
\ No newline at end of file
...@@ -17,26 +17,12 @@ end ...@@ -17,26 +17,12 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost() return c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
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(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end end
\ No newline at end of file
...@@ -20,42 +20,18 @@ function cm.costfilter(c) ...@@ -20,42 +20,18 @@ function cm.costfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_FAIRY) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,1,1)
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.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp) RD.TargetDraw(tp,1)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) RD.Draw()
Duel.Draw(p,d,REASON_EFFECT)
if Duel.GetFlagEffect(tp,m)~=0 then return end if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler()) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_FIELD) RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Hint
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.atktg(e,c) function cm.atktg(e,c)
......
...@@ -21,32 +21,15 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,32 +21,15 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,2,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,2,nil) if RD.SendToHandAndExists(g,1-tp) and Duel.GetFlagEffect(tp,m)==0 then
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then RD.CreateCannotSummonEffect(e,aux.Stringid(m,1),cm.sumlimit,tp,1,0,RESET_PHASE+PHASE_END)
Duel.ConfirmCards(1-tp,g) RD.CreateCannotSetMonsterEffect(e,aux.Stringid(m,2),cm.sumlimit,tp,1,0,RESET_PHASE+PHASE_END)
if Duel.GetFlagEffect(tp,m)==0 then RD.CreateCannotSpecialSummonEffect(e,aux.Stringid(m,3),cm.sumlimit,tp,1,0,RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,2))
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,3))
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTarget(cm.splimit)
Duel.RegisterEffect(e3,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
end end)
end end
function cm.splimit(e,c) function cm.sumlimit(e,c)
return c:IsLocation(LOCATION_HAND) return c:IsLocation(LOCATION_HAND)
end end
\ No newline at end of file
...@@ -23,21 +23,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,21 +23,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,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)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst() local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) RD.AttachAtkDef(e,tc,-500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE) if RD.IsLPBelowOpponent(tp,2000) then
e1:SetCode(EFFECT_UPDATE_ATTACK) RD.AttachAtkDef(e,tc,-1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if Duel.GetLP(1-tp)-Duel.GetLP(tp)>=2000 then
local e2=e1:Clone()
e2:SetValue(-1500)
tc:RegisterEffect(e2)
end end
end end)
end end
\ No newline at end of file
...@@ -16,22 +16,19 @@ end ...@@ -16,22 +16,19 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_FAIRY) return c:IsFaceup() and c:IsRace(RACE_FAIRY)
end end
function cm.tdfilter(c) function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
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.tdfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) RD.SelectAndDoAction(HINTMSG_TODECK,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,0,LOCATION_ONFIELD,1,1,nil) RD.SendToOpponentDeckBottom(g,tp)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,1,REASON_EFFECT)
end
end end
\ No newline at end of file
...@@ -23,19 +23,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,19 +23,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,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)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst() local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) RD.AttachBattleIndes(e,tc,1,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.Recover(1-tp,tc:GetAttack(),REASON_EFFECT) Duel.Recover(1-tp,tc:GetAttack(),REASON_EFFECT)
end end)
end end
\ No newline at end of file
...@@ -24,28 +24,17 @@ function cm.exfilter(c) ...@@ -24,28 +24,17 @@ function cm.exfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FAIRY) return c:IsFaceup() and c:IsRace(RACE_FAIRY)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_FAIRY) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-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 true end if chk==0 then return true end
Duel.SetTargetPlayer(1-tp) RD.TargetDamage(1-tp,500)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
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 p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if RD.Damage()~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if Duel.Damage(p,d,REASON_EFFECT)~=0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),cm.spfilter,e,tp,LOCATION_HAND,0,1,1,nil,POS_FACEUP)
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -17,32 +17,21 @@ function cm.initial_effect(c) ...@@ -17,32 +17,21 @@ function cm.initial_effect(c)
end end
--Special Summon --Special Summon
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelBelow(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(6) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.exfilter(c) function cm.exfilter(c)
return RushDuel.IsLegendCode(c,list[1]) return RD.IsLegendCode(c,list[1])
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
cm.cost=RD.CostSendSelfToGrave()
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.GetMZoneCount(tp,e:GetHandler())>0 if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(cm.spfilter,e,tp,LOCATION_HAND,0,1,1,nil,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.GetOperatedGroup():GetFirst()
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) RD.AttachAtkDef(e,tc,500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Damage(1-tp,500,REASON_EFFECT) Duel.Damage(1-tp,500,REASON_EFFECT)
end end
......
...@@ -16,7 +16,7 @@ function cm.exfilter(c) ...@@ -16,7 +16,7 @@ function cm.exfilter(c)
return c:IsLocation(LOCATION_GRAVE) return c:IsLocation(LOCATION_GRAVE)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelBelow(8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(8) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
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(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,nil) end
...@@ -24,25 +24,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,25 +24,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) RD.SelectAndDoAction(HINTMSG_TOGRAVE,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,7,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,7,nil) if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then local lv=Duel.GetOperatedGroup():Filter(cm.exfilter,nil):GetSum(Card.GetOriginalLevel)
local og=Duel.GetOperatedGroup() if lv>=10 and RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),e,tp,LOCATION_GRAVE,0,1,1,nil,POS_FACEUP)~=0 then
local lv=og:Filter(cm.exfilter,nil):GetSum(Card.GetOriginalLevel) local tc=Duel.GetOperatedGroup():GetFirst()
if lv>=10 and Duel.GetMZoneCount(tp)>0 RD.AttachAtkDef(e,tc,300,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=sg:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end end
end end
end end)
end end
\ No newline at end of file
...@@ -25,10 +25,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,10 +25,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) RD.SelectAndDoAction(HINTMSG_RTOHAND,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil) RD.SendToOpponentHand(g)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end end
\ No newline at end of file
...@@ -8,6 +8,7 @@ Duel.LoadScript("RDCost.lua") ...@@ -8,6 +8,7 @@ Duel.LoadScript("RDCost.lua")
Duel.LoadScript("RDTarget.lua") Duel.LoadScript("RDTarget.lua")
Duel.LoadScript("RDAttach.lua") Duel.LoadScript("RDAttach.lua")
Duel.LoadScript("RDAction.lua") Duel.LoadScript("RDAction.lua")
RD = RushDuel
function Auxiliary.PreloadUds() function Auxiliary.PreloadUds()
RD.Init() RD.Init()
......
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