public override void CreateCustom() { Light l = new Light(); l.directional = true; l.Position = Vector3Extensions.GetUnit(new Vector3(1, 3, 4)); l.diffuse = new Color4f(0.0f, 1.0f, 0.0f, 1); Spawn(l, true); { SpaceWar2006.Effects.EclipticNode e = new SpaceWar2006.Effects.EclipticNode(); e.Position = new Vector3(0f, 0f, 0f); e.rotationspeed = new Vector3(0f, 0f, 0f); e.Orientation = new Quaternion(0f, 0f, 0f, 1f); Spawn(e, true); } { SpaceWar2006.GameObjects.PlayerStart e = new SpaceWar2006.GameObjects.PlayerStart(); e.Position = new Vector3(410f, 0f, 3970f); e.rotationspeed = new Vector3(0f, 0f, 0f); e.Orientation = new Quaternion(0f, 0f, 0f, 1f); Spawn(e, true); } { SpaceWar2006.Planets.Mars e = new SpaceWar2006.Planets.Mars(); e.Position = new Vector3(810f, 0f, 1170f); e.rotationspeed = new Vector3(0f, 0f, 0f); e.Orientation = new Quaternion(0f, 0f, 0f, 1f); Spawn(e, true); } { Node e1 = new Waypoint(); e1.Position = new Vector3(10f, 0f, -1170f); Spawn(e1, true); Node e2 = new Waypoint(); e2.Position = new Vector3(10f, 0f, 2170f); Spawn(e2, true); SpaceWar2006.Ships.BorgCube e = borg = new SpaceWar2006.Ships.BorgCube(); e.Position = new Vector3(10f, 0f, 1170f); e.rotationspeed = new Vector3(0f, 0f, 0f); e.Orientation = new Quaternion(0f, 0f, 0f, 1f); Spawn(e, true); Ai.SpaceShipBotControl ai = new SpaceWar2006.Ai.SpaceShipBotControl(borg); ai.ChangeTask(new Ai.Patrol(borg, new Node[] { e2, e1 })); Root.Instance.LocalObjects.Add(ai); } //Mission = new SpaceWar2006.Rules.Mission(); //Mission.PrimaryObjectives = new SpaceWar2006.Rules.Objective[]{ // new SpaceWar2006.Rules.DestroyObjective("Destroy the Borg cube",new Actor[]{borg}) //}; //Mission.SecondaryObjectives = new SpaceWar2006.Rules.Objective[] { }; }
public override void CreateCustom() { IList <Waypoint> wp = Root.Instance.Scene.FindEntitiesByType <Waypoint>(); Waypoint[] waypoints = new Waypoint[wp.Count]; for (int i = 0; i < wp.Count; ++i) { waypoints[i] = wp[i]; } Array.Sort <Waypoint>(waypoints, new Comparison <Waypoint>(delegate(Waypoint wp1, Waypoint wp2) { return(string.Compare(wp1.Name, wp2.Name)); })); SpaceWar2006.Ships.BorgCube e = new SpaceWar2006.Ships.BorgCube(); e.Position = waypoints[0].Position; Spawn(e, false); if (Root.Instance.IsAuthoritive) { Ai.SpaceShipBotControl ai = new SpaceWar2006.Ai.SpaceShipBotControl(e); ai.ChangeTask(new Ai.Patrol(e, waypoints)); Root.Instance.LocalObjects.Add(ai); Mission = new SpaceWar2006.Rules.Mission(); Mission.Missions = new SpaceWar2006.Rules.SingleMission[2]; Mission.Missions[0] = new SpaceWar2006.Rules.SingleMission( new SpaceWar2006.Rules.Objective[] { new SpaceWar2006.Rules.DestroyObjective("Destroy the Borg cube", new Actor[] { e }) }); Mission.Missions[1] = new SpaceWar2006.Rules.SingleMission( new SpaceWar2006.Rules.Objective[] { new SpaceWar2006.Rules.EscortObjective("Escort the Borg cube", new Actor[] { e }) }); Mission.TimeLimit = 60; } //Mission.SecondaryObjectives = new SpaceWar2006.Rules.Objective[] { }; Light l = new Light(); l.directional = true; l.Position = Vector3Extensions.GetUnit(new Vector3(-1, 3, 4)); Spawn(l, true); }
public override void CreateCustom() { IList<Waypoint> wp = Root.Instance.Scene.FindEntitiesByType<Waypoint>(); Waypoint[] waypoints = new Waypoint[wp.Count]; for (int i = 0; i < wp.Count; ++i) waypoints[i] = wp[i]; Array.Sort<Waypoint>(waypoints, new Comparison<Waypoint>(delegate(Waypoint wp1, Waypoint wp2) { return string.Compare(wp1.Name, wp2.Name); })); SpaceWar2006.Ships.BorgCube e = new SpaceWar2006.Ships.BorgCube(); e.Position = waypoints[0].Position; Spawn(e, false); if (Root.Instance.IsAuthoritive) { Ai.SpaceShipBotControl ai = new SpaceWar2006.Ai.SpaceShipBotControl(e); ai.ChangeTask(new Ai.Patrol(e, waypoints)); Root.Instance.LocalObjects.Add(ai); Mission = new SpaceWar2006.Rules.Mission(); Mission.Missions = new SpaceWar2006.Rules.SingleMission[2]; Mission.Missions[0]=new SpaceWar2006.Rules.SingleMission( new SpaceWar2006.Rules.Objective[]{ new SpaceWar2006.Rules.DestroyObjective("Destroy the Borg cube",new Actor[]{e}) }); Mission.Missions[1] = new SpaceWar2006.Rules.SingleMission( new SpaceWar2006.Rules.Objective[]{ new SpaceWar2006.Rules.EscortObjective("Escort the Borg cube",new Actor[]{e}) }); Mission.TimeLimit = 60; } //Mission.SecondaryObjectives = new SpaceWar2006.Rules.Objective[] { }; Light l = new Light(); l.directional = true; l.Position = Vector3Extensions.GetUnit(new Vector3(-1, 3, 4)); Spawn(l, true); }