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
6be2e850
Commit
6be2e850
authored
Jul 17, 2018
by
Momobako
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
9a2b4b4c
861b5bcd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
27 deletions
+28
-27
card.cpp
card.cpp
+8
-6
card.h
card.h
+1
-0
field.cpp
field.cpp
+5
-3
interpreter.cpp
interpreter.cpp
+0
-1
libcard.cpp
libcard.cpp
+1
-1
libduel.cpp
libduel.cpp
+13
-15
scriptlib.h
scriptlib.h
+0
-1
No files found.
card.cpp
View file @
6be2e850
...
...
@@ -3461,10 +3461,12 @@ int32 card::is_capable_send_to_grave(uint8 playerid) {
int32
card
::
is_capable_send_to_hand
(
uint8
playerid
)
{
if
(
is_status
(
STATUS_LEAVE_CONFIRMED
))
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
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_HAND
))
return
FALSE
;
if
(
is_extra_deck_monster
()
&&
!
is_capable_send_to_deck
(
playerid
))
return
FALSE
;
if
(
!
pduel
->
game_field
->
is_player_can_send_to_hand
(
playerid
,
this
))
return
FALSE
;
return
TRUE
;
...
...
@@ -3472,7 +3474,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) {
int32
card
::
is_capable_send_to_deck
(
uint8
playerid
)
{
if
(
is_status
(
STATUS_LEAVE_CONFIRMED
))
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
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
))
return
FALSE
;
...
...
@@ -3481,7 +3483,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) {
return
TRUE
;
}
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
;
if
(
is_affected_by_effect
(
EFFECT_CANNOT_TO_DECK
))
return
FALSE
;
...
...
@@ -3519,7 +3521,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) {
int32
card
::
is_capable_cost_to_hand
(
uint8
playerid
)
{
uint32
redirect
=
0
;
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
;
if
(
current
.
location
==
LOCATION_HAND
)
return
FALSE
;
...
...
@@ -3542,7 +3544,7 @@ int32 card::is_capable_cost_to_hand(uint8 playerid) {
int32
card
::
is_capable_cost_to_deck
(
uint8
playerid
)
{
uint32
redirect
=
0
;
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
;
if
(
current
.
location
==
LOCATION_DECK
)
return
FALSE
;
...
...
@@ -3565,7 +3567,7 @@ int32 card::is_capable_cost_to_deck(uint8 playerid) {
int32
card
::
is_capable_cost_to_extra
(
uint8
playerid
)
{
uint32
redirect
=
0
;
uint32
dest
=
LOCATION_DECK
;
if
(
!
(
data
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)
))
if
(
!
is_extra_deck_monster
(
))
return
FALSE
;
if
(
current
.
location
==
LOCATION_EXTRA
)
return
FALSE
;
...
...
card.h
View file @
6be2e850
...
...
@@ -193,6 +193,7 @@ public:
explicit
card
(
duel
*
pd
);
~
card
();
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_info_location
();
...
...
field.cpp
View file @
6be2e850
...
...
@@ -162,7 +162,7 @@ void field::add_card(uint8 playerid, card* pcard, uint8 location, uint8 sequence
return
;
if
(
!
is_location_useable
(
playerid
,
location
,
sequence
))
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
;
pcard
->
sendto_param
.
position
=
POS_FACEDOWN_DEFENSE
;
}
...
...
@@ -300,7 +300,7 @@ void field::move_card(uint8 playerid, card* pcard, uint8 location, uint8 sequenc
return
;
uint8
preplayer
=
pcard
->
current
.
controler
;
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
;
pcard
->
sendto_param
.
position
=
POS_FACEDOWN_DEFENSE
;
}
...
...
@@ -991,7 +991,7 @@ void field::swap_deck_and_grave(uint8 playerid) {
player
[
playerid
].
list_grave
.
swap
(
player
[
playerid
].
list_main
);
card_vector
ex
;
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
);
clit
=
player
[
playerid
].
list_main
.
erase
(
clit
);
}
else
...
...
@@ -3291,6 +3291,8 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
3
))
return
FALSE
;
}
if
(
pcard
->
is_extra_deck_monster
()
&&
!
is_player_can_send_to_deck
(
playerid
,
pcard
))
return
FALSE
;
return
TRUE
;
}
int32
field
::
is_player_can_send_to_deck
(
uint8
playerid
,
card
*
pcard
)
{
...
...
interpreter.cpp
View file @
6be2e850
...
...
@@ -586,7 +586,6 @@ static const struct luaL_Reg duellib[] = {
{
"IsPlayerCanSendtoHand"
,
scriptlib
::
duel_is_player_can_send_to_hand
},
{
"IsPlayerCanSendtoGrave"
,
scriptlib
::
duel_is_player_can_send_to_grave
},
{
"IsPlayerCanSendtoDeck"
,
scriptlib
::
duel_is_player_can_send_to_deck
},
{
"IsPlayerExtraSummoned"
,
scriptlib
::
duel_is_player_extra_summoned
},
{
"IsChainNegatable"
,
scriptlib
::
duel_is_chain_negatable
},
{
"IsChainDisablable"
,
scriptlib
::
duel_is_chain_disablable
},
{
"CheckChainTarget"
,
scriptlib
::
duel_check_chain_target
},
...
...
libcard.cpp
View file @
6be2e850
...
...
@@ -2222,7 +2222,7 @@ int32 scriptlib::card_is_able_to_deck_or_extra_as_cost(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
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
)
lua_pushboolean
(
L
,
1
);
else
...
...
libduel.cpp
View file @
6be2e850
...
...
@@ -3656,14 +3656,23 @@ int32 scriptlib::duel_is_player_can_summon(lua_State * L) {
return
1
;
}
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
lua_gettop
(
L
)
==
1
)
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_summon
(
playerid
));
else
{
int32
check_additional
;
if
(
lua_gettop
(
L
)
<=
2
)
{
check_additional
=
lua_toboolean
(
L
,
2
);
if
(
check_additional
&&
pduel
->
game_field
->
core
.
extra_summon
[
playerid
])
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_summon
(
playerid
));
}
else
{
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
int32
sumtype
=
lua_tointeger
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_summon
(
sumtype
,
playerid
,
pcard
));
check_additional
=
lua_toboolean
(
L
,
4
);
if
(
check_additional
&&
pduel
->
game_field
->
core
.
extra_summon
[
playerid
])
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_summon
(
sumtype
,
playerid
,
pcard
));
}
return
1
;
}
...
...
@@ -3817,17 +3826,6 @@ int32 scriptlib::duel_is_player_can_send_to_deck(lua_State * L) {
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_player_can_send_to_deck
(
playerid
,
pcard
));
return
1
;
}
int32
scriptlib
::
duel_is_player_extra_summoned
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
{
lua_pushboolean
(
L
,
0
);
return
1
;
}
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]);
return
1
;
}
int32
scriptlib
::
duel_is_chain_negatable
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
chaincount
=
lua_tointeger
(
L
,
1
);
...
...
scriptlib.h
View file @
6be2e850
...
...
@@ -576,7 +576,6 @@ public:
static
int32
duel_is_player_can_send_to_hand
(
lua_State
*
L
);
static
int32
duel_is_player_can_send_to_grave
(
lua_State
*
L
);
static
int32
duel_is_player_can_send_to_deck
(
lua_State
*
L
);
static
int32
duel_is_player_extra_summoned
(
lua_State
*
L
);
static
int32
duel_is_chain_negatable
(
lua_State
*
L
);
static
int32
duel_is_chain_disablable
(
lua_State
*
L
);
static
int32
duel_check_chain_target
(
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