Ejemplo n.º 1
0
        public virtual void StructureFired(ICanFire firingStructure, float rotation, List <int> projectileIDs, IProjectileManager pm, byte percentCharge, byte weaponSlot)
        {
            foreach (var id in projectileIDs)
            {
                pm.CreateProjectile(firingStructure, id);
            }

            var messageData = new MessageObjectFired {
                ObjectType = FiringObjectTypes.Structure, FiringObjectID = firingStructure.Id, PercentCharge = percentCharge, Rotation = rotation, WeaponSlot = weaponSlot, ProjectileIDs = projectileIDs
            };

            BroadcastMessage(new NetworkMessageContainer(messageData, MessageTypes.ObjectFired), null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates projectiles and notifies other clients of firing ship
        /// </summary>
        /// <param name="firingPlayer"></param>
        /// <param name="weaponSlot"></param>
        public virtual void ShipFired(IShip firingShip, float rotation, byte weaponSlot, List <int> projectileIDs, IProjectileManager pm, byte percentCharge = 0)
        {
            foreach (var id in projectileIDs)
            {
                pm.CreateProjectile(firingShip, id);
            }

            MessageObjectFired messageData = new MessageObjectFired {
                FiringObjectID = firingShip.Id, ObjectType = FiringObjectTypes.Ship, PercentCharge = percentCharge, Rotation = rotation, WeaponSlot = weaponSlot, ProjectileIDs = projectileIDs
            };

            BroadcastMessage(new NetworkMessageContainer(messageData, MessageTypes.ObjectFired), firingShip.Id, firingShip.PilotType == PilotTypes.NPC);//If NPC, simulator doesn't need to get spammed with ship fired notifications
        }