Commit 103b2164 authored by xiaoye's avatar xiaoye

fix

parent 7cb6bca0
...@@ -551,6 +551,6 @@ vgf..Sendto(loc,sg,...) ...@@ -551,6 +551,6 @@ vgf..Sendto(loc,sg,...)
> >
> **LOCATION_TRIGGER : tp,tp,LOCATION_FZONE,POS_FACEUP,true** > **LOCATION_TRIGGER : tp,tp,LOCATION_FZONE,POS_FACEUP,true**
> >
> **LOCATION_MZONE : sumtype,tp,zone,pos,chk `chk为0则Call到不存在单位的圆阵`** > **LOCATION_MZONE : sumtype,tp,zone,pos**
> >
> **其他区域 : c,tp,pos,reason** > **其他区域 : c,tp,pos,reason**
\ No newline at end of file
...@@ -1474,22 +1474,42 @@ function VgD.GlobalCheckEffect(c,m,code,con,op) ...@@ -1474,22 +1474,42 @@ function VgD.GlobalCheckEffect(c,m,code,con,op)
end end
end end
function VgD.CannotBeTarget(c,m,con,val,loc) function VgD.CannotBeTarget(c,m,con,val,loc,tg,range)
local cm=_G["c"..m] local cm=_G["c"..m]
if not cm.is_has_continuous then cm.is_has_continuous=true end if not cm.is_has_continuous then cm.is_has_continuous=true end
if not loc then loc=LOCATION_MZONE end if not loc then loc=LOCATION_MZONE end
local e1=Effect.CreateEffect(c) if VgF.GetValueType(tg)=="function" or VgF.GetValueType(tg)=="number" then
e1:SetType(EFFECT_TYPE_SINGLE) if VgF.GetValueType(range)~="tabel" then range={} end
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) if #range==0 then range={LOCATION_MZONE,0}
e1:SetRange(loc) elseif #range==1 then table.insert(range,0)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) end
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end local e1=Effect.CreateEffect(c)
if VgF.GetValueType(val)=="function" then e1:SetValue(val) else e1:SetType(EFFECT_TYPE_FIELD)
e1:SetValue(function (e,re,rp) e1:SetRange(loc)
return rp==1-e:GetHandlerPlayer() e1:SetTargetRange(range[1],range[2])
end) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
if VgF.GetValueType(val)=="function" then e1:SetValue(val) else
e1:SetValue(function (e,re,rp)
return rp==1-e:GetHandlerPlayer()
end)
end
if VgF.GetValueType(tg)=="function" then e1:SetTarget(tg) end
c:RegisterEffect(e1)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(loc)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
if VgF.GetValueType(val)=="function" then e1:SetValue(val) else
e1:SetValue(function (e,re,rp)
return rp==1-e:GetHandlerPlayer()
end)
end
c:RegisterEffect(e1)
end end
c:RegisterEffect(e1)
end end
function VgD.NightEffect(c,m) function VgD.NightEffect(c,m)
local cm=_G["c"..m] local cm=_G["c"..m]
......
...@@ -572,6 +572,21 @@ function VgF.DamageFill(val) ...@@ -572,6 +572,21 @@ function VgF.DamageFill(val)
return Duel.GetOperatedGroup():GetCount() return Duel.GetOperatedGroup():GetCount()
end end
end end
function VgF.CostAnd(f1,f2,c1,c2)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local a=false
local b=false
if VgF.GetValueType(c1)~="nil" then a=f1(c1)(e,tp,eg,ep,ev,re,r,rp,chk) else a=f1(e,tp,eg,ep,ev,re,r,rp,chk) end
if VgF.GetValueType(c2)~="nil" then b=f2(c2)(e,tp,eg,ep,ev,re,r,rp,chk) else b=f2(e,tp,eg,ep,ev,re,r,rp,chk) end
return a and b
end
if VgF.GetValueType(c1)~="nil" then f1(c1)(e,tp,eg,ep,ev,re,r,rp,chk) else f1(e,tp,eg,ep,ev,re,r,rp,chk) end
if VgF.GetValueType(c2)~="nil" then f2(c2)(e,tp,eg,ep,ev,re,r,rp,chk) else f2(e,tp,eg,ep,ev,re,r,rp,chk) end
end
end
---用于效果的Cost。它返回一个执行“【费用】[将手牌中的val张卡舍弃]”的函数。 ---用于效果的Cost。它返回一个执行“【费用】[将手牌中的val张卡舍弃]”的函数。
---@param val integer 要舍弃的卡的数量 ---@param val integer 要舍弃的卡的数量
---@return function 效果的Cost函数 ---@return function 效果的Cost函数
......
...@@ -7,7 +7,7 @@ function cm.initial_effect(c) ...@@ -7,7 +7,7 @@ function cm.initial_effect(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return vgf.RMonsterCondition(e) and c:IsSummonLocation(LOCATION_HAND) return vgf.RSummonCondition(e) and c:IsSummonLocation(LOCATION_HAND)
end end
--效果二处理 --效果二处理
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation,cm.cost,cm.con)
vgd.GlobalCheckEffect(c,m,EVENT_SPSUMMON_SUCCESS,cm.checkcon)
end end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_SELFRIDE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=0
if c:GetFlagEffect(m)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
a=Duel.SelectOption(tp,vgf.Stringid(m,0),vgf.Stringid(m,1))
end
if a==0 then Duel.Draw(tp,1,REASON_EFFECT) else vgf.AtkUp(c,c,5000) vgf.StarUp(c,c,1) end
end
function cm.filter(c)
return vgf.RMonsterFilter(c) and c:IsLevel(3)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return vgf.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,4,nil) and vgf.RMonsterCondition(e)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return vgf.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,chk) and vgf.OverlayCost(1)(e,tp,eg,ep,ev,re,r,rp,chk)
end
vgf.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,chk)
vgf.OverlayCost(1)(e,tp,eg,ep,ev,re,r,rp,chk)
end
\ No newline at end of file
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation,nil,cm.con)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return not vgf.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,1,nil) and vgf.RMonsterCondition(e)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
\ No newline at end of file
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_SPSUMMON_SUCCESS,cm.operation,vgf.CostAnd(vgf.DamageCost,vgf.DisCardCost,1,1),cm.condition)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=vgf.GetVMonster(tp)
return vgf.RSummonCondition(e) and c:IsSummonLocation(LOCATION_HAND) and tc:IsCode(10401008,10401046)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,2)
Duel.ConfirmCards(tp,g)
Duel.DisableShuffleCheck()
local ct=bit.ReturnCount(vgf.GetAvailableLocation(tp))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,vgf.IsCanBeCalled,0,ct,nil,e,tp)
if sg:GetCount()>0 then
vgf.Sendto(LOCATION_MZONE,sg,0,tp)
g:Sub(sg)
end
if g:GetCount()>1 then
Duel.SortDecktop(tp,tp,#g)
end
end
\ No newline at end of file
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgd.CannotBeTarget(c,m,vgf.RMonsterCondition,nil,LOCATION_MZONE,cm.tg)
end end
function cm.tg(e,tc)
local c=e:GetHandler()
return vgf.FrontFilter(tc) and vgf.GetColumnGroup(c):IsContains(tc) and tc:IsControler(c:GetControler())
end
\ No newline at end of file
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgd.SpellActivate(c,m,cm.op,vgf.CostAnd(vgf.DamageCost,vgf.OverlayCost,1,1))
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp,chk)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
local ct=bit.ReturnCount(vgf.GetAvailableLocation(tp))
if chk>0 then if ct>2 then ct=2 end
else if ct>1 then ct=1 end
end
local sg=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_DROP,0,0,ct,nil,g:GetFirst():GetLevel(),e,tp)
if sg:GetCount()>0 then
vgf.Sendto(LOCATION_MZONE,sg,0,tp)
end
end
end
function cm.filter(c,lv,e,tp)
return c:IsLevel(lv) and vgf.IsCanBeCalled(c,e,tp)
end
\ No newline at end of file
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgd.SpellActivate(c,m,cm.op,vgf.DamageCost(1))
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,2)
vgf.Sendto(LOCATION_GRAVE,g,REASON_EFFECT)
local ct=bit.ReturnCount(vgf.GetAvailableLocation(tp))
if vgf.GetVMonster(tp):IsCode(10104001) then if ct>2 then ct=2 end
else if ct>1 then ct=1 end
end
local sg=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_DROP,0,0,ct,nil,vgf.GetVMonster(tp):GetLevel(),e,tp)
if sg:GetCount()>0 then vgf.Sendto(LOCATION_MZONE,sg,0,tp) end
end
function cm.filter(c,lv,e,tp)
return c:IsLevelBelow(lv) and vgf.IsCanBeCalled(c,e,tp)
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment