void begin_game(void) { int i; counter = 0; init_structs_etc(); for (i = 0; i < NO_ACTORS; i ++) { actor[i].in_play = 0; } player[0].score = 0; player[1].score = 0; if (game.type == GAME_SINGLE) { game.users = 1; actor[0].in_play = 0; player[game.single_player].actor_controlled = 0; // player[0].ships_left = 3; game.ships_left = 3; actor[0].controller = game.single_player; init_actor(0, player[game.single_player].ship); //ACTORTYPE_SHIP); } else { game.users = 2; actor[0].in_play = 0; player[0].actor_controlled = 0; // player[0].ships_left = 3; actor[0].controller = 0; init_actor(0, player[0].ship); //ACTORTYPE_SHIP); actor[1].in_play = 0; player[1].actor_controlled = 1; // player[1].ships_left = 3; actor[1].controller = 1; init_actor(1, player[1].ship); //ACTORTYPE_SHIP); game.ships_left = 6; } init_bullets(); init_clouds(); init_enemies(); prepare_display(); game.drag = 0.013;//955;//9999; /* arena.max_x = 894000; arena.max_y = 895000; */ arena.level = 0; init_level(); }
void begin_game(void) { int i; counter = 0; init_structs_etc(); for (i = 0; i < NO_ACTORS; i ++) { actor[i].in_play = 0; } player[0].score = 0; player[1].score = 0; if (game.type == GAME_SINGLE || game.type == GAME_TIME_ATTACK) { game.users = 1; actor[0].in_play = 0; player[game.single_player].actor_controlled = 0; // player[0].ships_left = 3; game.ships_left = 3; actor[0].controller = game.single_player; init_actor(0, player[game.single_player].ship); //ACTORTYPE_SHIP); } if (game.type == GAME_COOP || game.type == GAME_DUEL || game.type == GAME_TIME_ATTACK_COOP) { game.users = 2; actor[0].in_play = 0; player[0].actor_controlled = 0; // player[0].ships_left = 3; actor[0].controller = 0; init_actor(0, player[0].ship); //ACTORTYPE_SHIP); actor[1].in_play = 0; player[1].actor_controlled = 1; // player[1].ships_left = 3; actor[1].controller = 1; init_actor(1, player[1].ship); //ACTORTYPE_SHIP); game.ships_left = 6; } init_bullets(); init_clouds(); // init_stars(); init_enemies(); prepare_display(); game.drag = 0.013;//955;//9999; /* arena.max_x = 894000; arena.max_y = 895000; */ arena.level = 0; game.symbols_given = 0; init_level(); long_slacktime = 0; arena.waver_on_level = 0; }
void spawn_actor(int sactor, char async) { //int i; if (async == 0 && serial[0].game_type == SERIAL_CLIENT && user[actor[sactor].user].player > 0) { //async_spawn(sactor, actor[sactor].soldier); } user[actor[sactor].user].resting_time = 329; init_actor(sactor, 1); /* actor[sactor].firing_laser = LASER_NONE; actor[sactor].laser_strength = 0; actor[sactor].remote_control = REMOTE_NONE; actor[sactor].health = actor[sactor].max_health; actor[sactor].x_speed = 0; actor[sactor].y_speed = 0; actor [sactor].armour = 0; actor [sactor].shield = 0; actor [sactor].shield_visible = 0; actor [sactor].cloak = 0; actor [sactor].uncloaked = 0; actor [sactor].current_weapon = 0; for (i = 0; i < 4; i ++) { actor [sactor].weapon [i] = user[actor[sactor].user].weapon [i]; actor [sactor].ammunition [i] = wlist[actor [sactor].weapon [i]].ammunition; if (actor[sactor].weapon [i] != WPN_NONE) actor [sactor].clips [i] = actor[sactor].max_clips; else { actor [sactor].clips [i] = 0; actor [sactor].ammunition [i] = 0; } actor [sactor].reload [i] = 0; } */ // start place_actor function int px = 0; int py = 0; int tries = 0; if (!async) { do { px = prand(arena[0].max_x - 40) + 10; py = prand(arena[0].max_y - 40) + 20; tries ++; if (tries == 50000) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("Fatal Error: Can't find empty space in map. Aborting."); exit(1); } } while(!check_free_area(px - actor[sactor].width, py - actor[sactor].height, px + actor[sactor].width, py + actor[sactor].height)); actor[sactor].x = px * GRAIN; actor[sactor].y = py * GRAIN; blast_dirt(actor[sactor].x, actor[sactor].y, 15, 1); } display_actor_health(sactor, 0); display_actor_ammunition(sactor); if (actor[sactor].player > 0) init_stat_disp2(actor[sactor].player); display_actor_clips(sactor); display_actor_armour(sactor); if (actor[sactor].incarnation == 0) actor[sactor].incarnation = 1; else actor[sactor].incarnation = 0; // textprintf(screen, large_font, 140, 190, arena[0].counter, "A %i H %i MH %i", sactor, actor[sactor].health, actor[sactor].max_health); create_cloud(CLOUD_SPAWN, actor[sactor].x, actor[sactor].y, 0, 0, actor[sactor].circle_radius * 100, 1, actor[sactor].soldier, 3); create_cloud(CLOUD_BIGLIGHT, actor[sactor].x, actor[sactor].y, 0, 0, actor[sactor].circle_radius * 100, 1, 0, 3); }