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
6a95742d
Commit
6a95742d
authored
Feb 13, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
9dc22fa1
8ffc4947
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
26 deletions
+31
-26
field.cpp
field.cpp
+26
-22
interpreter.cpp
interpreter.cpp
+1
-0
operations.cpp
operations.cpp
+4
-4
No files found.
field.cpp
View file @
6a95742d
...
...
@@ -1638,6 +1638,13 @@ int32 field::check_release_list(uint8 playerid, int32 count, int32 use_con, int3
// 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
,
uint32
pos
)
{
uint8
p
=
target
->
current
.
controler
;
card_set
ex_tribute
;
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
],
&
ex_tribute
);
}
uint32
rcount
=
0
;
for
(
auto
cit
=
player
[
p
].
list_mzone
.
begin
();
cit
!=
player
[
p
].
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
...
...
@@ -1660,13 +1667,17 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
continue
;
if
(
mg
&&
!
mg
->
has_card
(
pcard
))
continue
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
release_param
=
2
;
else
pcard
->
release_param
=
1
;
if
(
ex
||
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
ex_list
)
ex_list
->
insert
(
pcard
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
release_param
=
2
;
else
pcard
->
release_param
=
1
;
rcount
+=
pcard
->
release_param
;
}
else
if
(
ex_tribute
.
find
(
pcard
)
!=
ex_tribute
.
end
())
{
if
(
release_list
)
release_list
->
insert
(
pcard
)
;
rcount
+=
pcard
->
release_param
;
}
else
{
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE_SUM
);
...
...
@@ -1674,28 +1685,20 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
continue
;
if
(
ex_list_sum
)
ex_list_sum
->
insert
(
pcard
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
release_param
=
2
;
else
pcard
->
release_param
=
1
;
if
(
ex_sum_max
<
pcard
->
release_param
)
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
)
{
for
(
auto
cit
=
ex_tribute
.
begin
();
cit
!=
ex_tribute
.
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
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
release_param
=
2
;
else
pcard
->
release_param
=
1
;
rcount
+=
pcard
->
release_param
;
}
return
rcount
+
ex_sum_max
;
...
...
@@ -2740,7 +2743,8 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
}
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
)
uint32
sumplayer
=
pcard
->
current
.
controler
;
if
(
toplayer
==
1
-
sumplayer
)
ex
=
TRUE
;
card_set
release_list
,
ex_list
;
int32
m
=
get_summon_release_list
(
pcard
,
&
release_list
,
&
ex_list
,
0
,
mg
,
ex
,
releasable
,
pos
);
...
...
@@ -2750,12 +2754,12 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
return
FALSE
;
zone
&=
0x1f
;
int32
s
=
0
;
if
(
toplayer
==
pcard
->
current
.
control
er
)
{
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
pcard
->
current
.
control
er
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
toplayer
==
sumplay
er
)
{
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
sumplay
er
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
ct
<=
0
&&
max
<=
0
)
return
FALSE
;
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
if
((
*
it
)
->
current
.
location
==
LOCATION_MZONE
)
{
if
((
*
it
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
it
)
->
current
.
controler
==
sumplayer
)
{
s
++
;
if
((
zone
>>
(
*
it
)
->
current
.
sequence
)
&
1
)
ct
++
;
...
...
@@ -2767,7 +2771,7 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
}
else
{
s
=
ex_list
.
size
();
}
int32
fcount
=
get_mzone_limit
(
toplayer
,
pcard
->
current
.
control
er
,
LOCATION_REASON_TOFIELD
);
int32
fcount
=
get_mzone_limit
(
toplayer
,
sumplay
er
,
LOCATION_REASON_TOFIELD
);
if
(
s
<
-
fcount
+
1
)
return
FALSE
;
if
(
max
<
0
)
...
...
interpreter.cpp
View file @
6a95742d
...
...
@@ -331,6 +331,7 @@ static const struct luaL_Reg grouplib[] = {
{
"GetNext"
,
scriptlib
::
group_get_next
},
{
"GetFirst"
,
scriptlib
::
group_get_first
},
{
"GetCount"
,
scriptlib
::
group_get_count
},
{
"__len"
,
scriptlib
::
group_get_count
},
{
"ForEach"
,
scriptlib
::
group_for_each
},
{
"Filter"
,
scriptlib
::
group_filter
},
{
"FilterCount"
,
scriptlib
::
group_filter_count
},
...
...
operations.cpp
View file @
6a95742d
...
...
@@ -1524,7 +1524,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
eset
[
i
]
->
get_value
(
target
,
0
,
&
retval
);
int32
new_min_tribute
=
retval
.
size
()
>
0
?
retval
[
0
]
:
0
;
int32
new_zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0x1f
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
-
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
+
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
new_zone
&=
zone
;
bool
unchanged
=
(
new_zone
==
zone
);
if
(
peffect
)
{
...
...
@@ -2074,7 +2074,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
eset
[
i
]
->
get_value
(
target
,
0
,
&
retval
);
int32
new_min_tribute
=
retval
.
size
()
>
0
?
retval
[
0
]
:
0
;
int32
new_zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0x1f
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
-
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
+
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
new_zone
&=
zone
;
bool
unchanged
=
(
new_zone
==
zone
);
if
(
peffect
)
{
...
...
@@ -5590,7 +5590,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
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
))
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
cit
)
->
current
.
controler
==
playerid
&&
(
(
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
))
core
.
select_cards
.
push_back
(
*
cit
);
else
rmax
+=
(
*
cit
)
->
release_param
;
...
...
@@ -5789,7 +5789,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
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
))
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
cit
)
->
current
.
controler
==
playerid
&&
(
(
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