public virtual void Fire(Actor ss, Slot s) { CurrentReloadTime = 0; Projectile p = (Projectile)Root.Instance.Factory.CreateInstance(ProjectileType); if (p.NoReplication || Root.Instance.IsAuthoritive) { p.Target = ss.Computer.Target; Matrix4 ship = ss.Matrix; Matrix4 slot = s.Matrix; Matrix4 combined = slot * ship; Vector3 x, y, z; Matrix4Extensions.ExtractBasis(combined, out x, out y, out z); p.Position = Matrix4Extensions.ExtractTranslation(combined); p.Orientation = Matrix4Extensions.ExtractRotation(combined); //p.localspeed=new Vector3(0,0,ExitingSpeed); p.Speed = z * ExitingSpeed; p.Source = ss; Root.Instance.Scene.Spawn(p); if (FireSound != null) p.PlaySound(FireSound, false); } //else p.Kill=true; }
public BorgCube() { Draw = new ArrayList(); Draw.Add(Root.Instance.ResourceManager.LoadMesh("borgcube/borgcube.mesh")); //Draw.Add(Root.Instance.ResourceManager.LoadMesh("saucer1/saucer1.mesh")); //Transparent = true; //Draw.Add(Root.Instance.ResourceManager.LoadMesh("defiant/defiant.mesh")); //Draw.Add(Root.Instance.ResourceManager.LoadMesh("ncc1701e/ncc1701e.mesh")); ShieldModel = Root.Instance.ResourceManager.LoadMesh("borgcube-shield/borgcube-shield.mesh"); Battery = new Battery(200); Generator = new Generator(20, Battery); Inventory = new Inventory(100); //Inventory.Load(typeof(HomingMissile), 10); Inventory.Load(typeof(LaserCannon), 2); Inventory.Load(typeof(RailGun), 2); Inventory.Load(typeof(IonPulseCannon), 2); Inventory.Load(typeof(DisruptorCannon), 2); Inventory.Load(typeof(Mine), 10); Inventory.Load(typeof(MineLayer), 2); //Inventory.Load(typeof(MissileLauncher), 1); Slots = new Slot[3]{ new Slot(null,new Vector3(46,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(-46,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(64,0,0),Quaternion.Identity,0) }; Shield = new Shield(Battery, 300, 5); Hull = new Hull(300); Computer = new Computer(this); Radius = 100; RenderRadius = 150; SyncRefs = false; ShieldSound = Root.Instance.ResourceManager.LoadSound("ST_IMP_FEDROM_Photon_Shield_1.wav"); WeaponNumbers = new int[] { -1, -1, -1 }; ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 0); ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 1); MainThrust = 200; StrafeThrust = 150; Resistance = 0.2f; RollSpeed = 1.0f; MaxRoll = 0.4f; MaxRotationSpeed = 1; }
public Tydirium() { Draw = new ArrayList(); Draw.Add(Root.Instance.ResourceManager.LoadMesh("tydirium/tydirium.mesh")); //Transparent = true; ShieldModel = Root.Instance.ResourceManager.LoadMesh("saucer1-shield/saucer1-shield.mesh"); Battery = new Battery(100); Generator = new Generator(10, Battery); Inventory = new Inventory(100); //Inventory.Load(typeof(HomingMissile), 10); Inventory.Load(typeof(LaserCannon), 2); Inventory.Load(typeof(IonPulseCannon), 2); Inventory.Load(typeof(DisruptorCannon), 2); Inventory.Load(typeof(Mine), 10); Inventory.Load(typeof(MineLayer), 2); //Inventory.Load(typeof(MissileLauncher), 1); Slots = new Slot[]{ new Slot(null,new Vector3(36,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(-36,0,0),Quaternion.Identity,0) }; Shield = new Shield(Battery, 100, 5); Hull = new Hull(100); Computer = new Computer(this); Radius = 39; RenderRadius = 40; SyncRefs = false; ShieldSound = Root.Instance.ResourceManager.LoadSound("ST_IMP_FEDROM_Photon_Shield_1.wav"); WeaponNumbers = new int[] { -1, -1 }; ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 0); ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 1); MainThrust = 600; StrafeThrust = 300; Resistance = 0.3f; RollSpeed = 1.5f; MaxRoll = 1.0f; MaxRotationSpeed = 2; }
public TieFighter() { Draw = new ArrayList(); Draw.Add(Root.Instance.ResourceManager.LoadMesh("tie/tie.mesh")); //Transparent = true; //ShieldModel = Root.Instance.ResourceManager.LoadMesh("saucer1-shield/saucer1-shield.mesh"); //typeof(Battery).GetCustomAttributes( Battery = new Battery(50); Generator = new Generator(10, Battery); Inventory = new Inventory(40); //Inventory.Load(typeof(HomingMissile), 10); Inventory.Load(typeof(LaserCannon), 2); Inventory.Load(typeof(IonPulseCannon), 2); Inventory.Load(typeof(DisruptorCannon), 2); Inventory.Load(typeof(Mine), 10); Inventory.Load(typeof(MineLayer), 2); //Inventory.Load(typeof(MissileLauncher), 1); Slots = new Slot[]{ new Slot(null,new Vector3(20,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(-20,0,0),Quaternion.Identity,0) }; Shield = new Shield(Battery, 0, 0); Hull = new Hull(50); Computer = new Computer(this); Radius = 39; RenderRadius = 40; SyncRefs = false; //ShieldSound = Root.Instance.ResourceManager.LoadSound("cnv-shield.wav"); WeaponNumbers = new int[] { -1, -1 }; ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 0); ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 1); MainThrust = 2400; StrafeThrust = 600; Resistance = 0.7f; RollSpeed = 2.5f; MaxRoll = (float)Math.PI/5.0f; MaxRotationSpeed = 3; }
public Sulaco() { Draw = new ArrayList(); //Draw.Add(Root.Instance.ResourceManager.LoadMesh("cnv301-low/cnv301-low.mesh")); Draw.Add(model=Root.Instance.ResourceManager.LoadMesh("sulaco/sulaco.mesh")); //Draw.Add(Root.Instance.ResourceManager.LoadMesh("saucer1/saucer1.mesh")); //Transparent = true; //model.BBox = new BoundingBox(new Vector3(-50, -100, -350), new Vector3(50, 100, 350)); //ShieldModel = Root.Instance.ResourceManager.LoadMesh("cnv-shield/cnv-shield.mesh"); ShieldModel = Root.Instance.ResourceManager.LoadMesh("sulaco-shield/sulaco-shield.mesh"); Battery = new Battery(200); Generator = new Generator(20, Battery); Inventory = new Inventory(200); //Inventory.Load(typeof(HomingMissile), 10); Inventory.Load(typeof(LaserCannon), 2); Inventory.Load(typeof(RailGun), 1); Inventory.Load(typeof(IonPulseCannon), 2); Inventory.Load(typeof(DisruptorCannon), 2); Inventory.Load(typeof(PulseLaserCannon), 2); Inventory.Load(typeof(Mine), 10); Inventory.Load(typeof(MineLayer), 1); //Inventory.Load(typeof(MissileLauncher), 1); Slots = new Slot[3]{ new Slot(null,new Vector3(46,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(-46,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(64,0,0),Quaternion.Identity,0) }; Shield = new Shield(Battery, 300, 5); Hull = new Hull(200); Computer = new Computer(this); Radius = 150; RenderRadius = 700; SyncRefs = false; ShieldSound = Root.Instance.ResourceManager.LoadSound("ST_IMP_FEDROM_Photon_Shield_1.wav"); WeaponNumbers = new int[] { -1, -1, -1 }; ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 0); ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 1); MainThrust = 80; StrafeThrust = 30; Resistance = 0.1f; RollSpeed = 0.5f; MaxRoll = 0.5f; MaxRotationSpeed = 0.3f; }
public GravityForceShip() { Draw = new ArrayList(); Draw.Add(Root.Instance.ResourceManager.LoadMesh("spaceship-symbol/spaceship-symbol.mesh")); //Draw.Add(Root.Instance.ResourceManager.LoadMesh("mk9hawk/mk9hawk.mesh")); //Draw.Add(new Marker()); //Transparent = true; ShieldModel = Root.Instance.ResourceManager.LoadMesh("cnv-shield/cnv-shield.mesh"); //ShieldModel = Root.Instance.ResourceManager.LoadMesh("mk9hawk-shield/mk9hawk-shield.mesh"); Battery = new Battery(100); Generator = new Generator(10, Battery); Inventory = new Inventory(100); //Inventory.Load(typeof(HomingMissile), 10); Inventory.Load(typeof(LaserCannon), 2); Inventory.Load(typeof(RailGun), 1); Inventory.Load(typeof(IonPulseCannon), 2); Inventory.Load(typeof(DisruptorCannon), 2); Inventory.Load(typeof(PulseLaserCannon), 2); Inventory.Load(typeof(Mine), 10); Inventory.Load(typeof(MineLayer), 1); Inventory.Load(typeof(HomingMissile), 10); Inventory.Load(typeof(HomingMissileLauncher), 1); //Inventory.Load(typeof(MissileLauncher), 1); Slots = new Slot[3]{ new Slot(null,new Vector3(46,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(-46,0,0),Quaternion.Identity,0), new Slot(null,new Vector3(64,0,0),Quaternion.Identity,0) }; Shield = new Shield(Battery, 100, 5); Hull = new Hull(100); Computer = new Computer(this); Radius = 60; RenderRadius = 90; SyncRefs = false; ShieldSound = Root.Instance.ResourceManager.LoadSound("cnv-shield.wav"); WeaponNumbers = new int[] { -1, -1, -1 }; ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 0); ArmWeapon(GetWeaponNumber(typeof(LaserCannon)), 1); MainThrust = 600; StrafeThrust = 0; Resistance = 0.0f; RollSpeed = 0; MaxRoll = 0; MaxRotationSpeed = 3; MaxSpeed = 500; }
public LaserTurret() { Draw = new ArrayList(); Draw.Add(Root.Instance.ResourceManager.LoadMesh("turret/turret.mesh")); Battery = new Battery(100); Generator = new Generator(20, Battery); Slots = new Slot[]{ new Slot(new LaserCannon(Battery),new Vector3(30,0,0),Quaternion.Identity,0), new Slot(new LaserCannon(Battery),new Vector3(-30,0,0),Quaternion.Identity,0), }; Shield = new Shield(Battery, 100, 5); Hull = new Hull(100); Computer = new Computer(this); Radius = 40; RenderRadius = 50; SyncRefs = false; }
public override void Fire(Actor ss, Slot s) { base.Fire(ss, s); AmmoSource.Unload(AmmoType, 1); }
public override void Fire(Actor ss, Slot s) { base.Fire(ss, s); EnergySource.CurrentEnergy -= EnergyPerShot; }
public WeaponDisplay(Slot[] slots) : base(Root.Instance.UserInterface!=null?(Root.Instance.UserInterface.Renderer.Size.X - 150):1000, 0, 96, slots.Length * 16, new Layout(1, slots.Length)) { Transparent = true; WeaponButtons = new Button[slots.Length]; WeaponProgress = new ProgressBar[slots.Length]; for (int i = 0; i < slots.Length; i += 1) { WeaponButtons[i] = new Button("-none-"); WeaponButtons[i].Transparent = true; Add(WeaponButtons[i], 0, i); WeaponProgress[i] = new ProgressBar(new Color4f(0.3f, 0.3f, 0.3f, 0.5f), new Color4f(0, 1, 0, 0.5f), OrientationType.Horizontal); Add(WeaponProgress[i], 0, i); } Slots = slots; Layout.Update(Size); }