Exemplo n.º 1
0
        void UsePill(Pill pill)
        {
            pill.Use(Save.Kevin);
            switch (pill.Drug)
            {
            case DrugEffect.Uppers:
                break;

            //Prescription
            case DrugEffect.Uppers2:
                break;

            case DrugEffect.Painkiller1:
                Save.Kevin.Buffs.Add(Effect.ABSORB);
                break;

            //Prescription
            case DrugEffect.Painkiller2:
                Save.Kevin.Buffs.Add(Effect.ABSORB);
                Save.Kevin.Buffs.Add(Effect.REGEN);
                break;

            case DrugEffect.Steroids:
                Save.Kevin.Buffs.Add(Effect.DMGUP);
                break;

            //Prescription
            case DrugEffect.Steroids2:
                Save.Kevin.Buffs.Add(Effect.DMGUP);
                Save.Kevin.Buffs.Add(Effect.CRITUP);
                break;

            case DrugEffect.Vitamins1:
                Save.Kevin.MaxHP++;
                Save.Kevin.HP++;
                break;

            //Prescription
            case DrugEffect.Vitamins2:
                Save.Kevin.MaxHP += 2;
                Save.Kevin.HP     = Save.Kevin.MaxHP;
                break;

            //Prescription
            case DrugEffect.Vitamins3:
                Save.Kevin.MaxHP += 2;
                Save.Kevin.HP++;
                break;

            case DrugEffect.Expired1:
                Save.Kevin.HP--;
                break;

            //Prescription
            case DrugEffect.Expired2:
                Save.Kevin.Buffs.Add(Effect.DMGDOWN);
                break;

            //Prescription
            case DrugEffect.Expired3:
                Save.Kevin.MaxHP--;
                Save.Kevin.HP = Save.Kevin.MaxHP;
                break;

            //Prescription
            case DrugEffect.Knowledge:
                foreach (Room room in Save.GetFloor().Rooms)
                {
                }
                break;

            case DrugEffect.Bad1:
                Save.Kevin.Wealth -= 5;
                if (Save.Kevin.Wealth < 0)
                {
                    Save.Kevin.Wealth = 0;
                }
                break;

                //case DrugEffect.Bad1:
                //    Save.Kevin.Wealth -= 5;
                //    if (Save.Kevin.Wealth < 0)
                //        Save.Kevin.Wealth = 0;
                //    break;
            }
        }
Exemplo n.º 2
0
        void DrawMiniMap()
        {
            // Get center offset Vector
            int imin = (int)Save.GetFloor().Position.X;
            int imax = (int)Save.GetFloor().Position.X;
            int jmin = (int)Save.GetFloor().Position.Y;
            int jmax = (int)Save.GetFloor().Position.Y;

            for (int i = 0; i < Save.GetFloor().Max.X; i++)
            {
                for (int j = 0; j < Save.GetFloor().Max.Y; j++)
                {
                    if (Save.GetFloor().Rooms[i, j].Exists)
                    {
                        if (i < imin)
                        {
                            imin = i;
                        }
                        if (i > imax)
                        {
                            imax = i;
                        }
                        if (j < jmin)
                        {
                            jmin = j;
                        }
                        if (j > jmax)
                        {
                            jmax = j;
                        }
                    }
                }
            }

            Vector2 offset = new Vector2((imax - imin) * 23, (jmax - jmin) * 23);
            Vector2 diff   = new Vector2(1150, 588) - offset / 2;

            SpriteBatch.DrawString(SegeoUiMono, "Depth: " + Save.Depth.ToString(), OffsetVector + new Vector2(1056, 470), brightwhite);
            for (int i = imin; i < Save.GetFloor().Max.X; i++)
            {
                for (int j = jmin; j < Save.GetFloor().Max.Y; j++)
                {
                    Room room = Save.GetFloor().Rooms[i, j];
                    if (room.Exists)
                    {
                        if (room == Save.GetRoom())
                        {
                            SpriteBatch.Draw(CurrentMiniRoom, OffsetVector + diff + new Vector2((i - imin) * 23, (j - jmin) * 23), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
                        }
                        else
                        {
                            if (room.Known)
                            {
                                Draw(VisitedMiniRoom, diff + new Vector2((i - imin) * 23, (j - jmin) * 23));
                            }
                            else
                            {
                                Draw(UnVisitedMiniRoom, diff + new Vector2((i - imin) * 23, (j - jmin) * 23));
                            }
                            if (room.HasEnemy() && room.Visited)
                            {
                                Draw(MiniEnemy, diff + new Vector2((i - imin) * 23 + 2, (j - jmin) * 23 + 6));
                            }
                            if (room.HasHealth() && room.Visited)
                            {
                                Draw(MiniDoor, diff + new Vector2((i - imin) * 23 + 2, (j - jmin) * 23 + 10));
                            }
                            if (room.HasItem() && room.Visited)
                            {
                                Draw(MiniPrize, diff + new Vector2((i - imin) * 23 + 2, (j - jmin) * 23 + 14));
                            }
                            if (room.HasStairs && room.Visited)
                            {
                                Draw(MiniSolid, diff + new Vector2((i - imin) * 23 + 6, (j - jmin) * 23 + 6));
                            }
                        }
                        if (room.HasSouthDoor())
                        {
                            SpriteBatch.Draw(MiniDoorHorizontal, OffsetVector + diff + new Vector2((i - imin) * 23 + 4, (j - jmin) * 23 + 19), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
                        }
                        if (room.HasWestDoor())
                        {
                            SpriteBatch.Draw(MiniDoorVertrical, OffsetVector + diff + new Vector2((i - imin) * 23 - 4, (j - jmin) * 23 + 4), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        void ChangeRooms()
        {
            bool newroom = false;

            Save.GetRoom().Remove(Save.Kevin);
            if (Save.Kevin.Position.X == 0)
            {
                Save.GetFloor().Position.X -= 1;
                if (!Save.GetRoom().Visited)
                {
                    newroom = true;
                }
                Save.GetRoom().Visited = true;
                for (int i = 1; i < 8; i++)
                {
                    if (Save.GetRoom().Tiles[14, i].Door)
                    {
                        Save.Kevin.Position = new Vector2I(14, i);
                    }
                }
            }
            else if (Save.Kevin.Position.X == 14)
            {
                Save.GetFloor().Position.X += 1;
                if (!Save.GetRoom().Visited)
                {
                    newroom = true;
                }
                Save.GetRoom().Visited = true;
                for (int i = 1; i < 8; i++)
                {
                    if (Save.GetRoom().Tiles[0, i].Door)
                    {
                        Save.Kevin.Position = new Vector2I(0, i);
                    }
                }
            }
            else if (Save.Kevin.Position.Y == 0)
            {
                Save.GetFloor().Position.Y -= 1;
                if (!Save.GetRoom().Visited)
                {
                    newroom = true;
                }
                Save.GetRoom().Visited = true;
                for (int i = 1; i < 13; i++)
                {
                    if (Save.GetRoom().Tiles[i, 9].Door)
                    {
                        Save.Kevin.Position = new Vector2I(i, 9);
                    }
                }
            }
            else if (Save.Kevin.Position.Y == 9)
            {
                Save.GetFloor().Position.Y += 1;
                for (int i = 1; i < 13; i++)
                {
                    if (Save.GetRoom().Tiles[i, 0].Door)
                    {
                        Save.Kevin.Position = new Vector2I(i, 0);
                    }
                }
            }
            if (!Save.GetRoom().Visited)
            {
                newroom = true;
            }
            Save.GetRoom().Visited = true;
            Save.GetRoom().Known   = true;
            Save.GetRoom().AddToRoom(Save.Kevin);
            UpdateOptions = true;
            if (newroom)
            {
                Do4XTurn();
            }
        }
Exemplo n.º 4
0
        void BuildMegaMap()
        {
            MegaMapButtons.RemoveAll(item => item.Action == "room" || item.Action == "door");
            // Get center offset Vector
            int imin = (int)Save.GetFloor().Position.X;
            int imax = (int)Save.GetFloor().Position.X;
            int jmin = (int)Save.GetFloor().Position.Y;
            int jmax = (int)Save.GetFloor().Position.Y;

            for (int i = 0; i < Save.GetFloor().Max.X; i++)
            {
                for (int j = 0; j < Save.GetFloor().Max.Y; j++)
                {
                    if (Save.GetFloor().Rooms[i, j].Exists)
                    {
                        if (i < imin)
                        {
                            imin = i;
                        }
                        if (i > imax)
                        {
                            imax = i;
                        }
                        if (j < jmin)
                        {
                            jmin = j;
                        }
                        if (j > jmax)
                        {
                            jmax = j;
                        }
                    }
                }
            }

            Vector2 offset = new Vector2((imax - imin) * 58, (jmax - jmin) * 58);
            Vector2 diff   = new Vector2(524, 364) - offset / 2;

            for (int i = 0; i < Save.GetFloor().Max.X; i++)
            {
                for (int j = 0; j < Save.GetFloor().Max.Y; j++)
                {
                    if (Save.GetFloor().Rooms[i, j].Exists)
                    {
                        if (Save.GetFloor().Rooms[i, j].Worked)
                        {
                            MegaMapButtons.Add(new RoomButton(PoweredRoom, diff + new Vector2((i - imin) * 58, (j - jmin) * 58), Save.GetFloor().Rooms[i, j]));
                        }
                        else
                        {
                            MegaMapButtons.Add(new RoomButton(MegaRoom, diff + new Vector2((i - imin) * 58, (j - jmin) * 58), Save.GetFloor().Rooms[i, j]));
                        }
                        if (Save.GetFloor().Rooms[i, j].HasSouthDoor())
                        {
                            MegaMapButtons.Add(new Button(MegaDoorHorizontal, diff + new Vector2((i - imin) * 58 + 13, (j - jmin) * 58 + 50) - new Vector2(14, 21), "door"));
                        }
                        if (Save.GetFloor().Rooms[i, j].HasWestDoor())
                        {
                            MegaMapButtons.Add(new Button(MegaDoorVertical, diff + new Vector2((i - imin) * 58 - 8, (j - jmin) * 58 + 13) - new Vector2(21, 14), "door"));
                        }
                    }
                }
            }
        }