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
3ea372fb
Commit
3ea372fb
authored
Dec 01, 2019
by
nekrozar
Committed by
mercury233
Dec 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.IsCanOverlay (#244)
parent
ad1b62b1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
0 deletions
+22
-0
card.cpp
card.cpp
+9
-0
card.h
card.h
+1
-0
interpreter.cpp
interpreter.cpp
+1
-0
libcard.cpp
libcard.cpp
+10
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
card.cpp
View file @
3ea372fb
...
...
@@ -3700,6 +3700,15 @@ int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) {
}
return
TRUE
;
}
int32
card
::
is_capable_overlay
(
uint8
playerid
)
{
if
(
data
.
type
&
TYPE_TOKEN
)
return
FALSE
;
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
)
&&
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
if
(
current
.
controler
!=
playerid
&&
!
is_capable_change_control
())
return
FALSE
;
return
TRUE
;
}
int32
card
::
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
)
{
if
(
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
...
...
card.h
View file @
3ea372fb
...
...
@@ -342,6 +342,7 @@ public:
int32
is_control_can_be_changed
(
int32
ignore_mzone
,
uint32
zone
);
int32
is_capable_be_battle_target
(
card
*
pcard
);
int32
is_capable_be_effect_target
(
effect
*
peffect
,
uint8
playerid
);
int32
is_capable_overlay
(
uint8
playerid
);
int32
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
);
int32
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
=
0
);
int32
is_can_be_ritual_material
(
card
*
scard
);
...
...
interpreter.cpp
View file @
3ea372fb
...
...
@@ -242,6 +242,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsCanTurnSet"
,
scriptlib
::
card_is_can_turn_set
},
{
"IsCanAddCounter"
,
scriptlib
::
card_is_can_add_counter
},
{
"IsCanRemoveCounter"
,
scriptlib
::
card_is_can_remove_counter
},
{
"IsCanOverlay"
,
scriptlib
::
card_is_can_overlay
},
{
"IsCanBeFusionMaterial"
,
scriptlib
::
card_is_can_be_fusion_material
},
{
"IsCanBeSynchroMaterial"
,
scriptlib
::
card_is_can_be_synchro_material
},
{
"IsCanBeRitualMaterial"
,
scriptlib
::
card_is_can_be_ritual_material
},
...
...
libcard.cpp
View file @
3ea372fb
...
...
@@ -2725,6 +2725,16 @@ int32 scriptlib::card_is_can_remove_counter(lua_State *L) {
lua_pushboolean
(
L
,
pcard
->
pduel
->
game_field
->
is_player_can_remove_counter
(
playerid
,
pcard
,
0
,
0
,
countertype
,
count
,
reason
));
return
1
;
}
int32
scriptlib
::
card_is_can_overlay
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint8
playerid
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>
1
&&
!
lua_isnil
(
L
,
2
))
playerid
=
lua_tointeger
(
L
,
2
);
lua_pushboolean
(
L
,
pcard
->
is_capable_overlay
(
playerid
));
return
1
;
}
int32
scriptlib
::
card_is_can_be_fusion_material
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
scriptlib.h
View file @
3ea372fb
...
...
@@ -246,6 +246,7 @@ public:
static
int32
card_is_can_turn_set
(
lua_State
*
L
);
static
int32
card_is_can_add_counter
(
lua_State
*
L
);
static
int32
card_is_can_remove_counter
(
lua_State
*
L
);
static
int32
card_is_can_overlay
(
lua_State
*
L
);
static
int32
card_is_can_be_fusion_material
(
lua_State
*
L
);
static
int32
card_is_can_be_synchro_material
(
lua_State
*
L
);
static
int32
card_is_can_be_ritual_material
(
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