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
ec522c98
Commit
ec522c98
authored
Feb 22, 2025
by
Chen Bill
Committed by
GitHub
Feb 22, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix EFFECT_COUNT_CODE_SINGLE activation count (#731)
* edit comment * fix EFFECT_COUNT_CODE_SINGLE activation count
parent
90d94e7b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
card.h
card.h
+2
-1
effect.cpp
effect.cpp
+2
-5
effect.h
effect.h
+2
-2
field.cpp
field.cpp
+1
-0
operations.cpp
operations.cpp
+2
-0
No files found.
card.h
View file @
ec522c98
...
@@ -170,7 +170,8 @@ public:
...
@@ -170,7 +170,8 @@ public:
uint8_t
attack_controler
{};
uint8_t
attack_controler
{};
uint64_t
cardid
{};
uint64_t
cardid
{};
uint32_t
fieldid
{};
uint32_t
fieldid
{};
uint32_t
fieldid_r
{};
uint32_t
fieldid_r
{};
//real field id, updated when moving to new location
uint32_t
activate_count_id
{};
//updated when moving to new location or flipping
uint16_t
turnid
{};
uint16_t
turnid
{};
uint16_t
turn_counter
{};
uint16_t
turn_counter
{};
uint8_t
unique_pos
[
2
]{};
uint8_t
unique_pos
[
2
]{};
...
...
effect.cpp
View file @
ec522c98
...
@@ -159,9 +159,6 @@ int32_t effect::is_single_ready() {
...
@@ -159,9 +159,6 @@ int32_t effect::is_single_ready() {
int32_t
res
=
pduel
->
lua
->
check_condition
(
condition
,
1
);
int32_t
res
=
pduel
->
lua
->
check_condition
(
condition
,
1
);
return
res
;
return
res
;
}
}
// reset_count: count of effect reset
// count_limit: left count of activation
// count_limit_max: max count of activation
int32_t
effect
::
check_count_limit
(
uint8_t
playerid
)
{
int32_t
effect
::
check_count_limit
(
uint8_t
playerid
)
{
if
(
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
(
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
(
count_limit
==
0
)
if
(
count_limit
==
0
)
...
@@ -171,7 +168,7 @@ int32_t effect::check_count_limit(uint8_t playerid) {
...
@@ -171,7 +168,7 @@ int32_t effect::check_count_limit(uint8_t playerid) {
uint32_t
limit_type
=
count_code
&
0xf0000000U
;
uint32_t
limit_type
=
count_code
&
0xf0000000U
;
int32_t
count
=
count_limit_max
;
int32_t
count
=
count_limit_max
;
if
(
limit_code
==
EFFECT_COUNT_CODE_SINGLE
)
{
if
(
limit_code
==
EFFECT_COUNT_CODE_SINGLE
)
{
if
(
pduel
->
game_field
->
get_effect_code
(
limit_type
|
get_handler
()
->
field
id
,
PLAYER_NONE
)
>=
count
)
if
(
pduel
->
game_field
->
get_effect_code
(
limit_type
|
get_handler
()
->
activate_count_
id
,
PLAYER_NONE
)
>=
count
)
return
FALSE
;
return
FALSE
;
}
else
{
}
else
{
if
(
pduel
->
game_field
->
get_effect_code
(
count_code
,
playerid
)
>=
count
)
if
(
pduel
->
game_field
->
get_effect_code
(
count_code
,
playerid
)
>=
count
)
...
@@ -680,7 +677,7 @@ void effect::dec_count(uint8_t playerid) {
...
@@ -680,7 +677,7 @@ void effect::dec_count(uint8_t playerid) {
uint32_t
limit_code
=
count_code
&
MAX_CARD_ID
;
uint32_t
limit_code
=
count_code
&
MAX_CARD_ID
;
uint32_t
limit_type
=
count_code
&
0xf0000000
;
uint32_t
limit_type
=
count_code
&
0xf0000000
;
if
(
limit_code
==
EFFECT_COUNT_CODE_SINGLE
)
if
(
limit_code
==
EFFECT_COUNT_CODE_SINGLE
)
pduel
->
game_field
->
add_effect_code
(
limit_type
|
get_handler
()
->
field
id
,
PLAYER_NONE
);
pduel
->
game_field
->
add_effect_code
(
limit_type
|
get_handler
()
->
activate_count_
id
,
PLAYER_NONE
);
else
else
pduel
->
game_field
->
add_effect_code
(
count_code
,
playerid
);
pduel
->
game_field
->
add_effect_code
(
count_code
,
playerid
);
}
}
...
...
effect.h
View file @
ec522c98
...
@@ -40,8 +40,8 @@ public:
...
@@ -40,8 +40,8 @@ public:
uint16_t
range
{
0
};
uint16_t
range
{
0
};
uint16_t
s_range
{
0
};
uint16_t
s_range
{
0
};
uint16_t
o_range
{
0
};
uint16_t
o_range
{
0
};
uint8_t
count_limit
{
0
};
uint8_t
count_limit
{
0
};
//left count of activation
uint8_t
count_limit_max
{
0
};
uint8_t
count_limit_max
{
0
};
//max count of activation
uint16_t
status
{
0
};
uint16_t
status
{
0
};
int32_t
reset_count
{
0
};
int32_t
reset_count
{
0
};
uint32_t
reset_flag
{
0
};
uint32_t
reset_flag
{
0
};
...
...
field.cpp
View file @
ec522c98
...
@@ -183,6 +183,7 @@ void field::add_card(uint8_t playerid, card* pcard, uint8_t location, uint8_t se
...
@@ -183,6 +183,7 @@ void field::add_card(uint8_t playerid, card* pcard, uint8_t location, uint8_t se
pcard
->
apply_field_effect
();
pcard
->
apply_field_effect
();
pcard
->
fieldid
=
infos
.
field_id
++
;
pcard
->
fieldid
=
infos
.
field_id
++
;
pcard
->
fieldid_r
=
pcard
->
fieldid
;
pcard
->
fieldid_r
=
pcard
->
fieldid
;
pcard
->
activate_count_id
=
pcard
->
fieldid
;
if
(
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
location
))
if
(
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
location
))
pcard
->
unique_fieldid
=
UINT_MAX
;
pcard
->
unique_fieldid
=
UINT_MAX
;
pcard
->
turnid
=
infos
.
turn_id
;
pcard
->
turnid
=
infos
.
turn_id
;
...
...
operations.cpp
View file @
ec522c98
...
@@ -2005,6 +2005,7 @@ int32_t field::flip_summon(uint16_t step, uint8_t sumplayer, card * target, uint
...
@@ -2005,6 +2005,7 @@ int32_t field::flip_summon(uint16_t step, uint8_t sumplayer, card * target, uint
target
->
summon_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
target
->
summon_info
|=
SUMMON_TYPE_FLIP
;
target
->
summon_info
|=
SUMMON_TYPE_FLIP
;
target
->
fieldid
=
infos
.
field_id
++
;
target
->
fieldid
=
infos
.
field_id
++
;
target
->
activate_count_id
=
target
->
fieldid
;
core
.
phase_action
=
TRUE
;
core
.
phase_action
=
TRUE
;
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
...
@@ -4909,6 +4910,7 @@ int32_t field::change_position(uint16_t step, group * targets, effect * reason_e
...
@@ -4909,6 +4910,7 @@ int32_t field::change_position(uint16_t step, group * targets, effect * reason_e
core
.
hint_timing
[
pcard
->
current
.
controler
]
|=
TIMING_POS_CHANGE
;
core
.
hint_timing
[
pcard
->
current
.
controler
]
|=
TIMING_POS_CHANGE
;
if
((
opos
&
POS_FACEDOWN
)
&&
(
npos
&
POS_FACEUP
))
{
if
((
opos
&
POS_FACEDOWN
)
&&
(
npos
&
POS_FACEUP
))
{
pcard
->
fieldid
=
infos
.
field_id
++
;
pcard
->
fieldid
=
infos
.
field_id
++
;
pcard
->
activate_count_id
=
pcard
->
fieldid
;
if
(
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
location
))
if
(
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
location
))
pcard
->
unique_fieldid
=
UINT_MAX
;
pcard
->
unique_fieldid
=
UINT_MAX
;
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
...
...
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