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
388e593f
Commit
388e593f
authored
Dec 20, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Duel.GetFusionMaterial
parent
4d5a4b40
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
7 deletions
+44
-7
card.cpp
card.cpp
+8
-0
effect.h
effect.h
+1
-0
field.cpp
field.cpp
+21
-7
field.h
field.h
+1
-0
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+11
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
card.cpp
View file @
388e593f
...
@@ -2957,6 +2957,14 @@ int32 card::is_can_be_fusion_material(card* fcard) {
...
@@ -2957,6 +2957,14 @@ int32 card::is_can_be_fusion_material(card* fcard) {
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
if
(
eset
[
i
]
->
get_value
(
fcard
))
if
(
eset
[
i
]
->
get_value
(
fcard
))
return
FALSE
;
return
FALSE
;
if
(
current
.
location
==
LOCATION_SZONE
)
{
eset
.
clear
();
filter_effect
(
EFFECT_EXTRA_FUSION_MATERIAL
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
if
(
eset
[
i
]
->
get_value
(
fcard
))
return
TRUE
;
return
FALSE
;
}
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
)
{
int32
card
::
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
)
{
...
...
effect.h
View file @
388e593f
...
@@ -412,6 +412,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -412,6 +412,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
//#define EFFECT_ADD_FUSION_ATTRIBUTE 349
//#define EFFECT_ADD_FUSION_ATTRIBUTE 349
//#define EFFECT_REMOVE_FUSION_ATTRIBUTE 350
//#define EFFECT_REMOVE_FUSION_ATTRIBUTE 350
#define EFFECT_CHANGE_FUSION_ATTRIBUTE 351
#define EFFECT_CHANGE_FUSION_ATTRIBUTE 351
#define EFFECT_EXTRA_FUSION_MATERIAL 352
#define EVENT_STARTUP 1000
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
#define EVENT_FLIP 1001
...
...
field.cpp
View file @
388e593f
...
@@ -1326,26 +1326,40 @@ int32 field::get_draw_count(uint8 playerid) {
...
@@ -1326,26 +1326,40 @@ int32 field::get_draw_count(uint8 playerid) {
return
count
;
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
)
{
card
*
pcard
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
pcard
=
player
[
playerid
].
list_mzone
[
i
];
card
*
pcard
=
player
[
playerid
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
->
get_level
()
&&
pcard
->
is_affect_by_effect
(
core
.
reason_
effect
)
if
(
pcard
&&
pcard
->
get_level
()
&&
pcard
->
is_affect_by_effect
(
p
effect
)
&&
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
))
material
->
insert
(
pcard
);
material
->
insert
(
pcard
);
}
}
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
pcard
=
player
[
1
-
playerid
].
list_mzone
[
i
];
card
*
pcard
=
player
[
1
-
playerid
].
list_mzone
[
i
];
if
(
pcard
&&
pcard
->
get_level
()
&&
pcard
->
is_affect_by_effect
(
core
.
reason_
effect
)
if
(
pcard
&&
pcard
->
get_level
()
&&
pcard
->
is_affect_by_effect
(
p
effect
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
)
&&
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
))
material
->
insert
(
pcard
);
material
->
insert
(
pcard
);
}
}
for
(
auto
cit
=
player
[
playerid
].
list_hand
.
begin
();
cit
!=
player
[
playerid
].
list_hand
.
end
();
++
cit
)
for
(
auto
cit
=
player
[
playerid
].
list_hand
.
begin
();
cit
!=
player
[
playerid
].
list_hand
.
end
();
++
cit
)
if
(((
*
cit
)
->
data
.
type
&
TYPE_MONSTER
)
&&
(
*
cit
)
->
is_releasable_by_nonsummon
(
playerid
))
if
(((
*
cit
)
->
data
.
type
&
TYPE_MONSTER
)
&&
(
*
cit
)
->
is_releasable_by_nonsummon
(
playerid
))
material
->
insert
(
(
*
cit
)
);
material
->
insert
(
*
cit
);
for
(
auto
cit
=
player
[
playerid
].
list_grave
.
begin
();
cit
!=
player
[
playerid
].
list_grave
.
end
();
++
cit
)
for
(
auto
cit
=
player
[
playerid
].
list_grave
.
begin
();
cit
!=
player
[
playerid
].
list_grave
.
end
();
++
cit
)
if
(((
*
cit
)
->
data
.
type
&
TYPE_MONSTER
)
&&
(
*
cit
)
->
is_affected_by_effect
(
EFFECT_EXTRA_RITUAL_MATERIAL
)
&&
(
*
cit
)
->
is_removeable
(
playerid
))
if
(((
*
cit
)
->
data
.
type
&
TYPE_MONSTER
)
&&
(
*
cit
)
->
is_affected_by_effect
(
EFFECT_EXTRA_RITUAL_MATERIAL
)
&&
(
*
cit
)
->
is_removeable
(
playerid
))
material
->
insert
((
*
cit
));
material
->
insert
(
*
cit
);
}
void
field
::
get_fusion_material
(
uint8
playerid
,
card_set
*
material
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
playerid
].
list_mzone
[
i
];
if
(
pcard
)
material
->
insert
(
pcard
);
}
for
(
int
i
=
0
;
i
<
8
;
++
i
)
{
card
*
pcard
=
player
[
playerid
].
list_szone
[
i
];
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_FUSION_MATERIAL
))
material
->
insert
(
pcard
);
}
for
(
auto
cit
=
player
[
playerid
].
list_hand
.
begin
();
cit
!=
player
[
playerid
].
list_hand
.
end
();
++
cit
)
if
((
*
cit
)
->
data
.
type
&
TYPE_MONSTER
)
material
->
insert
(
*
cit
);
}
}
void
field
::
ritual_release
(
card_set
*
material
)
{
void
field
::
ritual_release
(
card_set
*
material
)
{
card_set
rel
;
card_set
rel
;
...
...
field.h
View file @
388e593f
...
@@ -367,6 +367,7 @@ public:
...
@@ -367,6 +367,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
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
);
...
...
interpreter.cpp
View file @
388e593f
...
@@ -443,6 +443,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -443,6 +443,7 @@ static const struct luaL_Reg duellib[] = {
{
"CheckTunerMaterial"
,
scriptlib
::
duel_check_tuner_material
},
{
"CheckTunerMaterial"
,
scriptlib
::
duel_check_tuner_material
},
{
"GetRitualMaterial"
,
scriptlib
::
duel_get_ritual_material
},
{
"GetRitualMaterial"
,
scriptlib
::
duel_get_ritual_material
},
{
"ReleaseRitualMaterial"
,
scriptlib
::
duel_release_ritual_material
},
{
"ReleaseRitualMaterial"
,
scriptlib
::
duel_release_ritual_material
},
{
"GetFusionMaterial"
,
scriptlib
::
duel_get_fusion_material
},
{
"SetSelectedCard"
,
scriptlib
::
duel_set_must_select_cards
},
{
"SetSelectedCard"
,
scriptlib
::
duel_set_must_select_cards
},
{
"SetTargetCard"
,
scriptlib
::
duel_set_target_card
},
{
"SetTargetCard"
,
scriptlib
::
duel_set_target_card
},
{
"ClearTargetCard"
,
scriptlib
::
duel_clear_target_card
},
{
"ClearTargetCard"
,
scriptlib
::
duel_clear_target_card
},
...
...
libduel.cpp
View file @
388e593f
...
@@ -2317,6 +2317,17 @@ int32 scriptlib::duel_release_ritual_material(lua_State *L) {
...
@@ -2317,6 +2317,17 @@ int32 scriptlib::duel_release_ritual_material(lua_State *L) {
pgroup
->
pduel
->
game_field
->
ritual_release
(
&
pgroup
->
container
);
pgroup
->
pduel
->
game_field
->
ritual_release
(
&
pgroup
->
container
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_get_fusion_material
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
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_fusion_material
(
playerid
,
&
pgroup
->
container
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
int32
scriptlib
::
duel_set_must_select_cards
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_set_must_select_cards
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
1
,
TRUE
))
{
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
1
,
TRUE
))
{
...
...
scriptlib.h
View file @
388e593f
...
@@ -441,6 +441,7 @@ public:
...
@@ -441,6 +441,7 @@ public:
static
int32
duel_check_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
(
lua_State
*
L
);
static
int32
duel_release_ritual_material
(
lua_State
*
L
);
static
int32
duel_release_ritual_material
(
lua_State
*
L
);
static
int32
duel_get_fusion_material
(
lua_State
*
L
);
static
int32
duel_set_must_select_cards
(
lua_State
*
L
);
static
int32
duel_set_must_select_cards
(
lua_State
*
L
);
static
int32
duel_set_target_card
(
lua_State
*
L
);
static
int32
duel_set_target_card
(
lua_State
*
L
);
static
int32
duel_clear_target_card
(
lua_State
*
L
);
static
int32
duel_clear_target_card
(
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