SCORE.H 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. ** Command & Conquer(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $Header: F:\projects\c&c\vcs\code\score.h_v 2.18 16 Oct 1995 16:46:18 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : SCORE.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : April 19, 1994 *
  30. * *
  31. * Last Update : April 19, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef SCORE_H
  37. #define SCORE_H
  38. #include "unit.h"
  39. #include "building.h"
  40. class ScoreClass {
  41. public:
  42. int Score;
  43. int NKilled;
  44. int GKilled;
  45. int CKilled;
  46. int NBKilled;
  47. int GBKilled;
  48. int CBKilled;
  49. int NHarvested;
  50. int GHarvested;
  51. int CHarvested;
  52. unsigned long ElapsedTime;
  53. void Init(void) {memset(this, 0, sizeof(ScoreClass));};
  54. void Presentation(void);
  55. /*
  56. ** File I/O.
  57. */
  58. bool Load(FileClass & file);
  59. bool Save(FileClass & file);
  60. void Code_Pointers(void);
  61. void Decode_Pointers(void);
  62. protected:
  63. private:
  64. unsigned char *ChangingGun;
  65. void ScoreDelay(int ticks);
  66. void Pulse_Bar_Graph(void);
  67. void Print_Graph_Title(int,int);
  68. void Print_Minutes(int minutes);
  69. void Count_Up_Print(char *str, int percent, int max, int xpos, int ypos);
  70. void Show_Credits(int house, char const pal[]);
  71. void Do_GDI_Graph(void const * yellowptr, void const * redptr, int gdikilled, int nodkilled, int ypos);
  72. void Do_Nod_Casualties_Graph(void);
  73. void Do_Nod_Buildings_Graph(void);
  74. void Input_Name(char str[], int xpos, int ypos, char const pal[]);
  75. };
  76. class ScoreAnimClass {
  77. public:
  78. ScoreAnimClass(int x, int y, void const * data);
  79. int XPos;
  80. int YPos;
  81. CountDownTimerClass Timer;
  82. void const * DataPtr;
  83. virtual void Update(void) {} ;
  84. virtual ~ScoreAnimClass(void) {} ;
  85. };
  86. class ScoreCredsClass : public ScoreAnimClass {
  87. public:
  88. int Stage;
  89. int MaxStage;
  90. int TimerReset;
  91. void const * CashTurn;
  92. void const * Clock1;
  93. virtual void Update(void);
  94. ScoreCredsClass(int xpos, int ypos, void const * data, int max, int timer);
  95. virtual ~ScoreCredsClass(void) {};
  96. };
  97. class ScoreTimeClass : public ScoreAnimClass {
  98. public:
  99. int Stage;
  100. int MaxStage;
  101. int TimerReset;
  102. virtual void Update(void);
  103. ScoreTimeClass(int xpos, int ypos, void const * data, int max, int timer);
  104. virtual ~ScoreTimeClass(void) {};
  105. };
  106. class ScorePrintClass : public ScoreAnimClass {
  107. public:
  108. int Background;
  109. int Stage;
  110. void const * PrimaryPalette;
  111. virtual void Update(void);
  112. ScorePrintClass(void const * string, int xpos, int ypos, void const * palette, int background=TBLACK);
  113. ScorePrintClass( int string, int xpos, int ypos, void const * palette, int background=TBLACK);
  114. virtual ~ScorePrintClass(void) {};
  115. };
  116. class MultiStagePrintClass : public ScoreAnimClass {
  117. public:
  118. int Background;
  119. int Stage;
  120. void const * PrimaryPalette;
  121. virtual void Update(void);
  122. MultiStagePrintClass(void const * string, int xpos, int ypos, void const * palette, int background=TBLACK);
  123. MultiStagePrintClass( int string, int xpos, int ypos, void const * palette, int background=TBLACK);
  124. virtual ~MultiStagePrintClass(void) {};
  125. };
  126. class ScoreScaleClass : public ScoreAnimClass {
  127. public:
  128. int Stage;
  129. char const * Palette;
  130. virtual void Update(void);
  131. ScoreScaleClass(void const * data, int xpos, int ypos, char const pal[]);
  132. virtual ~ScoreScaleClass(void) {};
  133. };
  134. #define MAXSCOREOBJS 8
  135. extern ScoreAnimClass *ScoreObjs[MAXSCOREOBJS];
  136. void Multi_Score_Presentation(void);
  137. #endif