public override void DoAction()
        {
            envEffect = WeaponLoader.GetEnvironmentProperty(typeId);

            creationPosition = this.GetPosition();

            if ( Game.Players.ContainsKey(ownerId))
                envEffect.Owner = Game.Players[ownerId];

            Game.EnvironmentEffects.AddEffect(envEffect, id, creationPosition);
        }
        /// <summary>
        /// Constructor for ProjectileData.  This class is meant to be instantiated by the XML loader.
        /// </summary>
        public ProjectileData(int id, string name, string model, float projectileScale, string particleEffectName,
            string impactParticleName, string impactSoundEffect, string expirationParticleName, List<Weapon.ParticleEmitter> emitters, List<Weapon.ModelAnimation> animations,
            int areaOfEffectRadius, bool areaOfEffectUsesCone, float areaOfEffectDecay, int coneRadius, int coneOriginWidth, bool coneDamagesEntireArea,
            int minDamage, int maxDamage, bool isInstantaneous, int initialVelocity, int terminalVelocity, int acceleration, int range,
            int rangeVariation, int jumpRange, float jumpDamageDecay, int jumpCount, int environmentEffectID, float radius, EnvironmentProperty envProperty)
        {
            this.id = id;
            this.name = name;
            this.model = model;
            this.projectileScale = projectileScale;
            this.particleEffectName = particleEffectName;
            this.impactParticleName = impactParticleName;
            this.impactSoundEffect = impactSoundEffect;
            this.expirationParticleName = expirationParticleName;
            this.emitters = emitters;
            this.animations = animations;
            this.areaOfEffectRadius = areaOfEffectRadius;
            this.areaOfEffectUsesCone = areaOfEffectUsesCone;
            this.areaOfEffectDecay = areaOfEffectDecay;
            this.coneRadius = coneRadius;
            this.coneOriginWidth = coneOriginWidth;
            this.coneDamagesEntireArea = coneDamagesEntireArea;
            this.minDamage = minDamage;
            this.maxDamage = maxDamage;
            this.isInstantaneous = isInstantaneous;
            this.initialVelocity = initialVelocity;
            this.terminalVelocity = terminalVelocity;
            this.acceleration = acceleration;
            this.range = range;
            this.rangeVariation = rangeVariation;
            this.jumpRange = jumpRange;
            this.jumpDamageDecay = jumpDamageDecay;
            this.jumpCount = jumpCount;
            this.environmentEffectID = environmentEffectID;
            this.collisionRadius = radius;
            this.environmentEffect = envProperty;

            if (this.coneRadius != 0 && this.areaOfEffectUsesCone == false)
            {
                this.hasScatter = true;
            }
            else
            {
                this.hasScatter = false;
            }
        }
        /// <summary>
        /// Add an effect to the collection of EnvironmentProperties
        /// </summary>
        /// <param name="envProp">The environment property.</param>
        /// <param name="id">The environment property's Id</param>
        /// <param name="position">The position to add it in the scene.</param>
        public void AddEffect(EnvironmentProperty envProp, int id, Vector3 position)
        {
            if (envProps.ContainsKey(id))
                RemoveEffect(id);

            ParticleEmitter emitter = new ParticleEmitter(envProp.ParticleEffectName);
            ParticleEmitterSettings settings = emitter.Settings;

            settings.Radius = (int)Math.Floor(envProp.AoERadius);
            ParticleEmitter __emitterCopy = new ParticleEmitter(settings);

            __emitterCopy.Position = position;

            envProp.RenderID = ServiceManager.Scene.Add(__emitterCopy, 3);
            envProp.SetCreationTime();
            envProps[id] = envProp;
        }
Beispiel #4
0
        /// <summary>
        /// Constructor for ProjectileData.  This class is meant to be instantiated by the XML loader.
        /// </summary>
        public ProjectileData(int id, string name, string model, float projectileScale, string particleEffectName,
                              string impactParticleName, string impactSoundEffect, string expirationParticleName, List <Weapon.ParticleEmitter> emitters, List <Weapon.ModelAnimation> animations,
                              int areaOfEffectRadius, bool areaOfEffectUsesCone, float areaOfEffectDecay, int coneRadius, int coneOriginWidth, bool coneDamagesEntireArea,
                              int minDamage, int maxDamage, bool isInstantaneous, int initialVelocity, int terminalVelocity, int acceleration, int range,
                              int rangeVariation, int jumpRange, float jumpDamageDecay, int jumpCount, int environmentEffectID, float radius, EnvironmentProperty envProperty)
        {
            this.id                     = id;
            this.name                   = name;
            this.model                  = model;
            this.projectileScale        = projectileScale;
            this.particleEffectName     = particleEffectName;
            this.impactParticleName     = impactParticleName;
            this.impactSoundEffect      = impactSoundEffect;
            this.expirationParticleName = expirationParticleName;
            this.emitters               = emitters;
            this.animations             = animations;
            this.areaOfEffectRadius     = areaOfEffectRadius;
            this.areaOfEffectUsesCone   = areaOfEffectUsesCone;
            this.areaOfEffectDecay      = areaOfEffectDecay;
            this.coneRadius             = coneRadius;
            this.coneOriginWidth        = coneOriginWidth;
            this.coneDamagesEntireArea  = coneDamagesEntireArea;
            this.minDamage              = minDamage;
            this.maxDamage              = maxDamage;
            this.isInstantaneous        = isInstantaneous;
            this.initialVelocity        = initialVelocity;
            this.terminalVelocity       = terminalVelocity;
            this.acceleration           = acceleration;
            this.range                  = range;
            this.rangeVariation         = rangeVariation;
            this.jumpRange              = jumpRange;
            this.jumpDamageDecay        = jumpDamageDecay;
            this.jumpCount              = jumpCount;
            this.environmentEffectID    = environmentEffectID;
            this.collisionRadius        = radius;
            this.environmentEffect      = envProperty;

            if (this.coneRadius != 0 && this.areaOfEffectUsesCone == false)
            {
                this.hasScatter = true;
            }
            else
            {
                this.hasScatter = false;
            }
        }