Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
86fb6525
Commit
86fb6525
authored
Apr 06, 2014
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
02839a74
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
36 deletions
+29
-36
ocgcore/effect.cpp
ocgcore/effect.cpp
+6
-5
ocgcore/effect.h
ocgcore/effect.h
+1
-1
ocgcore/field.cpp
ocgcore/field.cpp
+6
-6
ocgcore/field.h
ocgcore/field.h
+3
-3
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+1
-1
ocgcore/processor.cpp
ocgcore/processor.cpp
+12
-20
No files found.
ocgcore/effect.cpp
View file @
86fb6525
...
@@ -123,11 +123,12 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
...
@@ -123,11 +123,12 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return
FALSE
;
return
FALSE
;
}
else
{
}
else
{
uint32
code
=
count_code
&
0x7fffffff
;
uint32
code
=
count_code
&
0x7fffffff
;
uint32
count
=
(
reset_count
>>
12
)
&
0xf
;
if
(
code
==
1
)
{
if
(
code
==
1
)
{
if
(
pduel
->
game_field
->
get_effect_code
((
count_code
&
0x80000000
)
|
handler
->
fieldid
)
>=
((
reset_count
>>
12
)
&
0xf
)
)
if
(
pduel
->
game_field
->
get_effect_code
((
count_code
&
0x80000000
)
|
handler
->
fieldid
,
PLAYER_NONE
)
>=
count
)
return
false
;
return
false
;
}
else
{
}
else
{
if
(
pduel
->
game_field
->
get_effect_code
(
count_code
)
>=
((
reset_count
>>
12
)
&
0xf
)
)
if
(
pduel
->
game_field
->
get_effect_code
(
count_code
,
playerid
)
>=
count
)
return
false
;
return
false
;
}
}
}
}
...
@@ -477,7 +478,7 @@ int32 effect::reset(uint32 reset_level, uint32 reset_type) {
...
@@ -477,7 +478,7 @@ int32 effect::reset(uint32 reset_level, uint32 reset_type) {
}
}
return
FALSE
;
return
FALSE
;
}
}
void
effect
::
dec_count
()
{
void
effect
::
dec_count
(
uint32
playerid
)
{
if
(
!
(
flag
&
EFFECT_FLAG_COUNT_LIMIT
))
if
(
!
(
flag
&
EFFECT_FLAG_COUNT_LIMIT
))
return
;
return
;
if
(
count_code
==
0
)
{
if
(
count_code
==
0
)
{
...
@@ -487,9 +488,9 @@ void effect::dec_count() {
...
@@ -487,9 +488,9 @@ void effect::dec_count() {
}
else
{
}
else
{
uint32
code
=
count_code
&
0x7fffffff
;
uint32
code
=
count_code
&
0x7fffffff
;
if
(
code
==
1
)
if
(
code
==
1
)
pduel
->
game_field
->
add_effect_code
((
count_code
&
0x80000000
)
|
handler
->
fieldid
);
pduel
->
game_field
->
add_effect_code
((
count_code
&
0x80000000
)
|
handler
->
fieldid
,
PLAYER_NONE
);
else
else
pduel
->
game_field
->
add_effect_code
(
count_code
);
pduel
->
game_field
->
add_effect_code
(
count_code
,
playerid
);
}
}
}
}
void
effect
::
recharge
()
{
void
effect
::
recharge
()
{
...
...
ocgcore/effect.h
View file @
86fb6525
...
@@ -74,7 +74,7 @@ public:
...
@@ -74,7 +74,7 @@ public:
int32
is_immuned
(
effect_set_v
*
effects
);
int32
is_immuned
(
effect_set_v
*
effects
);
int32
is_chainable
(
uint8
tp
);
int32
is_chainable
(
uint8
tp
);
int32
reset
(
uint32
reset_level
,
uint32
reset_type
);
int32
reset
(
uint32
reset_level
,
uint32
reset_type
);
void
dec_count
();
void
dec_count
(
uint32
playerid
=
2
);
void
recharge
();
void
recharge
();
int32
get_value
(
uint32
extraargs
=
0
);
int32
get_value
(
uint32
extraargs
=
0
);
int32
get_value
(
card
*
pcard
,
uint32
extraargs
=
0
);
int32
get_value
(
card
*
pcard
,
uint32
extraargs
=
0
);
...
...
ocgcore/field.cpp
View file @
86fb6525
...
@@ -815,17 +815,17 @@ void field::reset_chain() {
...
@@ -815,17 +815,17 @@ void field::reset_chain() {
(
*
rm
)
->
handler
->
remove_effect
((
*
rm
));
(
*
rm
)
->
handler
->
remove_effect
((
*
rm
));
}
}
}
}
void
field
::
add_effect_code
(
uint32
code
)
{
void
field
::
add_effect_code
(
uint32
code
,
uint32
playerid
)
{
core
.
effect_count_code
[
code
]
++
;
core
.
effect_count_code
[
code
+
(
playerid
<<
30
)
]
++
;
}
}
uint32
field
::
get_effect_code
(
uint32
code
)
{
uint32
field
::
get_effect_code
(
uint32
code
,
uint32
playerid
)
{
auto
iter
=
core
.
effect_count_code
.
find
(
code
);
auto
iter
=
core
.
effect_count_code
.
find
(
code
+
(
playerid
<<
30
)
);
if
(
iter
==
core
.
effect_count_code
.
end
())
if
(
iter
==
core
.
effect_count_code
.
end
())
return
0
;
return
0
;
return
iter
->
second
;
return
iter
->
second
;
}
}
void
field
::
dec_effect_code
(
uint32
code
)
{
void
field
::
dec_effect_code
(
uint32
code
,
uint32
playerid
)
{
auto
iter
=
core
.
effect_count_code
.
find
(
code
);
auto
iter
=
core
.
effect_count_code
.
find
(
code
+
(
playerid
<<
30
)
);
if
(
iter
==
core
.
effect_count_code
.
end
())
if
(
iter
==
core
.
effect_count_code
.
end
())
return
;
return
;
if
(
iter
->
second
>
0
)
if
(
iter
->
second
>
0
)
...
...
ocgcore/field.h
View file @
86fb6525
...
@@ -319,9 +319,9 @@ public:
...
@@ -319,9 +319,9 @@ public:
void
reset_effect
(
uint32
id
,
uint32
reset_type
);
void
reset_effect
(
uint32
id
,
uint32
reset_type
);
void
reset_phase
(
uint32
phase
);
void
reset_phase
(
uint32
phase
);
void
reset_chain
();
void
reset_chain
();
void
add_effect_code
(
uint32
code
);
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
uint32
get_effect_code
(
uint32
code
);
uint32
get_effect_code
(
uint32
code
,
uint32
playerid
);
void
dec_effect_code
(
uint32
code
);
void
dec_effect_code
(
uint32
code
,
uint32
playerid
);
void
filter_field_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_field_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
);
void
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
);
...
...
ocgcore/libduel.cpp
View file @
86fb6525
...
@@ -2554,7 +2554,7 @@ int32 scriptlib::duel_select_disable_field(lua_State * L) {
...
@@ -2554,7 +2554,7 @@ int32 scriptlib::duel_select_disable_field(lua_State * L) {
ct4
=
pduel
->
game_field
->
get_useable_count
(
1
-
playerid
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
,
&
plist
);
ct4
=
pduel
->
game_field
->
get_useable_count
(
1
-
playerid
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
,
&
plist
);
flag
=
(
flag
&
0xffffff
)
|
(
plist
<<
24
);
flag
=
(
flag
&
0xffffff
)
|
(
plist
<<
24
);
}
}
flag
|=
filter
;
flag
|=
filter
|
0xe0e0e0e0
;
if
(
count
>
ct1
+
ct2
+
ct3
+
ct4
)
if
(
count
>
ct1
+
ct2
+
ct3
+
ct4
)
count
=
ct1
+
ct2
+
ct3
+
ct4
;
count
=
ct1
+
ct2
+
ct3
+
ct4
;
if
(
count
==
0
)
if
(
count
==
0
)
...
...
ocgcore/processor.cpp
View file @
86fb6525
...
@@ -1419,7 +1419,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
...
@@ -1419,7 +1419,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
newchain
.
triggering_player
=
infos
.
turn_player
;
newchain
.
triggering_player
=
infos
.
turn_player
;
core
.
new_chains
.
push_back
(
newchain
);
core
.
new_chains
.
push_back
(
newchain
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
infos
.
turn_player
);
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
infos
.
turn_player
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
infos
.
turn_player
);
...
@@ -1557,7 +1557,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
...
@@ -1557,7 +1557,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
newchain
.
triggering_player
=
1
-
infos
.
turn_player
;
newchain
.
triggering_player
=
1
-
infos
.
turn_player
;
core
.
new_chains
.
push_back
(
newchain
);
core
.
new_chains
.
push_back
(
newchain
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
1
-
infos
.
turn_player
);
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
infos
.
turn_player
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
infos
.
turn_player
);
...
@@ -1670,22 +1670,14 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1670,22 +1670,14 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
}
}
core
.
new_fchain_s
.
splice
(
core
.
new_fchain_s
.
begin
(),
core
.
new_fchain
);
core
.
new_fchain_s
.
splice
(
core
.
new_fchain_s
.
begin
(),
core
.
new_fchain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
begin
(),
core
.
new_ochain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
begin
(),
core
.
new_ochain
);
//flip
core
.
tpchain
.
clear
();
core
.
tpchain
.
clear
();
core
.
ntpchain
.
clear
();
core
.
ntpchain
.
clear
();
core
.
delayed_quick
.
clear
();
core
.
delayed_quick
.
clear
();
core
.
delayed_quick_break
.
swap
(
core
.
delayed_quick
);
core
.
delayed_quick_break
.
swap
(
core
.
delayed_quick
);
if
(
core
.
tpchain
.
size
()
>
1
)
core
.
units
.
begin
()
->
step
=
1
;
add_process
(
PROCESSOR_SORT_CHAIN
,
0
,
0
,
0
,
1
,
infos
.
turn_player
);
if
(
core
.
ntpchain
.
size
()
>
1
)
add_process
(
PROCESSOR_SORT_CHAIN
,
0
,
0
,
0
,
0
,
infos
.
turn_player
);
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
core
.
new_chains
.
splice
(
core
.
new_chains
.
end
(),
core
.
tpchain
);
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
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
...
@@ -1727,7 +1719,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1727,7 +1719,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
else
else
core
.
ntpchain
.
push_back
(
*
clit
);
core
.
ntpchain
.
push_back
(
*
clit
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
tp
);
}
}
}
}
if
(
core
.
tpchain
.
size
()
>
1
)
if
(
core
.
tpchain
.
size
()
>
1
)
...
@@ -1826,7 +1818,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1826,7 +1818,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
effect
*
peffect
=
clit
->
triggering_effect
;
effect
*
peffect
=
clit
->
triggering_effect
;
uint8
tp
=
clit
->
triggering_player
;
uint8
tp
=
clit
->
triggering_player
;
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
tp
);
if
(
tp
==
infos
.
turn_player
)
if
(
tp
==
infos
.
turn_player
)
core
.
tpchain
.
push_back
(
*
clit
);
core
.
tpchain
.
push_back
(
*
clit
);
else
else
...
@@ -1947,7 +1939,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
...
@@ -1947,7 +1939,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
if
(
act
){
if
(
act
){
core
.
tpchain
.
push_back
(
ifit
->
second
);
core
.
tpchain
.
push_back
(
ifit
->
second
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
infos
.
turn_player
);
}
}
}
else
{
}
else
{
act
=
true
;
act
=
true
;
...
@@ -1969,7 +1961,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
...
@@ -1969,7 +1961,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
if
(
act
){
if
(
act
){
core
.
ntpchain
.
push_back
(
ifit
->
second
);
core
.
ntpchain
.
push_back
(
ifit
->
second
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
1
-
infos
.
turn_player
);
}
}
}
}
}
}
...
@@ -2142,7 +2134,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
...
@@ -2142,7 +2134,7 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
effect
*
peffect
=
newchain
.
triggering_effect
;
effect
*
peffect
=
newchain
.
triggering_effect
;
core
.
delayed_quick
.
erase
(
make_pair
(
peffect
,
newchain
.
evt
));
core
.
delayed_quick
.
erase
(
make_pair
(
peffect
,
newchain
.
evt
));
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
priority
);
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
priority
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
priority
);
infos
.
priorities
[
0
]
=
0
;
infos
.
priorities
[
0
]
=
0
;
...
@@ -2526,7 +2518,7 @@ int32 field::process_idle_command(uint16 step) {
...
@@ -2526,7 +2518,7 @@ int32 field::process_idle_command(uint16 step) {
newchain
.
triggering_player
=
infos
.
turn_player
;
newchain
.
triggering_player
=
infos
.
turn_player
;
core
.
new_chains
.
push_back
(
newchain
);
core
.
new_chains
.
push_back
(
newchain
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
infos
.
turn_player
);
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
infos
.
turn_player
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
infos
.
turn_player
);
...
@@ -2752,7 +2744,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2752,7 +2744,7 @@ int32 field::process_battle_command(uint16 step) {
newchain
.
triggering_player
=
infos
.
turn_player
;
newchain
.
triggering_player
=
infos
.
turn_player
;
core
.
new_chains
.
push_back
(
newchain
);
core
.
new_chains
.
push_back
(
newchain
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
handler
->
set_status
(
STATUS_CHAINING
,
TRUE
);
peffect
->
dec_count
();
peffect
->
dec_count
(
infos
.
turn_player
);
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_ADD_CHAIN
,
0
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
infos
.
turn_player
);
add_process
(
PROCESSOR_QUICK_EFFECT
,
0
,
0
,
0
,
FALSE
,
1
-
infos
.
turn_player
);
...
@@ -4286,7 +4278,7 @@ int32 field::solve_continuous(uint16 step, effect * peffect, uint8 triggering_pl
...
@@ -4286,7 +4278,7 @@ int32 field::solve_continuous(uint16 step, effect * peffect, uint8 triggering_pl
case
2
:
{
case
2
:
{
if
(
!
peffect
->
operation
)
if
(
!
peffect
->
operation
)
return
FALSE
;
return
FALSE
;
peffect
->
dec_count
();
peffect
->
dec_count
(
triggering_player
);
core
.
sub_solving_event
.
push_back
(
core
.
solving_event
.
front
());
core
.
sub_solving_event
.
push_back
(
core
.
solving_event
.
front
());
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
peffect
,
0
,
triggering_player
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
peffect
,
0
,
triggering_player
,
0
);
return
FALSE
;
return
FALSE
;
...
@@ -4329,7 +4321,7 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
...
@@ -4329,7 +4321,7 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
peffect
->
reset_count
+=
0x100
;
peffect
->
reset_count
+=
0x100
;
}
else
{
}
else
{
if
(
peffect
->
count_code
&
0x80000000
)
if
(
peffect
->
count_code
&
0x80000000
)
dec_effect_code
(
peffect
->
count_code
);
dec_effect_code
(
peffect
->
count_code
,
cait
->
triggering_player
);
}
}
}
}
raise_event
((
card
*
)
0
,
EVENT_CHAIN_NEGATED
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
raise_event
((
card
*
)
0
,
EVENT_CHAIN_NEGATED
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
...
...
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