Commit 23ad0940 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent f29ed288
...@@ -42,7 +42,7 @@ function VgD.RideUpCondition(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function VgD.RideUpCondition(e,tp,eg,ep,ev,re,r,rp)
local rg2=Duel.GetMatchingGroup(VgD.RideUpFilter2,tp,LOCATION_HAND,0,nil,lv,code,rc) local rg2=Duel.GetMatchingGroup(VgD.RideUpFilter2,tp,LOCATION_HAND,0,nil,lv,code,rc)
local a=rg1:GetCount()>0 local a=rg1:GetCount()>0
local b=rg2:GetCount()>0 local b=rg2:GetCount()>0
return Duel.GetTurnPlayer()==tp and VgD.RuleCardCondtion(e) and (a or b) return Duel.GetTurnPlayer()==tp and VgF.RuleCardCondtion(e) and (a or b)
end end
function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -69,7 +69,6 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +69,6 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
if sel==0 and a then if sel==0 and a then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,VgD.DisCardRideUpFilter,tp,LOCATION_HAND,0,1,1,nil,lv,code,rc) local g=Duel.SelectMatchingCard(tp,VgD.DisCardRideUpFilter,tp,LOCATION_HAND,0,1,1,nil,lv,code,rc)
--Duel.Sendto(g,REASON_TRIGGER,LOCATION_DAMAGE,POS_FACEUP)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=rg1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_HAND+LOCATION_RIDE) local sg=rg1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_HAND+LOCATION_RIDE)
...@@ -103,20 +102,16 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,20 +102,16 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function VgD.RideZeroFilter(c,tp) function VgD.RideZeroFilter(c,tp)
local loc=LOCATION_RIDE return c:IsLevel(1)
if Duel.GetMatchingGroupCount(nil,tp,LOCATION_RIDE,0,nil)<=0 then
loc=LOCATION_DECK
end
return c:IsLevel(1) and c:IsLocation(loc)
end end
function VgD.RideZeroCondition(e,tp,eg,ep,ev,re,r,rp) function VgD.RideZeroCondition(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst() local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
if rc then return false end if rc then return false end
local ct=Duel.GetMatchingGroupCount(VgD.RideZeroFilter,tp,LOCATION_RIDE+LOCATION_DECK,0,nil,tp) local ct=Duel.GetMatchingGroupCount(Card.IsLevel,tp,LOCATION_RIDE,0,nil,1)
return Duel.GetTurnCount(tp)+Duel.GetTurnCount(1-tp)==1 and ct>0 and VgD.RuleCardCondtion(e) return VgF.RuleTurnCondtion(e) and ct>0 and VgF.RuleCardCondtion(e)
end end
function VgD.RideZeroOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.RideZeroOperation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(VgD.RideZeroFilter,tp,LOCATION_RIDE+LOCATION_DECK,0,nil,tp) local g=Duel.GetMatchingGroup(Card.IsLevel,tp,LOCATION_RIDE,0,nil,1)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
g=g:Select(tp,1,1,nil) g=g:Select(tp,1,1,nil)
...@@ -209,12 +204,20 @@ function VgD.MonsterBattle(c) ...@@ -209,12 +204,20 @@ function VgD.MonsterBattle(c)
--支援 --支援
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e6:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e6:SetCondition(VgD.SupportCondition) e6:SetCondition(VgD.SupportCondition)
e6:SetOperation(VgD.SupportOperation) e6:SetOperation(VgD.SupportOperation)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--防御
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_ATTACK_ANNOUNCE)
e7:SetRange(LOCATION_HAND+LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetCondition(VgD.SendToGCondition)
e7:SetOperation(VgD.SendToGOperation)
c:RegisterEffect(e7)
--其他永续 --其他永续
local e10=Effect.CreateEffect(c) local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE) e10:SetType(EFFECT_TYPE_SINGLE)
...@@ -245,25 +248,21 @@ function VgD.MonsterBattle(c) ...@@ -245,25 +248,21 @@ function VgD.MonsterBattle(c)
c:RegisterEffect(e14) c:RegisterEffect(e14)
local e15=Effect.CreateEffect(c) local e15=Effect.CreateEffect(c)
e15:SetType(EFFECT_TYPE_SINGLE) e15:SetType(EFFECT_TYPE_SINGLE)
e15:SetCode(EFFECT_SET_DEFENSE_FINAL) e15:SetCode(EFFECT_EXTRA_ATTACK)
e15:SetValue(VgD.MonsterDefVal) e15:SetValue(100)
c:RegisterEffect(e15) c:RegisterEffect(e15)
local e16=e15:Clone() local e16=e15:Clone()
e16:SetCode(EFFECT_EXTRA_ATTACK) e16:SetType(EFFECT_TYPE_SINGLE)
e16:SetValue(100) e16:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e16:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e16:SetCondition(VgD.MonsterCannotBeAttackedCondition)
e16:SetValue(VgF.True)
c:RegisterEffect(e16) c:RegisterEffect(e16)
local e17=e15:Clone()
e17:SetType(EFFECT_TYPE_SINGLE)
e17:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e17:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e17:SetCondition(VgD.MonsterCannotBeAttackedCondition)
e17:SetValue(VgF.True)
c:RegisterEffect(e17)
end end
function VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp) function VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetDecktopGroup(tp,1) local tg=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.Sendto(tg:GetFirst(),REASON_TRIGGER,LOCATION_TRIGGER,POS_FACEUP) Duel.MoveToField(tg:GetFirst(),tp,tp,LOCATION_TRIGGER,POS_FACEUP,true)
end end
function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -318,6 +317,35 @@ function VgD.SupportOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -318,6 +317,35 @@ function VgD.SupportOperation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(c:GetAttack()) e1:SetValue(c:GetAttack())
Duel.GetAttacker():RegisterEffect(e1) Duel.GetAttacker():RegisterEffect(e1)
end end
function VgD.SendToGCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsPublic() and (not Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SendtoG) or Duel.IsExistingMatchingCard(VgF.Not(Card.IsPublic),tp,LOCATION_HAND,0,1,c)) end
local g=Group.FromCards(c)
if Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SendtoG) then
local sg=Duel.SelectMatchingCard(tp,VgF.Not(Card.IsPublic),tp,LOCATION_HAND,0,1,1,c)
g:Merge(sg)
end
for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+EVENT_CHAIN_SOLVED)
tc:RegisterEffect(e1)
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)
end
function VgD.SendToGOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttackTarget()
if not bc or not VgF.IsAbleToGZone(c) or not c:IsRelateToEffect(e) then return false end
Duel.Sendto(c,tp,LOCATION_GZONE,POS_FACEUP,REASON_EFFECT)
local atk=c:GetAttack()
VgF.AtkUp(c,bc,atk,nil)
end
function VgD.MonsterAttackAnnounceCondition(e,c) function VgD.MonsterAttackAnnounceCondition(e,c)
return e:GetHandler():IsPosition(POS_DEFENSE) or VgF.IsSequence(e:GetHandler(),1,2,3) return e:GetHandler():IsPosition(POS_DEFENSE) or VgF.IsSequence(e:GetHandler(),1,2,3)
end end
...@@ -331,9 +359,6 @@ function VgD.MonsterAttackCost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -331,9 +359,6 @@ function VgD.MonsterAttackCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c:GetFlagEffect(CountTriggerFlag)==0 end if chk==0 then return c:GetFlagEffect(CountTriggerFlag)==0 end
c:RegisterFlagEffect(CountTriggerFlag,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1) c:RegisterFlagEffect(CountTriggerFlag,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end end
function VgD.MonsterDefVal(e,c)
return e:GetHandler():GetAttack()
end
function VgD.MonsterCannotBeAttackedCondition(e,c) function VgD.MonsterCannotBeAttackedCondition(e,c)
return VgF.IsSequence(e:GetHandler(),1,2,3) return VgF.IsSequence(e:GetHandler(),1,2,3)
end end
...@@ -368,17 +393,17 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -368,17 +393,17 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CRITICAL_STRIKE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CRITICAL_STRIKE)
local g1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g1) Duel.HintSelection(g1)
VgF.StarUp(c,g1,1) VgF.StarUp(c,g1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g2) Duel.HintSelection(g2)
VgF.AtkUp(c,g2,10000) VgF.AtkUp(c,g2,10000,nil)
elseif c:IsRace(TRRIGGER_DRAW) then elseif c:IsRace(TRRIGGER_DRAW) then
Duel.Draw(tp,1,REASON_TRIGGER) Duel.Draw(tp,1,REASON_TRIGGER)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
VgF.AtkUp(c,g,10000) VgF.AtkUp(c,g,10000,nil)
elseif c:IsRace(TRRIGGER_HEAL) then elseif c:IsRace(TRRIGGER_HEAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODROP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODROP)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DAMAGE,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DAMAGE,0,1,1,nil):GetFirst()
...@@ -388,11 +413,11 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -388,11 +413,11 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
VgF.AtkUp(c,g,10000) VgF.AtkUp(c,g,10000,nil)
elseif c:IsRace(TRRIGGER_ADVANCE) then elseif c:IsRace(TRRIGGER_ADVANCE) then
local g=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,0,4,5) local g=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,0,4,5)
for tc in VgF.Next(g) do for tc in VgF.Next(g) do
VgF.AtkUp(c,tc,10000) VgF.AtkUp(c,tc,10000,nil)
end end
end end
if chkop==0 then if chkop==0 then
...@@ -402,9 +427,9 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -402,9 +427,9 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
VgF.AtkUp(c,g,100000000) VgF.AtkUp(c,g,100000000,nil)
else else
Duel.Sendto(c,REASON_TRIGGER,LOCATION_DAMAGE,POS_FACEUP) Duel.Sendto(c,tp,LOCATION_DAMAGE,POS_FACEUP,REASON_EFFECT)
Duel.Damage(tp,1,REASON_TRIGGER) Duel.Damage(tp,1,REASON_TRIGGER)
end end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst() local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
...@@ -425,7 +450,7 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -425,7 +450,7 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
VgF.AtkUp(c,g,100000000) VgF.AtkUp(c,g,100000000,nil)
if f then f(e,tp,eg,ep,ev,re,r,rp) end if f then f(e,tp,eg,ep,ev,re,r,rp) end
Duel.Exile(c,REASON_TRIGGER) Duel.Exile(c,REASON_TRIGGER)
else else
...@@ -450,18 +475,10 @@ end ...@@ -450,18 +475,10 @@ end
--vg规则 --vg规则
function VgD.Rule(c) function VgD.Rule(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_DRAW)
e1:SetCode(EVENT_PHASE_START+PHASE_STANDBY) e1:SetCondition(VgD.RuelDrawCondition)
e1:SetRange(LOCATION_ALL) e1:SetOperation(VgD.RuelDrawOperation)
e1:SetCountLimit(1)
e1:SetCondition(VgD.RuelGCondition)
e1:SetOperation(VgD.RuleGOperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_PHASE+PHASE_DRAW)
e2:SetCondition(VgD.RuelDrawCondition)
e2:SetOperation(VgD.RuelDrawOperation)
c:RegisterEffect(e2)
local e10=Effect.CreateEffect(c) local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD) e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_HAND_LIMIT) e10:SetCode(EFFECT_HAND_LIMIT)
...@@ -469,13 +486,13 @@ function VgD.Rule(c) ...@@ -469,13 +486,13 @@ function VgD.Rule(c)
e10:SetRange(LOCATION_ALL) e10:SetRange(LOCATION_ALL)
e10:SetTargetRange(1,0) e10:SetTargetRange(1,0)
e10:SetValue(100) e10:SetValue(100)
e10:SetCondition(VgD.RuleCardCondtion) e10:SetCondition(VgF.RuleCardCondtion)
c:RegisterEffect(e10) c:RegisterEffect(e10)
local e11=Effect.CreateEffect(c) local e11=Effect.CreateEffect(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:SetCondition(VgD.RuleCardCondtion) e11:SetCondition(VgF.RuleCardCondtion)
e11:SetOperation(VgD.RuleWin) e11:SetOperation(VgD.RuleWin)
c:RegisterEffect(e11) c:RegisterEffect(e11)
local e12=Effect.CreateEffect(c) local e12=Effect.CreateEffect(c)
...@@ -484,7 +501,6 @@ function VgD.Rule(c) ...@@ -484,7 +501,6 @@ function VgD.Rule(c)
e12:SetCode(EFFECT_SKIP_M2) e12:SetCode(EFFECT_SKIP_M2)
e12:SetRange(LOCATION_ALL) e12:SetRange(LOCATION_ALL)
e12:SetTargetRange(1,0) e12:SetTargetRange(1,0)
e12:SetCondition(VgD.RuleCardCondtion)
c:RegisterEffect(e12) c:RegisterEffect(e12)
local e13=e12:Clone() local e13=e12:Clone()
e13:SetCode(EFFECT_CANNOT_SUMMON) e13:SetCode(EFFECT_CANNOT_SUMMON)
...@@ -496,17 +512,6 @@ function VgD.Rule(c) ...@@ -496,17 +512,6 @@ function VgD.Rule(c)
e15:SetCode(EFFECT_CANNOT_SSET) e15:SetCode(EFFECT_CANNOT_SSET)
c:RegisterEffect(e15) c:RegisterEffect(e15)
end end
function VgD.RuleCardCondtion(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ALL,0,nil)
return e:GetHandler()==g:GetFirst()
end
function VgD.RuleTurnCondtion(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetTurnCount(tp)
local b=Duel.GetTurnCount(1-tp)
return a+b==1
end
function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp) function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()>0 then return end if Duel.GetCurrentChain()>0 then return end
for WinReason=0x1, 0xff, 1 do for WinReason=0x1, 0xff, 1 do
...@@ -523,40 +528,8 @@ function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp) ...@@ -523,40 +528,8 @@ function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function VgD.RuelGFilter(c,lv)
return c:IsLevel(lv) and c:IsType(TYPE_MONSTER)
end
function VgD.RuelGCondition(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
if not rc then return false end
local lv=rc:GetLevel()+1
local ct1=Duel.GetMatchingGroupCount(VgD.RuelGFilter,tp,LOCATION_HAND,0,nil,lv)
local ct2=Duel.GetMatchingGroupCount(nil,tp,LOCATION_RIDE,0,nil)
return Duel.GetTurnPlayer()==tp and rc:IsLevelBelow(2) and ct1==0 and ct2==0 and VgD.RuleCardCondtion(e)
end
function VgD.RuleGOperation(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,VgF.Stringid(VgID,1)) then
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
if Duel.SelectOption(1-tp,VgF.Stringid(VgID,2)) then
local tg=Duel.GetDecktopGroup(tp,5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=tg:Select(tp,0,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_PHASEG)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Select(tp,2,2,nil)
Duel.Exile(rg,REASON_PHASEG)
end
Duel.ShuffleDeck(tp)
end
end
end
end
function VgD.RuelDrawCondition(e,tp,eg,ep,ev,re,r,rp) function VgD.RuelDrawCondition(e,tp,eg,ep,ev,re,r,rp)
return VgD.RuleTurnCondtion(e) and VgD.RuleCardCondtion(e) return VgF.RuleTurnCondtion(e) and VgF.RuleCardCondtion(e)
end end
function VgD.RuelDrawOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.RuelDrawOperation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
......
...@@ -20,6 +20,7 @@ LOCATION_DAMAGE =0x800 --伤害区 ...@@ -20,6 +20,7 @@ LOCATION_DAMAGE =0x800 --伤害区
LOCATION_ORDER =0x1000 --指令区 LOCATION_ORDER =0x1000 --指令区
LOCATION_SPARE =0x2000 --备用格子(用于怪物箱等) LOCATION_SPARE =0x2000 --备用格子(用于怪物箱等)
LOCATION_GZONE =0x4000 --G区域 LOCATION_GZONE =0x4000 --G区域
LOCATION_EMBLEM =0x8000 --纹章区
LOCATION_RIDE =LOCATION_EXTRA LOCATION_RIDE =LOCATION_EXTRA
LOCATION_DROP =LOCATION_GRAVE LOCATION_DROP =LOCATION_GRAVE
LOCATION_LOCK =LOCATION_REMOVED LOCATION_LOCK =LOCATION_REMOVED
...@@ -123,7 +124,6 @@ REASON_LINK =0x10000000 --用于连接召唤 ...@@ -123,7 +124,6 @@ REASON_LINK =0x10000000 --用于连接召唤
REASON_LOST_OVERLAY =0x20000000 --超量素材随着超量怪兽离场 REASON_LOST_OVERLAY =0x20000000 --超量素材随着超量怪兽离场
REASON_MAINTENANCE =0x40000000 --维持代价 REASON_MAINTENANCE =0x40000000 --维持代价
REASON_ACTION =0x80000000 --攻击宣言之际等 REASON_ACTION =0x80000000 --攻击宣言之际等
REASON_PHASEG =REASON_RULE --G辅助
REASON_PHASEDRAW =REASON_RULE --抽卡 REASON_PHASEDRAW =REASON_RULE --抽卡
REASON_TRIGGER =REASON_EFFECT --判定 REASON_TRIGGER =REASON_EFFECT --判定
--Location Reason --Location Reason
...@@ -880,8 +880,13 @@ AttackTriggerFlag =VgID+1 --多次攻击判定标识 ...@@ -880,8 +880,13 @@ AttackTriggerFlag =VgID+1 --多次攻击判定标识
DamageTriggerFlag =VgID+2 --多次伤害判定标识 DamageTriggerFlag =VgID+2 --多次伤害判定标识
--AffectedByEffect --AffectedByEffect
AFFECT_CODE_MIX =VgID --魔合成 AFFECT_CODE_MIX =VgID --魔合成
AFFECT_CODE_SendtoG =VgID+1 --
--Counter --Counter
COUNTER_ENERGE =0x1 --能量爆发 COUNTER_ENERGE =0x1 --能量爆发
--自定时点 --自定时点
EVENT_TRIGGER =VgID --判定时点 EVENT_TRIGGER =VgID --判定时点
EVENT_CRITICAL_STRIKE =VgID+1 --暴击值结算时点 EVENT_CRITICAL_STRIKE =VgID+1 --暴击值结算时点
\ No newline at end of file
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE
\ No newline at end of file
VgF={} VgF={}
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE
function GetID() function GetID()
local offset=self_code<100000000 and 1 or 100 local offset=self_code<100000000 and 1 or 100
...@@ -96,6 +94,20 @@ function VgF.IsSequence(c,...) ...@@ -96,6 +94,20 @@ function VgF.IsSequence(c,...)
end end
return false return false
end end
function VgF.RuleCardCondtion(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ALL,0,nil)
return e:GetHandler()==g:GetFirst()
end
function VgF.RuleTurnCondtion(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetTurnCount(tp)
local b=Duel.GetTurnCount(1-tp)
return a+b==1
end
function VgF.Not(c,f)
return not f(c)
end
function VgF.GetColumnGroup(c) function VgF.GetColumnGroup(c)
local tp=c:GetControler() local tp=c:GetControler()
local g=Group.CreateGroup() local g=Group.CreateGroup()
...@@ -150,18 +162,20 @@ end ...@@ -150,18 +162,20 @@ end
function VgF.LvConditionFilter(c,lv) function VgF.LvConditionFilter(c,lv)
return VgF.VMonsterFilter(c) and c:IsLevelAbove(lv) return VgF.VMonsterFilter(c) and c:IsLevelAbove(lv)
end end
function VgF.AtkUp(c,g,val) function VgF.AtkUp(c,g,val,reset)
if not g then return end if not c or not g then return end
if not reset then reset=RESET_PHASE+PHASE_END end
local tc=VgF.ReturnCard(g) local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val) e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
function VgF.StarUp(c,g,val) function VgF.StarUp(c,g,val,reset)
if not g then return end if not c or not g then return end
if not reset then reset=RESET_PHASE+PHASE_END end
local tc=VgF.ReturnCard(g) local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -169,9 +183,15 @@ function VgF.StarUp(c,g,val) ...@@ -169,9 +183,15 @@ function VgF.StarUp(c,g,val)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetValue(val) e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE) e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end
function VgF.IsAbleToGZone(c)
if c:IsLocation(LOCATION_MZONE) then
return c:IsAttribute(SKILL_BLOCK)
end
return c:IsLocation(LOCATION_HAND)
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