Commit cdf82987 authored by Clara Grace Paulsen's avatar Clara Grace Paulsen

Merge branch 'master' into 'master'

sync

See merge request !1
parents df99b824 ce19226f
Pipeline #22259 failed with stages
in 7 minutes and 53 seconds
No preview for this file type
No preview for this file type
......@@ -3,3 +3,18 @@
120000000 1 -- 怪兽传说卡 (Legend Monster)
120000001 1 -- 魔法传说卡 (Legend Spell)
120000002 1 -- 陷阱传说卡 (Legend Trap)
#Forbidden
#Limit
120231034 1 -- 超可爱执行者·夜魔女
120226013 1 -- 业火之结界像
120151040 1 -- 寿司天使 龙卷
120160003 1 -- 死灵女仆·小七
120183015 1 -- 火雷神 雷击勇士
120231039 1 -- 超可爱执行者紧急出动!
120203024 1 -- 潜入开始
120203029 1 -- 魔法石采掘
#Semi-Limit
120217035 2 -- 革新制壶陶艺家
\ No newline at end of file
......@@ -11,6 +11,7 @@ function RushDuel._private_action_select_match(hint, filter, tp, s_range, o_rang
return action(g, ...)
end
end
return 0
end
-- 内部方法: 可以选择匹配卡片, 执行操作
function RushDuel._private_action_can_select_match(desc, hint, filter, tp, s_range, o_range, min, max, expect, hint_selection, confirm, action, ...)
......@@ -22,6 +23,7 @@ function RushDuel._private_action_can_select_match(desc, hint, filter, tp, s_ran
return action(g, ...)
end
end
return 0
end
-- 内部方法: 选择子卡片组, 执行操作
function RushDuel._private_action_select_group(hint, filter, check, tp, s_range, o_range, min, max, expect, hint_selection, confirm, action, ...)
......@@ -34,6 +36,7 @@ function RushDuel._private_action_select_group(hint, filter, check, tp, s_range,
return action(sg, ...)
end
end
return 0
end
-- 内部方法: 可以选择子卡片组, 执行操作
function RushDuel._private_action_can_select_group(desc, hint, filter, check, tp, s_range, o_range, min, max, expect, hint_selection, confirm, action, ...)
......@@ -46,17 +49,18 @@ function RushDuel._private_action_can_select_group(desc, hint, filter, check, tp
return action(sg, ...)
end
end
return 0
end
-- 内部方法: 是否包含公开区域
function RushDuel._private_is_include_public(s_range, o_range)
return (s_range | o_range) & (LOCATION_ONFIELD | LOCATION_GRAVE | LOCATION_REMOVED) ~= 0
end
-- 内部方法: 特殊召唤
function RushDuel._special_summon(target, effect, player, position, break_effect)
function RushDuel._special_summon(target, effect, player, position, break_effect, target_player)
if break_effect then
Duel.BreakEffect()
end
local ct = Duel.SpecialSummon(target, 0, player, player, false, false, position)
local ct = Duel.SpecialSummon(target, 0, player, target_player or player, false, false, position)
if (position & POS_FACEDOWN) ~= 0 then
Duel.ConfirmCards(1 - player, target)
end
......@@ -92,34 +96,37 @@ function RushDuel.CanSelectGroupAndDoAction(desc, hint, filter, check, tp, s_ran
end
-- 操作: 选择怪兽特殊召唤
function RushDuel.SelectAndSpecialSummon(filter, tp, s_range, o_range, min, max, expect, e, pos, break_effect)
local ct = RushDuel.GetMZoneCount(tp, max)
function RushDuel.SelectAndSpecialSummon(filter, tp, s_range, o_range, min, max, expect, e, pos, break_effect, target_player)
local ct = RushDuel.GetMZoneCount(target_player or tp, max)
if ct >= min then
return RushDuel._private_action_select_match(HINTMSG_SPSUMMON, filter, tp, s_range, o_range, min, ct, expect, false, 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, false, false, RushDuel._special_summon, e, tp, pos, break_effect, target_player)
end
return 0
end
-- 可选操作: 选择怪兽特殊召唤
function RushDuel.CanSelectAndSpecialSummon(desc, filter, tp, s_range, o_range, min, max, expect, e, pos, break_effect)
local ct = RushDuel.GetMZoneCount(tp, max)
function RushDuel.CanSelectAndSpecialSummon(desc, filter, tp, s_range, o_range, min, max, expect, e, pos, break_effect, target_player)
local ct = RushDuel.GetMZoneCount(target_player or tp, max)
if ct >= min then
return RushDuel._private_action_can_select_match(desc, HINTMSG_SPSUMMON, filter, tp, s_range, o_range, min, ct, expect, false, 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, false, false, RushDuel._special_summon, e, tp, pos, break_effect,
target_player)
end
return 0
end
-- 操作: 选择怪兽特殊召唤 (子卡片组)
function RushDuel.SelectGroupAndSpecialSummon(filter, check, tp, s_range, o_range, min, max, expect, e, pos, break_effect)
local ct = RushDuel.GetMZoneCount(tp, max)
function RushDuel.SelectGroupAndSpecialSummon(filter, check, tp, s_range, o_range, min, max, expect, e, pos, break_effect, target_player)
local ct = RushDuel.GetMZoneCount(target_player or tp, max)
if ct >= min then
return RushDuel._private_action_select_group(HINTMSG_SPSUMMON, filter, check, tp, s_range, o_range, min, ct, expect, false, false, RushDuel._special_summon, e, tp, pos, break_effect)
return RushDuel._private_action_select_group(HINTMSG_SPSUMMON, filter, check, tp, s_range, o_range, min, ct, expect, false, false, RushDuel._special_summon, e, tp, pos, break_effect,
target_player)
end
return 0
end
-- 可选操作: 选择怪兽特殊召唤 (子卡片组)
function RushDuel.CanSelectGroupAndSpecialSummon(desc, filter, check, tp, s_range, o_range, min, max, expect, e, pos, break_effect)
local ct = RushDuel.GetMZoneCount(tp, max)
function RushDuel.CanSelectGroupAndSpecialSummon(desc, filter, check, tp, s_range, o_range, min, max, expect, e, pos, break_effect, target_player)
local ct = RushDuel.GetMZoneCount(target_player or tp, max)
if ct >= min then
return RushDuel._private_action_can_select_group(desc, HINTMSG_SPSUMMON, filter, check, tp, s_range, o_range, min, ct, expect, false, false, RushDuel._special_summon, e, tp, pos, break_effect)
return RushDuel._private_action_can_select_group(desc, HINTMSG_SPSUMMON, filter, check, tp, s_range, o_range, min, ct, expect, false, false, RushDuel._special_summon, e, tp, pos, break_effect,
target_player)
end
return 0
end
......@@ -228,35 +235,35 @@ end
-- 操作: 返回卡组
function RushDuel.SendToDeckAndExists(target, filter, count, expect)
local g = RushDuel.ToMaximunGroup(target)
return Duel.SendtoDeck(g, nil, 2, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
return Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
end
-- 操作: 返回卡组上面 (排序)
function RushDuel.SendToDeckTop(target, sort_player, target_player, sort)
local g = RushDuel.ToMaximunGroup(target)
if sort then
local og, ct = RushDuel.SendToDeckSort(g, 0, REASON_EFFECT, sort_player, target_player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, sort_player, target_player)
return ct
else
return Duel.SendtoDeck(g, nil, 0, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
end
end
-- 操作: 返回卡组下面 (排序)
function RushDuel.SendToDeckBottom(target, sort_player, target_player, sort)
local g = RushDuel.ToMaximunGroup(target)
if sort then
local og, ct = RushDuel.SendToDeckSort(g, 1, REASON_EFFECT, sort_player, target_player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, sort_player, target_player)
return ct
else
return Duel.SendtoDeck(g, nil, 1, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
end
end
-- 操作: 返回对方卡组上面 (排序)
function RushDuel.SendToOpponentDeckTop(target, player)
local g = RushDuel.ToMaximunGroup(target)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, 0, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, 0, REASON_EFFECT, player, 1 - player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, player, 1 - player)
return ct
end
end
......@@ -264,13 +271,44 @@ end
function RushDuel.SendToOpponentDeckBottom(target, player)
local g = RushDuel.ToMaximunGroup(target)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, 1, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, 1, REASON_EFFECT, player, 1 - player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, player, 1 - player)
return ct
end
end
-- 操作: 翻开卡组并选择卡
function RushDuel.RevealDeckTopAndSelect(player, count, hint, filter, min, max)
Duel.ConfirmDecktop(player, count)
local g = Duel.GetDecktopGroup(player, count)
if g:GetCount() > 0 then
Duel.Hint(HINT_SELECTMSG, player, hint)
local sg = g:FilterSelect(player, filter, min, max, nil)
g:Sub(sg)
return sg, g
else
return g, g
end
end
-- 操作: 翻开卡组并可以选择卡
function RushDuel.RevealDeckTopAndCanSelect(player, count, desc, hint, filter, min, max, ...)
Duel.ConfirmDecktop(player, count)
local g = Duel.GetDecktopGroup(player, count)
if g:GetCount() > 0 then
if g:IsExists(filter, min, nil, ...) and Duel.SelectYesNo(player, desc) then
Duel.Hint(HINT_SELECTMSG, player, hint)
local sg = g:FilterSelect(player, filter, min, max, nil, ...)
g:Sub(sg)
return sg, g
else
return Group.CreateGroup(), g
end
else
return g, g
end
end
-- 可选操作: 抽卡
function RushDuel.CanDraw(desc, player, count, break_effect)
if Duel.IsPlayerCanDraw(player, count) and Duel.SelectYesNo(player, desc) then
......
......@@ -38,13 +38,42 @@ end
function RushDuel.AttachDoubleTribute(e, card, value, desc, reset, forced)
return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_DOUBLE_TRIBUTE, value, reset, forced)
end
-- 赋予: 使用对方的怪兽解放
function RushDuel.AttachOpponentTribute(e, card, flag, desc, reset, reset_player)
local tp = e:GetHandlerPlayer()
if Duel.IsPlayerAffectedByEffect(tp, EFFECT_CANNOT_SINGLE_TRIBUTE) and Duel.IsPlayerAffectedByEffect(tp, EFFECT_CANNOT_DOUBLE_TRIBUTE) then
return nil
else
card:RegisterFlagEffect(flag, reset, EFFECT_FLAG_CLIENT_HINT, 1, 0, desc)
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e1:SetTargetRange(0, LOCATION_MZONE)
e1:SetLabelObject(card)
e1:SetTarget(function(e, c)
return c == e:GetLabelObject() and card:GetFlagEffect(flag) ~= 0
end)
e1:SetValue(POS_FACEUP_ATTACK + POS_FACEDOWN_DEFENSE)
local e2 = Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_GRANT)
e2:SetTarget(aux.TargetBoolFunction(Card.IsType, TYPE_MONSTER))
e2:SetTargetRange(LOCATION_HAND, 0)
e2:SetLabelObject(e1)
e2:SetReset(reset_player or reset)
Duel.RegisterEffect(e2, e:GetHandlerPlayer())
return e1, e2
end
end
-- 赋予: 效果战斗抗性
function RushDuel.AttachBattleIndes(e, card, value, desc, reset, forced)
return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_INDESTRUCTABLE_BATTLE, value, reset, forced)
end
-- 赋予: 效果破坏抗性
function RushDuel.AttachEffectIndes(e, card, value, desc, reset, forced)
return RushDuel.CreateSingleEffect(e, desc, card, EFFECT_INDESTRUCTABLE_EFFECT, value, reset, forced)
local attach = RushDuel.CreateSingleEffect(e, desc, card, EFFECT_INDESTRUCTABLE_EFFECT, value, reset, forced)
attach:SetLabel(e:GetHandlerPlayer() + 1)
return attach
end
-- 赋予: 战斗, 效果破坏抗性 (有次数限制)
function RushDuel.AttachIndesCount(e, card, count, value, desc, reset, forced)
......@@ -68,7 +97,7 @@ function RushDuel.AttachAttackAnnounce(e, card, operation, desc, reset, forced)
end
-- 赋予: 回合结束时特效
function RushDuel.AttachEndPhase(e, card, player, code, operation, desc)
card:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, code, desc)
card:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, EFFECT_FLAG_CLIENT_HINT, 1, code, desc)
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE + PHASE_END)
......@@ -87,6 +116,7 @@ function RushDuel.AttachEndPhase(e, card, player, code, operation, desc)
return false
end)
e1:SetOperation(operation)
e1:SetReset(RESET_PHASE + PHASE_END)
Duel.RegisterEffect(e1, player)
return e1
end
......@@ -138,3 +168,10 @@ end
function RushDuel.ChangeRace(e, card, race, reset, forced)
return RushDuel.CreateSingleEffect(e, nil, card, EFFECT_CHANGE_RACE, race, reset, forced)
end
-- 赋予: 改变卡名
function RushDuel.ChangeCode(e, card, code, reset, forced)
-- 使用 LinkCode 来判断传说卡
RushDuel.CreateSingleEffect(e, nil, card, EFFECT_ADD_LINK_CODE, code, reset, forced)
RushDuel.CreateSingleEffect(e, nil, card, EFFECT_ADD_FUSION_CODE, code, reset, forced)
return RushDuel.CreateSingleEffect(e, nil, card, EFFECT_CHANGE_CODE, code, reset, forced)
end
This diff is collapsed.
......@@ -25,24 +25,37 @@ function RushDuel.IsLegend(card)
return card:IsCode(LEGEND_MONSTER, LEGEND_SPELL, LEGEND_TRAP)
end
-- 条件: 是否为传说卡
function RushDuel.IsLegendCard(card)
return card:IsHasEffect(EFFECT_LEGEND_CARD)
end
-- 条件: 是否为传说卡的卡名
function RushDuel.IsLegendCode(card, ...)
for _, item in ipairs {...} do
local type = aux.GetValueType(item)
if type == "number" and RushDuel.IsLegend(card) and card:GetOriginalCode() == item then
return true
elseif type == "table" and RushDuel.IsLegendCode(card, table.unpack(item)) then
return true
end
local code = RushDuel.GetCardCode(card)
return RushDuel.FlatCheck(function(item)
return code == item
end, ...)
end
-- 获取卡牌的密码
function RushDuel.GetCardCode(card)
local code = card:GetCode()
if RushDuel.IsLegendCard(card) then
code = card:GetOriginalCode()
end
local codes = RushDuel.GetEffectValues(card, EFFECT_CHANGE_CODE)
for _, val in ipairs(codes) do
code = val
end
return false
return code
end
-- 条件: 是否为同名卡
function RushDuel.IsSameCode(card1, card2)
if (RushDuel.IsLegend(card1) or RushDuel.IsLegend(card2)) then
return card1:GetOriginalCode() == card2:GetOriginalCode()
else
return card1:IsCode(card2:GetCode())
end
return RushDuel.GetCardCode(card1) == RushDuel.GetCardCode(card2)
end
-- 条件: 是否卡名不同
function RushDuel.IsDifferentCode(card1, card2)
return RushDuel.GetCardCode(card1) ~= RushDuel.GetCardCode(card2)
end
-- Rush Duel 条件
RushDuel = RushDuel or {}
-- 内部方法: 检测效果范围是否覆盖
function RushDuel._private_check_effect_values(value, values, decode)
local attach, attachs = {decode(value)}, {}
local start = 2
local count = #attach
for i = start, count do
attach[i] = attach[i] or 0
attachs[i] = 0
end
for _, val in ipairs(values) do
local _attach = {decode(val)}
if _attach[1] then
-- 忽略判定
else
for i = start, count do
attachs[i] = attachs[i] | (_attach[i] or 0)
end
end
end
for i = start, count do
if (attachs[i] | attach[i]) ~= attachs[i] then
return true
end
end
return false
end
-- 条件: 卡片是否处于"极大模式"
function RushDuel.IsMaximumMode(card)
return card:IsLocation(LOCATION_MZONE) and card:IsSummonType(SUMMON_TYPE_MAXIMUM) and card:GetOverlayCount() > 0
......@@ -104,6 +77,9 @@ function RushDuel.IsCanAttachPierce(card)
end
-- 条件: 可否赋予效果 - 多次攻击
function RushDuel.IsCanAttachExtraAttack(card, value)
if card:IsHasEffect(EFFECT_CANNOT_ATTACK) then
return false
end
local values = RushDuel.GetEffectValues(card, EFFECT_EXTRA_ATTACK)
for _, val in ipairs(values) do
if val >= value then
......@@ -114,6 +90,9 @@ function RushDuel.IsCanAttachExtraAttack(card, value)
end
-- 条件: 可否赋予效果 - 多次攻击 (怪兽限定)
function RushDuel.IsCanAttachExtraAttackMonster(card, value)
if card:IsHasEffect(EFFECT_CANNOT_ATTACK) then
return false
end
local values = RushDuel.GetEffectValues(card, EFFECT_EXTRA_ATTACK_MONSTER)
for _, val in ipairs(values) do
if val >= value then
......@@ -124,7 +103,7 @@ function RushDuel.IsCanAttachExtraAttackMonster(card, value)
end
-- 条件: 可否赋予效果 - 全体攻击
function RushDuel.IsCanAttachAttackAll(card, value)
return true
return not card:IsHasEffect(EFFECT_CANNOT_ATTACK)
end
-- 条件: 可否赋予效果 - 双重解放
function RushDuel.IsCanAttachDoubleTribute(card, value)
......@@ -135,13 +114,11 @@ function RushDuel.IsCanAttachDoubleTribute(card, value)
return false
end
local values = RushDuel.GetEffectValues(card, EFFECT_DOUBLE_TRIBUTE)
return RushDuel._private_check_effect_values(value, values, function(val)
if val == 1 then
return {true, RACE_ALL, ATTRIBUTE_ALL}
else
return val(nil)
end
end)
return RushDuel.CheckValueDoubleTribute(values, value)
end
-- 条件: 可否赋予效果 - 使用对方的怪兽解放
function RushDuel.IsCanAttachOpponentTribute(card, flag)
return card:GetFlagEffect(flag) == 0
end
-- 条件: 可否赋予效果 - 战斗破坏抗性
function RushDuel.IsCanAttachBattleIndes(card, value)
......@@ -154,15 +131,24 @@ function RushDuel.IsCanAttachBattleIndes(card, value)
return true
end
-- 条件: 可否赋予效果 - 效果破坏抗性
function RushDuel.IsCanAttachEffectIndes(card, value)
function RushDuel.IsCanAttachEffectIndes(card, player, value)
local swap = card:GetOwner() ~= player
local values = RushDuel.GetEffectValues(card, EFFECT_INDESTRUCTABLE_EFFECT)
return RushDuel._private_check_effect_values(value, values, function(val)
if val == 1 then
return {true, TYPE_MONSTER + TYPE_SPELL + TYPE_TRAP, TYPE_MONSTER + TYPE_SPELL + TYPE_TRAP}
else
return val(nil)
return RushDuel.CheckValueEffectIndesType(swap, values, value)
end
-- 条件: 玩家是否能够使用特定种族进行攻击
function RushDuel.IsPlayerCanUseRaceAttack(player, race)
if Duel.IsPlayerAffectedByEffect(player, EFFECT_PLAYER_CANNOT_ATTACK) then
return false
end
local effects = {Duel.IsPlayerAffectedByEffect(player, EFFECT_PLAYER_RACE_CANNOT_ATTACK)}
for i, effect in ipairs(effects) do
if (race & effect:GetValue()) == race then
return false
end
end)
end
return true
end
-- 额外条件: 最后的操作是否包含某种卡
......
......@@ -52,6 +52,16 @@ function RushDuel._private_action_send_deck_sort(sequence, reason, hint_selectio
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
-- 内部方法: 返回卡组上面或下面动作
function RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc, reason, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp)
RushDuel.SetLabelAndObject(e, g, set_label_before, set_object_before)
local sequence = Duel.SelectOption(tp, top_desc, bottom_desc)
local og, ct = RushDuel.SendToDeckSort(g, sequence, reason, tp, tp)
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
-- 内部方法: 返回手卡动作
function RushDuel._private_action_send_hand(reason, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return function(g, e, tp, eg, ep, ev, re, r, rp)
......@@ -89,6 +99,11 @@ function RushDuel.CostSendGroupToDeckSort(filter, check, field, min, max, except
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_TODECK, filter, check, field, 0, min, max, except_self, action)
end
-- 代价: 选择匹配卡片, 返回卡组上面或下面
function RushDuel.CostSendMatchToDeckTopOrBottom(filter, field, min, max, except_self, top_desc, bottom_desc, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_match(HINTMSG_TODECK, filter, field, 0, min, max, except_self, action)
end
-- 代价: 选择匹配卡片, 返回手卡
function RushDuel.CostSendMatchToHand(filter, field, min, max, except_self, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_hand(REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
......@@ -112,6 +127,21 @@ function RushDuel.CostShowHand(filter, min, max, set_label, set_object)
Duel.ShuffleHand(tp)
end)
end
-- 代价: 把手卡给对方观看 (子卡片组)
function RushDuel.CostShowGroupHand(filter, check, min, max, set_label, set_object)
return RushDuel._private_cost_select_group(HINTMSG_CONFIRM, filter, check, LOCATION_HAND, 0, min, max, true, function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.SetLabelAndObject(e, g, set_label, set_object)
Duel.ConfirmCards(1 - tp, g)
Duel.ShuffleHand(tp)
end)
end
-- 代价: 把额外卡组给对方观看 (子卡片组)
function RushDuel.CostShowGroupExtra(filter, check, min, max, set_label, set_object)
return RushDuel._private_cost_select_group(HINTMSG_CONFIRM, filter, check, LOCATION_EXTRA, 0, min, max, false, function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.SetLabelAndObject(e, g, set_label, set_object)
Duel.ConfirmCards(1 - tp, g)
end)
end
-- 代价: 从卡组上面把卡送去墓地
function RushDuel.CostSendDeckTopToGrave(count, set_label, set_object)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
......@@ -163,33 +193,53 @@ end
function RushDuel.CostSendOnFieldToGrave(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToGrave(filter, LOCATION_ONFIELD, min, max, except_self, false, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让怪兽返回卡组下面
function RushDuel.CostSendMZoneToDeckBottom(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_MZONE, min, max, except_self, SEQ_DECKBOTTOM, true, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让场上的卡返回卡组下面
function RushDuel.CostSendOnFieldToDeckBottom(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_ONFIELD, min, max, except_self, SEQ_DECKBOTTOM, true, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 把场上的卡送去墓地 (子卡片组)
function RushDuel.CostSendOnFieldSubToGrave(filter, check, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToGrave(filter, check, LOCATION_ONFIELD, min, max, except_self, false, false, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 把手卡返回卡组上面
function RushDuel.CostSendHandToDeckTop(filter, min, max, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_HAND, min, max, true, SEQ_DECKTOP, false, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 把手卡返回卡组
function RushDuel.CostSendHandToDeck(filter, min, max, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_HAND, min, max, true, SEQ_DECKSHUFFLE, false, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 把手卡返回卡组下面
function RushDuel.CostSendHandToDeckBottom(filter, min, max, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_HAND, min, max, true, 1, false, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_HAND, min, max, true, SEQ_DECKBOTTOM, false, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组
function RushDuel.CostSendGraveToDeck(filter, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_GRAVE, min, max, false, 2, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_GRAVE, min, max, false, SEQ_DECKSHUFFLE, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组 (子卡片组)
function RushDuel.CostSendGraveSubToDeck(filter, check, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckSort(filter, check, LOCATION_GRAVE, min, max, false, 2, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckSort(filter, check, LOCATION_GRAVE, min, max, false, SEQ_DECKSHUFFLE, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组上面
function RushDuel.CostSendGraveToDeckTop(filter, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_GRAVE, min, max, false, 0, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_GRAVE, min, max, false, SEQ_DECKTOP, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组下面
function RushDuel.CostSendGraveToDeckBottom(filter, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_GRAVE, min, max, false, 1, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckSort(filter, LOCATION_GRAVE, min, max, false, SEQ_DECKBOTTOM, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组下面 (子卡片组)
function RushDuel.CostSendGraveSubToDeckBottom(filter, check, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckSort(filter, check, LOCATION_GRAVE, min, max, false, 1, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckSort(filter, check, LOCATION_GRAVE, min, max, false, SEQ_DECKBOTTOM, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组上面或下面
function RushDuel.CostSendGraveToDeckTopOrBottom(filter, min, max, top_desc, bottom_desc, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckTopOrBottom(filter, LOCATION_GRAVE, min, max, false, top_desc, bottom_desc, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 把怪兽返回手卡
function RushDuel.CostSendMZoneToHand(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
......
......@@ -136,3 +136,14 @@ function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_p
end
return og, ct
end
-- 获取被上级召唤解放时的基础攻击力
function RushDuel.GetBaseAttackOnTribute(c)
local atk
if RushDuel.IsMaximumMode(c) then
atk = c.maximum_attack
else
atk = c:GetTextAttack()
end
return math.max(0, atk)
end
......@@ -7,11 +7,13 @@ function RushDuel.AddFusionProcedure(card, ...)
end
-- 创建效果: 融合术/结合 召唤
function RushDuel.CreateFusionEffect(card, matfilter, spfilter, exfilter, s_range, o_range, target_action, operation_action)
function RushDuel.CreateFusionEffect(card, matfilter, spfilter, exfilter, s_range, o_range, mat_check, mat_move, target_action, operation_action)
local self_range = s_range or 0
local opponent_range = o_range or 0
local move = mat_move or RushDuel.FusionToGrave
local e = Effect.CreateEffect(card)
e:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_FUSION_SUMMON)
e:SetTarget(RushDuel.FusionTarget(matfilter, spfilter, exfilter, s_range, o_range, target_action))
e:SetOperation(RushDuel.FusionOperation(matfilter, spfilter, exfilter, s_range, o_range, operation_action))
e:SetTarget(RushDuel.FusionTarget(matfilter, spfilter, exfilter, self_range, opponent_range, mat_check, target_action))
e:SetOperation(RushDuel.FusionOperation(matfilter, spfilter, exfilter, self_range, opponent_range, mat_check, move, operation_action))
return e
end
function RushDuel.FusionMaterialFilter(c, filter, e)
......@@ -20,7 +22,10 @@ end
function RushDuel.FusionSpecialSummonFilter(c, e, tp, m, f, chkf, filter)
return c:IsType(TYPE_FUSION) and (not filter or filter(c)) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e, SUMMON_TYPE_FUSION, tp, false, false) and c:CheckFusionMaterial(m, nil, chkf)
end
function RushDuel.FusionTarget(matfilter, spfilter, exfilter, s_range, o_range, action)
function RushDuel.ConfirmCardFilter(c)
return c:IsLocation(LOCATION_HAND) or (c:IsLocation(LOCATION_MZONE) and c:IsFacedown())
end
function RushDuel.FusionTarget(matfilter, spfilter, exfilter, s_range, o_range, mat_check, action)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
local chkf = tp
......@@ -29,6 +34,7 @@ function RushDuel.FusionTarget(matfilter, spfilter, exfilter, s_range, o_range,
local mg2 = Duel.GetMatchingGroup(exfilter, tp, s_range, o_range, nil)
mg1:Merge(mg2)
end
aux.FGoalCheckAdditional = mat_check
local res = Duel.IsExistingMatchingCard(RushDuel.FusionSpecialSummonFilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, mg1, nil, chkf, spfilter)
if not res then
local ce = Duel.GetChainMaterial(tp)
......@@ -39,6 +45,7 @@ function RushDuel.FusionTarget(matfilter, spfilter, exfilter, s_range, o_range,
res = Duel.IsExistingMatchingCard(RushDuel.FusionSpecialSummonFilter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, mg3, mf, chkf, spfilter)
end
end
aux.FGoalCheckAdditional = nil
return res
end
if action ~= nil then
......@@ -47,7 +54,7 @@ function RushDuel.FusionTarget(matfilter, spfilter, exfilter, s_range, o_range,
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
end
end
function RushDuel.FusionOperation(matfilter, spfilter, exfilter, s_range, o_range, action)
function RushDuel.FusionOperation(matfilter, spfilter, exfilter, s_range, o_range, mat_check, mat_move, action)
return function(e, tp, eg, ep, ev, re, r, rp)
local chkf = tp
local mg1 = Duel.GetFusionMaterial(tp):Filter(RushDuel.FusionMaterialFilter, nil, matfilter, e)
......@@ -55,6 +62,7 @@ function RushDuel.FusionOperation(matfilter, spfilter, exfilter, s_range, o_rang
local mg2 = Duel.GetMatchingGroup(exfilter, tp, s_range, o_range, nil, e)
mg1:Merge(mg2)
end
aux.FGoalCheckAdditional = mat_check
local sg1 = Duel.GetMatchingGroup(RushDuel.FusionSpecialSummonFilter, tp, LOCATION_EXTRA, 0, nil, e, tp, mg1, nil, chkf, spfilter)
local mg3 = nil
local sg2 = nil
......@@ -78,7 +86,11 @@ function RushDuel.FusionOperation(matfilter, spfilter, exfilter, s_range, o_rang
if sg1:IsContains(fc) and (sg2 == nil or not sg2:IsContains(fc) or not Duel.SelectYesNo(tp, ce:GetDescription())) then
mat = Duel.SelectFusionMaterial(tp, fc, mg1, nil, chkf)
fc:SetMaterial(mat)
Duel.SendtoGrave(mat, REASON_EFFECT + REASON_MATERIAL + REASON_FUSION)
local cg = mat:Filter(RushDuel.ConfirmCardFilter, nil)
if cg:GetCount() > 0 then
Duel.ConfirmCards(1 - tp, cg)
end
mat_move(mat)
Duel.BreakEffect()
Duel.SpecialSummon(fc, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP)
else
......@@ -91,5 +103,15 @@ function RushDuel.FusionOperation(matfilter, spfilter, exfilter, s_range, o_rang
if action ~= nil then
action(e, tp, eg, ep, ev, re, r, rp, mat, fc)
end
aux.FGoalCheckAdditional = nil
end
end
-- 素材去向: 墓地
function RushDuel.FusionToGrave(mat)
Duel.SendtoGrave(mat, REASON_EFFECT + REASON_MATERIAL + REASON_FUSION)
end
-- 素材去向: 卡组
function RushDuel.FusionToDeck(mat)
Duel.SendtoDeck(mat, nil, SEQ_DECKSHUFFLE, REASON_EFFECT + REASON_MATERIAL + REASON_FUSION)
end
-- Rush Duel 编号
RushDuel = RushDuel or {}
LEGEND_MONSTER = 120000000
LEGEND_SPELL = 120000001
LEGEND_TRAP = 120000002
RushDuel.LegendCodes = {
-- 青眼白龙
{120120000, 120198001, 120231001},
-- 真红眼黑龙
{120125001, 120203016, 120229101},
-- 黑魔术师
{120130000, 120203015},
-- 死者苏生
{120194004, 120195004},
-- 天使的施舍
{120196049, 120195005},
-- 海龙-泰达路斯
{120199000, 120239060}
}
-- 初始化传说卡
function RushDuel.InitLegend()
local g = Duel.GetMatchingGroup(Card.IsCode, 0, 0xff, 0xff, nil, LEGEND_MONSTER, LEGEND_SPELL, LEGEND_TRAP)
g:ForEach(function(c)
local code = RushDuel.GetLegendCode(c:GetOriginalCode())
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEGEND_CARD)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(0xff)
e1:SetValue(code)
c:RegisterEffect(e1, true)
-- 修改卡牌数据 (删除同名卡:传说卡)
c:SetCardData(2, code)
end)
end
-- 获取传说卡原卡名
function RushDuel.GetLegendCode(code)
for _, codes in ipairs(RushDuel.LegendCodes) do
for _, legend_code in ipairs(codes) do
if (code == legend_code) then
return codes[1]
end
end
end
return code
end
-- 条件: 是否为传说卡
function RushDuel.IsLegendCard(card)
return card:IsHasEffect(EFFECT_LEGEND_CARD)
end
-- 条件: 是否为同名卡
function RushDuel.IsSameCode(card1, card2)
return card1:IsLinkCode(card2:GetLinkCode())
end
-- 永续改变卡名
function RushDuel.EnableChangeCode(c, code, location, condition)
Auxiliary.AddCodeList(c, code)
local loc = c:GetOriginalType() & TYPE_MONSTER ~= 0 and LOCATION_MZONE or LOCATION_SZONE
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(location or loc)
if condition ~= nil then
e1:SetCondition(condition)
end
e1:SetValue(code)
c:RegisterEffect(e1)
local e2 = e1:Clone()
e2:SetCode(EFFECT_ADD_LINK_CODE)
c:RegisterEffect(e2)
local e3 = e1:Clone()
e3:SetCode(EFFECT_ADD_FUSION_CODE)
c:RegisterEffect(e3)
return e1, e2, e3
end
......@@ -4,48 +4,48 @@ RushDuel = RushDuel or {}
TYPE_MAXIMUM = 0x400 -- 极大怪兽
SUMMON_TYPE_MAXIMUM = 0x45000000 -- 极大模式
-- 初始化极大怪兽规则
function RushDuel.InitMaximum()
-- 不可改变表示形式
local e1 = Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_POSITION)
e1:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
e1:SetTarget(RushDuel.MaximumMonster)
e1:SetValue(POS_FACEUP_ATTACK)
Duel.RegisterEffect(e1, 0)
local e2 = e1:Clone()
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e2:SetValue(0)
Duel.RegisterEffect(e2, 0)
local e3 = e2:Clone()
e3:SetCode(EFFECT_CANNOT_CHANGE_POS_E)
e3:SetTarget(RushDuel.MaximumMonsterAtk)
Duel.RegisterEffect(e3, 0)
local e4 = e2:Clone()
e4:SetCode(EFFECT_CANNOT_TURN_SET)
Duel.RegisterEffect(e4, 0)
end
function RushDuel.MaximumMonster(e, c)
return c:IsSummonType(SUMMON_TYPE_MAXIMUM) and c:GetOverlayCount() > 0
end
function RushDuel.MaximumMonsterAtk(e, c)
return c:IsPosition(POS_FACEUP_ATTACK) and RushDuel.MaximumMonster(e, c)
end
-- 添加极大召唤手续
function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code)
if c:IsStatus(STATUS_COPYING_EFFECT) then
return
end
-- 记录状态
if c.maximum_attack == nil then
local mt = getmetatable(c)
mt.maximum_attack = max_atk
end
-- 极大召唤 手续
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(120000000, 0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(function(e, c, og)
if c == nil then
return true
end
local tp = c:GetControler()
local mg = Duel.GetMatchingGroup(RushDuel.MaximumSummonFilter, tp, LOCATION_HAND, 0, nil, e, tp, left_code, right_code)
local fg = Duel.GetFieldGroup(tp, LOCATION_MZONE, 0)
return Duel.GetMZoneCount(tp, fg) > 0 and not Duel.IsPlayerAffectedByEffect(tp, 59822133) and mg:CheckSubGroup(RushDuel.MaximumSummonCheck, 2, 2)
end)
e1:SetOperation(function(e, tp, eg, ep, ev, re, r, rp, c, sg, og)
local mg = Duel.GetMatchingGroup(RushDuel.MaximumSummonFilter, tp, LOCATION_HAND, 0, nil, e, tp, left_code, right_code)
Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(120000000, 1))
local cancel = Duel.GetCurrentChain() == 0
local g = mg:SelectSubGroup(tp, RushDuel.MaximumSummonCheck, cancel, 2, 2)
if not g then
return
end
local fg = Duel.GetFieldGroup(tp, LOCATION_MZONE, 0)
Duel.SendtoGrave(fg, REASON_RULE)
c:SetMaterial(g)
sg:AddCard(c)
sg:Merge(g)
end)
e1:SetValue(SUMMON_TYPE_MAXIMUM)
c:RegisterEffect(e1)
-- 极大召唤 素材
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e2:SetCondition(RushDuel.MaximumMaterialCondition)
e2:SetOperation(RushDuel.MaximumMaterialOperation)
c:RegisterEffect(e2)
RushDuel.AddHandSpecialSummonProcedure(c, aux.Stringid(120000000, 0), RushDuel.MaximumSummonCondition(left_code, right_code), RushDuel.MaximumSummonTarget(left_code, right_code),
RushDuel.MaximumSummonOperation(left_code, right_code), RushDuel.MaximumSummonValue, POS_FACEUP_ATTACK)
-- 极大攻击力
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
......@@ -55,59 +55,24 @@ function RushDuel.AddMaximumProcedure(c, max_atk, left_code, right_code)
e3:SetCondition(RushDuel.MaximumMode)
e3:SetValue(max_atk)
c:RegisterEffect(e3)
-- 不可改变表示形式
-- 占用3个主要怪兽区域
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_POSITION)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_MAX_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(POS_FACEUP_ATTACK)
e4:SetTargetRange(1, 0)
e4:SetCondition(RushDuel.MaximumMode)
e4:SetValue(1)
c:RegisterEffect(e4)
-- 离开场上时, 所有部件一同离开
local e5 = Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e5:SetCondition(RushDuel.MaximumMode)
e5:SetOperation(RushDuel.MaximumLeaveOperation)
c:RegisterEffect(e5)
local e6 = e5:Clone()
e6:SetCode(EFFECT_CANNOT_CHANGE_POS_E)
e6:SetCondition(RushDuel.MaximumPositionCondition)
c:RegisterEffect(e6)
local e7 = Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_CANNOT_TURN_SET)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(RushDuel.MaximumMode)
c:RegisterEffect(e7)
-- 占用3个主要怪兽区域
local e8 = Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_MAX_MZONE)
e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e8:SetRange(LOCATION_MZONE)
e8:SetTargetRange(1, 0)
e8:SetCondition(RushDuel.MaximumMode)
e8:SetValue(1)
c:RegisterEffect(e8)
-- 离开场上时, 所有部件一同离开
local e9 = Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_LEAVE_FIELD_P)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e9:SetCondition(RushDuel.MaximumMode)
e9:SetOperation(RushDuel.MaximumLeaveOperation)
c:RegisterEffect(e9)
-- 极大召唤时的表示形式
local ge1 = Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)
ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ge1:SetTargetRange(1, 1)
ge1:SetTarget(RushDuel.MaximumSummonPosition)
Duel.RegisterEffect(ge1, 0)
end
function RushDuel.MaximumSummonFilter(c, e, tp, left_code, right_code)
return c:IsCode(left_code, right_code) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP)
......@@ -115,21 +80,56 @@ end
function RushDuel.MaximumSummonCheck(g)
return g:GetClassCount(Card.GetCode) == g:GetCount()
end
function RushDuel.MaximumMode(e)
local c = e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_MAXIMUM) and c:GetOverlayCount() > 0
function RushDuel.MaximumSummonCondition(left_code, right_code)
return function(e, c, og, min, max)
if c == nil then
return true
end
local tp = c:GetControler()
local mg = Duel.GetMatchingGroup(RushDuel.MaximumSummonFilter, tp, LOCATION_HAND, 0, nil, e, tp, left_code, right_code)
local fg = Duel.GetFieldGroup(tp, LOCATION_MZONE, 0)
return Duel.GetMZoneCount(tp, fg) > 0 and mg:CheckSubGroup(RushDuel.MaximumSummonCheck, 2, 2)
end
end
function RushDuel.MaximumSummonTarget(left_code, right_code)
return function(e, tp, eg, ep, ev, re, r, rp, chk, c, og, min, max)
local mg = Duel.GetMatchingGroup(RushDuel.MaximumSummonFilter, tp, LOCATION_HAND, 0, nil, e, tp, left_code, right_code)
Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(120000000, 1))
local cancel = Duel.GetCurrentChain() == 0
local g = mg:SelectSubGroup(tp, RushDuel.MaximumSummonCheck, cancel, 2, 2)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else
return false
end
end
end
function RushDuel.MaximumSummonOperation(left_code, right_code)
return function(e, tp, eg, ep, ev, re, r, rp, c, og, min, max)
local fg = Duel.GetFieldGroup(tp, LOCATION_MZONE, 0)
Duel.SendtoGrave(fg, REASON_RULE)
local mg = e:GetLabelObject()
local left = mg:GetFirst()
local right = mg:GetNext()
if left:IsCode(right_code) then
left, right = right, left
end
Duel.MoveToField(left, tp, tp, LOCATION_MZONE, POS_FACEUP_ATTACK, false, 0x2)
Duel.MoveToField(right, tp, tp, LOCATION_MZONE, POS_FACEUP_ATTACK, false, 0x8)
c:SetMaterial(mg)
Duel.Overlay(c, mg)
mg:DeleteGroup()
end
end
function RushDuel.MaximumMaterialCondition(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_MAXIMUM)
function RushDuel.MaximumSummonValue(e, c)
return SUMMON_TYPE_MAXIMUM, 0x4
end
function RushDuel.MaximumMaterialOperation(e, tp, eg, ep, ev, re, r, rp)
function RushDuel.MaximumMode(e)
local c = e:GetHandler()
local mg = c:GetMaterial()
Duel.Overlay(c, mg)
Duel.MoveSequence(c, 2)
end
function RushDuel.MaximumPositionCondition(e)
return RushDuel.MaximumMode(e) and e:GetHandler():IsAttackPos()
return c:IsSummonType(SUMMON_TYPE_MAXIMUM) and c:GetOverlayCount() > 0
end
function RushDuel.MaximumLeaveOperation(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
......@@ -143,6 +143,3 @@ function RushDuel.MaximumLeaveOperation(e, tp, eg, ep, ev, re, r, rp)
Duel.Remove(g, POS_FACEUP, REASON_RULE)
end
end
function RushDuel.MaximumSummonPosition(e, c, tp, sumtp, sumpos)
return c:IsType(TYPE_MAXIMUM) and (sumtp & SUMMON_TYPE_MAXIMUM) == SUMMON_TYPE_MAXIMUM and (sumpos & POS_DEFENSE) > 0
end
......@@ -14,8 +14,7 @@ function RushDuel.Init()
Duel.Draw(0, 1, REASON_RULE)
end
-- 传说卡
local g = Duel.GetMatchingGroup(RushDuel.IsLegend, 0, 0xff, 0xff, nil)
g:ForEach(RushDuel.InitLegend)
RushDuel.InitLegend()
e:Reset()
end)
end
......@@ -39,7 +38,7 @@ function RushDuel.InitRule()
-- 极大怪兽的L/R部分的效果分开计算
return e:GetLabel()
else
return e:GetOwner():GetCode()
return e:GetOwner():GetOriginalCode()
end
end
RushDuel.CreatePlayerTargetGlobalEffect(EFFECT_CANNOT_ACTIVATE, function(e, re, tp)
......@@ -66,13 +65,6 @@ function RushDuel.InitRule()
RushDuel.CreatePlayerTargetGlobalEffect(EFFECT_SKIP_M2)
-- 手卡无限制
RushDuel.CreatePlayerTargetGlobalEffect(EFFECT_HAND_LIMIT, 100)
end
-- 初始化传说卡
function RushDuel.InitLegend(c)
local e = Effect.GlobalEffect()
e:SetType(EFFECT_TYPE_SINGLE)
e:SetCode(EFFECT_ADD_CODE)
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e:SetValue(c:GetOriginalCode())
c:RegisterEffect(e, true)
-- 极大怪兽
RushDuel.InitMaximum()
end
-- Rush Duel 效果值
RushDuel = RushDuel or {}
-- 效果值: 双重解放 属性/种族
function RushDuel.ValueDoubleTribute(attribute, race, ignore)
-- 内部方法: 双重解放的对象怪兽信息
function RushDuel._private_double_tribute_info(code, attribute, level, race, attack, defense)
local info = {}
info.code = code
info.attribute = attribute
info.level = level
info.race = race
info.attack = attack
info.defense = defense
return info
end
-- 内部方法: 判断双重解放的对象怪兽是否重合
function RushDuel._private_is_double_tribute_info_different(info1, info2)
if info1.code ~= info2.code then
return true
elseif info1.attribute ~= info2.attribute then
return true
elseif info1.level ~= info2.level then
return true
elseif info1.race ~= info2.race then
return true
elseif info1.attack ~= info2.attack then
return true
elseif info1.defense ~= info2.defense then
return true
end
return false
end
-- 效果值: 双重解放
function RushDuel.ValueDoubleTributeMix(ignore, code, attribute, level, race, attack, defense)
return function(e, c)
if e == nil then
return ignore, RushDuel._private_double_tribute_info(code, attribute, level, race, attack, defense)
end
return (code == nil or c:IsCode(code)) and (attribute == nil or c:IsAttribute(attribute)) and (level == nil or c:IsLevel(level)) and (race == nil or c:IsRace(race)) and
(attack == nil or c:IsAttack(attack)) and (defense == nil or c:IsDefense(defense))
end
end
-- 效果值: 双重解放 全范围
function RushDuel.ValueDoubleTributeAll(ignore)
return function(e, c)
if e == nil then
return ignore or false, attribute or 0, race or 0
return ignore, 1
end
return (attribute == nil or c:IsAttribute(attribute)) and (race == nil or c:IsRace(race))
return true
end
end
-- 效果值: 双重解放 卡名
function RushDuel.ValueDoubleTributeCode(code, ignore)
return RushDuel.ValueDoubleTributeMix(ignore, code, nil, nil, nil, nil, nil)
end
-- 效果值: 双重解放 属性/种族
function RushDuel.ValueDoubleTributeAttrRace(attribute, race, ignore)
return RushDuel.ValueDoubleTributeMix(ignore, nil, attribute, nil, race, nil, nil)
end
-- 效果值: 双重解放 等级/属性/种族
function RushDuel.ValueDoubleTributeLvAttrRace(level, attribute, race, ignore)
return RushDuel.ValueDoubleTributeMix(ignore, nil, attribute, level, race, nil, nil)
end
-- 效果值: 双重解放 攻击力/守备力
function RushDuel.ValueDoubleTributeAtkDef(attack, defense, ignore)
return RushDuel.ValueDoubleTributeMix(ignore, nil, nil, nil, nil, attack, defense)
end
-- 判断: 是否可以赋予双重解放
function RushDuel.CheckValueDoubleTribute(values, value)
local _, info = value(nil)
for _, val in ipairs(values) do
if val == 1 then
-- 全范围双重解放, 无法再赋予双重解放
return false
else
-- 已有抗性全部叠加
local ignore, attach_info = val(nil)
if not ignore then
if attach_info == 1 then
-- 全范围双重解放, 无法再赋予双重解放
return false
elseif info == 1 then
-- 全范围双重解放, 无需判断
elseif not RushDuel._private_is_double_tribute_info_different(info, attach_info) then
-- 已存在相同的双重解放效果
return false
end
end
end
end
return true
end
-- 效果值: 效果破坏抗性 抵抗类型
function RushDuel.ValueEffectIndesType(self_type, opponent_type, ignore)
......@@ -17,9 +98,12 @@ function RushDuel.ValueEffectIndesType(self_type, opponent_type, ignore)
local o_type = opponent_type or 0
return function(e, re, rp)
if e == nil then
return ignore or false, s_type or 0, o_type or 0
return ignore or false, s_type, o_type
end
local tp = e:GetHandlerPlayer()
if e:GetLabel() ~= 0 then
tp = e:GetLabel() - 1
end
if rp == tp then
return s_type ~= 0 and re:IsActiveType(s_type)
else
......@@ -27,3 +111,28 @@ function RushDuel.ValueEffectIndesType(self_type, opponent_type, ignore)
end
end
end
-- 判断: 是否可以赋予效果破坏抗性
function RushDuel.CheckValueEffectIndesType(swap, values, value)
local attachs_s, attachs_o = 0, 0
for _, val in ipairs(values) do
if val == 1 then
-- 全破坏抗性, 无法再赋予其他抗性
return false
else
-- 已有抗性全部叠加
local ignore, s_type, o_type = val(nil)
if not ignore then
attachs_s = attachs_s | s_type
attachs_o = attachs_o | o_type
end
end
end
-- 判断抗性是否有变化
local _, s_type, o_type = value(nil)
if swap then
-- 控制权交换中
s_type, o_type = o_type, s_type
end
return (attachs_s | s_type) ~= attachs_s or (attachs_o | o_type) ~= attachs_o
end
......@@ -33,10 +33,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_DEFENCE)
if Duel.GetFlagEffect(tp,m)~=0 then return end
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)
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,1),RACE_ALL-RACE_FIEND,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_FIEND)
end
\ No newline at end of file
......@@ -13,11 +13,15 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Atk Up
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -37,9 +37,5 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
local e1=RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetLabel(e:GetHandler():GetFieldID())
end
function cm.atktg(e,c)
return e:GetLabel()~=c:GetFieldID()
RD.CreateOnlyThisAttackEffect(e,20109018,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
end
\ No newline at end of file
local m=120109022
local list={120231024}
local cm=_G["c"..m]
cm.name="电子搜索龙"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Summon Procedure
RD.AddSummonProcedure(c,aux.Stringid(m,0),cm.sumcon,cm.sumop,SUMMON_TYPE_ADVANCE)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Summon Procedure
function cm.matfilter(c,tp)
return c:IsFaceup() and c:IsCode(list[1])
end
function cm.sumcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
--Special Summon
function cm.spfilter(c,e,tp)
return c:IsCode(list[1]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return RD.IsSummonTurn(c) or RD.IsSpecialSummonTurn(c)
end
cm.cost=RD.CostSendHandToDeckTop(Card.IsAbleToDeckAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
end
\ No newline at end of file
local m=120109023
local cm=_G["c"..m]
cm.name="入侵龙"
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Special Summon
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_DEFENSE)
end
function cm.thfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(1-tp)>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 RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP_DEFENSE,false,1-tp)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.BreakEffect()
RD.SendToOpponentHand(g)
end)
end
end
\ No newline at end of file
local m=120109024
local list={120209001}
local cm=_G["c"..m]
cm.name="穿越侍·乌贼侍"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Pierce
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Pierce
function cm.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_GALAXY) and RD.IsCanAttachPierce(c)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1])
end
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
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.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachPierce(e,g:GetFirst(),aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg)
end)
end
end)
end
\ No newline at end of file
local m=120109025
local cm=_G["c"..m]
cm.name="斩奏之琴拨罪犯"
function cm.initial_effect(c)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--To Hand
function cm.thfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
end
cm.cost=RD.CostPayLP(1000)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if RD.SendToHandAndExists(g,1-tp) then
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.BreakEffect()
RD.AttachAtkDef(e,c,400,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
end
end
end)
end
\ No newline at end of file
local m=120109026
local cm=_G["c"..m]
cm.name="深海猎手"
function cm.initial_effect(c)
--Position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsFaceup() and c:IsLevelBelow(6) and c:IsDefenseBelow(1000) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1
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)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
local m=120109027
local cm=_G["c"..m]
cm.name="卫星士兵"
function cm.initial_effect(c)
--Level Up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Level Up
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(6) and RD.IsDefense(c,1000)
end
cm.cost=RD.CostSendDeckTopToGrave(1)
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.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachLevel(e,g:GetFirst(),2,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
\ No newline at end of file
local m=120109028
local cm=_G["c"..m]
cm.name="肃圣之光芒巫师"
function cm.initial_effect(c)
--Atk Down
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Atk Down
function cm.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER)
end
cm.cost=RD.CostPayLP(300)
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)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*-300
if atk==0 then return end
RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.AttachAtkDef(e,g:GetFirst(),atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
\ No newline at end of file
local m=120109029
local cm=_G["c"..m]
cm.name="解压除冻骑兵"
function cm.initial_effect(c)
--Discard Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Discard Deck
function cm.exfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thfilter(c)
return c:GetType()==TYPE_EQUIP+TYPE_SPELL and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
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(1-tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,2)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(1-tp,2) and Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_GRAVE,5,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
Duel.BreakEffect()
RD.SendToHandAndExists(g,1-tp)
end)
end
end
\ No newline at end of file
......@@ -14,18 +14,19 @@ function cm.initial_effect(c)
end
--Indes Effect
cm.indval=RD.ValueEffectIndesType(0,TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
function cm.filter(c)
return RD.IsCanAttachEffectIndes(c,cm.indval)
function cm.filter(c,tp)
return RD.IsCanAttachEffectIndes(c,tp,cm.indval)
end
function cm.costfilter(c)
return c:IsRace(RACE_SPELLCASTER+RACE_DRAGON) and c:IsAbleToGraveAsCost()
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(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local filter=RD.Filter(cm.filter,tp)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachEffectIndes(e,g:GetFirst(),cm.indval,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
\ No newline at end of file
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c,tp,rp)
return RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and ((rp==1-tp and c:IsReason(REASON_EFFECT)) or c==Duel.GetAttackTarget())
end
function cm.spfilter(c,e,tp)
......
local m=120125002
local list={120125001}
local cm=_G["c"..m]
cm.name="黑龙之雏"
function cm.initial_effect(c)
RD.AddCodeList(c,LEGEND_RED_EYES_BLACK_DRAGON)
RD.AddCodeList(c,list)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......@@ -16,7 +17,7 @@ function cm.initial_effect(c)
end
--Special Summon
function cm.spfilter(c,e,tp)
return RD.IsLegendCode(c,LEGEND_RED_EYES_BLACK_DRAGON) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
return c:IsLinkCode(list[1]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
cm.cost=RD.CostSendSelfToGrave()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
local m=120125003
local list={120125001}
local cm=_G["c"..m]
cm.name="黑炎弹"
function cm.initial_effect(c)
RD.AddCodeList(c,LEGEND_RED_EYES_BLACK_DRAGON)
RD.AddCodeList(c,list)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
......@@ -16,7 +17,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and RD.IsLegendCode(c,LEGEND_RED_EYES_BLACK_DRAGON)
return c:IsFaceup() and c:IsLinkCode(list[1])
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
......@@ -33,5 +34,5 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return RD.IsLegendCode(c,LEGEND_RED_EYES_BLACK_DRAGON)
return c:IsCode(list[1])
end
\ No newline at end of file
......@@ -20,11 +20,14 @@ end
function cm.adfilter(c,attr)
return c:IsFaceup() and c:IsAttribute(attr)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1,nil,Group.GetFirst)
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1,function(g)
local tc=g:GetFirst()
return tc:GetLevel(),tc:GetAttribute()
end)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local cc=e:GetLabelObject()
local down=cc:GetLevel()*-300
local g=Duel.GetMatchingGroup(cm.adfilter,tp,0,LOCATION_MZONE,nil,cc:GetAttribute())
local lv,attr=e:GetLabel()
local down=lv*-300
local g=Duel.GetMatchingGroup(cm.adfilter,tp,0,LOCATION_MZONE,nil,attr)
g:ForEach(function(tc)
RD.AttachAtkDef(e,tc,down,down,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
......
......@@ -32,8 +32,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
--Attack Limit
RD.AttachCannotSelectBattleTarget(e,c,cm.atlimit,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
RD.AttachCannotDirectAttack(e,c,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
RD.AttachCannotSelectBattleTarget(e,c,cm.atlimit,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END)
RD.AttachCannotDirectAttack(e,c,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END)
end
end
function cm.atlimit(e,c)
......
......@@ -33,7 +33,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and RD.SendToGraveAndExists(c) then
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_DEFENSE,true)
end
end
\ No newline at end of file
local m=120130040
local list={120130000}
local cm=_G["c"..m]
cm.name="千把刀"
function cm.initial_effect(c)
RD.AddCodeList(c,LEGEND_DARK_MAGICIAN)
RD.AddCodeList(c,list)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
......@@ -15,7 +16,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and RD.IsLegendCode(c,LEGEND_DARK_MAGICIAN)
return c:IsFaceup() and c:IsLinkCode(list[1])
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
......
local m=120130041
local list={120130000}
local cm=_G["c"..m]
cm.name="黑·魔·导"
function cm.initial_effect(c)
RD.AddCodeList(c,LEGEND_DARK_MAGICIAN)
RD.AddCodeList(c,list)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
......@@ -15,7 +16,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and RD.IsLegendCode(c,LEGEND_DARK_MAGICIAN)
return c:IsFaceup() and c:IsLinkCode(list[1])
end
function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Extra Tribute
cm.trival=RD.ValueDoubleTribute(nil,RACE_DRAGON)
cm.trival=RD.ValueDoubleTributeAttrRace(nil,RACE_DRAGON)
function cm.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToDeckOrExtraAsCost()
end
......
......@@ -27,10 +27,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.AttachDirectAttack(e,c,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
end
if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateHintEffect(e,aux.Stringid(m,2),tp,1,0,RESET_PHASE+PHASE_END)
RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,2),RACE_ALL-RACE_WARRIOR,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_WARRIOR)
end
\ No newline at end of file
......@@ -23,18 +23,16 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=e:GetLabel()*100
local reset=RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END
RD.AttachAtkDef(e,c,atk,0,reset)
local reset1=RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END
local reset2=RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END
RD.AttachAtkDef(e,c,atk,0,reset1)
RD.AttachCannotSelectBattleTarget(e,c,cm.atlimit,aux.Stringid(m,2),reset)
RD.AttachCannotDirectAttack(e,c,aux.Stringid(m,3),reset)
RD.AttachAttackAll(e,c,1,aux.Stringid(m,4),reset)
RD.AttachAttackAll(e,c,1,aux.Stringid(m,4),reset1)
end
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):SetLabel(c:GetFieldID())
RD.CreateOnlyThisAttackEffect(e,20145031,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
end
function cm.atlimit(e,c)
return c:IsDefensePos()
end
function cm.atktg(e,c)
return e:GetLabel()~=c:GetFieldID()
end
\ No newline at end of file
......@@ -25,7 +25,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.Damage()~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
RD.Damage()
Duel.Draw(tp,1,REASON_EFFECT)
end
\ No newline at end of file
......@@ -31,7 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0
and Duel.Draw(tp,2,REASON_EFFECT)~=0 and Duel.IsPlayerCanDiscardDeck(tp,1) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
......
......@@ -30,7 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -31,7 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and Duel.Draw(tp,2,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and Duel.Draw(tp,2,REASON_EFFECT)~=0 then
RD.SelectAndDoAction(HINTMSG_TODECK,Card.IsAbleToDeck,tp,LOCATION_HAND,0,2,2,nil,function(g)
Duel.BreakEffect()
RD.SendToDeckBottom(g,tp,tp,true)
......
......@@ -27,7 +27,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and Duel.Draw(tp,3,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and Duel.Draw(tp,3,REASON_EFFECT)~=0 then
RD.SelectAndDoAction(HINTMSG_TOGRAVE,Card.IsAbleToGrave,tp,LOCATION_HAND,0,3,3,nil,function(g)
RD.SendToGraveAndExists(g)
end)
......
......@@ -31,7 +31,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.Damage(nil,Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*500)
if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
RD.CreateAttackLimitEffect(e,nil,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
RD.CreateCannotAttackEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
\ No newline at end of file
......@@ -17,7 +17,7 @@ function cm.initial_effect(c)
end
--Draw
function cm.setfilter(c)
return RD.IsLegendCode(c,list[1]) and c:IsSSetable()
return c:IsLinkCode(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
......
......@@ -14,7 +14,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_FAIRY) and RD.IsCanAttachBattleIndes(c, 1)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_FAIRY) and RD.IsCanAttachBattleIndes(c,1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
......
......@@ -20,7 +20,7 @@ function cm.spfilter(c,e,tp)
return c:IsLevelBelow(6) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.exfilter(c)
return RD.IsLegendCode(c,list[1])
return c:IsLinkCode(list[1])
end
cm.cost=RD.CostSendSelfToGrave()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -17,7 +17,7 @@ function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and bit.band(r,REASON_RULE)~=0
return ep~=tp and r==REASON_RULE
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
......
......@@ -17,8 +17,9 @@ function cm.tdfilter(c,race)
return c:IsLevelAbove(1) and c:IsRace(race) and c:IsAbleToDeck()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil,e:GetHandler():GetRace()) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil,e:GetHandler():GetRace())
local race=e:GetHandler():GetRace()
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil,race) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil,race)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......@@ -29,7 +30,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local atk=g:GetSum(Card.GetLevel)*100
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
Duel.BreakEffect()
if RD.SendToDeckAndExists(g) and Duel.GetOperatedGroup():GetCount() == 1 then
if RD.SendToDeckAndExists(g) and Duel.GetOperatedGroup():GetCount()==1 then
RD.AttachPierce(e,c,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
end
end)
......
......@@ -14,7 +14,7 @@ function cm.initial_effect(c)
end
--Cannot Activate
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
return Duel.IsAbleToEnterBP() and RD.IsPlayerCanUseRaceAttack(tp,RACE_WARRIOR)
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -30,9 +30,5 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,g:GetFirst():GetAttack(),REASON_EFFECT)
end)
RD.CreateHintEffect(e,aux.Stringid(m,2),tp,1,0,RESET_PHASE+PHASE_END)
local e1=RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetLabel(e:GetHandler():GetFieldID())
end
function cm.atktg(e,c)
return e:GetLabel()~=c:GetFieldID()
RD.CreateOnlyThisAttackEffect(e,20155030,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
end
\ No newline at end of file
local m=120155040
local cm=_G["c"..m]
cm.name="古代壁"
cm.name="古代冰炎壁"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -19,15 +19,16 @@ end
function cm.costcheck(g)
return g:GetClassCount(Card.GetRace)==1
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanAttachEffectIndes(c,cm.indval)
function cm.filter(c,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanAttachEffectIndes(c,tp,cm.indval)
end
cm.cost=RD.CostSendGraveSubToDeck(cm.costfilter,cm.costcheck,2,2)
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,tp) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
local filter=RD.Filter(cm.filter,tp)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
g:ForEach(function(tc)
RD.AttachEffectIndes(e,tc,cm.indval,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
......
......@@ -32,10 +32,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectGroupAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),cm.check,tp,LOCATION_GRAVE,0,2,2,nil,e,POS_FACEUP_ATTACK)
if Duel.GetFlagEffect(tp,m)~=0 then return end
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)
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,1),RACE_ALL-RACE_FIEND,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_FIEND)
end
\ No newline at end of file
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.thfilter(c)
return RD.IsLegendCode(c,list[1]) and c:IsAbleToHand()
return c:IsLinkCode(list[1]) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
......
......@@ -19,20 +19,20 @@ end
function cm.costfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WYRM) and c:IsAbleToGraveAsCost()
end
function cm.filter(c,tp)
return c:IsFaceup() and RD.IsPlayerCanUseRaceAttack(1-tp,c:GetRace())
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
cm.cost=RD.CostSendMZoneToGrave(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,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.CreateHintEffect(e,aux.Stringid(m,2),tp,0,1,RESET_PHASE+PHASE_END)
local e1=RD.CreateAttackLimitEffect(e,cm.atktg,tp,0,LOCATION_MZONE,RESET_PHASE+PHASE_END)
e1:SetLabel(g:GetFirst():GetRace())
local filter=RD.Filter(cm.filter,tp)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local race=g:GetFirst():GetRace()
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,2),race,tp,0,1,RESET_PHASE+PHASE_END)
end)
end
function cm.atktg(e,c)
return c:IsRace(e:GetLabel())
end
\ No newline at end of file
local m=120170000
local cm=_G["c"..m]
cm.name="破坏剑士"
cm.name="破坏剑士"
function cm.initial_effect(c)
--Atk Up
local e1=Effect.CreateEffect(c)
......
......@@ -29,7 +29,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
RD.CanSelectAndSet(aux.Stringid(m,1),aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,2,nil,e,true)
end
end
\ No newline at end of file
......@@ -21,7 +21,7 @@ function cm.spfilter(c,e,tp)
return c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.costcheck(g,e,tp)
return g:GetClassCount(Card.GetCode,nil)==g:GetCount()
return g:GetClassCount(Card.GetLinkCode,nil)==g:GetCount()
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,g,e,tp)
end
cm.cost=RD.CostSendGraveSubToDeckBottom(cm.costfilter,cm.costcheck,2,2)
......
......@@ -33,7 +33,9 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
RD.CreateOnlySoleAttackEffect(e,m,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
end)
if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
RD.CreateOnlySoleAttackEffect(e,20170032,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
\ No newline at end of file
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Extra Tribute
cm.trival=RD.ValueDoubleTribute(nil,RACE_WINDBEAST)
cm.trival=RD.ValueDoubleTributeAttrRace(nil,RACE_WINDBEAST)
function cm.costfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsPublic()
end
......
......@@ -19,6 +19,14 @@ function cm.initial_effect(c)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e3)
--Limit Tribute
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SINGLE_TRIBUTE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(1,1)
c:RegisterEffect(e4)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
......
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and (RD.IsLegendCode(c,list[1])
return c:IsFaceup() and (c:IsLinkCode(list[1])
or (c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) and c:IsRace(RACE_FIEND)))
end
function cm.filter(c)
......
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter(c,tp)
return (RD.IsLegendCode(c,list[1]) or c:GetPreviousCodeOnField()==list[1] or (
return (c:IsLinkCode(list[1]) or c:GetPreviousCodeOnField()==list[1] or (
RD.IsPreviousType(c,TYPE_NORMAL) and c:GetPreviousLevelOnField()>=7 and RD.IsPreviousRace(c,RACE_FIEND)
)) and RD.IsPreviousControler(c,tp) and c==Duel.GetAttackTarget()
end
......
......@@ -20,7 +20,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.confilter1(c)
return c:IsFaceup() and (RD.IsLegendCode(c,list[1])
return c:IsFaceup() and (c:IsLinkCode(list[1])
or (c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) and c:IsRace(RACE_FIEND)))
end
function cm.confilter2(c,tp)
......
local m=120181002
local list={120130000}
local cm=_G["c"..m]
cm.name="黑魔术少女"
function cm.initial_effect(c)
RD.AddCodeList(c,LEGEND_DARK_MAGICIAN)
RD.AddCodeList(c,list)
--Atk Up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -14,7 +15,7 @@ function cm.initial_effect(c)
end
--Atk Up
function cm.filter(c)
return RD.IsLegendCode(c,LEGEND_DARK_MAGICIAN)
return c:IsLinkCode(list[1])
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(cm.filter,c:GetControler(),LOCATION_GRAVE,LOCATION_GRAVE,nil)*500
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Extra Tribute
cm.trival=RD.ValueDoubleTribute(ATTRIBUTE_LIGHT,RACE_MACHINE)
cm.trival=RD.ValueDoubleTributeAttrRace(ATTRIBUTE_LIGHT,RACE_MACHINE)
function cm.costfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToDeckOrExtraAsCost()
end
......
......@@ -29,7 +29,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachAtkDef(e,c,300,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
local g=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if g:GetClassCount(Card.GetCode)>=4 then
if g:GetClassCount(Card.GetLinkCode)>=4 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
end
end
......
......@@ -27,14 +27,11 @@ cm.cost=RD.CostPayLP(600)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectGroupAndSet(aux.NecroValleyFilter(cm.setfilter),aux.dncheck,tp,LOCATION_GRAVE,0,1,2,nil,e)
if Duel.GetFlagEffect(tp,m)~=0 then return end
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)
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,1),RACE_ALL-RACE_MACHINE,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_MACHINE)
end
\ No newline at end of file
......@@ -32,6 +32,7 @@ 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.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectGroupAndSet(aux.NecroValleyFilter(cm.setfilter),aux.dncheck,tp,LOCATION_GRAVE,0,1,2,nil,e)
......
......@@ -25,6 +25,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachAtkDef(e,g:GetFirst(),-500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.CanSelectAndDoAction(aux.Stringid(m,2),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
Duel.BreakEffect()
Duel.Destroy(sg,REASON_EFFECT)
end)
end)
......
......@@ -19,7 +19,7 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND)
end
function cm.exfilter(c)
return c:IsFaceup() and RD.IsLegendCode(c,list[1])
return c:IsFaceup() and c:IsLinkCode(list[1])
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,2,nil)
......
......@@ -23,10 +23,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and tc:IsFaceup() then
RD.AttachAtkDef(e,tc,-400,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.AttachBattleIndes(e,tc,1,nil,RESET_PHASE+PHASE_DAMAGE)
RD.AttachBattleIndes(e,tc,1,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
local c=Duel.GetAttackTarget()
if c and c:IsRelateToBattle() and c:IsFaceup() then
RD.AttachBattleIndes(e,c,1,nil,RESET_PHASE+PHASE_DAMAGE)
RD.AttachBattleIndes(e,c,1,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
end
end
end
\ No newline at end of file
......@@ -22,8 +22,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostSendMZoneToGrave(Card.IsAbleToGraveAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=eg:GetFirst()
if chk==0 then return tc:IsAbleToDeck() end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0)
end
......
......@@ -29,6 +29,7 @@ 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.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSet(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,1,nil,e)
......
local m=120189003
local cm=_G["c"..m]
cm.name="天吉他手"
cm.name="天吉他手"
function cm.initial_effect(c)
--Atk Up
local e1=Effect.CreateEffect(c)
......
......@@ -22,7 +22,8 @@ function cm.filter(c)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
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)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*-300
......
......@@ -7,19 +7,17 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DESTROY,CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
--Destroy
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil)
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
Duel.Destroy(g,REASON_EFFECT)
end)
......@@ -31,11 +29,11 @@ end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.atkfilter,tp,0,LOCATION_MZONE,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.atkfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,0,LOCATION_MZONE,nil)
local atk=g:GetSum(Card.GetAttack)
if atk==0 then return end
......
......@@ -7,19 +7,18 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_DESTROY)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_POSITION,CATEGORY_DESTROY)
end
--Position
function cm.posfilter(c)
return RD.IsCanChangePosition(c) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil)
function cm.target1(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)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
......@@ -39,11 +38,13 @@ end
function cm.desfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON)
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
if ct==0 then return end
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
......
......@@ -7,35 +7,35 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,CATEGORY_TODECK)
end
--Multi-Choose Effect
cm.cost=RD.CostSendGraveToDeckBottom(Card.IsAbleToDeckOrExtraAsCost,1,1)
--To Deck(Grave)
function cm.tdfilter1(c)
function cm.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.tdfilter1,tp,0,LOCATION_GRAVE,1,nil)
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter1),tp,0,LOCATION_GRAVE,1,3,nil,function(g)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter1),tp,0,LOCATION_GRAVE,1,3,nil,function(g)
RD.SendToDeckAndExists(g)
end)
end
--To Deck(Monstar)
function cm.tdfilter2(c)
function cm.filter2(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToDeck()
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.tdfilter2,tp,0,LOCATION_MZONE,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter2,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,cm.tdfilter2,tp,0,LOCATION_MZONE,1,2,nil,function(g)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,cm.filter2,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.SendToDeckAndExists(g)
end)
end
\ No newline at end of file
......@@ -7,19 +7,15 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
--Atk & Def Down(Single)
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
function cm.target1(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.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,3),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.AttachAtkDef(e,g:GetFirst(),-1500,-1500,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
......@@ -28,10 +24,10 @@ end
function cm.downfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DINOSAUR)
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.downfilter,tp,0,LOCATION_MZONE,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.downfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.downfilter,tp,0,LOCATION_MZONE,nil)
g:ForEach(function(tc)
RD.AttachAtkDef(e,tc,-2000,-2000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
......@@ -7,11 +7,7 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......@@ -19,10 +15,10 @@ cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.atkfilter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
......@@ -34,10 +30,12 @@ end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if RD.SendToDeckAndExists(g) then
Duel.ShuffleDeck(tp)
......
......@@ -7,12 +7,7 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),nil,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),nil,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
function cm.confilter1(c)
......@@ -27,7 +22,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostSendDeckTopToGrave(1)
--Atk Up
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachAtkDef(e,c,900,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
......@@ -35,10 +30,10 @@ function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
end
end
--Pierce
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP() and RD.IsCanAttachExtraAttack(e:GetHandler(),1)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsAbleToEnterBP() and RD.IsCanAttachExtraAttack(e:GetHandler(),1) end
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachExtraAttack(e,c,1,aux.Stringid(m,4),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
......
......@@ -7,11 +7,7 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
function cm.costfilter(c)
......@@ -22,25 +18,23 @@ cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_HYDRAGON) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp,op)
local filter=cm.spfilter
if op then filter=aux.NecroValleyFilter(cm.spfilter) end
return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
end
--To Hand
function cm.thfilter(c)
return c:IsCode(list[3]) and c:IsAbleToHand()
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp,op)
local filter=cm.thfilter
if op then filter=aux.NecroValleyFilter(cm.thfilter) end
return Duel.IsExistingMatchingCard(filter,tp,LOCATION_GRAVE,0,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
RD.SendToHandAndExists(g,1-tp)
end)
......
......@@ -19,7 +19,7 @@ end
--Indes
cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsCanAttachEffectIndes(e:GetHandler(),cm.indval)
return RD.IsCanAttachEffectIndes(e:GetHandler(),tp,cm.indval)
end
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -21,19 +21,12 @@ function cm.costfilter(c)
return c:IsRace(RACE_DINOSAUR) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.exfilter(c)
return RD.IsLegendCode(c,list[3])
return c:IsLinkCode(list[3])
end
function cm.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
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)
local op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
Duel.SendtoDeck(g,nil,op,REASON_COST)
end
cm.cost=RD.CostSendGraveToDeckTopOrBottom(cm.costfilter,1,1,aux.Stringid(m,1),aux.Stringid(m,2))
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -31,10 +31,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)
if Duel.GetFlagEffect(tp,m)~=0 then return end
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)
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,1),RACE_ALL-RACE_MACHINE,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_MACHINE)
end
\ No newline at end of file
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
end
--Activate
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and RD.IsCanAttachBattleIndes(c, 1)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and RD.IsCanAttachBattleIndes(c,1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
......
......@@ -3,7 +3,8 @@ local cm=_G["c"..m]
cm.name="融合术"
function cm.initial_effect(c)
--Activate
local e1=RD.CreateFusionEffect(c,cm.matfilter,nil,nil,0,0)
local e1=RD.CreateFusionEffect(c,cm.matfilter)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
......
......@@ -16,8 +16,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Destroy
function cm.costfilter(c)
function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsCode(list[1]) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,Group.FromCards(c,e:GetHandler()))
end
cm.cost=RD.CostSendOnFieldToGrave(cm.costfilter,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -26,7 +26,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,1,REASON_EFFECT)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,99,nil,function(g)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
Duel.BreakEffect()
RD.SendToHandAndExists(g,1-tp)
end)
......
......@@ -30,10 +30,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
if Duel.GetFlagEffect(tp,m)~=0 then return end
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)
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,1),RACE_ALL-RACE_WYRM,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return not c:IsRace(RACE_WYRM)
end
\ No newline at end of file
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Extra Tribute
cm.trival=RD.ValueDoubleTribute(ATTRIBUTE_FIRE,nil)
cm.trival=RD.ValueDoubleTributeAttrRace(ATTRIBUTE_FIRE,nil)
function cm.confilter(c)
return c:IsFaceup() and c:IsCode(list[1])
end
......
......@@ -32,9 +32,5 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.AttachAtkDef(e,c,2500,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
local e1=RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetLabel(c:GetFieldID())
end
function cm.atktg(e,c)
return e:GetLabel()~=c:GetFieldID()
RD.CreateOnlyThisAttackEffect(e,20199028,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
end
\ No newline at end of file
......@@ -7,19 +7,15 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_DESTROY)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
--Atk Up
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0 end
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)*300
......@@ -27,10 +23,12 @@ function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
end
end
--Destroy
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil)
if g:GetCount()==0 then return end
Duel.ConfirmCards(tp,g)
......
......@@ -7,18 +7,18 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),nil,cm.eff1op,aux.Stringid(m,2),nil,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE+CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetCondition(cm.condition)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,cm.condition,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DAMAGE+CATEGORY_ATKCHANGE,CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
end
--Multi-Choose Effect
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
--Damage
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(tp,2000,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
......@@ -33,7 +33,11 @@ end
function cm.spfilter(c,e,tp)
return c:IsLevelAbove(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,1000,REASON_EFFECT)~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,4),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
......
local m=120199036
local list={120120029,120199001}
local cm=_G["c"..m]
cm.name="天翔流丽 雅灭铁拉"
cm.name="天翔流丽 雅灭铁拉"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),nil,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_POSITION)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),nil,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_POSITION)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
--Cannot Special Summon
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachAtkDef(e,c,500,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
......@@ -39,10 +35,12 @@ end
function cm.posfilter(c)
return RD.IsCanChangePosition(c)
end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g)
end)
......
......@@ -16,17 +16,18 @@ cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR+RACE_FAIRY+RACE_BEAST+RACE_WINDBEAST+RACE_REPTILE)
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanAttachEffectIndes(c,cm.indval)
function cm.filter(c,tp)
return c:IsFaceup() and RD.IsCanAttachEffectIndes(c,tp,cm.indval)
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.filter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
local filter=RD.Filter(cm.filter,tp)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
g:ForEach(function(tc)
RD.AttachEffectIndes(e,tc,cm.indval,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
......
......@@ -29,6 +29,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP) then
local tc=Duel.GetOperatedGroup():GetFirst()
RD.AttachAtkDef(e,tc,-800,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
RD.AttachAtkDef(e,tc,-800,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end
\ No newline at end of file
......@@ -20,9 +20,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local c=Duel.GetAttackTarget()
if tc and tc:IsRelateToBattle() and tc:IsFaceup() then
RD.AttachBattleIndes(e,tc,1,nil,RESET_PHASE+PHASE_DAMAGE)
RD.AttachBattleIndes(e,tc,1,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
if c and c:IsRelateToBattle() and c:IsFaceup() then
RD.AttachBattleIndes(e,c,1,nil,RESET_PHASE+PHASE_DAMAGE)
RD.AttachBattleIndes(e,c,1,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
end
end
end
\ No newline at end of file
......@@ -30,7 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
if RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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