SUPER.H 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: /CounterStrike/SUPER.H 1 3/03/97 10:25a Joe_bostic $ */
  15. /***********************************************************************************************
  16. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : SUPER.H *
  22. * *
  23. * Programmer : Joe L. Bostic *
  24. * *
  25. * Start Date : 07/28/95 *
  26. * *
  27. * Last Update : July 28, 1995 [JLB] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef SUPER_H
  33. #define SUPER_H
  34. #include "ftimer.h"
  35. class SuperClass {
  36. public:
  37. SuperClass(NoInitClass const & x) : Control(x) {};
  38. SuperClass(void) : Control(NoInitClass()) {};
  39. SuperClass(int recharge, bool powered, VoxType charging=VOX_NONE, VoxType ready=VOX_NONE, VoxType impatient=VOX_NONE, VoxType suspend=VOX_NONE);
  40. bool Suspend(bool on);
  41. bool Enable(bool onetime = false, bool player=false, bool quiet=false);
  42. void Forced_Charge(bool player=false);
  43. bool AI(bool player=false);
  44. bool Remove(bool forced=false);
  45. void Impatient_Click(void) const;
  46. int Anim_Stage(void) const;
  47. bool Discharged(bool player);
  48. bool Is_Ready(void) const {return(IsReady);}
  49. bool Is_Present(void) const {return(IsPresent);}
  50. bool Is_One_Time(void) const {return(IsOneTime && IsPresent);}
  51. bool Is_Powered(void) const {return(IsPowered);}
  52. //Needed access to recharge times for tooltips - 2019/08/14 Jason Scott
  53. int Get_Recharge_Time() const { return(RechargeTime); };
  54. private:
  55. bool Recharge(bool player=false);
  56. unsigned IsPowered:1;
  57. unsigned IsPresent:1;
  58. unsigned IsOneTime:1;
  59. unsigned IsReady:1;
  60. CDTimerClass<FrameTimerClass> Control;
  61. int OldStage;
  62. VoxType VoxRecharge;
  63. VoxType VoxCharging;
  64. VoxType VoxImpatient;
  65. VoxType VoxSuspend;
  66. int RechargeTime;
  67. //Needed to make ANIMATION_STAGES public so the animation frame numbers could be turned into progress
  68. //percentages - 2019/08/07 Jason Scott
  69. public:
  70. enum {
  71. ANIMATION_STAGES=54
  72. };
  73. };
  74. #endif