Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
V
Vgdpro Scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
Vgdpro Scripts
Commits
8a3c0238
Commit
8a3c0238
authored
Apr 11, 2024
by
jwyxym
Committed by
GitHub
Apr 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
211f706e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
74 deletions
+11
-74
VgD.Lua
VgD.Lua
+10
-67
VgDefinition.Lua
VgDefinition.Lua
+0
-2
VgFuncLib.lua
VgFuncLib.lua
+1
-5
No files found.
VgD.Lua
View file @
8a3c0238
...
...
@@ -281,14 +281,9 @@ function VgD.MonsterBattle(c)
e6
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e6
:
SetRange
(
LOCATION_MZONE
)
e6
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e6
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
)
e6
:
SetCost
(
VgF
.
OnceChainCount
)
e6
:
SetCondition
(
VgD
.
SupportCondition
)
e6
:
SetOperation
(
VgD
.
SupportOperation
)
c
:
RegisterEffect
(
e6
)
local
e19
=
e6
:
Clone
()
e19
:
SetCode
(
EVENT_CUSTOM
+
EVENT_AFTER_ATTACK_ANNOUNCE
)
c
:
RegisterEffect
(
e19
)
local
e9
=
Effect
.
CreateEffect
(
c
)
e9
:
SetType
(
EFFECT_TYPE_SINGLE
)
e9
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
...
...
@@ -301,14 +296,11 @@ function VgD.MonsterBattle(c)
e7
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e7
:
SetCode
(
EVENT_BATTLE_START
)
e7
:
SetRange
(
LOCATION_HAND
+
LOCATION_MZONE
)
e7
:
SetCountLimit
(
1
)
e7
:
SetCost
(
VgD
.
SendToGCost
)
e7
:
SetCondition
(
VgD
.
SendToGCondition
)
e7
:
SetOperation
(
VgD
.
SendToGOperation
)
c
:
RegisterEffect
(
e7
)
local
e17
=
e7
:
Clone
()
e17
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
)
e17
:
SetCode
(
EVENT_CUSTOM
+
EVENT_AFTER_TO_GZONE
)
c
:
RegisterEffect
(
e17
)
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e8
:
SetProperty
(
EFFECT_FLAG_DELAY
)
...
...
@@ -317,13 +309,6 @@ function VgD.MonsterBattle(c)
e8
:
SetRange
(
LOCATION_GZONE
)
e8
:
SetOperation
(
VgD
.
GToGraveOperation
)
c
:
RegisterEffect
(
e8
)
local
e18
=
Effect
.
CreateEffect
(
c
)
e18
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e18
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e18
:
SetCode
(
EVENT_MOVE
)
e18
:
SetCondition
(
VgD
.
CardToGCondition
)
e18
:
SetOperation
(
VgD
.
EventToGOperation
)
c
:
RegisterEffect
(
e18
)
--其他永续
local
e10
=
Effect
.
CreateEffect
(
c
)
e10
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
@@ -411,13 +396,12 @@ function VgD.MonsterNextTrigger(e,tp,eg,ep,ev,re,r,rp)
return
eg
:
GetFirst
():
GetControler
()
==
tp
and
VgF
.
VMonsterFilter
(
c
)
end
function
VgD
.
SupportCondition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
VgF
.
GetColumnGroup
(
Duel
.
GetAttacker
()):
IsContains
(
e
:
GetHandler
())
and
Duel
.
GetTurnPlayer
()
==
tp
and
e
:
GetHandler
():
IsAttribute
(
SKILL_SUPPORT
)
and
e
:
GetHandler
():
IsPosition
(
POS_ATTACK
)
return
VgF
.
GetColumnGroup
(
Duel
.
GetAttacker
()):
IsContains
(
e
:
GetHandler
())
and
Duel
.
GetTurnPlayer
()
==
tp
and
e
:
GetHandler
():
IsAttribute
(
SKILL_SUPPORT
)
end
function
VgD
.
SupportOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
ChangePosition
(
c
,
POS_FACEUP_DEFENSE
)
Duel
.
GetAttacker
():
RegisterFlagEffect
(
SupportFlag
,
RESET_EVENT
+
RESETS_STANDARD
+
EVENT_DAMAGE_STEP_END
,
0
,
1
)
Duel
.
ResetFlagEffect
(
tp
,
CountTriggerFlag
)
end
function
VgD
.
SupportValue
(
e
)
local
tp
=
e
:
GetHandlerPlayer
()
...
...
@@ -443,21 +427,21 @@ 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
VgF
.
OnceChainCount
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
end
if
chk
==
0
then
return
true
end
else
if
chk
==
0
then
return
(
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
AFFECT_CODE_SendtoG
)
or
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
LOCATION_GZONE
,
0
,
1
,
nil
)
or
Duel
.
IsExistingMatchingCard
(
VgF
.
IsAbleToGZone
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
))
and
Duel
.
GetFlagEffect
(
tp
,
CountTriggerFlag
)
==
0
end
if
chk
==
0
then
return
(
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
AFFECT_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
,
AFFECT_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
VgF
.
OnceChainCount
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
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
)
and
Duel
.
GetCurrentChain
()
<
1
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
()
...
...
@@ -469,16 +453,11 @@ function VgD.SendToGOperation(e,tp,eg,ep,ev,re,r,rp)
g
:
AddCard
(
tc
)
end
Duel
.
Sendto
(
g
,
tp
,
LOCATION_GZONE
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
ResetFlagEffect
(
tp
,
CountTriggerFlag
)
end
function
VgD
.
GToGraveOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
SendtoGrave
(
c
,
REASON_RULE
)
end
function
VgD
.
EventToGOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
EVENT_AFTER_TO_GZONE
,
e
,
0
,
tp
,
tp
,
0
)
end
function
VgD
.
MonsterAttackAnnounceCondition
(
e
,
c
)
return
e
:
GetHandler
():
IsPosition
(
POS_DEFENSE
)
or
VgF
.
IsSequence
(
e
:
GetHandler
(),
1
,
2
,
3
)
end
...
...
@@ -905,55 +884,19 @@ function VgD.EffectTypeTrigger(c,m,loc,typ,code,op,cost,con,tg,count,property,st
if
not
typ
then
typ
=
EFFECT_TYPE_SINGLE
end
if
not
loc
then
loc
=
LOCATION_MZONE
end
if
not
stringid
then
stringid
=
0
end
if
not
property
then
property
=
EFFECT_FLAG_DELAY
end
if
not
property
then
property
=
0
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
VgF
.
Stringid
(
m
,
stringid
))
e1
:
SetType
(
typ
+
type2
)
e1
:
SetRange
(
loc
)
e1
:
SetCode
(
code
)
e1
:
SetProperty
(
property
)
e1
:
SetProperty
(
property
+
EFFECT_FLAG_DELAY
)
if
count
and
count
>
0
then
e1
:
SetCountLimit
(
count
)
end
if
VgF
.
GetValueType
(
con
)
==
"function"
then
e1
:
SetCost
(
con
)
end
if
VgF
.
GetValueType
(
cost
)
==
"function"
then
e1
:
SetCost
(
cost
)
end
if
VgF
.
GetValueType
(
tg
)
==
"function"
then
e1
:
SetTarget
(
tg
)
end
e1
:
SetCost
(
VgD
.
EffectTypeTriggerCost
(
cost
,
code
))
e1
:
SetOperation
(
VgD
.
EffectTypeTriggerOperation
(
op
,
code
))
if
VgF
.
GetValueType
(
op
)
==
"function"
then
e1
:
SetOperation
(
op
)
end
c
:
RegisterEffect
(
e1
)
if
code
==
EVENT_BATTLE_START
then
if
property
&
EFFECT_FLAG_DAMAGE_STEP
==
0
then
property
=
property
+
EFFECT_FLAG_DAMAGE_STEP
end
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_CUSTOM
+
EVENT_AFTER_TO_GZONE
)
e2
:
SetProperty
(
property
)
c
:
RegisterEffect
(
e2
)
elseif
code
==
EVENT_ATTACK_ANNOUNCE
then
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_CUSTOM
+
EVENT_AFTER_ATTACK_ANNOUNCE
)
c
:
RegisterEffect
(
e2
)
end
end
function
VgD
.
EffectTypeTriggerCost
(
cost
,
code
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
VgF
.
GetValueType
(
cost
)
==
"function"
and
not
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
then
return
false
end
if
code
==
EVENT_ATTACK_ANNOUNCE
or
code
==
EVENT_BATTLE_START
then
return
VgF
.
OnceChainCount
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
else
return
true
end
end
if
code
==
EVENT_ATTACK_ANNOUNCE
or
code
==
EVENT_BATTLE_START
then
VgF
.
OnceChainCount
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
end
end
end
function
VgD
.
EffectTypeTriggerOperation
(
op
,
code
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
code
==
EVENT_BATTLE_START
then
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
EVENT_AFTER_TO_GZONE
,
e
,
0
,
tp
,
tp
,
0
)
elseif
code
==
EVENT_ATTACK_ANNOUNCE
then
Duel
.
RaiseEvent
(
c
,
EVENT_CUSTOM
+
EVENT_AFTER_ATTACK_ANNOUNCE
,
e
,
0
,
tp
,
tp
,
0
)
end
if
VgF
.
GetValueType
(
op
)
==
"function"
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
Duel
.
ResetFlagEffect
(
tp
,
CountTriggerFlag
)
end
end
function
VgD
.
EffectTypeIgnition
(
c
,
m
,
loc
,
op
,
cost
,
con
,
tg
,
count
,
property
,
stringid
)
if
not
loc
then
loc
=
LOCATION_MZONE
end
...
...
VgDefinition.Lua
View file @
8a3c0238
...
...
@@ -889,8 +889,6 @@ AFFECT_CODE_SendtoG =VgID+1 --
--自定时点
EVENT_TRIGGER
=
VgID
--判定时点
EVENT_CRITICAL_STRIKE
=
VgID
+
1
--暴击值结算时点
EVENT_AFTER_TO_GZONE
=
VgID
+
2
--交盾结算时点
EVENT_AFTER_ATTACK_ANNOUNCE
=
VgID
+
3
--攻击宣言时点
POS_FACEUP_DEFENCE
=
POS_FACEUP_DEFENSE
...
...
VgFuncLib.lua
View file @
8a3c0238
...
...
@@ -284,14 +284,10 @@ function VgF.StarUp(c,g,val,reset)
end
function
VgF
.
IsAbleToGZone
(
c
)
if
c
:
IsLocation
(
LOCATION_MZONE
)
then
return
c
:
IsAttribute
(
SKILL_BLOCK
)
and
VgF
.
RMonsterFilter
(
c
)
return
c
:
IsAttribute
(
SKILL_BLOCK
)
end
return
c
:
IsLocation
(
LOCATION_HAND
)
end
function
VgF
.
OnceChainCount
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFlagEffect
(
tp
,
CountTriggerFlag
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
CountTriggerFlag
,
RESET_EVENT
+
EVENT_CHAIN_SOLVING
,
0
,
1
)
end
function
VgF
.
DisCardCost
(
num
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment