Example #1
0
        public static GetItemInteraction GetRandomItemInteraction(AssetHandler assetHandler)
        {
            GetItemInteraction interaction;
            Item item;

            Random r    = new Random();
            int    rand = 0;

            if (rand == 0) //Weapon
            {
                interaction = new GetItemInteraction(Weapon.GetRandomWeapon(assetHandler), "Interaktion", "Interaktiontext");
            }
            else
            {
                interaction = new GetItemInteraction(Weapon.GetRandomWeapon(assetHandler), "Interak", "ItnerText");
            }



            return(interaction);
        }
Example #2
0
 private GetItemInteraction interaction; //Item-Interaktion für das Menü
 public GetItemPopupMenu(GetItemInteraction gii, Brush mB, int wX, int wY, Graphics g, DebugForm df) : base(mB, wX, wY, g, df)
 {
     interaction = gii;
 }
Example #3
0
        private GetItemInteraction interaction; //Item-Interaktion für das Menü

        public GetItemPopupMenu(AssetHandler assetHandler, GetItemInteraction gii, Brush mB, Brush iconBg, int wX, int wY, Graphics g, DebugForm df) : base(assetHandler, mB, iconBg, wX, wY, g, df)
        {
            interaction = gii;
        }
Example #4
0
        public static Tile GetRandomTile(AssetHandler assetHandler, DebugForm debugForm, int salt, Tileset tileset)
        {
            Random tempRand = new Random(salt);
            Tile   randTile = new Tile();

            int rand = tempRand.Next(0, 1000);

            if (debugForm != null)
            {
                debugForm.WriteLine("Random-Value: " + rand);
            }

            if (rand < 250)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = false;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_0];
                randTile.tileName       = "Plain_0";
            }
            else if (rand < 500)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = false;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_1];
                randTile.tileName       = "Plain_1";
            }
            else if (rand < 750)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = false;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_2];
                randTile.tileName       = "Plain_2";
            }
            else if (rand < 940)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = false;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_3];
                randTile.tileName       = "Plain_3";
            }
            else if (rand < 965)
            {
                randTile.isEnterable    = false;
                randTile.isInteractable = false;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_4];
                randTile.tileName       = "Plain_4";
            }
            else if (rand < 985)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = true;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_House_0];
                randTile.tileName       = "Plain_House_0";

                //randTile.interaction = new GetItemInteraction(Weapon.GetRandomWeapon(assetHandler),"Dorfbesuch","Willkommen im Dummy-Dorf, hier ist ein Item-Test!");
                randTile.interaction = GetItemInteraction.GetRandomItemInteraction(assetHandler);
            }
            else if (rand < 998)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = true;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_House_1];
                randTile.tileName       = "Plain_House_1";
            }
            else if (rand < 1000)
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = false;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Plain_Castle_0];
                randTile.tileName       = "Plain_Castle_0";
            }
            else
            {
                randTile.isEnterable    = true;
                randTile.isInteractable = true;
                randTile.tileBitmap     = tileset.TileIcons[(int)Tiles.Dummy];
                randTile.tileName       = "DUMMY";
            }



            return(randTile);
        }