diff --git a/DepthsBelow/DepthsBelow/Component/Shooting.cs b/DepthsBelow/DepthsBelow/Component/Stat.cs
similarity index 70%
rename from DepthsBelow/DepthsBelow/Component/Shooting.cs
rename to DepthsBelow/DepthsBelow/Component/Stat.cs
index 382d5ac..2a00b2a 100644
--- a/DepthsBelow/DepthsBelow/Component/Shooting.cs
+++ b/DepthsBelow/DepthsBelow/Component/Stat.cs
@@ -5,7 +5,7 @@ using System.Text;
namespace DepthsBelow.Component
{
- class Shooting : Component
+ public class Stat : Component
{
protected int stepsTaken = 0;
protected int distanceToTarget = 0;
@@ -16,7 +16,22 @@ namespace DepthsBelow.Component
protected int penaltyRange = 5;
- public Shooting(Entity parent) : base (parent)
+ public int GetAim()
+ {
+ return (soldierAim + weaponAccuracy);
+ }
+
+ public int GetDodge()
+ {
+ return enemyDodge;
+ }
+
+ public int Penalty(int distance)
+ {
+ return panic + GetPenalty(stepsTaken) + (int)(GetPenalty(distance) / 2);
+ }
+
+ public Stat(Entity parent) : base (parent)
{
}
@@ -26,16 +41,7 @@ namespace DepthsBelow.Component
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)
+ public int GetPenalty(int distance)
{
int penalty = 0;
if (distance >= penaltyRange * 3)
diff --git a/DepthsBelow/DepthsBelow/Core.cs b/DepthsBelow/DepthsBelow/Core.cs
index cbe8091..7cea473 100755
--- a/DepthsBelow/DepthsBelow/Core.cs
+++ b/DepthsBelow/DepthsBelow/Core.cs
@@ -1,213 +1,201 @@
-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