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
7eba9c3e
Commit
7eba9c3e
authored
Nov 26, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update EFFECT_TYPE_XMATERIAL
parent
c670a7c8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
21 deletions
+37
-21
card.cpp
card.cpp
+22
-12
effect.cpp
effect.cpp
+13
-9
processor.cpp
processor.cpp
+2
-0
No files found.
card.cpp
View file @
7eba9c3e
...
...
@@ -1162,6 +1162,11 @@ void card::xyz_add(card* mat, card_set* des) {
mat
->
current
.
location
=
LOCATION_OVERLAY
;
mat
->
current
.
sequence
=
xyz_materials
.
size
()
-
1
;
mat
->
current
.
reason
=
REASON_XYZ
+
REASON_MATERIAL
;
for
(
auto
eit
=
mat
->
xmaterial_effect
.
begin
();
eit
!=
mat
->
xmaterial_effect
.
end
();
++
eit
)
{
effect
*
peffect
=
eit
->
second
;
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
pduel
->
game_field
->
add_effect
(
peffect
);
}
}
void
card
::
xyz_remove
(
card
*
mat
)
{
if
(
mat
->
overlay_target
!=
this
)
...
...
@@ -1176,6 +1181,11 @@ void card::xyz_remove(card* mat) {
mat
->
overlay_target
=
0
;
for
(
auto
clit
=
xyz_materials
.
begin
();
clit
!=
xyz_materials
.
end
();
++
clit
)
(
*
clit
)
->
current
.
sequence
=
clit
-
xyz_materials
.
begin
();
for
(
auto
eit
=
mat
->
xmaterial_effect
.
begin
();
eit
!=
mat
->
xmaterial_effect
.
end
();
++
eit
)
{
effect
*
peffect
=
eit
->
second
;
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
pduel
->
game_field
->
remove_effect
(
peffect
);
}
}
void
card
::
apply_field_effect
()
{
if
(
current
.
controler
==
PLAYER_NONE
)
...
...
@@ -1278,9 +1288,7 @@ int32 card::add_effect(effect* peffect) {
}
}
eit
=
single_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
eit
=
field_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
else
if
(
peffect
->
type
&
EFFECT_TYPE_EQUIP
)
{
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_EQUIP
)
{
eit
=
equip_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
if
(
equiping_target
)
check_target
=
equiping_target
;
...
...
@@ -1292,6 +1300,8 @@ int32 card::add_effect(effect* peffect) {
check_target
=
overlay_target
;
else
check_target
=
0
;
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
{
eit
=
field_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
}
else
return
0
;
peffect
->
id
=
pduel
->
game_field
->
infos
.
field_id
++
;
...
...
@@ -1353,16 +1363,8 @@ void card::remove_effect(effect* peffect) {
}
void
card
::
remove_effect
(
effect
*
peffect
,
effect_container
::
iterator
it
)
{
card
*
check_target
=
this
;
if
(
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
if
(
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
{
single_effect
.
erase
(
it
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
{
check_target
=
0
;
if
(
peffect
->
is_available
()
&&
peffect
->
is_disable_related
())
{
pduel
->
game_field
->
update_disable_check_list
(
peffect
);
}
field_effect
.
erase
(
it
);
if
(
peffect
->
in_range
(
current
.
location
,
current
.
sequence
))
pduel
->
game_field
->
remove_effect
(
peffect
);
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_EQUIP
)
{
equip_effect
.
erase
(
it
);
if
(
equiping_target
)
...
...
@@ -1375,6 +1377,14 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
check_target
=
overlay_target
;
else
check_target
=
0
;
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
{
check_target
=
0
;
if
(
peffect
->
is_available
()
&&
peffect
->
is_disable_related
())
{
pduel
->
game_field
->
update_disable_check_list
(
peffect
);
}
field_effect
.
erase
(
it
);
if
(
peffect
->
in_range
(
current
.
location
,
current
.
sequence
))
pduel
->
game_field
->
remove_effect
(
peffect
);
}
if
((
current
.
controler
!=
PLAYER_NONE
)
&&
!
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
)
&&
check_target
)
{
if
(
peffect
->
is_disable_related
())
...
...
effect.cpp
View file @
7eba9c3e
...
...
@@ -111,24 +111,26 @@ int32 effect::is_available() {
}
}
if
(
type
&
EFFECT_TYPE_FIELD
)
{
card
*
phandler
=
get_handler
();
card
*
powner
=
get_owner
();
if
(
!
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
{
if
(
handler
->
current
.
controler
==
PLAYER_NONE
)
if
(
p
handler
->
current
.
controler
==
PLAYER_NONE
)
return
FALSE
;
if
(
!
in_range
(
handler
->
current
.
location
,
handler
->
current
.
sequence
))
if
(
!
in_range
(
phandler
->
current
.
location
,
p
handler
->
current
.
sequence
))
return
FALSE
;
if
(
!
handler
->
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
is_flag
(
EFFECT_FLAG_IMMEDIATELY_APPLY
))
if
(
!
p
handler
->
get_status
(
STATUS_EFFECT_ENABLED
)
&&
!
is_flag
(
EFFECT_FLAG_IMMEDIATELY_APPLY
))
return
FALSE
;
if
((
handler
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
handler
->
is_position
(
POS_FACEUP
))
if
((
phandler
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
p
handler
->
is_position
(
POS_FACEUP
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
is_can_be_forbidden
()
&&
owner
->
is_status
(
STATUS_FORBIDDEN
))
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
is_can_be_forbidden
()
&&
p
owner
->
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
if
(
owner
==
handler
&&
is_can_be_forbidden
()
&&
handler
->
get_status
(
STATUS_FORBIDDEN
))
if
(
powner
==
phandler
&&
is_can_be_forbidden
()
&&
p
handler
->
get_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
owner
->
is_status
(
STATUS_DISABLED
))
if
(
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
p
owner
->
is_status
(
STATUS_DISABLED
))
return
FALSE
;
if
(
owner
==
handler
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
handler
->
get_status
(
STATUS_DISABLED
))
if
(
powner
==
phandler
&&
!
is_flag
(
EFFECT_FLAG_CANNOT_DISABLE
)
&&
p
handler
->
get_status
(
STATUS_DISABLED
))
return
FALSE
;
if
(
handler
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
!
is_flag
(
EFFECT_FLAG_AVAILABLE_BD
))
if
(
p
handler
->
is_status
(
STATUS_BATTLE_DESTROYED
)
&&
!
is_flag
(
EFFECT_FLAG_AVAILABLE_BD
))
return
FALSE
;
}
}
...
...
@@ -677,6 +679,8 @@ uint8 effect::get_handler_player() {
return
get_handler
()
->
current
.
controler
;
}
int32
effect
::
in_range
(
int32
loc
,
int32
seq
)
{
if
(
type
&
EFFECT_TYPE_XMATERIAL
)
return
(
int32
)(
!!
handler
->
overlay_target
);
if
(
loc
!=
LOCATION_SZONE
)
return
range
&
loc
;
if
(
seq
<
5
)
...
...
processor.cpp
View file @
7eba9c3e
...
...
@@ -2381,6 +2381,8 @@ int32 field::process_single_event() {
pr
=
(
*
ovit
)
->
xmaterial_effect
.
equal_range
(
ev
);
for
(;
pr
.
first
!=
pr
.
second
;
++
pr
.
first
)
{
effect
*
peffect
=
pr
.
first
->
second
;
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
continue
;
process_single_event
(
peffect
,
*
elit
,
tp
,
ntp
,
tev
,
ntev
);
}
}
...
...
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