Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
acb48d40
Commit
acb48d40
authored
Dec 16, 2014
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5e90b8dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
33 deletions
+69
-33
ocgcore/field.cpp
ocgcore/field.cpp
+5
-5
ocgcore/field.h
ocgcore/field.h
+2
-0
ocgcore/processor.cpp
ocgcore/processor.cpp
+62
-28
No files found.
ocgcore/field.cpp
View file @
acb48d40
...
...
@@ -1416,8 +1416,8 @@ void field::CheckCounter(card* pcard, int32 counter_type, int32 playerid) {
(
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
;
for
(
auto
iter
=
counter_map
.
begin
();
iter
!=
counter_map
.
end
();
++
iter
)
{
auto
&
info
=
iter
->
second
;
if
(
info
.
first
)
{
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
if
(
!
pduel
->
lua
->
check_condition
(
info
.
first
,
1
))
{
...
...
@@ -1705,9 +1705,9 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
if
(
mg
)
{
uint32
xyz_level
;
core
.
xmaterial_lst
.
clear
();
for
(
auto
cit
:
mg
->
container
)
{
if
((
xyz_level
=
cit
->
check_xyz_level
(
scard
,
lv
))
&&
(
findex
==
0
||
pduel
->
lua
->
check_matching
(
cit
,
findex
,
0
)))
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
((
xyz_level
>>
12
)
&
0xf
,
cit
));
for
(
auto
cit
=
mg
->
container
.
begin
();
cit
!=
mg
->
container
.
end
();
++
cit
)
{
if
((
xyz_level
=
(
*
cit
)
->
check_xyz_level
(
scard
,
lv
))
&&
(
findex
==
0
||
pduel
->
lua
->
check_matching
(
*
cit
,
findex
,
0
)))
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
((
xyz_level
>>
12
)
&
0xf
,
*
cit
));
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
auto
iter
=
core
.
xmaterial_lst
.
begin
();
...
...
ocgcore/field.h
View file @
acb48d40
...
...
@@ -180,6 +180,7 @@ struct processor {
chain_list
new_ochain_b
;
chain_list
new_ochain_h
;
chain_list
new_chains
;
chain_list
tmp_chain
;
delayed_effect_collection
delayed_quick_tmp
;
delayed_effect_collection
delayed_quick_break
;
delayed_effect_collection
delayed_quick
;
...
...
@@ -270,6 +271,7 @@ struct processor {
uint8
battle_phase_count
[
2
];
uint8
phase_action
;
uint32
hint_timing
[
2
];
uint8
current_player
;
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
>
>
spsummon_counter
;
...
...
ocgcore/processor.cpp
View file @
acb48d40
...
...
@@ -1727,6 +1727,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
core
.
ntpchain
.
clear
();
core
.
delayed_quick
.
clear
();
core
.
delayed_quick_break
.
swap
(
core
.
delayed_quick
);
core
.
current_player
=
infos
.
turn_player
;
core
.
units
.
begin
()
->
step
=
1
;
return
FALSE
;
}
...
...
@@ -1775,18 +1776,30 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
peffect
->
dec_count
(
tp
);
}
}
core
.
new_fchain_s
.
clear
();
if
(
core
.
current_player
==
infos
.
turn_player
){
if
(
core
.
tpchain
.
size
()
>
1
)
add_process
(
PROCESSOR_SORT_CHAIN
,
0
,
0
,
0
,
1
,
infos
.
turn_player
);
}
else
{
if
(
core
.
ntpchain
.
size
()
>
1
)
add_process
(
PROCESSOR_SORT_CHAIN
,
0
,
0
,
0
,
0
,
infos
.
turn_player
);
core
.
new_fchain_s
.
clear
();
}
return
FALSE
;
}
case
3
:
{
if
(
core
.
current_player
==
infos
.
turn_player
){
core
.
new_chains
.
splice
(
core
.
new_chains
.
end
(),
core
.
tpchain
);
if
(
core
.
new_chains
.
size
())
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
core
.
current_player
=
1
-
infos
.
turn_player
;
core
.
units
.
begin
()
->
step
=
1
;
}
else
{
core
.
new_chains
.
splice
(
core
.
new_chains
.
end
(),
core
.
ntpchain
);
if
(
core
.
new_chains
.
size
())
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
}
return
FALSE
;
}
case
4
:
{
...
...
@@ -1816,14 +1829,21 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
tpchain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
ntpchain
);
core
.
new_ochain_h
.
clear
();
core
.
tmp_chain
.
clear
();
core
.
current_player
=
infos
.
turn_player
;
return
FALSE
;
}
case
5
:
{
if
(
core
.
new_ochain_s
.
size
()
==
0
)
{
if
(
core
.
current_player
==
infos
.
turn_player
){
if
(
core
.
tpchain
.
size
()
>
1
)
add_process
(
PROCESSOR_SORT_CHAIN
,
0
,
0
,
0
,
1
,
infos
.
turn_player
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
tmp_chain
);
}
else
{
if
(
core
.
ntpchain
.
size
()
>
1
)
add_process
(
PROCESSOR_SORT_CHAIN
,
0
,
0
,
0
,
0
,
infos
.
turn_player
);
}
core
.
units
.
begin
()
->
step
=
6
;
return
FALSE
;
}
...
...
@@ -1861,8 +1881,14 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
}
else
act
=
false
;
}
else
act
=
false
;
if
(
act
)
if
(
act
){
if
(
tp
==
core
.
current_player
)
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
peffect
->
handler
,
tp
,
0
);
else
{
core
.
tmp_chain
.
push_back
(
*
clit
);
returns
.
ivalue
[
0
]
=
FALSE
;
}
}
else
returns
.
ivalue
[
0
]
=
FALSE
;
return
FALSE
;
}
...
...
@@ -1941,10 +1967,18 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return
FALSE
;
}
case
7
:
{
if
(
core
.
current_player
==
infos
.
turn_player
){
core
.
new_chains
.
splice
(
core
.
new_chains
.
end
(),
core
.
tpchain
);
if
(
core
.
new_chains
.
size
())
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
core
.
current_player
=
1
-
infos
.
turn_player
;
core
.
units
.
begin
()
->
step
=
4
;
}
else
{
core
.
new_chains
.
splice
(
core
.
new_chains
.
end
(),
core
.
ntpchain
);
if
(
core
.
new_chains
.
size
())
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
}
return
FALSE
;
}
case
8
:
{
...
...
@@ -4001,16 +4035,16 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
for
(
auto
rit
=
effects
.
rechargeable
.
begin
();
rit
!=
effects
.
rechargeable
.
end
();
++
rit
)
if
(
!
((
*
rit
)
->
flag
&
EFFECT_FLAG_NO_TURN_RESET
))
(
*
rit
)
->
recharge
();
for
(
auto
&
iter
:
core
.
summon_coun
ter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
normalsummon_coun
ter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
spsummon_coun
ter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
flipsummon_coun
ter
)
iter
.
second
.
second
=
0
;
for
(
auto
&
iter
:
core
.
attack_coun
ter
)
iter
.
second
.
second
=
0
;
for
(
auto
iter
=
core
.
summon_counter
.
begin
();
iter
!=
core
.
summon_counter
.
end
();
++
i
ter
)
iter
->
second
.
second
=
0
;
for
(
auto
iter
=
core
.
normalsummon_counter
.
begin
();
iter
!=
core
.
normalsummon_counter
.
end
();
++
i
ter
)
iter
->
second
.
second
=
0
;
for
(
auto
iter
=
core
.
spsummon_counter
.
begin
();
iter
!=
core
.
spsummon_counter
.
end
();
++
i
ter
)
iter
->
second
.
second
=
0
;
for
(
auto
iter
=
core
.
flipsummon_counter
.
begin
();
iter
!=
core
.
flipsummon_counter
.
end
();
++
i
ter
)
iter
->
second
.
second
=
0
;
for
(
auto
iter
=
core
.
attack_counter
.
begin
();
iter
!=
core
.
attack_counter
.
end
();
++
i
ter
)
iter
->
second
.
second
=
0
;
infos
.
turn_id
++
;
infos
.
turn_player
=
turn_player
;
pduel
->
write_buffer8
(
MSG_NEW_TURN
);
...
...
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