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
9530b738
Commit
9530b738
authored
Jul 03, 2024
by
Chen Bill
Committed by
GitHub
Jul 03, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use unsigned in bitwise operator (#608)
parent
b16497d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
+25
-25
card.cpp
card.cpp
+5
-5
card.h
card.h
+16
-16
field.cpp
field.cpp
+4
-4
No files found.
card.cpp
View file @
9530b738
...
@@ -350,7 +350,7 @@ int32 card::get_infos(byte* buf, uint32 query_flag, int32 use_cache) {
...
@@ -350,7 +350,7 @@ int32 card::get_infos(byte* buf, uint32 query_flag, int32 use_cache) {
if
(
query_flag
&
QUERY_COUNTERS
)
{
if
(
query_flag
&
QUERY_COUNTERS
)
{
buffer_write
<
int32_t
>
(
p
,
(
int32_t
)
counters
.
size
());
buffer_write
<
int32_t
>
(
p
,
(
int32_t
)
counters
.
size
());
for
(
const
auto
&
cmit
:
counters
)
{
for
(
const
auto
&
cmit
:
counters
)
{
uint32
tdata
=
cmit
.
first
+
((
uint32
)
cmit
.
second
<<
16
);
uint32
tdata
=
cmit
.
first
|
((
uint32
)
cmit
.
second
<<
16
);
buffer_write
<
uint32_t
>
(
p
,
tdata
);
buffer_write
<
uint32_t
>
(
p
,
tdata
);
}
}
}
}
...
@@ -2156,7 +2156,7 @@ void card::reset(uint32 id, uint32 reset_type) {
...
@@ -2156,7 +2156,7 @@ void card::reset(uint32 id, uint32 reset_type) {
}
}
if
(
id
&
RESET_DISABLE
)
{
if
(
id
&
RESET_DISABLE
)
{
for
(
auto
cmit
=
counters
.
begin
();
cmit
!=
counters
.
end
();)
{
for
(
auto
cmit
=
counters
.
begin
();
cmit
!=
counters
.
end
();)
{
if
(
(
uint32
)
cmit
->
first
&
COUNTER_WITHOUT_PERMIT
)
{
if
(
cmit
->
first
&
COUNTER_WITHOUT_PERMIT
)
{
++
cmit
;
++
cmit
;
continue
;
continue
;
}
}
...
@@ -2410,7 +2410,7 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count,
...
@@ -2410,7 +2410,7 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count,
return
FALSE
;
return
FALSE
;
if
(
!
loc
&&
(
!
(
current
.
location
&
LOCATION_ONFIELD
)
||
!
is_position
(
POS_FACEUP
)))
if
(
!
loc
&&
(
!
(
current
.
location
&
LOCATION_ONFIELD
)
||
!
is_position
(
POS_FACEUP
)))
return
FALSE
;
return
FALSE
;
uint32
check
=
(
uint32
)
countertype
&
COUNTER_WITHOUT_PERMIT
;
uint32
check
=
countertype
&
COUNTER_WITHOUT_PERMIT
;
if
(
!
check
)
{
if
(
!
check
)
{
filter_effect
(
EFFECT_COUNTER_PERMIT
+
countertype
,
&
eset
);
filter_effect
(
EFFECT_COUNTER_PERMIT
+
countertype
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
@@ -2561,7 +2561,7 @@ void card::set_special_summon_status(effect* peffect) {
...
@@ -2561,7 +2561,7 @@ void card::set_special_summon_status(effect* peffect) {
effect_set
eset
;
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_ADD_SETCODE
,
&
eset
);
pcard
->
filter_effect
(
EFFECT_ADD_SETCODE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
spsummon
.
setcode
.
push_back
(
(
uint32
)
eset
[
i
]
->
get_value
(
pcard
)
&
0xffff
);
spsummon
.
setcode
.
push_back
(
eset
[
i
]
->
get_value
(
pcard
)
&
0xffffU
);
}
}
spsummon
.
reason_effect
=
peffect
;
spsummon
.
reason_effect
=
peffect
;
spsummon
.
reason_player
=
peffect
->
get_handler_player
();
spsummon
.
reason_player
=
peffect
->
get_handler_player
();
...
@@ -2580,7 +2580,7 @@ void card::set_special_summon_status(effect* peffect) {
...
@@ -2580,7 +2580,7 @@ void card::set_special_summon_status(effect* peffect) {
effect_set
eset
;
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_ADD_SETCODE
,
&
eset
);
pcard
->
filter_effect
(
EFFECT_ADD_SETCODE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
spsummon
.
setcode
.
push_back
(
(
uint32
)
eset
[
i
]
->
get_value
(
pcard
)
&
0xffff
);
spsummon
.
setcode
.
push_back
(
eset
[
i
]
->
get_value
(
pcard
)
&
0xffffU
);
}
}
spsummon
.
reason_effect
=
cait
->
triggering_effect
;
spsummon
.
reason_effect
=
cait
->
triggering_effect
;
spsummon
.
reason_player
=
cait
->
triggering_player
;
spsummon
.
reason_player
=
cait
->
triggering_player
;
...
...
card.h
View file @
9530b738
...
@@ -393,31 +393,31 @@ public:
...
@@ -393,31 +393,31 @@ public:
};
};
//Summon Type in summon_info
//Summon Type in summon_info
#define SUMMON_TYPE_NORMAL 0x10000000
#define SUMMON_TYPE_NORMAL 0x10000000
U
#define SUMMON_TYPE_ADVANCE 0x11000000
#define SUMMON_TYPE_ADVANCE 0x11000000
U
#define SUMMON_TYPE_FLIP 0x20000000
#define SUMMON_TYPE_FLIP 0x20000000
U
#define SUMMON_TYPE_SPECIAL 0x40000000
#define SUMMON_TYPE_SPECIAL 0x40000000
U
#define SUMMON_TYPE_FUSION 0x43000000
#define SUMMON_TYPE_FUSION 0x43000000
U
#define SUMMON_TYPE_RITUAL 0x45000000
#define SUMMON_TYPE_RITUAL 0x45000000
U
#define SUMMON_TYPE_SYNCHRO 0x46000000
#define SUMMON_TYPE_SYNCHRO 0x46000000
U
#define SUMMON_TYPE_XYZ 0x49000000
#define SUMMON_TYPE_XYZ 0x49000000
U
#define SUMMON_TYPE_PENDULUM 0x4a000000
#define SUMMON_TYPE_PENDULUM 0x4a000000
U
#define SUMMON_TYPE_LINK 0x4c000000
#define SUMMON_TYPE_LINK 0x4c000000
U
//Gemini Summon
//Gemini Summon
#define SUMMON_TYPE_DUAL 0x12000000
#define SUMMON_TYPE_DUAL 0x12000000
U
//bitfield blocks
//bitfield blocks
#define SUMMON_VALUE_MAIN_TYPE 0xf0000000
#define SUMMON_VALUE_MAIN_TYPE 0xf0000000
U
#define SUMMON_VALUE_SUB_TYPE 0x0f000000
#define SUMMON_VALUE_SUB_TYPE 0x0f000000
U
#define SUMMON_VALUE_LOCATION 0x00ff0000
#define SUMMON_VALUE_LOCATION 0x00ff0000
U
#define SUMMON_VALUE_CUSTOM_TYPE 0x0000ffff
#define SUMMON_VALUE_CUSTOM_TYPE 0x0000ffff
U
constexpr
uint32
DEFAULT_SUMMON_TYPE
=
SUMMON_VALUE_MAIN_TYPE
|
SUMMON_VALUE_SUB_TYPE
|
SUMMON_VALUE_CUSTOM_TYPE
;
constexpr
uint32
DEFAULT_SUMMON_TYPE
=
SUMMON_VALUE_MAIN_TYPE
|
SUMMON_VALUE_SUB_TYPE
|
SUMMON_VALUE_CUSTOM_TYPE
;
#define SUMMON_VALUE_FUTURE_FUSION 0x18
#define SUMMON_VALUE_FUTURE_FUSION 0x18
//Counter
//Counter
#define COUNTER_WITHOUT_PERMIT 0x1000
#define COUNTER_WITHOUT_PERMIT 0x1000
U
//#define COUNTER_NEED_ENABLE 0x2000
//#define COUNTER_NEED_ENABLE 0x2000
//Assume
//Assume
...
...
field.cpp
View file @
9530b738
...
@@ -1978,12 +1978,12 @@ void field::get_overlay_group(uint8 self, uint8 s, uint8 o, card_set* pset) {
...
@@ -1978,12 +1978,12 @@ void field::get_overlay_group(uint8 self, uint8 s, uint8 o, card_set* pset) {
}
}
int32
field
::
get_overlay_count
(
uint8
self
,
uint8
s
,
uint8
o
)
{
int32
field
::
get_overlay_count
(
uint8
self
,
uint8
s
,
uint8
o
)
{
uint8
c
=
s
;
uint8
c
=
s
;
u
int32
count
=
0
;
int32
count
=
0
;
for
(
int32
p
=
0
;
p
<
2
;
++
p
)
{
for
(
int32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
c
)
{
if
(
c
)
{
for
(
auto
&
pcard
:
player
[
self
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
self
].
list_mzone
)
{
if
(
pcard
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SPSUMMON_STEP
))
if
(
pcard
&&
!
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SPSUMMON_STEP
))
count
+=
(
u
int32
)
pcard
->
xyz_materials
.
size
();
count
+=
(
int32
)
pcard
->
xyz_materials
.
size
();
}
}
}
}
self
=
1
-
self
;
self
=
1
-
self
;
...
@@ -3034,12 +3034,12 @@ int32 field::is_player_can_draw(uint8 playerid) {
...
@@ -3034,12 +3034,12 @@ int32 field::is_player_can_draw(uint8 playerid) {
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DRAW
);
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DRAW
);
}
}
int32
field
::
is_player_can_discard_deck
(
uint8
playerid
,
int32
count
)
{
int32
field
::
is_player_can_discard_deck
(
uint8
playerid
,
int32
count
)
{
if
(
player
[
playerid
].
list_main
.
size
()
<
(
uint32
)
count
)
if
(
count
<
0
||
(
int32
)
player
[
playerid
].
list_main
.
size
()
<
count
)
return
FALSE
;
return
FALSE
;
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DISCARD_DECK
);
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DISCARD_DECK
);
}
}
int32
field
::
is_player_can_discard_deck_as_cost
(
uint8
playerid
,
int32
count
)
{
int32
field
::
is_player_can_discard_deck_as_cost
(
uint8
playerid
,
int32
count
)
{
if
(
player
[
playerid
].
list_main
.
size
()
<
(
uint32
)
count
)
if
(
count
<
0
||
(
int32
)
player
[
playerid
].
list_main
.
size
()
<
count
)
return
FALSE
;
return
FALSE
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DISCARD_DECK
))
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DISCARD_DECK
))
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