Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
List
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
fallenstardust
YGOMobile
Commits
f0a23631
Commit
f0a23631
authored
Aug 13, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
efa665ba
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
113 additions
and
95 deletions
+113
-95
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+3
-15
Classes/ocgcore/effect.cpp
Classes/ocgcore/effect.cpp
+2
-0
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+32
-27
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+2
-2
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+62
-39
Classes/ocgcore/libgroup.cpp
Classes/ocgcore/libgroup.cpp
+2
-2
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+5
-5
Classes/ocgcore/playerop.cpp
Classes/ocgcore/playerop.cpp
+5
-5
No files found.
Classes/ocgcore/card.cpp
View file @
f0a23631
...
...
@@ -2221,8 +2221,7 @@ int32 card::get_counter(uint16 countertype) {
void
card
::
set_material
(
card_set
*
materials
)
{
if
(
!
materials
)
{
material_cards
.
clear
();
return
;
}
}
else
material_cards
=
*
materials
;
for
(
auto
&
pcard
:
material_cards
)
pcard
->
current
.
reason_card
=
this
;
...
...
@@ -2849,7 +2848,7 @@ void card::get_unique_target(card_set* cset, int32 controler, card* icard) {
const
auto
&
player
=
pduel
->
game_field
->
player
[
controler
^
p
];
if
(
unique_location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
.
list_mzone
)
{
if
(
pcard
&&
(
pcard
!=
icard
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
get_status
(
STATUS_
BATTLE_DESTROYED
|
STATUS_
SPSUMMON_STEP
)
if
(
pcard
&&
(
pcard
!=
icard
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
get_status
(
STATUS_SPSUMMON_STEP
)
&&
check_unique_code
(
pcard
))
cset
->
insert
(
pcard
);
}
...
...
@@ -3123,17 +3122,6 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
}
effect_set
eset
;
filter_spsummon_procedure
(
playerid
,
&
eset
,
summon_type
);
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pduel
->
game_field
->
core
.
limit_syn
=
0
;
pduel
->
game_field
->
core
.
limit_syn_minc
=
0
;
pduel
->
game_field
->
core
.
limit_syn_maxc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
0
;
pduel
->
game_field
->
core
.
limit_link
=
0
;
pduel
->
game_field
->
core
.
limit_link_card
=
0
;
pduel
->
game_field
->
core
.
limit_link_minc
=
0
;
pduel
->
game_field
->
core
.
limit_link_maxc
=
0
;
pduel
->
game_field
->
restore_lp_cost
();
return
eset
.
size
();
}
...
...
Classes/ocgcore/effect.cpp
View file @
f0a23631
...
...
@@ -456,6 +456,8 @@ int32 effect::is_target(card* pcard) {
if
(
!
is_flag
(
EFFECT_FLAG_IGNORE_RANGE
))
{
if
(
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
|
STATUS_SPSUMMON_STEP
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_ABSOLUTE_TARGET
))
{
if
(
pcard
->
current
.
controler
==
0
)
{
if
(
!
pcard
->
current
.
is_location
(
s_range
))
...
...
Classes/ocgcore/field.cpp
View file @
f0a23631
...
...
@@ -636,9 +636,6 @@ int32 field::is_location_useable(uint32 playerid, uint32 location, uint32 sequen
}
return
TRUE
;
}
// 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
)
{
if
(
location
==
LOCATION_MZONE
&&
pcard
&&
pcard
->
current
.
location
==
LOCATION_EXTRA
)
return
get_useable_count_fromex
(
pcard
,
playerid
,
uplayer
,
zone
,
list
);
...
...
@@ -683,6 +680,7 @@ int32 field::get_spsummonable_count_fromex(card* pcard, uint8 playerid, uint8 up
pcard
->
current
.
location
=
0
;
return
spsummonable_count
;
}
// return: usable count of main mzone or szone(0~4) of playerid requested by uplayer (may be negative)
int32
field
::
get_useable_count_other
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint8
uplayer
,
uint32
reason
,
uint32
zone
,
uint32
*
list
)
{
int32
count
=
get_tofield_count
(
pcard
,
playerid
,
location
,
uplayer
,
reason
,
zone
,
list
);
int32
limit
;
...
...
@@ -694,6 +692,10 @@ int32 field::get_useable_count_other(card* pcard, uint8 playerid, uint8 location
count
=
limit
;
return
count
;
}
// uplayer: request player, PLAYER_NONE means ignoring EFFECT_MUST_USE_MZONE, EFFECT_MAX_MZONE, EFFECT_MAX_SZONE
// list: store unavailable flag in list
// for LOCATION_MZONE, return the available count of zone in main mzone (not used, not disabled, satisfying EFFECT_MUST_USE_MZONE)
// for LOCATION_SZONE, return the available count of zone in szone(0~4) (not used, not disabled)
int32
field
::
get_tofield_count
(
card
*
pcard
,
uint8
playerid
,
uint8
location
,
uint32
uplayer
,
uint32
reason
,
uint32
zone
,
uint32
*
list
)
{
if
(
location
!=
LOCATION_MZONE
&&
location
!=
LOCATION_SZONE
)
return
0
;
...
...
@@ -1322,7 +1324,8 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
eset
->
sort
();
}
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
|
EFFECT_FLAG_SPSUM_PARAM
))
return
;
uint8
self
=
peffect
->
get_handler_player
();
if
(
self
==
PLAYER_NONE
)
...
...
@@ -1355,7 +1358,7 @@ void field::filter_affected_cards(effect* peffect, card_set* cset) {
}
}
void
field
::
filter_inrange_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
if
(
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
|
EFFECT_FLAG_SPSUM_PARAM
))
return
;
uint8
self
=
peffect
->
get_handler_player
();
if
(
self
==
PLAYER_NONE
)
...
...
@@ -1814,12 +1817,12 @@ int32 field::get_draw_count(uint8 playerid) {
}
void
field
::
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
get_level
()
&&
pcard
->
is_affect_by_effect
(
peffect
)
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
))
material
->
insert
(
pcard
);
}
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
get_level
()
&&
pcard
->
is_affect_by_effect
(
peffect
)
if
(
pcard
&&
pcard
->
is_affect_by_effect
(
peffect
)
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
pcard
->
is_releasable_by_effect
(
playerid
,
peffect
))
material
->
insert
(
pcard
);
...
...
@@ -1936,13 +1939,13 @@ void field::adjust_disable_check_list() {
effects
.
disable_check_list
.
pop_front
();
effects
.
disable_check_set
.
erase
(
checking
);
checked
.
insert
(
checking
);
if
(
checking
->
is_status
(
STATUS_TO_ENABLE
|
STATUS_TO_DISABLE
))
if
(
checking
->
is_status
(
STATUS_TO_ENABLE
|
STATUS_TO_DISABLE
))
// prevent loop
continue
;
int32
pre_disable
=
checking
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
);
checking
->
refresh_disable_status
();
int32
new_disable
=
checking
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
);
if
(
pre_disable
!=
new_disable
&&
checking
->
is_status
(
STATUS_EFFECT_ENABLED
))
{
checking
->
filter_disable_related_cards
();
checking
->
filter_disable_related_cards
();
// change effects.disable_check_list
if
(
pre_disable
)
checking
->
set_status
(
STATUS_TO_ENABLE
,
TRUE
);
else
...
...
@@ -2459,10 +2462,12 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
if
(
ptuner
)
{
if
(
ptuner
->
value
)
location
=
ptuner
->
value
;
if
(
ptuner
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
ptuner
->
s_range
&&
ptuner
->
s_range
>
min
)
min
=
ptuner
->
s_range
;
if
(
ptuner
->
o_range
&&
ptuner
->
o_range
<
max
)
max
=
ptuner
->
o_range
;
}
if
(
min
>
max
)
{
pduel
->
restore_assumes
();
return
FALSE
;
...
...
@@ -2512,7 +2517,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
ct
++
;
}
if
(
min
==
0
)
{
if
(
ct
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
{
if
(
ct
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
{
pduel
->
restore_assumes
();
return
TRUE
;
}
...
...
@@ -2592,7 +2597,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
}
int32
field
::
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
)
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SCRAP_CHIMERA
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
}
return
FALSE
;
...
...
@@ -2604,7 +2609,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
break
;
}
if
(
!
pscrap
)
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
}
return
FALSE
;
...
...
@@ -2615,7 +2620,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
nsyn_filtered
.
push_back
(
pm
);
}
if
(
nsyn_filtered
.
size
()
==
nsyn
.
size
())
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
}
}
else
{
...
...
@@ -2624,7 +2629,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
if
(
pscrap
->
get_value
(
nsyn
[
i
]))
mfiltered
=
false
;
}
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
}
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
{
...
...
@@ -2637,7 +2642,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
if
(
!
pm
->
is_affected_by_effect
(
EFFECT_SCRAP_CHIMERA
))
nsyn_removed
.
push_back
(
pm
);
}
if
(
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
}
}
...
...
@@ -2678,34 +2683,34 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
return
FALSE
;
return
TRUE
;
}
int32
field
::
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
)
{
int32
field
::
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
,
int32
opmin
)
{
if
(
count
>
max
)
return
FALSE
;
while
(
index
<
(
int32
)
mats
.
size
())
{
int32
op1
=
mats
[
index
]
->
sum_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum_param
>>
16
)
&
0xffff
;
if
((
op1
==
acc
||
op2
==
acc
)
&&
count
>=
min
)
if
((
(
op1
==
acc
&&
acc
+
opmin
>
op1
)
||
(
op2
&&
op2
==
acc
&&
acc
+
opmin
>
op2
)
)
&&
count
>=
min
)
return
TRUE
;
index
++
;
if
(
acc
>
op1
&&
check_with_sum_limit
(
mats
,
acc
-
op1
,
index
,
count
+
1
,
min
,
max
))
if
(
acc
>
op1
&&
check_with_sum_limit
(
mats
,
acc
-
op1
,
index
,
count
+
1
,
min
,
max
,
std
::
min
(
opmin
,
op1
)
))
return
TRUE
;
if
(
op2
&&
acc
>
op2
&&
check_with_sum_limit
(
mats
,
acc
-
op2
,
index
,
count
+
1
,
min
,
max
))
if
(
op2
&&
acc
>
op2
&&
check_with_sum_limit
(
mats
,
acc
-
op2
,
index
,
count
+
1
,
min
,
max
,
std
::
min
(
opmin
,
op2
)
))
return
TRUE
;
}
return
FALSE
;
}
int32
field
::
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
)
{
int32
field
::
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
opmin
,
int32
must_count
)
{
if
(
acc
==
0
)
return
index
==
must_count
&&
0
>=
min
&&
0
<=
max
;
if
(
index
==
must_count
)
return
check_with_sum_limit
(
mats
,
acc
,
index
,
1
,
min
,
max
);
return
check_with_sum_limit
(
mats
,
acc
,
index
,
1
,
min
,
max
,
opmin
);
if
(
index
>=
(
int32
)
mats
.
size
())
return
FALSE
;
int32
op1
=
mats
[
index
]
->
sum_param
&
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
,
std
::
min
(
opmin
,
op1
),
must_count
))
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
,
std
::
min
(
opmin
,
op2
),
must_count
))
return
TRUE
;
return
FALSE
;
}
...
...
Classes/ocgcore/field.h
View file @
f0a23631
...
...
@@ -447,8 +447,8 @@ public:
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
,
int32
opmin
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
opmin
,
int32
must_count
);
static
int32
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
);
static
int32
check_with_sum_greater_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
,
int32
must_count
);
int32
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
lv
,
int32
min
,
int32
max
,
group
*
mg
);
...
...
Classes/ocgcore/libcard.cpp
View file @
f0a23631
This diff is collapsed.
Click to expand it.
Classes/ocgcore/libgroup.cpp
View file @
f0a23631
...
...
@@ -416,7 +416,7 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
for
(
auto
&
pcard
:
cv
)
pcard
->
sum_param
=
pduel
->
lua
->
get_operation_value
(
pcard
,
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
,
0xffff
,
mcount
));
return
1
;
}
int32
scriptlib
::
group_select_with_sum_equal
(
lua_State
*
L
)
{
...
...
@@ -447,7 +447,7 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
for
(
auto
&
pcard
:
cv
)
pcard
->
sum_param
=
pduel
->
lua
->
get_operation_value
(
pcard
,
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
,
0xffff
,
mcount
))
{
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
group
*
empty_group
=
pduel
->
new_group
();
interpreter
::
group2value
(
L
,
empty_group
);
...
...
Classes/ocgcore/operations.cpp
View file @
f0a23631
...
...
@@ -3794,7 +3794,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
uint8
dest
=
pcard
->
sendto_param
.
location
;
if
(
!
(
reason
&
REASON_RULE
)
&&
(
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SPSUMMON_STEP
)
||
(
!
(
pcard
->
current
.
reason
&
REASON_COST
)
&&
!
pcard
->
is_affect_by_effect
(
pcard
->
current
.
reason_effect
))
||
(
!
(
pcard
->
current
.
reason
&
(
REASON_COST
|
REASON_SUMMON
|
REASON_MATERIAL
)
)
&&
!
pcard
->
is_affect_by_effect
(
pcard
->
current
.
reason_effect
))
||
(
dest
==
LOCATION_HAND
&&
!
pcard
->
is_capable_send_to_hand
(
core
.
reason_player
))
||
(
dest
==
LOCATION_DECK
&&
!
pcard
->
is_capable_send_to_deck
(
core
.
reason_player
))
||
(
dest
==
LOCATION_REMOVED
&&
!
pcard
->
is_removeable
(
core
.
reason_player
,
pcard
->
sendto_param
.
position
,
reason
))
...
...
@@ -5213,7 +5213,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
case
3
:
{
card
*
tuner
=
core
.
limit_tuner
;
effect
*
ptuner
=
tuner
->
is_affected_by_effect
(
EFFECT_TUNER_MATERIAL_LIMIT
);
if
(
ptuner
)
{
if
(
ptuner
&&
ptuner
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
)
)
{
if
(
ptuner
->
s_range
&&
ptuner
->
s_range
>
min
)
min
=
ptuner
->
s_range
;
if
(
ptuner
->
o_range
&&
ptuner
->
o_range
<
max
)
...
...
@@ -5242,7 +5242,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
nsyn
.
push_back
(
smat
);
tuner
->
sum_param
=
tuner
->
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
,
0xffff
,
2
))
core
.
units
.
begin
()
->
step
=
8
;
}
return
FALSE
;
...
...
@@ -5416,8 +5416,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
if
(
nsyn
[
i
]
->
is_affected_by_effect
(
EFFECT_SCRAP_CHIMERA
))
mremoved
=
false
;
}
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
mremoved
&&
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
if
(
mremoved
&&
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
peffect
->
description
);
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
...
...
Classes/ocgcore/playerop.cpp
View file @
f0a23631
...
...
@@ -599,15 +599,15 @@ int32 field::select_counter(uint16 step, uint8 playerid, uint16 countertype, uin
}
return
TRUE
;
}
static
int32
select_sum_check1
(
const
int32
*
oparam
,
int32
size
,
int32
index
,
int32
acc
)
{
static
int32
select_sum_check1
(
const
int32
*
oparam
,
int32
size
,
int32
index
,
int32
acc
,
int32
opmin
)
{
if
(
acc
==
0
||
index
==
size
)
return
FALSE
;
int32
o1
=
oparam
[
index
]
&
0xffff
;
int32
o2
=
oparam
[
index
]
>>
16
;
if
(
index
==
size
-
1
)
return
acc
==
o1
||
acc
==
o2
;
return
(
acc
>
o1
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o1
))
||
(
o2
>
0
&&
acc
>
o2
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o2
));
return
(
acc
==
o1
&&
acc
+
opmin
>
o1
)
||
(
o2
&&
acc
==
o2
&&
acc
+
opmin
>
o2
)
;
return
(
acc
>
o1
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o1
,
std
::
min
(
o1
,
opmin
)
))
||
(
o2
>
0
&&
acc
>
o2
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o2
,
std
::
min
(
o2
,
opmin
)
));
}
int32
field
::
select_with_sum_limit
(
int16
step
,
uint8
playerid
,
int32
acc
,
int32
min
,
int32
max
)
{
if
(
step
==
0
)
{
...
...
@@ -664,7 +664,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
c
[
v
]
=
1
;
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
,
0xffff
))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
...
...
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