Ejemplo n.º 1
0
    public bool CanHitActor(IGameActor touchedActor)
    {
        bool canHitActor = true;

        if (touchedActor == null)
        {
            canHitActor = false;
        }
        else if (touchedActor.IsDodging())
        {
            canHitActor = false;
        }
        else if (MyOwner != null && touchedActor.GetTribe() == MyOwner.GetTribe())
        {
            canHitActor = false;
        }
        else if (actorsHitbyProjectile.TryGetValue(MyId, out List <IGameActor> actors) &&
                 actors.Contains(touchedActor))
        {
            // Don't let a bullet hit the same character multiple times.
            canHitActor = false;
        }
        return(canHitActor);
    }