public void ActivateTrap(DungeonCharacter player)
        {
            Controller.Log($"{player.Name} got hit by a poison dart trap.");
            Random rand = new Random();

            player.TakeDamage(rand.Next(15, 35));
        }
        public void ActivateTrap(DungeonCharacter player)
        {
            Controller.Log($"{player.Name} walked into a bear trap.");
            Random rand = new Random();

            player.TakeDamage(rand.Next(15) + 1);
        }
 public void Initialize(DungeonCharacter dc, CharBehaviour c)
 {
     dchar = dc;
     charBehaviour = c;
     c.achar = this;
     planned = false;
 }
        public void ActivateTrap(DungeonCharacter player)
        {
            Controller.Log($"{player.Name} fell into a spike pit.");
            Random rand = new Random();

            player.TakeDamage(rand.Next(5, 21));
        }
Beispiel #5
0
    public static string[] OptionsFor(DungeonCharacter dc)
    {
        List<string> performed = dc.actions.Select(a => a.execName).ToList();
        List<string> optionList = new List<string>();

        if (!performed.Contains("move")) {
            optionList.Add("Move");
        }
        if (!performed.Contains("lob") && !performed.Contains("attack") && !performed.Contains("strand") && !performed.Contains("skill")) {
            //optionList.Add("Strand");
            if (dc.entity.AnyAbove()) {
                optionList.Add("Lob");
                //optionList.Add("Put down");
            }
            else {
                optionList.Add("Lift");
                optionList.Add("Attack");
                optionList.Add("Whirlwind");
                optionList.Add("Inferno");
            }
        }
        if (dc.entity.tile.exitable) {
            optionList.Add("Exit");
        }

        return optionList.ToArray();
    }
Beispiel #6
0
    public Inferno(DungeonCharacter dc)
    {
        dchar = dc;

        tileRange = dchar.GetPassTileRange(range);

        config = new TileActionConfig(tileRange);
    }
Beispiel #7
0
    public Lob(DungeonCharacter dc)
    {
        dchar = dc;

        //not really. fix with a different tile range function later
        tileRange = dchar.GetPassTileRange(dchar.character.lobRange, null, null, LobbableTile);
        config = new TileActionConfig(tileRange);
    }
Beispiel #8
0
 public LiftExec(DungeonCharacter dc, DungeonEntity b, Tile t)
 {
     dchar = dc;
     target = dc.entity.tile;
     bottom = b;
     origin = t;
     lifted = t.entities.ToArray();
     origCount = origin.entities.IndexOf(bottom);
 }
Beispiel #9
0
    public Attack(DungeonCharacter dc)
    {
        dchar = dc;

        tileRange = dchar.entity.tile.GetNeighbors();
        tileRange.RemoveAll(t => t.entities.Count == 0 || t.GetBottomChar() == null);

        config = new TileActionConfig(tileRange);
    }
Beispiel #10
0
    public Move(DungeonCharacter dc)
    {
        dchar = dc;

        rangesLeft = new Dictionary<int, float>();
        parents = new Dictionary<int, int>();

        tileRange = dchar.GetPassTileRange(dc.character.moveRange, rangesLeft, parents, dchar.TraversibleTile);
        config = new TileActionConfig(tileRange);
    }
Beispiel #11
0
    public void Select(DungeonCharacter dc, ReturnFunction rf, CancelFunction cf)
    {
        rfunc = rf;
        cfunc = cf;
        dchar = dc;

        options = OptionsFor(dc);
        selIndex = 0;

        screenPos = Camera.mainCamera.WorldToScreenPoint(dc.entity.tile.worldPos);
        screenPos.y = Screen.height - screenPos.y;

        selecting = true;
    }
    public void RemoveCharacter(DungeonCharacter character)
    {
        switch (character.faction)
        {
        case CharacterFaction.PLAYER:
            Players.Remove(character);
            break;

        case CharacterFaction.FRIENDLY:
            Friendlies.Remove(character);
            break;

        case CharacterFaction.ENEMY:
            Enemies.Remove(character);
            break;

        default:
            break;
        }
    }
        public void Battle(DungeonCharacter opponent)
        {
            Controller.Log($"{opponent.Name} battles {Name}.");
            Controller.Log("---------------------------------------------");

            while (opponent.StillAlive && StillAlive)
            {
                opponent.MakeBattleMove(opponent.ChooseBattleOption(), this);

                if (StillAlive)
                {
                    MakeBattleMove(ChooseBattleOption(), opponent);
                }
            }

            if (StillAlive)
            {
                Controller.Log($"{opponent} was defeated by {Name}.");
            }
            else
            {
                Controller.Log($"{Name} was defeated by {opponent}.");
            }
        }
Beispiel #14
0
 public InfernoExec(DungeonCharacter dc, Tile t)
 {
     dchar = dc;
     target = t;
 }
Beispiel #15
0
 public MoveExec(DungeonCharacter dc, Tile o, Tile t, List<Tile> p)
 {
     dchar = dc;
     target = t;
     origin = o;
     path = p;
     movingEntities = dc.entity.AllAbove(true);
 }
Beispiel #16
0
 public string GetMessage(DungeonCharacter attacker, DungeonCharacter target)
 {
     return($"{attacker.Name} attacks {target.Name} using {Description}.");
 }
Beispiel #17
0
 public LobExec(DungeonCharacter dc, Tile t)
 {
     dchar = dc;
     lobbees = dc.entity.AllAbove(false).ToArray();
     target = t;
 }
Beispiel #18
0
 public AttackExec(DungeonCharacter dc, DungeonCharacter t)
 {
     dchar = dc;
     dtarget = t;
 }
Beispiel #19
0
 public IEnumerator StartCharSelect(DungeonCharacter bchar)
 {
     yield return 0;
     charSelect.Select(bchar, SetAction, Cancel);
 }
Beispiel #20
0
 public WhirlwindExec(DungeonCharacter dc, Tile t)
 {
     dchar = dc;
     target = t;
 }