home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / sources / 2611 / fighter.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-23  |  1.2 KB  |  74 lines

  1. #ifndef lint
  2. static    char    sccsid[] = "@(#)fighter.c 1.1 92/05/28 SMI" ;
  3.     /* from fighter.c 1.2 88/10/19 SMI */
  4. #endif
  5.  
  6. /*
  7.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  8.  */
  9.  
  10. /*
  11.  * special routines for driving a fighter (not myself)
  12.  */
  13.  
  14.  
  15.  
  16. #include <stdio.h>
  17. #include <sys/time.h>
  18.  
  19. #include "dstar.h"
  20. #include "object_types.h"
  21.  
  22.  
  23. extern    new_status() ;
  24. extern    control_object() ;
  25. static    fighter_killed() ;
  26.  
  27.  
  28.     fptr    fighter_vector[VECTOR_LENGTH] = {
  29.           new_status,        /* new status        */
  30.           control_object,    /* control        */
  31.           fighter_killed,    /* when killed        */
  32.           NULL,            /* when kills        */
  33.         } ;
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. static
  46. fighter_killed(object,victim,killer)
  47. register Object        *object ;
  48. register Object        *victim ;
  49. register Object        *killer ;
  50. {
  51.     if(victim->status == OBJ_ACTIVE)
  52.     {
  53.       killer->score += SCORE_KILL ;
  54.       victim->score -= SCORE_KILL ;
  55.     }
  56.  
  57.     if(victim == Me)
  58.     {
  59.       victim->status = OBJ_DEAD ;
  60.       victim->flags &= ~(LASER_FLAG) ;
  61.       victim->Delta.x = 0.0 ;
  62.       victim->Delta.y = 0.0 ;
  63.       victim->Delta.z = 0.5 ;
  64.       victim->Pointing = Me->Forward ;
  65.       victim->Speed *= 0.7 ;
  66.       victim->description = BLAST_DESC ;
  67.       special_got_blasted(object) ;
  68.       net_start_message( NULL ) ;
  69.       send_status(Me) ;
  70.     }
  71.  
  72.     special_someone_got_blasted(object,victim) ;
  73. }
  74.