示例#1
0
    // edit depending on game.
    public static void ProcessAction(CombatAction e)
    {
        AbilityData activatedAbility = e.source.data.abilities[e.abilityId].Last.Value;

        // filtering
        if (e.evt == CombatActionId.DamageAttempt_CastCollision)
        {
            // Debug.Log("Possibility of applying dmg after collision " + e.source + " to " + e.target);
            e.evt = CombatActionId.Damage;
        }

        // handle events
        if (e.evt == CombatActionId.Damage)
        {
            // Note: Doesn't support abilities to be applied without source, after death(buffs...).
            if (PassFiltering(e.source.data.abilities[e.abilityId].Last.Value.targetFilter, e))
            {
                int dmg = activatedAbility.GetDmg();
                Debug.Log("Applying dmg from " + e.source + " to " + e.target + " w amt " + dmg);
                e.target.Damaged(e, dmg);
            }
        }
    }