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
a6867db7
Commit
a6867db7
authored
Jun 19, 2019
by
DailyShana
Committed by
GitHub
Jun 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiple effect label (#192)
parent
33346d1f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
15 deletions
+23
-15
effect.cpp
effect.cpp
+1
-1
effect.h
effect.h
+1
-1
libcard.cpp
libcard.cpp
+5
-6
libduel.cpp
libduel.cpp
+4
-3
libeffect.cpp
libeffect.cpp
+12
-4
No files found.
effect.cpp
View file @
a6867db7
...
...
@@ -41,7 +41,7 @@ effect::effect(duel* pd) {
reset_flag
=
0
;
count_code
=
0
;
category
=
0
;
label
=
0
;
label
.
reserve
(
4
)
;
label_object
=
0
;
hint_timing
[
0
]
=
0
;
hint_timing
[
1
]
=
0
;
...
...
effect.h
View file @
a6867db7
...
...
@@ -54,7 +54,7 @@ public:
uint16
active_sequence
;
card
*
active_handler
;
uint16
status
;
uint32
label
;
std
::
vector
<
uint32
>
label
;
int32
label_object
;
int32
condition
;
int32
cost
;
...
...
libcard.cpp
View file @
a6867db7
...
...
@@ -1688,7 +1688,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) {
peffect
->
reset_flag
=
reset
;
peffect
->
flag
[
0
]
=
flag
|
EFFECT_FLAG_CANNOT_DISABLE
;
peffect
->
reset_count
=
count
;
peffect
->
label
=
lab
;
peffect
->
label
.
push_back
(
lab
)
;
peffect
->
description
=
desc
;
pcard
->
add_effect
(
peffect
);
interpreter
::
effect2value
(
L
,
peffect
);
...
...
@@ -1720,7 +1720,8 @@ int32 scriptlib::card_set_flag_effect_label(lua_State *L) {
if
(
eit
==
pcard
->
single_effect
.
end
())
lua_pushboolean
(
L
,
FALSE
);
else
{
eit
->
second
->
label
=
lab
;
eit
->
second
->
label
.
clear
();
eit
->
second
->
label
.
push_back
(
lab
);
lua_pushboolean
(
L
,
TRUE
);
}
return
1
;
...
...
@@ -1732,10 +1733,8 @@ int32 scriptlib::card_get_flag_effect_label(lua_State *L) {
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
0xfffffff
)
|
0x10000000
;
auto
rg
=
pcard
->
single_effect
.
equal_range
(
code
);
int32
count
=
0
;
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
)
{
lua_pushinteger
(
L
,
rg
.
first
->
second
->
label
);
count
++
;
}
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
,
++
count
)
lua_pushinteger
(
L
,
rg
.
first
->
second
->
label
.
size
()
?
rg
.
first
->
second
->
label
[
0
]
:
0
);
if
(
!
count
)
{
lua_pushnil
(
L
);
return
1
;
...
...
libduel.cpp
View file @
a6867db7
...
...
@@ -108,7 +108,7 @@ int32 scriptlib::duel_register_flag_effect(lua_State *L) {
peffect
->
s_range
=
1
;
peffect
->
o_range
=
0
;
peffect
->
reset_count
=
count
;
peffect
->
label
=
lab
;
peffect
->
label
.
push_back
(
lab
)
;
pduel
->
game_field
->
add_effect
(
peffect
,
playerid
);
interpreter
::
effect2value
(
L
,
peffect
);
return
1
;
...
...
@@ -154,7 +154,8 @@ int32 scriptlib::duel_set_flag_effect_label(lua_State *L) {
if
(
!
eset
.
size
())
lua_pushboolean
(
L
,
FALSE
);
else
{
eset
[
0
]
->
label
=
lab
;
eset
[
0
]
->
label
.
clear
();
eset
[
0
]
->
label
.
push_back
(
lab
);
lua_pushboolean
(
L
,
TRUE
);
}
return
1
;
...
...
@@ -173,7 +174,7 @@ int32 scriptlib::duel_get_flag_effect_label(lua_State *L) {
return
1
;
}
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
lua_pushinteger
(
L
,
eset
[
i
]
->
label
);
lua_pushinteger
(
L
,
eset
[
i
]
->
label
.
size
()
?
eset
[
i
]
->
label
[
0
]
:
0
);
return
eset
.
size
();
}
int32
scriptlib
::
duel_destroy
(
lua_State
*
L
)
{
...
...
libeffect.cpp
View file @
a6867db7
...
...
@@ -175,8 +175,11 @@ int32 scriptlib::effect_set_label(lua_State *L) {
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
v
=
lua_tointeger
(
L
,
2
);
peffect
->
label
=
v
;
peffect
->
label
.
clear
();
for
(
int32
i
=
2
;
i
<=
lua_gettop
(
L
);
++
i
)
{
uint32
v
=
lua_tointeger
(
L
,
i
);
peffect
->
label
.
push_back
(
v
);
}
return
0
;
}
int32
scriptlib
::
effect_set_label_object
(
lua_State
*
L
)
{
...
...
@@ -337,8 +340,13 @@ int32 scriptlib::effect_get_label(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
if
(
peffect
)
{
lua_pushinteger
(
L
,
peffect
->
label
);
return
1
;
if
(
peffect
->
label
.
empty
())
{
lua_pushinteger
(
L
,
0
);
return
1
;
}
for
(
const
auto
&
lab
:
peffect
->
label
)
lua_pushinteger
(
L
,
lab
);
return
peffect
->
label
.
size
();
}
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