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
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
MyCard
ygopro-core
Commits
3ee2dd48
Commit
3ee2dd48
authored
Jun 24, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
cd09cf9a
3f7aa8ed
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
484 additions
and
524 deletions
+484
-524
field.cpp
field.cpp
+3
-3
field.h
field.h
+35
-33
libcard.cpp
libcard.cpp
+18
-9
libduel.cpp
libduel.cpp
+332
-80
libgroup.cpp
libgroup.cpp
+90
-13
operations.cpp
operations.cpp
+2
-2
processor.cpp
processor.cpp
+4
-384
No files found.
field.cpp
View file @
3ee2dd48
...
@@ -690,12 +690,11 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui
...
@@ -690,12 +690,11 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui
value
=
eset
[
i
]
->
get_value
(
pcard
,
3
);
value
=
eset
[
i
]
->
get_value
(
pcard
,
3
);
}
}
if
(
eset
[
i
]
->
get_handler_player
()
==
playerid
)
if
(
eset
[
i
]
->
get_handler_player
()
==
playerid
)
flag
|=
~
value
&
0x
1
f
;
flag
|=
~
value
&
0x
7
f
;
else
else
flag
|=
~
(
value
>>
16
)
&
0x
1
f
;
flag
|=
~
(
value
>>
16
)
&
0x
7
f
;
}
}
uint32
linked_zone
=
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
);
uint32
linked_zone
=
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
);
flag
=
flag
|
~
zone
|
~
linked_zone
;
if
(
player
[
playerid
].
list_mzone
[
5
]
&&
is_location_useable
(
playerid
,
LOCATION_MZONE
,
6
)
if
(
player
[
playerid
].
list_mzone
[
5
]
&&
is_location_useable
(
playerid
,
LOCATION_MZONE
,
6
)
&&
check_extra_link
(
playerid
,
pcard
,
6
))
{
&&
check_extra_link
(
playerid
,
pcard
,
6
))
{
flag
|=
1u
<<
5
;
flag
|=
1u
<<
5
;
...
@@ -710,6 +709,7 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui
...
@@ -710,6 +709,7 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui
if
(
!
is_location_useable
(
playerid
,
LOCATION_MZONE
,
6
))
if
(
!
is_location_useable
(
playerid
,
LOCATION_MZONE
,
6
))
flag
|=
1u
<<
6
;
flag
|=
1u
<<
6
;
}
}
flag
=
flag
|
~
zone
|
~
linked_zone
;
if
(
list
)
if
(
list
)
*
list
=
flag
&
0x7f
;
*
list
=
flag
&
0x7f
;
int32
count
=
5
-
field_used_count
[
flag
&
0x1f
];
int32
count
=
5
-
field_used_count
[
flag
&
0x1f
];
...
...
field.h
View file @
3ee2dd48
...
@@ -707,7 +707,6 @@ public:
...
@@ -707,7 +707,6 @@ public:
#define PROCESSOR_SELECT_PLACE 18
#define PROCESSOR_SELECT_PLACE 18
#define PROCESSOR_SELECT_POSITION 19
#define PROCESSOR_SELECT_POSITION 19
#define PROCESSOR_SELECT_TRIBUTE_P 20
#define PROCESSOR_SELECT_TRIBUTE_P 20
//#define PROCESSOR_SORT_CHAIN 21
#define PROCESSOR_SELECT_COUNTER 22
#define PROCESSOR_SELECT_COUNTER 22
#define PROCESSOR_SELECT_SUM 23
#define PROCESSOR_SELECT_SUM 23
#define PROCESSOR_SELECT_DISFIELD 24
#define PROCESSOR_SELECT_DISFIELD 24
...
@@ -756,10 +755,6 @@ public:
...
@@ -756,10 +755,6 @@ public:
#define PROCESSOR_ATTACK_DISABLE 82
#define PROCESSOR_ATTACK_DISABLE 82
#define PROCESSOR_ACTIVATE_EFFECT 83
#define PROCESSOR_ACTIVATE_EFFECT 83
#define PROCESSOR_DESTROY_S 100
#define PROCESSOR_RELEASE_S 101
#define PROCESSOR_SENDTO_S 102
#define PROCESSOR_CHANGEPOS_S 103
#define PROCESSOR_ANNOUNCE_RACE 110
#define PROCESSOR_ANNOUNCE_RACE 110
#define PROCESSOR_ANNOUNCE_ATTRIB 111
#define PROCESSOR_ANNOUNCE_ATTRIB 111
#define PROCESSOR_ANNOUNCE_LEVEL 112
#define PROCESSOR_ANNOUNCE_LEVEL 112
...
@@ -770,36 +765,43 @@ public:
...
@@ -770,36 +765,43 @@ public:
#define PROCESSOR_TOSS_DICE 117
#define PROCESSOR_TOSS_DICE 117
#define PROCESSOR_TOSS_COIN 118
#define PROCESSOR_TOSS_COIN 118
#define PROCESSOR_ROCK_PAPER_SCISSORS 119
#define PROCESSOR_ROCK_PAPER_SCISSORS 119
#define PROCESSOR_SELECT_YESNO_S 120
#define PROCESSOR_SELECT_OPTION_S 121
#define PROCESSOR_SELECT_CARD_S 122
#define PROCESSOR_SELECT_EFFECTYN_S 123
#define PROCESSOR_SELECT_UNSELECT_CARD_S 124
//#define PROCESSOR_SELECT_PLACE_S 125
#define PROCESSOR_SELECT_POSITION_S 126
#define PROCESSOR_SELECT_TRIBUTE_S 127
#define PROCESSOR_SORT_CARDS_S 128
#define PROCESSOR_SELECT_RELEASE_S 129
#define PROCESSOR_SELECT_TARGET 130
#define PROCESSOR_SELECT_FUSION 131
#define PROCESSOR_SELECT_FUSION 131
#define PROCESSOR_SELECT_SYNCHRO 132
#define PROCESSOR_SELECT_SYNCHRO 132
#define PROCESSOR_SELECT_SUM_S 133
#define PROCESSOR_SELECT_DISFIELD_S 134
#define PROCESSOR_SPSUMMON_S 135
#define PROCESSOR_SPSUMMON_STEP_S 136
#define PROCESSOR_SPSUMMON_COMP_S 137
#define PROCESSOR_RANDOM_SELECT_S 138
#define PROCESSOR_SELECT_XMATERIAL 139
#define PROCESSOR_SELECT_XMATERIAL 139
#define PROCESSOR_DRAW_S 140
#define PROCESSOR_DISCARD_HAND 150
#define PROCESSOR_DAMAGE_S 141
#define PROCESSOR_DISCARD_DECK 151
#define PROCESSOR_RECOVER_S 142
#define PROCESSOR_SORT_DECK 152
#define PROCESSOR_EQUIP_S 143
#define PROCESSOR_REMOVE_OVERLAY 160
#define PROCESSOR_GET_CONTROL_S 144
#define PROCESSOR_SWAP_CONTROL_S 145
//#define PROCESSOR_SORT_CHAIN 21
#define PROCESSOR_DISCARD_HAND_S 150
//#define PROCESSOR_DESTROY_S 100
#define PROCESSOR_DISCARD_DECK_S 151
//#define PROCESSOR_RELEASE_S 101
#define PROCESSOR_SORT_DECK_S 152
//#define PROCESSOR_SENDTO_S 102
#define PROCESSOR_REMOVEOL_S 160
//#define PROCESSOR_CHANGEPOS_S 103
#define PROCESSOR_MOVETOFIELD_S 161
//#define PROCESSOR_SELECT_YESNO_S 120
//#define PROCESSOR_SELECT_OPTION_S 121
//#define PROCESSOR_SELECT_CARD_S 122
//#define PROCESSOR_SELECT_EFFECTYN_S 123
//#define PROCESSOR_SELECT_UNSELECT_CARD_S 124
//#define PROCESSOR_SELECT_PLACE_S 125
//#define PROCESSOR_SELECT_POSITION_S 126
//#define PROCESSOR_SELECT_TRIBUTE_S 127
//#define PROCESSOR_SORT_CARDS_S 128
//#define PROCESSOR_SELECT_RELEASE_S 129
//#define PROCESSOR_SELECT_TARGET 130
//#define PROCESSOR_SELECT_SUM_S 133
//#define PROCESSOR_SELECT_DISFIELD_S 134
//#define PROCESSOR_SPSUMMON_S 135
//#define PROCESSOR_SPSUMMON_STEP_S 136
//#define PROCESSOR_SPSUMMON_COMP_S 137
//#define PROCESSOR_RANDOM_SELECT_S 138
//#define PROCESSOR_DRAW_S 140
//#define PROCESSOR_DAMAGE_S 141
//#define PROCESSOR_RECOVER_S 142
//#define PROCESSOR_EQUIP_S 143
//#define PROCESSOR_GET_CONTROL_S 144
//#define PROCESSOR_SWAP_CONTROL_S 145
//#define PROCESSOR_MOVETOFIELD_S 161
#endif
/* FIELD_H_ */
#endif
/* FIELD_H_ */
libcard.cpp
View file @
3ee2dd48
...
@@ -1345,7 +1345,11 @@ int32 scriptlib::card_remove_overlay_card(lua_State *L) {
...
@@ -1345,7 +1345,11 @@ int32 scriptlib::card_remove_overlay_card(lua_State *L) {
int32
reason
=
lua_tointeger
(
L
,
5
);
int32
reason
=
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
pcard
->
pduel
;
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
remove_overlay_card
(
reason
,
pcard
,
playerid
,
0
,
0
,
min
,
max
);
pduel
->
game_field
->
remove_overlay_card
(
reason
,
pcard
,
playerid
,
0
,
0
,
min
,
max
);
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushboolean
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
return
1
;
});
}
}
int32
scriptlib
::
card_get_attacked_group
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_attacked_group
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
...
@@ -2572,21 +2576,26 @@ int32 scriptlib::card_remove_counter(lua_State *L) {
...
@@ -2572,21 +2576,26 @@ int32 scriptlib::card_remove_counter(lua_State *L) {
uint32
countertype
=
lua_tointeger
(
L
,
3
);
uint32
countertype
=
lua_tointeger
(
L
,
3
);
uint32
count
=
lua_tointeger
(
L
,
4
);
uint32
count
=
lua_tointeger
(
L
,
4
);
uint32
reason
=
lua_tointeger
(
L
,
5
);
uint32
reason
=
lua_tointeger
(
L
,
5
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
countertype
==
0
)
{
if
(
countertype
==
0
)
{
// c38834303: remove all counters
// c38834303: remove all counters
for
(
const
auto
&
cmit
:
pcard
->
counters
)
{
for
(
const
auto
&
cmit
:
pcard
->
counters
)
{
p
card
->
p
duel
->
write_buffer8
(
MSG_REMOVE_COUNTER
);
pduel
->
write_buffer8
(
MSG_REMOVE_COUNTER
);
p
card
->
p
duel
->
write_buffer16
(
cmit
.
first
);
pduel
->
write_buffer16
(
cmit
.
first
);
p
card
->
p
duel
->
write_buffer8
(
pcard
->
current
.
controler
);
pduel
->
write_buffer8
(
pcard
->
current
.
controler
);
p
card
->
p
duel
->
write_buffer8
(
pcard
->
current
.
location
);
pduel
->
write_buffer8
(
pcard
->
current
.
location
);
p
card
->
p
duel
->
write_buffer8
(
pcard
->
current
.
sequence
);
pduel
->
write_buffer8
(
pcard
->
current
.
sequence
);
p
card
->
p
duel
->
write_buffer16
(
cmit
.
second
[
0
]
+
cmit
.
second
[
1
]);
pduel
->
write_buffer16
(
cmit
.
second
[
0
]
+
cmit
.
second
[
1
]);
}
}
pcard
->
counters
.
clear
();
pcard
->
counters
.
clear
();
return
0
;
return
0
;
}
else
{
}
else
{
pcard
->
pduel
->
game_field
->
remove_counter
(
reason
,
pcard
,
rplayer
,
0
,
0
,
countertype
,
count
);
pduel
->
game_field
->
remove_counter
(
reason
,
pcard
,
rplayer
,
0
,
0
,
countertype
,
count
);
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushboolean
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
return
1
;
});
}
}
}
}
int32
scriptlib
::
card_get_counter
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_counter
(
lua_State
*
L
)
{
...
...
libduel.cpp
View file @
3ee2dd48
This diff is collapsed.
Click to expand it.
libgroup.cpp
View file @
3ee2dd48
...
@@ -217,8 +217,17 @@ int32 scriptlib::group_filter_select(lua_State *L) {
...
@@ -217,8 +217,17 @@ int32 scriptlib::group_filter_select(lua_State *L) {
if
(
pduel
->
lua
->
check_matching
(
pcard
,
3
,
extraargs
))
if
(
pduel
->
lua
->
check_matching
(
pcard
,
3
,
extraargs
))
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pcard
);
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pcard
);
}
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_CARD_S
,
0
,
0
,
0
,
playerid
,
min
+
(
max
<<
16
));
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
max
<<
16
));
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
group
*
pgroup
=
pduel
->
new_group
();
for
(
int32
i
=
0
;
i
<
pduel
->
game_field
->
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
});
}
}
int32
scriptlib
::
group_select
(
lua_State
*
L
)
{
int32
scriptlib
::
group_select
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_action_permission
(
L
);
...
@@ -244,8 +253,17 @@ int32 scriptlib::group_select(lua_State *L) {
...
@@ -244,8 +253,17 @@ int32 scriptlib::group_select(lua_State *L) {
for
(
auto
&
pcard
:
cset
)
{
for
(
auto
&
pcard
:
cset
)
{
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pcard
);
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pcard
);
}
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_CARD_S
,
0
,
0
,
0
,
playerid
,
min
+
(
max
<<
16
));
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
max
<<
16
));
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
group
*
pgroup
=
pduel
->
new_group
();
for
(
int32
i
=
0
;
i
<
pduel
->
game_field
->
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
});
}
}
int32
scriptlib
::
group_select_unselect
(
lua_State
*
L
)
{
int32
scriptlib
::
group_select_unselect
(
lua_State
*
L
)
{
check_action_permission
(
L
);
check_action_permission
(
L
);
...
@@ -294,17 +312,54 @@ int32 scriptlib::group_select_unselect(lua_State *L) {
...
@@ -294,17 +312,54 @@ int32 scriptlib::group_select_unselect(lua_State *L) {
for
(
auto
it
=
pgroup2
->
container
.
begin
();
it
!=
pgroup2
->
container
.
end
();
++
it
)
{
for
(
auto
it
=
pgroup2
->
container
.
begin
();
it
!=
pgroup2
->
container
.
end
();
++
it
)
{
pduel
->
game_field
->
core
.
unselect_cards
.
push_back
(
*
it
);
pduel
->
game_field
->
core
.
unselect_cards
.
push_back
(
*
it
);
}
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_UNSELECT_CARD_S
,
0
,
0
,
0
,
playerid
+
(
cancelable
<<
16
),
min
+
(
max
<<
16
),
finishable
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_UNSELECT_CARD
,
0
,
0
,
0
,
playerid
+
(
cancelable
<<
16
),
min
+
(
max
<<
16
),
finishable
);
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
if
(
pduel
->
game_field
->
returns
.
bvalue
[
0
]
==
-
1
)
{
lua_pushnil
(
L
);
}
else
{
card
*
pcard
;
if
((
size_t
)
pduel
->
game_field
->
returns
.
bvalue
[
1
]
<
pduel
->
game_field
->
core
.
select_cards
.
size
())
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
1
]];
else
pcard
=
pduel
->
game_field
->
core
.
unselect_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
1
]
-
pduel
->
game_field
->
core
.
select_cards
.
size
()];
interpreter
::
card2value
(
L
,
pcard
);
}
return
1
;
});
}
}
int32
scriptlib
::
group_random_select
(
lua_State
*
L
)
{
int32
scriptlib
::
group_random_select
(
lua_State
*
L
)
{
check_param_count
(
L
,
3
);
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
2
);
int32
playerid
=
lua_tointeger
(
L
,
2
);
int32
count
=
lua_tointeger
(
L
,
3
);
uint32
count
=
lua_tointeger
(
L
,
3
);
pgroup
->
pduel
->
game_field
->
add_process
(
PROCESSOR_RANDOM_SELECT_S
,
0
,
0
,
pgroup
,
playerid
,
count
);
duel
*
pduel
=
pgroup
->
pduel
;
return
lua_yield
(
L
,
0
);
group
*
newgroup
=
pduel
->
new_group
();
if
(
count
>
pgroup
->
container
.
size
())
count
=
pgroup
->
container
.
size
();
if
(
count
==
0
)
{
interpreter
::
group2value
(
L
,
newgroup
);
return
1
;
}
if
(
count
==
pgroup
->
container
.
size
())
newgroup
->
container
=
pgroup
->
container
;
else
{
while
(
newgroup
->
container
.
size
()
<
count
)
{
int32
i
=
pduel
->
get_next_integer
(
0
,
pgroup
->
container
.
size
()
-
1
);
auto
cit
=
pgroup
->
container
.
begin
();
std
::
advance
(
cit
,
i
);
newgroup
->
container
.
insert
(
*
cit
);
}
}
pduel
->
write_buffer8
(
MSG_RANDOM_SELECTED
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
count
);
for
(
auto
&
pcard
:
newgroup
->
container
)
{
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
}
interpreter
::
group2value
(
L
,
newgroup
);
return
1
;
}
}
int32
scriptlib
::
group_is_exists
(
lua_State
*
L
)
{
int32
scriptlib
::
group_is_exists
(
lua_State
*
L
)
{
check_param_count
(
L
,
4
);
check_param_count
(
L
,
4
);
...
@@ -398,8 +453,19 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
...
@@ -398,8 +453,19 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
interpreter
::
group2value
(
L
,
empty_group
);
interpreter
::
group2value
(
L
,
empty_group
);
return
1
;
return
1
;
}
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SUM_S
,
0
,
0
,
0
,
acc
,
playerid
+
(
min
<<
16
)
+
(
max
<<
24
));
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
acc
,
playerid
+
(
min
<<
16
)
+
(
max
<<
24
));
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
group
*
pgroup
=
pduel
->
new_group
();
int32
mcount
=
pduel
->
game_field
->
core
.
must_select_cards
.
size
();
for
(
int32
i
=
mcount
;
i
<
pduel
->
game_field
->
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
});
}
}
int32
scriptlib
::
group_check_with_sum_greater
(
lua_State
*
L
)
{
int32
scriptlib
::
group_check_with_sum_greater
(
lua_State
*
L
)
{
check_param_count
(
L
,
3
);
check_param_count
(
L
,
3
);
...
@@ -450,8 +516,19 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
...
@@ -450,8 +516,19 @@ int32 scriptlib::group_select_with_sum_greater(lua_State *L) {
interpreter
::
group2value
(
L
,
empty_group
);
interpreter
::
group2value
(
L
,
empty_group
);
return
1
;
return
1
;
}
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SUM_S
,
0
,
0
,
0
,
acc
,
playerid
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
acc
,
playerid
);
return
lua_yield
(
L
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
group
*
pgroup
=
pduel
->
new_group
();
int32
mcount
=
pduel
->
game_field
->
core
.
must_select_cards
.
size
();
for
(
int32
i
=
mcount
;
i
<
pduel
->
game_field
->
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
core
.
select_cards
[
pduel
->
game_field
->
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
}
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
});
}
}
int32
scriptlib
::
group_get_min_group
(
lua_State
*
L
)
{
int32
scriptlib
::
group_get_min_group
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
...
...
operations.cpp
View file @
3ee2dd48
...
@@ -101,7 +101,7 @@ void field::remove_counter(uint32 reason, card* pcard, uint32 rplayer, uint32 s,
...
@@ -101,7 +101,7 @@ void field::remove_counter(uint32 reason, card* pcard, uint32 rplayer, uint32 s,
add_process
(
PROCESSOR_REMOVE_COUNTER
,
0
,
NULL
,
(
group
*
)
pcard
,
(
rplayer
<<
16
)
+
(
s
<<
8
)
+
o
,
countertype
,
count
,
reason
);
add_process
(
PROCESSOR_REMOVE_COUNTER
,
0
,
NULL
,
(
group
*
)
pcard
,
(
rplayer
<<
16
)
+
(
s
<<
8
)
+
o
,
countertype
,
count
,
reason
);
}
}
void
field
::
remove_overlay_card
(
uint32
reason
,
card
*
pcard
,
uint32
rplayer
,
uint32
s
,
uint32
o
,
uint16
min
,
uint16
max
)
{
void
field
::
remove_overlay_card
(
uint32
reason
,
card
*
pcard
,
uint32
rplayer
,
uint32
s
,
uint32
o
,
uint16
min
,
uint16
max
)
{
add_process
(
PROCESSOR_REMOVE
OL_S
,
0
,
NULL
,
(
group
*
)
pcard
,
(
rplayer
<<
16
)
+
(
s
<<
8
)
+
o
,
(
max
<<
16
)
+
min
,
reason
);
add_process
(
PROCESSOR_REMOVE
_OVERLAY
,
0
,
NULL
,
(
group
*
)
pcard
,
(
rplayer
<<
16
)
+
(
s
<<
8
)
+
o
,
(
max
<<
16
)
+
min
,
reason
);
}
}
void
field
::
get_control
(
card_set
*
targets
,
effect
*
reason_effect
,
uint32
reason_player
,
uint32
playerid
,
uint32
reset_phase
,
uint32
reset_count
,
uint32
zone
)
{
void
field
::
get_control
(
card_set
*
targets
,
effect
*
reason_effect
,
uint32
reason_player
,
uint32
playerid
,
uint32
reset_phase
,
uint32
reset_count
,
uint32
zone
)
{
group
*
ng
=
pduel
->
new_group
(
*
targets
);
group
*
ng
=
pduel
->
new_group
(
*
targets
);
...
@@ -191,7 +191,7 @@ void field::special_summon_complete(effect* reason_effect, uint8 reason_player)
...
@@ -191,7 +191,7 @@ void field::special_summon_complete(effect* reason_effect, uint8 reason_player)
ng
->
container
.
swap
(
core
.
special_summoning
);
ng
->
container
.
swap
(
core
.
special_summoning
);
ng
->
is_readonly
=
TRUE
;
ng
->
is_readonly
=
TRUE
;
//core.special_summoning.clear();
//core.special_summoning.clear();
add_process
(
PROCESSOR_SPSUMMON
_COMP_S
,
0
,
reason_effect
,
ng
,
reason_player
,
0
);
add_process
(
PROCESSOR_SPSUMMON
,
1
,
reason_effect
,
ng
,
reason_player
,
0
);
}
}
void
field
::
destroy
(
card_set
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
destination
,
uint32
sequence
)
{
void
field
::
destroy
(
card_set
*
targets
,
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
destination
,
uint32
sequence
)
{
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();)
{
for
(
auto
cit
=
targets
->
begin
();
cit
!=
targets
->
end
();)
{
...
...
processor.cpp
View file @
3ee2dd48
This diff is collapsed.
Click to expand it.
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