Commit 54be4cae authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent 2f4453fa
......@@ -319,13 +319,17 @@ function VgD.MonsterBattle(c)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_BATTLE_START)
e7:SetRange(LOCATION_HAND+LOCATION_MZONE)
e7:SetRange(LOCATION_MZONE)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCountLimit(1)
e7:SetCost(VgD.SendToGCost)
e7:SetCondition(VgD.SendToGCondition)
e7:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e7:SetCondition(VgD.SendToGCondition(VgF.IsAbleToGZone))
e7:SetOperation(VgD.SendToGOperation)
c:RegisterEffect(e7)
local e17=e7:Clone()
e17:SetRange(LOCATION_HAND)
e17:SetCost(VgD.SendToGCost)
e17:SetCondition(VgD.SendToGCondition(nil))
c:RegisterEffect(e17)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_DAMAGE_STEP_END)
......@@ -457,22 +461,20 @@ function VgD.SupportValue(e)
end
function VgD.SendToGCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsLocation(LOCATION_MZONE) then
if chk==0 then return true end
else
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) or Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) or Duel.IsExistingMatchingCard(VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,c) end
if Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) and not Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) then
local tc=Duel.SelectMatchingCard(tp,VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,1,c)
tc=VgF.ReturnCard(tc)
Duel.ConfirmCards(1-tp,tc)
e:SetLabelObject(tc)
end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) or Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) or Duel.IsExistingMatchingCard(VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,c) end
if Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) and not Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) then
local tc=Duel.SelectMatchingCard(tp,VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,1,c)
tc=VgF.ReturnCard(tc)
Duel.ConfirmCards(1-tp,tc)
e:SetLabelObject(tc)
end
end
function VgD.SendToGCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttackTarget()
return bc and bc:IsControler(tp) and bc~=c and VgF.IsAbleToGZone(c)
function VgD.SendToGCondition(f)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttackTarget()
return bc and bc:IsControler(tp) and bc~=c and (vgf.GetValueType(f)~="function" or f(c))
end
end
function VgD.SendToGOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -766,7 +768,7 @@ end
---@param op function|nil 作为指令卡的效果
---@param con function|nil 作为指令卡的发动条件
---@param cost any|nil 作为指令卡的发动费用
function VgD.SpellActivate(c,m,op,con,cost)
function VgD.SpellActivate(c,m,op,cost,con)
local e1=Effect.CreateEffect(c)
if m then e1:SetDescription(VgF.Stringid(m, 0)) end
e1:SetType(EFFECT_TYPE_ACTIVATE)
......
......@@ -491,7 +491,6 @@ end
---@param c Card 要判断的卡
---@return boolean 指示c能否去到G区域。
function VgF.IsAbleToGZone(c)
if c:IsLocation(LOCATION_HAND) then return true end
local tp=c:GetControler()
return c:IsAttribute(SKILL_BLOCK) and VgF.IsSequence(c,0,4) and not Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SENDTOG_MZONE) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup()
end
......@@ -507,11 +506,11 @@ function VgF.DisCardCostOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,nil)
cm.cos_val={nil,num,num}
end
return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,num,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
......@@ -531,11 +530,11 @@ function VgF.EnergyCostOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
cm.cos_val={nil,num,num}
end
if chk==0 then
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
cm.cos_val={nil,num,num}
end
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_EMBLEM,0,num,nil,10800730)
end
local sg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
......@@ -555,11 +554,11 @@ function VgF.OverlayCostOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)
cm.cos_val={nil,num,num}
end
return Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)>=num
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
......@@ -579,11 +578,11 @@ function VgF.OverlayFillOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetFieldGroupCount(tp,LOCATION_DECK)
cm.cos_val={nil,num,num}
end
if chk==0 then
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
cm.cos_val={nil,num,num}
end
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=num
end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
......@@ -604,11 +603,11 @@ function VgF.DamageCostOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_DAMAGE,0,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_DAMAGE,0,nil)
cm.cos_val={nil,num,num}
end
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,num,nil)
end
Debug.Message(chk)
......
......@@ -22,8 +22,8 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,chk) and vgf.DisCardCostOp(1,e,tp,eg,ep,ev,re,r,rp,chk)
return vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,chk) and vgf.DisCardCostOP(1,e,tp,eg,ep,ev,re,r,rp,chk)
end
vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,chk)
vgf.DisCardCostOp(1,e,tp,eg,ep,ev,re,r,rp,chk)
vgf.DisCardCostOP(1,e,tp,eg,ep,ev,re,r,rp,chk)
end
\ No newline at end of file
......@@ -22,7 +22,7 @@ function cm.fliter2(c)
end
--计数爆发1,灵魂爆发1
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.DamageCostOp(1,e,tp,eg,ep,ev,re,r,rp,0) and vgf.OverlayCostOp(1,e,tp,eg,ep,ev,re,r,rp,0) end
vgf.DamageCostOp(1,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayCostOp(1,e,tp,eg,ep,ev,re,r,rp,1)
if chk==0 then return vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,0) and vgf.OverlayCostOP(1,e,tp,eg,ep,ev,re,r,rp,0) end
vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayCostOP(1,e,tp,eg,ep,ev,re,r,rp,1)
end
......@@ -14,12 +14,12 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
VgF.StarUp(c,g1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g2=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,0,4,5)
VgF.AtkUp(c,g2,10000,nil)
VgF.AtkUp(c,g2,10000,nil)
if Duel.GetMatchingGroupCount(nil,tp,LOCATION_DAMAGE,0,nil)>=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_DAMAGE,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODROP)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DAMAGE,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_TRIGGER)
end
end
end
end
\ No newline at end of file
......@@ -7,26 +7,21 @@ function cm.initial_effect(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_ATTACK_ANNOUNCE,cm.operation2,cm.cost,cm.condition2)
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetAttacker()
return vgf.RMonsterCondition(e) and Duel.GetMatchingGroupCount(vgf.RMonsterFilter,tp,0,LOCATION_MZONE,nil)<=2 and VgF.VMonsterFilter(g)
local c=Duel.GetAttacker()
return vgf.RMonsterCondition(e) and Duel.GetMatchingGroupCount(vgf.RMonsterFilter,tp,0,LOCATION_MZONE,nil)<=2 and VgF.VMonsterFilter(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
if chk==0 then return c:IsCanOverlay() end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
Duel.Overlay(rc,c)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CRITICAL_STRIKE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,vgf.VMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
VgF.StarUp(c,g,1,EVENT_BATTLED)
local e1=VgF.StarUp(c,g,1,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
end
function cm.filter(c)
return vgf.VMonsterFilter(c)
end
\ No newline at end of file
......@@ -11,18 +11,16 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_GRAVE,0,0,1,nil)
if g:GetCount()>0 then
Duel.Overlay(VgF.GetVMonster(tp),g)
end
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.OverlayFillOp(1,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayFillOP(1,e,tp,eg,ep,ev,re,r,rp,1)
local e1=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
function cm.condition (e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(vgf.RMonsterFilter,tp,0,LOCATION_MZONE,nil)<=2
......
......@@ -8,15 +8,14 @@ end
--这个单位从手牌登场到R时
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not(c:IsSummonType(SUMMON_TYPE_RIDE) or c:IsSummonType(SUMMON_TYPE_SELFRIDE)) and c:IsPreviousLocation(LOCATION_HAND)
return not (c:IsSummonType(SUMMON_TYPE_RIDE) or c:IsSummonType(SUMMON_TYPE_SELFRIDE))
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.OverlayFillOp(1,e,tp,eg,ep,ev,re,r,rp)
vgf.OverlayFillOP(1,e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LEAVEONFIELD)
local g=Duel.SelectTarget(tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
local g=Duel.SelectTarget(tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
......@@ -7,14 +7,14 @@ function cm.initial_effect(c)
end
--计数爆发1,灵魂爆发1
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.DamageCostOp(1,e,tp,eg,ep,ev,re,r,rp,0) and vgf.OverlayCostOp(1,e,tp,eg,ep,ev,re,r,rp,0) end
vgf.DamageCostOp(1,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayCostOp(1,e,tp,eg,ep,ev,re,r,rp,1)
if chk==0 then return vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,0) and vgf.OverlayCostOP(1,e,tp,eg,ep,ev,re,r,rp,0) end
vgf.DamageCostOP(1,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayCostOP(1,e,tp,eg,ep,ev,re,r,rp,1)
end
--选择对手的1张等级2以上的后防者
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not(c:IsSummonType(SUMMON_TYPE_RIDE) or c:IsSummonType(SUMMON_TYPE_SELFRIDE)) and c:IsPreviousLocation(LOCATION_HAND)
return not (c:IsSummonType(SUMMON_TYPE_RIDE) or c:IsSummonType(SUMMON_TYPE_SELFRIDE))
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -13,11 +13,10 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return vgf.RMonsterCondition(e) and Duel.GetMatchingGroupCount(nil,tp,LOCATION_OVERLAY,0,nil)>=10
return vgf.RMonsterCondition(e) and VgF.GetVMonster(tp):GetOverlayCount()>=10
end
function cm.operation()
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g2=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,0,4,5)
VgF.AtkUp(c,g2,10000,nil)
end
\ No newline at end of file
......@@ -11,7 +11,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Draw(tp,1,REASON_EFFECT)
VgF.OverlayFillOp(1,e,tp,eg,ep,ev,re,r,rp,1)
VgF.OverlayFillOP(1,e,tp,eg,ep,ev,re,r,rp,1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_HAND,nil)>=1 end
......@@ -25,5 +25,5 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not(c:IsSummonType(SUMMON_TYPE_RIDE) or c:IsSummonType(SUMMON_TYPE_SELFRIDE))
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
vgf.OverlayFillOp(2,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayFillOP(2,e,tp,eg,ep,ev,re,r,rp,1)
end
\ No newline at end of file
......@@ -7,7 +7,7 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.OverlayFillOp(1,e,tp,eg,ep,ev,re,r,rp,1)
vgf.OverlayFillOP(1,e,tp,eg,ep,ev,re,r,rp,1)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local e1=Duel.GetMatchingGroupCount(nil,tp,LOCATION_OVERLAY,0,nil)/5
......@@ -18,7 +18,4 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMatchingGroupCount(nil,tp,LOCATION_OVERLAY,0,nil)>=10 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function cm.filter(c)
return c:IsCode(10101006)
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