Monster som inte dyker upp förren runda X

This almost looks like a game now!
This commit is contained in:
Niklas Ulf Anders Cullberg
2012-10-31 12:00:55 +01:00
parent 1c7c8b600d
commit 3106c0ea63
6 changed files with 835 additions and 801 deletions
+2 -2
View File
@@ -222,14 +222,14 @@ namespace DepthsBelow
}
}
#if DEBUG
/*#if DEBUG
var debugTexture = new Texture2D(GraphicsDevice, 1, 1);
debugTexture.SetData(new Color[] { Color.White });
foreach (var collisionComponent in EntityManager.GetComponents<Component.Collision>())
{
spriteBatch.Draw(debugTexture, collisionComponent.Rectangle, Color.Red * 0.5f);
}
#endif
#endif*/
// Draw mouse input visuals
MouseInput.Draw(spriteBatch);
+20 -4
View File
@@ -82,22 +82,38 @@ namespace DepthsBelow
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 mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
enemy.X = mapObjectGridPos.X;
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 mapObjectGridPos = Grid.WorldToGrid(mapObjectPos);
enemy.X = mapObjectGridPos.X;
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")
{
var door = new Door();
+6 -3
View File
@@ -11,19 +11,22 @@ namespace DepthsBelow
{
//EntityManager entityManager;
int wakingDistance = 7;
int wakingDistance = 12;
int sleepingDistance = 6;
int wakingTurn = 0;
string type;
List<SmallEnemy> swarm;
public MonsterSpawn(string _type, ref List<SmallEnemy> Swarm)
public MonsterSpawn(string _type, int _wakingDistance, int _wakingTurn, ref List<SmallEnemy> Swarm)
: base()
{
//this.entityManager = entityManager;
type = _type;
swarm = Swarm;
wakingDistance = _wakingDistance;
wakingTurn = _wakingTurn;
}
public override void Update(GameTime gameTime)
@@ -37,7 +40,7 @@ namespace DepthsBelow
this.GetComponent<Component.Transform>().Grid.Position.Y);
Vector2 distance2 = new Vector2(entity.GetComponent<Component.Transform>().Grid.Position.X,
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);
if (type == "BUB")
+2 -2
View File
@@ -19,7 +19,7 @@ namespace DepthsBelow
private PathFinder.Node nextNode;
public int numberOfSteps = 5;
public int numberOfSteps = 8;
public int currentStep = 0;
public bool AttackedThisTurn = false;
@@ -58,7 +58,7 @@ namespace DepthsBelow
{
Life = 50,
Defence = 25,
Strength = 26,
Strength = 70,
GetAim = 100,
GetDodge = 50
};
+7
View File
@@ -11,6 +11,8 @@ namespace DepthsBelow
/// </summary>
public class TurnManager
{
public static int currentTurn = 0;
/// <summary>
/// A player turn token.
/// </summary>
@@ -110,6 +112,11 @@ namespace DepthsBelow
currentTokenIndex = 0;
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="BossSpawn" x="832" y="2720" width="32" height="32"/>
<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="992" y="2688" 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="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>
<layer name="Collision" width="256" height="256">
<data encoding="base64" compression="zlib">