Commit 7e4c827d authored by salix5's avatar salix5

Merge pull request #36 from DailyShana/summon_info

add Debug.PreSummon
parents 4faee52c 2b5f53ce
...@@ -57,6 +57,7 @@ card::card(duel* pd) { ...@@ -57,6 +57,7 @@ card::card(duel* pd) {
pduel = pd; pduel = pd;
owner = PLAYER_NONE; owner = PLAYER_NONE;
operation_param = 0; operation_param = 0;
summon_info = 0;
status = 0; status = 0;
memset(&q_cache, 0xff, sizeof(query_cache)); memset(&q_cache, 0xff, sizeof(query_cache));
equiping_target = 0; equiping_target = 0;
......
...@@ -505,6 +505,7 @@ static const struct luaL_Reg debuglib[] = { ...@@ -505,6 +505,7 @@ static const struct luaL_Reg debuglib[] = {
{ "Message", scriptlib::debug_message }, { "Message", scriptlib::debug_message },
{ "AddCard", scriptlib::debug_add_card }, { "AddCard", scriptlib::debug_add_card },
{ "SetPlayerInfo", scriptlib::debug_set_player_info }, { "SetPlayerInfo", scriptlib::debug_set_player_info },
{ "PreSummon", scriptlib::debug_pre_summon },
{ "PreEquip", scriptlib::debug_pre_equip }, { "PreEquip", scriptlib::debug_pre_equip },
{ "PreSetTarget", scriptlib::debug_pre_set_target }, { "PreSetTarget", scriptlib::debug_pre_set_target },
{ "PreAddCounter", scriptlib::debug_pre_add_counter }, { "PreAddCounter", scriptlib::debug_pre_add_counter },
......
...@@ -78,6 +78,17 @@ int32 scriptlib::debug_set_player_info(lua_State *L) { ...@@ -78,6 +78,17 @@ int32 scriptlib::debug_set_player_info(lua_State *L) {
pduel->game_field->player[playerid].draw_count = drawcount; pduel->game_field->player[playerid].draw_count = drawcount;
return 0; return 0;
} }
int32 scriptlib::debug_pre_summon(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 summon_type = lua_tointeger(L, 2);
uint8 summon_location = 0;
if(lua_gettop(L) > 2)
summon_location = lua_tointeger(L, 3);
pcard->summon_info = summon_type | (summon_location << 16);
return 0;
}
int32 scriptlib::debug_pre_equip(lua_State *L) { int32 scriptlib::debug_pre_equip(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -505,6 +505,7 @@ public: ...@@ -505,6 +505,7 @@ public:
static int32 debug_message(lua_State *L); static int32 debug_message(lua_State *L);
static int32 debug_add_card(lua_State *L); static int32 debug_add_card(lua_State *L);
static int32 debug_set_player_info(lua_State *L); static int32 debug_set_player_info(lua_State *L);
static int32 debug_pre_summon(lua_State *L);
static int32 debug_pre_equip(lua_State *L); static int32 debug_pre_equip(lua_State *L);
static int32 debug_pre_set_target(lua_State *L); static int32 debug_pre_set_target(lua_State *L);
static int32 debug_pre_add_counter(lua_State *L); static int32 debug_pre_add_counter(lua_State *L);
......
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