Ejemplo n.º 1
0
        public new bool LoadData(NdfObject dataobject, IrisZoomDataApi.TradManager dictionary, IrisZoomDataApi.TradManager dictionary2, IrisZoomDataApi.EdataManager iconPackage)
        {
            NdfSingle ndfFloat32;
            NdfCollection ndfCollection;

            // Traerse speed
            TraverseSpeed = 0;
            if (dataobject.TryGetValueFromQuery<NdfSingle>(ROTATION_SPEED_PROPERTY, out ndfFloat32))
                TraverseSpeed = ndfFloat32.Value;

            // Weapons
            if (dataobject.TryGetValueFromQuery<NdfCollection>(WEAPONS_PROPERTY, out ndfCollection))
            {
                List<CollectionItemValueHolder> weaponss = ndfCollection.InnerList.FindAll(x => x.Value is NdfObjectReference);

                List<NdfObjectReference> weapons = new List<NdfObjectReference>();
                foreach (CollectionItemValueHolder w in weaponss)
                {
                    weapons.Add(w.Value as NdfObjectReference);
                }

                AoAWeapon weapon;
                foreach (NdfObjectReference w in weapons)
                {
                    weapon = new AoAWeapon(Prefix);
                    if (weapon.LoadData(w.Instance, dictionary, dictionary2, iconPackage))
                        Weapons.Add(weapon);
                }
            }
            return true;
        }
Ejemplo n.º 2
0
 public bool LoadData(NdfObject dataobject, IrisZoomDataApi.TradManager dictionary, IrisZoomDataApi.TradManager dictionary2, IrisZoomDataApi.EdataManager iconPackage)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
        public new bool LoadData(NdfObject dataobject, IrisZoomDataApi.TradManager dictionary, IrisZoomDataApi.TradManager dictionary2, IrisZoomDataApi.EdataManager iconPackage)
        {
            NdfBoolean ndfbool;
            NdfSingle ndffloat32;
            NdfUInt32 ndfUint32;
            NdfLocalisationHash ndfHash;
            string name;

            // Name
            if (dataobject.TryGetValueFromQuery<NdfLocalisationHash>(NAME_PROPERTY, out ndfHash))
            {
                if (dictionary.TryGetString(ndfHash.Value, out name))
                    Name = string.IsNullOrEmpty(Prefix) ? name : Prefix + ": " + name;

            }
            else { Name = string.Empty; }

            //GroundRange
            if (dataobject.TryGetValueFromQuery<NdfSingle>(MAX_RANGE_PROPERTY, out ndffloat32))
                GroundRange = ndffloat32.Value;

            //Alpha
            if (!dataobject.TryGetValueFromQuery<NdfSingle>(DAMAGE_PROPERTY, out ndffloat32))
                return false;
            Alpha = ndffloat32.Value;

            //TBARange
            if (dataobject.TryGetValueFromQuery<NdfSingle>(HELICOPTER_MAX_RANGE_PROPERTY, out ndffloat32))
                VLARange = ndffloat32.Value;

            //THARange
            if (dataobject.TryGetValueFromQuery<NdfSingle>(PLANE_MAX_RANGE_PROPERTY, out ndffloat32))
                VHARange = ndffloat32.Value;

            //Splash
            if (dataobject.TryGetValueFromQuery<NdfSingle>(SPLASH_DAMAGE_RADIUS_PROPERTY, out ndffloat32))
                Splash = ndffloat32.Value;

            //PowGen
            if (dataobject.TryGetValueFromQuery<NdfSingle>(POW_PROBABILITY_PROPERTY, out ndffloat32))
                PoWGen = ndffloat32.Value;

            //AmBush
            if (dataobject.TryGetValueFromQuery<NdfSingle>(AMBUSH_MULTIPLIER_PROPERTY, out ndffloat32))
                AmbushMultiplier = ndffloat32.Value;

            // SimulatenousShots
            if (!dataobject.TryGetValueFromQuery<NdfUInt32>(SIMULTANEOUS_PROJECTILES_PROPERTY, out ndfUint32))
                return false;
            SimulatenousShots = (int)ndfUint32.Value;

            // MaxShotsPerSalvo
            if (!dataobject.TryGetValueFromQuery<NdfUInt32>(SHOTS_PER_SALVO_PROPERTY, out ndfUint32))
                return false;
            MaxShotsPerSalvo = (int)ndfUint32.Value;

            //TimeBetweenShots
            if (!dataobject.TryGetValueFromQuery<NdfSingle>(TIME_BETWEEN_SHOTS_PROPERTY, out ndffloat32))
                return false;
            TimeBetweenShots = ndffloat32.Value;

            //Salvo Reload Time
            if (!dataobject.TryGetValueFromQuery<NdfSingle>(SALVO_RELOAD_TIME_PROPERTY, out ndffloat32))
                return false;
            SalvoReloadTime = ndffloat32.Value;

            //Aiming Time
            AimingTime = 0;
            if (dataobject.TryGetValueFromQuery<NdfSingle>(AIMING_TIME_PROPERTY, out ndffloat32))
                AimingTime = ndffloat32.Value;

            //Noise
            IsSilenced = false;
            if (dataobject.TryGetValueFromQuery<NdfSingle>(NOISE, out ndffloat32))
                IsSilenced = ndffloat32.Value < 5;

            //Supress
            SupressDamages = 0;
            if (dataobject.TryGetValueFromQuery<NdfSingle>(SUPRESS_DAMAGES, out ndffloat32))
                SupressDamages = ndffloat32.Value;

            if (dataobject.TryGetValueFromQuery<NdfSingle>(AMBUSH_MULTIPLIER_PROPERTY, out ndffloat32))
                AmbushMultiplier = ndffloat32.Value;

            double oneSalvoCycleTime =  TimeBetweenShots * MaxShotsPerSalvo + SalvoReloadTime; // sec
            float nbshotInOneCycle = SimulatenousShots * MaxShotsPerSalvo;
            double nbCycleInAMinute = 60 / oneSalvoCycleTime;

            Sustained = nbshotInOneCycle * nbCycleInAMinute * Alpha;

            return true;
        }