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
28156c4f
Commit
28156c4f
authored
Dec 18, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.CheckTribute
parent
7e9bb82c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
28 deletions
+44
-28
card.cpp
card.cpp
+2
-28
field.cpp
field.cpp
+19
-0
field.h
field.h
+1
-0
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+20
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
card.cpp
View file @
28156c4f
...
...
@@ -2014,24 +2014,11 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
int32
min
=
rcount
&
0xffff
,
max
=
(
rcount
>>
16
)
&
0xffff
;
if
(
min
>
0
&&
!
pduel
->
game_field
->
is_player_can_summon
(
SUMMON_TYPE_ADVANCE
,
playerid
,
this
))
return
FALSE
;
int32
fcount
=
pduel
->
game_field
->
get_useable_count
(
current
.
controler
,
LOCATION_MZONE
,
current
.
controler
,
LOCATION_REASON_TOFIELD
);
if
(
max
<=
-
fcount
)
return
FALSE
;
if
(
min
<
-
fcount
+
1
)
min
=
-
fcount
+
1
;
if
(
max
<
min_tribute
)
return
FALSE
;
if
(
min
<
min_tribute
)
min
=
min_tribute
;
if
(
min
==
0
)
return
TRUE
;
card_set
release_list
;
int32
m
=
pduel
->
game_field
->
get_summon_release_list
(
this
,
&
release_list
,
0
,
0
);
if
((
int32
)
release_list
.
size
()
<
-
fcount
+
1
)
return
FALSE
;
if
(
m
>=
min
)
return
TRUE
;
return
FALSE
;
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
);
}
int32
card
::
filter_set_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint8
ignore_count
,
uint8
min_tribute
)
{
effect_set
eset
;
...
...
@@ -2059,24 +2046,11 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
int32
min
=
rcount
&
0xffff
,
max
=
(
rcount
>>
16
)
&
0xffff
;
if
(
min
>
0
&&
!
pduel
->
game_field
->
is_player_can_mset
(
SUMMON_TYPE_ADVANCE
,
playerid
,
this
))
return
FALSE
;
int32
fcount
=
pduel
->
game_field
->
get_useable_count
(
current
.
controler
,
LOCATION_MZONE
,
current
.
controler
,
LOCATION_REASON_TOFIELD
);
if
(
max
<=
-
fcount
)
return
FALSE
;
if
(
min
<
-
fcount
+
1
)
min
=
-
fcount
+
1
;
if
(
max
<
min_tribute
)
return
FALSE
;
if
(
min
<
min_tribute
)
min
=
min_tribute
;
if
(
min
==
0
)
return
TRUE
;
card_set
release_list
;
int32
m
=
pduel
->
game_field
->
get_summon_release_list
(
this
,
&
release_list
,
0
,
0
);
if
((
int32
)
release_list
.
size
()
<
-
fcount
+
1
)
return
FALSE
;
if
(
m
>=
min
)
return
TRUE
;
return
FALSE
;
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
);
}
void
card
::
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint32
summon_type
)
{
auto
pr
=
field_effect
.
equal_range
(
EFFECT_SPSUMMON_PROC
);
...
...
field.cpp
View file @
28156c4f
...
...
@@ -2176,6 +2176,25 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
pduel
->
restore_assumes
();
return
FALSE
;
}
int32
field
::
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
)
{
int32
fcount
=
get_useable_count
(
toplayer
,
LOCATION_MZONE
,
toplayer
,
LOCATION_REASON_TOFIELD
);
if
(
max
<=
-
fcount
)
return
FALSE
;
if
(
min
<
-
fcount
+
1
)
min
=
-
fcount
+
1
;
if
(
min
==
0
)
return
TRUE
;
card_set
release_list
;
uint32
ex
=
FALSE
;
if
(
pcard
->
current
.
controler
!=
toplayer
)
ex
=
TRUE
;
int32
m
=
get_summon_release_list
(
pcard
,
&
release_list
,
0
,
0
,
mg
,
ex
);
if
((
int32
)
release_list
.
size
()
<
-
fcount
+
1
)
return
FALSE
;
if
(
m
>=
min
)
return
TRUE
;
return
FALSE
;
}
int32
field
::
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
)
{
if
(
count
>
max
)
return
FALSE
;
...
...
field.h
View file @
28156c4f
...
...
@@ -396,6 +396,7 @@ public:
void
attack_all_target_check
();
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_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
);
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
);
...
...
interpreter.cpp
View file @
28156c4f
...
...
@@ -427,6 +427,7 @@ static const struct luaL_Reg duellib[] = {
{
"SelectReleaseGroupEx"
,
scriptlib
::
duel_select_release_group_ex
},
{
"GetTributeGroup"
,
scriptlib
::
duel_get_tribute_group
},
{
"GetTributeCount"
,
scriptlib
::
duel_get_tribute_count
},
{
"CheckTribute"
,
scriptlib
::
duel_check_tribute
},
{
"SelectTribute"
,
scriptlib
::
duel_select_tribute
},
{
"GetTargetCount"
,
scriptlib
::
duel_get_target_count
},
{
"IsExistingTarget"
,
scriptlib
::
duel_is_existing_target
},
...
...
libduel.cpp
View file @
28156c4f
...
...
@@ -2014,6 +2014,26 @@ int32 scriptlib::duel_get_tribute_count(lua_State *L) {
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_summon_release_list
(
target
,
0
,
0
,
0
,
mg
,
ex
));
return
1
;
}
int32
scriptlib
::
duel_check_tribute
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
target
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
min
=
lua_tointeger
(
L
,
2
);
uint32
max
=
min
;
if
(
lua_gettop
(
L
)
>=
3
&&
!
lua_isnil
(
L
,
3
))
max
=
lua_tointeger
(
L
,
3
);
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
4
&&
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
4
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
4
);
}
uint8
toplayer
=
target
->
current
.
controler
;
if
(
lua_gettop
(
L
)
>=
5
&&
!
lua_isnil
(
L
,
5
))
toplayer
=
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
target
->
pduel
;
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tribute
(
target
,
min
,
max
,
mg
,
toplayer
));
return
1
;
}
int32
scriptlib
::
duel_select_tribute
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
4
);
...
...
scriptlib.h
View file @
28156c4f
...
...
@@ -425,6 +425,7 @@ public:
static
int32
duel_select_release_group_ex
(
lua_State
*
L
);
static
int32
duel_get_tribute_group
(
lua_State
*
L
);
static
int32
duel_get_tribute_count
(
lua_State
*
L
);
static
int32
duel_check_tribute
(
lua_State
*
L
);
static
int32
duel_select_tribute
(
lua_State
*
L
);
static
int32
duel_get_target_count
(
lua_State
*
L
);
static
int32
duel_is_existing_target
(
lua_State
*
L
);
...
...
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