public Countdown(CountdownType type = CountdownType.S_COUNTDOWN_NO_LIMIT, float current = 0, float max = 0)
 {
     Type    = type;
     Current = current;
     Max     = max;
     Command = CommandType.S_COMMAND_UNKNOWN;
 }
Exemple #2
0
 public Hourglass(float duration, CountdownType countdownType)
 {
     this.countdownType = countdownType;
     if (countdownType == CountdownType.ScaledTime)
         expiryTime = Time.time + duration;
     else if (countdownType == CountdownType.UnscaledTime)
         expiryTime = Time.unscaledTime + duration;
 }
 public StatusEffectDefinition(string name, CountdownType limit, bool persists, bool freezeOnAffliction, float endOfTurnRemoveChance = 0)
 {
     this.name     = name;
     this.limit    = limit;
     this.persists = persists;
     this.endOfTurnRemoveChance = endOfTurnRemoveChance;
     this.freezeOnAffliction    = freezeOnAffliction;
 }
Exemple #4
0
        public void StartCD(CountdownType _type)
        {
            if (!locked)
            {
                snapshot = Network.Util.Clock.GetTimeMilliseconds();
                current  = snapshot;
                enabled  = true;

                if (_type == CountdownType.Respawn)
                {
                    Length    = respawnTime;
                    fillColor = Color.Red;
                    Message   = messages[0];
                }
                else if (_type == CountdownType.MapChange)
                {
                    Length    = mapTime;
                    fillColor = Color.GreenYellow;
                    Message   = messages[1];
                    Locked    = true;
                }

                Vector2 size = bigFont.MeasureString(Message);


                messagePos.X = (int)(rect.X + (rect.Width / 2) - ((size.X * Constants.UI_SCALE) / 2));

                if (tLocation == TextLocation.Bottom)
                {
                    backRect.Height = rect.Height + (int)(size.Y * Constants.UI_SCALE) + 5;
                }
                else if (tLocation == TextLocation.Top)
                {
                    rect.Y          = (int)(messagePos.Y + (size.Y * Constants.UI_SCALE));
                    backRect.Height = rect.Height + (int)(size.Y * Constants.UI_SCALE) + 10;
                }
            }
        }
        public void StartCD(CountdownType _type)
        {
            if (!locked)
            {
                snapshot = Network.Util.Clock.GetTimeMilliseconds();
                current = snapshot;
                enabled = true;

                if (_type == CountdownType.Respawn)
                {
                    Length = respawnTime;
                    fillColor = Color.Red;
                    Message = messages[0];
                }
                else if (_type == CountdownType.MapChange)
                {
                    Length = mapTime;
                    fillColor = Color.GreenYellow;
                    Message = messages[1];
                    Locked = true;
                }

                Vector2 size = bigFont.MeasureString(Message);

                messagePos.X = (int)(rect.X + (rect.Width / 2) - ((size.X * Constants.UI_SCALE) / 2));

                if (tLocation == TextLocation.Bottom)
                {
                    backRect.Height = rect.Height + (int)(size.Y * Constants.UI_SCALE) + 5;
                }
                else if (tLocation == TextLocation.Top)
                {
                    rect.Y = (int)(messagePos.Y + (size.Y * Constants.UI_SCALE));
                    backRect.Height = rect.Height + (int)(size.Y * Constants.UI_SCALE) + 10;
                }
            }
        }
 public Countdown(CountdownType type = CountdownType.S_COUNTDOWN_NO_LIMIT, float current = 0, float max = 0)
 {
     Type    = type;
     Current = current;
     Max     = max;
 }