From: etj90 <etj90@ecs.soton.ac.uk>
Newsgroups: rec.games.xtank.play,rec.games.xtank.programmer
Subject: patches to 1.3f, for new weapons plus some fixes
Date: 26 Sep 92 16:46:54 GMT
Organization: XTank Players Anonymous
X-Face: 
	 +YuKMM.9.siQ,tvy#,l!$$Ud}MF+B1SfRscO'v|AMXNt~}.,r<l&*C5]{/z]0Aa8J_KE=PQ
	 IY{7=YXJouOsCaGW/_[D1f{]0SM&n^\l](RY>zwJ%<|*:1ih?.~~PMx16);.efLwN?8!|~(X88!h`1
	 5;}ab+OD3W"a~fuCVKBh;YMm7zw?d2,iH~WJQTmD_;^,"d
Originator: etj90@gloriana

Here they are. The newconsole's armour bars were wrong left-to-right,
the weapons menu is made scrolling, the height of a scrolling menu is
changed from 25 to 22 to fit the design screen (I know it's lazy), and
the HUD has been taught about lasers' non-relative bullet movement (I should
probs make it an Attribute in weapon-defs.h).

Other things I will add are turbo boost and autofire. The autofire
has me stumped though, it will mean that when you click in the ANIM_WIN
all weapons continue firing until you release the button, and I am not
sure how to go about this.
-- 
"Thought I oughtta bare my naked feelings,
 Thought I oughtta tear the curtain down.
 I held the blade in trembling hands, prepared to make it but
 Just then the phone rang; I never had the nerve to make the final cut"

diff -c5 -r xtank1-3f/Src/Include/scroll.h xtank1-3f.etj90/Src/Include/scroll.h
*** xtank1-3f/Src/Include/scroll.h	Sun Aug 30 22:15:51 1992
--- xtank1-3f.etj90/Src/Include/scroll.h	Sat Sep 26 15:24:14 1992
***************
*** 1,8 ****
  /* scroll.h - part of XTank */
  
! #define MAXSPAN 25
  
  /*
  $Author: rpotter $
  $Id: scroll.h,v 2.3 1991/02/10 13:51:36 rpotter Exp $
  
--- 1,8 ----
  /* scroll.h - part of XTank */
  
! #define MAXSPAN 22
  
  /*
  $Author: rpotter $
  $Id: scroll.h,v 2.3 1991/02/10 13:51:36 rpotter Exp $
  
diff -c5 -r xtank1-3f/Src/Include/weapon-defs.h xtank1-3f.etj90/Src/Include/weapon-defs.h
*** xtank1-3f/Src/Include/weapon-defs.h	Sun Sep 13 08:03:31 1992
--- xtank1-3f.etj90/Src/Include/weapon-defs.h	Sat Sep 26 14:59:11 1992
***************
*** 38,47 ****
--- 38,50 ----
  QQ(MINE,   "Mine Layer",        6,  50,  50, 2, 10,1000,1000, 70, 2, 10,  8000, 4, NORM)
  QQ(SEEKER, "Heat Seeker",       8,1250,  15,15, 25,1000,1800, 51, 9, 50, 20000, 12, HIGH)
  
  /* Note that weapons you don't want chosen by an outpost must be after SEEKER */
  
+ QQ(BLAST,  "Blast Cannon",      1, 500,  20, 8, 25, 300, 350, 20,10, 20,100000, 1, NORM)
+ QQ(LASER,  "Pulse Laser",       5, 500, 500, 2, 50, 300, 250, 10, 3,  3, 30000, 1, NORM)
+ QQ(SELF_D, "Self Destruct",  9999,   1,   1, 1,  1,2500,1000,  1, 1,  1, 30000, 1, NORM)
  QQ(SLICK,  "Oil Slick",         0,  50,  50, 5, 10, 300, 500, 70, 0, 10,  2000, 1, LOW)
  QQ(PROCKET,"Pocket Rocket",     8,1015,  30, 8, 35, 900,1650, 30,12, 23, 17000, 2, NORM)
  QQ(UMISSLE,"Unguided Missle",   8,1995,  30, 8, 35,1000,1800, 57,12, 25, 18000, 2, NORM)
  #ifdef TAC_NUKES
  QQ(NUKE,   "Tactical Nuke",     8, 600,  10, 7, 35, 900,1600, 25,12,999, 15000, 15, NORM)
diff -c5 -r xtank1-3f/Src/Objects/bullets.obj xtank1-3f.etj90/Src/Objects/bullets.obj
*** xtank1-3f/Src/Objects/bullets.obj	Tue Aug 18 06:45:00 1992
--- xtank1-3f.etj90/Src/Objects/bullets.obj	Fri Sep 25 21:25:13 1992
***************
*** 1,13 ****
  /*
  **  This is the object file for all bullets.
  */
  
  #ifdef NO_GAME_BALANCE
! #define all_bullets_views 22
  #else
! #define all_bullets_views 21
  #endif
  
  #define OURSTUFF
  
  static Picture all_bullets_pic[all_bullets_views] = {
--- 1,13 ----
  /*
  **  This is the object file for all bullets.
  */
  
  #ifdef NO_GAME_BALANCE
! #define all_bullets_views 25
  #else
! #define all_bullets_views 24
  #endif
  
  #define OURSTUFF
  
  static Picture all_bullets_pic[all_bullets_views] = {
***************
*** 28,41 ****
  #ifdef OURSTUFF
        {11,11, 5, 5 },
  #else
        { 5, 5, 2, 2 },
  #endif
!       { 7, 7, 3, 3 },
!       { 9, 9, 4, 4 },
!       { 7, 7, 3, 3 },
!       { 7, 7, 3, 3 },
  #ifdef NO_GAME_BALANCE
        { 16, 16, 8, 8 },  /* nuke */
  #endif
        { 7, 7, 3, 3 },    /* harm */
        { 15, 15, 7, 7 }   /* disc */
--- 28,44 ----
  #ifdef OURSTUFF
        {11,11, 5, 5 },
  #else
        { 5, 5, 2, 2 },
  #endif
!       { 7, 7, 3, 3 }, /* SEEKER */
!       { 5, 5, 2, 2 }, /* BLAST */
!       { 2, 2, 0, 0 }, /* LASER */
!       { 2, 2, 0, 0 }, /* SELF_D */
!       { 9, 9, 4, 4 }, /* SLICK */
!       { 7, 7, 3, 3 }, /* PROCKET */
!       { 7, 7, 3, 3 }, /* UMISSLE */
  #ifdef NO_GAME_BALANCE
        { 16, 16, 8, 8 },  /* nuke */
  #endif
        { 7, 7, 3, 3 },    /* harm */
        { 15, 15, 7, 7 }   /* disc */
***************
*** 137,146 ****
--- 140,152 ----
  	hrl_bits,
  	as_bits,
  	ft_bits,
  	ml_bits,
  	seeker_bits,
+ 	ha_bits, /* BLAST */
+ 	lmg_bits, /* LASER */
+ 	lmg_bits, /* SELF_D */
  	slick_bits,
  	seeker_bits,
  	seeker_bits,
  #ifdef NO_GAME_BALANCE
  	tacnuke_bits,
diff -c5 -r xtank1-3f/Src/actions.c xtank1-3f.etj90/Src/actions.c
*** xtank1-3f/Src/actions.c	Sun Sep 13 08:04:25 1992
--- xtank1-3f.etj90/Src/actions.c	Fri Sep 25 18:09:46 1992
***************
*** 157,174 ****
      /* Compute the x and y components of the bullet's speed */
      b->xspeed = (FLOAT) ws->ammo_speed * cos(angle);
      b->yspeed = (FLOAT) ws->ammo_speed * sin(angle);
  
      /* Add the motion of the owner (if necessary) */
!     if (settings.si.rel_shoot == TRUE && v != NULL)
      {
  	b->xspeed += v->vector.xspeed;
  	b->yspeed += v->vector.yspeed;
      }
      b->type = type;
      b->life = ws->frames;
!     b->hurt_owner = FALSE;
      if (type == HARM) {
          b->target.y = target->y;
          b->target.x = target->x; 
      }
      if (type == DISC) {
--- 157,179 ----
      /* Compute the x and y components of the bullet's speed */
      b->xspeed = (FLOAT) ws->ammo_speed * cos(angle);
      b->yspeed = (FLOAT) ws->ammo_speed * sin(angle);
  
      /* Add the motion of the owner (if necessary) */
!     if (settings.si.rel_shoot == TRUE && v != NULL && type != LASER)
      {
  	b->xspeed += v->vector.xspeed;
  	b->yspeed += v->vector.yspeed;
      }
      b->type = type;
      b->life = ws->frames;
! 
!     if (type == SELF_D) /* Ellis's Self Destruct !!?!?! */
! 	b->hurt_owner = TRUE;
!     else
! 	b->hurt_owner = FALSE;
! 
      if (type == HARM) {
          b->target.y = target->y;
          b->target.x = target->x; 
      }
      if (type == DISC) {
diff -c5 -r xtank1-3f/Src/hit.c xtank1-3f.etj90/Src/hit.c
*** xtank1-3f/Src/hit.c	Sun Sep 13 08:04:34 1992
--- xtank1-3f.etj90/Src/hit.c	Fri Sep 25 19:02:09 1992
***************
*** 394,404 ****
  int dx, dy;
  {
      extern Vehicle *disc_last_owner(), *disc_old_owner();
      Vehicle *shoot_v;
      FLOAT angle;
!     int vx, vy, damage, height;
  
      switch (b->type)
      {
        case DISC:
        
--- 394,404 ----
  int dx, dy;
  {
      extern Vehicle *disc_last_owner(), *disc_old_owner();
      Vehicle *shoot_v;
      FLOAT angle;
!     int vx, vy, damage, height, lcount;
  
      switch (b->type)
      {
        case DISC:
        
***************
*** 487,496 ****
--- 487,501 ----
  	    else
  	    {
  		damage = 0;
  	    }
  
+ 	    if (b->type == BLAST) {
+ 		for(lcount=0; lcount < 16; lcount++)
+ 		    make_bullet(b->owner, loc, MG, lcount * PI/8);
+ 	    }
+ 
  	    /* Make an explosion of the appropriate type */
  	    /* for the damage */
  	    explode(b, damage);
  	}
      }
***************
*** 503,513 ****
  bul_hit_outpost(b, bbox, grid_x, grid_y)
  Bullet *b;
  Box *bbox;
  int grid_x, grid_y;
  {
! 	int damage;
  
  	if (b->type != DISC)
  	{
          /* Compute damage of the bullet, award points, and damage the outpost
  	   */
--- 508,518 ----
  bul_hit_outpost(b, bbox, grid_x, grid_y)
  Bullet *b;
  Box *bbox;
  int grid_x, grid_y;
  {
! 	int damage, lcount;
  
  	if (b->type != DISC)
  	{
          /* Compute damage of the bullet, award points, and damage the outpost
  	   */
***************
*** 535,544 ****
--- 540,555 ----
  				bbox->type = NORMAL;
  				explode_location(b->loc, 1, EXP_TANK);
  				invalidate_maps();
  			}
  		}
+ 
+ 		if (b->type == BLAST) {
+ 		    for(lcount=0; lcount < 16; lcount++)
+ 			make_bullet(b->owner, b->loc, MG, lcount * PI/8);
+ 		}
+ 
  		explode(b, damage);
  	}
  }
  
  #define WALL_THICKNESS 0.5
***************
*** 553,563 ****
      Bullet *b;
      int grid_x, grid_y;		/* coordinates of box containing wall flag */
      WallSide dir;		/* direction bullet hit wall */
  {
      FLOAT dx, dy;
!     int dam;
  
      /* Compute x and y distances from current location to point of contact */
      switch (dir)
      {
        case NORTH:
--- 564,574 ----
      Bullet *b;
      int grid_x, grid_y;		/* coordinates of box containing wall flag */
      WallSide dir;		/* direction bullet hit wall */
  {
      FLOAT dx, dy;
!     int dam, lcount;
  
      /* Compute x and y distances from current location to point of contact */
      switch (dir)
      {
        case NORTH:
***************
*** 609,618 ****
--- 620,634 ----
  	    bounce_bullet(b, dir, dx, dy);
  	    return TRUE;
  	}
  	else
  	{
+ 	    if (b->type == BLAST) {
+ 		for(lcount=0; lcount < 16; lcount++)
+ 		    make_bullet(b->owner, b->loc, MG, lcount * PI/8);
+ 	    }
+ 
  	    explode(b, dam);
  	    return FALSE;
  	}
      }
  }
diff -c5 -r xtank1-3f/Src/hud.c xtank1-3f.etj90/Src/hud.c
*** xtank1-3f/Src/hud.c	Sun Aug 30 22:15:12 1992
--- xtank1-3f.etj90/Src/hud.c	Sat Sep 26 16:13:56 1992
***************
*** 256,270 ****
--- 256,272 ----
  			    color = BLUE;
  			    break;
  			case LRIFLE:
  			case RIFLE:
  			case HRIFLE:
+ 			case LASER:
  			    color = RED;
  			    break;
  			case LCANNON:
  			case CANNON:
  			case HCANNON:
+ 			case BLAST:
  			    color = ORANGE;
  			    break;
  			case LROCKET:
  			case ROCKET:
  			case HROCKET:
***************
*** 282,292 ****
  			    break;
  		    }
  
  		    x2 = x1 + (int) (weapon_stat[v->weapon[h->draw[i].weapon].type].range * COS(a));
  		    y2 = y1 + (int) (weapon_stat[v->weapon[h->draw[i].weapon].type].range * SIN(a));
! 		    if (settings.si.rel_shoot) {
  			x2 += (int) v->vector.xspeed * weapon_stat[v->weapon[h->draw[i].weapon].type].frames;
  			y2 += (int) v->vector.yspeed * weapon_stat[v->weapon[h->draw[i].weapon].type].frames;
  		    }
  
  		    h->draw[i].x1 = x1;
--- 284,294 ----
  			    break;
  		    }
  
  		    x2 = x1 + (int) (weapon_stat[v->weapon[h->draw[i].weapon].type].range * COS(a));
  		    y2 = y1 + (int) (weapon_stat[v->weapon[h->draw[i].weapon].type].range * SIN(a));
! 		    if (settings.si.rel_shoot && (v->weapon[h->draw[i].weapon].type != LASER)) {
  			x2 += (int) v->vector.xspeed * weapon_stat[v->weapon[h->draw[i].weapon].type].frames;
  			y2 += (int) v->vector.yspeed * weapon_stat[v->weapon[h->draw[i].weapon].type].frames;
  		    }
  
  		    h->draw[i].x1 = x1;
diff -c5 -r xtank1-3f/Src/newconsole.c xtank1-3f.etj90/Src/newconsole.c
*** xtank1-3f/Src/newconsole.c	Sun Sep 13 08:04:40 1992
--- xtank1-3f.etj90/Src/newconsole.c	Sat Sep 26 16:22:14 1992
***************
*** 109,121 ****
  int idx, *sidep;
  {
  	*sidep = (idx >= 44 && idx <= 47) ? 1 : 0;
  	switch(idx) {
  		case 44: return FRONT;
! 		case 45: return LEFT;
  		case 46: return BACK;
! 		case 47: return RIGHT;
  		case 48: return TOP;
  		case 49: return BOTTOM;
  	}
  }
  
--- 109,121 ----
  int idx, *sidep;
  {
  	*sidep = (idx >= 44 && idx <= 47) ? 1 : 0;
  	switch(idx) {
  		case 44: return FRONT;
! 		case 47: return LEFT;
  		case 46: return BACK;
! 		case 45: return RIGHT;
  		case 48: return TOP;
  		case 49: return BOTTOM;
  	}
  }
  
diff -c5 -r xtank1-3f/Src/vdesign.c xtank1-3f.etj90/Src/vdesign.c
*** xtank1-3f/Src/vdesign.c	Sun Sep 13 08:04:46 1992
--- xtank1-3f.etj90/Src/vdesign.c	Fri Sep 25 18:19:58 1992
***************
*** 301,311 ****
  
      menu_norm_make(&menu_sys, MAIN_MENU, "Vdesign", 14, 0,
  		   LEV0_X, LEV0_Y, main_entries, M_FONT);
      menu_norm_make(&menu_sys, ENGINES_MENU, engine_title, MAX_ENGINES, 0,
  		   LEV1_X, LEV0_Y, engine_entries, M_FONT);
!     menu_norm_make(&menu_sys, WEAPONS_MENU, weapon_title, VMAX_WEAPONS, 0,
  		   LEV1_X, LEV0_Y, weapon_entries, M_FONT);
      menu_norm_make(&menu_sys, ARMORS_MENU, armor_title, MAX_ARMORS, 0,
  		   LEV1_X, LEV0_Y, armor_entries, L_FONT);
      menu_norm_make(&menu_sys, BODIES_MENU, body_title, MAX_BODIES, 0,
  		   LEV1_X, LEV0_Y, body_entries, M_FONT);
--- 301,312 ----
  
      menu_norm_make(&menu_sys, MAIN_MENU, "Vdesign", 14, 0,
  		   LEV0_X, LEV0_Y, main_entries, M_FONT);
      menu_norm_make(&menu_sys, ENGINES_MENU, engine_title, MAX_ENGINES, 0,
  		   LEV1_X, LEV0_Y, engine_entries, M_FONT);
! 
!     menu_scroll_make(&menu_sys, WEAPONS_MENU, weapon_title, VMAX_WEAPONS, 0, /* etj */
  		   LEV1_X, LEV0_Y, weapon_entries, M_FONT);
      menu_norm_make(&menu_sys, ARMORS_MENU, armor_title, MAX_ARMORS, 0,
  		   LEV1_X, LEV0_Y, armor_entries, L_FONT);
      menu_norm_make(&menu_sys, BODIES_MENU, body_title, MAX_BODIES, 0,
  		   LEV1_X, LEV0_Y, body_entries, M_FONT);
diff -c5 -r xtank1-3f/Src/vehicle.c xtank1-3f.etj90/Src/vehicle.c
*** xtank1-3f/Src/vehicle.c	Sun Sep 13 08:04:47 1992
--- xtank1-3f.etj90/Src/vehicle.c	Fri Sep 25 18:32:58 1992
***************
*** 371,380 ****
--- 371,381 ----
      for (i = 0; i < v->num_weapons; i++) {
  	w = &v->weapon[i];
  	w->status = (WS_on | WS_func);
  	w->ammo = weapon_stat[(int) w->type].max_ammo;
  	w->reload_counter = 0;
+ 	if (w->type == SELF_D) w->status = WS_func; /* Efp's SELF_D */
  	w->refill_counter = weapon_stat[(int) w->type].refill_time;
      }
  
      /* Set up each player's terminal */
      for (i = 0; i < c->num_players; i++)
***************
*** 474,486 ****
      for (i = victim->num_weapons; i-- > 0;) {
  	Weapon *w;
  	int j;
  
  	w = &victim->weapon[i];
! 	for (j = rnd(w->ammo / 30 + 1); j-- > 0;)
! 	    make_bullet((Vehicle *) NULL, loc, w->type, rnd_interval(-PI, PI));
! 	/* perhaps we should have turned some SLICK into FLAME? */
      }
  
      /* blow up the fuel */
      switch (engine) {
  	case 0: case 1: case 2: case 3:		/* electric */
--- 475,493 ----
      for (i = victim->num_weapons; i-- > 0;) {
  	Weapon *w;
  	int j;
  
  	w = &victim->weapon[i];
! 
! 	if (w->type == SELF_D) /* Ellis' SELF_D */
! 	    for (j = 12; j-- > 0;)
! 		make_bullet((Vehicle *) NULL, loc, HCANNON, rnd_interval(-PI, PI));
! 
! 	if (w->type != LASER && w->type != SELF_D) /* Ellis' SELF_D */
! 	    for (j = rnd(w->ammo / 30 + 1); j-- > 0;)
! 		make_bullet((Vehicle *) NULL, loc, w->type, rnd_interval(-PI, PI));
! 	    /* perhaps we should have turned some SLICK into FLAME? */
      }
  
      /* blow up the fuel */
      switch (engine) {
  	case 0: case 1: case 2: case 3:		/* electric */
Organization: Carnegie Mellon, Pittsburgh, PA