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
0fafca17
Commit
0fafca17
authored
Dec 11, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
0446b0bb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+26
-0
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+1
-0
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+6
-6
No files found.
Classes/ocgcore/field.cpp
View file @
0fafca17
...
@@ -2072,6 +2072,32 @@ void field::check_card_counter(card* pcard, int32 counter_type, int32 playerid)
...
@@ -2072,6 +2072,32 @@ void field::check_card_counter(card* pcard, int32 counter_type, int32 playerid)
}
}
}
}
}
}
void
field
::
check_card_counter
(
group
*
pgroup
,
int32
counter_type
,
int32
playerid
)
{
auto
&
counter_map
=
(
counter_type
==
1
)
?
core
.
summon_counter
:
(
counter_type
==
2
)
?
core
.
normalsummon_counter
:
(
counter_type
==
3
)
?
core
.
spsummon_counter
:
(
counter_type
==
4
)
?
core
.
flipsummon_counter
:
core
.
attack_counter
;
for
(
auto
&
iter
:
counter_map
)
{
auto
&
info
=
iter
.
second
;
if
((
playerid
==
0
)
&&
(
info
.
second
&
0xffff
)
!=
0
)
continue
;
if
((
playerid
==
1
)
&&
(
info
.
second
&
0xffff0000
)
!=
0
)
continue
;
if
(
info
.
first
)
{
for
(
auto
&
pcard
:
pgroup
->
container
)
{
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
1
))
{
if
(
playerid
==
0
)
info
.
second
+=
0x1
;
else
info
.
second
+=
0x10000
;
break
;
}
}
}
}
}
void
field
::
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
,
bool
cancel
)
{
void
field
::
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
,
bool
cancel
)
{
for
(
auto
&
iter
:
core
.
chain_counter
)
{
for
(
auto
&
iter
:
core
.
chain_counter
)
{
auto
&
info
=
iter
.
second
;
auto
&
info
=
iter
.
second
;
...
...
Classes/ocgcore/field.h
View file @
0fafca17
...
@@ -416,6 +416,7 @@ public:
...
@@ -416,6 +416,7 @@ public:
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
,
uint8
location
,
card
*
icard
=
0
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
,
uint8
location
,
card
*
icard
=
0
);
int32
check_spsummon_once
(
card
*
pcard
,
uint8
playerid
);
int32
check_spsummon_once
(
card
*
pcard
,
uint8
playerid
);
void
check_card_counter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
);
void
check_card_counter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
);
void
check_card_counter
(
group
*
pgroup
,
int32
counter_type
,
int32
playerid
);
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
,
bool
add
=
true
,
bool
chain
=
false
);
void
set_spsummon_counter
(
uint8
playerid
,
bool
add
=
true
,
bool
chain
=
false
);
int32
check_spsummon_counter
(
uint8
playerid
,
uint8
ct
=
1
);
int32
check_spsummon_counter
(
uint8
playerid
,
uint8
ct
=
1
);
...
...
Classes/ocgcore/operations.cpp
View file @
0fafca17
...
@@ -1800,8 +1800,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1800,8 +1800,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
pduel
->
write_buffer32
(
target
->
get_info_location
());
pduel
->
write_buffer32
(
target
->
get_info_location
());
core
.
summon_state_count
[
sumplayer
]
++
;
core
.
summon_state_count
[
sumplayer
]
++
;
core
.
normalsummon_state_count
[
sumplayer
]
++
;
core
.
normalsummon_state_count
[
sumplayer
]
++
;
check_card_counter
(
target
,
1
,
sumplayer
);
check_card_counter
(
target
,
2
,
sumplayer
);
if
(
target
->
material_cards
.
size
())
{
if
(
target
->
material_cards
.
size
())
{
for
(
auto
&
mcard
:
target
->
material_cards
)
for
(
auto
&
mcard
:
target
->
material_cards
)
raise_single_event
(
mcard
,
0
,
EVENT_BE_PRE_MATERIAL
,
proc
,
REASON_SUMMON
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
mcard
,
0
,
EVENT_BE_PRE_MATERIAL
,
proc
,
REASON_SUMMON
,
sumplayer
,
sumplayer
,
0
);
...
@@ -1876,6 +1874,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1876,6 +1874,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
return
FALSE
;
return
FALSE
;
}
}
case
17
:
{
case
17
:
{
check_card_counter
(
target
,
1
,
sumplayer
);
check_card_counter
(
target
,
2
,
sumplayer
);
raise_single_event
(
target
,
0
,
EVENT_SUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
target
,
0
,
EVENT_SUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
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
);
...
@@ -1915,7 +1915,6 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -1915,7 +1915,6 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
target
->
fieldid
=
infos
.
field_id
++
;
target
->
fieldid
=
infos
.
field_id
++
;
core
.
phase_action
=
TRUE
;
core
.
phase_action
=
TRUE
;
core
.
flipsummon_state_count
[
sumplayer
]
++
;
core
.
flipsummon_state_count
[
sumplayer
]
++
;
check_card_counter
(
target
,
4
,
sumplayer
);
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
get_info_location
());
pduel
->
write_buffer32
(
target
->
get_info_location
());
...
@@ -1948,6 +1947,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -1948,6 +1947,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
}
}
case
4
:
{
case
4
:
{
pduel
->
write_buffer8
(
MSG_FLIPSUMMONED
);
pduel
->
write_buffer8
(
MSG_FLIPSUMMONED
);
check_card_counter
(
target
,
4
,
sumplayer
);
adjust_instant
();
adjust_instant
();
raise_single_event
(
target
,
0
,
EVENT_FLIP
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
target
,
0
,
EVENT_FLIP
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
target
,
0
,
EVENT_FLIP_SUMMON_SUCCESS
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
target
,
0
,
EVENT_FLIP_SUMMON_SUCCESS
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
...
@@ -2587,7 +2587,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2587,7 +2587,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
target
->
current
.
reason_player
=
sumplayer
;
target
->
current
.
reason_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
set_spsummon_counter
(
sumplayer
);
set_spsummon_counter
(
sumplayer
);
check_card_counter
(
target
,
3
,
sumplayer
);
if
(
target
->
spsummon_code
)
if
(
target
->
spsummon_code
)
core
.
spsummon_once_map
[
sumplayer
][
target
->
spsummon_code
]
++
;
core
.
spsummon_once_map
[
sumplayer
][
target
->
spsummon_code
]
++
;
break_effect
();
break_effect
();
...
@@ -2694,6 +2693,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2694,6 +2693,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return
FALSE
;
return
FALSE
;
}
}
case
17
:
{
case
17
:
{
check_card_counter
(
target
,
3
,
sumplayer
);
raise_single_event
(
target
,
0
,
EVENT_SPSUMMON_SUCCESS
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_single_event
(
target
,
0
,
EVENT_SPSUMMON_SUCCESS
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
process_single_event
();
process_single_event
();
raise_event
(
target
,
EVENT_SPSUMMON_SUCCESS
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
raise_event
(
target
,
EVENT_SPSUMMON_SUCCESS
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
...
@@ -2757,7 +2757,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2757,7 +2757,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
pcard
->
current
.
reason_player
=
sumplayer
;
pcard
->
current
.
reason_player
=
sumplayer
;
pcard
->
summon_player
=
sumplayer
;
pcard
->
summon_player
=
sumplayer
;
pcard
->
summon_info
=
(
peffect
->
get_value
(
pcard
)
&
0xff00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
pcard
->
current
.
location
<<
16
);
pcard
->
summon_info
=
(
peffect
->
get_value
(
pcard
)
&
0xff00ffff
)
|
SUMMON_TYPE_SPECIAL
|
((
uint32
)
pcard
->
current
.
location
<<
16
);
check_card_counter
(
pcard
,
3
,
sumplayer
);
uint32
zone
=
0xff
;
uint32
zone
=
0xff
;
uint32
flag1
,
flag2
;
uint32
flag1
,
flag2
;
int32
ct1
=
get_tofield_count
(
pcard
,
sumplayer
,
LOCATION_MZONE
,
sumplayer
,
LOCATION_REASON_TOFIELD
,
zone
,
&
flag1
);
int32
ct1
=
get_tofield_count
(
pcard
,
sumplayer
,
LOCATION_MZONE
,
sumplayer
,
LOCATION_REASON_TOFIELD
,
zone
,
&
flag1
);
...
@@ -2854,6 +2853,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2854,6 +2853,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
case
28
:
{
case
28
:
{
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
check_card_counter
(
pgroup
,
3
,
sumplayer
);
for
(
auto
&
pcard
:
pgroup
->
container
)
for
(
auto
&
pcard
:
pgroup
->
container
)
raise_single_event
(
pcard
,
0
,
EVENT_SPSUMMON_SUCCESS
,
pcard
->
current
.
reason_effect
,
0
,
pcard
->
current
.
reason_player
,
pcard
->
summon_player
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_SPSUMMON_SUCCESS
,
pcard
->
current
.
reason_effect
,
0
,
pcard
->
current
.
reason_player
,
pcard
->
summon_player
,
0
);
process_single_event
();
process_single_event
();
...
@@ -2924,7 +2924,6 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
...
@@ -2924,7 +2924,6 @@ int32 field::special_summon_step(uint16 step, group* targets, card* target, uint
if
(
!
targets
)
if
(
!
targets
)
core
.
special_summoning
.
insert
(
target
);
core
.
special_summoning
.
insert
(
target
);
target
->
enable_field_effect
(
false
);
target
->
enable_field_effect
(
false
);
check_card_counter
(
target
,
3
,
target
->
summon_player
);
if
(
targets
&&
core
.
duel_rule
>=
4
)
{
if
(
targets
&&
core
.
duel_rule
>=
4
)
{
uint32
flag1
,
flag2
;
uint32
flag1
,
flag2
;
int32
ct1
=
get_tofield_count
(
target
,
playerid
,
LOCATION_MZONE
,
target
->
summon_player
,
LOCATION_REASON_TOFIELD
,
zone
,
&
flag1
);
int32
ct1
=
get_tofield_count
(
target
,
playerid
,
LOCATION_MZONE
,
target
->
summon_player
,
LOCATION_REASON_TOFIELD
,
zone
,
&
flag1
);
...
@@ -3039,6 +3038,7 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
...
@@ -3039,6 +3038,7 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
case
3
:
{
case
3
:
{
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
for
(
auto
&
pcard
:
targets
->
container
)
{
for
(
auto
&
pcard
:
targets
->
container
)
{
check_card_counter
(
pcard
,
3
,
pcard
->
summon_player
);
if
(
!
(
pcard
->
current
.
position
&
POS_FACEDOWN
))
if
(
!
(
pcard
->
current
.
position
&
POS_FACEDOWN
))
raise_single_event
(
pcard
,
0
,
EVENT_SPSUMMON_SUCCESS
,
pcard
->
current
.
reason_effect
,
0
,
pcard
->
current
.
reason_player
,
pcard
->
summon_player
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_SPSUMMON_SUCCESS
,
pcard
->
current
.
reason_effect
,
0
,
pcard
->
current
.
reason_player
,
pcard
->
summon_player
,
0
);
int32
summontype
=
pcard
->
summon_info
&
0xff000000
;
int32
summontype
=
pcard
->
summon_info
&
0xff000000
;
...
...
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