Inheritance: IProjectileInfo
Beispiel #1
0
        public LaserZap(ProjectileArgs args, LaserZapInfo info, Color color)
        {
            this.args  = args;
            this.info  = info;
            this.color = color;
            target     = args.PassiveTarget;

            if (!string.IsNullOrEmpty(info.HitAnim))
            {
                hitanim = new Animation(args.SourceActor.World, info.HitAnim);
            }
        }
Beispiel #2
0
        public LaserZap(LaserZapInfo info, ProjectileArgs args, Color color)
        {
            this.args      = args;
            this.info      = info;
            this.color     = color;
            secondaryColor = info.SecondaryBeamUsePlayerColor ? args.SourceActor.Owner.Color.RGB : info.SecondaryBeamColor;
            target         = args.PassiveTarget;
            source         = args.Source;

            if (info.Inaccuracy.Length > 0)
            {
                var inaccuracy = OpenRA.Mods.Common.Util.ApplyPercentageModifiers(info.Inaccuracy.Length, args.InaccuracyModifiers);
                var maxOffset  = inaccuracy * (target - source).Length / args.Weapon.Range.Length;
                target += WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * maxOffset / 1024;
            }

            if (!string.IsNullOrEmpty(info.HitAnim))
            {
                hitanim = new Animation(args.SourceActor.World, info.HitAnim);
            }
        }
Beispiel #3
0
        public LaserZap(LaserZapInfo info, ProjectileArgs args, Color color)
        {
            this.args      = args;
            this.info      = info;
            this.color     = color;
            secondaryColor = info.SecondaryBeamUsePlayerColor ? args.SourceActor.Owner.Color : info.SecondaryBeamColor;
            target         = args.PassiveTarget;
            source         = args.Source;

            if (info.Inaccuracy.Length > 0)
            {
                var maxInaccuracyOffset = Util.GetProjectileInaccuracy(info.Inaccuracy.Length, info.InaccuracyType, args);
                target += WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * maxInaccuracyOffset / 1024;
            }

            if (!string.IsNullOrEmpty(info.HitAnim))
            {
                hitanim     = new Animation(args.SourceActor.World, info.HitAnim);
                showHitAnim = true;
            }

            hasLaunchEffect = !string.IsNullOrEmpty(info.LaunchEffectImage) && !string.IsNullOrEmpty(info.LaunchEffectSequence);
        }