Exemplo n.º 1
0
    public bool TryAddTarget(TBC_Entity entity)
    {
        if (!selectedTargets.Contains(entity))
        {
            selectedTargets.Add(entity);

            int targetEntityCount = 0;
            switch (targetType)
            {
            case TargetTypes.Player:
                targetEntityCount = TBC_GameManager.instance.playerEntities.Count;
                break;

            case TargetTypes.Enemy:
                targetEntityCount = TBC_GameManager.instance.enemyEntities.Count;
                break;
            }

            if (affectsAll || selectedTargets.Count >= maxTargets || selectedTargets.Count >= targetEntityCount)
            {
                ApplyItemToTargets();

                return(true);
            }
        }

        return(false);
    }
Exemplo n.º 2
0
    public override void ApplyAttack(TBC_Entity entity)
    {
        if (destroysArmor)
        {
            entity.healthModel.armor = 0;
        }

        base.ApplyAttack(entity);

        TBC_DOTStatusEffect dot = entity.gameObject.AddComponent <TBC_DOTStatusEffect>();

        dot.InitializeStatusEffect(dotDuration, entity);
        dot.bleedDamage = dotDamage;
    }
Exemplo n.º 3
0
 public void TrySelectTarget(TBC_Entity target)
 {
     if (TBC_GameManager.instance.playerSelectedAttack != null)
     {
         if (
             IsTargetingEnemy(TBC_GameManager.instance.playerSelectedAttack.targetType, target) ||
             IsTargetingPlayer(TBC_GameManager.instance.playerSelectedAttack.targetType, target)
             )
         {
             if (TBC_GameManager.instance.playerSelectedAttack.TryAddTarget(target))
             {
                 NextTurn();
             }
             else
             {
                 target.spriteUI.selectedSprite.SetActive(true);
             }
         }
     }
     else if (TBC_GameManager.instance.playerSelectedItem != null)
     {
         if (
             IsTargetingEnemy(TBC_GameManager.instance.playerSelectedItem.targetType, target) ||
             IsTargetingPlayer(TBC_GameManager.instance.playerSelectedItem.targetType, target)
             )
         {
             if (TBC_GameManager.instance.playerSelectedItem.TryAddTarget(target))
             {
                 NextTurn();
             }
             else
             {
                 target.spriteUI.selectedSprite.SetActive(true);
             }
         }
     }
 }
Exemplo n.º 4
0
 private bool IsTargetingEnemy(TargetTypes actionType, TBC_Entity target) => actionType == TargetTypes.Enemy && target.GetType() == typeof(TBC_EnemyEntity);
Exemplo n.º 5
0
 private bool IsTargetingPlayer(TargetTypes actionType, TBC_Entity target) => actionType == TargetTypes.Player && target.GetType() == typeof(TBC_PlayerEntity);
 public void InitializeStatusEffect(int duration, TBC_Entity entity)
 {
     this.duration  = duration;
     attachedEntity = entity;
     attachedEntity.startTurnEvent.AddListener(() => ApplyEffect());
 }
Exemplo n.º 7
0
 public virtual void ApplyAttack(TBC_Entity entity)
 {
     entity.DealDamage(damage, isPiercing);
 }