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
7f8ff147
Commit
7f8ff147
authored
Dec 30, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uniq conti_cards
parent
ae29e5f2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
28 deletions
+27
-28
gframe/client_field.cpp
gframe/client_field.cpp
+11
-12
gframe/client_field.h
gframe/client_field.h
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+12
-12
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/client_field.cpp
View file @
7f8ff147
...
...
@@ -1183,11 +1183,10 @@ bool ClientField::ShowSelectSum(bool panelmode) {
}
bool
ClientField
::
CheckSelectSum
()
{
std
::
set
<
ClientCard
*>
selable
;
std
::
set
<
ClientCard
*>::
iterator
sit
;
for
(
size_t
i
=
0
;
i
<
selectsum_all
.
size
();
++
i
)
{
selectsum_all
[
i
]
->
is_selectable
=
false
;
selectsum_all
[
i
]
->
is_selected
=
false
;
selable
.
insert
(
selectsum_all
[
i
]);
for
(
auto
sit
=
selectsum_all
.
begin
();
sit
!=
selectsum_all
.
end
();
++
sit
)
{
(
*
sit
)
->
is_selectable
=
false
;
(
*
sit
)
->
is_selected
=
false
;
selable
.
insert
(
*
sit
);
}
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
{
if
((
int
)
i
<
must_select_count
)
...
...
@@ -1201,7 +1200,7 @@ bool ClientField::CheckSelectSum() {
if
(
select_mode
==
0
)
{
bool
ret
=
check_sel_sum_s
(
selable
,
0
,
select_sumval
);
selectable_cards
.
clear
();
for
(
sit
=
selectsum_cards
.
begin
();
sit
!=
selectsum_cards
.
end
();
++
sit
)
{
for
(
auto
sit
=
selectsum_cards
.
begin
();
sit
!=
selectsum_cards
.
end
();
++
sit
)
{
(
*
sit
)
->
is_selectable
=
true
;
selectable_cards
.
push_back
(
*
sit
);
}
...
...
@@ -1209,9 +1208,9 @@ bool ClientField::CheckSelectSum() {
}
else
{
int
mm
=
-
1
,
mx
=
-
1
,
max
=
0
,
sumc
=
0
;
bool
ret
=
false
;
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
{
int
op1
=
selected_cards
[
i
]
->
opParam
&
0xffff
;
int
op2
=
selected_cards
[
i
]
->
opParam
>>
16
;
for
(
auto
sit
=
selected_cards
.
begin
();
sit
!=
selected_cards
.
end
();
++
sit
)
{
int
op1
=
(
*
sit
)
->
opParam
&
0xffff
;
int
op2
=
(
*
sit
)
->
opParam
>>
16
;
int
opmin
=
(
op2
>
0
&&
op1
>
op2
)
?
op2
:
op1
;
int
opmax
=
op2
>
op1
?
op2
:
op1
;
if
(
mm
==
-
1
||
opmin
<
mm
)
...
...
@@ -1225,7 +1224,7 @@ bool ClientField::CheckSelectSum() {
return
true
;
if
(
select_sumval
<=
max
&&
select_sumval
>
max
-
mx
)
ret
=
true
;
for
(
sit
=
selable
.
begin
();
sit
!=
selable
.
end
();
++
sit
)
{
for
(
auto
sit
=
selable
.
begin
();
sit
!=
selable
.
end
();
++
sit
)
{
int
op1
=
(
*
sit
)
->
opParam
&
0xffff
;
int
op2
=
(
*
sit
)
->
opParam
>>
16
;
int
m
=
op1
;
...
...
@@ -1262,14 +1261,14 @@ bool ClientField::CheckSelectSum() {
}
}
selectable_cards
.
clear
();
for
(
sit
=
selectsum_cards
.
begin
();
sit
!=
selectsum_cards
.
end
();
++
sit
)
{
for
(
auto
sit
=
selectsum_cards
.
begin
();
sit
!=
selectsum_cards
.
end
();
++
sit
)
{
(
*
sit
)
->
is_selectable
=
true
;
selectable_cards
.
push_back
(
*
sit
);
}
return
ret
;
}
}
bool
ClientField
::
check_min
(
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
iterator
index
,
int
min
,
int
max
)
{
bool
ClientField
::
check_min
(
const
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
const_
iterator
index
,
int
min
,
int
max
)
{
if
(
index
==
left
.
end
())
return
false
;
int
op1
=
(
*
index
)
->
opParam
&
0xffff
;
...
...
gframe/client_field.h
View file @
7f8ff147
...
...
@@ -102,7 +102,7 @@ public:
void
FadeCard
(
ClientCard
*
pcard
,
int
alpha
,
int
frame
);
bool
ShowSelectSum
(
bool
panelmode
);
bool
CheckSelectSum
();
bool
check_min
(
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
iterator
index
,
int
min
,
int
max
);
bool
check_min
(
const
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
const_
iterator
index
,
int
min
,
int
max
);
bool
check_sel_sum_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
);
void
check_sel_sum_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
);
bool
check_sum
(
std
::
set
<
ClientCard
*>::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
,
int
count
);
...
...
gframe/duelclient.cpp
View file @
7f8ff147
...
...
@@ -944,7 +944,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
0
));
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
0
));
pcard
->
cmdFlag
|=
COMMAND_ACTIVATE
;
if
(
pcard
->
location
==
LOCATION_GRAVE
)
mainGame
->
dField
.
grave_act
=
true
;
...
...
gframe/event_handler.cpp
View file @
7f8ff147
...
...
@@ -386,18 +386,16 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
BUTTON_OPTION_OK
:
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_OPTION
)
{
DuelClient
::
SetResponseI
(
selected_option
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
int
index
=
0
;
while
(
activatable_cards
[
index
]
!=
command_card
||
activatable_descs
[
index
].
first
!=
select_options
[
selected_option
])
index
++
;
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
int
index
=
0
;
while
(
activatable_cards
[
index
]
!=
command_card
||
activatable_descs
[
index
].
first
!=
select_options
[
selected_option
])
index
++
;
DuelClient
::
SetResponseI
(
index
<<
16
);
}
else
{
int
index
=
0
;
while
(
activatable_cards
[
index
]
!=
command_card
||
activatable_descs
[
index
].
first
!=
select_options
[
selected_option
])
index
++
;
DuelClient
::
SetResponseI
(
index
);
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_IDLECMD
)
{
DuelClient
::
SetResponseI
((
index
<<
16
)
+
5
);
}
else
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_BATTLECMD
)
{
DuelClient
::
SetResponseI
(
index
<<
16
);
}
else
{
DuelClient
::
SetResponseI
(
index
);
}
}
mainGame
->
HideElement
(
mainGame
->
wOptions
,
true
);
break
;
...
...
@@ -487,7 +485,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
POSITION_HINT
:
{
selectable_cards
.
insert
(
selectable_cards
.
end
(),
conti_cards
.
begin
(),
conti_cards
.
end
());
selectable_cards
=
conti_cards
;
std
::
sort
(
selectable_cards
.
begin
(),
selectable_cards
.
end
());
auto
eit
=
std
::
unique
(
selectable_cards
.
begin
(),
selectable_cards
.
end
());
selectable_cards
.
erase
(
eit
,
selectable_cards
.
end
());
conti_selecting
=
true
;
break
;
}
...
...
@@ -1326,8 +1327,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
int
command_flag
=
0
;
if
(
conti_cards
.
size
()
==
0
)
break
;
if
(
conti_cards
.
size
())
command_flag
|=
COMMAND_OPERATION
;
command_flag
|=
COMMAND_OPERATION
;
list_command
=
1
;
ShowMenu
(
command_flag
,
x
,
y
);
break
;
...
...
ocgcore
@
ccbe898d
Subproject commit
6a7087423c889bb51aa92c6bb836b476e9776cdb
Subproject commit
ccbe898dfe57f5c34e3c659a849255303776cc61
script
@
5f3149af
Subproject commit
cf2966bca9eeab2dd275da5d2a20e59ac74f23fc
Subproject commit
5f3149af08221ef1f8b7a255ec44d5e36e467c07
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