Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
4cfe4e67
Commit
4cfe4e67
authored
Jan 04, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
effectset
parent
1a1c3d49
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
152 additions
and
139 deletions
+152
-139
ocgcore/card.cpp
ocgcore/card.cpp
+53
-53
ocgcore/effect.cpp
ocgcore/effect.cpp
+3
-3
ocgcore/effectset.h
ocgcore/effectset.h
+13
-0
ocgcore/field.cpp
ocgcore/field.cpp
+22
-22
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+1
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+6
-6
ocgcore/operations.cpp
ocgcore/operations.cpp
+35
-35
ocgcore/processor.cpp
ocgcore/processor.cpp
+19
-19
No files found.
ocgcore/card.cpp
View file @
4cfe4e67
This diff is collapsed.
Click to expand it.
ocgcore/effect.cpp
View file @
4cfe4e67
...
...
@@ -186,7 +186,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
int32
available
=
false
;
effect_set
eset
;
handler
->
filter_effect
(
ecode
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
eset
[
i
]
->
check_count_limit
(
playerid
))
{
available
=
true
;
break
;
...
...
@@ -250,7 +250,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
int32
effect
::
is_action_check
(
uint8
playerid
)
{
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
EFFECT_CANNOT_ACTIVATE
,
&
eset
);
for
(
int
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
2
))
...
...
@@ -258,7 +258,7 @@ int32 effect::is_action_check(uint8 playerid) {
}
eset
.
clear
();
pduel
->
game_field
->
filter_player_effect
(
playerid
,
EFFECT_ACTIVATE_COST
,
&
eset
);
for
(
int
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
...
...
ocgcore/effectset.h
View file @
4cfe4e67
...
...
@@ -37,20 +37,33 @@ struct effect_set {
void
clear
()
{
count
=
0
;
}
int
size
()
const
{
return
count
;
}
void
sort
()
{
if
(
count
<
2
)
return
;
std
::
sort
(
container
.
begin
(),
container
.
begin
()
+
count
,
effect_sort_id
);
}
effect
*
const
&
get_last
()
const
{
return
container
[
count
-
1
];
}
effect
*&
get_last
()
{
return
container
[
count
-
1
];
}
effect
*
const
&
operator
[]
(
int
index
)
const
{
return
container
[
index
];
}
effect
*&
operator
[]
(
int
index
)
{
return
container
[
index
];
}
effect
*
const
&
at
(
int
index
)
const
{
return
container
[
index
];
}
effect
*&
at
(
int
index
)
{
return
container
[
index
];
}
private:
std
::
array
<
effect
*
,
64
>
container
;
int
count
;
};
...
...
ocgcore/field.cpp
View file @
4cfe4e67
...
...
@@ -471,7 +471,7 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
}
if
(
list
)
*
list
=
flag
;
if
(
eset
.
count
)
{
if
(
eset
.
size
()
)
{
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
uplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
reason
,
PARAM_TYPE_INT
);
...
...
@@ -1229,7 +1229,7 @@ int32 field::get_summon_count_limit(uint8 playerid) {
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_SET_SUMMON_COUNT_LIMIT
,
&
eset
);
int32
count
=
1
,
c
;
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
c
=
eset
[
i
]
->
get_value
();
if
(
c
>
count
)
count
=
c
;
...
...
@@ -1240,7 +1240,7 @@ int32 field::get_draw_count(uint8 playerid) {
effect_set
eset
;
filter_player_effect
(
infos
.
turn_player
,
EFFECT_DRAW_COUNT
,
&
eset
);
int32
count
=
player
[
playerid
].
draw_count
;
if
(
eset
.
count
)
if
(
eset
.
size
()
)
count
=
eset
.
get_last
()
->
get_value
();
return
count
;
}
...
...
@@ -1514,7 +1514,7 @@ int32 field::check_lp_cost(uint8 playerid, uint32 lp) {
if
(
lp
==
0
)
return
TRUE
;
filter_player_effect
(
playerid
,
EFFECT_LPCOST_CHANGE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
core
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
val
,
PARAM_TYPE_INT
);
...
...
@@ -1660,7 +1660,7 @@ int32 field::check_synchro_material(card* pcard, int32 findex1, int32 findex2, i
if
(
core
.
global_flag
&
GLOBALFLAG_MUST_BE_SMATERIAL
)
{
effect_set
eset
;
filter_player_effect
(
pcard
->
current
.
controler
,
EFFECT_MUST_BE_SMATERIAL
,
&
eset
);
if
(
eset
.
count
)
if
(
eset
.
size
()
)
return
check_tuner_material
(
pcard
,
eset
[
0
]
->
handler
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
);
}
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
...
...
@@ -1814,7 +1814,7 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
return
player
[
playerid
].
list_main
.
back
()
->
is_capable_cost_to_grave
(
playerid
);
effect_set
eset
;
filter_field_effect
(
EFFECT_TO_GRAVE_REDIRECT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
uint32
redirect
=
eset
[
i
]
->
get_value
();
if
((
redirect
&
LOCATION_REMOVED
)
&&
player
[
playerid
].
list_main
.
back
()
->
is_affected_by_effect
(
EFFECT_CANNOT_REMOVE
))
continue
;
...
...
@@ -1829,7 +1829,7 @@ int32 field::is_player_can_discard_hand(uint8 playerid, card * pcard, effect * p
return
FALSE
;
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_DISCARD_HAND
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1845,7 +1845,7 @@ int32 field::is_player_can_summon(uint32 sumtype, uint8 playerid, card * pcard)
effect_set
eset
;
sumtype
|=
SUMMON_TYPE_NORMAL
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1861,7 +1861,7 @@ int32 field::is_player_can_mset(uint32 sumtype, uint8 playerid, card * pcard) {
effect_set
eset
;
sumtype
|=
SUMMON_TYPE_NORMAL
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_MSET
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1876,7 +1876,7 @@ int32 field::is_player_can_mset(uint32 sumtype, uint8 playerid, card * pcard) {
int32
field
::
is_player_can_sset
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SSET
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1890,7 +1890,7 @@ int32 field::is_player_can_sset(uint8 playerid, card * pcard) {
int32
field
::
is_player_can_spsummon
(
uint8
playerid
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SPECIAL_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
}
...
...
@@ -1902,7 +1902,7 @@ int32 field::is_player_can_spsummon(effect * peffect, uint32 sumtype, uint8 sump
if
(
sumpos
&
POS_FACEDOWN
&&
is_player_affected_by_effect
(
playerid
,
EFFECT_DEVINE_LIGHT
))
sumpos
=
(
sumpos
&
POS_FACEUP
)
|
(
sumpos
>>
1
);
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SPECIAL_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1924,7 +1924,7 @@ int32 field::is_player_can_spsummon(effect * peffect, uint32 sumtype, uint8 sump
int32
field
::
is_player_can_flipsummon
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_FLIP_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1944,7 +1944,7 @@ int32 field::is_player_can_spsummon_monster(uint8 playerid, uint8 toplayer, uint
int32
field
::
is_player_can_release
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_RELEASE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -1958,7 +1958,7 @@ int32 field::is_player_can_release(uint8 playerid, card * pcard) {
int32
field
::
is_player_can_spsummon_count
(
uint8
playerid
,
uint32
count
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_LEFT_SPSUMMON_COUNT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
core
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
int32
v
=
eset
[
i
]
->
get_value
(
2
);
...
...
@@ -1970,7 +1970,7 @@ int32 field::is_player_can_spsummon_count(uint8 playerid, uint32 count) {
int32
field
::
is_player_can_place_counter
(
uint8
playerid
,
card
*
pcard
,
uint16
countertype
,
uint16
count
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_PLACE_COUNTER
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -2024,7 +2024,7 @@ int32 field::is_player_can_remove_overlay_card(uint8 playerid, card * pcard, uin
int32
field
::
is_player_can_send_to_grave
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_TO_GRAVE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -2038,7 +2038,7 @@ int32 field::is_player_can_send_to_grave(uint8 playerid, card * pcard) {
int32
field
::
is_player_can_send_to_hand
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_TO_HAND
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -2052,7 +2052,7 @@ int32 field::is_player_can_send_to_hand(uint8 playerid, card * pcard) {
int32
field
::
is_player_can_send_to_deck
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_TO_DECK
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -2066,7 +2066,7 @@ int32 field::is_player_can_send_to_deck(uint8 playerid, card * pcard) {
int32
field
::
is_player_can_remove
(
uint8
playerid
,
card
*
pcard
)
{
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_REMOVE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
...
...
@@ -2091,7 +2091,7 @@ int32 field::is_chain_negatable(uint8 chaincount, uint8 naga_check) {
if
(
peffect
->
flag
&
EFFECT_FLAG_CANNOT_DISABLE
)
return
FALSE
;
filter_field_effect
(
EFFECT_CANNOT_INACTIVATE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
chaincount
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
1
))
return
FALSE
;
...
...
@@ -2112,7 +2112,7 @@ int32 field::is_chain_disablable(uint8 chaincount, uint8 naga_check) {
if
(
peffect
->
flag
&
EFFECT_FLAG_CANNOT_DISABLE
)
return
FALSE
;
filter_field_effect
(
EFFECT_CANNOT_DISEFFECT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
chaincount
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
1
))
return
FALSE
;
...
...
ocgcore/libcard.cpp
View file @
4cfe4e67
...
...
@@ -901,7 +901,7 @@ int32 scriptlib::card_get_effect_count(lua_State *L) {
uint32
code
=
lua_tointeger
(
L
,
2
);
effect_set
eset
;
pcard
->
filter_effect
(
code
,
&
eset
);
lua_pushinteger
(
L
,
eset
.
count
);
lua_pushinteger
(
L
,
eset
.
size
()
);
return
1
;
}
int32
scriptlib
::
card_register_flag_effect
(
lua_State
*
L
)
{
...
...
ocgcore/libduel.cpp
View file @
4cfe4e67
...
...
@@ -112,7 +112,7 @@ int32 scriptlib::duel_get_flag_effect(lua_State *L) {
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
code
,
&
eset
);
lua_pushinteger
(
L
,
eset
.
count
);
lua_pushinteger
(
L
,
eset
.
size
()
);
return
1
;
}
int32
scriptlib
::
duel_reset_flag_effect
(
lua_State
*
L
)
{
...
...
@@ -623,7 +623,7 @@ int32 scriptlib::duel_get_chain_material(lua_State *L) {
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
EFFECT_CHAIN_MATERIAL
,
&
eset
);
if
(
!
eset
.
count
)
if
(
!
eset
.
size
()
)
return
0
;
interpreter
::
effect2value
(
L
,
eset
[
0
]);
return
1
;
...
...
@@ -812,7 +812,7 @@ int32 scriptlib::duel_get_environment(lua_State *L) {
pcard
=
pduel
->
game_field
->
player
[
1
].
list_szone
[
5
];
if
(
pcard
==
0
||
pcard
->
is_position
(
POS_FACEDOWN
)
||
!
pcard
->
get_status
(
STATUS_EFFECT_ENABLED
))
{
pduel
->
game_field
->
filter_field_effect
(
EFFECT_CHANGE_ENVIRONMENT
,
&
eset
);
if
(
eset
.
count
)
{
if
(
eset
.
size
()
)
{
effect
*
peffect
=
eset
.
get_last
();
code
=
peffect
->
get_value
();
p
=
peffect
->
get_handler_player
();
...
...
@@ -850,7 +850,7 @@ int32 scriptlib::duel_is_environment(lua_State *L) {
if
(
!
fc
)
{
effect_set
eset
;
pduel
->
game_field
->
filter_field_effect
(
EFFECT_CHANGE_ENVIRONMENT
,
&
eset
);
if
(
eset
.
count
)
{
if
(
eset
.
size
()
)
{
effect
*
peffect
=
eset
.
get_last
();
if
(
code
==
(
uint32
)
peffect
->
get_value
()
&&
(
playerid
==
peffect
->
get_handler_player
()
||
playerid
==
PLAYER_ALL
))
ret
=
1
;
...
...
@@ -2149,7 +2149,7 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
if
(
pduel
->
game_field
->
core
.
global_flag
&
GLOBALFLAG_MUST_BE_SMATERIAL
)
{
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
pcard
->
current
.
controler
,
EFFECT_MUST_BE_SMATERIAL
,
&
eset
);
if
(
eset
.
count
&&
eset
[
0
]
->
handler
!=
tuner
)
{
if
(
eset
.
size
()
&&
eset
[
0
]
->
handler
!=
tuner
)
{
lua_pushboolean
(
L
,
false
);
return
1
;
}
...
...
@@ -3194,7 +3194,7 @@ int32 scriptlib::duel_venom_swamp_check(lua_State *L) {
pcard
->
filter_effect
(
EFFECT_UPDATE_ATTACK
,
&
eset
,
FALSE
);
pcard
->
filter_effect
(
EFFECT_SET_ATTACK
,
&
eset
,
FALSE
);
pcard
->
filter_effect
(
EFFECT_SET_ATTACK_FINAL
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
switch
(
eset
[
i
]
->
code
)
{
case
EFFECT_UPDATE_ATTACK
:
{
if
(
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
&&
!
(
eset
[
i
]
->
flag
&
EFFECT_FLAG_SINGLE_RANGE
))
...
...
ocgcore/operations.cpp
View file @
4cfe4e67
This diff is collapsed.
Click to expand it.
ocgcore/processor.cpp
View file @
4cfe4e67
...
...
@@ -1658,7 +1658,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
int32
limit
=
6
;
effect_set
eset
;
filter_player_effect
(
infos
.
turn_player
,
EFFECT_HAND_LIMIT
,
&
eset
);
if
(
eset
.
count
)
if
(
eset
.
size
()
)
limit
=
eset
.
get_last
()
->
get_value
();
int32
hd
=
player
[
infos
.
turn_player
].
list_hand
.
size
();
if
(
hd
<=
limit
)
{
...
...
@@ -2612,7 +2612,7 @@ int32 field::process_idle_command(uint16 step) {
core
.
spsummonable_cards
.
clear
();
effect_set
eset
;
filter_field_effect
(
EFFECT_SPSUMMON_PROC
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pcard
=
eset
[
i
]
->
handler
;
if
(
!
eset
[
i
]
->
check_count_limit
(
pcard
->
current
.
controler
))
continue
;
...
...
@@ -2621,7 +2621,7 @@ int32 field::process_idle_command(uint16 step) {
}
eset
.
clear
();
filter_field_effect
(
EFFECT_SPSUMMON_PROC_G
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pcard
=
eset
[
i
]
->
handler
;
if
(
!
eset
[
i
]
->
check_count_limit
(
pcard
->
current
.
controler
))
continue
;
...
...
@@ -2924,7 +2924,7 @@ int32 field::process_battle_command(uint16 step) {
effect_set
eset
;
filter_player_effect
(
infos
.
turn_player
,
EFFECT_ATTACK_COST
,
&
eset
,
FALSE
);
core
.
attacker
->
filter_effect
(
EFFECT_ATTACK_COST
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
attack_cancelable
=
FALSE
;
core
.
sub_solving_event
.
push_back
(
nil_event
);
...
...
@@ -3545,9 +3545,9 @@ int32 field::process_battle_command(uint16 step) {
uint8
dp
[
2
];
dp
[
0
]
=
dp
[
1
]
=
0
;
core
.
attacker
->
filter_effect
(
EFFECT_PIERCE
,
&
eset
);
if
(
eset
.
count
&&
!
core
.
attacker
->
is_affected_by_effect
(
EFFECT_NO_BATTLE_DAMAGE
)
if
(
eset
.
size
()
&&
!
core
.
attacker
->
is_affected_by_effect
(
EFFECT_NO_BATTLE_DAMAGE
)
&&
!
core
.
attack_target
->
is_affected_by_effect
(
EFFECT_AVOID_BATTLE_DAMAGE
,
core
.
attacker
))
{
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
dp
[
1
-
eset
[
i
]
->
get_handler_player
()]
=
1
;
if
(
dp
[
0
]
&&
is_player_affected_by_effect
(
0
,
EFFECT_AVOID_BATTLE_DAMAGE
))
dp
[
0
]
=
0
;
...
...
@@ -3892,7 +3892,7 @@ int32 field::process_battle_command(uint16 step) {
effect_set
eset
;
filter_player_effect
(
infos
.
turn_player
,
EFFECT_ATTACK_COST
,
&
eset
,
FALSE
);
core
.
attacker
->
filter_effect
(
EFFECT_ATTACK_COST
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
infos
.
turn_player
,
0
);
...
...
@@ -4298,7 +4298,7 @@ int32 field::add_chain(uint16 step) {
return
TRUE
;
effect_set
eset
;
filter_player_effect
(
clit
.
triggering_player
,
EFFECT_ACTIVATE_COST
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
clit
.
triggering_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
clit
.
triggering_player
,
PARAM_TYPE_INT
);
...
...
@@ -4326,14 +4326,14 @@ int32 field::add_chain(uint16 step) {
eset
.
clear
();
peffect
->
handler
->
filter_effect
(
ecode
,
&
eset
);
effect
*
pactin
=
0
;
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
!
(
eset
[
i
]
->
flag
&
EFFECT_FLAG_COUNT_LIMIT
))
{
pactin
=
eset
[
i
];
break
;
}
}
if
(
!
pactin
)
{
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
if
(
eset
[
i
]
->
check_count_limit
(
peffect
->
handler
->
current
.
controler
))
{
eset
[
i
]
->
dec_count
(
peffect
->
handler
->
current
.
controler
);
break
;
...
...
@@ -4896,21 +4896,21 @@ void field::refresh_location_info_instant() {
player
[
0
].
disabled_location
=
0
;
player
[
1
].
disabled_location
=
0
;
filter_field_effect
(
EFFECT_DISABLE_FIELD
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
value
=
eset
[
i
]
->
get_value
();
player
[
0
].
disabled_location
|=
value
&
0x1f1f
;
player
[
1
].
disabled_location
|=
(
value
>>
16
)
&
0x1f1f
;
}
eset
.
clear
();
filter_field_effect
(
EFFECT_USE_EXTRA_MZONE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
p
=
eset
[
i
]
->
get_handler_player
();
value
=
eset
[
i
]
->
get_value
();
player
[
p
].
disabled_location
|=
(
value
>>
16
)
&
0x1f
;
}
eset
.
clear
();
filter_field_effect
(
EFFECT_USE_EXTRA_SZONE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
p
=
eset
[
i
]
->
get_handler_player
();
value
=
eset
[
i
]
->
get_value
();
player
[
p
].
disabled_location
|=
(
value
>>
8
)
&
0x1f00
;
...
...
@@ -4934,7 +4934,7 @@ int32 field::refresh_location_info(uint16 step) {
core
.
extraz_effects
.
clear
();
core
.
extraz_effects_e
.
clear
();
filter_field_effect
(
EFFECT_DISABLE_FIELD
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
value
=
eset
[
i
]
->
get_value
();
if
(
value
)
{
player
[
0
].
disabled_location
|=
value
&
0x1f1f
;
...
...
@@ -4944,7 +4944,7 @@ int32 field::refresh_location_info(uint16 step) {
}
eset
.
clear
();
filter_field_effect
(
EFFECT_USE_EXTRA_MZONE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
p
=
eset
[
i
]
->
get_handler_player
();
value
=
eset
[
i
]
->
get_value
();
player
[
p
].
disabled_location
|=
(
value
>>
16
)
&
0x1f
;
...
...
@@ -4955,7 +4955,7 @@ int32 field::refresh_location_info(uint16 step) {
}
eset
.
clear
();
filter_field_effect
(
EFFECT_USE_EXTRA_SZONE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
()
;
++
i
)
{
p
=
eset
[
i
]
->
get_handler_player
();
value
=
eset
[
i
]
->
get_value
();
player
[
p
].
disabled_location
|=
(
value
>>
8
)
&
0x1f00
;
...
...
@@ -5347,7 +5347,7 @@ int32 field::adjust_step(uint16 step) {
continue
;
eset
.
clear
();
pcard
->
filter_effect
(
EFFECT_SET_POSITION
,
&
eset
);
if
(
eset
.
count
)
{
if
(
eset
.
size
()
)
{
pos
=
eset
.
get_last
()
->
get_value
();
if
((
pos
&
0xff
)
!=
pcard
->
current
.
position
)
{
pos_adjust
.
insert
(
pcard
);
...
...
@@ -5400,7 +5400,7 @@ int32 field::adjust_step(uint16 step) {
uint32
res
=
0
;
if
(
core
.
global_flag
&
GLOBALFLAG_DECK_REVERSE_CHECK
)
{
filter_field_effect
(
EFFECT_REVERSE_DECK
,
&
eset
,
FALSE
);
res
=
eset
.
count
?
TRUE
:
FALSE
;
res
=
eset
.
size
()
?
TRUE
:
FALSE
;
if
(
core
.
deck_reversed
^
res
)
{
reverse_deck
(
0
);
reverse_deck
(
1
);
...
...
@@ -5433,7 +5433,7 @@ int32 field::adjust_step(uint16 step) {
}
if
(
core
.
global_flag
&
GLOBALFLAG_BRAINWASHING_CHECK
)
{
filter_field_effect
(
EFFECT_REMOVE_BRAINWASHING
,
&
eset
,
FALSE
);
res
=
eset
.
count
?
TRUE
:
FALSE
;
res
=
eset
.
size
()
?
TRUE
:
FALSE
;
if
(
res
&&
!
core
.
remove_brainwashing
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
0
].
list_mzone
[
i
];
...
...
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