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
xiaoye
ygopro-core
Commits
e92e8c0b
You need to sign in or sign up before continuing.
Commit
e92e8c0b
authored
Dec 19, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2de8a5ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
0 deletions
+31
-0
card.cpp
card.cpp
+20
-0
card.h
card.h
+1
-0
interpreter.cpp
interpreter.cpp
+1
-0
libcard.cpp
libcard.cpp
+8
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
card.cpp
View file @
e92e8c0b
...
@@ -343,6 +343,26 @@ int32 card::is_pre_set_card(uint32 set_code) {
...
@@ -343,6 +343,26 @@ int32 card::is_pre_set_card(uint32 set_code) {
}
}
return
FALSE
;
return
FALSE
;
}
}
int32
card
::
is_fusion_set_card
(
uint32
set_code
)
{
if
(
is_set_card
(
set_code
))
return
TRUE
;
uint32
settype
=
set_code
&
0xfff
;
uint32
setsubtype
=
set_code
&
0xf000
;
effect_set
eset
;
filter_effect
(
EFFECT_ADD_FUSION_CODE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
uint32
code
=
eset
[
i
]
->
get_value
(
this
);
card_data
dat
;
::
read_card
(
code
,
&
dat
);
uint64
setcode
=
dat
.
setcode
;
while
(
setcode
)
{
if
((
setcode
&
0xfff
)
==
settype
&&
(
setcode
&
0xf000
&
setsubtype
)
==
setsubtype
)
return
TRUE
;
setcode
=
setcode
>>
16
;
}
}
return
FALSE
;
}
uint32
card
::
get_type
()
{
uint32
card
::
get_type
()
{
if
(
assume_type
==
ASSUME_TYPE
)
if
(
assume_type
==
ASSUME_TYPE
)
return
assume_value
;
return
assume_value
;
...
...
card.h
View file @
e92e8c0b
...
@@ -149,6 +149,7 @@ public:
...
@@ -149,6 +149,7 @@ public:
uint32
get_another_code
();
uint32
get_another_code
();
int32
is_set_card
(
uint32
set_code
);
int32
is_set_card
(
uint32
set_code
);
int32
is_pre_set_card
(
uint32
set_code
);
int32
is_pre_set_card
(
uint32
set_code
);
int32
is_fusion_set_card
(
uint32
set_code
);
uint32
get_type
();
uint32
get_type
();
int32
get_base_attack
(
uint8
swap
=
FALSE
);
int32
get_base_attack
(
uint8
swap
=
FALSE
);
int32
get_attack
();
int32
get_attack
();
...
...
interpreter.cpp
View file @
e92e8c0b
...
@@ -22,6 +22,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -22,6 +22,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsFusionCode"
,
scriptlib
::
card_is_fusion_code
},
{
"IsFusionCode"
,
scriptlib
::
card_is_fusion_code
},
{
"IsSetCard"
,
scriptlib
::
card_is_set_card
},
{
"IsSetCard"
,
scriptlib
::
card_is_set_card
},
{
"IsPreviousSetCard"
,
scriptlib
::
card_is_pre_set_card
},
{
"IsPreviousSetCard"
,
scriptlib
::
card_is_pre_set_card
},
{
"IsFusionSetCard"
,
scriptlib
::
card_is_fusion_set_card
},
{
"GetType"
,
scriptlib
::
card_get_type
},
{
"GetType"
,
scriptlib
::
card_get_type
},
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
...
...
libcard.cpp
View file @
e92e8c0b
...
@@ -100,6 +100,14 @@ int32 scriptlib::card_is_pre_set_card(lua_State *L) {
...
@@ -100,6 +100,14 @@ int32 scriptlib::card_is_pre_set_card(lua_State *L) {
lua_pushboolean
(
L
,
pcard
->
is_pre_set_card
(
set_code
));
lua_pushboolean
(
L
,
pcard
->
is_pre_set_card
(
set_code
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_fusion_set_card
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
set_code
=
lua_tointeger
(
L
,
2
);
lua_pushboolean
(
L
,
pcard
->
is_fusion_set_card
(
set_code
));
return
1
;
}
int32
scriptlib
::
card_get_type
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
scriptlib.h
View file @
e92e8c0b
...
@@ -24,6 +24,7 @@ public:
...
@@ -24,6 +24,7 @@ public:
static
int32
card_is_fusion_code
(
lua_State
*
L
);
static
int32
card_is_fusion_code
(
lua_State
*
L
);
static
int32
card_is_set_card
(
lua_State
*
L
);
static
int32
card_is_set_card
(
lua_State
*
L
);
static
int32
card_is_pre_set_card
(
lua_State
*
L
);
static
int32
card_is_pre_set_card
(
lua_State
*
L
);
static
int32
card_is_fusion_set_card
(
lua_State
*
L
);
static
int32
card_get_type
(
lua_State
*
L
);
static
int32
card_get_type
(
lua_State
*
L
);
static
int32
card_get_origin_type
(
lua_State
*
L
);
static
int32
card_get_origin_type
(
lua_State
*
L
);
static
int32
card_get_level
(
lua_State
*
L
);
static
int32
card_get_level
(
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