Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
31916c5d
Commit
31916c5d
authored
Aug 05, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8d1c4ae3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
19 deletions
+31
-19
ocgcore/card.cpp
ocgcore/card.cpp
+5
-0
ocgcore/card.h
ocgcore/card.h
+2
-1
ocgcore/field.cpp
ocgcore/field.cpp
+9
-9
ocgcore/field.h
ocgcore/field.h
+4
-4
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+1
-0
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+7
-0
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+1
-4
ocgcore/operations.cpp
ocgcore/operations.cpp
+1
-1
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+1
-0
No files found.
ocgcore/card.cpp
View file @
31916c5d
...
...
@@ -3409,6 +3409,11 @@ int32 card::is_capable_change_position(uint8 playerid) {
return
FALSE
;
return
TRUE
;
}
int32
card
::
is_capable_change_position_by_effect
(
uint8
playerid
)
{
if
(
data
.
type
&
TYPE_LINK
)
return
FALSE
;
return
TRUE
;
}
int32
card
::
is_capable_turn_set
(
uint8
playerid
)
{
if
(
data
.
type
&
(
TYPE_LINK
|
TYPE_TOKEN
))
return
FALSE
;
...
...
ocgcore/card.h
View file @
31916c5d
...
...
@@ -103,7 +103,7 @@ public:
class
attacker_map
:
public
std
::
unordered_map
<
uint16
,
std
::
pair
<
card
*
,
uint32
>
>
{
public:
void
addcard
(
card
*
pcard
);
};
};
//222DIY
uint32
set_entity_code
(
uint32
entity_code
);
...
...
@@ -311,6 +311,7 @@ public:
int32
is_capable_attack
();
int32
is_capable_attack_announce
(
uint8
playerid
);
int32
is_capable_change_position
(
uint8
playerid
);
int32
is_capable_change_position_by_effect
(
uint8
playerid
);
int32
is_capable_turn_set
(
uint8
playerid
);
int32
is_capable_change_control
();
int32
is_control_can_be_changed
(
int32
ignore_mzone
,
uint32
zone
);
...
...
ocgcore/field.cpp
View file @
31916c5d
...
...
@@ -516,13 +516,13 @@ card* field::get_field_card(uint32 playerid, uint32 location, uint32 sequence) {
return
0
;
}
// return: the given slot in LOCATION_MZONE or all LOCATION_SZONE is available or not
int32
field
::
is_location_useable
(
uint32
playerid
,
uint32
location
,
uint32
sequence
,
uint8
neglect_used
)
{
uint32
flag
=
player
[
playerid
].
disabled_location
|
(
neglect_used
?
0
:
player
[
playerid
].
used_location
)
;
int32
field
::
is_location_useable
(
uint32
playerid
,
uint32
location
,
uint32
sequence
)
{
uint32
flag
=
player
[
playerid
].
disabled_location
|
player
[
playerid
].
used_location
;
if
(
location
==
LOCATION_MZONE
)
{
if
(
flag
&
(
0x1u
<<
sequence
))
return
FALSE
;
if
(
sequence
>=
5
)
{
uint32
oppo
=
player
[
1
-
playerid
].
disabled_location
|
(
neglect_used
?
0
:
player
[
1
-
playerid
].
used_location
)
;
uint32
oppo
=
player
[
1
-
playerid
].
disabled_location
|
player
[
1
-
playerid
].
used_location
;
if
(
oppo
&
(
0x1u
<<
(
11
-
sequence
)))
return
FALSE
;
}
...
...
@@ -546,11 +546,11 @@ int32 field::is_location_useable(uint32 playerid, uint32 location, uint32 sequen
// uplayer: request player, PLAYER_NONE means ignoring EFFECT_MAX_MZONE, EFFECT_MAX_SZONE
// list: store local flag in list
// return: usable count of LOCATION_MZONE or real LOCATION_SZONE of playerid requested by uplayer (may be negative)
int32
field
::
get_useable_count
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
,
uint32
*
list
,
uint8
neglect_used
)
{
int32
field
::
get_useable_count
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
,
uint32
*
list
)
{
if
(
core
.
duel_rule
>=
4
&&
location
==
LOCATION_MZONE
&&
pcard
->
current
.
location
==
LOCATION_EXTRA
)
return
get_useable_count_fromex
(
pcard
,
playerid
,
uplayer
,
zone
,
list
);
else
return
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
,
list
,
neglect_used
);
return
get_useable_count
(
playerid
,
location
,
uplayer
,
reason
,
zone
,
list
);
}
int32
field
::
get_spsummonable_count
(
card
*
pcard
,
uint8
playerid
,
uint32
zone
,
uint32
*
list
)
{
if
(
core
.
duel_rule
>=
4
&&
pcard
->
current
.
location
==
LOCATION_EXTRA
)
...
...
@@ -558,8 +558,8 @@ int32 field::get_spsummonable_count(card* pcard, uint8 playerid, uint32 zone, ui
else
return
get_tofield_count
(
playerid
,
LOCATION_MZONE
,
zone
,
list
);
}
int32
field
::
get_useable_count
(
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
,
uint32
*
list
,
uint8
neglect_used
)
{
int32
count
=
get_tofield_count
(
playerid
,
location
,
zone
,
list
,
neglect_used
);
int32
field
::
get_useable_count
(
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
,
uint32
*
list
)
{
int32
count
=
get_tofield_count
(
playerid
,
location
,
zone
,
list
);
int32
limit
;
if
(
location
==
LOCATION_MZONE
)
limit
=
get_mzone_limit
(
playerid
,
uplayer
,
LOCATION_REASON_TOFIELD
);
...
...
@@ -569,10 +569,10 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
count
=
limit
;
return
count
;
}
int32
field
::
get_tofield_count
(
uint8
playerid
,
uint8
location
,
uint32
zone
,
uint32
*
list
,
uint8
neglect_used
)
{
int32
field
::
get_tofield_count
(
uint8
playerid
,
uint8
location
,
uint32
zone
,
uint32
*
list
)
{
if
(
location
!=
LOCATION_MZONE
&&
location
!=
LOCATION_SZONE
)
return
0
;
uint32
flag
=
player
[
playerid
].
disabled_location
|
(
neglect_used
?
0
:
player
[
playerid
].
used_location
)
;
uint32
flag
=
player
[
playerid
].
disabled_location
|
player
[
playerid
].
used_location
;
if
(
location
==
LOCATION_MZONE
)
flag
=
(
flag
|
~
zone
)
&
0x1f
;
else
...
...
ocgcore/field.h
View file @
31916c5d
...
...
@@ -345,11 +345,11 @@ public:
void
move_card
(
uint8
playerid
,
card
*
pcard
,
uint8
location
,
uint8
sequence
,
uint8
pzone
=
FALSE
);
void
set_control
(
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
);
card
*
get_field_card
(
uint32
playerid
,
uint32
location
,
uint32
sequence
);
int32
is_location_useable
(
uint32
playerid
,
uint32
location
,
uint32
sequence
,
uint8
neglect_used
=
0
);
int32
get_useable_count
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
,
uint8
neglect_used
=
0
);
int32
is_location_useable
(
uint32
playerid
,
uint32
location
,
uint32
sequence
);
int32
get_useable_count
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
);
int32
get_spsummonable_count
(
card
*
pcard
,
uint8
playerid
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
);
int32
get_useable_count
(
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
,
uint8
neglect_used
=
0
);
int32
get_tofield_count
(
uint8
playerid
,
uint8
location
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
,
uint8
neglect_used
=
0
);
int32
get_useable_count
(
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
);
int32
get_tofield_count
(
uint8
playerid
,
uint8
location
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
);
int32
get_useable_count_fromex
(
card
*
pcard
,
uint8
playerid
,
uint8
uplayer
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
);
int32
get_spsummonable_count_fromex
(
card
*
pcard
,
uint8
playerid
,
uint32
zone
=
0xff
,
uint32
*
list
=
0
);
int32
get_mzone_limit
(
uint8
playerid
,
uint8
uplayer
,
uint32
reason
);
...
...
ocgcore/interpreter.cpp
View file @
31916c5d
...
...
@@ -226,6 +226,7 @@ static const struct luaL_Reg cardlib[] = {
{
"GetCounter"
,
scriptlib
::
card_get_counter
},
{
"EnableCounterPermit"
,
scriptlib
::
card_enable_counter_permit
},
{
"SetCounterLimit"
,
scriptlib
::
card_set_counter_limit
},
{
"IsCanChangePosition"
,
scriptlib
::
card_is_can_change_position
},
{
"IsCanTurnSet"
,
scriptlib
::
card_is_can_turn_set
},
{
"IsCanAddCounter"
,
scriptlib
::
card_is_can_add_counter
},
{
"IsCanRemoveCounter"
,
scriptlib
::
card_is_can_remove_counter
},
...
...
ocgcore/libcard.cpp
View file @
31916c5d
...
...
@@ -2234,6 +2234,13 @@ int32 scriptlib::card_set_counter_limit(lua_State *L) {
pcard
->
add_effect
(
peffect
);
return
0
;
}
int32
scriptlib
::
card_is_can_change_position
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
lua_pushboolean
(
L
,
pcard
->
is_capable_change_position_by_effect
(
pcard
->
pduel
->
game_field
->
core
.
reason_player
));
return
1
;
}
int32
scriptlib
::
card_is_can_turn_set
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
ocgcore/libduel.cpp
View file @
31916c5d
...
...
@@ -1759,13 +1759,10 @@ int32 scriptlib::duel_check_location(lua_State *L) {
uint32
playerid
=
lua_tointeger
(
L
,
1
);
uint32
location
=
lua_tointeger
(
L
,
2
);
uint32
sequence
=
lua_tointeger
(
L
,
3
);
uint32
neglect_used
=
0
;
if
(
lua_gettop
(
L
)
>=
4
)
neglect_used
=
lua_toboolean
(
L
,
4
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_location_useable
(
playerid
,
location
,
sequence
,
neglect_used
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_location_useable
(
playerid
,
location
,
sequence
));
return
1
;
}
int32
scriptlib
::
duel_get_current_chain
(
lua_State
*
L
)
{
...
...
ocgcore/operations.cpp
View file @
31916c5d
...
...
@@ -3686,7 +3686,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
return
FALSE
;
}
if
(
param
->
predirect
&&
get_useable_count
(
pcard
->
current
.
controler
,
LOCATION_SZONE
,
pcard
->
current
.
controler
,
LOCATION_REASON_TOFIELD
)
>
0
)
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
pcard
,
pcard
->
current
.
controler
,
0
);
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
pcard
,
pcard
->
current
.
controler
,
97
);
else
returns
.
ivalue
[
0
]
=
0
;
return
FALSE
;
...
...
ocgcore/scriptlib.h
View file @
31916c5d
...
...
@@ -232,6 +232,7 @@ public:
static
int32
card_get_counter
(
lua_State
*
L
);
static
int32
card_enable_counter_permit
(
lua_State
*
L
);
static
int32
card_set_counter_limit
(
lua_State
*
L
);
static
int32
card_is_can_change_position
(
lua_State
*
L
);
static
int32
card_is_can_turn_set
(
lua_State
*
L
);
static
int32
card_is_can_add_counter
(
lua_State
*
L
);
static
int32
card_is_can_remove_counter
(
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