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
f39885a8
Commit
f39885a8
authored
Apr 02, 2020
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new ruling: (special) summon count
parent
08da17f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
61 deletions
+11
-61
card.cpp
card.cpp
+0
-2
card.h
card.h
+0
-1
field.cpp
field.cpp
+5
-22
field.h
field.h
+1
-4
operations.cpp
operations.cpp
+5
-6
processor.cpp
processor.cpp
+0
-26
No files found.
card.cpp
View file @
f39885a8
...
...
@@ -91,7 +91,6 @@ card::card(duel* pd) {
std
::
memset
(
&
temp
,
0xff
,
sizeof
(
card_state
));
unique_pos
[
0
]
=
unique_pos
[
1
]
=
0
;
spsummon_counter
[
0
]
=
spsummon_counter
[
1
]
=
0
;
spsummon_counter_rst
[
0
]
=
spsummon_counter_rst
[
1
]
=
0
;
unique_code
=
0
;
unique_fieldid
=
0
;
assume_type
=
0
;
...
...
@@ -1505,7 +1504,6 @@ void card::apply_field_effect() {
if
(
unique_code
&&
(
current
.
location
&
unique_location
))
pduel
->
game_field
->
add_unique_card
(
this
);
spsummon_counter
[
0
]
=
spsummon_counter
[
1
]
=
0
;
spsummon_counter_rst
[
0
]
=
spsummon_counter_rst
[
1
]
=
0
;
}
void
card
::
cancel_field_effect
()
{
if
(
current
.
controler
==
PLAYER_NONE
)
...
...
card.h
View file @
f39885a8
...
...
@@ -161,7 +161,6 @@ public:
effect
*
unique_effect
;
uint32
spsummon_code
;
uint16
spsummon_counter
[
2
];
uint16
spsummon_counter_rst
[
2
];
uint8
assume_type
;
uint32
assume_value
;
card
*
equiping_target
;
...
...
field.cpp
View file @
f39885a8
...
...
@@ -2170,32 +2170,15 @@ void field::check_chain_counter(effect* peffect, int32 playerid, int32 chainid,
}
}
}
void
field
::
set_spsummon_counter
(
uint8
playerid
,
bool
add
,
bool
chain
)
{
if
(
add
)
{
core
.
spsummon_state_count
[
playerid
]
++
;
if
(
chain
)
core
.
spsummon_state_count_rst
[
playerid
]
++
;
}
else
{
if
(
chain
)
{
core
.
spsummon_state_count
[
playerid
]
-=
core
.
spsummon_state_count_rst
[
playerid
];
core
.
spsummon_state_count_rst
[
playerid
]
=
0
;
}
else
core
.
spsummon_state_count
[
playerid
]
--
;
}
void
field
::
set_spsummon_counter
(
uint8
playerid
)
{
core
.
spsummon_state_count
[
playerid
]
++
;
if
(
core
.
global_flag
&
GLOBALFLAG_SPSUMMON_COUNT
)
{
for
(
auto
&
peffect
:
effects
.
spsummon_count_eff
)
{
card
*
pcard
=
peffect
->
get_handler
();
if
(
add
)
{
if
(
peffect
->
is_available
())
{
if
(((
playerid
==
pcard
->
current
.
controler
)
&&
peffect
->
s_range
)
||
((
playerid
!=
pcard
->
current
.
controler
)
&&
peffect
->
o_range
))
{
pcard
->
spsummon_counter
[
playerid
]
++
;
if
(
chain
)
pcard
->
spsummon_counter_rst
[
playerid
]
++
;
}
if
(
peffect
->
is_available
())
{
if
(((
playerid
==
pcard
->
current
.
controler
)
&&
peffect
->
s_range
)
||
((
playerid
!=
pcard
->
current
.
controler
)
&&
peffect
->
o_range
))
{
pcard
->
spsummon_counter
[
playerid
]
++
;
}
}
else
{
pcard
->
spsummon_counter
[
playerid
]
-=
pcard
->
spsummon_counter_rst
[
playerid
];
pcard
->
spsummon_counter_rst
[
playerid
]
=
0
;
}
}
}
...
...
field.h
View file @
f39885a8
...
...
@@ -313,9 +313,6 @@ struct processor {
uint8
normalsummon_state_count
[
2
];
uint8
flipsummon_state_count
[
2
];
uint8
spsummon_state_count
[
2
];
uint8
spsummon_state_count_rst
[
2
];
uint8
spsummon_state_count_tmp
[
2
];
bool
spsummon_rst
;
uint8
attack_state_count
[
2
];
uint8
battle_phase_count
[
2
];
uint8
battled_count
[
2
];
...
...
@@ -432,7 +429,7 @@ public:
void
check_card_counter
(
card
*
pcard
,
int32
counter_type
,
int32
playerid
);
void
check_card_counter
(
group
*
pgroup
,
int32
counter_type
,
int32
playerid
);
void
check_chain_counter
(
effect
*
peffect
,
int32
playerid
,
int32
chainid
,
bool
cancel
=
false
);
void
set_spsummon_counter
(
uint8
playerid
,
bool
add
=
true
,
bool
chain
=
false
);
void
set_spsummon_counter
(
uint8
playerid
);
int32
check_spsummon_counter
(
uint8
playerid
,
uint8
ct
=
1
);
int32
check_lp_cost
(
uint8
playerid
,
uint32
cost
);
...
...
operations.cpp
View file @
f39885a8
...
...
@@ -1916,8 +1916,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
pduel
->
write_buffer8
(
MSG_SUMMONING
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
get_info_location
());
core
.
summon_state_count
[
sumplayer
]
++
;
core
.
normalsummon_state_count
[
sumplayer
]
++
;
if
(
target
->
material_cards
.
size
())
{
for
(
auto
&
mcard
:
target
->
material_cards
)
raise_single_event
(
mcard
,
0
,
EVENT_BE_PRE_MATERIAL
,
proc
,
REASON_SUMMON
,
sumplayer
,
sumplayer
,
0
);
...
...
@@ -1992,6 +1990,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
return
FALSE
;
}
case
17
:
{
core
.
summon_state_count
[
sumplayer
]
++
;
core
.
normalsummon_state_count
[
sumplayer
]
++
;
check_card_counter
(
target
,
1
,
sumplayer
);
check_card_counter
(
target
,
2
,
sumplayer
);
raise_single_event
(
target
,
0
,
EVENT_SUMMON_SUCCESS
,
proc
,
0
,
sumplayer
,
sumplayer
,
0
);
...
...
@@ -2032,7 +2032,6 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
target
->
current
.
position
=
POS_FACEUP_ATTACK
;
target
->
fieldid
=
infos
.
field_id
++
;
core
.
phase_action
=
TRUE
;
core
.
flipsummon_state_count
[
sumplayer
]
++
;
pduel
->
write_buffer8
(
MSG_FLIPSUMMONING
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
pduel
->
write_buffer32
(
target
->
get_info_location
());
...
...
@@ -2065,6 +2064,7 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
}
case
4
:
{
pduel
->
write_buffer8
(
MSG_FLIPSUMMONED
);
core
.
flipsummon_state_count
[
sumplayer
]
++
;
check_card_counter
(
target
,
4
,
sumplayer
);
adjust_instant
();
raise_single_event
(
target
,
0
,
EVENT_FLIP
,
0
,
0
,
sumplayer
,
sumplayer
,
0
);
...
...
@@ -2755,7 +2755,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
target
->
current
.
reason_effect
=
peffect
;
target
->
current
.
reason_player
=
sumplayer
;
target
->
summon_player
=
sumplayer
;
set_spsummon_counter
(
sumplayer
);
break_effect
();
return
FALSE
;
}
...
...
@@ -2860,6 +2859,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return
FALSE
;
}
case
17
:
{
set_spsummon_counter
(
sumplayer
);
check_card_counter
(
target
,
3
,
sumplayer
);
if
(
target
->
spsummon_code
)
core
.
spsummon_once_map
[
sumplayer
][
target
->
spsummon_code
]
++
;
...
...
@@ -2962,7 +2962,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
}
case
25
:
{
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
set_spsummon_counter
(
sumplayer
);
card_set
cset
;
for
(
auto
&
pcard
:
pgroup
->
container
)
{
pcard
->
set_status
(
STATUS_SUMMONING
,
TRUE
);
...
...
@@ -3015,6 +3014,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
case
28
:
{
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
pduel
->
write_buffer8
(
MSG_SPSUMMONED
);
set_spsummon_counter
(
sumplayer
);
check_card_counter
(
pgroup
,
3
,
sumplayer
);
std
::
set
<
uint32
>
spsummon_once_set
;
for
(
auto
&
pcard
:
pgroup
->
container
)
{
...
...
@@ -4743,7 +4743,6 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
if
((
pcard
->
summon_info
&
SUMMON_TYPE_PENDULUM
)
==
SUMMON_TYPE_PENDULUM
)
pcard
->
summon_info
&=
0xf000ffff
;
pcard
->
spsummon_counter
[
0
]
=
pcard
->
spsummon_counter
[
1
]
=
0
;
pcard
->
spsummon_counter_rst
[
0
]
=
pcard
->
spsummon_counter_rst
[
1
]
=
0
;
}
if
((
npos
&
POS_FACEDOWN
)
&&
pcard
->
equiping_cards
.
size
())
{
for
(
auto
csit
=
pcard
->
equiping_cards
.
begin
();
csit
!=
pcard
->
equiping_cards
.
end
();)
{
...
...
processor.cpp
View file @
f39885a8
...
...
@@ -3642,7 +3642,6 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core
.
normalsummon_state_count
[
p
]
=
0
;
core
.
flipsummon_state_count
[
p
]
=
0
;
core
.
spsummon_state_count
[
p
]
=
0
;
core
.
spsummon_state_count_rst
[
p
]
=
0
;
core
.
attack_state_count
[
p
]
=
0
;
core
.
battle_phase_count
[
p
]
=
0
;
core
.
battled_count
[
p
]
=
0
;
...
...
@@ -3650,7 +3649,6 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core
.
extra_summon
[
p
]
=
0
;
core
.
spsummon_once_map
[
p
].
clear
();
}
core
.
spsummon_rst
=
false
;
for
(
auto
&
peffect
:
effects
.
rechargeable
)
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_NO_TURN_RESET
))
peffect
->
recharge
();
...
...
@@ -3671,7 +3669,6 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
card
*
pcard
=
peffect
->
get_handler
();
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_NO_TURN_RESET
))
{
pcard
->
spsummon_counter
[
0
]
=
pcard
->
spsummon_counter
[
1
]
=
0
;
pcard
->
spsummon_counter_rst
[
0
]
=
pcard
->
spsummon_counter_rst
[
1
]
=
0
;
}
}
}
...
...
@@ -4156,12 +4153,6 @@ int32 field::add_chain(uint16 step) {
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
clit
.
flag
|=
CHAIN_CONTINUOUS_CARD
;
core
.
phase_action
=
TRUE
;
if
(
clit
.
opinfos
.
count
(
0x200
)
&&
clit
.
opinfos
[
0x200
].
op_count
)
{
core
.
spsummon_rst
=
true
;
set_spsummon_counter
(
clit
.
triggering_player
,
true
,
true
);
if
(
clit
.
opinfos
[
0x200
].
op_player
==
PLAYER_ALL
)
set_spsummon_counter
(
1
-
clit
.
triggering_player
,
true
,
true
);
}
pduel
->
write_buffer8
(
MSG_CHAINED
);
pduel
->
write_buffer8
(
clit
.
chain_count
);
raise_event
(
phandler
,
EVENT_CHAINING
,
peffect
,
0
,
clit
.
triggering_player
,
clit
.
triggering_player
,
clit
.
chain_count
);
...
...
@@ -4279,11 +4270,6 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
auto
cait
=
core
.
current_chain
.
rbegin
();
switch
(
step
)
{
case
0
:
{
if
(
core
.
spsummon_rst
)
{
set_spsummon_counter
(
0
,
false
,
true
);
set_spsummon_counter
(
1
,
false
,
true
);
core
.
spsummon_rst
=
false
;
}
pduel
->
write_buffer8
(
MSG_CHAIN_SOLVING
);
pduel
->
write_buffer8
(
cait
->
chain_count
);
add_to_disable_check_list
(
cait
->
triggering_effect
->
get_handler
());
...
...
@@ -4317,8 +4303,6 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
return
FALSE
;
}
case
2
:
{
core
.
spsummon_state_count_tmp
[
0
]
=
core
.
spsummon_state_count
[
0
];
core
.
spsummon_state_count_tmp
[
1
]
=
core
.
spsummon_state_count
[
1
];
effect
*
peffect
=
cait
->
triggering_effect
;
card
*
pcard
=
peffect
->
get_handler
();
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
pcard
->
is_has_relation
(
*
cait
))
{
...
...
@@ -4369,16 +4353,6 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
return
FALSE
;
}
case
4
:
{
if
(
core
.
units
.
begin
()
->
arg4
==
0
)
{
if
(
cait
->
opinfos
.
count
(
0x200
)
&&
cait
->
opinfos
[
0x200
].
op_count
)
{
if
(
core
.
spsummon_state_count_tmp
[
cait
->
triggering_player
]
==
core
.
spsummon_state_count
[
cait
->
triggering_player
])
set_spsummon_counter
(
cait
->
triggering_player
);
if
(
cait
->
opinfos
[
0x200
].
op_player
==
PLAYER_ALL
&&
core
.
spsummon_state_count_tmp
[
1
-
cait
->
triggering_player
]
==
core
.
spsummon_state_count
[
1
-
cait
->
triggering_player
])
set_spsummon_counter
(
1
-
cait
->
triggering_player
);
}
}
core
.
spsummon_state_count_tmp
[
0
]
=
0
;
core
.
spsummon_state_count_tmp
[
1
]
=
0
;
core
.
chain_solving
=
FALSE
;
if
(
core
.
delayed_continuous_tp
.
size
())
{
core
.
conti_player
=
infos
.
turn_player
;
...
...
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