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
3b33beda
Commit
3b33beda
authored
Aug 28, 2017
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed counter permit handling, added location option to iscanaddcounter
parent
9ecae394
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
card.cpp
card.cpp
+18
-5
card.h
card.h
+1
-1
libcard.cpp
libcard.cpp
+1
-3
No files found.
card.cpp
View file @
3b33beda
...
@@ -2124,7 +2124,7 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
...
@@ -2124,7 +2124,7 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
// cmit->second[0]: permanent
// cmit->second[0]: permanent
// cmit->second[1]: reset while negated
// cmit->second[1]: reset while negated
int32
card
::
add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
)
{
int32
card
::
add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
)
{
if
(
!
is_can_add_counter
(
playerid
,
countertype
,
count
,
singly
,
FALSE
))
if
(
!
is_can_add_counter
(
playerid
,
countertype
,
count
,
singly
,
0
))
return
FALSE
;
return
FALSE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
auto
pr
=
counters
.
insert
(
std
::
make_pair
(
cttype
,
counter_map
::
mapped_type
()));
auto
pr
=
counters
.
insert
(
std
::
make_pair
(
cttype
,
counter_map
::
mapped_type
()));
...
@@ -2182,15 +2182,28 @@ int32 card::remove_counter(uint16 countertype, uint16 count) {
...
@@ -2182,15 +2182,28 @@ int32 card::remove_counter(uint16 countertype, uint16 count) {
pduel
->
write_buffer16
(
count
);
pduel
->
write_buffer16
(
count
);
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_can_add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
,
uint
8
temp
)
{
int32
card
::
is_can_add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
,
uint
32
temploc
)
{
effect_set
eset
;
effect_set
eset
;
if
(
!
pduel
->
game_field
->
is_player_can_place_counter
(
playerid
,
this
,
countertype
,
count
))
if
(
!
pduel
->
game_field
->
is_player_can_place_counter
(
playerid
,
this
,
countertype
,
count
))
return
FALSE
;
return
FALSE
;
if
((
!
(
current
.
location
&
LOCATION_ONFIELD
)
||
!
is_position
(
POS_FACEUP
))
&&
!
temp
)
return
FALSE
;
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
is_status
(
STATUS_DISABLED
))
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
is_status
(
STATUS_DISABLED
))
return
FALSE
;
return
FALSE
;
if
(
!
(
countertype
&
COUNTER_WITHOUT_PERMIT
)
&&
!
is_affected_by_effect
(
EFFECT_COUNTER_PERMIT
+
(
countertype
&
0xffff
)))
filter_effect
(
EFFECT_COUNTER_PERMIT
+
(
countertype
&
0xffff
),
&
eset
);
if
(
eset
.
size
()
<
1
&&
!
(
countertype
&
COUNTER_WITHOUT_PERMIT
))
return
FALSE
;
bool
check
=
false
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
){
uint32
prange
=
eset
[
i
]
->
get_value
();
if
(
!
(
countertype
&
COUNTER_WITHOUT_PERMIT
))
{
if
(
temploc
)
check
=
(
temploc
&
prange
);
else
check
=
(
current
.
is_location
(
prange
)
&&
is_position
(
POS_FACEUP
));
if
(
check
)
break
;
}
}
if
(
!
check
)
return
FALSE
;
return
FALSE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
uint16
cttype
=
countertype
&
~
COUNTER_NEED_ENABLE
;
int32
limit
=
-
1
;
int32
limit
=
-
1
;
...
...
card.h
View file @
3b33beda
...
@@ -265,7 +265,7 @@ public:
...
@@ -265,7 +265,7 @@ public:
int32
destination_redirect
(
uint8
destination
,
uint32
reason
);
int32
destination_redirect
(
uint8
destination
,
uint32
reason
);
int32
add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
);
int32
add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
);
int32
remove_counter
(
uint16
countertype
,
uint16
count
);
int32
remove_counter
(
uint16
countertype
,
uint16
count
);
int32
is_can_add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
,
uint
8
temp
);
int32
is_can_add_counter
(
uint8
playerid
,
uint16
countertype
,
uint16
count
,
uint8
singly
,
uint
32
temploc
);
int32
get_counter
(
uint16
countertype
);
int32
get_counter
(
uint16
countertype
);
void
set_material
(
card_set
*
materials
);
void
set_material
(
card_set
*
materials
);
void
add_card_target
(
card
*
pcard
);
void
add_card_target
(
card
*
pcard
);
...
...
libcard.cpp
View file @
3b33beda
...
@@ -2173,13 +2173,11 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) {
...
@@ -2173,13 +2173,11 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) {
prange
=
LOCATION_MZONE
;
prange
=
LOCATION_MZONE
;
else
else
prange
=
LOCATION_SZONE
|
LOCATION_FZONE
;
prange
=
LOCATION_SZONE
|
LOCATION_FZONE
;
prange
|=
LOCATION_GRAVE
+
LOCATION_REMOVED
+
LOCATION_EXTRA
+
LOCATION_OVERLAY
+
LOCATION_HAND
+
LOCATION_DECK
;
effect
*
peffect
=
pcard
->
pduel
->
new_effect
();
effect
*
peffect
=
pcard
->
pduel
->
new_effect
();
peffect
->
owner
=
pcard
;
peffect
->
owner
=
pcard
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
code
=
EFFECT_COUNTER_PERMIT
|
countertype
;
peffect
->
code
=
EFFECT_COUNTER_PERMIT
|
countertype
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_SINGLE_RANGE
;
peffect
->
value
=
prange
;
peffect
->
range
=
prange
;
pcard
->
add_effect
(
peffect
);
pcard
->
add_effect
(
peffect
);
return
0
;
return
0
;
}
}
...
...
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