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
1c7549e8
Commit
1c7549e8
authored
Sep 28, 2022
by
Chrono-Genex
Committed by
GitHub
Sep 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix & update Effect.IsCostChecked (#460)
parent
0eec9ae4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
effect.cpp
effect.cpp
+6
-4
libeffect.cpp
libeffect.cpp
+9
-0
processor.cpp
processor.cpp
+2
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
effect.cpp
View file @
1c7549e8
...
@@ -412,7 +412,7 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
...
@@ -412,7 +412,7 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
}
}
}
}
if
(
!
neglect_cost
&&
!
(
type
&
EFFECT_TYPE_CONTINUOUS
))
{
if
(
!
neglect_cost
&&
!
(
type
&
EFFECT_TYPE_CONTINUOUS
))
{
cost_checked
=
TRUE
;
reason_effect
->
cost_checked
=
TRUE
;
if
(
cost
)
{
if
(
cost
)
{
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
...
@@ -424,10 +424,12 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
...
@@ -424,10 +424,12 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
((
ptr
)
0
,
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
))
{
cost_checked
=
FALSE
;
reason_effect
->
cost_checked
=
FALSE
;
return
FALSE
;
return
FALSE
;
}
}
}
}
}
else
{
reason_effect
->
cost_checked
=
FALSE
;
}
}
if
(
!
neglect_target
&&
target
)
{
if
(
!
neglect_target
&&
target
)
{
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_effect
,
PARAM_TYPE_EFFECT
);
...
@@ -440,11 +442,11 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
...
@@ -440,11 +442,11 @@ int32 effect::is_activate_ready(effect* reason_effect, uint8 playerid, const tev
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
e
.
reason_player
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
((
ptr
)
0
,
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
))
{
cost_checked
=
FALSE
;
reason_effect
->
cost_checked
=
FALSE
;
return
FALSE
;
return
FALSE
;
}
}
}
}
cost_checked
=
FALSE
;
reason_effect
->
cost_checked
=
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
int32
effect
::
is_activate_ready
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
)
{
int32
effect
::
is_activate_ready
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
)
{
...
...
libeffect.cpp
View file @
1c7549e8
...
@@ -526,6 +526,14 @@ int32 scriptlib::effect_is_cost_checked(lua_State *L) {
...
@@ -526,6 +526,14 @@ int32 scriptlib::effect_is_cost_checked(lua_State *L) {
lua_pushboolean
(
L
,
peffect
->
cost_checked
);
lua_pushboolean
(
L
,
peffect
->
cost_checked
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
effect_set_cost_check
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint8
cost_check
=
lua_toboolean
(
L
,
2
);
peffect
->
cost_checked
=
cost_check
;
return
0
;
}
int32
scriptlib
::
effect_get_activate_location
(
lua_State
*
L
)
{
int32
scriptlib
::
effect_get_activate_location
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
...
@@ -618,6 +626,7 @@ static const struct luaL_Reg effectlib[] = {
...
@@ -618,6 +626,7 @@ static const struct luaL_Reg effectlib[] = {
{
"IsActivatable"
,
scriptlib
::
effect_is_activatable
},
{
"IsActivatable"
,
scriptlib
::
effect_is_activatable
},
{
"IsActivated"
,
scriptlib
::
effect_is_activated
},
{
"IsActivated"
,
scriptlib
::
effect_is_activated
},
{
"IsCostChecked"
,
scriptlib
::
effect_is_cost_checked
},
{
"IsCostChecked"
,
scriptlib
::
effect_is_cost_checked
},
{
"SetCostCheck"
,
scriptlib
::
effect_set_cost_check
},
{
"GetActivateLocation"
,
scriptlib
::
effect_get_activate_location
},
{
"GetActivateLocation"
,
scriptlib
::
effect_get_activate_location
},
{
"GetActivateSequence"
,
scriptlib
::
effect_get_activate_sequence
},
{
"GetActivateSequence"
,
scriptlib
::
effect_get_activate_sequence
},
{
"CheckCountLimit"
,
scriptlib
::
effect_check_count_limit
},
{
"CheckCountLimit"
,
scriptlib
::
effect_check_count_limit
},
...
...
processor.cpp
View file @
1c7549e8
...
@@ -4147,6 +4147,7 @@ int32 field::add_chain(uint16 step) {
...
@@ -4147,6 +4147,7 @@ int32 field::add_chain(uint16 step) {
case
5
:
{
case
5
:
{
auto
&
clit
=
core
.
current_chain
.
back
();
auto
&
clit
=
core
.
current_chain
.
back
();
effect
*
peffect
=
clit
.
triggering_effect
;
effect
*
peffect
=
clit
.
triggering_effect
;
peffect
->
cost_checked
=
TRUE
;
if
(
peffect
->
cost
)
{
if
(
peffect
->
cost
)
{
core
.
sub_solving_event
.
push_back
(
clit
.
evt
);
core
.
sub_solving_event
.
push_back
(
clit
.
evt
);
add_process
(
PROCESSOR_EXECUTE_COST
,
0
,
peffect
,
0
,
clit
.
triggering_player
,
0
);
add_process
(
PROCESSOR_EXECUTE_COST
,
0
,
peffect
,
0
,
clit
.
triggering_player
,
0
);
...
@@ -4166,6 +4167,7 @@ int32 field::add_chain(uint16 step) {
...
@@ -4166,6 +4167,7 @@ int32 field::add_chain(uint16 step) {
break_effect
();
break_effect
();
auto
&
clit
=
core
.
current_chain
.
back
();
auto
&
clit
=
core
.
current_chain
.
back
();
effect
*
peffect
=
clit
.
triggering_effect
;
effect
*
peffect
=
clit
.
triggering_effect
;
peffect
->
cost_checked
=
FALSE
;
card
*
phandler
=
peffect
->
get_handler
();
card
*
phandler
=
peffect
->
get_handler
();
if
(
clit
.
target_cards
&&
clit
.
target_cards
->
container
.
size
())
{
if
(
clit
.
target_cards
&&
clit
.
target_cards
->
container
.
size
())
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CARD_TARGET
))
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CARD_TARGET
))
{
...
...
scriptlib.h
View file @
1c7549e8
...
@@ -333,6 +333,7 @@ public:
...
@@ -333,6 +333,7 @@ public:
static
int32
effect_is_activatable
(
lua_State
*
L
);
static
int32
effect_is_activatable
(
lua_State
*
L
);
static
int32
effect_is_activated
(
lua_State
*
L
);
static
int32
effect_is_activated
(
lua_State
*
L
);
static
int32
effect_is_cost_checked
(
lua_State
*
L
);
static
int32
effect_is_cost_checked
(
lua_State
*
L
);
static
int32
effect_set_cost_check
(
lua_State
*
L
);
static
int32
effect_get_activate_location
(
lua_State
*
L
);
static
int32
effect_get_activate_location
(
lua_State
*
L
);
static
int32
effect_get_activate_sequence
(
lua_State
*
L
);
static
int32
effect_get_activate_sequence
(
lua_State
*
L
);
static
int32
effect_check_count_limit
(
lua_State
*
L
);
static
int32
effect_check_count_limit
(
lua_State
*
L
);
...
...
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