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
xiaoye
ygopro-core
Commits
d5aace84
Commit
d5aace84
authored
May 13, 2020
by
DailyShana
Committed by
GitHub
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update summon proc in effect (#311)
parent
1ebab3c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
38 deletions
+51
-38
libduel.cpp
libduel.cpp
+45
-15
operations.cpp
operations.cpp
+2
-23
processor.cpp
processor.cpp
+4
-0
No files found.
libduel.cpp
View file @
d5aace84
...
...
@@ -260,25 +260,30 @@ int32 scriptlib::duel_summon(lua_State *L) {
check_action_permission
(
L
);
check_param_count
(
L
,
4
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
min_tribute
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
min_tribute
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
zone
=
0x1f
;
if
(
lua_gettop
(
L
)
>=
6
)
zone
=
(
uint32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_special_summon_rule
(
lua_State
*
L
)
{
...
...
@@ -290,11 +295,16 @@ int32 scriptlib::duel_special_summon_rule(lua_State *L) {
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
uint32
sumtype
=
0
;
if
(
lua_gettop
(
L
)
>=
3
)
sumtype
=
(
uint32
)
lua_tointeger
(
L
,
3
);
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
sumtype
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_synchro_summon
(
lua_State
*
L
)
{
...
...
@@ -305,6 +315,9 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
card
*
tuner
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
...
...
@@ -323,13 +336,15 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
maxc
=
(
int32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pduel
->
game_field
->
core
.
limit_syn
=
mg
;
pduel
->
game_field
->
core
.
limit_syn_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_syn_maxc
=
maxc
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_SYNCHRO
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_xyz_summon
(
lua_State
*
L
)
{
...
...
@@ -340,6 +355,9 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
group
*
materials
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
...
...
@@ -351,12 +369,14 @@ int32 scriptlib::duel_xyz_summon(lua_State *L) {
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
maxc
=
(
int32
)
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_xyz
=
materials
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
minc
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
maxc
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
,
SUMMON_TYPE_XYZ
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_link_summon
(
lua_State
*
L
)
{
...
...
@@ -367,6 +387,9 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
group
*
materials
=
0
;
card
*
lcard
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
...
...
@@ -385,38 +408,45 @@ int32 scriptlib::duel_link_summon(lua_State *L) {
int32
maxc
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
maxc
=
(
int32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_link
=
materials
;
pduel
->
game_field
->
core
.
limit_link_card
=
lcard
;
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
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_setm
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_param_count
(
L
,
4
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
pduel
->
game_field
->
core
.
effect_damage_step
)
return
0
;
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
4
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
4
);
}
uint32
min_tribute
=
0
;
if
(
lua_gettop
(
L
)
>=
5
)
min_tribute
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
zone
=
0x1f
;
if
(
lua_gettop
(
L
)
>=
6
)
zone
=
(
uint32
)
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
mset
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
pduel
->
game_field
->
core
.
reserved
=
pduel
->
game_field
->
core
.
subunits
.
back
();
pduel
->
game_field
->
core
.
subunits
.
pop_back
();
pduel
->
game_field
->
core
.
summoning_card
=
pcard
;
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_sets
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
d5aace84
...
...
@@ -1869,7 +1869,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
}
target
->
enable_field_effect
(
false
);
move_to_field
(
target
,
sumplayer
,
targetplayer
,
LOCATION_MZONE
,
positions
,
FALSE
,
0
,
FALSE
,
zone
);
core
.
summoning_card
=
target
;
core
.
units
.
begin
()
->
step
=
10
;
return
FALSE
;
}
...
...
@@ -1889,7 +1888,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
deffect
->
description
=
64
;
deffect
->
reset_flag
=
RESET_EVENT
+
0x1fe0000
;
target
->
add_effect
(
deffect
);
core
.
summoning_card
=
target
;
return
FALSE
;
}
case
10
:
{
...
...
@@ -1934,23 +1932,15 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
if
(
target
->
is_affected_by_effect
(
EFFECT_CANNOT_DISABLE_SUMMON
))
core
.
units
.
begin
()
->
step
=
14
;
return
FALSE
;
}
else
if
(
core
.
current_chain
.
size
()
>
1
)
{
}
else
{
core
.
units
.
begin
()
->
step
=
14
;
return
FALSE
;
}
else
{
if
(
target
->
is_affected_by_effect
(
EFFECT_CANNOT_DISABLE_SUMMON
))
core
.
units
.
begin
()
->
step
=
15
;
else
core
.
units
.
begin
()
->
step
=
13
;
core
.
reserved
=
core
.
units
.
front
();
return
TRUE
;
}
return
FALSE
;
}
case
13
:
{
target
->
set_status
(
STATUS_SUMMONING
,
TRUE
);
target
->
set_status
(
STATUS_SUMMON_DISABLED
,
FALSE
);
core
.
summoning_card
=
0
;
raise_event
(
target
,
EVENT_SUMMON
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
process_instant_event
();
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0x101
,
TRUE
);
...
...
@@ -1984,7 +1974,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
target
->
enable_field_effect
(
true
);
if
(
target
->
is_status
(
STATUS_DISABLED
))
target
->
reset
(
RESET_DISABLE
,
RESET_EVENT
);
core
.
summoning_card
=
0
;
return
FALSE
;
}
case
16
:
{
...
...
@@ -2772,7 +2761,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
set_control
(
target
,
target
->
current
.
controler
,
0
,
0
);
core
.
phase_action
=
TRUE
;
target
->
current
.
reason_effect
=
core
.
units
.
begin
()
->
peffect
;
core
.
summoning_card
=
target
;
pduel
->
write_buffer8
(
MSG_SPSUMMONING
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
get_info_location
());
...
...
@@ -2803,21 +2791,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
else
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
}
else
if
(
core
.
current_chain
.
size
()
>
1
)
{
}
else
{
core
.
units
.
begin
()
->
step
=
14
;
return
FALSE
;
}
else
{
if
(
target
->
is_affected_by_effect
(
EFFECT_CANNOT_DISABLE_SPSUMMON
))
core
.
units
.
begin
()
->
step
=
15
;
else
core
.
units
.
begin
()
->
step
=
10
;
core
.
reserved
=
core
.
units
.
front
();
return
TRUE
;
}
return
FALSE
;
}
case
10
:
{
core
.
summoning_card
=
0
;
target
->
set_status
(
STATUS_SUMMONING
,
TRUE
);
target
->
set_status
(
STATUS_SUMMON_DISABLED
,
FALSE
);
raise_event
(
target
,
EVENT_SPSUMMON
,
core
.
units
.
begin
()
->
peffect
,
0
,
sumplayer
,
sumplayer
,
0
);
...
...
@@ -2850,7 +2830,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
target
->
enable_field_effect
(
true
);
if
(
target
->
is_status
(
STATUS_DISABLED
))
target
->
reset
(
RESET_DISABLE
,
RESET_EVENT
);
core
.
summoning_card
=
0
;
return
FALSE
;
}
case
16
:
{
...
...
processor.cpp
View file @
d5aace84
...
...
@@ -4413,6 +4413,9 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core
.
chain_limit
.
clear
();
return
FALSE
;
}
if
(
core
.
summoning_card
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
summoning_card
=
0
;
core
.
units
.
begin
()
->
step
=
-
1
;
return
FALSE
;
}
...
...
@@ -4435,6 +4438,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
reset_chain
();
if
(
core
.
summoning_card
||
core
.
effect_damage_step
==
1
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
summoning_card
=
0
;
return
FALSE
;
}
case
13
:
{
...
...
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