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