public void Remove(RPGStats.Modifier mod)
 {
     if (mod.type == "add")
     {
         Value -= mod.value;
     }
     if (mod.type == "mult")
     {
         Value -= _baseValue * mod.value / 10;
     }
 }
    public void Apply(RPGStats.Modifier mod)
    {
        if (mod.type == "add")
        {
            Value += mod.value;
        }

        if (mod.type == "mult")
        {
            Value += _baseValue * mod.value / 10;
        }
    }
示例#3
0
    public string AddModifier(int id, RPGStats.Modifier m)
    {
        INSPECTOR_MODS.Add(new IDModifier {
            identifier = id, mod = m
        });
        Modifiers.Add(id, m);
        var result = string.Format(
            "Add modifier {0} {1} {2}",
            Modifiers[id].stat,
            Modifiers[id].type,
            Modifiers[id].value);

        Items[m.stat].Apply(m);
        return(result);
    }
    public override void ModifyStat(Stat stat, RPGStats.Modifier mod)
    {
        if (!this.CharacterStats.GetStat(stat.Name))
        {
            Debug.LogWarningFormat("stat:: {0}, is not a valid stat to modify", stat);
            return;
        }

        CharacterStats.AddModifier(modcount++, mod);

        if (stat.Name == "Health")
        {
            onHealthChange.Invoke(CharacterStats[stat.Name].Value);
        }
        onStatModify.Invoke(stat.Name);
    }
示例#5
0
 public override void Initialize(GameObject go)
 {
     mod = new RPGStats.Modifier(ModType.ToString(), EffectedStat.Name, ModifiedValue);
 }
 public virtual void ModifyStat(Stat stat, RPGStats.Modifier mod)
 {
 }