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
2e2f392d
Commit
2e2f392d
authored
Jul 17, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
779170a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
card.cpp
card.cpp
+7
-7
card.h
card.h
+1
-0
field.cpp
field.cpp
+4
-4
libcard.cpp
libcard.cpp
+1
-1
No files found.
card.cpp
View file @
2e2f392d
...
@@ -3406,11 +3406,11 @@ int32 card::is_capable_send_to_grave(uint8 playerid) {
...
@@ -3406,11 +3406,11 @@ int32 card::is_capable_send_to_grave(uint8 playerid) {
int32
card
::
is_capable_send_to_hand
(
uint8
playerid
)
{
int32
card
::
is_capable_send_to_hand
(
uint8
playerid
)
{
if
(
is_status
(
STATUS_LEAVE_CONFIRMED
))
if
(
is_status
(
STATUS_LEAVE_CONFIRMED
))
return
FALSE
;
return
FALSE
;
if
((
current
.
location
==
LOCATION_EXTRA
)
&&
(
data
.
type
&
(
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
)
))
if
((
current
.
location
==
LOCATION_EXTRA
)
&&
is_extra_deck_monster
(
))
return
FALSE
;
return
FALSE
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_HAND
))
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_HAND
))
return
FALSE
;
return
FALSE
;
if
(
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)
&&
!
is_capable_send_to_deck
(
playerid
))
if
(
is_extra_deck_monster
(
)
&&
!
is_capable_send_to_deck
(
playerid
))
return
FALSE
;
return
FALSE
;
if
(
!
pduel
->
game_field
->
is_player_can_send_to_hand
(
playerid
,
this
))
if
(
!
pduel
->
game_field
->
is_player_can_send_to_hand
(
playerid
,
this
))
return
FALSE
;
return
FALSE
;
...
@@ -3419,7 +3419,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) {
...
@@ -3419,7 +3419,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) {
int32
card
::
is_capable_send_to_deck
(
uint8
playerid
)
{
int32
card
::
is_capable_send_to_deck
(
uint8
playerid
)
{
if
(
is_status
(
STATUS_LEAVE_CONFIRMED
))
if
(
is_status
(
STATUS_LEAVE_CONFIRMED
))
return
FALSE
;
return
FALSE
;
if
((
current
.
location
==
LOCATION_EXTRA
)
&&
(
data
.
type
&
(
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
)
))
if
((
current
.
location
==
LOCATION_EXTRA
)
&&
is_extra_deck_monster
(
))
return
FALSE
;
return
FALSE
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
))
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
))
return
FALSE
;
return
FALSE
;
...
@@ -3428,7 +3428,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) {
...
@@ -3428,7 +3428,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) {
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_capable_send_to_extra
(
uint8
playerid
)
{
int32
card
::
is_capable_send_to_extra
(
uint8
playerid
)
{
if
(
!
(
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_PENDULUM
|
TYPE_LINK
)
))
if
(
!
is_extra_deck_monster
()
&&
!
(
data
.
type
&
TYPE_PENDULUM
))
return
FALSE
;
return
FALSE
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
))
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
))
return
FALSE
;
return
FALSE
;
...
@@ -3466,7 +3466,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) {
...
@@ -3466,7 +3466,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) {
int32
card
::
is_capable_cost_to_hand
(
uint8
playerid
)
{
int32
card
::
is_capable_cost_to_hand
(
uint8
playerid
)
{
uint32
redirect
=
0
;
uint32
redirect
=
0
;
uint32
dest
=
LOCATION_HAND
;
uint32
dest
=
LOCATION_HAND
;
if
(
data
.
type
&
(
TYPE_TOKEN
|
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
if
(
data
.
type
&
(
TYPE_TOKEN
)
||
is_extra_deck_monster
(
))
return
FALSE
;
return
FALSE
;
if
(
current
.
location
==
LOCATION_HAND
)
if
(
current
.
location
==
LOCATION_HAND
)
return
FALSE
;
return
FALSE
;
...
@@ -3489,7 +3489,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) {
...
@@ -3489,7 +3489,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) {
int32
card
::
is_capable_cost_to_deck
(
uint8
playerid
)
{
int32
card
::
is_capable_cost_to_deck
(
uint8
playerid
)
{
uint32
redirect
=
0
;
uint32
redirect
=
0
;
uint32
dest
=
LOCATION_DECK
;
uint32
dest
=
LOCATION_DECK
;
if
(
data
.
type
&
(
TYPE_TOKEN
|
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
if
(
data
.
type
&
(
TYPE_TOKEN
)
||
is_extra_deck_monster
(
))
return
FALSE
;
return
FALSE
;
if
(
current
.
location
==
LOCATION_DECK
)
if
(
current
.
location
==
LOCATION_DECK
)
return
FALSE
;
return
FALSE
;
...
@@ -3512,7 +3512,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) {
...
@@ -3512,7 +3512,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) {
int32
card
::
is_capable_cost_to_extra
(
uint8
playerid
)
{
int32
card
::
is_capable_cost_to_extra
(
uint8
playerid
)
{
uint32
redirect
=
0
;
uint32
redirect
=
0
;
uint32
dest
=
LOCATION_DECK
;
uint32
dest
=
LOCATION_DECK
;
if
(
!
(
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)
))
if
(
!
is_extra_deck_monster
(
))
return
FALSE
;
return
FALSE
;
if
(
current
.
location
==
LOCATION_EXTRA
)
if
(
current
.
location
==
LOCATION_EXTRA
)
return
FALSE
;
return
FALSE
;
...
...
card.h
View file @
2e2f392d
...
@@ -188,6 +188,7 @@ public:
...
@@ -188,6 +188,7 @@ public:
explicit
card
(
duel
*
pd
);
explicit
card
(
duel
*
pd
);
~
card
();
~
card
();
static
bool
card_operation_sort
(
card
*
c1
,
card
*
c2
);
static
bool
card_operation_sort
(
card
*
c1
,
card
*
c2
);
const
bool
is_extra_deck_monster
()
{
return
!!
(
data
.
type
&
0x4802040
);
}
uint32
get_infos
(
byte
*
buf
,
int32
query_flag
,
int32
use_cache
=
TRUE
);
uint32
get_infos
(
byte
*
buf
,
int32
query_flag
,
int32
use_cache
=
TRUE
);
uint32
get_info_location
();
uint32
get_info_location
();
...
...
field.cpp
View file @
2e2f392d
...
@@ -162,7 +162,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
...
@@ -162,7 +162,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
return
;
return
;
if
(
!
is_location_useable
(
playerid
,
location
,
sequence
))
if
(
!
is_location_useable
(
playerid
,
location
,
sequence
))
return
;
return
;
if
(
(
pcard
->
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)
)
&&
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
)))
{
if
(
pcard
->
is_extra_deck_monster
(
)
&&
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
)))
{
location
=
LOCATION_EXTRA
;
location
=
LOCATION_EXTRA
;
pcard
->
sendto_param
.
position
=
POS_FACEDOWN_DEFENSE
;
pcard
->
sendto_param
.
position
=
POS_FACEDOWN_DEFENSE
;
}
}
...
@@ -300,7 +300,7 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
...
@@ -300,7 +300,7 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
return
;
return
;
uint8
preplayer
=
pcard
->
current
.
controler
;
uint8
preplayer
=
pcard
->
current
.
controler
;
uint8
presequence
=
pcard
->
current
.
sequence
;
uint8
presequence
=
pcard
->
current
.
sequence
;
if
(
(
pcard
->
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)
)
&&
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
)))
{
if
(
pcard
->
is_extra_deck_monster
(
)
&&
(
location
&
(
LOCATION_HAND
|
LOCATION_DECK
)))
{
location
=
LOCATION_EXTRA
;
location
=
LOCATION_EXTRA
;
pcard
->
sendto_param
.
position
=
POS_FACEDOWN_DEFENSE
;
pcard
->
sendto_param
.
position
=
POS_FACEDOWN_DEFENSE
;
}
}
...
@@ -991,7 +991,7 @@ void field::swap_deck_and_grave(uint8 playerid) {
...
@@ -991,7 +991,7 @@ void field::swap_deck_and_grave(uint8 playerid) {
player
[
playerid
].
list_grave
.
swap
(
player
[
playerid
].
list_main
);
player
[
playerid
].
list_grave
.
swap
(
player
[
playerid
].
list_main
);
card_vector
ex
;
card_vector
ex
;
for
(
auto
clit
=
player
[
playerid
].
list_main
.
begin
();
clit
!=
player
[
playerid
].
list_main
.
end
();
)
{
for
(
auto
clit
=
player
[
playerid
].
list_main
.
begin
();
clit
!=
player
[
playerid
].
list_main
.
end
();
)
{
if
((
*
clit
)
->
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
{
if
((
*
clit
)
->
is_extra_deck_monster
(
))
{
ex
.
push_back
(
*
clit
);
ex
.
push_back
(
*
clit
);
clit
=
player
[
playerid
].
list_main
.
erase
(
clit
);
clit
=
player
[
playerid
].
list_main
.
erase
(
clit
);
}
else
}
else
...
@@ -3272,7 +3272,7 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
...
@@ -3272,7 +3272,7 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
3
))
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
3
))
return
FALSE
;
return
FALSE
;
}
}
if
(
(
pcard
->
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
&&
!
is_player_can_send_to_deck
(
playerid
,
pcard
))
if
(
pcard
->
is_extra_deck_monster
()
&&
!
is_player_can_send_to_deck
(
playerid
,
pcard
))
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
...
...
libcard.cpp
View file @
2e2f392d
...
@@ -2112,7 +2112,7 @@ int32 scriptlib::card_is_able_to_deck_or_extra_as_cost(lua_State *L) {
...
@@ -2112,7 +2112,7 @@ int32 scriptlib::card_is_able_to_deck_or_extra_as_cost(lua_State *L) {
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
);
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
int32
val
=
(
pcard
->
data
.
type
&
0x4802040
)
?
pcard
->
is_capable_cost_to_extra
(
p
)
:
pcard
->
is_capable_cost_to_deck
(
p
);
int32
val
=
pcard
->
is_extra_deck_monster
(
)
?
pcard
->
is_capable_cost_to_extra
(
p
)
:
pcard
->
is_capable_cost_to_deck
(
p
);
if
(
val
)
if
(
val
)
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
else
else
...
...
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