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
63e10ceb
Commit
63e10ceb
authored
Jul 11, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
STATUS_EFFECT_ENABLED
parent
8a1ac12b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
16 deletions
+23
-16
card.cpp
card.cpp
+7
-3
effect.cpp
effect.cpp
+12
-9
field.cpp
field.cpp
+2
-2
libduel.cpp
libduel.cpp
+1
-1
operations.cpp
operations.cpp
+1
-1
No files found.
card.cpp
View file @
63e10ceb
...
@@ -1022,9 +1022,11 @@ void card::set_status(uint32 status, int32 enabled) {
...
@@ -1022,9 +1022,11 @@ void card::set_status(uint32 status, int32 enabled) {
else
else
this
->
status
&=
~
status
;
this
->
status
&=
~
status
;
}
}
// match at least 1 status
int32
card
::
get_status
(
uint32
status
)
{
int32
card
::
get_status
(
uint32
status
)
{
return
this
->
status
&
status
;
return
this
->
status
&
status
;
}
}
// match all status
int32
card
::
is_status
(
uint32
status
)
{
int32
card
::
is_status
(
uint32
status
)
{
if
((
this
->
status
&
status
)
==
status
)
if
((
this
->
status
&
status
)
==
status
)
return
TRUE
;
return
TRUE
;
...
@@ -1174,6 +1176,9 @@ void card::cancel_field_effect() {
...
@@ -1174,6 +1176,9 @@ void card::cancel_field_effect() {
if
(
unique_code
&&
(
current
.
location
&
unique_location
))
if
(
unique_code
&&
(
current
.
location
&
unique_location
))
pduel
->
game_field
->
remove_unique_card
(
this
);
pduel
->
game_field
->
remove_unique_card
(
this
);
}
}
// STATUS_EFFECT_ENABLED: the card is ready to use
// false: before moving, summoning, chaining
// true: ready
void
card
::
enable_field_effect
(
bool
enabled
)
{
void
card
::
enable_field_effect
(
bool
enabled
)
{
if
(
current
.
location
==
0
)
if
(
current
.
location
==
0
)
return
;
return
;
...
@@ -1323,9 +1328,8 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
...
@@ -1323,9 +1328,8 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
single_effect
.
erase
(
it
);
single_effect
.
erase
(
it
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
{
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
{
check_target
=
0
;
check_target
=
0
;
if
(
peffect
->
in_range
(
current
.
location
,
current
.
sequence
)
&&
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
))
{
if
(
peffect
->
is_available
()
&&
peffect
->
is_disable_related
())
{
if
(
peffect
->
is_disable_related
())
pduel
->
game_field
->
update_disable_check_list
(
peffect
);
pduel
->
game_field
->
update_disable_check_list
(
peffect
);
}
}
field_effect
.
erase
(
it
);
field_effect
.
erase
(
it
);
if
(
peffect
->
in_range
(
current
.
location
,
current
.
sequence
))
if
(
peffect
->
in_range
(
current
.
location
,
current
.
sequence
))
...
...
effect.cpp
View file @
63e10ceb
...
@@ -76,8 +76,9 @@ int32 effect::is_available() {
...
@@ -76,8 +76,9 @@ int32 effect::is_available() {
return
FALSE
;
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
if
(
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
return
FALSE
;
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
(
handler
->
current
.
location
&
LOCATION_ONFIELD
)
if
(
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
!
handler
->
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
is_flag
(
EFFECT_FLAG_IMMEDIATELY_APPLY
))
&&
(
handler
->
is_position
(
POS_FACEDOWN
)
||
(
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
)
&&
!
is_flag
(
EFFECT_FLAG_IMMEDIATELY_APPLY
))))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
(
handler
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
handler
->
is_position
(
POS_FACEUP
))
return
FALSE
;
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
is_can_be_forbidden
()
&&
owner
->
is_status
(
STATUS_FORBIDDEN
))
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
is_can_be_forbidden
()
&&
owner
->
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
...
@@ -110,6 +111,12 @@ int32 effect::is_available() {
...
@@ -110,6 +111,12 @@ int32 effect::is_available() {
if
(
!
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
{
if
(
!
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
{
if
(
handler
->
current
.
controler
==
PLAYER_NONE
)
if
(
handler
->
current
.
controler
==
PLAYER_NONE
)
return
FALSE
;
return
FALSE
;
if
(
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
return
FALSE
;
if
(
!
handler
->
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
is_flag
(
EFFECT_FLAG_IMMEDIATELY_APPLY
))
return
FALSE
;
if
((
handler
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
handler
->
is_position
(
POS_FACEUP
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
is_can_be_forbidden
()
&&
owner
->
is_status
(
STATUS_FORBIDDEN
))
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
is_can_be_forbidden
()
&&
owner
->
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
if
(
owner
==
handler
&&
is_can_be_forbidden
()
&&
handler
->
get_status
(
STATUS_FORBIDDEN
))
if
(
owner
==
handler
&&
is_can_be_forbidden
()
&&
handler
->
get_status
(
STATUS_FORBIDDEN
))
...
@@ -120,12 +127,6 @@ int32 effect::is_available() {
...
@@ -120,12 +127,6 @@ int32 effect::is_available() {
return
FALSE
;
return
FALSE
;
if
(
handler
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
!
is_flag
(
EFFECT_FLAG_AVAILABLE_BD
))
if
(
handler
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
!
is_flag
(
EFFECT_FLAG_AVAILABLE_BD
))
return
FALSE
;
return
FALSE
;
if
(
!
handler
->
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
is_flag
(
EFFECT_FLAG_IMMEDIATELY_APPLY
))
return
FALSE
;
if
(
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
return
FALSE
;
if
((
handler
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
handler
->
is_position
(
POS_FACEUP
))
return
FALSE
;
}
}
}
}
if
(
!
condition
)
if
(
!
condition
)
...
@@ -236,7 +237,9 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
...
@@ -236,7 +237,9 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
&&
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
&&
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
return
FALSE
;
return
FALSE
;
if
((
handler
->
current
.
location
&
(
LOCATION_ONFIELD
|
LOCATION_REMOVED
)))
{
if
((
handler
->
current
.
location
&
(
LOCATION_ONFIELD
|
LOCATION_REMOVED
)))
{
// effects with EFFECT_FLAG_SET_AVAILABLE can be activated while face-down
// effects which can be activated while face-down:
// 1. effects with EFFECT_FLAG_SET_AVAILABLE
// 2. events with FLIP_SET_AVAILABLE
if
(
!
handler
->
is_position
(
POS_FACEUP
)
&&
!
is_flag
(
EFFECT_FLAG_SET_AVAILABLE
)
&&
(
code
!=
EVENT_FLIP
||
!
(
e
.
event_value
&
(
FLIP_SET_AVAILABLE
>>
16
))))
if
(
!
handler
->
is_position
(
POS_FACEUP
)
&&
!
is_flag
(
EFFECT_FLAG_SET_AVAILABLE
)
&&
(
code
!=
EVENT_FLIP
||
!
(
e
.
event_value
&
(
FLIP_SET_AVAILABLE
>>
16
))))
return
FALSE
;
return
FALSE
;
if
(
handler
->
is_position
(
POS_FACEUP
)
&&
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
))
if
(
handler
->
is_position
(
POS_FACEUP
)
&&
!
handler
->
is_status
(
STATUS_EFFECT_ENABLED
))
...
...
field.cpp
View file @
63e10ceb
...
@@ -1561,7 +1561,7 @@ void field::set_spsummon_counter(uint8 playerid, bool add, bool chain) {
...
@@ -1561,7 +1561,7 @@ void field::set_spsummon_counter(uint8 playerid, bool add, bool chain) {
effect
*
peffect
=
*
iter
;
effect
*
peffect
=
*
iter
;
card
*
pcard
=
peffect
->
handler
;
card
*
pcard
=
peffect
->
handler
;
if
(
add
)
{
if
(
add
)
{
if
(
p
card
->
is_status
(
STATUS_EFFECT_ENABLED
)
&&
!
pcard
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
)
&&
pcard
->
is_position
(
POS_FACEUP
))
{
if
(
p
effect
->
is_available
(
))
{
if
(((
playerid
==
pcard
->
current
.
controler
)
&&
peffect
->
s_range
)
||
((
playerid
!=
pcard
->
current
.
controler
)
&&
peffect
->
o_range
))
{
if
(((
playerid
==
pcard
->
current
.
controler
)
&&
peffect
->
s_range
)
||
((
playerid
!=
pcard
->
current
.
controler
)
&&
peffect
->
o_range
))
{
pcard
->
spsummon_counter
[
playerid
]
++
;
pcard
->
spsummon_counter
[
playerid
]
++
;
if
(
chain
)
if
(
chain
)
...
@@ -1581,7 +1581,7 @@ int32 field::check_spsummon_counter(uint8 playerid, uint8 ct) {
...
@@ -1581,7 +1581,7 @@ int32 field::check_spsummon_counter(uint8 playerid, uint8 ct) {
effect
*
peffect
=
*
iter
;
effect
*
peffect
=
*
iter
;
card
*
pcard
=
peffect
->
handler
;
card
*
pcard
=
peffect
->
handler
;
uint16
val
=
(
uint16
)
peffect
->
value
;
uint16
val
=
(
uint16
)
peffect
->
value
;
if
(
p
card
->
is_status
(
STATUS_EFFECT_ENABLED
)
&&
!
pcard
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
)
&&
pcard
->
is_position
(
POS_FACEUP
))
{
if
(
p
effect
->
is_available
(
))
{
if
(
pcard
->
spsummon_counter
[
playerid
]
+
ct
>
val
)
if
(
pcard
->
spsummon_counter
[
playerid
]
+
ct
>
val
)
return
FALSE
;
return
FALSE
;
}
}
...
...
libduel.cpp
View file @
63e10ceb
...
@@ -632,7 +632,7 @@ int32 scriptlib::duel_return_to_field(lua_State *L) {
...
@@ -632,7 +632,7 @@ int32 scriptlib::duel_return_to_field(lua_State *L) {
pcard
->
enable_field_effect
(
false
);
pcard
->
enable_field_effect
(
false
);
pduel
->
game_field
->
adjust_instant
();
pduel
->
game_field
->
adjust_instant
();
pduel
->
game_field
->
refresh_location_info_instant
();
pduel
->
game_field
->
refresh_location_info_instant
();
pduel
->
game_field
->
move_to_field
(
pcard
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
location
,
pos
,
FALS
E
,
1
);
pduel
->
game_field
->
move_to_field
(
pcard
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
location
,
pos
,
TRU
E
,
1
);
pduel
->
game_field
->
core
.
subunits
.
begin
()
->
type
=
PROCESSOR_MOVETOFIELD_S
;
pduel
->
game_field
->
core
.
subunits
.
begin
()
->
type
=
PROCESSOR_MOVETOFIELD_S
;
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
...
...
operations.cpp
View file @
63e10ceb
...
@@ -3799,7 +3799,7 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
...
@@ -3799,7 +3799,7 @@ int32 field::move_to_field(uint16 step, card * target, uint32 enable, uint32 ret
uint32
flag
;
uint32
flag
;
uint32
lreason
=
(
target
->
current
.
location
==
LOCATION_MZONE
)
?
LOCATION_REASON_CONTROL
:
LOCATION_REASON_TOFIELD
;
uint32
lreason
=
(
target
->
current
.
location
==
LOCATION_MZONE
)
?
LOCATION_REASON_CONTROL
:
LOCATION_REASON_TOFIELD
;
uint32
ct
=
get_useable_count
(
playerid
,
location
,
move_player
,
lreason
,
&
flag
);
uint32
ct
=
get_useable_count
(
playerid
,
location
,
move_player
,
lreason
,
&
flag
);
if
((
ret
==
1
)
&&
(
ct
<=
0
||
target
->
is_
affected_by_effect
(
EFFECT
_FORBIDDEN
)))
{
if
((
ret
==
1
)
&&
(
ct
<=
0
||
target
->
is_
status
(
STATUS
_FORBIDDEN
)))
{
core
.
units
.
begin
()
->
step
=
3
;
core
.
units
.
begin
()
->
step
=
3
;
send_to
(
target
,
core
.
reason_effect
,
REASON_EFFECT
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
core
.
reason_effect
,
REASON_EFFECT
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
return
FALSE
;
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