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
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
MyCard
ygopro-core
Commits
11987e9a
Commit
11987e9a
authored
Jun 15, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
86e90c20
aa97d54e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
110 additions
and
8 deletions
+110
-8
card.cpp
card.cpp
+13
-0
field.cpp
field.cpp
+3
-0
field.h
field.h
+3
-0
interpreter.cpp
interpreter.cpp
+2
-0
libcard.cpp
libcard.cpp
+24
-0
libduel.cpp
libduel.cpp
+27
-0
operations.cpp
operations.cpp
+28
-6
processor.cpp
processor.cpp
+8
-2
scriptlib.h
scriptlib.h
+2
-0
No files found.
card.cpp
View file @
11987e9a
...
@@ -2935,6 +2935,16 @@ int32 card::is_spsummonable(effect* peffect) {
...
@@ -2935,6 +2935,16 @@ int32 card::is_spsummonable(effect* peffect) {
}
}
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
param_count
))
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
param_count
))
result
=
TRUE
;
result
=
TRUE
;
}
else
if
(
pduel
->
game_field
->
core
.
limit_link
)
{
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link
,
PARAM_TYPE_GROUP
);
uint32
param_count
=
3
;
if
(
pduel
->
game_field
->
core
.
limit_link_minc
)
{
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link_minc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link_maxc
,
PARAM_TYPE_INT
);
param_count
=
5
;
}
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
param_count
))
result
=
TRUE
;
}
else
{
}
else
{
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
2
))
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
2
))
result
=
TRUE
;
result
=
TRUE
;
...
@@ -3112,6 +3122,9 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
...
@@ -3112,6 +3122,9 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
0
;
pduel
->
game_field
->
core
.
limit_link
=
0
;
pduel
->
game_field
->
core
.
limit_link_minc
=
0
;
pduel
->
game_field
->
core
.
limit_link_maxc
=
0
;
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
eset
.
size
();
return
eset
.
size
();
}
}
...
...
field.cpp
View file @
11987e9a
...
@@ -96,6 +96,9 @@ field::field(duel* pduel) {
...
@@ -96,6 +96,9 @@ field::field(duel* pduel) {
core
.
limit_xyz
=
0
;
core
.
limit_xyz
=
0
;
core
.
limit_xyz_minc
=
0
;
core
.
limit_xyz_minc
=
0
;
core
.
limit_xyz_maxc
=
0
;
core
.
limit_xyz_maxc
=
0
;
core
.
limit_link
=
0
;
core
.
limit_link_minc
=
0
;
core
.
limit_link_maxc
=
0
;
core
.
last_control_changed_id
=
0
;
core
.
last_control_changed_id
=
0
;
core
.
duel_options
=
0
;
core
.
duel_options
=
0
;
core
.
duel_rule
=
0
;
core
.
duel_rule
=
0
;
...
...
field.h
View file @
11987e9a
...
@@ -265,6 +265,9 @@ struct processor {
...
@@ -265,6 +265,9 @@ struct processor {
group
*
limit_xyz
;
group
*
limit_xyz
;
int32
limit_xyz_minc
;
int32
limit_xyz_minc
;
int32
limit_xyz_maxc
;
int32
limit_xyz_maxc
;
group
*
limit_link
;
int32
limit_link_minc
;
int32
limit_link_maxc
;
uint8
attack_cancelable
;
uint8
attack_cancelable
;
uint8
attack_rollback
;
uint8
attack_rollback
;
uint8
effect_damage_step
;
uint8
effect_damage_step
;
...
...
interpreter.cpp
View file @
11987e9a
...
@@ -189,6 +189,7 @@ static const struct luaL_Reg cardlib[] = {
...
@@ -189,6 +189,7 @@ static const struct luaL_Reg cardlib[] = {
{
"IsSpecialSummonable"
,
scriptlib
::
card_is_special_summonable
},
{
"IsSpecialSummonable"
,
scriptlib
::
card_is_special_summonable
},
{
"IsSynchroSummonable"
,
scriptlib
::
card_is_synchro_summonable
},
{
"IsSynchroSummonable"
,
scriptlib
::
card_is_synchro_summonable
},
{
"IsXyzSummonable"
,
scriptlib
::
card_is_xyz_summonable
},
{
"IsXyzSummonable"
,
scriptlib
::
card_is_xyz_summonable
},
{
"IsLinkSummonable"
,
scriptlib
::
card_is_link_summonable
},
{
"IsSummonable"
,
scriptlib
::
card_is_can_be_summoned
},
{
"IsSummonable"
,
scriptlib
::
card_is_can_be_summoned
},
{
"IsMSetable"
,
scriptlib
::
card_is_msetable
},
{
"IsMSetable"
,
scriptlib
::
card_is_msetable
},
{
"IsSSetable"
,
scriptlib
::
card_is_ssetable
},
{
"IsSSetable"
,
scriptlib
::
card_is_ssetable
},
...
@@ -391,6 +392,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -391,6 +392,7 @@ static const struct luaL_Reg duellib[] = {
{
"SpecialSummonRule"
,
scriptlib
::
duel_special_summon_rule
},
{
"SpecialSummonRule"
,
scriptlib
::
duel_special_summon_rule
},
{
"SynchroSummon"
,
scriptlib
::
duel_synchro_summon
},
{
"SynchroSummon"
,
scriptlib
::
duel_synchro_summon
},
{
"XyzSummon"
,
scriptlib
::
duel_xyz_summon
},
{
"XyzSummon"
,
scriptlib
::
duel_xyz_summon
},
{
"LinkSummon"
,
scriptlib
::
duel_link_summon
},
{
"MSet"
,
scriptlib
::
duel_setm
},
{
"MSet"
,
scriptlib
::
duel_setm
},
{
"SSet"
,
scriptlib
::
duel_sets
},
{
"SSet"
,
scriptlib
::
duel_sets
},
{
"CreateToken"
,
scriptlib
::
duel_create_token
},
{
"CreateToken"
,
scriptlib
::
duel_create_token
},
...
...
libcard.cpp
View file @
11987e9a
...
@@ -2035,6 +2035,30 @@ int32 scriptlib::card_is_xyz_summonable(lua_State *L) {
...
@@ -2035,6 +2035,30 @@ int32 scriptlib::card_is_xyz_summonable(lua_State *L) {
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_XYZ
));
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_XYZ
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_link_summonable
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
if
(
!
(
pcard
->
data
.
type
&
TYPE_LINK
))
return
0
;
group
*
materials
=
0
;
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
2
);
materials
=
*
(
group
**
)
lua_touserdata
(
L
,
2
);
}
int32
minc
=
0
;
if
(
lua_gettop
(
L
)
>=
3
)
minc
=
lua_tointeger
(
L
,
3
);
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
4
)
maxc
=
lua_tointeger
(
L
,
4
);
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
pcard
->
pduel
->
game_field
->
core
.
limit_link
=
materials
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_minc
=
minc
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_maxc
=
maxc
;
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_LINK
));
return
1
;
}
int32
scriptlib
::
card_is_can_be_summoned
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_can_be_summoned
(
lua_State
*
L
)
{
check_param_count
(
L
,
3
);
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
...
...
libduel.cpp
View file @
11987e9a
...
@@ -341,6 +341,33 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
...
@@ -341,6 +341,33 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_link_summon
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
uint32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
group
*
materials
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
materials
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
}
int32
minc
=
0
;
if
(
lua_gettop
(
L
)
>=
4
)
minc
=
lua_tointeger
(
L
,
4
);
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
maxc
=
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_link
=
materials
;
pduel
->
game_field
->
core
.
limit_link_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_link_maxc
=
maxc
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_LINK
);
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_setm
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_setm
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_action_permission
(
L
);
check_param_count
(
L
,
4
);
check_param_count
(
L
,
4
);
...
...
operations.cpp
View file @
11987e9a
...
@@ -2508,16 +2508,22 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2508,16 +2508,22 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
effect_set
eset
;
effect_set
eset
;
card
*
tuner
=
core
.
limit_tuner
;
card
*
tuner
=
core
.
limit_tuner
;
group
*
syn
=
core
.
limit_syn
;
group
*
syn
=
core
.
limit_syn
;
group
*
materials
=
core
.
limit_xyz
;
group
*
xmaterials
=
core
.
limit_xyz
;
int32
minc
=
core
.
limit_xyz_minc
;
int32
xminc
=
core
.
limit_xyz_minc
;
int32
maxc
=
core
.
limit_xyz_maxc
;
int32
xmaxc
=
core
.
limit_xyz_maxc
;
group
*
lmaterials
=
core
.
limit_link
;
int32
lminc
=
core
.
limit_link_minc
;
int32
lmaxc
=
core
.
limit_link_maxc
;
target
->
filter_spsummon_procedure
(
sumplayer
,
&
eset
,
summon_type
);
target
->
filter_spsummon_procedure
(
sumplayer
,
&
eset
,
summon_type
);
target
->
filter_spsummon_procedure_g
(
sumplayer
,
&
eset
);
target
->
filter_spsummon_procedure_g
(
sumplayer
,
&
eset
);
core
.
limit_tuner
=
tuner
;
core
.
limit_tuner
=
tuner
;
core
.
limit_syn
=
syn
;
core
.
limit_syn
=
syn
;
core
.
limit_xyz
=
materials
;
core
.
limit_xyz
=
xmaterials
;
core
.
limit_xyz_minc
=
minc
;
core
.
limit_xyz_minc
=
xminc
;
core
.
limit_xyz_maxc
=
maxc
;
core
.
limit_xyz_maxc
=
xmaxc
;
core
.
limit_link
=
lmaterials
;
core
.
limit_link_minc
=
lminc
;
core
.
limit_link_maxc
=
lmaxc
;
if
(
!
eset
.
size
())
if
(
!
eset
.
size
())
return
TRUE
;
return
TRUE
;
core
.
select_effects
.
clear
();
core
.
select_effects
.
clear
();
...
@@ -2551,6 +2557,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2551,6 +2557,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
pduel
->
lua
->
add_param
(
core
.
limit_xyz_minc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
core
.
limit_xyz_minc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
core
.
limit_xyz_maxc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
core
.
limit_xyz_maxc
,
PARAM_TYPE_INT
);
}
}
}
else
if
(
core
.
limit_link
)
{
pduel
->
lua
->
add_param
(
core
.
limit_link
,
PARAM_TYPE_GROUP
);
if
(
core
.
limit_link_minc
)
{
pduel
->
lua
->
add_param
(
core
.
limit_link_minc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
core
.
limit_link_maxc
,
PARAM_TYPE_INT
);
}
}
}
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_TARGET
,
0
,
peffect
,
0
,
sumplayer
,
0
);
add_process
(
PROCESSOR_EXECUTE_TARGET
,
0
,
peffect
,
0
,
sumplayer
,
0
);
...
@@ -2591,6 +2603,16 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2591,6 +2603,16 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
core
.
limit_xyz_maxc
=
0
;
core
.
limit_xyz_maxc
=
0
;
}
}
}
}
if
(
core
.
limit_link
)
{
pduel
->
lua
->
add_param
(
core
.
limit_link
,
PARAM_TYPE_GROUP
);
core
.
limit_link
=
0
;
if
(
core
.
limit_link_minc
)
{
pduel
->
lua
->
add_param
(
core
.
limit_link_minc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
core
.
limit_link_maxc
,
PARAM_TYPE_INT
);
core
.
limit_link_minc
=
0
;
core
.
limit_link_maxc
=
0
;
}
}
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
peffect
,
0
,
sumplayer
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
peffect
,
0
,
sumplayer
,
0
);
}
}
...
...
processor.cpp
View file @
11987e9a
...
@@ -4359,7 +4359,10 @@ int32 field::add_chain(uint16 step) {
...
@@ -4359,7 +4359,10 @@ int32 field::add_chain(uint16 step) {
}
}
}
else
{
}
else
{
uint32
sumplayer
=
clit
.
triggering_player
;
uint32
sumplayer
=
clit
.
triggering_player
;
if
(
optarget
.
op_player
==
1
)
// genarally setting op_player is unnecessary when the effect targets cards
// in the case of CATEGORY_SPECIAL_SUMMON(with EFFECT_FLAG_CARD_TARGET), op_player=1
// indecates that it is the opponent that special summons the target monsters
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CARD_TARGET
)
&&
optarget
.
op_player
==
1
)
sumplayer
=
1
-
sumplayer
;
sumplayer
=
1
-
sumplayer
;
for
(
auto
&
pcard
:
optarget
.
op_cards
->
container
)
{
for
(
auto
&
pcard
:
optarget
.
op_cards
->
container
)
{
if
(
pcard
->
spsummon_code
)
{
if
(
pcard
->
spsummon_code
)
{
...
@@ -4608,7 +4611,10 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4608,7 +4611,10 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
check_card_counter
(
*
opit
,
3
,
1
-
sumplayer
);
check_card_counter
(
*
opit
,
3
,
1
-
sumplayer
);
}
else
{
}
else
{
uint32
sumplayer
=
cait
->
triggering_player
;
uint32
sumplayer
=
cait
->
triggering_player
;
if
(
optarget
.
op_player
==
1
)
// genarally setting op_player is unnecessary when the effect targets cards
// in the case of CATEGORY_SPECIAL_SUMMON(with EFFECT_FLAG_CARD_TARGET), op_player=1
// indecates that it is the opponent that special summons the target monsters
if
(
cait
->
triggering_effect
->
is_flag
(
EFFECT_FLAG_CARD_TARGET
)
&&
optarget
.
op_player
==
1
)
sumplayer
=
1
-
sumplayer
;
sumplayer
=
1
-
sumplayer
;
for
(
auto
&
ptarget
:
optarget
.
op_cards
->
container
)
{
for
(
auto
&
ptarget
:
optarget
.
op_cards
->
container
)
{
if
((
core
.
global_flag
&
GLOBALFLAG_SPSUMMON_ONCE
)
&&
ptarget
->
spsummon_code
)
if
((
core
.
global_flag
&
GLOBALFLAG_SPSUMMON_ONCE
)
&&
ptarget
->
spsummon_code
)
...
...
scriptlib.h
View file @
11987e9a
...
@@ -195,6 +195,7 @@ public:
...
@@ -195,6 +195,7 @@ public:
static
int32
card_is_special_summonable
(
lua_State
*
L
);
static
int32
card_is_special_summonable
(
lua_State
*
L
);
static
int32
card_is_synchro_summonable
(
lua_State
*
L
);
static
int32
card_is_synchro_summonable
(
lua_State
*
L
);
static
int32
card_is_xyz_summonable
(
lua_State
*
L
);
static
int32
card_is_xyz_summonable
(
lua_State
*
L
);
static
int32
card_is_link_summonable
(
lua_State
*
L
);
static
int32
card_is_can_be_summoned
(
lua_State
*
L
);
static
int32
card_is_can_be_summoned
(
lua_State
*
L
);
static
int32
card_is_can_be_special_summoned
(
lua_State
*
L
);
static
int32
card_is_can_be_special_summoned
(
lua_State
*
L
);
static
int32
card_is_able_to_hand
(
lua_State
*
L
);
static
int32
card_is_able_to_hand
(
lua_State
*
L
);
...
@@ -379,6 +380,7 @@ public:
...
@@ -379,6 +380,7 @@ public:
static
int32
duel_special_summon_rule
(
lua_State
*
L
);
static
int32
duel_special_summon_rule
(
lua_State
*
L
);
static
int32
duel_synchro_summon
(
lua_State
*
L
);
static
int32
duel_synchro_summon
(
lua_State
*
L
);
static
int32
duel_xyz_summon
(
lua_State
*
L
);
static
int32
duel_xyz_summon
(
lua_State
*
L
);
static
int32
duel_link_summon
(
lua_State
*
L
);
static
int32
duel_setm
(
lua_State
*
L
);
static
int32
duel_setm
(
lua_State
*
L
);
static
int32
duel_sets
(
lua_State
*
L
);
static
int32
duel_sets
(
lua_State
*
L
);
static
int32
duel_create_token
(
lua_State
*
L
);
static
int32
duel_create_token
(
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