Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
1ebf1261
Commit
1ebf1261
authored
Apr 24, 2014
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e6125867
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
16 deletions
+27
-16
ocgcore/card.cpp
ocgcore/card.cpp
+5
-3
ocgcore/card.h
ocgcore/card.h
+2
-2
ocgcore/field.cpp
ocgcore/field.cpp
+12
-1
ocgcore/field.h
ocgcore/field.h
+2
-1
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+3
-6
script/c26270847.lua
script/c26270847.lua
+1
-1
script/constant.lua
script/constant.lua
+2
-2
No files found.
ocgcore/card.cpp
View file @
1ebf1261
...
@@ -1266,8 +1266,8 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
...
@@ -1266,8 +1266,8 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
}
}
return
0
;
return
0
;
}
}
int32
card
::
add_counter
(
uint16
countertype
,
uint16
count
)
{
int32
card
::
add_counter
(
uint
8
playerid
,
uint
16
countertype
,
uint16
count
)
{
if
(
!
is_can_add_counter
(
countertype
,
count
))
if
(
!
is_can_add_counter
(
playerid
,
countertype
,
count
))
return
FALSE
;
return
FALSE
;
counters
[
countertype
]
+=
count
;
counters
[
countertype
]
+=
count
;
pduel
->
write_buffer8
(
MSG_ADD_COUNTER
);
pduel
->
write_buffer8
(
MSG_ADD_COUNTER
);
...
@@ -1293,8 +1293,10 @@ int32 card::remove_counter(uint16 countertype, uint16 count) {
...
@@ -1293,8 +1293,10 @@ int32 card::remove_counter(uint16 countertype, uint16 count) {
pduel
->
write_buffer8
(
count
);
pduel
->
write_buffer8
(
count
);
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_can_add_counter
(
uint16
countertype
,
uint16
count
)
{
int32
card
::
is_can_add_counter
(
uint
8
playerid
,
uint
16
countertype
,
uint16
count
)
{
effect_set
eset
;
effect_set
eset
;
if
(
!
pduel
->
game_field
->
is_player_can_place_counter
(
playerid
,
this
,
countertype
,
count
))
return
FALSE
;
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
)
||
!
is_position
(
POS_FACEUP
))
if
(
!
(
current
.
location
&
LOCATION_ONFIELD
)
||
!
is_position
(
POS_FACEUP
))
return
FALSE
;
return
FALSE
;
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
is_status
(
STATUS_DISABLED
))
if
((
countertype
&
COUNTER_NEED_ENABLE
)
&&
is_status
(
STATUS_DISABLED
))
...
...
ocgcore/card.h
View file @
1ebf1261
...
@@ -186,9 +186,9 @@ public:
...
@@ -186,9 +186,9 @@ public:
void
release_relation
(
effect
*
peffect
);
void
release_relation
(
effect
*
peffect
);
int32
leave_field_redirect
(
uint32
reason
);
int32
leave_field_redirect
(
uint32
reason
);
int32
destination_redirect
(
uint8
destination
,
uint32
reason
);
int32
destination_redirect
(
uint8
destination
,
uint32
reason
);
int32
add_counter
(
uint16
countertype
,
uint16
count
);
int32
add_counter
(
uint
8
playerid
,
uint
16
countertype
,
uint16
count
);
int32
remove_counter
(
uint16
countertype
,
uint16
count
);
int32
remove_counter
(
uint16
countertype
,
uint16
count
);
int32
is_can_add_counter
(
uint16
countertype
,
uint16
count
);
int32
is_can_add_counter
(
uint
8
playerid
,
uint
16
countertype
,
uint16
count
);
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
);
...
...
ocgcore/field.cpp
View file @
1ebf1261
...
@@ -1854,7 +1854,18 @@ int32 field::is_player_can_release(uint8 playerid, card * pcard) {
...
@@ -1854,7 +1854,18 @@ int32 field::is_player_can_release(uint8 playerid, card * pcard) {
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
is_player_can_place_counter
(
uint8
playerid
,
card
*
pcard
,
uint16
countertype
,
uint16
count
)
{
int32
field
::
is_player_can_place_counter
(
uint8
playerid
,
card
*
pcard
,
uint16
countertype
,
uint16
count
)
{
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_PLACE_COUNTER
);
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_PLACE_COUNTER
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
count
;
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
3
))
return
FALSE
;
}
return
TRUE
;
}
}
int32
field
::
is_player_can_remove_counter
(
uint8
playerid
,
card
*
pcard
,
uint8
s
,
uint8
o
,
uint16
countertype
,
uint16
count
,
uint32
reason
)
{
int32
field
::
is_player_can_remove_counter
(
uint8
playerid
,
card
*
pcard
,
uint8
s
,
uint8
o
,
uint16
countertype
,
uint16
count
,
uint32
reason
)
{
if
((
pcard
&&
pcard
->
get_counter
(
countertype
)
>=
count
)
||
(
!
pcard
&&
get_field_counter
(
playerid
,
s
,
o
,
countertype
)
>=
count
))
if
((
pcard
&&
pcard
->
get_counter
(
countertype
)
>=
count
)
||
(
!
pcard
&&
get_field_counter
(
playerid
,
s
,
o
,
countertype
)
>=
count
))
...
...
ocgcore/field.h
View file @
1ebf1261
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include <map>
#include <map>
#include <list>
#include <list>
#include <array>
#include <array>
#include <functional>
#include <unordered_map>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
...
@@ -212,7 +213,7 @@ struct processor {
...
@@ -212,7 +213,7 @@ struct processor {
std
::
unordered_map
<
card
*
,
uint32
>
readjust_map
;
std
::
unordered_map
<
card
*
,
uint32
>
readjust_map
;
std
::
unordered_set
<
card
*>
unique_cards
[
2
];
std
::
unordered_set
<
card
*>
unique_cards
[
2
];
std
::
unordered_map
<
uint32
,
uint32
>
effect_count_code
;
std
::
unordered_map
<
uint32
,
uint32
>
effect_count_code
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
xmaterial_lst
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
xmaterial_lst
;
ptr
temp_var
[
4
];
ptr
temp_var
[
4
];
uint32
global_flag
;
uint32
global_flag
;
uint16
pre_field
[
2
];
uint16
pre_field
[
2
];
...
...
ocgcore/libcard.cpp
View file @
1ebf1261
...
@@ -1617,11 +1617,8 @@ int32 scriptlib::card_add_counter(lua_State *L) {
...
@@ -1617,11 +1617,8 @@ int32 scriptlib::card_add_counter(lua_State *L) {
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
countertype
=
lua_tointeger
(
L
,
2
);
uint32
countertype
=
lua_tointeger
(
L
,
2
);
uint32
count
=
lua_tointeger
(
L
,
3
);
uint32
count
=
lua_tointeger
(
L
,
3
);
field
*
game_field
=
pcard
->
pduel
->
game_field
;
if
(
pcard
->
is_affect_by_effect
(
pcard
->
pduel
->
game_field
->
core
.
reason_effect
))
uint8
player
=
game_field
->
core
.
reason_player
;
lua_pushboolean
(
L
,
pcard
->
add_counter
(
pcard
->
pduel
->
game_field
->
core
.
reason_player
,
countertype
,
count
));
if
(
pcard
->
is_affect_by_effect
(
game_field
->
core
.
reason_effect
)
&&
game_field
->
is_player_can_place_counter
(
player
,
pcard
,
countertype
,
count
))
lua_pushboolean
(
L
,
pcard
->
add_counter
(
countertype
,
count
));
else
lua_pushboolean
(
L
,
0
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
return
1
;
}
}
...
@@ -1703,7 +1700,7 @@ int32 scriptlib::card_is_can_add_counter(lua_State *L) {
...
@@ -1703,7 +1700,7 @@ int32 scriptlib::card_is_can_add_counter(lua_State *L) {
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
uint32
countertype
=
lua_tointeger
(
L
,
2
);
uint32
countertype
=
lua_tointeger
(
L
,
2
);
uint32
count
=
lua_tointeger
(
L
,
3
);
uint32
count
=
lua_tointeger
(
L
,
3
);
lua_pushboolean
(
L
,
pcard
->
is_can_add_counter
(
countertype
,
count
));
lua_pushboolean
(
L
,
pcard
->
is_can_add_counter
(
pcard
->
pduel
->
game_field
->
core
.
reason_player
,
countertype
,
count
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_can_remove_counter
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_can_remove_counter
(
lua_State
*
L
)
{
...
...
script/c26270847.lua
View file @
1ebf1261
...
@@ -34,7 +34,7 @@ function c26270847.atktg(e,c)
...
@@ -34,7 +34,7 @@ function c26270847.atktg(e,c)
return
c
:
IsSetCard
(
0x9f
)
return
c
:
IsSetCard
(
0x9f
)
end
end
function
c26270847
.
filter
(
c
)
function
c26270847
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x9
d
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x9
f
)
end
end
function
c26270847
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c26270847
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c26270847
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c26270847
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
...
...
script/constant.lua
View file @
1ebf1261
...
@@ -303,7 +303,7 @@ EFFECT_UNRELEASABLE_SUM =43 --
...
@@ -303,7 +303,7 @@ EFFECT_UNRELEASABLE_SUM =43 --
EFFECT_UNRELEASABLE_NONSUM
=
44
--
EFFECT_UNRELEASABLE_NONSUM
=
44
--
EFFECT_DESTROY_SUBSTITUTE
=
45
--
EFFECT_DESTROY_SUBSTITUTE
=
45
--
EFFECT_CANNOT_RELEASE
=
46
--
EFFECT_CANNOT_RELEASE
=
46
--
EFFECT_INDESTRUCTABLE_COUNT
=
47
--
EFFECT_INDESTRUCTABLE_COUNT
=
47
--
EFFECT_UNRELEASABLE_EFFECT
=
48
--
EFFECT_UNRELEASABLE_EFFECT
=
48
--
EFFECT_DESTROY_REPLACE
=
50
--
EFFECT_DESTROY_REPLACE
=
50
--
EFFECT_RELEASE_REPLACE
=
51
--
EFFECT_RELEASE_REPLACE
=
51
--
...
@@ -311,7 +311,7 @@ EFFECT_SEND_REPLACE =52 --
...
@@ -311,7 +311,7 @@ EFFECT_SEND_REPLACE =52 --
EFFECT_CANNOT_DISCARD_HAND
=
55
--
EFFECT_CANNOT_DISCARD_HAND
=
55
--
EFFECT_CANNOT_DISCARD_DECK
=
56
--
EFFECT_CANNOT_DISCARD_DECK
=
56
--
EFFECT_CANNOT_USE_AS_COST
=
57
--
EFFECT_CANNOT_USE_AS_COST
=
57
--
EFFECT_CANNOT_PLACE_COUNTER
=
58
--
EFFECT_CANNOT_PLACE_COUNTER
=
58
--
EFFECT_LEAVE_FIELD_REDIRECT
=
60
--
EFFECT_LEAVE_FIELD_REDIRECT
=
60
--
EFFECT_TO_HAND_REDIRECT
=
61
--
EFFECT_TO_HAND_REDIRECT
=
61
--
...
...
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