예제 #1
0
 // Token: 0x06000245 RID: 581 RVA: 0x000110F0 File Offset: 0x0000F2F0
 private void AddForces()
 {
     this.colliders = Physics.OverlapSphere(base.transform.position, this.explosionRadius);
     for (int i = 0; i < this.colliders.Length; i++)
     {
         AntiTouchSystem.KillPlayer(this.colliders[i].transform.root.GetComponent <PlayerSettings>());
         AntiTouchSystem.KillSmartRagdoll(this.colliders[i].transform);
         this.FractureObjects(this.colliders[i].transform);
         Rigidbody component = this.colliders[i].GetComponent <Rigidbody>();
         if (component != null)
         {
             if (this.dismemberRagdolls && UnityEngine.Random.Range(0, 4) == 0)
             {
                 RagdollSettings.DismemberJoint(component.transform);
             }
             component.AddExplosionForce(this.explosionPower, base.transform.position, this.explosionRadius, 0f, ForceMode.Impulse);
             component.AddTorque(Vector3.Normalize(base.transform.position - component.position));
         }
         this.anotherMine = this.colliders[i].transform.GetComponentInParent <Mine>();
         if (this.anotherMine != null)
         {
             this.anotherMine.remoteDetonate = true;
         }
     }
 }
예제 #2
0
 // Token: 0x060004B3 RID: 1203 RVA: 0x000197D8 File Offset: 0x000179D8
 public static void ObjectTouchedSomething(AntiTouchObject antiTouchScript, Transform touchedObject)
 {
     if (antiTouchScript.antiTouchInBuildMode || (!antiTouchScript.antiTouchInBuildMode && !LevelManager.BuildModeOn))
     {
         if (antiTouchScript.badForPlayer && Tag.Compare(touchedObject, Tag.Tags.Player))
         {
             AntiTouchSystem.KillPlayer(touchedObject.transform.root.GetComponent <PlayerSettings>());
         }
         if (antiTouchScript.badForSmartRagdolls && Tag.Compare(touchedObject, Tag.Tags.Ragdoll))
         {
             if (antiTouchScript.specifiedSmartRagdolls.Length != 0)
             {
                 for (int i = 0; i < antiTouchScript.specifiedSmartRagdolls.Length; i++)
                 {
                     if (SmartRagdollController.RagdollHasLogic(touchedObject, antiTouchScript.specifiedSmartRagdolls[i]))
                     {
                         AntiTouchSystem.KillSmartRagdoll(touchedObject);
                         return;
                     }
                 }
                 return;
             }
             AntiTouchSystem.KillSmartRagdoll(touchedObject);
         }
     }
 }
예제 #3
0
 // Token: 0x060004AF RID: 1199 RVA: 0x00005D9E File Offset: 0x00003F9E
 private void OnCollisionEnter(Collision collision)
 {
     if (!this.colliderCollisions)
     {
         return;
     }
     AntiTouchSystem.ObjectTouchedSomething(this, collision.transform);
 }
 // Token: 0x06000092 RID: 146 RVA: 0x0000296D File Offset: 0x00000B6D
 public void CollisionDetected(Transform collidedObject, Vector3 impactVelocity)
 {
     AntiTouchSystem.PlayerTouchedRagdoll(this.playerSettings, collidedObject);
     if (Tag.Compare(collidedObject, Tag.Tags.Ragdoll) && this.playerRagdollAnimator != null)
     {
         this.playerRagdollAnimator.AnimateTrip();
     }
 }
예제 #5
0
 // Token: 0x060000B2 RID: 178 RVA: 0x0000A380 File Offset: 0x00008580
 private void KillSmartRagdollOnGrab()
 {
     if (this.grabbing && this.focusRigidbody != null && Tag.Compare(this.focusRigidbody.transform, Tag.Tags.Ragdoll) && !this.killedSmartRagdoll)
     {
         AntiTouchSystem.KillSmartRagdoll(this.focusRigidbody.transform);
         this.killedSmartRagdoll = true;
         return;
     }
     this.killedSmartRagdoll = false;
 }
예제 #6
0
 // Token: 0x060001D8 RID: 472 RVA: 0x0000F300 File Offset: 0x0000D500
 private void ShootCube()
 {
     this.shotObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
     this.shotObject.transform.position = this.BarrelEnd;
     this.shotObject.transform.rotation = this.canonBarrel.rotation;
     if (this.destroyShotObjects)
     {
         UnityEngine.Object.Destroy(this.shotObject, this.destroyTime);
     }
     this.shotObjects.Add(this.shotObject);
     this.shotObject.GetComponent <Renderer>().material = this.defaultMaterial;
     this.shotObject.AddComponent <Rigidbody>().AddRelativeForce(new Vector3(0f, 0f, 1f) * this.shootStrength, ForceMode.Impulse);
     Physics.IgnoreCollision(this.shotObject.GetComponent <Collider>(), PlayerSettings.instance.playerController.GetComponent <Collider>());
     AntiTouchSystem.AddAntiTouchComponent(this.shotObject, false);
 }
예제 #7
0
 // Token: 0x06000231 RID: 561 RVA: 0x00010BD8 File Offset: 0x0000EDD8
 private void Detonate()
 {
     if (this.detonated || LevelManager.BuildModeOn)
     {
         return;
     }
     if (UIVersion.NukeEnabled)
     {
         this.colliders = Physics.OverlapSphere(this.mineObject.transform.position, 1000f);
     }
     else
     {
         this.colliders = Physics.OverlapSphere(this.mineObject.transform.position, this.radius);
     }
     for (int i = 0; i < this.colliders.Length; i++)
     {
         AntiTouchSystem.KillPlayer(this.colliders[i].transform.root.GetComponent <PlayerSettings>());
         AntiTouchSystem.KillSmartRagdoll(this.colliders[i].transform);
         this.FractureObjects(this.colliders[i].transform);
         Rigidbody component = this.colliders[i].GetComponent <Rigidbody>();
         if (component != null)
         {
             if (this.dismemberRagdolls && UnityEngine.Random.Range(0, 4) == 0)
             {
                 RagdollSettings.DismemberJoint(component.transform);
             }
             if (UIVersion.NukeEnabled)
             {
                 component.AddExplosionForce(5000f * ((component.mass < 10f) ? 1f : (component.mass * 0.1f)), this.mineObject.transform.position, 1000f, 0f, ForceMode.Impulse);
             }
             else
             {
                 component.AddExplosionForce(this.power * ((component.mass < 10f) ? 1f : (component.mass * 0.1f)), this.mineObject.transform.position, this.radius, 0f, ForceMode.Impulse);
             }
             component.AddTorque(Vector3.Normalize(base.transform.position - component.position));
         }
         this.anotherMine = this.colliders[i].transform.GetComponentInParent <Mine>();
         if (this.anotherMine != null)
         {
             this.anotherMine.remoteDetonate = true;
         }
     }
     this.spawnedExplosion.transform.position = this.mineObject.transform.position;
     this.spawnedExplosion.SetActive(true);
     this.mineObject.SetActive(false);
     this.detonated = true;
 }
예제 #8
0
 // Token: 0x06000433 RID: 1075 RVA: 0x00017EC8 File Offset: 0x000160C8
 private void TriggerCheck(Transform colliderTransform)
 {
     if (this.Fracture || LevelManager.BuildModeOn)
     {
         return;
     }
     if (DestructibleObject.destructibleObjectsCollide && Tag.Compare(colliderTransform, Tag.Tags.None))
     {
         this.Fracture = true;
     }
     if (this.playerCanFracture && Tag.Compare(colliderTransform, Tag.Tags.Player))
     {
         this.Fracture       = true;
         this.playerCollided = colliderTransform.root.GetComponent <PlayerSettings>();
         if (this.playerCollided != null)
         {
             CameraController.TriggerCameraTremor(this.playerCollided.mainCamera);
         }
     }
     if (this.smartRagdollsCanFracture && Tag.Compare(colliderTransform, Tag.Tags.Ragdoll))
     {
         AntiTouchSystem.KillSmartRagdoll(colliderTransform);
         this.Fracture = true;
     }
     if (this.creatureCanFracture && Tag.Compare(colliderTransform, Tag.Tags.Creature))
     {
         this.Fracture = true;
     }
     if (this.carCanFracture && Tag.Compare(colliderTransform, Tag.Tags.Vehicle))
     {
         this.Fracture = true;
     }
     if (Tag.Compare(colliderTransform, Tag.Tags.Domino))
     {
         this.Fracture = true;
     }
 }
예제 #9
0
 // Token: 0x060004B2 RID: 1202 RVA: 0x00019760 File Offset: 0x00017960
 public static void PlayerTouchedRagdoll(PlayerSettings playerSettings, Transform ragdoll)
 {
     if (!Tag.Compare(ragdoll, Tag.Tags.Ragdoll))
     {
         return;
     }
     if (LevelManager.BuildModeOn)
     {
         return;
     }
     if (!playerSettings.ragdollsCanTouchThisPlayer)
     {
         AntiTouchSystem.KillSmartRagdoll(ragdoll);
     }
     AntiTouchSystem.antiTouchScript = ragdoll.root.GetComponent <AntiTouchObject>();
     if (AntiTouchSystem.antiTouchScript == null)
     {
         return;
     }
     if ((AntiTouchSystem.antiTouchScript.antiTouchInBuildMode || !AntiTouchSystem.antiTouchScript.antiTouchInBuildMode) && AntiTouchSystem.antiTouchScript.badForPlayer)
     {
         AntiTouchSystem.KillPlayer(playerSettings);
     }
 }