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
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
nanahira
ygopro-core
Commits
cab15ae7
Commit
cab15ae7
authored
Nov 07, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add EFFECT_ADD_EXTRA_TRIBUTE
parent
f006ac9f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
20 deletions
+43
-20
card.cpp
card.cpp
+2
-2
effect.h
effect.h
+1
-0
field.cpp
field.cpp
+33
-12
field.h
field.h
+3
-2
operations.cpp
operations.cpp
+4
-4
No files found.
card.cpp
View file @
cab15ae7
...
...
@@ -2510,11 +2510,11 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
if
(
new_min
<
min
)
new_min
=
min
;
new_zone
&=
zone
;
if
(
pduel
->
game_field
->
check_tribute
(
this
,
new_min
,
max
,
0
,
current
.
controler
,
new_zone
,
releasable
))
if
(
pduel
->
game_field
->
check_tribute
(
this
,
new_min
,
max
,
0
,
current
.
controler
,
new_zone
,
releasable
,
POS_FACEDOWN_DEFENSE
))
return
TRUE
;
}
}
else
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
);
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
,
0xff00ff
,
POS_FACEDOWN_DEFENSE
);
return
FALSE
;
}
int32
card
::
check_set_procedure
(
effect
*
peffect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
...
...
effect.h
View file @
cab15ae7
...
...
@@ -325,6 +325,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_TRIBUTE_LIMIT 154
#define EFFECT_EXTRA_RELEASE_SUM 155
//#define EFFECT_TRIPLE_TRIBUTE 156
#define EFFECT_ADD_EXTRA_TRIBUTE 157
#define EFFECT_PUBLIC 160
#define EFFECT_COUNTER_PERMIT 0x10000
#define EFFECT_COUNTER_LIMIT 0x20000
...
...
field.cpp
View file @
cab15ae7
...
...
@@ -1210,7 +1210,12 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
}
// put all cards in the target of peffect into cset
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
))
return
;
filter_inrange_cards
(
peffect
,
cset
);
}
void
field
::
filter_inrange_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
return
;
uint8
self
=
peffect
->
get_handler_player
();
if
(
self
==
PLAYER_NONE
)
...
...
@@ -1614,7 +1619,7 @@ int32 field::check_release_list(uint8 playerid, int32 count, int32 use_con, int3
return
FALSE
;
}
// return: the max release count of mg or all monsters on field
int32
field
::
get_summon_release_list
(
card
*
target
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_sum
,
group
*
mg
,
uint32
ex
,
uint32
releasable
)
{
int32
field
::
get_summon_release_list
(
card
*
target
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_sum
,
group
*
mg
,
uint32
ex
,
uint32
releasable
,
uint32
pos
)
{
uint8
p
=
target
->
current
.
controler
;
uint32
rcount
=
0
;
for
(
auto
cit
=
player
[
p
].
list_mzone
.
begin
();
cit
!=
player
[
p
].
list_mzone
.
end
();
++
cit
)
{
...
...
@@ -1660,6 +1665,22 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
ex_sum_max
=
pcard
->
release_param
;
}
}
card_set
cset
;
effect_set
eset
;
target
->
filter_effect
(
EFFECT_ADD_EXTRA_TRIBUTE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
get_value
()
&
pos
)
filter_inrange_cards
(
eset
[
i
],
&
cset
);
}
for
(
auto
cit
=
cset
.
begin
();
cit
!=
cset
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
||
!
pcard
->
is_releasable_by_summon
(
p
,
target
))
continue
;
if
(
release_list
)
release_list
->
insert
(
pcard
);
pcard
->
release_param
=
1
;
rcount
+=
pcard
->
release_param
;
}
return
rcount
+
ex_sum_max
;
}
int32
field
::
get_summon_count_limit
(
uint8
playerid
)
{
...
...
@@ -2700,31 +2721,31 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
}
return
FALSE
;
}
int32
field
::
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
,
uint32
releasable
)
{
int32
field
::
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
,
uint32
releasable
,
uint32
pos
)
{
int32
ex
=
FALSE
;
if
(
toplayer
==
1
-
pcard
->
current
.
controler
)
ex
=
TRUE
;
card_set
release_list
,
ex_list
;
int32
m
=
get_summon_release_list
(
pcard
,
&
release_list
,
&
ex_list
,
0
,
mg
,
ex
,
releasable
);
int32
m
=
get_summon_release_list
(
pcard
,
&
release_list
,
&
ex_list
,
0
,
mg
,
ex
,
releasable
,
pos
);
if
(
max
>
m
)
max
=
m
;
if
(
min
>
max
)
return
FALSE
;
zone
&=
0x1f
;
int32
s
;
int32
s
=
0
;
if
(
toplayer
==
pcard
->
current
.
controler
)
{
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
pcard
->
current
.
controler
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
ct
<=
0
)
{
if
(
max
<=
0
)
if
(
ct
<=
0
&&
max
<=
0
)
return
FALSE
;
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
if
((
*
it
)
->
current
.
location
==
LOCATION_MZONE
)
{
s
++
;
if
((
zone
>>
(
*
it
)
->
current
.
sequence
)
&
1
)
ct
++
;
}
}
if
(
ct
<=
0
)
return
FALSE
;
}
s
=
release_list
.
size
();
max
-=
(
int32
)
ex_list
.
size
();
}
else
{
s
=
ex_list
.
size
();
...
...
field.h
View file @
cab15ae7
...
...
@@ -383,6 +383,7 @@ public:
void
filter_field_effect
(
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
);
void
filter_inrange_cards
(
effect
*
peffect
,
card_set
*
cset
);
void
filter_player_effect
(
uint8
playerid
,
uint32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
int32
filter_matching_card
(
int32
findex
,
uint8
self
,
uint32
location1
,
uint32
location2
,
group
*
pgroup
,
card
*
pexception
,
group
*
pexgroup
,
uint32
extraargs
,
card
**
pret
=
0
,
int32
fcount
=
0
,
int32
is_target
=
FALSE
);
int32
filter_field_card
(
uint8
self
,
uint32
location
,
uint32
location2
,
group
*
pgroup
);
...
...
@@ -390,7 +391,7 @@ public:
int32
get_release_list
(
uint8
playerid
,
card_set
*
release_list
,
card_set
*
ex_list
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
);
int32
check_release_list
(
uint8
playerid
,
int32
count
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
);
int32
get_summon_release_list
(
card
*
target
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_sum
,
group
*
mg
=
NULL
,
uint32
ex
=
0
,
uint32
releasable
=
0xff00ff
);
int32
get_summon_release_list
(
card
*
target
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_sum
,
group
*
mg
=
NULL
,
uint32
ex
=
0
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
int32
get_summon_count_limit
(
uint8
playerid
);
int32
get_draw_count
(
uint8
playerid
);
void
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
);
...
...
@@ -427,7 +428,7 @@ public:
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
);
static
int32
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
);
...
...
operations.cpp
View file @
cab15ae7
...
...
@@ -2098,7 +2098,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
min
=
new_min_tribute
;
unchanged
=
false
;
}
if
(
!
check_tribute
(
target
,
min
,
max
,
0
,
target
->
current
.
controler
,
new_zone
,
releasable
))
if
(
!
check_tribute
(
target
,
min
,
max
,
0
,
target
->
current
.
controler
,
new_zone
,
releasable
,
POS_FACEDOWN_DEFENSE
))
continue
;
}
if
(
unlimited
<
0
&&
unchanged
)
...
...
@@ -2152,7 +2152,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
core
.
release_cards
.
clear
();
core
.
release_cards_ex
.
clear
();
core
.
release_cards_ex_sum
.
clear
();
int32
rcount
=
get_summon_release_list
(
target
,
&
core
.
release_cards
,
&
core
.
release_cards_ex
,
&
core
.
release_cards_ex_sum
,
NULL
,
0
,
releasable
);
int32
rcount
=
get_summon_release_list
(
target
,
&
core
.
release_cards
,
&
core
.
release_cards_ex
,
&
core
.
release_cards_ex_sum
,
NULL
,
0
,
releasable
,
POS_FACEDOWN_DEFENSE
);
if
(
rcount
==
0
)
{
returns
.
bvalue
[
0
]
=
0
;
core
.
units
.
begin
()
->
step
=
3
;
...
...
@@ -5480,7 +5480,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
int32
rmax
=
0
;
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
{
if
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
)
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
)
)
core
.
select_cards
.
push_back
(
*
cit
);
else
rmax
+=
(
*
cit
)
->
release_param
;
...
...
@@ -5679,7 +5679,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
int32
rmax
=
0
;
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
{
if
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
)
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
)
)
core
.
select_cards
.
push_back
(
*
cit
);
else
rmax
+=
(
*
cit
)
->
release_param
;
...
...
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