// Token: 0x0600203D RID: 8253 RVA: 0x00099EB0 File Offset: 0x000980B0
    public override void Shoot(Ray ray, out CmunePairList <BaseGameProp, ShotPoint> hits)
    {
        hits = null;
        RaycastHit raycastHit;

        if (this.MinProjectileDistance > 0 && Physics.Raycast(ray.origin, ray.direction, out raycastHit, (float)this.MinProjectileDistance, UberstrikeLayerMasks.LocalRocketMask))
        {
            int num = base.Controller.NextProjectileId();
            hits = new CmunePairList <BaseGameProp, ShotPoint>(1);
            hits.Add(null, new ShotPoint(raycastHit.point, num));
            this.ShowExplosionEffect(raycastHit.point, raycastHit.normal, ray.direction, num);
            if (this.OnProjectileShoot != null)
            {
                this.OnProjectileShoot(new ProjectileInfo(num, new Ray(raycastHit.point, -ray.direction)));
            }
        }
        else
        {
            if (this._decorator)
            {
                this._decorator.ShowShootEffect(new RaycastHit[0]);
            }
            UnityRuntime.StartRoutine(this.EmitProjectile(ray));
        }
    }
Example #2
0
    // Token: 0x06002009 RID: 8201 RVA: 0x000993A8 File Offset: 0x000975A8
    public override void Shoot(Ray ray, out CmunePairList <BaseGameProp, ShotPoint> hits)
    {
        hits = null;
        Vector3    direction    = WeaponDataManager.ApplyDispersion(ray.direction, this._view, this._supportIronSight);
        int        projectileId = base.Controller.NextProjectileId();
        RaycastHit raycastHit;

        if (Physics.Raycast(ray.origin, direction, out raycastHit, 1000f, (!base.Controller.IsLocal) ? UberstrikeLayerMasks.ShootMaskRemotePlayer : UberstrikeLayerMasks.ShootMask))
        {
            HitPoint     point     = new HitPoint(raycastHit.point, TagUtil.GetTag(raycastHit.collider));
            BaseGameProp component = raycastHit.collider.GetComponent <BaseGameProp>();
            if (component)
            {
                hits = new CmunePairList <BaseGameProp, ShotPoint>(1);
                hits.Add(component, new ShotPoint(raycastHit.point, projectileId));
            }
            this.Decorator.PlayImpactSoundAt(point);
        }
        else
        {
            raycastHit.point = ray.origin + ray.direction * 1000f;
        }
        if (this.Decorator)
        {
            this.Decorator.ShowShootEffect(new RaycastHit[]
            {
                raycastHit
            });
        }
        base.OnHits(hits);
    }
Example #3
0
    // Token: 0x06001F98 RID: 8088 RVA: 0x00097844 File Offset: 0x00095A44
    private IEnumerator StartApplyDamage(WeaponSlot slot, float delay, CmunePairList <BaseGameProp, ShotPoint> hits)
    {
        yield return(new WaitForSeconds(delay));

        this.ApplyDamage(slot, hits);
        yield break;
    }
 // Token: 0x06001FF8 RID: 8184 RVA: 0x00015101 File Offset: 0x00013301
 protected void OnHits(CmunePairList <BaseGameProp, ShotPoint> hits)
 {
     if (this.OnTargetHit != null)
     {
         this.OnTargetHit(hits);
     }
 }
    // Token: 0x0600200C RID: 8204 RVA: 0x000994D4 File Offset: 0x000976D4
    public override void Shoot(Ray ray, out CmunePairList <BaseGameProp, ShotPoint> hits)
    {
        Dictionary <BaseGameProp, ShotPoint> dictionary = new Dictionary <BaseGameProp, ShotPoint>(this.ShotgunGauge);
        HitPoint hitPoint = null;

        RaycastHit[] array        = new RaycastHit[this.ShotgunGauge];
        int          projectileId = base.Controller.NextProjectileId();
        int          num          = 1000;

        for (int i = 0; i < this.ShotgunGauge; i++)
        {
            Vector3    direction = WeaponDataManager.ApplyDispersion(ray.direction, this._view, false);
            RaycastHit raycastHit;
            if (Physics.Raycast(ray.origin, direction, out raycastHit, (float)num, (!base.Controller.IsLocal) ? UberstrikeLayerMasks.ShootMaskRemotePlayer : UberstrikeLayerMasks.ShootMask))
            {
                if (hitPoint == null)
                {
                    hitPoint = new HitPoint(raycastHit.point, TagUtil.GetTag(raycastHit.collider));
                }
                BaseGameProp component = raycastHit.collider.GetComponent <BaseGameProp>();
                if (component)
                {
                    ShotPoint shotPoint;
                    if (dictionary.TryGetValue(component, out shotPoint))
                    {
                        shotPoint.AddPoint(raycastHit.point);
                    }
                    else
                    {
                        dictionary.Add(component, new ShotPoint(raycastHit.point, projectileId));
                    }
                }
                array[i] = raycastHit;
            }
            else
            {
                array[i].point  = ray.origin + ray.direction * 1000f;
                array[i].normal = raycastHit.normal;
            }
        }
        this.Decorator.PlayImpactSoundAt(hitPoint);
        hits = new CmunePairList <BaseGameProp, ShotPoint>(dictionary.Count);
        foreach (KeyValuePair <BaseGameProp, ShotPoint> keyValuePair in dictionary)
        {
            hits.Add(keyValuePair.Key, keyValuePair.Value);
        }
        if (this.Decorator)
        {
            this.Decorator.ShowShootEffect(array);
        }
        base.OnHits(hits);
    }
Example #6
0
    // Token: 0x06002010 RID: 8208 RVA: 0x000996D8 File Offset: 0x000978D8
    public override void Shoot(Ray ray, out CmunePairList <BaseGameProp, ShotPoint> hits)
    {
        Vector3 origin = ray.origin;

        origin.y  -= 0.1f;
        ray.origin = origin;
        hits       = null;
        float radius    = 1f;
        int   layerMask = (!base.Controller.IsLocal) ? UberstrikeLayerMasks.ShootMaskRemotePlayer : UberstrikeLayerMasks.ShootMask;
        float distance  = 1f;

        RaycastHit[] array        = Physics.SphereCastAll(ray, radius, distance, layerMask);
        int          projectileId = base.Controller.NextProjectileId();

        if (array != null && array.Length > 0)
        {
            hits = new CmunePairList <BaseGameProp, ShotPoint>();
            float      num = float.PositiveInfinity;
            RaycastHit hit = array[0];
            foreach (RaycastHit raycastHit in array)
            {
                Vector3 rhs = raycastHit.point - ray.origin;
                if (Vector3.Dot(ray.direction, rhs) > 0f && raycastHit.distance < num)
                {
                    num = raycastHit.distance;
                    hit = raycastHit;
                }
            }
            if (hit.collider)
            {
                BaseGameProp component = hit.collider.GetComponent <BaseGameProp>();
                if (component != null)
                {
                    hits.Add(component, new ShotPoint(hit.point, projectileId));
                }
                if (this._decorator)
                {
                    this._decorator.StartCoroutine(this.StartShowingEffect(hit, ray.origin, this.HitDelay));
                }
            }
        }
        else if (this._decorator)
        {
            this._decorator.ShowShootEffect(new RaycastHit[0]);
        }
        this.EmitWaterImpactParticles(ray, radius);
        base.OnHits(hits);
    }
Example #7
0
 // Token: 0x06001F99 RID: 8089 RVA: 0x0009788C File Offset: 0x00095A8C
 private void ApplyDamage(WeaponSlot slot, CmunePairList <BaseGameProp, ShotPoint> hits)
 {
     foreach (KeyValuePair <BaseGameProp, ShotPoint> keyValuePair in hits)
     {
         DamageInfo damageInfo = new DamageInfo(Convert.ToInt16(slot.View.DamagePerProjectile * keyValuePair.Value.Count))
         {
             Bullets = (byte)keyValuePair.Value.Count,
             Force   = GameState.Current.Player.WeaponCamera.transform.forward * (float)(slot.View.DamagePerProjectile * keyValuePair.Value.Count),
             UpwardsForceMultiplier = 10f,
             Hitpoint            = keyValuePair.Value.MidPoint,
             ProjectileID        = keyValuePair.Value.ProjectileId,
             SlotId              = slot.SlotId,
             WeaponID            = slot.View.ID,
             WeaponClass         = slot.View.ItemClass,
             CriticalStrikeBonus = WeaponConfigurationHelper.GetCriticalStrikeBonus(slot.View)
         };
         if (keyValuePair.Key != null)
         {
             keyValuePair.Key.ApplyDamage(damageInfo);
         }
     }
 }
 // Token: 0x06001FF7 RID: 8183
 public abstract void Shoot(Ray ray, out CmunePairList <BaseGameProp, ShotPoint> hits);