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
83a3e621
Commit
83a3e621
authored
Mar 04, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro-core
parents
35a2d6ec
df431baf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
23 deletions
+64
-23
card.cpp
card.cpp
+2
-1
effect.cpp
effect.cpp
+2
-3
effect.h
effect.h
+1
-1
field.cpp
field.cpp
+4
-1
operations.cpp
operations.cpp
+51
-14
processor.cpp
processor.cpp
+4
-3
No files found.
card.cpp
View file @
83a3e621
...
...
@@ -2836,6 +2836,7 @@ effect* card::is_affected_by_effect(int32 code, card* target) {
}
return
0
;
}
// return the last control-changing continous effect
effect
*
card
::
check_control_effect
()
{
effect
*
ret_effect
=
0
;
for
(
auto
&
pcard
:
equiping_cards
)
{
...
...
@@ -2859,7 +2860,7 @@ effect* card::check_control_effect() {
auto
rg
=
single_effect
.
equal_range
(
EFFECT_SET_CONTROL
);
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
effect
*
peffect
=
rg
.
first
->
second
;
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_
SINGLE_RANG
E
))
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_
OWNER_RELAT
E
))
continue
;
if
(
!
ret_effect
||
peffect
->
id
>
ret_effect
->
id
)
ret_effect
=
peffect
;
...
...
effect.cpp
View file @
83a3e621
...
...
@@ -168,7 +168,6 @@ int32 effect::check_count_limit(uint8 playerid) {
}
// check if an EFFECT_TYPE_ACTIONS effect can be activated
// for triggering effects, it checks EFFECT_FLAG_DAMAGE_STEP, EFFECT_FLAG_SET_AVAILABLE
// for continuous effect, it checks EFFECT_FLAG_AVAILABLE_BD
int32
effect
::
is_activateable
(
uint8
playerid
,
const
tevent
&
e
,
int32
neglect_cond
,
int32
neglect_cost
,
int32
neglect_target
,
int32
neglect_loc
,
int32
neglect_faceup
)
{
if
(
!
(
type
&
EFFECT_TYPE_ACTIONS
))
return
FALSE
;
...
...
@@ -549,7 +548,7 @@ int32 effect::is_chainable(uint8 tp) {
return
TRUE
;
}
//return: this can be reset by reset_level or not
//RESET_CODE can only reset single effects without EFFECT_FLAG_SINGLE_RANGE
//RESET_CODE can only reset single effects without EFFECT_FLAG_SINGLE_RANGE
, EFFECT_FLAG_OWNER_RELATE
//RESET_DISABLE is valid only when owner == handler
int32
effect
::
reset
(
uint32
reset_level
,
uint32
reset_type
)
{
switch
(
reset_type
)
{
...
...
@@ -582,7 +581,7 @@ int32 effect::reset(uint32 reset_level, uint32 reset_type) {
}
case
RESET_CODE
:
{
return
(
code
==
reset_level
)
&&
(
type
&
EFFECT_TYPE_SINGLE
)
&&
!
(
type
&
EFFECT_TYPE_ACTIONS
)
&&
!
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
);
&&
!
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
!
is_flag
(
EFFECT_FLAG_OWNER_RELATE
)
;
break
;
}
case
RESET_COPY
:
{
...
...
effect.h
View file @
83a3e621
...
...
@@ -200,7 +200,7 @@ enum effect_flag : uint32 {
EFFECT_FLAG_NO_TURN_RESET
=
0x400000
,
EFFECT_FLAG_EVENT_PLAYER
=
0x800000
,
EFFECT_FLAG_OWNER_RELATE
=
0x1000000
,
// EFFECT_FLAG_AVAILABLE_BD
= 0x2000000,
EFFECT_FLAG_CANNOT_INACTIVATE
=
0x2000000
,
EFFECT_FLAG_CLIENT_HINT
=
0x4000000
,
// EFFECT_FLAG_CHAIN_UNIQUE = 0x8000000,
EFFECT_FLAG_LIMIT_ZONE
=
0x10000000
,
...
...
field.cpp
View file @
83a3e621
...
...
@@ -1250,6 +1250,9 @@ void field::remove_oath_effect(effect* reason_effect) {
void
field
::
reset_phase
(
uint32
phase
)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
auto
rm
=
eit
++
;
// work around: skip turn still raise reset_phase(PHASE_END)
// without this taking control only for one turn will be returned when skipping turn
// RESET_TURN_END should be introduced
if
((
*
rm
)
->
code
==
EFFECT_SET_CONTROL
)
continue
;
if
((
*
rm
)
->
reset
(
phase
,
RESET_PHASE
))
{
...
...
@@ -3173,7 +3176,7 @@ int32 field::is_chain_negatable(uint8 chaincount) {
peffect
=
core
.
current_chain
.
back
().
triggering_effect
;
else
peffect
=
core
.
current_chain
[
chaincount
-
1
].
triggering_effect
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CANNOT_
DISABL
E
))
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CANNOT_
INACTIVAT
E
))
return
FALSE
;
filter_field_effect
(
EFFECT_CANNOT_INACTIVATE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
operations.cpp
View file @
83a3e621
...
...
@@ -1291,25 +1291,60 @@ int32 field::self_destroy(uint16 step, card* ucard, int32 p) {
auto
cit
=
cset
.
begin
();
ucard
->
unique_fieldid
=
(
*
cit
)
->
fieldid
;
}
else
{
card
*
mcard
=
0
;
core
.
select_cards
.
clear
();
uint8
player
=
p
;
for
(
auto
&
pcard
:
cset
)
{
if
(
ucard
->
unique_fieldid
==
pcard
->
fieldid
)
{
mcard
=
pcard
;
break
;
if
(
pcard
->
current
.
controler
==
player
&&
pcard
->
unique_fieldid
!=
UINT_MAX
)
core
.
select_cards
.
push_back
(
pcard
);
}
if
(
core
.
select_cards
.
size
()
==
0
)
{
player
=
1
-
p
;
for
(
auto
&
pcard
:
cset
)
{
if
(
pcard
->
current
.
controler
==
player
&&
pcard
->
unique_fieldid
!=
UINT_MAX
)
core
.
select_cards
.
push_back
(
pcard
);
}
if
(
!
mcard
||
pcard
->
fieldid
<
mcard
->
fieldid
)
mcard
=
pcard
;
}
ucard
->
unique_fieldid
=
mcard
->
fieldid
;
cset
.
erase
(
mcard
);
for
(
auto
&
pcard
:
cset
)
{
pcard
->
temp
.
reason_effect
=
pcard
->
current
.
reason_effect
;
pcard
->
temp
.
reason_player
=
pcard
->
current
.
reason_player
;
pcard
->
current
.
reason_effect
=
ucard
->
unique_effect
;
pcard
->
current
.
reason_player
=
ucard
->
current
.
controler
;
if
(
core
.
select_cards
.
size
()
==
0
)
{
player
=
p
;
for
(
auto
&
pcard
:
cset
)
{
if
(
pcard
->
current
.
controler
==
player
)
core
.
select_cards
.
push_back
(
pcard
);
}
}
if
(
core
.
select_cards
.
size
()
==
0
)
{
player
=
1
-
p
;
for
(
auto
&
pcard
:
cset
)
{
if
(
pcard
->
current
.
controler
==
player
)
core
.
select_cards
.
push_back
(
pcard
);
}
}
if
(
core
.
select_cards
.
size
()
==
1
)
{
returns
.
bvalue
[
1
]
=
0
;
}
destroy
(
&
cset
,
0
,
REASON_RULE
,
5
);
else
{
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
player
);
pduel
->
write_buffer32
(
534
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
player
,
0x10001
);
}
return
FALSE
;
}
return
TRUE
;
}
case
1
:
{
card_set
cset
;
ucard
->
get_unique_target
(
&
cset
,
p
);
card
*
mcard
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
ucard
->
unique_fieldid
=
mcard
->
fieldid
;
cset
.
erase
(
mcard
);
for
(
auto
&
pcard
:
cset
)
{
pcard
->
temp
.
reason_effect
=
pcard
->
current
.
reason_effect
;
pcard
->
temp
.
reason_player
=
pcard
->
current
.
reason_player
;
pcard
->
current
.
reason_effect
=
ucard
->
unique_effect
;
pcard
->
current
.
reason_player
=
ucard
->
current
.
controler
;
}
destroy
(
&
cset
,
0
,
REASON_RULE
,
5
);
return
TRUE
;
}
case
10
:
{
...
...
@@ -4498,6 +4533,8 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
core
.
hint_timing
[
pcard
->
current
.
controler
]
|=
TIMING_POS_CHANGE
;
if
((
opos
&
POS_FACEDOWN
)
&&
(
npos
&
POS_FACEUP
))
{
pcard
->
fieldid
=
infos
.
field_id
++
;
if
(
check_unique_onfield
(
pcard
,
pcard
->
current
.
controler
,
pcard
->
current
.
location
))
pcard
->
unique_fieldid
=
UINT_MAX
;
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
)
{
raise_single_event
(
pcard
,
0
,
EVENT_FLIP
,
reason_effect
,
0
,
reason_player
,
0
,
flag
);
flips
.
insert
(
pcard
);
...
...
processor.cpp
View file @
83a3e621
...
...
@@ -1395,6 +1395,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
core
.
select_chains
.
push_back
(
newchain
);
cn_count
++
;
}
//all effects taking control non-permanently are only until End Phase, not until Turn end
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
effect
*
peffect
=
*
eit
++
;
if
(
peffect
->
code
!=
EFFECT_SET_CONTROL
)
...
...
@@ -1407,7 +1408,8 @@ int32 field::process_phase_event(int16 step, int32 phase) {
uint8
tp
=
infos
.
turn_player
;
if
(
!
(((
peffect
->
reset_flag
&
RESET_SELF_TURN
)
&&
pid
==
tp
)
||
((
peffect
->
reset_flag
&
RESET_OPPO_TURN
)
&&
pid
!=
tp
)))
continue
;
if
(
peffect
->
reset_count
!=
1
)
peffect
->
reset_count
--
;
if
(
peffect
->
reset_count
!=
0
)
continue
;
card
*
phandler
=
peffect
->
get_handler
();
if
(
pid
!=
phandler
->
current
.
controler
)
{
...
...
@@ -5066,7 +5068,7 @@ int32 field::adjust_step(uint16 step) {
return
FALSE
;
}
case
4
:
{
//
1-5
control
//control
core
.
control_adjust_set
[
0
].
clear
();
core
.
control_adjust_set
[
1
].
clear
();
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
...
...
@@ -5096,7 +5098,6 @@ int32 field::adjust_step(uint16 step) {
if
(
res
)
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
auto
&
pcard
:
player
[
p
].
list_mzone
)
{
// remove EFFECT_SET_CONTROL
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_REMOVE_BRAINWASHING
))
{
pcard
->
reset
(
EFFECT_SET_CONTROL
,
RESET_CODE
);
if
(
p
!=
pcard
->
owner
&&
pcard
->
is_capable_change_control
())
...
...
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