Commit e45f2898 authored by Chen Bill's avatar Chen Bill

add effect flag in Card.RegisterEffect

parent 343115bb
...@@ -215,6 +215,9 @@ enum effect_flag : uint64 { ...@@ -215,6 +215,9 @@ enum effect_flag : uint64 {
EFFECT_FLAG_ACTIVATE_CONDITION = 0x20000000, EFFECT_FLAG_ACTIVATE_CONDITION = 0x20000000,
// EFFECT_FLAG_CVAL_CHECK = 0x40000000, // EFFECT_FLAG_CVAL_CHECK = 0x40000000,
EFFECT_FLAG_IMMEDIATELY_APPLY = 0x80000000, EFFECT_FLAG_IMMEDIATELY_APPLY = 0x80000000,
EFFECT_FLAG_COIN = 0x100000000,
EFFECT_FLAG_DICE = 0x200000000,
EFFECT_FLAG_FUSION_SUMMON = 0x400000000,
}; };
enum effect_flag2 : uint64 { enum effect_flag2 : uint64 {
EFFECT_FLAG2_REPEAT_UPDATE = 0x0001, EFFECT_FLAG2_REPEAT_UPDATE = 0x0001,
...@@ -263,6 +266,12 @@ enum effect_category :uint64 { ...@@ -263,6 +266,12 @@ enum effect_category :uint64 {
CATEGORY_TOEXTRA = 0x80000000, CATEGORY_TOEXTRA = 0x80000000,
}; };
const std::map<uint64, uint64> category_checklist{
{CATEGORY_COIN, EFFECT_FLAG_COIN},
{CATEGORY_DICE, EFFECT_FLAG_DICE},
{CATEGORY_FUSION_SUMMON, EFFECT_FLAG_FUSION_SUMMON},
};
//========== Codes ========== //========== Codes ==========
#define EFFECT_IMMUNE_EFFECT 1 // #define EFFECT_IMMUNE_EFFECT 1 //
#define EFFECT_DISABLE 2 // #define EFFECT_DISABLE 2 //
......
...@@ -1828,6 +1828,10 @@ int32 scriptlib::card_register_effect(lua_State *L) { ...@@ -1828,6 +1828,10 @@ int32 scriptlib::card_register_effect(lua_State *L) {
pduel->game_field->core.reseted_effects.insert(peffect); pduel->game_field->core.reseted_effects.insert(peffect);
return 0; return 0;
} }
for (auto& entry : category_checklist) {
if (peffect->category & entry.first)
peffect->flag[0] |= entry.second;
}
int32 id; int32 id;
if (peffect->handler) if (peffect->handler)
id = -1; id = -1;
......
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