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
ff51e934
Commit
ff51e934
authored
Jun 30, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
ce89e6b1
2044525c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
150 additions
and
52 deletions
+150
-52
card.cpp
card.cpp
+2
-11
effect.h
effect.h
+1
-0
field.h
field.h
+4
-2
libduel.cpp
libduel.cpp
+18
-8
operations.cpp
operations.cpp
+122
-29
processor.cpp
processor.cpp
+3
-2
No files found.
card.cpp
View file @
ff51e934
...
@@ -3112,6 +3112,8 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
...
@@ -3112,6 +3112,8 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
return
eset
.
size
();
return
eset
.
size
();
}
}
int32
card
::
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
)
{
int32
card
::
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
)
{
if
(
reason_effect
->
get_handler
()
==
this
)
reason_effect
->
status
|=
EFFECT_STATUS_SPSELF
;
if
(
current
.
location
==
LOCATION_MZONE
)
if
(
current
.
location
==
LOCATION_MZONE
)
return
FALSE
;
return
FALSE
;
if
(
current
.
location
==
LOCATION_REMOVED
&&
(
current
.
position
&
POS_FACEDOWN
))
if
(
current
.
location
==
LOCATION_REMOVED
&&
(
current
.
position
&
POS_FACEDOWN
))
...
@@ -3361,17 +3363,6 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
...
@@ -3361,17 +3363,6 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
int32
card
::
is_releasable_by_effect
(
uint8
playerid
,
effect
*
peffect
)
{
int32
card
::
is_releasable_by_effect
(
uint8
playerid
,
effect
*
peffect
)
{
if
(
!
peffect
)
if
(
!
peffect
)
return
TRUE
;
return
TRUE
;
if
(
current
.
controler
!=
playerid
&&
!
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
effect_set
eset
;
filter_effect
(
EFFECT_EXTRA_RELEASE_NONSUM
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
eset
[
i
]
->
check_value_condition
(
3
))
return
FALSE
;
}
}
effect_set
eset
;
effect_set
eset
;
filter_effect
(
EFFECT_UNRELEASABLE_EFFECT
,
&
eset
);
filter_effect
(
EFFECT_UNRELEASABLE_EFFECT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
effect.h
View file @
ff51e934
...
@@ -111,6 +111,7 @@ public:
...
@@ -111,6 +111,7 @@ public:
//status
//status
#define EFFECT_STATUS_AVAILABLE 0x0001
#define EFFECT_STATUS_AVAILABLE 0x0001
//#define EFFECT_STATUS_ACTIVATED 0x0002
//#define EFFECT_STATUS_ACTIVATED 0x0002
#define EFFECT_STATUS_SPSELF 0x0004
#define EFFECT_COUNT_CODE_OATH 0x10000000
#define EFFECT_COUNT_CODE_OATH 0x10000000
#define EFFECT_COUNT_CODE_DUEL 0x20000000
#define EFFECT_COUNT_CODE_DUEL 0x20000000
...
...
field.h
View file @
ff51e934
...
@@ -227,7 +227,7 @@ struct processor {
...
@@ -227,7 +227,7 @@ struct processor {
card_set
discarded_set
;
card_set
discarded_set
;
card_set
destroy_canceled
;
card_set
destroy_canceled
;
card_set
delayed_enable_set
;
card_set
delayed_enable_set
;
card_set
tem
p_set
;
card_set
set_grou
p_set
;
effect_set_v
disfield_effects
;
effect_set_v
disfield_effects
;
effect_set_v
extram_effects
;
effect_set_v
extram_effects
;
effect_set_v
extras_effects
;
effect_set_v
extras_effects
;
...
@@ -278,6 +278,8 @@ struct processor {
...
@@ -278,6 +278,8 @@ struct processor {
uint32
copy_reset
;
uint32
copy_reset
;
uint8
copy_reset_count
;
uint8
copy_reset_count
;
uint32
last_control_changed_id
;
uint32
last_control_changed_id
;
uint32
set_group_used_zones
;
uint8
set_group_seq
[
7
];
uint8
dice_result
[
5
];
uint8
dice_result
[
5
];
uint8
coin_result
[
5
];
uint8
coin_result
[
5
];
uint8
to_bp
;
uint8
to_bp
;
...
@@ -554,7 +556,7 @@ public:
...
@@ -554,7 +556,7 @@ public:
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
);
int32
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
);
int32
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
,
uint8
confirm
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
...
...
libduel.cpp
View file @
ff51e934
...
@@ -377,6 +377,9 @@ int32 scriptlib::duel_sets(lua_State *L) {
...
@@ -377,6 +377,9 @@ int32 scriptlib::duel_sets(lua_State *L) {
toplayer
=
lua_tointeger
(
L
,
3
);
toplayer
=
lua_tointeger
(
L
,
3
);
if
(
toplayer
!=
0
&&
toplayer
!=
1
)
if
(
toplayer
!=
0
&&
toplayer
!=
1
)
toplayer
=
playerid
;
toplayer
=
playerid
;
uint32
confirm
=
TRUE
;
if
(
lua_gettop
(
L
)
>
3
)
confirm
=
lua_toboolean
(
L
,
4
);
card
*
pcard
=
0
;
card
*
pcard
=
0
;
group
*
pgroup
=
0
;
group
*
pgroup
=
0
;
duel
*
pduel
=
0
;
duel
*
pduel
=
0
;
...
@@ -385,13 +388,20 @@ int32 scriptlib::duel_sets(lua_State *L) {
...
@@ -385,13 +388,20 @@ int32 scriptlib::duel_sets(lua_State *L) {
pduel
=
pcard
->
pduel
;
pduel
=
pcard
->
pduel
;
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
2
,
TRUE
))
{
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
2
,
TRUE
))
{
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
2
);
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
2
);
pduel
=
pgroup
->
pduel
;
if
(
pgroup
->
container
.
empty
())
{
return
0
;
}
else
if
(
pgroup
->
container
.
size
()
==
1
)
{
pcard
=
*
pgroup
->
container
.
begin
();
pduel
=
pcard
->
pduel
;
}
else
{
pduel
=
pgroup
->
pduel
;
}
}
else
}
else
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
2
);
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
2
);
if
(
pcard
)
if
(
pcard
)
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET
,
0
,
0
,
(
group
*
)
pcard
,
playerid
,
toplayer
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET
,
0
,
0
,
(
group
*
)
pcard
,
playerid
,
toplayer
);
else
else
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET_G
,
0
,
0
,
pgroup
,
playerid
,
toplayer
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET_G
,
0
,
0
,
pgroup
,
playerid
,
toplayer
,
confirm
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_create_token
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_create_token
(
lua_State
*
L
)
{
...
@@ -435,9 +445,9 @@ int32 scriptlib::duel_special_summon(lua_State *L) {
...
@@ -435,9 +445,9 @@ int32 scriptlib::duel_special_summon(lua_State *L) {
if
(
lua_gettop
(
L
)
>=
8
)
if
(
lua_gettop
(
L
)
>=
8
)
zone
=
lua_tointeger
(
L
,
8
);
zone
=
lua_tointeger
(
L
,
8
);
if
(
pcard
)
{
if
(
pcard
)
{
pduel
->
game_field
->
core
.
temp_set
.
clear
()
;
field
::
card_set
cset
;
pduel
->
game_field
->
core
.
temp_
set
.
insert
(
pcard
);
c
set
.
insert
(
pcard
);
pduel
->
game_field
->
special_summon
(
&
pduel
->
game_field
->
core
.
temp_
set
,
sumtype
,
sumplayer
,
playerid
,
nocheck
,
nolimit
,
positions
,
zone
);
pduel
->
game_field
->
special_summon
(
&
c
set
,
sumtype
,
sumplayer
,
playerid
,
nocheck
,
nolimit
,
positions
,
zone
);
}
else
}
else
pduel
->
game_field
->
special_summon
(
&
(
pgroup
->
container
),
sumtype
,
sumplayer
,
playerid
,
nocheck
,
nolimit
,
positions
,
zone
);
pduel
->
game_field
->
special_summon
(
&
(
pgroup
->
container
),
sumtype
,
sumplayer
,
playerid
,
nocheck
,
nolimit
,
positions
,
zone
);
pduel
->
game_field
->
core
.
subunits
.
back
().
type
=
PROCESSOR_SPSUMMON_S
;
pduel
->
game_field
->
core
.
subunits
.
back
().
type
=
PROCESSOR_SPSUMMON_S
;
...
@@ -629,9 +639,9 @@ int32 scriptlib::duel_change_form(lua_State *L) {
...
@@ -629,9 +639,9 @@ int32 scriptlib::duel_change_form(lua_State *L) {
if
(
top
>
5
&&
lua_toboolean
(
L
,
6
))
flag
|=
NO_FLIP_EFFECT
;
if
(
top
>
5
&&
lua_toboolean
(
L
,
6
))
flag
|=
NO_FLIP_EFFECT
;
if
(
top
>
6
&&
lua_toboolean
(
L
,
7
))
flag
|=
FLIP_SET_AVAILABLE
;
if
(
top
>
6
&&
lua_toboolean
(
L
,
7
))
flag
|=
FLIP_SET_AVAILABLE
;
if
(
pcard
)
{
if
(
pcard
)
{
pduel
->
game_field
->
core
.
temp_set
.
clear
()
;
field
::
card_set
cset
;
pduel
->
game_field
->
core
.
temp_
set
.
insert
(
pcard
);
c
set
.
insert
(
pcard
);
pduel
->
game_field
->
change_position
(
&
pduel
->
game_field
->
core
.
temp_
set
,
pduel
->
game_field
->
core
.
reason_effect
,
pduel
->
game_field
->
core
.
reason_player
,
au
,
ad
,
du
,
dd
,
flag
,
TRUE
);
pduel
->
game_field
->
change_position
(
&
c
set
,
pduel
->
game_field
->
core
.
reason_effect
,
pduel
->
game_field
->
core
.
reason_player
,
au
,
ad
,
du
,
dd
,
flag
,
TRUE
);
}
else
}
else
pduel
->
game_field
->
change_position
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
pduel
->
game_field
->
core
.
reason_player
,
au
,
ad
,
du
,
dd
,
flag
,
TRUE
);
pduel
->
game_field
->
change_position
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
pduel
->
game_field
->
core
.
reason_player
,
au
,
ad
,
du
,
dd
,
flag
,
TRUE
);
pduel
->
game_field
->
core
.
subunits
.
back
().
type
=
PROCESSOR_CHANGEPOS_S
;
pduel
->
game_field
->
core
.
subunits
.
back
().
type
=
PROCESSOR_CHANGEPOS_S
;
...
...
operations.cpp
View file @
ff51e934
This diff is collapsed.
Click to expand it.
processor.cpp
View file @
ff51e934
...
@@ -417,7 +417,7 @@ int32 field::process() {
...
@@ -417,7 +417,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SSET_G
:
{
case
PROCESSOR_SSET_G
:
{
if
(
sset_g
(
it
->
step
,
it
->
arg1
,
it
->
arg2
,
it
->
ptarget
))
{
if
(
sset_g
(
it
->
step
,
it
->
arg1
,
it
->
arg2
,
it
->
ptarget
,
it
->
arg3
))
{
pduel
->
lua
->
add_param
(
returns
.
ivalue
[
0
],
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
returns
.
ivalue
[
0
],
PARAM_TYPE_INT
);
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
}
else
}
else
...
@@ -2106,7 +2106,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -2106,7 +2106,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
clit
->
evt
,
TRUE
))
{
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
clit
->
evt
,
TRUE
))
{
for
(
auto
cait
=
core
.
current_chain
.
begin
();
cait
!=
core
.
current_chain
.
end
();
++
cait
)
{
for
(
auto
cait
=
core
.
current_chain
.
begin
();
cait
!=
core
.
current_chain
.
end
();
++
cait
)
{
if
(
cait
->
triggering_player
==
priority
)
{
if
(
cait
->
triggering_player
==
priority
)
{
if
(
std
::
any_of
(
core
.
new_ochain_h
.
begin
(),
core
.
new_ochain_h
.
end
(),
[
=
](
chain
ch
)
{
return
ch
.
chain_id
==
cait
->
chain_id
;
}))
{
if
((
peffect
->
status
&
EFFECT_STATUS_SPSELF
)
&&
(
cait
->
triggering_effect
->
status
&
EFFECT_STATUS_SPSELF
)
&&
std
::
any_of
(
core
.
new_ochain_h
.
begin
(),
core
.
new_ochain_h
.
end
(),
[
=
](
chain
ch
)
{
return
ch
.
chain_id
==
cait
->
chain_id
;
}))
{
act
=
false
;
act
=
false
;
break
;
break
;
}
}
...
...
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