Ejemplo n.º 1
0
        protected virtual void OnFire()
        {
            long         appliedDamage = Damage;
            LSProjectile projectile    = ProjectileManager.Create(
                ProjCode,
                this.Agent,
                this.ProjectileOffset,
                this.TargetAllegiance,
                (other) => this.Agent.Healther.IsNotNull(),
                (agent) => agent.Healther.TakeRawDamage(appliedDamage));

            projectile.InitializeHoming(this.Target);
            projectile.TargetPlatform = TargetPlatform;
            ProjectileManager.Fire(projectile);
        }
Ejemplo n.º 2
0
        public LSProjectile FireProjectile(Vector3d projOffset, LSAgent target)
        {
            LSProjectile currentProjectile = ProjectileManager.Create(
                ProjCode,
                this.Agent,
                projOffset,
                this.TargetAllegiance,
                (other) =>
            {
                Health healther = other.GetAbility <Health>();
                return(healther.IsNotNull() && healther.HealthAmount > 0);
            },
                CachedOnHit);

            switch (currentProjectile.TargetingBehavior)
            {
            case TargetingType.Homing:
                currentProjectile.InitializeHoming(target);
                break;

            case TargetingType.Timed:
                currentProjectile.InitializeTimed(Agent.Body.Forward);
                break;

            case TargetingType.Positional:
                currentProjectile.InitializePositional(target.Body.Position.ToVector3d(target.Body.HeightPos));
                break;

            case TargetingType.Free:
                //TODO
                throw new System.Exception("Not implemented yet.");
                //break;
            }
            if (onPrepareProjectile != null)
            {
                onPrepareProjectile(currentProjectile);
            }
            ProjectileManager.Fire(currentProjectile);
            return(currentProjectile);
        }
Ejemplo n.º 3
0
        protected virtual void OnFire()
        {
            long appliedDamage = Damage;

            LSProjectile projectile = ProjectileManager.Create(
                ProjCode,
                this.Agent,
                this.ProjectileOffset,
                this.TargetAllegiance,
                (other) =>
            {
                Health healther = other.GetAbility <Health>();
                return(healther.IsNotNull() && healther.HealthAmount > 0);
            },
                CachedOnHit);

            switch (projectile.TargetingBehavior)
            {
            case TargetingType.Homing:
                projectile.InitializeHoming(this.Target);
                break;

            case TargetingType.Timed:
                projectile.InitializeTimed();
                break;

            case TargetingType.Positional:
                projectile.InitializePositional(Target.Body.Position.ToVector3d(Target.Body.HeightPos));
                break;

            case TargetingType.Free:
                //TODO
                throw new System.Exception("Not implemented yet.");
                break;
            }
            ProjectileManager.Fire(projectile);
        }