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
08861e17
Commit
08861e17
authored
Dec 25, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro-core
parents
090fcd79
fd9fc404
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
8 deletions
+40
-8
effect.h
effect.h
+2
-0
libdebug.cpp
libdebug.cpp
+2
-0
processor.cpp
processor.cpp
+36
-8
No files found.
effect.h
View file @
08861e17
...
@@ -537,4 +537,6 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -537,4 +537,6 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_REMOVE_COUNTER 0x20000
#define EVENT_REMOVE_COUNTER 0x20000
#define EVENT_CUSTOM 0x10000000
#define EVENT_CUSTOM 0x10000000
#define DOUBLE_DAMAGE 0x80000000
#define HALF_DAMAGE 0x80000001
#endif
/* EFFECT_H_ */
#endif
/* EFFECT_H_ */
libdebug.cpp
View file @
08861e17
...
@@ -45,6 +45,8 @@ int32 scriptlib::debug_add_card(lua_State *L) {
...
@@ -45,6 +45,8 @@ int32 scriptlib::debug_add_card(lua_State *L) {
if
(
pduel
->
game_field
->
is_location_useable
(
playerid
,
location
,
sequence
))
{
if
(
pduel
->
game_field
->
is_location_useable
(
playerid
,
location
,
sequence
))
{
card
*
pcard
=
pduel
->
new_card
(
code
);
card
*
pcard
=
pduel
->
new_card
(
code
);
pcard
->
owner
=
owner
;
pcard
->
owner
=
owner
;
if
(
location
==
LOCATION_EXTRA
&&
position
==
0
)
position
=
POS_FACEDOWN_DEFENSE
;
pcard
->
sendto_param
.
position
=
position
;
pcard
->
sendto_param
.
position
=
position
;
if
(
location
==
LOCATION_PZONE
)
{
if
(
location
==
LOCATION_PZONE
)
{
int32
seq
=
pduel
->
game_field
->
core
.
duel_rule
>=
4
?
sequence
*
4
:
sequence
+
6
;
int32
seq
=
pduel
->
game_field
->
core
.
duel_rule
>=
4
?
sequence
*
4
:
sequence
+
6
;
...
...
processor.cpp
View file @
08861e17
...
@@ -2765,7 +2765,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2765,7 +2765,7 @@ int32 field::process_battle_command(uint16 step) {
}
}
case
21
:
{
case
21
:
{
if
(
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
))
{
if
(
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
))
{
core
.
units
.
begin
()
->
step
=
3
2
;
core
.
units
.
begin
()
->
step
=
3
3
;
return
FALSE
;
return
FALSE
;
}
}
if
(
!
core
.
attack_target
)
{
if
(
!
core
.
attack_target
)
{
...
@@ -2803,7 +2803,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2803,7 +2803,7 @@ int32 field::process_battle_command(uint16 step) {
}
}
case
23
:
{
case
23
:
{
if
(
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
))
{
if
(
core
.
attacker
->
is_status
(
STATUS_ATTACK_CANCELED
))
{
core
.
units
.
begin
()
->
step
=
3
2
;
core
.
units
.
begin
()
->
step
=
3
3
;
return
FALSE
;
return
FALSE
;
}
}
infos
.
phase
=
PHASE_DAMAGE_CAL
;
infos
.
phase
=
PHASE_DAMAGE_CAL
;
...
@@ -2836,7 +2836,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2836,7 +2836,7 @@ int32 field::process_battle_command(uint16 step) {
reset_phase
(
PHASE_DAMAGE_CAL
);
reset_phase
(
PHASE_DAMAGE_CAL
);
adjust_all
();
adjust_all
();
infos
.
phase
=
PHASE_DAMAGE
;
infos
.
phase
=
PHASE_DAMAGE
;
core
.
units
.
begin
()
->
step
=
3
2
;
core
.
units
.
begin
()
->
step
=
3
3
;
return
FALSE
;
return
FALSE
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -2943,8 +2943,6 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2943,8 +2943,6 @@ int32 field::process_battle_command(uint16 step) {
process_instant_event
();
process_instant_event
();
//this timing does not exist in Master Rule 3
//this timing does not exist in Master Rule 3
core
.
damage_calculated
=
TRUE
;
core
.
damage_calculated
=
TRUE
;
if
(
core
.
effect_damage_step
)
return
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
case
27
:
{
case
27
:
{
...
@@ -3067,6 +3065,12 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3067,6 +3065,12 @@ int32 field::process_battle_command(uint16 step) {
raise_event
((
card
*
)
0
,
EVENT_BATTLED
,
0
,
0
,
PLAYER_NONE
,
0
,
0
);
raise_event
((
card
*
)
0
,
EVENT_BATTLED
,
0
,
0
,
PLAYER_NONE
,
0
,
0
);
process_single_event
();
process_single_event
();
process_instant_event
();
process_instant_event
();
if
(
core
.
effect_damage_step
)
return
TRUE
;
core
.
units
.
begin
()
->
step
=
32
;
}
// fall through
case
32
:
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
0
);
...
@@ -3078,7 +3082,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3078,7 +3082,7 @@ int32 field::process_battle_command(uint16 step) {
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
TRUE
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
TRUE
);
return
FALSE
;
return
FALSE
;
}
}
case
3
2
:
{
case
3
3
:
{
group
*
des
=
core
.
units
.
begin
()
->
ptarget
;
group
*
des
=
core
.
units
.
begin
()
->
ptarget
;
if
(
des
)
{
if
(
des
)
{
for
(
auto
cit
=
des
->
container
.
begin
();
cit
!=
des
->
container
.
end
();)
{
for
(
auto
cit
=
des
->
container
.
begin
();
cit
!=
des
->
container
.
end
();)
{
...
@@ -3091,7 +3095,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3091,7 +3095,7 @@ int32 field::process_battle_command(uint16 step) {
adjust_all
();
adjust_all
();
return
FALSE
;
return
FALSE
;
}
}
case
3
3
:
{
case
3
4
:
{
core
.
units
.
begin
()
->
ptarget
=
0
;
core
.
units
.
begin
()
->
ptarget
=
0
;
core
.
damage_calculated
=
TRUE
;
core
.
damage_calculated
=
TRUE
;
core
.
selfdes_disabled
=
FALSE
;
core
.
selfdes_disabled
=
FALSE
;
...
@@ -3247,7 +3251,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
...
@@ -3247,7 +3251,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
}
}
case
2
:
{
case
2
:
{
core
.
effect_damage_step
=
2
;
core
.
effect_damage_step
=
2
;
add_process
(
PROCESSOR_BATTLE_COMMAND
,
27
,
0
,
0
,
0
,
0
);
add_process
(
PROCESSOR_BATTLE_COMMAND
,
32
,
0
,
0
,
0
,
0
);
return
FALSE
;
return
FALSE
;
}
}
case
3
:
{
case
3
:
{
...
@@ -3365,6 +3369,30 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
...
@@ -3365,6 +3369,30 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
if
(
dp
[
1
-
pd
]
&&
!
core
.
attacker
->
is_affected_by_effect
(
EFFECT_AVOID_BATTLE_DAMAGE
,
core
.
attack_target
)
if
(
dp
[
1
-
pd
]
&&
!
core
.
attacker
->
is_affected_by_effect
(
EFFECT_AVOID_BATTLE_DAMAGE
,
core
.
attack_target
)
&&
!
is_player_affected_by_effect
(
1
-
pd
,
EFFECT_AVOID_BATTLE_DAMAGE
))
&&
!
is_player_affected_by_effect
(
1
-
pd
,
EFFECT_AVOID_BATTLE_DAMAGE
))
core
.
battle_damage
[
1
-
pd
]
=
a
-
d
;
core
.
battle_damage
[
1
-
pd
]
=
a
-
d
;
bool
double_damage
=
false
;
//bool half_damage = false;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
get_value
()
==
DOUBLE_DAMAGE
)
double_damage
=
true
;
//if(eset[i]->get_value() == HALF_DAMAGE)
// half_damage = true;
}
//if(double_damage && half_damage) {
// double_damage = false;
// half_damage = false;
//}
if
(
double_damage
)
{
if
(
dp
[
0
])
core
.
battle_damage
[
0
]
*=
2
;
if
(
dp
[
1
])
core
.
battle_damage
[
1
]
*=
2
;
}
//if(half_damage) {
// if(dp[0])
// core.battle_damage[0] /= 2;
// if(dp[1])
// core.battle_damage[1] /= 2;
//}
reason_card
=
core
.
attacker
;
reason_card
=
core
.
attacker
;
}
}
bd
[
1
]
=
TRUE
;
bd
[
1
]
=
TRUE
;
...
...
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