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
b585a1dc
Commit
b585a1dc
authored
Jun 03, 2021
by
mercury233
Committed by
GitHub
Jun 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix core.reason_effect for check_cost_condition (#381)
parent
83229e8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
card.cpp
card.cpp
+28
-8
No files found.
card.cpp
View file @
b585a1dc
...
...
@@ -2943,28 +2943,48 @@ int32 card::check_cost_condition(int32 ecode, int32 playerid) {
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
ecode
,
&
eset
,
FALSE
);
filter_effect
(
ecode
,
&
eset
);
int32
res
=
TRUE
;
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
effect
*
peffect
=
eset
[
i
];
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
pduel
->
game_field
->
core
.
reason_player
=
playerid
;
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
return FALSE;
if
(
!
pduel
->
lua
->
check_condition
(
peffect
->
cost
,
3
))
{
res
=
FALSE
;
break
;
}
return TRUE;
}
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
pduel
->
game_field
->
core
.
reason_player
=
op
;
return
res
;
}
int32
card
::
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
)
{
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
ecode
,
&
eset
,
FALSE
);
filter_effect
(
ecode
,
&
eset
);
int32
res
=
TRUE
;
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
effect
*
peffect
=
eset
[
i
];
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
pduel
->
game_field
->
core
.
reason_player
=
playerid
;
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
if(!pduel->lua->check_condition(eset[i]->cost, 4))
return FALSE;
if
(
!
pduel
->
lua
->
check_condition
(
peffect
->
cost
,
4
))
{
res
=
FALSE
;
break
;
}
return TRUE;
}
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
pduel
->
game_field
->
core
.
reason_player
=
op
;
return
res
;
}
int32
card
::
is_summonable_card
()
{
if
(
!
(
data
.
type
&
TYPE_MONSTER
))
...
...
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