Commit 22e81ada authored by Uytrewq's avatar Uytrewq Committed by GitHub

add SUMMON_INFO_REASON_PLAYER (#530)

* add SUMMON_INFO_REASON_PLAYER

* fix
parent 438d791f
...@@ -2578,6 +2578,7 @@ void card::set_special_summon_status(effect* peffect) { ...@@ -2578,6 +2578,7 @@ void card::set_special_summon_status(effect* peffect) {
spsummon.defense = 0; spsummon.defense = 0;
spsummon.setcode.clear(); spsummon.setcode.clear();
spsummon.reason_effect = nullptr; spsummon.reason_effect = nullptr;
spsummon.reason_player = PLAYER_NONE;
return; return;
} }
card* pcard = peffect->get_handler(); card* pcard = peffect->get_handler();
...@@ -2600,6 +2601,7 @@ void card::set_special_summon_status(effect* peffect) { ...@@ -2600,6 +2601,7 @@ void card::set_special_summon_status(effect* peffect) {
spsummon.setcode.push_back((uint32)eset[i]->get_value(pcard)); spsummon.setcode.push_back((uint32)eset[i]->get_value(pcard));
} }
spsummon.reason_effect = peffect; spsummon.reason_effect = peffect;
spsummon.reason_player = peffect->get_handler_player();
} else { } else {
pcard = cait->triggering_effect->get_handler(); pcard = cait->triggering_effect->get_handler();
spsummon.code = cait->triggering_state.code; spsummon.code = cait->triggering_state.code;
...@@ -2618,6 +2620,7 @@ void card::set_special_summon_status(effect* peffect) { ...@@ -2618,6 +2620,7 @@ void card::set_special_summon_status(effect* peffect) {
spsummon.setcode.push_back((uint32)eset[i]->get_value(pcard)); spsummon.setcode.push_back((uint32)eset[i]->get_value(pcard));
} }
spsummon.reason_effect = cait->triggering_effect; spsummon.reason_effect = cait->triggering_effect;
spsummon.reason_player = cait->triggering_player;
} }
} }
void card::filter_effect(int32 code, effect_set* eset, uint8 sort) { void card::filter_effect(int32 code, effect_set* eset, uint8 sort) {
......
...@@ -417,6 +417,7 @@ public: ...@@ -417,6 +417,7 @@ public:
#define SUMMON_INFO_ATTACK 0x80 #define SUMMON_INFO_ATTACK 0x80
#define SUMMON_INFO_DEFENSE 0x100 #define SUMMON_INFO_DEFENSE 0x100
#define SUMMON_INFO_REASON_EFFECT 0x200 #define SUMMON_INFO_REASON_EFFECT 0x200
#define SUMMON_INFO_REASON_PLAYER 0x400
//double-name cards //double-name cards
#define CARD_MARINE_DOLPHIN 78734254 #define CARD_MARINE_DOLPHIN 78734254
......
...@@ -921,6 +921,9 @@ int32 scriptlib::card_get_special_summon_info(lua_State *L) { ...@@ -921,6 +921,9 @@ int32 scriptlib::card_get_special_summon_info(lua_State *L) {
case SUMMON_INFO_REASON_EFFECT: case SUMMON_INFO_REASON_EFFECT:
interpreter::effect2value(L, pcard->spsummon.reason_effect); interpreter::effect2value(L, pcard->spsummon.reason_effect);
break; break;
case SUMMON_INFO_REASON_PLAYER:
lua_pushinteger(L, pcard->spsummon.reason_player);
break;
default: default:
lua_pushnil(L); lua_pushnil(L);
break; break;
......
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