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
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
xiaoye
ygopro-core
Commits
2dff74ed
You need to sign in or sign up before continuing.
Commit
2dff74ed
authored
Nov 28, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
745ef5f6
a82085b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
56 deletions
+58
-56
effect.cpp
effect.cpp
+3
-0
effect.h
effect.h
+1
-0
field.cpp
field.cpp
+54
-56
No files found.
effect.cpp
View file @
2dff74ed
...
@@ -454,6 +454,9 @@ int32 effect::is_target(card* pcard) {
...
@@ -454,6 +454,9 @@ int32 effect::is_target(card* pcard) {
}
}
}
}
}
}
return
is_fit_target_function
(
pcard
);
}
int32
effect
::
is_fit_target_function
(
card
*
pcard
)
{
if
(
target
)
{
if
(
target
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
...
...
effect.h
View file @
2dff74ed
...
@@ -75,6 +75,7 @@ public:
...
@@ -75,6 +75,7 @@ public:
int32
is_condition_check
(
uint8
playerid
,
const
tevent
&
e
);
int32
is_condition_check
(
uint8
playerid
,
const
tevent
&
e
);
int32
is_activate_check
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
);
int32
is_activate_check
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
);
int32
is_target
(
card
*
pcard
);
int32
is_target
(
card
*
pcard
);
int32
is_fit_target_function
(
card
*
pcard
);
int32
is_target_player
(
uint8
playerid
);
int32
is_target_player
(
uint8
playerid
);
int32
is_player_effect_target
(
card
*
pcard
);
int32
is_player_effect_target
(
card
*
pcard
);
int32
is_immuned
(
card
*
pcard
);
int32
is_immuned
(
card
*
pcard
);
...
...
field.cpp
View file @
2dff74ed
...
@@ -1210,9 +1210,38 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
...
@@ -1210,9 +1210,38 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
}
}
// put all cards in the target of peffect into cset
// put all cards in the target of peffect into cset
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
))
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
)
)
return
;
return
;
filter_inrange_cards
(
peffect
,
cset
);
uint8
self
=
peffect
->
get_handler_player
();
if
(
self
==
PLAYER_NONE
)
return
;
std
::
vector
<
card_vector
*>
cvec
;
uint16
range
=
peffect
->
s_range
;
for
(
uint32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
range
&
LOCATION_MZONE
)
cvec
.
push_back
(
&
player
[
self
].
list_mzone
);
if
(
range
&
LOCATION_SZONE
)
cvec
.
push_back
(
&
player
[
self
].
list_szone
);
if
(
range
&
LOCATION_GRAVE
)
cvec
.
push_back
(
&
player
[
self
].
list_grave
);
if
(
range
&
LOCATION_REMOVED
)
cvec
.
push_back
(
&
player
[
self
].
list_remove
);
if
(
range
&
LOCATION_HAND
)
cvec
.
push_back
(
&
player
[
self
].
list_hand
);
if
(
range
&
LOCATION_DECK
)
cvec
.
push_back
(
&
player
[
self
].
list_main
);
if
(
range
&
LOCATION_EXTRA
)
cvec
.
push_back
(
&
player
[
self
].
list_extra
);
range
=
peffect
->
o_range
;
self
=
1
-
self
;
}
for
(
auto
cvit
=
cvec
.
begin
();
cvit
!=
cvec
.
end
();
++
cvit
)
{
for
(
auto
it
=
(
*
cvit
)
->
begin
();
it
!=
(
*
cvit
)
->
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
pcard
&&
peffect
->
is_target
(
pcard
))
cset
->
insert
(
pcard
);
}
}
}
}
void
field
::
filter_inrange_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
))
...
@@ -1221,59 +1250,32 @@ void field::filter_inrange_cards(effect* peffect, card_set* cset) {
...
@@ -1221,59 +1250,32 @@ void field::filter_inrange_cards(effect* peffect, card_set* cset) {
if
(
self
==
PLAYER_NONE
)
if
(
self
==
PLAYER_NONE
)
return
;
return
;
uint16
range
=
peffect
->
s_range
;
uint16
range
=
peffect
->
s_range
;
std
::
vector
<
card_vector
*>
cvec
;
for
(
uint32
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint32
p
=
0
;
p
<
2
;
++
p
)
{
if
(
range
&
LOCATION_MZONE
)
{
if
(
range
&
LOCATION_MZONE
)
for
(
auto
it
=
player
[
self
].
list_mzone
.
begin
();
it
!=
player
[
self
].
list_mzone
.
end
();
++
it
)
{
cvec
.
push_back
(
&
player
[
self
].
list_mzone
);
card
*
pcard
=
*
it
;
if
(
range
&
LOCATION_SZONE
)
if
(
pcard
&&
peffect
->
is_target
(
pcard
))
cvec
.
push_back
(
&
player
[
self
].
list_szone
);
cset
->
insert
(
pcard
);
if
(
range
&
LOCATION_GRAVE
)
}
cvec
.
push_back
(
&
player
[
self
].
list_grave
);
}
if
(
range
&
LOCATION_REMOVED
)
if
(
range
&
LOCATION_SZONE
)
{
cvec
.
push_back
(
&
player
[
self
].
list_remove
);
for
(
auto
it
=
player
[
self
].
list_szone
.
begin
();
it
!=
player
[
self
].
list_szone
.
end
();
++
it
)
{
if
(
range
&
LOCATION_HAND
)
card
*
pcard
=
*
it
;
cvec
.
push_back
(
&
player
[
self
].
list_hand
);
if
(
pcard
&&
peffect
->
is_target
(
pcard
))
if
(
range
&
LOCATION_DECK
)
cset
->
insert
(
pcard
);
cvec
.
push_back
(
&
player
[
self
].
list_main
);
}
if
(
range
&
LOCATION_EXTRA
)
}
cvec
.
push_back
(
&
player
[
self
].
list_extra
);
if
(
range
&
LOCATION_GRAVE
)
{
for
(
auto
it
=
player
[
self
].
list_grave
.
begin
();
it
!=
player
[
self
].
list_grave
.
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
peffect
->
is_target
(
pcard
))
cset
->
insert
(
pcard
);
}
}
if
(
range
&
LOCATION_REMOVED
)
{
for
(
auto
it
=
player
[
self
].
list_remove
.
begin
();
it
!=
player
[
self
].
list_remove
.
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
peffect
->
is_target
(
pcard
))
cset
->
insert
(
pcard
);
}
}
if
(
range
&
LOCATION_HAND
)
{
for
(
auto
it
=
player
[
self
].
list_hand
.
begin
();
it
!=
player
[
self
].
list_hand
.
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
peffect
->
is_target
(
pcard
))
cset
->
insert
(
pcard
);
}
}
if
(
range
&
LOCATION_DECK
)
{
for
(
auto
it
=
player
[
self
].
list_main
.
begin
();
it
!=
player
[
self
].
list_main
.
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
peffect
->
is_target
(
pcard
))
cset
->
insert
(
pcard
);
}
}
if
(
range
&
LOCATION_EXTRA
)
{
for
(
auto
it
=
player
[
self
].
list_extra
.
begin
();
it
!=
player
[
self
].
list_extra
.
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
peffect
->
is_target
(
pcard
))
cset
->
insert
(
pcard
);
}
}
range
=
peffect
->
o_range
;
range
=
peffect
->
o_range
;
self
=
1
-
self
;
self
=
1
-
self
;
}
}
for
(
auto
cvit
=
cvec
.
begin
();
cvit
!=
cvec
.
end
();
++
cvit
)
{
for
(
auto
it
=
(
*
cvit
)
->
begin
();
it
!=
(
*
cvit
)
->
end
();
++
it
)
{
card
*
pcard
=
*
it
;
if
(
pcard
&&
peffect
->
is_fit_target_function
(
pcard
))
cset
->
insert
(
pcard
);
}
}
}
}
void
field
::
filter_player_effect
(
uint8
playerid
,
uint32
code
,
effect_set
*
eset
,
uint8
sort
)
{
void
field
::
filter_player_effect
(
uint8
playerid
,
uint32
code
,
effect_set
*
eset
,
uint8
sort
)
{
auto
rg
=
effects
.
aura_effect
.
equal_range
(
code
);
auto
rg
=
effects
.
aura_effect
.
equal_range
(
code
);
...
@@ -3340,15 +3342,11 @@ int32 field::get_cteffect(effect* peffect, int32 playerid, int32 store) {
...
@@ -3340,15 +3342,11 @@ int32 field::get_cteffect(effect* peffect, int32 playerid, int32 store) {
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
core
.
select_options
.
clear
();
core
.
select_options
.
clear
();
}
}
const
bool
damage_step
=
infos
.
phase
==
PHASE_DAMAGE
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_DAMAGE_STEP
);
const
bool
damage_cal
=
infos
.
phase
==
PHASE_DAMAGE_CAL
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_DAMAGE_CAL
);
for
(
auto
efit
=
phandler
->
field_effect
.
begin
();
efit
!=
phandler
->
field_effect
.
end
();
++
efit
)
{
for
(
auto
efit
=
phandler
->
field_effect
.
begin
();
efit
!=
phandler
->
field_effect
.
end
();
++
efit
)
{
effect
*
feffect
=
efit
->
second
;
effect
*
feffect
=
efit
->
second
;
if
(
!
(
feffect
->
type
&
(
EFFECT_TYPE_TRIGGER_F
|
EFFECT_TYPE_TRIGGER_O
|
EFFECT_TYPE_QUICK_O
)))
if
(
!
(
feffect
->
type
&
(
EFFECT_TYPE_TRIGGER_F
|
EFFECT_TYPE_TRIGGER_O
|
EFFECT_TYPE_QUICK_O
)))
continue
;
continue
;
if
(
damage_step
&&
!
feffect
->
is_flag
(
EFFECT_FLAG_DAMAGE_STEP
))
if
(
!
feffect
->
in_range
(
phandler
))
continue
;
if
(
damage_cal
&&
!
feffect
->
is_flag
(
EFFECT_FLAG_DAMAGE_CAL
))
continue
;
continue
;
uint32
code
=
efit
->
first
;
uint32
code
=
efit
->
first
;
if
(
code
==
EVENT_FREE_CHAIN
||
code
==
EVENT_PHASE
+
infos
.
phase
)
{
if
(
code
==
EVENT_FREE_CHAIN
||
code
==
EVENT_PHASE
+
infos
.
phase
)
{
...
...
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