Commit 75ba9362 authored by salix5's avatar salix5

Card.RegisterEffect()

parent 051aa8b1
...@@ -462,5 +462,6 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2) ...@@ -462,5 +462,6 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_PHASE_START 0x2000 #define EVENT_PHASE_START 0x2000
#define EVENT_ADD_COUNTER 0x10000 #define EVENT_ADD_COUNTER 0x10000
#define EVENT_REMOVE_COUNTER 0x20000 #define EVENT_REMOVE_COUNTER 0x20000
#define EVENT_CARD 0x10000000
#endif /* EFFECT_H_ */ #endif /* EFFECT_H_ */
...@@ -981,8 +981,13 @@ int32 scriptlib::card_register_effect(lua_State *L) { ...@@ -981,8 +981,13 @@ int32 scriptlib::card_register_effect(lua_State *L) {
int32 id; int32 id;
if (peffect->handler) if (peffect->handler)
id = -1; id = -1;
else else {
if((peffect->type & (EFFECT_TYPE_TRIGGER_O | EFFECT_TYPE_TRIGGER_F)) && !(peffect->code & EVENT_CARD) && (peffect->code & EVENT_PHASE)) {
peffect->flag[0] |= EFFECT_FLAG_COUNT_LIMIT;
peffect->reset_count |= ((1 << 12) & 0xf000) | ((1 << 8) & 0xf00);
}
id = pcard->add_effect(peffect); id = pcard->add_effect(peffect);
}
lua_pushinteger(L, id); lua_pushinteger(L, id);
return 1; return 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