public static void DoEffect(int typeID, IGORR.Client.Logic.IMap map, Microsoft.Xna.Framework.Vector2 dir, Microsoft.Xna.Framework.Point position, string info) { for (int x = 0; x < _modules.Count; x++) { _modules[x].DoEffect(typeID, map,dir,position, info); } }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { IGORR.Server.Logic.MapChanger changer = new IGORR.Server.Logic.MapChanger(map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); changer.targetMapID = bin.ReadInt32(); changer.targetPos = new Microsoft.Xna.Framework.Vector2(bin.ReadInt32(),bin.ReadInt32()); return changer; }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { string color = "" + (char)bin.ReadByte() + (char)bin.ReadByte() + (char)bin.ReadByte() + (char)bin.ReadByte(); int radius = bin.ReadInt32(); color += (char)(byte)(radius / 256); color += (char)(byte)(radius % 256); return new IGORR.Server.Logic.DummyObject(10003, map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID, color); }
public static void Draw(SpriteBatch batch, IGORR.Client.Logic.Camera cam) { batch.Begin(SpriteSortMode.BackToFront, null, SamplerState.PointClamp, DepthStencilState.Default, null, null, cam.ViewMatrix); for (int x = 0; x < _texts.Count; x++) _texts[x].Draw(_font, batch); for (int x = 0; x < _bubbles.Count; x++) _bubbles[x].Draw(batch,cam); batch.End(); }
public static void LoadMaps(IGORR.Server.Server server) { Console.WriteLine(); _maps = new List<Map>(); string curDir=Directory.GetCurrentDirectory(); StreamReader reader = new StreamReader("Content\\map\\maps.lst"); string[] lines = reader.ReadToEnd().Split(new string[] { "\n", Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); for (int x = 0; x < lines.Length; x++) { _maps.Add(new Map(lines[x],server,x)); } }
public override void DoEffect(IGORR.Client.Logic.IMap map, Microsoft.Xna.Framework.Vector2 dir, Microsoft.Xna.Framework.Point position, string info) { if(smoke==null) smoke=ContentInterface.LoadTexture("dust"); Vector2 pos = new Vector2(position.X, position.Y); ParticleInfo pInfo = new ParticleInfo(); pInfo.collides = true; map.SetGlow(-2, pos, Color.Yellow, 40, false, 300); Vector2 sideWays = new Vector2(dir.Y, -dir.X); if (smoke != null) for (int x = 0; x < 80; x++) map.Particles.AddParticle(smoke, 0.7f, pos, 0.6f*dir*(float)_random.NextDouble() + (float)(-0.15f+0.3f*_random.NextDouble()) * sideWays, new Vector2(0, 100), (float)(_random.NextDouble() * Math.PI * 2), (float)(_random.NextDouble() * Math.PI * 2), (float)_random.NextDouble()*0.7f + 0.4f, pInfo); }
public override void DoEffect(IGORR.Client.Logic.IMap map, Vector2 dir, Point position, string info) { if (tex1 == null) { tex1 = ContentInterface.LoadTexture("splat"); tex2 = ContentInterface.LoadTexture("healthOrb"); } ParticleInfo PInfo = new ParticleInfo(); PInfo.collides = true; PInfo.sticky = false; for (int x = 0; x < 1; x++) { map.Particles.AddParticle(tex1, 0.3f + (float)_random.NextDouble() * 0.2f, new Vector2(position.X, position.Y), Vector2.Zero, new Vector2(0, 0), (float)_random.NextDouble() * 6, (float)_random.NextDouble() * 6, 0.5f, PInfo); map.Particles.AddParticle(tex2, 0.6f + (float)_random.NextDouble() * 0.2f, new Vector2(position.X, position.Y), Vector2.Zero, new Vector2(0, 0), (float)_random.NextDouble() * 6, (float)_random.NextDouble() * 6, 0.5f, PInfo); } }
public override void DoEffect(IGORR.Client.Logic.IMap map, Vector2 dir, Point position, string info) { if (shard1 == null) { shard1 = ContentInterface.LoadTexture("shard1"); shard2 = ContentInterface.LoadTexture("shard2"); shard3 = ContentInterface.LoadTexture("shard3"); shard4 = ContentInterface.LoadTexture("shard4"); } ParticleInfo PInfo = new ParticleInfo(); PInfo.collides = true; PInfo.sticky = false; for (int x = 0; x < 2; x++) { map.Particles.AddParticle(shard1, 2.5f, new Vector2(position.X + (float)_random.NextDouble() * 16 - 8, position.Y + (float)_random.NextDouble() * 16 - 8), new Vector2((float)_random.NextDouble() * 70 - 35, (float)_random.NextDouble() * (-15) - 40), new Vector2(0, 100), (float)_random.NextDouble() * 6, (float)_random.NextDouble() * 6, 0.5f, PInfo); map.Particles.AddParticle(shard2, 2.5f, new Vector2(position.X + (float)_random.NextDouble() * 16 - 8, position.Y + (float)_random.NextDouble() * 16 - 8), new Vector2((float)_random.NextDouble() * 70 - 35, (float)_random.NextDouble() * (-15) - 40), new Vector2(0, 100), (float)_random.NextDouble() * 6, (float)_random.NextDouble() * 6, 0.5f, PInfo); map.Particles.AddParticle(shard3, 2.5f, new Vector2(position.X + (float)_random.NextDouble() * 16 - 8, position.Y + (float)_random.NextDouble() * 16 - 8), new Vector2((float)_random.NextDouble() * 70 - 35, (float)_random.NextDouble() * (-15) - 40), new Vector2(0, 100), (float)_random.NextDouble() * 6, (float)_random.NextDouble() * 6, 0.5f, PInfo); map.Particles.AddParticle(shard4, 2.5f, new Vector2(position.X + (float)_random.NextDouble() * 16 - 8, position.Y + (float)_random.NextDouble() * 16 - 8), new Vector2((float)_random.NextDouble() * 70 - 35, (float)_random.NextDouble() * (-15) - 40), new Vector2(0, 100), (float)_random.NextDouble() * 6, (float)_random.NextDouble() * 6, 0.5f, PInfo); } }
public override void DoEffect(IGORR.Client.Logic.IMap map, Microsoft.Xna.Framework.Vector2 dir, Microsoft.Xna.Framework.Point position, string info) { if(_smokeTex==null) _smokeTex=ContentInterface.LoadTexture("dust"); if(_fireTex==null) _fireTex=ContentInterface.LoadTexture("Boom"); if(_particleTex==null) _particleTex=ContentInterface.LoadTexture("expOrb"); Vector2 pos = new Vector2(position.X, position.Y); ParticleInfo pInfo = new ParticleInfo(); pInfo.collides = true; map.SetGlow(-2, pos, Color.LightYellow, 300, true, 500); if(_smokeTex!=null) for (int x = 0; x < 60; x++) map.Particles.AddParticle(_smokeTex, 1.2f, pos + new Vector2((float)_random.NextDouble() * 40 - 20, (float)_random.NextDouble() * 40 - 20), new Vector2((float)_random.NextDouble() * 40 - 20, (float)-(15 + _random.NextDouble() * 10)), new Vector2(0, 20), (float)(_random.NextDouble() * Math.PI * 2), (float)(_random.NextDouble() * Math.PI * 2), (float)_random.NextDouble() + 0.7f, pInfo); if (_fireTex != null) for (int x = 0; x < 12; x++) map.Particles.AddParticle(_fireTex, 0.7f, pos + new Vector2((float)_random.NextDouble() * 20 - 10, (float)_random.NextDouble() * 20 - 10), new Vector2((float)_random.NextDouble() * 40 - 20, (float)-(15 + _random.NextDouble() * 10)), new Vector2(0, 20), (float)(_random.NextDouble() * Math.PI * 2), (float)(_random.NextDouble() * Math.PI * 2), (float)_random.NextDouble() * 0.5f + 0.7f, pInfo); if (_particleTex != null) for (int x = 0; x < 6; x++) map.Particles.AddParticle(_particleTex, 0.8f, pos, new Vector2((float)_random.NextDouble() * 600 - 300, (float)_random.NextDouble() * 600 - 300), new Vector2(0, 0), (float)(_random.NextDouble() * Math.PI * 2), (float)(_random.NextDouble() * Math.PI * 2), (float)_random.NextDouble() * 0.2f + 0.4f, pInfo); }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { string[] split = bin.ReadString().Split(':'); return new IGORR.Server.Logic.TurnOffBlocker(split[0], bin.ReadBoolean(), map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID, split.Length > 1 ? int.Parse(split[1]) : 20); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { return new IGORR.Client.Logic.LightCircle(map, null, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public void DoEffect(int typeID, IGORR.Client.Logic.IMap map, Vector2 dir, Point position, string info) { if (_effectTemplates.ContainsKey(typeID)) _effectTemplates[typeID].DoEffect(map, dir, position, info); }
public void SetServer(IGORR.Server.Server server) { _server = server; }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { return new IGORR.Server.Logic.HPOrb(5,map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { return new Server.TriggeredEnemySpawner(map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID, bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadBoolean(), bin.ReadString(), bin.ReadBoolean(), bin.ReadString()); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { return new IGORR.Client.Logic.Pusher(map, IGORR.Content.ContentInterface.LoadTexture("Lava"), new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { Microsoft.Xna.Framework.Color c = new Microsoft.Xna.Framework.Color((byte)info[1],(byte)info[2],(byte)info[3],(byte)info[0]); int radius = 256 * info[4] + info[5]; return new IGORR.Client.Logic.StaticLight(map, null, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID, c,radius); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { IGORR.Client.Logic.Player player = new IGORR.Client.Logic.Player("default", new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); player.Name = info; return player; }
public AttackManager(IGORR.Server.Server server) { _attacks = new List<Attack>(); _addAttack = new List<Attack>(); _server = server; }
public Map(string fileName, IGORR.Server.Server server, int id) { random = new Random(); _mapname = fileName; _id = id; _spawns = new List<SpawnCountdown>(); manager = new IGORR.Server.Logic.ObjectManager(server); manager.SetMap(this); _modules = Modules.ModuleManager.Modules; LoadNew(fileName); /* StreamReader reader = new StreamReader(fileName+".txt"); string fileContent = reader.ReadToEnd(); reader.Close(); //_spawnPoints = new Dictionary<int, List<Point>>(); string[] lines = fileContent.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries); int sizeX = int.Parse(lines[0]); int sizeY = int.Parse(lines[1]); string[] teleportPoints = lines[3].Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); List<TeleportPoint> tpoints = new List<TeleportPoint>(); for (int x = 0; x+2 < teleportPoints.Length; x+=3) { TeleportPoint newPoint = new TeleportPoint(); newPoint.mapID = int.Parse(teleportPoints[x]); newPoint.X = int.Parse(teleportPoints[x+1]); newPoint.Y = int.Parse(teleportPoints[x+2]); tpoints.Add(newPoint); } _layers = new Tile[3][sizeX, sizeY]; for (int y = 0; y < sizeY; y++) { for (int x = 0; x < sizeX; x++) { int tileID = lines[4 + y][x] - 'a'; _t[x, y] = new Tile(this,new Rectangle(tileID * tileSize, 0, tileSize, tileSize), new Rectangle(x * tileSize, y * tileSize, tileSize, tileSize), tileID > 1); } } for (int y = 0; y < sizeY; y++) { for (int x = 0; x < sizeX; x++) { int powerID = lines[4 + y + sizeY][x] - 'a'; switch (powerID) { case ('t' - 'a'): Lava lava = new Lava(this, new Rectangle(x * tileSize, y * tileSize, tileSize, tileSize), ObjectManager.getID()); _tiles[x, y].SetChild(lava); ObjectManager.Add(lava); break; case ('f'-'a'): BossBlobTrigger trigger = new Logic.BossBlobTrigger(this,new Rectangle(x * tileSize, y * tileSize, tileSize, tileSize), ObjectManager.getID()); ObjectManager.Add(trigger); _tiles[x, y].SetChild(trigger); break; case ('g' - 'a'): if (tpoints.Count > 0) { MapChanger mc = new MapChanger(this, new Rectangle(x * tileSize, y * tileSize, tileSize, tileSize), ObjectManager.getID()); mc.targetMapID = tpoints[0].mapID; mc.targetPos = new Vector2(tpoints[0].X, tpoints[0].Y); Console.WriteLine("Added Teleporter"); tpoints.RemoveAt(0); ObjectManager.Add(mc); _tiles[x, y].SetChild(mc); } break; default: if (powerID >= 0 && powerID <= 's' - 'a') { /* if (!_spawnPoints.ContainsKey(powerID)) _spawnPoints.Add(powerID, new List<Point>()); _spawnPoints[powerID].Add(new Point(x * tileSize, y * tileSize)); } break; } } } if(4 + 2 * sizeY<lines.Length) for (int x = 0; x < lines[4 + 2 * sizeY].Length; x++) { SpawnItem(lines[4 + 2 * sizeY][x] - 'a'); } //SpawnItem(1); //SpawnItem(1); //SpawnItem(3); //SpawnItem(3); //SpawnItem(4); */ }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { return new IGORR.Server.Logic.TurnOnBlocker(bin.ReadString(),bin.ReadBoolean(), map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { return new IGORR.Client.Logic.PartPickup(new IGORR.Client.Logic.Body.BodyPart(IGORR.Content.ContentInterface.LoadTexture("healthOrb"), IGORR.Client.Logic.Body.BodyPartType.None), map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { return new IGORR.Client.Logic.PartPickup(new IGORR.Client.Logic.GrenadeLauncher(IGORR.Content.ContentInterface.LoadTexture("Egg")), map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public override IGORR.Client.Logic.GameObject CreateClient(IGORR.Client.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, string info) { return new IGORR.Client.Logic.Player("bossminion", new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID); }
public override IGORR.Server.Logic.GameObject CreateServer(IGORR.Server.Logic.IMap map, int objectID, Microsoft.Xna.Framework.Point p, System.IO.BinaryReader bin) { return new IGORR.Server.Logic.PartPickup(new IGORR.Server.Logic.GrenadeLauncher(),map, new Microsoft.Xna.Framework.Rectangle(p.X, p.Y, 16, 16), objectID, true); }
public ObjectManager(IGORR.Server.Server server) { _server = server; _objects = new List<GameObject>(); _attacks = new AttackManager(server); }
public void SendMessage(IGORR.Protocol.IgorrMessage m, bool Sequenced) { if (Sequenced) WorldController.SendReliable(m); else WorldController.Send(m, false); }