diff --git a/DepthsBelow/DepthsBelow/Component/Shooting.cs b/DepthsBelow/DepthsBelow/Component/Shooting.cs
deleted file mode 100644
index 382d5ac..0000000
--- a/DepthsBelow/DepthsBelow/Component/Shooting.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace DepthsBelow.Component
-{
- class Shooting : Component
- {
- protected int stepsTaken = 0;
- protected int distanceToTarget = 0;
- protected int panic = 0;
- protected int soldierAim = 0;
- protected int weaponAccuracy = 0;
- protected int enemyDodge = 0;
-
- protected int penaltyRange = 5;
-
- public Shooting(Entity parent) : base (parent)
- {
-
- }
-
- public bool targetInSight()
- {
- return false;
- }
-
- public int CalculateChance()
- {
- int baseHitChance = soldierAim + weaponAccuracy;
- int baseDodgeChance = panic + enemyDodge;
- int basePenalty = ReturnPenalty(stepsTaken) + (int)(ReturnPenalty(distanceToTarget) / 2);
- int chanceToHit = baseHitChance - baseDodgeChance - basePenalty;
- return chanceToHit;
- }
-
- public int ReturnPenalty(int distance)
- {
- int penalty = 0;
- if (distance >= penaltyRange * 3)
- {
- penalty = 100;
- }
- else if (distance >= penaltyRange * 2)
- {
- distance -= penaltyRange * 2;
- penalty = penaltyRange + penaltyRange * 3 + distance * 5;
- }
- else if (distance >= penaltyRange)
- {
- distance -= penaltyRange;
- penalty = penaltyRange + distance * 3;
- }
- else
- {
- penalty = distance;
- }
- return penalty;
- }
- }
-}
diff --git a/DepthsBelow/DepthsBelow/Component/Stat.cs b/DepthsBelow/DepthsBelow/Component/Stat.cs
new file mode 100644
index 0000000..4412f8a
--- /dev/null
+++ b/DepthsBelow/DepthsBelow/Component/Stat.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace DepthsBelow.Component
+{
+ public class Stat : Component
+ {
+ protected int hp = 0;
+ protected int defence = 0;
+ protected int stepsTaken = 0;
+ protected int distanceToTarget = 0;
+ protected int panic = 0;
+ protected int soldierAim = 100;
+ protected int weaponAccuracy = 0;
+ protected int weaponStrength = 0;
+ protected int ammo = 0;
+ protected int enemyDodge = 0;
+
+ protected int penaltyRange = 5;
+
+ public int GetAim
+ {
+ get { return soldierAim + weaponAccuracy; }
+ set { soldierAim = value; }
+ }
+
+ public int GetDodge
+ {
+ get { return enemyDodge; }
+ set { enemyDodge = value; }
+ }
+ public int Life
+ {
+ get { return hp; }
+ set
+ {
+ hp = value;
+ if (hp <= 0) {
+ //If you kill me, I will become stronger than you can ever imagine.
+ Kill();
+ }
+ }
+ }
+ public int Defence
+ {
+ get { return defence; }
+ set { defence = value; }
+ }
+ public int Strength
+ {
+ get { return weaponStrength; }
+ set { weaponStrength = value; }
+ }
+
+ public void Kill()
+ {
+ hp = 0;
+ }
+
+ public int Penalty(int distance)
+ {
+ return panic + GetPenalty(stepsTaken) + (int)(GetPenalty(distance) / 2);
+ }
+
+ public Stat(Entity parent) : base (parent)
+ {
+
+ }
+
+ public bool targetInSight()
+ {
+ return false;
+ }
+
+ public int GetPenalty(int distance)
+ {
+ int penalty = 0;
+ if (distance >= penaltyRange * 3)
+ {
+ penalty = 100;
+ }
+ else if (distance >= penaltyRange * 2)
+ {
+ distance -= penaltyRange * 2;
+ penalty = penaltyRange + penaltyRange * 3 + distance * 5;
+ }
+ else if (distance >= penaltyRange)
+ {
+ distance -= penaltyRange;
+ penalty = penaltyRange + distance * 3;
+ }
+ else
+ {
+ penalty = distance;
+ }
+ return penalty;
+ }
+ }
+}
diff --git a/DepthsBelow/DepthsBelow/Core.cs b/DepthsBelow/DepthsBelow/Core.cs
index cbe8091..c4bffdd 100755
--- a/DepthsBelow/DepthsBelow/Core.cs
+++ b/DepthsBelow/DepthsBelow/Core.cs
@@ -1,213 +1,203 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using DepthsBelow.GUI;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.GamerServices;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Media;
-
-namespace DepthsBelow
-{
- ///
- /// This is the main type for your game
- ///
- public class Core : Microsoft.Xna.Framework.Game
- {
- public static GraphicsDeviceManager GraphicsDeviceManager;
- SpriteBatch spriteBatch;
-
- public Lua Lua;
-
- public Camera Camera;
-
- public bool PlayerTurn = true;
- public static MouseInput MouseInput;
- public static KeyboardInput KeyboardInput;
- public List Squad;
- public List Swarm;
- public List Volley;
- public static Map Map;
-
- public SmallEnemy TestMonster;
-
- public Core()
- {
- GraphicsDeviceManager = new GraphicsDeviceManager(this);
- Content.RootDirectory = "Content";
-
- GraphicsDeviceManager.PreferredBackBufferWidth = 1280;
- GraphicsDeviceManager.PreferredBackBufferHeight = 720;
- GraphicsDeviceManager.IsFullScreen = false;
-
- //graphics.SynchronizeWithVerticalRetrace = false;
- this.IsFixedTimeStep = false;
- GraphicsDeviceManager.ApplyChanges();
-
- this.IsMouseVisible = true;
-
- GameServices.AddService(GraphicsDevice);
- GameServices.AddService(Content);
- }
-
- ///
- /// Allows the game to perform any initialization it needs to before starting to run.
- /// This is where it can query for any required services and load any non-graphic
- /// related content. Calling base.Initialize will enumerate through any components
- /// and initialize them as well.
- ///
- protected override void Initialize()
- {
- // TODO: Add your initialization logic here
- Camera = new Camera(this);
- Squad = new List();
- Swarm = new List();
- Volley = new List();
-
- TestMonster = new SmallEnemy(this, ref Swarm);
-
- // Run scripts after everything is initialized
- Lua = new Lua();
- Lua.LoadScripts();
-
- base.Initialize();
- }
-
- ///
- /// LoadContent will be called once per game and is the place to load
- /// all of your content.
- ///
- protected override void LoadContent()
- {
- // Create a new SpriteBatch, which can be used to draw textures.
- spriteBatch = new SpriteBatch(GraphicsDevice);
-
- Map = Content.Load