Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
e77c4e79
Commit
e77c4e79
authored
Aug 09, 2015
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetPreviousCodeOnField()
parent
81cb5b31
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
9 deletions
+28
-9
ocgcore/card.h
ocgcore/card.h
+1
-0
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+4
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+11
-1
script/c34460239.lua
script/c34460239.lua
+8
-4
script/c8339504.lua
script/c8339504.lua
+4
-4
No files found.
ocgcore/card.h
View file @
e77c4e79
...
@@ -34,6 +34,7 @@ struct card_data {
...
@@ -34,6 +34,7 @@ struct card_data {
struct
card_state
{
struct
card_state
{
uint32
code
;
uint32
code
;
uint32
code2
;
uint32
type
;
uint32
type
;
uint32
level
;
uint32
level
;
uint32
rank
;
uint32
rank
;
...
...
ocgcore/libcard.cpp
View file @
e77c4e79
...
@@ -258,6 +258,10 @@ int32 scriptlib:: card_get_previous_code_onfield(lua_State *L) {
...
@@ -258,6 +258,10 @@ int32 scriptlib:: card_get_previous_code_onfield(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
lua_pushinteger
(
L
,
pcard
->
previous
.
code
);
lua_pushinteger
(
L
,
pcard
->
previous
.
code
);
if
(
pcard
->
previous
.
code2
)
{
lua_pushinteger
(
L
,
pcard
->
previous
.
code2
);
return
2
;
}
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_get_previous_type_onfield
(
lua_State
*
L
)
{
int32
scriptlib
::
card_get_previous_type_onfield
(
lua_State
*
L
)
{
...
...
ocgcore/operations.cpp
View file @
e77c4e79
...
@@ -3022,6 +3022,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3022,6 +3022,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
if
((
pcard
->
current
.
location
&
LOCATION_ONFIELD
))
{
if
((
pcard
->
current
.
location
&
LOCATION_ONFIELD
))
{
if
(
pcard
->
current
.
position
&
POS_FACEUP
)
{
if
(
pcard
->
current
.
position
&
POS_FACEUP
)
{
pcard
->
previous
.
code
=
pcard
->
get_code
();
pcard
->
previous
.
code
=
pcard
->
get_code
();
pcard
->
previous
.
code2
=
pcard
->
get_another_code
();
pcard
->
previous
.
type
=
pcard
->
get_type
();
pcard
->
previous
.
type
=
pcard
->
get_type
();
if
(
pcard
->
current
.
location
&
LOCATION_MZONE
)
{
if
(
pcard
->
current
.
location
&
LOCATION_MZONE
)
{
pcard
->
previous
.
level
=
pcard
->
get_level
();
pcard
->
previous
.
level
=
pcard
->
get_level
();
...
@@ -3032,7 +3033,16 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3032,7 +3033,16 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
previous
.
defence
=
pcard
->
get_defence
();
pcard
->
previous
.
defence
=
pcard
->
get_defence
();
}
}
}
else
{
}
else
{
pcard
->
previous
.
code
=
pcard
->
data
.
code
;
if
(
pcard
->
data
.
alias
)
pcard
->
previous
.
code
=
pcard
->
data
.
alias
;
else
pcard
->
previous
.
code
=
pcard
->
data
.
code
;
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_ADD_CODE
,
&
eset
);
if
(
eset
.
size
())
pcard
->
previous
.
code2
=
eset
.
get_last
()
->
get_value
(
pcard
);
else
pcard
->
previous
.
code2
=
0
;
pcard
->
previous
.
type
=
pcard
->
data
.
type
;
pcard
->
previous
.
type
=
pcard
->
data
.
type
;
pcard
->
previous
.
level
=
pcard
->
data
.
level
;
pcard
->
previous
.
level
=
pcard
->
data
.
level
;
pcard
->
previous
.
rank
=
pcard
->
data
.
level
;
pcard
->
previous
.
rank
=
pcard
->
data
.
level
;
...
...
script/c34460239.lua
View file @
e77c4e79
...
@@ -12,10 +12,13 @@ function c34460239.initial_effect(c)
...
@@ -12,10 +12,13 @@ function c34460239.initial_effect(c)
end
end
function
c34460239
.
filter
(
c
,
tp
)
function
c34460239
.
filter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsDestructable
()
return
c
:
IsFaceup
()
and
c
:
IsDestructable
()
and
Duel
.
IsExistingMatchingCard
(
c34460239
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
:
GetCode
()
)
and
Duel
.
IsExistingMatchingCard
(
c34460239
.
nfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
)
end
end
function
c34460239
.
filter2
(
c
,
code
)
function
c34460239
.
nfilter1
(
c
,
tc
)
return
c
:
IsCode
(
code
)
and
c
:
IsAbleToHand
()
return
c
:
IsCode
(
tc
:
GetCode
())
and
c
:
IsAbleToHand
()
end
function
c34460239
.
nfilter2
(
c
,
tc
)
return
c
:
IsCode
(
tc
:
GetPreviousCodeOnField
())
and
c
:
IsAbleToHand
()
end
end
function
c34460239
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
c34460239
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c34460239
.
filter
(
chkc
,
tp
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c34460239
.
filter
(
chkc
,
tp
)
end
...
@@ -29,7 +32,8 @@ function c34460239.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -29,7 +32,8 @@ function c34460239.activate(e,tp,eg,ep,ev,re,r,rp)
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
>
0
then
if
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
>
0
then
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
local
hc
=
Duel
.
GetFirstMatchingCard
(
c34460239
.
filter2
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tc
:
GetCode
())
local
g
=
Duel
.
Duel
.
SelectMatchingCard
(
tp
,
c34460239
.
nfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tc
)
local
hc
=
g
:
GetFirst
()
if
hc
then
if
hc
then
Duel
.
SendtoHand
(
hc
,
nil
,
REASON_EFFECT
)
Duel
.
SendtoHand
(
hc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
hc
)
Duel
.
ConfirmCards
(
1
-
tp
,
hc
)
...
...
script/c8339504.lua
View file @
e77c4e79
...
@@ -20,9 +20,9 @@ function c8339504.cfilter(c,e,tp)
...
@@ -20,9 +20,9 @@ function c8339504.cfilter(c,e,tp)
local
rk
=
c
:
GetRank
()
local
rk
=
c
:
GetRank
()
return
rk
>
0
and
Duel
.
IsExistingMatchingCard
(
c8339504
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
rk
,
c
:
GetRace
(),
c
:
GetAttribute
(),
c
:
GetCode
(),
e
,
tp
)
return
rk
>
0
and
Duel
.
IsExistingMatchingCard
(
c8339504
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
rk
,
c
:
GetRace
(),
c
:
GetAttribute
(),
c
:
GetCode
(),
e
,
tp
)
end
end
function
c8339504
.
spfilter
(
c
,
rk
,
rc
,
att
,
code
,
e
,
tp
)
function
c8339504
.
spfilter
(
c
,
tc
,
e
,
tp
)
return
c
:
GetRank
()
==
rk
and
c
:
IsRace
(
rc
)
and
c
:
IsAttribute
(
att
)
and
not
c
:
IsCode
(
code
)
return
c
:
GetRank
()
==
tc
:
GetPreviousRankOnField
()
and
c
:
IsRace
(
tc
:
GetPreviousRaceOnField
())
and
c
:
IsAttribute
(
tc
:
GetPreviousAttributeOnField
())
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
not
c
:
IsCode
(
tc
:
GetPreviousCodeOnField
())
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
end
function
c8339504
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c8339504
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
...
@@ -42,7 +42,7 @@ function c8339504.activate(e,tp,eg,ep,ev,re,r,rp)
...
@@ -42,7 +42,7 @@ function c8339504.activate(e,tp,eg,ep,ev,re,r,rp)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c8339504
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tc
:
GetPreviousRankOnField
(),
tc
:
GetPreviousRaceOnField
(),
tc
:
GetPreviousAttributeOnField
(),
tc
:
GetPreviousCodeOnField
()
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c8339504
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tc
,
e
,
tp
)
local
sc
=
g
:
GetFirst
()
local
sc
=
g
:
GetFirst
()
if
sc
then
if
sc
then
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
SpecialSummon
(
sc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
...
...
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