Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Wind2009-Louse committed Sep 26, 2024
2 parents fc6cb4c + 301b8cc commit 8327d70
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 47 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
27 changes: 2 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 0 additions & 15 deletions card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2164,21 +2164,6 @@ void card::reset(uint32 id, uint32 reset_type) {
cmit = counters.erase(cmit);
}
}
if(id & RESET_TURN_SET) {
effect* peffect = std::get<effect*>(refresh_control_status());
if(peffect && (!(peffect->type & EFFECT_TYPE_SINGLE) || peffect->condition)) {
effect* new_effect = pduel->new_effect();
new_effect->id = peffect->id;
new_effect->owner = this;
new_effect->handler = this;
new_effect->type = EFFECT_TYPE_SINGLE;
new_effect->code = EFFECT_SET_CONTROL;
new_effect->value = current.controler;
new_effect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
new_effect->reset_flag = RESET_EVENT | 0xec0000;
this->add_effect(new_effect);
}
}
}
for (auto i = indexer.begin(); i != indexer.end();) {
auto rm = i++;
Expand Down
2 changes: 1 addition & 1 deletion effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions libduel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4783,8 +4783,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;
Expand Down

0 comments on commit 8327d70

Please sign in to comment.