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
2ec2856b
Commit
2ec2856b
authored
Sep 29, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release_param, sum_param
parent
b2d98347
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
55 deletions
+61
-55
card.h
card.h
+2
-0
field.cpp
field.cpp
+28
-28
libgroup.cpp
libgroup.cpp
+4
-4
operations.cpp
operations.cpp
+18
-14
playerop.cpp
playerop.cpp
+9
-9
No files found.
card.h
View file @
2ec2856b
...
@@ -111,6 +111,8 @@ public:
...
@@ -111,6 +111,8 @@ public:
uint32
summon_info
;
uint32
summon_info
;
uint32
status
;
uint32
status
;
uint32
operation_param
;
uint32
operation_param
;
uint32
release_param
;
uint32
sum_param
;
uint8
announce_count
;
uint8
announce_count
;
uint8
attacked_count
;
uint8
attacked_count
;
uint8
attack_all_target
;
uint8
attack_all_target
;
...
...
field.cpp
View file @
2ec2856b
...
@@ -1182,7 +1182,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
...
@@ -1182,7 +1182,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
if
(
release_list
)
if
(
release_list
)
release_list
->
insert
(
pcard
);
release_list
->
insert
(
pcard
);
pcard
->
operation
_param
=
1
;
pcard
->
release
_param
=
1
;
rcount
++
;
rcount
++
;
}
}
}
}
...
@@ -1193,7 +1193,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
...
@@ -1193,7 +1193,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
if
(
release_list
)
if
(
release_list
)
release_list
->
insert
(
pcard
);
release_list
->
insert
(
pcard
);
pcard
->
operation
_param
=
1
;
pcard
->
release
_param
=
1
;
rcount
++
;
rcount
++
;
}
}
}
}
...
@@ -1204,7 +1204,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
...
@@ -1204,7 +1204,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)))
{
if
(
ex_list
)
if
(
ex_list
)
ex_list
->
insert
(
pcard
);
ex_list
->
insert
(
pcard
);
pcard
->
operation
_param
=
1
;
pcard
->
release
_param
=
1
;
rcount
++
;
rcount
++
;
}
}
}
}
...
@@ -1255,12 +1255,12 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
...
@@ -1255,12 +1255,12 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
if
(
release_list
)
if
(
release_list
)
release_list
->
insert
(
pcard
);
release_list
->
insert
(
pcard
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_TRIPLE_TRIBUTE
,
target
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_TRIPLE_TRIBUTE
,
target
))
pcard
->
operation
_param
=
3
;
pcard
->
release
_param
=
3
;
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
operation
_param
=
2
;
pcard
->
release
_param
=
2
;
else
else
pcard
->
operation
_param
=
1
;
pcard
->
release
_param
=
1
;
rcount
+=
pcard
->
operation
_param
;
rcount
+=
pcard
->
release
_param
;
}
}
}
}
uint32
ex_sum_max
=
0
;
uint32
ex_sum_max
=
0
;
...
@@ -1274,12 +1274,12 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
...
@@ -1274,12 +1274,12 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
if
(
ex_list
)
if
(
ex_list
)
ex_list
->
insert
(
pcard
);
ex_list
->
insert
(
pcard
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_TRIPLE_TRIBUTE
,
target
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_TRIPLE_TRIBUTE
,
target
))
pcard
->
operation
_param
=
3
;
pcard
->
release
_param
=
3
;
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
operation
_param
=
2
;
pcard
->
release
_param
=
2
;
else
else
pcard
->
operation
_param
=
1
;
pcard
->
release
_param
=
1
;
rcount
+=
pcard
->
operation
_param
;
rcount
+=
pcard
->
release
_param
;
}
else
{
}
else
{
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE_SUM
);
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE_SUM
);
if
(
!
peffect
||
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
(
peffect
->
reset_count
&
0xf00
)
==
0
))
if
(
!
peffect
||
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
(
peffect
->
reset_count
&
0xf00
)
==
0
))
...
@@ -1287,13 +1287,13 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
...
@@ -1287,13 +1287,13 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
if
(
ex_list_sum
)
if
(
ex_list_sum
)
ex_list_sum
->
insert
(
pcard
);
ex_list_sum
->
insert
(
pcard
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_TRIPLE_TRIBUTE
,
target
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_TRIPLE_TRIBUTE
,
target
))
pcard
->
operation
_param
=
3
;
pcard
->
release
_param
=
3
;
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_DOUBLE_TRIBUTE
,
target
))
pcard
->
operation
_param
=
2
;
pcard
->
release
_param
=
2
;
else
else
pcard
->
operation
_param
=
1
;
pcard
->
release
_param
=
1
;
if
(
ex_sum_max
<
pcard
->
operation
_param
)
if
(
ex_sum_max
<
pcard
->
release
_param
)
ex_sum_max
=
pcard
->
operation
_param
;
ex_sum_max
=
pcard
->
release
_param
;
}
}
}
}
return
rcount
+
ex_sum_max
;
return
rcount
+
ex_sum_max
;
...
@@ -2053,7 +2053,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2053,7 +2053,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
card_vector
nsyn
;
card_vector
nsyn
;
int32
mcount
=
1
;
int32
mcount
=
1
;
nsyn
.
push_back
(
tuner
);
nsyn
.
push_back
(
tuner
);
tuner
->
operation
_param
=
tuner
->
get_synchro_level
(
pcard
);
tuner
->
sum
_param
=
tuner
->
get_synchro_level
(
pcard
);
if
(
smat
)
{
if
(
smat
)
{
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
smat
);
pcheck
->
get_value
(
smat
);
...
@@ -2064,7 +2064,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2064,7 +2064,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
min
--
;
min
--
;
max
--
;
max
--
;
nsyn
.
push_back
(
smat
);
nsyn
.
push_back
(
smat
);
smat
->
operation
_param
=
smat
->
get_synchro_level
(
pcard
);
smat
->
sum
_param
=
smat
->
get_synchro_level
(
pcard
);
mcount
++
;
mcount
++
;
if
(
min
==
0
)
{
if
(
min
==
0
)
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
{
...
@@ -2088,7 +2088,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2088,7 +2088,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
findex2
,
0
))
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
findex2
,
0
))
continue
;
continue
;
nsyn
.
push_back
(
pm
);
nsyn
.
push_back
(
pm
);
pm
->
operation
_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum
_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
}
}
else
{
}
else
{
...
@@ -2101,7 +2101,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2101,7 +2101,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
findex2
,
0
))
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
findex2
,
0
))
continue
;
continue
;
nsyn
.
push_back
(
pm
);
nsyn
.
push_back
(
pm
);
pm
->
operation
_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum
_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
}
}
}
...
@@ -2171,8 +2171,8 @@ int32 field::check_with_sum_limit(const card_vector& mats, int32 acc, int32 inde
...
@@ -2171,8 +2171,8 @@ int32 field::check_with_sum_limit(const card_vector& mats, int32 acc, int32 inde
if
(
count
>
max
)
if
(
count
>
max
)
return
FALSE
;
return
FALSE
;
while
(
index
<
(
int32
)
mats
.
size
())
{
while
(
index
<
(
int32
)
mats
.
size
())
{
int32
op1
=
mats
[
index
]
->
operation
_param
&
0xffff
;
int32
op1
=
mats
[
index
]
->
sum
_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
operation
_param
>>
16
)
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum
_param
>>
16
)
&
0xffff
;
if
((
op1
==
acc
||
op2
==
acc
)
&&
count
>=
min
)
if
((
op1
==
acc
||
op2
==
acc
)
&&
count
>=
min
)
return
TRUE
;
return
TRUE
;
index
++
;
index
++
;
...
@@ -2190,8 +2190,8 @@ int32 field::check_with_sum_limit_m(const card_vector& mats, int32 acc, int32 in
...
@@ -2190,8 +2190,8 @@ int32 field::check_with_sum_limit_m(const card_vector& mats, int32 acc, int32 in
return
check_with_sum_limit
(
mats
,
acc
,
index
,
1
,
min
,
max
);
return
check_with_sum_limit
(
mats
,
acc
,
index
,
1
,
min
,
max
);
if
(
index
>=
(
int32
)
mats
.
size
())
if
(
index
>=
(
int32
)
mats
.
size
())
return
FALSE
;
return
FALSE
;
int32
op1
=
mats
[
index
]
->
operation
_param
&
0xffff
;
int32
op1
=
mats
[
index
]
->
sum
_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
operation
_param
>>
16
)
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum
_param
>>
16
)
&
0xffff
;
if
(
acc
>=
op1
&&
check_with_sum_limit_m
(
mats
,
acc
-
op1
,
index
+
1
,
min
,
max
,
must_count
))
if
(
acc
>=
op1
&&
check_with_sum_limit_m
(
mats
,
acc
-
op1
,
index
+
1
,
min
,
max
,
must_count
))
return
TRUE
;
return
TRUE
;
if
(
op2
&&
acc
>=
op2
&&
check_with_sum_limit_m
(
mats
,
acc
-
op2
,
index
+
1
,
min
,
max
,
must_count
))
if
(
op2
&&
acc
>=
op2
&&
check_with_sum_limit_m
(
mats
,
acc
-
op2
,
index
+
1
,
min
,
max
,
must_count
))
...
@@ -2200,8 +2200,8 @@ int32 field::check_with_sum_limit_m(const card_vector& mats, int32 acc, int32 in
...
@@ -2200,8 +2200,8 @@ int32 field::check_with_sum_limit_m(const card_vector& mats, int32 acc, int32 in
}
}
int32
field
::
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
)
{
int32
field
::
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
)
{
while
(
index
<
(
int32
)
mats
.
size
())
{
while
(
index
<
(
int32
)
mats
.
size
())
{
int32
op1
=
mats
[
index
]
->
operation
_param
&
0xffff
;
int32
op1
=
mats
[
index
]
->
sum
_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
operation
_param
>>
16
)
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum
_param
>>
16
)
&
0xffff
;
if
((
acc
<=
op1
&&
acc
+
opmin
>
op1
)
||
(
op2
&&
acc
<=
op2
&&
acc
+
opmin
>
op2
))
if
((
acc
<=
op1
&&
acc
+
opmin
>
op1
)
||
(
op2
&&
acc
<=
op2
&&
acc
+
opmin
>
op2
))
return
TRUE
;
return
TRUE
;
index
++
;
index
++
;
...
@@ -2219,8 +2219,8 @@ int32 field::check_with_sum_greater_limit_m(const card_vector& mats, int32 acc,
...
@@ -2219,8 +2219,8 @@ int32 field::check_with_sum_greater_limit_m(const card_vector& mats, int32 acc,
return
check_with_sum_greater_limit
(
mats
,
acc
,
index
,
opmin
);
return
check_with_sum_greater_limit
(
mats
,
acc
,
index
,
opmin
);
if
(
index
>=
(
int32
)
mats
.
size
())
if
(
index
>=
(
int32
)
mats
.
size
())
return
FALSE
;
return
FALSE
;
int32
op1
=
mats
[
index
]
->
operation
_param
&
0xffff
;
int32
op1
=
mats
[
index
]
->
sum
_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
operation
_param
>>
16
)
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum
_param
>>
16
)
&
0xffff
;
if
(
check_with_sum_greater_limit_m
(
mats
,
acc
-
op1
,
index
+
1
,
std
::
min
(
opmin
,
op1
),
must_count
))
if
(
check_with_sum_greater_limit_m
(
mats
,
acc
-
op1
,
index
+
1
,
std
::
min
(
opmin
,
op1
),
must_count
))
return
TRUE
;
return
TRUE
;
if
(
op2
&&
check_with_sum_greater_limit_m
(
mats
,
acc
-
op2
,
index
+
1
,
std
::
min
(
opmin
,
op2
),
must_count
))
if
(
op2
&&
check_with_sum_greater_limit_m
(
mats
,
acc
-
op2
,
index
+
1
,
std
::
min
(
opmin
,
op2
),
must_count
))
...
...
libgroup.cpp
View file @
2ec2856b
...
@@ -290,7 +290,7 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
...
@@ -290,7 +290,7 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
}
}
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
(
*
cit
)
->
operation
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
2
,
extraargs
);
(
*
cit
)
->
sum
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
2
,
extraargs
);
lua_pushboolean
(
L
,
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
mcount
));
lua_pushboolean
(
L
,
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
mcount
));
return
1
;
return
1
;
}
}
...
@@ -321,7 +321,7 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
...
@@ -321,7 +321,7 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
int32
mcount
=
cv
.
size
();
int32
mcount
=
cv
.
size
();
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
(
*
cit
)
->
operation
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
3
,
extraargs
);
(
*
cit
)
->
sum
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
3
,
extraargs
);
if
(
!
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
mcount
))
{
if
(
!
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
mcount
))
{
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
return
0
;
return
0
;
...
@@ -346,7 +346,7 @@ int32 scriptlib::group_check_with_sum_greater(lua_State *L) {
...
@@ -346,7 +346,7 @@ int32 scriptlib::group_check_with_sum_greater(lua_State *L) {
}
}
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
(
*
cit
)
->
operation
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
2
,
extraargs
);
(
*
cit
)
->
sum
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
2
,
extraargs
);
lua_pushboolean
(
L
,
field
::
check_with_sum_greater_limit_m
(
cv
,
acc
,
0
,
0xffff
,
mcount
));
lua_pushboolean
(
L
,
field
::
check_with_sum_greater_limit_m
(
cv
,
acc
,
0
,
0xffff
,
mcount
));
return
1
;
return
1
;
}
}
...
@@ -371,7 +371,7 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
...
@@ -371,7 +371,7 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
int32
mcount
=
cv
.
size
();
int32
mcount
=
cv
.
size
();
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
for
(
auto
cit
=
cv
.
begin
();
cit
!=
cv
.
end
();
++
cit
)
(
*
cit
)
->
operation
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
3
,
extraargs
);
(
*
cit
)
->
sum
_param
=
pduel
->
lua
->
get_operation_value
(
*
cit
,
3
,
extraargs
);
if
(
!
field
::
check_with_sum_greater_limit_m
(
cv
,
acc
,
0
,
0xffff
,
mcount
))
{
if
(
!
field
::
check_with_sum_greater_limit_m
(
cv
,
acc
,
0
,
0xffff
,
mcount
))
{
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
return
0
;
return
0
;
...
...
operations.cpp
View file @
2ec2856b
...
@@ -295,10 +295,14 @@ void field::change_position(card_set* targets, effect* reason_effect, uint32 rea
...
@@ -295,10 +295,14 @@ void field::change_position(card_set* targets, effect* reason_effect, uint32 rea
ng
->
is_readonly
=
TRUE
;
ng
->
is_readonly
=
TRUE
;
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();
++
cit
)
{
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
->
current
.
position
==
POS_FACEUP_ATTACK
)
pcard
->
operation_param
=
au
;
if
(
pcard
->
current
.
position
==
POS_FACEUP_ATTACK
)
else
if
(
pcard
->
current
.
position
==
POS_FACEDOWN_DEFENSE
)
pcard
->
operation_param
=
dd
;
pcard
->
operation_param
=
au
;
else
if
(
pcard
->
current
.
position
==
POS_FACEUP_DEFENSE
)
pcard
->
operation_param
=
du
;
else
if
(
pcard
->
current
.
position
==
POS_FACEDOWN_DEFENSE
)
else
pcard
->
operation_param
=
ad
;
pcard
->
operation_param
=
dd
;
else
if
(
pcard
->
current
.
position
==
POS_FACEUP_DEFENSE
)
pcard
->
operation_param
=
du
;
else
pcard
->
operation_param
=
ad
;
pcard
->
operation_param
|=
flag
;
pcard
->
operation_param
|=
flag
;
}
}
add_process
(
PROCESSOR_CHANGEPOS
,
0
,
reason_effect
,
ng
,
reason_player
,
enable
);
add_process
(
PROCESSOR_CHANGEPOS
,
0
,
reason_effect
,
ng
,
reason_player
,
enable
);
...
@@ -4384,8 +4388,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4384,8 +4388,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
card_vector
nsyn
;
card_vector
nsyn
;
nsyn
.
push_back
(
tuner
);
nsyn
.
push_back
(
tuner
);
nsyn
.
push_back
(
smat
);
nsyn
.
push_back
(
smat
);
tuner
->
operation
_param
=
tuner
->
get_synchro_level
(
pcard
);
tuner
->
sum
_param
=
tuner
->
get_synchro_level
(
pcard
);
smat
->
operation
_param
=
smat
->
get_synchro_level
(
pcard
);
smat
->
sum
_param
=
smat
->
get_synchro_level
(
pcard
);
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
core
.
units
.
begin
()
->
step
=
5
;
core
.
units
.
begin
()
->
step
=
5
;
}
}
...
@@ -4398,12 +4402,12 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4398,12 +4402,12 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
core
.
must_select_cards
.
clear
();
core
.
must_select_cards
.
clear
();
core
.
must_select_cards
.
push_back
(
tuner
);
core
.
must_select_cards
.
push_back
(
tuner
);
tuner
->
operation
_param
=
tuner
->
get_synchro_level
(
pcard
);
tuner
->
sum
_param
=
tuner
->
get_synchro_level
(
pcard
);
if
(
smat
)
{
if
(
smat
)
{
min
--
;
min
--
;
max
--
;
max
--
;
core
.
must_select_cards
.
push_back
(
smat
);
core
.
must_select_cards
.
push_back
(
smat
);
smat
->
operation
_param
=
smat
->
get_synchro_level
(
pcard
);
smat
->
sum
_param
=
smat
->
get_synchro_level
(
pcard
);
mcount
++
;
mcount
++
;
}
}
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
...
@@ -4418,7 +4422,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4418,7 +4422,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
continue
;
continue
;
core
.
select_cards
.
push_back
(
pm
);
core
.
select_cards
.
push_back
(
pm
);
pm
->
operation
_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum
_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
}
}
else
{
}
else
{
...
@@ -4431,7 +4435,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4431,7 +4435,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
continue
;
continue
;
core
.
select_cards
.
push_back
(
pm
);
core
.
select_cards
.
push_back
(
pm
);
pm
->
operation
_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum
_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
}
}
}
...
@@ -4759,9 +4763,9 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -4759,9 +4763,9 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
int32
rmax
=
0
;
int32
rmax
=
0
;
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
rmax
+=
(
*
cit
)
->
operation
_param
;
rmax
+=
(
*
cit
)
->
release
_param
;
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
rmax
+=
(
*
cit
)
->
operation
_param
;
rmax
+=
(
*
cit
)
->
release
_param
;
core
.
temp_var
[
0
]
=
0
;
core
.
temp_var
[
0
]
=
0
;
if
(
rmax
<
min
)
{
if
(
rmax
<
min
)
{
returns
.
ivalue
[
0
]
=
TRUE
;
returns
.
ivalue
[
0
]
=
TRUE
;
...
@@ -4783,7 +4787,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -4783,7 +4787,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
core
.
select_cards
.
push_back
(
*
cit
);
core
.
select_cards
.
push_back
(
*
cit
);
else
else
for
(
auto
cit
=
core
.
release_cards_ex_sum
.
begin
();
cit
!=
core
.
release_cards_ex_sum
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
release_cards_ex_sum
.
begin
();
cit
!=
core
.
release_cards_ex_sum
.
end
();
++
cit
)
if
((
*
cit
)
->
operation
_param
==
2
)
if
((
*
cit
)
->
release
_param
==
2
)
core
.
select_cards
.
push_back
(
*
cit
);
core
.
select_cards
.
push_back
(
*
cit
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
...
@@ -4820,7 +4824,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -4820,7 +4824,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
uint32
rmin
=
core
.
operated_set
.
size
();
uint32
rmin
=
core
.
operated_set
.
size
();
uint32
rmax
=
0
;
uint32
rmax
=
0
;
for
(
auto
cit
=
core
.
operated_set
.
begin
();
cit
!=
core
.
operated_set
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
operated_set
.
begin
();
cit
!=
core
.
operated_set
.
end
();
++
cit
)
rmax
+=
(
*
cit
)
->
operation
_param
;
rmax
+=
(
*
cit
)
->
release
_param
;
min
-=
rmax
;
min
-=
rmax
;
max
-=
rmin
;
max
-=
rmin
;
core
.
units
.
begin
()
->
arg2
=
(
max
<<
16
)
+
min
;
core
.
units
.
begin
()
->
arg2
=
(
max
<<
16
)
+
min
;
...
...
playerop.cpp
View file @
2ec2856b
...
@@ -443,7 +443,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
...
@@ -443,7 +443,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
return
TRUE
;
return
TRUE
;
uint8
tm
=
0
;
uint8
tm
=
0
;
for
(
uint32
i
=
0
;
i
<
core
.
select_cards
.
size
();
++
i
)
for
(
uint32
i
=
0
;
i
<
core
.
select_cards
.
size
();
++
i
)
tm
+=
core
.
select_cards
[
i
]
->
operation
_param
;
tm
+=
core
.
select_cards
[
i
]
->
release
_param
;
if
(
max
>
5
)
if
(
max
>
5
)
max
=
5
;
max
=
5
;
if
(
max
>
tm
)
if
(
max
>
tm
)
...
@@ -465,7 +465,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
...
@@ -465,7 +465,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
operation
_param
);
pduel
->
write_buffer8
(
pcard
->
release
_param
);
}
}
return
FALSE
;
return
FALSE
;
}
else
{
}
else
{
...
@@ -485,7 +485,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
...
@@ -485,7 +485,7 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
return
FALSE
;
return
FALSE
;
}
}
c
[
v
]
=
1
;
c
[
v
]
=
1
;
tt
+=
core
.
select_cards
[
v
]
->
operation
_param
;
tt
+=
core
.
select_cards
[
v
]
->
release
_param
;
}
}
if
(
tt
<
min
)
{
if
(
tt
<
min
)
{
pduel
->
write_buffer8
(
MSG_RETRY
);
pduel
->
write_buffer8
(
MSG_RETRY
);
...
@@ -570,7 +570,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -570,7 +570,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer32
(
pcard
->
operation
_param
);
pduel
->
write_buffer32
(
pcard
->
sum
_param
);
}
}
pduel
->
write_buffer8
(
core
.
select_cards
.
size
());
pduel
->
write_buffer8
(
core
.
select_cards
.
size
());
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
core
.
select_cards
.
begin
(),
core
.
select_cards
.
end
(),
card
::
card_operation_sort
);
...
@@ -580,7 +580,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -580,7 +580,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer32
(
pcard
->
operation
_param
);
pduel
->
write_buffer32
(
pcard
->
sum
_param
);
}
}
return
FALSE
;
return
FALSE
;
}
else
{
}
else
{
...
@@ -594,7 +594,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -594,7 +594,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
return
FALSE
;
return
FALSE
;
}
}
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
oparam
[
i
]
=
core
.
must_select_cards
[
i
]
->
operation
_param
;
oparam
[
i
]
=
core
.
must_select_cards
[
i
]
->
sum
_param
;
int32
m
=
core
.
select_cards
.
size
();
int32
m
=
core
.
select_cards
.
size
();
for
(
int32
i
=
mcount
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
for
(
int32
i
=
mcount
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
int32
v
=
returns
.
bvalue
[
i
+
1
];
int32
v
=
returns
.
bvalue
[
i
+
1
];
...
@@ -603,7 +603,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -603,7 +603,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
return
FALSE
;
return
FALSE
;
}
}
c
[
v
]
=
1
;
c
[
v
]
=
1
;
oparam
[
i
]
=
core
.
select_cards
[
v
]
->
operation
_param
;
oparam
[
i
]
=
core
.
select_cards
[
v
]
->
sum
_param
;
}
}
if
(
!
select_sum_check1
(
oparam
,
returns
.
bvalue
[
0
],
0
,
acc
))
{
if
(
!
select_sum_check1
(
oparam
,
returns
.
bvalue
[
0
],
0
,
acc
))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
pduel
->
write_buffer8
(
MSG_RETRY
);
...
@@ -614,7 +614,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -614,7 +614,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
int32
mcount
=
core
.
must_select_cards
.
size
();
int32
mcount
=
core
.
must_select_cards
.
size
();
int32
sum
=
0
,
mx
=
0
,
mn
=
0x7fffffff
;
int32
sum
=
0
,
mx
=
0
,
mn
=
0x7fffffff
;
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
{
int32
op
=
core
.
must_select_cards
[
i
]
->
operation
_param
;
int32
op
=
core
.
must_select_cards
[
i
]
->
sum
_param
;
int32
o1
=
op
&
0xffff
;
int32
o1
=
op
&
0xffff
;
int32
o2
=
op
>>
16
;
int32
o2
=
op
>>
16
;
int32
ms
=
(
o2
&&
o2
<
o1
)
?
o2
:
o1
;
int32
ms
=
(
o2
&&
o2
<
o1
)
?
o2
:
o1
;
...
@@ -631,7 +631,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -631,7 +631,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
return
FALSE
;
return
FALSE
;
}
}
c
[
v
]
=
1
;
c
[
v
]
=
1
;
int32
op
=
core
.
select_cards
[
v
]
->
operation
_param
;
int32
op
=
core
.
select_cards
[
v
]
->
sum
_param
;
int32
o1
=
op
&
0xffff
;
int32
o1
=
op
&
0xffff
;
int32
o2
=
op
>>
16
;
int32
o2
=
op
>>
16
;
int32
ms
=
(
o2
&&
o2
<
o1
)
?
o2
:
o1
;
int32
ms
=
(
o2
&&
o2
<
o1
)
?
o2
:
o1
;
...
...
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