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
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
nanahira
ygopro-core
Commits
a9b84ac6
Commit
a9b84ac6
authored
Sep 04, 2022
by
salix5
Committed by
GitHub
Sep 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.IsCanBeDisabledByEffect() (#469)
parent
00cf6b81
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
card.cpp
card.cpp
+9
-0
card.h
card.h
+1
-0
libcard.cpp
libcard.cpp
+10
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
card.cpp
View file @
a9b84ac6
...
@@ -3394,6 +3394,15 @@ int32 card::is_affect_by_effect(effect* reason_effect) {
...
@@ -3394,6 +3394,15 @@ int32 card::is_affect_by_effect(effect* reason_effect) {
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_can_be_disabled_by_effect
(
effect
*
reason_effect
)
{
if
(
is_status
(
STATUS_DISABLED
))
return
FALSE
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_DISABLE
))
return
FALSE
;
if
(
!
is_affect_by_effect
(
reason_effect
))
return
FALSE
;
return
TRUE
;
}
int32
card
::
is_destructable
()
{
int32
card
::
is_destructable
()
{
if
(
overlay_target
)
if
(
overlay_target
)
return
FALSE
;
return
FALSE
;
...
...
card.h
View file @
a9b84ac6
...
@@ -351,6 +351,7 @@ public:
...
@@ -351,6 +351,7 @@ public:
int32
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_setable_szone
(
uint8
playerid
,
uint8
ignore_fd
=
0
);
int32
is_setable_szone
(
uint8
playerid
,
uint8
ignore_fd
=
0
);
int32
is_affect_by_effect
(
effect
*
reason_effect
);
int32
is_affect_by_effect
(
effect
*
reason_effect
);
int32
is_can_be_disabled_by_effect
(
effect
*
reason_effect
);
int32
is_destructable
();
int32
is_destructable
();
int32
is_destructable_by_battle
(
card
*
pcard
);
int32
is_destructable_by_battle
(
card
*
pcard
);
effect
*
check_indestructable_by_effect
(
effect
*
reason_effect
,
uint8
playerid
);
effect
*
check_indestructable_by_effect
(
effect
*
reason_effect
,
uint8
playerid
);
...
...
libcard.cpp
View file @
a9b84ac6
...
@@ -2971,6 +2971,15 @@ int32 scriptlib::card_is_immune_to_effect(lua_State *L) {
...
@@ -2971,6 +2971,15 @@ int32 scriptlib::card_is_immune_to_effect(lua_State *L) {
lua_pushboolean
(
L
,
!
pcard
->
is_affect_by_effect
(
peffect
));
lua_pushboolean
(
L
,
!
pcard
->
is_affect_by_effect
(
peffect
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_can_be_disabled_by_effect
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
2
);
lua_pushboolean
(
L
,
pcard
->
is_can_be_disabled_by_effect
(
peffect
));
return
1
;
}
int32
scriptlib
::
card_is_can_be_effect_target
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_can_be_effect_target
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
@@ -3474,6 +3483,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -3474,6 +3483,7 @@ static const struct luaL_Reg cardlib[] = {
{
"CheckFusionMaterial"
,
scriptlib
::
card_check_fusion_material
},
{
"CheckFusionMaterial"
,
scriptlib
::
card_check_fusion_material
},
{
"CheckFusionSubstitute"
,
scriptlib
::
card_check_fusion_substitute
},
{
"CheckFusionSubstitute"
,
scriptlib
::
card_check_fusion_substitute
},
{
"IsImmuneToEffect"
,
scriptlib
::
card_is_immune_to_effect
},
{
"IsImmuneToEffect"
,
scriptlib
::
card_is_immune_to_effect
},
{
"IsCanBeDisabledByEffect"
,
scriptlib
::
card_is_can_be_disabled_by_effect
},
{
"IsCanBeEffectTarget"
,
scriptlib
::
card_is_can_be_effect_target
},
{
"IsCanBeEffectTarget"
,
scriptlib
::
card_is_can_be_effect_target
},
{
"IsCanBeBattleTarget"
,
scriptlib
::
card_is_can_be_battle_target
},
{
"IsCanBeBattleTarget"
,
scriptlib
::
card_is_can_be_battle_target
},
{
"AddMonsterAttribute"
,
scriptlib
::
card_add_monster_attribute
},
{
"AddMonsterAttribute"
,
scriptlib
::
card_add_monster_attribute
},
...
...
scriptlib.h
View file @
a9b84ac6
...
@@ -266,6 +266,7 @@ public:
...
@@ -266,6 +266,7 @@ public:
static
int32
card_check_fusion_material
(
lua_State
*
L
);
static
int32
card_check_fusion_material
(
lua_State
*
L
);
static
int32
card_check_fusion_substitute
(
lua_State
*
L
);
static
int32
card_check_fusion_substitute
(
lua_State
*
L
);
static
int32
card_is_immune_to_effect
(
lua_State
*
L
);
static
int32
card_is_immune_to_effect
(
lua_State
*
L
);
static
int32
card_is_can_be_disabled_by_effect
(
lua_State
*
L
);
static
int32
card_is_can_be_effect_target
(
lua_State
*
L
);
static
int32
card_is_can_be_effect_target
(
lua_State
*
L
);
static
int32
card_is_can_be_battle_target
(
lua_State
*
L
);
static
int32
card_is_can_be_battle_target
(
lua_State
*
L
);
static
int32
card_add_monster_attribute
(
lua_State
*
L
);
static
int32
card_add_monster_attribute
(
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