Advertisement
Chronos_Ouroboros

Camper125Lv enemy marker

Jun 17th, 2019
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. class EnemyMapMarker : MapMarker {
  2.     default {
  3.         Scale 0.3;
  4.     }
  5.  
  6.     transient CVar scaleCVar;
  7.     transient bool gotScaleCVar;
  8.  
  9.     override void Tick () {
  10.         if (!gotScaleCVar) {
  11.             scaleCVar = CVar.FindCVar ('marker_scale');
  12.             gotScaleCVar = true;
  13.         }
  14.  
  15.         if (scaleCVar)
  16.             scale.X = scale.Y = scaleCVar.GetFloat ();
  17.  
  18.         // Remove the actor if it has no target
  19.         if (!target) {
  20.             Destroy ();
  21.             return;
  22.         } else if (target.health < 1) {
  23.             sprite = GetSpriteIndex ('TNT1');
  24.             frame = 0; // Frame "A"
  25.             return;
  26.         } else {
  27.             sprite = GetSpriteIndex ('MARE');
  28.             frame = 0; // Frame "A"
  29.         }
  30.  
  31.         SetOrigin (target.pos, true);
  32.         Prev = target.Prev;
  33.     }
  34.    
  35.     States {
  36.     Spawn:
  37.         MARE A -1;
  38.         stop;
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement