Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
dp88_misc.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12
13#pragma once
14
15#include "scripts.h"
16#include "engine.h"
17#include "LoopedAnimationController.h"
18
19
20
21/*------------------------
22Random weather script
23--------------------------*/
24
108class dp88_randomWeather : public ScriptImpClass
109{
110 void Created ( GameObject* obj );
111 void Timer_Expired ( GameObject* obj, int number );
112};
113
114
115
116
117
118/*------------------------
119Unit sounds script
120--------------------------*/
121
122class dp88_unitSounds : public ScriptImpClass
123{
124 void Created ( GameObject* obj );
125 void Damaged( GameObject *obj, GameObject *damager, float amount );
126 void Killed ( GameObject *obj, GameObject *killer );
127 void Timer_Expired ( GameObject* obj, int number );
128 void Custom ( GameObject* obj, int type, int param, GameObject* sender );
129
130 // Enabled states
131 bool damagedEnabled;
132 bool heavilyDamagedEnabled;
133 bool healedEnabled;
134 bool fallingDamageEnabled;
135
136 // Counters
137 int healAmount;
138};
139
140
141
142/*------------------------
143Unique Infantry Controller
144--------------------------*/
145
146class dp88_uniqueInfantry_controller : public JFW_Object_Created_Hook_Base
147{
148 void Created ( GameObject* obj );
149 void ObjectCreateHook ( GameObject* obj );
150 void Destroyed ( GameObject* obj );
151
152 char* infantry_preset;
153 int team_id;
154 int max_count;
155 int percent_chance;
156};
157
158
159
266class dp88_damageAnimation : public ScriptImpClass
267{
268 void Created ( GameObject* obj );
269 void Detach ( GameObject* obj );
270 void Damaged( GameObject *obj, GameObject *damager, float amount );
271 void Timer_Expired ( GameObject* obj, int number );
272
273 void SetDamageAnimation ( GameObject* obj );
274
275 int currentDamageLevel;
276 bool basePowerState;
277 bool m_bIsDestroyed;
278
281 int damageLevelBoundaries[6];
282 int damageLevelStartFrames[6];
283 int damageLevelEndFrames[6];
284 int damageLevelLowPowerStartFrames[6];
285 int damageLevelLowPowerEndFrames[6];
286 bool loopAnimation;
287 bool m_bUseDestroyedMode;
289protected:
290 LoopedAnimationController* m_pLoopedAnimCtrl;
291public:
292 dp88_damageAnimation() : m_pLoopedAnimCtrl(0) {}
293};
294
295
296
297/*------------------------
298Object Annoucements script
299--------------------------*/
300
301class dp88_objectAnnouncements : public ScriptImpClass
302{
303 void Created ( GameObject* obj );
304 void Damaged ( GameObject *obj, GameObject *damager, float amount );
305 void Killed ( GameObject *obj, GameObject *killer );
306
307 time_t lastAnnouncementTime;
308 int minimumAnnounceInterval;
309
310 unsigned long team0_underAttackStringId;
311 unsigned long team1_underAttackStringId;
312 unsigned long team0_destroyedStringId;
313 unsigned long team1_destroyedStringId;
314
315 unsigned long team0_underAttackSoundId;
316 unsigned long team1_underAttackSoundId;
317 unsigned long team0_destroyedSoundId;
318 unsigned long team1_destroyedSoundId;
319};
320
321
322
323
324
325/*------------------------
326Chrono Tank Script
327--------------------------*/
328
329class dp88_chronoTank : public JFW_Key_Hook_Base
330{
331 void Created ( GameObject* obj );
332 void Killed ( GameObject *obj, GameObject *killer );
333 void Custom( GameObject *obj, int type, int param, GameObject *sender );
334 void Timer_Expired ( GameObject* obj, int number );
335 void KeyHook();
336
337 void Shift_Out_Begin(GameObject* obj);
338 void Shift_Out_Complete(GameObject* obj);
339 void Shift_Out_Cleanup(GameObject* obj);
340 void Shift_In_Begin(GameObject* obj);
341 void Shift_In_Complete(GameObject* obj);
342 void Shift_In_Cleanup(GameObject* obj);
343
344 int state;
345 int object_id; // For KeyHook (obj is not provided)
346 int driver_id;
347 int shifted_vehicle_object_id;
348
349private:
350 // Define states
351 enum CT_STATES
352 {
353 CT_STATE_CHARGING,
354 CT_STATE_CHARGED,
355 CT_STATE_SHIFTING_OUT,
356 CT_STATE_SHIFTED_OUT_PENDING_CLEANUP_1,
357 CT_STATE_SHIFTED_OUT_PENDING_CLEANUP_2,
358 CT_STATE_SHIFTED_OUT,
359 CT_STATE_SHIFTING_IN,
360 CT_STATE_SHIFTED_IN_PENDING_CLEANUP_1,
361 CT_STATE_SHIFTED_IN_PENDING_CLEANUP_2
362 };
363};
364
365
366
367/*------------------------
368Spawn Vehicle Part script
369--------------------------*/
370
371class dp88_spawnVehiclePart : public ScriptImpClass
372{
373 void Created ( GameObject* obj );
374 void Timer_Expired( GameObject *obj, int number );
375 void Killed ( GameObject* obj, GameObject *killer );
376 void Destroyed( GameObject* obj );
377
378 int partObjectId;
379};
380
381
382
409class dp88_customPoints : public ScriptImpClass
410{
411protected:
412 void Created ( GameObject* obj );
413 void Damaged ( GameObject *obj, GameObject *damager, float amount );
414 void Killed ( GameObject* obj, GameObject *killer );
415
416 void GivePointsAndMoney ( GameObject* obj, float points, float money );
417
420 float m_killPoints;
421 float m_damagePoints;
422 float m_repairPoints;
423 float m_killMoney;
424 float m_damageMoney;
425 float m_repairMoney;
427};
428
429class dp88_customPointsPercentage : public ScriptImpClass
430{
431protected:
432 void Created(GameObject* obj);
433 void Damaged(GameObject *obj, GameObject *damager, float amount);
434 void Killed(GameObject* obj, GameObject *killer);
435
436 void GivePointsAndMoney(GameObject* obj, float points, float money);
437
438 float m_killPoints;
439 float m_damagePoints;
440 float m_repairPoints;
441 float m_killMoney;
442 float m_damageMoney;
443 float m_repairMoney;
444};
445
446// -------------------------------------------------------------------------------------------------
447
515class dp88_conquestController : public ScriptImpClass
516{
517 void Created ( GameObject* pSelf );
518 void Destroyed ( GameObject* pSelf );
519 void Timer_Expired ( GameObject* pSelf, int number );
520 void Custom ( GameObject* pSelf, int type, int param, GameObject* pSender );
521
522 int GetWinningTeamID();
523 int GetLosingTeamID();
524
525 void DisplayMessage(StringClass message);
526
527protected:
533 static const unsigned char MODE_DEFAULT = 0;
534 static const unsigned char MODE_DEDUCTION = 1;
536
537 unsigned char m_scoringMode;
538 int m_points[2];
539 int m_targets[2];
541private:
542 int m_objectCreateHookId;
543};
544
545// -------------------------------------------------------------------------------------------------
546
669class dp88_conquestControlZone : public ScriptImpClass
670{
671public:
672 void Created( GameObject* pObj );
673 void Timer_Expired( GameObject* pObj, int number );
674
675protected:
676 void IncrementCaptureProgress( GameObject* pObj, int team, int nPlayers );
677 void UpdateAnimationFrame( GameObject* pObj );
678
682 void ChangeOwner(GameObject* pObj, int team);
683
684 void DisplayMessage(GameObject* pObj, StringClass message, int sendtoteam = 2);
685
694 int m_captureTime;
695 int m_multiCaptureCap;
696 float m_multiCaptureMultiplier;
697 bool m_bAllowMajorityCapture;
698 int m_nAnimTransitionFrames;
699
700 int m_aiPriority_soldier;
701 int m_aiPriority_lvehicle;
702 int m_aiPriority_hvehicle;
703 int m_aiPriority_aircraft;
705};
706
707// -------------------------------------------------------------------------------------------------
708
727class dp88_conquestControlObject : public ScriptImpClass
728{
729public:
730 void Created( GameObject* pObj );
731 void Timer_Expired( GameObject* pObj, int number );
732
733protected:
735};
736
737// -------------------------------------------------------------------------------------------------
738
748class dp88_radarInvisibility : public ScriptImpClass
749{
750public:
753
754protected:
755 void Created ( GameObject* pObj );
756 void Custom ( GameObject* pObj, int type, int param, GameObject* pSender );
757 void Detach ( GameObject* pObj );
758
759 void HidePassengerBlip ( class VehicleGameObj* pVehicle, class SoldierGameObj* pSoldier );
760 void RestorePassengerBlip ( class SoldierGameObj* pSoldier );
761
766};
767
768// -------------------------------------------------------------------------------------------------
769
789class dp88_turretSound : public ScriptImpClass
790{
791protected:
792 void Created ( GameObject* pObj );
793 void Timer_Expired ( GameObject* pObj, int number );
794 void Custom ( GameObject* pObj, int type, int param, GameObject* pSender );
795
796 float Get_Turret_Facing ( class RenderObjClass* pRenderObj );
797 void Play_Sound ( GameObject* pObj );
798 void Stop_Sound ( GameObject* pObj );
799
800 float m_lastFacing;
801 int m_nSoundId;
802
805 float m_nMinDifferential;
807};
808
809// -------------------------------------------------------------------------------------------------
810
838class dp88_teleport : public ScriptImpClass
839{
840protected:
841 void Created ( GameObject* pObj );
842 void Entered ( GameObject* pObj, GameObject* pEnterer );
843 void Custom ( GameObject* pObj, int type, int param, GameObject* pSender );
844 void Poked ( GameObject* pObj, GameObject* pPoker );
845
848 int m_nObjectID;
849 bool m_bUseBone;
850 Vector3 m_offset;
851
852 bool m_bTeleportInfantry;
853 bool m_bTeleportVehicles;
855};
856
857// -------------------------------------------------------------------------------------------------
858
886class dp88_Ammo_Animation : public ScriptImpClass
887{
888public:
889 void Created ( GameObject* pObj );
890 void Timer_Expired ( GameObject* pObj, int number );
891
892protected:
893 void UpdateAnimationFrame ( GameObject* pObj );
894
895 int m_nBullets;
896
899
902 const char* m_strAnimation;
903 int m_nFrames;
904 bool m_bUseTotal;
906};
907
908// -------------------------------------------------------------------------------------------------
909
926class dp88_Camo_Controller : public ScriptImpClass
927{
928public:
929 virtual void Created ( GameObject* pObj );
930
931 const char* GetCamoVariant() const { return m_camoVariant; };
932
933protected:
934 const char* m_camoVariant;
935};
936
937// -------------------------------------------------------------------------------------------------
938
957class dp88_Camo_Object : public ScriptImpClass
958{
959public:
960 virtual void Created ( GameObject* pObj );
961};
962
963// -------------------------------------------------------------------------------------------------
964
997class dp88_Create_Object_Cinematic: public ScriptImpClass
998{
999public:
1000 void Created ( GameObject* pObj );
1001 void Custom ( GameObject* pObj, int type, int param, GameObject* pSender );
1002
1003protected:
1004 void Create_Object ( GameObject* pobj, GameObject* pOwner );
1005};
1006
1007// -------------------------------------------------------------------------------------------------
1008
1029class dp88_Set_Team_On_Custom : public ScriptImpClass
1030{
1031public:
1032 void Custom ( GameObject* pObj, int type, int param, GameObject* pSender );
1033};
1034
1035// -------------------------------------------------------------------------------------------------
1036
1113class dp88_RegenerateHitpoints : public ScriptImpClass
1114{
1115protected:
1116 const static int MODE_HEALTH = 1;
1117 const static int MODE_ARMOUR = 2;
1118 const static int MODE_PILOTED_HEALTH = 4;
1119 const static int MODE_PILOTED_ARMOUR = 8;
1120 const static int MODE_OCCUPIED_HEALTH = 16;
1121 const static int MODE_OCCUPIED_ARMOUR = 32;
1122 const static int MODE_DRIVER_HEALTH = 64;
1123 const static int MODE_DRIVER_ARMOUR = 128;
1124 const static int MODE_PASSENGERS_HEALTH = 256;
1125 const static int MODE_PASSENGERS_ARMOUR = 512;
1126
1127public:
1128 void Created( GameObject *obj );
1129 void Timer_Expired( GameObject *obj, int number );
1130 void Damaged ( GameObject *obj, GameObject *damager, float amount );
1131 void Custom( GameObject *obj, int type, int param, GameObject *sender );
1132
1133protected:
1134 bool IsModeEnabled(int mode);
1135 void RegenObject(GameObject* obj, bool bHealth, bool bArmour);
1136 void ApplyNonWarheadRepairs(GameObject* obj, float amount, bool bHealth, bool bArmour);
1137
1138private:
1140 time_t m_lastDamage;
1141
1144 int m_mode;
1145 float m_amount;
1146 float m_interval;
1147 float m_maxPercent;
1148 int m_warheadId;
1149 int m_lastDamageTimeout;
1151};
1152
1153// -------------------------------------------------------------------------------------------------
1154
1191class dp88_CreateAttachedObject : public ScriptImpClass
1192{
1193 void Created(GameObject* obj);
1194 void Killed(GameObject* obj, GameObject *killer);
1195 void Custom(GameObject *obj, int type, int param, GameObject *sender);
1196
1197 int m_spawnedObjectId;
1198 bool m_hasDriver;
1199};
1200
1201// -------------------------------------------------------------------------------------------------
1202// Dynamic spawn system
1203// -------------------------------------------------------------------------------------------------
1204
1247{};
1248
1249// -------------------------------------------------------------------------------------------------
1250
1273class dp88_DynamicSpawner_Spawner : ScriptImpClass
1274{};
1275
1276// -------------------------------------------------------------------------------------------------
1277
1315{};
Controller for looped animations using a subset of frames.
Definition LoopedAnimationController.h:31
Vehicle Ammo Animation.
Definition dp88_misc.h:887
int m_ammoAnimObjId
Definition dp88_misc.h:898
Camo Controller.
Definition dp88_misc.h:927
Camo Object.
Definition dp88_misc.h:958
Create Object With Cinematic.
Definition dp88_misc.h:998
Create Attached Object.
Definition dp88_misc.h:1192
Dynamic Spawner - Controller.
Definition dp88_misc.h:1247
Dynamic Spawner - Simple Spawner.
Definition dp88_misc.h:1274
Dynamic Spawner - Vehicle Spawner.
Definition dp88_misc.h:1315
Health Regeneration.
Definition dp88_misc.h:1114
Set Team On Custom.
Definition dp88_misc.h:1030
Conquest Mode - Control Object.
Definition dp88_misc.h:728
int m_controllerID
Definition dp88_misc.h:734
Conquest Mode - Control Zone.
Definition dp88_misc.h:670
void ChangeOwner(GameObject *pObj, int team)
Definition dp88_misc.cpp:1768
int m_zoneID
Definition dp88_misc.h:687
float m_captureState
Definition dp88_misc.h:688
bool m_bTickRunning
Definition dp88_misc.h:690
int m_controllerID
Definition dp88_misc.h:686
Conquest Mode - Controller.
Definition dp88_misc.h:516
static const unsigned char MODE_DEDUCTION
Definition dp88_misc.h:534
unsigned char m_scoringMode
Definition dp88_misc.h:537
static const unsigned char MODE_DEFAULT
Definition dp88_misc.h:533
int m_targets[2]
Definition dp88_misc.h:539
int m_points[2]
Definition dp88_misc.h:538
Custom Unit Points & Credits.
Definition dp88_misc.h:410
Damage animation script.
Definition dp88_misc.h:267
Radar Invisibility.
Definition dp88_misc.h:749
dp88_radarInvisibility()
Definition dp88_misc.h:752
int m_originalRadarMode
The original radar mode of this object.
Definition dp88_misc.h:762
int * m_pPassengerRadarModes
For vehicles, the original radar mode of each passenger.
Definition dp88_misc.h:764
int * m_pPassengerIds
For vehicles, the ID of each passenger.
Definition dp88_misc.h:763
int m_nSeats
For vehicles, cache the number of seats (for Detach() to use)
Definition dp88_misc.h:765
Weather Randomizer.
Definition dp88_misc.h:109
Yet Another Teleport Script.
Definition dp88_misc.h:839
Turret Rotation Sound Effect.
Definition dp88_misc.h:790