Beispiel #1
0
        public virtual void UpdateProjectile()
        {
            if (HitTarget())
            {
                if (mSplash)
                {
                    ApplySplashDamage();
                }
                else
                {
                    ApplySingleDamage();
                }

                if (mHitSound != null && mPlaySound)
                {
                    mWorld.PlaySound(mHitSound, mTarget.Position);
                }

                mActive = false;
            }
            else if (Overshot())
            {
                mPosition = mTargetPos;
                if (mSplash)
                {
                    ApplySplashDamage();
                }
                else
                {
                    ApplySingleDamage();
                }

                if (mHitSound != null && mPlaySound)
                {
                    mWorld.PlaySound(mHitSound, mTarget.Position);
                }

                mActive = false;
            }
            else
            {
                Move();
            }
        }
Beispiel #2
0
        protected virtual void Fire(Unit target)
        {
            mProjectiles.Add(new Arrow(mWorld, mCenter, target, mDmg, mProjectileSpeed, mImprecision));

            mFiringTimer -= mFiringRate;
            if (mFireSound != null && mPlaySound)
            {
                mWorld.PlaySound(mFireSound, mCenter);
            }
        }