home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / garage.c < prev    next >
Text File  |  1998-06-08  |  4KB  |  127 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/rcs/garage.c $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:30:32 $
  18.  * 
  19.  * .
  20.  * 
  21.  * $Log: garage.c $
  22.  * Revision 2.0  1995/02/27  11:30:32  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.2  1994/08/17  16:50:28  john
  27.  * Added damaging fireballs, missiles.
  28.  * 
  29.  * Revision 1.1  1994/08/16  12:45:12  john
  30.  * Initial revision
  31.  * 
  32.  * 
  33.  */
  34.  
  35.  
  36. #pragma off (unreferenced)
  37. static char rcsid[] = "$Id: garage.c 2.0 1995/02/27 11:30:32 john Exp $";
  38. #pragma on (unreferenced)
  39.  
  40. #include <i86.h>
  41. #include <dos.h>
  42. #include <stdio.h>
  43. #include <string.h>
  44. #include <malloc.h>
  45. #include <stdlib.h>
  46. #include <conio.h>
  47.  
  48. #include "types.h"
  49. #include "args.h"
  50. #include "timer.h"
  51. #include "mono.h"
  52. #include "ipx.h"
  53. #include "newmenu.h"
  54. #include "key.h"
  55. #include "gauges.h"
  56. #include "object.h"
  57. #include "error.h"
  58. #include "lzw.h"
  59. #include "netmisc.h"
  60. #include "laser.h"
  61. #include "gamesave.h"
  62. #include "gamemine.h"
  63. #include "player.h"
  64. #include "gameseq.h"
  65. #include "fireball.h"
  66.  
  67. void garage_tweak_ship()
  68. {
  69.     int r;
  70.     newmenu_item m[20];
  71.     char mass[10],drag[10];
  72.     char low_thrust[10],high_thrust[10],reverse_thrust[10];
  73.     char rot_speed[10];        //arbitary units
  74.  
  75.     sprintf( mass, "%.1f", f2fl(Player_ship->mass) );
  76.     sprintf( drag, "%.1f", f2fl(Player_ship->drag) );
  77.     sprintf( low_thrust, "%.1f", f2fl(Player_ship->low_thrust) );
  78.     sprintf( high_thrust, "%.1f", f2fl(Player_ship->high_thrust) );
  79.     sprintf( reverse_thrust, "%.1f", f2fl(Player_ship->reverse_thrust) );
  80.     sprintf( rot_speed, "%d", Player_ship->rot_speed );
  81.     
  82.     m[0].type=NM_TYPE_TEXT; m[0].text = "Mass (Default:4.0)"; 
  83.     m[1].type=NM_TYPE_INPUT; m[1].text = mass; m[1].text_len = 10;
  84.  
  85.     m[2].type=NM_TYPE_TEXT; m[2].text = "Drag (Default:2.0)"; 
  86.     m[3].type=NM_TYPE_INPUT; m[3].text = drag; m[3].text_len = 10;
  87.  
  88.     m[4].type=NM_TYPE_TEXT; m[4].text = "Low thrust (Default:200.0)"; 
  89.     m[5].type=NM_TYPE_INPUT; m[5].text = low_thrust; m[5].text_len = 10;
  90.  
  91.     m[6].type=NM_TYPE_TEXT; m[6].text = "High thrust (Default:500.0)"; 
  92.     m[7].type=NM_TYPE_INPUT; m[7].text = high_thrust; m[7].text_len = 10;
  93.  
  94.     m[8].type=NM_TYPE_TEXT; m[8].text = "Reverse thrust (Default:300.0)"; 
  95.     m[9].type=NM_TYPE_INPUT; m[9].text = reverse_thrust; m[9].text_len = 10;
  96.  
  97.     m[10].type=NM_TYPE_TEXT; m[10].text = "Rotation speed (Default:20)"; 
  98.     m[11].type=NM_TYPE_INPUT; m[11].text = rot_speed; m[11].text_len = 10;
  99.  
  100.     r = newmenu_do( "Garage", NULL, 12, m, NULL );
  101.  
  102.     if ( r < 0 ) return;
  103.  
  104.     Player_ship->mass = fl2f(atof(mass));
  105.     Player_ship->drag = fl2f(atof(drag));
  106.     Player_ship->low_thrust = fl2f(atof(low_thrust));
  107.     Player_ship->high_thrust = fl2f(atof(high_thrust));
  108.     Player_ship->reverse_thrust = fl2f(atof(reverse_thrust));
  109.     Player_ship->rot_speed = (int)atof(rot_speed);
  110.  
  111. }
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. 
  127.