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
b601c80a
Commit
b601c80a
authored
Nov 13, 2024
by
whenmo
Committed by
GitHub
Nov 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update VgFuncLib.lua
parent
d8c1c36b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
194 additions
and
219 deletions
+194
-219
VgFuncLib.lua
VgFuncLib.lua
+194
-219
No files found.
VgFuncLib.lua
View file @
b601c80a
...
@@ -7,69 +7,34 @@ bit = {}
...
@@ -7,69 +7,34 @@ bit = {}
---@class Group
---@class Group
---@class Effect
---@class Effect
---初始化c,使c具有vg卡的功能。
---@param c Card 要初始化的卡
function
VgF
.
VgCard
(
c
)
VgD
.
Rule
(
c
)
VgF
.
DefineArguments
()
VgD
.
RideUp
(
c
)
VgD
.
CardTrigger
(
c
)
if
c
:
IsType
(
TYPE_MONSTER
)
then
VgD
.
CallToR
(
c
)
VgD
.
MonsterBattle
(
c
)
end
end
---获取脚本基本信息
---获取脚本基本信息
function
GetID
()
function
GetID
()
local
offset
=
self_code
<
100000000
and
1
or
100
local
offset
=
self_code
<
100000000
and
1
or
100
return
self_table
,
self_code
,
offset
return
self_table
,
self_code
,
offset
end
end
---根据卡号和索引获取描述编号
---根据卡号和索引获取描述编号
---@param code
integ
er 卡片密码
---@param code
numb
er 卡片密码
---@param id
integ
er 索引
---@param id
numb
er 索引
---@return
integ
er 描述的编号
---@return
numb
er 描述的编号
function
VgF
.
Stringid
(
code
,
id
)
function
VgF
.
Stringid
(
code
,
id
)
return
code
*
16
+
id
return
code
*
16
+
id
end
end
function
VgF
.
DefineArguments
()
if
not
code
then
code
=
nil
end
if
not
loc
then
loc
=
nil
end
if
not
typ
then
typ
=
nil
end
if
not
typ2
then
typ2
=
nil
end
if
not
count
then
count
=
nil
end
if
not
property
then
property
=
nil
end
if
not
reset
then
reset
=
nil
end
if
not
op
then
op
=
nil
end
if
not
cost
then
cost
=
nil
end
if
not
con
then
con
=
nil
end
if
not
tg
then
tg
=
nil
end
if
not
f
then
f
=
nil
end
if
not
zone
then
zone
=
nil
end
end
---根据控制者,区域和编号获取zone;不合法的数据会返回0
---根据控制者,区域和编号获取zone;不合法的数据会返回0
---@param p
integ
er 控制者
---@param p
numb
er 控制者
---@param loc
integ
er 所在区域,若不是LOCATION_MZONE或LOCATION_SZONE则返回0
---@param loc
numb
er 所在区域,若不是LOCATION_MZONE或LOCATION_SZONE则返回0
---@param seq
integ
er 编号
---@param seq
numb
er 编号
---@return
integ
er 卡片所在的zone
---@return
numb
er 卡片所在的zone
function
VgF
.
SequenceToGlobal
(
p
,
loc
,
seq
)
function
VgF
.
SequenceToGlobal
(
p
,
loc
,
seq
)
if
p
~=
0
and
p
~=
1
then
if
p
~=
0
or
p
~=
1
or
loc
&
0xc
~=
loc
then
Debug
.
Message
(
"VgF.SequenceToGlobal param illegal"
)
return
0
return
0
end
end
if
loc
==
LOCATION_MZONE
then
if
loc
==
LOCATION_MZONE
and
seq
<=
6
then
if
seq
<=
6
then
return
0x0001
<<
(
seq
)
return
0x0001
<<
(
seq
)
else
elseif
loc
==
LOCATION_SZONE
and
seq
<=
4
then
return
0
end
elseif
loc
==
LOCATION_SZONE
then
if
seq
<=
4
then
return
0x0100
<<
(
16
*
p
+
seq
)
return
0x0100
<<
(
16
*
p
+
seq
)
else
return
0
end
end
else
return
0
return
0
end
end
end
---一个总是返回true的函数。
---一个总是返回true的函数。
---@return true
---@return true
...
@@ -128,7 +93,7 @@ end
...
@@ -128,7 +93,7 @@ end
---返回g的前val张卡。
---返回g的前val张卡。
---@param g Group 要操作的卡片组
---@param g Group 要操作的卡片组
---@param val
integ
er 要获取的卡片数量
---@param val
numb
er 要获取的卡片数量
function
VgF
.
GetCardsFromGroup
(
g
,
val
)
function
VgF
.
GetCardsFromGroup
(
g
,
val
)
if
VgF
.
GetValueType
(
g
)
==
"Group"
then
if
VgF
.
GetValueType
(
g
)
==
"Group"
then
local
sg
=
Group
.
CreateGroup
()
local
sg
=
Group
.
CreateGroup
()
...
@@ -155,43 +120,43 @@ function table.copy(copy, original)
...
@@ -155,43 +120,43 @@ function table.copy(copy, original)
end
end
---返回对a和b进行按位与运算的结果。
---返回对a和b进行按位与运算的结果。
---@param a
integ
er 操作数1
---@param a
numb
er 操作数1
---@param b
integ
er 操作数2
---@param b
numb
er 操作数2
---@return
integ
er 运算结果
---@return
numb
er 运算结果
function
bit
.
band
(
a
,
b
)
function
bit
.
band
(
a
,
b
)
return
a
&
b
return
a
&
b
end
end
---返回对a和b进行按位或运算的结果。
---返回对a和b进行按位或运算的结果。
---@param a
integ
er 操作数1
---@param a
numb
er 操作数1
---@param b
integ
er 操作数2
---@param b
numb
er 操作数2
---@return
integ
er 运算结果
---@return
numb
er 运算结果
function
bit
.
bor
(
a
,
b
)
function
bit
.
bor
(
a
,
b
)
return
a
|
b
return
a
|
b
end
end
---返回对a和b进行按位异或运算的结果。
---返回对a和b进行按位异或运算的结果。
---@param a
integ
er 操作数1
---@param a
numb
er 操作数1
---@param b
integ
er 操作数2
---@param b
numb
er 操作数2
---@return
integ
er 运算结果
---@return
numb
er 运算结果
function
bit
.
bxor
(
a
,
b
)
function
bit
.
bxor
(
a
,
b
)
return
a
~
b
return
a
~
b
end
end
---返回a按位左移b位后的结果。
---返回a按位左移b位后的结果。
---@param a
integ
er 操作数1
---@param a
numb
er 操作数1
---@param b
integ
er 操作数2
---@param b
numb
er 操作数2
---@return
integ
er 运算结果
---@return
numb
er 运算结果
function
bit
.
lshift
(
a
,
b
)
function
bit
.
lshift
(
a
,
b
)
return
a
<<
b
return
a
<<
b
end
end
---返回a按位右移b位后的结果。
---返回a按位右移b位后的结果。
---@param a
integ
er 操作数1
---@param a
numb
er 操作数1
---@param b
integ
er 操作数2
---@param b
numb
er 操作数2
---@return
integ
er 运算结果
---@return
numb
er 运算结果
function
bit
.
rshift
(
a
,
b
)
function
bit
.
rshift
(
a
,
b
)
return
a
>>
b
return
a
>>
b
end
end
---返回a按位非后的结果。
---返回a按位非后的结果。
---@param a
integ
er 操作数
---@param a
numb
er 操作数
---@return
integ
er 运算结果
---@return
numb
er 运算结果
function
bit
.
bnot
(
a
)
function
bit
.
bnot
(
a
)
return
~
a
return
~
a
end
end
...
@@ -238,7 +203,7 @@ function VgF.IsSummonTypeR(c)
...
@@ -238,7 +203,7 @@ function VgF.IsSummonTypeR(c)
end
end
---判断c是否在当前区域的某(几)个编号上
---判断c是否在当前区域的某(几)个编号上
---@param c Card 要判断的卡
---@param c Card 要判断的卡
---@param ...
integ
er 编号
---@param ...
numb
er 编号
---@return boolean 指示是否在给定编号上
---@return boolean 指示是否在给定编号上
function
VgF
.
IsSequence
(
c
,
...
)
function
VgF
.
IsSequence
(
c
,
...
)
for
i
,
v
in
ipairs
{
...
}
do
for
i
,
v
in
ipairs
{
...
}
do
...
@@ -324,11 +289,11 @@ function VgF.GetAvailableLocation(tp, zone)
...
@@ -324,11 +289,11 @@ function VgF.GetAvailableLocation(tp, zone)
end
end
---将g(中的每一张卡)Call到单位区。返回Call成功的数量。
---将g(中的每一张卡)Call到单位区。返回Call成功的数量。
---@param g Card|Group 要Call的卡(片组)
---@param g Card|Group 要Call的卡(片组)
---@param sumtype
integ
er Call的方式,默认填0
---@param sumtype
numb
er Call的方式,默认填0
---@param tp
integ
er Call的玩家
---@param tp
numb
er Call的玩家
---@param zone
integ
er|nil 指示要Call到的格子。<br>前列的R:17; 后列的R:14; 全部的R:31; V:32
---@param zone
numb
er|nil 指示要Call到的格子。<br>前列的R:17; 后列的R:14; 全部的R:31; V:32
---@param pos
integ
er|nil 表示形式
---@param pos
numb
er|nil 表示形式
---@return
integ
er Call成功的数量
---@return
numb
er Call成功的数量
function
VgF
.
Call
(
g
,
sumtype
,
tp
,
zone
,
pos
)
function
VgF
.
Call
(
g
,
sumtype
,
tp
,
zone
,
pos
)
if
(
VgF
.
GetValueType
(
g
)
~=
"Card"
and
VgF
.
GetValueType
(
g
)
~=
"Group"
)
or
(
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
==
0
)
then
return
0
end
if
(
VgF
.
GetValueType
(
g
)
~=
"Card"
and
VgF
.
GetValueType
(
g
)
~=
"Group"
)
or
(
VgF
.
GetValueType
(
g
)
==
"Group"
and
g
:
GetCount
()
==
0
)
then
return
0
end
if
VgF
.
GetValueType
(
pos
)
~=
"number"
then
pos
=
POS_FACEUP_ATTACK
end
if
VgF
.
GetValueType
(
pos
)
~=
"number"
then
pos
=
POS_FACEUP_ATTACK
end
...
@@ -411,8 +376,8 @@ end
...
@@ -411,8 +376,8 @@ end
---以c的名义,使g(中的每一张卡)的攻击力上升val,并在reset时重置。
---以c的名义,使g(中的每一张卡)的攻击力上升val,并在reset时重置。
---@param c Card 要使卡上升攻击力的卡
---@param c Card 要使卡上升攻击力的卡
---@param g Card|Group 要被上升攻击力的卡
---@param g Card|Group 要被上升攻击力的卡
---@param val
integ
er|string 要上升的攻击力(可以为负)
---@param val
numb
er|string 要上升的攻击力(可以为负)
---@param reset
integ
er|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
---@param reset
numb
er|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function
VgF
.
AtkUp
(
c
,
g
,
val
,
reset
,
resetcount
)
function
VgF
.
AtkUp
(
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
resetcount
then
resetcount
=
1
end
if
not
resetcount
then
resetcount
=
1
end
...
@@ -455,8 +420,8 @@ end
...
@@ -455,8 +420,8 @@ end
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
---@param c Card 要使卡上升盾值的卡
---@param c Card 要使卡上升盾值的卡
---@param g Card|Group 要被上升盾值的卡
---@param g Card|Group 要被上升盾值的卡
---@param val
integ
er|string 要上升的盾值(可以为负)
---@param val
numb
er|string 要上升的盾值(可以为负)
---@param reset
integ
er|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
---@param reset
numb
er|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function
VgF
.
DefUp
(
c
,
g
,
val
,
reset
,
resetcount
)
function
VgF
.
DefUp
(
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
...
@@ -498,8 +463,8 @@ end
...
@@ -498,8 +463,8 @@ end
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
---@param c Card 要使卡上升☆的卡
---@param c Card 要使卡上升☆的卡
---@param g Card|Group 要被上升☆的卡
---@param g Card|Group 要被上升☆的卡
---@param val
integ
er|string 要上升的☆(可以为负)
---@param val
numb
er|string 要上升的☆(可以为负)
---@param reset
integ
er|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
---@param reset
numb
er|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function
VgF
.
StarUp
(
c
,
g
,
val
,
reset
,
resetcount
)
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
...
@@ -562,7 +527,7 @@ function VgF.IsAbleToGZone(c, loc)
...
@@ -562,7 +527,7 @@ function VgF.IsAbleToGZone(c, loc)
return
false
return
false
end
end
---用于效果的Operation。它返回一个执行“[计数回充val]”的函数。
---用于效果的Operation。它返回一个执行“[计数回充val]”的函数。
---@param val
integ
er 计数回充的数量
---@param val
numb
er 计数回充的数量
---@return function 效果的Operation函数
---@return function 效果的Operation函数
function
VgF
.
DamageFill
(
val
)
function
VgF
.
DamageFill
(
val
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
@@ -606,7 +571,7 @@ function VgF.ChangePosDefence(c)
...
@@ -606,7 +571,7 @@ function VgF.ChangePosDefence(c)
end
end
---用于效果的Cost。它返回一个执行“【费用】[将手牌中的val张卡舍弃]”的函数。
---用于效果的Cost。它返回一个执行“【费用】[将手牌中的val张卡舍弃]”的函数。
---@param val
integ
er 要舍弃的卡的数量
---@param val
numb
er 要舍弃的卡的数量
---@return function 效果的Cost函数
---@return function 效果的Cost函数
function
VgF
.
DisCardCost
(
val
)
function
VgF
.
DisCardCost
(
val
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -629,7 +594,7 @@ function VgF.DisCardCost(val)
...
@@ -629,7 +594,7 @@ function VgF.DisCardCost(val)
end
end
end
end
---用于效果的Cost。它返回一个执行“【费用】[能量爆发val]”的函数。
---用于效果的Cost。它返回一个执行“【费用】[能量爆发val]”的函数。
---@param val
integ
er 能量爆发的数量
---@param val
numb
er 能量爆发的数量
---@return function 效果的Cost函数
---@return function 效果的Cost函数
function
VgF
.
EnergyCost
(
val
)
function
VgF
.
EnergyCost
(
val
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -652,7 +617,7 @@ function VgF.EnergyCost(val)
...
@@ -652,7 +617,7 @@ function VgF.EnergyCost(val)
end
end
end
end
---用于效果的Cost。它返回一个执行“【费用】[灵魂爆发val]”的函数。
---用于效果的Cost。它返回一个执行“【费用】[灵魂爆发val]”的函数。
---@param val
integ
er 灵魂爆发的数量
---@param val
numb
er 灵魂爆发的数量
---@return function 效果的Cost函数
---@return function 效果的Cost函数
function
VgF
.
OverlayCost
(
val
)
function
VgF
.
OverlayCost
(
val
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -675,7 +640,7 @@ function VgF.OverlayCost(val)
...
@@ -675,7 +640,7 @@ function VgF.OverlayCost(val)
end
end
end
end
---用于效果的Cost或Operation。它返回一个执行“【费用】[灵魂填充val]”的函数。
---用于效果的Cost或Operation。它返回一个执行“【费用】[灵魂填充val]”的函数。
---@param val
integ
er 灵魂填充的数量
---@param val
numb
er 灵魂填充的数量
---@return function 效果的Cost或Operation函数
---@return function 效果的Cost或Operation函数
function
VgF
.
OverlayFill
(
val
)
function
VgF
.
OverlayFill
(
val
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -700,7 +665,7 @@ function VgF.OverlayFill(val)
...
@@ -700,7 +665,7 @@ function VgF.OverlayFill(val)
end
end
end
end
---用于效果的Cost。它返回一个执行“【费用】[计数爆发val]”的函数。
---用于效果的Cost。它返回一个执行“【费用】[计数爆发val]”的函数。
---@param val
integ
er 计数爆发的数量
---@param val
numb
er 计数爆发的数量
---@return function 效果的Cost函数
---@return function 效果的Cost函数
function
VgF
.
DamageCost
(
val
)
function
VgF
.
DamageCost
(
val
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -725,8 +690,8 @@ function VgF.DamageCost(val)
...
@@ -725,8 +690,8 @@ function VgF.DamageCost(val)
end
end
---用于效果的Cost。它返回一个执行“【费用】[将xxx退场]”的函数。
---用于效果的Cost。它返回一个执行“【费用】[将xxx退场]”的函数。
---@param card_code_func Card|integer|function 退场的卡的条件
---@param card_code_func Card|integer|function 退场的卡的条件
---@param val_max
integ
er 退场的卡的最大数量
---@param val_max
numb
er 退场的卡的最大数量
---@param val_min
integ
er 退场的卡的最小数量
---@param val_min
numb
er 退场的卡的最小数量
---@param except Card
---@param except Card
---@param ... any
---@param ... any
---@return function 效果的Cost函数
---@return function 效果的Cost函数
...
@@ -775,8 +740,8 @@ function VgF.IsCanBeCalled(c, e, tp, sumtype, pos, zone)
...
@@ -775,8 +740,8 @@ function VgF.IsCanBeCalled(c, e, tp, sumtype, pos, zone)
return
z
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
sumtype
,
tp
,
false
,
false
,
pos
,
tp
,
zone
)
return
z
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
sumtype
,
tp
,
false
,
false
,
pos
,
tp
,
zone
)
end
end
---用于效果的Operation。执行“从loc_from中选取最少int_min,最多int_max张满足f的卡,送去loc_to。”。
---用于效果的Operation。执行“从loc_from中选取最少int_min,最多int_max张满足f的卡,送去loc_to。”。
---@param loc_to
integ
er 要送去的区域。不填则返回0。
---@param loc_to
numb
er 要送去的区域。不填则返回0。
---@param loc_from
integ
er 要选取的区域。不填则返回0。
---@param loc_from
numb
er 要选取的区域。不填则返回0。
---@param f function|nil 卡片过滤的条件
---@param f function|nil 卡片过滤的条件
function
VgF
.
SearchCard
(
loc_to
,
loc_from
,
f
,
int_max
,
int_min
,
...
)
function
VgF
.
SearchCard
(
loc_to
,
loc_from
,
f
,
int_max
,
int_min
,
...
)
local
ext_params
=
{
...
}
local
ext_params
=
{
...
}
...
@@ -971,7 +936,7 @@ function Group.SelectDoubleSubGroup(g, p, f1, int_min1, int_max1, f2, int_min2,
...
@@ -971,7 +936,7 @@ function Group.SelectDoubleSubGroup(g, p, f1, int_min1, int_max1, f2, int_min2,
return
result
return
result
end
end
---返回p场上的先导者。
---返回p场上的先导者。
---@param p
integ
er 要获取先导者的玩家。不合法则返回nil。
---@param p
numb
er 要获取先导者的玩家。不合法则返回nil。
---@return Card|nil p场上的先导者
---@return Card|nil p场上的先导者
function
VgF
.
GetVMonster
(
p
)
function
VgF
.
GetVMonster
(
p
)
if
p
~=
0
and
p
~=
1
then
return
end
if
p
~=
0
and
p
~=
1
then
return
end
...
@@ -994,7 +959,7 @@ function VgF.PrisonFilter(c, ct)
...
@@ -994,7 +959,7 @@ function VgF.PrisonFilter(c, ct)
end
end
---收容g(中的每一张卡)到p的监狱。没有监狱时,不操作。
---收容g(中的每一张卡)到p的监狱。没有监狱时,不操作。
---@param g Card|Group
---@param g Card|Group
---@param p
integ
er
---@param p
numb
er
function
VgF
.
SendtoPrison
(
g
,
p
)
function
VgF
.
SendtoPrison
(
g
,
p
)
if
not
VgF
.
CheckPrison
(
p
)
or
not
g
then
return
end
if
not
VgF
.
CheckPrison
(
p
)
or
not
g
then
return
end
local
og
=
Duel
.
GetFieldGroup
(
p
,
LOCATION_ORDER
,
0
)
local
og
=
Duel
.
GetFieldGroup
(
p
,
LOCATION_ORDER
,
0
)
...
@@ -1018,7 +983,7 @@ function VgF.PrisonFilter(c, tp)
...
@@ -1018,7 +983,7 @@ function VgF.PrisonFilter(c, tp)
end
end
---收容g(中的每一张卡)到p的监狱。没有监狱时,不操作。
---收容g(中的每一张卡)到p的监狱。没有监狱时,不操作。
---@param g Card|Group
---@param g Card|Group
---@param p
integ
er
---@param p
numb
er
function VgF.SendtoPrison(g, p)
function VgF.SendtoPrison(g, p)
if not VgF.CheckPrison(p) or not g then return end
if not VgF.CheckPrison(p) or not g then return end
local og = Duel.GetFieldGroup(p, LOCATION_ORDER, 0)
local og = Duel.GetFieldGroup(p, LOCATION_ORDER, 0)
...
@@ -1034,7 +999,7 @@ function VgF.SendtoPrison(g, p)
...
@@ -1034,7 +999,7 @@ function VgF.SendtoPrison(g, p)
end
end
end]]
end]]
---检测p场上有没有监狱。
---检测p场上有没有监狱。
---@param p
integ
er
---@param p
numb
er
---@return boolean 指示p场上有没有监狱。
---@return boolean 指示p场上有没有监狱。
function
VgF
.
CheckPrison
(
p
)
function
VgF
.
CheckPrison
(
p
)
local
og
=
Duel
.
GetFieldGroup
(
p
,
LOCATION_ORDER
,
0
)
local
og
=
Duel
.
GetFieldGroup
(
p
,
LOCATION_ORDER
,
0
)
...
@@ -1244,7 +1209,7 @@ function VgF.GetMatchingGroup(f, tp, loc_self, loc_op, except_g, ...)
...
@@ -1244,7 +1209,7 @@ function VgF.GetMatchingGroup(f, tp, loc_self, loc_op, except_g, ...)
return
g
return
g
end
end
---用于效果的Operation。执行“把卡sg,送去loc,第三个参数开始为额外参数,内容与原函数相同。”。
---用于效果的Operation。执行“把卡sg,送去loc,第三个参数开始为额外参数,内容与原函数相同。”。
---@param loc
integ
er 要送去的区域。不填则返回0。
---@param loc
numb
er 要送去的区域。不填则返回0。
---@param sg Card|Group 要操作的卡|卡片组。
---@param sg Card|Group 要操作的卡|卡片组。
---@return number 具体操作的卡的数量
---@return number 具体操作的卡的数量
function
VgF
.
Sendto
(
loc
,
sg
,
...
)
function
VgF
.
Sendto
(
loc
,
sg
,
...
)
...
@@ -1411,19 +1376,29 @@ end
...
@@ -1411,19 +1376,29 @@ end
function
VgF
.
PlayerEffect
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
VgF
.
PlayerEffect
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
true
return
true
end
end
---检查func是否为nil或函数
---创建一个函数检查器 检查func是否为nil或函数
function
VgF
.
FunctionLegal
(
func
,
from
,
name
)
function
VgF
.
IllegalFunctionCheck
(
name
)
if
VgF
.
GetValueType
(
func
)
==
"nil"
or
VgF
.
GetValueType
(
func
)
==
"function"
then
return
true
end
local
chk
=
function
(
key
)
if
VgF
.
GetValueType
(
name
)
==
"string"
and
(
VgF
.
GetValueType
(
from
)
==
"string"
or
VgF
.
GetValueType
(
from
)
==
"number"
)
then
return
function
(
func
)
Debug
.
Message
(
"c"
..
from
..
".lua : VgD.EffectTypeTrigger param"
..
name
..
" is not function | nil"
)
local
ftyp
=
type
(
func
)
if
ftyp
==
"nil"
or
ftyp
==
"function"
then
return
false
end
Debug
.
Message
(
"c"
..
self_code
..
" VgD."
..
name
..
" param "
..
key
..
" isn't function | nil"
)
return
true
end
end
return
false
end
return
{
con
=
chk
(
"con"
),
cost
=
chk
(
"cost"
),
tg
=
chk
(
"tg"
),
op
=
chk
(
"op"
)}
end
end
---检查card是否为卡片
---检查并转换 loc 以及 con 用于【起】等模板函数
function
VgF
.
CardLegal
(
card
,
from
,
name
)
function
VgF
.
GetLocCondition
(
loc
,
con
)
if
VgF
.
GetValueType
(
card
)
==
"Card"
then
return
true
end
local
con_exf
=
VgF
.
True
if
VgF
.
GetValueType
(
name
)
==
"string"
and
(
VgF
.
GetValueType
(
from
)
==
"string"
or
VgF
.
GetValueType
(
from
)
==
"number"
)
then
if
loc
==
LOCATION_RZONE
then
Debug
.
Message
(
"c"
..
from
..
".lua : VgD.EffectTypeTrigger param"
..
name
..
" is not card"
)
loc
,
con_exf
=
LOCATION_MZONE
,
VgF
.
RMonsterCondition
elseif
loc
==
LOCATION_VZONE
then
loc
,
con_exf
=
LOCATION_MZONE
,
VgF
.
VMonsterCondition
end
end
return
false
loc
=
loc
or
LOCATION_MZONE
local
condition
=
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
))
and
con_exf
(
e
)
end
return
loc
,
condition
end
end
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