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
93c62a6e
Commit
93c62a6e
authored
Sep 29, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
position_param, direct_attackable
parent
2ec2856b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
17 deletions
+21
-17
card.h
card.h
+2
-0
field.cpp
field.cpp
+2
-2
libcard.cpp
libcard.cpp
+2
-2
operations.cpp
operations.cpp
+11
-9
playerop.cpp
playerop.cpp
+1
-1
processor.cpp
processor.cpp
+3
-3
No files found.
card.h
View file @
93c62a6e
...
@@ -113,6 +113,8 @@ public:
...
@@ -113,6 +113,8 @@ public:
uint32
operation_param
;
uint32
operation_param
;
uint32
release_param
;
uint32
release_param
;
uint32
sum_param
;
uint32
sum_param
;
uint32
position_param
;
uint8
direct_attackable
;
uint8
announce_count
;
uint8
announce_count
;
uint8
attacked_count
;
uint8
attacked_count
;
uint8
attack_all_target
;
uint8
attack_all_target
;
...
...
field.cpp
View file @
93c62a6e
...
@@ -1713,7 +1713,7 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
...
@@ -1713,7 +1713,7 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
card_vector
only_be_attack
;
card_vector
only_be_attack
;
effect_set
eset
;
effect_set
eset
;
// find the universal set pv
// find the universal set pv
pcard
->
operation_param
=
0
;
pcard
->
direct_attackable
=
0
;
for
(
uint32
i
=
0
;
i
<
5
;
++
i
)
{
for
(
uint32
i
=
0
;
i
<
5
;
++
i
)
{
card
*
atarget
=
player
[
1
-
p
].
list_mzone
[
i
];
card
*
atarget
=
player
[
1
-
p
].
list_mzone
[
i
];
if
(
atarget
)
{
if
(
atarget
)
{
...
@@ -1873,7 +1873,7 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
...
@@ -1873,7 +1873,7 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
}
}
if
((
mcount
==
0
||
pcard
->
is_affected_by_effect
(
EFFECT_DIRECT_ATTACK
)
||
core
.
attack_player
)
if
((
mcount
==
0
||
pcard
->
is_affected_by_effect
(
EFFECT_DIRECT_ATTACK
)
||
core
.
attack_player
)
&&
!
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_DIRECT_ATTACK
)
&&
dir
)
&&
!
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_DIRECT_ATTACK
)
&&
dir
)
pcard
->
operation_param
=
1
;
pcard
->
direct_attackable
=
1
;
return
atype
;
return
atype
;
}
}
// return: core.attack_target is valid or not
// return: core.attack_target is valid or not
...
...
libcard.cpp
View file @
93c62a6e
...
@@ -1616,7 +1616,7 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
...
@@ -1616,7 +1616,7 @@ int32 scriptlib::card_is_chain_attackable(lua_State *L) {
}
}
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
get_attack_target
(
attacker
,
&
pduel
->
game_field
->
core
.
select_cards
,
TRUE
);
pduel
->
game_field
->
get_attack_target
(
attacker
,
&
pduel
->
game_field
->
core
.
select_cards
,
TRUE
);
if
(
pduel
->
game_field
->
core
.
select_cards
.
size
()
==
0
&&
(
monsteronly
||
attacker
->
operation_param
==
0
))
if
(
pduel
->
game_field
->
core
.
select_cards
.
size
()
==
0
&&
(
monsteronly
||
attacker
->
direct_attackable
==
0
))
lua_pushboolean
(
L
,
0
);
lua_pushboolean
(
L
,
0
);
else
else
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
...
@@ -2244,7 +2244,7 @@ int32 scriptlib::card_get_attackable_target(lua_State *L) {
...
@@ -2244,7 +2244,7 @@ int32 scriptlib::card_get_attackable_target(lua_State *L) {
group
*
newgroup
=
pduel
->
new_group
();
group
*
newgroup
=
pduel
->
new_group
();
newgroup
->
container
.
insert
(
targets
.
begin
(),
targets
.
end
());
newgroup
->
container
.
insert
(
targets
.
begin
(),
targets
.
end
());
interpreter
::
group2value
(
L
,
newgroup
);
interpreter
::
group2value
(
L
,
newgroup
);
lua_pushboolean
(
L
,
pcard
->
operation_param
);
lua_pushboolean
(
L
,
(
int32
)
pcard
->
direct_attackable
);
return
2
;
return
2
;
}
}
int32
scriptlib
::
card_set_hint
(
lua_State
*
L
)
{
int32
scriptlib
::
card_set_hint
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
93c62a6e
...
@@ -296,22 +296,22 @@ void field::change_position(card_set* targets, effect* reason_effect, uint32 rea
...
@@ -296,22 +296,22 @@ void field::change_position(card_set* targets, effect* reason_effect, uint32 rea
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();
++
cit
)
{
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
->
current
.
position
==
POS_FACEUP_ATTACK
)
if
(
pcard
->
current
.
position
==
POS_FACEUP_ATTACK
)
pcard
->
opera
tion_param
=
au
;
pcard
->
posi
tion_param
=
au
;
else
if
(
pcard
->
current
.
position
==
POS_FACEDOWN_DEFENSE
)
else
if
(
pcard
->
current
.
position
==
POS_FACEDOWN_DEFENSE
)
pcard
->
opera
tion_param
=
dd
;
pcard
->
posi
tion_param
=
dd
;
else
if
(
pcard
->
current
.
position
==
POS_FACEUP_DEFENSE
)
else
if
(
pcard
->
current
.
position
==
POS_FACEUP_DEFENSE
)
pcard
->
opera
tion_param
=
du
;
pcard
->
posi
tion_param
=
du
;
else
else
pcard
->
opera
tion_param
=
ad
;
pcard
->
posi
tion_param
=
ad
;
pcard
->
opera
tion_param
|=
flag
;
pcard
->
posi
tion_param
|=
flag
;
}
}
add_process
(
PROCESSOR_CHANGEPOS
,
0
,
reason_effect
,
ng
,
reason_player
,
enable
);
add_process
(
PROCESSOR_CHANGEPOS
,
0
,
reason_effect
,
ng
,
reason_player
,
enable
);
}
}
void
field
::
change_position
(
card
*
target
,
effect
*
reason_effect
,
uint32
reason_player
,
uint32
npos
,
uint32
flag
,
uint32
enable
)
{
void
field
::
change_position
(
card
*
target
,
effect
*
reason_effect
,
uint32
reason_player
,
uint32
npos
,
uint32
flag
,
uint32
enable
)
{
group
*
ng
=
pduel
->
new_group
(
target
);
group
*
ng
=
pduel
->
new_group
(
target
);
ng
->
is_readonly
=
TRUE
;
ng
->
is_readonly
=
TRUE
;
target
->
opera
tion_param
=
npos
;
target
->
posi
tion_param
=
npos
;
target
->
opera
tion_param
|=
flag
;
target
->
posi
tion_param
|=
flag
;
add_process
(
PROCESSOR_CHANGEPOS
,
0
,
reason_effect
,
ng
,
reason_player
,
enable
);
add_process
(
PROCESSOR_CHANGEPOS
,
0
,
reason_effect
,
ng
,
reason_player
,
enable
);
}
}
int32
field
::
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
count
)
{
int32
field
::
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
count
)
{
...
@@ -634,6 +634,8 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) {
...
@@ -634,6 +634,8 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost) {
}
}
return
TRUE
;
return
TRUE
;
}
}
// rplayer rmoves counter from pcard or the field
// s,o: binary value indicating the available side
int32
field
::
remove_counter
(
uint16
step
,
uint32
reason
,
card
*
pcard
,
uint8
rplayer
,
uint8
s
,
uint8
o
,
uint16
countertype
,
uint16
count
)
{
int32
field
::
remove_counter
(
uint16
step
,
uint32
reason
,
card
*
pcard
,
uint8
rplayer
,
uint8
s
,
uint8
o
,
uint16
countertype
,
uint16
count
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
...
@@ -3945,9 +3947,9 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
...
@@ -3945,9 +3947,9 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
std
::
sort
(
cv
.
begin
(),
cv
.
end
(),
card
::
card_operation_sort
);
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
for
(
auto
cvit
=
cv
.
begin
();
cvit
!=
cv
.
end
();
++
cvit
)
{
card
*
pcard
=
*
cvit
;
card
*
pcard
=
*
cvit
;
uint8
npos
=
pcard
->
opera
tion_param
&
0xff
;
uint8
npos
=
pcard
->
posi
tion_param
&
0xff
;
uint8
opos
=
pcard
->
current
.
position
;
uint8
opos
=
pcard
->
current
.
position
;
uint8
flag
=
pcard
->
opera
tion_param
>>
16
;
uint8
flag
=
pcard
->
posi
tion_param
>>
16
;
if
(
pcard
->
is_status
(
STATUS_SUMMONING
)
||
pcard
->
overlay_target
||
!
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
if
(
pcard
->
is_status
(
STATUS_SUMMONING
)
||
pcard
->
overlay_target
||
!
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
||
!
pcard
->
is_affect_by_effect
(
reason_effect
)
||
npos
==
opos
||
!
pcard
->
is_affect_by_effect
(
reason_effect
)
||
npos
==
opos
||
(
!
(
pcard
->
data
.
type
&
TYPE_TOKEN
)
&&
(
opos
&
POS_FACEUP
)
&&
(
npos
&
POS_FACEDOWN
)
&&
!
pcard
->
is_capable_turn_set
(
reason_player
))
||
(
!
(
pcard
->
data
.
type
&
TYPE_TOKEN
)
&&
(
opos
&
POS_FACEUP
)
&&
(
npos
&
POS_FACEDOWN
)
&&
!
pcard
->
is_capable_turn_set
(
reason_player
))
...
...
playerop.cpp
View file @
93c62a6e
...
@@ -40,7 +40,7 @@ int32 field::select_battle_command(uint16 step, uint8 playerid) {
...
@@ -40,7 +40,7 @@ int32 field::select_battle_command(uint16 step, uint8 playerid) {
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
operation_param
);
pduel
->
write_buffer8
(
pcard
->
direct_attackable
);
}
}
//M2, EP
//M2, EP
if
(
core
.
to_m2
)
if
(
core
.
to_m2
)
...
...
processor.cpp
View file @
93c62a6e
...
@@ -2823,7 +2823,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2823,7 +2823,7 @@ int32 field::process_battle_command(uint16 step) {
chain_attack
=
TRUE
;
chain_attack
=
TRUE
;
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
get_attack_target
(
pcard
,
&
core
.
select_cards
,
chain_attack
);
get_attack_target
(
pcard
,
&
core
.
select_cards
,
chain_attack
);
if
(
core
.
select_cards
.
size
()
==
0
&&
pcard
->
operation_param
==
0
)
if
(
core
.
select_cards
.
size
()
==
0
&&
pcard
->
direct_attackable
==
0
)
continue
;
continue
;
core
.
attackable_cards
.
push_back
(
pcard
);
core
.
attackable_cards
.
push_back
(
pcard
);
if
(
pcard
->
is_affected_by_effect
(
EFFECT_FIRST_ATTACK
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_FIRST_ATTACK
))
...
@@ -3134,7 +3134,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3134,7 +3134,7 @@ int32 field::process_battle_command(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
// attack canceled
// attack canceled
if
(
!
core
.
select_cards
.
size
()
&&
!
core
.
attacker
->
operation_param
)
{
if
(
!
core
.
select_cards
.
size
()
&&
!
core
.
attacker
->
direct_attackable
)
{
core
.
chain_attack
=
FALSE
;
core
.
chain_attack
=
FALSE
;
core
.
units
.
begin
()
->
step
=
-
1
;
core
.
units
.
begin
()
->
step
=
-
1
;
reset_phase
(
PHASE_DAMAGE
);
reset_phase
(
PHASE_DAMAGE
);
...
@@ -5157,7 +5157,7 @@ int32 field::adjust_step(uint16 step) {
...
@@ -5157,7 +5157,7 @@ int32 field::adjust_step(uint16 step) {
pos
=
eset
.
get_last
()
->
get_value
();
pos
=
eset
.
get_last
()
->
get_value
();
if
((
pos
&
0xff
)
!=
pcard
->
current
.
position
)
{
if
((
pos
&
0xff
)
!=
pcard
->
current
.
position
)
{
pos_adjust
.
insert
(
pcard
);
pos_adjust
.
insert
(
pcard
);
pcard
->
opera
tion_param
=
pos
;
pcard
->
posi
tion_param
=
pos
;
if
(
pcard
->
is_status
(
STATUS_JUST_POS
))
if
(
pcard
->
is_status
(
STATUS_JUST_POS
))
pcard
->
set_status
(
STATUS_CONTINUOUS_POS
,
TRUE
);
pcard
->
set_status
(
STATUS_CONTINUOUS_POS
,
TRUE
);
else
else
...
...
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