Commit e454e517 authored by nanahira's avatar nanahira

Update starting

parent 30ac8f7f
......@@ -175,8 +175,9 @@ function Auxiliary.StartPick(e)
Duel.ShuffleDeck(p)
end
end
Duel.Draw(0,5,REASON_RULE)
Duel.Draw(1,5,REASON_RULE)
for p=0,1 do
Duel.Draw(p,Duel.GetStartCount(p),REASON_RULE)
end
e:Reset()
end
......
......@@ -372,6 +372,7 @@ static const struct luaL_Reg duellib[] = {
//2pick
{ "SavePickDeck", scriptlib::duel_save_pick_deck },
{ "IsPlayerNeedToPickDeck", scriptlib::duel_is_player_need_to_pick_deck },
{ "GetStartCount", scriptlib::duel_get_start_count },
//modded
{ "SelectField", scriptlib::duel_select_field },
{ "GetMasterRule", scriptlib::duel_get_master_rule },
......
......@@ -36,11 +36,20 @@ int32 scriptlib::duel_is_player_need_to_pick_deck(lua_State * L) {
check_param_count(L, 1);
int32 p = lua_tonumberint(L, 1);
if(p != 0 && p != 1)
luaL_error(L, "Parameter 1 should be 0 or 1.", 2);;
luaL_error(L, "Parameter 1 should be 0 or 1.", 2);
duel* pduel = interpreter::get_duel_info(L);
lua_pushboolean(L, pduel->game_field->player[p].pick_needed);
return 1;
}
int32 scriptlib::duel_get_start_count(lua_State * L) {
check_param_count(L, 1);
int32 p = lua_tonumberint(L, 1);
if(p != 0 && p != 1)
luaL_error(L, "Parameter 1 should be 0 or 1.", 2);
duel* pduel = interpreter::get_duel_info(L);
lua_pushinteger(L, pduel->game_field->player[p].start_count);
return 1;
}
//modded
int32 scriptlib::duel_select_field(lua_State * L) {
check_action_permission(L);
......
......@@ -78,10 +78,12 @@ extern "C" DECL_DLLEXPORT void start_duel(ptr pduel, int options) {
pd->game_field->core.shuffle_hand_check[1] = FALSE;
pd->game_field->core.shuffle_deck_check[0] = FALSE;
pd->game_field->core.shuffle_deck_check[1] = FALSE;
/*
if(pd->game_field->player[0].start_count > 0)
pd->game_field->draw(0, REASON_RULE, PLAYER_NONE, 0, pd->game_field->player[0].start_count);
if(pd->game_field->player[1].start_count > 0)
pd->game_field->draw(0, REASON_RULE, PLAYER_NONE, 1, pd->game_field->player[1].start_count);
*/
if(options & DUEL_TAG_MODE) {
for(int i = 0; i < pd->game_field->player[0].start_count && pd->game_field->player[0].tag_list_main.size(); ++i) {
card* pcard = pd->game_field->player[0].tag_list_main.back();
......
......@@ -19,6 +19,7 @@ public:
//2pick
static int32 duel_save_pick_deck(lua_State *L);
static int32 duel_is_player_need_to_pick_deck(lua_State *L);
static int32 duel_get_start_count(lua_State *L);
//millux
static int32 card_is_ritual_type(lua_State *L);
//modded
......
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