Commit 3b85a623 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into develop

parents bf728087 02254c8c
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
.vscode/ .vscode/
/premake5.exe
/build
/lua
...@@ -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))
......
...@@ -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);
} }
......
...@@ -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;
......
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" }
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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment