Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
af1017d7
Commit
af1017d7
authored
Feb 23, 2013
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trigger
parent
a6409320
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
44 deletions
+55
-44
ocgcore/card.cpp
ocgcore/card.cpp
+2
-3
ocgcore/effect.cpp
ocgcore/effect.cpp
+4
-1
ocgcore/field.h
ocgcore/field.h
+1
-0
ocgcore/processor.cpp
ocgcore/processor.cpp
+48
-40
No files found.
ocgcore/card.cpp
View file @
af1017d7
...
@@ -682,9 +682,8 @@ void card::apply_field_effect() {
...
@@ -682,9 +682,8 @@ void card::apply_field_effect() {
if
(
current
.
controler
==
PLAYER_NONE
)
if
(
current
.
controler
==
PLAYER_NONE
)
return
;
return
;
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
if
(
current
.
location
&
it
->
second
->
range
)
{
if
(
(
current
.
location
&
it
->
second
->
range
)
||
((
it
->
second
->
range
&
LOCATION_HAND
)
&&
(
it
->
second
->
type
&
EFFECT_TYPE_TRIGGER_O
)))
pduel
->
game_field
->
add_effect
(
it
->
second
);
pduel
->
game_field
->
add_effect
(
it
->
second
);
}
}
}
if
(
unique_code
&&
(
current
.
location
&
LOCATION_ONFIELD
))
if
(
unique_code
&&
(
current
.
location
&
LOCATION_ONFIELD
))
pduel
->
game_field
->
add_unique_card
(
this
);
pduel
->
game_field
->
add_unique_card
(
this
);
...
@@ -693,7 +692,7 @@ void card::cancel_field_effect() {
...
@@ -693,7 +692,7 @@ void card::cancel_field_effect() {
if
(
current
.
controler
==
PLAYER_NONE
)
if
(
current
.
controler
==
PLAYER_NONE
)
return
;
return
;
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
for
(
auto
it
=
field_effect
.
begin
();
it
!=
field_effect
.
end
();
++
it
)
{
if
(
current
.
location
&
it
->
second
->
range
)
if
(
(
current
.
location
&
it
->
second
->
range
)
||
((
it
->
second
->
range
&
LOCATION_HAND
)
&&
(
it
->
second
->
type
&
EFFECT_TYPE_TRIGGER_O
))
)
pduel
->
game_field
->
remove_effect
(
it
->
second
);
pduel
->
game_field
->
remove_effect
(
it
->
second
);
}
}
if
(
unique_code
&&
current
.
location
&
LOCATION_ONFIELD
)
if
(
unique_code
&&
current
.
location
&
LOCATION_ONFIELD
)
...
...
ocgcore/effect.cpp
View file @
af1017d7
...
@@ -397,7 +397,10 @@ int32 effect::is_chainable(uint8 tp) {
...
@@ -397,7 +397,10 @@ int32 effect::is_chainable(uint8 tp) {
if
((
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
sp
<=
1
)
&&
!
(
flag
&
EFFECT_FLAG_COF
))
if
((
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
sp
<=
1
)
&&
!
(
flag
&
EFFECT_FLAG_COF
))
return
FALSE
;
return
FALSE
;
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
size
())
{
if
(
sp
<
pduel
->
game_field
->
core
.
current_chain
.
rbegin
()
->
triggering_effect
->
get_speed
())
if
((
type
&
EFFECT_TYPE_TRIGGER_O
)
&&
(
handler
->
current
.
location
==
LOCATION_HAND
))
{
if
(
pduel
->
game_field
->
core
.
current_chain
.
rbegin
()
->
triggering_effect
->
get_speed
()
>
2
)
return
FALSE
;
}
else
if
(
sp
<
pduel
->
game_field
->
core
.
current_chain
.
rbegin
()
->
triggering_effect
->
get_speed
())
return
FALSE
;
return
FALSE
;
}
}
if
(
pduel
->
game_field
->
core
.
chain_limit
)
{
if
(
pduel
->
game_field
->
core
.
chain_limit
)
{
...
...
ocgcore/field.h
View file @
af1017d7
...
@@ -175,6 +175,7 @@ struct processor {
...
@@ -175,6 +175,7 @@ struct processor {
chain_list
new_fchain_b
;
chain_list
new_fchain_b
;
chain_list
new_ochain_b
;
chain_list
new_ochain_b
;
chain_list
flip_chain_b
;
chain_list
flip_chain_b
;
chain_list
new_ochain_h
;
chain_list
new_chains
;
chain_list
new_chains
;
instant_f_list
quick_f_chain
;
instant_f_list
quick_f_chain
;
card_set
leave_confirmed
;
card_set
leave_confirmed
;
...
...
ocgcore/processor.cpp
View file @
af1017d7
...
@@ -1733,7 +1733,10 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1733,7 +1733,10 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
}
}
for
(
auto
clit
=
core
.
new_ochain_s
.
begin
();
clit
!=
core
.
new_ochain_s
.
end
();
++
clit
)
{
for
(
auto
clit
=
core
.
new_ochain_s
.
begin
();
clit
!=
core
.
new_ochain_s
.
end
();
++
clit
)
{
effect
*
peffect
=
clit
->
triggering_effect
;
effect
*
peffect
=
clit
->
triggering_effect
;
if
(
!
(
peffect
->
flag
&
(
EFFECT_FLAG_EVENT_PLAYER
|
EFFECT_FLAG_BOTH_SIDE
))
&&
peffect
->
handler
->
is_has_relation
(
peffect
))
{
if
((
!
(
peffect
->
flag
&
(
EFFECT_FLAG_EVENT_PLAYER
|
EFFECT_FLAG_BOTH_SIDE
))
&&
peffect
->
handler
->
is_has_relation
(
peffect
))
||
((
peffect
->
range
&
LOCATION_HAND
)
&&
peffect
->
handler
->
current
.
location
==
LOCATION_HAND
))
{
if
(
!
peffect
->
handler
->
is_has_relation
(
peffect
))
peffect
->
handler
->
create_relation
(
peffect
);
clit
->
triggering_player
=
peffect
->
handler
->
current
.
controler
;
clit
->
triggering_player
=
peffect
->
handler
->
current
.
controler
;
clit
->
triggering_controler
=
peffect
->
handler
->
current
.
controler
;
clit
->
triggering_controler
=
peffect
->
handler
->
current
.
controler
;
clit
->
triggering_location
=
peffect
->
handler
->
current
.
location
;
clit
->
triggering_location
=
peffect
->
handler
->
current
.
location
;
...
@@ -1747,6 +1750,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1747,6 +1750,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
core
.
new_ochain_s
.
clear
();
core
.
new_ochain_s
.
clear
();
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
tpchain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
tpchain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
ntpchain
);
core
.
new_ochain_s
.
splice
(
core
.
new_ochain_s
.
end
(),
core
.
ntpchain
);
core
.
new_ochain_h
.
clear
();
return
FALSE
;
return
FALSE
;
}
}
case
5
:
{
case
5
:
{
...
@@ -1759,57 +1763,38 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1759,57 +1763,38 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return
FALSE
;
return
FALSE
;
}
}
auto
clit
=
core
.
new_ochain_s
.
begin
();
auto
clit
=
core
.
new_ochain_s
.
begin
();
effect
*
peffect
=
clit
->
triggering_effect
;
uint8
tp
=
clit
->
triggering_player
;
uint8
tp
=
clit
->
triggering_player
;
bool
act
=
true
;
bool
act
=
true
;
if
(
clit
->
triggering_effect
->
is_chainable
(
tp
)
&&
clit
->
triggering_effect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
if
(
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
&&
((
clit
->
triggering_effect
->
code
==
EVENT_FLIP
)
||
(
clit
->
triggering_location
&
0x3
)
&&
((
peffect
->
code
==
EVENT_FLIP
)
||
(
clit
->
triggering_location
&
0x3
)
||
!
(
clit
->
triggering_effect
->
handler
->
current
.
location
&
0x3
)
||
clit
->
triggering_effect
->
handler
->
is_status
(
STATUS_IS_PUBLIC
)))
{
||
!
(
peffect
->
handler
->
current
.
location
&
0x3
)
||
peffect
->
handler
->
is_status
(
STATUS_IS_PUBLIC
)))
{
if
(
tp
==
infos
.
turn_player
)
{
if
((
peffect
->
range
&
LOCATION_HAND
)
&&
clit
->
triggering_location
==
LOCATION_HAND
)
{
for
(
auto
tpit
=
core
.
tpchain
.
begin
();
tpit
!=
core
.
tpchain
.
end
();
++
tpit
)
{
core
.
new_ochain_h
.
push_back
(
*
clit
);
if
(
!
(
clit
->
triggering_effect
->
flag
&
EFFECT_FLAG_MULTIACT_HAND
))
{
act
=
false
;
if
(
clit
->
triggering_location
==
LOCATION_HAND
)
{
}
else
if
(
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
(
clit
->
triggering_location
&
peffect
->
range
))
{
if
(
tpit
->
triggering_location
==
LOCATION_HAND
||
tpit
->
triggering_effect
->
handler
->
data
.
code
==
clit
->
triggering_effect
->
handler
->
data
.
code
)
{
if
(
peffect
->
flag
&
EFFECT_FLAG_CHAIN_UNIQUE
)
{
act
=
false
;
if
(
tp
==
infos
.
turn_player
)
{
break
;
for
(
auto
tpit
=
core
.
tpchain
.
begin
();
tpit
!=
core
.
tpchain
.
end
();
++
tpit
)
{
}
if
(
tpit
->
triggering_effect
->
handler
->
data
.
code
==
peffect
->
handler
->
data
.
code
)
{
}
else
{
if
(
tpit
->
triggering_location
==
LOCATION_HAND
&&
tpit
->
triggering_effect
->
handler
->
data
.
code
==
clit
->
triggering_effect
->
handler
->
data
.
code
)
{
act
=
false
;
act
=
false
;
break
;
break
;
}
}
}
}
}
}
else
{
if
(
act
&&
(
clit
->
triggering_effect
->
flag
&
EFFECT_FLAG_CHAIN_UNIQUE
)
for
(
auto
ntpit
=
core
.
ntpchain
.
begin
();
ntpit
!=
core
.
ntpchain
.
end
();
++
ntpit
)
{
&&
tpit
->
triggering_effect
->
handler
->
data
.
code
==
clit
->
triggering_effect
->
handler
->
data
.
code
)
{
if
(
ntpit
->
triggering_effect
->
handler
->
data
.
code
==
peffect
->
handler
->
data
.
code
)
{
act
=
false
;
break
;
}
}
}
else
{
for
(
auto
ntpit
=
core
.
ntpchain
.
begin
();
ntpit
!=
core
.
ntpchain
.
end
();
++
ntpit
)
{
if
(
!
(
clit
->
triggering_effect
->
flag
&
EFFECT_FLAG_MULTIACT_HAND
))
{
if
(
clit
->
triggering_location
==
LOCATION_HAND
)
{
if
(
ntpit
->
triggering_location
==
LOCATION_HAND
||
ntpit
->
triggering_effect
->
handler
->
data
.
code
==
clit
->
triggering_effect
->
handler
->
data
.
code
)
{
act
=
false
;
break
;
}
}
else
{
if
(
ntpit
->
triggering_location
==
LOCATION_HAND
&&
ntpit
->
triggering_effect
->
handler
->
data
.
code
==
clit
->
triggering_effect
->
handler
->
data
.
code
)
{
act
=
false
;
act
=
false
;
break
;
break
;
}
}
}
}
}
}
if
(
act
&&
(
clit
->
triggering_effect
->
flag
&
EFFECT_FLAG_CHAIN_UNIQUE
)
&&
ntpit
->
triggering_effect
->
handler
->
data
.
code
==
clit
->
triggering_effect
->
handler
->
data
.
code
)
{
act
=
false
;
break
;
}
}
}
}
}
else
act
=
false
;
}
else
act
=
false
;
}
else
act
=
false
;
if
(
act
)
if
(
act
)
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
clit
->
triggering_
effect
->
handler
,
tp
,
0
);
add_process
(
PROCESSOR_SELECT_EFFECTYN
,
0
,
0
,
(
group
*
)
p
effect
->
handler
,
tp
,
0
);
else
returns
.
ivalue
[
0
]
=
FALSE
;
else
returns
.
ivalue
[
0
]
=
FALSE
;
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1884,6 +1869,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1884,6 +1869,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return
FALSE
;
return
FALSE
;
}
}
case
10
:
{
case
10
:
{
core
.
new_ochain_h
.
clear
();
if
(
core
.
chain_limit
)
{
if
(
core
.
chain_limit
)
{
luaL_unref
(
pduel
->
lua
->
lua_state
,
LUA_REGISTRYINDEX
,
core
.
chain_limit
);
luaL_unref
(
pduel
->
lua
->
lua_state
,
LUA_REGISTRYINDEX
,
core
.
chain_limit
);
core
.
chain_limit
=
0
;
core
.
chain_limit
=
0
;
...
@@ -1907,11 +1893,9 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
...
@@ -1907,11 +1893,9 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
process_quick_effect
(
int16
step
,
int32
special
,
uint8
priority
)
{
int32
field
::
process_quick_effect
(
int16
step
,
int32
special
,
uint8
priority
)
{
effect_container
::
iterator
eit
;
pair
<
effect_container
::
iterator
,
effect_container
::
iterator
>
pr
;
pair
<
effect_container
::
iterator
,
effect_container
::
iterator
>
pr
;
event_list
::
iterator
evit
;
event_list
::
iterator
evit
;
effect
*
peffect
;
effect
*
peffect
;
chain
newchain
;
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
core
.
tpchain
.
clear
();
core
.
tpchain
.
clear
();
...
@@ -1981,6 +1965,30 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
...
@@ -1981,6 +1965,30 @@ int32 field::process_quick_effect(int16 step, int32 special, uint8 priority) {
pev
=
false
;
pev
=
false
;
}
}
}
}
for
(
auto
clit
=
core
.
new_ochain_h
.
begin
();
clit
!=
core
.
new_ochain_h
.
end
();
++
clit
)
{
effect
*
peffect
=
clit
->
triggering_effect
;
bool
act
=
true
;
if
(
clit
->
triggering_player
==
priority
&&
!
peffect
->
handler
->
is_status
(
STATUS_CHAINING
)
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
clit
->
evt
,
TRUE
))
{
for
(
auto
cait
=
core
.
current_chain
.
begin
();
cait
!=
core
.
current_chain
.
end
();
++
cait
)
{
if
(
cait
->
triggering_player
==
priority
)
{
if
(
!
(
peffect
->
flag
&
EFFECT_FLAG_MULTIACT_HAND
))
{
if
(
cait
->
triggering_location
==
LOCATION_HAND
||
cait
->
triggering_effect
->
handler
->
data
.
code
==
peffect
->
handler
->
data
.
code
)
{
act
=
false
;
break
;
}
}
if
((
peffect
->
flag
&
EFFECT_FLAG_CHAIN_UNIQUE
)
&&
(
cait
->
triggering_effect
->
handler
->
data
.
code
==
peffect
->
handler
->
data
.
code
))
{
act
=
false
;
break
;
}
}
}
}
else
act
=
false
;
if
(
act
)
core
.
select_chains
.
push_back
(
*
clit
);
}
core
.
spe_effect
[
priority
]
=
core
.
select_chains
.
size
();
core
.
spe_effect
[
priority
]
=
core
.
select_chains
.
size
();
if
(
!
special
)
{
if
(
!
special
)
{
nil_event
.
event_code
=
EVENT_FREE_CHAIN
;
nil_event
.
event_code
=
EVENT_FREE_CHAIN
;
...
...
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