public virtual void RemoveCooldown(Mobile m) { if (Cooldown.ContainsKey(m)) { Cooldown.Remove(m); } }
public void Tick() { if (DoingDelate > 0) { DoingDelate--; } if (Doing != Action.Nothing && DoingDelate <= 0) { Do(Action.Nothing); } Action[] keys = { Action.Attack, Action.Defand, Action.Hurt }; foreach (Action key in keys) { if (Cooldown.ContainsKey(key) && Cooldown[key] > 0) { Cooldown[key]--; } } if (Doing == Action.Nothing) { ViewVersion--; } if (ViewVersion < -40) { ViewVersion = 40; } }
private void OnEntityBuilt(Planner planner, GameObject gameObject) { if (INIT != false) { BasePlayer player = planner.GetOwnerPlayer(); if (permission.UserHasPermission(player.userID.ToString(), "magicsigns.able")) { BaseEntity e = gameObject.ToBaseEntity(); if (!(e is BaseEntity) || player == null) { return; } if (e.GetComponent <Signage>() != null) { if (!Cooldown.ContainsKey(player.userID)) { int id = GetRandomInt(0, ScrapedImages.Count); UWeb.Add(ScrapedImages[id], player, e.GetComponent <Signage>(), false); ScrapedImages.Remove(ScrapedImages[id]); if (player.net.connection.authLevel < 1) { InitCooldown(player); } if (ScrapedImages.Count == 0) { Puts(player.displayName + " has used the last image in the list, scraping more..."); PopulateImageList(); } } else { PrintToChat(player, "You must wait " + Cooldown[player.userID].ToString() + " seconds before placing another sign."); e.Kill(); } } } } return; }
public virtual bool IsInCooldown(Mobile m) { return(Cooldown != null && Cooldown.ContainsKey(m)); }