Commit 3b5bcce0 authored by mercury233's avatar mercury233

update MSG_SELECT_EFFECTYN

parent 8caee9dc
...@@ -559,7 +559,7 @@ public: ...@@ -559,7 +559,7 @@ public:
int32 select_battle_command(uint16 step, uint8 playerid); int32 select_battle_command(uint16 step, uint8 playerid);
int32 select_idle_command(uint16 step, uint8 playerid); int32 select_idle_command(uint16 step, uint8 playerid);
int32 select_effect_yes_no(uint16 step, uint8 playerid, card* pcard); int32 select_effect_yes_no(uint16 step, uint8 playerid, uint32 description, card* pcard);
int32 select_yes_no(uint16 step, uint8 playerid, uint32 description); int32 select_yes_no(uint16 step, uint8 playerid, uint32 description);
int32 select_option(uint16 step, uint8 playerid); int32 select_option(uint16 step, uint8 playerid);
int32 select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 min, uint8 max); int32 select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 min, uint8 max);
......
...@@ -2832,8 +2832,11 @@ int32 scriptlib::duel_select_effect_yesno(lua_State * L) { ...@@ -2832,8 +2832,11 @@ int32 scriptlib::duel_select_effect_yesno(lua_State * L) {
if(playerid != 0 && playerid != 1) if(playerid != 0 && playerid != 1)
return 0; return 0;
card* pcard = *(card**) lua_touserdata(L, 2); card* pcard = *(card**) lua_touserdata(L, 2);
int32 desc = 95;
if(lua_gettop(L) >= 3)
desc = lua_tointeger(L, 3);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->add_process(PROCESSOR_SELECT_EFFECTYN_S, 0, 0, (group*)pcard, playerid, 0); pduel->game_field->add_process(PROCESSOR_SELECT_EFFECTYN_S, 0, 0, (group*)pcard, playerid, desc);
return lua_yield(L, 0); return lua_yield(L, 0);
} }
int32 scriptlib::duel_select_yesno(lua_State * L) { int32 scriptlib::duel_select_yesno(lua_State * L) {
......
...@@ -165,7 +165,7 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) { ...@@ -165,7 +165,7 @@ int32 field::select_idle_command(uint16 step, uint8 playerid) {
return TRUE; return TRUE;
} }
} }
int32 field::select_effect_yes_no(uint16 step, uint8 playerid, card* pcard) { int32 field::select_effect_yes_no(uint16 step, uint8 playerid, uint32 description, card* pcard) {
if(step == 0) { if(step == 0) {
if((playerid == 1) && (core.duel_options & DUEL_SIMPLE_AI)) { if((playerid == 1) && (core.duel_options & DUEL_SIMPLE_AI)) {
returns.ivalue[0] = 1; returns.ivalue[0] = 1;
...@@ -175,6 +175,7 @@ int32 field::select_effect_yes_no(uint16 step, uint8 playerid, card* pcard) { ...@@ -175,6 +175,7 @@ int32 field::select_effect_yes_no(uint16 step, uint8 playerid, card* pcard) {
pduel->write_buffer8(playerid); pduel->write_buffer8(playerid);
pduel->write_buffer32(pcard->data.code); pduel->write_buffer32(pcard->data.code);
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
pduel->write_buffer32(description);
returns.ivalue[0] = -1; returns.ivalue[0] = -1;
return FALSE; return FALSE;
} else { } else {
......
...@@ -80,7 +80,7 @@ int32 field::process() { ...@@ -80,7 +80,7 @@ int32 field::process() {
} }
} }
case PROCESSOR_SELECT_EFFECTYN: { case PROCESSOR_SELECT_EFFECTYN: {
if (select_effect_yes_no(it->step, it->arg1, (card*)it->ptarget)) { if (select_effect_yes_no(it->step, it->arg1, it->arg2, (card*)it->ptarget)) {
core.units.pop_front(); core.units.pop_front();
return pduel->bufferlen; return pduel->bufferlen;
} else { } else {
......
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