Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
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
MyCard
ygopro-core
Commits
ba75473a
Commit
ba75473a
authored
Apr 23, 2018
by
Aephiex
Committed by
nanahira
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Effect.UseCountLimit and Effect.CheckCountLimit (#151)
parent
c500b776
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
interpreter.cpp
interpreter.cpp
+2
-0
libeffect.cpp
libeffect.cpp
+28
-0
scriptlib.h
scriptlib.h
+2
-0
No files found.
interpreter.cpp
View file @
ba75473a
...
...
@@ -316,6 +316,8 @@ static const struct luaL_Reg effectlib[] = {
{
"IsActivated"
,
scriptlib
::
effect_is_activated
},
{
"GetActivateLocation"
,
scriptlib
::
effect_get_activate_location
},
{
"GetActivateSequence"
,
scriptlib
::
effect_get_activate_sequence
},
{
"CheckCountLimit"
,
scriptlib
::
effect_check_count_limit
},
{
"UseCountLimit"
,
scriptlib
::
effect_use_count_limit
},
{
NULL
,
NULL
}
};
...
...
libeffect.cpp
View file @
ba75473a
...
...
@@ -530,3 +530,31 @@ int32 scriptlib::effect_get_activate_sequence(lua_State *L) {
lua_pushinteger
(
L
,
peffect
->
active_sequence
);
return
1
;
}
int32
scriptlib
::
effect_check_count_limit
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
p
=
lua_tointeger
(
L
,
2
);
lua_pushboolean
(
L
,
peffect
->
check_count_limit
(
p
));
return
1
;
}
int32
scriptlib
::
effect_use_count_limit
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
p
=
lua_tointeger
(
L
,
2
);
uint32
count
=
1
;
uint32
oath_only
=
0
;
uint32
code
=
peffect
->
count_code
;
if
(
lua_gettop
(
L
)
>
2
)
{
count
=
lua_tointeger
(
L
,
3
);
if
(
lua_gettop
(
L
)
>
3
)
oath_only
=
lua_toboolean
(
L
,
4
);
}
if
(
!
oath_only
||
code
&
EFFECT_COUNT_CODE_OATH
)
while
(
count
)
{
peffect
->
dec_count
(
p
);
count
--
;
}
return
0
;
}
scriptlib.h
View file @
ba75473a
...
...
@@ -316,6 +316,8 @@ public:
static
int32
effect_is_activated
(
lua_State
*
L
);
static
int32
effect_get_activate_location
(
lua_State
*
L
);
static
int32
effect_get_activate_sequence
(
lua_State
*
L
);
static
int32
effect_check_count_limit
(
lua_State
*
L
);
static
int32
effect_use_count_limit
(
lua_State
*
L
);
//Group functions
static
int32
group_new
(
lua_State
*
L
);
...
...
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