// 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); }
// 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); }
// Token: 0x06002011 RID: 8209 RVA: 0x00099898 File Offset: 0x00097A98 private IEnumerator StartShowingEffect(RaycastHit hit, Vector3 origin, float delay) { if (this._decorator) { this._decorator.ShowShootEffect(new RaycastHit[] { hit }); } yield return(new WaitForSeconds(delay)); this.Decorator.PlayImpactSoundAt(new HitPoint(hit.point, TagUtil.GetTag(hit.collider))); yield break; }
// Token: 0x06001F39 RID: 7993 RVA: 0x00096438 File Offset: 0x00094638 protected override void OnCollisionEnter(Collision c) { if (!base.IsProjectileExploded && LayerUtil.IsLayerInMask(base.CollisionMask, c.gameObject.layer)) { if (c.contacts.Length > 0) { base.Explode(c.contacts[0].point, c.contacts[0].normal, TagUtil.GetTag(c.collider)); } else { this.Explode(); } } }
// Token: 0x060011A8 RID: 4520 RVA: 0x00069A68 File Offset: 0x00067C68 public void OnTriggerEnterEvent(Collider c) { if (TagUtil.GetTag(c) == "Player") { this.behaviour.machine.PopState(true); GameState.Current.Player.MoveController.ApplyForce(this.behaviour._config.JumpDirection.normalized * (float)this.behaviour._config.Force, CharacterMoveController.ForceType.Additive); AutoMonoBehaviour <SfxManager> .Instance.PlayInGameAudioClip(this.behaviour.JumpSound, 0UL); Singleton <ProjectileManager> .Instance.RemoveProjectile(this.behaviour.ID, true); GameState.Current.Actions.RemoveProjectile(this.behaviour.ID, true); } else if (this.behaviour.collider.gameObject.layer == 20) { AutoMonoBehaviour <SfxManager> .Instance.Play3dAudioClip(GameAudio.JumpPad, this.behaviour.transform.position, 1f); } }
// Token: 0x06001E33 RID: 7731 RVA: 0x000949EC File Offset: 0x00092BEC protected void EmitImpactParticles(RaycastHit hit, Vector3 direction, Vector3 muzzlePosition, float distance, bool playSound) { string tag = TagUtil.GetTag(hit.collider); Vector3 point = hit.point; Vector3 hitNormal = hit.normal; SurfaceEffectType surface = SurfaceEffectType.Default; if (this._effectMap.TryGetValue(tag, out surface)) { if (GameState.Current.Map != null && GameState.Current.Map.HasWaterPlane && ((this._muzzlePosition.position.y > GameState.Current.Map.WaterPlaneHeight && point.y < GameState.Current.Map.WaterPlaneHeight) || (this._muzzlePosition.position.y < GameState.Current.Map.WaterPlaneHeight && point.y > GameState.Current.Map.WaterPlaneHeight))) { surface = SurfaceEffectType.WaterEffect; hitNormal = Vector3.up; point.y = GameState.Current.Map.WaterPlaneHeight; if (!Mathf.Approximately(direction.y, 0f)) { point.x = (GameState.Current.Map.WaterPlaneHeight - hit.point.y) / direction.y * direction.x + hit.point.x; point.z = (GameState.Current.Map.WaterPlaneHeight - hit.point.y) / direction.y * direction.z + hit.point.z; } } ParticleEffectController.ShowHitEffect(this._effectType, surface, direction, point, hitNormal, muzzlePosition, distance, ref this._trailRenderer, this._parent); } }
// Token: 0x06001F5F RID: 8031 RVA: 0x000969FC File Offset: 0x00094BFC public Vector3 Explode() { Vector3 vector = Vector3.zero; try { RaycastHit raycastHit; if (Physics.Raycast(base.transform.position - base.transform.forward, base.transform.forward, out raycastHit, 2f, this.CollisionMask)) { vector = raycastHit.point - base.transform.forward * 0.01f; this.Explode(vector, raycastHit.normal, TagUtil.GetTag(raycastHit.collider)); } else { vector = base.transform.position; this.Explode(vector, -base.transform.forward, string.Empty); } } catch (Exception message) { Debug.LogWarning(message); } return(vector); }