//---------------------------------------------------------------------------------------------------------------------------------------------------
//
// 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;
#endregion
///
/// Contains the Global Scoreboard where application-scope variables are posted and read.
///
public static class Statics_Engine
{
#region System Settings
///
/// System Settings
///
public struct SystemSettings
{
///
/// Content Manager
///
public static ContentManager content;
///
/// Window in focus
///
public static bool WINDOW_IN_FOCUS = true; // Disables mouse when window loses focus
///
/// Set true to commit focus change event
///
public static bool WINDOW_RESET = false;
///
/// Change in time between frames
///
public static float dt;
///
/// Total GameTime Elapsed
///
public static GameTime elementalGameTime;
///
/// Current Engine Execution Mode
///
public static Enums_Engine.EngineState gameState;
///
/// Screen Saver
///
public static Stopwatch screenSaverTimer;
///
/// Turn Frames Per Second Counter On
///
public static bool enableFPSDisplay;
///
/// Turns the Compiler console application on/off
///
public static bool pauseUpdate;
///
/// Time of inactivity after which the anti-burn screen saver activates (millisecs)
///
public static int ANTI_BURN_TIMER = 60000;
///
/// Count of players currently connected
///
public static int TOTAL_PLAYERS = 0;
// Pause Menu Options
///
/// Shadow Mapping for light source 1 enabled/disabled
///
public static bool enableShadowMap1 = true;
///
/// Shadow mapping for light source 2 enabled/disabled
///
public static bool enableShadowMap2 = true;
///
/// Terrain bump mapping enabled/disabled
///
public static bool enableTerrainBumpMapping = true;
///
/// Terrain multi-texturing enabled/disabled
///
public static bool enableTerrainMultiTexturing = true;
///
/// Number of textures to use for multi-texturing
///
public static int numberOfTerrainTextures = 4;
///
/// Single light source only enabled/disabled
///
public static bool singleLightSource = false;
///
/// Music enabled/disabled
///
public static bool music = true;
///
/// Sound effects enabled/disabled
///
public static bool soundFX = true;
}
#endregion
#region Game Settings
///
/// Game Settings
///
public struct GameSettings
{
///
/// Search radius for collision checking (obsolete)
///
public static int collisionSearchArea = 2;
///
/// Drawing radius (obsolete)
///
public static int drawSearchArea = 40;
///
/// Maximum number of levels
///
public static int MAX_LEVELS = 4;
///
/// Set to true when after Load Screen is drawn to trigger Level Loading
///
public static bool LoadScreenLoaded = false;
// Gravity
///
/// Vector force of gravity
///
public static Vector3 accelDueToGravity = Vector3.Zero;
///
/// Single downward component of gravity
///
public static float gravityForce = -300f;
///
/// Number of bots
///
public static int botCount = 4;
///
/// Number of humans
///
public static int numberOfHumansActive = 4;
///
/// On end of level delegate type
///
/// Event arguments
public delegate void LevelChangeFormsHandler(EventArgs args);
}
#endregion
#region Level Settings
///
/// Level Settings
///
public struct LevelSettings
{
///
/// Amount of friction force from the terrain
///
public static float TERRAIN_FRICTION = 0.0f;
///
/// Density of fog (disabled)
///
public static float fogDensity = 0;
///
/// Color of fog
///
public static float[] fogColor = { 1.0f, 1.0f, 1.0f, 0.1f };
///
/// Maximum depth for shadow mapping
///
public static float zMaxDepth = 1000.0f;
///
/// Number of human players
///
public static int numberOfHumans; // Number humans in the game
///
/// Maximum number of AI players
///
public static int MAX_NUMBER_OF_BOTS = 50; // The most bots there can be
///
/// Angle of rotation of light source 1
///
public static double lightMoveAngle1 = 0;
///
/// Angle of rotation of light source 2
///
public static double lightMoveAngle2 = 0;
///
/// Distance of light source 1 from the center of it's rotation
///
public static float lightDistance1 = 0.0f;
///
/// Distance of light source 2 from the center of it's rotation
///
public static float lightDistance2 = 0.0f;
///
/// Speed of motion of light source 1
///
public static float LIGHT_MOVE_SPEED1 = 0.0f;
///
/// Speed of motion of light source 2
///
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 static Vector3 lightPosition1 = new Vector3(512.0f, 1024.0f, 512.0f);
///
/// Ambient component of light source 1
///
public static Vector4 lightAmbient1 = new Vector4(0.9f, 0.9f, 0.9f, 1.0f);
///
/// Diffused component of light source 1
///
public static Vector4 lightDiffuse1 = new Vector4(0.8f, 0.8f, 0.8f, 1.0f);
///
/// Specular component of light source 1
///
public static Vector4 lightSpecular1 = new Vector4(0.7f, 0.7f, 0.7f, 1.0f);
///
/// Position of light source 2
///
public static Vector3 lightPosition2 = new Vector3(1024.0f, 1024.0f, 1024.0f);
///
/// Ambient component of light source 2
///
public static Vector4 lightAmbient2 = new Vector4(0.9f, 0.9f, 0.9f, 1.0f);
///
/// Diffused component of light source 2
///
public static Vector4 lightDiffuse2 = new Vector4(0.8f, 0.8f, 0.8f, 1.0f);
///
/// Specular component of light source 2
///
public static Vector4 lightSpecular2 = new Vector4(0.7f, 0.7f, 0.7f, 1.0f);
///
/// In-game elapsed time display
///
public static Stopwatch gameTimer = new Stopwatch();
///
/// Fog start distance
///
public static float fogStart = 5000.0f;
///
/// Fog end distance (ie, no change beyond this)
///
public static float fogEnd = 10000.0f;
// Scene Graph
//public static LookupMap lookupMap;
public static int bombCounter = 0;
}
#endregion
#region Terrain
///
/// Terrain Settings
///
public struct TerrainSettings
{
///
/// Width of the unscaled terrain
///
public static int vertexMapSize;
///
/// Interpolated values for scaled terrain
///
public static int collisionMapSize;
///
/// Terrain scaling factor
///
public static int terrainScaleFactor;
///
/// Point on the terrain that the player is looking at
///
public static Vector3 terrainLookAtPoint;
///
/// Maximum distance at which terrain mod is possible
///
public static float terrainModRange;
///
/// Terrain Mod enabled/disabled
///
public static bool terrainModEnabled;
///
/// Using an instanced mesh or not
///
public static bool terrainInstanced = true;
}
#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 static float PARTICLE_START_DISTANCE = 20.0f;
///
/// Force applied to the particle initially
///
public static float DIRECT_ATTACK_FORCE = 100000;
///
/// Miliseconds before allowing another automatic shot to be fired eg: 1000 = 1 sec
///
public static float RATE_OF_FIRE = 100;
///
/// Rate of movement in Hover mode
///
public static float HOVER_SPEED = 5000.0f;
///
/// Maximum speed in Hover mode
///
public static float MAX_HOVER_SPEED = 1000000.0f;
///
/// Rate of movement in Walk mode
///
public static float WALK_SPEED = 2.0F;
///
/// Maximum achievable velocity by a player
///
public static float MAX_VELOCITY = 1000.0f; // 4000.0f
///
/// Amount of upward force for a jump
///
public static float JUMP_CONSTANT = 1000000000.0f;
///
/// Amount of upward force for an in-air jump..change before turnin
///
public static float IN_AIR_JUMP_CONSTANT = 15000000.0f;
///
/// Milliseconds before the player is done spawning (invincible before then)
///
public static int SPAWN_DONE_DELAY = 5000;
///
/// Default maximum distance at which terrain mod is possible
///
public static float TERRAIN_MOD_RANGE = 15000.0f;
///
/// Default player height above the terrain (based on model properties)
///
public static int DEFAULT_PLAYER_HEIGHT = 200;
///
/// Maximum distance between player and sensor
///
public static int MAX_SENSOR_DISTANCE = 50;
///
/// Cost in manna for using an attack
///
public static float ATTACK_MANNA_COST = 0.5f;
///
/// Cost in manna for shielding an attack
///
public static float SHIELD_MANNA_COST = 0.2f;
///
/// Cost in manna for jumping
///
public static float JUMP_MANNA_COST = 4.0f;
///
/// Manna gain for properly shielding an attack
///
public static float SHIELD_MANNA_GAIN = 5.0f;
///
/// Governs how fast manna regenerates in milliseconds (lower = faster)
///
public static int MANNA_INCREMENT_RATE = 1000;
///
/// Health gain received from another player
///
public static float PLAYER_ABSORB_HEALTH_GAIN = 0.5f;
///
/// Manna gain received from a particle
///
public static float PARTICLE_ABSORB_MANNA_GAIN = 3.0f;
///
/// Cost of using the energy beam
///
public static float ENERGY_BEAM_MANNA_COST = 0.05f;
//public static float EXPEL_MANNA_COST = 0.2f;
///
/// Health loss from a direct hit
///
public static float DIRECT_HEALTH_LOSS = 1.0f;
///
/// Health loss from an AOE (Area Of Effect) attact
///
public static float AREA_HEALTH_LOSS = 0.05f;
///
/// Health loss from hitting the ground too hard
///
public static float FALLING_HEALTH_LOSS = 1.0f;
///
/// Health loss given to other player
///
public static float EXPEL_HEALTH_LOSS = 0.5f;
///
/// Minimum distance at which the enemy marker is drawn
///
public static float ENEMY_MARKER_MIN_DISTANCE = 5;
///
/// Maximum distance beyond which the enemy marker is not drawn
///
public static float ENEMY_MARKER_MAX_DISTANCE = 70000;
///
/// Limit the angle to which player can look up.
///
public static float PLAYER_ROTATION_CAP_UP = 1.0f;
///
/// Limit the angle to which player can look down.
///
public static float PLAYER_ROTATION_CAP_DOWN = 2.5f;
// The Currently Updating Player's Positional Information
///
/// Current player's position
///
public static Vector3 playerPosition;
///
/// Current player's orientation
///
public static Quaternion playerRotation;
///
/// Current player's look at vector
///
public static Vector2 playerLookVector;
///
/// Index of the player who paused the game
///
public static int playerThatPaused = -1;
///
/// Current player's index
///
public static int currentPlayerIndex = 0;
///
/// Reset Text for G2L stuff
///
public static bool doResetText = false;
// G2L name for player
public static string studentName = "";
///
/// Hold the y position for use in resetting spawn point
///
public static float spawnPosYStorage = 0;
///
/// Used for student messages from the compiler to the hud
///
public static string studentMessage = "";
///
/// Which XML file we are pulling the player data from
///
public static int PlayerLevelIndexLoad = 0;
}
#endregion
}
}