public void Create(ForceFieldUser player, List <string> args) { if (!player.HasProperty("LastHealthRecovered")) { player.SetProperty("LastHealthRecovered", DateTime.UtcNow); } if (!player.HasProperty("HealthRecoveryAmount")) { player.SetProperty("HealthRecoveryAmount", 10); } if (!player.HasProperty("TimeBetweenHeals")) { player.SetProperty("TimeBetweenHeals", 5); } if (args.Count > 0) { int recover; if (Int32.TryParse(args[0], out recover)) { player.SetProperty("HealthRecoveryAmount", recover); } } if (args.Count > 1) { int timeBetweenHeals; if (Int32.TryParse(args[1], out timeBetweenHeals)) { player.SetProperty("TimeBetweenHeals", timeBetweenHeals); } } }
public void Create(ForceFieldUser player, List<string> args) { if (!player.HasProperty("LastManaRecovered")) { player.SetProperty("LastManaRecovered", DateTime.UtcNow); } if (!player.HasProperty("ManaRecoveryAmount")) { player.SetProperty("ManaRecoveryAmount", 10); } if (!player.HasProperty("TimeBetweenRestores")) { player.SetProperty("TimeBetweenRestores", 5); } if (args.Count > 0) { int recover; if (Int32.TryParse(args[0], out recover)) { player.SetProperty("HealthRecoveryAmount", recover); } } if (args.Count > 1) { int timeBetweenRestores; if (Int32.TryParse(args[1], out timeBetweenRestores)) { player.SetProperty("TimeBetweenRestores", timeBetweenRestores); } } }
public void Create(ForceFieldUser player, List<string> args) { if (!player.HasProperty("LastBuffSet")) { player.SetProperty("LastBuffSet", DateTime.UtcNow); } if (!player.HasProperty("BuffList")) { player.SetProperty("BuffList", new List<int>()); } foreach (string arg in args) { int buff; if (!Int32.TryParse(arg, out buff) && (buff < 0 || buff >= Main.maxBuffTypes)) { continue; } ((List<int>) player["BuffList"]).Add(buff); } }
public void Create(ForceFieldUser player, List <string> args) { if (!player.HasProperty("LastBuffSet")) { player.SetProperty("LastBuffSet", DateTime.UtcNow); } if (!player.HasProperty("BuffList")) { player.SetProperty("BuffList", new List <int>()); } foreach (string arg in args) { int buff; if (!Int32.TryParse(arg, out buff) && (buff < 0 || buff >= Main.maxBuffTypes)) { continue; } ((List <int>)player["BuffList"]).Add(buff); } }