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
a076361f
Commit
a076361f
authored
Feb 27, 2025
by
whenmo
Committed by
GitHub
Feb 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add card lib function
parent
444dd3a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
5 deletions
+70
-5
vgfuncLib.lua
vgfuncLib.lua
+70
-5
No files found.
vgfuncLib.lua
View file @
a076361f
...
...
@@ -733,7 +733,34 @@ function Card.IsAbleToGCircle(c)
return
false
end
---判断c是否在当前区域的某(几)个编号上
function
Card
.
IsTrigger
(
c
,
skill
)
return
c
:
IsRace
(
skill
)
end
Card
.
IsAbleToBind
=
Card
.
IsAbleToRemove
Card
.
IsAbleToBindAsCost
=
Card
.
IsAbleToRemoveAsCost
---返回卡片 c 是不是先导者。
---@param c Card 要判断的卡
---@return boolean 指示是否是先导者
function
Card
.
IsVanguard
(
c
)
return
c
:
GetSequence
()
==
5
end
---返回卡片 c 是不是后防者。
---@param c Card 要判断的卡
---@return boolean 指示是否是后防者
function
Card
.
IsRearguard
(
c
)
return
c
:
GetSequence
()
<
5
end
---返回卡片 c 召唤类型是不是V
function
Card
.
IsSummonTypeV
(
c
)
return
c
:
IsSummonType
(
SUMMON_TYPE_RIDE
)
or
c
:
IsSummonType
(
SUMMON_TYPE_SELFRIDE
)
end
---返回卡片 c 召唤类型是不是R
function
Card
.
IsSummonTypeR
(
c
)
return
not
c
:
IsSummonTypeV
()
end
---返回卡片 c 是否在当前区域的某(几)个编号上
---@param c Card 要判断的卡
---@param ... number 编号
---@return boolean 指示是否在给定编号上
...
...
@@ -745,13 +772,51 @@ function Card.IsSequence(c, ...)
end
return
false
end
---返回卡片 c 是否在前列。
---@param c Card 要判断的卡
---@return boolean 指示c是否是前列的单位
function
Card
.
IsFrontrow
(
c
)
return
c
:
IsSequence
(
0
,
5
,
4
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
---返回卡片 c 是否在后列。
---@param c Card 要判断的卡
---@return boolean 指示c是否是后列的单位
function
Card
.
IsBackrow
(
c
)
return
c
:
IsSequence
(
1
,
2
,
3
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
---返回卡片 c 技能是否是 skill
---@param c Card 要判断的卡
---@param skill number 要判断的技能
---@return boolean 卡片 c 技能是否是 skill
function
Card
.
IsSkill
(
c
,
skill
)
return
c
:
IsAttribute
(
skill
)
end
function
Card
.
IsTrigger
(
c
,
skill
)
return
c
:
IsRace
(
skill
)
---返回卡片 c 是否可以以规则的手段到G区域。
---@param c Card 要判断的卡
---@return boolean 卡片 c 是否可以以规则的手段到G区域。
function
Card
.
IsAbleToGZone
(
c
)
if
c
:
IsLocation
(
LOCATION_HAND
)
and
c
:
IsType
(
TYPE_MONSTER
)
then
return
true
end
return
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsSkill
(
SKILL_BLOCK
)
and
c
:
IsSequence
(
0
,
4
)
and
c
:
IsFaceup
()
end
---返回卡片 c 是否可以被玩家 tp 用效果 e[以 calltyp 方式和 callpos 表示形式] Call 到玩家 tp [的区域 zone]
---@param c Card 要判断的卡
---@param e Effect 效果
---@param calltyp number|nil Call 方式
---@param callpos number|nil 表示形式
---@param zone any|nil 区域
---@return boolean 返回卡片 c 是否可以被玩家 tp 用效果 e[以 calltyp 方式和 callpos 表示形式] Call 到玩家 tp [的区域 zone]
function
Card
.
IsCanBeCalled
(
c
,
e
,
tp
,
calltyp
,
callpos
,
zone
)
calltyp
=
calltyp
or
0
callpos
=
callpos
or
POS_FACEUP_ATTACK
if
zone
==
"FromSoulToV"
then
local
_
,
code
=
c
:
GetOriginalCode
()
local
atk
,
def
,
lv
,
race
,
att
=
c
:
GetBaseAttack
(),
c
:
GetBaseDefense
(),
c
:
GetOriginalLevel
(),
c
:
GetOriginalRace
(),
c
:
GetOriginalAttribute
()
return
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
code
,
nil
,
TYPE_MONSTER
+
TYPE_EFFECT
,
atk
,
def
,
lv
,
race
,
att
,
callpos
,
tp
,
calltyp
)
end
if
zone
==
"NoMonster"
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
==
0
then
return
false
end
if
type
(
zone
)
~=
"number"
then
zone
=
0x1f
end
if
VgF
.
GetAvailableLocation
(
tp
,
zone
)
==
0
then
return
false
end
return
loccount
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
calltyp
,
tp
,
false
,
false
,
callpos
,
tp
,
zone
)
end
--Group库自定义函数-----------------------------------------------------------------------
...
...
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