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
3b85a623
Commit
3b85a623
authored
Apr 18, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into develop
parents
bf728087
02254c8c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
7 deletions
+147
-7
.github/workflows/build.yml
.github/workflows/build.yml
+57
-0
.gitignore
.gitignore
+4
-1
card.cpp
card.cpp
+2
-2
libduel.cpp
libduel.cpp
+6
-3
playerop.cpp
playerop.cpp
+1
-1
premake/dll.lua
premake/dll.lua
+57
-0
premake/lua.lua
premake/lua.lua
+20
-0
No files found.
.github/workflows/build.yml
0 → 100644
View file @
3b85a623
name
:
Automated Test Build
on
:
push
:
branches
:
[
"
master"
]
pull_request
:
branches
:
[
"
master"
]
jobs
:
build
:
runs-on
:
windows-2022
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v4
with
:
fetch-depth
:
0
-
name
:
Install lua
run
:
|
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.4.6.tar.gz ; exit 0"
tar xzf lua-5.4.6.tar.gz
move lua-5.4.6 lua
-
name
:
Premake
run
:
|
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip ; exit 0"
7z x premake-5.0.0-beta2-windows.zip
move premake\lua.lua lua\premake5.lua
move premake\dll.lua dll.lua
.\premake5.exe vs2022 --file=dll.lua
-
name
:
Add msbuild to PATH
uses
:
microsoft/setup-msbuild@v2
-
name
:
Build
run
:
|
msbuild build\ocgcoredll.sln /t:Build /p:"Configuration=Release;Platform=Win32"
msbuild build\ocgcoredll.sln /t:Build /p:"Configuration=Release;Platform=x64"
-
name
:
Upload build artifacts
uses
:
actions/upload-artifact@v4
with
:
path
:
|
build\bin\x32\Release\ocgcore.dll
build\bin\x64\Release\ocgcore.dll
-
name
:
GitHub Release
if
:
github.event_name == 'push'
uses
:
salix5/action-automatic-releases@node20
with
:
repo_token
:
"
${{
secrets.GITHUB_TOKEN
}}"
automatic_release_tag
:
"
latest"
prerelease
:
true
title
:
"
Development
Build"
files
:
|
build/bin/x64/Release/ocgcore.dll
.gitignore
View file @
3b85a623
.vscode/
.vscode/
/premake5.exe
/build
/lua
card.cpp
View file @
3b85a623
...
@@ -2044,7 +2044,7 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
...
@@ -2044,7 +2044,7 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
}
}
int32
card
::
copy_effect
(
uint32
code
,
uint32
reset
,
uint32
count
)
{
int32
card
::
copy_effect
(
uint32
code
,
uint32
reset
,
uint32
count
)
{
card_data
cdata
;
card_data
cdata
;
read_card
(
code
,
&
cdata
);
::
read_card
(
code
,
&
cdata
);
if
(
cdata
.
type
&
TYPE_NORMAL
)
if
(
cdata
.
type
&
TYPE_NORMAL
)
return
-
1
;
return
-
1
;
set_status
(
STATUS_COPYING_EFFECT
,
TRUE
);
set_status
(
STATUS_COPYING_EFFECT
,
TRUE
);
...
@@ -2080,7 +2080,7 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) {
...
@@ -2080,7 +2080,7 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) {
}
}
int32
card
::
replace_effect
(
uint32
code
,
uint32
reset
,
uint32
count
)
{
int32
card
::
replace_effect
(
uint32
code
,
uint32
reset
,
uint32
count
)
{
card_data
cdata
;
card_data
cdata
;
read_card
(
code
,
&
cdata
);
::
read_card
(
code
,
&
cdata
);
if
(
cdata
.
type
&
TYPE_NORMAL
)
if
(
cdata
.
type
&
TYPE_NORMAL
)
return
-
1
;
return
-
1
;
if
(
is_status
(
STATUS_EFFECT_REPLACED
))
if
(
is_status
(
STATUS_EFFECT_REPLACED
))
...
...
libduel.cpp
View file @
3b85a623
...
@@ -2438,8 +2438,12 @@ int32 scriptlib::duel_disable_attack(lua_State *L) {
...
@@ -2438,8 +2438,12 @@ int32 scriptlib::duel_disable_attack(lua_State *L) {
}
}
int32
scriptlib
::
duel_chain_attack
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_chain_attack
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
card
*
attacker
=
pduel
->
game_field
->
core
.
attacker
;
if
(
!
attacker
||
!
attacker
->
is_affect_by_effect
(
pduel
->
game_field
->
core
.
reason_effect
))
{
return
0
;
}
pduel
->
game_field
->
core
.
chain_attack
=
TRUE
;
pduel
->
game_field
->
core
.
chain_attack
=
TRUE
;
pduel
->
game_field
->
core
.
chain_attacker_id
=
pduel
->
game_field
->
core
.
attacker
->
fieldid
;
pduel
->
game_field
->
core
.
chain_attacker_id
=
attacker
->
fieldid
;
if
(
lua_gettop
(
L
)
>
0
)
{
if
(
lua_gettop
(
L
)
>
0
)
{
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
pduel
->
game_field
->
core
.
chain_attack_target
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
pduel
->
game_field
->
core
.
chain_attack_target
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
...
@@ -3185,8 +3189,7 @@ int32 scriptlib::duel_get_synchro_material(lua_State *L) {
...
@@ -3185,8 +3189,7 @@ int32 scriptlib::duel_get_synchro_material(lua_State *L) {
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
for
(
auto
cit
=
mats
.
begin
();
cit
!=
mats
.
end
();
++
cit
)
{
for
(
auto
cit
=
mats
.
begin
();
cit
!=
mats
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
if
(
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_SPSUMMON_STEP
)
if
(
pcard
->
current
.
location
==
LOCATION_MZONE
&&
!
pcard
->
is_position
(
POS_FACEUP
)
&&
!
facedown
)
||
pcard
->
current
.
location
==
LOCATION_MZONE
&&
!
pcard
->
is_position
(
POS_FACEUP
)
&&
!
facedown
)
continue
;
continue
;
pgroup
->
container
.
insert
(
*
cit
);
pgroup
->
container
.
insert
(
*
cit
);
}
}
...
...
playerop.cpp
View file @
3b85a623
...
@@ -1000,7 +1000,7 @@ int32 field::announce_card(int16 step, uint8 playerid) {
...
@@ -1000,7 +1000,7 @@ int32 field::announce_card(int16 step, uint8 playerid) {
}
else
{
}
else
{
int32
code
=
returns
.
ivalue
[
0
];
int32
code
=
returns
.
ivalue
[
0
];
card_data
data
;
card_data
data
;
read_card
(
code
,
&
data
);
::
read_card
(
code
,
&
data
);
if
(
!
data
.
code
)
{
if
(
!
data
.
code
)
{
pduel
->
write_buffer8
(
MSG_RETRY
);
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
return
FALSE
;
...
...
premake/dll.lua
0 → 100644
View file @
3b85a623
newoption
{
trigger
=
"lua-dir"
,
description
=
""
,
value
=
"PATH"
,
default
=
"./lua"
}
function
GetParam
(
param
)
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
end
LUA_DIR
=
GetParam
(
"lua-dir"
)
if
not
os
.
isdir
(
LUA_DIR
)
then
LUA_DIR
=
"../lua"
end
workspace
"ocgcoredll"
location
"build"
language
"C++"
configurations
{
"Release"
,
"Debug"
}
platforms
{
"x32"
,
"x64"
}
filter
"platforms:x32"
architecture
"x32"
filter
"platforms:x64"
architecture
"x64"
filter
"configurations:Release"
optimize
"Speed"
filter
"configurations:Debug"
symbols
"On"
defines
"_DEBUG"
filter
"system:windows"
defines
{
"WIN32"
,
"_WIN32"
}
systemversion
"latest"
startproject
"ocgcore"
filter
{
"configurations:Release"
,
"action:vs*"
}
flags
{
"LinkTimeOptimization"
}
staticruntime
"On"
disablewarnings
{
"4267"
,
"4334"
}
filter
"action:vs*"
buildoptions
{
"/utf-8"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
filter
{}
include
(
LUA_DIR
)
project
"ocgcore"
kind
"SharedLib"
files
{
"*.cpp"
,
"*.h"
}
links
{
"lua"
}
includedirs
{
LUA_DIR
..
"/src"
}
premake/lua.lua
0 → 100644
View file @
3b85a623
project
"lua"
kind
"StaticLib"
files
{
"src/*.c"
,
"src/*.h"
,
"src/*.hpp"
}
removefiles
{
"src/lua.c"
,
"src/luac.c"
}
filter
"action:vs*"
buildoptions
{
"/TP"
}
filter
"not action:vs*"
buildoptions
{
"-x c++"
}
filter
"system:bsd"
defines
{
"LUA_USE_POSIX"
}
filter
"system:macosx"
defines
{
"LUA_USE_MACOSX"
}
filter
"system:linux"
defines
{
"LUA_USE_LINUX"
}
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