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
6194667e
Commit
6194667e
authored
May 18, 2024
by
mercury233
Committed by
mercury233
May 23, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update move to field flags
parent
9d6759f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
common.h
common.h
+4
-0
libduel.cpp
libduel.cpp
+1
-1
operations.cpp
operations.cpp
+10
-10
No files found.
common.h
View file @
6194667e
...
@@ -80,6 +80,10 @@ struct card_sort {
...
@@ -80,6 +80,10 @@ struct card_sort {
//Flip effect flags
//Flip effect flags
#define NO_FLIP_EFFECT 0x10000
#define NO_FLIP_EFFECT 0x10000
//Move to field flags
#define RETURN_TEMP_REMOVE_TO_FIELD 1
#define RETURN_TRAP_MONSTER_TO_SZONE 2
//Types
//Types
#define TYPE_MONSTER 0x1 //
#define TYPE_MONSTER 0x1 //
#define TYPE_SPELL 0x2 //
#define TYPE_SPELL 0x2 //
...
...
libduel.cpp
View file @
6194667e
...
@@ -897,7 +897,7 @@ int32 scriptlib::duel_return_to_field(lua_State *L) {
...
@@ -897,7 +897,7 @@ int32 scriptlib::duel_return_to_field(lua_State *L) {
pcard
->
enable_field_effect
(
false
);
pcard
->
enable_field_effect
(
false
);
pduel
->
game_field
->
adjust_instant
();
pduel
->
game_field
->
adjust_instant
();
pduel
->
game_field
->
refresh_location_info_instant
();
pduel
->
game_field
->
refresh_location_info_instant
();
pduel
->
game_field
->
move_to_field
(
pcard
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
location
,
pos
,
TRUE
,
1
,
pcard
->
previous
.
pzone
,
zone
);
pduel
->
game_field
->
move_to_field
(
pcard
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
controler
,
pcard
->
previous
.
location
,
pos
,
TRUE
,
RETURN_TEMP_REMOVE_TO_FIELD
,
pcard
->
previous
.
pzone
,
zone
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushboolean
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
lua_pushboolean
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
...
...
operations.cpp
View file @
6194667e
...
@@ -1352,7 +1352,7 @@ int32 field::trap_monster_adjust(uint16 step) {
...
@@ -1352,7 +1352,7 @@ int32 field::trap_monster_adjust(uint16 step) {
pcard
->
reset
(
RESET_TURN_SET
,
RESET_EVENT
);
pcard
->
reset
(
RESET_TURN_SET
,
RESET_EVENT
);
if
(
core
.
duel_rule
<=
4
)
if
(
core
.
duel_rule
<=
4
)
refresh_location_info_instant
();
refresh_location_info_instant
();
move_to_field
(
pcard
,
tp
,
tp
,
LOCATION_SZONE
,
pcard
->
current
.
position
,
FALSE
,
2
);
move_to_field
(
pcard
,
tp
,
tp
,
LOCATION_SZONE
,
pcard
->
current
.
position
,
FALSE
,
RETURN_TRAP_MONSTER_TO_SZONE
);
}
}
tp
=
1
-
tp
;
tp
=
1
-
tp
;
}
}
...
@@ -4550,7 +4550,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4550,7 +4550,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
returns
.
ivalue
[
0
]
=
FALSE
;
returns
.
ivalue
[
0
]
=
FALSE
;
if
((
ret
==
1
)
&&
(
!
(
target
->
current
.
reason
&
REASON_TEMPORARY
)
||
(
target
->
current
.
reason_effect
->
owner
!=
core
.
reason_effect
->
owner
)))
if
((
ret
==
RETURN_TEMP_REMOVE_TO_FIELD
)
&&
(
!
(
target
->
current
.
reason
&
REASON_TEMPORARY
)
||
(
target
->
current
.
reason_effect
->
owner
!=
core
.
reason_effect
->
owner
)))
return
TRUE
;
return
TRUE
;
if
(
location
==
LOCATION_SZONE
&&
zone
==
0x1
<<
5
&&
(
target
->
data
.
type
&
TYPE_FIELD
)
&&
(
target
->
data
.
type
&
TYPE_SPELL
))
{
if
(
location
==
LOCATION_SZONE
&&
zone
==
0x1
<<
5
&&
(
target
->
data
.
type
&
TYPE_FIELD
)
&&
(
target
->
data
.
type
&
TYPE_SPELL
))
{
card
*
pcard
=
get_field_card
(
playerid
,
LOCATION_SZONE
,
5
);
card
*
pcard
=
get_field_card
(
playerid
,
LOCATION_SZONE
,
5
);
...
@@ -4585,7 +4585,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4585,7 +4585,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
uint32
flag
;
uint32
flag
;
uint32
lreason
=
(
target
->
current
.
location
==
LOCATION_MZONE
)
?
LOCATION_REASON_CONTROL
:
LOCATION_REASON_TOFIELD
;
uint32
lreason
=
(
target
->
current
.
location
==
LOCATION_MZONE
)
?
LOCATION_REASON_CONTROL
:
LOCATION_REASON_TOFIELD
;
int32
ct
=
get_useable_count
(
target
,
playerid
,
location
,
move_player
,
lreason
,
zone
,
&
flag
);
int32
ct
=
get_useable_count
(
target
,
playerid
,
location
,
move_player
,
lreason
,
zone
,
&
flag
);
if
((
ret
==
1
)
&&
(
ct
<=
0
||
target
->
is_status
(
STATUS_FORBIDDEN
)
||
!
(
positions
&
POS_FACEDOWN
)
&&
check_unique_onfield
(
target
,
playerid
,
location
)))
{
if
((
ret
==
RETURN_TEMP_REMOVE_TO_FIELD
)
&&
(
ct
<=
0
||
target
->
is_status
(
STATUS_FORBIDDEN
)
||
!
(
positions
&
POS_FACEDOWN
)
&&
check_unique_onfield
(
target
,
playerid
,
location
)))
{
core
.
units
.
begin
()
->
step
=
3
;
core
.
units
.
begin
()
->
step
=
3
;
send_to
(
target
,
core
.
reason_effect
,
REASON_RULE
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
core
.
reason_effect
,
REASON_RULE
,
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
return
FALSE
;
return
FALSE
;
...
@@ -4604,7 +4604,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4604,7 +4604,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
}
}
}
}
}
}
if
(
ret
==
2
&&
core
.
duel_rule
<=
4
)
{
if
(
ret
==
RETURN_TRAP_MONSTER_TO_SZONE
&&
core
.
duel_rule
<=
4
)
{
returns
.
bvalue
[
2
]
=
target
->
previous
.
sequence
;
returns
.
bvalue
[
2
]
=
target
->
previous
.
sequence
;
return
FALSE
;
return
FALSE
;
}
}
...
@@ -4632,7 +4632,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4632,7 +4632,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
uint32
seq
=
returns
.
bvalue
[
2
];
uint32
seq
=
returns
.
bvalue
[
2
];
if
(
location
==
LOCATION_SZONE
&&
zone
==
0x1
<<
5
&&
(
target
->
data
.
type
&
TYPE_FIELD
)
&&
(
target
->
data
.
type
&
TYPE_SPELL
))
if
(
location
==
LOCATION_SZONE
&&
zone
==
0x1
<<
5
&&
(
target
->
data
.
type
&
TYPE_FIELD
)
&&
(
target
->
data
.
type
&
TYPE_SPELL
))
seq
=
5
;
seq
=
5
;
if
(
ret
!=
1
)
{
if
(
ret
!=
RETURN_TEMP_REMOVE_TO_FIELD
)
{
if
(
location
!=
target
->
current
.
location
)
{
if
(
location
!=
target
->
current
.
location
)
{
uint32
resetflag
=
0
;
uint32
resetflag
=
0
;
if
(
location
&
LOCATION_ONFIELD
)
if
(
location
&
LOCATION_ONFIELD
)
...
@@ -4649,10 +4649,10 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4649,10 +4649,10 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
}
}
if
(
!
(
target
->
current
.
location
&
LOCATION_ONFIELD
))
if
(
!
(
target
->
current
.
location
&
LOCATION_ONFIELD
))
target
->
clear_relate_effect
();
target
->
clear_relate_effect
();
if
(
ret
==
1
)
if
(
ret
==
RETURN_TEMP_REMOVE_TO_FIELD
)
target
->
current
.
reason
&=
~
REASON_TEMPORARY
;
target
->
current
.
reason
&=
~
REASON_TEMPORARY
;
if
(
ret
==
0
&&
location
!=
target
->
current
.
location
if
(
ret
==
0
&&
location
!=
target
->
current
.
location
||
ret
==
1
&&
target
->
turnid
!=
infos
.
turn_id
)
{
||
ret
==
RETURN_TEMP_REMOVE_TO_FIELD
&&
target
->
turnid
!=
infos
.
turn_id
)
{
target
->
set_status
(
STATUS_SUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_SUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_FLIP_SUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_FLIP_SUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_SPSUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_SPSUMMON_TURN
,
FALSE
);
...
@@ -4770,9 +4770,9 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
...
@@ -4770,9 +4770,9 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
}
}
}
}
}
}
if
(
enable
||
((
ret
==
1
)
&&
target
->
is_position
(
POS_FACEUP
)))
if
(
enable
||
((
ret
==
RETURN_TEMP_REMOVE_TO_FIELD
)
&&
target
->
is_position
(
POS_FACEUP
)))
target
->
enable_field_effect
(
true
);
target
->
enable_field_effect
(
true
);
if
(
ret
==
1
&&
target
->
current
.
location
==
LOCATION_MZONE
&&
!
(
target
->
data
.
type
&
TYPE_MONSTER
))
if
(
ret
==
RETURN_TEMP_REMOVE_TO_FIELD
&&
target
->
current
.
location
==
LOCATION_MZONE
&&
!
(
target
->
data
.
type
&
TYPE_MONSTER
))
send_to
(
target
,
0
,
REASON_RULE
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
PLAYER_NONE
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
0
);
else
{
else
{
if
(
target
->
previous
.
location
==
LOCATION_GRAVE
)
{
if
(
target
->
previous
.
location
==
LOCATION_GRAVE
)
{
...
@@ -4955,7 +4955,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
...
@@ -4955,7 +4955,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
pcard
->
unequip
();
pcard
->
unequip
();
if
(
trapmonster
)
{
if
(
trapmonster
)
{
refresh_location_info_instant
();
refresh_location_info_instant
();
move_to_field
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
controler
,
LOCATION_SZONE
,
POS_FACEDOWN
,
FALSE
,
2
);
move_to_field
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
controler
,
LOCATION_SZONE
,
POS_FACEDOWN
,
FALSE
,
RETURN_TRAP_MONSTER_TO_SZONE
);
raise_single_event
(
pcard
,
0
,
EVENT_SSET
,
reason_effect
,
0
,
reason_player
,
0
,
0
);
raise_single_event
(
pcard
,
0
,
EVENT_SSET
,
reason_effect
,
0
,
reason_player
,
0
,
0
);
ssets
.
insert
(
pcard
);
ssets
.
insert
(
pcard
);
}
}
...
...
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