Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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-core
Commits
3a099257
Commit
3a099257
authored
Mar 03, 2019
by
mercury233
Committed by
GitHub
Mar 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update unique self destroy (#204)
parent
2e3cc636
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
14 deletions
+51
-14
operations.cpp
operations.cpp
+51
-14
No files found.
operations.cpp
View file @
3a099257
...
@@ -1266,25 +1266,60 @@ int32 field::self_destroy(uint16 step, card* ucard, int32 p) {
...
@@ -1266,25 +1266,60 @@ int32 field::self_destroy(uint16 step, card* ucard, int32 p) {
auto
cit
=
cset
.
begin
();
auto
cit
=
cset
.
begin
();
ucard
->
unique_fieldid
=
(
*
cit
)
->
fieldid
;
ucard
->
unique_fieldid
=
(
*
cit
)
->
fieldid
;
}
else
{
}
else
{
card* mcard = 0;
core
.
select_cards
.
clear
();
uint8
player
=
p
;
for
(
auto
&
pcard
:
cset
)
{
for
(
auto
&
pcard
:
cset
)
{
if(ucard->unique_fieldid == pcard->fieldid) {
if
(
pcard
->
current
.
controler
==
player
&&
pcard
->
unique_fieldid
!=
UINT_MAX
)
mcard = pcard;
core
.
select_cards
.
push_back
(
pcard
);
break;
}
if
(
core
.
select_cards
.
size
()
==
0
)
{
player
=
1
-
p
;
for
(
auto
&
pcard
:
cset
)
{
if
(
pcard
->
current
.
controler
==
player
&&
pcard
->
unique_fieldid
!=
UINT_MAX
)
core
.
select_cards
.
push_back
(
pcard
);
}
}
if(!mcard || pcard->fieldid < mcard->fieldid)
mcard = pcard;
}
}
ucard->unique_fieldid = mcard->fieldid;
if
(
core
.
select_cards
.
size
()
==
0
)
{
cset.erase(mcard);
player
=
p
;
for(auto& pcard : cset) {
for
(
auto
&
pcard
:
cset
)
{
pcard->temp.reason_effect = pcard->current.reason_effect;
if
(
pcard
->
current
.
controler
==
player
)
pcard->temp.reason_player = pcard->current.reason_player;
core
.
select_cards
.
push_back
(
pcard
);
pcard->current.reason_effect = ucard->unique_effect;
}
pcard->current.reason_player = ucard->current.controler;
}
if
(
core
.
select_cards
.
size
()
==
0
)
{
player
=
1
-
p
;
for
(
auto
&
pcard
:
cset
)
{
if
(
pcard
->
current
.
controler
==
player
)
core
.
select_cards
.
push_back
(
pcard
);
}
}
if
(
core
.
select_cards
.
size
()
==
1
)
{
returns
.
bvalue
[
1
]
=
0
;
}
}
destroy(&cset, 0, REASON_RULE, 5);
else
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
player
);
pduel
->
write_buffer32
(
534
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
player
,
0x10001
);
}
return
FALSE
;
}
return
TRUE
;
}
case
1
:
{
card_set
cset
;
ucard
->
get_unique_target
(
&
cset
,
p
);
card
*
mcard
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
ucard
->
unique_fieldid
=
mcard
->
fieldid
;
cset
.
erase
(
mcard
);
for
(
auto
&
pcard
:
cset
)
{
pcard
->
temp
.
reason_effect
=
pcard
->
current
.
reason_effect
;
pcard
->
temp
.
reason_player
=
pcard
->
current
.
reason_player
;
pcard
->
current
.
reason_effect
=
ucard
->
unique_effect
;
pcard
->
current
.
reason_player
=
ucard
->
current
.
controler
;
}
}
destroy
(
&
cset
,
0
,
REASON_RULE
,
5
);
return
TRUE
;
return
TRUE
;
}
}
case
10
:
{
case
10
:
{
...
@@ -4445,6 +4480,8 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
...
@@ -4445,6 +4480,8 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
core
.
hint_timing
[
pcard
->
current
.
controler
]
|=
TIMING_POS_CHANGE
;
core
.
hint_timing
[
pcard
->
current
.
controler
]
|=
TIMING_POS_CHANGE
;
if
((
opos
&
POS_FACEDOWN
)
&&
(
npos
&
POS_FACEUP
))
{
if
((
opos
&
POS_FACEDOWN
)
&&
(
npos
&
POS_FACEUP
))
{
pcard
->
fieldid
=
infos
.
field_id
++
;
pcard
->
fieldid
=
infos
.
field_id
++
;
if
(
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
location
))
pcard
->
unique_fieldid
=
UINT_MAX
;
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
raise_single_event
(
pcard
,
0
,
EVENT_FLIP
,
reason_effect
,
0
,
reason_player
,
0
,
flag
);
raise_single_event
(
pcard
,
0
,
EVENT_FLIP
,
reason_effect
,
0
,
reason_player
,
0
,
flag
);
flips
.
insert
(
pcard
);
flips
.
insert
(
pcard
);
...
...
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