Monster som inte dyker upp förren runda X
This almost looks like a game now!
This commit is contained in:
@@ -222,14 +222,14 @@ namespace DepthsBelow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
/*#if DEBUG
|
||||||
var debugTexture = new Texture2D(GraphicsDevice, 1, 1);
|
var debugTexture = new Texture2D(GraphicsDevice, 1, 1);
|
||||||
debugTexture.SetData(new Color[] { Color.White });
|
debugTexture.SetData(new Color[] { Color.White });
|
||||||
foreach (var collisionComponent in EntityManager.GetComponents<Component.Collision>())
|
foreach (var collisionComponent in EntityManager.GetComponents<Component.Collision>())
|
||||||
{
|
{
|
||||||
spriteBatch.Draw(debugTexture, collisionComponent.Rectangle, Color.Red * 0.5f);
|
spriteBatch.Draw(debugTexture, collisionComponent.Rectangle, Color.Red * 0.5f);
|
||||||
}
|
}
|
||||||
#endif
|
#endif*/
|
||||||
|
|
||||||
// Draw mouse input visuals
|
// Draw mouse input visuals
|
||||||
MouseInput.Draw(spriteBatch);
|
MouseInput.Draw(spriteBatch);
|
||||||
|
|||||||
@@ -82,22 +82,38 @@ namespace DepthsBelow
|
|||||||
|
|
||||||
core.Squad.Add(soldier);
|
core.Squad.Add(soldier);
|
||||||
}
|
}
|
||||||
if (mapObject.Type == "MonsterSpawn")
|
if (mapObject.Type == "MonsterSpawn" || mapObject.Type == "EnemySpawn")
|
||||||
{
|
{
|
||||||
var enemy = new MonsterSpawn("Monster", ref core.Swarm);
|
var enemy = new MonsterSpawn("Monster", 14, 0, ref core.Swarm);
|
||||||
var mapObjectPos = new Vector2(mapObject.Bounds.X, mapObject.Bounds.Y - Grid.TileSize);
|
var mapObjectPos = new Vector2(mapObject.Bounds.X, mapObject.Bounds.Y - Grid.TileSize);
|
||||||
var mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
|
var mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
|
||||||
enemy.X = mapObjectGridPos.X;
|
enemy.X = mapObjectGridPos.X;
|
||||||
enemy.Y = mapObjectGridPos.Y;
|
enemy.Y = mapObjectGridPos.Y;
|
||||||
}
|
}
|
||||||
if (mapObject.Type == "BossSpawn")
|
if (mapObject.Type == "AmbushMonsterSpawn" || mapObject.Type == "AmbushEnemySpawn")
|
||||||
{
|
{
|
||||||
var enemy = new MonsterSpawn("BUB", ref core.Swarm);
|
var enemy = new MonsterSpawn("Monster", 2, 0, ref core.Swarm);
|
||||||
var mapObjectPos = new Vector2(mapObject.Bounds.X, mapObject.Bounds.Y - Grid.TileSize);
|
var mapObjectPos = new Vector2(mapObject.Bounds.X, mapObject.Bounds.Y - Grid.TileSize);
|
||||||
var mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
|
var mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
|
||||||
enemy.X = mapObjectGridPos.X;
|
enemy.X = mapObjectGridPos.X;
|
||||||
enemy.Y = mapObjectGridPos.Y;
|
enemy.Y = mapObjectGridPos.Y;
|
||||||
}
|
}
|
||||||
|
if (mapObject.Type == "DelayedMonsterSpawn" || mapObject.Type == "DelayedEnemySpawn")
|
||||||
|
{
|
||||||
|
var enemy = new MonsterSpawn("Monster", 200, 8, ref core.Swarm);
|
||||||
|
var mapObjectPos = new Vector2(mapObject.Bounds.X, mapObject.Bounds.Y - Grid.TileSize);
|
||||||
|
var mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
|
||||||
|
enemy.X = mapObjectGridPos.X;
|
||||||
|
enemy.Y = mapObjectGridPos.Y;
|
||||||
|
}
|
||||||
|
/*if (mapObject.Type == "BossSpawn")
|
||||||
|
{
|
||||||
|
var enemy = new MonsterSpawn("BUB", 12, 0, ref core.Swarm);
|
||||||
|
var mapObjectPos = new Vector2(mapObject.Bounds.X, mapObject.Bounds.Y - Grid.TileSize);
|
||||||
|
var mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
|
||||||
|
enemy.X = mapObjectGridPos.X;
|
||||||
|
enemy.Y = mapObjectGridPos.Y;
|
||||||
|
}*/
|
||||||
if (mapObject.Type == "Door")
|
if (mapObject.Type == "Door")
|
||||||
{
|
{
|
||||||
var door = new Door();
|
var door = new Door();
|
||||||
|
|||||||
@@ -11,19 +11,22 @@ namespace DepthsBelow
|
|||||||
{
|
{
|
||||||
//EntityManager entityManager;
|
//EntityManager entityManager;
|
||||||
|
|
||||||
int wakingDistance = 7;
|
int wakingDistance = 12;
|
||||||
int sleepingDistance = 6;
|
int sleepingDistance = 6;
|
||||||
|
int wakingTurn = 0;
|
||||||
|
|
||||||
string type;
|
string type;
|
||||||
|
|
||||||
List<SmallEnemy> swarm;
|
List<SmallEnemy> swarm;
|
||||||
|
|
||||||
public MonsterSpawn(string _type, ref List<SmallEnemy> Swarm)
|
public MonsterSpawn(string _type, int _wakingDistance, int _wakingTurn, ref List<SmallEnemy> Swarm)
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
//this.entityManager = entityManager;
|
//this.entityManager = entityManager;
|
||||||
type = _type;
|
type = _type;
|
||||||
swarm = Swarm;
|
swarm = Swarm;
|
||||||
|
wakingDistance = _wakingDistance;
|
||||||
|
wakingTurn = _wakingTurn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(GameTime gameTime)
|
public override void Update(GameTime gameTime)
|
||||||
@@ -37,7 +40,7 @@ namespace DepthsBelow
|
|||||||
this.GetComponent<Component.Transform>().Grid.Position.Y);
|
this.GetComponent<Component.Transform>().Grid.Position.Y);
|
||||||
Vector2 distance2 = new Vector2(entity.GetComponent<Component.Transform>().Grid.Position.X,
|
Vector2 distance2 = new Vector2(entity.GetComponent<Component.Transform>().Grid.Position.X,
|
||||||
entity.GetComponent<Component.Transform>().Grid.Position.Y);
|
entity.GetComponent<Component.Transform>().Grid.Position.Y);
|
||||||
if (Vector2.Distance(distance1, distance2) < wakingDistance/* && Vector2.Distance(distance1, distance2) > sleepingDistance*/)
|
if (Vector2.Distance(distance1, distance2) < wakingDistance && TurnManager.currentTurn >= wakingTurn/* && Vector2.Distance(distance1, distance2) > sleepingDistance*/)
|
||||||
{
|
{
|
||||||
var enemy = new SmallEnemy(ref swarm);
|
var enemy = new SmallEnemy(ref swarm);
|
||||||
if (type == "BUB")
|
if (type == "BUB")
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace DepthsBelow
|
|||||||
|
|
||||||
private PathFinder.Node nextNode;
|
private PathFinder.Node nextNode;
|
||||||
|
|
||||||
public int numberOfSteps = 5;
|
public int numberOfSteps = 8;
|
||||||
public int currentStep = 0;
|
public int currentStep = 0;
|
||||||
|
|
||||||
public bool AttackedThisTurn = false;
|
public bool AttackedThisTurn = false;
|
||||||
@@ -58,7 +58,7 @@ namespace DepthsBelow
|
|||||||
{
|
{
|
||||||
Life = 50,
|
Life = 50,
|
||||||
Defence = 25,
|
Defence = 25,
|
||||||
Strength = 26,
|
Strength = 70,
|
||||||
GetAim = 100,
|
GetAim = 100,
|
||||||
GetDodge = 50
|
GetDodge = 50
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ namespace DepthsBelow
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class TurnManager
|
public class TurnManager
|
||||||
{
|
{
|
||||||
|
public static int currentTurn = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A player turn token.
|
/// A player turn token.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -110,6 +112,11 @@ namespace DepthsBelow
|
|||||||
currentTokenIndex = 0;
|
currentTokenIndex = 0;
|
||||||
|
|
||||||
Debug.WriteLine(prevTurn.Name + " turn ended. Current turn: " + CurrentTurn.Name);
|
Debug.WriteLine(prevTurn.Name + " turn ended. Current turn: " + CurrentTurn.Name);
|
||||||
|
if (CurrentTurn.Name == "Player")
|
||||||
|
{
|
||||||
|
currentTurn++;
|
||||||
|
Console.WriteLine("Turn: " + currentTurn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<object type="SquadStart" x="768" y="2720" width="32" height="32"/>
|
<object type="SquadStart" x="768" y="2720" width="32" height="32"/>
|
||||||
<object type="BossSpawn" x="832" y="2720" width="32" height="32"/>
|
<object type="BossSpawn" x="832" y="2720" width="32" height="32"/>
|
||||||
<object type="Door" x="640" y="2656" width="32" height="64"/>
|
<object type="Door" x="640" y="2656" width="32" height="64"/>
|
||||||
<object type="EnemySpawn" x="992" y="2304" width="32" height="32"/>
|
<object type="MonsterSpawn" x="992" y="2304" width="32" height="32"/>
|
||||||
<object type="EnemySpawn" x="1184" y="2144" width="32" height="32"/>
|
<object type="EnemySpawn" x="1184" y="2144" width="32" height="32"/>
|
||||||
<object type="EnemySpawn" x="992" y="2688" width="32" height="32"/>
|
<object type="EnemySpawn" x="992" y="2688" width="32" height="32"/>
|
||||||
<object type="EnemySpawn" x="1088" y="2560" width="32" height="32"/>
|
<object type="EnemySpawn" x="1088" y="2560" width="32" height="32"/>
|
||||||
@@ -59,6 +59,14 @@
|
|||||||
<object type="EnemySpawn" x="3424" y="800" width="32" height="32"/>
|
<object type="EnemySpawn" x="3424" y="800" width="32" height="32"/>
|
||||||
<object type="EnemySpawn" x="3424" y="640" width="32" height="32"/>
|
<object type="EnemySpawn" x="3424" y="640" width="32" height="32"/>
|
||||||
<object type="EnemySpawn" x="2112" y="640" width="32" height="32"/>
|
<object type="EnemySpawn" x="2112" y="640" width="32" height="32"/>
|
||||||
|
|
||||||
|
<object type="DelayedEnemySpawn" x="704" y="2624" width="32" height="32"/>
|
||||||
|
<object type="DelayedEnemySpawn" x="736" y="2656" width="32" height="32"/>
|
||||||
|
<object type="DelayedEnemySpawn" x="704" y="2720" width="32" height="32"/>
|
||||||
|
<object type="DelayedEnemySpawn" x="800" y="2656" width="32" height="32"/>
|
||||||
|
<object type="DelayedEnemySpawn" x="768" y="2720" width="32" height="32"/>
|
||||||
|
<object type="DelayedEnemySpawn" x="832" y="2720" width="32" height="32"/>
|
||||||
|
|
||||||
</objectgroup>
|
</objectgroup>
|
||||||
<layer name="Collision" width="256" height="256">
|
<layer name="Collision" width="256" height="256">
|
||||||
<data encoding="base64" compression="zlib">
|
<data encoding="base64" compression="zlib">
|
||||||
|
|||||||
Reference in New Issue
Block a user