home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Gameplay / Classes / TeamTrigger.uc < prev    next >
Text File  |  2003-12-11  |  1KB  |  42 lines

  1. //=============================================================================
  2. // TeamTrigger: triggers for all except pawns with matching team
  3. //=============================================================================
  4. class TeamTrigger extends Trigger;
  5.  
  6. var() byte Team;
  7. var() bool bTimed;
  8.  
  9. function PostBeginPlay()
  10. {
  11.     Super.PostBeginPlay();
  12.     if ( bTimed )
  13.         SetTimer(2.5, true);
  14. }
  15.  
  16. function Timer()
  17. {
  18.     local Controller P;
  19.  
  20.     for ( P=Level.ControllerList; P!=None; P=P.NextController )
  21.         if ( (P.Pawn != None) && (abs(Location.Z - P.Pawn.Location.Z) < CollisionHeight + P.CollisionHeight)
  22.             && (VSize(Location - P.Pawn.Location) < CollisionRadius) )
  23.             Touch(P.Pawn);
  24.     SetTimer(2.5, true);
  25. }
  26.  
  27. function bool IsRelevant( actor Other )
  28. {
  29.     if( !bInitiallyActive || !Level.Game.bTeamGame || (Other.Instigator == None) 
  30.         || Level.Game.IsOnTeam(Other.Instigator.Controller, Team) )
  31.         return false;
  32.     return Super.IsRelevant(Other);
  33. }
  34.  
  35. function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, 
  36.                         Vector momentum, class<DamageType> damageType)
  37. {
  38.     if ( (InstigatedBy != None) && Level.Game.bTeamGame
  39.         && !Level.Game.IsOnTeam(InstigatedBy.Controller, Team) )
  40.         Super.TakeDamage(Damage, instigatedBy, HitLocation, Momentum, DamageType);
  41. }
  42.