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
e9200055
Commit
e9200055
authored
Jun 30, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update effect_is_activatable
parent
d44b7098
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
effect.cpp
effect.cpp
+2
-2
effect.h
effect.h
+1
-1
libeffect.cpp
libeffect.cpp
+4
-1
No files found.
effect.cpp
View file @
e9200055
...
...
@@ -170,7 +170,7 @@ int32 effect::check_count_limit(uint8 playerid) {
// check if an EFFECT_TYPE_ACTIONS effect can be activated
// for triggering effects, it checks EFFECT_FLAG_DAMAGE_STEP, EFFECT_FLAG_SET_AVAILABLE
// for continuous effect, it checks EFFECT_FLAG_AVAILABLE_BD
int32
effect
::
is_activateable
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
)
{
int32
effect
::
is_activateable
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
,
int32
neglect_loc
)
{
if
(
!
(
type
&
EFFECT_TYPE_ACTIONS
))
return
FALSE
;
if
(
!
check_count_limit
(
playerid
))
...
...
@@ -210,7 +210,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
}
// check activate in hand/in set turn
int32
ecode
=
0
;
if
(
handler
->
current
.
location
==
LOCATION_HAND
)
{
if
(
handler
->
current
.
location
==
LOCATION_HAND
&&
!
neglect_loc
)
{
if
(
handler
->
data
.
type
&
TYPE_TRAP
)
ecode
=
EFFECT_TRAP_ACT_IN_HAND
;
else
if
((
handler
->
data
.
type
&
TYPE_SPELL
)
&&
pduel
->
game_field
->
infos
.
turn_player
!=
playerid
)
{
...
...
effect.h
View file @
e9200055
...
...
@@ -67,7 +67,7 @@ public:
int32
is_can_be_forbidden
();
int32
is_available
();
int32
check_count_limit
(
uint8
playerid
);
int32
is_activateable
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
);
int32
is_activateable
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
,
int32
neglect_loc
=
FALSE
);
int32
is_action_check
(
uint8
playerid
);
int32
is_activate_ready
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
);
int32
is_condition_check
(
uint8
playerid
,
const
tevent
&
e
);
...
...
libeffect.cpp
View file @
e9200055
...
...
@@ -527,7 +527,10 @@ int32 scriptlib::effect_is_activatable(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
uint32
playerid
=
lua_tointeger
(
L
,
2
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
lua_pushboolean
(
L
,
peffect
->
is_activateable
(
playerid
,
peffect
->
pduel
->
game_field
->
nil_event
));
uint32
neglect_loc
=
0
;
if
(
lua_gettop
(
L
)
>
2
)
neglect_loc
=
lua_toboolean
(
L
,
3
);
lua_pushboolean
(
L
,
peffect
->
is_activateable
(
playerid
,
peffect
->
pduel
->
game_field
->
nil_event
,
0
,
0
,
0
,
neglect_loc
));
return
1
;
}
int32
scriptlib
::
effect_is_activated
(
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