Exemple #1
0
    void RPCMeleeAttackObstacle(int unitX, int unitZ, int targetX, int targetZ)
    {
        UnitScript         Attacker = Map.Board[unitX, unitZ].myUnit;
        DestructibleScript target   = Map.Board[targetX, targetZ].GetComponentInChildren <DestructibleScript>();

        MeleeAttackObstacle(Attacker, target);
    }
Exemple #2
0
 public bool CanAttackDestructible(DestructibleScript target, bool showText)
 {
     if (CheckIfIsInCombat() && Input.GetMouseButtonDown(0) && showText)
     {
         PopupTextController.AddPopupText("Cannot destroy objects while in combat!", PopupTypes.Info);
     }
     return(StandsNextToDestructible(target) && hasAttacked == false && CheckIfIsInCombat() == false && TurnManager.Instance.CurrentPhase == TurnPhases.Attack);
 }
Exemple #3
0
 void MeleeAttackObstacle(UnitScript Attacker, DestructibleScript target)
 {
     Debug.Log("Melee attacking obstacle - debugging fencer bug");
     Attacker.GetComponent <UnitMovement>().LookAtTheTarget(target.transform.position, Attacker.GetComponentInChildren <BodyTrigger>().RotationInAttack);
     Attacker.GetComponentInChildren <AnimController>().AnimateAttack();
     target.GetDamaged(Attacker.CurrentAttack + 1);
     Attacker.hasAttacked = true;
     CheckIfLastAttacker();
     target.GetComponentInChildren <ObjectHP>().SwitchTrigger();
 }
Exemple #4
0
 void Start()
 {
     thisObject        = this.transform.root.GetComponentInChildren <DestructibleScript>();
     fillOfABar        = GetComponentsInChildren <Image>()[0];
     fillOfABar.sprite = HPVisual;
     fillOfABar.rectTransform.localScale = new Vector3(0.5f, 0.25f, 0.25f);
     if (this.GetComponent <CanvasGroup>() == null)
     {
         this.gameObject.AddComponent <CanvasGroup>();
     }
 }
Exemple #5
0
 bool StandsNextToDestructible(DestructibleScript target)
 {
     return(myTile.GetNeighbours().Contains(target.transform.parent.GetComponent <Tile>()));
 }