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
cd93c0a5
Commit
cd93c0a5
authored
Apr 20, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove field::reset_effect()
parent
edf3d41c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
44 deletions
+14
-44
card.cpp
card.cpp
+8
-6
effect.cpp
effect.cpp
+3
-1
field.cpp
field.cpp
+0
-35
field.h
field.h
+0
-1
libeffect.cpp
libeffect.cpp
+1
-1
processor.cpp
processor.cpp
+2
-0
No files found.
card.cpp
View file @
cd93c0a5
...
@@ -1003,8 +1003,8 @@ void card::apply_field_effect() {
...
@@ -1003,8 +1003,8 @@ void card::apply_field_effect() {
if
(
current
.
controler
==
PLAYER_NONE
)
if
(
current
.
controler
==
PLAYER_NONE
)
return
;
return
;
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
if
(
it
->
second
->
in_range
(
current
.
location
,
current
.
sequence
)
||
((
it
->
second
->
range
&
LOCATION_HAND
)
if
(
it
->
second
->
in_range
(
current
.
location
,
current
.
sequence
)
&&
(
it
->
second
->
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
!
(
it
->
second
->
code
&
EVENT_PHASE
)))
{
||
((
it
->
second
->
range
&
LOCATION_HAND
)
&&
(
it
->
second
->
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
!
(
it
->
second
->
code
&
EVENT_PHASE
)))
{
pduel
->
game_field
->
add_effect
(
it
->
second
);
pduel
->
game_field
->
add_effect
(
it
->
second
);
}
}
}
}
...
@@ -1017,8 +1017,8 @@ void card::cancel_field_effect() {
...
@@ -1017,8 +1017,8 @@ void card::cancel_field_effect() {
if
(
current
.
controler
==
PLAYER_NONE
)
if
(
current
.
controler
==
PLAYER_NONE
)
return
;
return
;
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
if
(
it
->
second
->
in_range
(
current
.
location
,
current
.
sequence
)
||
((
it
->
second
->
range
&
LOCATION_HAND
)
if
(
it
->
second
->
in_range
(
current
.
location
,
current
.
sequence
)
&&
(
it
->
second
->
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
!
(
it
->
second
->
code
&
EVENT_PHASE
)))
{
||
((
it
->
second
->
range
&
LOCATION_HAND
)
&&
(
it
->
second
->
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
!
(
it
->
second
->
code
&
EVENT_PHASE
)))
{
pduel
->
game_field
->
remove_effect
(
it
->
second
);
pduel
->
game_field
->
remove_effect
(
it
->
second
);
}
}
}
}
...
@@ -1098,7 +1098,8 @@ int32 card::add_effect(effect* peffect) {
...
@@ -1098,7 +1098,8 @@ int32 card::add_effect(effect* peffect) {
}
}
}
}
it
=
single_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
it
=
single_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
}
else
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
it
=
field_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
it
=
field_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
else
if
(
peffect
->
type
&
EFFECT_TYPE_EQUIP
)
{
else
if
(
peffect
->
type
&
EFFECT_TYPE_EQUIP
)
{
it
=
equip_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
it
=
equip_effect
.
insert
(
std
::
make_pair
(
peffect
->
code
,
peffect
));
...
@@ -1106,7 +1107,8 @@ int32 card::add_effect(effect* peffect) {
...
@@ -1106,7 +1107,8 @@ int32 card::add_effect(effect* peffect) {
check_target
=
equiping_target
;
check_target
=
equiping_target
;
else
else
check_target
=
0
;
check_target
=
0
;
}
else
}
else
return
0
;
return
0
;
peffect
->
id
=
pduel
->
game_field
->
infos
.
field_id
++
;
peffect
->
id
=
pduel
->
game_field
->
infos
.
field_id
++
;
peffect
->
card_type
=
data
.
type
;
peffect
->
card_type
=
data
.
type
;
...
...
effect.cpp
View file @
cd93c0a5
...
@@ -140,7 +140,9 @@ int32 effect::is_available() {
...
@@ -140,7 +140,9 @@ int32 effect::is_available() {
status
&=
~
EFFECT_STATUS_AVAILABLE
;
status
&=
~
EFFECT_STATUS_AVAILABLE
;
return
res
;
return
res
;
}
}
// reset_count:
// 0x00ff: count of effect reset
// 0xf000: max count of activation, 0x0f00: left count of activation
int32
effect
::
check_count_limit
(
uint8
playerid
)
{
int32
effect
::
check_count_limit
(
uint8
playerid
)
{
if
(
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
(
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
((
reset_count
&
0xf00
)
==
0
)
if
((
reset_count
&
0xf00
)
==
0
)
...
...
field.cpp
View file @
cd93c0a5
...
@@ -815,41 +815,6 @@ void field::remove_oath_effect(effect* reason_effect) {
...
@@ -815,41 +815,6 @@ void field::remove_oath_effect(effect* reason_effect) {
}
}
}
}
}
}
void
field
::
reset_effect
(
uint32
id
,
uint32
reset_type
)
{
int32
result
;
for
(
auto
it
=
effects
.
indexer
.
begin
();
it
!=
effects
.
indexer
.
end
();)
{
auto
rm
=
it
++
;
auto
peffect
=
rm
->
first
;
auto
pit
=
rm
->
second
;
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
continue
;
result
=
peffect
->
reset
(
id
,
reset_type
);
if
(
result
)
{
if
(
!
(
peffect
->
type
&
EFFECT_TYPE_ACTIONS
))
{
if
(
peffect
->
is_disable_related
())
update_disable_check_list
(
peffect
);
effects
.
aura_effect
.
erase
(
pit
);
}
else
{
if
(
peffect
->
type
&
EFFECT_TYPE_IGNITION
)
effects
.
ignition_effect
.
erase
(
pit
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_ACTIVATE
)
effects
.
activate_effect
.
erase
(
pit
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_TRIGGER_O
)
effects
.
trigger_o_effect
.
erase
(
pit
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_TRIGGER_F
)
effects
.
trigger_f_effect
.
erase
(
pit
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_QUICK_O
)
effects
.
quick_o_effect
.
erase
(
pit
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_QUICK_F
)
effects
.
quick_f_effect
.
erase
(
pit
);
else
if
(
peffect
->
type
&
EFFECT_TYPE_CONTINUOUS
)
effects
.
continuous_effect
.
erase
(
pit
);
}
effects
.
indexer
.
erase
(
peffect
);
pduel
->
delete_effect
(
peffect
);
}
}
}
void
field
::
reset_phase
(
uint32
phase
)
{
void
field
::
reset_phase
(
uint32
phase
)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
auto
rm
=
eit
++
;
auto
rm
=
eit
++
;
...
...
field.h
View file @
cd93c0a5
...
@@ -341,7 +341,6 @@ public:
...
@@ -341,7 +341,6 @@ public:
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
remove_effect
(
effect
*
peffect
);
void
remove_effect
(
effect
*
peffect
);
void
remove_oath_effect
(
effect
*
reason_effect
);
void
remove_oath_effect
(
effect
*
reason_effect
);
void
reset_effect
(
uint32
id
,
uint32
reset_type
);
void
reset_phase
(
uint32
phase
);
void
reset_phase
(
uint32
phase
);
void
reset_chain
();
void
reset_chain
();
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
...
...
libeffect.cpp
View file @
cd93c0a5
...
@@ -172,7 +172,7 @@ int32 scriptlib::effect_set_type(lua_State *L) {
...
@@ -172,7 +172,7 @@ int32 scriptlib::effect_set_type(lua_State *L) {
v
|=
EFFECT_TYPE_ACTIONS
;
v
|=
EFFECT_TYPE_ACTIONS
;
else
else
v
&=
~
EFFECT_TYPE_ACTIONS
;
v
&=
~
EFFECT_TYPE_ACTIONS
;
if
(
v
&
0x550
)
if
(
v
&
(
EFFECT_TYPE_ACTIVATE
|
EFFECT_TYPE_IGNITION
|
EFFECT_TYPE_QUICK_O
|
EFFECT_TYPE_QUICK_F
)
)
v
|=
EFFECT_TYPE_FIELD
;
v
|=
EFFECT_TYPE_FIELD
;
if
(
v
&
EFFECT_TYPE_ACTIVATE
)
if
(
v
&
EFFECT_TYPE_ACTIVATE
)
peffect
->
range
=
LOCATION_SZONE
+
LOCATION_FZONE
+
LOCATION_HAND
;
peffect
->
range
=
LOCATION_SZONE
+
LOCATION_FZONE
+
LOCATION_HAND
;
...
...
processor.cpp
View file @
cd93c0a5
...
@@ -1262,6 +1262,7 @@ void field::raise_single_event(card* trigger_card, card_set* event_cards, uint32
...
@@ -1262,6 +1262,7 @@ void field::raise_single_event(card* trigger_card, card_set* event_cards, uint32
new_event
.
event_value
=
event_value
;
new_event
.
event_value
=
event_value
;
core
.
single_event
.
push_back
(
new_event
);
core
.
single_event
.
push_back
(
new_event
);
}
}
// called by Duel.CheckEvent()
int32
field
::
check_event
(
uint32
code
,
tevent
*
pe
)
{
int32
field
::
check_event
(
uint32
code
,
tevent
*
pe
)
{
for
(
auto
eit
=
core
.
point_event
.
begin
();
eit
!=
core
.
point_event
.
end
();
++
eit
)
{
for
(
auto
eit
=
core
.
point_event
.
begin
();
eit
!=
core
.
point_event
.
end
();
++
eit
)
{
if
(
eit
->
event_code
==
code
)
{
if
(
eit
->
event_code
==
code
)
{
...
@@ -1279,6 +1280,7 @@ int32 field::check_event(uint32 code, tevent * pe) {
...
@@ -1279,6 +1280,7 @@ int32 field::check_event(uint32 code, tevent * pe) {
}
}
return
FALSE
;
return
FALSE
;
}
}
// called by Duel.CheckActivateEffect()
int32
field
::
check_event_c
(
effect
*
peffect
,
uint8
playerid
,
int32
neglect_con
,
int32
neglect_cost
,
int32
copy_info
,
tevent
*
pe
)
{
int32
field
::
check_event_c
(
effect
*
peffect
,
uint8
playerid
,
int32
neglect_con
,
int32
neglect_cost
,
int32
copy_info
,
tevent
*
pe
)
{
if
(
peffect
->
code
==
EVENT_FREE_CHAIN
)
{
if
(
peffect
->
code
==
EVENT_FREE_CHAIN
)
{
return
peffect
->
is_activate_ready
(
playerid
,
nil_event
,
neglect_con
,
neglect_cost
,
FALSE
);
return
peffect
->
is_activate_ready
(
playerid
,
nil_event
,
neglect_con
,
neglect_cost
,
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