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
b47e5012
Commit
b47e5012
authored
Jan 17, 2022
by
mercury233
Committed by
GitHub
Jan 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.GetRitualMaterialEx, update Duel.GetRitualMaterial (#429)
parent
42aa4345
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
field.cpp
field.cpp
+10
-5
field.h
field.h
+1
-1
libduel.cpp
libduel.cpp
+12
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
field.cpp
View file @
b47e5012
...
...
@@ -1836,26 +1836,31 @@ int32 field::get_draw_count(uint8 playerid) {
}
return
count
;
}
void
field
::
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
)
{
void
field
::
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
,
uint8
no_level
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
)
&&
(
no_level
||
pcard
->
get_level
()
>
0
))
material
->
insert
(
pcard
);
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_OVERLAY_RITUAL_MATERIAL
))
for
(
auto
&
mcard
:
pcard
->
xyz_materials
)
material
->
insert
(
mcard
);
if
(
no_level
||
mcard
->
get_level
()
>
0
)
material
->
insert
(
mcard
);
}
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
)
&&
(
no_level
||
pcard
->
get_level
()
>
0
))
material
->
insert
(
pcard
);
}
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
if
((
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
))
material
->
insert
(
pcard
);
for
(
auto
&
pcard
:
player
[
playerid
].
list_grave
)
if
((
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RITUAL_MATERIAL
)
&&
pcard
->
is_removeable
(
playerid
,
POS_FACEUP
,
REASON_EFFECT
))
if
((
pcard
->
data
.
type
&
TYPE_MONSTER
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RITUAL_MATERIAL
)
&&
pcard
->
is_removeable
(
playerid
,
POS_FACEUP
,
REASON_EFFECT
)
&&
(
no_level
||
pcard
->
get_level
()
>
0
))
material
->
insert
(
pcard
);
}
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material_all
,
card_set
*
material_base
,
uint32
location
)
{
...
...
field.h
View file @
b47e5012
...
...
@@ -446,7 +446,7 @@ public:
int32
get_summon_release_list
(
card
*
target
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_oneof
,
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
);
void
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
,
uint8
no_level
=
FALSE
);
void
get_fusion_material
(
uint8
playerid
,
card_set
*
material_all
,
card_set
*
material_base
,
uint32
location
);
void
ritual_release
(
card_set
*
material
);
void
get_xyz_material
(
card
*
scard
,
int32
findex
,
uint32
lv
,
int32
maxc
,
group
*
mg
);
...
...
libduel.cpp
View file @
b47e5012
...
...
@@ -3115,6 +3115,17 @@ int32 scriptlib::duel_get_ritual_material(lua_State *L) {
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
int32
scriptlib
::
duel_get_ritual_material_ex
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
group
*
pgroup
=
pduel
->
new_group
();
pduel
->
game_field
->
get_ritual_material
(
playerid
,
pduel
->
game_field
->
core
.
reason_effect
,
&
pgroup
->
container
,
TRUE
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
int32
scriptlib
::
duel_release_ritual_material
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
1
);
...
...
@@ -4679,6 +4690,7 @@ static const struct luaL_Reg duellib[] = {
{
"SelectTunerMaterial"
,
scriptlib
::
duel_select_tuner_material
},
{
"CheckTunerMaterial"
,
scriptlib
::
duel_check_tuner_material
},
{
"GetRitualMaterial"
,
scriptlib
::
duel_get_ritual_material
},
{
"GetRitualMaterialEx"
,
scriptlib
::
duel_get_ritual_material_ex
},
{
"ReleaseRitualMaterial"
,
scriptlib
::
duel_release_ritual_material
},
{
"GetFusionMaterial"
,
scriptlib
::
duel_get_fusion_material
},
{
"IsSummonCancelable"
,
scriptlib
::
duel_is_summon_cancelable
},
...
...
scriptlib.h
View file @
b47e5012
...
...
@@ -517,6 +517,7 @@ public:
static
int32
duel_select_tuner_material
(
lua_State
*
L
);
static
int32
duel_check_tuner_material
(
lua_State
*
L
);
static
int32
duel_get_ritual_material
(
lua_State
*
L
);
static
int32
duel_get_ritual_material_ex
(
lua_State
*
L
);
static
int32
duel_release_ritual_material
(
lua_State
*
L
);
static
int32
duel_get_fusion_material
(
lua_State
*
L
);
static
int32
duel_is_summon_cancelable
(
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