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
8404ec95
Commit
8404ec95
authored
Jul 02, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using card_vector in global
parent
d5158743
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
16 deletions
+13
-16
card.cpp
card.cpp
+1
-1
card.h
card.h
+1
-1
field.h
field.h
+0
-3
libcard.cpp
libcard.cpp
+2
-2
libduel.cpp
libduel.cpp
+3
-3
libgroup.cpp
libgroup.cpp
+4
-4
ocgapi.cpp
ocgapi.cpp
+2
-2
No files found.
card.cpp
View file @
8404ec95
...
...
@@ -1584,7 +1584,7 @@ void card::xyz_overlay(card_set* materials) {
if
(
materials
->
size
()
==
0
)
return
;
card_set
des
,
leave_grave
,
leave_deck
;
field
::
card_vector
cv
;
card_vector
cv
;
for
(
auto
&
pcard
:
*
materials
)
cv
.
push_back
(
pcard
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
...
...
card.h
View file @
8404ec95
...
...
@@ -25,6 +25,7 @@ class group;
struct
chain
;
using
card_set
=
std
::
set
<
card
*
,
card_sort
>
;
using
card_vector
=
std
::
vector
<
card
*>
;
struct
card_state
{
uint32
code
{
0
};
...
...
@@ -115,7 +116,6 @@ public:
return
std
::
hash
<
uint16
>
()(
v
.
second
);
}
};
using
card_vector
=
std
::
vector
<
card
*>
;
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
using
effect_indexer
=
std
::
unordered_map
<
effect
*
,
effect_container
::
iterator
>
;
using
effect_relation
=
std
::
unordered_set
<
std
::
pair
<
effect
*
,
uint16
>
,
effect_relation_hash
>
;
...
...
field.h
View file @
8404ec95
...
...
@@ -78,7 +78,6 @@ struct chain {
};
struct
player_info
{
using
card_vector
=
std
::
vector
<
card
*>
;
int32
lp
{
0
};
int32
start_count
{
0
};
int32
draw_count
{
0
};
...
...
@@ -170,7 +169,6 @@ union return_value {
};
struct
processor
{
using
effect_vector
=
std
::
vector
<
effect
*>
;
using
card_vector
=
std
::
vector
<
card
*>
;
using
option_vector
=
std
::
vector
<
uint32
>
;
using
card_list
=
std
::
list
<
card
*>
;
using
event_list
=
std
::
list
<
tevent
>
;
...
...
@@ -365,7 +363,6 @@ class field {
public:
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
using
effect_vector
=
std
::
vector
<
effect
*>
;
using
card_vector
=
std
::
vector
<
card
*>
;
using
card_list
=
std
::
list
<
card
*>
;
using
event_list
=
std
::
list
<
tevent
>
;
using
chain_list
=
std
::
list
<
chain
>
;
...
...
libcard.cpp
View file @
8404ec95
...
...
@@ -2535,7 +2535,7 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
lua_pushboolean
(
L
,
0
);
return
1
;
}
field
::
card_vector
cv
;
card_vector
cv
;
pduel
->
game_field
->
get_attack_target
(
attacker
,
&
cv
,
TRUE
);
if
(
cv
.
size
()
==
0
&&
(
monsteronly
||
attacker
->
direct_attackable
==
0
))
lua_pushboolean
(
L
,
0
);
...
...
@@ -3260,7 +3260,7 @@ int32 scriptlib::card_get_attackable_target(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pcard
->
pduel
;
field
::
card_vector
targets
;
card_vector
targets
;
uint8
chain_attack
=
FALSE
;
if
(
pduel
->
game_field
->
core
.
chain_attacker_id
==
pcard
->
fieldid
)
chain_attack
=
TRUE
;
...
...
libduel.cpp
View file @
8404ec95
...
...
@@ -1674,7 +1674,7 @@ int32 scriptlib::duel_change_attack_target(lua_State *L) {
lua_pushboolean
(
L
,
0
);
return
1
;
}
field
::
card_vector
cv
;
card_vector
cv
;
pduel
->
game_field
->
get_attack_target
(
attacker
,
&
cv
,
pduel
->
game_field
->
core
.
chain_attack
);
if
(
target
&&
std
::
find
(
cv
.
begin
(),
cv
.
end
(),
target
)
!=
cv
.
end
()
||
!
target
&&
!
attacker
->
is_affected_by_effect
(
EFFECT_CANNOT_DIRECT_ATTACK
))
{
...
...
@@ -1975,7 +1975,7 @@ int32 scriptlib::duel_get_mzone_count(lua_State *L) {
card
*
mcard
=
nullptr
;
group
*
mgroup
=
nullptr
;
uint32
used_location
[
2
]
=
{
0
,
0
};
player_info
::
card_vector
list_mzone
[
2
];
card_vector
list_mzone
[
2
];
if
(
lua_gettop
(
L
)
>=
2
&&
!
lua_isnil
(
L
,
2
))
{
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
2
,
TRUE
))
{
mcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
...
...
@@ -2034,7 +2034,7 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
card
*
mcard
=
nullptr
;
group
*
mgroup
=
nullptr
;
uint32
used_location
[
2
]
=
{
0
,
0
};
player_info
::
card_vector
list_mzone
[
2
];
card_vector
list_mzone
[
2
];
if
(
lua_gettop
(
L
)
>=
3
&&
!
lua_isnil
(
L
,
3
))
{
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
3
,
TRUE
))
{
mcard
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
...
...
libgroup.cpp
View file @
8404ec95
...
...
@@ -448,7 +448,7 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
if
(
max
<
min
)
max
=
min
;
int32
extraargs
=
lua_gettop
(
L
)
-
5
;
field
::
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
int32
mcount
=
(
int32
)
cv
.
size
();
for
(
auto
&
pcard
:
pgroup
->
container
)
{
auto
it
=
std
::
find
(
pduel
->
game_field
->
core
.
must_select_cards
.
begin
(),
pduel
->
game_field
->
core
.
must_select_cards
.
end
(),
pcard
);
...
...
@@ -486,7 +486,7 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
auto
it
=
std
::
remove
(
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
(),
pcard
);
pduel
->
game_field
->
core
.
select_cards
.
erase
(
it
,
pduel
->
game_field
->
core
.
select_cards
.
end
());
}
field
::
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
int32
mcount
=
(
int32
)
cv
.
size
();
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
for
(
auto
&
pcard
:
cv
)
...
...
@@ -519,7 +519,7 @@ int32 scriptlib::group_check_with_sum_greater(lua_State *L) {
duel
*
pduel
=
pgroup
->
pduel
;
int32
acc
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
extraargs
=
lua_gettop
(
L
)
-
3
;
field
::
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
int32
mcount
=
(
int32
)
cv
.
size
();
for
(
auto
&
pcard
:
pgroup
->
container
)
{
auto
it
=
std
::
find
(
pduel
->
game_field
->
core
.
must_select_cards
.
begin
(),
pduel
->
game_field
->
core
.
must_select_cards
.
end
(),
pcard
);
...
...
@@ -549,7 +549,7 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
auto
it
=
std
::
remove
(
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
(),
pcard
);
pduel
->
game_field
->
core
.
select_cards
.
erase
(
it
,
pduel
->
game_field
->
core
.
select_cards
.
end
());
}
field
::
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
card_vector
cv
(
pduel
->
game_field
->
core
.
must_select_cards
);
int32
mcount
=
(
int32
)
cv
.
size
();
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
for
(
auto
&
pcard
:
cv
)
...
...
ocgapi.cpp
View file @
8404ec95
...
...
@@ -185,7 +185,7 @@ extern "C" DECL_DLLEXPORT int32 query_card(intptr_t pduel, uint8 playerid, uint8
if
(
location
&
LOCATION_ONFIELD
)
pcard
=
ptduel
->
game_field
->
get_field_card
(
playerid
,
location
,
sequence
);
else
{
field
::
card_vector
*
lst
=
nullptr
;
card_vector
*
lst
=
nullptr
;
if
(
location
==
LOCATION_HAND
)
lst
=
&
ptduel
->
game_field
->
player
[
playerid
].
list_hand
;
else
if
(
location
==
LOCATION_GRAVE
)
...
...
@@ -269,7 +269,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid,
}
}
else
{
field
::
card_vector
*
lst
=
nullptr
;
card_vector
*
lst
=
nullptr
;
if
(
location
==
LOCATION_HAND
)
lst
=
&
player
.
list_hand
;
else
if
(
location
==
LOCATION_GRAVE
)
...
...
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