Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
REIKAI
ygopro
Commits
7f3a151b
Commit
7f3a151b
authored
Mar 31, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
98e32f96
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
141 additions
and
48 deletions
+141
-48
gframe/duelclient.cpp
gframe/duelclient.cpp
+4
-4
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-1
ocgcore/card.cpp
ocgcore/card.cpp
+4
-7
ocgcore/field.cpp
ocgcore/field.cpp
+1
-0
ocgcore/field.h
ocgcore/field.h
+3
-2
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+1
-0
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+3
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+12
-0
ocgcore/processor.cpp
ocgcore/processor.cpp
+94
-22
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+1
-0
script/c17189677.lua
script/c17189677.lua
+2
-2
script/c25341652.lua
script/c25341652.lua
+6
-3
script/c29888389.lua
script/c29888389.lua
+1
-1
script/c47106439.lua
script/c47106439.lua
+1
-1
script/c67987611.lua
script/c67987611.lua
+1
-1
script/c69488544.lua
script/c69488544.lua
+1
-1
script/c93504463.lua
script/c93504463.lua
+4
-1
system.conf
system.conf
+1
-1
No files found.
gframe/duelclient.cpp
View file @
7f3a151b
...
@@ -1691,10 +1691,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
...
@@ -1691,10 +1691,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
,
ps
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pc
,
pl
,
ps
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
pcard
->
SetCode
(
code
);
if
((
pl
&
LOCATION_ONFIELD
)
&&
(
cl
!=
pl
))
pcard
->
counters
.
clear
();
pcard
->
counters
.
clear
();
pcard
->
ClearTarget
();
if
(
cl
!=
pl
)
pcard
->
ClearTarget
();
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
...
@@ -2446,6 +2444,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
...
@@ -2446,6 +2444,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
!
pcard
)
return
true
;
pcard
->
cHint
=
chtype
;
pcard
->
cHint
=
chtype
;
pcard
->
chValue
=
value
;
pcard
->
chValue
=
value
;
if
(
chtype
==
CHINT_TURN
)
{
if
(
chtype
==
CHINT_TURN
)
{
...
...
gframe/single_duel.cpp
View file @
7f3a151b
...
@@ -546,7 +546,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -546,7 +546,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
unsigned
char
engType
=
BufferIO
::
ReadUInt8
(
pbuf
);
unsigned
char
engType
=
BufferIO
::
ReadUInt8
(
pbuf
);
switch
(
engType
)
{
switch
(
engType
)
{
case
MSG_RETRY
:
{
case
MSG_RETRY
:
{
WaitforResponse
(
player
);
WaitforResponse
(
last_response
);
NetServer
::
SendBufferToPlayer
(
players
[
last_response
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
last_response
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
}
}
...
...
ocgcore/card.cpp
View file @
7f3a151b
...
@@ -588,18 +588,16 @@ void card::xyz_overlay(card_set* materials) {
...
@@ -588,18 +588,16 @@ void card::xyz_overlay(card_set* materials) {
return
;
return
;
card_set
des
;
card_set
des
;
if
(
materials
->
size
()
==
1
)
{
if
(
materials
->
size
()
==
1
)
{
(
*
materials
->
begin
())
->
reset
(
RESET_LEAVE
+
RESET_OVERLAY
,
RESET_EVENT
);
xyz_add
(
*
materials
->
begin
(),
&
des
);
xyz_add
(
*
materials
->
begin
(),
&
des
);
(
*
materials
->
begin
())
->
reset
(
RESET_EVENT
,
RESET_OVERLAY
);
}
else
{
}
else
{
field
::
card_vector
cv
;
field
::
card_vector
cv
;
field
::
card_vector
::
iterator
cvit
;
for
(
auto
cit
=
materials
->
begin
();
cit
!=
materials
->
end
();
++
cit
)
card_set
::
iterator
cit
;
for
(
cit
=
materials
->
begin
();
cit
!=
materials
->
end
();
++
cit
)
cv
.
push_back
(
*
cit
);
cv
.
push_back
(
*
cit
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
for
(
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
(
*
cvit
)
->
reset
(
RESET_LEAVE
+
RESET_OVERLAY
,
RESET_EVENT
);
xyz_add
(
*
cvit
,
&
des
);
xyz_add
(
*
cvit
,
&
des
);
(
*
cvit
)
->
reset
(
RESET_EVENT
,
RESET_OVERLAY
);
}
}
}
}
if
(
des
.
size
())
if
(
des
.
size
())
...
@@ -611,7 +609,6 @@ void card::xyz_add(card* mat, card_set* des) {
...
@@ -611,7 +609,6 @@ void card::xyz_add(card* mat, card_set* des) {
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer8
(
MSG_MOVE
);
pduel
->
write_buffer32
(
mat
->
data
.
code
);
pduel
->
write_buffer32
(
mat
->
data
.
code
);
mat
->
enable_field_effect
(
false
);
mat
->
enable_field_effect
(
false
);
mat
->
reset
(
RESET_LEAVE
,
RESET_EVENT
);
if
(
mat
->
overlay_target
)
{
if
(
mat
->
overlay_target
)
{
pduel
->
write_buffer8
(
mat
->
overlay_target
->
current
.
controler
);
pduel
->
write_buffer8
(
mat
->
overlay_target
->
current
.
controler
);
pduel
->
write_buffer8
(
mat
->
overlay_target
->
current
.
location
|
LOCATION_OVERLAY
);
pduel
->
write_buffer8
(
mat
->
overlay_target
->
current
.
location
|
LOCATION_OVERLAY
);
...
...
ocgcore/field.cpp
View file @
7f3a151b
...
@@ -71,6 +71,7 @@ field::field(duel* pduel) {
...
@@ -71,6 +71,7 @@ field::field(duel* pduel) {
core
.
attacker
=
0
;
core
.
attacker
=
0
;
core
.
attack_target
=
0
;
core
.
attack_target
=
0
;
core
.
deck_reversed
=
FALSE
;
core
.
deck_reversed
=
FALSE
;
core
.
effect_damage_step
=
FALSE
;
nil_event
.
event_code
=
0
;
nil_event
.
event_code
=
0
;
nil_event
.
event_cards
=
0
;
nil_event
.
event_cards
=
0
;
nil_event
.
event_player
=
PLAYER_NONE
;
nil_event
.
event_player
=
PLAYER_NONE
;
...
...
ocgcore/field.h
View file @
7f3a151b
...
@@ -219,6 +219,7 @@ struct processor {
...
@@ -219,6 +219,7 @@ struct processor {
card
*
sub_attack_target
;
card
*
sub_attack_target
;
card
*
limit_tuner
;
card
*
limit_tuner
;
uint8
attack_cancelable
;
uint8
attack_cancelable
;
uint8
effect_damage_step
;
int32
battle_damage
[
2
];
int32
battle_damage
[
2
];
int32
summon_count
[
2
];
int32
summon_count
[
2
];
uint8
extra_summon
[
2
];
uint8
extra_summon
[
2
];
...
@@ -370,7 +371,7 @@ public:
...
@@ -370,7 +371,7 @@ public:
int32
process_single_event
();
int32
process_single_event
();
int32
process_idle_command
(
uint16
step
);
int32
process_idle_command
(
uint16
step
);
int32
process_battle_command
(
uint16
step
);
int32
process_battle_command
(
uint16
step
);
int32
process_damage_
phase
(
uint16
step
);
int32
process_damage_
step
(
uint16
step
);
int32
process_turn
(
uint16
step
,
uint8
turn_player
);
int32
process_turn
(
uint16
step
,
uint8
turn_player
);
int32
add_chain
(
uint16
step
);
int32
add_chain
(
uint16
step
);
...
@@ -540,7 +541,7 @@ public:
...
@@ -540,7 +541,7 @@ public:
#define PROCESSOR_IDLE_COMMAND 32
#define PROCESSOR_IDLE_COMMAND 32
#define PROCESSOR_PHASE_EVENT 33
#define PROCESSOR_PHASE_EVENT 33
#define PROCESSOR_BATTLE_COMMAND 34
#define PROCESSOR_BATTLE_COMMAND 34
#define PROCESSOR_DAMAGE_
PHASE
35
#define PROCESSOR_DAMAGE_
STEP
35
#define PROCESSOR_ADD_CHAIN 40
#define PROCESSOR_ADD_CHAIN 40
#define PROCESSOR_SOLVE_CHAIN 42
#define PROCESSOR_SOLVE_CHAIN 42
#define PROCESSOR_SOLVE_CONTINUOUS 43
#define PROCESSOR_SOLVE_CONTINUOUS 43
...
...
ocgcore/interpreter.cpp
View file @
7f3a151b
...
@@ -331,6 +331,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -331,6 +331,7 @@ static const struct luaL_Reg duellib[] = {
{
"ReplaceAttacker"
,
scriptlib
::
duel_replace_attacker
},
{
"ReplaceAttacker"
,
scriptlib
::
duel_replace_attacker
},
{
"ChangeAttackTarget"
,
scriptlib
::
duel_change_attack_target
},
{
"ChangeAttackTarget"
,
scriptlib
::
duel_change_attack_target
},
{
"ReplaceAttackTarget"
,
scriptlib
::
duel_replace_attack_target
},
{
"ReplaceAttackTarget"
,
scriptlib
::
duel_replace_attack_target
},
{
"CalculateDamage"
,
scriptlib
::
duel_calculate_damage
},
{
"GetBattleDamage"
,
scriptlib
::
duel_get_battle_damage
},
{
"GetBattleDamage"
,
scriptlib
::
duel_get_battle_damage
},
{
"ChangeBattleDamage"
,
scriptlib
::
duel_change_battle_damage
},
{
"ChangeBattleDamage"
,
scriptlib
::
duel_change_battle_damage
},
{
"ChangeTargetCard"
,
scriptlib
::
duel_change_target
},
{
"ChangeTargetCard"
,
scriptlib
::
duel_change_target
},
...
...
ocgcore/libcard.cpp
View file @
7f3a151b
...
@@ -1191,7 +1191,9 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
...
@@ -1191,7 +1191,9 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
if
(
lua_gettop
(
L
)
>
1
)
if
(
lua_gettop
(
L
)
>
1
)
ac
=
lua_tointeger
(
L
,
2
);
ac
=
lua_tointeger
(
L
,
2
);
card
*
attacker
=
pduel
->
game_field
->
core
.
attacker
;
card
*
attacker
=
pduel
->
game_field
->
core
.
attacker
;
if
(
attacker
->
is_status
(
STATUS_BATTLE_DESTROYED
)
||
attacker
->
fieldid
!=
pduel
->
game_field
->
core
.
pre_field
[
0
]
if
(
pduel
->
game_field
->
core
.
effect_damage_step
||
attacker
->
is_status
(
STATUS_BATTLE_DESTROYED
)
||
attacker
->
fieldid
!=
pduel
->
game_field
->
core
.
pre_field
[
0
]
||
!
attacker
->
is_capable_attack_announce
(
pduel
->
game_field
->
infos
.
turn_player
)
||
!
attacker
->
is_capable_attack_announce
(
pduel
->
game_field
->
infos
.
turn_player
)
||
attacker
->
announce_count
>=
ac
)
{
||
attacker
->
announce_count
>=
ac
)
{
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
...
...
ocgcore/libduel.cpp
View file @
7f3a151b
...
@@ -1015,6 +1015,18 @@ int32 scriptlib::duel_change_attack_target(lua_State *L) {
...
@@ -1015,6 +1015,18 @@ int32 scriptlib::duel_change_attack_target(lua_State *L) {
int32
scriptlib
::
duel_replace_attack_target
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_replace_attack_target
(
lua_State
*
L
)
{
return
0
;
return
0
;
}
}
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
);
if
(
attacker
==
attack_target
)
return
0
;
attacker
->
pduel
->
game_field
->
add_process
(
PROCESSOR_DAMAGE_STEP
,
0
,
(
effect
*
)
attacker
,
(
group
*
)
attack_target
,
0
,
0
);
return
lua_yield
(
L
,
0
);
}
int32
scriptlib
::
duel_get_battle_damage
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_battle_damage
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
...
...
ocgcore/processor.cpp
View file @
7f3a151b
...
@@ -231,8 +231,8 @@ int32 field::process() {
...
@@ -231,8 +231,8 @@ int32 field::process() {
core
.
units
.
begin
()
->
step
++
;
core
.
units
.
begin
()
->
step
++
;
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_DAMAGE_
PHASE
:
{
case
PROCESSOR_DAMAGE_
STEP
:
{
if
(
process_damage_
phase
(
it
->
step
))
if
(
process_damage_
step
(
it
->
step
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
core
.
units
.
begin
()
->
step
++
;
core
.
units
.
begin
()
->
step
++
;
...
@@ -3126,17 +3126,23 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3126,17 +3126,23 @@ int32 field::process_battle_command(uint16 step) {
}
}
process_single_event
();
process_single_event
();
process_instant_event
();
process_instant_event
();
pduel
->
write_buffer8
(
MSG_HINT
);
if
(
!
core
.
effect_damage_step
)
{
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer32
(
43
);
pduel
->
write_buffer8
(
0
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer32
(
43
);
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer32
(
43
);
pduel
->
write_buffer8
(
1
);
core
.
hint_timing
[
infos
.
turn_player
]
=
TIMING_DAMAGE_CAL
;
pduel
->
write_buffer32
(
43
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
0
);
core
.
hint_timing
[
infos
.
turn_player
]
=
TIMING_DAMAGE_CAL
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
0
);
}
else
{
break_effect
();
}
core
.
damage_calculated
=
TRUE
;
core
.
damage_calculated
=
TRUE
;
if
(
core
.
effect_damage_step
&&
core
.
current_chain
.
size
()
<=
1
)
return
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
case
27
:
{
case
27
:
{
...
@@ -3239,8 +3245,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3239,8 +3245,7 @@ int32 field::process_battle_command(uint16 step) {
group
*
des
=
core
.
units
.
begin
()
->
ptarget
;
group
*
des
=
core
.
units
.
begin
()
->
ptarget
;
if
(
!
des
||
!
des
->
container
.
size
())
if
(
!
des
||
!
des
->
container
.
size
())
return
FALSE
;
return
FALSE
;
card_set
::
iterator
cit
;
for
(
auto
cit
=
des
->
container
.
begin
();
cit
!=
des
->
container
.
end
();
++
cit
)
{
for
(
cit
=
des
->
container
.
begin
();
cit
!=
des
->
container
.
end
();
++
cit
)
{
(
*
cit
)
->
set_status
(
STATUS_BATTLE_DESTROYED
,
TRUE
);
(
*
cit
)
->
set_status
(
STATUS_BATTLE_DESTROYED
,
TRUE
);
(
*
cit
)
->
filter_disable_related_cards
();
(
*
cit
)
->
filter_disable_related_cards
();
}
}
...
@@ -3254,8 +3259,12 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3254,8 +3259,12 @@ int32 field::process_battle_command(uint16 step) {
raise_event
((
card
*
)
0
,
EVENT_BATTLE_END
,
0
,
0
,
PLAYER_NONE
,
0
,
0
);
raise_event
((
card
*
)
0
,
EVENT_BATTLE_END
,
0
,
0
,
PLAYER_NONE
,
0
,
0
);
process_single_event
();
process_single_event
();
process_instant_event
();
process_instant_event
();
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
TRUE
);
if
(
!
core
.
effect_damage_step
||
core
.
current_chain
.
size
()
<=
1
)
{
core
.
units
.
begin
()
->
arg1
=
1
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
TRUE
);
core
.
units
.
begin
()
->
arg1
=
1
;
}
else
{
break_effect
();
}
return
FALSE
;
return
FALSE
;
}
}
case
31
:
{
case
31
:
{
...
@@ -3271,8 +3280,12 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3271,8 +3280,12 @@ int32 field::process_battle_command(uint16 step) {
process_single_event
();
process_single_event
();
process_instant_event
();
process_instant_event
();
}
}
if
(
core
.
flip_chain
.
size
()
||
core
.
new_fchain
.
size
()
||
core
.
new_ochain
.
size
())
if
(
!
core
.
effect_damage_step
||
core
.
current_chain
.
size
()
<=
1
)
{
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
FALSE
);
if
(
core
.
flip_chain
.
size
()
||
core
.
new_fchain
.
size
()
||
core
.
new_ochain
.
size
())
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
FALSE
);
}
else
{
break_effect
();
}
return
FALSE
;
return
FALSE
;
}
}
case
32
:
{
case
32
:
{
...
@@ -3321,8 +3334,12 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3321,8 +3334,12 @@ int32 field::process_battle_command(uint16 step) {
core
.
attacker
->
set_status
(
STATUS_BATTLE_DESTROYED
,
FALSE
);
core
.
attacker
->
set_status
(
STATUS_BATTLE_DESTROYED
,
FALSE
);
if
(
core
.
attack_target
)
if
(
core
.
attack_target
)
core
.
attack_target
->
set_status
(
STATUS_BATTLE_DESTROYED
,
FALSE
);
core
.
attack_target
->
set_status
(
STATUS_BATTLE_DESTROYED
,
FALSE
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
FALSE
);
if
(
!
core
.
effect_damage_step
||
core
.
current_chain
.
size
()
<=
1
)
{
core
.
units
.
begin
()
->
step
=
38
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
FALSE
);
core
.
units
.
begin
()
->
step
=
38
;
}
else
{
break_effect
();
}
return
FALSE
;
return
FALSE
;
}
}
case
39
:
{
case
39
:
{
...
@@ -3331,6 +3348,8 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3331,6 +3348,8 @@ int32 field::process_battle_command(uint16 step) {
pduel
->
write_buffer8
(
MSG_DAMAGE_STEP_END
);
pduel
->
write_buffer8
(
MSG_DAMAGE_STEP_END
);
reset_phase
(
PHASE_DAMAGE
);
reset_phase
(
PHASE_DAMAGE
);
adjust_all
();
adjust_all
();
if
(
core
.
effect_damage_step
)
return
TRUE
;
if
(
core
.
chain_attack
)
{
if
(
core
.
chain_attack
)
{
if
(
core
.
attacker
->
is_status
(
STATUS_BATTLE_DESTROYED
)
||
core
.
attacker
->
fieldid_r
!=
core
.
pre_field
[
0
]
if
(
core
.
attacker
->
is_status
(
STATUS_BATTLE_DESTROYED
)
||
core
.
attacker
->
fieldid_r
!=
core
.
pre_field
[
0
]
||
!
core
.
attacker
->
is_capable_attack_announce
(
infos
.
turn_player
))
||
!
core
.
attacker
->
is_capable_attack_announce
(
infos
.
turn_player
))
...
@@ -3365,7 +3384,60 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3365,7 +3384,60 @@ int32 field::process_battle_command(uint16 step) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
process_damage_phase
(
uint16
step
)
{
int32
field
::
process_damage_step
(
uint16
step
)
{
switch
(
step
)
{
case
0
:
{
core
.
effect_damage_step
=
1
;
card
*
tmp
=
core
.
attacker
;
core
.
attacker
=
(
card
*
)
core
.
units
.
begin
()
->
peffect
;
core
.
units
.
begin
()
->
peffect
=
(
effect
*
)
tmp
;
tmp
=
core
.
attack_target
;
core
.
attack_target
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
tmp
;
core
.
units
.
begin
()
->
arg1
=
infos
.
phase
;
pduel
->
write_buffer8
(
MSG_ATTACK
);
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
pduel
->
write_buffer32
(
core
.
attack_target
->
get_info_location
());
infos
.
phase
=
PHASE_DAMAGE
;
pduel
->
write_buffer8
(
MSG_DAMAGE_STEP_START
);
core
.
pre_field
[
0
]
=
core
.
attacker
->
fieldid_r
;
if
(
core
.
attack_target
)
core
.
pre_field
[
1
]
=
core
.
attack_target
->
fieldid_r
;
else
core
.
pre_field
[
1
]
=
0
;
infos
.
phase
=
PHASE_DAMAGE_CAL
;
raise_single_event
(
core
.
attacker
,
0
,
EVENT_DAMAGE_CALCULATING
,
0
,
0
,
0
,
0
,
0
);
if
(
core
.
attack_target
)
raise_single_event
(
core
.
attack_target
,
0
,
EVENT_DAMAGE_CALCULATING
,
0
,
0
,
0
,
0
,
1
);
raise_event
((
card
*
)
0
,
EVENT_DAMAGE_CALCULATING
,
0
,
0
,
0
,
0
,
0
);
process_single_event
();
process_instant_event
();
add_process
(
PROCESSOR_BATTLE_COMMAND
,
26
,
0
,
0
,
0
,
0
);
if
(
core
.
current_chain
.
size
()
>
1
)
{
core
.
units
.
begin
()
->
step
=
1
;
return
FALSE
;
}
else
{
core
.
units
.
begin
()
->
step
=
1
;
core
.
reserved
=
core
.
units
.
front
();
return
TRUE
;
}
}
case
1
:
{
core
.
effect_damage_step
=
2
;
add_process
(
PROCESSOR_BATTLE_COMMAND
,
27
,
0
,
0
,
0
,
0
);
return
FALSE
;
}
case
2
:
{
core
.
attacker
=
(
card
*
)
core
.
units
.
begin
()
->
peffect
;
core
.
attack_target
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
core
.
attacker
->
set_status
(
STATUS_ATTACK_CANCELED
,
TRUE
);
if
(
core
.
attack_target
)
core
.
attack_target
->
set_status
(
STATUS_ATTACK_CANCELED
,
TRUE
);
core
.
effect_damage_step
=
0
;
infos
.
phase
=
core
.
units
.
begin
()
->
arg1
;
return
TRUE
;
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
process_turn
(
uint16
step
,
uint8
turn_player
)
{
int32
field
::
process_turn
(
uint16
step
,
uint8
turn_player
)
{
...
@@ -3975,7 +4047,7 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
...
@@ -3975,7 +4047,7 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
core
.
chain_limit_p
=
0
;
core
.
chain_limit_p
=
0
;
}
}
reset_chain
();
reset_chain
();
if
(
core
.
summoning_card
||
core
.
spsummoning_card
)
if
(
core
.
summoning_card
||
core
.
spsummoning_card
||
core
.
effect_damage_step
==
1
)
core
.
subunits
.
push_back
(
core
.
reserved
);
core
.
subunits
.
push_back
(
core
.
reserved
);
return
FALSE
;
return
FALSE
;
}
}
...
...
ocgcore/scriptlib.h
View file @
7f3a151b
...
@@ -327,6 +327,7 @@ public:
...
@@ -327,6 +327,7 @@ public:
static
int32
duel_replace_attacker
(
lua_State
*
L
);
static
int32
duel_replace_attacker
(
lua_State
*
L
);
static
int32
duel_change_attack_target
(
lua_State
*
L
);
static
int32
duel_change_attack_target
(
lua_State
*
L
);
static
int32
duel_replace_attack_target
(
lua_State
*
L
);
static
int32
duel_replace_attack_target
(
lua_State
*
L
);
static
int32
duel_calculate_damage
(
lua_State
*
L
);
static
int32
duel_get_battle_damage
(
lua_State
*
L
);
static
int32
duel_get_battle_damage
(
lua_State
*
L
);
static
int32
duel_change_battle_damage
(
lua_State
*
L
);
static
int32
duel_change_battle_damage
(
lua_State
*
L
);
static
int32
duel_change_target
(
lua_State
*
L
);
static
int32
duel_change_target
(
lua_State
*
L
);
...
...
script/c17189677.lua
View file @
7f3a151b
...
@@ -18,8 +18,8 @@ function c17189677.tgfilter(c)
...
@@ -18,8 +18,8 @@ function c17189677.tgfilter(c)
return
c
:
IsRace
(
RACE_REPTILE
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
return
c
:
IsRace
(
RACE_REPTILE
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
end
end
function
c17189677
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c17189677
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c17189677
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
2
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c17189677
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
4
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
2
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
4
,
tp
,
LOCATION_DECK
)
end
end
function
c17189677
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c17189677
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
c17189677
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c17189677
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
...
...
script/c25341652.lua
View file @
7f3a151b
...
@@ -29,11 +29,14 @@ function c25341652.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -29,11 +29,14 @@ function c25341652.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
end
function
c25341652
.
posfilter
(
c
)
return
c
:
IsPosition
(
POS_FACEUP_ATTACK
)
and
c
:
IsCanTurnSet
()
end
function
c25341652
.
postg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
c25341652
.
postg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c
hkc
:
IsPosition
(
POS_FACEUP_ATTACK
)
end
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c
25341652
.
posfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsPosition
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
,
POS_FACEUP_ATTACK
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c25341652
.
posfilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUPATTACK
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUPATTACK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsPosition
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
,
POS_FACEUP_ATTACK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c25341652
.
posfilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
g
,
1
,
0
,
0
)
end
end
function
c25341652
.
posop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c25341652
.
posop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
script/c29888389.lua
View file @
7f3a151b
...
@@ -20,7 +20,7 @@ end
...
@@ -20,7 +20,7 @@ end
function
c29888389
.
rlevel
(
e
,
c
)
function
c29888389
.
rlevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
local
lv
=
e
:
GetHandler
():
GetLevel
()
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
then
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
then
local
clv
=
c
:
Get
Original
Level
()
local
clv
=
c
:
GetLevel
()
return
lv
*
65536
+
clv
return
lv
*
65536
+
clv
else
return
lv
end
else
return
lv
end
end
end
...
...
script/c47106439.lua
View file @
7f3a151b
...
@@ -20,7 +20,7 @@ end
...
@@ -20,7 +20,7 @@ end
function
c47106439
.
rlevel
(
e
,
c
)
function
c47106439
.
rlevel
(
e
,
c
)
local
lv
=
e
:
GetHandler
():
GetLevel
()
local
lv
=
e
:
GetHandler
():
GetLevel
()
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
then
if
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
then
local
clv
=
c
:
Get
Original
Level
()
local
clv
=
c
:
GetLevel
()
return
lv
*
65536
+
clv
return
lv
*
65536
+
clv
else
return
lv
end
else
return
lv
end
end
end
...
...
script/c67987611.lua
View file @
7f3a151b
...
@@ -34,7 +34,7 @@ function c67987611.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -34,7 +34,7 @@ function c67987611.activate(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
-
500
)
e1
:
SetValue
(
-
500
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
script/c69488544.lua
View file @
7f3a151b
...
@@ -35,7 +35,7 @@ function c69488544.filter(c,e,tp)
...
@@ -35,7 +35,7 @@ function c69488544.filter(c,e,tp)
end
end
function
c69488544
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
c69488544
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c69488544
.
filter
(
chkc
,
e
,
tp
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c69488544
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
~=
0
if
chk
==
0
then
return
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
~=
0
and
Duel
.
IsExistingTarget
(
c69488544
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
and
Duel
.
IsExistingTarget
(
c69488544
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c69488544
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c69488544
.
filter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
...
...
script/c93504463.lua
View file @
7f3a151b
...
@@ -29,6 +29,9 @@ end
...
@@ -29,6 +29,9 @@ end
function
c93504463
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c93504463
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
Duel
.
ChangeAttackTarget
(
tc
)
local
a
=
Duel
.
GetAttacker
()
if
a
:
IsOnField
()
and
a
:
IsFaceup
()
then
Duel
.
CalculateDamage
(
a
,
tc
)
end
end
end
end
end
system.conf
View file @
7f3a151b
...
@@ -7,5 +7,5 @@ lastdeck = test
...
@@ -7,5 +7,5 @@ lastdeck = test
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
7911
serverport
=
7911
lastip
=
192
.
168
.
2
.
100
lastip
=
192
.
168
.
3
.
235
lastport
=
7911
lastport
=
7911
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