protected override ISceneObject SpawnBullet(Point point) { if (lastBullet != null) { lastBullet.GetControlOfType <HighlightingControl>().Enabled = false; } if (point.Y > Owner.GetBaseLocation().Y) { point.Y = Owner.GetBaseLocation().Y; } lastBullet = SceneObjectFactory.CreateSingularityBouncingBullet(SceneMgr, point, Owner); NetOutgoingMessage msg = SceneMgr.CreateNetMessage(); lastBullet.WriteObject(msg); SceneMgr.SendMessage(msg); HighlightingControl hc = new HighlightingControl(); lastBullet.AddControl(hc); SceneMgr.DelayedAttachToScene(lastBullet); return(lastBullet); }
protected override ISceneObject SpawnMine(Point point) { SingularityMine mine = SceneObjectFactory.CreateAsteroidDroppingSingularityMine(SceneMgr, point, Owner); Vector dir = new Vector(endPoint.X - startPoint.X, endPoint.Y - startPoint.Y); dir.Normalize(); mine.Direction = dir; LinearMovementControl c = mine.GetControlOfType <LinearMovementControl>(); c.Speed = Owner.Data.MineFallingSpeed * SharedDef.MINE_LAUNCHER_SPEED_MODIFIER; if (SceneMgr.GameType != Gametype.SOLO_GAME) { NetOutgoingMessage msg = SceneMgr.CreateNetMessage(); (mine as ISendable).WriteObject(msg); SceneMgr.SendMessage(msg); } HighlightingControl hc = new HighlightingControl(); mine.AddControl(hc); lastMine = mine; SceneMgr.DelayedAttachToScene(mine); return(mine); }
protected override Hook CreateHook(Point point) { if (lastHook != null) { lastHook.GetControlOfType <HighlightingControl>().Enabled = false; } lastHook = SceneObjectFactory.CreatePowerHook(SceneMgr, point, Owner); HighlightingControl hc = new HighlightingControl(); lastHook.AddControl(hc); hooks.Add(new HookData(lastHook, Owner.Data.HookCooldown)); return(lastHook); }