Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // ToggleCreatureFactory.
- //=============================================================================
- class ToggleCreatureFactory expands ToggleThingFactory;
- var() name Orders; // creatures from this factory will have these orders
- var() name OrderTag;
- var pawn enemy;
- var() name AlarmTag; // alarmtag given to creatures from this factory
- var() int AddedCoopCapacity; // Extra creatures for coop mode
- function PreBeginPlay()
- {
- }
- function PostBeginPlay()
- {
- Super.PostBeginPlay();
- if ( Level.NetMode!=NM_StandAlone )
- capacity += AddedCoopCapacity;
- backup_capacity = capacity;
- }
- Auto State Waiting
- {
- function Trigger( actor Other, pawn EventInstigator )
- {
- TriggerEvent(Event,Self,EventInstigator);
- curStatus = bStatus;
- bStatus = !bStatus;
- if (curStatus) {
- if (bAnnounceToggle) BroadcastMessage(self.name@": status is"@self.curStatus, true, 'CriticalEvent');
- GotoState('Spawning');
- }
- }
- function Touch(Actor Other)
- {
- local pawn otherpawn;
- otherpawn = Pawn(Other);
- if ( (otherpawn != None) && (!bOnlyPlayerTouched || otherpawn.bIsPlayer) )
- {
- enemy = otherpawn;
- Trigger(other, otherPawn);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement