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
189e3a1b
Commit
189e3a1b
authored
Oct 01, 2024
by
Chen Bill
Committed by
GitHub
Oct 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change effect::type to uint32, fix effect_sort_id (#631)
* change effect::type to uint32 * fix effect_sort_id()
parent
614ee807
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
effect.cpp
effect.cpp
+7
-0
effect.h
effect.h
+2
-1
No files found.
effect.cpp
View file @
189e3a1b
...
@@ -12,6 +12,10 @@
...
@@ -12,6 +12,10 @@
#include "interpreter.h"
#include "interpreter.h"
bool
effect_sort_id
(
const
effect
*
e1
,
const
effect
*
e2
)
{
bool
effect_sort_id
(
const
effect
*
e1
,
const
effect
*
e2
)
{
int32
is_single1
=
e1
->
is_iniital_single
();
int32
is_single2
=
e2
->
is_iniital_single
();
if
(
is_single1
!=
is_single2
)
return
is_single1
>
is_single2
;
return
e1
->
id
<
e2
->
id
;
return
e1
->
id
<
e2
->
id
;
}
}
// return: code is an event reserved for EFFECT_TYPE_CONTINUOUS or not
// return: code is an event reserved for EFFECT_TYPE_CONTINUOUS or not
...
@@ -615,6 +619,9 @@ int32 effect::is_chainable(uint8 tp) {
...
@@ -615,6 +619,9 @@ int32 effect::is_chainable(uint8 tp) {
int32
effect
::
is_hand_trigger
()
const
{
int32
effect
::
is_hand_trigger
()
const
{
return
(
range
&
LOCATION_HAND
)
&&
(
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
get_code_type
()
!=
CODE_PHASE
;
return
(
range
&
LOCATION_HAND
)
&&
(
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
get_code_type
()
!=
CODE_PHASE
;
}
}
int32
effect
::
is_iniital_single
()
const
{
return
(
type
&
EFFECT_TYPE_SINGLE
)
&&
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
is_flag
(
EFFECT_FLAG_INITIAL
);
}
//return: this can be reset by reset_level or not
//return: this can be reset by reset_level or not
//RESET_DISABLE is valid only when owner == handler
//RESET_DISABLE is valid only when owner == handler
int32
effect
::
reset
(
uint32
reset_level
,
uint32
reset_type
)
{
int32
effect
::
reset
(
uint32
reset_level
,
uint32
reset_type
)
{
...
...
effect.h
View file @
189e3a1b
...
@@ -36,7 +36,7 @@ public:
...
@@ -36,7 +36,7 @@ public:
uint32
code
{
0
};
uint32
code
{
0
};
uint32
flag
[
2
]{};
uint32
flag
[
2
]{};
uint32
id
{
0
};
uint32
id
{
0
};
uint
16
type
{
0
};
uint
32
type
{
0
};
uint16
copy_id
{
0
};
uint16
copy_id
{
0
};
uint16
range
{
0
};
uint16
range
{
0
};
uint16
s_range
{
0
};
uint16
s_range
{
0
};
...
@@ -88,6 +88,7 @@ public:
...
@@ -88,6 +88,7 @@ public:
int32
is_immuned
(
card
*
pcard
);
int32
is_immuned
(
card
*
pcard
);
int32
is_chainable
(
uint8
tp
);
int32
is_chainable
(
uint8
tp
);
int32
is_hand_trigger
()
const
;
int32
is_hand_trigger
()
const
;
int32
is_iniital_single
()
const
;
int32
reset
(
uint32
reset_level
,
uint32
reset_type
);
int32
reset
(
uint32
reset_level
,
uint32
reset_type
);
void
dec_count
(
uint8
playerid
=
PLAYER_NONE
);
void
dec_count
(
uint8
playerid
=
PLAYER_NONE
);
void
recharge
();
void
recharge
();
...
...
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