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
9a36a4ce
Commit
9a36a4ce
authored
Jun 07, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check Kaiser Colosseum in Duel.GetMZoneCount & Duel.GetLocationCountFromEx
parent
deda06c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
2 deletions
+59
-2
field.cpp
field.cpp
+32
-0
field.h
field.h
+3
-0
libduel.cpp
libduel.cpp
+24
-2
No files found.
field.cpp
View file @
9a36a4ce
...
...
@@ -811,6 +811,38 @@ int32 field::get_szone_limit(uint8 playerid, uint8 uplayer, uint32 reason) {
int32
limit
=
max
-
field_used_count
[
used_flag
];
return
limit
;
}
int32
field
::
get_kaiser_limit
(
uint8
playerid
,
card_set
*
using_cards
)
{
if
(
!
is_player_affected_by_effect
(
playerid
,
EFFECT_KAISER_COLOSSEUM
))
return
0xff
;
card_set
oppo_monsters
;
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
)
oppo_monsters
.
insert
(
pcard
);
}
if
(
!
oppo_monsters
.
size
())
return
0xff
;
card_set
self_monsters
;
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
self_monsters
.
insert
(
pcard
);
}
auto
limit
=
oppo_monsters
.
size
()
-
self_monsters
.
size
();
for
(
auto
&
pcard
:
*
using_cards
)
{
if
(
pcard
->
is_location
(
LOCATION_MZONE
))
{
if
(
pcard
->
current
.
controler
==
playerid
)
++
limit
;
else
--
limit
;
}
}
return
limit
;
}
int32
field
::
get_kaiser_limit
(
uint8
playerid
,
card
*
using_card
)
{
card_set
using_cards
;
if
(
using_card
)
using_cards
.
insert
(
using_card
);
return
get_kaiser_limit
(
playerid
,
&
using_cards
);
}
uint32
field
::
get_linked_zone
(
int32
playerid
)
{
uint32
zones
=
0
;
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
...
...
field.h
View file @
9a36a4ce
...
...
@@ -405,6 +405,9 @@ public:
int32
get_spsummonable_count_fromex_rule4
(
card
*
pcard
,
uint8
playerid
,
uint8
uplayer
,
uint32
zone
=
0xff
,
uint32
*
list
=
nullptr
);
int32
get_mzone_limit
(
uint8
playerid
,
uint8
uplayer
,
uint32
reason
);
int32
get_szone_limit
(
uint8
playerid
,
uint8
uplayer
,
uint32
reason
);
int32
get_kaiser_limit
(
uint8
playerid
,
card_set
*
using_cards
);
int32
get_kaiser_limit
(
uint8
playerid
,
card
*
using_card
);
uint32
get_linked_zone
(
int32
playerid
);
uint32
get_rule_zone_fromex
(
int32
playerid
,
card
*
pcard
);
void
filter_must_use_mzone
(
uint8
playerid
,
uint8
uplayer
,
uint32
reason
,
card
*
pcard
,
uint32
*
flag
);
...
...
libduel.cpp
View file @
9a36a4ce
...
...
@@ -2009,7 +2009,18 @@ int32 scriptlib::duel_get_mzone_count(lua_State *L) {
if
(
lua_gettop
(
L
)
>=
5
)
zone
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
list
=
0
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count
(
nullptr
,
playerid
,
LOCATION_MZONE
,
uplayer
,
reason
,
zone
,
&
list
));
auto
count
=
pduel
->
game_field
->
get_useable_count
(
nullptr
,
playerid
,
LOCATION_MZONE
,
uplayer
,
reason
,
zone
,
&
list
);
if
(
uplayer
==
playerid
&&
reason
==
LOCATION_REASON_TOFIELD
)
{
uint32
kaiser_limit
=
0xff
;
if
(
mcard
)
{
kaiser_limit
=
pduel
->
game_field
->
get_kaiser_limit
(
playerid
,
mcard
);
}
else
if
(
mgroup
)
{
kaiser_limit
=
pduel
->
game_field
->
get_kaiser_limit
(
playerid
,
&
mgroup
->
container
);
}
if
(
kaiser_limit
<
count
)
count
=
kaiser_limit
;
}
lua_pushinteger
(
L
,
count
);
lua_pushinteger
(
L
,
list
);
if
(
swapped
)
{
pduel
->
game_field
->
player
[
0
].
used_location
=
used_location
[
0
];
...
...
@@ -2079,7 +2090,18 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
if
(
lua_gettop
(
L
)
>=
5
)
zone
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
list
=
0
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_useable_count_fromex
(
scard
,
playerid
,
uplayer
,
zone
,
&
list
));
auto
count
=
pduel
->
game_field
->
get_useable_count_fromex
(
scard
,
playerid
,
uplayer
,
zone
,
&
list
);
if
(
uplayer
==
playerid
&&
reason
==
LOCATION_REASON_TOFIELD
)
{
uint32
kaiser_limit
=
0xff
;
if
(
mcard
)
{
kaiser_limit
=
pduel
->
game_field
->
get_kaiser_limit
(
playerid
,
mcard
);
}
else
if
(
mgroup
)
{
kaiser_limit
=
pduel
->
game_field
->
get_kaiser_limit
(
playerid
,
&
mgroup
->
container
);
}
if
(
kaiser_limit
<
count
)
count
=
kaiser_limit
;
}
lua_pushinteger
(
L
,
count
);
lua_pushinteger
(
L
,
list
);
if
(
swapped
)
{
pduel
->
game_field
->
player
[
0
].
used_location
=
used_location
[
0
];
...
...
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