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
b0776933
Commit
b0776933
authored
Jan 31, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
86d502db
4cc1b185
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
126 deletions
+74
-126
card.cpp
card.cpp
+7
-72
card.h
card.h
+10
-10
duel.h
duel.h
+1
-1
effect.h
effect.h
+2
-2
field.cpp
field.cpp
+1
-1
field.h
field.h
+30
-30
group.h
group.h
+1
-1
interpreter.h
interpreter.h
+2
-2
processor.cpp
processor.cpp
+20
-7
No files found.
card.cpp
View file @
b0776933
...
@@ -573,7 +573,6 @@ int32 card::get_attack() {
...
@@ -573,7 +573,6 @@ int32 card::get_attack() {
filter_effect
(
EFFECT_UPDATE_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_UPDATE_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_ATTACK_FINAL
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_ATTACK_FINAL
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SWAP_ATTACK_FINAL
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_BASE_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_BASE_ATTACK
,
&
eset
,
FALSE
);
if
(
!
(
data
.
type
&
TYPE_LINK
))
{
if
(
!
(
data
.
type
&
TYPE_LINK
))
{
filter_effect
(
EFFECT_SWAP_AD
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SWAP_AD
,
&
eset
,
FALSE
);
...
@@ -637,11 +636,6 @@ int32 card::get_attack() {
...
@@ -637,11 +636,6 @@ int32 card::get_attack() {
batk
=
0
;
batk
=
0
;
atk
=
-
1
;
atk
=
-
1
;
break
;
break
;
case
EFFECT_SWAP_ATTACK_FINAL
:
atk
=
eset
[
i
]
->
get_value
(
this
);
up_atk
=
0
;
upc_atk
=
0
;
break
;
case
EFFECT_SET_BASE_DEFENSE
:
case
EFFECT_SET_BASE_DEFENSE
:
bdef
=
eset
[
i
]
->
get_value
(
this
);
bdef
=
eset
[
i
]
->
get_value
(
this
);
if
(
bdef
<
0
)
if
(
bdef
<
0
)
...
@@ -773,7 +767,6 @@ int32 card::get_defense() {
...
@@ -773,7 +767,6 @@ int32 card::get_defense() {
filter_effect
(
EFFECT_UPDATE_DEFENSE
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_UPDATE_DEFENSE
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_DEFENSE
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_DEFENSE
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_DEFENSE_FINAL
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_DEFENSE_FINAL
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SWAP_DEFENSE_FINAL
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SWAP_BASE_AD
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SWAP_BASE_AD
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_BASE_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_BASE_ATTACK
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_BASE_DEFENSE
,
&
eset
,
FALSE
);
filter_effect
(
EFFECT_SET_BASE_DEFENSE
,
&
eset
,
FALSE
);
...
@@ -834,11 +827,6 @@ int32 card::get_defense() {
...
@@ -834,11 +827,6 @@ int32 card::get_defense() {
bdef
=
0
;
bdef
=
0
;
def
=
-
1
;
def
=
-
1
;
break
;
break
;
case
EFFECT_SWAP_DEFENSE_FINAL
:
def
=
eset
[
i
]
->
get_value
(
this
);
up_def
=
0
;
upc_def
=
0
;
break
;
case
EFFECT_SET_BASE_ATTACK
:
case
EFFECT_SET_BASE_ATTACK
:
batk
=
eset
[
i
]
->
get_value
(
this
);
batk
=
eset
[
i
]
->
get_value
(
this
);
if
(
batk
<
0
)
if
(
batk
<
0
)
...
@@ -1911,7 +1899,8 @@ void card::reset(uint32 id, uint32 reset_type) {
...
@@ -1911,7 +1899,8 @@ void card::reset(uint32 id, uint32 reset_type) {
}
}
}
}
if
(
id
&
RESET_TURN_SET
)
{
if
(
id
&
RESET_TURN_SET
)
{
if
(
effect
*
peffect
=
check_control_effect
())
{
effect
*
peffect
=
std
::
get
<
effect
*>
(
refresh_control_status
());
if
(
peffect
&&
(
!
(
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
||
peffect
->
condition
))
{
effect
*
new_effect
=
pduel
->
new_effect
();
effect
*
new_effect
=
pduel
->
new_effect
();
new_effect
->
id
=
peffect
->
id
;
new_effect
->
id
=
peffect
->
id
;
new_effect
->
owner
=
this
;
new_effect
->
owner
=
this
;
...
@@ -1964,8 +1953,9 @@ void card::refresh_disable_status() {
...
@@ -1964,8 +1953,9 @@ void card::refresh_disable_status() {
if
(
pre_dis
!=
cur_dis
)
if
(
pre_dis
!=
cur_dis
)
filter_immune_effect
();
filter_immune_effect
();
}
}
uint8
card
::
refresh_control_status
()
{
std
::
tuple
<
uint8
,
effect
*>
card
::
refresh_control_status
()
{
uint8
final
=
owner
;
uint8
final
=
owner
;
effect
*
ceffect
=
nullptr
;
uint32
last_id
=
0
;
uint32
last_id
=
0
;
if
(
pduel
->
game_field
->
core
.
remove_brainwashing
&&
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
if
(
pduel
->
game_field
->
core
.
remove_brainwashing
&&
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
last_id
=
pduel
->
game_field
->
core
.
last_control_changed_id
;
last_id
=
pduel
->
game_field
->
core
.
last_control_changed_id
;
...
@@ -1974,18 +1964,11 @@ uint8 card::refresh_control_status() {
...
@@ -1974,18 +1964,11 @@ uint8 card::refresh_control_status() {
if
(
eset
.
size
())
{
if
(
eset
.
size
())
{
effect
*
peffect
=
eset
.
get_last
();
effect
*
peffect
=
eset
.
get_last
();
if
(
peffect
->
id
>=
last_id
)
{
if
(
peffect
->
id
>=
last_id
)
{
card
*
pcard
=
peffect
->
get_handler
();
final
=
(
uint8
)
peffect
->
get_value
(
this
);
uint8
val
=
(
uint8
)
peffect
->
get_value
(
this
);
ceffect
=
peffect
;
if
(
val
!=
current
.
controler
)
pduel
->
game_field
->
core
.
readjust_map
[
pcard
]
++
;
if
(
pduel
->
game_field
->
core
.
readjust_map
[
pcard
]
>
5
)
{
pduel
->
game_field
->
send_to
(
pcard
,
0
,
REASON_RULE
,
peffect
->
get_handler_player
(),
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
return
final
;
}
}
final
=
val
;
}
}
}
return
{
final
,
ceffect
};
return
final
;
}
}
void
card
::
count_turn
(
uint16
ct
)
{
void
card
::
count_turn
(
uint16
ct
)
{
turn_counter
=
ct
;
turn_counter
=
ct
;
...
@@ -2730,54 +2713,6 @@ effect* card::is_affected_by_effect(int32 code, card* target) {
...
@@ -2730,54 +2713,6 @@ effect* card::is_affected_by_effect(int32 code, card* target) {
}
}
return
0
;
return
0
;
}
}
effect
*
card
::
check_control_effect
()
{
effect
*
ret_effect
=
0
;
for
(
auto
&
pcard
:
equiping_cards
)
{
auto
rg
=
pcard
->
equip_effect
.
equal_range
(
EFFECT_SET_CONTROL
);
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
effect
*
peffect
=
rg
.
first
->
second
;
if
(
!
ret_effect
||
peffect
->
id
>
ret_effect
->
id
)
ret_effect
=
peffect
;
}
}
for
(
auto
&
pcard
:
effect_target_owner
)
{
auto
rg
=
pcard
->
target_effect
.
equal_range
(
EFFECT_SET_CONTROL
);
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
effect
*
peffect
=
rg
.
first
->
second
;
if
(
!
ret_effect
||
peffect
->
is_target
(
pcard
)
&&
peffect
->
id
>
ret_effect
->
id
)
ret_effect
=
peffect
;
}
}
for
(
auto
&
pcard
:
xyz_materials
)
{
auto
rg
=
pcard
->
xmaterial_effect
.
equal_range
(
EFFECT_SET_CONTROL
);
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
effect
*
peffect
=
rg
.
first
->
second
;
if
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
continue
;
if
(
!
ret_effect
||
peffect
->
id
>
ret_effect
->
id
)
ret_effect
=
peffect
;
}
}
auto
rg
=
single_effect
.
equal_range
(
EFFECT_SET_CONTROL
);
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
effect
*
peffect
=
rg
.
first
->
second
;
if
(
!
peffect
->
condition
)
continue
;
if
(
!
ret_effect
||
peffect
->
id
>
ret_effect
->
id
)
ret_effect
=
peffect
;
}
/*
rg = pduel->game_field->effects.aura_effect.equal_range(EFFECT_SET_CONTROL);
for(; rg.first != rg.second; ++rg.first) {
effect* peffect = rg.first->second;
if(peffect->is_flag(EFFECT_FLAG_PLAYER_TARGET) || !peffect->is_target(this))
continue;
if(!ret_effect || peffect->id > ret_effect->id)
ret_effect = peffect;
}
*/
return
ret_effect
;
}
int32
card
::
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
)
{
int32
card
::
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
)
{
group
*
matgroup
=
0
;
group
*
matgroup
=
0
;
if
(
fusion_m
&&
!
not_material
)
{
if
(
fusion_m
&&
!
not_material
)
{
...
...
card.h
View file @
b0776933
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <map>
#include <map>
#include <unordered_set>
#include <unordered_set>
#include <unordered_map>
#include <unordered_map>
#include <tuple>
class
card
;
class
card
;
class
duel
;
class
duel
;
...
@@ -93,14 +94,14 @@ public:
...
@@ -93,14 +94,14 @@ public:
return
std
::
hash
<
uint16
>
()(
v
.
second
);
return
std
::
hash
<
uint16
>
()(
v
.
second
);
}
}
};
};
typedef
std
::
vector
<
card
*>
card_vector
;
using
card_vector
=
std
::
vector
<
card
*>
;
typedef
std
::
multimap
<
uint32
,
effect
*>
effect_container
;
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
typedef
std
::
set
<
card
*
,
card_sort
>
card_set
;
using
card_set
=
std
::
set
<
card
*
,
card_sort
>
;
typedef
std
::
unordered_map
<
effect
*
,
effect_container
::
iterator
>
effect_indexer
;
using
effect_indexer
=
std
::
unordered_map
<
effect
*
,
effect_container
::
iterator
>
;
typedef
std
::
unordered_set
<
std
::
pair
<
effect
*
,
uint16
>
,
effect_relation_hash
>
effect_relation
;
using
effect_relation
=
std
::
unordered_set
<
std
::
pair
<
effect
*
,
uint16
>
,
effect_relation_hash
>
;
typedef
std
::
unordered_map
<
card
*
,
uint32
>
relation_map
;
using
relation_map
=
std
::
unordered_map
<
card
*
,
uint32
>
;
typedef
std
::
map
<
uint16
,
std
::
array
<
uint16
,
2
>>
counter_map
;
using
counter_map
=
std
::
map
<
uint16
,
std
::
array
<
uint16
,
2
>>
;
typedef
std
::
map
<
uint32
,
int32
>
effect_count
;
using
effect_count
=
std
::
map
<
uint32
,
int32
>
;
class
attacker_map
:
public
std
::
unordered_map
<
uint16
,
std
::
pair
<
card
*
,
uint32
>>
{
class
attacker_map
:
public
std
::
unordered_map
<
uint16
,
std
::
pair
<
card
*
,
uint32
>>
{
public:
public:
void
addcard
(
card
*
pcard
);
void
addcard
(
card
*
pcard
);
...
@@ -257,7 +258,7 @@ public:
...
@@ -257,7 +258,7 @@ public:
void
reset
(
uint32
id
,
uint32
reset_type
);
void
reset
(
uint32
id
,
uint32
reset_type
);
void
reset_effect_count
();
void
reset_effect_count
();
void
refresh_disable_status
();
void
refresh_disable_status
();
uint8
refresh_control_status
();
std
::
tuple
<
uint8
,
effect
*>
refresh_control_status
();
void
count_turn
(
uint16
ct
);
void
count_turn
(
uint16
ct
);
void
create_relation
(
card
*
target
,
uint32
reset
);
void
create_relation
(
card
*
target
,
uint32
reset
);
...
@@ -294,7 +295,6 @@ public:
...
@@ -294,7 +295,6 @@ public:
void
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
eset
);
void
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
eset
);
effect
*
is_affected_by_effect
(
int32
code
);
effect
*
is_affected_by_effect
(
int32
code
);
effect
*
is_affected_by_effect
(
int32
code
,
card
*
target
);
effect
*
is_affected_by_effect
(
int32
code
,
card
*
target
);
effect
*
check_control_effect
();
int32
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
);
int32
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
);
void
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
);
void
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
);
int32
check_fusion_substitute
(
card
*
fcard
);
int32
check_fusion_substitute
(
card
*
fcard
);
...
...
duel.h
View file @
b0776933
...
@@ -21,7 +21,7 @@ class interpreter;
...
@@ -21,7 +21,7 @@ class interpreter;
class
duel
{
class
duel
{
public:
public:
typedef
std
::
set
<
card
*
,
card_sort
>
card_set
;
using
card_set
=
std
::
set
<
card
*
,
card_sort
>
;
char
strbuffer
[
256
];
char
strbuffer
[
256
];
byte
buffer
[
0x1000
];
byte
buffer
[
0x1000
];
uint32
bufferlen
;
uint32
bufferlen
;
...
...
effect.h
View file @
b0776933
...
@@ -301,8 +301,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -301,8 +301,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_REVERSE_UPDATE 108 //
#define EFFECT_REVERSE_UPDATE 108 //
#define EFFECT_SWAP_AD 109 //
#define EFFECT_SWAP_AD 109 //
#define EFFECT_SWAP_BASE_AD 110 //
#define EFFECT_SWAP_BASE_AD 110 //
#define EFFECT_SWAP_ATTACK_FINAL 111
//
#define EFFECT_SWAP_ATTACK_FINAL 111
#define EFFECT_SWAP_DEFENSE_FINAL 112
//
#define EFFECT_SWAP_DEFENSE_FINAL 112
#define EFFECT_ADD_CODE 113 //
#define EFFECT_ADD_CODE 113 //
#define EFFECT_CHANGE_CODE 114 //
#define EFFECT_CHANGE_CODE 114 //
#define EFFECT_ADD_TYPE 115 //
#define EFFECT_ADD_TYPE 115 //
...
...
field.cpp
View file @
b0776933
...
@@ -520,7 +520,7 @@ void field::swap_card(card* pcard1, card* pcard2) {
...
@@ -520,7 +520,7 @@ void field::swap_card(card* pcard1, card* pcard2) {
return
swap_card
(
pcard1
,
pcard2
,
pcard1
->
current
.
sequence
,
pcard2
->
current
.
sequence
);
return
swap_card
(
pcard1
,
pcard2
,
pcard1
->
current
.
sequence
,
pcard2
->
current
.
sequence
);
}
}
void
field
::
set_control
(
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
)
{
void
field
::
set_control
(
card
*
pcard
,
uint8
playerid
,
uint16
reset_phase
,
uint8
reset_count
)
{
if
((
core
.
remove_brainwashing
&&
pcard
->
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
||
pcard
->
refresh_control_status
(
)
==
playerid
)
if
((
core
.
remove_brainwashing
&&
pcard
->
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
||
std
::
get
<
uint8
>
(
pcard
->
refresh_control_status
()
)
==
playerid
)
return
;
return
;
effect
*
peffect
=
pduel
->
new_effect
();
effect
*
peffect
=
pduel
->
new_effect
();
if
(
core
.
reason_effect
)
if
(
core
.
reason_effect
)
...
...
field.h
View file @
b0776933
...
@@ -44,7 +44,7 @@ struct optarget {
...
@@ -44,7 +44,7 @@ struct optarget {
int32
op_param
;
int32
op_param
;
};
};
struct
chain
{
struct
chain
{
typedef
std
::
unordered_map
<
uint32
,
optarget
>
opmap
;
using
opmap
=
std
::
unordered_map
<
uint32
,
optarget
>
;
uint16
chain_id
;
uint16
chain_id
;
uint8
chain_count
;
uint8
chain_count
;
uint8
triggering_player
;
uint8
triggering_player
;
...
@@ -68,7 +68,7 @@ struct chain {
...
@@ -68,7 +68,7 @@ struct chain {
};
};
struct
player_info
{
struct
player_info
{
typedef
std
::
vector
<
card
*>
card_vector
;
using
card_vector
=
std
::
vector
<
card
*>
;
int32
lp
;
int32
lp
;
int32
start_count
;
int32
start_count
;
int32
draw_count
;
int32
draw_count
;
...
@@ -88,12 +88,12 @@ struct player_info {
...
@@ -88,12 +88,12 @@ struct player_info {
card_vector
tag_list_extra
;
card_vector
tag_list_extra
;
};
};
struct
field_effect
{
struct
field_effect
{
typedef
std
::
multimap
<
uint32
,
effect
*>
effect_container
;
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
typedef
std
::
unordered_map
<
effect
*
,
effect_container
::
iterator
>
effect_indexer
;
using
effect_indexer
=
std
::
unordered_map
<
effect
*
,
effect_container
::
iterator
>
;
typedef
std
::
unordered_map
<
effect
*
,
effect
*>
oath_effects
;
using
oath_effects
=
std
::
unordered_map
<
effect
*
,
effect
*>
;
typedef
std
::
unordered_set
<
effect
*>
effect_collection
;
using
effect_collection
=
std
::
unordered_set
<
effect
*>
;
typedef
std
::
unordered_map
<
card
*
,
effect
*>
gain_effects
;
using
gain_effects
=
std
::
unordered_map
<
card
*
,
effect
*>
;
typedef
std
::
unordered_map
<
effect
*
,
gain_effects
>
grant_effect_container
;
using
grant_effect_container
=
std
::
unordered_map
<
effect
*
,
gain_effects
>
;
effect_container
aura_effect
;
effect_container
aura_effect
;
effect_container
ignition_effect
;
effect_container
ignition_effect
;
...
@@ -150,23 +150,23 @@ union return_value {
...
@@ -150,23 +150,23 @@ union return_value {
int64
lvalue
[
8
];
int64
lvalue
[
8
];
};
};
struct
processor
{
struct
processor
{
typedef
std
::
vector
<
effect
*>
effect_vector
;
using
effect_vector
=
std
::
vector
<
effect
*>
;
typedef
std
::
vector
<
card
*>
card_vector
;
using
card_vector
=
std
::
vector
<
card
*>
;
typedef
std
::
vector
<
uint32
>
option_vector
;
using
option_vector
=
std
::
vector
<
uint32
>
;
typedef
std
::
list
<
card
*>
card_list
;
using
card_list
=
std
::
list
<
card
*>
;
typedef
std
::
list
<
tevent
>
event_list
;
using
event_list
=
std
::
list
<
tevent
>
;
typedef
std
::
list
<
chain
>
chain_list
;
using
chain_list
=
std
::
list
<
chain
>
;
typedef
std
::
map
<
effect
*
,
chain
>
instant_f_list
;
using
instant_f_list
=
std
::
map
<
effect
*
,
chain
>
;
typedef
std
::
vector
<
chain
>
chain_array
;
using
chain_array
=
std
::
vector
<
chain
>
;
typedef
std
::
list
<
processor_unit
>
processor_list
;
using
processor_list
=
std
::
list
<
processor_unit
>
;
typedef
std
::
set
<
card
*
,
card_sort
>
card_set
;
using
card_set
=
std
::
set
<
card
*
,
card_sort
>
;
typedef
std
::
set
<
std
::
pair
<
effect
*
,
tevent
>>
delayed_effect_collection
;
using
delayed_effect_collection
=
std
::
set
<
std
::
pair
<
effect
*
,
tevent
>>
;
struct
chain_limit_t
{
struct
chain_limit_t
{
chain_limit_t
(
int32
f
,
int32
p
)
:
function
(
f
),
player
(
p
)
{}
chain_limit_t
(
int32
f
,
int32
p
)
:
function
(
f
),
player
(
p
)
{}
int32
function
;
int32
function
;
int32
player
;
int32
player
;
};
};
typedef
std
::
vector
<
chain_limit_t
>
chain_limit_list
;
using
chain_limit_list
=
std
::
vector
<
chain_limit_t
>
;
processor_list
units
;
processor_list
units
;
processor_list
subunits
;
processor_list
subunits
;
...
@@ -335,16 +335,16 @@ struct processor {
...
@@ -335,16 +335,16 @@ struct processor {
};
};
class
field
{
class
field
{
public:
public:
typedef
std
::
multimap
<
uint32
,
effect
*>
effect_container
;
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
typedef
std
::
set
<
card
*
,
card_sort
>
card_set
;
using
card_set
=
std
::
set
<
card
*
,
card_sort
>
;
typedef
std
::
vector
<
effect
*>
effect_vector
;
using
effect_vector
=
std
::
vector
<
effect
*>
;
typedef
std
::
vector
<
card
*>
card_vector
;
using
card_vector
=
std
::
vector
<
card
*>
;
typedef
std
::
list
<
card
*>
card_list
;
using
card_list
=
std
::
list
<
card
*>
;
typedef
std
::
list
<
tevent
>
event_list
;
using
event_list
=
std
::
list
<
tevent
>
;
typedef
std
::
list
<
chain
>
chain_list
;
using
chain_list
=
std
::
list
<
chain
>
;
typedef
std
::
map
<
effect
*
,
chain
>
instant_f_list
;
using
instant_f_list
=
std
::
map
<
effect
*
,
chain
>
;
typedef
std
::
vector
<
chain
>
chain_array
;
using
chain_array
=
std
::
vector
<
chain
>
;
typedef
std
::
list
<
processor_unit
>
processor_list
;
using
processor_list
=
std
::
list
<
processor_unit
>
;
duel
*
pduel
;
duel
*
pduel
;
player_info
player
[
2
];
player_info
player
[
2
];
...
...
group.h
View file @
b0776933
...
@@ -17,7 +17,7 @@ class duel;
...
@@ -17,7 +17,7 @@ class duel;
class
group
{
class
group
{
public:
public:
typedef
std
::
set
<
card
*
,
card_sort
>
card_set
;
using
card_set
=
std
::
set
<
card
*
,
card_sort
>
;
int32
ref_handle
;
int32
ref_handle
;
duel
*
pduel
;
duel
*
pduel
;
card_set
container
;
card_set
container
;
...
...
interpreter.h
View file @
b0776933
...
@@ -26,8 +26,8 @@ class duel;
...
@@ -26,8 +26,8 @@ class duel;
class
interpreter
{
class
interpreter
{
public:
public:
typedef
std
::
unordered_map
<
int32
,
lua_State
*>
coroutine_map
;
using
coroutine_map
=
std
::
unordered_map
<
int32
,
lua_State
*>
;
typedef
std
::
list
<
std
::
pair
<
void
*
,
uint32
>>
param_list
;
using
param_list
=
std
::
list
<
std
::
pair
<
void
*
,
uint32
>>
;
duel
*
pduel
;
duel
*
pduel
;
char
msgbuf
[
64
];
char
msgbuf
[
64
];
...
...
processor.cpp
View file @
b0776933
...
@@ -1274,13 +1274,13 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1274,13 +1274,13 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
case
0
:
{
case
0
:
{
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
core
.
point_event
.
splice
(
core
.
point_event
.
end
(),
core
.
instant_event
);
core
.
point_event
.
splice
(
core
.
point_event
.
end
(),
core
.
instant_event
);
core
.
full_event
.
splice
(
core
.
full_event
.
end
(),
core
.
delayed_activate_event
);
if
(
skip_trigger
)
{
if
(
skip_trigger
)
{
core
.
units
.
begin
()
->
step
=
7
;
core
.
units
.
begin
()
->
step
=
7
;
return
FALSE
;
return
FALSE
;
}
}
core
.
new_fchain_s
.
splice
(
core
.
new_fchain_s
.
begin
(),
core
.
new_fchain
);
core
.
new_fchain_s
.
splice
(
core
.
new_fchain_s
.
begin
(),
core
.
new_fchain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
begin
(),
core
.
new_ochain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
begin
(),
core
.
new_ochain
);
core
.
full_event
.
splice
(
core
.
full_event
.
end
(),
core
.
delayed_activate_event
);
core
.
delayed_quick
.
clear
();
core
.
delayed_quick
.
clear
();
core
.
delayed_quick_break
.
swap
(
core
.
delayed_quick
);
core
.
delayed_quick_break
.
swap
(
core
.
delayed_quick
);
core
.
current_player
=
infos
.
turn_player
;
core
.
current_player
=
infos
.
turn_player
;
...
@@ -1640,12 +1640,12 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -1640,12 +1640,12 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
newchain
.
set_triggering_state
(
phandler
);
newchain
.
set_triggering_state
(
phandler
);
newchain
.
triggering_player
=
priority
;
newchain
.
triggering_player
=
priority
;
core
.
select_chains
.
push_back
(
newchain
);
core
.
select_chains
.
push_back
(
newchain
);
}
core
.
delayed_quick_tmp
.
erase
(
std
::
make_pair
(
peffect
,
ev
));
core
.
delayed_quick_tmp
.
erase
(
std
::
make_pair
(
peffect
,
ev
));
core
.
delayed_quick_break
.
erase
(
std
::
make_pair
(
peffect
,
ev
));
core
.
delayed_quick_break
.
erase
(
std
::
make_pair
(
peffect
,
ev
));
}
}
}
}
}
}
}
for
(
auto
&
ch
:
core
.
new_ochain_h
)
{
for
(
auto
&
ch
:
core
.
new_ochain_h
)
{
effect
*
peffect
=
ch
.
triggering_effect
;
effect
*
peffect
=
ch
.
triggering_effect
;
card
*
phandler
=
peffect
->
get_handler
();
card
*
phandler
=
peffect
->
get_handler
();
...
@@ -4843,18 +4843,30 @@ int32 field::adjust_step(uint16 step) {
...
@@ -4843,18 +4843,30 @@ int32 field::adjust_step(uint16 step) {
//control
//control
core
.
control_adjust_set
[
0
].
clear
();
core
.
control_adjust_set
[
0
].
clear
();
core
.
control_adjust_set
[
1
].
clear
();
core
.
control_adjust_set
[
1
].
clear
();
card_set
reason_cards
;
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
auto
&
pcard
:
player
[
p
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
p
].
list_mzone
)
{
if
(
!
pcard
)
continue
;
if
(
!
pcard
)
continue
;
uint8
cur
=
pcard
->
current
.
controler
;
uint8
cur
=
pcard
->
current
.
controler
;
uint8
ref
=
pcard
->
refresh_control_status
();
auto
res
=
pcard
->
refresh_control_status
();
if
(
cur
!=
ref
&&
pcard
->
is_capable_change_control
())
uint8
ref
=
std
::
get
<
uint8
>
(
res
);
effect
*
peffect
=
std
::
get
<
effect
*>
(
res
);
if
(
cur
!=
ref
&&
pcard
->
is_capable_change_control
())
{
core
.
control_adjust_set
[
p
].
insert
(
pcard
);
core
.
control_adjust_set
[
p
].
insert
(
pcard
);
if
(
peffect
&&
(
!
(
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
||
peffect
->
condition
))
reason_cards
.
insert
(
peffect
->
get_handler
());
}
}
}
}
}
if
(
core
.
control_adjust_set
[
0
].
size
()
||
core
.
control_adjust_set
[
1
].
size
())
{
if
(
core
.
control_adjust_set
[
0
].
size
()
||
core
.
control_adjust_set
[
1
].
size
())
{
core
.
re_adjust
=
TRUE
;
core
.
re_adjust
=
TRUE
;
add_process
(
PROCESSOR_CONTROL_ADJUST
,
0
,
0
,
0
,
0
,
0
);
get_control
(
&
core
.
control_adjust_set
[
1
-
infos
.
turn_player
],
0
,
PLAYER_NONE
,
infos
.
turn_player
,
0
,
0
,
0xff
);
get_control
(
&
core
.
control_adjust_set
[
infos
.
turn_player
],
0
,
PLAYER_NONE
,
1
-
infos
.
turn_player
,
0
,
0
,
0xff
);
for
(
auto
&
rcard
:
reason_cards
)
{
core
.
readjust_map
[
rcard
]
++
;
if
(
core
.
readjust_map
[
rcard
]
>
3
)
destroy
(
rcard
,
0
,
REASON_RULE
,
PLAYER_NONE
);
}
}
}
core
.
last_control_changed_id
=
infos
.
field_id
;
core
.
last_control_changed_id
=
infos
.
field_id
;
return
FALSE
;
return
FALSE
;
...
@@ -4888,7 +4900,8 @@ int32 field::adjust_step(uint16 step) {
...
@@ -4888,7 +4900,8 @@ int32 field::adjust_step(uint16 step) {
core
.
remove_brainwashing
=
res
;
core
.
remove_brainwashing
=
res
;
if
(
core
.
control_adjust_set
[
0
].
size
()
||
core
.
control_adjust_set
[
1
].
size
())
{
if
(
core
.
control_adjust_set
[
0
].
size
()
||
core
.
control_adjust_set
[
1
].
size
())
{
core
.
re_adjust
=
TRUE
;
core
.
re_adjust
=
TRUE
;
add_process
(
PROCESSOR_CONTROL_ADJUST
,
0
,
0
,
0
,
0
,
0
);
get_control
(
&
core
.
control_adjust_set
[
1
-
infos
.
turn_player
],
0
,
PLAYER_NONE
,
infos
.
turn_player
,
0
,
0
,
0xff
);
get_control
(
&
core
.
control_adjust_set
[
infos
.
turn_player
],
0
,
PLAYER_NONE
,
1
-
infos
.
turn_player
,
0
,
0
,
0xff
);
}
}
}
}
core
.
units
.
begin
()
->
step
=
7
;
core
.
units
.
begin
()
->
step
=
7
;
...
...
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