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
bf0e868b
Commit
bf0e868b
authored
Feb 04, 2026
by
水濑真白
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:mycard/ygopro-core into develop
parents
31031c31
d611c960
Pipeline
#42851
passed with stages
in 2 minutes and 2 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
24 deletions
+32
-24
field.h
field.h
+1
-1
libduel.cpp
libduel.cpp
+9
-4
operations.cpp
operations.cpp
+22
-19
No files found.
field.h
View file @
bf0e868b
...
...
@@ -312,7 +312,7 @@ struct processor {
uint32_t
set_group_used_zones
{
0
};
uint8_t
set_group_seq
[
7
]{};
uint8_t
dice_result
[
5
]{};
uint
8_t
coin_result
[
MAX_COIN_COUNT
]{
};
uint
32_t
coin_result
{
0
};
int32_t
coin_count
{
0
};
bool
is_target_ready
{
false
};
bool
is_gemini_summoning
{
false
};
...
...
libduel.cpp
View file @
bf0e868b
...
...
@@ -4603,7 +4603,7 @@ int32_t scriptlib::duel_toss_coin(lua_State * L) {
duel
*
pduel
=
(
duel
*
)
ctx
;
int32_t
count
=
pduel
->
game_field
->
core
.
coin_count
;
for
(
int32_t
i
=
0
;
i
<
count
;
++
i
)
lua_pushinteger
(
L
,
pduel
->
game_field
->
core
.
coin_result
[
i
]
);
lua_pushinteger
(
L
,
(
pduel
->
game_field
->
core
.
coin_result
>>
i
)
&
1u
);
return
count
;
});
}
...
...
@@ -4649,7 +4649,7 @@ int32_t scriptlib::duel_rock_paper_scissors(lua_State * L) {
int32_t
scriptlib
::
duel_get_coin_result
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
for
(
int32_t
i
=
0
;
i
<
pduel
->
game_field
->
core
.
coin_count
;
++
i
)
lua_pushinteger
(
L
,
pduel
->
game_field
->
core
.
coin_result
[
i
]
);
lua_pushinteger
(
L
,
(
pduel
->
game_field
->
core
.
coin_result
>>
i
)
&
1u
);
return
pduel
->
game_field
->
core
.
coin_count
;
}
int32_t
scriptlib
::
duel_get_dice_result
(
lua_State
*
L
)
{
...
...
@@ -4661,11 +4661,16 @@ int32_t scriptlib::duel_get_dice_result(lua_State * L) {
int32_t
scriptlib
::
duel_set_coin_result
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32_t
res
;
for
(
int32_t
i
=
0
;
i
<
MAX_COIN_COUNT
;
++
i
)
{
auto
coin_count
=
lua_gettop
(
L
);
pduel
->
game_field
->
core
.
coin_result
=
0
;
if
(
coin_count
>
MAX_COIN_COUNT
)
coin_count
=
MAX_COIN_COUNT
;
for
(
int32_t
i
=
0
;
i
<
coin_count
;
++
i
)
{
res
=
(
int32_t
)
lua_tointeger
(
L
,
i
+
1
);
if
(
res
!=
0
&&
res
!=
1
)
res
=
0
;
pduel
->
game_field
->
core
.
coin_result
[
i
]
=
res
;
if
(
res
)
pduel
->
game_field
->
core
.
coin_result
|=
(
1u
<<
i
);
}
return
0
;
}
...
...
operations.cpp
View file @
bf0e868b
...
...
@@ -5422,13 +5422,10 @@ int32_t field::select_synchro_material(int16_t step, uint8_t playerid, card* pca
}
if
(
!
smat
)
return
FALSE
;
--
min
;
--
max
;
core
.
units
.
begin
()
->
arg2
=
min
+
(
max
<<
16
);
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
if
(
pcheck
)
pcheck
->
get_value
(
smat
);
if
(
min
==
0
)
{
if
(
min
==
1
&&
max
==
1
)
{
group
*
pgroup
=
pduel
->
new_group
();
pgroup
->
container
.
insert
(
tuner
);
pgroup
->
container
.
insert
(
smat
);
...
...
@@ -5532,7 +5529,7 @@ int32_t field::select_synchro_material(int16_t step, uint8_t playerid, card* pca
card
*
pm
=
*
cit
;
if
(
start
!=
cit
)
std
::
iter_swap
(
start
,
cit
);
if
(
check_other_synchro_material
(
nsyn
,
lv
,
min
-
1
,
max
-
1
,
mcount
+
1
))
if
(
check_other_synchro_material
(
nsyn
,
lv
,
min
-
mcount
,
max
-
mcount
,
mcount
+
1
))
core
.
select_cards
.
push_back
(
pm
);
if
(
start
!=
cit
)
std
::
iter_swap
(
start
,
cit
);
...
...
@@ -5600,6 +5597,7 @@ int32_t field::select_synchro_material(int16_t step, uint8_t playerid, card* pca
}
case
7
:
{
int32_t
lv
=
pcard
->
get_level
();
int32_t
mcount
=
(
int32_t
)
core
.
must_select_cards
.
size
();
if
(
core
.
global_flag
&
GLOBALFLAG_SCRAP_CHIMERA
)
{
effect
*
peffect
=
nullptr
;
for
(
auto
&
pm
:
core
.
select_cards
)
{
...
...
@@ -5646,7 +5644,7 @@ int32_t field::select_synchro_material(int16_t step, uint8_t playerid, card* pca
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
512
);
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
lv
,
playerid
,
min
,
max
);
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
lv
,
playerid
,
min
-
(
mcount
-
1
),
max
-
(
mcount
-
1
)
);
return
FALSE
;
}
case
8
:
{
...
...
@@ -5674,6 +5672,7 @@ int32_t field::select_synchro_material(int16_t step, uint8_t playerid, card* pca
}
case
10
:
{
int32_t
lv
=
pcard
->
get_level
();
int32_t
mcount
=
(
int32_t
)
core
.
must_select_cards
.
size
();
if
(
returns
.
ivalue
[
0
])
{
effect
*
peffect
=
nullptr
;
for
(
auto
&
pm
:
core
.
select_cards
)
{
...
...
@@ -5699,7 +5698,7 @@ int32_t field::select_synchro_material(int16_t step, uint8_t playerid, card* pca
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
512
);
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
lv
,
playerid
,
min
,
max
);
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
lv
,
playerid
,
min
-
(
mcount
-
1
),
max
-
(
mcount
-
1
)
);
core
.
units
.
begin
()
->
step
=
7
;
return
FALSE
;
}
...
...
@@ -6459,8 +6458,7 @@ int32_t field::toss_coin(uint16_t step, effect * reason_effect, uint8_t reason_p
e
.
reason
=
0
;
e
.
reason_effect
=
reason_effect
;
e
.
reason_player
=
reason_player
;
for
(
int32_t
i
=
0
;
i
<
MAX_COIN_COUNT
;
++
i
)
core
.
coin_result
[
i
]
=
0
;
core
.
coin_result
=
0
;
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_TOSS_COIN_REPLACE
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
effect
*
pe
=
eit
->
second
;
...
...
@@ -6471,32 +6469,38 @@ int32_t field::toss_coin(uint16_t step, effect * reason_effect, uint8_t reason_p
}
}
if
(
!
peffect
)
{
auto
gen_bits
=
[
&
](
int32_t
n
)
->
uint32_t
{
uint32_t
mask
=
(
1u
<<
n
)
-
1u
;
return
(
uint32_t
)
pduel
->
get_next_integer
(
0
,
(
int32_t
)
mask
);
};
if
(
count
>
0
)
{
pduel
->
write_buffer8
(
MSG_TOSS_COIN
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
((
uint8_t
)
count
);
core
.
coin_count
=
count
;
core
.
coin_result
=
gen_bits
(
count
);
for
(
int32_t
i
=
0
;
i
<
count
;
++
i
)
{
core
.
coin_result
[
i
]
=
pduel
->
get_next_integer
(
0
,
1
);
pduel
->
write_buffer8
(
core
.
coin_result
[
i
]);
pduel
->
write_buffer8
((
uint8_t
)((
core
.
coin_result
>>
i
)
&
1u
));
}
}
else
if
(
count
==
-
1
)
{
core
.
coin_count
=
0
;
uint32_t
bits
=
gen_bits
(
MAX_COIN_COUNT
);
int32_t
first_zero
=
-
1
;
for
(
int32_t
i
=
0
;
i
<
MAX_COIN_COUNT
;
++
i
)
{
core
.
coin_result
[
i
]
=
pduel
->
get_next_integer
(
0
,
1
);
if
(
!
core
.
coin_result
[
i
])
{
core
.
coin_count
=
i
+
1
;
if
(((
bits
>>
i
)
&
1u
)
==
0u
)
{
first_zero
=
i
;
break
;
}
}
if
(
!
core
.
coin_count
)
core
.
coin_count
=
MAX_COIN_COUNT
;
core
.
coin_count
=
(
first_zero
==
-
1
)
?
MAX_COIN_COUNT
:
(
first_zero
+
1
);
core
.
coin_result
=
bits
;
pduel
->
write_buffer8
(
MSG_TOSS_COIN
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
((
uint8_t
)
core
.
coin_count
);
for
(
int32_t
i
=
0
;
i
<
core
.
coin_count
;
++
i
)
{
pduel
->
write_buffer8
(
core
.
coin_result
[
i
]
);
pduel
->
write_buffer8
(
(
uint8_t
)((
core
.
coin_result
>>
i
)
&
1u
)
);
}
}
raise_event
(
nullptr
,
EVENT_TOSS_COIN_NEGATE
,
reason_effect
,
0
,
reason_player
,
playerid
,
count
);
...
...
@@ -6528,8 +6532,7 @@ int32_t field::toss_dice(uint16_t step, effect * reason_effect, uint8_t reason_p
e
.
reason
=
0
;
e
.
reason_effect
=
reason_effect
;
e
.
reason_player
=
reason_player
;
for
(
int32_t
i
=
0
;
i
<
5
;
++
i
)
core
.
dice_result
[
i
]
=
0
;
memset
(
core
.
dice_result
,
0
,
sizeof
(
core
.
dice_result
));
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_TOSS_DICE_REPLACE
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
effect
*
pe
=
eit
->
second
;
...
...
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