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
nanahira
ygopro-core
Commits
259732f5
Commit
259732f5
authored
Jun 30, 2020
by
DailyShana
Committed by
GitHub
Jun 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Card.CheckActivateEffect (#325)
parent
dcfb08ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
effect.cpp
effect.cpp
+17
-14
effect.h
effect.h
+1
-0
processor.cpp
processor.cpp
+3
-3
No files found.
effect.cpp
View file @
259732f5
...
...
@@ -352,50 +352,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 @
259732f5
...
...
@@ -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
);
...
...
processor.cpp
View file @
259732f5
...
...
@@ -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