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
56cbba98
Commit
56cbba98
authored
May 16, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5eb9b56e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
62 deletions
+74
-62
ocgcore/field.h
ocgcore/field.h
+3
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+50
-1
ocgcore/processor.cpp
ocgcore/processor.cpp
+21
-57
script/c20426907.lua
script/c20426907.lua
+0
-1
script/c32919136.lua
script/c32919136.lua
+0
-1
script/c61965407.lua
script/c61965407.lua
+0
-1
script/c94432298.lua
script/c94432298.lua
+0
-1
No files found.
ocgcore/field.h
View file @
56cbba98
...
@@ -191,6 +191,7 @@ struct processor {
...
@@ -191,6 +191,7 @@ struct processor {
card_set
special_summoning
;
card_set
special_summoning
;
card_set
equiping_cards
;
card_set
equiping_cards
;
card_set
control_adjust_set
[
2
];
card_set
control_adjust_set
[
2
];
card_set
self_destroy_set
;
card_set
release_cards
;
card_set
release_cards
;
card_set
release_cards_ex
;
card_set
release_cards_ex
;
card_set
release_cards_ex_sum
;
card_set
release_cards_ex_sum
;
...
@@ -476,6 +477,7 @@ public:
...
@@ -476,6 +477,7 @@ public:
int32
get_control
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
);
int32
get_control
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
);
int32
swap_control
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
card
*
pcard1
,
card
*
pcard2
,
uint16
reset_phase
,
uint8
reset_count
);
int32
swap_control
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
card
*
pcard1
,
card
*
pcard2
,
uint16
reset_phase
,
uint8
reset_count
);
int32
control_adjust
(
uint16
step
);
int32
control_adjust
(
uint16
step
);
int32
self_destroy
(
uint16
step
);
int32
equip
(
uint16
step
,
uint8
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
);
int32
equip
(
uint16
step
,
uint8
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
);
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
count
);
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
count
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
pcard
,
uint8
playerid
,
uint32
amount
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
pcard
,
uint8
playerid
,
uint32
amount
);
...
@@ -646,6 +648,7 @@ public:
...
@@ -646,6 +648,7 @@ public:
#define PROCESSOR_GET_CONTROL 74
#define PROCESSOR_GET_CONTROL 74
#define PROCESSOR_SWAP_CONTROL 75
#define PROCESSOR_SWAP_CONTROL 75
#define PROCESSOR_CONTROL_ADJUST 76
#define PROCESSOR_CONTROL_ADJUST 76
#define PROCESSOR_SELF_DESTROY 77
#define PROCESSOR_PAY_LPCOST 80
#define PROCESSOR_PAY_LPCOST 80
#define PROCESSOR_REMOVE_COUNTER 81
#define PROCESSOR_REMOVE_COUNTER 81
#define PROCESSOR_ATTACK_DISABLE 82
#define PROCESSOR_ATTACK_DISABLE 82
...
...
ocgcore/operations.cpp
View file @
56cbba98
...
@@ -896,6 +896,7 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play
...
@@ -896,6 +896,7 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play
int32
field
::
control_adjust
(
uint16
step
)
{
int32
field
::
control_adjust
(
uint16
step
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
core
.
destroy_set
.
clear
();
core
.
operated_set
.
clear
();
core
.
operated_set
.
clear
();
uint32
b0
=
get_useable_count
(
0
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
);
uint32
b0
=
get_useable_count
(
0
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
);
uint32
b1
=
get_useable_count
(
1
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
);
uint32
b1
=
get_useable_count
(
1
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
);
...
@@ -948,7 +949,6 @@ int32 field::control_adjust(uint16 step) {
...
@@ -948,7 +949,6 @@ int32 field::control_adjust(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
core
.
destroy_set
.
clear
();
uint8
adjp
=
core
.
temp_var
[
0
];
uint8
adjp
=
core
.
temp_var
[
0
];
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
...
@@ -1028,6 +1028,55 @@ int32 field::control_adjust(uint16 step) {
...
@@ -1028,6 +1028,55 @@ int32 field::control_adjust(uint16 step) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
self_destroy
(
uint16
step
)
{
switch
(
step
)
{
case
0
:
{
effect
*
peffect
;
core
.
destroy_set
.
clear
();
for
(
auto
cit
=
core
.
self_destroy_set
.
begin
();
cit
!=
core
.
self_destroy_set
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
->
is_position
(
POS_FACEUP
)
&&
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
((
!
pcard
->
is_status
(
STATUS_DISABLED
)
&&
(
peffect
=
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
)))
||
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_DESTROY
))))
{
core
.
destroy_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
if
(
core
.
destroy_set
.
size
())
destroy
(
&
core
.
destroy_set
,
0
,
REASON_EFFECT
,
5
);
else
returns
.
ivalue
[
0
]
=
0
;
return
FALSE
;
}
case
1
:
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SELF_TOGRAVE
))
return
TRUE
;
core
.
units
.
begin
()
->
arg1
=
returns
.
ivalue
[
0
];
effect
*
peffect
;
card_set
tograve_set
;
for
(
auto
cit
=
core
.
self_destroy_set
.
begin
();
cit
!=
core
.
self_destroy_set
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
->
is_position
(
POS_FACEUP
)
&&
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_TOGRAVE
)))
{
tograve_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
if
(
tograve_set
.
size
())
send_to
(
&
tograve_set
,
0
,
REASON_EFFECT
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
else
return
TRUE
;
return
FALSE
;
}
case
2
:
{
returns
.
ivalue
[
0
]
+=
core
.
units
.
begin
()
->
arg1
;
return
TRUE
;
}
}
return
TRUE
;
}
int32
field
::
equip
(
uint16
step
,
uint8
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
)
{
int32
field
::
equip
(
uint16
step
,
uint8
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
...
...
ocgcore/processor.cpp
View file @
56cbba98
...
@@ -460,6 +460,13 @@ int32 field::process() {
...
@@ -460,6 +460,13 @@ int32 field::process() {
it
->
step
++
;
it
->
step
++
;
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SELF_DESTROY
:
{
if
(
self_destroy
(
it
->
step
))
{
core
.
units
.
pop_front
();
}
else
it
->
step
++
;
return
pduel
->
bufferlen
;
}
case
PROCESSOR_PAY_LPCOST
:
{
case
PROCESSOR_PAY_LPCOST
:
{
if
(
pay_lp_cost
(
it
->
step
,
it
->
arg1
,
it
->
arg2
))
if
(
pay_lp_cost
(
it
->
step
,
it
->
arg1
,
it
->
arg2
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
...
@@ -4727,6 +4734,9 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4727,6 +4734,9 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
}
}
}
}
adjust_instant
();
adjust_instant
();
core
.
self_destroy_set
.
clear
();
core
.
self_destroy_set
.
insert
(
pcard
);
add_process
(
PROCESSOR_SELF_DESTROY
,
0
,
0
,
0
,
0
,
0
);
}
}
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
process_instant_event
();
process_instant_event
();
...
@@ -5318,77 +5328,31 @@ int32 field::adjust_step(uint16 step) {
...
@@ -5318,77 +5328,31 @@ int32 field::adjust_step(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
//self destroy
//self destroy
uint8
tp
=
infos
.
turn_player
;
core
.
self_destroy_set
.
clear
();
effect
*
peffect
;
core
.
destroy_set
.
clear
();
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
tp
].
list_mzone
[
i
];
card
*
pcard
=
player
[
p
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
((
!
pcard
->
is_status
(
STATUS_DISABLED
)
&&
(
peffect
=
check_unique_onfield
(
pcard
,
tp
)))
if
(
pcard
)
||
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_DESTROY
))))
{
core
.
self_destroy_set
.
insert
(
pcard
);
core
.
destroy_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
}
for
(
uint8
i
=
0
;
i
<
8
;
++
i
)
{
for
(
uint8
i
=
0
;
i
<
8
;
++
i
)
{
card
*
pcard
=
player
[
tp
].
list_szone
[
i
];
card
*
pcard
=
player
[
p
].
list_szone
[
i
];
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
((
!
pcard
->
is_status
(
STATUS_DISABLED
)
&&
(
peffect
=
check_unique_onfield
(
pcard
,
tp
)))
if
(
pcard
)
||
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_DESTROY
))))
{
core
.
self_destroy_set
.
insert
(
pcard
);
core
.
destroy_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
}
tp
=
1
-
tp
;
}
if
(
core
.
destroy_set
.
size
())
{
destroy
(
&
core
.
destroy_set
,
0
,
REASON_EFFECT
,
5
);
}
else
{
returns
.
ivalue
[
0
]
=
0
;
}
}
if
(
core
.
self_destroy_set
.
size
())
add_process
(
PROCESSOR_SELF_DESTROY
,
0
,
0
,
0
,
0
,
0
);
else
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
return
FALSE
;
}
}
case
9
:
{
case
9
:
{
if
(
returns
.
ivalue
[
0
]
>
0
)
if
(
returns
.
ivalue
[
0
]
>
0
)
core
.
re_adjust
=
TRUE
;
core
.
re_adjust
=
TRUE
;
//self tograve
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SELF_TOGRAVE
))
{
returns
.
ivalue
[
0
]
=
0
;
return
FALSE
;
}
uint8
tp
=
infos
.
turn_player
;
effect
*
peffect
;
card_set
tograve_set
;
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
tp
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_TOGRAVE
)))
{
tograve_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
for
(
uint8
i
=
0
;
i
<
8
;
++
i
)
{
card
*
pcard
=
player
[
tp
].
list_szone
[
i
];
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
(
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_SELF_TOGRAVE
)))
{
tograve_set
.
insert
(
pcard
);
pcard
->
current
.
reason_effect
=
peffect
;
pcard
->
current
.
reason_player
=
peffect
->
get_handler_player
();
}
}
tp
=
1
-
tp
;
}
if
(
tograve_set
.
size
())
{
send_to
(
&
tograve_set
,
0
,
REASON_EFFECT
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
}
else
{
returns
.
ivalue
[
0
]
=
0
;
}
return
FALSE
;
return
FALSE
;
}
}
case
10
:
{
case
10
:
{
if
(
returns
.
ivalue
[
0
]
>
0
)
core
.
re_adjust
=
TRUE
;
//equip check
//equip check
uint8
tp
=
infos
.
turn_player
;
uint8
tp
=
infos
.
turn_player
;
card
*
pcard
;
card
*
pcard
;
...
...
script/c20426907.lua
View file @
56cbba98
...
@@ -90,7 +90,6 @@ function c20426907.disfilter(c,e)
...
@@ -90,7 +90,6 @@ function c20426907.disfilter(c,e)
return
c
:
IsFaceup
()
and
c
:
IsRelateToEffect
(
e
)
return
c
:
IsFaceup
()
and
c
:
IsRelateToEffect
(
e
)
end
end
function
c20426907
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c20426907
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
c20426907
.
sdcon
(
e
)
then
return
end
if
e
:
GetLabel
()
==
0
or
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
e
:
GetLabel
()
==
0
or
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
c20426907
.
disfilter
,
nil
,
e
)
local
g
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
):
Filter
(
c20426907
.
disfilter
,
nil
,
e
)
local
tc
=
g
:
GetFirst
()
local
tc
=
g
:
GetFirst
()
...
...
script/c32919136.lua
View file @
56cbba98
...
@@ -59,7 +59,6 @@ function c32919136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
...
@@ -59,7 +59,6 @@ function c32919136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
end
function
c32919136
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c32919136
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
c32919136
.
descon
(
e
)
then
Duel
.
Destroy
(
c
,
REASON_EFFECT
)
end
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Equip
(
tp
,
c
,
tc
)
Duel
.
Equip
(
tp
,
c
,
tc
)
...
...
script/c61965407.lua
View file @
56cbba98
...
@@ -114,7 +114,6 @@ function c61965407.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
...
@@ -114,7 +114,6 @@ function c61965407.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
1
,
0
,
0
)
end
end
function
c61965407
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c61965407
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
c61965407
.
sdcon
(
e
)
then
return
end
if
e
:
GetLabel
()
==
0
or
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
if
e
:
GetLabel
()
==
0
or
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
...
...
script/c94432298.lua
View file @
56cbba98
...
@@ -58,7 +58,6 @@ function c94432298.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -58,7 +58,6 @@ function c94432298.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
c94432298
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c94432298
.
tgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
c94432298
.
sdcon
(
e
)
then
return
end
if
e
:
GetHandler
():
GetFlagEffect
(
94432298
)
==
0
then
return
end
if
e
:
GetHandler
():
GetFlagEffect
(
94432298
)
==
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c94432298
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
2
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c94432298
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
2
,
nil
)
...
...
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