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
nanahira
ygopro
Commits
efac21cf
Commit
efac21cf
authored
Jun 08, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
single
parent
a3cd3967
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
1 deletion
+99
-1
gframe/game.cpp
gframe/game.cpp
+25
-0
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+3
-0
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+2
-0
ocgcore/libdebug.cpp
ocgcore/libdebug.cpp
+4
-0
ocgcore/libeffect.cpp
ocgcore/libeffect.cpp
+8
-0
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+3
-0
script/c10925955.lua
script/c10925955.lua
+1
-1
script/c17377751.lua
script/c17377751.lua
+53
-0
No files found.
gframe/game.cpp
View file @
efac21cf
...
...
@@ -657,6 +657,31 @@ void Game::RefreshReplay() {
#endif
}
void
Game
::
RefreshSingleplay
()
{
lstSinglePlayList
->
clear
();
#ifdef _WIN32
WIN32_FIND_DATAW
fdataw
;
HANDLE
fh
=
FindFirstFileW
(
L"./single/*.lua"
,
&
fdataw
);
if
(
fh
==
INVALID_HANDLE_VALUE
)
return
;
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
lstSinglePlayList
->
addItem
(
fdataw
.
cFileName
);
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
#else
DIR
*
dir
;
struct
dirent
*
dirp
;
if
((
dir
=
opendir
(
"./single/"
))
==
NULL
)
return
;
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
size_t
len
=
strlen
(
dirp
->
d_name
);
if
(
len
<
5
||
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".lua"
)
!=
0
)
continue
;
wchar_t
wname
[
256
];
BufferIO
::
DecodeUTF8
(
dirp
->
d_name
,
wname
);
lstSinglePlayList
->
addItem
(
wname
);
}
#endif
}
void
Game
::
LoadConfig
()
{
FILE
*
fp
=
fopen
(
"system.conf"
,
"r"
);
...
...
ocgcore/interpreter.cpp
View file @
efac21cf
...
...
@@ -190,6 +190,7 @@ static const struct luaL_Reg cardlib[] = {
static
const
struct
luaL_Reg
effectlib
[]
=
{
{
"CreateEffect"
,
scriptlib
::
effect_new
},
{
"GlobalEffect"
,
scriptlib
::
effect_newex
},
{
"Clone"
,
scriptlib
::
effect_clone
},
{
"Reset"
,
scriptlib
::
effect_reset
},
{
"SetDescription"
,
scriptlib
::
effect_set_description
},
...
...
@@ -461,6 +462,8 @@ static const struct luaL_Reg debuglib[] = {
{
"Message"
,
scriptlib
::
debug_message
},
{
"AddCard"
,
scriptlib
::
debug_add_card
},
{
"SetPlayerInfo"
,
scriptlib
::
debug_set_player_info
},
{
"ReloadFieldBegin"
,
scriptlib
::
debug_reload_field_begin
},
{
"ReloadFieldEnd"
,
scriptlib
::
debug_reload_field_end
},
{
NULL
,
NULL
}
};
...
...
ocgcore/libcard.cpp
View file @
efac21cf
...
...
@@ -717,6 +717,8 @@ int32 scriptlib::card_register_effect(lua_State *L) {
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
2
);
int32
forced
=
lua_toboolean
(
L
,
3
);
duel
*
pduel
=
pcard
->
pduel
;
if
(
peffect
->
owner
==
pduel
->
game_field
->
temp_card
)
return
0
;
if
(
!
forced
&&
pduel
->
game_field
->
core
.
reason_effect
&&
!
pcard
->
is_affect_by_effect
(
pduel
->
game_field
->
core
.
reason_effect
))
return
0
;
int32
id
;
...
...
ocgcore/libdebug.cpp
View file @
efac21cf
...
...
@@ -66,3 +66,7 @@ int32 scriptlib::debug_set_player_info(lua_State *L) {
pd
->
game_field
->
player
[
playerid
].
draw_count
=
drawcount
;
return
0
;
}
int32
scriptlib
::
debug_reload_field_begin
(
lua_State
*
L
)
{
}
int32
scriptlib
::
debug_reload_field_end
(
lua_State
*
L
)
{
}
ocgcore/libeffect.cpp
View file @
efac21cf
...
...
@@ -22,6 +22,14 @@ int32 scriptlib::effect_new(lua_State *L) {
interpreter
::
effect2value
(
L
,
peffect
);
return
1
;
}
int32
scriptlib
::
effect_newex
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
effect
*
peffect
=
pduel
->
new_effect
();
peffect
->
effect_owner
=
0
;
peffect
->
owner
=
pduel
->
game_field
->
temp_card
;
interpreter
::
effect2value
(
L
,
peffect
);
return
1
;
}
int32
scriptlib
::
effect_clone
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
...
...
ocgcore/scriptlib.h
View file @
efac21cf
...
...
@@ -189,6 +189,7 @@ public:
static
int32
card_set_hint
(
lua_State
*
L
);
//Effect functions
static
int32
effect_new
(
lua_State
*
L
);
static
int32
effect_newex
(
lua_State
*
L
);
static
int32
effect_clone
(
lua_State
*
L
);
static
int32
effect_reset
(
lua_State
*
L
);
static
int32
effect_set_description
(
lua_State
*
L
);
...
...
@@ -460,6 +461,8 @@ public:
static
int32
debug_message
(
lua_State
*
L
);
static
int32
debug_add_card
(
lua_State
*
L
);
static
int32
debug_set_player_info
(
lua_State
*
L
);
static
int32
debug_reload_field_begin
(
lua_State
*
L
);
static
int32
debug_reload_field_end
(
lua_State
*
L
);
};
#endif
/* SCRIPTLIB_H_ */
script/c10925955.lua
View file @
efac21cf
...
...
@@ -26,7 +26,7 @@ function c10925955.target(e,tp,eg,ep,ev,re,r,rp,chk)
if
sel
==
1
then
ac
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
10925955
,
0
))
elseif
sel
==
2
then
ac
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
10925955
,
1
))
ac
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
10925955
,
1
))
+
1
elseif
Duel
.
IsExistingMatchingCard
(
c10925955
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
true
)
then
ac
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
10925955
,
0
),
aux
.
Stringid
(
10925955
,
1
),
aux
.
Stringid
(
10925955
,
2
))
else
...
...
script/c17377751.lua
0 → 100644
View file @
efac21cf
--BF-煌星のグラム
function
c17377751
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--cannot special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_EXTRA
)
e1
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e1
)
--Special Summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
17377751
,
0
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCondition
(
c17377751
.
spcon
)
e2
:
SetTarget
(
c17377751
.
sptg
)
e2
:
SetOperation
(
c17377751
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
c17377751
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
e
:
GetHandler
():
GetSummonType
()
==
SUMMON_TYPE_SYNCHRO
end
function
c17377751
.
filter
(
c
,
e
,
tp
)
return
not
c
:
IsType
(
TYPE_TUNER
)
and
c
:
IsLevelBelow
(
4
)
and
c
:
IsSetCard
(
0x33
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
true
)
end
function
c17377751
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c17377751
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
function
c17377751
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c17377751
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SpecialSummonStep
(
tc
,
0
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
0x1fe0000
)
tc
:
RegisterEffect
(
e2
,
true
)
Duel
.
SpecialSummonComplete
()
end
end
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