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
ca37f8b6
Commit
ca37f8b6
authored
Aug 17, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update EFFECT_ONLY_BE_ATTACKED
and EFFECT_ONLY_ATTACK_MONSTER, EFFECT_MUST_ATTACK_MONSTER
parent
b5f28bc4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
30 deletions
+25
-30
effect.h
effect.h
+1
-3
field.cpp
field.cpp
+24
-27
No files found.
effect.h
View file @
ca37f8b6
...
...
@@ -351,7 +351,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_FIRST_ATTACK 192
#define EFFECT_ATTACK_ALL 193
#define EFFECT_EXTRA_ATTACK 194
#define EFFECT_MUST_BE_ATTACKED 195
//
#define EFFECT_MUST_BE_ATTACKED 195
#define EFFECT_ONLY_BE_ATTACKED 196
#define EFFECT_ATTACK_DISABLED 197
#define EFFECT_NO_BATTLE_DAMAGE 200
...
...
@@ -418,12 +418,10 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_ADD_SETCODE 334
#define EFFECT_NO_EFFECT_DAMAGE 335
#define EFFECT_UNSUMMONABLE_CARD 336
//#define EFFECT_DISABLE_CHAIN_FIELD 337
#define EFFECT_DISCARD_COST_CHANGE 338
#define EFFECT_HAND_SYNCHRO 339
#define EFFECT_ADD_FUSION_CODE 340
#define EFFECT_ADD_FUSION_SETCODE 341
#define EFFECT_RISE_TO_FULL_HEIGHT 342
#define EFFECT_ONLY_ATTACK_MONSTER 343
#define EFFECT_MUST_ATTACK_MONSTER 344
#define EFFECT_PATRICIAN_OF_DARKNESS 345
...
...
field.cpp
View file @
ca37f8b6
...
...
@@ -2256,40 +2256,38 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
effect* peffect;
card_vector* pv = NULL;
int32 atype = 0;
card_vector
must_
be_
attack
;
card_vector must_attack;
card_vector only_be_attack;
effect_set
eset
;
card_vector only_attack
;
// find the universal set pv
pcard->direct_attackable = 0;
for(auto cit = player[1 - p].list_mzone.begin(); cit != player[1 - p].list_mzone.end(); ++cit) {
card* atarget = *cit;
if(atarget) {
if
(
atarget
->
is_affected_by_effect
(
EFFECT_MUST_BE_ATTACKED
,
pcard
))
must_be_attack
.
push_back
(
atarget
);
if(atarget->is_affected_by_effect(EFFECT_ONLY_BE_ATTACKED))
only_be_attack.push_back(atarget);
if(pcard->is_affected_by_effect(EFFECT_MUST_ATTACK_MONSTER, atarget))
must_attack.push_back(atarget);
if(pcard->is_affected_by_effect(EFFECT_ONLY_ATTACK_MONSTER, atarget))
only_attack.push_back(atarget);
}
}
pcard
->
filter_effect
(
EFFECT_RISE_TO_FULL_HEIGHT
,
&
eset
);
if
(
eset
.
size
())
{
if(only_be_attack.size()) {
atype = 1;
std
::
set
<
uint32
>
idset
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
idset
.
insert
(
eset
[
i
]
->
label
);
if
(
idset
.
size
()
==
1
&&
only_be_attack
.
size
()
==
1
&&
only_be_attack
.
front
()
->
fieldid_r
==
*
idset
.
begin
())
if(only_be_attack.size() == 1)
pv = &only_be_attack;
else
return atype;
} else if(pcard->is_affected_by_effect(EFFECT_ONLY_ATTACK_MONSTER)) {
atype = 2;
if
(
only_
be_
attack
.
size
()
==
1
)
pv
=
&
only_
be_
attack
;
if(only_attack.size() == 1)
pv = &only_attack;
else
return atype;
} else if(pcard->is_affected_by_effect(EFFECT_MUST_ATTACK_MONSTER)) {
atype = 3;
if
(
must_
be_
attack
.
size
())
pv
=
&
must_
be_
attack
;
if(must_attack.size())
pv = &must_attack;
else
return atype;
} else {
...
...
@@ -2429,40 +2427,39 @@ bool field::confirm_attack_target() {
effect* peffect;
card_vector* pv = NULL;
int32 atype = 0;
card_vector
must_
be_
attack
;
card_vector must_attack;
card_vector only_be_attack;
card_vector only_attack;
effect_set eset;
// find the universal set
for(auto cit = player[1 - p].list_mzone.begin(); cit != player[1 - p].list_mzone.end(); ++cit) {
card* atarget = *cit;
if(atarget) {
if
(
atarget
->
is_affected_by_effect
(
EFFECT_MUST_BE_ATTACKED
,
pcard
))
must_be_attack
.
push_back
(
atarget
);
if(atarget->is_affected_by_effect(EFFECT_ONLY_BE_ATTACKED))
only_be_attack.push_back(atarget);
if(pcard->is_affected_by_effect(EFFECT_MUST_ATTACK_MONSTER, atarget))
must_attack.push_back(atarget);
if(pcard->is_affected_by_effect(EFFECT_ONLY_ATTACK_MONSTER, atarget))
only_attack.push_back(atarget);
}
}
pcard
->
filter_effect
(
EFFECT_RISE_TO_FULL_HEIGHT
,
&
eset
);
if
(
eset
.
size
())
{
if(only_be_attack.size()) {
atype = 1;
std
::
set
<
uint32
>
idset
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
idset
.
insert
(
eset
[
i
]
->
label
);
if
(
idset
.
size
()
==
1
&&
only_be_attack
.
size
()
==
1
&&
only_be_attack
.
front
()
->
fieldid_r
==
*
idset
.
begin
())
if(only_be_attack.size() == 1)
pv = &only_be_attack;
else
return false;
} else if(pcard->is_affected_by_effect(EFFECT_ONLY_ATTACK_MONSTER)) {
atype = 2;
if
(
only_
be_
attack
.
size
()
==
1
)
pv
=
&
only_
be_
attack
;
if(only_attack.size() == 1)
pv = &only_attack;
else
return false;
} else if(pcard->is_affected_by_effect(EFFECT_MUST_ATTACK_MONSTER)) {
atype = 3;
if
(
must_
be_
attack
.
size
())
pv
=
&
must_
be_
attack
;
if(must_attack.size())
pv = &must_attack;
else
return false;
} else {
...
...
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