Commit c3aed578 authored by xiaoye's avatar xiaoye

fix

parent 562c5fa2
local cm,m,o=GetID()
function cm.initial_effect(c)
vgd.VgCard(c)
cm.is_has_continuous=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(function (e,re,tp)
return re:IsHasCategory(CATEGORY_DEFENDER) and re:GetHandler():IsLocation(LOCATION_HAND)
vgd.CannotCallToGZoneWhenAttack(c, m, function (e,re,tp)
return re:GetHandler():IsLocation(LOCATION_HAND)
end)
e1:SetCondition(function (e)
return Duel.GetAttacker()==e:GetHandler() and vgf.RMonsterFilter(Duel.GetAttackTarget())
end)
c:RegisterEffect(e1)
vgd.EffectTypeTriggerWhenHitting(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,cm.op,cm.cost,nil,nil,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -260,8 +260,8 @@ function VgD.RideUpOperation(e, tp, eg, ep, ev, re, r, rp)
sc:SetMaterial(Group.FromCards(rc))
VgF.Sendto(LOCATION_OVERLAY, Group.FromCards(rc), sc)
VgF.Sendto(LOCATION_MZONE, sc, SUMMON_TYPE_RIDE, tp, 0x20)
if VgF.IsExistingMatchingCard(Card.IsType, tp, LOCATION_RIDE, 0, 1, nil, TYPE_EMBLEM) then
local tc = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_RIDE, 0, nil, TYPE_EMBLEM):GetFirst()
if VgF.IsExistingMatchingCard(Card.IsType, tp, LOCATION_RIDE, 0, 1, nil, TYPE_RIDE_EMBLEM) then
local tc = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_RIDE, 0, nil, TYPE_RIDE_EMBLEM):GetFirst()
VgF.Sendto(LOCATION_EMBLEM, tc, tp, POS_FACEUP_DEFENSE, REASON_EFFECT)
end
elseif sel == 0 or (sel == 1 and a and b) then
......@@ -1670,7 +1670,7 @@ end
---@param con function|nil 这个效果的条件函数
---@param reset number|nil 效果的重置条件
---@param hc Card|nil 效果的拥有者, 没有则为 c
---@return Effect 这个效果
---@return Effect|nil 这个效果
function VgD.TriggerCountUp(c, m, num, con, reset, hc)
-- check func
if VgF.IllegalFunctionCheck("TriggerCountUp", c).con(con) then return end
......@@ -1744,6 +1744,41 @@ function VgD.CannotBeTarget(c, m, loc, typ, val, con, tg, loc_self)
c:RegisterEffect(e)
return e
end
---【永】Card c 攻击的战斗中,对手不能将符合函数f的卡CALL到G上。
---@param c Card 效果的创建者
---@param m number|nil 效果的创建者的卡号
---@param val function|nil 这个效果的目标函数
---@param condition function|nil 这个效果的条件函数
---@param reset number|nil 效果的重置条件
---@param hc Card|nil 效果的拥有者, 没有则为 c
---@return Effect|nil 这个效果
function VgD.CannotCallToGZoneWhenAttack(c, m, val, condition, reset, hc)
-- set param
local cm = _G["c"..(m or c:GetOriginalCode())]
cm.is_has_continuous = cm.is_has_continuous or not reset
hc = hc and VgF.ReturnCard(hc) or c
val = val or function(e, re, rp)
return VgF.True()
end
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(function (e, re, tp)
return re:IsHasCategory(CATEGORY_DEFENDER) and val(e, re, tp)
end)
e1:SetCondition(function (e)
return Duel.GetAttacker() == e:GetHandler() and (not condition or condition(e, e:GetHandler()))
end)
if reset then e1:SetReset(RESET_EVENT + RESETS_STANDARD + reset) end
hc:RegisterEffect(e1)
return e1
end
---【永】【指令区】:你的指令区中没有世界卡以外的设置指令卡的话,根据你的指令区中的卡的张数生效以下全部的效果。
---●1张——你的世界卡的内容变为黑夜。
......
......@@ -56,36 +56,18 @@ POS_ATTACK = 0x3 --攻击表示
POS_DEFENSE = 0xc --守备表示
NO_FLIP_EFFECT = 0x10000--不发动反转效果
--Types 卡片类型
TYPE_MONSTER = 0x1 --怪兽卡
TYPE_SPELL = 0x2 --魔法卡
TYPE_TRAP = 0x4 --陷阱卡
TYPE_NORMAL = 0x10 --通常怪兽
TYPE_EFFECT = 0x20 --效果
TYPE_FUSION = 0x40 --融合
TYPE_RITUAL = 0x80 --仪式
TYPE_TRAPMONSTER = 0x100 --陷阱怪兽
TYPE_SPIRIT = 0x200 --灵魂
TYPE_UNION = 0x400 --同盟
TYPE_DUAL = 0x800 --二重
TYPE_TUNER = 0x1000 --调整
TYPE_SYNCHRO = 0x2000 --同调
TYPE_TOKEN = 0x4000 --衍生物
TYPE_QUICKPLAY = 0x10000 --速攻
TYPE_CONTINUOUS = 0x20000 --永续
TYPE_EQUIP = 0x40000 --装备
TYPE_FIELD = 0x80000 --场地
TYPE_COUNTER = 0x100000 --反击
TYPE_FLIP = 0x200000 --翻转
TYPE_TOON = 0x400000 --卡通
TYPE_XYZ = 0x800000 --超量
TYPE_PENDULUM = 0x1000000 --灵摆
TYPE_SPSUMMON = 0x2000000 --特殊召唤
TYPE_LINK = 0x4000000 --连接
--组合类型
TYPES_TOKEN_MONSTER = 0x4011
TYPES_NORMAL_TRAP_MONSTER = 0x111
TYPES_EFFECT_TRAP_MONSTER = 0x121
TYPE_EMBLEM = TYPE_TRAP + TYPE_COUNTER + TYPE_FUSION
TYPE_MONSTER = 0x1 --单位卡
TYPE_SPELL = 0x2 --指令卡
TYPE_TRAP = 0x4 --标记
TYPE_NORMAL = 0x20 --普通
TYPE_TRIIGER = 0x80 --触发
TYPE_G = 0x200 --G
TYPE_TOKEN = 0x4000 --衍生
TYPE_QUICKPLAY = 0x10000 --闪现
TYPE_CONTINUOUS = 0x20000 --设置
TYPE_EMBLEM = 0x100000 --纹章
TYPE_RIDE_EMBLEM = 0x100044 --RIDE卡组纹章
--技能 --属性
SKILL_ALL = 0x7f --All
SKILL_NONE = 0x01 --无
......@@ -106,7 +88,7 @@ TRIGGER_SUPER = 0x20 --超限触发
--组合类型
TRIGGER_CARDS = 0x3e --触发单位卡
--Category 效果分类
CATEGORY_DEFENDER = 0x1 --守护者
CATEGORY_DEFENDER = 0x1 --防御
--Reason 卡片到当前位置的原因
REASON_DESTROY = 0x1 --破坏
REASON_RELEASE = 0x2 --解放
......
......@@ -734,7 +734,7 @@ function VgF.IsCanBeCalled(c, e, tp, sumtype, pos, zone)
if VgF.GetValueType(pos) ~= "number" then pos = POS_FACEUP_ATTACK end
if VgF.GetValueType(zone) == "string" and zone == "FromOverlayToV" then
local _, code = c:GetOriginalCode()
return Duel.IsPlayerCanSpecialSummonMonster(tp, code, nil, TYPE_MONSTER + TYPE_EFFECT, c:GetBaseAttack(), c:GetBaseDefense(), c:GetOriginalLevel(), c:GetOriginalRace(), c:GetOriginalAttribute())
return Duel.IsPlayerCanSpecialSummonMonster(tp, code, nil, TYPE_MONSTER + TYPE_NORMAL, c:GetBaseAttack(), c:GetBaseDefense(), c:GetOriginalLevel(), c:GetOriginalRace(), c:GetOriginalAttribute())
end
return z > 0 and c:IsCanBeSpecialSummoned(e, sumtype, tp, false, false, pos, tp, zone)
end
......@@ -815,6 +815,14 @@ function VgF.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min, ...)
return 0
end
end
function Group.ForEach(g, f, ...)
local ext_params = {...}
for c in VgF.Next(g) do
f(c, table.unpack(ext_params))
end
end
function Group.CheckSubGroup(g, f, min, max, ...)
min = min or 1
max = max or #g
......
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