Example #1
0
        public void Run(Entities.Drawable d)
        {
            if (Game.doTick)
            {
                if (Game.g.rng.Next(0, 100) <= 5)
                {
                    List <string> set = new List <string>();
                    set.AddRange(randomThoughtSet[currentSet]);
                    set.AddRange(genericRandomToughts);

                    var thought = set[Game.g.rng.Next(set.Count)];
                    if (lastThought != thought)
                    {
                        Game.g.LogCombat(thought);
                        lastThought = thought;
                    }
                }

                if (Util.Dist(d.pos.xPos, d.pos.yPos, Game.g.princess.pos.xPos, Game.g.princess.pos.yPos) < 1.5 && Game.g.princess.active)
                {
                    for (int k = 0; k < endThoughtSet[currentSet].Count; k++)
                    {
                        Game.g.LogCombat(endThoughtSet[currentSet][k]);
                    }

                    Game.g.princess.active = false;
                    if (currentSet < endThoughtSet.Count)
                    {
                        currentSet++;
                    }
                }
            }
        }
Example #2
0
        public static bool CheckCollision(int xMove, int yMove, Entities.Drawable d)
        {
            int futureX = d.pos.xPos + xMove;
            int futureY = d.pos.yPos + yMove;

            if (Game.isInWorld(futureX, futureY))
            {
                if (Game.g.ground[futureX, futureY].Collideable == false && Game.g.world[futureX, futureY].Collideable == false)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }