示例#1
0
        private static float GetTimeout(FiredProjectile projectile, float distance)
        {
            double maxVelocity = OpCodes.GetMaxVelocity(projectile.AmmoType);

            if (projectile.AmmoType > 0)
            {
                maxVelocity *= OpCodes.GetProjectileVelocityScale((EPrefabUID)projectile.PrefabID);
            }
            double y = projectile.FiredTime + 1f;
            double z = maxVelocity;
            double w = OpCodes.GetProjectileInitialDistance(projectile.AmmoType);
            double f = distance;
            double x = (-w + f + 1.5f * y * z - 0.09799f * z);

            return((float)((x / (1.5f * z)) - GetCurrentTime()));
        }
示例#2
0
        // Token: 0x06000128 RID: 296 RVA: 0x0000A06C File Offset: 0x0000826C
        private static float GetTimeout(FiredProjectile projectile, float distance)
        {
            double maxVelocity = (double)OpCodes.GetMaxVelocity(projectile.AmmoType);
            bool   flag        = projectile.AmmoType > 0;

            if (flag)
            {
                maxVelocity *= (double)OpCodes.GetProjectileVelocityScale((EPrefabUID)projectile.PrefabID);
            }
            double y        = (double)(projectile.FiredTime + 1f);
            double z        = maxVelocity;
            double w        = (double)OpCodes.GetProjectileInitialDistance(projectile.AmmoType);
            double f        = (double)distance;
            double chisl    = -w + f + 1.5 * y * z - 0.0979899987578392 * z;
            double znam     = 1.5 * z;
            double drob     = chisl / znam;
            double normDrob = drob - (double)RangeAim.GetCurrentTime();

            return((float)normDrob);
        }