Beispiel #1
0
    public void AddEscortableOnTile(PawnInstance escortable)
    {
        Tile tile = escortable.GetComponentInParent <Tile>();

        if (escortable.GetComponent <Behaviour.Escortable>() == null)
        {
            Debug.Log("Can't add escortable to tile, missing component Escortable.");
            return;
        }
        if (escortable.GetComponent <Behaviour.Prisoner>() != null)
        {
            Debug.Log("Can't add an escortable with a Prisoner component.");
            return;
        }

        if (tile == null)
        {
            Debug.Log("Can't add escortable to tile, no Tile component found in parent.");
            return;
        }

        if (escortablesOnTile.ContainsKey(tile))
        {
            escortablesOnTile[tile].Add(escortable);
        }
        else
        {
            List <PawnInstance> newList = new List <PawnInstance>();
            newList.Add(escortable);
            escortablesOnTile.Add(tile, newList);
        }
        escortable.CurrentTile = tile;
    }
Beispiel #2
0
 void LaunchBattle(PawnInstance _aggroTarget)
 {
     if (GetComponentInParent <Monster>().BattleOnCollision&& _aggroTarget.GetComponentInParent <Fighter>() != null && _aggroTarget.GetComponentInParent <Fighter>().IsTargetableByMonster == true)
     {
         BattleHandler.StartBattleProcess(instance.CurrentTile);
         GameManager.Instance.UpdateCameraPosition(_aggroTarget);
     }
 }
Beispiel #3
0
    public void AddMonsterOnTile(PawnInstance monster)
    {
        Tile tile = monster.GetComponentInParent <Tile>();

        if (monster.GetComponent <Behaviour.Monster>() == null)
        {
            Debug.Log("Can't add monster to tile, missing component Monster.");
            return;
        }

        if (MonstersOnTile.ContainsKey(tile))
        {
            MonstersOnTile[tile].Add(monster);
        }
        else
        {
            List <PawnInstance> newList = new List <PawnInstance>();
            newList.Add(monster);
            MonstersOnTile.Add(tile, newList);
        }
        monster.CurrentTile = tile;
    }