Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Nicely Aligned^TM
- #region Load assets
- m_allTheBitmaps = new Dictionary<string, Bitmap>() {
- /* Namespaces:
- * s: room backgrounds (screens)
- * i: inventory items
- * w: world items
- * p: placed items
- * h: hotspot backgrounds
- * n: npc
- */
- { "s/gate_inside", new Bitmap("screens/gate_inside.jpg") },
- { "s/gate_outside", new Bitmap("screens/gate_outside.jpg") },
- { "s/wall", new Bitmap("screens/wall.jpg") },
- { "s/shed", new Bitmap("screens/shed.jpg") },
- { "s/inside_shed", new Bitmap("screens/inside_shed.png") },
- { "s/stables", new Bitmap("screens/stables.png") },
- { "s/inside_stables", new Bitmap("screens/inside_stables.png") },
- { "s/castle", new Bitmap("screens/castle.png") },
- { "s/inside_castle", new Bitmap("screens/inside_castle.png") },
- { "s/alchemist", new Bitmap("screens/alchemist.png") },
- { "i/endGame", new Bitmap("items/endGame.png") },
- { "i/shovel", new Bitmap("items/shovel.png") },
- { "i/coal", new Bitmap("items/coal.png") },
- { "i/hayBale", new Bitmap("items/hayBale.png") },
- { "i/planksAndNails", new Bitmap("items/planks.png") },
- { "i/water", new Bitmap("items/water.png") },
- { "i/nitrite", new Bitmap("items/nitrite.png") },
- { "i/sulfur", new Bitmap("items/sulfur.png") },
- { "i/nitric_acid", new Bitmap("items/nitric_acid.png") },
- { "i/sulfuric_acid", new Bitmap("items/sulfuric_acid.png") },
- { "i/glycerol", new Bitmap("items/glycerol.png") },
- { "i/conc_acid", new Bitmap("items/conc_acid.png") },
- { "i/explosive", new Bitmap("items/explosive.png") },
- { "w/hayBale-shed", new Bitmap("worlditems/hayBale-shed.png") },
- { "w/hayBale-stables", new Bitmap("worlditems/hayBale-stables.png") },
- { "w/planksAndNails", new Bitmap("worlditems/planks.png") },
- { "w/shovel", new Bitmap("worlditems/shovel.png") },
- { "w/coal", new Bitmap("worlditems/coal.png") },
- { "p/coal", new Bitmap("placeditems/coal.png") },
- { "p/explosive", new Bitmap("placeditems/explosive.png") },
- { "p/hayBale", new Bitmap("placeditems/hayBale.png") },
- { "p/plankedGate", new Bitmap("placeditems/plankedGate.png") },
- // TODO FIXME test object
- { "n/stickFigure", new Bitmap("npc/stick.png") },
- };
- m_measuringFont = new System.Drawing.Font("Arial", 12.0f / 96.0f, System.Drawing.GraphicsUnit.Inch);
- #endregion Load assets
- #region Initialize game objects
- m_allTheRooms = new Dictionary<string, GameScreen>() {
- { "gate", new GameScreen("Gate", m_allTheBitmaps["s/gate_inside"]) },
- { "outside_gate", new GameScreen("Outside castle walls", m_allTheBitmaps["s/gate_outside"]) },
- { "wall", new GameScreen("West wall", m_allTheBitmaps["s/wall"]) },
- { "shed", new GameScreen("Shed", m_allTheBitmaps["s/shed"]) },
- { "inside_shed", new GameScreen("Inside the shed", m_allTheBitmaps["s/inside_shed"]) },
- { "stables", new GameScreen("Stables", m_allTheBitmaps["s/stables"]) },
- { "inside_stables", new GameScreen("Inside the stables", m_allTheBitmaps["s/inside_stables"]) },
- { "castle", new GameScreen("Castle", m_allTheBitmaps["s/castle"]) },
- { "inside_castle", new GameScreen("Inside castle", m_allTheBitmaps["s/inside_castle"]) },
- { "alchemist", new GameScreen("Alchemist room", m_allTheBitmaps["s/alchemist"]) },
- };
- m_allTheInvItems = new Dictionary<string, InventoryItem>() {
- { "endGame", new InventoryItem("Finish game", m_allTheBitmaps["i/endGame"]) }, // Specially handled item
- { "shovel", new InventoryItem("Shovel", m_allTheBitmaps["i/shovel"]) },
- { "coal", new InventoryItem("Coal", m_allTheBitmaps["i/coal"]) },
- { "hayBale", new InventoryItem("Hay bale", m_allTheBitmaps["i/hayBale"]) },
- { "planksAndNails", new InventoryItem("Planks and nails", m_allTheBitmaps["i/planksAndNails"]) },
- { "water", new InventoryItem("Water", m_allTheBitmaps["i/water"]) },
- { "sulfur", new InventoryItem("Sulfur", m_allTheBitmaps["i/sulfur"]) },
- { "nitrite", new InventoryItem("Nitrite", m_allTheBitmaps["i/nitrite"]) },
- { "nitric_acid", new InventoryItem("Nitric Acid", m_allTheBitmaps["i/nitric_acid"]) },
- { "sulfuric_acid", new InventoryItem("Sulfuric Acid", m_allTheBitmaps["i/sulfuric_acid"]) },
- { "conc_acid", new InventoryItem("Concentrated Acid", m_allTheBitmaps["i/conc_acid"]) },
- { "glycerol", new InventoryItem("Glycerol", m_allTheBitmaps["i/glycerol"]) },
- { "explosive", new InventoryItem("Explosive", m_allTheBitmaps["i/explosive"]) },
- };
- m_allTheWorldItems = new Dictionary<string, WorldItem>() {
- { "coal", new WorldItem("Coal", m_allTheBitmaps["w/coal"], new Vector2f(47, 854), m_allTheInvItems["coal"]) },
- { "hayBale-shed", new WorldItem("Hay bale", m_allTheBitmaps["w/hayBale-shed"], new Vector2f(1155, 125), m_allTheInvItems["hayBale"]) },
- { "hayBale-stables", new WorldItem("Hay bale", m_allTheBitmaps["w/hayBale-stables"], new Vector2f(1416, 701), m_allTheInvItems["hayBale"]) },
- { "shovel", new WorldItem("Shovel", m_allTheBitmaps["w/shovel"], new Vector2f(243, 694), m_allTheInvItems["shovel"]) },
- { "water1", new WorldItem("Water", m_allTheBitmaps["i/water"], new Vector2f(665, 678), m_allTheInvItems["water"]) },
- { "water2", new WorldItem("Water", m_allTheBitmaps["i/water"], new Vector2f(665, 678), m_allTheInvItems["water"]) },
- { "nitrite", new WorldItem("Nitrite", m_allTheBitmaps["i/nitrite"], new Vector2f(792, 704), m_allTheInvItems["nitrite"]) },
- { "sulfur", new WorldItem("Sulfur", m_allTheBitmaps["i/sulfur"], new Vector2f(907, 705), m_allTheInvItems["sulfur"]) },
- { "glycerol", new WorldItem("Glycerol", m_allTheBitmaps["i/glycerol"], new Vector2f(641, 716), m_allTheInvItems["glycerol"]) },
- { "plankAndNails", new WorldItem("Planks and nails", m_allTheBitmaps["w/planksAndNails"], new Vector2f(0, 594), m_allTheInvItems["planksAndNails"]) },
- };
- m_allThePlacedItems = new Dictionary<string, PlacedItem>() {
- { "hayBale", new PlacedItem(m_allTheBitmaps["p/hayBale"], 10, new Rectanglef(817, 694, 285, 105), m_allTheInvItems["hayBale"]) },
- { "plankedGate", new PlacedItem(m_allTheBitmaps["p/plankedGate"], 20, new Rectanglef(674, 394, 549, 549), null) },
- { "coal1", new PlacedItem(m_allTheBitmaps["p/coal"], 15, new Rectanglef(786, 576, 224, 226), m_allTheInvItems["coal"]) },
- { "explosive1", new PlacedItem(m_allTheBitmaps["p/explosive"], 20, new Rectanglef(786, 560, 224, 226), m_allTheInvItems["explosive"]) },
- { "coal2", new PlacedItem(m_allTheBitmaps["p/coal"], 15, new Rectanglef(1010, 576, 224, 226), m_allTheInvItems["coal"]) },
- { "explosive2", new PlacedItem(m_allTheBitmaps["p/explosive"], 20, new Rectanglef(1010, 560, 224, 226), m_allTheInvItems["explosive"]) },
- };
- m_allTheHotspots = new Dictionary<string, ItemHotspot>() {
- { "gate", new ItemHotspot("Gate", new Rectanglef(818, 471, 285, 334)) },
- { "wall1", new ItemHotspot("Wall", new Rectanglef(786, 576, 224, 226)) },
- { "wall2", new ItemHotspot("Wall", new Rectanglef(1010, 576, 224, 226)) },
- };
- m_allThePossibilities = new Dictionary<string, HotspotPossibility>() {
- // Key is "hotspot:inventoryItem"
- { "gate:hayBale", new HotspotPossibility(m_allTheInvItems["hayBale"], m_allThePlacedItems["hayBale"]) },
- { "gate:planksAndNails", new HotspotPossibility(m_allTheInvItems["planksAndNails"], m_allThePlacedItems["plankedGate"]) },
- { "wall:coal1", new HotspotPossibility(m_allTheInvItems["coal"], m_allThePlacedItems["coal1"]) },
- { "wall:explosive1", new HotspotPossibility(m_allTheInvItems["explosive"], m_allThePlacedItems["explosive1"]) },
- { "wall:coal2", new HotspotPossibility(m_allTheInvItems["coal"], m_allThePlacedItems["coal2"]) },
- { "wall:explosive2", new HotspotPossibility(m_allTheInvItems["explosive"], m_allThePlacedItems["explosive2"]) },
- };
- m_allTheNPCs = new Dictionary<string, NPC>() {
- // TODO FIXME test objects
- { "stickFigure", new NPC("Stickfigure", m_allTheBitmaps["n/stickFigure"], new Rectanglef(1314, 448, 285, 334)) },
- };
- m_allTheQuests = new Dictionary<string, NPCQuest>() {
- // TODO FIXME test objects
- { "stickFigureOne", new NPCQuest(NPCQuestRequirement.PUT_ITEM, new object[] { m_allTheHotspots["gate"], m_allThePlacedItems["hayBale"] },
- NPCQuestReward.ITEM, new object[] { m_allTheInvItems["planksAndNails"] },
- new string[] { "Put hay at the gate", "do it", "mawfakka" }) },
- { "stickFigureTwo", new NPCQuest(NPCQuestRequirement.NULL, null,
- NPCQuestReward.NULL, null,
- new string[] { "have this plank and nails", "go away now" }) },
- };
- // Finish quest creation
- // TODO FIXME test object
- m_allTheQuests["stickFigureOne"].SetNextQuest(m_allTheQuests["stickFigureTwo"]);
- // Finish NPC creation
- // TODO FIXME test object
- m_allTheNPCs["stickFigure"].CurrentQuest = m_allTheQuests["stickFigureOne"];
- #endregion Initialize game objects
- #region Link objects
- // Link rooms
- m_allTheRooms["gate"] .AddLink(ScreenEdges.LEFT, m_allTheRooms["wall"]);
- m_allTheRooms["gate"] .AddLink(ScreenEdges.RIGHT, m_allTheRooms["shed"]);
- m_allTheRooms["gate"] .AddLink(ScreenEdges.DOWN, m_allTheRooms["castle"]);
- m_allTheRooms["gate"] .AddLink(new Rectanglef(815, 400, 287, 402), m_allTheRooms["outside_gate"]);
- m_allTheRooms["outside_gate"] .AddLink(new Rectanglef(815, 400, 287, 402), m_allTheRooms["gate"]);
- m_allTheRooms["wall"] .AddLink(ScreenEdges.RIGHT, m_allTheRooms["gate"]);
- m_allTheRooms["shed"] .AddLink(ScreenEdges.LEFT, m_allTheRooms["gate"]);
- m_allTheRooms["shed"] .AddLink(ScreenEdges.RIGHT, m_allTheRooms["stables"]);
- m_allTheRooms["shed"] .AddLink(new Rectanglef(753, 449, 413, 549), m_allTheRooms["inside_shed"]);
- m_allTheRooms["stables"] .AddLink(ScreenEdges.LEFT, m_allTheRooms["shed"]);
- m_allTheRooms["stables"] .AddLink(new Rectanglef(1134, 729, 114, 275), m_allTheRooms["inside_stables"]);
- m_allTheRooms["castle"] .AddLink(new Rectanglef(0, 960, 803, 118), m_allTheRooms["gate"]);
- m_allTheRooms["castle"] .AddLink(new Rectanglef(1117, 960, 803, 118), m_allTheRooms["gate"]);
- m_allTheRooms["castle"] .AddLink(new Rectanglef(804, 860, 314, 220), m_allTheRooms["inside_castle"]);
- m_allTheRooms["inside_castle"] .AddLink(ScreenEdges.LEFT, m_allTheRooms["alchemist"]);
- m_allTheRooms["inside_castle"] .AddLink(ScreenEdges.DOWN, m_allTheRooms["castle"]);
- m_allTheRooms["alchemist"] .AddLink(ScreenEdges.RIGHT, m_allTheRooms["inside_castle"]);
- m_allTheRooms["inside_shed"] .AddLink(new Rectanglef(532, 957, 754, 144), m_allTheRooms["shed"]);
- m_allTheRooms["inside_stables"] .AddLink(new Rectanglef(599, 944, 498, 131), m_allTheRooms["stables"]);
- // Place items in rooms
- m_allTheRooms["inside_shed"] .AddItem(m_allTheWorldItems["shovel"]);
- m_allTheRooms["inside_shed"] .AddItem(m_allTheWorldItems["coal"]);
- m_allTheRooms["inside_shed"] .AddItem(m_allTheWorldItems["hayBale-shed"]);
- m_allTheRooms["inside_stables"] .AddItem(m_allTheWorldItems["hayBale-stables"]);
- m_allTheRooms["alchemist"] .AddItem(m_allTheWorldItems["water1"]);
- m_allTheRooms["alchemist"] .AddItem(m_allTheWorldItems["water2"]); // Intentionally twice
- m_allTheRooms["alchemist"] .AddItem(m_allTheWorldItems["nitrite"]);
- m_allTheRooms["alchemist"] .AddItem(m_allTheWorldItems["sulfur"]);
- m_allTheRooms["alchemist"] .AddItem(m_allTheWorldItems["glycerol"]);
- m_allTheRooms["inside_stables"] .AddItem(m_allTheWorldItems["plankAndNails"]);
- // Place NPCs
- // TODO FIXME test object
- m_allTheRooms["inside_stables"].AddNPC(m_allTheNPCs["stickFigure"]);
- // Add crafting combinations
- m_allTheInvItems["water"] .AddCombination(m_allTheInvItems["sulfur"], m_allTheInvItems["sulfuric_acid"]);
- m_allTheInvItems["water"] .AddCombination(m_allTheInvItems["nitrite"], m_allTheInvItems["nitric_acid"]);
- m_allTheInvItems["nitric_acid"] .AddCombination(m_allTheInvItems["sulfuric_acid"], m_allTheInvItems["conc_acid"]);
- m_allTheInvItems["conc_acid"] .AddCombination(m_allTheInvItems["glycerol"], m_allTheInvItems["explosive"]);
- // Add hotspots to screens
- m_allTheRooms["gate"].AddHotspot(m_allTheHotspots["gate"]);
- m_allTheRooms["wall"].AddHotspot(m_allTheHotspots["wall1"]);
- m_allTheRooms["wall"].AddHotspot(m_allTheHotspots["wall2"]);
- // Add possibilities to hotspots
- m_allTheHotspots["gate"] .AddPossibility(m_allThePossibilities["gate:hayBale"]);
- m_allTheHotspots["gate"] .AddPossibility(m_allThePossibilities["gate:planksAndNails"]);
- m_allTheHotspots["wall1"].AddPossibility(m_allThePossibilities["wall:coal1"]);
- m_allTheHotspots["wall1"].AddPossibility(m_allThePossibilities["wall:explosive1"]);
- m_allTheHotspots["wall2"].AddPossibility(m_allThePossibilities["wall:coal2"]);
- m_allTheHotspots["wall2"].AddPossibility(m_allThePossibilities["wall:explosive2"]);
- #endregion Link objects
Advertisement
Add Comment
Please, Sign In to add comment