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
e53cb0c5
Commit
e53cb0c5
authored
Sep 02, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
b9282b23
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
54 deletions
+49
-54
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+1
-1
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+2
-2
Classes/ocgcore/common.h
Classes/ocgcore/common.h
+2
-0
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+10
-27
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+17
-15
Classes/ocgcore/libdebug.cpp
Classes/ocgcore/libdebug.cpp
+4
-0
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+5
-5
Classes/ocgcore/ocgapi.cpp
Classes/ocgcore/ocgapi.cpp
+6
-2
Classes/ocgcore/ocgapi.h
Classes/ocgcore/ocgapi.h
+1
-1
Classes/ocgcore/scriptlib.h
Classes/ocgcore/scriptlib.h
+1
-1
No files found.
Classes/gframe/game.cpp
View file @
e53cb0c5
...
@@ -958,7 +958,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
...
@@ -958,7 +958,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
ChangeToIGUIImageButton
(
btnShuffleDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnShuffleDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnSortDeck
=
env
->
addButton
(
rect
<
s32
>
((
3
+
CARD_IMG_WIDTH
)
*
yScale
,
115
*
yScale
,
310
*
yScale
,
155
*
yScale
),
0
,
BUTTON_SORT_DECK
,
dataManager
.
GetSysString
(
1305
));
btnSortDeck
=
env
->
addButton
(
rect
<
s32
>
((
3
+
CARD_IMG_WIDTH
)
*
yScale
,
115
*
yScale
,
310
*
yScale
,
155
*
yScale
),
0
,
BUTTON_SORT_DECK
,
dataManager
.
GetSysString
(
1305
));
ChangeToIGUIImageButton
(
btnSortDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnSortDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnClearDeck
=
env
->
addButton
(
rect
<
s32
>
((
3
+
CARD_IMG_WIDTH
)
*
yScale
,
160
*
yScale
,
310
*
yScale
,
20
0
*
yScale
),
0
,
BUTTON_CLEAR_DECK
,
dataManager
.
GetSysString
(
1304
));
btnClearDeck
=
env
->
addButton
(
rect
<
s32
>
((
3
+
CARD_IMG_WIDTH
)
*
yScale
,
200
*
yScale
,
310
*
yScale
,
24
0
*
yScale
),
0
,
BUTTON_CLEAR_DECK
,
dataManager
.
GetSysString
(
1304
));
ChangeToIGUIImageButton
(
btnClearDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnClearDeck
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnDeleteDeck
->
setVisible
(
false
);
btnDeleteDeck
->
setVisible
(
false
);
btnShuffleDeck
->
setVisible
(
false
);
btnShuffleDeck
->
setVisible
(
false
);
...
...
Classes/ocgcore/card.cpp
View file @
e53cb0c5
...
@@ -95,7 +95,7 @@ bool card::card_operation_sort(card* c1, card* c2) {
...
@@ -95,7 +95,7 @@ bool card::card_operation_sort(card* c1, card* c2) {
return
c1
->
overlay_target
->
current
.
sequence
<
c2
->
overlay_target
->
current
.
sequence
;
return
c1
->
overlay_target
->
current
.
sequence
<
c2
->
overlay_target
->
current
.
sequence
;
else
else
return
c1
->
current
.
sequence
<
c2
->
current
.
sequence
;
return
c1
->
current
.
sequence
<
c2
->
current
.
sequence
;
}
else
if
(
c1
->
current
.
location
&
LOCATION_DECK
&&
cp1
==
pduel
->
game_field
->
core
.
selecting_player
&&
!
pduel
->
game_field
->
core
.
select_deck_seq_preserved
)
{
}
else
if
(
c1
->
current
.
location
&
LOCATION_DECK
&&
pduel
->
game_field
->
is_select_hide_deck_sequence
(
cp1
)
)
{
// if deck reversed and the card being at the top, it should go first
// if deck reversed and the card being at the top, it should go first
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
if
(
pduel
->
game_field
->
core
.
deck_reversed
)
{
if
(
c1
->
current
.
sequence
==
pduel
->
game_field
->
player
[
cp1
].
list_main
.
size
()
-
1
)
if
(
c1
->
current
.
sequence
==
pduel
->
game_field
->
player
[
cp1
].
list_main
.
size
()
-
1
)
...
@@ -1511,7 +1511,7 @@ int32 card::is_all_column() {
...
@@ -1511,7 +1511,7 @@ int32 card::is_all_column() {
return
FALSE
;
return
FALSE
;
}
}
uint8
card
::
get_select_sequence
(
uint8
*
deck_seq_pointer
)
{
uint8
card
::
get_select_sequence
(
uint8
*
deck_seq_pointer
)
{
if
(
current
.
location
==
LOCATION_DECK
&&
current
.
controler
==
pduel
->
game_field
->
core
.
selecting_player
&&
!
pduel
->
game_field
->
core
.
select_deck_seq_preserved
)
{
if
(
current
.
location
==
LOCATION_DECK
&&
pduel
->
game_field
->
is_select_hide_deck_sequence
(
current
.
controler
)
)
{
return
(
*
deck_seq_pointer
)
++
;
return
(
*
deck_seq_pointer
)
++
;
}
else
{
}
else
{
return
current
.
sequence
;
return
current
.
sequence
;
...
...
Classes/ocgcore/common.h
View file @
e53cb0c5
...
@@ -43,6 +43,7 @@ typedef signed char int8;
...
@@ -43,6 +43,7 @@ typedef signed char int8;
#define NULL 0
#define NULL 0
#endif
#endif
#define MASTER_RULE3 3 //Master Rule 3 (2014)
#define NEW_MASTER_RULE 4 //New Master Rule (2017)
#define NEW_MASTER_RULE 4 //New Master Rule (2017)
#define MASTER_RULE_2020 5 //Master Rule 2020
#define MASTER_RULE_2020 5 //Master Rule 2020
#define CURRENT_RULE 5
#define CURRENT_RULE 5
...
@@ -418,6 +419,7 @@ typedef signed char int8;
...
@@ -418,6 +419,7 @@ typedef signed char int8;
#define DUEL_TAG_MODE 0x20
#define DUEL_TAG_MODE 0x20
#define DUEL_SIMPLE_AI 0x40
#define DUEL_SIMPLE_AI 0x40
#define DUEL_RETURN_DECK_TOP 0x80
#define DUEL_RETURN_DECK_TOP 0x80
#define DUEL_REVEAL_DECK_SEQ 0x100
//Activity
//Activity
#define ACTIVITY_SUMMON 1
#define ACTIVITY_SUMMON 1
...
...
Classes/ocgcore/field.cpp
View file @
e53cb0c5
...
@@ -55,25 +55,7 @@ bool tevent::operator< (const tevent& v) const {
...
@@ -55,25 +55,7 @@ bool tevent::operator< (const tevent& v) const {
}
}
field
::
field
(
duel
*
pduel
)
{
field
::
field
(
duel
*
pduel
)
{
this
->
pduel
=
pduel
;
this
->
pduel
=
pduel
;
infos
.
field_id
=
1
;
infos
.
copy_id
=
1
;
infos
.
can_shuffle
=
TRUE
;
infos
.
turn_id
=
0
;
infos
.
turn_id_by_player
[
0
]
=
0
;
infos
.
turn_id_by_player
[
1
]
=
0
;
infos
.
card_id
=
1
;
infos
.
phase
=
0
;
infos
.
turn_player
=
0
;
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
//cost[i].count = 0;
//cost[i].amount = 0;
player
[
i
].
lp
=
8000
;
player
[
i
].
start_count
=
5
;
player
[
i
].
draw_count
=
1
;
player
[
i
].
disabled_location
=
0
;
player
[
i
].
used_location
=
0
;
player
[
i
].
extra_p_count
=
0
;
player
[
i
].
tag_extra_p_count
=
0
;
player
[
i
].
list_mzone
.
resize
(
7
,
0
);
player
[
i
].
list_mzone
.
resize
(
7
,
0
);
player
[
i
].
list_szone
.
resize
(
8
,
0
);
player
[
i
].
list_szone
.
resize
(
8
,
0
);
player
[
i
].
list_main
.
reserve
(
60
);
player
[
i
].
list_main
.
reserve
(
60
);
...
@@ -82,8 +64,6 @@ field::field(duel* pduel) {
...
@@ -82,8 +64,6 @@ field::field(duel* pduel) {
player
[
i
].
list_remove
.
reserve
(
75
);
player
[
i
].
list_remove
.
reserve
(
75
);
player
[
i
].
list_extra
.
reserve
(
30
);
player
[
i
].
list_extra
.
reserve
(
30
);
}
}
returns
=
{
0
};
temp_card
=
nullptr
;
}
}
void
field
::
reload_field_info
()
{
void
field
::
reload_field_info
()
{
pduel
->
write_buffer8
(
MSG_RELOAD_FIELD
);
pduel
->
write_buffer8
(
MSG_RELOAD_FIELD
);
...
@@ -300,10 +280,10 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
...
@@ -300,10 +280,10 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
if
(
playerid
==
preplayer
&&
sequence
==
presequence
)
if
(
playerid
==
preplayer
&&
sequence
==
presequence
)
return
;
return
;
if
(
location
==
LOCATION_MZONE
)
{
if
(
location
==
LOCATION_MZONE
)
{
if
(
sequence
>=
player
[
playerid
].
list_mzone
.
size
()
||
player
[
playerid
].
list_mzone
[
sequence
])
if
(
sequence
>=
(
int32
)
player
[
playerid
].
list_mzone
.
size
()
||
player
[
playerid
].
list_mzone
[
sequence
])
return
;
return
;
}
else
{
}
else
{
if
(
sequence
>=
player
[
playerid
].
list_szone
.
size
()
||
player
[
playerid
].
list_szone
[
sequence
])
if
(
sequence
>=
player
[
playerid
].
szone_size
||
player
[
playerid
].
list_szone
[
sequence
])
return
;
return
;
}
}
if
(
preplayer
==
playerid
)
{
if
(
preplayer
==
playerid
)
{
...
@@ -511,14 +491,14 @@ card* field::get_field_card(uint8 playerid, uint32 general_location, uint8 seque
...
@@ -511,14 +491,14 @@ card* field::get_field_card(uint8 playerid, uint32 general_location, uint8 seque
return
nullptr
;
return
nullptr
;
switch
(
general_location
)
{
switch
(
general_location
)
{
case
LOCATION_MZONE
:
{
case
LOCATION_MZONE
:
{
if
(
sequence
<
player
[
playerid
].
list_mzone
.
size
())
if
(
sequence
<
(
int32
)
player
[
playerid
].
list_mzone
.
size
())
return
player
[
playerid
].
list_mzone
[
sequence
];
return
player
[
playerid
].
list_mzone
[
sequence
];
else
else
return
nullptr
;
return
nullptr
;
break
;
break
;
}
}
case
LOCATION_SZONE
:
{
case
LOCATION_SZONE
:
{
if
(
sequence
<
player
[
playerid
].
list_szone
.
size
()
)
if
(
sequence
<
player
[
playerid
].
szone_size
)
return
player
[
playerid
].
list_szone
[
sequence
];
return
player
[
playerid
].
list_szone
[
sequence
];
else
else
return
nullptr
;
return
nullptr
;
...
@@ -585,7 +565,7 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
...
@@ -585,7 +565,7 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
return
FALSE
;
return
FALSE
;
uint32
flag
=
player
[
playerid
].
disabled_location
|
player
[
playerid
].
used_location
;
uint32
flag
=
player
[
playerid
].
disabled_location
|
player
[
playerid
].
used_location
;
if
(
general_location
==
LOCATION_MZONE
)
{
if
(
general_location
==
LOCATION_MZONE
)
{
if
(
sequence
>=
(
int32
)
player
[
0
].
list_mzone
.
size
())
if
(
sequence
>=
(
int32
)
player
[
playerid
].
list_mzone
.
size
())
return
FALSE
;
return
FALSE
;
if
(
flag
&
(
0x1u
<<
sequence
))
if
(
flag
&
(
0x1u
<<
sequence
))
return
FALSE
;
return
FALSE
;
...
@@ -595,7 +575,7 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
...
@@ -595,7 +575,7 @@ int32 field::is_location_useable(uint8 playerid, uint32 general_location, uint8
return
FALSE
;
return
FALSE
;
}
}
}
else
if
(
general_location
==
LOCATION_SZONE
)
{
}
else
if
(
general_location
==
LOCATION_SZONE
)
{
if
(
sequence
>=
(
int32
)
player
[
0
].
list_szone
.
size
()
)
if
(
sequence
>=
player
[
playerid
].
szone_size
)
return
FALSE
;
return
FALSE
;
if
(
flag
&
(
0x100u
<<
sequence
))
if
(
flag
&
(
0x100u
<<
sequence
))
return
FALSE
;
return
FALSE
;
...
@@ -1127,7 +1107,7 @@ void field::refresh_player_info(uint8 playerid) {
...
@@ -1127,7 +1107,7 @@ void field::refresh_player_info(uint8 playerid) {
if
(
player
[
playerid
].
list_mzone
[
i
])
if
(
player
[
playerid
].
list_mzone
[
i
])
used_flag
|=
0x1U
<<
i
;
used_flag
|=
0x1U
<<
i
;
}
}
for
(
int32
i
=
0
;
i
<
(
int32
)
player
[
playerid
].
list_szone
.
size
()
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
player
[
playerid
].
szone_size
;
++
i
)
{
if
(
player
[
playerid
].
list_szone
[
i
])
if
(
player
[
playerid
].
list_szone
[
i
])
used_flag
|=
0x100U
<<
i
;
used_flag
|=
0x100U
<<
i
;
}
}
...
@@ -2293,6 +2273,9 @@ int32 field::check_spsummon_counter(uint8 playerid, uint8 ct) {
...
@@ -2293,6 +2273,9 @@ int32 field::check_spsummon_counter(uint8 playerid, uint8 ct) {
}
}
return
TRUE
;
return
TRUE
;
}
}
bool
field
::
is_select_hide_deck_sequence
(
uint8
playerid
)
{
return
!
core
.
select_deck_sequence_revealed
&&
!
(
core
.
duel_options
&
DUEL_REVEAL_DECK_SEQ
)
&&
playerid
==
core
.
selecting_player
;
}
int32
field
::
check_lp_cost
(
uint8
playerid
,
uint32
lp
,
uint32
must_pay
)
{
int32
field
::
check_lp_cost
(
uint8
playerid
,
uint32
lp
,
uint32
must_pay
)
{
effect_set
eset
;
effect_set
eset
;
int32
val
=
lp
;
int32
val
=
lp
;
...
...
Classes/ocgcore/field.h
View file @
e53cb0c5
...
@@ -80,13 +80,14 @@ struct chain {
...
@@ -80,13 +80,14 @@ struct chain {
};
};
struct
player_info
{
struct
player_info
{
int32
lp
{
0
};
int32
lp
{
800
0
};
int32
start_count
{
0
};
int32
start_count
{
5
};
int32
draw_count
{
0
};
int32
draw_count
{
1
};
uint32
used_location
{
0
};
uint32
used_location
{
0
};
uint32
disabled_location
{
0
};
uint32
disabled_location
{
0
};
uint32
extra_p_count
{
0
};
uint32
extra_p_count
{
0
};
uint32
tag_extra_p_count
{
0
};
uint32
tag_extra_p_count
{
0
};
int32
szone_size
{
6
};
card_vector
list_mzone
;
card_vector
list_mzone
;
card_vector
list_szone
;
card_vector
list_szone
;
card_vector
list_main
;
card_vector
list_main
;
...
@@ -127,19 +128,19 @@ struct field_effect {
...
@@ -127,19 +128,19 @@ struct field_effect {
grant_effect_container
grant_effect
;
grant_effect_container
grant_effect
;
};
};
struct
field_info
{
struct
field_info
{
int32
field_id
{
0
};
int32
field_id
{
1
};
int16
copy_id
{
0
};
int16
copy_id
{
1
};
int16
turn_id
{
0
};
int16
turn_id
{};
int16
turn_id_by_player
[
2
]{};
int16
turn_id_by_player
[
2
]{};
int16
card_id
{
0
};
int16
card_id
{
1
};
uint16
phase
{
0
};
uint16
phase
{};
uint8
turn_player
{
0
};
uint8
turn_player
{};
uint8
priorities
[
2
]{};
uint8
priorities
[
2
]{};
uint8
can_shuffle
{
TRUE
};
uint8
can_shuffle
{
TRUE
};
};
};
struct
lpcost
{
struct
lpcost
{
int32
count
{
0
};
int32
count
{};
int32
amount
{
0
};
int32
amount
{};
int32
lpstack
[
8
]{};
int32
lpstack
[
8
]{};
};
};
struct
processor_unit
{
struct
processor_unit
{
...
@@ -306,7 +307,7 @@ struct processor {
...
@@ -306,7 +307,7 @@ struct processor {
uint8
extra_summon
[
2
]{};
uint8
extra_summon
[
2
]{};
int32
spe_effect
[
2
]{};
int32
spe_effect
[
2
]{};
int32
last_select_hint
[
2
]{
0
};
int32
last_select_hint
[
2
]{
0
};
int32
duel_options
{
0
};
u
int32
duel_options
{
0
};
int32
duel_rule
{
CURRENT_RULE
};
int32
duel_rule
{
CURRENT_RULE
};
uint32
copy_reset
{
0
};
uint32
copy_reset
{
0
};
int32
copy_reset_count
{
0
};
int32
copy_reset_count
{
0
};
...
@@ -350,7 +351,7 @@ struct processor {
...
@@ -350,7 +351,7 @@ struct processor {
uint32
hint_timing
[
2
]{};
uint32
hint_timing
[
2
]{};
uint8
current_player
{
PLAYER_NONE
};
uint8
current_player
{
PLAYER_NONE
};
uint8
conti_player
{
PLAYER_NONE
};
uint8
conti_player
{
PLAYER_NONE
};
uint8
select_deck_seq
_preserv
ed
{
FALSE
};
uint8
select_deck_seq
uence_reveal
ed
{
FALSE
};
uint8
selecting_player
{
PLAYER_NONE
};
uint8
selecting_player
{
PLAYER_NONE
};
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
summon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
summon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
normalsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
normalsummon_counter
;
...
@@ -374,12 +375,12 @@ public:
...
@@ -374,12 +375,12 @@ public:
duel
*
pduel
;
duel
*
pduel
;
player_info
player
[
2
];
player_info
player
[
2
];
card
*
temp_card
;
card
*
temp_card
{}
;
field_info
infos
;
field_info
infos
;
//lpcost cost[2];
//lpcost cost[2];
field_effect
effects
;
field_effect
effects
;
processor
core
;
processor
core
;
return_value
returns
;
return_value
returns
{}
;
tevent
nil_event
;
tevent
nil_event
;
static
int32
field_used_count
[
32
];
static
int32
field_used_count
[
32
];
...
@@ -463,6 +464,7 @@ public:
...
@@ -463,6 +464,7 @@ public:
void
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
,
bool
cancel
=
false
);
void
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
,
bool
cancel
=
false
);
void
set_spsummon_counter
(
uint8
playerid
);
void
set_spsummon_counter
(
uint8
playerid
);
int32
check_spsummon_counter
(
uint8
playerid
,
uint8
ct
=
1
);
int32
check_spsummon_counter
(
uint8
playerid
,
uint8
ct
=
1
);
bool
is_select_hide_deck_sequence
(
uint8
playerid
);
int32
check_lp_cost
(
uint8
playerid
,
uint32
cost
,
uint32
must_pay
);
int32
check_lp_cost
(
uint8
playerid
,
uint32
cost
,
uint32
must_pay
);
void
save_lp_cost
()
{}
void
save_lp_cost
()
{}
...
...
Classes/ocgcore/libdebug.cpp
View file @
e53cb0c5
...
@@ -148,6 +148,10 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) {
...
@@ -148,6 +148,10 @@ int32 scriptlib::debug_reload_field_begin(lua_State *L) {
pduel
->
game_field
->
core
.
duel_rule
=
1
;
pduel
->
game_field
->
core
.
duel_rule
=
1
;
else
else
pduel
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
pduel
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
if
(
pduel
->
game_field
->
core
.
duel_rule
==
MASTER_RULE3
)
{
pduel
->
game_field
->
player
[
0
].
szone_size
=
8
;
pduel
->
game_field
->
player
[
1
].
szone_size
=
8
;
}
return
0
;
return
0
;
}
}
int32
scriptlib
::
debug_reload_field_end
(
lua_State
*
L
)
{
int32
scriptlib
::
debug_reload_field_end
(
lua_State
*
L
)
{
...
...
Classes/ocgcore/libduel.cpp
View file @
e53cb0c5
...
@@ -1546,12 +1546,12 @@ int32 scriptlib::duel_disable_self_destroy_check(lua_State* L) {
...
@@ -1546,12 +1546,12 @@ int32 scriptlib::duel_disable_self_destroy_check(lua_State* L) {
pduel
->
game_field
->
core
.
selfdes_disabled
=
disable
;
pduel
->
game_field
->
core
.
selfdes_disabled
=
disable
;
return
0
;
return
0
;
}
}
int32
scriptlib
::
duel_
preserve_select_deck_seq
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_
reveal_select_deck_sequence
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint8
preserve
=
TRUE
;
uint8
reveal
=
TRUE
;
if
(
lua_gettop
(
L
)
>
0
)
if
(
lua_gettop
(
L
)
>
0
)
preserve
=
lua_toboolean
(
L
,
1
);
reveal
=
lua_toboolean
(
L
,
1
);
pduel
->
game_field
->
core
.
select_deck_seq
_preserved
=
preserve
;
pduel
->
game_field
->
core
.
select_deck_seq
uence_revealed
=
reveal
;
return
0
;
return
0
;
}
}
int32
scriptlib
::
duel_shuffle_deck
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_shuffle_deck
(
lua_State
*
L
)
{
...
@@ -4876,7 +4876,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -4876,7 +4876,7 @@ static const struct luaL_Reg duellib[] = {
{
"DiscardHand"
,
scriptlib
::
duel_discard_hand
},
{
"DiscardHand"
,
scriptlib
::
duel_discard_hand
},
{
"DisableShuffleCheck"
,
scriptlib
::
duel_disable_shuffle_check
},
{
"DisableShuffleCheck"
,
scriptlib
::
duel_disable_shuffle_check
},
{
"DisableSelfDestroyCheck"
,
scriptlib
::
duel_disable_self_destroy_check
},
{
"DisableSelfDestroyCheck"
,
scriptlib
::
duel_disable_self_destroy_check
},
{
"
PreserveSelectDeckSequence"
,
scriptlib
::
duel_preserve_select_deck_seq
},
{
"
RevealSelectDeckSequence"
,
scriptlib
::
duel_reveal_select_deck_sequence
},
{
"ShuffleDeck"
,
scriptlib
::
duel_shuffle_deck
},
{
"ShuffleDeck"
,
scriptlib
::
duel_shuffle_deck
},
{
"ShuffleExtra"
,
scriptlib
::
duel_shuffle_extra
},
{
"ShuffleExtra"
,
scriptlib
::
duel_shuffle_extra
},
{
"ShuffleHand"
,
scriptlib
::
duel_shuffle_hand
},
{
"ShuffleHand"
,
scriptlib
::
duel_shuffle_hand
},
...
...
Classes/ocgcore/ocgapi.cpp
View file @
e53cb0c5
...
@@ -64,7 +64,7 @@ extern "C" DECL_DLLEXPORT intptr_t create_duel(uint_fast32_t seed) {
...
@@ -64,7 +64,7 @@ extern "C" DECL_DLLEXPORT intptr_t create_duel(uint_fast32_t seed) {
pduel
->
random
.
reset
(
seed
);
pduel
->
random
.
reset
(
seed
);
return
(
intptr_t
)
pduel
;
return
(
intptr_t
)
pduel
;
}
}
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
int32
options
)
{
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
u
int32
options
)
{
duel
*
pd
=
(
duel
*
)
pduel
;
duel
*
pd
=
(
duel
*
)
pduel
;
pd
->
game_field
->
core
.
duel_options
|=
options
&
0xffff
;
pd
->
game_field
->
core
.
duel_options
|=
options
&
0xffff
;
int32
duel_rule
=
options
>>
16
;
int32
duel_rule
=
options
>>
16
;
...
@@ -72,8 +72,12 @@ extern "C" DECL_DLLEXPORT void start_duel(intptr_t pduel, int32 options) {
...
@@ -72,8 +72,12 @@ extern "C" DECL_DLLEXPORT void start_duel(intptr_t pduel, int32 options) {
pd
->
game_field
->
core
.
duel_rule
=
duel_rule
;
pd
->
game_field
->
core
.
duel_rule
=
duel_rule
;
else
if
(
options
&
DUEL_OBSOLETE_RULING
)
//provide backward compatibility with replay
else
if
(
options
&
DUEL_OBSOLETE_RULING
)
//provide backward compatibility with replay
pd
->
game_field
->
core
.
duel_rule
=
1
;
pd
->
game_field
->
core
.
duel_rule
=
1
;
else
if
(
!
pd
->
game_field
->
core
.
duel_rule
)
if
(
pd
->
game_field
->
core
.
duel_rule
<
1
||
pd
->
game_field
->
core
.
duel_rule
>
CURRENT_RULE
)
pd
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
pd
->
game_field
->
core
.
duel_rule
=
CURRENT_RULE
;
if
(
pd
->
game_field
->
core
.
duel_rule
==
MASTER_RULE3
)
{
pd
->
game_field
->
player
[
0
].
szone_size
=
8
;
pd
->
game_field
->
player
[
1
].
szone_size
=
8
;
}
pd
->
game_field
->
core
.
shuffle_hand_check
[
0
]
=
FALSE
;
pd
->
game_field
->
core
.
shuffle_hand_check
[
0
]
=
FALSE
;
pd
->
game_field
->
core
.
shuffle_hand_check
[
1
]
=
FALSE
;
pd
->
game_field
->
core
.
shuffle_hand_check
[
1
]
=
FALSE
;
pd
->
game_field
->
core
.
shuffle_deck_check
[
0
]
=
FALSE
;
pd
->
game_field
->
core
.
shuffle_deck_check
[
0
]
=
FALSE
;
...
...
Classes/ocgcore/ocgapi.h
View file @
e53cb0c5
...
@@ -39,7 +39,7 @@ uint32 read_card(uint32 code, card_data* data);
...
@@ -39,7 +39,7 @@ uint32 read_card(uint32 code, card_data* data);
uint32
handle_message
(
void
*
pduel
,
uint32
message_type
);
uint32
handle_message
(
void
*
pduel
,
uint32
message_type
);
extern
"C"
DECL_DLLEXPORT
intptr_t
create_duel
(
uint_fast32_t
seed
);
extern
"C"
DECL_DLLEXPORT
intptr_t
create_duel
(
uint_fast32_t
seed
);
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
int32
options
);
extern
"C"
DECL_DLLEXPORT
void
start_duel
(
intptr_t
pduel
,
u
int32
options
);
extern
"C"
DECL_DLLEXPORT
void
end_duel
(
intptr_t
pduel
);
extern
"C"
DECL_DLLEXPORT
void
end_duel
(
intptr_t
pduel
);
extern
"C"
DECL_DLLEXPORT
void
set_player_info
(
intptr_t
pduel
,
int32
playerid
,
int32
lp
,
int32
startcount
,
int32
drawcount
);
extern
"C"
DECL_DLLEXPORT
void
set_player_info
(
intptr_t
pduel
,
int32
playerid
,
int32
lp
,
int32
startcount
,
int32
drawcount
);
extern
"C"
DECL_DLLEXPORT
void
get_log_message
(
intptr_t
pduel
,
char
*
buf
);
extern
"C"
DECL_DLLEXPORT
void
get_log_message
(
intptr_t
pduel
,
char
*
buf
);
...
...
Classes/ocgcore/scriptlib.h
View file @
e53cb0c5
...
@@ -462,7 +462,7 @@ public:
...
@@ -462,7 +462,7 @@ public:
static
int32
duel_discard_hand
(
lua_State
*
L
);
static
int32
duel_discard_hand
(
lua_State
*
L
);
static
int32
duel_disable_shuffle_check
(
lua_State
*
L
);
static
int32
duel_disable_shuffle_check
(
lua_State
*
L
);
static
int32
duel_disable_self_destroy_check
(
lua_State
*
L
);
static
int32
duel_disable_self_destroy_check
(
lua_State
*
L
);
static
int32
duel_
preserve_select_deck_seq
(
lua_State
*
L
);
static
int32
duel_
reveal_select_deck_sequence
(
lua_State
*
L
);
static
int32
duel_shuffle_deck
(
lua_State
*
L
);
static
int32
duel_shuffle_deck
(
lua_State
*
L
);
static
int32
duel_shuffle_extra
(
lua_State
*
L
);
static
int32
duel_shuffle_extra
(
lua_State
*
L
);
static
int32
duel_shuffle_hand
(
lua_State
*
L
);
static
int32
duel_shuffle_hand
(
lua_State
*
L
);
...
...
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