Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
e0ab2804
Commit
e0ab2804
authored
Aug 29, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
cf4c3ac0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
50 deletions
+27
-50
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+12
-13
Classes/ocgcore/effect.cpp
Classes/ocgcore/effect.cpp
+1
-2
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+1
-5
Classes/ocgcore/interpreter.cpp
Classes/ocgcore/interpreter.cpp
+0
-1
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+0
-1
Classes/ocgcore/ocgapi.cpp
Classes/ocgcore/ocgapi.cpp
+10
-21
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+3
-7
No files found.
Classes/ocgcore/card.cpp
View file @
e0ab2804
...
@@ -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
{
...
@@ -407,10 +406,10 @@ int32 card::is_fusion_set_card(uint32 set_code) {
...
@@ -407,10 +406,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
;
}
}
...
@@ -1027,12 +1026,10 @@ uint32 card::get_attribute() {
...
@@ -1027,12 +1026,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
);
...
@@ -1040,8 +1037,10 @@ uint32 card::get_attribute() {
...
@@ -1040,8 +1037,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
;
...
@@ -1078,12 +1077,10 @@ uint32 card::get_race() {
...
@@ -1078,12 +1077,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
);
...
@@ -1091,8 +1088,10 @@ uint32 card::get_race() {
...
@@ -1091,8 +1088,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
;
...
...
Classes/ocgcore/effect.cpp
View file @
e0ab2804
...
@@ -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
);
...
...
Classes/ocgcore/field.cpp
View file @
e0ab2804
...
@@ -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
;
...
@@ -1283,7 +1280,6 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
...
@@ -1283,7 +1280,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
;
...
...
Classes/ocgcore/interpreter.cpp
View file @
e0ab2804
...
@@ -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"
...
...
Classes/ocgcore/libcard.cpp
View file @
e0ab2804
...
@@ -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
);
...
...
Classes/ocgcore/ocgapi.cpp
View file @
e0ab2804
...
@@ -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,32 +278,29 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
...
@@ -281,32 +278,29 @@ 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
;
byte
*
p
=
buf
;
*
buf
++
=
MSG_RELOAD_FIELD
;
*
buf
++
=
MSG_RELOAD_FIELD
;
*
buf
++
=
ptduel
->
game_field
->
core
.
duel_rule
;
*
buf
++
=
ptduel
->
game_field
->
core
.
duel_rule
;
int32
ct
=
2
;
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
*
)
buf
)
=
player
.
lp
;
buf
+=
4
;
buf
+=
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
;
*
buf
++
=
1
;
*
buf
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
xyz_materials
.
size
();
*
buf
++
=
pcard
->
xyz_materials
.
size
();
ct
+=
3
;
}
else
{
}
else
{
*
buf
++
=
0
;
*
buf
++
=
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
)
{
...
@@ -314,10 +308,8 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -314,10 +308,8 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
if
(
pcard
)
{
if
(
pcard
)
{
*
buf
++
=
1
;
*
buf
++
=
1
;
*
buf
++
=
pcard
->
current
.
position
;
*
buf
++
=
pcard
->
current
.
position
;
ct
+=
2
;
}
else
{
}
else
{
*
buf
++
=
0
;
*
buf
++
=
0
;
ct
++
;
}
}
}
}
*
buf
++
=
player
.
list_main
.
size
();
*
buf
++
=
player
.
list_main
.
size
();
...
@@ -326,24 +318,21 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
...
@@ -326,24 +318,21 @@ extern "C" DECL_DLLEXPORT int32 query_field_info(ptr pduel, byte* buf) {
*
buf
++
=
player
.
list_remove
.
size
();
*
buf
++
=
player
.
list_remove
.
size
();
*
buf
++
=
player
.
list_extra
.
size
();
*
buf
++
=
player
.
list_extra
.
size
();
*
buf
++
=
player
.
extra_p_count
;
*
buf
++
=
player
.
extra_p_count
;
ct
+=
6
;
}
}
*
buf
++
=
ptduel
->
game_field
->
core
.
current_chain
.
size
();
*
buf
++
=
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
*
)
buf
)
=
peffect
->
get_handler
()
->
data
.
code
;
buf
+=
4
;
buf
+=
4
;
*
((
int
*
)
(
buf
)
)
=
peffect
->
get_handler
()
->
get_info_location
();
*
((
int
*
)
buf
)
=
peffect
->
get_handler
()
->
get_info_location
();
buf
+=
4
;
buf
+=
4
;
*
buf
++
=
chit
->
triggering_controler
;
*
buf
++
=
chit
->
triggering_controler
;
*
buf
++
=
(
uint8
)
chit
->
triggering_location
;
*
buf
++
=
(
uint8
)
chit
->
triggering_location
;
*
buf
++
=
chit
->
triggering_sequence
;
*
buf
++
=
chit
->
triggering_sequence
;
*
((
int
*
)
(
buf
)
)
=
peffect
->
description
;
*
((
int
*
)
buf
)
=
peffect
->
description
;
buf
+=
4
;
buf
+=
4
;
ct
+=
15
;
}
}
return
ct
;
return
(
int32
)(
buf
-
p
)
;
}
}
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
);
...
...
Classes/ocgcore/operations.cpp
View file @
e0ab2804
...
@@ -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