private Enemy SpawnHero()
    {
        EnemyType heroType = EnemyType.NUM;

        for (int i = 0; i < heroAppearingTurn.Length; i++)
        {
            if (heroAppearingTurn[i] == gm.gameTurnManager.GetCurrentGameTurn())
            {
                heroType = getHeroType(i + 1);
                break;
            }
        }

        if (heroType != EnemyType.NUM)
        {
            uilog.UpdateLog("<color=" + TextColor.RedColor + ">" + heroType.ToString() + " has appeared!</color>");
            return(SpawnEnemyAtCell(heroType, gm.hexMap.GetRandomCellToSpawn()));
        }
        return(null);
    }
    public virtual int TakeDamage(int damage, int magicDamage, Pawn from = null, bool isIgnoreDefense = false, bool isIgnoreMagicDefense = false)
    {
        currentHP -= damage + magicDamage;

        if (currentHP <= 0)
        {
            OnDie();
        }
        else
        {
            PlayTakeDamage(damage + magicDamage);
        }

        if (this.pawnType == PawnType.Monster)
        {
            uilog.UpdateLog("<color=" + TextColor.BlueColor + ">" + this.Name + "</color> take damage by<color=" + TextColor.RedColor + "> " + (damage + magicDamage) + "</color>");
        }
        else if (this.pawnType == PawnType.Enemy)
        {
            uilog.UpdateLog("<color=" + TextColor.GreyColor + ">" + this.Name + " take damage by <color=" + TextColor.RedColor + "> " + (damage + magicDamage) + "</color></color>");
        }

        return(damage + magicDamage);
    }
Exemple #3
0
 public void UseTeleporter()
 {
     if (selectedPawn != null)
     {
         uilog.UpdateLog("<color=" + TextColor.BlueColor + ">" + selectedPawn.Name + "</color> is trying to transfer");
         //Debug.Log(selectedPawn.Name + " is trying to transfer");
         gameInteraction.SetIsPawnAction(true);
         currentStatus = Status.IsTransfering;
         UpdateRoot(selectedPawn, selectedPawn.currentCell, selectedPawn.currentCell.building.GetComponent <Teleporter>().another.currentCell);
         selectedPawn.currentCell.building.GetComponent <Teleporter>().SetIsValid(false);
         //Debug.Log("pawn use teleporter: " + selectedPawn.currentCell.building.GetComponent<Teleporter>().GetIsValid());
         ActiveTransferButton();
     }
 }