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
4d5a4b40
Commit
4d5a4b40
authored
Dec 19, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fusion type
parent
9d4ac1d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
1 deletion
+29
-1
card.cpp
card.cpp
+6
-1
card.h
card.h
+1
-0
interpreter.cpp
interpreter.cpp
+2
-0
libcard.cpp
libcard.cpp
+18
-0
scriptlib.h
scriptlib.h
+2
-0
No files found.
card.cpp
View file @
4d5a4b40
...
...
@@ -395,6 +395,11 @@ uint32 card::get_type() {
temp
.
type
=
0xffffffff
;
return
type
;
}
uint32
card
::
get_fusion_type
()
{
if
(
current
.
location
==
LOCATION_SZONE
)
return
data
.
type
;
return
get_type
();
}
// Atk and def are sepcial cases since text atk/def ? are involved.
// Asuumption: we can only change the atk/def of cards in LOCATION_MZONE.
int32
card
::
get_base_attack
()
{
...
...
@@ -942,7 +947,7 @@ uint32 card::get_fusion_attribute(uint8 playerid) {
filter_effect
(
EFFECT_CHANGE_FUSION_ATTRIBUTE
,
&
effects
);
if
(
!
effects
.
size
())
return
get_attribute
();
uint32
attribute
;
uint32
attribute
=
0
;
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
attribute
=
effects
[
i
]
->
get_value
(
this
,
1
);
...
...
card.h
View file @
4d5a4b40
...
...
@@ -169,6 +169,7 @@ public:
int32
is_pre_set_card
(
uint32
set_code
);
int32
is_fusion_set_card
(
uint32
set_code
);
uint32
get_type
();
uint32
get_fusion_type
();
int32
get_base_attack
();
int32
get_attack
();
int32
get_base_defense
();
...
...
interpreter.cpp
View file @
4d5a4b40
...
...
@@ -26,6 +26,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsFusionSetCard"
,
scriptlib
::
card_is_fusion_set_card
},
{
"GetType"
,
scriptlib
::
card_get_type
},
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetFusionType"
,
scriptlib
::
card_get_fusion_type
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
{
"GetRank"
,
scriptlib
::
card_get_rank
},
{
"GetSynchroLevel"
,
scriptlib
::
card_get_synchro_level
},
...
...
@@ -80,6 +81,7 @@ static const struct luaL_Reg cardlib[] = {
{
"GetRealFieldID"
,
scriptlib
::
card_get_fieldidr
},
{
"IsCode"
,
scriptlib
::
card_is_code
},
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsFusionType"
,
scriptlib
::
card_is_fusion_type
},
{
"IsRace"
,
scriptlib
::
card_is_race
},
{
"IsAttribute"
,
scriptlib
::
card_is_attribute
},
{
"IsFusionAttribute"
,
scriptlib
::
card_is_fusion_attribute
},
...
...
libcard.cpp
View file @
4d5a4b40
...
...
@@ -146,6 +146,13 @@ int32 scriptlib::card_get_origin_type(lua_State *L) {
lua_pushinteger
(
L
,
pcard
->
data
.
type
);
return
1
;
}
int32
scriptlib
::
card_get_fusion_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
lua_pushinteger
(
L
,
pcard
->
get_fusion_type
());
return
1
;
}
int32
scriptlib
::
card_get_level
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
@@ -576,6 +583,17 @@ int32 scriptlib::card_is_type(lua_State *L) {
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_fusion_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
ttype
=
lua_tointeger
(
L
,
2
);
if
(
pcard
->
get_fusion_type
()
&
ttype
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_race
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
scriptlib.h
View file @
4d5a4b40
...
...
@@ -28,6 +28,7 @@ public:
static
int32
card_is_fusion_set_card
(
lua_State
*
L
);
static
int32
card_get_type
(
lua_State
*
L
);
static
int32
card_get_origin_type
(
lua_State
*
L
);
static
int32
card_get_fusion_type
(
lua_State
*
L
);
static
int32
card_get_level
(
lua_State
*
L
);
static
int32
card_get_rank
(
lua_State
*
L
);
static
int32
card_get_synchro_level
(
lua_State
*
L
);
...
...
@@ -82,6 +83,7 @@ public:
static
int32
card_get_fieldidr
(
lua_State
*
L
);
static
int32
card_is_code
(
lua_State
*
L
);
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_fusion_type
(
lua_State
*
L
);
static
int32
card_is_race
(
lua_State
*
L
);
static
int32
card_is_attribute
(
lua_State
*
L
);
static
int32
card_is_fusion_attribute
(
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