SHIP.C 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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/ship.c $
  15. * $Revision: 1.2 $
  16. * $Author: yuan $
  17. * $Date: 1994/03/01 18:12:37 $
  18. *
  19. * Functions to affect the ship.
  20. *
  21. * $Log: ship.c $
  22. * Revision 1.2 1994/03/01 18:12:37 yuan
  23. * Wallswitches, triggers, and more!
  24. *
  25. * Revision 1.1 1994/02/25 15:51:53 yuan
  26. * Initial revision
  27. *
  28. *
  29. */
  30. #pragma off (unreferenced)
  31. static char rcsid[] = "$Id: ship.c 1.2 1994/03/01 18:12:37 yuan Exp $";
  32. #pragma on (unreferenced)
  33. #include "inferno.h"
  34. #include "game.h"
  35. void ship_damage(fix damage)
  36. {
  37. Player_stats.shields -= damage;
  38. }
  39. void ship_repair(fix damage)
  40. {
  41. Player_stats.shields += damage;
  42. }
  43. void ship_repair_full()
  44. {
  45. Player_stats.shields = INITIAL_SHIELDS;
  46. }
  47. void ship_energy_full()
  48. {
  49. Player_stats.energy = INITIAL_ENERGY;
  50. }
  51. void ship_energy_drain(fix damage)
  52. {
  53. Player_stats.energy -= damage;
  54. }
  55. void ship_energy_empty()
  56. {
  57. Player_stats.energy = 0;
  58. }
  59.