Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Creatures.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
public abstract class Creatures
{
public string Name { get; private set; }
public int Health { get; set; }
public int NumberOfCoins { get; set; }

public Creatures(string name, int health, int numberOfCoins)
{
Name = name;
Health = health;
NumberOfCoins = numberOfCoins;
}

public abstract void PickUpCoins(bool pickingUpCoins, int coins);
public abstract void Attack(IDamagable attacked, int damageTaken);
public abstract void Defense(bool defended, int damage, int damageReduction, int damageTaken);
}
}
11 changes: 11 additions & 0 deletions DungeonExplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,22 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Statistics.cs" />
<Compile Include="LongRange.cs" />
<Compile Include="Melee.cs" />
<Compile Include="Heals.cs" />
<Compile Include="Creatures.cs" />
<Compile Include="GameMap.cs" />
<Compile Include="Interfaces.cs" />
<Compile Include="Inventory.cs" />
<Compile Include="Item.cs" />
<Compile Include="Monster.cs" />
<Compile Include="Game.cs" />
<Compile Include="Player.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Room.cs" />
<Compile Include="Test.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
391 changes: 386 additions & 5 deletions Game.cs

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions GameMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
abstract class GameMap
{
public string RoomName { get; private set; }
public bool RoomEntered { get; set; }
public bool RoomLocked { get; set; }
public string RoomType { get; private set; }
public string RoomDescription { get; private set; }

public GameMap(string roomName, bool roomEntered, bool roomLocked, string roomType, string roomDescription)
{
RoomName = roomName;
RoomEntered = roomEntered;
RoomLocked = roomLocked;
RoomType = roomType;
RoomDescription = roomDescription;
}

abstract public void EnterRoom();

abstract public void UnlockRoom();

abstract public string GetDescription();
}
}
27 changes: 27 additions & 0 deletions Heals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
class Heals : Item, ICollectible
{
public int HealthIncrease { get; set; }

public Heals(string itemName, string itemDescription,
int itemDurability, string itemType, int healthIncrease) :
base(itemName, itemDescription, itemDurability, itemType)
{
HealthIncrease = healthIncrease;
}

public void Collected()
{
Console.WriteLine($"{ItemName}s can heal by {HealthIncrease}");
Console.WriteLine($"There is a {ItemName} on the ground, press X to pick it up");
}

}
}
19 changes: 19 additions & 0 deletions Interfaces.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
public interface IDamagable
{
void Damaged(int damageTaken);
}

public interface ICollectible
{
void Collected();
}

}
52 changes: 52 additions & 0 deletions Inventory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
class Inventory
{
private Dictionary<string, string> inventoryItems;

public Inventory()
{
inventoryItems = new Dictionary<string, string>();
}

public Dictionary<string, string> GetItemType(string itemType)
{
Dictionary<string, string> ItemsToReturn = new Dictionary<string, string>();
foreach (var item in inventoryItems)
{
if (item.Value == itemType)
{
ItemsToReturn.Add(item.Key, item.Value);
}
}
return ItemsToReturn;

}


public void AddItem(string itemName, string itemType)
{
Console.ReadKey();
inventoryItems.Add(itemName, itemType);
Console.WriteLine($"{itemName} has been added to inventory");
}

public void RemoveItem(string itemName)
{
inventoryItems.Remove(itemName);
Console.WriteLine($"{itemName} has been removed from inventory");
}

public string InventoryContents()
{
return string.Join(", ", inventoryItems);
}
}
}
27 changes: 27 additions & 0 deletions Item.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
abstract class Item
{
public string ItemName { get; private set; }
public string ItemDescription { get; private set; }
public int ItemDurability { get; set; }
public string ItemType { get; private set; }
public int ItemSpace { get; private set; }

public Item(string itemName, string itemDescription, int itemDurability, string itemType)
{
ItemName = itemName;
ItemDescription = itemDescription;
ItemDurability = itemDurability;
ItemType = itemType;
}


}
}
31 changes: 31 additions & 0 deletions LongRange.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
class LongRange : Item, ICollectible
{
public int ItemDamage { get; set; }
public int AmmoNumber { get; set; }

public LongRange(string itemName, string itemDescriptiom,
int itemDurability, string itemType,int itemDamage, int ammoNumber) :
base(itemName, itemDescriptiom, itemDurability, itemType)
{
ItemDamage = itemDamage;
AmmoNumber = ammoNumber;

}

public void Collected()
{
Console.WriteLine($"{ItemName}s can do {ItemDamage}");
Console.WriteLine($"There is a {ItemName} on the ground, press X to pick it up");
}


}
}
28 changes: 28 additions & 0 deletions Melee.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DungeonExplorer
{
class Melee : Item, ICollectible
{

public string ItemEffect { get; set; }
public int ItemDamage { get; set; }
public Melee(string itemName, string itemDescription,
int itemDurability, string itemType, string itemEffect, int itemDamage) :
base(itemName, itemDescription, itemDurability, itemType)
{
ItemEffect = itemEffect;
ItemDamage = itemDamage;
}

public void Collected()
{
Console.WriteLine($"{ItemName} can do {ItemDamage} damage");
Console.WriteLine($"There is a {ItemName} on the ground, press any key to pick it up");
}
}
}
Loading