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
134aee54
Commit
134aee54
authored
May 22, 2024
by
jwyxym
Committed by
GitHub
May 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
d7650427
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
105 deletions
+46
-105
VgFuncLib.lua
VgFuncLib.lua
+46
-105
No files found.
VgFuncLib.lua
View file @
134aee54
...
@@ -380,33 +380,24 @@ end
...
@@ -380,33 +380,24 @@ end
---@param g Card|Group 要被上升攻击力的卡
---@param g Card|Group 要被上升攻击力的卡
---@param val integer 要上升的攻击力(可以为负)
---@param val integer 要上升的攻击力(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function
VgF
.
AtkUp
(
c
,
g
,
val
,
reset
,
resetcount
,
resettype
,
resetcode
)
function
VgF
.
AtkUp
(
c
,
g
,
val
,
reset
,
resetcount
)
if
not
c
then
return
end
if
not
c
then
return
end
if
not
reset
then
reset
=
RESET_PHASE
+
PHASE_END
end
if
not
resetcount
then
resetcount
=
1
end
if
not
resetcount
then
resetcount
=
1
end
if
not
reset
type
then
resettype
=
EFFECT_TYPE_FIEL
D
end
if
not
reset
then
reset
=
RESET_PHASE
+
PHASE_EN
D
end
if
not
val
or
val
==
0
then
return
end
if
not
val
or
val
==
0
then
return
end
if
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
>
0
then
if
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
>
0
then
local
e
=
{}
for
tc
in
VgF
.
Next
(
g
)
do
for
tc
in
VgF
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_
FIELD
)
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
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
if
resetcode
then
table.insert
(
e
,
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
resettype
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
resetcode
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetOperation
(
function
(
te
)
e1
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e2
)
end
end
end
return
e
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
local
tc
=
VgF
.
ReturnCard
(
g
)
local
tc
=
VgF
.
ReturnCard
(
g
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
@@ -415,18 +406,7 @@ function VgF.AtkUp(c,g,val,reset,resetcount,resettype,resetcode)
...
@@ -415,18 +406,7 @@ function VgF.AtkUp(c,g,val,reset,resetcount,resettype,resetcode)
e1
:
SetValue
(
val
)
e1
:
SetValue
(
val
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
if
resetcode
>
0
then
return
e1
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
resettype
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
resetcode
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetOperation
(
function
(
te
)
e1
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e2
)
end
end
end
end
end
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
...
@@ -434,13 +414,13 @@ end
...
@@ -434,13 +414,13 @@ end
---@param g Card|Group 要被上升盾值的卡
---@param g Card|Group 要被上升盾值的卡
---@param val integer 要上升的盾值(可以为负)
---@param val integer 要上升的盾值(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function
VgF
.
DefUp
(
c
,
g
,
val
,
reset
,
resetcount
,
resettype
,
resetcode
)
function
VgF
.
DefUp
(
c
,
g
,
val
,
reset
,
resetcount
)
if
not
c
then
return
end
if
not
c
then
return
end
if
not
reset
then
reset
=
RESET_PHASE
+
PHASE_END
end
if
not
reset
then
reset
=
RESET_PHASE
+
PHASE_END
end
if
not
resetcount
then
resetcount
=
1
end
if
not
resetcount
then
resetcount
=
1
end
if
not
resettype
then
resettype
=
EFFECT_TYPE_FIELD
end
if
not
val
or
val
==
0
then
return
end
if
not
val
or
val
==
0
then
return
end
if
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
>
0
then
if
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
>
0
then
local
e
=
{}
for
tc
in
VgF
.
Next
(
g
)
do
for
tc
in
VgF
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
@@ -448,19 +428,9 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
...
@@ -448,19 +428,9 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
e1
:
SetValue
(
val
)
e1
:
SetValue
(
val
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
if
resetcode
>
0
then
table.insert
(
e
,
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
resettype
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
resetcode
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetOperation
(
function
(
te
)
e1
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e2
)
end
end
end
return
e
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
local
tc
=
VgF
.
ReturnCard
(
g
)
local
tc
=
VgF
.
ReturnCard
(
g
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
@@ -469,18 +439,7 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
...
@@ -469,18 +439,7 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
e1
:
SetValue
(
val
)
e1
:
SetValue
(
val
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
reset
,
resetcount
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
if
resetcode
>
0
then
return
e1
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
resettype
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
resetcode
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetOperation
(
function
(
te
)
e1
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e2
)
end
end
end
end
end
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
...
@@ -488,13 +447,14 @@ end
...
@@ -488,13 +447,14 @@ end
---@param g Card|Group 要被上升☆的卡
---@param g Card|Group 要被上升☆的卡
---@param val integer 要上升的☆(可以为负)
---@param val integer 要上升的☆(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function
VgF
.
StarUp
(
c
,
g
,
val
,
reset
,
resetcount
,
resettype
,
resetcode
)
function
VgF
.
StarUp
(
c
,
g
,
val
,
reset
,
resetcount
)
if
not
c
or
not
g
then
return
end
if
not
c
or
not
g
then
return
end
if
not
reset
then
reset
=
RESET_PHASE
+
PHASE_END
end
if
not
reset
then
reset
=
RESET_PHASE
+
PHASE_END
end
if
not
resetcount
then
resetcount
=
1
end
if
not
resetcount
then
resetcount
=
1
end
if
not
resettype
then
resettype
=
EFFECT_TYPE_FIELD
end
if
not
val
or
val
==
0
then
return
end
if
not
val
or
val
==
0
then
return
end
if
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
>
0
then
if
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
>
0
then
local
t1
=
{}
local
t2
=
{}
for
tc
in
VgF
.
Next
(
g
)
do
for
tc
in
VgF
.
Next
(
g
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
@@ -507,25 +467,10 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
...
@@ -507,25 +467,10 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_RSCALE
)
e2
:
SetCode
(
EFFECT_UPDATE_RSCALE
)
tc
:
RegisterEffect
(
e2
)
tc
:
RegisterEffect
(
e2
)
if
resetcode
>
0
then
table.insert
(
t1
,
e1
)
local
e3
=
Effect
.
CreateEffect
(
c
)
table.insert
(
t2
,
e2
)
e3
:
SetType
(
resettype
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
resetcode
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetOperation
(
function
(
te
)
e1
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetOperation
(
function
(
te
)
e2
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e4
)
end
end
end
return
t1
,
t2
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
local
tc
=
VgF
.
ReturnCard
(
g
)
local
tc
=
VgF
.
ReturnCard
(
g
)
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
...
@@ -539,24 +484,7 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
...
@@ -539,24 +484,7 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
local
e2
=
e1
:
Clone
()
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_RSCALE
)
e2
:
SetCode
(
EFFECT_UPDATE_RSCALE
)
tc
:
RegisterEffect
(
e2
)
tc
:
RegisterEffect
(
e2
)
if
resetcode
>
0
then
return
e1
,
e2
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
resettype
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
resetcode
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetOperation
(
function
(
te
)
e1
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetOperation
(
function
(
te
)
e2
:
Reset
()
te
:
Reset
()
end
)
tc
:
RegisterEffect
(
e4
)
end
end
end
end
end
---判断c是否可以以规则的手段到G区域。
---判断c是否可以以规则的手段到G区域。
...
@@ -619,10 +547,8 @@ end
...
@@ -619,10 +547,8 @@ end
---@param num integer 灵魂爆发的数量
---@param num integer 灵魂爆发的数量
---@return function 效果的Cost函数
---@return function 效果的Cost函数
function
VgF
.
OverlayCost
(
num
)
function
VgF
.
OverlayCost
(
num
)
function
VgF
.
EnergyCost
(
num
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
VgF
.
OverlayCostOp
(
num
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
VgF
.
OverlayCostOp
(
num
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
end
end
end
end
end
function
VgF
.
OverlayCostOp
(
num
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
VgF
.
OverlayCostOp
(
num
,
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -818,17 +744,32 @@ function VgF.CheckPrison(p)
...
@@ -818,17 +744,32 @@ function VgF.CheckPrison(p)
end
end
--重置Effect
--重置Effect
function
VgF
.
EffectReset
(
c
,
e
,
code
,
con
)
function
VgF
.
EffectReset
(
c
,
e
,
code
,
con
)
local
e1
=
Effect
.
CreateEffect
(
c
)
if
VgF
.
GetValueType
(
e
)
==
"Effect"
then
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
code
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
code
)
e1
:
SetRange
(
LOCATION_ALL
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetLabelObject
(
e
)
e1
:
SetRange
(
LOCATION_ALL
)
if
VgF
.
GetValueType
(
con
)
==
"function"
then
e1
:
SetCondition
(
con
)
end
e1
:
SetLabelObject
(
e
)
e1
:
SetOperation
(
VgF
.
EffectResetOperation
)
if
VgF
.
GetValueType
(
con
)
==
"function"
then
e1
:
SetCondition
(
con
)
end
c
:
RegisterEffect
(
e1
)
e1
:
SetOperation
(
VgF
.
EffectResetOperation
)
c
:
RegisterEffect
(
e1
)
elseif
VgF
.
GetValueType
(
e
)
==
"table"
then
for
i
,
v
in
ipairs
(
e
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
code
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetRange
(
LOCATION_ALL
)
e1
:
SetLabelObject
(
v
)
if
VgF
.
GetValueType
(
con
)
==
"function"
then
e1
:
SetCondition
(
con
)
end
e1
:
SetOperation
(
VgF
.
EffectResetOperation
)
c
:
RegisterEffect
(
e1
)
end
end
end
end
function
VgF
.
EffectResetOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
VgF
.
EffectResetOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
e1
=
e
:
GetLabelObject
()
local
e1
=
e
:
GetLabelObject
()
if
VgF
.
GetValueType
(
e1
)
==
"Effect"
then
e1
:
Reset
()
end
if
VgF
.
GetValueType
(
e1
)
==
"Effect"
then
e1
:
Reset
()
end
e
:
Reset
()
end
end
\ No newline at end of file
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