Commit e454e517 authored by nanahira's avatar nanahira

Update starting

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