Ejemplo n.º 1
0
 public bool tryOccupy(MercSlot target)
 {
     if (target != null && target.ally && !target.occupied)
     {
         parent.waiting = null;
         OccupySlot(MercTrayMain.hoveringSlot);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
 public void ReturnToHand()
 {
     if (occupyingSlot != null)
     {
         occupyingSlot.occupying = null;
         occupyingSlot           = null;
     }
     ++parent.count;
     Destroy(gameObject);
 }
Ejemplo n.º 3
0
 public void Trigger(MercSlot target)
 {
     if (occupyingSlot != null)
     {
         //Do active ability
     }
     else
     {
         tryOccupy(target);
     }
 }
Ejemplo n.º 4
0
    private void OccupySlot(MercSlot slot)
    {
        occupyingSlot  = slot;
        slot.occupying = behaviour;
        transform.SetParent(slot.transform);
        transform.localPosition = new Vector3(0, 0, 0);
        //Negative so that it has to deploy before attacking

        occupyingSlot.attackProgress = -1000.0f;
        StartCoroutine(Deploy());
    }
    void Summon(Mercenary merc, MercSlot slot)
    {
        GameObject           instance = GameObject.Instantiate(mercElementPrefab, Vector3.zero, Quaternion.identity);
        MercenaryRepresenter mr       = instance.GetComponent <MercenaryRepresenter>();

        slot.occupying = merc.Copy();
        mr.SetBehaviour(slot.occupying);
        mr.transform.SetParent(slot.transform);
        mr.transform.localPosition = new Vector3(0, 0, 0);
        slot.attackProgress        = -1000.0f;
        StartCoroutine(Deploy(slot));
    }
Ejemplo n.º 6
0
 void Awake()
 {
     attackAnim = GetComponent <Animator>();
     if (!general)
     {
         for (int i = 0; i < transform.parent.childCount; ++i)
         {
             MercSlot comp = transform.parent.GetChild(i).GetComponent <MercSlot>();
             if (comp != null && comp != this)
             {
                 opposite = comp;
             }
         }
     }
     else
     {
         opposite = null;
     }
 }
    private IEnumerator Deploy(MercSlot slot)
    {
        yield return(new WaitForSeconds(0.1f));

        slot.attackProgress = 1;
    }