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
50680705
Commit
50680705
authored
Apr 07, 2021
by
salix5
Committed by
GitHub
Apr 07, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #369 from Fluorohydride/patch-init
add init to all struct
parents
ac12ab98
309955d6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
55 deletions
+46
-55
card.h
card.h
+4
-0
effectset.h
effectset.h
+2
-1
field.cpp
field.cpp
+2
-54
field.h
field.h
+35
-0
operations.cpp
operations.cpp
+3
-0
No files found.
card.h
View file @
50680705
...
@@ -40,6 +40,10 @@ struct card_data {
...
@@ -40,6 +40,10 @@ struct card_data {
};
};
struct
card_state
{
struct
card_state
{
card_state
()
:
code
(
0
),
code2
(
0
),
setcode
(
0
),
type
(
0
),
level
(
0
),
rank
(
0
),
link
(
0
),
lscale
(
0
),
rscale
(
0
),
attribute
(
0
),
race
(
0
),
attack
(
0
),
defense
(
0
),
base_attack
(
0
),
base_defense
(
0
),
controler
(
PLAYER_NONE
),
location
(
0
),
sequence
(
0
),
position
(
0
),
reason
(
0
),
pzone
(
false
),
reason_card
(
nullptr
),
reason_player
(
PLAYER_NONE
),
reason_effect
(
nullptr
)
{}
uint32
code
;
uint32
code
;
uint32
code2
;
uint32
code2
;
uint16
setcode
;
uint16
setcode
;
...
...
effectset.h
View file @
50680705
...
@@ -18,7 +18,8 @@ class effect;
...
@@ -18,7 +18,8 @@ class effect;
bool
effect_sort_id
(
const
effect
*
e1
,
const
effect
*
e2
);
bool
effect_sort_id
(
const
effect
*
e1
,
const
effect
*
e2
);
struct
effect_set
{
struct
effect_set
{
effect_set
()
:
count
(
0
)
{}
effect_set
()
:
count
(
0
),
container
{
nullptr
}
{}
void
add_item
(
effect
*
peffect
)
{
void
add_item
(
effect
*
peffect
)
{
if
(
count
>=
64
)
return
;
if
(
count
>=
64
)
return
;
container
[
count
++
]
=
peffect
;
container
[
count
++
]
=
peffect
;
...
...
field.cpp
View file @
50680705
...
@@ -53,7 +53,6 @@ field::field(duel* pduel) {
...
@@ -53,7 +53,6 @@ field::field(duel* pduel) {
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
2
;
++
i
)
{
//cost[i].count = 0;
//cost[i].count = 0;
//cost[i].amount = 0;
//cost[i].amount = 0;
core
.
hint_timing
[
i
]
=
0
;
player
[
i
].
lp
=
8000
;
player
[
i
].
lp
=
8000
;
player
[
i
].
start_count
=
5
;
player
[
i
].
start_count
=
5
;
player
[
i
].
draw_count
=
1
;
player
[
i
].
draw_count
=
1
;
...
@@ -68,60 +67,9 @@ field::field(duel* pduel) {
...
@@ -68,60 +67,9 @@ field::field(duel* pduel) {
player
[
i
].
list_grave
.
reserve
(
30
);
player
[
i
].
list_grave
.
reserve
(
30
);
player
[
i
].
list_remove
.
reserve
(
30
);
player
[
i
].
list_remove
.
reserve
(
30
);
player
[
i
].
list_extra
.
reserve
(
15
);
player
[
i
].
list_extra
.
reserve
(
15
);
core
.
shuffle_deck_check
[
i
]
=
FALSE
;
}
core
.
shuffle_hand_check
[
i
]
=
FALSE
;
}
core
.
pre_field
[
0
]
=
0
;
core
.
pre_field
[
1
]
=
0
;
core
.
opp_mzone
.
clear
();
core
.
summoning_card
=
0
;
core
.
summon_depth
=
0
;
core
.
summon_cancelable
=
FALSE
;
core
.
chain_limit
.
clear
();
core
.
chain_limit_p
.
clear
();
core
.
chain_solving
=
FALSE
;
core
.
conti_solving
=
FALSE
;
core
.
conti_player
=
PLAYER_NONE
;
core
.
win_player
=
5
;
core
.
win_reason
=
0
;
core
.
reason_effect
=
0
;
core
.
reason_player
=
PLAYER_NONE
;
core
.
selfdes_disabled
=
FALSE
;
core
.
flip_delayed
=
FALSE
;
core
.
overdraw
[
0
]
=
FALSE
;
core
.
overdraw
[
1
]
=
FALSE
;
core
.
check_level
=
0
;
core
.
limit_tuner
=
0
;
core
.
limit_syn
=
0
;
core
.
limit_syn_minc
=
0
;
core
.
limit_syn_maxc
=
0
;
core
.
limit_xyz
=
0
;
core
.
limit_xyz_minc
=
0
;
core
.
limit_xyz_maxc
=
0
;
core
.
limit_link
=
0
;
core
.
limit_link_card
=
0
;
core
.
limit_link_minc
=
0
;
core
.
limit_link_maxc
=
0
;
core
.
last_control_changed_id
=
0
;
core
.
duel_options
=
0
;
core
.
duel_rule
=
0
;
core
.
attacker
=
0
;
core
.
attack_target
=
0
;
core
.
attack_rollback
=
FALSE
;
core
.
deck_reversed
=
FALSE
;
core
.
remove_brainwashing
=
FALSE
;
core
.
effect_damage_step
=
FALSE
;
core
.
shuffle_check_disabled
=
FALSE
;
core
.
global_flag
=
0
;
nil_event
.
event_code
=
0
;
nil_event
.
event_cards
=
0
;
nil_event
.
event_player
=
PLAYER_NONE
;
nil_event
.
event_value
=
0
;
nil_event
.
reason
=
0
;
nil_event
.
reason_effect
=
0
;
nil_event
.
reason_player
=
PLAYER_NONE
;
returns
=
{
0
};
returns
=
{
0
};
temp_card
=
NULL
;
temp_card
=
nullptr
;
}
}
void
field
::
reload_field_info
()
{
void
field
::
reload_field_info
()
{
pduel
->
write_buffer8
(
MSG_RELOAD_FIELD
);
pduel
->
write_buffer8
(
MSG_RELOAD_FIELD
);
...
...
field.h
View file @
50680705
...
@@ -35,6 +35,9 @@ struct tevent {
...
@@ -35,6 +35,9 @@ struct tevent {
uint32
reason
;
uint32
reason
;
uint8
event_player
;
uint8
event_player
;
uint8
reason_player
;
uint8
reason_player
;
tevent
()
:
trigger_card
(
nullptr
),
event_cards
(
nullptr
),
reason_effect
(
nullptr
),
event_code
(
0
),
event_value
(
0
),
reason
(
0
),
event_player
(
PLAYER_NONE
),
reason_player
(
PLAYER_NONE
)
{}
bool
operator
<
(
const
tevent
&
v
)
const
;
bool
operator
<
(
const
tevent
&
v
)
const
;
};
};
struct
optarget
{
struct
optarget
{
...
@@ -42,6 +45,9 @@ struct optarget {
...
@@ -42,6 +45,9 @@ struct optarget {
uint8
op_count
;
uint8
op_count
;
uint8
op_player
;
uint8
op_player
;
int32
op_param
;
int32
op_param
;
optarget
()
:
op_cards
(
nullptr
),
op_count
(
0
),
op_player
(
PLAYER_NONE
),
op_param
(
0
)
{}
};
};
struct
chain
{
struct
chain
{
using
opmap
=
std
::
unordered_map
<
uint32
,
optarget
>
;
using
opmap
=
std
::
unordered_map
<
uint32
,
optarget
>
;
...
@@ -63,6 +69,11 @@ struct chain {
...
@@ -63,6 +69,11 @@ struct chain {
tevent
evt
;
tevent
evt
;
opmap
opinfos
;
opmap
opinfos
;
uint32
flag
;
uint32
flag
;
chain
()
:
chain_id
(
0
),
chain_count
(
0
),
triggering_player
(
PLAYER_NONE
),
triggering_controler
(
PLAYER_NONE
),
triggering_location
(
0
),
triggering_sequence
(
0
),
triggering_position
(
0
),
triggering_state
(),
triggering_effect
(
nullptr
),
target_cards
(
nullptr
),
replace_op
(
0
),
target_player
(
PLAYER_NONE
),
target_param
(
0
),
disable_reason
(
nullptr
),
disable_player
(
PLAYER_NONE
),
evt
(),
flag
(
0
)
{}
static
bool
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
);
static
bool
chain_operation_sort
(
const
chain
&
c1
,
const
chain
&
c2
);
void
set_triggering_state
(
card
*
pcard
);
void
set_triggering_state
(
card
*
pcard
);
};
};
...
@@ -86,6 +97,9 @@ struct player_info {
...
@@ -86,6 +97,9 @@ struct player_info {
card_vector
tag_list_main
;
card_vector
tag_list_main
;
card_vector
tag_list_hand
;
card_vector
tag_list_hand
;
card_vector
tag_list_extra
;
card_vector
tag_list_extra
;
player_info
()
:
lp
(
0
),
start_count
(
0
),
draw_count
(
0
),
used_location
(
0
),
disabled_location
(
0
),
extra_p_count
(
0
),
tag_extra_p_count
(
0
)
{}
};
};
struct
field_effect
{
struct
field_effect
{
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
using
effect_container
=
std
::
multimap
<
uint32
,
effect
*>
;
...
@@ -125,11 +139,17 @@ struct field_info {
...
@@ -125,11 +139,17 @@ struct field_info {
uint8
turn_player
;
uint8
turn_player
;
uint8
priorities
[
2
];
uint8
priorities
[
2
];
uint8
can_shuffle
;
uint8
can_shuffle
;
field_info
()
:
field_id
(
0
),
copy_id
(
0
),
turn_id
(
0
),
turn_id_by_player
{
0
},
card_id
(
0
),
phase
(
0
),
turn_player
(
0
),
priorities
{
0
},
can_shuffle
(
TRUE
)
{}
};
};
struct
lpcost
{
struct
lpcost
{
int32
count
;
int32
count
;
int32
amount
;
int32
amount
;
int32
lpstack
[
8
];
int32
lpstack
[
8
];
lpcost
()
:
count
(
0
),
amount
(
0
),
lpstack
{
0
}
{}
};
};
struct
processor_unit
{
struct
processor_unit
{
uint16
type
;
uint16
type
;
...
@@ -142,6 +162,9 @@ struct processor_unit {
...
@@ -142,6 +162,9 @@ struct processor_unit {
ptr
arg4
;
ptr
arg4
;
void
*
ptr1
;
void
*
ptr1
;
void
*
ptr2
;
void
*
ptr2
;
processor_unit
()
:
type
(
0
),
step
(
0
),
peffect
(
nullptr
),
ptarget
(
nullptr
),
arg1
(
0
),
arg2
(
0
),
arg3
(
0
),
arg4
(
0
),
ptr1
(
nullptr
),
ptr2
(
nullptr
)
{}
};
};
union
return_value
{
union
return_value
{
int8
bvalue
[
64
];
int8
bvalue
[
64
];
...
@@ -242,6 +265,7 @@ struct processor {
...
@@ -242,6 +265,7 @@ struct processor {
std
::
unordered_map
<
uint32
,
uint32
>
effect_count_code_duel
;
std
::
unordered_map
<
uint32
,
uint32
>
effect_count_code_duel
;
std
::
unordered_map
<
uint32
,
uint32
>
spsummon_once_map
[
2
];
std
::
unordered_map
<
uint32
,
uint32
>
spsummon_once_map
[
2
];
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>>
xmaterial_lst
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>>
xmaterial_lst
;
ptr
temp_var
[
4
];
ptr
temp_var
[
4
];
uint32
global_flag
;
uint32
global_flag
;
uint16
pre_field
[
2
];
uint16
pre_field
[
2
];
...
@@ -328,6 +352,17 @@ struct processor {
...
@@ -328,6 +352,17 @@ struct processor {
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
chain_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>>
chain_counter
;
processor_list
recover_damage_reserve
;
processor_list
recover_damage_reserve
;
effect_vector
dec_count_reserve
;
effect_vector
dec_count_reserve
;
processor
()
:
temp_var
{
0
},
global_flag
(
0
),
pre_field
{
0
},
chain_solving
(
FALSE
),
conti_solving
(
FALSE
),
win_player
(
5
),
win_reason
(
0
),
re_adjust
(
FALSE
),
reason_effect
(
nullptr
),
reason_player
(
PLAYER_NONE
),
summoning_card
(
nullptr
),
summon_depth
(
0
),
summon_cancelable
(
FALSE
),
attacker
(
nullptr
),
attack_target
(
nullptr
),
limit_extra_summon_zone
(
0
),
limit_extra_summon_releasable
(
0
),
limit_tuner
(
nullptr
),
limit_syn
(
nullptr
),
limit_syn_minc
(
0
),
limit_syn_maxc
(
0
),
limit_xyz
(
nullptr
),
limit_xyz_minc
(
0
),
limit_xyz_maxc
(
0
),
limit_link
(
nullptr
),
limit_link_card
(
nullptr
),
limit_link_minc
(
0
),
limit_link_maxc
(
0
),
not_material
(
FALSE
),
attack_cancelable
(
FALSE
),
attack_rollback
(
FALSE
),
effect_damage_step
(
0
),
battle_damage
{
0
},
summon_count
{
0
},
extra_summon
{
FALSE
},
spe_effect
{
0
},
duel_options
(
0
),
duel_rule
(
0
),
copy_reset
(
0
),
copy_reset_count
(
0
),
last_control_changed_id
(
0
),
set_group_used_zones
(
0
),
set_group_seq
{
0
},
dice_result
{
0
},
coin_result
{
0
},
to_bp
(
FALSE
),
to_m2
(
FALSE
),
to_ep
(
FALSE
),
skip_m2
(
FALSE
),
chain_attack
(
FALSE
),
chain_attacker_id
(
0
),
chain_attack_target
(
nullptr
),
attack_player
(
PLAYER_NONE
),
selfdes_disabled
(
FALSE
),
overdraw
{
FALSE
},
check_level
(
0
),
shuffle_check_disabled
(
FALSE
),
shuffle_hand_check
{
FALSE
},
shuffle_deck_check
{
FALSE
},
deck_reversed
(
FALSE
),
remove_brainwashing
(
FALSE
),
flip_delayed
(
FALSE
),
damage_calculated
(
FALSE
),
hand_adjusted
(
FALSE
),
summon_state_count
{
0
},
normalsummon_state_count
{
0
},
flipsummon_state_count
{
0
},
spsummon_state_count
{
0
},
attack_state_count
{
0
},
battle_phase_count
{
0
},
battled_count
{
0
},
phase_action
(
FALSE
),
hint_timing
{
0
},
current_player
(
PLAYER_NONE
),
conti_player
(
PLAYER_NONE
)
{}
};
};
class
field
{
class
field
{
public:
public:
...
...
operations.cpp
View file @
50680705
...
@@ -3898,6 +3898,9 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3898,6 +3898,9 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
card_vector
cv
;
card_vector
cv
;
card_vector
::
iterator
cvit
;
card_vector
::
iterator
cvit
;
effect
*
predirect
;
effect
*
predirect
;
exargs
()
:
targets
(
nullptr
),
show_decktop
{
FALSE
},
predirect
(
nullptr
)
{}
}
;
}
;
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
...
...
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