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
9b4a241e
Commit
9b4a241e
authored
Dec 02, 2024
by
Chen Bill
Committed by
GitHub
Dec 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
card: add filter_effect_container (unordered_set) (#681)
parent
276f504b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
card.cpp
card.cpp
+15
-10
card.h
card.h
+1
-0
No files found.
card.cpp
View file @
9b4a241e
...
@@ -2611,6 +2611,13 @@ void card::filter_effect_container(const effect_container& container, uint32 cod
...
@@ -2611,6 +2611,13 @@ void card::filter_effect_container(const effect_container& container, uint32 cod
eset
.
add_item
(
it
->
second
);
eset
.
add_item
(
it
->
second
);
}
}
}
}
void
card
::
filter_effect_container
(
const
effect_container
&
container
,
uint32
code
,
effect_filter
f
,
effect_collection
&
eset
)
{
auto
rg
=
container
.
equal_range
(
code
);
for
(
auto
it
=
rg
.
first
;
it
!=
rg
.
second
;
++
it
)
{
if
(
f
(
this
,
it
->
second
))
eset
.
insert
(
it
->
second
);
}
}
void
card
::
filter_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
)
{
void
card
::
filter_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
)
{
filter_effect_container
(
single_effect
,
code
,
default_single_filter
,
*
eset
);
filter_effect_container
(
single_effect
,
code
,
default_single_filter
,
*
eset
);
for
(
const
auto
&
pcard
:
equiping_cards
)
for
(
const
auto
&
pcard
:
equiping_cards
)
...
@@ -2865,12 +2872,11 @@ int32 card::check_set_procedure(effect* proc, uint8 playerid, uint8 ignore_count
...
@@ -2865,12 +2872,11 @@ int32 card::check_set_procedure(effect* proc, uint8 playerid, uint8 ignore_count
return
FALSE
;
return
FALSE
;
}
}
void
card
::
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint32
summon_type
,
material_info
info
)
{
void
card
::
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint32
summon_type
,
material_info
info
)
{
auto
pr
=
field_effect
.
equal_range
(
EFFECT_SPSUMMON_PROC
);
effect_collection
proc_set
;
uint8
toplayer
;
filter_effect_container
(
field_effect
,
EFFECT_SPSUMMON_PROC
,
accept_filter
,
proc_set
);
uint8
topos
;
for
(
auto
&
peffect
:
proc_set
)
{
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
uint8
toplayer
{};
effect
*
peffect
=
eit
->
second
;
uint8
topos
{};
++
eit
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
topos
=
(
uint8
)
peffect
->
s_range
;
topos
=
(
uint8
)
peffect
->
s_range
;
if
(
peffect
->
o_range
==
0
)
if
(
peffect
->
o_range
==
0
)
...
@@ -2894,10 +2900,9 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset, uint32 s
...
@@ -2894,10 +2900,9 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset, uint32 s
}
}
}
}
void
card
::
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
peset
)
{
void
card
::
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
peset
)
{
auto
pr
=
field_effect
.
equal_range
(
EFFECT_SPSUMMON_PROC_G
);
effect_collection
proc_set
;
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
filter_effect_container
(
field_effect
,
EFFECT_SPSUMMON_PROC_G
,
accept_filter
,
proc_set
);
effect
*
peffect
=
eit
->
second
;
for
(
auto
&
peffect
:
proc_set
)
{
++
eit
;
if
(
!
peffect
->
is_available
()
||
!
peffect
->
check_count_limit
(
playerid
))
if
(
!
peffect
->
is_available
()
||
!
peffect
->
check_count_limit
(
playerid
))
continue
;
continue
;
if
(
current
.
controler
!=
playerid
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_BOTH_SIDE
))
if
(
current
.
controler
!=
playerid
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_BOTH_SIDE
))
...
...
card.h
View file @
9b4a241e
...
@@ -327,6 +327,7 @@ public:
...
@@ -327,6 +327,7 @@ public:
template
<
typename
T
>
template
<
typename
T
>
void
filter_effect_container
(
const
effect_container
&
container
,
uint32
code
,
effect_filter
f
,
T
&
eset
);
void
filter_effect_container
(
const
effect_container
&
container
,
uint32
code
,
effect_filter
f
,
T
&
eset
);
void
filter_effect_container
(
const
effect_container
&
container
,
uint32
code
,
effect_filter
f
,
effect_collection
&
eset
);
void
filter_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_single_continuous_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_single_continuous_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_self_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_self_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
...
...
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