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
35d903a9
Commit
35d903a9
authored
Aug 28, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up
parent
e4a284aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
74 deletions
+51
-74
card.cpp
card.cpp
+13
-14
effect.cpp
effect.cpp
+1
-2
field.cpp
field.cpp
+1
-5
interpreter.cpp
interpreter.cpp
+0
-1
libcard.cpp
libcard.cpp
+0
-1
ocgapi.cpp
ocgapi.cpp
+33
-44
operations.cpp
operations.cpp
+3
-7
No files found.
card.cpp
View file @
35d903a9
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
#include "group.h"
#include "group.h"
#include "interpreter.h"
#include "interpreter.h"
#include "ocgapi.h"
#include "ocgapi.h"
#include <iostream>
#include <algorithm>
#include <algorithm>
bool
card_sort
::
operator
()(
void
*
const
&
p1
,
void
*
const
&
p2
)
const
{
bool
card_sort
::
operator
()(
void
*
const
&
p1
,
void
*
const
&
p2
)
const
{
...
@@ -240,7 +239,7 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
...
@@ -240,7 +239,7 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
}
}
*
(
uint32
*
)
buf
=
(
byte
*
)
p
-
buf
;
*
(
uint32
*
)
buf
=
(
byte
*
)
p
-
buf
;
*
(
uint32
*
)(
buf
+
4
)
=
query_flag
;
*
(
uint32
*
)(
buf
+
4
)
=
query_flag
;
return
(
byte
*
)
p
-
buf
;
return
(
uint32
)((
byte
*
)
p
-
buf
)
;
}
}
uint32
card
::
get_info_location
()
{
uint32
card
::
get_info_location
()
{
if
(
overlay_target
)
{
if
(
overlay_target
)
{
...
@@ -403,10 +402,10 @@ int32 card::is_fusion_set_card(uint32 set_code) {
...
@@ -403,10 +402,10 @@ int32 card::is_fusion_set_card(uint32 set_code) {
setcode
=
setcode
>>
16
;
setcode
=
setcode
>>
16
;
}
}
}
}
e
ffect_set
eset2
;
e
set
.
clear
()
;
filter_effect
(
EFFECT_ADD_FUSION_SETCODE
,
&
eset
2
);
filter_effect
(
EFFECT_ADD_FUSION_SETCODE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
2
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
uint32
setcode
=
eset
2
[
i
]
->
get_value
(
this
);
uint32
setcode
=
eset
[
i
]
->
get_value
(
this
);
if
((
setcode
&
0xfff
)
==
settype
&&
(
setcode
&
0xf000
&
setsubtype
)
==
setsubtype
)
if
((
setcode
&
0xfff
)
==
settype
&&
(
setcode
&
0xf000
&
setsubtype
)
==
setsubtype
)
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1023,12 +1022,10 @@ uint32 card::get_attribute() {
...
@@ -1023,12 +1022,10 @@ uint32 card::get_attribute() {
if
(
temp
.
attribute
!=
0xffffffff
)
if
(
temp
.
attribute
!=
0xffffffff
)
return
temp
.
attribute
;
return
temp
.
attribute
;
effect_set
effects
;
effect_set
effects
;
effect_set
effects2
;
int32
attribute
=
data
.
attribute
;
int32
attribute
=
data
.
attribute
;
temp
.
attribute
=
data
.
attribute
;
temp
.
attribute
=
data
.
attribute
;
filter_effect
(
EFFECT_ADD_ATTRIBUTE
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_ADD_ATTRIBUTE
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_REMOVE_ATTRIBUTE
,
&
effects
);
filter_effect
(
EFFECT_REMOVE_ATTRIBUTE
,
&
effects
);
filter_effect
(
EFFECT_CHANGE_ATTRIBUTE
,
&
effects2
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
if
(
effects
[
i
]
->
code
==
EFFECT_ADD_ATTRIBUTE
)
if
(
effects
[
i
]
->
code
==
EFFECT_ADD_ATTRIBUTE
)
attribute
|=
effects
[
i
]
->
get_value
(
this
);
attribute
|=
effects
[
i
]
->
get_value
(
this
);
...
@@ -1036,8 +1033,10 @@ uint32 card::get_attribute() {
...
@@ -1036,8 +1033,10 @@ uint32 card::get_attribute() {
attribute
&=
~
(
effects
[
i
]
->
get_value
(
this
));
attribute
&=
~
(
effects
[
i
]
->
get_value
(
this
));
temp
.
attribute
=
attribute
;
temp
.
attribute
=
attribute
;
}
}
for
(
int32
i
=
0
;
i
<
effects2
.
size
();
++
i
)
{
effects
.
clear
();
attribute
=
effects2
[
i
]
->
get_value
(
this
);
filter_effect
(
EFFECT_CHANGE_ATTRIBUTE
,
&
effects
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
attribute
=
effects
[
i
]
->
get_value
(
this
);
temp
.
attribute
=
attribute
;
temp
.
attribute
=
attribute
;
}
}
temp
.
attribute
=
0xffffffff
;
temp
.
attribute
=
0xffffffff
;
...
@@ -1074,12 +1073,10 @@ uint32 card::get_race() {
...
@@ -1074,12 +1073,10 @@ uint32 card::get_race() {
if
(
temp
.
race
!=
0xffffffff
)
if
(
temp
.
race
!=
0xffffffff
)
return
temp
.
race
;
return
temp
.
race
;
effect_set
effects
;
effect_set
effects
;
effect_set
effects2
;
int32
race
=
data
.
race
;
int32
race
=
data
.
race
;
temp
.
race
=
data
.
race
;
temp
.
race
=
data
.
race
;
filter_effect
(
EFFECT_ADD_RACE
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_ADD_RACE
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_REMOVE_RACE
,
&
effects
);
filter_effect
(
EFFECT_REMOVE_RACE
,
&
effects
);
filter_effect
(
EFFECT_CHANGE_RACE
,
&
effects2
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
if
(
effects
[
i
]
->
code
==
EFFECT_ADD_RACE
)
if
(
effects
[
i
]
->
code
==
EFFECT_ADD_RACE
)
race
|=
effects
[
i
]
->
get_value
(
this
);
race
|=
effects
[
i
]
->
get_value
(
this
);
...
@@ -1087,8 +1084,10 @@ uint32 card::get_race() {
...
@@ -1087,8 +1084,10 @@ uint32 card::get_race() {
race
&=
~
(
effects
[
i
]
->
get_value
(
this
));
race
&=
~
(
effects
[
i
]
->
get_value
(
this
));
temp
.
race
=
race
;
temp
.
race
=
race
;
}
}
for
(
int32
i
=
0
;
i
<
effects2
.
size
();
++
i
)
{
effects
.
clear
();
race
=
effects2
[
i
]
->
get_value
(
this
);
filter_effect
(
EFFECT_CHANGE_RACE
,
&
effects
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
race
=
effects
[
i
]
->
get_value
(
this
);
temp
.
race
=
race
;
temp
.
race
=
race
;
}
}
temp
.
race
=
0xffffffff
;
temp
.
race
=
0xffffffff
;
...
...
effect.cpp
View file @
35d903a9
...
@@ -494,9 +494,8 @@ int32 effect::is_player_effect_target(card* pcard) {
...
@@ -494,9 +494,8 @@ int32 effect::is_player_effect_target(card* pcard) {
}
}
int32
effect
::
is_immuned
(
card
*
pcard
)
{
int32
effect
::
is_immuned
(
card
*
pcard
)
{
effect_set_v
effects
=
pcard
->
immune_effect
;
effect_set_v
effects
=
pcard
->
immune_effect
;
effect
*
peffect
;
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
peffect
=
effects
.
at
(
i
);
effect
*
peffect
=
effects
.
at
(
i
);
if
(
peffect
->
value
)
{
if
(
peffect
->
value
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
...
...
field.cpp
View file @
35d903a9
...
@@ -11,9 +11,6 @@
...
@@ -11,9 +11,6 @@
#include "group.h"
#include "group.h"
#include "effect.h"
#include "effect.h"
#include "interpreter.h"
#include "interpreter.h"
#include <iostream>
#include <cstring>
#include <map>
int32
field
::
field_used_count
[
32
]
=
{
0
,
1
,
1
,
2
,
1
,
2
,
2
,
3
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
};
int32
field
::
field_used_count
[
32
]
=
{
0
,
1
,
1
,
2
,
1
,
2
,
2
,
3
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
2
,
3
,
3
,
4
,
3
,
4
,
4
,
5
};
...
@@ -32,7 +29,7 @@ void chain::set_triggering_place(card* pcard) {
...
@@ -32,7 +29,7 @@ void chain::set_triggering_place(card* pcard) {
triggering_position
=
pcard
->
current
.
position
;
triggering_position
=
pcard
->
current
.
position
;
}
}
bool
tevent
::
operator
<
(
const
tevent
&
v
)
const
{
bool
tevent
::
operator
<
(
const
tevent
&
v
)
const
{
return
memcmp
(
this
,
&
v
,
sizeof
(
tevent
))
<
0
;
return
std
::
memcmp
(
this
,
&
v
,
sizeof
(
tevent
))
<
0
;
}
}
field
::
field
(
duel
*
pduel
)
{
field
::
field
(
duel
*
pduel
)
{
this
->
pduel
=
pduel
;
this
->
pduel
=
pduel
;
...
@@ -1280,7 +1277,6 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
...
@@ -1280,7 +1277,6 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
if
(
sort
)
if
(
sort
)
eset
->
sort
();
eset
->
sort
();
}
}
// put all cards in the target of peffect into cset
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
return
;
return
;
...
...
interpreter.cpp
View file @
35d903a9
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <iostream>
#include "duel.h"
#include "duel.h"
#include "group.h"
#include "group.h"
#include "card.h"
#include "card.h"
...
...
libcard.cpp
View file @
35d903a9
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include "card.h"
#include "card.h"
#include "effect.h"
#include "effect.h"
#include "group.h"
#include "group.h"
#include <iostream>
int32
scriptlib
::
card_get_code
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_code
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
...
...
ocgapi.cpp
View file @
35d903a9
...
@@ -242,17 +242,15 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
...
@@ -242,17 +242,15 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
return
0
;
return
0
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
auto
&
player
=
ptduel
->
game_field
->
player
[
playerid
];
auto
&
player
=
ptduel
->
game_field
->
player
[
playerid
];
uint32
ct
=
0
,
clen
;
byte
*
p
=
buf
;
byte
*
p
=
buf
;
if
(
location
==
LOCATION_MZONE
)
{
if
(
location
==
LOCATION_MZONE
)
{
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
)
{
if
(
pcard
)
{
ct
+=
clen
=
pcard
->
get_infos
(
p
,
query_flag
,
use_cache
);
uint32
clen
=
pcard
->
get_infos
(
p
,
query_flag
,
use_cache
);
p
+=
clen
;
p
+=
clen
;
}
else
{
}
else
{
*
((
int32
*
)
p
)
=
4
;
*
((
int32
*
)
p
)
=
4
;
ct
+=
4
;
p
+=
4
;
p
+=
4
;
}
}
}
}
...
@@ -260,11 +258,10 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
...
@@ -260,11 +258,10 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
)
{
if
(
pcard
)
{
ct
+=
clen
=
pcard
->
get_infos
(
p
,
query_flag
,
use_cache
);
uint32
clen
=
pcard
->
get_infos
(
p
,
query_flag
,
use_cache
);
p
+=
clen
;
p
+=
clen
;
}
else
{
}
else
{
*
((
int32
*
)
p
)
=
4
;
*
((
int32
*
)
p
)
=
4
;
ct
+=
4
;
p
+=
4
;
p
+=
4
;
}
}
}
}
...
@@ -281,69 +278,61 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
...
@@ -281,69 +278,61 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
else
if
(
location
==
LOCATION_DECK
)
else
if
(
location
==
LOCATION_DECK
)
lst
=
&
player
.
list_main
;
lst
=
&
player
.
list_main
;
for
(
auto
cit
=
lst
->
begin
();
cit
!=
lst
->
end
();
++
cit
)
{
for
(
auto
cit
=
lst
->
begin
();
cit
!=
lst
->
end
();
++
cit
)
{
ct
+=
clen
=
(
*
cit
)
->
get_infos
(
p
,
query_flag
,
use_cache
);
uint32
clen
=
(
*
cit
)
->
get_infos
(
p
,
query_flag
,
use_cache
);
p
+=
clen
;
p
+=
clen
;
}
}
}
}
return
ct
;
return
(
int32
)(
p
-
buf
)
;
}
}
extern
"C"
DECL_DLLEXPORT
int32
query_field_info
(
ptr
pduel
,
byte
*
buf
)
{
extern
"C"
DECL_DLLEXPORT
int32
query_field_info
(
ptr
pduel
,
byte
*
buf
)
{
duel
*
ptduel
=
(
duel
*
)
pduel
;
duel
*
ptduel
=
(
duel
*
)
pduel
;
*
buf
++
=
MSG_RELOAD_FIELD
;
byte
*
p
=
buf
;
*
buf
++
=
ptduel
->
game_field
->
core
.
duel_rule
;
*
p
++
=
MSG_RELOAD_FIELD
;
int32
ct
=
2
;
*
p
++
=
ptduel
->
game_field
->
core
.
duel_rule
;
for
(
int
playerid
=
0
;
playerid
<
2
;
++
playerid
)
{
for
(
int
playerid
=
0
;
playerid
<
2
;
++
playerid
)
{
auto
&
player
=
ptduel
->
game_field
->
player
[
playerid
];
auto
&
player
=
ptduel
->
game_field
->
player
[
playerid
];
*
((
int
*
)(
buf
))
=
player
.
lp
;
*
((
int
*
)
p
)
=
player
.
lp
;
buf
+=
4
;
p
+=
4
;
ct
+=
4
;
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
for
(
auto
cit
=
player
.
list_mzone
.
begin
();
cit
!=
player
.
list_mzone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
)
{
if
(
pcard
)
{
*
buf
++
=
1
;
*
p
++
=
1
;
*
buf
++
=
pcard
->
current
.
position
;
*
p
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
xyz_materials
.
size
();
*
p
++
=
pcard
->
xyz_materials
.
size
();
ct
+=
3
;
}
else
{
}
else
{
*
buf
++
=
0
;
*
p
++
=
0
;
ct
++
;
}
}
}
}
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
for
(
auto
cit
=
player
.
list_szone
.
begin
();
cit
!=
player
.
list_szone
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
)
{
if
(
pcard
)
{
*
buf
++
=
1
;
*
p
++
=
1
;
*
buf
++
=
pcard
->
current
.
position
;
*
p
++
=
pcard
->
current
.
position
;
ct
+=
2
;
}
else
{
}
else
{
*
buf
++
=
0
;
*
p
++
=
0
;
ct
++
;
}
}
}
}
*
buf
++
=
player
.
list_main
.
size
();
*
p
++
=
player
.
list_main
.
size
();
*
buf
++
=
player
.
list_hand
.
size
();
*
p
++
=
player
.
list_hand
.
size
();
*
buf
++
=
player
.
list_grave
.
size
();
*
p
++
=
player
.
list_grave
.
size
();
*
buf
++
=
player
.
list_remove
.
size
();
*
p
++
=
player
.
list_remove
.
size
();
*
buf
++
=
player
.
list_extra
.
size
();
*
p
++
=
player
.
list_extra
.
size
();
*
buf
++
=
player
.
extra_p_count
;
*
p
++
=
player
.
extra_p_count
;
ct
+=
6
;
}
}
*
buf
++
=
ptduel
->
game_field
->
core
.
current_chain
.
size
();
*
p
++
=
ptduel
->
game_field
->
core
.
current_chain
.
size
();
ct
++
;
for
(
auto
chit
=
ptduel
->
game_field
->
core
.
current_chain
.
begin
();
chit
!=
ptduel
->
game_field
->
core
.
current_chain
.
end
();
++
chit
)
{
for
(
auto
chit
=
ptduel
->
game_field
->
core
.
current_chain
.
begin
();
chit
!=
ptduel
->
game_field
->
core
.
current_chain
.
end
();
++
chit
)
{
effect
*
peffect
=
chit
->
triggering_effect
;
effect
*
peffect
=
chit
->
triggering_effect
;
*
((
int
*
)(
buf
))
=
peffect
->
get_handler
()
->
data
.
code
;
*
((
int
*
)
p
)
=
peffect
->
get_handler
()
->
data
.
code
;
buf
+=
4
;
p
+=
4
;
*
((
int
*
)(
buf
))
=
peffect
->
get_handler
()
->
get_info_location
();
*
((
int
*
)
p
)
=
peffect
->
get_handler
()
->
get_info_location
();
buf
+=
4
;
p
+=
4
;
*
buf
++
=
chit
->
triggering_controler
;
*
p
++
=
chit
->
triggering_controler
;
*
buf
++
=
(
uint8
)
chit
->
triggering_location
;
*
p
++
=
(
uint8
)
chit
->
triggering_location
;
*
buf
++
=
chit
->
triggering_sequence
;
*
p
++
=
chit
->
triggering_sequence
;
*
((
int
*
)(
buf
))
=
peffect
->
description
;
*
((
int
*
)
p
)
=
peffect
->
description
;
buf
+=
4
;
p
+=
4
;
ct
+=
15
;
}
}
return
ct
;
return
(
int32
)(
p
-
buf
)
;
}
}
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
ptr
pduel
,
int32
value
)
{
extern
"C"
DECL_DLLEXPORT
void
set_responsei
(
ptr
pduel
,
int32
value
)
{
((
duel
*
)
pduel
)
->
set_responsei
(
value
);
((
duel
*
)
pduel
)
->
set_responsei
(
value
);
...
...
operations.cpp
View file @
35d903a9
...
@@ -260,12 +260,8 @@ void field::release(card* target, effect* reason_effect, uint32 reason, uint32 r
...
@@ -260,12 +260,8 @@ void field::release(card* target, effect* reason_effect, uint32 reason, uint32 r
void
field
::
send_to
(
card_set
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
destination
,
uint32
sequence
,
uint32
position
)
{
void
field
::
send_to
(
card_set
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
destination
,
uint32
sequence
,
uint32
position
)
{
if
(
destination
&
LOCATION_ONFIELD
)
if
(
destination
&
LOCATION_ONFIELD
)
return
;
return
;
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();
)
{
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();
++
cit
)
{
card
*
pcard
=
*
cit
++
;
card
*
pcard
=
*
cit
;
if
((
destination
&
LOCATION_EXTRA
)
&&
!
(
pcard
->
data
.
type
&
TYPE_PENDULUM
))
{
targets
->
erase
(
pcard
);
continue
;
}
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
temp
.
reason_effect
=
pcard
->
current
.
reason_effect
;
pcard
->
temp
.
reason_effect
=
pcard
->
current
.
reason_effect
;
pcard
->
temp
.
reason_player
=
pcard
->
current
.
reason_player
;
pcard
->
temp
.
reason_player
=
pcard
->
current
.
reason_player
;
...
@@ -273,7 +269,7 @@ void field::send_to(card_set* targets, effect* reason_effect, uint32 reason, uin
...
@@ -273,7 +269,7 @@ void field::send_to(card_set* targets, effect* reason_effect, uint32 reason, uin
pcard
->
current
.
reason_effect
=
reason_effect
;
pcard
->
current
.
reason_effect
=
reason_effect
;
pcard
->
current
.
reason_player
=
reason_player
;
pcard
->
current
.
reason_player
=
reason_player
;
uint32
p
=
playerid
;
uint32
p
=
playerid
;
// send to hand from deck
&
playerid not given => send to the hand of controler
// send to hand from deck
and
playerid not given => send to the hand of controler
if
(
p
==
PLAYER_NONE
&&
(
destination
&
LOCATION_HAND
)
&&
(
pcard
->
current
.
location
&
LOCATION_DECK
)
&&
pcard
->
current
.
controler
==
reason_player
)
if
(
p
==
PLAYER_NONE
&&
(
destination
&
LOCATION_HAND
)
&&
(
pcard
->
current
.
location
&
LOCATION_DECK
)
&&
pcard
->
current
.
controler
==
reason_player
)
p
=
reason_player
;
p
=
reason_player
;
if
(
destination
&
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
||
p
==
PLAYER_NONE
)
if
(
destination
&
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
||
p
==
PLAYER_NONE
)
...
...
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