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
c4f02f36
Commit
c4f02f36
authored
Jan 31, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
ae05eb99
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
33 deletions
+60
-33
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+8
-1
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+12
-5
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+12
-6
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+17
-12
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+11
-9
No files found.
Classes/ocgcore/effect.h
View file @
c4f02f36
...
@@ -518,6 +518,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -518,6 +518,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_SUMMON_NEGATED 1114
#define EVENT_SUMMON_NEGATED 1114
#define EVENT_FLIP_SUMMON_NEGATED 1115
#define EVENT_FLIP_SUMMON_NEGATED 1115
#define EVENT_SPSUMMON_NEGATED 1116
#define EVENT_SPSUMMON_NEGATED 1116
#define EVENT_SPSUMMON_SUCCESS_G_P 1117
#define EVENT_CONTROL_CHANGED 1120
#define EVENT_CONTROL_CHANGED 1120
#define EVENT_EQUIP 1121
#define EVENT_EQUIP 1121
#define EVENT_ATTACK_ANNOUNCE 1130
#define EVENT_ATTACK_ANNOUNCE 1130
...
@@ -561,7 +562,13 @@ constexpr int32 HALF_DAMAGE = 0x80000001;
...
@@ -561,7 +562,13 @@ constexpr int32 HALF_DAMAGE = 0x80000001;
#define CODE_PHASE 3 // header + phase_id (12 bits)
#define CODE_PHASE 3 // header + phase_id (12 bits)
#define CODE_VALUE 4 // numeric value, max = 4095
#define CODE_VALUE 4 // numeric value, max = 4095
const
std
::
unordered_set
<
uint32
>
continuous_event
({
EVENT_ADJUST
,
EVENT_BREAK_EFFECT
,
EVENT_TURN_END
});
const
std
::
unordered_set
<
uint32
>
continuous_event
{
EVENT_ADJUST
,
EVENT_BREAK_EFFECT
,
EVENT_TURN_END
,
EVENT_PRE_BATTLE_DAMAGE
,
EVENT_SPSUMMON_SUCCESS_G_P
,
};
bool
is_continuous_event
(
uint32
code
);
bool
is_continuous_event
(
uint32
code
);
#endif
/* EFFECT_H_ */
#endif
/* EFFECT_H_ */
Classes/ocgcore/field.h
View file @
c4f02f36
...
@@ -174,7 +174,8 @@ struct processor {
...
@@ -174,7 +174,8 @@ struct processor {
processor_list
units
;
processor_list
units
;
processor_list
subunits
;
processor_list
subunits
;
processor_unit
reserved
;
processor_unit
damage_step_reserved
;
processor_unit
summon_reserved
;
card_vector
select_cards
;
card_vector
select_cards
;
card_vector
unselect_cards
;
card_vector
unselect_cards
;
card_vector
summonable_cards
;
card_vector
summonable_cards
;
...
@@ -569,6 +570,12 @@ public:
...
@@ -569,6 +570,12 @@ public:
void
operation_replace
(
int32
type
,
int32
step
,
group
*
targets
);
void
operation_replace
(
int32
type
,
int32
step
,
group
*
targets
);
void
select_tribute_cards
(
card
*
target
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint8
toplayer
,
uint32
zone
);
void
select_tribute_cards
(
card
*
target
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint8
toplayer
,
uint32
zone
);
// summon
int32
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
,
uint32
action_type
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
,
uint32
action_type
);
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
action_type
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
,
uint32
action_type
);
int32
remove_counter
(
uint16
step
,
uint32
reason
,
card
*
pcard
,
uint8
rplayer
,
uint8
s
,
uint8
o
,
uint16
countertype
,
uint16
count
);
int32
remove_counter
(
uint16
step
,
uint32
reason
,
card
*
pcard
,
uint8
rplayer
,
uint8
s
,
uint8
o
,
uint16
countertype
,
uint16
count
);
int32
remove_overlay_card
(
uint16
step
,
uint32
reason
,
card
*
pcard
,
uint8
rplayer
,
uint8
s
,
uint8
o
,
uint16
min
,
uint16
max
);
int32
remove_overlay_card
(
uint16
step
,
uint32
reason
,
card
*
pcard
,
uint8
rplayer
,
uint8
s
,
uint8
o
,
uint16
min
,
uint16
max
);
int32
get_control
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
,
uint32
zone
);
int32
get_control
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
,
uint32
zone
);
...
@@ -579,12 +586,8 @@ public:
...
@@ -579,12 +586,8 @@ public:
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
count
);
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
count
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
reason_card
,
uint8
playerid
,
int32
amount
,
uint32
is_step
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
reason_card
,
uint8
playerid
,
int32
amount
,
uint32
is_step
);
int32
recover
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
amount
,
uint32
is_step
);
int32
recover
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
amount
,
uint32
is_step
);
int32
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
,
effect
*
reason_effect
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
,
effect
*
reason_effect
);
int32
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
,
uint8
confirm
,
effect
*
reason_effect
);
int32
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
,
uint8
confirm
,
effect
*
reason_effect
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
int32
destroy_replace
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint8
battle
);
int32
destroy_replace
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint8
battle
);
...
@@ -705,6 +708,10 @@ public:
...
@@ -705,6 +708,10 @@ public:
#define GLOBALFLAG_ACTIVATION_COUNT 0x800
#define GLOBALFLAG_ACTIVATION_COUNT 0x800
//
//
//summon action type
#define SUMMON_IN_IDLE 0
#define SUMMON_IN_CHAIN 1
#define PROCESSOR_ADJUST 1
#define PROCESSOR_ADJUST 1
#define PROCESSOR_HINT 2
#define PROCESSOR_HINT 2
#define PROCESSOR_TURN 3
#define PROCESSOR_TURN 3
...
...
Classes/ocgcore/libduel.cpp
View file @
c4f02f36
...
@@ -301,7 +301,8 @@ int32 scriptlib::duel_summon(lua_State *L) {
...
@@ -301,7 +301,8 @@ int32 scriptlib::duel_summon(lua_State *L) {
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
.
arg3
=
SUMMON_IN_CHAIN
;
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
}
}
...
@@ -324,7 +325,8 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) {
...
@@ -324,7 +325,8 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) {
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
sumtype
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
sumtype
);
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
.
arg3
=
SUMMON_IN_CHAIN
;
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
}
}
...
@@ -368,7 +370,8 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
...
@@ -368,7 +370,8 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_SYNCHRO
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_SYNCHRO
);
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
.
arg3
=
SUMMON_IN_CHAIN
;
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
}
}
...
@@ -404,7 +407,8 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
...
@@ -404,7 +407,8 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
.
arg3
=
SUMMON_IN_CHAIN
;
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
}
}
...
@@ -448,7 +452,8 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
...
@@ -448,7 +452,8 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_LINK
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_LINK
);
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
.
arg3
=
SUMMON_IN_CHAIN
;
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
}
}
...
@@ -480,7 +485,8 @@ int32 scriptlib::duel_setm(lua_State *L) {
...
@@ -480,7 +485,8 @@ int32 scriptlib::duel_setm(lua_State *L) {
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
mset
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
mset
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
summon_reserved
.
arg3
=
SUMMON_IN_CHAIN
;
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
}
}
...
...
Classes/ocgcore/operations.cpp
View file @
c4f02f36
...
@@ -1412,9 +1412,6 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
...
@@ -1412,9 +1412,6 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
if
(
equip_card
->
get_type
()
&
TYPE_TRAP
)
{
if
(
equip_card
->
get_type
()
&
TYPE_TRAP
)
{
peffect
->
code
=
EFFECT_ADD_TYPE
;
peffect
->
code
=
EFFECT_ADD_TYPE
;
peffect
->
value
=
TYPE_EQUIP
;
peffect
->
value
=
TYPE_EQUIP
;
}
else
if
(
equip_card
->
data
.
type
&
TYPE_UNION
)
{
peffect
->
code
=
EFFECT_CHANGE_TYPE
;
peffect
->
value
=
TYPE_EQUIP
+
TYPE_SPELL
+
TYPE_UNION
;
}
else
{
}
else
{
peffect
->
code
=
EFFECT_CHANGE_TYPE
;
peffect
->
code
=
EFFECT_CHANGE_TYPE
;
peffect
->
value
=
TYPE_EQUIP
+
TYPE_SPELL
;
peffect
->
value
=
TYPE_EQUIP
+
TYPE_SPELL
;
...
@@ -1454,7 +1451,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
...
@@ -1454,7 +1451,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
int32
field
::
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
,
uint32
action_type
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
if
(
!
target
->
is_summonable_card
())
if
(
!
target
->
is_summonable_card
())
...
@@ -1954,7 +1951,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1954,7 +1951,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
process_single_event
();
process_single_event
();
raise_event
(
target
,
EVENT_SUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_event
(
target
,
EVENT_SUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
process_instant_event
();
process_instant_event
();
if
(
core
.
current_chain
.
size
()
==
0
)
{
if
(
action_type
==
SUMMON_IN_IDLE
)
{
adjust_all
();
adjust_all
();
core
.
hint_timing
[
sumplayer
]
|=
TIMING_SUMMON
;
core
.
hint_timing
[
sumplayer
]
|=
TIMING_SUMMON
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
...
@@ -1964,7 +1961,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1964,7 +1961,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
)
{
int32
field
::
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
action_type
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
if
(
target
->
current
.
location
!=
LOCATION_MZONE
)
if
(
target
->
current
.
location
!=
LOCATION_MZONE
)
...
@@ -2050,7 +2047,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2050,7 +2047,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
raise_event
(
target
,
EVENT_CHANGE_POS
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_event
(
target
,
EVENT_CHANGE_POS
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
process_instant_event
();
process_instant_event
();
adjust_all
();
adjust_all
();
if
(
core
.
current_chain
.
size
()
==
0
)
{
if
(
action_type
==
SUMMON_IN_IDLE
)
{
core
.
hint_timing
[
sumplayer
]
|=
TIMING_FLIPSUMMON
;
core
.
hint_timing
[
sumplayer
]
|=
TIMING_FLIPSUMMON
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
}
}
...
@@ -2059,7 +2056,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2059,7 +2056,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
mset
(
uint16
step
,
uint8
setplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
int32
field
::
mset
(
uint16
step
,
uint8
setplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
,
uint32
action_type
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
if
(
!
target
->
is_summonable_card
())
if
(
!
target
->
is_summonable_card
())
...
@@ -2387,7 +2384,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
...
@@ -2387,7 +2384,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
adjust_instant
();
adjust_instant
();
raise_event
(
target
,
EVENT_MSET
,
proc
,
0
,
setplayer
,
setplayer
,
0
);
raise_event
(
target
,
EVENT_MSET
,
proc
,
0
,
setplayer
,
setplayer
,
0
);
process_instant_event
();
process_instant_event
();
if
(
core
.
current_chain
.
size
()
==
0
)
{
if
(
action_type
==
SUMMON_IN_IDLE
)
{
adjust_all
();
adjust_all
();
core
.
hint_timing
[
setplayer
]
|=
TIMING_MSET
;
core
.
hint_timing
[
setplayer
]
|=
TIMING_MSET
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
FALSE
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
FALSE
);
...
@@ -2667,7 +2664,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
...
@@ -2667,7 +2664,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
)
{
int32
field
::
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
,
uint32
action_type
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
effect_set
eset
;
effect_set
eset
;
...
@@ -2951,7 +2948,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2951,7 +2948,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
process_single_event
();
process_single_event
();
raise_event
(
target
,
EVENT_SPSUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_event
(
target
,
EVENT_SPSUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
process_instant_event
();
process_instant_event
();
if
(
core
.
current_chain
.
size
()
==
0
)
{
if
(
action_type
==
SUMMON_IN_IDLE
)
{
adjust_all
();
adjust_all
();
core
.
hint_timing
[
sumplayer
]
|=
TIMING_SPSUMMON
;
core
.
hint_timing
[
sumplayer
]
|=
TIMING_SPSUMMON
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
...
@@ -2959,6 +2956,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2959,6 +2956,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return
TRUE
;
return
TRUE
;
}
}
case
20
:
{
case
20
:
{
// EFFECT_SPSUMMON_PROC_G (Pendulum Summon)
effect
*
peffect
=
core
.
units
.
begin
()
->
peffect
;
effect
*
peffect
=
core
.
units
.
begin
()
->
peffect
;
core
.
units
.
begin
()
->
ptarget
=
pduel
->
new_group
();
core
.
units
.
begin
()
->
ptarget
=
pduel
->
new_group
();
if
(
peffect
->
operation
)
{
if
(
peffect
->
operation
)
{
...
@@ -3128,6 +3126,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -3128,6 +3126,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return
FALSE
;
return
FALSE
;
}
}
case
28
:
{
case
28
:
{
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
raise_event
(
&
pgroup
->
container
,
EVENT_SPSUMMON_SUCCESS_G_P
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
process_instant_event
();
adjust_all
();
return
FALSE
;
}
case
29
:
{
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
set_spsummon_counter
(
sumplayer
);
set_spsummon_counter
(
sumplayer
);
...
@@ -3145,7 +3150,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -3145,7 +3150,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
process_single_event
();
process_single_event
();
raise_event
(
&
pgroup
->
container
,
EVENT_SPSUMMON_SUCCESS
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_event
(
&
pgroup
->
container
,
EVENT_SPSUMMON_SUCCESS
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
process_instant_event
();
process_instant_event
();
if
(
core
.
current_chain
.
size
()
==
0
)
{
if
(
action_type
==
SUMMON_IN_IDLE
)
{
adjust_all
();
adjust_all
();
core
.
hint_timing
[
sumplayer
]
|=
TIMING_SPSUMMON
;
core
.
hint_timing
[
sumplayer
]
|=
TIMING_SPSUMMON
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
...
...
Classes/ocgcore/processor.cpp
View file @
c4f02f36
...
@@ -364,14 +364,14 @@ uint32 field::process() {
...
@@ -364,14 +364,14 @@ uint32 field::process() {
return
pduel
->
message_buffer
.
size
();
return
pduel
->
message_buffer
.
size
();
}
}
case
PROCESSOR_SUMMON_RULE
:
{
case
PROCESSOR_SUMMON_RULE
:
{
if
(
summon
(
it
->
step
,
it
->
arg1
&
0xff
,
(
card
*
)
it
->
ptarget
,
it
->
peffect
,
(
it
->
arg1
>>
8
)
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg1
>>
24
)
&
0xff
))
if
(
summon
(
it
->
step
,
it
->
arg1
&
0xff
,
(
card
*
)
it
->
ptarget
,
it
->
peffect
,
(
it
->
arg1
>>
8
)
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg1
>>
24
)
&
0xff
,
it
->
arg3
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
++
it
->
step
;
++
it
->
step
;
return
pduel
->
message_buffer
.
size
();
return
pduel
->
message_buffer
.
size
();
}
}
case
PROCESSOR_SPSUMMON_RULE
:
{
case
PROCESSOR_SPSUMMON_RULE
:
{
if
(
special_summon_rule
(
it
->
step
,
it
->
arg1
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
))
if
(
special_summon_rule
(
it
->
step
,
it
->
arg1
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
,
it
->
arg3
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
++
it
->
step
;
++
it
->
step
;
...
@@ -385,14 +385,14 @@ uint32 field::process() {
...
@@ -385,14 +385,14 @@ uint32 field::process() {
return
pduel
->
message_buffer
.
size
();
return
pduel
->
message_buffer
.
size
();
}
}
case
PROCESSOR_FLIP_SUMMON
:
{
case
PROCESSOR_FLIP_SUMMON
:
{
if
(
flip_summon
(
it
->
step
,
it
->
arg1
,
(
card
*
)(
it
->
ptarget
)))
if
(
flip_summon
(
it
->
step
,
it
->
arg1
,
(
card
*
)(
it
->
ptarget
)
,
it
->
arg3
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
++
it
->
step
;
++
it
->
step
;
return
pduel
->
message_buffer
.
size
();
return
pduel
->
message_buffer
.
size
();
}
}
case
PROCESSOR_MSET
:
{
case
PROCESSOR_MSET
:
{
if
(
mset
(
it
->
step
,
it
->
arg1
&
0xff
,
(
card
*
)
it
->
ptarget
,
it
->
peffect
,
(
it
->
arg1
>>
8
)
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg1
>>
24
)
&
0xff
))
if
(
mset
(
it
->
step
,
it
->
arg1
&
0xff
,
(
card
*
)
it
->
ptarget
,
it
->
peffect
,
(
it
->
arg1
>>
8
)
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg1
>>
24
)
&
0xff
,
it
->
arg3
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
++
it
->
step
;
++
it
->
step
;
...
@@ -3120,7 +3120,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3120,7 +3120,7 @@ int32 field::process_battle_command(uint16 step) {
process_single_event
();
process_single_event
();
process_instant_event
();
process_instant_event
();
if
(
core
.
effect_damage_step
)
{
if
(
core
.
effect_damage_step
)
{
core
.
reserved
.
ptr1
=
core
.
units
.
begin
()
->
ptarget
;
core
.
damage_step_
reserved
.
ptr1
=
core
.
units
.
begin
()
->
ptarget
;
return
TRUE
;
return
TRUE
;
}
}
core
.
units
.
begin
()
->
step
=
32
;
core
.
units
.
begin
()
->
step
=
32
;
...
@@ -3305,7 +3305,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
...
@@ -3305,7 +3305,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
infos
.
phase
=
PHASE_DAMAGE_CAL
;
infos
.
phase
=
PHASE_DAMAGE_CAL
;
add_process
(
PROCESSOR_BATTLE_COMMAND
,
26
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_BATTLE_COMMAND
,
26
,
0
,
0
,
0
,
0
);
core
.
units
.
begin
()
->
step
=
2
;
core
.
units
.
begin
()
->
step
=
2
;
core
.
reserved
=
core
.
units
.
front
();
core
.
damage_step_
reserved
=
core
.
units
.
front
();
return
TRUE
;
return
TRUE
;
}
}
case
2
:
{
case
2
:
{
...
@@ -4487,7 +4487,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4487,7 +4487,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
return
FALSE
;
return
FALSE
;
}
}
if
(
core
.
summoning_card
)
if
(
core
.
summoning_card
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
subunits
.
push_back
(
core
.
summon_
reserved
);
core
.
summoning_card
=
0
;
core
.
summoning_card
=
0
;
core
.
units
.
begin
()
->
step
=
-
1
;
core
.
units
.
begin
()
->
step
=
-
1
;
return
FALSE
;
return
FALSE
;
...
@@ -4511,8 +4511,10 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4511,8 +4511,10 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core
.
chain_limit_p
.
clear
();
core
.
chain_limit_p
.
clear
();
core
.
effect_count_code_chain
.
clear
();
core
.
effect_count_code_chain
.
clear
();
reset_chain
();
reset_chain
();
if
(
core
.
summoning_card
||
core
.
effect_damage_step
==
1
)
if
(
core
.
summoning_card
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
subunits
.
push_back
(
core
.
summon_reserved
);
if
(
core
.
effect_damage_step
==
1
)
core
.
subunits
.
push_back
(
core
.
damage_step_reserved
);
core
.
summoning_card
=
0
;
core
.
summoning_card
=
0
;
return
FALSE
;
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