public void ActivateFunction(Dude d) { if (SoulButton==0 && _currentCDTime <= 0) { switch (Function) { case "boost": d.BoostTime = 5000; _currentCDTime = _actualCDTime; break; case "shield": d.ShieldTime = 10000; _currentCDTime = _actualCDTime; break; default: if (d.Weapon.GetType() == typeof(Weapons.Sword)) { d.GiveWeapon(Function); _currentCDTime = _actualCDTime; } break; } } if(SoulButton>0 && _currentCDTime >= _actualCDTime) { switch (Function) { case "haste": GameSession.Instance.ButtonController.HasteTime = 30000; break; case "meteors": GameSession.Instance.SoulController.AirStrike(GameSession.Instance.Team1ClientType == GameClientType.Human ? 0 : 1); break; case "elite": GameSession.Instance.SoulController.EliteSquad(GameSession.Instance.Team1ClientType == GameClientType.Human ? 0 : 1); break; } if (GameSession.Instance.Team1ClientType == GameClientType.Human) GameSession.Instance.Team1SoulCount -= (int)_actualCDTime * SoulButton; if (GameSession.Instance.Team2ClientType == GameClientType.Human) GameSession.Instance.Team2SoulCount -= (int)_actualCDTime * SoulButton; } }
private void ActivateFunction(AIAction a, Dude d) { if (a.CurrentCooldown <= 0) { a.CurrentCooldown = a.MaxCooldown; switch (a.Function) { case "boost": d.BoostTime = 5000; break; case "shield": d.ShieldTime = 10000; break; default: d.GiveWeapon(a.Function); break; } } }