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

2022/3/11 模块化Max2

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