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
86c1f543
Commit
86c1f543
authored
Jul 26, 2018
by
DailyShana
Committed by
GitHub
Jul 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update hand trigger (#174)
* update hand trigger * refine
parent
16318155
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
23 deletions
+51
-23
field.h
field.h
+1
-0
processor.cpp
processor.cpp
+50
-23
No files found.
field.h
View file @
86c1f543
...
@@ -609,6 +609,7 @@ public:
...
@@ -609,6 +609,7 @@ public:
#define CHAIN_HAND_EFFECT 0x04
#define CHAIN_HAND_EFFECT 0x04
#define CHAIN_CONTINUOUS_CARD 0x08
#define CHAIN_CONTINUOUS_CARD 0x08
#define CHAIN_ACTIVATING 0x10
#define CHAIN_ACTIVATING 0x10
#define CHAIN_HAND_TRIGGER 0x20
#define CHAININFO_CHAIN_COUNT 0x01
#define CHAININFO_CHAIN_COUNT 0x01
#define CHAININFO_TRIGGERING_EFFECT 0x02
#define CHAININFO_TRIGGERING_EFFECT 0x02
#define CHAININFO_TRIGGERING_PLAYER 0x04
#define CHAININFO_TRIGGERING_PLAYER 0x04
...
...
processor.cpp
View file @
86c1f543
...
@@ -1767,27 +1767,41 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1767,27 +1767,41 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
}
}
uint8 tp = clit->triggering_player;
uint8 tp = clit->triggering_player;
bool act = true;
bool act = true;
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY)
&& ((peffect->type & EFFECT_TYPE_SINGLE) && !peffect->is_flag(EFFECT_FLAG_SINGLE_RANGE)
&& phandler->is_has_relation(*clit) && clit->triggering_location == LOCATION_HAND
|| (peffect->range & LOCATION_HAND))) {
clit->flag |= CHAIN_HAND_TRIGGER;
core.new_ochain_h.push_back(*clit);
if(clit->triggering_location == LOCATION_HAND && phandler->is_position(POS_FACEDOWN)
|| peffect->range && !peffect->in_range(*clit))
act = false;
}
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
if(peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
&& (!(peffect->type & EFFECT_TYPE_FIELD) || phandler->is_has_relation(*clit))
&& (!(peffect->type & EFFECT_TYPE_FIELD) || phandler->is_has_relation(*clit))
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE
&& (peffect->code == EVENT_FLIP && infos.phase == PHASE_DAMAGE
|| (clit->triggering_location & 0x43) && (clit->triggering_position & POS_FACEDOWN)
|| (clit->triggering_location & 0x43) && (clit->triggering_position & POS_FACEDOWN)
|| !(phandler->current.location & 0x43) || phandler->is_position(POS_FACEUP))) {
|| !(phandler->current.location & 0x43) || phandler->is_position(POS_FACEUP))) {
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
&&
clit
->
triggering_location
==
LOCATION_HAND
if(peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) || !(peffect->type & EFFECT_TYPE_FIELD) || peffect->in_range(*clit)) {
&&
(((
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
phandler
->
is_has_relation
(
*
clit
))
if((peffect->status & EFFECT_STATUS_SPSELF) && (clit->flag & CHAIN_HAND_TRIGGER)) {
||
(
peffect
->
range
&
LOCATION_HAND
)))
{
for(auto tpit = core.current_chain.begin(); tpit != core.current_chain.end(); ++tpit) {
core
.
new_ochain_h
.
push_back
(
*
clit
);
if(tpit->triggering_player == tp
act
=
false
;
&& (tpit->triggering_effect->status & EFFECT_STATUS_SPSELF) && (tpit->flag & CHAIN_HAND_TRIGGER)) {
}
else
if
(
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
in_range
(
*
clit
))
{
act = false;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CHAIN_UNIQUE
))
{
break;
for
(
auto
tpit
=
core
.
current_chain
.
begin
();
tpit
!=
core
.
current_chain
.
end
();
++
tpit
)
{
}
if
(
tpit
->
triggering_effect
->
get_handler
()
->
data
.
code
==
phandler
->
data
.
code
&&
tpit
->
triggering_player
==
tp
)
{
}
act
=
false
;
}
break
;
if(peffect->is_flag(EFFECT_FLAG_CHAIN_UNIQUE)) {
}
for(auto tpit = core.current_chain.begin(); tpit != core.current_chain.end(); ++tpit) {
}
if(tpit->triggering_player == tp && tpit->triggering_effect->get_handler()->data.code == phandler->data.code) {
}
act = false;
}
else
break;
act
=
false
;
}
}
}
} else
act = false;
} else act = false;
} else act = false;
if(act) {
if(act) {
if(tp == core.current_player)
if(tp == core.current_player)
...
@@ -1837,6 +1851,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1837,6 +1851,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
core.new_chains.push_back(newchain);
core.new_chains.push_back(newchain);
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
core.new_ochain_s.remove_if([=](chain ch) { return ch.chain_id == newchain.chain_id; });
core.new_ochain_s.remove_if([=](chain ch) { return ch.chain_id == newchain.chain_id; });
core.new_ochain_h.remove_if([=](chain ch) { return ch.chain_id == newchain.chain_id; });
core.units.begin()->step = 3;
core.units.begin()->step = 3;
return FALSE;
return FALSE;
}
}
...
@@ -2100,17 +2115,29 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -2100,17 +2115,29 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
for(auto clit = core.new_ochain_h.begin(); clit != core.new_ochain_h.end(); ++clit) {
for(auto clit = core.new_ochain_h.begin(); clit != core.new_ochain_h.end(); ++clit) {
effect* peffect = clit->triggering_effect;
effect* peffect = clit->triggering_effect;
card* phandler = peffect->get_handler();
card* phandler = peffect->get_handler();
if(!peffect->is_flag(EFFECT_FLAG_FIELD_ONLY) && (peffect->type & EFFECT_TYPE_FIELD)
&& (peffect->range & LOCATION_HAND) && phandler->current.location == LOCATION_HAND) {
if(!phandler->is_has_relation(*clit))
phandler->create_relation(*clit);
clit->triggering_player = phandler->current.controler;
clit->set_triggering_place(phandler);
}
bool act = true;
bool act = true;
if
(
clit
->
triggering_player
==
priority
&&
!
phandler
->
is_status
(
STATUS_CHAINING
)
&&
phandler
->
is_has_relation
(
*
clit
)
if(clit->triggering_player == priority && clit->triggering_location == LOCATION_HAND
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
clit
->
evt
,
TRUE
))
{
&& phandler->is_position(POS_FACEDOWN) && !phandler->is_status(STATUS_CHAINING) && phandler->is_has_relation(*clit)
for
(
auto
cait
=
core
.
current_chain
.
begin
();
cait
!=
core
.
current_chain
.
end
();
++
cait
)
{
&& peffect->is_chainable(priority) && peffect->is_activateable(priority, clit->evt, TRUE)) {
if
(
cait
->
triggering_player
==
priority
)
{
if(peffect->status & EFFECT_STATUS_SPSELF) {
if
((
peffect
->
status
&
EFFECT_STATUS_SPSELF
)
&&
(
cait
->
triggering_effect
->
status
&
EFFECT_STATUS_SPSELF
)
for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) {
&&
std
::
any_of
(
core
.
new_ochain_h
.
begin
(),
core
.
new_ochain_h
.
end
(),
[
=
](
chain
ch
)
{
return
ch
.
chain_id
==
cait
->
chain_id
;
}))
{
if(cait->triggering_player == priority
&& (cait->triggering_effect->status & EFFECT_STATUS_SPSELF) && (cait->flag & CHAIN_HAND_TRIGGER)) {
act = false;
act = false;
break;
break;
}
}
if
(
peffect
->
is_flag
(
EFFECT_FLAG_CHAIN_UNIQUE
)
&&
cait
->
triggering_effect
->
get_handler
()
->
data
.
code
==
phandler
->
data
.
code
)
{
}
}
if(peffect->is_flag(EFFECT_FLAG_CHAIN_UNIQUE)) {
for(auto cait = core.current_chain.begin(); cait != core.current_chain.end(); ++cait) {
if(cait->triggering_player == priority && cait->triggering_effect->get_handler()->data.code == phandler->data.code) {
act = false;
act = false;
break;
break;
}
}
...
...
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