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
9c5c4a53
Commit
9c5c4a53
authored
Jun 19, 2019
by
DailyShana
Committed by
GitHub
Jun 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use TYPE_SPSUMMON to indicate unsummonable cards (#217)
parent
a6867db7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
30 deletions
+9
-30
card.cpp
card.cpp
+4
-2
effect.h
effect.h
+1
-1
interpreter.cpp
interpreter.cpp
+0
-1
libcard.cpp
libcard.cpp
+2
-23
operations.cpp
operations.cpp
+2
-2
scriptlib.h
scriptlib.h
+0
-1
No files found.
card.cpp
View file @
9c5c4a53
...
@@ -2888,9 +2888,11 @@ int32 card::check_cost_condition(int32 ecode, int32 playerid, int32 sumtype) {
...
@@ -2888,9 +2888,11 @@ int32 card::check_cost_condition(int32 ecode, int32 playerid, int32 sumtype) {
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_summonable_card
()
{
int32
card
::
is_summonable_card
()
{
if
(
!
(
data
.
type
&
TYPE_MONSTER
)
||
(
data
.
type
&
TYPE_TOKEN
)
)
if
(
!
(
data
.
type
&
TYPE_MONSTER
))
return
FALSE
;
return
FALSE
;
return
!
is_affected_by_effect
(
EFFECT_UNSUMMONABLE_CARD
);
return
!
(
data
.
type
&
(
TYPE_RITUAL
|
TYPE_SPSUMMON
|
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
|
TYPE_TOKEN
));
}
}
int32
card
::
is_fusion_summonable_card
(
uint32
summon_type
)
{
int32
card
::
is_fusion_summonable_card
(
uint32
summon_type
)
{
if
(
!
(
data
.
type
&
TYPE_FUSION
))
if
(
!
(
data
.
type
&
TYPE_FUSION
))
...
...
effect.h
View file @
9c5c4a53
...
@@ -419,7 +419,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -419,7 +419,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_CANNOT_SELECT_EFFECT_TARGET 333
#define EFFECT_CANNOT_SELECT_EFFECT_TARGET 333
#define EFFECT_ADD_SETCODE 334
#define EFFECT_ADD_SETCODE 334
#define EFFECT_NO_EFFECT_DAMAGE 335
#define EFFECT_NO_EFFECT_DAMAGE 335
#define EFFECT_UNSUMMONABLE_CARD 336
//
#define EFFECT_UNSUMMONABLE_CARD 336
#define EFFECT_DISCARD_COST_CHANGE 338
#define EFFECT_DISCARD_COST_CHANGE 338
#define EFFECT_HAND_SYNCHRO 339
#define EFFECT_HAND_SYNCHRO 339
#define EFFECT_ADD_FUSION_CODE 340
#define EFFECT_ADD_FUSION_CODE 340
...
...
interpreter.cpp
View file @
9c5c4a53
...
@@ -179,7 +179,6 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -179,7 +179,6 @@ static const struct luaL_Reg cardlib[] = {
{
"IsRelateToBattle"
,
scriptlib
::
card_is_relate_to_battle
},
{
"IsRelateToBattle"
,
scriptlib
::
card_is_relate_to_battle
},
{
"CopyEffect"
,
scriptlib
::
card_copy_effect
},
{
"CopyEffect"
,
scriptlib
::
card_copy_effect
},
{
"ReplaceEffect"
,
scriptlib
::
card_replace_effect
},
{
"ReplaceEffect"
,
scriptlib
::
card_replace_effect
},
{
"EnableUnsummonable"
,
scriptlib
::
card_enable_unsummonable
},
{
"EnableReviveLimit"
,
scriptlib
::
card_enable_revive_limit
},
{
"EnableReviveLimit"
,
scriptlib
::
card_enable_revive_limit
},
{
"CompleteProcedure"
,
scriptlib
::
card_complete_procedure
},
{
"CompleteProcedure"
,
scriptlib
::
card_complete_procedure
},
{
"IsDisabled"
,
scriptlib
::
card_is_disabled
},
{
"IsDisabled"
,
scriptlib
::
card_is_disabled
},
...
...
libcard.cpp
View file @
9c5c4a53
...
@@ -1862,7 +1862,7 @@ int32 scriptlib::card_replace_effect(lua_State * L) {
...
@@ -1862,7 +1862,7 @@ int32 scriptlib::card_replace_effect(lua_State * L) {
lua_pushinteger
(
L
,
pcard
->
replace_effect
(
code
,
reset
,
count
));
lua_pushinteger
(
L
,
pcard
->
replace_effect
(
code
,
reset
,
count
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_enable_
unsummonable
(
lua_State
*
L
)
{
int32
scriptlib
::
card_enable_
revive_limit
(
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
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
...
@@ -1870,34 +1870,13 @@ int32 scriptlib::card_enable_unsummonable(lua_State *L) {
...
@@ -1870,34 +1870,13 @@ int32 scriptlib::card_enable_unsummonable(lua_State *L) {
if
(
!
pcard
->
is_status
(
STATUS_COPYING_EFFECT
))
{
if
(
!
pcard
->
is_status
(
STATUS_COPYING_EFFECT
))
{
effect
*
peffect
=
pduel
->
new_effect
();
effect
*
peffect
=
pduel
->
new_effect
();
peffect
->
owner
=
pcard
;
peffect
->
owner
=
pcard
;
peffect
->
code
=
EFFECT_
UNSUMMONABLE_CARD
;
peffect
->
code
=
EFFECT_
REVIVE_LIMIT
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_UNCOPYABLE
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_UNCOPYABLE
;
pcard
->
add_effect
(
peffect
);
pcard
->
add_effect
(
peffect
);
}
}
return
0
;
return
0
;
}
}
int32
scriptlib
::
card_enable_revive_limit
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
!
pcard
->
is_status
(
STATUS_COPYING_EFFECT
))
{
effect
*
peffect1
=
pduel
->
new_effect
();
peffect1
->
owner
=
pcard
;
peffect1
->
code
=
EFFECT_UNSUMMONABLE_CARD
;
peffect1
->
type
=
EFFECT_TYPE_SINGLE
;
peffect1
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_UNCOPYABLE
;
pcard
->
add_effect
(
peffect1
);
effect
*
peffect2
=
pduel
->
new_effect
();
peffect2
->
owner
=
pcard
;
peffect2
->
code
=
EFFECT_REVIVE_LIMIT
;
peffect2
->
type
=
EFFECT_TYPE_SINGLE
;
peffect2
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
|
EFFECT_FLAG_UNCOPYABLE
;
pcard
->
add_effect
(
peffect2
);
}
return
0
;
}
int32
scriptlib
::
card_complete_procedure
(
lua_State
*
L
)
{
int32
scriptlib
::
card_complete_procedure
(
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
);
...
...
operations.cpp
View file @
9c5c4a53
...
@@ -1446,7 +1446,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
...
@@ -1446,7 +1446,7 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
int32
field
::
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
int32
field
::
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
if
(
!
(
target
->
data
.
type
&
TYPE_MONSTER
))
if
(
!
target
->
is_summonable_card
(
))
return
TRUE
;
return
TRUE
;
if
(
check_unique_onfield
(
target
,
sumplayer
,
LOCATION_MZONE
))
if
(
check_unique_onfield
(
target
,
sumplayer
,
LOCATION_MZONE
))
return
TRUE
;
return
TRUE
;
...
@@ -2013,7 +2013,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2013,7 +2013,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
int32
field
::
mset
(
uint16
step
,
uint8
setplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
int32
field
::
mset
(
uint16
step
,
uint8
setplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
if
(
target
->
is_affected_by_effect
(
EFFECT_UNSUMMONABLE_CARD
))
if
(
!
target
->
is_summonable_card
(
))
return
TRUE
;
return
TRUE
;
if
(
target
->
current
.
location
!=
LOCATION_HAND
)
if
(
target
->
current
.
location
!=
LOCATION_HAND
)
return
TRUE
;
return
TRUE
;
...
...
scriptlib.h
View file @
9c5c4a53
...
@@ -183,7 +183,6 @@ public:
...
@@ -183,7 +183,6 @@ public:
static
int32
card_is_relate_to_battle
(
lua_State
*
L
);
static
int32
card_is_relate_to_battle
(
lua_State
*
L
);
static
int32
card_copy_effect
(
lua_State
*
L
);
static
int32
card_copy_effect
(
lua_State
*
L
);
static
int32
card_replace_effect
(
lua_State
*
L
);
static
int32
card_replace_effect
(
lua_State
*
L
);
static
int32
card_enable_unsummonable
(
lua_State
*
L
);
static
int32
card_enable_revive_limit
(
lua_State
*
L
);
static
int32
card_enable_revive_limit
(
lua_State
*
L
);
static
int32
card_complete_procedure
(
lua_State
*
L
);
static
int32
card_complete_procedure
(
lua_State
*
L
);
static
int32
card_is_disabled
(
lua_State
*
L
);
static
int32
card_is_disabled
(
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