//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynter.Engine.Globals { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using System.Xml; using System.Diagnostics; using Physics; using ObjectLib; using DarkWynter.Engine.UserInterface; using System.ComponentModel; using DarkWynter.Stream.UIInterfacing; #endregion /// /// Contains the Global Scoreboard where application-scope variables are posted and read. /// public class Statics_Engine { #region Struct Accessors [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public SystemSettings _systemSettings { get { return systemSettings; } set { systemSettings = value; } } private SystemSettings systemSettings; [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public GameSettings _gameSettings { get { return gameSettings; } set { gameSettings = value; } } private GameSettings gameSettings; [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public AISettings _aiSettings { get { return aiSettings; } set { aiSettings = value; } } private AISettings aiSettings; [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public LevelSettings _levelSettings { get { return levelSettings; } set { levelSettings = value; } } private LevelSettings levelSettings; [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public TerrainSettings _terrainSettings { get { return terrainSettings; } set { terrainSettings = value; } } private TerrainSettings terrainSettings; [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public ParticleSettings _particleSettings { get { return particleSettings; } set { particleSettings = value; } } private ParticleSettings particleSettings; [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public PlayerSettings _playerSettings { get { return playerSettings; } set { playerSettings = value; } } private PlayerSettings playerSettings; #endregion public Statics_Engine() { systemSettings = new SystemSettings(); gameSettings = new GameSettings(); aiSettings = new AISettings(); levelSettings = new LevelSettings(); terrainSettings = new TerrainSettings(); particleSettings = new ParticleSettings(); playerSettings = new PlayerSettings(); } /// /// List of availible levels contained in _Levels.xml /// public List _levelInfo { get { return levelInfo; } set { levelInfo = value; } } public static List levelInfo; /// /// Current level index /// public int _levelIndex { get { return levelIndex; } set { levelIndex = value; } } public static int levelIndex = 0; #region System Settings /// /// System Settings /// public struct SystemSettings { /// /// Content Manager /// [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public ContentManager _content { get { return content; } set { content = value; } } public static ContentManager content; /// /// Window in focus /// public bool _WINDOW_IN_FOCUS { get { return WINDOW_IN_FOCUS; } set { WINDOW_IN_FOCUS = value; } } public static bool WINDOW_IN_FOCUS = true; // Disables mouse when window loses focus /// /// Set true to commit focus change event /// public bool _WINDOW_RESET { get { return WINDOW_RESET; } set { WINDOW_RESET = value; } } public static bool WINDOW_RESET = false; /// /// Change in time between frames /// public float _dt { get { return dt; } set { dt = value; } } public static float dt; /// /// Allows dt to be overridden by user modified dt /// public bool _dt_realTime { get { return dt_realTime; } set { dt_realTime = value; } } public static bool dt_realTime = true; /// /// Total GameTime Elapsed /// [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public GameTime _elementalGameTime { get { return elementalGameTime; } set { elementalGameTime = value; } } public static GameTime elementalGameTime; /// /// Current Engine Execution Mode /// public Enums_Engine.EngineState _gameState { get { return gameState; } set { gameState = value; } } public static Enums_Engine.EngineState gameState; /// /// Screen Saver /// [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public Stopwatch _screenSaverTimer { get { return screenSaverTimer; } set { screenSaverTimer = value; } } public static Stopwatch screenSaverTimer; /// /// Turn Frames Per Second Counter On /// public bool _enableFPSDisplay { get { return enableFPSDisplay; } set { enableFPSDisplay = value; } } public static bool enableFPSDisplay; /// /// Turns the Compiler console application on/off /// public bool _enableCompilerConsole { get { return enableCompilerConsole; } set { enableCompilerConsole = value; } } public static bool enableCompilerConsole; /// /// Time of inactivity after which the anti-burn screen saver activates (millisecs) /// public int _ANTI_BURN_TIMER { get { return ANTI_BURN_TIMER; } set { ANTI_BURN_TIMER = value; } } public static int ANTI_BURN_TIMER = 60000; /// /// Count of players currently connected /// public int _TOTAL_PLAYERS { get { return TOTAL_PLAYERS; } set { TOTAL_PLAYERS = value; } } public static int TOTAL_PLAYERS = 0; // Pause Menu Options /// /// Shadow Mapping for light source 1 enabled/disabled /// public bool _enableShadowMap1 { get { return enableShadowMap1; } set { enableShadowMap1 = value; } } public static bool enableShadowMap1 = true; /// /// Shadow mapping for light source 2 enabled/disabled /// public bool _enableShadowMap2 { get { return enableShadowMap2; } set { enableShadowMap2 = value; } } public static bool enableShadowMap2 = true; /// /// Terrain bump mapping enabled/disabled /// public bool _enableTerrainBumpMapping { get { return enableTerrainBumpMapping; } set { enableTerrainBumpMapping = value; } } public static bool enableTerrainBumpMapping = true; /// /// Terrain multi-texturing enabled/disabled /// public bool _enableTerrainMultiTexturing { get { return enableTerrainMultiTexturing; } set { enableTerrainMultiTexturing = value; } } public static bool enableTerrainMultiTexturing = true; /// /// Number of textures to use for multi-texturing /// public int _numberOfTerrainTextures { get { return numberOfTerrainTextures; } set { numberOfTerrainTextures = value; } } public static int numberOfTerrainTextures = 4; /// /// Single light source only enabled/disabled /// public bool _singleLightSource { get { return singleLightSource; } set { singleLightSource = value; } } public static bool singleLightSource = false; /// /// Music enabled/disabled /// public bool _music { get { return music; } set { music = value; } } public static bool music = true; /// /// Sound effects enabled/disabled /// public bool _soundFX { get { return soundFX; } set { soundFX = value; } } public static bool soundFX = true; } #endregion #region Game Settings /// /// Game Settings /// public struct GameSettings { /// /// Search radius for collision checking (obsolete) /// public int _collisionSearchArea { get { return collisionSearchArea; } set { collisionSearchArea = value; } } public static int collisionSearchArea = 2; /// /// Drawing radius (obsolete) /// public int _drawSearchArea { get { return drawSearchArea; } set { drawSearchArea = value; } } public static int drawSearchArea = 40; /// /// Maximum number of levels /// public int _MAX_LEVELS { get { return MAX_LEVELS; } set { MAX_LEVELS = value; } } public static int MAX_LEVELS = 4; /// /// Set to true when after Load Screen is drawn to trigger Level Loading /// public bool _LoadLevel { get { return LoadLevel; } set { LoadLevel = value; } } public static bool LoadLevel = false; // Gravity /// /// Vector force of gravity /// public Vector3 _accelDueToGravity { get { return accelDueToGravity; } set { accelDueToGravity = value; } } public static Vector3 accelDueToGravity = Vector3.Zero; /// /// Single downward component of gravity /// public float _gravityForce { get { return gravityForce; } set { gravityForce = value; } } public static float gravityForce = -300f; /// /// Number of bots /// public int _botCount { get { return botCount; } set { botCount = value; } } public static int botCount = 4; /// /// Number of humans /// public int _numberOfHumansActive { get { return numberOfHumansActive; } set { numberOfHumansActive = value; } } public static int numberOfHumansActive = 4; /// /// Current game type /// public Enums_Engine.GameType _gameType { get { return gameType; } set { gameType = value; } } public static Enums_Engine.GameType gameType = Enums_Engine.GameType.NONE_SELECTED; /// /// Milliseconds before the player spawns again /// public int _RESPAWN_DELAY { get { return RESPAWN_DELAY; } set { RESPAWN_DELAY = value; } } public static int RESPAWN_DELAY = 5000; /// /// Maximum number of kills based on the current game type /// public int _maxNumberOfKills { get { return maxNumberOfKills; } set { maxNumberOfKills = value; } } public static int maxNumberOfKills; // Experience points for the player public int _experiencePoints { get { return experiencePoints; } set { experiencePoints = value; } } public static int experiencePoints; /// /// Adds th total score for the player /// /// float public float _TotalScore { get { return TotalScore(); }} public static float TotalScore() { int coinMultiplier = 4; float timeDivisor = 180 - Statics_Engine.LevelSettings.gameTimer.Elapsed.Seconds; return ((GameSettings.experiencePoints + (PlayerSettings.coinsCollected * coinMultiplier)) + timeDivisor); } /// /// G2L switch to control problem state /// public bool _isProblemFinished { get { return isProblemFinished; } set { isProblemFinished = value; } } public static bool isProblemFinished = false; /// /// G2L current Challenge index /// public int _currentChallengeNumber { get { return currentChallengeNumber; } set { currentChallengeNumber = value; } } public static int currentChallengeNumber = 0; /// /// G2L position for the bombs /// public Vector3 _BombCurrentPosition { get { return BombCurrentPosition; } set { BombCurrentPosition = value; } } public static Vector3 BombCurrentPosition; // public static string ParsesandCompilesCode = ""; /// /// Number of keys to collect inorder to progress to the next stage in story mode /// public int _STORYMODE_NUM_KEYS_TO_COLLECT { get { return STORYMODE_NUM_KEYS_TO_COLLECT; } set { STORYMODE_NUM_KEYS_TO_COLLECT = value; } } public static int STORYMODE_NUM_KEYS_TO_COLLECT = 10; /// /// Health gain for collecting a key /// public float _HEALTH_BOOST_FOR_KEY { get { return HEALTH_BOOST_FOR_KEY; } set { HEALTH_BOOST_FOR_KEY = value; } } public static float HEALTH_BOOST_FOR_KEY = 5.0f; /// /// Maximum time to play the sound for a particle (millisec) /// public float _PARTICLE_SOUND_TIME_LIMIT { get { return PARTICLE_SOUND_TIME_LIMIT; } set { PARTICLE_SOUND_TIME_LIMIT = value; } } public static float PARTICLE_SOUND_TIME_LIMIT = 10000.0f; /// /// Minimum number of players to run the game /// public int _MIN_NUMBER_OF_PLAYERS { get { return MIN_NUMBER_OF_PLAYERS; } set { MIN_NUMBER_OF_PLAYERS = value; } } public static int MIN_NUMBER_OF_PLAYERS = 1; /// /// Maximum number of players supported /// public int _MAX_NUMBER_OF_PLAYERS { get { return MAX_NUMBER_OF_PLAYERS; } set { MAX_NUMBER_OF_PLAYERS = value; } } public static int MAX_NUMBER_OF_PLAYERS = 4; /// /// Default number of players /// public int _DEFAULT_NUMBER_OF_PLAYERS { get { return DEFAULT_NUMBER_OF_PLAYERS; } set { DEFAULT_NUMBER_OF_PLAYERS = value; } } public static int DEFAULT_NUMBER_OF_PLAYERS = 1; /// /// Number of players per team /// public int _NUMBER_OF_PLAYERS_PER_TEAM { get { return NUMBER_OF_PLAYERS_PER_TEAM; } set { NUMBER_OF_PLAYERS_PER_TEAM = value; } } public static int NUMBER_OF_PLAYERS_PER_TEAM = 1; /// /// G2L scoring metric /// public int[,] _scoringMetric { get { return scoringMetric; } set { scoringMetric = value; } } public static int[,] scoringMetric = { { 0, 0, 0 ,0 }, { 50, 100, 150, 200 }, { 40, 80, 125 ,160 }, { 30, 60, 100 , 120 }, { 20, 40, 75 ,80 }, { 10, 20, 50 ,40 }, { 0, 0, 0 ,0 }}; /// /// Scoring metric tries index /// public int _sMRows { get { return sMRows; } set { sMRows = value; } } public static int sMRows = 7; /// /// Scoring metric problem index /// public int _sMColumns { get { return sMColumns; } set { sMColumns = value; } } public static int sMColumns = 4; /// /// G2L tracking number of tries for exp purposes /// public int _triesNumber { get { return triesNumber; } set { triesNumber = value; } } public static int triesNumber = 0; } #endregion #region AI Settings /// /// AI Settings /// public struct AISettings { // Number between 1 and 10 for smartness (10 being super smart) /// /// AI IQ /// public int _AI_INTELLIGENCE { get { return AI_INTELLIGENCE; } set { AI_INTELLIGENCE = value; } } public static int AI_INTELLIGENCE = 8; /// /// AI Maximum health /// public int _AI_MAX_HEALTH { get { return AI_MAX_HEALTH; } set { AI_MAX_HEALTH = value; } } public static int AI_MAX_HEALTH = 100; /// /// Switches to enable/disable default AI behavior /// [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public AISwitches _aiSwitches { get { return aiSwitches; } set { aiSwitches = value; } } public static AISwitches aiSwitches = new AISwitches(); } #endregion #region Level Settings /// /// Contains the name, description, and filepath for each level. /// public struct LevelInfo { /// /// User friendly name for level. /// public string _name { get { return name; } set { name = value; } } public string name; /// /// User friendly description for level. /// public string _description { get { return description; } set { description = value; } } public string description; /// /// Filepath of the level xml, which contains all xml data for that level. /// public string _filepath { get { return filepath; } set { filepath = value; } } public string filepath; } //} /// /// Level Settings /// public struct LevelSettings { /// /// Amount of friction force from the terrain /// public float _TERRAIN_FRICTION { get { return TERRAIN_FRICTION; } set { TERRAIN_FRICTION = value; } } public static float TERRAIN_FRICTION = 0.0f; /// /// Density of fog (disabled) /// public float _fogDensity { get { return fogDensity; } set { fogDensity = value; } } public static float fogDensity = 0; /// /// Color of fog /// public float[] _fogColor { get { return fogColor; } set { fogColor = value; } } public static float[] fogColor = { 1.0f, 1.0f, 1.0f, 0.1f }; /// /// Maximum depth for shadow mapping /// public float _zMaxDepth { get { return zMaxDepth; } set { zMaxDepth = value; } } public static float zMaxDepth = 1000.0f; /// /// Number of human players /// public int _numberOfHumans { get { return numberOfHumans; } set { numberOfHumans = value; } } public static int numberOfHumans; // Number humans in the game /// /// Maximum number of AI players /// public int _MAX_NUMBER_OF_BOTS { get { return MAX_NUMBER_OF_BOTS; } set { MAX_NUMBER_OF_BOTS = value; } } public static int MAX_NUMBER_OF_BOTS = 50; // The most bots there can be /// /// Angle of rotation of light source 1 /// public double _lightMoveAngle1 { get { return lightMoveAngle1; } set { lightMoveAngle1 = value; } } public static double lightMoveAngle1 = 0; /// /// Angle of rotation of light source 2 /// public double _lightMoveAngle2 { get { return lightMoveAngle2; } set { lightMoveAngle2 = value; } } public static double lightMoveAngle2 = 0; /// /// Distance of light source 1 from the center of it's rotation /// public float _lightDistance1 { get { return lightDistance1; } set { lightDistance1 = value; } } public static float lightDistance1 = 0.0f; /// /// Distance of light source 2 from the center of it's rotation /// public float _lightDistance2 { get { return lightDistance2; } set { lightDistance2 = value; } } public static float lightDistance2 = 0.0f; /// /// Speed of motion of light source 1 /// public float _LIGHT_MOVE_SPEED1 { get { return LIGHT_MOVE_SPEED1; } set { LIGHT_MOVE_SPEED1 = value; } } public static float LIGHT_MOVE_SPEED1 = 0.0f; /// /// Speed of motion of light source 2 /// public float _LIGHT_MOVE_SPEED2 { get { return LIGHT_MOVE_SPEED2; } set { LIGHT_MOVE_SPEED2 = value; } } public static float LIGHT_MOVE_SPEED2 = 0; //// DARK MATTER ///// ///// List of masses which are available for use ///// //public static List darkMatter; ///// ///// Index of the next available dark matter object ///// //public static int darkMatterIterator = 0; ///// ///// Maximum number of dark matter objects ///// //public static int darkMatterCount = 250000; /// /// Position of light source 1 /// public Vector3 _lightPosition1 { get { return lightPosition1; } set { lightPosition1 = value; } } public static Vector3 lightPosition1 = new Vector3(512.0f, 1024.0f, 512.0f); /// /// Ambient component of light source 1 /// public Vector4 _lightAmbient1 { get { return lightAmbient1; } set { lightAmbient1 = value; } } public static Vector4 lightAmbient1 = new Vector4(0.9f, 0.9f, 0.9f, 1.0f); /// /// Diffused component of light source 1 /// public Vector4 _lightDiffuse1 { get { return lightDiffuse1; } set { lightDiffuse1 = value; } } public static Vector4 lightDiffuse1 = new Vector4(0.8f, 0.8f, 0.8f, 1.0f); /// /// Specular component of light source 1 /// public Vector4 _lightSpecular1 { get { return lightSpecular1; } set { lightSpecular1 = value; } } public static Vector4 lightSpecular1 = new Vector4(0.7f, 0.7f, 0.7f, 1.0f); /// /// Position of light source 2 /// public Vector3 _lightPosition2 { get { return lightPosition2; } set { lightPosition2 = value; } } public static Vector3 lightPosition2 = new Vector3(1024.0f, 1024.0f, 1024.0f); /// /// Ambient component of light source 2 /// public Vector4 _lightAmbient2 { get { return lightAmbient2; } set { lightAmbient2 = value; } } public static Vector4 lightAmbient2 = new Vector4(0.9f, 0.9f, 0.9f, 1.0f); /// /// Diffused component of light source 2 /// public Vector4 _lightDiffuse2 { get { return lightDiffuse2; } set { lightDiffuse2 = value; } } public static Vector4 lightDiffuse2 = new Vector4(0.8f, 0.8f, 0.8f, 1.0f); /// /// Specular component of light source 2 /// public Vector4 _lightSpecular2 { get { return lightSpecular2; } set { lightSpecular2 = value; } } public static Vector4 lightSpecular2 = new Vector4(0.7f, 0.7f, 0.7f, 1.0f); /// /// In-game elapsed time display /// [EditorAttribute(typeof(ObjectPropertyEditor), typeof(System.Drawing.Design.UITypeEditor))] public Stopwatch _gameTimer { get { return gameTimer; } set { gameTimer = value; } } public static Stopwatch gameTimer = new Stopwatch(); /// /// Fog start distance /// public float _fogStart { get { return fogStart; } set { fogStart = value; } } public static float fogStart = 5000.0f; /// /// Fog end distance (ie, no change beyond this) /// public float _fogEnd { get { return fogEnd; } set { fogEnd = value; } } public static float fogEnd = 10000.0f; // Scene Graph //public static LookupMap lookupMap; public int _bombCounter { get { return bombCounter; } set { bombCounter = value; } } public static int bombCounter = 0; // Dimensions of the Viewport updated when Level Loads public Vector2 _ViewportSize { get { return ViewportSize; } set { ViewportSize = value; } } public static Vector2 ViewportSize; } #endregion #region Terrain /// /// Terrain Settings /// public struct TerrainSettings { /// /// Width of the unscaled terrain /// public int _vertexMapSize { get { return vertexMapSize; } set { vertexMapSize = value; } } public static int vertexMapSize; /// /// Interpolated values for scaled terrain /// public int _collisionMapSize { get { return collisionMapSize; } set { collisionMapSize = value; } } public static int collisionMapSize; /// /// Terrain scaling factor /// public int _terrainScaleFactor { get { return terrainScaleFactor; } set { terrainScaleFactor = value; } } public static int terrainScaleFactor; /// /// Point on the terrain that the player is looking at /// public Vector3 _terrainLookAtPoint { get { return terrainLookAtPoint; } set { terrainLookAtPoint = value; } } public static Vector3 terrainLookAtPoint; /// /// Maximum distance at which terrain mod is possible /// public float _terrainModRange { get { return terrainModRange; } set { terrainModRange = value; } } public static float terrainModRange; /// /// Terrain Mod enabled/disabled /// public bool _terrainModEnabled { get { return terrainModEnabled; } set { terrainModEnabled = value; } } public static bool terrainModEnabled; } #endregion #region Particle /// /// Stores all settings for particles /// public struct ParticleSettings { /// /// Earth properties /// public struct Earth { /// /// Mass /// public static float EARTH_MASS = 5.0f; /// /// Coefficient of Restitution of cold earth /// public static float EARTH_COLD_COR = 0.7f; /// /// Coefficient of Restitution of hot earth /// public static float EARTH_HOT_COR = 0.1f; /// /// Friction coeefficient of cold earth /// public static float EARTH_COLD_FRICTION = 0.5f; /// /// Friction coefficient of hot earth /// public static float EARTH_HOT_FRICTION = 0.7f; } /// /// Water properties /// public struct Water { /// /// Mass /// public static float WATER_MASS = 3.0f; // Mass value /// /// Coefficient of Restitution of cold Water /// public static float WATER_COLD_COR = 0.7f; // Coefficient of Restitution /// /// Coefficient of Restitution of hot Water /// public static float WATER_HOT_COR = 0.1f; /// /// Friction coeefficient of cold Water /// public static float WATER_COLD_FRICTION = 0.15f; /// /// Friction coefficient of hot Water /// public static float WATER_HOT_FRICTION = 0.05f; } /// /// Water properties /// public struct Wind { /// /// Mass /// public static float WIND_MASS = 2.0f; // Mass value /// /// Coefficient of Restitution of cold Wind /// public static float WIND_COLD_COR = 0.4f; // Coefficient of Restitution /// /// Coefficient of Restitution of hot Wind /// public static float WIND_HOT_COR = 0.6f; /// /// Friction coeefficient of cold Wind /// public static float WIND_COLD_FRICTION = 0.1f; /// /// Friction coefficient of hot Wind /// public static float WIND_HOT_FRICTION = 0.1f; } } #endregion #region Player Settings /// /// Player Settings /// public struct PlayerSettings { // Attack Variables /// /// Distance from player at which the particle is spawned /// public float _PARTICLE_START_DISTANCE { get { return PARTICLE_START_DISTANCE; } set { PARTICLE_START_DISTANCE = value; } } public static float PARTICLE_START_DISTANCE = 20.0f; /// /// Force applied to the particle initially /// public float _DIRECT_ATTACK_FORCE { get { return DIRECT_ATTACK_FORCE; } set { DIRECT_ATTACK_FORCE = value; } } public static float DIRECT_ATTACK_FORCE = 100000; /// /// Miliseconds before allowing another automatic shot to be fired eg: 1000 = 1 sec /// public float _RATE_OF_FIRE { get { return RATE_OF_FIRE; } set { RATE_OF_FIRE = value; } } public static float RATE_OF_FIRE = 100; /// /// Rate of movement in Hover mode /// public float _HOVER_SPEED { get { return HOVER_SPEED; } set { HOVER_SPEED = value; } } public static float HOVER_SPEED = 5000.0f; /// /// Maximum speed in Hover mode /// public float _MAX_HOVER_SPEED { get { return MAX_HOVER_SPEED; } set { MAX_HOVER_SPEED = value; } } public static float MAX_HOVER_SPEED = 10000.0f; /// /// Rate of movement in Walk mode /// public float _WALK_SPEED { get { return WALK_SPEED; } set { WALK_SPEED = value; } } public static float WALK_SPEED = 2.0F; /// /// Maximum achievable velocity by a player /// public float _MAX_VELOCITY { get { return MAX_VELOCITY; } set { MAX_VELOCITY = value; } } public static float MAX_VELOCITY = 1000.0f; // 4000.0f /// /// Amount of upward force for a jump /// public float _JUMP_CONSTANT { get { return JUMP_CONSTANT; } set { JUMP_CONSTANT = value; } } public static float JUMP_CONSTANT = 100000.0f; /// /// Amount of upward force for an in-air jump..change before turnin /// public float _IN_AIR_JUMP_CONSTANT { get { return IN_AIR_JUMP_CONSTANT; } set { IN_AIR_JUMP_CONSTANT = value; } } public static float IN_AIR_JUMP_CONSTANT = 50000.0f; /// /// Milliseconds before the player is done spawning (invincible before then) /// public int _SPAWN_DONE_DELAY { get { return SPAWN_DONE_DELAY; } set { SPAWN_DONE_DELAY = value; } } public static int SPAWN_DONE_DELAY = 5000; /// /// Default maximum distance at which terrain mod is possible /// public float _TERRAIN_MOD_RANGE { get { return TERRAIN_MOD_RANGE; } set { TERRAIN_MOD_RANGE = value; } } public static float TERRAIN_MOD_RANGE = 15000.0f; /// /// Default player height above the terrain (based on model properties) /// public int _DEFAULT_PLAYER_HEIGHT { get { return DEFAULT_PLAYER_HEIGHT; } set { DEFAULT_PLAYER_HEIGHT = value; } } public static int DEFAULT_PLAYER_HEIGHT = 300; /// /// Maximum distance between player and sensor /// public int _MAX_SENSOR_DISTANCE { get { return MAX_SENSOR_DISTANCE; } set { MAX_SENSOR_DISTANCE = value; } } public static int MAX_SENSOR_DISTANCE = 50; /// /// Cost in manna for using an attack /// public float _ATTACK_MANNA_COST { get { return ATTACK_MANNA_COST; } set { ATTACK_MANNA_COST = value; } } public static float ATTACK_MANNA_COST = 0.5f; /// /// Cost in manna for shielding an attack /// public float _SHIELD_MANNA_COST { get { return SHIELD_MANNA_COST; } set { SHIELD_MANNA_COST = value; } } public static float SHIELD_MANNA_COST = 0.2f; /// /// Cost in manna for jumping /// public float _JUMP_MANNA_COST { get { return JUMP_MANNA_COST; } set { JUMP_MANNA_COST = value; } } public static float JUMP_MANNA_COST = 4.0f; /// /// Manna gain for properly shielding an attack /// public float _SHIELD_MANNA_GAIN { get { return SHIELD_MANNA_GAIN; } set { SHIELD_MANNA_GAIN = value; } } public static float SHIELD_MANNA_GAIN = 5.0f; /// /// Governs how fast manna regenerates in milliseconds (lower = faster) /// public int _MANNA_INCREMENT_RATE { get { return MANNA_INCREMENT_RATE; } set { MANNA_INCREMENT_RATE = value; } } public static int MANNA_INCREMENT_RATE = 1000; /// /// Health gain received from another player /// public float _PLAYER_ABSORB_HEALTH_GAIN { get { return PLAYER_ABSORB_HEALTH_GAIN; } set { PLAYER_ABSORB_HEALTH_GAIN = value; } } public static float PLAYER_ABSORB_HEALTH_GAIN = 0.5f; /// /// Manna gain received from a particle /// public float _PARTICLE_ABSORB_MANNA_GAIN { get { return PARTICLE_ABSORB_MANNA_GAIN; } set { PARTICLE_ABSORB_MANNA_GAIN = value; } } public static float PARTICLE_ABSORB_MANNA_GAIN = 3.0f; /// /// Cost of using the energy beam /// public float _ENERGY_BEAM_MANNA_COST { get { return ENERGY_BEAM_MANNA_COST; } set { ENERGY_BEAM_MANNA_COST = value; } } public static float ENERGY_BEAM_MANNA_COST = 0.05f; //public static float EXPEL_MANNA_COST = 0.2f; /// /// Health loss from a direct hit /// public float _DIRECT_HEALTH_LOSS { get { return DIRECT_HEALTH_LOSS; } set { DIRECT_HEALTH_LOSS = value; } } public static float DIRECT_HEALTH_LOSS = 1.0f; /// /// Health loss from an AOE (Area Of Effect) attact /// public float _AREA_HEALTH_LOSS { get { return AREA_HEALTH_LOSS; } set { AREA_HEALTH_LOSS = value; } } public static float AREA_HEALTH_LOSS = 0.05f; /// /// Health loss from hitting the ground too hard /// public float _FALLING_HEALTH_LOSS { get { return FALLING_HEALTH_LOSS; } set { FALLING_HEALTH_LOSS = value; } } public static float FALLING_HEALTH_LOSS = 1.0f; /// /// Health loss given to other player /// public float _EXPEL_HEALTH_LOSS { get { return EXPEL_HEALTH_LOSS; } set { EXPEL_HEALTH_LOSS = value; } } public static float EXPEL_HEALTH_LOSS = 0.5f; /// /// Minimum distance at which the enemy marker is drawn /// public float _ENEMY_MARKER_MIN_DISTANCE { get { return ENEMY_MARKER_MIN_DISTANCE; } set { ENEMY_MARKER_MIN_DISTANCE = value; } } public static float ENEMY_MARKER_MIN_DISTANCE = 5; /// /// Maximum distance beyond which the enemy marker is not drawn /// public float _ENEMY_MARKER_MAX_DISTANCE { get { return ENEMY_MARKER_MAX_DISTANCE; } set { ENEMY_MARKER_MAX_DISTANCE = value; } } public static float ENEMY_MARKER_MAX_DISTANCE = 70000; // The Currently Updating Player's Positional Information /// /// Current player's position /// public Vector3 _playerPosition { get { return playerPosition; } set { playerPosition = value; } } public static Vector3 playerPosition; /// /// Current player's orientation /// public Quaternion _playerRotation { get { return playerRotation; } set { playerRotation = value; } } public static Quaternion playerRotation; /// /// Current player's look at vector /// public Vector2 _playerLookVector { get { return playerLookVector; } set { playerLookVector = value; } } public static Vector2 playerLookVector; /// /// Index of the player who paused the game /// public int _playerThatPaused { get { return playerThatPaused; } set { playerThatPaused = value; } } public static int playerThatPaused = -1; /// /// Current player's index /// public int _currentPlayerIndex { get { return currentPlayerIndex; } set { currentPlayerIndex = value; } } public static int currentPlayerIndex = 0; /// /// Reset Text for G2L stuff /// public bool _doResetText { get { return doResetText; } set { doResetText = value; } } public static bool doResetText = false; // G2L name for player public string _studentName { get { return studentName; } set { studentName = value; } } public static string studentName = "test"; /// /// Hold the y position for use in resetting spawn point /// public float _spawnPosYStorage { get { return spawnPosYStorage; } set { spawnPosYStorage = value; } } public static float spawnPosYStorage = 0; /// /// Used for student messages from the compiler to the hud /// public string _studentMessage { get { return studentMessage; } set { studentMessage = value; } } public static string studentMessage = ""; /// /// G2L particpant number for the study /// public int _studentIDNumber { get { return studentIDNumber; } set { studentIDNumber = value; } } public static int studentIDNumber = 0; /// /// G2L Number of coins collected /// public int _coinsCollected { get { return coinsCollected; } set { coinsCollected = value; } } public static int coinsCollected = 0; /// /// Last Player Spawn Position /// public Vector3 _lastSpawnPoint { get { return lastSpawnPoint; } set { lastSpawnPoint = value; } } public static Vector3 lastSpawnPoint; /// /// Previous Player Position /// public Vector3 _previousPosition { get { return previousPosition; } set { previousPosition = value; } } public static Vector3 previousPosition; } #endregion /// /// Switches to enable/disable default AI behavior /// public class AISwitches { /// /// Enable/Disable AI Vision search /// public bool enableAIVisionSearch; /// /// Enable/Disable Attack mode /// public bool enableAttack; /// /// Enable/Disable default search /// public bool enableDefaultSearch; /// /// Enable/Disable Destroy mode /// public bool enableDestroy; /// /// Enable/Disable Evade mode /// public bool enableEvade; /// /// Enable/Disable moving towards the target /// public bool enableGoTo; /// /// Enable/Disable Jump /// public bool enableJump; /// /// This string is used to store an output /// check for the challenges. /// public string secretCode; /// /// Constructor /// public AISwitches() { enableAIVisionSearch = false; enableAttack = true; enableDefaultSearch = true; enableDestroy = true; enableEvade = true; enableGoTo = true; enableJump = true; } } } }