Toolkit.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /*
  2. ** Command & Conquer Renegade(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. /******************************************************************************
  19. *
  20. * FILE
  21. * Toolkit.h
  22. *
  23. * DESCRIPTION
  24. * Designer Common Toolkit for Mission Construction
  25. *
  26. * PROGRAMMER
  27. * Design Team
  28. *
  29. * VERSION INFO
  30. * $Author: Dan_e $
  31. * $Revision: 79 $
  32. * $Modtime: 12/07/01 1:18p $
  33. * $Archive: /Commando/Code/Scripts/Toolkit.h $
  34. *
  35. ******************************************************************************/
  36. #ifndef _TOOLKIT_H_
  37. #define _TOOLKIT_H_
  38. // Defines and Includes
  39. #define SCRIPT_DEBUG_MESSAGE( X )
  40. /*
  41. #ifdef WWDEBUG
  42. #define SCRIPT_DEBUG_MESSAGE( X ) if (debug_mode) { Commands->Debug_Message X ; }
  43. #else
  44. #define SCRIPT_DEBUG_MESSAGE( X )
  45. #endif
  46. */
  47. #ifdef WWDEBUG
  48. #define NULL_POINTER_CHECK( X ) (if (X == NULL) { Commands->Debug_Message("***NULL pointer found in script: Line %d of file %s.\n", __LINE__, __FILE__); })
  49. #else
  50. #define NULL_POINTER_CHECK( X )
  51. #endif
  52. #ifdef WWDEBUG
  53. #define DISPLAY_VECTOR3( V ) Commands->Debug_Message("Value of '%s' is (%3.2f, %3.2f, %3.2f) at line %d of file %s.\n", #V, V.X, V.Y, V.Z, __LINE__, __FILE__)
  54. #else
  55. #define DISPLAY_VECTOR3( V )
  56. #endif
  57. #define STAR (Commands->Get_A_Star(Commands->Get_Position(Owner())))
  58. #define DIFFICULTY (Commands->Get_Difficulty_Level())
  59. #define MAX3( a, b, c ) (WWMath::Max(WWMath::Max(a, b), WWMath::Max(b, c)))
  60. #include "customevents.h"
  61. #include "scripts.h"
  62. #include "dprint.h"
  63. #include "vector3.h"
  64. #include "wwmath.h"
  65. #include <string.h>
  66. #include <assert.h>
  67. #include <stdio.h>
  68. #include <time.h>
  69. #define M00_BROADCASTER_TERMINAL_SIZE_RAD 100
  70. #define M00_BROADCASTER_TERMINAL_PROMPT_SIZE_RAD 10
  71. #define M00_SIEGE_GROUP_MAXIMUM 10
  72. #define M00_SIEGE_ZONES_MAXIMUM 10
  73. // Innate Priority Levels
  74. #define INNATE_PRIORITY_IDLE 10
  75. #define INNATE_PRIORITY_FOOTSTEPS_HEARD 50 //30
  76. #define INNATE_PRIORITY_CONVERSATION 40
  77. #define INNATE_PRIORITY_BULLET_HEARD 50
  78. #define INNATE_PRIORITY_GUNSHOT_HEARD 50 //70
  79. #define INNATE_PRIORITY_ENEMY_SEEN 90
  80. // Movement Speeds
  81. #define RUN .8f
  82. #define WALK .3f
  83. #define CROUCH .1f
  84. // Secondary Pog Delay
  85. #define SECONDARY_POG_DELAY 15.0f
  86. //Designer Sound Types
  87. #define M00_SOUND_SIEGE_ZONE 1000
  88. #define M03_SOUND_VOLCANO 1001
  89. #define M00_SOUND_ENGINEER_WANDER 1002
  90. #define M03_SOUND_BUNKER_OCCUPY 1003
  91. #define M00_SOUND_ENGINEER_WANDER_EMERGENCY 1004
  92. #define M00_SOUND_BUILDING_DESTROYED 100000
  93. #define M00_SOUND_ALWAYS_RUN 1005
  94. #define M00_SOUND_ALWAYS_RUN_OFF 1006
  95. #define M00_CUSTOM_CAMERA_ALARM 1007
  96. #define M00_CUSTOM_SAM_SITE_IGNORE 100008
  97. // Toolkit Timer Enumerations
  98. enum
  99. {
  100. TOOLKIT_TIMER_START = STIMER_TOOLKIT, // 9900
  101. M00_TIMER_SOUND_PLAY_2D_RAD, // 9901
  102. M00_TIMER_SOUND_PLAY_3D_RAD, // 9902
  103. M00_TIMER_SOUND_PLAY_3D_ON_OBJECT_RAD, // 9903
  104. M00_TIMER_DROP_OBJECT_RMV, // 9904
  105. M00_TIMER_SIEGE_ACTOR_CHECK, // 9905
  106. M00_TIMER_TRIGGER_EXPIRED, // 9906
  107. M00_TIMER_SIEGE_ZONE // 9907
  108. };
  109. // Toolkit Custom Enumerations
  110. enum
  111. {
  112. M00_CUSTOM_TRIGGER_ACTIVATE_ALL = 9000, // 0
  113. M00_CUSTOM_TRIGGER_ACTIVATE_KILLED, // 1
  114. M00_CUSTOM_TRIGGER_ACTIVATE_DESTROYED, // 2
  115. M00_CUSTOM_TRIGGER_ACTIVATE_ZONE_ENTERED, // 3
  116. M00_CUSTOM_TRIGGER_ACTIVATE_ZONE_EXITED, // 4
  117. M00_CUSTOM_TRIGGER_ACTIVATE_ZONE_ENTERED_OR_EXITED, // 5
  118. M00_CUSTOM_TRIGGER_ACTIVATE_ENEMY_SEEN, // 6
  119. M00_CUSTOM_TRIGGER_ACTIVATE_DAMAGED, // 7
  120. M00_CUSTOM_TRIGGER_ACTIVATE_ACTION_COMPLETE, // 8
  121. M00_CUSTOM_TRIGGER_ACTIVATE_ANIMATION_COMPLETE, // 9
  122. M00_CUSTOM_BROADCASTER_REGISTRATION, // 10
  123. M00_CUSTOM_BROADCASTER_PROMPTER, // 11
  124. M00_CUSTOM_BROADCASTER_REGISTRY_ERROR, // 12
  125. M00_CUSTOM_ANIMATION_DROP_OBJECT, // 13
  126. M00_CUSTOM_ACTION_RECEIVE_TYPE_DEFAULT, // 14
  127. M00_CUSTOM_TRIGGER_TIMER_EXPIRED, // 15
  128. M00_CUSTOM_SIEGE_ACTOR_GROUP_CHECK, // 16
  129. M00_CUSTOM_SIEGE_ZONE_VERIFICATION, // 17
  130. M00_CUSTOM_SIEGE_ACTOR_IS_DEAD, // 18
  131. M00_CUSTOM_SIEGE_ZONE_CHECKING_ACTOR, // 19
  132. M00_CUSTOM_SIEGE_ACTOR_RESPONDING, // 20
  133. M00_CUSTOM_SIEGE_ACTOR_UNREGISTER, // 21
  134. M00_CUSTOM_SIEGE_OBJECT_GROUP_CHANGE, // 22
  135. M00_CUSTOM_CINEMATIC_PRIMARY_KILLED, // 23
  136. M00_CUSTOM_POWERUP_GRANT_DISABLE, // 24
  137. M00_CUSTOM_OBJECT_ATTACHED_PRIMARY, // 25
  138. M00_CUSTOM_SOUND_BUILDING, // 26
  139. M00_CUSTOM_BUILDING_EXPLODE, // 27
  140. M00_CUSTOM_BUILDING_EXPLODE_NO, // 28
  141. M00_CUSTOM_BUILDING_EXPLODE_YES, // 29
  142. M00_CUSTOM_PLAY_BUILDING_SOUND, // 30
  143. M00_CREATE_RANDOM_EXPLOSION, // 31
  144. M00_SELECT_EMPTY_HANDS, // 32
  145. M00_OBELISK_WEAPON_ID, // 33
  146. M00_LAUNCH_SSM, // 34
  147. M00_SEND_OBJECT_ID, // 35
  148. M00_LOITER_ENABLE_TOGGLE, // 36
  149. M00_ENABLE_DAMAGE_MOD, // 37
  150. // This type and the next 20+ are used to set a slot in a cinematic script to an ID
  151. M00_CUSTOM_CINEMATIC_SET_SLOT = 10000, // 10000
  152. };
  153. inline int Get_Int_Random(int min, int max)
  154. {
  155. float random;
  156. int d_random;
  157. random = Commands->Get_Random(float(min), float(max)+1.0f-WWMATH_EPSILON);
  158. d_random = int(random);
  159. d_random = (d_random > max) ? max : d_random;
  160. return d_random;
  161. }
  162. // Vector 3 Color definitions for use with Text messages
  163. #define TEXT_COLOR_OBJECTIVE_PRIMARY Vector3 ( .196f, .882f, .196f)
  164. #define TEXT_COLOR_OBJECTIVE_SECONDARY Vector3 ( .196f, .588f, .980f)
  165. #define TEXT_COLOR_OBJECTIVE_TERTIARY Vector3 ( .588f, .196f, .588f)
  166. #define TEXT_COLOR_PLAYERTYPE_GDI Vector3 ( .882f, .686f, .255f)
  167. #define TEXT_COLOR_PLAYERTYPE_NOD Vector3 ( .784f, 0.0f, 0.0f)
  168. #define TEXT_COLOR_PLAYERTYPE_NEUTRAL Vector3 ( .882f, .882f, .941f)
  169. #define TEXT_COLOR_PLAYERTYPE_MUTANT Vector3 ( 0.0f, .392f, 0.0f)
  170. #define TEXT_COLOR_WHITE Vector3 ( 1.0f, 1.0f, 1.0f)
  171. #define TEXT_COLOR_YELLOW Vector3 ( 1.0f, 1.0f, 0.0f)
  172. #endif // _TOOLKIT_H_