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(); } }
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); } }