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
c1f69377
Commit
c1f69377
authored
Jul 26, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update handling of effect activated in deck
parent
86c1f543
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
34 deletions
+37
-34
effect.h
effect.h
+1
-1
field.h
field.h
+1
-0
libduel.cpp
libduel.cpp
+17
-31
operations.cpp
operations.cpp
+2
-2
processor.cpp
processor.cpp
+16
-0
No files found.
effect.h
View file @
c1f69377
...
...
@@ -191,7 +191,7 @@ enum effect_flag : uint32 {
EFFECT_FLAG_IMMEDIATELY_APPLY
=
0x80000000
,
};
enum
effect_flag2
:
uint32
{
EFFECT_FLAG2_NAGA
=
0x0001
,
//
EFFECT_FLAG2_NAGA = 0x0001,
EFFECT_FLAG2_COF
=
0x0002
,
};
inline
effect_flag
operator
|
(
effect_flag
flag1
,
effect_flag
flag2
)
...
...
field.h
View file @
c1f69377
...
...
@@ -610,6 +610,7 @@ public:
#define CHAIN_CONTINUOUS_CARD 0x08
#define CHAIN_ACTIVATING 0x10
#define CHAIN_HAND_TRIGGER 0x20
#define CHAIN_DECK_EFFECT 0x40
#define CHAININFO_CHAIN_COUNT 0x01
#define CHAININFO_TRIGGERING_EFFECT 0x02
#define CHAININFO_TRIGGERING_PLAYER 0x04
...
...
libduel.cpp
View file @
c1f69377
...
...
@@ -3619,44 +3619,30 @@ int32 scriptlib::duel_is_chain_negatable(lua_State * L) {
check_param_count
(
L
,
1
);
int32
chaincount
=
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
res
=
0
;
if
(
chaincount
<
0
||
chaincount
>
(
int32
)
pduel
->
game_field
->
core
.
current_chain
.
size
())
res
=
FALSE
;
else
{
effect
*
peffect
;
if
(
chaincount
==
0
)
peffect
=
pduel
->
game_field
->
core
.
current_chain
.
back
().
triggering_effect
;
else
peffect
=
pduel
->
game_field
->
core
.
current_chain
[
chaincount
-
1
].
triggering_effect
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG2_NAGA
))
res
=
FALSE
;
else
res
=
TRUE
;
}
lua_pushboolean
(
L
,
res
);
chain
*
ch
=
pduel
->
game_field
->
get_chain
(
chaincount
);
if
(
!
ch
)
return
0
;
if
(
ch
->
flag
&
CHAIN_DECK_EFFECT
)
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
1
);
return
1
;
}
int32
scriptlib
::
duel_is_chain_disablable
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
chaincount
=
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
res
=
0
;
if
(
chaincount
<
0
||
chaincount
>
(
int32
)
pduel
->
game_field
->
core
.
current_chain
.
size
())
res
=
FALSE
;
else
{
effect
*
peffect
;
if
(
chaincount
==
0
)
peffect
=
pduel
->
game_field
->
core
.
current_chain
.
back
().
triggering_effect
;
else
peffect
=
pduel
->
game_field
->
core
.
current_chain
[
chaincount
-
1
].
triggering_effect
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG2_NAGA
))
res
=
FALSE
;
else
res
=
TRUE
;
if
(
pduel
->
game_field
->
core
.
chain_solving
)
res
=
pduel
->
game_field
->
is_chain_disablable
(
chaincount
);
if
(
pduel
->
game_field
->
core
.
chain_solving
)
{
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_chain_disablable
(
chaincount
));
return
1
;
}
lua_pushboolean
(
L
,
res
);
chain
*
ch
=
pduel
->
game_field
->
get_chain
(
chaincount
);
if
(
!
ch
)
return
0
;
if
(
ch
->
flag
&
CHAIN_DECK_EFFECT
)
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
1
);
return
1
;
}
int32
scriptlib
::
duel_check_chain_target
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
c1f69377
...
...
@@ -29,7 +29,7 @@ int32 field::negate_chain(uint8 chaincount) {
}
pduel
->
write_buffer8
(
MSG_CHAIN_NEGATED
);
pduel
->
write_buffer8
(
chaincount
);
if
(
pchain
.
triggering_effect
->
is_flag
(
EFFECT_FLAG2_NAGA
)
)
if
(
pchain
.
flag
&
CHAIN_DECK_EFFECT
)
return
FALSE
;
return
TRUE
;
}
...
...
@@ -48,7 +48,7 @@ int32 field::disable_chain(uint8 chaincount) {
core
.
current_chain
[
chaincount
-
1
].
disable_player
=
core
.
reason_player
;
pduel
->
write_buffer8
(
MSG_CHAIN_DISABLED
);
pduel
->
write_buffer8
(
chaincount
);
if
(
pchain
.
triggering_effect
->
is_flag
(
EFFECT_FLAG2_NAGA
)
)
if
(
pchain
.
flag
&
CHAIN_DECK_EFFECT
)
return
FALSE
;
return
TRUE
;
}
...
...
processor.cpp
View file @
c1f69377
...
...
@@ -1697,6 +1697,14 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
}
uint8
tp
=
clit
->
triggering_player
;
bool
act
=
true
;
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
&&
clit
->
triggering_location
==
LOCATION_DECK
&&
(
phandler
->
current
.
location
&
LOCATION_DECK
))
{
if
((
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
peffect
->
code
==
EVENT_TO_DECK
||
(
peffect
->
range
&
LOCATION_DECK
))
clit
->
flag
|=
CHAIN_DECK_EFFECT
;
else
act
=
false
;
}
if
(
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
&&
(
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
phandler
->
is_has_relation
(
*
clit
))
&&
(
peffect
->
code
==
EVENT_FLIP
&&
infos
.
phase
==
PHASE_DAMAGE
...
...
@@ -1777,6 +1785,14 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
||
peffect
->
range
&&
!
peffect
->
in_range
(
*
clit
))
act
=
false
;
}
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
&&
clit
->
triggering_location
==
LOCATION_DECK
&&
(
phandler
->
current
.
location
&
LOCATION_DECK
))
{
if
((
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
peffect
->
code
==
EVENT_TO_DECK
||
(
peffect
->
range
&
LOCATION_DECK
))
clit
->
flag
|=
CHAIN_DECK_EFFECT
;
else
act
=
false
;
}
if
(
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
&&
(
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
phandler
->
is_has_relation
(
*
clit
))
&&
(
peffect
->
code
==
EVENT_FLIP
&&
infos
.
phase
==
PHASE_DAMAGE
...
...
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