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
2ebfb5b6
Commit
2ebfb5b6
authored
Apr 12, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert
revert modification related to counter in
3fee0191
and
775b7666
parent
3fee0191
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
card.cpp
card.cpp
+8
-4
card.h
card.h
+1
-1
libdebug.cpp
libdebug.cpp
+4
-2
No files found.
card.cpp
View file @
2ebfb5b6
...
...
@@ -1542,7 +1542,9 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
int32
card
::
add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
)
{
if
(
!
is_can_add_counter
(
playerid
,
countertype
,
count
,
singly
))
return
FALSE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
uint16
cttype
=
countertype
;
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
!
(
countertype
&
COUNTER_NEED_PERMIT
))
cttype
&=
0xfff
;
auto
pr
=
counters
.
insert
(
std
::
make_pair
(
cttype
,
counter_map
::
mapped_type
()));
auto
cmit
=
pr
.
first
;
if
(
pr
.
second
)
{
...
...
@@ -1562,7 +1564,7 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8
pcount
=
mcount
;
}
}
if
(
(
countertype
&
COUNTER_WITHOUT_PERMIT
)
&&
!
(
countertype
&
COUNTER_NEED_ENABLE
))
if
(
!
(
countertype
&
COUNTER_NEED_ENABLE
))
cmit
->
second
[
0
]
+=
pcount
;
else
cmit
->
second
[
1
]
+=
pcount
;
...
...
@@ -1606,9 +1608,11 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count,
return
FALSE
;
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
is_status
(
STATUS_DISABLED
))
return
FALSE
;
if
(
!
(
countertype
&
COUNTER_WITHOUT
_PERMIT
)
&&
!
is_affected_by_effect
(
EFFECT_COUNTER_PERMIT
+
(
countertype
&
0xffff
)))
if
(
(
countertype
&
COUNTER_NEED
_PERMIT
)
&&
!
is_affected_by_effect
(
EFFECT_COUNTER_PERMIT
+
(
countertype
&
0xffff
)))
return
FALSE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
uint16
cttype
=
countertype
;
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
!
(
countertype
&
COUNTER_NEED_PERMIT
))
cttype
&=
0xfff
;
int32
limit
=
-
1
;
int32
cur
=
0
;
auto
cmit
=
counters
.
find
(
cttype
);
...
...
card.h
View file @
2ebfb5b6
...
...
@@ -430,7 +430,7 @@ public:
#define STATUS_FLIP_SUMMON_TURN 0x20000000
#define STATUS_SPSUMMON_TURN 0x40000000
//Counter
#define COUNTER_
WITHOUT_PERMIT
0x1000
#define COUNTER_
NEED_PERMIT
0x1000
#define COUNTER_NEED_ENABLE 0x2000
//Query list
#define QUERY_CODE 0x1
...
...
libdebug.cpp
View file @
2ebfb5b6
...
...
@@ -122,14 +122,16 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) {
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
countertype
=
lua_tointeger
(
L
,
2
);
uint32
count
=
lua_tointeger
(
L
,
3
);
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
uint16
cttype
=
countertype
;
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
!
(
countertype
&
COUNTER_NEED_PERMIT
))
cttype
&=
0xfff
;
auto
pr
=
pcard
->
counters
.
insert
(
std
::
make_pair
(
cttype
,
card
::
counter_map
::
mapped_type
()));
auto
cmit
=
pr
.
first
;
if
(
pr
.
second
)
{
cmit
->
second
[
0
]
=
0
;
cmit
->
second
[
1
]
=
0
;
}
if
(
(
countertype
&
COUNTER_WITHOUT_PERMIT
)
&&
!
(
countertype
&
COUNTER_NEED_ENABLE
))
if
(
!
(
countertype
&
COUNTER_NEED_ENABLE
))
cmit
->
second
[
0
]
+=
count
;
else
cmit
->
second
[
1
]
+=
count
;
...
...
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