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
4704aa74
Commit
4704aa74
authored
May 30, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ac0471ae
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
2 deletions
+32
-2
card.cpp
card.cpp
+6
-1
card.h
card.h
+1
-0
field.cpp
field.cpp
+1
-1
interpreter.cpp
interpreter.cpp
+2
-0
libcard.cpp
libcard.cpp
+18
-0
operations.cpp
operations.cpp
+2
-0
scriptlib.h
scriptlib.h
+2
-0
No files found.
card.cpp
View file @
4704aa74
...
@@ -435,6 +435,11 @@ uint32 card::get_fusion_type() {
...
@@ -435,6 +435,11 @@ uint32 card::get_fusion_type() {
return
data
.
type
;
return
data
.
type
;
return
get_type
();
return
get_type
();
}
}
uint32
card
::
get_synchro_type
()
{
if
(
current
.
location
==
LOCATION_SZONE
&&
(
data
.
type
&
TYPE_MONSTER
))
return
data
.
type
;
return
get_type
();
}
// Atk and def are sepcial cases since text atk/def ? are involved.
// 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.
// Asuumption: we can only change the atk/def of cards in LOCATION_MZONE.
int32
card
::
get_base_attack
()
{
int32
card
::
get_base_attack
()
{
...
@@ -3318,7 +3323,7 @@ int32 card::is_can_be_fusion_material(card* fcard) {
...
@@ -3318,7 +3323,7 @@ int32 card::is_can_be_fusion_material(card* fcard) {
int32
card
::
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
)
{
int32
card
::
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
)
{
if
(
data
.
type
&
(
TYPE_XYZ
|
TYPE_LINK
))
if
(
data
.
type
&
(
TYPE_XYZ
|
TYPE_LINK
))
return
FALSE
;
return
FALSE
;
if
(
!
(
get_type
()
&
TYPE_MONSTER
))
if
(
!
(
get_
synchro_
type
()
&
TYPE_MONSTER
))
return
FALSE
;
return
FALSE
;
if
(
scard
&&
current
.
location
==
LOCATION_MZONE
&&
current
.
controler
!=
scard
->
current
.
controler
&&
!
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL
))
if
(
scard
&&
current
.
location
==
LOCATION_MZONE
&&
current
.
controler
!=
scard
->
current
.
controler
&&
!
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL
))
return
FALSE
;
return
FALSE
;
...
...
card.h
View file @
4704aa74
...
@@ -178,6 +178,7 @@ public:
...
@@ -178,6 +178,7 @@ public:
int32
is_fusion_set_card
(
uint32
set_code
);
int32
is_fusion_set_card
(
uint32
set_code
);
uint32
get_type
();
uint32
get_type
();
uint32
get_fusion_type
();
uint32
get_fusion_type
();
uint32
get_synchro_type
();
int32
get_base_attack
();
int32
get_base_attack
();
int32
get_attack
();
int32
get_attack
();
int32
get_base_defense
();
int32
get_base_defense
();
...
...
field.cpp
View file @
4704aa74
...
@@ -2394,7 +2394,7 @@ int32 field::check_synchro_material(card* pcard, int32 findex1, int32 findex2, i
...
@@ -2394,7 +2394,7 @@ int32 field::check_synchro_material(card* pcard, int32 findex1, int32 findex2, i
return
FALSE
;
return
FALSE
;
}
}
int32
field
::
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
int32
field
::
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
if
(
!
tuner
||
!
tuner
->
is_position
(
POS_FACEUP
)
||
!
(
tuner
->
get_type
()
&
TYPE_TUNER
)
||
!
tuner
->
is_can_be_synchro_material
(
pcard
))
if
(
!
tuner
||
!
tuner
->
is_position
(
POS_FACEUP
)
||
!
(
tuner
->
get_
synchro_
type
()
&
TYPE_TUNER
)
||
!
tuner
->
is_can_be_synchro_material
(
pcard
))
return
FALSE
;
return
FALSE
;
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
if
(
pcheck
)
if
(
pcheck
)
...
...
interpreter.cpp
View file @
4704aa74
...
@@ -28,6 +28,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -28,6 +28,7 @@ static const struct luaL_Reg cardlib[] = {
{
"GetType"
,
scriptlib
::
card_get_type
},
{
"GetType"
,
scriptlib
::
card_get_type
},
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetOriginalType"
,
scriptlib
::
card_get_origin_type
},
{
"GetFusionType"
,
scriptlib
::
card_get_fusion_type
},
{
"GetFusionType"
,
scriptlib
::
card_get_fusion_type
},
{
"GetSynchroType"
,
scriptlib
::
card_get_synchro_type
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
{
"GetLevel"
,
scriptlib
::
card_get_level
},
{
"GetRank"
,
scriptlib
::
card_get_rank
},
{
"GetRank"
,
scriptlib
::
card_get_rank
},
{
"GetLink"
,
scriptlib
::
card_get_link
},
{
"GetLink"
,
scriptlib
::
card_get_link
},
...
@@ -88,6 +89,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -88,6 +89,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsCode"
,
scriptlib
::
card_is_code
},
{
"IsCode"
,
scriptlib
::
card_is_code
},
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsType"
,
scriptlib
::
card_is_type
},
{
"IsFusionType"
,
scriptlib
::
card_is_fusion_type
},
{
"IsFusionType"
,
scriptlib
::
card_is_fusion_type
},
{
"IsSynchroType"
,
scriptlib
::
card_is_synchro_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
},
{
"IsFusionAttribute"
,
scriptlib
::
card_is_fusion_attribute
},
...
...
libcard.cpp
View file @
4704aa74
...
@@ -161,6 +161,13 @@ int32 scriptlib::card_get_fusion_type(lua_State *L) {
...
@@ -161,6 +161,13 @@ int32 scriptlib::card_get_fusion_type(lua_State *L) {
lua_pushinteger
(
L
,
pcard
->
get_fusion_type
());
lua_pushinteger
(
L
,
pcard
->
get_fusion_type
());
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_get_synchro_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_synchro_type
());
return
1
;
}
int32
scriptlib
::
card_get_level
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_level
(
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
);
...
@@ -643,6 +650,17 @@ int32 scriptlib::card_is_fusion_type(lua_State *L) {
...
@@ -643,6 +650,17 @@ int32 scriptlib::card_is_fusion_type(lua_State *L) {
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_synchro_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_synchro_type
()
&
ttype
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
card_is_race
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_race
(
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
);
...
...
operations.cpp
View file @
4704aa74
...
@@ -884,6 +884,8 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
...
@@ -884,6 +884,8 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
}
}
card
*
pcard
=
*
targets
->
it
;
card
*
pcard
=
*
targets
->
it
;
move_to_field
(
pcard
,
playerid
,
playerid
,
LOCATION_MZONE
,
pcard
->
current
.
position
,
FALSE
,
0
,
FALSE
,
zone
);
move_to_field
(
pcard
,
playerid
,
playerid
,
LOCATION_MZONE
,
pcard
->
current
.
position
,
FALSE
,
0
,
FALSE
,
zone
);
pcard
->
fieldid
=
infos
.
field_id
++
;
pcard
->
fieldid_r
=
pcard
->
fieldid
;
return
FALSE
;
return
FALSE
;
}
}
case
4
:
{
case
4
:
{
...
...
scriptlib.h
View file @
4704aa74
...
@@ -30,6 +30,7 @@ public:
...
@@ -30,6 +30,7 @@ public:
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_fusion_type
(
lua_State
*
L
);
static
int32
card_get_fusion_type
(
lua_State
*
L
);
static
int32
card_get_synchro_type
(
lua_State
*
L
);
static
int32
card_get_level
(
lua_State
*
L
);
static
int32
card_get_level
(
lua_State
*
L
);
static
int32
card_get_rank
(
lua_State
*
L
);
static
int32
card_get_rank
(
lua_State
*
L
);
static
int32
card_get_link
(
lua_State
*
L
);
static
int32
card_get_link
(
lua_State
*
L
);
...
@@ -90,6 +91,7 @@ public:
...
@@ -90,6 +91,7 @@ public:
static
int32
card_is_code
(
lua_State
*
L
);
static
int32
card_is_code
(
lua_State
*
L
);
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_type
(
lua_State
*
L
);
static
int32
card_is_fusion_type
(
lua_State
*
L
);
static
int32
card_is_fusion_type
(
lua_State
*
L
);
static
int32
card_is_synchro_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_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