Commit c353c350 authored by DailyShana's avatar DailyShana

extra pendulum count for puzzle mode

parent 92176df0
......@@ -3105,6 +3105,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.AddCard(ccard, p, LOCATION_REMOVED, seq);
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
}
val = BufferIO::ReadInt8(pbuf);
mainGame->dField.extra_p_count[p] = val;
}
val = BufferIO::ReadInt8(pbuf); //chains
for(int i = 0; i < val; ++i) {
......
......@@ -667,6 +667,8 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
ClientCard* ccard = new ClientCard;
mainGame->dField.AddCard(ccard, p, LOCATION_EXTRA, seq);
}
val = BufferIO::ReadInt8(pbuf);
mainGame->dField.extra_p_count[p] = val;
}
BufferIO::ReadInt8(pbuf); //chain count, always 0
SinglePlayReload();
......
......@@ -41,6 +41,7 @@ field::field(duel* pduel) {
player[i].draw_count = 1;
player[i].disabled_location = 0;
player[i].used_location = 0;
player[i].extra_p_count = 0;
player[i].list_mzone.reserve(5);
player[i].list_szone.reserve(8);
player[i].list_main.reserve(45);
......@@ -128,6 +129,7 @@ void field::reload_field_info() {
pduel->write_buffer8(player[playerid].list_grave.size());
pduel->write_buffer8(player[playerid].list_remove.size());
pduel->write_buffer8(player[playerid].list_extra.size());
pduel->write_buffer8(player[playerid].extra_p_count);
}
pduel->write_buffer8(core.current_chain.size());
for(auto chit = core.current_chain.begin(); chit != core.current_chain.end(); ++chit) {
......
......@@ -71,6 +71,7 @@ struct player_info {
int32 draw_count;
uint32 used_location;
uint32 disabled_location;
uint32 extra_p_count;
card_vector list_mzone;
card_vector list_szone;
card_vector list_main;
......
......@@ -45,6 +45,8 @@ int32 scriptlib::debug_add_card(lua_State *L) {
pcard->enable_field_effect(TRUE);
pduel->game_field->adjust_instant();
}
if((pcard->data.type & TYPE_PENDULUM) && (location == LOCATION_EXTRA) && (position & POS_FACEUP))
pduel->game_field->player[playerid].extra_p_count += 1;
if(proc)
pcard->set_status(STATUS_PROC_COMPLETE, TRUE);
interpreter::card2value(L, pcard);
......
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