Commit eb84ba01 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent 6855895f
...@@ -8,6 +8,7 @@ function VgD.RideUp(c) ...@@ -8,6 +8,7 @@ function VgD.RideUp(c)
e1:SetCode(EVENT_PREDRAW) e1:SetCode(EVENT_PREDRAW)
e1:SetCountLimit(1,VgID) e1:SetCountLimit(1,VgID)
e1:SetRange(LOCATION_ALL) e1:SetRange(LOCATION_ALL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(VgD.RideZeroCondition) e1:SetCondition(VgD.RideZeroCondition)
e1:SetOperation(VgD.RideZeroOperation) e1:SetOperation(VgD.RideZeroOperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -16,6 +17,7 @@ function VgD.RideUp(c) ...@@ -16,6 +17,7 @@ function VgD.RideUp(c)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY) e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_ALL) e2:SetRange(LOCATION_ALL)
e2:SetCountLimit(1,VgID+1) e2:SetCountLimit(1,VgID+1)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(VgD.RideUpCondition) e2:SetCondition(VgD.RideUpCondition)
e2:SetOperation(VgD.RideUpOperation) e2:SetOperation(VgD.RideUpOperation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -146,15 +148,21 @@ end ...@@ -146,15 +148,21 @@ end
function VgD.CallCondition(e,c) function VgD.CallCondition(e,c)
if c==nil then return true end if c==nil then return true end
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) and Duel.GetMatchingGroupCount(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEDOWN_ATTACK)<5
end end
function VgD.CallFilter(c,tp,zone) function VgD.CallFilter(c,tp,zone)
return VgF.RMonsterFilter(c) and zone==VgF.SequenceToGlobal(tp,c:GetLocation(),c:GetSequence()) return VgF.RMonsterFilter(c) and zone==VgF.SequenceToGlobal(tp,c:GetLocation(),c:GetSequence())
end end
function VgD.CallOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.CallOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local z=0xe0
local rg=Duel.GetMatchingGroup(Card.IsPosition,sp,LOCATION_MZONE,0,nil,POS_FACEDOWN_ATTACK)
for tc in VgF.Next(rg) do
local szone=VgF.SequenceToGlobal(sp,tc:GetLocation(),tc:GetSequence())
z=bit.bor(z,szone)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CallZONE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CallZONE)
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,0,0xe0) local zone=Duel.SelectField(tp,1,LOCATION_MZONE,0,z)
if Duel.IsExistingMatchingCard(VgD.CallFilter,tp,LOCATION_MZONE,0,1,nil,tp,zone) then if Duel.IsExistingMatchingCard(VgD.CallFilter,tp,LOCATION_MZONE,0,1,nil,tp,zone) then
local tc=Duel.GetMatchingGroup(VgD.CallFilter,tp,LOCATION_MZONE,0,nil,tp,zone):GetFirst() local tc=Duel.GetMatchingGroup(VgD.CallFilter,tp,LOCATION_MZONE,0,nil,tp,zone):GetFirst()
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
...@@ -198,7 +206,7 @@ function VgD.OverDressFilter(c,f,zone) ...@@ -198,7 +206,7 @@ function VgD.OverDressFilter(c,f,zone)
if zone==0x10 then seq=4 end if zone==0x10 then seq=4 end
if not VgF.IsSequence(c,seq) then return false end if not VgF.IsSequence(c,seq) then return false end
end end
return (VgF.GetValueType(f)=="function" and f(c)) or (VgF.GetValueType(f)=="number" and c:IsCode(f)) return (VgF.GetValueType(f)=="function" and f(c)) or (VgF.GetValueType(f)=="number" and c:IsCode(f)) and c:IsFaceup()
end end
function VgD.OverDressOperation(f) function VgD.OverDressOperation(f)
return function(e,tp,eg,ep,ev,re,r,rp) return function(e,tp,eg,ep,ev,re,r,rp)
...@@ -256,9 +264,10 @@ function VgD.MonsterBattle(c) ...@@ -256,9 +264,10 @@ function VgD.MonsterBattle(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PREDRAW) e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_ONFIELD) e2:SetRange(LOCATION_ALL)
e2:SetCountLimit(1,VgID+4)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(VgD.MonsterPosAttackCondition) e2:SetCondition(VgF.RuleCardCondtion)
e2:SetOperation(VgD.MonsterPosAttackOperation) e2:SetOperation(VgD.MonsterPosAttackOperation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--扣血 --扣血
...@@ -300,9 +309,10 @@ function VgD.MonsterBattle(c) ...@@ -300,9 +309,10 @@ function VgD.MonsterBattle(c)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e9=Effect.CreateEffect(c) local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE) e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_UPDATE_ATTACK) e9:SetCode(EFFECT_UPDATE_ATTACK)
e9:SetRange(LOCATION_MZONE) e9:SetRange(LOCATION_MZONE)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e9:SetValue(VgD.SupportValue) e9:SetValue(VgD.SupportValue)
c:RegisterEffect(e9) c:RegisterEffect(e9)
--防御 --防御
...@@ -310,16 +320,17 @@ function VgD.MonsterBattle(c) ...@@ -310,16 +320,17 @@ function VgD.MonsterBattle(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_BATTLE_START) e7:SetCode(EVENT_BATTLE_START)
e7:SetRange(LOCATION_HAND+LOCATION_MZONE) e7:SetRange(LOCATION_HAND+LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCountLimit(1)
e7:SetCost(VgD.SendToGCost) e7:SetCost(VgD.SendToGCost)
e7:SetCondition(VgD.SendToGCondition) e7:SetCondition(VgD.SendToGCondition)
e7:SetOperation(VgD.SendToGOperation) e7:SetOperation(VgD.SendToGOperation)
c:RegisterEffect(e7) c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c) local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CANNOT_DISABLE) e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetCode(EVENT_DAMAGE_STEP_END) e8:SetCode(EVENT_DAMAGE_STEP_END)
e8:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CANNOT_DISABLE)
e8:SetRange(LOCATION_GZONE) e8:SetRange(LOCATION_GZONE)
e8:SetOperation(VgD.GToGraveOperation) e8:SetOperation(VgD.GToGraveOperation)
c:RegisterEffect(e8) c:RegisterEffect(e8)
...@@ -327,8 +338,8 @@ function VgD.MonsterBattle(c) ...@@ -327,8 +338,8 @@ function VgD.MonsterBattle(c)
local e10=Effect.CreateEffect(c) local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE) e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_DEFENSE_ATTACK) e10:SetCode(EFFECT_DEFENSE_ATTACK)
e10:SetValue(1)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e10:SetValue(1)
c:RegisterEffect(e10) c:RegisterEffect(e10)
local e11=Effect.CreateEffect(c) local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE) e11:SetType(EFFECT_TYPE_SINGLE)
...@@ -364,8 +375,9 @@ function VgD.MonsterBattle(c) ...@@ -364,8 +375,9 @@ function VgD.MonsterBattle(c)
local e16=e15:Clone() local e16=e15:Clone()
e16:SetType(EFFECT_TYPE_SINGLE) e16:SetType(EFFECT_TYPE_SINGLE)
e16:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e16:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e16:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e16:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e16:SetRange(LOCATION_MZONE) e16:SetRange(LOCATION_MZONE)
e16:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e16:SetCondition(VgD.MonsterCannotBeAttackedCondition) e16:SetCondition(VgD.MonsterCannotBeAttackedCondition)
e16:SetValue(VgF.True) e16:SetValue(VgF.True)
c:RegisterEffect(e16) c:RegisterEffect(e16)
...@@ -386,13 +398,9 @@ function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -386,13 +398,9 @@ function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
end end
c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD+EVENT_PRE_BATTLE_DAMAGE,0,1,label) c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD+EVENT_PRE_BATTLE_DAMAGE,0,1,label)
end end
function VgD.MonsterPosAttackCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()==tp and c:IsPosition(POS_DEFENSE) and (VgF.RMonsterFilter(c) or VgF.VMonsterFilter(c))
end
function VgD.MonsterPosAttackOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.MonsterPosAttackOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local g=duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE)
Duel.ChangePosition(c,POS_FACEUP_ATTACK) Duel.ChangePosition(g,POS_FACEUP_ATTACK)
Duel.Hint(HINT_LINES,tp,VgF.Stringid(VgID,8)) Duel.Hint(HINT_LINES,tp,VgF.Stringid(VgID,8))
end end
function VgD.MonsterBattleDamageCondition(e,tp,eg,ep,ev,re,r,rp) function VgD.MonsterBattleDamageCondition(e,tp,eg,ep,ev,re,r,rp)
...@@ -420,7 +428,8 @@ end ...@@ -420,7 +428,8 @@ end
function VgD.SupportOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.SupportOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.ChangePosition(c,POS_FACEUP_DEFENSE) Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
c:RegisterFlagEffect(SupportFlag,RESET_EVENT+EVENT_BATTLED,0,1) c:RegisterFlagEffect(SupportFlag,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.RaiseEvent(c,EVENT_CUSTOM+EVENT_SUPPORT,e,0,tp,tp,0)
end end
function VgD.SupportValue(e) function VgD.SupportValue(e)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
...@@ -527,7 +536,7 @@ end ...@@ -527,7 +536,7 @@ end
function VgD.CardTrigger(c,f) function VgD.CardTrigger(c,f)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_CANNOT_DISABLE)
e1:SetCode(EVENT_MOVE) e1:SetCode(EVENT_MOVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(VgD.CardTriggerCondtion(0)) e1:SetCondition(VgD.CardTriggerCondtion(0))
...@@ -639,6 +648,7 @@ function VgD.Rule(c) ...@@ -639,6 +648,7 @@ function VgD.Rule(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_DRAW) e1:SetCode(EVENT_PHASE+PHASE_DRAW)
e1:SetRange(LOCATION_ALL) e1:SetRange(LOCATION_ALL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1,VgID+2) e1:SetCountLimit(1,VgID+2)
e1:SetCondition(VgD.RuelDrawCondition) e1:SetCondition(VgD.RuelDrawCondition)
e1:SetOperation(VgD.RuelDrawOperation) e1:SetOperation(VgD.RuelDrawOperation)
...@@ -646,12 +656,14 @@ function VgD.Rule(c) ...@@ -646,12 +656,14 @@ function VgD.Rule(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLED) e2:SetCode(EVENT_BATTLED)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetOperation(VgD.ResetOperation) e2:SetOperation(VgD.ResetOperation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE_START+PHASE_STANDBY) e3:SetCode(EVENT_PHASE_START+PHASE_STANDBY)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_ALL) e3:SetRange(LOCATION_ALL)
e3:SetCountLimit(1,VgID+3) e3:SetCountLimit(1,VgID+3)
e3:SetCondition(VgF.RuleCardCondtion) e3:SetCondition(VgF.RuleCardCondtion)
...@@ -661,6 +673,7 @@ function VgD.Rule(c) ...@@ -661,6 +673,7 @@ function VgD.Rule(c)
e10:SetType(EFFECT_TYPE_FIELD) e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_HAND_LIMIT) e10:SetCode(EFFECT_HAND_LIMIT)
e10:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e10:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e10:SetRange(LOCATION_ALL) e10:SetRange(LOCATION_ALL)
e10:SetTargetRange(1,0) e10:SetTargetRange(1,0)
e10:SetValue(100) e10:SetValue(100)
...@@ -670,6 +683,7 @@ function VgD.Rule(c) ...@@ -670,6 +683,7 @@ function VgD.Rule(c)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e11:SetCode(EVENT_ADJUST) e11:SetCode(EVENT_ADJUST)
e11:SetRange(LOCATION_ALL) e11:SetRange(LOCATION_ALL)
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e11:SetCondition(VgF.RuleCardCondtion) e11:SetCondition(VgF.RuleCardCondtion)
e11:SetOperation(VgD.RuleWin) e11:SetOperation(VgD.RuleWin)
c:RegisterEffect(e11) c:RegisterEffect(e11)
...@@ -678,6 +692,7 @@ function VgD.Rule(c) ...@@ -678,6 +692,7 @@ function VgD.Rule(c)
e12:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e12:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e12:SetCode(EFFECT_SKIP_M2) e12:SetCode(EFFECT_SKIP_M2)
e12:SetRange(LOCATION_ALL) e12:SetRange(LOCATION_ALL)
e12:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e12:SetTargetRange(1,0) e12:SetTargetRange(1,0)
c:RegisterEffect(e12) c:RegisterEffect(e12)
local e13=e12:Clone() local e13=e12:Clone()
...@@ -693,6 +708,7 @@ function VgD.Rule(c) ...@@ -693,6 +708,7 @@ function VgD.Rule(c)
e16:SetType(EFFECT_TYPE_FIELD) e16:SetType(EFFECT_TYPE_FIELD)
e16:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e16:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e16:SetRange(LOCATION_ALL) e16:SetRange(LOCATION_ALL)
e16:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e16:SetCondition(VgF.RuleCardCondtion) e16:SetCondition(VgF.RuleCardCondtion)
e16:SetTargetRange(LOCATION_HAND,0) e16:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e16) c:RegisterEffect(e16)
...@@ -746,12 +762,7 @@ end ...@@ -746,12 +762,7 @@ end
---@param m integer 指示脚本的整数。cxxx的脚本应填入xxx。cm的脚本应填入m。 ---@param m integer 指示脚本的整数。cxxx的脚本应填入xxx。cm的脚本应填入m。
---@param op function|nil 作为指令卡的效果 ---@param op function|nil 作为指令卡的效果
---@param con function|nil 作为指令卡的发动条件 ---@param con function|nil 作为指令卡的发动条件
---@param specialchk any|nil 未知。请资讯群主。 ---@param cost any|nil 作为指令卡的发动费用
---@param num1 any|nil 未知。请资讯群主。
---@param num2 any|nil 未知。请资讯群主。
---@param num3 any|nil 未知。请资讯群主。
---@param num4 any|nil 未知。请资讯群主。
---@param num5 any|nil 未知。请资讯群主。
function VgD.SpellActivate(c,m,op,con,cost) function VgD.SpellActivate(c,m,op,con,cost)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
if m then e1:SetDescription(VgF.Stringid(m, 0)) end if m then e1:SetDescription(VgF.Stringid(m, 0)) end
...@@ -892,7 +903,6 @@ function VgD.EffectTypeTrigger(c,m,loc,typ,code,op,cost,con,tg,count,property,st ...@@ -892,7 +903,6 @@ function VgD.EffectTypeTrigger(c,m,loc,typ,code,op,cost,con,tg,count,property,st
e1:SetDescription(VgF.Stringid(m,stringid)) e1:SetDescription(VgF.Stringid(m,stringid))
e1:SetType(typ+type2) e1:SetType(typ+type2)
if code~=EVENT_SPSUMMON_SUCCESS then e1:SetRange(loc) end if code~=EVENT_SPSUMMON_SUCCESS then e1:SetRange(loc) end
if code==EVENT_SPSUMMON_SUCCESS and bit.band(typ,EFFECT_TYPE_FIELD)~=0 then e1:SetRange(loc) end
e1:SetCode(code) e1:SetCode(code)
e1:SetProperty(property+EFFECT_FLAG_DELAY) e1:SetProperty(property+EFFECT_FLAG_DELAY)
if count and count>0 then e1:SetCountLimit(count) end if count and count>0 then e1:SetCountLimit(count) end
...@@ -928,9 +938,21 @@ function VgD.EffectTypeIgnition(c,m,loc,op,cost,con,tg,count,property,stringid) ...@@ -928,9 +938,21 @@ function VgD.EffectTypeIgnition(c,m,loc,op,cost,con,tg,count,property,stringid)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function VgD.EffectTypeTriggerWhenHitting(c,m,loc,typ,op,cost,con,tg,count,property,stringid) function VgD.EffectTypeTriggerWhenHitting(c,m,loc,typ,op,cost,con,tg,count,property,stringid)
VgD.EffectTypeTrigger(c,m,loc,typ,EVENT_CUSTOM+EVENT_DAMAGE_TRIGGER,op,cost,con,tg,count,property,stringid) if not typ or typ==0 then typ=EFFECT_TYPE_SINGLE end
VgD.EffectTypeTrigger(c,m,loc,EFFECT_TYPE_FIELD,EVENT_CUSTOM+EVENT_DAMAGE_TRIGGER,op,cost,VgD.EffectTypeTriggerWhenHittingCon(typ,con),tg,count,property,stringid)
VgD.EffectTypeTrigger(c,m,loc,typ,EVENT_BATTLE_DESTROYING,op,cost,con,tg,count,property,stringid) VgD.EffectTypeTrigger(c,m,loc,typ,EVENT_BATTLE_DESTROYING,op,cost,con,tg,count,property,stringid)
end end
function VgD.EffectTypeTriggerWhenHittingCon(typ,con)
return function (e,tp,eg,ep,ev,re,r,rp)
if typ==EFFECT_TYPE_SINGLE then
if VgF.GetValueType(con)~="function" or con(e,tp,eg,ep,ev,re,r,rp) then
return Duel.GetAttacker()==e:GetHandler()
end
return false
end
return VgF.GetValueType(con)~="function" or con(e,tp,eg,ep,ev,re,r,rp)
end
end
function VgD.QuickSpell(c,code,op,cost,con,tg) function VgD.QuickSpell(c,code,op,cost,con,tg)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
......
...@@ -668,40 +668,19 @@ EVENT_PHASE_START =0x2000 --阶段开始时 ...@@ -668,40 +668,19 @@ EVENT_PHASE_START =0x2000 --阶段开始时
EVENT_ADD_COUNTER =0x10000 --增加指示物时 EVENT_ADD_COUNTER =0x10000 --增加指示物时
EVENT_REMOVE_COUNTER =0x20000 --去除指示物时(A指示物),Card.RemoveCounter()必須手動觸發此事件 EVENT_REMOVE_COUNTER =0x20000 --去除指示物时(A指示物),Card.RemoveCounter()必須手動觸發此事件
EVENT_CUSTOM =0x10000000 --自訂事件 EVENT_CUSTOM =0x10000000 --自訂事件
--自定时点
EVENT_TRIGGER =VgID --判定时点
EVENT_CRITICAL_STRIKE =VgID+1 --暴击值结算时点
EVENT_DAMAGE_TRIGGER =VgID+2 --受伤判定完毕时点
EVENT_RIDE_START =VgID+3 --骑升时点
EVENT_SUPPORT =VgID+4 --支援时点
--攻击时(EVENT_ATTACK_ANNOUNCE)
--支援时(EVENT_CUSTOM+EVENT_SUPPORT)
--截击|放置到G(EVENT_MOVE)
--攻击击中时(EVENT_CUSTOM+EVENT_DAMAGE|EVENT_BATTLE_DESTROYING)
--战斗结束时(EVENT_BATTLED)
--Category 效果分类(表示这个效果将要发生什么事,OperationInfo设置了效果分类才能触发针对这一类型发动的卡,如破坏->星尘龙
CATEGORY_DESTROY =0x1 --破坏效果
CATEGORY_RELEASE =0x2 --解放效果
CATEGORY_REMOVE =0x4 --除外效果
CATEGORY_TOHAND =0x8 --回手牌效果
CATEGORY_TODECK =0x10 --回卡组效果
CATEGORY_TOGRAVE =0x20 --送去墓地效果
CATEGORY_DECKDES =0x40 --包含從卡组送去墓地或特殊召唤效果
CATEGORY_HANDES =0x80 --捨棄手牌效果
CATEGORY_SUMMON =0x100 --含召唤的效果
CATEGORY_SPECIAL_SUMMON =0x200 --含特殊召唤的效果
CATEGORY_TOKEN =0x400 --含衍生物效果
CATEGORY_GRAVE_ACTION =0x800 --包含特殊召喚以外移動墓地的卡的效果(屋敷わらし)
CATEGORY_POSITION =0x1000 --改变表示形式效果
CATEGORY_CONTROL =0x2000 --改变控制权效果
CATEGORY_DISABLE =0x4000 --使效果无效效果
CATEGORY_DISABLE_SUMMON =0x8000 --无效召唤效果
CATEGORY_DRAW =0x10000 --抽卡效果
CATEGORY_SEARCH =0x20000 --检索卡组效果
CATEGORY_EQUIP =0x40000 --装备效果
CATEGORY_DAMAGE =0x80000 --伤害效果
CATEGORY_RECOVER =0x100000 --回复效果
CATEGORY_ATKCHANGE =0x200000 --改变攻击效果
CATEGORY_DEFCHANGE =0x400000 --改变防御效果
CATEGORY_COUNTER =0x800000 --指示物效果
CATEGORY_COIN =0x1000000 --硬币效果
CATEGORY_DICE =0x2000000 --骰子效果
CATEGORY_LEAVE_GRAVE =0x4000000 --涉及墓地的效果(王家長眠之谷)
CATEGORY_GRAVE_SPSUMMON =0x8000000 --包含從墓地特殊召喚的效果(屋敷わらし、冥神)
CATEGORY_NEGATE =0x10000000 --使发动无效效果
CATEGORY_ANNOUNCE =0x20000000 --發動時宣言卡名的效果
CATEGORY_FUSION_SUMMON =0x40000000 --融合召唤效果(暴走魔法阵)
CATEGORY_TOEXTRA =0x80000000 --回额外卡组效果
--Hint --Hint
HINT_EVENT =1 HINT_EVENT =1
HINT_MESSAGE =2 HINT_MESSAGE =2
...@@ -889,11 +868,7 @@ AFFECT_CODE_MIX =VgID --魔合成 ...@@ -889,11 +868,7 @@ AFFECT_CODE_MIX =VgID --魔合成
AFFECT_CODE_MIX_DIFFERENT_NAME =VgID+1 --魔合成(卡名不同) AFFECT_CODE_MIX_DIFFERENT_NAME =VgID+1 --魔合成(卡名不同)
AFFECT_CODE_SENDTOG =VgID+2 --需要两张卡才能防御 AFFECT_CODE_SENDTOG =VgID+2 --需要两张卡才能防御
AFFECT_CODE_SENDTOG_MZONE =VgID+3 --不能截击 AFFECT_CODE_SENDTOG_MZONE =VgID+3 --不能截击
--自定时点
EVENT_TRIGGER =VgID --判定时点
EVENT_CRITICAL_STRIKE =VgID+1 --暴击值结算时点
EVENT_DAMAGE_TRIGGER =VgID+2 --受伤判定完毕时点
EVENT_RIDE_START =VgID+3 --骑升时点
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE
\ No newline at end of file
...@@ -299,10 +299,15 @@ function VgF.Call(g,sumtype,sp,zone) ...@@ -299,10 +299,15 @@ function VgF.Call(g,sumtype,sp,zone)
end end
local sg local sg
local z=0xe0 local z=0xe0
local rg=Duel.GetMatchingGroup(Card.IsPosition,sp,LOCATION_MZONE,0,nil,POS_FACEDOWN_ATTACK)
for tc in VgF.Next(rg) do
local szone=VgF.SequenceToGlobal(sp,tc:GetLocation(),tc:GetSequence())
z=bit.bor(z,szone)
end
if VgF.GetValueType(g)=="Card" then sg=Group.FromCards(g) else sg=Group.Clone(g) end if VgF.GetValueType(g)=="Card" then sg=Group.FromCards(g) else sg=Group.Clone(g) end
for sc in VgF.Next(sg) do for sc in VgF.Next(sg) do
if sc:IsLocation(LOCATION_EXTRA) then if sc:IsLocation(LOCATION_EXTRA) then
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst() local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,sp,LOCATION_MZONE,0,nil):GetFirst()
local mg=rc:GetOverlayGroup() local mg=rc:GetOverlayGroup()
if mg:GetCount()~=0 then if mg:GetCount()~=0 then
Duel.Overlay(sc,mg) Duel.Overlay(sc,mg)
......
...@@ -29,6 +29,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,6 +29,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,vgf.IsLevel,tp,LOCATION_HAND,0,3,3,nil,3) local g=Duel.SelectMatchingCard(tp,vgf.IsLevel,tp,LOCATION_HAND,0,3,3,nil,3)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,c)
local tp=e:GetHandlerPlayer()
return vgf.RMonsterCondition(e) and Duel.IsExistingMatchingCard(vgf.IsLevel,tp,LOCATION_MZONE,0,3,nil,3) return vgf.RMonsterCondition(e) and Duel.IsExistingMatchingCard(vgf.IsLevel,tp,LOCATION_MZONE,0,3,nil,3)
end 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