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
5a081df9
Commit
5a081df9
authored
Aug 12, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
350195a6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
11 deletions
+22
-11
ocgcore/card.cpp
ocgcore/card.cpp
+3
-3
ocgcore/card.h
ocgcore/card.h
+2
-1
ocgcore/field.cpp
ocgcore/field.cpp
+4
-3
ocgcore/field.h
ocgcore/field.h
+3
-1
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+6
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+4
-2
No files found.
ocgcore/card.cpp
View file @
5a081df9
...
...
@@ -2753,7 +2753,7 @@ int32 card::check_unique_code(card* pcard) {
return
TRUE
;
return
FALSE
;
}
void
card
::
get_unique_target
(
card_set
*
cset
,
int32
controler
)
{
void
card
::
get_unique_target
(
card_set
*
cset
,
int32
controler
,
card
*
icard
)
{
cset
->
clear
();
for
(
int32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
!
unique_pos
[
p
])
...
...
@@ -2762,7 +2762,7 @@ void card::get_unique_target(card_set* cset, int32 controler) {
if
(
unique_location
&
LOCATION_MZONE
)
{
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
is_status
(
STATUS_BATTLE_DESTROYED
)
if
(
pcard
&&
(
pcard
!=
icard
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
check_unique_code
(
pcard
))
cset
->
insert
(
pcard
);
}
...
...
@@ -2770,7 +2770,7 @@ void card::get_unique_target(card_set* cset, int32 controler) {
if
(
unique_location
&
LOCATION_SZONE
)
{
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
if
(
pcard
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
check_unique_code
(
pcard
))
if
(
pcard
&&
(
pcard
!=
icard
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
check_unique_code
(
pcard
))
cset
->
insert
(
pcard
);
}
}
...
...
ocgcore/card.h
View file @
5a081df9
...
...
@@ -104,6 +104,7 @@ public:
public:
void
addcard
(
card
*
pcard
);
};
//222DIY
uint32
set_entity_code
(
uint32
entity_code
,
bool
remove_alias
=
false
);
struct
sendto_param_t
{
...
...
@@ -292,7 +293,7 @@ public:
int32
check_fusion_substitute
(
card
*
fcard
);
int32
check_unique_code
(
card
*
pcard
);
void
get_unique_target
(
card_set
*
cset
,
int32
controler
);
void
get_unique_target
(
card_set
*
cset
,
int32
controler
,
card
*
icard
=
0
);
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
);
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
);
int32
is_summonable_card
();
...
...
ocgcore/field.cpp
View file @
5a081df9
...
...
@@ -29,6 +29,7 @@ void chain::set_triggering_place(card* pcard) {
else
triggering_location
=
pcard
->
current
.
location
;
triggering_sequence
=
pcard
->
current
.
sequence
;
triggering_position
=
pcard
->
current
.
position
;
}
bool
tevent
::
operator
<
(
const
tevent
&
v
)
const
{
return
memcmp
(
this
,
&
v
,
sizeof
(
tevent
))
<
0
;
...
...
@@ -1900,10 +1901,10 @@ void field::remove_unique_card(card* pcard) {
core
.
unique_cards
[
1
-
con
].
erase
(
pcard
);
}
// return: pcard->unique_effect or 0
effect
*
field
::
check_unique_onfield
(
card
*
pcard
,
uint8
controler
,
uint8
location
)
{
effect
*
field
::
check_unique_onfield
(
card
*
pcard
,
uint8
controler
,
uint8
location
,
card
*
icard
)
{
for
(
auto
iter
=
core
.
unique_cards
[
controler
].
begin
();
iter
!=
core
.
unique_cards
[
controler
].
end
();
++
iter
)
{
card
*
ucard
=
*
iter
;
if
((
ucard
!=
pcard
)
&&
ucard
->
is_position
(
POS_FACEUP
)
&&
ucard
->
get_status
(
STATUS_EFFECT_ENABLED
)
if
((
ucard
!=
pcard
)
&&
(
ucard
!=
icard
)
&&
ucard
->
is_position
(
POS_FACEUP
)
&&
ucard
->
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
ucard
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
)
&&
ucard
->
unique_fieldid
&&
ucard
->
check_unique_code
(
pcard
)
&&
(
ucard
->
unique_location
&
location
))
return
ucard
->
unique_effect
;
...
...
@@ -1911,7 +1912,7 @@ effect* field::check_unique_onfield(card* pcard, uint8 controler, uint8 location
if
(
!
pcard
->
unique_code
||
!
(
pcard
->
unique_location
&
location
)
||
pcard
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
))
return
0
;
card_set
cset
;
pcard
->
get_unique_target
(
&
cset
,
controler
);
pcard
->
get_unique_target
(
&
cset
,
controler
,
icard
);
if
(
pcard
->
check_unique_code
(
pcard
))
cset
.
insert
(
pcard
);
if
(
cset
.
size
()
>=
2
)
...
...
ocgcore/field.h
View file @
5a081df9
...
...
@@ -51,6 +51,7 @@ struct chain {
uint8
triggering_controler
;
uint16
triggering_location
;
uint8
triggering_sequence
;
uint8
triggering_position
;
effect
*
triggering_effect
;
group
*
target_cards
;
int32
replace_op
;
...
...
@@ -398,7 +399,7 @@ public:
void
adjust_self_destroy_set
();
void
add_unique_card
(
card
*
pcard
);
void
remove_unique_card
(
card
*
pcard
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
,
uint8
location
);
effect
*
check_unique_onfield
(
card
*
pcard
,
uint8
controler
,
uint8
location
,
card
*
icard
=
0
);
int32
check_spsummon_once
(
card
*
pcard
,
uint8
playerid
);
void
check_card_counter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
);
void
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
,
bool
cancel
=
false
);
...
...
@@ -599,6 +600,7 @@ public:
#define CHAININFO_CHAIN_ID 0x800
#define CHAININFO_TYPE 0x1000
#define CHAININFO_EXTTYPE 0x2000
#define CHAININFO_TRIGGERING_POSITION 0x4000
//Timing
#define TIMING_DRAW_PHASE 0x1
#define TIMING_STANDBY_PHASE 0x2
...
...
ocgcore/libcard.cpp
View file @
5a081df9
...
...
@@ -2631,7 +2631,12 @@ int32 scriptlib::card_check_unique_onfield(lua_State *L) {
uint32
check_location
=
LOCATION_ONFIELD
;
if
(
lua_gettop
(
L
)
>
2
)
check_location
=
lua_tointeger
(
L
,
3
)
&
LOCATION_ONFIELD
;
lua_pushboolean
(
L
,
pcard
->
pduel
->
game_field
->
check_unique_onfield
(
pcard
,
check_player
,
check_location
)
?
0
:
1
);
card
*
icard
=
0
;
if
(
lua_gettop
(
L
)
>
3
)
{
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
4
,
TRUE
))
icard
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
}
lua_pushboolean
(
L
,
pcard
->
pduel
->
game_field
->
check_unique_onfield
(
pcard
,
check_player
,
check_location
,
icard
)
?
0
:
1
);
return
1
;
}
int32
scriptlib
::
card_reset_negate_effect
(
lua_State
*
L
)
{
...
...
ocgcore/libduel.cpp
View file @
5a081df9
...
...
@@ -1805,14 +1805,13 @@ int32 scriptlib::duel_get_current_chain(lua_State *L) {
int32
scriptlib
::
duel_get_chain_info
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
uint32
c
=
lua_tointeger
(
L
,
1
);
uint32
flag
;
uint32
args
=
lua_gettop
(
L
)
-
1
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
chain
*
ch
=
pduel
->
game_field
->
get_chain
(
c
);
if
(
!
ch
)
return
0
;
for
(
uint32
i
=
0
;
i
<
args
;
++
i
)
{
flag
=
lua_tointeger
(
L
,
2
+
i
);
uint32
flag
=
lua_tointeger
(
L
,
2
+
i
);
switch
(
flag
)
{
case
CHAININFO_CHAIN_COUNT
:
lua_pushinteger
(
L
,
ch
->
chain_count
);
...
...
@@ -1832,6 +1831,9 @@ int32 scriptlib::duel_get_chain_info(lua_State *L) {
case
CHAININFO_TRIGGERING_SEQUENCE
:
lua_pushinteger
(
L
,
ch
->
triggering_sequence
);
break
;
case
CHAININFO_TRIGGERING_POSITION
:
lua_pushinteger
(
L
,
ch
->
triggering_position
);
break
;
case
CHAININFO_TARGET_CARDS
:
interpreter
::
group2value
(
L
,
ch
->
target_cards
);
break
;
...
...
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