Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
7fa28fbb
Commit
7fa28fbb
authored
Sep 19, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
0da7e25d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
19 deletions
+49
-19
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+1
-0
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+7
-3
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+7
-7
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+34
-9
No files found.
Classes/ocgcore/effect.h
View file @
7fa28fbb
...
@@ -471,6 +471,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -471,6 +471,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_LIMIT_SPECIAL_SUMMON_POSITION 368
#define EFFECT_LIMIT_SPECIAL_SUMMON_POSITION 368
#define EFFECT_TUNER 369
#define EFFECT_TUNER 369
#define EFFECT_KAISER_COLOSSEUM 370
#define EFFECT_KAISER_COLOSSEUM 370
#define EFFECT_REPLACE_DAMAGE 371
//#define EVENT_STARTUP 1000
//#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
#define EVENT_FLIP 1001
...
...
Classes/ocgcore/field.h
View file @
7fa28fbb
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include <unordered_map>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
#define MAX_COIN_COUNT 20
class
card
;
class
card
;
struct
card_data
;
struct
card_data
;
class
duel
;
class
duel
;
...
@@ -315,7 +317,9 @@ struct processor {
...
@@ -315,7 +317,9 @@ struct processor {
uint32
set_group_used_zones
;
uint32
set_group_used_zones
;
uint8
set_group_seq
[
7
];
uint8
set_group_seq
[
7
];
uint8
dice_result
[
5
];
uint8
dice_result
[
5
];
uint8
coin_result
[
5
];
uint8
coin_result
[
MAX_COIN_COUNT
];
int32
coin_count
;
uint8
to_bp
;
uint8
to_bp
;
uint8
to_m2
;
uint8
to_m2
;
uint8
to_ep
;
uint8
to_ep
;
...
@@ -361,7 +365,7 @@ struct processor {
...
@@ -361,7 +365,7 @@ struct processor {
limit_tuner
(
nullptr
),
limit_syn
(
nullptr
),
limit_syn_minc
(
0
),
limit_syn_maxc
(
0
),
limit_xyz
(
nullptr
),
limit_xyz_minc
(
0
),
limit_xyz_maxc
(
0
),
limit_link
(
nullptr
),
limit_link_card
(
nullptr
),
limit_tuner
(
nullptr
),
limit_syn
(
nullptr
),
limit_syn_minc
(
0
),
limit_syn_maxc
(
0
),
limit_xyz
(
nullptr
),
limit_xyz_minc
(
0
),
limit_xyz_maxc
(
0
),
limit_link
(
nullptr
),
limit_link_card
(
nullptr
),
limit_link_minc
(
0
),
limit_link_maxc
(
0
),
not_material
(
FALSE
),
attack_cancelable
(
FALSE
),
attack_rollback
(
FALSE
),
effect_damage_step
(
0
),
battle_damage
{
0
},
summon_count
{
0
},
extra_summon
{
FALSE
},
limit_link_minc
(
0
),
limit_link_maxc
(
0
),
not_material
(
FALSE
),
attack_cancelable
(
FALSE
),
attack_rollback
(
FALSE
),
effect_damage_step
(
0
),
battle_damage
{
0
},
summon_count
{
0
},
extra_summon
{
FALSE
},
spe_effect
{
0
},
duel_options
(
0
),
duel_rule
(
0
),
copy_reset
(
0
),
copy_reset_count
(
0
),
last_control_changed_id
(
0
),
set_group_used_zones
(
0
),
set_group_seq
{
0
},
dice_result
{
0
},
coin_result
{
0
},
spe_effect
{
0
},
duel_options
(
0
),
duel_rule
(
0
),
copy_reset
(
0
),
copy_reset_count
(
0
),
last_control_changed_id
(
0
),
set_group_used_zones
(
0
),
set_group_seq
{
0
},
dice_result
{
0
},
coin_result
{
0
},
to_bp
(
FALSE
),
to_m2
(
FALSE
),
to_ep
(
FALSE
),
skip_m2
(
FALSE
),
chain_attack
(
FALSE
),
chain_attacker_id
(
0
),
chain_attack_target
(
nullptr
),
attack_player
(
PLAYER_NONE
),
selfdes_disabled
(
FALSE
),
coin_count
(
0
),
to_bp
(
FALSE
),
to_m2
(
FALSE
),
to_ep
(
FALSE
),
skip_m2
(
FALSE
),
chain_attack
(
FALSE
),
chain_attacker_id
(
0
),
chain_attack_target
(
nullptr
),
attack_player
(
PLAYER_NONE
),
selfdes_disabled
(
FALSE
),
overdraw
{
FALSE
},
check_level
(
0
),
shuffle_check_disabled
(
FALSE
),
shuffle_hand_check
{
FALSE
},
shuffle_deck_check
{
FALSE
},
deck_reversed
(
FALSE
),
remove_brainwashing
(
FALSE
),
flip_delayed
(
FALSE
),
overdraw
{
FALSE
},
check_level
(
0
),
shuffle_check_disabled
(
FALSE
),
shuffle_hand_check
{
FALSE
},
shuffle_deck_check
{
FALSE
},
deck_reversed
(
FALSE
),
remove_brainwashing
(
FALSE
),
flip_delayed
(
FALSE
),
damage_calculated
(
FALSE
),
hand_adjusted
(
FALSE
),
summon_state_count
{
0
},
normalsummon_state_count
{
0
},
flipsummon_state_count
{
0
},
spsummon_state_count
{
0
},
attack_state_count
{
0
},
damage_calculated
(
FALSE
),
hand_adjusted
(
FALSE
),
summon_state_count
{
0
},
normalsummon_state_count
{
0
},
flipsummon_state_count
{
0
},
spsummon_state_count
{
0
},
attack_state_count
{
0
},
battle_phase_count
{
0
},
battled_count
{
0
},
phase_action
(
FALSE
),
hint_timing
{
0
},
current_player
(
PLAYER_NONE
),
conti_player
(
PLAYER_NONE
)
{}
battle_phase_count
{
0
},
battled_count
{
0
},
phase_action
(
FALSE
),
hint_timing
{
0
},
current_player
(
PLAYER_NONE
),
conti_player
(
PLAYER_NONE
)
{}
...
@@ -629,7 +633,7 @@ public:
...
@@ -629,7 +633,7 @@ public:
int32
select_xyz_material
(
int16
step
,
uint8
playerid
,
uint32
lv
,
card
*
pcard
,
int32
min
,
int32
max
);
int32
select_xyz_material
(
int16
step
,
uint8
playerid
,
uint32
lv
,
card
*
pcard
,
int32
min
,
int32
max
);
int32
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
select_tribute_cards
(
int16
step
,
card
*
target
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint8
toplayer
,
uint32
zone
);
int32
select_tribute_cards
(
int16
step
,
card
*
target
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint8
toplayer
,
uint32
zone
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
int32
count
);
int32
toss_dice
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count1
,
uint8
count2
);
int32
toss_dice
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count1
,
uint8
count2
);
int32
rock_paper_scissors
(
uint16
step
,
uint8
repeat
);
int32
rock_paper_scissors
(
uint16
step
,
uint8
repeat
);
...
...
Classes/ocgcore/libduel.cpp
View file @
7fa28fbb
...
@@ -3973,14 +3973,14 @@ int32 scriptlib::duel_toss_coin(lua_State * L) {
...
@@ -3973,14 +3973,14 @@ int32 scriptlib::duel_toss_coin(lua_State * L) {
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
2
);
if
((
playerid
!=
0
&&
playerid
!=
1
)
||
count
<=
0
)
if
((
playerid
!=
0
&&
playerid
!=
1
)
||
count
==
0
||
count
<
-
1
)
return
0
;
return
0
;
if
(
count
>
5
)
if
(
count
>
MAX_COIN_COUNT
)
count
=
5
;
count
=
MAX_COIN_COUNT
;
pduel
->
game_field
->
add_process
(
PROCESSOR_TOSS_COIN
,
0
,
pduel
->
game_field
->
core
.
reason_effect
,
0
,
(
pduel
->
game_field
->
core
.
reason_player
<<
16
)
+
playerid
,
count
);
pduel
->
game_field
->
add_process
(
PROCESSOR_TOSS_COIN
,
0
,
pduel
->
game_field
->
core
.
reason_effect
,
0
,
(
pduel
->
game_field
->
core
.
reason_player
<<
16
)
+
playerid
,
count
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
duel
*
pduel
=
(
duel
*
)
ctx
;
int32
count
=
(
int32
)
lua_tointeger
(
L
,
2
)
;
int32
count
=
pduel
->
game_field
->
core
.
coin_count
;
for
(
int32
i
=
0
;
i
<
count
;
++
i
)
for
(
int32
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
]);
return
count
;
return
count
;
...
@@ -4027,9 +4027,9 @@ int32 scriptlib::duel_rock_paper_scissors(lua_State * L) {
...
@@ -4027,9 +4027,9 @@ int32 scriptlib::duel_rock_paper_scissors(lua_State * L) {
}
}
int32
scriptlib
::
duel_get_coin_result
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_coin_result
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
for
(
int32
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
]);
return
5
;
return
pduel
->
game_field
->
core
.
coin_count
;
}
}
int32
scriptlib
::
duel_get_dice_result
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_dice_result
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
...
@@ -4040,7 +4040,7 @@ int32 scriptlib::duel_get_dice_result(lua_State * L) {
...
@@ -4040,7 +4040,7 @@ int32 scriptlib::duel_get_dice_result(lua_State * L) {
int32
scriptlib
::
duel_set_coin_result
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_set_coin_result
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
res
;
int32
res
;
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
MAX_COIN_COUNT
;
++
i
)
{
res
=
(
int32
)
lua_tointeger
(
L
,
i
+
1
);
res
=
(
int32
)
lua_tointeger
(
L
,
i
+
1
);
if
(
res
!=
0
&&
res
!=
1
)
if
(
res
!=
0
&&
res
!=
1
)
res
=
0
;
res
=
0
;
...
...
Classes/ocgcore/operations.cpp
View file @
7fa28fbb
...
@@ -6311,7 +6311,11 @@ int32 field::select_tribute_cards(int16 step, card* target, uint8 playerid, uint
...
@@ -6311,7 +6311,11 @@ int32 field::select_tribute_cards(int16 step, card* target, uint8 playerid, uint
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
)
{
int32
field
::
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
int32
count
)
{
if
(
count
==
0
||
count
<
-
1
)
return
TRUE
;
if
(
count
>
MAX_COIN_COUNT
)
count
=
MAX_COIN_COUNT
;
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
effect_set
eset
;
effect_set
eset
;
...
@@ -6323,7 +6327,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
...
@@ -6323,7 +6327,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
e
.
reason
=
0
;
e
.
reason
=
0
;
e
.
reason_effect
=
reason_effect
;
e
.
reason_effect
=
reason_effect
;
e
.
reason_player
=
reason_player
;
e
.
reason_player
=
reason_player
;
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
for
(
int32
i
=
0
;
i
<
MAX_COIN_COUNT
;
++
i
)
core
.
coin_result
[
i
]
=
0
;
core
.
coin_result
[
i
]
=
0
;
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_TOSS_COIN_REPLACE
);
auto
pr
=
effects
.
continuous_effect
.
equal_range
(
EFFECT_TOSS_COIN_REPLACE
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
...
@@ -6335,13 +6339,34 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
...
@@ -6335,13 +6339,34 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
}
}
}
}
if
(
!
peffect
)
{
if
(
!
peffect
)
{
if
(
count
>
0
)
{
pduel
->
write_buffer8
(
MSG_TOSS_COIN
);
pduel
->
write_buffer8
(
MSG_TOSS_COIN
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
pduel
->
write_buffer8
((
uint8
)
count
);
for
(
int32
i
=
0
;
i
<
count
;
++
i
)
{
core
.
coin_count
=
count
;
for
(
int32
i
=
0
;
i
<
count
;
++
i
)
{
core
.
coin_result
[
i
]
=
pduel
->
get_next_integer
(
0
,
1
);
pduel
->
write_buffer8
(
core
.
coin_result
[
i
]);
}
}
else
if
(
count
==
-
1
)
{
core
.
coin_count
=
0
;
for
(
int32
i
=
0
;
i
<
MAX_COIN_COUNT
;
++
i
)
{
core
.
coin_result
[
i
]
=
pduel
->
get_next_integer
(
0
,
1
);
core
.
coin_result
[
i
]
=
pduel
->
get_next_integer
(
0
,
1
);
if
(
!
core
.
coin_result
[
i
])
{
core
.
coin_count
=
i
+
1
;
break
;
}
}
if
(
!
core
.
coin_count
)
core
.
coin_count
==
MAX_COIN_COUNT
;
pduel
->
write_buffer8
(
MSG_TOSS_COIN
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
((
uint8
)
core
.
coin_count
);
for
(
int32
i
=
0
;
i
<
core
.
coin_count
;
++
i
)
{
pduel
->
write_buffer8
(
core
.
coin_result
[
i
]);
pduel
->
write_buffer8
(
core
.
coin_result
[
i
]);
}
}
}
raise_event
((
card
*
)
0
,
EVENT_TOSS_COIN_NEGATE
,
reason_effect
,
0
,
reason_player
,
playerid
,
count
);
raise_event
((
card
*
)
0
,
EVENT_TOSS_COIN_NEGATE
,
reason_effect
,
0
,
reason_player
,
playerid
,
count
);
process_instant_event
();
process_instant_event
();
}
else
{
}
else
{
...
@@ -6352,7 +6377,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
...
@@ -6352,7 +6377,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
raise_event
((
card
*
)
0
,
EVENT_TOSS_COIN
,
reason_effect
,
0
,
reason_player
,
playerid
,
count
);
raise_event
((
card
*
)
0
,
EVENT_TOSS_COIN
,
reason_effect
,
0
,
reason_player
,
playerid
,
co
re
.
coin_co
unt
);
process_instant_event
();
process_instant_event
();
return
TRUE
;
return
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