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
f0e56034
Commit
f0e56034
authored
May 23, 2022
by
mercury233
Committed by
GitHub
May 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix & update Duel.NegateActivation and NegateEffect, add Duel.IsChainDisabled (#447)
parent
1f3749aa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
10 deletions
+29
-10
field.h
field.h
+1
-1
libduel.cpp
libduel.cpp
+16
-1
operations.cpp
operations.cpp
+11
-8
scriptlib.h
scriptlib.h
+1
-0
No files found.
field.h
View file @
f0e56034
...
@@ -558,7 +558,7 @@ public:
...
@@ -558,7 +558,7 @@ public:
//operations
//operations
int32
negate_chain
(
uint8
chaincount
);
int32
negate_chain
(
uint8
chaincount
);
int32
disable_chain
(
uint8
chaincount
);
int32
disable_chain
(
uint8
chaincount
,
uint8
forced
);
void
change_chain_effect
(
uint8
chaincount
,
int32
replace_op
);
void
change_chain_effect
(
uint8
chaincount
,
int32
replace_op
);
void
change_target
(
uint8
chaincount
,
group
*
targets
);
void
change_target
(
uint8
chaincount
,
group
*
targets
);
void
change_target_player
(
uint8
chaincount
,
uint8
playerid
);
void
change_target_player
(
uint8
chaincount
,
uint8
playerid
);
...
...
libduel.cpp
View file @
f0e56034
...
@@ -1764,8 +1764,11 @@ int32 scriptlib::duel_negate_activate(lua_State *L) {
...
@@ -1764,8 +1764,11 @@ int32 scriptlib::duel_negate_activate(lua_State *L) {
int32
scriptlib
::
duel_negate_effect
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_negate_effect
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
uint32
c
=
(
uint32
)
lua_tointeger
(
L
,
1
);
uint32
c
=
(
uint32
)
lua_tointeger
(
L
,
1
);
uint8
forced
=
FALSE
;
if
(
lua_gettop
(
L
)
>
1
)
forced
=
lua_toboolean
(
L
,
2
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
disable_chain
(
c
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
disable_chain
(
c
,
forced
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_negate_related_chain
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_negate_related_chain
(
lua_State
*
L
)
{
...
@@ -4311,6 +4314,17 @@ int32 scriptlib::duel_is_chain_disablable(lua_State * L) {
...
@@ -4311,6 +4314,17 @@ int32 scriptlib::duel_is_chain_disablable(lua_State * L) {
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_is_chain_disabled
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
chaincount
=
(
int32
)
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
if
(
pduel
->
game_field
->
core
.
chain_solving
)
{
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_chain_disabled
(
chaincount
));
return
1
;
}
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
duel_check_chain_target
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_check_chain_target
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
...
@@ -4753,6 +4767,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -4753,6 +4767,7 @@ static const struct luaL_Reg duellib[] = {
{
"IsPlayerCanAdditionalSummon"
,
scriptlib
::
duel_is_player_can_additional_summon
},
{
"IsPlayerCanAdditionalSummon"
,
scriptlib
::
duel_is_player_can_additional_summon
},
{
"IsChainNegatable"
,
scriptlib
::
duel_is_chain_negatable
},
{
"IsChainNegatable"
,
scriptlib
::
duel_is_chain_negatable
},
{
"IsChainDisablable"
,
scriptlib
::
duel_is_chain_disablable
},
{
"IsChainDisablable"
,
scriptlib
::
duel_is_chain_disablable
},
{
"IsChainDisabled"
,
scriptlib
::
duel_is_chain_disabled
},
{
"CheckChainTarget"
,
scriptlib
::
duel_check_chain_target
},
{
"CheckChainTarget"
,
scriptlib
::
duel_check_chain_target
},
{
"CheckChainUniqueness"
,
scriptlib
::
duel_check_chain_uniqueness
},
{
"CheckChainUniqueness"
,
scriptlib
::
duel_check_chain_uniqueness
},
{
"GetActivityCount"
,
scriptlib
::
duel_get_activity_count
},
{
"GetActivityCount"
,
scriptlib
::
duel_get_activity_count
},
...
...
operations.cpp
View file @
f0e56034
...
@@ -18,32 +18,35 @@ int32 field::negate_chain(uint8 chaincount) {
...
@@ -18,32 +18,35 @@ int32 field::negate_chain(uint8 chaincount) {
if
(
chaincount
>
core
.
current_chain
.
size
()
||
chaincount
<
1
)
if
(
chaincount
>
core
.
current_chain
.
size
()
||
chaincount
<
1
)
chaincount
=
(
uint8
)
core
.
current_chain
.
size
();
chaincount
=
(
uint8
)
core
.
current_chain
.
size
();
chain
&
pchain
=
core
.
current_chain
[
chaincount
-
1
];
chain
&
pchain
=
core
.
current_chain
[
chaincount
-
1
];
card
*
phandler
=
pchain
.
triggering_effect
->
handler
;
if
(
!
(
pchain
.
flag
&
CHAIN_DISABLE_ACTIVATE
)
&&
is_chain_negatable
(
pchain
.
chain_count
)
if
(
!
(
pchain
.
flag
&
CHAIN_DISABLE_ACTIVATE
)
&&
is_chain_negatable
(
pchain
.
chain_count
)
&&
pchain
.
triggering_effect
->
handler
->
is_affect_by_effect
(
core
.
reason_effect
)
)
{
&&
(
!
phandler
->
is_has_relation
(
pchain
)
||
phandler
->
is_affect_by_effect
(
core
.
reason_effect
))
)
{
pchain
.
flag
|=
CHAIN_DISABLE_ACTIVATE
;
pchain
.
flag
|=
CHAIN_DISABLE_ACTIVATE
;
pchain
.
disable_reason
=
core
.
reason_effect
;
pchain
.
disable_reason
=
core
.
reason_effect
;
pchain
.
disable_player
=
core
.
reason_player
;
pchain
.
disable_player
=
core
.
reason_player
;
if
((
pchain
.
triggering_effect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
p
chain
.
triggering_effect
->
handler
->
current
.
location
==
LOCATION_SZONE
))
{
if
((
pchain
.
triggering_effect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
phandler
->
current
.
location
==
LOCATION_SZONE
))
{
p
chain
.
triggering_effect
->
handler
->
set_status
(
STATUS_LEAVE_CONFIRMED
,
TRUE
);
phandler
->
set_status
(
STATUS_LEAVE_CONFIRMED
,
TRUE
);
p
chain
.
triggering_effect
->
handler
->
set_status
(
STATUS_ACTIVATE_DISABLED
,
TRUE
);
phandler
->
set_status
(
STATUS_ACTIVATE_DISABLED
,
TRUE
);
}
}
pduel
->
write_buffer8
(
MSG_CHAIN_NEGATED
);
pduel
->
write_buffer8
(
MSG_CHAIN_NEGATED
);
pduel
->
write_buffer8
(
chaincount
);
pduel
->
write_buffer8
(
chaincount
);
if
(
pchain
.
triggering_location
==
LOCATION_DECK
if
(
pchain
.
triggering_location
==
LOCATION_DECK
||
core
.
duel_rule
>=
5
&&
pchain
.
triggering_location
==
LOCATION_EXTRA
&&
(
pchain
.
triggering_position
&
POS_FACEDOWN
))
||
core
.
duel_rule
>=
5
&&
pchain
.
triggering_location
==
LOCATION_EXTRA
&&
(
pchain
.
triggering_position
&
POS_FACEDOWN
))
p
chain
.
triggering_effect
->
handler
->
release_relation
(
pchain
);
phandler
->
release_relation
(
pchain
);
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
}
}
int32
field
::
disable_chain
(
uint8
chaincount
)
{
int32
field
::
disable_chain
(
uint8
chaincount
,
uint8
forced
)
{
if
(
core
.
current_chain
.
size
()
==
0
)
if
(
core
.
current_chain
.
size
()
==
0
)
return
FALSE
;
return
FALSE
;
if
(
chaincount
>
core
.
current_chain
.
size
()
||
chaincount
<
1
)
if
(
chaincount
>
core
.
current_chain
.
size
()
||
chaincount
<
1
)
chaincount
=
(
uint8
)
core
.
current_chain
.
size
();
chaincount
=
(
uint8
)
core
.
current_chain
.
size
();
chain
&
pchain
=
core
.
current_chain
[
chaincount
-
1
];
chain
&
pchain
=
core
.
current_chain
[
chaincount
-
1
];
card
*
phandler
=
pchain
.
triggering_effect
->
handler
;
if
(
!
(
pchain
.
flag
&
CHAIN_DISABLE_EFFECT
)
&&
is_chain_disablable
(
pchain
.
chain_count
)
if
(
!
(
pchain
.
flag
&
CHAIN_DISABLE_EFFECT
)
&&
is_chain_disablable
(
pchain
.
chain_count
)
&&
pchain
.
triggering_effect
->
handler
->
is_affect_by_effect
(
core
.
reason_effect
))
{
&&
(
!
phandler
->
is_has_relation
(
pchain
)
||
phandler
->
is_affect_by_effect
(
core
.
reason_effect
))
&&
!
(
phandler
->
is_has_relation
(
pchain
)
&&
phandler
->
is_status
(
STATUS_DISABLED
)
&&
!
forced
))
{
core
.
current_chain
[
chaincount
-
1
].
flag
|=
CHAIN_DISABLE_EFFECT
;
core
.
current_chain
[
chaincount
-
1
].
flag
|=
CHAIN_DISABLE_EFFECT
;
core
.
current_chain
[
chaincount
-
1
].
disable_reason
=
core
.
reason_effect
;
core
.
current_chain
[
chaincount
-
1
].
disable_reason
=
core
.
reason_effect
;
core
.
current_chain
[
chaincount
-
1
].
disable_player
=
core
.
reason_player
;
core
.
current_chain
[
chaincount
-
1
].
disable_player
=
core
.
reason_player
;
...
@@ -51,7 +54,7 @@ int32 field::disable_chain(uint8 chaincount) {
...
@@ -51,7 +54,7 @@ int32 field::disable_chain(uint8 chaincount) {
pduel
->
write_buffer8
(
chaincount
);
pduel
->
write_buffer8
(
chaincount
);
if
(
pchain
.
triggering_location
==
LOCATION_DECK
if
(
pchain
.
triggering_location
==
LOCATION_DECK
||
core
.
duel_rule
>=
5
&&
pchain
.
triggering_location
==
LOCATION_EXTRA
&&
(
pchain
.
triggering_position
&
POS_FACEDOWN
))
||
core
.
duel_rule
>=
5
&&
pchain
.
triggering_location
==
LOCATION_EXTRA
&&
(
pchain
.
triggering_position
&
POS_FACEDOWN
))
p
chain
.
triggering_effect
->
handler
->
release_relation
(
pchain
);
phandler
->
release_relation
(
pchain
);
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
...
scriptlib.h
View file @
f0e56034
...
@@ -582,6 +582,7 @@ public:
...
@@ -582,6 +582,7 @@ public:
static
int32
duel_is_player_can_additional_summon
(
lua_State
*
L
);
static
int32
duel_is_player_can_additional_summon
(
lua_State
*
L
);
static
int32
duel_is_chain_negatable
(
lua_State
*
L
);
static
int32
duel_is_chain_negatable
(
lua_State
*
L
);
static
int32
duel_is_chain_disablable
(
lua_State
*
L
);
static
int32
duel_is_chain_disablable
(
lua_State
*
L
);
static
int32
duel_is_chain_disabled
(
lua_State
*
L
);
static
int32
duel_check_chain_target
(
lua_State
*
L
);
static
int32
duel_check_chain_target
(
lua_State
*
L
);
static
int32
duel_check_chain_uniqueness
(
lua_State
*
L
);
static
int32
duel_check_chain_uniqueness
(
lua_State
*
L
);
static
int32
duel_get_activity_count
(
lua_State
*
L
);
static
int32
duel_get_activity_count
(
lua_State
*
L
);
...
...
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