public StatMod(Tag modTag, Stat.Type identifier, StatType type, float value) { ModTag = modTag; Identifier = identifier; Type = type; StackIdentifier = Identifier.ToString(); Value = new ModProperty(value, Type == StatType.Additive ? ModProperty.StackBehaviour.Add : ModProperty.StackBehaviour.Multiply); OnStackRecalculated += StatMod_OnStackRecalculated; }
static public void SetUpgradeCards(Stat.Type card1, Stat.Type card2, Stat.Type card3) { CharacterController.Instance.menuChoice.SetActive(true); instance = CharacterController.Instance.menuChoice.GetComponent <ChoiceMenu>(); instance.timeOpen = Time.unscaledTime; instance.cards[0].Set(card1); instance.cards[1].Set(card2); instance.cards[2].Set(card3); }
/// <summary> /// For making new types /// </summary> /// <param name="id"></param> protected Type( byte id, string name, Stat.Type statToRestore, int restoritivePower = 1, short numberOfUses = 1, float restoreTime = 1.0f ) : base(id, name, numberOfUses) { StatToRestore = statToRestore; RestoritivePower = restoritivePower; RestoreTime = restoreTime; // on creation, add the singleton to the all types list. Types.Add(this); }
public void Set(Stat.Type upgrade) { _type = Type.Stat; statUpgrade = upgrade; switch (upgrade) { case Stat.Type.Acceleration: title.text = "Acceleration"; text.text = "Move faster to max speed"; break; case Stat.Type.AttackSpeed: title.text = "Attack Speed"; text.text = "Hit faster with the melee attack"; break; case Stat.Type.DamageShot: title.text = "Gun damage"; text.text = "Deal more damage with your projectiles"; break; case Stat.Type.DamageSword: title.text = "Melee damage"; text.text = "Increase the damages dealt with the sword, forever"; break; case Stat.Type.FireRate: title.text = "Fire rate"; text.text = "Increase fire rate"; break; case Stat.Type.MaxSpeed: title.text = "Max Speed"; text.text = "Move faster at max speed"; break; case Stat.Type.ReloadSpeed: title.text = "Reload Speed"; text.text = "Reload your gun faster"; break; } }
public void AddStat(Stat.Type identifier, string name, string description, float baseValue) { _stats.Add(new Stat(identifier, name, description, baseValue)); }
public void RemoveStat(Stat.Type identifier) { _stats.Remove(_stats.First(x => x.Identifier == identifier)); }
public Stat GetStat(Stat.Type identifier) { return(_stats.First(x => x.Identifier == identifier)); }
/// <summary> /// Make a stat /// </summary> /// <param name="type"></param> /// <param name="max"></param> /// <param name="current"></param> /// <param name="min"></param> public VariantStat(Stat.Type type, int defaultMax, int variance = 0) { this.type = type; this.defaultMax = defaultMax; this.variance = variance; }
public StatUpgradeStruct(Stat.Type type, float val) { this.type = type; value = val; }