Esempio n. 1
0
    public override void OnRemove(CharacterBase ownerCharacter, CharacterBase targetCharacter,
                                  ref List <CharacterBase> affectedCharacters)
    {
        if (characterInstanceData.ContainsKey(targetCharacter))
        {
            float appliedAmount = (float)characterInstanceData[targetCharacter];
            characterInstanceData.Remove(targetCharacter);

            targetCharacter.ApplyStatModifier(Type, -appliedAmount);
        }
    }
Esempio n. 2
0
    public override void OnApply(CharacterBase ownerCharacter, CharacterBase targetCharacter,
                                 ref List <CharacterBase> affectedCharacters)
    {
        float appliedAmount = Amount;

        if (Percentage)
        {
            appliedAmount = targetCharacter.GetStatModifier(Type) * Amount;
        }

        characterInstanceData[targetCharacter] = appliedAmount;
        targetCharacter.ApplyStatModifier(Type, appliedAmount);

        ApplyEffects(targetCharacter);
    }