Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // ToggleCreatureFactory.
  3. //=============================================================================
  4. class ToggleCreatureFactory expands ToggleThingFactory;
  5.  
  6. var() name Orders;      // creatures from this factory will have these orders
  7. var() name OrderTag;
  8. var pawn    enemy;
  9. var() name AlarmTag;    // alarmtag given to creatures from this factory
  10. var() int  AddedCoopCapacity; // Extra creatures for coop mode
  11.  
  12. function PreBeginPlay()
  13. {
  14.  
  15. }
  16.  
  17. function PostBeginPlay()
  18. {
  19.     Super.PostBeginPlay();
  20.     if ( Level.NetMode!=NM_StandAlone )
  21.         capacity += AddedCoopCapacity;
  22.     backup_capacity = capacity;
  23. }
  24.  
  25. Auto State Waiting
  26. {
  27.  
  28.     function Trigger( actor Other, pawn EventInstigator )
  29.     {
  30.         TriggerEvent(Event,Self,EventInstigator);
  31.    
  32.         curStatus = bStatus;
  33.         bStatus = !bStatus;
  34.         if (curStatus) {
  35.             if (bAnnounceToggle) BroadcastMessage(self.name@": status is"@self.curStatus, true, 'CriticalEvent');
  36.             GotoState('Spawning');
  37.         }
  38.     }
  39.  
  40.  
  41.     function Touch(Actor Other)
  42.     {
  43.         local pawn otherpawn;
  44.  
  45.         otherpawn = Pawn(Other);
  46.         if ( (otherpawn != None) && (!bOnlyPlayerTouched || otherpawn.bIsPlayer) )
  47.         {
  48.             enemy = otherpawn;
  49.             Trigger(other, otherPawn);
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement