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
35e203de
Commit
35e203de
authored
Apr 18, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
effect:is_activateable()
parent
25e8dd71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
effect.cpp
effect.cpp
+12
-7
No files found.
effect.cpp
View file @
35e203de
...
...
@@ -140,6 +140,7 @@ int32 effect::is_available() {
status
&=
~
EFFECT_STATUS_AVAILABLE
;
return
res
;
}
int32
effect
::
check_count_limit
(
uint8
playerid
)
{
if
(
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
((
reset_count
&
0xf00
)
==
0
)
...
...
@@ -178,6 +179,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if
((
code
<
1134
||
code
>
1136
)
&&
pduel
->
game_field
->
infos
.
phase
==
PHASE_DAMAGE_CAL
&&
!
is_flag
(
EFFECT_FLAG_DAMAGE_CAL
))
return
FALSE
;
}
// additional check for each location
if
(
handler
->
current
.
location
==
LOCATION_HAND
)
{
if
(
handler
->
data
.
type
&
TYPE_MONSTER
)
{
if
(
!
(
handler
->
data
.
type
&
TYPE_PENDULUM
))
...
...
@@ -194,8 +196,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if
((
handler
->
data
.
type
&
TYPE_SPELL
)
&&
(
handler
->
data
.
type
&
TYPE_QUICKPLAY
))
return
FALSE
;
}
}
else
return
FALSE
;
}
// check activate in hand/in set turn
int32
ecode
=
0
;
if
(
handler
->
current
.
location
==
LOCATION_HAND
)
{
if
(
handler
->
data
.
type
&
TYPE_TRAP
)
...
...
@@ -227,7 +229,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return
FALSE
;
if
(
handler
->
is_affected_by_effect
(
EFFECT_CANNOT_TRIGGER
))
return
FALSE
;
}
else
if
(
!
(
type
&
EFFECT_TYPE_CONTINUOUS
))
{
}
else
if
(
!
(
type
&
EFFECT_TYPE_CONTINUOUS
))
{
if
((
handler
->
data
.
type
&
TYPE_MONSTER
)
&&
(
handler
->
current
.
location
&
LOCATION_SZONE
)
&&
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
return
FALSE
;
...
...
@@ -235,7 +238,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if
((
handler
->
current
.
location
&
(
LOCATION_ONFIELD
|
LOCATION_REMOVED
))
&&
!
is_flag
(
EFFECT_FLAG_SET_AVAILABLE
)
&&
(
code
!=
EVENT_FLIP
||
!
(
e
.
event_value
&
(
FLIP_SET_AVAILABLE
>>
16
)))
&&
(
!
handler
->
is_position
(
POS_FACEUP
)
||
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
)
))
&&
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
))
return
FALSE
;
if
(
!
(
type
&
(
EFFECT_TYPE_FLIP
|
EFFECT_TYPE_TRIGGER_F
))
&&
!
((
type
&
EFFECT_TYPE_SINGLE
)
&&
(
code
==
EVENT_TO_GRAVE
||
code
==
EVENT_DESTROYED
||
code
==
EVENT_SPSUMMON_SUCCESS
||
code
==
EVENT_TO_HAND
)))
{
...
...
@@ -252,11 +255,12 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return
FALSE
;
if
(
handler
->
is_affected_by_effect
(
EFFECT_CANNOT_TRIGGER
))
return
FALSE
;
}
else
{
}
else
{
if
(
!
is_flag
(
EFFECT_FLAG_AVAILABLE_BD
)
&&
(
type
&
EFFECT_TYPE_FIELD
)
&&
handler
->
is_status
(
STATUS_BATTLE_DESTROYED
))
return
FALSE
;
if
(((
type
&
EFFECT_TYPE_FIELD
)
||
((
type
&
EFFECT_TYPE_SINGLE
)
&&
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)))
&&
(
handler
->
current
.
location
&
LOCATION_ONFIELD
)
&&
(
!
handler
->
is_position
(
POS_FACEUP
)
||
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
)
))
&&
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
))
return
FALSE
;
if
((
type
&
EFFECT_TYPE_SINGLE
)
&&
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
return
FALSE
;
...
...
@@ -269,7 +273,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if
(
handler
==
owner
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
handler
->
is_status
(
STATUS_DISABLED
))
return
FALSE
;
}
}
else
{
}
else
{
if
((
get_owner_player
()
!=
playerid
)
&&
!
is_flag
(
EFFECT_FLAG_BOTH_SIDE
))
return
FALSE
;
}
...
...
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