Commit dc1e9c42 authored by wind2009's avatar wind2009

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

parents 0de537f3 301b8cc3
......@@ -18,9 +18,9 @@ jobs:
- 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
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.4.7.tar.gz ; exit 0"
tar xzf lua-5.4.7.tar.gz
move lua-5.4.7 lua
- name: Premake
run: |
......
......@@ -4,31 +4,8 @@
The core logic and lua script processor of YGOPro. This library can be made external of the project and used to power server technologies. It maintains a state engine that is manipulated by Lua scripts using manipulation functions it exposes.
## Compiling
See [ygopro wiki](https://github.com/Fluorohydride/ygopro/wiki).
### 1.) Download Fluorohydride/ygopro
Start by downloading the most parent of the source code. The team developing this project are the de facto edge and experts in our community. The most up-to-date `ocgcore` is a compiled dll version of the `Fluorohydride/ygopro/ocgcore` folders project.
### 2.) Install Premake5 and Visual Studio 2022 (or later).
Download premake5.exe, put it in `c:\windows` or a similar folder that is globally accessible via `cmd` or PowerShell. Install Visual Studio 2022, it is the system used for the guide because other parts of the project use C# and most the development team are Windows users.
### 3.) Download dependencies
* lua
### 4.) Create the project files
Run the following commands from the command line in the `Fluorohydride/ygopro` folder.
`premake5 vs2022`
If you are not using Visual Studio 2022 or higher, make necessary adjustments. In the file system open `Fluorohydride/ygopro/build` folder open the `ygopro` project.
### 5.) Build the system
Make sure the code actually compiles. Compile them in the following order one by one:
* lua
* ocgcore
This should provide you with `ocgcore.lib` in the build output folder. `YGOCore` requires a `*.dll`; in `ocgcore` project properties change it to a dynamically linked library. Recompile, it should fail with an error indicating missing dependencies. Right click the project, add an existing file. Add `lua.lib` from the build folder to the project. It should now compile.
In most cases, what you want to compile is the main program of YGOPro. You should refer to the main YGOPro project's [wiki](https://github.com/Fluorohydride/ygopro/wiki).
If you want to compile the dynamic link library of this repository (ocgcore.dll), you can refer to [this script](https://github.com/Fluorohydride/ygopro-core/blob/master/.github/workflows/build.yml).
## Exposed Functions
......
......@@ -513,7 +513,7 @@ constexpr uint32 INTERNAL_FLAGS = EFFECT_FLAG_INITIAL | EFFECT_FLAG_FUNC_VALUE |
#define EVENT_MSET 1106
#define EVENT_SSET 1107
#define EVENT_BE_MATERIAL 1108
#define EVENT_BE_PRE_MATERIAL 1109
#define EVENT_BE_PRE_MATERIAL 1109
#define EVENT_DRAW 1110
#define EVENT_DAMAGE 1111
#define EVENT_RECOVER 1112
......
......@@ -3125,7 +3125,7 @@ int32 scriptlib::card_is_immune_to_effect(lua_State *L) {
check_param(L, PARAM_TYPE_EFFECT, 2);
card* pcard = *(card**) lua_touserdata(L, 1);
effect* peffect = *(effect**) lua_touserdata(L, 2);
lua_pushboolean(L, !pcard->is_affect_by_effect(peffect));
lua_pushboolean(L, (int)!pcard->is_affect_by_effect(peffect));
return 1;
}
int32 scriptlib::card_is_can_be_disabled_by_effect(lua_State* L) {
......
......@@ -4805,8 +4805,10 @@ int32 scriptlib::duel_majestic_copy(lua_State *L) {
break;
}
effect* peffect = eit->second;
if(!(peffect->type & 0x7c)) continue;
if(!peffect->is_flag(EFFECT_FLAG_INITIAL)) continue;
if (!(peffect->type & 0x7c))
continue;
if (!peffect->is_flag(EFFECT_FLAG_INITIAL))
continue;
effect* ceffect = peffect->clone();
ceffect->owner = pcard;
ceffect->flag[0] &= ~EFFECT_FLAG_INITIAL;
......
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