public override string Use(BasicChar user) { TempStatMod tempMod = new TempStatMod(10, ModTypes.Flat, typeof(VirilityTempBooster).Name, 168); user.PregnancySystem.Virility.AddTempMod(tempMod); return(base.Use(user)); }
public override string Use(BasicChar user) { TempStatMod tempMod = new TempStatMod(10, ModTypes.Flat, TypeName, 168); user.PregnancySystem.Fertility.AddTempMod(tempMod); return(base.Use(user)); }
public void AddTempMod(TempStatMod mod) { if (TempMods.Exists(tm => tm.Source.Equals(mod.Source))) { TempStatMod toChange = TempMods.Find(tm => tm.Source.Equals(mod.Source)); float diminishingReturn = (float)toChange.Duration / mod.Duration; int toIncrease = Mathf.Max(0, Mathf.FloorToInt(mod.Duration / Mathf.Max(1, 2 * diminishingReturn))); toChange.IncreaseDuration(toIncrease); } else { // Clone otherwise diminishingReturn doesn't work as duration increase on both. TempMods.Add(new TempStatMod(mod.Value, mod.ModType, mod.Source, mod.Duration)); } IsDirty = true; AddedTempEvent?.Invoke(); }
public void RemoveTempMod(TempStatMod mod) { TempMods.Remove(mod); IsDirty = true; }
private void Awake() { statMods = this.GetComponent <PermStatMod>(); tempStatMods = this.GetComponent <TempStatMod>(); }
public AssingTempStatMod(TempStatMod tempStatMod, StatTypes statTypes) { this.tempStatMod = tempStatMod; this.statTypes = statTypes; }