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
12c0bc27
Commit
12c0bc27
authored
May 01, 2021
by
mercury233
Committed by
GitHub
May 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Duel.GetFusionMaterial (#361)
parent
f0a8eb49
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
13 deletions
+64
-13
field.cpp
field.cpp
+54
-8
field.h
field.h
+1
-1
libduel.cpp
libduel.cpp
+9
-4
No files found.
field.cpp
View file @
12c0bc27
...
@@ -1847,18 +1847,64 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
...
@@ -1847,18 +1847,64 @@ void field::get_ritual_material(uint8 playerid, effect* peffect, card_set* mater
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
))
material
->
insert
(
pcard
);
material
->
insert
(
pcard
);
}
}
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material
)
{
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material_all
,
card_set
*
material_base
,
uint32
location
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
location
&
LOCATION_MZONE
)
{
if
(
pcard
)
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
material
->
insert
(
pcard
);
if
(
pcard
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_HAND
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
if
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_GRAVE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_grave
)
{
if
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_REMOVED
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_remove
)
{
if
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_DECK
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_main
)
{
if
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_EXTRA
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_extra
)
{
if
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_SZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_szone
)
{
if
(
pcard
&&
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_PZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_szone
)
{
if
(
pcard
&&
pcard
->
current
.
pzone
&&
pcard
->
data
.
type
&
TYPE_MONSTER
)
material_base
->
insert
(
pcard
);
}
}
}
for
(
auto
&
pcard
:
player
[
playerid
].
list_szone
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_szone
)
{
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_FUSION_MATERIAL
))
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_FUSION_MATERIAL
))
material
->
insert
(
pcard
);
material
_all
->
insert
(
pcard
);
}
}
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
for
(
auto
&
pcard
:
player
[
playerid
].
list_grave
)
{
if
(
pcard
->
data
.
type
&
TYPE_MONSTER
)
if
(
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_FUSION_MATERIAL
))
material
->
insert
(
pcard
);
material_all
->
insert
(
pcard
);
}
material_all
->
insert
(
material_base
->
begin
(),
material_base
->
end
());
}
}
void
field
::
ritual_release
(
card_set
*
material
)
{
void
field
::
ritual_release
(
card_set
*
material
)
{
card_set
rel
;
card_set
rel
;
...
...
field.h
View file @
12c0bc27
...
@@ -447,7 +447,7 @@ public:
...
@@ -447,7 +447,7 @@ public:
int32
get_summon_count_limit
(
uint8
playerid
);
int32
get_summon_count_limit
(
uint8
playerid
);
int32
get_draw_count
(
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
);
void
get_fusion_material
(
uint8
playerid
,
card_set
*
material
);
void
get_fusion_material
(
uint8
playerid
,
card_set
*
material
_all
,
card_set
*
material_base
,
uint32
location
);
void
ritual_release
(
card_set
*
material
);
void
ritual_release
(
card_set
*
material
);
void
get_xyz_material
(
card
*
scard
,
int32
findex
,
uint32
lv
,
int32
maxc
,
group
*
mg
);
void
get_xyz_material
(
card
*
scard
,
int32
findex
,
uint32
lv
,
int32
maxc
,
group
*
mg
);
void
get_overlay_group
(
uint8
self
,
uint8
s
,
uint8
o
,
card_set
*
pset
);
void
get_overlay_group
(
uint8
self
,
uint8
s
,
uint8
o
,
card_set
*
pset
);
...
...
libduel.cpp
View file @
12c0bc27
...
@@ -3108,11 +3108,16 @@ int32 scriptlib::duel_get_fusion_material(lua_State *L) {
...
@@ -3108,11 +3108,16 @@ int32 scriptlib::duel_get_fusion_material(lua_State *L) {
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
uint32
location
=
LOCATION_HAND
+
LOCATION_MZONE
;
if
(
lua_gettop
(
L
)
>=
2
)
location
=
(
uint32
)
lua_tointeger
(
L
,
2
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroupall
=
pduel
->
new_group
();
pduel
->
game_field
->
get_fusion_material
(
playerid
,
&
pgroup
->
container
);
group
*
pgroupbase
=
pduel
->
new_group
();
interpreter
::
group2value
(
L
,
pgroup
);
pduel
->
game_field
->
get_fusion_material
(
playerid
,
&
pgroupall
->
container
,
&
pgroupbase
->
container
,
location
);
return
1
;
interpreter
::
group2value
(
L
,
pgroupall
);
interpreter
::
group2value
(
L
,
pgroupbase
);
return
2
;
}
}
int32
scriptlib
::
duel_is_summon_cancelable
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_is_summon_cancelable
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
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