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
6b9b2419
Commit
6b9b2419
authored
Nov 22, 2024
by
Chen Bill
Committed by
GitHub
Nov 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
effect: add enum code_type (#670)
parent
3135a105
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
effect.cpp
effect.cpp
+1
-1
effect.h
effect.h
+10
-6
No files found.
effect.cpp
View file @
6b9b2419
...
...
@@ -863,7 +863,7 @@ uint32 effect::get_active_type(uint8 uselast) {
}
else
return
owner
->
get_type
();
}
int32
effect
::
get_code_type
()
const
{
code_type
effect
::
get_code_type
()
const
{
// start from the highest bit
if
(
code
&
0xf0000000
)
return
CODE_CUSTOM
;
...
...
effect.h
View file @
6b9b2419
...
...
@@ -22,6 +22,9 @@ struct effect_set;
struct
effect_set_v
;
enum
effect_flag
:
uint64
;
enum
effect_flag2
:
uint64
;
enum
code_type
:
int32
;
bool
is_continuous_event
(
uint32
code
);
class
effect
{
public:
...
...
@@ -112,7 +115,7 @@ public:
void
set_activate_location
();
void
set_active_type
();
uint32
get_active_type
(
uint8
uselast
=
TRUE
);
int32
get_code_type
()
const
;
code_type
get_code_type
()
const
;
bool
is_flag
(
effect_flag
x
)
const
{
return
!!
(
flag
[
0
]
&
x
);
...
...
@@ -564,10 +567,12 @@ constexpr int32 HALF_DAMAGE = 0x80000001;
#define MAX_CARD_ID 0xfffffff
// The type of effect code
#define CODE_CUSTOM 1 // header + id (28 bits)
#define CODE_COUNTER 2 // header + counter_id (16 bits)
#define CODE_PHASE 3 // header + phase_id (12 bits)
#define CODE_VALUE 4 // numeric value, max = 4095
enum
code_type
:
int32
{
CODE_CUSTOM
=
1
,
// header + id (28 bits)
CODE_COUNTER
,
// header + counter_id (16 bits)
CODE_PHASE
,
// header + phase_id (12 bits)
CODE_VALUE
,
// numeric value, max = 4095
};
const
std
::
unordered_set
<
uint32
>
continuous_event
{
EVENT_ADJUST
,
...
...
@@ -576,7 +581,6 @@ const std::unordered_set<uint32> continuous_event{
EVENT_PRE_BATTLE_DAMAGE
,
EVENT_SPSUMMON_SUCCESS_G_P
,
};
bool
is_continuous_event
(
uint32
code
);
const
std
::
unordered_set
<
uint32
>
affect_summoning_effect
{
EFFECT_CANNOT_DISABLE_SUMMON
,
...
...
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