forked from whoopdedo/publicscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSS2Scripts.h
More file actions
895 lines (812 loc) · 24.3 KB
/
SS2Scripts.h
File metadata and controls
895 lines (812 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
/******************************************************************************
* SS2Scripts.h
*
* This file is part of Public Scripts
* Copyright (C) 2005-2011 Tom N Harris <telliamed@whoopdedo.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*****************************************************************************/
#ifndef SS2SCRIPTS_H
#define SS2SCRIPTS_H
#if (_DARKGAME == 3)
#ifndef SCR_GENSCRIPTS
#include <lg/config.h>
#include <lg/objstd.h>
#include <lg/scrservices.h>
#include <lg/links.h>
#include "BaseScript.h"
#include "BaseTrap.h"
#include "CommonScripts.h"
#include "scriptvars.h"
#endif // SCR_GENSCRIPTS
/**
* Script: NotifyRegion
* Inherits: BaseScript
* Messages: Slain, Obituary
* Links: ScriptParams(Population)
*
* Sends an ``Obituary`` message when slain. The message is sent to
* objects that link to this one with a ``ScriptParams`` link that has
* the data set to $$Population$$. OBB and room scripts create the link
* so they can be notified when a creature dies.
*
* This script should be in a metaproperty named ``M-NotifyRegion``
* which will be added to creatures that enter the room or OBB.
*/
#if !SCR_GENSCRIPTS
class cScr_NotifyRegion : public cBaseScript
{
public:
cScr_NotifyRegion(const char* pszName, int iHostObjId)
: cBaseScript(pszName, iHostObjId)
{ }
private:
static int LinkIter(ILinkSrv*, ILinkQuery*, IScript*, void*);
protected:
virtual long OnSlain(sSlayMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("NotifyRegion","BaseScript",cScr_NotifyRegion)
#endif // SCR_GENSCRIPTS
/**
* Script: StdParticleGroup
* Inherits: BaseScript
* Messages: TurnOn, TurnOff, Die
* Properties: SFX\Particles
*
* Controls SFX particles. The object is destroyed when it gets the ``Die`` message.
*/
#if !SCR_GENSCRIPTS
class cScr_StdParticleGroup : public cBaseScript
{
public:
cScr_StdParticleGroup(const char* pszName, int iHostObjId)
: cBaseScript(pszName, iHostObjId)
{ }
protected:
virtual long OnTurnOn(sScrMsg*, cMultiParm&);
virtual long OnTurnOff(sScrMsg*, cMultiParm&);
virtual long OnMessage(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("StdParticleGroup","BaseScript",cScr_StdParticleGroup)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapCapacitor
* Inherits: BaseTrap
* Properties: Script\Delay Time
*
* Relays ``TurnOn`` and ``TurnOff``. When turned on, the trap will not relay
* any messages until the timer has expired. A message sent to the trap during
* the delay will be relayed after the time expires. Only the last message received
* is sent.
*
* This trap can be used to prevent an effect from turning off too quickly. It allows
* sounds or tweq animations to complete before the object is deactivated.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapCapacitor : public cBaseTrap
{
public:
cScr_TrapCapacitor(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnTimer(sScrTimerMsg*, cMultiParm& mpReply);
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapCapacitor","BaseTrap",cScr_TrapCapacitor)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapConverse
* Inherits: BaseTrap
* Links: AIConversationActor
* Properties: AI\Conversations\Conversation
*
* Starts a conversation when turned on. Turning off the trap does nothing.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapConverse : public cBaseTrap
{
public:
cScr_TrapConverse(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapConverse","BaseTrap",cScr_TrapConverse)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapPatrol
* Inherits: BaseTrap
* Links: SwitchLink
* Properties: AI\Ability Settings\Patrol: Does patrol
*
* Sets the ``Patrol: Does patrol`` property of objects linked with ``SwitchLink``.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapPatrol : public cBaseTrap
{
public:
cScr_TrapPatrol(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
private:
static int LinkIter(ILinkSrv*, ILinkQuery*, IScript*, void*);
protected:
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapPatrol","BaseTrap",cScr_TrapPatrol)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapRevert
* Inherits: BaseTrap
* Properties: Script\Delay Time
*
* Relays ``TurnOn`` and ``TurnOff``. After the time set in ``Script\Delay Time``,
* the opposite message will be sent.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapRevert : public cBaseTrap
{
public:
cScr_TrapRevert(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnTurnOff(sScrMsg*, cMultiParm&);
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapRevert","BaseTrap",cScr_TrapRevert)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapTexture
* Inherits: BaseTrap
* Properties: Engine Features\Retexture Radius
* Parameters: terrreplaceon(string), terrreplaceoff(string)
*
* Change the texture on nearby terrain.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapTexture : public cBaseTrap
{
public:
cScr_TrapTexture(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapTexture","BaseTrap",cScr_TrapTexture)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigAIAlert
* Inherits: BaseAIScript
* Messages: Alertness
* Links: SwitchLink
*
* Sends ``TurnOn`` when the AI goes to high alert.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigAIAlert : public cBaseAIScript
{
public:
cScr_TrigAIAlert(const char* pszName, int iHostObjId)
: cBaseAIScript(pszName, iHostObjId)
{ }
protected:
virtual long OnAlertness(sAIAlertnessMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigAIAlert","BaseAIScript",cScr_TrigAIAlert)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigWorldFrob
* Inherits: BaseTrap
* Messages: FrobWorldEnd
*
* Sends ``TurnOn`` when the object is frobbed.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigWorldFrob : public cBaseTrap
{
public:
cScr_TrigWorldFrob(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnFrobWorldEnd(sFrobMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigWorldFrob","BaseTrap",cScr_TrigWorldFrob)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigWorldFocus
* Inherits: BaseTrap
* Messages: WorldSelect, WorldDeSelect
*
* Sends ``TurnOn`` and ``TurnOff`` when the object is hilighted.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigWorldFocus : public cBaseTrap
{
public:
cScr_TrigWorldFocus(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnWorldSelect(sScrMsg*, cMultiParm&);
virtual long OnWorldDeSelect(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigWorldFocus","BaseTrap",cScr_TrigWorldFocus)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigInvFrob
* Inherits: BaseTrap
* Messages: FrobInvEnd
*
* Sends ``TurnOn`` when the object is frobbed in the player's inventory.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigInvFrob : public cBaseTrap
{
public:
cScr_TrigInvFrob(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnFrobInvEnd(sFrobMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigInvFrob","BaseTrap",cScr_TrigInvFrob)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigFlicker
* Inherits: BaseTrap
* Messages: TweqComplete
* Properties: Tweq\Flicker, Tweq\FlickerState
*
* Uses a flicker tweq to send alternate ``TurnOn`` and ``TurnOff`` messages.
* The tweq can be activated and deactivated by sending ``TurnOn`` and ``TurnOff``
* to the trap. ``TurnOff`` will always be the last message sent when the trap
* is deactivated.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigFlicker : public cBaseTrap
{
public:
cScr_TrigFlicker(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId),
SCRIPT_VAROBJ(cScr_TrigFlicker,m_iFlicker,iHostObjId),
SCRIPT_VAROBJ(cScr_TrigFlicker,m_hSafety,iHostObjId)
{ }
private:
script_int m_iFlicker;
script_handle<tScrTimer> m_hSafety;
void Blink(bool);
protected:
virtual long OnBeginScript(sScrMsg* pMsg, cMultiParm& mpReply)
{
m_iFlicker.Init(0);
m_hSafety.Init();
return cBaseTrap::OnBeginScript(pMsg, mpReply);
}
virtual long OnTweqComplete(sTweqMsg*, cMultiParm&);
virtual long OnTimer(sScrTimerMsg*, cMultiParm&);
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigFlicker","BaseTrap",cScr_TrigFlicker)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigUnlock
* Inherits: BaseScript
* Messages: NowLocked, NowUnlocked
* Links: SwitchLink
*
* Triggers when the object is locked and unlocked.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigUnlock : public cBaseScript
{
public:
cScr_TrigUnlock(const char* pszName, int iHostObjId)
: cBaseScript(pszName, iHostObjId)
{ }
protected:
virtual long OnNowLocked(sScrMsg*, cMultiParm&);
virtual long OnNowUnlocked(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigUnlock","BaseScript",cScr_TrigUnlock)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigPPlate
* Inherits: BasePPlateScript
* Messages: PressurePlateActive, PressurePlateInactive
* Links: SwitchLink
*
* A pressure plate that triggers when it stops moving.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigPPlate : public cBasePPlateScript
{
public:
cScr_TrigPPlate(const char* pszName, int iHostObjId)
: cBasePPlateScript(pszName, iHostObjId)
{ }
protected:
virtual long OnPressurePlateActive(sScrMsg*, cMultiParm&);
virtual long OnPressurePlateInactive(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigPPlate","BasePPlateScript",cScr_TrigPPlate)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigPPlateImmed
* Inherits: BasePPlateScript
* Messages: PressurePlateActivating, PressurePlateDeactivating
* Links: SwitchLink
*
* A pressure plate that triggers when it starts moving.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigPPlateImmed : public cBasePPlateScript
{
public:
cScr_TrigPPlateImmed(const char* pszName, int iHostObjId)
: cBasePPlateScript(pszName, iHostObjId)
{ }
protected:
virtual long OnPressurePlateActivating(sScrMsg*, cMultiParm&);
virtual long OnPressurePlateDeactivating(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigPPlateImmed","BasePPlateScript",cScr_TrigPPlateImmed)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapRequireAll
* Inherits: TrapRequirement
* Links: SwitchLink
*
* Counts the ``SwitchLink`` links that control this object and trigger
* when all of them have sent ``TurnOn``.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapRequireAll : public cBaseTrap, protected cRequirement
{
public:
cScr_TrapRequireAll(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId),
cRequirement(iHostObjId)
{ }
protected:
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapRequireAll","BaseTrap",cScr_TrapRequireAll)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapRequireAny
* Inherits: TrapRequirement
*
* Trigger when at least one ``TurnOn`` has been received. The messages
* don't have to come from ``SwitchLink`` links.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapRequireAny : public cBaseTrap, protected cRequirement
{
public:
cScr_TrapRequireAny(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId),
cRequirement(iHostObjId)
{ }
protected:
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapRequireAny","BaseTrap",cScr_TrapRequireAny)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigContained
* Inherits: BaseTrap
* Messages: Contained
*
* Sends ``TurnOn`` when the object is picked up or dropped.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigContained : public cBaseTrap
{
public:
cScr_TrigContained(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnContained(sContainedScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigContained","BaseTrap",cScr_TrigContained)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigRoomPlayerTrans
* Inherits: BaseRoomScript
* Messages: PlayerRoomEnter, PlayerRoomExit
* Links: SwitchLink, ScriptParams(Route)
*
* Triggers when the player moves between two designated rooms. This script is
* used on one of the rooms. A ``ScriptParams`` link with the data $$Route$$ is
* made to another room. When the player is in the first room and he moves into
* the other room, then ``TurnOn`` is sent along ``SwitchLink`` links from the
* first room. If the player moves from the second room to the first, then ``TurnOff``
* is sent.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigRoomPlayerTrans : public cBaseRoomScript
{
public:
cScr_TrigRoomPlayerTrans(const char* pszName, int iHostObjId)
: cBaseRoomScript(pszName, iHostObjId)
{ }
protected:
int AreRoomsRelated(object iDest, object iSource);
protected:
virtual long OnPlayerRoomEnter(sRoomMsg*, cMultiParm&);
virtual long OnPlayerRoomExit(sRoomMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigRoomPlayerTrans","BaseRoomScript",cScr_TrigRoomPlayerTrans)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigRoomCreature
* Inherits: BaseRoomScript
* Messages: CreatureRoomEnter, CreatureRoomExit, PlayerRoomEnter, PlayerRoomExit, Obituary
* Links: SwitchLink, ScriptParams(Population)
* Metaproperties: M-NotifyRegion
*
* Triggers when any AI or player is in the room.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigRoomCreature : public cBaseRoomScript, protected cTrackPopulation
{
public:
cScr_TrigRoomCreature(const char* pszName, int iHostObjId)
: cBaseRoomScript(pszName, iHostObjId),
cTrackPopulation(iHostObjId)
{ }
protected:
virtual long OnCreatureRoomEnter(sRoomMsg*, cMultiParm&);
virtual long OnCreatureRoomExit(sRoomMsg*, cMultiParm&);
virtual long OnPlayerRoomEnter(sRoomMsg*, cMultiParm&);
virtual long OnPlayerRoomExit(sRoomMsg*, cMultiParm&);
virtual long OnMessage(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigRoomCreature","BaseRoomScript",cScr_TrigRoomCreature)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigRoomPopChange
* Inherits: BaseRoomScript
* Messages: CreatureRoomEnter, CreatureRoomExit, Obituary
*
* Sends ``TurnOn`` when any AI or player enters or exits the room.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigRoomPopChange : public cBaseRoomScript
{
public:
cScr_TrigRoomPopChange(const char* pszName, int iHostObjId)
: cBaseRoomScript(pszName, iHostObjId)
{ }
protected:
virtual long OnCreatureRoomEnter(sRoomMsg*, cMultiParm&);
virtual long OnCreatureRoomExit(sRoomMsg*, cMultiParm&);
virtual long OnPlayerRoomEnter(sRoomMsg*, cMultiParm&);
virtual long OnPlayerRoomExit(sRoomMsg*, cMultiParm&);
virtual long OnMessage(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigRoomPopChange","BaseRoomScript",cScr_TrigRoomPopChange)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigRoomObject
* Inherits: BaseRoomScript
* Messages: ObjRoomTransit
* Links: SwitchLink, ScriptParams(Route)
*
* Trigger when this object is inside a designated room. Link from the object to
* any number of rooms using ``ScriptParams`` links that have the data $$Route$$.
* The script sends ``TurnOn`` along ``SwitchLink`` links when the object enters
* any of the rooms. ``TurnOff`` is sent when it exits the room. Moving between
* two rooms that are both linked will do nothing.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigRoomObject : public cBaseRoomScript
{
public:
cScr_TrigRoomObject(const char* pszName, int iHostObjId)
: cBaseRoomScript(pszName, iHostObjId)
{ }
protected:
virtual long OnBeginScript(sScrMsg*, cMultiParm&);
virtual long OnObjRoomTransit(sRoomMsg*, cMultiParm&);
virtual void ObjEnteringRoom(void);
virtual void ObjExitingRoom(void);
bool ObjIsInRoom(void);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigRoomObject","BaseRoomScript",cScr_TrigRoomObject)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigRoomDelivery
* Inherits: TrigRoomObject
* Messages: Contained
*
* Triggers when an object enters a designated room while it is being held by
* a player.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigRoomDelivery : public cScr_TrigRoomObject
{
public:
cScr_TrigRoomDelivery(const char* pszName, int iHostObjId)
: cScr_TrigRoomObject(pszName, iHostObjId)
{ }
protected:
virtual long OnContained(sContainedScrMsg*, cMultiParm&);
virtual void ObjEnteringRoom(void);
virtual void ObjExitingRoom(void);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigRoomDelivery","TrigRoomObject",cScr_TrigRoomDelivery)
#endif // SCR_GENSCRIPTS
/**
* Script: TrigRoomDeposit
* Inherits: TrigRoomObject
* Messages: Contained
*
* Triggers when an object enters a designated room, but only when it is not
* in a container. If the object is removed from the container (because the player
* dropped it) then ``TurnOn`` will be sent along ``ControlDevice`` links.
* Picking up the object or moving it out of the room will send ``TurnOff``.
*/
#if !SCR_GENSCRIPTS
class cScr_TrigRoomDeposit : public cScr_TrigRoomObject
{
public:
cScr_TrigRoomDeposit(const char* pszName, int iHostObjId)
: cScr_TrigRoomObject(pszName, iHostObjId)
{ }
protected:
virtual long OnContained(sContainedScrMsg*, cMultiParm&);
virtual void ObjEnteringRoom(void);
virtual void ObjExitingRoom(void);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrigRoomDeposit","TrigRoomObject",cScr_TrigRoomDeposit)
#endif // SCR_GENSCRIPTS
/**
* Script: AnimLight
* Inherits: BaseTrap
* Messages: TurnOn, TurnOff, Toggle, Slain, TweqComplete, LightChange
* Links: SwitchLink, ParticleAttachement
* Properties Renderer\AnimLight, Renderer\Self Illumination, AmbientHacked, Tweq\Flicker
*
* Control an animated light. The light can be turned on, turned off, or switched
* between on and off. A light can have ambient schemas or link to a particle SFX
* that will be activated or deactivated with the light. It also triggers ``SwitchLink``
* links. If the ``Tweq\Flicker`` property is set, then when the light is turned on it
* will flicker for the duration of the tweq. After the tweq completes, the light will
* be set to normal brightness.
*/
#if !SCR_GENSCRIPTS
class cScr_AnimLight : public cBaseTrap
{
public:
cScr_AnimLight(const char* pszName, int iHostObjId);
private:
script_int m_iOnMode;
script_int m_iOffMode;
protected:
void InitModes(void);
void TurnLightOn(void);
void TurnLightOff(void);
bool IsLightOn(void);
protected:
virtual long OnBeginScript(sScrMsg*, cMultiParm&);
virtual long OnEndScript(sScrMsg*, cMultiParm&);
virtual long OnSlain(sSlayMsg*, cMultiParm&);
virtual long OnTimer(sScrTimerMsg*, cMultiParm&);
virtual long OnTweqComplete(sTweqMsg*, cMultiParm&);
virtual long OnLightChange(sScrMsg*, cMultiParm&);
virtual long OnToggle(sScrMsg*, cMultiParm&);
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
private:
static long HandleLightChange(cScript*, sScrMsg*, sMultiParm*);
static long HandleToggle(cScript*, sScrMsg*, sMultiParm*);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("AnimLight","BaseTrap",cScr_AnimLight)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapAddPsi
* Inherits: BaseTrap
* Parameters: psi(number)
*
* Give the player psi points. The psi is added when the trap is turned on
* and subtracted when turned off.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapAddPsi : public cBaseTrap
{
public:
cScr_TrapAddPsi(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapAddPsi","BaseTrap",cScr_TrapAddPsi)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapKeypad
* Inherits: BaseTrap
* Messages: KeypadDone
* Links: ScriptParams(ErrorOutput)
* Properties: Script\Keypad Code
*
* Shows the keypad when turned on. If the correct code is entered, then
* ``TurnOn`` is sent along ``SwitchLink`` links. An incorrect code will
* send ``TurnOn`` along ``ScriptParams`` links that have the data set to
* $$ErrorOutput$$.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapKeypad : public cBaseTrap
{
public:
cScr_TrapKeypad(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId)
{ }
protected:
virtual long OnKeypadDone(sKeypadMsg*, cMultiParm&);
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapKeypad","BaseTrap",cScr_TrapKeypad)
#endif // SCR_GENSCRIPTS
/**
* Script: TrapNanites
* Inherits: BaseTrap
* Links: ScriptParams(ErrorOutput)
* Parameters: nanites(number)
*
* Relays ``TurnOn`` and ``TurnOff`` if the player has sufficient nanites.
*
* With a positive value, this trap will give nanites to the player when turned on.
* The trap always relays when adding nanites. With a negative value, then
* the player will have to pay before the message is sent. If the player doesn't
* have enough nanites, then ``TurnOn`` will be sent along ``ScriptParams``
* links that have the data set to $$ErrorOutput$$.
*/
#if !SCR_GENSCRIPTS
class cScr_TrapNanites : public cBaseTrap
{
public:
cScr_TrapNanites(const char* pszName, int iHostObjId)
: cBaseTrap(pszName, iHostObjId),
m_bNoCharge(false)
{ }
private:
bool m_bNoCharge;
protected:
virtual long OnTimer(sScrTimerMsg*, cMultiParm&);
virtual long OnSwitch(bool, sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TrapNanites","BaseTrap",cScr_TrapNanites)
#endif // SCR_GENSCRIPTS
/**
* Script: TraitMachineReusable
* Inherits: BaseScript
* Messages: FrobWorldEnd, TurnOn, TurnOff, Used
* Links: Lock
* Properties: Engine Features\Locked, Player\Traits
* Schemas: (Event Activate)
*
* An upgrade panel that can be used more than once.
* The machine is usable if it is unlocked. Sending ``TurnOn`` will
* unlock (enable) the machine and ``TurnOff`` will lock (disable)
* it. The lock is automatically set after the machine is used.
*
* The standard upgrade object has a tweqable joint that can be used
* to indicate if the panel is active. Use the ``Tweq\Lock`` property
* to have the joint move when the state changes.
*/
#if !SCR_GENSCRIPTS
class cScr_NewTraitMachine : public cBaseScript
{
public:
cScr_NewTraitMachine(const char* pszName, int iHostObjId)
: cBaseScript(pszName, iHostObjId)
{ }
private:
int TraitsUsed(object iPlayer);
void SetLock(bool bLock);
protected:
virtual long OnFrobWorldEnd(sFrobMsg*, cMultiParm&);
virtual long OnTurnOn(sScrMsg*, cMultiParm&);
virtual long OnTurnOff(sScrMsg*, cMultiParm&);
virtual long OnMessage(sScrMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("TraitMachineReusable","BaseScript",cScr_NewTraitMachine)
#endif // SCR_GENSCRIPTS
/**
* Script: PhysARContact
* Inherits: BaseScript
* Messages: PhysContactCreate, PhysContactDestroy
*
* Stimulates objects that come in contact with this one.
*/
#if !SCR_GENSCRIPTS
class cScr_PhysARContact : public cBaseScript
{
public:
cScr_PhysARContact(const char* pszName, int iHostObjId)
: cBaseScript(pszName, iHostObjId)
{ }
protected:
virtual long OnBeginScript(sScrMsg*, cMultiParm&);
virtual long OnEndScript(sScrMsg*, cMultiParm&);
virtual long OnPhysContactCreate(sPhysMsg*, cMultiParm&);
virtual long OnPhysContactDestroy(sPhysMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("PhysARContact","BaseScript",cScr_PhysARContact)
#endif // SCR_GENSCRIPTS
/**
* Script: CloneContactFrob
* Inherits: BaseScript
* Messages: FrobInvEnd
* Properties: Engine Features\Stack Count, Renderer\Has Refs
*
* Stimulates the player when it is frobbed in inventory. Most often used
* to give health points.
*/
#if !SCR_GENSCRIPTS
class cScr_CloneContactFrob : public cBaseScript
{
public:
cScr_CloneContactFrob(const char* pszName, int iHostObjId)
: cBaseScript(pszName, iHostObjId)
{ }
protected:
virtual long OnFrobInvEnd(sFrobMsg*, cMultiParm&);
};
#else // SCR_GENSCRIPTS
GEN_FACTORY("CloneContactFrob","BaseScript",cScr_CloneContactFrob)
#endif // SCR_GENSCRIPTS
#endif // _DARKGAME == 3
#endif // SS2SCRIPTS_H
#ifdef SCR_GENSCRIPTS
#undef SS2SCRIPTS_H
#endif