Commit 86bd0696 authored by nanahira's avatar nanahira

Merge branch 'master' into 888

parents 7163cff5 2d486e69
Pipeline #41744 passed with stages
in 3 minutes and 31 seconds
...@@ -86,6 +86,8 @@ build_linux_x64: ...@@ -86,6 +86,8 @@ build_linux_x64:
build_linux_x64_no_longjmp: build_linux_x64_no_longjmp:
extends: .build_unix extends: .build_unix
except: [] except: []
only:
- '888'
variables: variables:
NO_LONGJMP: '1' NO_LONGJMP: '1'
......
...@@ -3425,69 +3425,32 @@ int32_t scriptlib::card_add_monster_attribute(lua_State *L) { ...@@ -3425,69 +3425,32 @@ int32_t scriptlib::card_add_monster_attribute(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
duel* pduel = pcard->pduel; duel* pduel = pcard->pduel;
pcard->set_status(STATUS_NO_LEVEL, FALSE); pcard->set_status(STATUS_NO_LEVEL, FALSE);
// pre-monster effect* peffect;
effect* peffect = pduel->new_effect(); auto add_temp_effect = [&](uint32_t code, int32_t value, uint32_t extra_reset_flag = 0) {
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_PRE_MONSTER;
peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_flag = RESET_CHAIN + RESET_EVENT + 0x47e0000;
peffect->value = type;
pcard->add_effect(peffect);
//attribute
if(attribute) {
peffect = pduel->new_effect(); peffect = pduel->new_effect();
peffect->owner = pcard; peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE; peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_ADD_ATTRIBUTE; peffect->code = code;
peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE; peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_flag = RESET_EVENT + 0x47e0000; peffect->reset_flag = RESET_EVENT | 0x47e0000 | extra_reset_flag;
peffect->value = attribute; peffect->value = value;
pcard->add_effect(peffect); pcard->add_effect(peffect);
};
add_temp_effect(EFFECT_PRE_MONSTER, type, RESET_CHAIN);
if(attribute) {
add_temp_effect(EFFECT_CHANGE_ATTRIBUTE, attribute);
} }
//race
if(race) { if(race) {
peffect = pduel->new_effect(); add_temp_effect(EFFECT_CHANGE_RACE, race);
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_ADD_RACE;
peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_flag = RESET_EVENT + 0x47e0000;
peffect->value = race;
pcard->add_effect(peffect);
} }
//level
if(level) { if(level) {
peffect = pduel->new_effect(); add_temp_effect(EFFECT_CHANGE_LEVEL, level);
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_CHANGE_LEVEL;
peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_flag = RESET_EVENT + 0x47e0000;
peffect->value = level;
pcard->add_effect(peffect);
} }
//atk
if(atk) { if(atk) {
peffect = pduel->new_effect(); add_temp_effect(EFFECT_SET_BASE_ATTACK, atk);
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_SET_BASE_ATTACK;
peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_flag = RESET_EVENT + 0x47e0000;
peffect->value = atk;
pcard->add_effect(peffect);
} }
//def
if(def) { if(def) {
peffect = pduel->new_effect(); add_temp_effect(EFFECT_SET_BASE_DEFENSE, def);
peffect->owner = pcard;
peffect->type = EFFECT_TYPE_SINGLE;
peffect->code = EFFECT_SET_BASE_DEFENSE;
peffect->flag[0] = EFFECT_FLAG_CANNOT_DISABLE;
peffect->reset_flag = RESET_EVENT + 0x47e0000;
peffect->value = def;
pcard->add_effect(peffect);
} }
return 0; return 0;
} }
......
...@@ -20,6 +20,7 @@ if not os.isdir(LUA_DIR) then ...@@ -20,6 +20,7 @@ if not os.isdir(LUA_DIR) then
end end
SQLITE3_DIR=GetParam("sqlite3-dir") SQLITE3_DIR=GetParam("sqlite3-dir")
USE_LONGJMP=not GetParam("no-longjmp")
function ApplyBoolean(param) function ApplyBoolean(param)
if GetParam(param) then if GetParam(param) then
...@@ -34,7 +35,7 @@ workspace "ocgcoredll" ...@@ -34,7 +35,7 @@ workspace "ocgcoredll"
configurations { "Release", "Debug" } configurations { "Release", "Debug" }
platforms { "x64", "x32", "arm64", "wasm" } platforms { "x64", "x32", "arm64", "wasm" }
if not GetParam("no-longjmp") then if USE_LONGJMP then
defines { "LUA_USE_LONGJMP" } defines { "LUA_USE_LONGJMP" }
end end
...@@ -82,7 +83,9 @@ workspace "ocgcoredll" ...@@ -82,7 +83,9 @@ workspace "ocgcoredll"
filter "system:linux" filter "system:linux"
defines { "LUA_USE_LINUX" } defines { "LUA_USE_LINUX" }
pic "On" pic "On"
-- linkoptions { "-static-libstdc++", "-static-libgcc" } if USE_LONGJMP then
linkoptions { "-static-libstdc++", "-static-libgcc" }
end
filter "platforms:wasm" filter "platforms:wasm"
toolset "emcc" toolset "emcc"
......
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