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
4e8abce9
Commit
4e8abce9
authored
Nov 18, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
69fc4f35
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
51 deletions
+52
-51
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+5
-7
Classes/ocgcore/card.h
Classes/ocgcore/card.h
+1
-34
Classes/ocgcore/common.h
Classes/ocgcore/common.h
+34
-2
Classes/ocgcore/effect.cpp
Classes/ocgcore/effect.cpp
+2
-4
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+2
-0
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+3
-3
Classes/ocgcore/playerop.cpp
Classes/ocgcore/playerop.cpp
+2
-0
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+3
-1
No files found.
Classes/ocgcore/card.cpp
View file @
4e8abce9
...
...
@@ -188,16 +188,14 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
}
if
(
query_flag
&
QUERY_OWNER
)
*
p
++
=
owner
;
if
(
query_flag
&
QUERY_
IS_DISABLED
)
{
tdata
=
(
status
&
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
))
?
1
:
0
;
if
(
!
use_cache
||
(
tdata
!=
q_cache
.
is_disabled
))
{
q_cache
.
is_disabled
=
tdata
;
if
(
query_flag
&
QUERY_
STATUS
)
{
tdata
=
status
&
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
|
STATUS_PROC_COMPLETE
)
;
if
(
!
use_cache
||
(
tdata
!=
q_cache
.
status
))
{
q_cache
.
status
=
tdata
;
*
p
++
=
tdata
;
}
else
query_flag
&=
~
QUERY_
IS_DISABLED
;
query_flag
&=
~
QUERY_
STATUS
;
}
if
(
query_flag
&
QUERY_IS_PUBLIC
)
*
p
++
=
is_position
(
POS_FACEUP
)
?
1
:
0
;
if
(
!
use_cache
)
{
if
(
query_flag
&
QUERY_LSCALE
)
q_cache
.
lscale
=
*
p
++
=
get_lscale
();
if
(
query_flag
&
QUERY_RSCALE
)
q_cache
.
rscale
=
*
p
++
=
get_rscale
();
...
...
Classes/ocgcore/card.h
View file @
4e8abce9
...
...
@@ -80,8 +80,7 @@ struct query_cache {
int32
base_attack
;
int32
base_defense
;
uint32
reason
;
int32
is_public
;
int32
is_disabled
;
int32
status
;
uint32
lscale
;
uint32
rscale
;
uint32
link_marker
;
...
...
@@ -361,38 +360,6 @@ public:
#define SUMMON_TYPE_XYZ 0x49000000
#define SUMMON_TYPE_PENDULUM 0x4a000000
#define SUMMON_TYPE_LINK 0x4c000000
//Status
#define STATUS_DISABLED 0x0001 //
#define STATUS_TO_ENABLE 0x0002 //
#define STATUS_TO_DISABLE 0x0004 //
#define STATUS_PROC_COMPLETE 0x0008 //
#define STATUS_SET_TURN 0x0010 //
#define STATUS_NO_LEVEL 0x0020 //
#define STATUS_BATTLE_RESULT 0x0040 //
#define STATUS_SPSUMMON_STEP 0x0080 //
#define STATUS_FORM_CHANGED 0x0100 //
#define STATUS_SUMMONING 0x0200 //
#define STATUS_EFFECT_ENABLED 0x0400 //
#define STATUS_SUMMON_TURN 0x0800 //
#define STATUS_DESTROY_CONFIRMED 0x1000 //
#define STATUS_LEAVE_CONFIRMED 0x2000 //
#define STATUS_BATTLE_DESTROYED 0x4000 //
#define STATUS_COPYING_EFFECT 0x8000 //
#define STATUS_CHAINING 0x10000 //
#define STATUS_SUMMON_DISABLED 0x20000 //
#define STATUS_ACTIVATE_DISABLED 0x40000 //
#define STATUS_EFFECT_REPLACED 0x80000
#define STATUS_FUTURE_FUSION 0x100000
#define STATUS_ATTACK_CANCELED 0x200000
#define STATUS_INITIALIZING 0x400000
//#define STATUS_ACTIVATED 0x800000
#define STATUS_JUST_POS 0x1000000
#define STATUS_CONTINUOUS_POS 0x2000000
#define STATUS_FORBIDDEN 0x4000000
#define STATUS_ACT_FROM_HAND 0x8000000
#define STATUS_OPPO_BATTLE 0x10000000
#define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000
//Counter
#define COUNTER_WITHOUT_PERMIT 0x1000
#define COUNTER_NEED_ENABLE 0x2000
...
...
Classes/ocgcore/common.h
View file @
4e8abce9
...
...
@@ -160,6 +160,39 @@ struct card_sort {
//#define REASON_REVEAL 0x8000000 //
#define REASON_LINK 0x10000000 //
//Status
#define STATUS_DISABLED 0x0001 //
#define STATUS_TO_ENABLE 0x0002 //
#define STATUS_TO_DISABLE 0x0004 //
#define STATUS_PROC_COMPLETE 0x0008 //
#define STATUS_SET_TURN 0x0010 //
#define STATUS_NO_LEVEL 0x0020 //
#define STATUS_BATTLE_RESULT 0x0040 //
#define STATUS_SPSUMMON_STEP 0x0080 //
#define STATUS_FORM_CHANGED 0x0100 //
#define STATUS_SUMMONING 0x0200 //
#define STATUS_EFFECT_ENABLED 0x0400 //
#define STATUS_SUMMON_TURN 0x0800 //
#define STATUS_DESTROY_CONFIRMED 0x1000 //
#define STATUS_LEAVE_CONFIRMED 0x2000 //
#define STATUS_BATTLE_DESTROYED 0x4000 //
#define STATUS_COPYING_EFFECT 0x8000 //
#define STATUS_CHAINING 0x10000 //
#define STATUS_SUMMON_DISABLED 0x20000 //
#define STATUS_ACTIVATE_DISABLED 0x40000 //
#define STATUS_EFFECT_REPLACED 0x80000
#define STATUS_FUTURE_FUSION 0x100000
#define STATUS_ATTACK_CANCELED 0x200000
#define STATUS_INITIALIZING 0x400000
//#define STATUS_ACTIVATED 0x800000
#define STATUS_JUST_POS 0x1000000
#define STATUS_CONTINUOUS_POS 0x2000000
#define STATUS_FORBIDDEN 0x4000000
#define STATUS_ACT_FROM_HAND 0x8000000
#define STATUS_OPPO_BATTLE 0x10000000
#define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000
//Query list
#define QUERY_CODE 0x1
#define QUERY_POSITION 0x2
...
...
@@ -180,8 +213,7 @@ struct card_sort {
#define QUERY_OVERLAY_CARD 0x10000
#define QUERY_COUNTERS 0x20000
#define QUERY_OWNER 0x40000
#define QUERY_IS_DISABLED 0x80000
#define QUERY_IS_PUBLIC 0x100000
#define QUERY_STATUS 0x80000
#define QUERY_LSCALE 0x200000
#define QUERY_RSCALE 0x400000
#define QUERY_LINK 0x800000
...
...
Classes/ocgcore/effect.cpp
View file @
4e8abce9
...
...
@@ -206,10 +206,6 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return
FALSE
;
if
(
handler
->
equiping_target
)
return
FALSE
;
if
(
handler
->
get_status
(
STATUS_SET_TURN
))
{
if
((
handler
->
data
.
type
&
TYPE_SPELL
)
&&
(
handler
->
data
.
type
&
TYPE_QUICKPLAY
))
return
FALSE
;
}
if
(
!
(
handler
->
data
.
type
&
(
TYPE_FIELD
|
TYPE_PENDULUM
))
&&
is_flag
(
EFFECT_FLAG_LIMIT_ZONE
)
&&
!
(
zone
&
(
1u
<<
handler
->
current
.
sequence
)))
return
FALSE
;
}
else
{
...
...
@@ -237,6 +233,8 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
}
else
if
(
handler
->
current
.
location
==
LOCATION_SZONE
)
{
if
((
handler
->
data
.
type
&
TYPE_TRAP
)
&&
handler
->
get_status
(
STATUS_SET_TURN
))
ecode
=
EFFECT_TRAP_ACT_IN_SET_TURN
;
if
((
handler
->
data
.
type
&
TYPE_SPELL
)
&&
(
handler
->
data
.
type
&
TYPE_QUICKPLAY
)
&&
handler
->
get_status
(
STATUS_SET_TURN
))
ecode
=
EFFECT_QP_ACT_IN_SET_TURN
;
}
if
(
ecode
)
{
bool
available
=
false
;
...
...
Classes/ocgcore/effect.h
View file @
4e8abce9
...
...
@@ -439,6 +439,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
//#define EFFECT_ADD_LINK_SETCODE 355
#define EFFECT_ADD_LINK_ATTRIBUTE 356
#define EFFECT_ADD_LINK_RACE 357
#define EFFECT_EXTRA_LINK_MATERIAL 358
#define EFFECT_QP_ACT_IN_SET_TURN 359
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
...
...
Classes/ocgcore/operations.cpp
View file @
4e8abce9
...
...
@@ -619,7 +619,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) {
if
(
core
.
select_options
.
size
()
==
1
)
returns
.
ivalue
[
0
]
=
0
;
else
if
(
core
.
select_effects
[
0
]
==
0
&&
core
.
select_effects
.
size
()
==
2
)
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_effects
[
1
]
->
handler
,
playerid
,
0
);
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_effects
[
1
]
->
handler
,
playerid
,
218
);
else
add_process
(
PROCESSOR_SELECT_OPTION
,
0
,
0
,
0
,
playerid
,
0
);
return
FALSE
;
...
...
@@ -683,7 +683,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay
if
(
core
.
select_options
.
size
()
==
1
)
returns
.
ivalue
[
0
]
=
0
;
else
if
(
core
.
select_effects
[
0
]
==
0
&&
core
.
select_effects
.
size
()
==
2
)
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_effects
[
1
]
->
handler
,
rplayer
,
0
);
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_effects
[
1
]
->
handler
,
rplayer
,
219
);
else
add_process
(
PROCESSOR_SELECT_OPTION
,
0
,
0
,
0
,
rplayer
,
0
);
return
FALSE
;
...
...
@@ -759,7 +759,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
if
(
core
.
select_options
.
size
()
==
1
)
returns
.
ivalue
[
0
]
=
0
;
else
if
(
core
.
select_effects
[
0
]
==
0
&&
core
.
select_effects
.
size
()
==
2
)
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_effects
[
1
]
->
handler
,
rplayer
,
0
);
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_effects
[
1
]
->
handler
,
rplayer
,
22
0
);
else
add_process
(
PROCESSOR_SELECT_OPTION
,
0
,
0
,
0
,
rplayer
,
0
);
return
FALSE
;
...
...
Classes/ocgcore/playerop.cpp
View file @
4e8abce9
...
...
@@ -326,6 +326,8 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo
if
((
playerid
==
1
)
&&
(
core
.
duel_options
&
DUEL_SIMPLE_AI
))
{
if
(
core
.
select_chains
.
size
()
==
0
)
returns
.
ivalue
[
0
]
=
-
1
;
else
if
(
forced
)
returns
.
ivalue
[
0
]
=
0
;
else
{
bool
act
=
true
;
for
(
const
auto
&
ch
:
core
.
current_chain
)
...
...
Classes/ocgcore/processor.cpp
View file @
4e8abce9
...
...
@@ -1799,7 +1799,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
core
.
units
.
begin
()
->
step
=
5
;
return
FALSE
;
}
else
if
(
core
.
select_chains
.
size
()
==
1
&&
!
core
.
current_chain
.
size
())
{
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_chains
[
0
].
triggering_effect
->
get_handler
(),
core
.
current_player
,
0
);
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
core
.
select_chains
[
0
].
triggering_effect
->
get_handler
(),
core
.
current_player
,
221
);
return
FALSE
;
}
else
{
add_process
(
PROCESSOR_SELECT_CHAIN
,
0
,
0
,
0
,
core
.
current_player
,
0x7f
);
...
...
@@ -4208,6 +4208,8 @@ int32 field::add_chain(uint16 step) {
}
else
if
(
phandler
->
current
.
location
==
LOCATION_SZONE
)
{
if
((
phandler
->
data
.
type
&
TYPE_TRAP
)
&&
phandler
->
get_status
(
STATUS_SET_TURN
))
ecode
=
EFFECT_TRAP_ACT_IN_SET_TURN
;
if
((
phandler
->
data
.
type
&
TYPE_SPELL
)
&&
(
phandler
->
data
.
type
&
TYPE_QUICKPLAY
)
&&
phandler
->
get_status
(
STATUS_SET_TURN
))
ecode
=
EFFECT_QP_ACT_IN_SET_TURN
;
}
if
(
ecode
)
{
eset
.
clear
();
...
...
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