private readonly Dictionary <string, API.JuiceDefinition> items_ = new Dictionary <string, API.JuiceDefinition>(); // Lookup table for subtypeid against juice level public void AddJuiceDefinition(API.JuiceDefinition def) { if (!items_.ContainsKey(def.SubtypeId)) { items_.Add(def.SubtypeId, def); } else { Log.Game.Info($"Skipped juice def '{def.SubtypeId}' because it has already been added"); } }
private void ApplyToxicBuildup(float units_used, API.JuiceDefinition def, PlayerData data) { data.toxicity_buildup += def.ToxicityPerMitagated * units_used; data.toxicity_buildup = Math.Min(data.toxicity_buildup, 100); if (data.lowest_toxic_decay > 0) { data.lowest_toxic_decay = Math.Min(def.ToxicityDecay, data.lowest_toxic_decay); } else { data.lowest_toxic_decay = def.ToxicityDecay; } }
public void RegisterJuiceDefinition(JuiceDefinition def) { Hooks["RegisterJuice"](MyAPIGateway.Utilities.SerializeToBinary(def)); }