void eraseignore_by_number (int ignorenum) { int ignoreloop; int player_list[MAX_NUM_NET_PLAYERS]; int n = multi_get_kill_list(player_list); if((ignorenum <= 0) || (ignorenum > n)) { hud_message(MSGC_GAME_FEEDBACK,"UNIGNOREN: Player number %d doesn't exist!",ignorenum); Network_message[0]=0; multi_message_index = 0; multi_sending_message = 0; return; } for (ignoreloop = 0; ignoreloop < MAX_IGNORE; ignoreloop++) { if(!strcmp(ignorelist[ignoreloop], Players[player_list[ignorenum - 1]].callsign)) { ignorelist[ignoreloop][0] = '\0'; hud_message(MSGC_GAME_FEEDBACK,"Now unignoring %s!", Players[player_list[ignorenum - 1]].callsign); Players[player_list[ignorenum - 1]].connected = 1; return; } } hud_message(MSGC_GAME_FEEDBACK,"Player %s not currently ignored!", Players[player_list[ignorenum - 1]].callsign); return; }
void eraseignore (char * ignorename) //Delete a player from the ignore list. { int iPlayerLoop; int ignoreloop; strupr(ignorename); for(iPlayerLoop=0;iPlayerLoop!=MAX_NUM_NET_PLAYERS;iPlayerLoop++) { if(!stricmp(Players[iPlayerLoop].callsign,ignorename)) { for (ignoreloop = 0; ignoreloop < MAX_IGNORE; ignoreloop++) { if(!strcmp(ignorelist[ignoreloop], ignorename)) { ignorelist[ignoreloop][0] = '\0'; hud_message(MSGC_GAME_FEEDBACK,"Now unignoring %s!", ignorename); Players[iPlayerLoop].connected = 1; return; } } hud_message(MSGC_GAME_FEEDBACK,"Player %s not currently ignored!", ignorename); return; } } hud_message(MSGC_GAME_FEEDBACK,"UNIGNORE: %s doesn't exist!",ignorename); Network_message[0]=0; multi_message_index = 0; multi_sending_message = 0; return; }
void save_screen_shot(int automap_flag) { // fix t1; char message[100]; static int savenum=0; char savename[13]; unsigned char *buf; if (!ogl_readpixels_ok) { if (!automap_flag) hud_message(MSGC_GAME_FEEDBACK,"glReadPixels not supported on your configuration"); return; } stop_time(); //added/changed on 10/31/98 by Victor Rachels to fix overwrite each new game if ( savenum == 9999 ) savenum = 0; sprintf(savename,"scrn%04d.tga",savenum++); while(!access(savename,0)) { if ( savenum == 9999 ) savenum = 0; sprintf(savename,"scrn%04d.tga",savenum++); } sprintf( message, "%s '%s'", TXT_DUMPING_SCREEN, savename ); //end this section addition/change - Victor Rachels if (automap_flag) { // save_font = grd_curcanv->cv_font; // gr_set_curfont(GAME_FONT); // gr_set_fontcolor(gr_find_closest_color_current(0,31,0),-1); // gr_get_string_size(message,&w,&h,&aw); // modex_print_message(32, 2, message); } else { hud_message(MSGC_GAME_FEEDBACK,message); } buf = malloc(grd_curscreen->sc_w*grd_curscreen->sc_h*3); glReadBuffer(GL_FRONT); glReadPixels(0,0,grd_curscreen->sc_w,grd_curscreen->sc_h,GL_RGB,GL_UNSIGNED_BYTE,buf); write_bmp(savename,grd_curscreen->sc_w,grd_curscreen->sc_h,buf); free(buf); key_flush(); start_time(); }
void addignore (char * ignorename) //Add a player to the good 'ol ignore list. { int iPlayerLoop; int ignoreloop; char name[CALLSIGN_LEN+1]; //Ignore the specified player. strupr(ignorename); for(iPlayerLoop = 0;iPlayerLoop!=MAX_NUM_NET_PLAYERS;iPlayerLoop++) { if(!stricmp(Players[iPlayerLoop].callsign,ignorename)) { for(ignoreloop = 0; ignoreloop < MAX_IGNORE; ignoreloop++) { if (!strcmp(ignorename,Players[Player_num].callsign)) { hud_message(MSGC_GAME_FEEDBACK,"You cannot ignore yourself!"); return; } if (!strcmp(ignorelist[ignoreloop], ignorename)) { hud_message(MSGC_GAME_FEEDBACK,"You've already ignored %s!",ignorename); return; } if (ignorelist[ignoreloop][0] == '\0') { strcpy(ignorelist[ignoreloop], ignorename); hud_message(MSGC_GAME_FEEDBACK,"Now ignoring %s!", ignorename); strcpy(name, ignorename); Network_message_reciever = 100; // Let everyone know that I'm ignoring someone... sprintf( Network_message, "I'm now ignoring %s!", name); multi_send_message(); network_disconnect_player(iPlayerLoop); return; } } hud_message(MSGC_GAME_FEEDBACK,"Ignore slots are full!"); return; } } hud_message(MSGC_GAME_FEEDBACK,"IGNORE: %s doesn't exist!",ignorename); Network_message[0]=0; multi_message_index = 0; multi_sending_message = 0; return; }
void addignore_by_number (int ignorenum) { int ignoreloop; int player_list[MAX_NUM_NET_PLAYERS]; int n = multi_get_kill_list(player_list); if((ignorenum <= 0) || (ignorenum > n)) { hud_message(MSGC_GAME_FEEDBACK,"IGNOREN: Player number %d doesn't exist!",ignorenum); Network_message[0]=0; multi_message_index = 0; multi_sending_message = 0; return; } for(ignoreloop = 0; ignoreloop < MAX_IGNORE; ignoreloop++) { if(!stricmp(Players[Player_num].callsign, Players[player_list[ignorenum - 1]].callsign)) { hud_message(MSGC_GAME_FEEDBACK,"You cannot ignore yourself!"); return; } if(!stricmp(ignorelist[ignoreloop], Players[player_list[ignorenum - 1]].callsign)) { hud_message(MSGC_GAME_FEEDBACK,"You've already ignored %s!", Players[player_list[ignorenum - 1]].callsign); return; } if(ignorelist[ignoreloop][0] == '\0') { strcpy(ignorelist[ignoreloop], Players[player_list[ignorenum - 1]].callsign); hud_message(MSGC_GAME_FEEDBACK,"Now ignoring %s!", Players[player_list[ignorenum - 1]].callsign); Network_message_reciever = 100; // Let everyone know that I'm ignoring someone... sprintf( Network_message, "I'm now ignoring %s!", Players[player_list[ignorenum - 1]].callsign); multi_send_message(); network_disconnect_player(player_list[ignorenum - 1]); return; } } hud_message(MSGC_GAME_FEEDBACK,"Ignore slots are full!"); return; }
void gamefont_loadfont(int gf,int fi){ if (cfexist(font_conf[gf].font[fi].f.name)){ gamefont_unloadfont(gf); Gamefonts[gf]=gr_init_font(font_conf[gf].font[fi].f.name); }else { hud_message(MSGC_GAME_FEEDBACK,"Couldn't find font file %s!",font_conf[gf].font[fi].f.name); if (Gamefonts[gf]==NULL){ Gamefonts[gf]=gr_init_font(Gamefont_filenames_l[gf]); font_conf[gf].cur=-1; } return; } font_conf[gf].cur=fi; }
void listignore (void) //Lists all players on ignore. { int ignoreloop; for(ignoreloop = 0; ignoreloop < MAX_IGNORE; ignoreloop++) { if(ignorelist[ignoreloop][0] != '\0') { strcat(onignore, ignorelist[ignoreloop]); strcat(onignore, ","); strcat(onignore, " "); } } if(onignore[0] == '\0') { hud_message(MSGC_GAME_FEEDBACK,"There is no one on the ignore list!"); } else { hud_message(MSGC_GAME_FEEDBACK,"%s",onignore); } //Clear the onignore var to prevent overloading... onignore[0] = '\0'; return; }
void clearignore (void) //Clears the ignore list of all players on it. { int ignoreloop; int iPlayerLoop; for(ignoreloop = 0; ignoreloop < MAX_IGNORE; ignoreloop++) { if(ignorelist[ignoreloop][0] != '\0') { for(iPlayerLoop = 0; iPlayerLoop < MAX_NUM_NET_PLAYERS; iPlayerLoop++) { if(!stricmp(Players[iPlayerLoop].callsign,ignorelist[ignoreloop])) Players[iPlayerLoop].connected = 1; } ignorelist[ignoreloop][0] = '\0'; } } hud_message(MSGC_GAME_FEEDBACK,"Clearing ignore list!"); return; }
void start_endlevel_sequence() { int last_segnum,exit_side,tunnel_length; if (Newdemo_state == ND_STATE_RECORDING) // stop demo recording Newdemo_state = ND_STATE_PAUSED; if (Newdemo_state == ND_STATE_PLAYBACK) // don't do this if in playback mode return; if (Player_is_dead || ConsoleObject->flags&OF_SHOULD_BE_DEAD) return; //don't start if dead! Players[Player_num].homing_object_dist = -F1_0; // Turn off homing sound. reset_rear_view(); //turn off rear view if set if (!endlevel_data_loaded) { #ifdef NETWORK if (Game_mode & GM_MULTI) { multi_send_endlevel_start(0); #ifdef NETWORK network_do_frame(1, 1); #endif } #endif PlayerFinishedLevel(0); //don't do special sequence return; } { int segnum,old_segnum,entry_side,i; //count segments in exit tunnel old_segnum = ConsoleObject->segnum; exit_side = find_exit_side(ConsoleObject); segnum = Segments[old_segnum].children[exit_side]; tunnel_length = 0; do { entry_side = matt_find_connect_side(segnum,old_segnum); exit_side = Side_opposite[entry_side]; old_segnum = segnum; segnum = Segments[segnum].children[exit_side]; tunnel_length++; } while (segnum >= 0); if (segnum != -2) { PlayerFinishedLevel(0); //don't do special sequence return; } last_segnum = old_segnum; //now pick transition segnum 1/3 of the way in old_segnum = ConsoleObject->segnum; exit_side = find_exit_side(ConsoleObject); segnum = Segments[old_segnum].children[exit_side]; i=tunnel_length/3; while (i--) { entry_side = matt_find_connect_side(segnum,old_segnum); exit_side = Side_opposite[entry_side]; old_segnum = segnum; segnum = Segments[segnum].children[exit_side]; } transition_segnum = segnum; } Assert(last_segnum == exit_segnum); cockpit_mode_save = PlayerCfg.CockpitMode; #ifdef NETWORK if (Game_mode & GM_MULTI) { multi_send_endlevel_start(0); network_do_frame(1, 1); } #endif #ifndef SHAREWARE songs_play_song( SONG_ENDLEVEL, 0 ); #endif Endlevel_sequence = EL_FLYTHROUGH; ConsoleObject->movement_type = MT_NONE; //movement handled by flythrough ConsoleObject->control_type = CT_NONE; Game_suspended |= SUSP_ROBOTS; //robots don't move cur_fly_speed = desired_fly_speed = FLY_SPEED; start_endlevel_flythrough(0,ConsoleObject,cur_fly_speed); //initialize hud_message( MSGC_GAME_ACTION, TXT_EXIT_SEQUENCE ); outside_mine = ext_expl_playing = 0; flash_scale = f1_0; //init_endlevel(); mine_destroyed=0; }
//----------------------------------------------------------------- // Determines what happens when a wall is shot //returns info about wall. see wall.h for codes //obj is the object that hit...either a weapon or the player himself //playernum is the number the player who hit the wall or fired the weapon, //or -1 if a robot fired the weapon int wall_hit_process(segment *seg, int side, fix damage, int playernum, object *obj ) { wall *w; fix show_message; Assert (seg-Segments != -1); // If it is not a "wall" then just return. if ( seg->sides[side].wall_num < 0 ) return WHP_NOT_SPECIAL; w = &Walls[seg->sides[side].wall_num]; if ( Newdemo_state == ND_STATE_RECORDING ) newdemo_record_wall_hit_process( seg-Segments, side, damage, playernum ); if (w->type == WALL_BLASTABLE) { wall_damage(seg, side, damage); return WHP_BLASTABLE; } if (playernum != Player_num) //return if was robot fire return WHP_NOT_SPECIAL; Assert( playernum > -1 ); // Determine whether player is facing door he hit. If not, don't say negative // messages because he probably didn't intentionally hit the door. if (obj->type == OBJ_PLAYER) show_message = (vm_vec_dot(&obj->orient.fvec, &obj->mtype.phys_info.velocity) > 0); else show_message = 1; if (w->keys == KEY_BLUE) if (!(Players[playernum].flags & PLAYER_FLAGS_BLUE_KEY)) { if ( playernum==Player_num ) if (show_message) hud_message(MSGC_MINE_FEEDBACK, "%s %s",TXT_BLUE,TXT_ACCESS_DENIED); return WHP_NO_KEY; } if (w->keys == KEY_RED) if (!(Players[playernum].flags & PLAYER_FLAGS_RED_KEY)) { if ( playernum==Player_num ) if (show_message) hud_message(MSGC_MINE_FEEDBACK, "%s %s",TXT_RED,TXT_ACCESS_DENIED); return WHP_NO_KEY; } if (w->keys == KEY_GOLD) if (!(Players[playernum].flags & PLAYER_FLAGS_GOLD_KEY)) { if ( playernum==Player_num ) if (show_message) hud_message(MSGC_MINE_FEEDBACK, "%s %s",TXT_YELLOW,TXT_ACCESS_DENIED); return WHP_NO_KEY; } if (w->type == WALL_DOOR) { if ((w->flags & WALL_DOOR_LOCKED ) && !(special_boss_opening_allowed(seg-Segments, side)) ) { if ( playernum==Player_num ) if (show_message) hud_message(MSGC_MINE_FEEDBACK, TXT_CANT_OPEN_DOOR); return WHP_NO_KEY; } else { if (w->state != WALL_DOOR_OPENING) { wall_open_door(seg, side); #ifdef NETWORK if (Game_mode & GM_MULTI) multi_send_door_open(seg-Segments, side); #endif } return WHP_DOOR; } } return WHP_NOT_SPECIAL; //default is treat like normal wall }