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
ff099fd7
Commit
ff099fd7
authored
Aug 31, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理
parent
3b730444
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
278 deletions
+40
-278
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+13
-241
Classes/gframe/replay_mode.cpp
Classes/gframe/replay_mode.cpp
+2
-6
Classes/gframe/single_duel.cpp
Classes/gframe/single_duel.cpp
+0
-2
Classes/gframe/single_mode.cpp
Classes/gframe/single_mode.cpp
+0
-2
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+1
-1
Classes/ocgcore/playerop.cpp
Classes/ocgcore/playerop.cpp
+3
-3
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+21
-23
No files found.
Classes/gframe/game.cpp
View file @
ff099fd7
This diff is collapsed.
Click to expand it.
Classes/gframe/replay_mode.cpp
View file @
ff099fd7
...
...
@@ -64,15 +64,11 @@ int ReplayMode::ReplayThread(void* param) {
mainGame
->
dInfo
.
tag_player
[
0
]
=
false
;
mainGame
->
dInfo
.
tag_player
[
1
]
=
false
;
if
(
mainGame
->
dInfo
.
isSingleMode
)
{
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader
((
script_reader
)
SingleMode
::
ScriptReaderEx
);
#endif
set_script_reader
((
script_reader
)
SingleMode
::
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
}
else
{
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader
((
script_reader
)
ScriptReaderEx
);
#endif
set_script_reader
((
script_reader
)
ScriptReaderEx
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
}
...
...
Classes/gframe/single_duel.cpp
View file @
ff099fd7
...
...
@@ -406,9 +406,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
}
time_limit
[
0
]
=
host_info
.
time_limit
;
time_limit
[
1
]
=
host_info
.
time_limit
;
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader
((
script_reader
)
ScriptReaderEx
);
#endif
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
SingleDuel
::
MessageHandler
);
rnd
.
reset
(
seed
);
...
...
Classes/gframe/single_mode.cpp
View file @
ff099fd7
...
...
@@ -38,9 +38,7 @@ int SingleMode::SinglePlayThread(void* param) {
mtrandom
rnd
;
time_t
seed
=
time
(
0
);
rnd
.
reset
(
seed
);
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader
((
script_reader
)
ScriptReaderEx
);
#endif
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
pduel
=
create_duel
(
rnd
.
rand
());
...
...
Classes/ocgcore/card.cpp
View file @
ff099fd7
...
...
@@ -243,7 +243,7 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
#else
*
(
uint32
*
)(
buf
+
4
)
=
query_flag
;
#endif
return
(
byte
*
)
p
-
buf
;
return
(
uint32
)((
byte
*
)
p
-
buf
)
;
}
uint32
card
::
get_info_location
()
{
if
(
overlay_target
)
{
...
...
Classes/ocgcore/playerop.cpp
View file @
ff099fd7
...
...
@@ -269,7 +269,7 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
byte
c
[
64
]
=
{};
uint8
m
=
core
.
select_cards
.
size
();
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
u
int8
v
=
returns
.
bvalue
[
i
+
1
];
int8
v
=
returns
.
bvalue
[
i
+
1
];
if
(
v
<
0
||
v
>=
m
||
v
>=
63
||
c
[
v
])
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
...
...
@@ -747,12 +747,12 @@ int32 field::sort_card(int16 step, uint8 playerid, uint8 is_chain) {
}
return
FALSE
;
}
else
{
if
(
returns
.
i
value
[
0
]
==
-
1
)
if
(
returns
.
b
value
[
0
]
==
-
1
)
return
TRUE
;
byte
c
[
64
]
=
{};
uint8
m
=
core
.
select_cards
.
size
();
for
(
uint8
i
=
0
;
i
<
m
;
++
i
)
{
u
int8
v
=
returns
.
bvalue
[
i
];
int8
v
=
returns
.
bvalue
[
i
];
if
(
v
<
0
||
v
>=
m
||
c
[
v
])
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
...
...
Classes/ocgcore/processor.cpp
View file @
ff099fd7
...
...
@@ -674,9 +674,8 @@ int32 field::process() {
it
->
step
++
;
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
card
*
pcard
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
...
...
@@ -719,9 +718,8 @@ int32 field::process() {
it
->
step
++
;
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
card
*
pcard
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
...
...
@@ -735,9 +733,8 @@ int32 field::process() {
it
->
step
++
;
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
card
*
pcard
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
...
...
@@ -852,11 +849,11 @@ int32 field::process() {
int32
playerid
=
it
->
arg1
;
int32
count
=
it
->
arg3
;
int32
dfflag
=
0
;
uint8
p
,
l
,
s
,
p
a
=
0
;
uint8
pa
=
0
;
for
(
int32
i
=
0
;
i
<
count
;
++
i
)
{
p
=
returns
.
bvalue
[
pa
];
l
=
returns
.
bvalue
[
pa
+
1
];
s
=
returns
.
bvalue
[
pa
+
2
];
uint8
p
=
returns
.
bvalue
[
pa
];
uint8
l
=
returns
.
bvalue
[
pa
+
1
];
uint8
s
=
returns
.
bvalue
[
pa
+
2
];
dfflag
|=
0x1u
<<
(
s
+
(
p
==
playerid
?
0
:
16
)
+
(
l
==
LOCATION_MZONE
?
0
:
8
));
pa
+=
3
;
}
...
...
@@ -1007,9 +1004,8 @@ int32 field::process() {
it
->
step
++
;
}
else
if
(
it
->
step
==
1
)
{
card_set
cset
;
card
*
pcard
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
cset
.
insert
(
pcard
);
}
if
(
cset
.
size
())
...
...
@@ -1050,7 +1046,7 @@ int32 field::process() {
for
(
i
=
0
;
i
<
count
;
++
i
)
player
[
target_player
].
list_main
.
pop_back
();
for
(
i
=
0
;
i
<
count
;
++
i
)
tc
[(
int32
)
returns
.
bvalue
[
i
]]
=
core
.
select_cards
[
i
];
tc
[(
uint8
)
returns
.
bvalue
[
i
]]
=
core
.
select_cards
[
i
];
for
(
i
=
0
;
i
<
count
;
++
i
)
{
player
[
target_player
].
list_main
.
push_back
(
tc
[
count
-
i
-
1
]);
tc
[
count
-
i
-
1
]
->
current
.
sequence
=
player
[
target_player
].
list_main
.
size
()
-
1
;
...
...
@@ -3095,7 +3091,8 @@ int32 field::process_battle_command(uint16 step) {
return
FALSE
;
}
case
9
:
{
if
(
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
)
||
core
.
attack_rollback
)
{
if
(
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
)
||
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
)
||
core
.
attack_rollback
)
{
core
.
units
.
begin
()
->
step
=
10
;
return
FALSE
;
}
...
...
@@ -3126,17 +3123,12 @@ int32 field::process_battle_command(uint16 step) {
core
.
attacker
->
set_status
(
STATUS_ATTACK_CANCELED
,
TRUE
);
}
if
(
is_player_affected_by_effect
(
infos
.
turn_player
,
EFFECT_SKIP_BP
)
||
!
core
.
attacker
->
is_capable_attack
()
||
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
)
||
core
.
attacker
->
current
.
controler
!=
core
.
attacker
->
attack_controler
||
core
.
attacker
->
fieldid_r
!=
core
.
pre_field
[
0
])
{
||
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
))
{
core
.
units
.
begin
()
->
step
=
12
;
return
FALSE
;
}
uint8
rollback
=
core
.
attack_rollback
;
if
(
!
confirm_attack_target
())
rollback
=
TRUE
;
// go to damage step
if
(
!
rollback
)
{
if
(
!
core
.
attack_
rollback
)
{
core
.
attacker
->
announce_count
++
;
core
.
attacker
->
announced_cards
.
addcard
(
core
.
attack_target
);
attack_all_target_check
();
...
...
@@ -5327,8 +5319,14 @@ int32 field::adjust_step(uint16 step) {
card
*
attacker
=
core
.
attacker
;
if
(
!
attacker
)
return
FALSE
;
if
(
attacker
->
is_affected_by_effect
(
EFFECT_CANNOT_ATTACK
))
if
(
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
))
return
FALSE
;
if
(
!
core
.
attacker
->
is_capable_attack
()
||
core
.
attacker
->
current
.
controler
!=
core
.
attacker
->
attack_controler
||
core
.
attacker
->
fieldid_r
!=
core
.
pre_field
[
0
])
{
attacker
->
set_status
(
STATUS_ATTACK_CANCELED
,
TRUE
);
return
FALSE
;
}
if
(
core
.
attack_rollback
)
return
FALSE
;
std
::
set
<
uint16
>
fidset
;
...
...
@@ -5336,7 +5334,7 @@ int32 field::adjust_step(uint16 step) {
if
(
pcard
)
fidset
.
insert
(
pcard
->
fieldid_r
);
}
if
(
fidset
!=
core
.
opp_mzone
)
if
(
fidset
!=
core
.
opp_mzone
||
!
confirm_attack_target
()
)
core
.
attack_rollback
=
TRUE
;
return
FALSE
;
}
...
...
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