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
3fc1ec0d
Commit
3fc1ec0d
authored
Jan 24, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
6e14677a
82cc1830
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
libduel.cpp
libduel.cpp
+17
-6
processor.cpp
processor.cpp
+11
-7
No files found.
libduel.cpp
View file @
3fc1ec0d
...
...
@@ -818,9 +818,12 @@ int32 scriptlib::duel_raise_event(lua_State *L) {
pduel
=
pgroup
->
pduel
;
}
else
return
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
3
);
uint32
code
=
lua_tointeger
(
L
,
2
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
3
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
3
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
3
);
}
uint32
r
=
lua_tointeger
(
L
,
4
);
uint32
rp
=
lua_tointeger
(
L
,
5
);
uint32
ep
=
lua_tointeger
(
L
,
6
);
...
...
@@ -836,10 +839,13 @@ int32 scriptlib::duel_raise_single_event(lua_State *L) {
check_action_permission
(
L
);
check_param_count
(
L
,
7
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
3
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
code
=
lua_tointeger
(
L
,
2
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
3
);
effect
*
peffect
=
0
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_EFFECT
,
3
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
3
);
}
uint32
r
=
lua_tointeger
(
L
,
4
);
uint32
rp
=
lua_tointeger
(
L
,
5
);
uint32
ep
=
lua_tointeger
(
L
,
6
);
...
...
@@ -1264,9 +1270,14 @@ int32 scriptlib::duel_calculate_damage(lua_State *L) {
check_action_permission
(
L
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
card
*
attacker
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
attack_target
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
attack_target
;
if
(
lua_isnil
(
L
,
2
))
attack_target
=
NULL
;
else
{
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
attack_target
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
}
int32
new_attack
=
FALSE
;
if
(
lua_gettop
(
L
)
>=
3
)
new_attack
=
lua_toboolean
(
L
,
3
);
...
...
processor.cpp
View file @
3fc1ec0d
...
...
@@ -3672,7 +3672,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
core
.
attack_target
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
tmp
;
core
.
units
.
begin
()
->
arg1
=
infos
.
phase
;
if
(
core
.
attacker
->
current
.
location
!=
LOCATION_MZONE
||
core
.
attack_target
->
current
.
location
!=
LOCATION_MZONE
)
{
if
(
core
.
attacker
->
current
.
location
!=
LOCATION_MZONE
||
core
.
attack_target
&&
core
.
attack_target
->
current
.
location
!=
LOCATION_MZONE
)
{
core
.
units
.
begin
()
->
step
=
2
;
return
FALSE
;
}
...
...
@@ -3684,19 +3684,23 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
attack_all_target_check
();
pduel
->
write_buffer8
(
MSG_ATTACK
);
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
pduel
->
write_buffer32
(
core
.
attack_target
->
get_info_location
());
if
(
core
.
attack_target
)
pduel
->
write_buffer32
(
core
.
attack_target
->
get_info_location
());
else
pduel
->
write_buffer32
(
0
);
infos
.
phase
=
PHASE_DAMAGE
;
pduel
->
write_buffer8
(
MSG_DAMAGE_STEP_START
);
core
.
pre_field
[
0
]
=
core
.
attacker
->
fieldid_r
;
core
.
attacker
->
attacked_count
++
;
if
(
core
.
attack_target
)
if
(
core
.
attack_target
)
{
core
.
pre_field
[
1
]
=
core
.
attack_target
->
fieldid_r
;
if
(
core
.
attack_target
->
is_position
(
POS_FACEDOWN
))
{
change_position
(
core
.
attack_target
,
0
,
PLAYER_NONE
,
core
.
attack_target
->
current
.
position
>>
1
,
0
,
TRUE
);
adjust_all
();
}
}
else
core
.
pre_field
[
1
]
=
0
;
if
(
core
.
attack_target
->
is_position
(
POS_FACEDOWN
))
{
change_position
(
core
.
attack_target
,
0
,
PLAYER_NONE
,
core
.
attack_target
->
current
.
position
>>
1
,
0
,
TRUE
);
adjust_all
();
}
return
FALSE
;
}
case
1
:
{
...
...
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