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
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
MyCard
ygopro-core
Commits
79b9ee57
Commit
79b9ee57
authored
Nov 15, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fusion attribute
parent
7f7633b1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
1 deletion
+56
-1
card.cpp
card.cpp
+20
-1
card.h
card.h
+1
-0
effect.h
effect.h
+3
-0
interpreter.cpp
interpreter.cpp
+2
-0
libcard.cpp
libcard.cpp
+28
-0
scriptlib.h
scriptlib.h
+2
-0
No files found.
card.cpp
View file @
79b9ee57
...
@@ -936,6 +936,18 @@ uint32 card::get_attribute() {
...
@@ -936,6 +936,18 @@ uint32 card::get_attribute() {
temp
.
attribute
=
0xffffffff
;
temp
.
attribute
=
0xffffffff
;
return
attribute
;
return
attribute
;
}
}
uint32
card
::
get_fusion_attribute
(
uint8
playerid
)
{
effect_set
effects
;
filter_effect
(
EFFECT_CHANGE_FUSION_ATTRIBUTE
,
&
effects
);
if
(
!
effects
.
size
())
return
get_attribute
();
uint32
attribute
;
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
attribute
=
effects
[
i
]
->
get_value
(
this
,
1
);
}
return
attribute
;
}
// see get_level()
// see get_level()
uint32
card
::
get_race
()
{
uint32
card
::
get_race
()
{
if
(
assume_type
==
ASSUME_RACE
)
if
(
assume_type
==
ASSUME_RACE
)
...
@@ -2148,7 +2160,14 @@ int32 card::fusion_check(group* fusion_m, card* cg, uint32 chkf) {
...
@@ -2148,7 +2160,14 @@ int32 card::fusion_check(group* fusion_m, card* cg, uint32 chkf) {
pduel
->
lua
->
add_param
(
fusion_m
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
fusion_m
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
cg
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
cg
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
chkf
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
chkf
,
PARAM_TYPE_INT
);
return
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
4
);
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
pduel
->
game_field
->
core
.
reason_player
=
peffect
->
get_handler_player
();
int32
res
=
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
4
);
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
pduel
->
game_field
->
core
.
reason_player
=
op
;
return
res
;
}
}
void
card
::
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
)
{
void
card
::
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
)
{
effect
*
peffect
=
0
;
effect
*
peffect
=
0
;
...
...
card.h
View file @
79b9ee57
...
@@ -178,6 +178,7 @@ public:
...
@@ -178,6 +178,7 @@ public:
uint32
get_ritual_level
(
card
*
pcard
);
uint32
get_ritual_level
(
card
*
pcard
);
uint32
check_xyz_level
(
card
*
pcard
,
uint32
lv
);
uint32
check_xyz_level
(
card
*
pcard
,
uint32
lv
);
uint32
get_attribute
();
uint32
get_attribute
();
uint32
get_fusion_attribute
(
uint8
playerid
);
uint32
get_race
();
uint32
get_race
();
uint32
get_lscale
();
uint32
get_lscale
();
uint32
get_rscale
();
uint32
get_rscale
();
...
...
effect.h
View file @
79b9ee57
...
@@ -405,6 +405,9 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -405,6 +405,9 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_EXTRA_ATTACK_MONSTER 346
#define EFFECT_EXTRA_ATTACK_MONSTER 346
#define EFFECT_UNION_STATUS 347
#define EFFECT_UNION_STATUS 347
#define EFFECT_OLDUNION_STATUS 348
#define EFFECT_OLDUNION_STATUS 348
//#define EFFECT_ADD_FUSION_ATTRIBUTE 349
//#define EFFECT_REMOVE_FUSION_ATTRIBUTE 350
#define EFFECT_CHANGE_FUSION_ATTRIBUTE 351
#define EVENT_STARTUP 1000
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
#define EVENT_FLIP 1001
...
...
interpreter.cpp
View file @
79b9ee57
...
@@ -39,6 +39,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -39,6 +39,7 @@ static const struct luaL_Reg cardlib[] = {
{
"GetOriginalRightScale"
,
scriptlib
::
card_get_origin_rscale
},
{
"GetOriginalRightScale"
,
scriptlib
::
card_get_origin_rscale
},
{
"GetAttribute"
,
scriptlib
::
card_get_attribute
},
{
"GetAttribute"
,
scriptlib
::
card_get_attribute
},
{
"GetOriginalAttribute"
,
scriptlib
::
card_get_origin_attribute
},
{
"GetOriginalAttribute"
,
scriptlib
::
card_get_origin_attribute
},
{
"GetFusionAttribute"
,
scriptlib
::
card_get_fusion_attribute
},
{
"GetRace"
,
scriptlib
::
card_get_race
},
{
"GetRace"
,
scriptlib
::
card_get_race
},
{
"GetOriginalRace"
,
scriptlib
::
card_get_origin_race
},
{
"GetOriginalRace"
,
scriptlib
::
card_get_origin_race
},
{
"GetAttack"
,
scriptlib
::
card_get_attack
},
{
"GetAttack"
,
scriptlib
::
card_get_attack
},
...
@@ -81,6 +82,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -81,6 +82,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsRace"
,
scriptlib
::
card_is_race
},
{
"IsRace"
,
scriptlib
::
card_is_race
},
{
"IsAttribute"
,
scriptlib
::
card_is_attribute
},
{
"IsAttribute"
,
scriptlib
::
card_is_attribute
},
{
"IsFusionAttribute"
,
scriptlib
::
card_is_fusion_attribute
},
{
"IsReason"
,
scriptlib
::
card_is_reason
},
{
"IsReason"
,
scriptlib
::
card_is_reason
},
{
"IsStatus"
,
scriptlib
::
card_is_status
},
{
"IsStatus"
,
scriptlib
::
card_is_status
},
{
"IsNotTuner"
,
scriptlib
::
card_is_not_tuner
},
{
"IsNotTuner"
,
scriptlib
::
card_is_not_tuner
},
...
...
libcard.cpp
View file @
79b9ee57
...
@@ -251,6 +251,18 @@ int32 scriptlib::card_get_origin_attribute(lua_State *L) {
...
@@ -251,6 +251,18 @@ int32 scriptlib::card_get_origin_attribute(lua_State *L) {
lua_pushinteger
(
L
,
pcard
->
data
.
attribute
);
lua_pushinteger
(
L
,
pcard
->
data
.
attribute
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_get_fusion_attribute
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
int32
playerid
=
PLAYER_NONE
;
if
(
lua_gettop
(
L
)
>
1
&&
!
lua_isnil
(
L
,
2
))
playerid
=
lua_tointeger
(
L
,
2
);
else
playerid
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
lua_pushinteger
(
L
,
pcard
->
get_fusion_attribute
(
playerid
));
return
1
;
}
int32
scriptlib
::
card_get_race
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_race
(
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
);
...
@@ -586,6 +598,22 @@ int32 scriptlib::card_is_attribute(lua_State *L) {
...
@@ -586,6 +598,22 @@ int32 scriptlib::card_is_attribute(lua_State *L) {
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_fusion_attribute
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
tattrib
=
lua_tointeger
(
L
,
2
);
int32
playerid
=
PLAYER_NONE
;
if
(
lua_gettop
(
L
)
>
2
&&
!
lua_isnil
(
L
,
3
))
playerid
=
lua_tointeger
(
L
,
3
);
else
playerid
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
if
(
pcard
->
get_fusion_attribute
(
playerid
)
&
tattrib
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_reason
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_reason
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
scriptlib.h
View file @
79b9ee57
...
@@ -41,6 +41,7 @@ public:
...
@@ -41,6 +41,7 @@ public:
static
int32
card_get_origin_rscale
(
lua_State
*
L
);
static
int32
card_get_origin_rscale
(
lua_State
*
L
);
static
int32
card_get_attribute
(
lua_State
*
L
);
static
int32
card_get_attribute
(
lua_State
*
L
);
static
int32
card_get_origin_attribute
(
lua_State
*
L
);
static
int32
card_get_origin_attribute
(
lua_State
*
L
);
static
int32
card_get_fusion_attribute
(
lua_State
*
L
);
static
int32
card_get_race
(
lua_State
*
L
);
static
int32
card_get_race
(
lua_State
*
L
);
static
int32
card_get_origin_race
(
lua_State
*
L
);
static
int32
card_get_origin_race
(
lua_State
*
L
);
static
int32
card_get_attack
(
lua_State
*
L
);
static
int32
card_get_attack
(
lua_State
*
L
);
...
@@ -83,6 +84,7 @@ public:
...
@@ -83,6 +84,7 @@ public:
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_race
(
lua_State
*
L
);
static
int32
card_is_race
(
lua_State
*
L
);
static
int32
card_is_attribute
(
lua_State
*
L
);
static
int32
card_is_attribute
(
lua_State
*
L
);
static
int32
card_is_fusion_attribute
(
lua_State
*
L
);
static
int32
card_is_reason
(
lua_State
*
L
);
static
int32
card_is_reason
(
lua_State
*
L
);
static
int32
card_is_status
(
lua_State
*
L
);
static
int32
card_is_status
(
lua_State
*
L
);
static
int32
card_is_not_tuner
(
lua_State
*
L
);
static
int32
card_is_not_tuner
(
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