public virtual void SpawnCommander(ManagerHelper mH, Type commanderType, NPC.AffliationTypes team, Vector2 point) { if (commanderType == typeof(RedCommander)) { mH.GetNPCManager().Add(new RedCommander(point, team)); } else if (commanderType == typeof(BlueCommander)) { mH.GetNPCManager().Add(new BlueCommander(point, team)); } else if (commanderType == typeof(GreenCommander)) { mH.GetNPCManager().Add(new GreenCommander(point, team)); } else if (commanderType == typeof(YellowCommander)) { mH.GetNPCManager().Add(new YellowCommander(point, team)); } else if (commanderType == typeof(RedPlayerCommander)) { mH.GetNPCManager().Add(new RedPlayerCommander(point, team, mH)); } else if (commanderType == typeof(BluePlayerCommander)) { mH.GetNPCManager().Add(new BluePlayerCommander(point, team, mH)); } else if (commanderType == typeof(GreenPlayerCommander)) { mH.GetNPCManager().Add(new GreenPlayerCommander(point, team, mH)); } else if (commanderType == typeof(YellowPlayerCommander)) { mH.GetNPCManager().Add(new YellowPlayerCommander(point, team, mH)); } }
public void UpdateQuickestSuccessfulCapture(NPC.AffliationTypes a) { if (timeFlagAway[a] < quickestFlagCapture[a]) { quickestFlagCapture[a] = timeFlagAway[a]; } }
public virtual void Set(String a, Vector2 p, NPC n, Vector2 v, int d, bool iE, bool collide, float dT, ManagerHelper mH) { asset = a; position = p; velocity = v; damage = d; // set damage existenceTime = 4; // Default 10 seconds drawTime = dT; //set up draw time affiliation = n.GetAffiliation(); //Sets up hurting creator = n; isExplosive = iE; shouldCollide = collide; //Get x and y values from angle and set up direction rotation = DWMath.Atan2(velocity.Y, velocity.X); //No friction drag = 0; LoadContent(mH.GetTextureManager()); if (!(this is Tossable)) { setModeIndex();//set mode index } }
public void UpdateMostTimeFlagAway(NPC.AffliationTypes a) { if (timeFlagAway[a] > mostTimeFlagAway[a]) { mostTimeFlagAway[a] = timeFlagAway[a]; } }
public void Intitialize(ManagerHelper mH) { //kd stuff medicKills = 0; flagsCaptured = new Dictionary <NPC.AffliationTypes, int>(); flagsReturned = new Dictionary <NPC.AffliationTypes, int>(); rocksDestroyed = new Dictionary <NPC.AffliationTypes, int>(); dotsRecruited = new Dictionary <NPC.AffliationTypes, int>(); killsToCommanders = new int[4, 4]; vendittaKills = 0; vendittaKiller = NPC.AffliationTypes.black; vendittaVictim = NPC.AffliationTypes.black; rocksCreatedCounter = 0; waterSpilledCounter = 0; lightningTravelledCounter = 0; foreach (NPC.AffliationTypes a in affilations) { flagsCaptured.Add(a, 0); flagsReturned.Add(a, 0); rocksDestroyed.Add(a, 0); dotsRecruited.Add(a, 0); stats.Add(a, mH.GetNPCManager().GetStats(a)); } }
public Camera(Type cT, Rectangle d, int i, NPC.AffliationTypes color) { commanderType = cT; teammateColor = color; focus = new Vector2(d.Width / 2, d.Height / 2); dimensions = d; port = new Viewport(d); zoom = 1; index = i; switch (i) { case 0: gamePadIndex = PlayerIndex.One; break; case 1: gamePadIndex = PlayerIndex.Two; break; case 2: gamePadIndex = PlayerIndex.Three; break; case 3: gamePadIndex = PlayerIndex.Four; break; } oldState = GamePad.GetState(PlayerIndex.One); }
public CTFBase(NPC.AffliationTypes aT, Vector2 p, ManagerHelper mH) : base("bases", p, Vector2.Zero) { affiliation = aT; spawnCounter = 0; spawnTime = 1.5f; //1.5 seconds switch (aT) { case NPC.AffliationTypes.red: myFlag = new RedFlag(GetOriginPosition()); break; case NPC.AffliationTypes.blue: myFlag = new BlueFlag(GetOriginPosition()); break; case NPC.AffliationTypes.green: myFlag = new GreenFlag(GetOriginPosition()); break; case NPC.AffliationTypes.yellow: myFlag = new YellowFlag(GetOriginPosition()); break; } }
public String GetQuickestFlagCaptureStatistic() { double minTime = 1000; NPC.AffliationTypes af = NPC.AffliationTypes.black; foreach (NPC.AffliationTypes a in teams) { if (quickestFlagCapture[a] < minTime) { minTime = quickestFlagCapture[a]; af = a; } } switch (af) { case NPC.AffliationTypes.red: return("Quickest flag capture was\n red flag in " + minTime + " seconds"); case NPC.AffliationTypes.blue: return("Quickest flag capture was\n blue flag in " + minTime + " seconds"); case NPC.AffliationTypes.green: return("Quickest flag capture was\n green flag in " + minTime + " seconds"); case NPC.AffliationTypes.yellow: return("Quickest flag capture was\n yellow flag in " + minTime + " seconds"); case NPC.AffliationTypes.black: return("No flag was captured."); } return("heh"); }
public String GetMostTimeFlagAwayStatistic() { double maxTime = 0; NPC.AffliationTypes af = NPC.AffliationTypes.black; foreach (NPC.AffliationTypes a in teams) { if (mostTimeFlagAway[a] > maxTime) { maxTime = mostTimeFlagAway[a]; af = a; } } switch (af) { case NPC.AffliationTypes.red: return("Red flag " + maxTime + " seconds"); case NPC.AffliationTypes.blue: return("Blue flag " + maxTime + " seconds"); case NPC.AffliationTypes.green: return("Green flag " + maxTime + " seconds"); case NPC.AffliationTypes.yellow: return("Yellow flag " + maxTime + " seconds"); case NPC.AffliationTypes.black: return("No flag was abducted in this game"); } return("heh"); }
private void UpdateCasualities(NPC.AffliationTypes killedAffilation) { if (killedAffilation != NPC.AffliationTypes.black) { stats[killedAffilation].Casualties++; } }
public ConquestBase(Vector2 p) : base("bases", p, Vector2.Zero) { affiliation = NPC.AffliationTypes.grey; conquestCounters = new Dictionary <NPC.AffliationTypes, Double>(); spawns = new List <SpawnPoint>(); conquestTime = 3; //three seconds }
public Assault(List <NPC.AffliationTypes> tL, Dictionary <Type, NPC.AffliationTypes> pL, int pC, NPC.AffliationTypes att, NPC.AffliationTypes def, float sT) : base(tL, pL, 3, pC, sT) { this.typeOfGame = GT.ASSAULT; //set up defender and attacker attacker = att; defender = def; }
public void AddExplosion(Vector2 p, NPC.AffliationTypes aT, int d) { if (inactiveExplosions.Count > 0) { Explosion temp = inactiveExplosions.Pop(); temp.Set(p, d, aT, managers); activeExplosions.Enqueue(temp); } }
public void AddFireball(Vector2 p, Vector2 direction, NPC.AffliationTypes aT) { if (inactiveFireballs.Count > 0) { Fireball temp = inactiveFireballs.Pop(); temp.Set(p, direction, aT, managers); activeFireballs.Enqueue(temp); } }
public void AddLightning(Vector2 p, float r, NPC.AffliationTypes aT) { if (inactiveLightning.Count > 0) { LightningTrail temp = inactiveLightning.Pop(); temp.Set(p, r, aT, managers); activeLightning.Enqueue(temp); } }
public void AddWaterpool(Vector2 p, NPC.AffliationTypes aT) { if (inactiveWaterpools.Count > 0) { WaterPool temp = inactiveWaterpools.Pop(); temp.Set(p, aT, managers); activeWaterpools.Enqueue(temp); } }
public void Set(Vector2 p, float r, NPC.AffliationTypes aT, ManagerHelper mH) { affiliation = aT; rotation = r; position = p; lifeTimer = 2; mH.GetAudioManager().Play(AudioManager.SPARK, (float)mH.GetRandom().NextDouble() / 4 + 0.5f, AudioManager.RandomPitch(mH), 0, false); }
public Flag(string a, Vector2 p, NPC.AffliationTypes aT) : base(a, p) { affiliation = aT; status = FlagStatus.home; homePosition = p; //Animations timer = 0; endTime = 0.1f; }
public NPC.AffliationTypes GetSecondaryWinner(NPC.AffliationTypes winner) { foreach (KeyValuePair <Type, NPC.AffliationTypes> commander in commanders) { if (NPC.CommanderColor(commander.Key) != winner && commander.Value == winner) { return(NPC.CommanderColor(commander.Key)); } } return(NPC.AffliationTypes.red); }
public void Set(Vector2 p, NPC.AffliationTypes aT, ManagerHelper mH) { originPosition = p; position = p - origin; affiliation = aT; animateTimer = 0; rotation = (float)(Math.PI * 2 * mH.GetRandom().NextDouble()); splash.SetOriginPosition(originPosition); splash.position = position; mH.GetAudioManager().Play(AudioManager.WATER, (float)mH.GetRandom().NextDouble() / 4 + 0.5f, AudioManager.RandomPitch(mH), 0, false); }
public NPC GetCommander(NPC.AffliationTypes a) { foreach (Commander n in commanders) { if (n.GetAffiliation() == a) { return(n); } } return(null); }
public void UpdateDeaths(NPC.AffliationTypes a) { if (stats[a].TimeAlive.Get() > stats[a].MaxTimeAlive) { stats[a].MaxTimeAlive = stats[a].TimeAlive.Get(); } stats[a].TimeAlive.Set(0); stats[a].IsAlive = false; stats[a].Deaths++; }
public NPC GetSpecificCommander(NPC.AffliationTypes personalAffilation) { foreach (Commander n in commanders) { if (n.GetPersonalAffilation() == personalAffilation) { return(n); } } return(null); }
public NPC GetSecondaryCommander(NPC.AffliationTypes teamAffilation) { foreach (NPC commander in commanders) { if (commander.GetAffiliation() == teamAffilation && commander.GetPersonalAffilation() != teamAffilation) { return(commander); } } return(null); }
public void Set(Vector2 p, int d, NPC.AffliationTypes aT, ManagerHelper mH) { base.Set(asset, p, Vector2.Zero, 0.1f, 0, 0, 0.5f, mH); existanceTime = 0.1f; affiliation = aT; creator = null; damage = d; exploaded = false; mH.GetAudioManager().Play(AudioManager.EXPLOSION, AudioManager.RandomVolume(mH), AudioManager.RandomPitch(mH), 0, false); }
public SpawnPoint(Vector2 sP, NPC.AffliationTypes a, ManagerHelper mH) : base(null, sP) { spawnPoint = sP; affilation = a; isGoodSpawnPoint = true; spawnCounter = 0; spawnTime = mH.GetGametype().GetSpawnTime() * 1.1; //so same spot wont be used twice in a row velocity = Vector2.Zero; isOneUse = (mH.GetGametype() is Conquest) && (affilation == NPC.AffliationTypes.grey); isUsed = false; }
public void ChangeHealth(int hM, NPC.AffliationTypes lD) { if (!IsProtected()) { health += hM; if (health > maxHealth) { health = maxHealth; } } }
public AssaultBase GetAllyBase(NPC.AffliationTypes a) { foreach (AssaultBase fB in bases) { if (fB.affiliation == a) { return(fB); } } //did not find desired base return(null); }
public CTFBase GetEnemyBase(NPC.AffliationTypes a) { foreach (CTFBase fB in bases) { if (fB.affiliation != a) { return(fB); } } //did not find desired base return(null); }
public List <NPC> GetAllies(NPC.AffliationTypes af) { List <NPC> tempList; if (agents.TryGetValue(af, out tempList)) { return(tempList); } else { throw new Exception("Cannot find allies"); } }