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
6969a86b
Commit
6969a86b
authored
Jul 02, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro-core
parents
e7572c70
fadc016f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
22 deletions
+31
-22
card.cpp
card.cpp
+2
-0
effect.cpp
effect.cpp
+17
-14
effect.h
effect.h
+1
-0
field.cpp
field.cpp
+6
-3
operations.cpp
operations.cpp
+2
-2
processor.cpp
processor.cpp
+3
-3
No files found.
card.cpp
View file @
6969a86b
...
...
@@ -3770,6 +3770,8 @@ int32 card::is_capable_be_battle_target(card* pcard) {
int32
card
::
is_capable_be_effect_target
(
effect
*
reason_effect
,
uint8
playerid
)
{
if
(
is_status
(
STATUS_SUMMONING
)
||
is_status
(
STATUS_BATTLE_DESTROYED
))
return
FALSE
;
if
(
current
.
location
&
(
LOCATION_DECK
|
LOCATION_EXTRA
|
LOCATION_HAND
))
return
FALSE
;
effect_set
eset
;
filter_effect
(
EFFECT_CANNOT_BE_EFFECT_TARGET
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
effect.cpp
View file @
6969a86b
...
...
@@ -355,50 +355,53 @@ int32 effect::is_action_check(uint8 playerid) {
return
TRUE
;
}
// check functions: condition, cost(chk=0), target(chk=0)
int32
effect
::
is_activate_ready
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
)
{
if
(
!
neglect_cond
&&
condition
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
int32
effect
::
is_activate_ready
(
effect
*
reason_effect
,
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
)
{
if
(
!
neglect_cond
&&
condition
)
{
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
event_cards
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
e
.
event_cards
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
e
.
event_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
event_value
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
condition
,
8
))
{
if
(
!
pduel
->
lua
->
check_condition
(
condition
,
8
))
{
return
FALSE
;
}
}
if
(
!
neglect_cost
&&
cost
&&
!
(
type
&
EFFECT_TYPE_CONTINUOUS
))
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
event_cards
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
e
.
event_cards
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
e
.
event_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
event_value
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
((
ptr
)
0
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
cost
,
9
))
{
if
(
!
pduel
->
lua
->
check_condition
(
cost
,
9
))
{
return
FALSE
;
}
}
if
(
!
neglect_target
&&
target
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
event_cards
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
e
.
event_cards
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
e
.
event_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
event_value
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
e
.
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
((
ptr
)
0
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
target
,
9
))
{
if
(
!
pduel
->
lua
->
check_condition
(
target
,
9
))
{
return
FALSE
;
}
}
return
TRUE
;
}
int32
effect
::
is_activate_ready
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
)
{
return
is_activate_ready
(
this
,
playerid
,
e
,
neglect_cond
,
neglect_cost
,
neglect_target
);
}
// check functions: condition
int32
effect
::
is_condition_check
(
uint8
playerid
,
const
tevent
&
e
)
{
card
*
phandler
=
get_handler
();
...
...
effect.h
View file @
6969a86b
...
...
@@ -72,6 +72,7 @@ public:
int32
check_count_limit
(
uint8
playerid
);
int32
is_activateable
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
,
int32
neglect_loc
=
FALSE
,
int32
neglect_faceup
=
FALSE
);
int32
is_action_check
(
uint8
playerid
);
int32
is_activate_ready
(
effect
*
reason_effect
,
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
);
int32
is_activate_ready
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
=
FALSE
,
int32
neglect_cost
=
FALSE
,
int32
neglect_target
=
FALSE
);
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
);
...
...
field.cpp
View file @
6969a86b
...
...
@@ -1827,10 +1827,13 @@ int32 field::get_summon_count_limit(uint8 playerid) {
}
int32
field
::
get_draw_count
(
uint8
playerid
)
{
effect_set
eset
;
filter_player_effect
(
infos
.
turn_player
,
EFFECT_DRAW_COUNT
,
&
eset
);
filter_player_effect
(
playerid
,
EFFECT_DRAW_COUNT
,
&
eset
);
int32
count
=
player
[
playerid
].
draw_count
;
if
(
eset
.
size
())
count
=
eset
.
get_last
()
->
get_value
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
int32
c
=
eset
[
i
]
->
get_value
();
if
(
c
>
count
)
count
=
c
;
}
return
count
;
}
void
field
::
get_ritual_material
(
uint8
playerid
,
effect
*
peffect
,
card_set
*
material
)
{
...
...
operations.cpp
View file @
6969a86b
...
...
@@ -1888,7 +1888,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
if
(
is_player_affected_by_effect
(
sumplayer
,
EFFECT_DEVINE_LIGHT
))
positions
=
POS_FACEUP
;
if
(
proc
&&
proc
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
positions
=
(
uint8
)
proc
->
s_range
;
positions
=
(
uint8
)
proc
->
s_range
&
POS_FACEUP
;
if
(
proc
->
o_range
)
targetplayer
=
1
-
sumplayer
;
}
...
...
@@ -2367,7 +2367,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
uint8
targetplayer
=
setplayer
;
uint8
positions
=
POS_FACEDOWN_DEFENSE
;
if
(
proc
&&
proc
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
positions
=
(
uint8
)
proc
->
s_range
;
positions
=
(
uint8
)
proc
->
s_range
&
POS_FACEDOWN
;
if
(
proc
->
o_range
)
targetplayer
=
1
-
setplayer
;
}
...
...
processor.cpp
View file @
6969a86b
...
...
@@ -957,11 +957,11 @@ int32 field::check_event(uint32 code, 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
)
{
return
peffect
->
is_activate_ready
(
playerid
,
nil_event
,
neglect_con
,
neglect_cost
,
FALSE
);
return
peffect
->
is_activate_ready
(
core
.
reason_effect
,
playerid
,
nil_event
,
neglect_con
,
neglect_cost
,
FALSE
);
}
for
(
const
auto
&
ev
:
core
.
point_event
)
{
if
(
ev
.
event_code
==
peffect
->
code
&&
peffect
->
is_activate_ready
(
playerid
,
ev
,
neglect_con
,
neglect_cost
,
FALSE
))
{
peffect
->
is_activate_ready
(
core
.
reason_effect
,
playerid
,
ev
,
neglect_con
,
neglect_cost
,
FALSE
))
{
if
(
pe
)
*
pe
=
ev
;
if
(
copy_info
&&
!
pduel
->
lua
->
no_action
&&
core
.
current_chain
.
size
())
{
...
...
@@ -972,7 +972,7 @@ int32 field::check_event_c(effect* peffect, uint8 playerid, int32 neglect_con, i
}
for
(
const
auto
&
ev
:
core
.
instant_event
)
{
if
(
ev
.
event_code
==
peffect
->
code
&&
peffect
->
is_activate_ready
(
playerid
,
ev
,
neglect_con
,
neglect_cost
,
FALSE
))
{
peffect
->
is_activate_ready
(
core
.
reason_effect
,
playerid
,
ev
,
neglect_con
,
neglect_cost
,
FALSE
))
{
if
(
pe
)
*
pe
=
ev
;
if
(
copy_info
&&
!
pduel
->
lua
->
no_action
&&
core
.
current_chain
.
size
())
{
...
...
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