private void hitPlayer(HERO heros) { if ((!heros.HasDied()) && !heros.isInvincible()) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!heros.isGrabbed) { heros.die((Vector3)((this.v.normalized * 1000f) + (Vector3.up * 50f)), false); } } else if (((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER) && !heros.HasDied()) && !heros.isGrabbed) { heros.markDie(); int myOwnerViewID = -1; string titanName = string.Empty; EnemyfxIDcontainer fx = baseT.root.gameObject.GetComponent <EnemyfxIDcontainer>(); if (fx != null) { myOwnerViewID = fx.myOwnerViewID; titanName = fx.titanName; } Debug.Log("rock hit player " + titanName); object[] parameters = new object[] { (Vector3)((this.v.normalized * 1000f) + (Vector3.up * 50f)), false, myOwnerViewID, titanName, true }; heros.photonView.RPC("netDie", PhotonTargets.All, parameters); } } }
private GameObject checkIfHitHand(Transform hand) { foreach (Collider collider in Physics.OverlapSphere(hand.GetComponent <SphereCollider>().transform.position, 31f)) { if (collider.transform.root.tag == "Player") { GameObject gameObject = collider.transform.root.gameObject; TITAN_EREN te = gameObject.GetComponent <TITAN_EREN>(); if (te != null) { if (!te.isHit) { te.hitByTitan(); } return(gameObject); } HERO he = gameObject.GetComponent <HERO>(); if ((he != null) && !he.isInvincible()) { return(gameObject); } } } return(null); }
private void hitPlayer(GameObject hero, HERO component) { if (((hero != null) && !component.HasDied()) && !component.isInvincible()) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!component.isGrabbed) { component.die((Vector3)((this.v.normalized * 1000f) + (Vector3.up * 50f)), false); } } else if (((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER) && !component.HasDied()) && !component.isGrabbed) { component.markDie(); object[] parameters = new object[] { (Vector3)((this.v.normalized * 1000f) + (Vector3.up * 50f)), false, viewID, titanName, true }; component.photonView.RPC("netDie", PhotonTargets.All, parameters); } if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER && this.basePV.isMine) { GameObject gameObject; gameObject = PhotonNetwork.Instantiate("FX/boom6", this.baseT.position, this.baseT.rotation, 0); gameObject.transform.localScale = this.baseT.localScale; EnemyfxIDcontainer component2 = gameObject.GetComponent <EnemyfxIDcontainer>(); if (component2 != null) { component2.myOwnerViewID = viewID; component2.titanName = titanName; return; } } else { ((GameObject)UnityEngine.Object.Instantiate(CLEARSKIES.CacheResources.Load("FX/boom6"), this.baseT.position, this.baseT.rotation)).transform.localScale = this.baseT.localScale; } } }
private void OnTriggerStay(Collider other) { if (this.active_me) { if (!this.currentHitsII.Contains(other.gameObject)) { this.currentHitsII.Add(other.gameObject); currentCameraT.startShake(0.1f, 0.1f, 0.95f); if (other.gameObject.transform.root.gameObject.tag == "titan") { if ((int)FengGameManagerMKII.settings[330] == 0) { currentCameraT.main_objectH.slashHit.Play(); } if ((int)FengGameManagerMKII.settings[287] == 0) { GameObject obj2; if (IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.SINGLE) { obj2 = PhotonNetwork.Instantiate("hitMeat", BaseT.position, Quaternion.Euler(270f, 0f, 0f), 0); } else { obj2 = (GameObject)UnityEngine.Object.Instantiate(Cach.hitMeat != null ? Cach.hitMeat : Cach.hitMeat = (GameObject)Resources.Load("hitMeat")); } obj2.transform.position = BaseT.position; } BaseTR.GetComponent <HERO>().useBlade(0); } } if (other.gameObject.tag == "playerHitbox") { if (FengGameManagerMKII.lvlInfo.pvp) { float b = 1f - (Vector3.Distance(other.gameObject.transform.position, BaseT.position) * 0.05f); b = Mathf.Min(1f, b); HitBox component = other.gameObject.GetComponent <HitBox>(); HERO hero = null; if ((((component != null) && (component.transform.root != null)) && ((hero = component.transform.root.GetComponent <HERO>()).myTeam != this.myTeam)) && !hero.isInvincible()) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!hero.isGrabbed) { Vector3 vector = component.transform.root.transform.position - BaseT.position; hero.die((Vector3)(((vector.normalized * b) * 1000f) + (Vector3.up * 50f)), false); } } else if (((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER) && !hero.HasDied()) && !hero.isGrabbed) { hero.markDie(); int viewID = BaseTR.gameObject.GetPhotonView().viewID; string plName = PhotonView.Find(viewID).owner.name2; object[] parameters = new object[5]; Vector3 vector2 = component.transform.root.position - BaseT.position; parameters[0] = (Vector3)(((vector2.normalized * b) * 1000f) + (Vector3.up * 50f)); parameters[1] = false; parameters[2] = viewID; parameters[3] = plName; parameters[4] = false; hero.photonView.RPC("netDie", PhotonTargets.All, parameters); AddStats(plName, 0); } } } } else if (other.gameObject.tag == "titanneck") { HitBox item = other.gameObject.GetComponent <HitBox>(); if (((item != null) && this.checkIfBehind(item.transform.root.gameObject)) && !this.currentHits.Contains(item)) { item.hitPosition = (Vector3)((BaseT.position + item.transform.position) * 0.5f); this.currentHits.Add(item); if ((int)FengGameManagerMKII.settings[330] == 0) { this.meatDie.Play(); } TITAN titn = item.transform.root.GetComponent <TITAN>(); FEMALE_TITAN ft = null; COLOSSAL_TITAN ct = null; if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if ((titn != null) && !titn.hasDie) { Vector3 vector3 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num2 = (int)((vector3.magnitude * 10f) * this.scoreMulti); num2 = Mathf.Max(10, num2); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num2, item.transform.root.gameObject, 0.02f); } AddStats(titn.name, num2, titn.myLevel); titn.die(); this.napeMeat(this.currentCameraT.main_objectR.velocity, item.transform.root); FengGameManagerMKII.instance.netShowDamage(num2); FengGameManagerMKII.instance.playerKillInfoSingleUpdate(num2); } } else if (!PhotonNetwork.isMasterClient) { if (titn != null) { if (!titn.hasDie) { Vector3 vector4 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num3 = (int)((vector4.magnitude * 10f) * this.scoreMulti); num3 = Mathf.Max(10, num3); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num3, item.transform.root.gameObject, 0.02f); titn.asClientLookTarget = false; } AddStats(titn.name, num3, titn.myLevel); object[] objArray2 = new object[] { BaseTR.gameObject.GetPhotonView().viewID, num3 }; titn.photonView.RPC("titanGetHit", titn.photonView.owner, objArray2); } } else if ((ft = item.transform.root.GetComponent <FEMALE_TITAN>()) != null) { BaseTR.GetComponent <HERO>().useBlade(0x7fffffff); Vector3 vector5 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num4 = (int)((vector5.magnitude * 10f) * this.scoreMulti); num4 = Mathf.Max(10, num4); if (!ft.hasDie) { AddStats(ft.name, num4, ft.size); object[] objArray3 = new object[] { BaseTR.gameObject.GetPhotonView().viewID, num4 }; ft.photonView.RPC("titanGetHit", ft.photonView.owner, objArray3); } } else if ((ct = item.transform.root.GetComponent <COLOSSAL_TITAN>()) != null) { BaseTR.GetComponent <HERO>().useBlade(0x7fffffff); if (!ct.hasDie) { Vector3 vector6 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num5 = (int)((vector6.magnitude * 10f) * this.scoreMulti); num5 = Mathf.Max(10, num5); AddStats(ct.name, num5, ct.size); object[] objArray4 = new object[] { BaseTR.gameObject.GetPhotonView().viewID, num5 }; ct.photonView.RPC("titanGetHit", ct.photonView.owner, objArray4); } } } else if (titn != null) { if (!titn.hasDie) { Vector3 vector7 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num6 = (int)((vector7.magnitude * 10f) * this.scoreMulti); num6 = Mathf.Max(10, num6); AddStats(titn.name, num6, titn.myLevel); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num6, item.transform.root.gameObject, 0.02f); } titn.titanGetHit(BaseTR.gameObject.GetPhotonView().viewID, num6); } } else if ((ft = item.transform.root.GetComponent <FEMALE_TITAN>()) != null) { BaseTR.GetComponent <HERO>().useBlade(0x7fffffff); if (!ft.hasDie) { Vector3 vector8 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num7 = (int)((vector8.magnitude * 10f) * this.scoreMulti); num7 = Mathf.Max(10, num7); AddStats(ft.name, num7, ft.size); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num7, null, 0.02f); } ft.titanGetHit(BaseTR.gameObject.GetPhotonView().viewID, num7); } } else if ((ct = item.transform.root.GetComponent <COLOSSAL_TITAN>()) != null) { BaseTR.GetComponent <HERO>().useBlade(0x7fffffff); if (!ct.hasDie) { Vector3 vector9 = this.currentCameraT.main_objectR.velocity - item.transform.root.rigidbody.velocity; int num8 = (int)((vector9.magnitude * 10f) * this.scoreMulti); num8 = Mathf.Max(10, num8); AddStats(ct.name, num8, ct.size); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num8, null, 0.02f); } ct.titanGetHit(BaseTR.gameObject.GetPhotonView().viewID, num8); } } this.showCriticalHitFX(); } } else if (other.gameObject.tag == "titaneye") { if (!this.currentHits.Contains(other.gameObject)) { this.currentHits.Add(other.gameObject); GameObject gameObject = other.gameObject.transform.root.gameObject; TITAN tit = null; FEMALE_TITAN ft = gameObject.GetComponent <FEMALE_TITAN>(); if (ft != null) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!ft.hasDie) { ft.hitEye(); } } else if (!PhotonNetwork.isMasterClient) { if (!ft.hasDie) { object[] objArray5 = new object[] { BaseTR.gameObject.GetPhotonView().viewID }; ft.photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, objArray5); } } else if (!ft.hasDie) { ft.hitEyeRPC(BaseTR.gameObject.GetPhotonView().viewID); } } else if ((tit = gameObject.GetComponent <TITAN>()).abnormalType != AbnormalType.TYPE_CRAWLER) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!tit.hasDie) { tit.hitEye(); } } else if (!PhotonNetwork.isMasterClient) { if (!tit.hasDie) { object[] objArray6 = new object[] { BaseTR.gameObject.GetPhotonView().viewID }; tit.photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, objArray6); } } else if (!tit.hasDie) { tit.hitEyeRPC(BaseTR.gameObject.GetPhotonView().viewID); } this.showCriticalHitFX(); } } } else if ((other.gameObject.tag == "titanankle") && !this.currentHits.Contains(other.gameObject)) { this.currentHits.Add(other.gameObject); GameObject obj4 = other.gameObject.transform.root.gameObject; Vector3 vector10 = this.currentCameraT.main_objectR.velocity - obj4.rigidbody.velocity; int num9 = (int)((vector10.magnitude * 10f) * this.scoreMulti); num9 = Mathf.Max(10, num9); TITAN tit = obj4.GetComponent <TITAN>(); FEMALE_TITAN ft = null; if ((tit != null) && (tit.abnormalType != AbnormalType.TYPE_CRAWLER)) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!tit.hasDie) { tit.hitAnkle(); } } else { if (!PhotonNetwork.isMasterClient) { if (!tit.hasDie) { object[] objArray7 = new object[] { BaseTR.gameObject.GetPhotonView().viewID }; tit.photonView.RPC("hitAnkleRPC", PhotonTargets.MasterClient, objArray7); } } else if (!tit.hasDie) { tit.hitAnkle(); } this.showCriticalHitFX(); } } else if ((ft = obj4.GetComponent <FEMALE_TITAN>()) != null) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (other.gameObject.name == "ankleR") { if (!ft.hasDie) { ft.hitAnkleR(num9); } } else if (!ft.hasDie) { ft.hitAnkleL(num9); } } else if (other.gameObject.name == "ankleR") { if (!PhotonNetwork.isMasterClient) { if (!ft.hasDie) { object[] objArray8 = new object[] { BaseTR.gameObject.GetPhotonView().viewID, num9 }; ft.photonView.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, objArray8); } } else if (!ft.hasDie) { ft.hitAnkleRRPC(BaseTR.gameObject.GetPhotonView().viewID, num9); } } else if (!PhotonNetwork.isMasterClient) { if (!ft.hasDie) { object[] objArray9 = new object[] { BaseTR.gameObject.GetPhotonView().viewID, num9 }; ft.photonView.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, objArray9); } } else if (!ft.hasDie) { ft.hitAnkleLRPC(BaseTR.gameObject.GetPhotonView().viewID, num9); } this.showCriticalHitFX(); } } } }
private void OnTriggerStay(Collider other) { if (((IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.MULTIPLAYER) || baseG.GetPhotonView().isMine) && this.active_me) { GameObject otherG = other.gameObject; if (otherG.tag == "playerHitbox") { if (FengGameManagerMKII.lvlInfo.pvp) { float b = 1f - (Vector3.Distance(otherG.transform.position, baseT.position) * 0.05f); b = Mathf.Min(1f, b); HitBox component = otherG.GetComponent <HitBox>(); HERO hero = component.transform.root.GetComponent <HERO>(); if ((((component != null) && (component.transform.root != null)) && (hero.myTeam != this.myTeam)) && !hero.isInvincible()) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!hero.isGrabbed) { Vector3 vector = component.transform.root.transform.position - baseT.position; hero.die((Vector3)(((vector.normalized * b) * 1000f) + (Vector3.up * 50f)), false); } } else if (((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER) && !hero.HasDied()) && !hero.isGrabbed) { hero.markDie(); object[] parameters = new object[5]; Vector3 vector2 = component.transform.root.position - baseT.position; parameters[0] = (Vector3)(((vector2.normalized * b) * 1000f) + (Vector3.up * 50f)); parameters[1] = false; parameters[2] = this.viewID; parameters[3] = this.ownerName; parameters[4] = false; AddStats(ownerName, 0); hero.photonView.RPC("netDie", PhotonTargets.All, parameters); } } } } else if (otherG.tag == "erenHitbox") { if ((this.dmg > 0) && !otherG.transform.root.gameObject.GetComponent <TITAN_EREN>().isHit) { otherG.transform.root.gameObject.GetComponent <TITAN_EREN>().hitByTitan(); } } else if (otherG.tag == "titanneck") { HitBox item = otherG.GetComponent <HitBox>(); if (((item != null) && this.checkIfBehind(item.transform.root.gameObject)) && !this.currentHits.Contains(item)) { item.hitPosition = (Vector3)((baseT.position + item.transform.position) * 0.5f); this.currentHits.Add(item); TITAN tit = item.transform.root.GetComponent <TITAN>(); FEMALE_TITAN ft = null; COLOSSAL_TITAN ct = null; if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if ((tit != null) && !tit.hasDie) { Vector3 vector3 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num2 = (int)((vector3.magnitude * 10f) * this.scoreMulti); num2 = Mathf.Max(10, num2); FengGameManagerMKII.instance.netShowDamage(num2); if (num2 > (tit.myLevel * 100f)) { AddStats(tit.name, num2, tit.myLevel); tit.die(); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num2, item.transform.root.gameObject, 0.02f); } FengGameManagerMKII.instance.playerKillInfoSingleUpdate(num2); } } } else if (!PhotonNetwork.isMasterClient) { if (tit != null) { if (!tit.hasDie) { Vector3 vector4 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num3 = (int)((vector4.magnitude * 10f) * this.scoreMulti); num3 = Mathf.Max(10, num3); if (num3 > (tit.myLevel * 100f)) { AddStats(tit.name, num3, tit.myLevel); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num3, item.transform.root.gameObject, 0.02f); tit.asClientLookTarget = false; } object[] objArray2 = new object[] { baseG.GetPhotonView().viewID, num3 }; tit.photonView.RPC("titanGetHit", tit.photonView.owner, objArray2); } } } else if ((ft = item.transform.root.GetComponent <FEMALE_TITAN>()) != null) { Vector3 vector5 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num4 = (int)((vector5.magnitude * 10f) * this.scoreMulti); num4 = Mathf.Max(10, num4); if (!ft.hasDie) { AddStats(ft.name, num4, ft.size); object[] objArray3 = new object[] { baseG.GetPhotonView().viewID, num4 }; ft.photonView.RPC("titanGetHit", ft.photonView.owner, objArray3); } } else if (((ct = item.transform.root.GetComponent <COLOSSAL_TITAN>()) != null) && !ct.hasDie) { Vector3 vector6 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num5 = (int)((vector6.magnitude * 10f) * this.scoreMulti); num5 = Mathf.Max(10, num5); AddStats(ct.name, num5, ct.size); object[] objArray4 = new object[] { baseG.GetPhotonView().viewID, num5 }; ct.photonView.RPC("titanGetHit", ct.photonView.owner, objArray4); } } else if (tit != null) { if (!tit.hasDie) { Vector3 vector7 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num6 = (int)((vector7.magnitude * 10f) * this.scoreMulti); num6 = Mathf.Max(10, num6); if (num6 > (tit.myLevel * 100f)) { AddStats(tit.name, num6, tit.myLevel); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num6, item.transform.root.gameObject, 0.02f); } tit.titanGetHit(baseG.GetPhotonView().viewID, num6); } } } else if ((ft = item.transform.root.GetComponent <FEMALE_TITAN>()) != null) { if (!ft.hasDie) { Vector3 vector8 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num7 = (int)((vector8.magnitude * 10f) * this.scoreMulti); num7 = Mathf.Max(10, num7); AddStats(ft.name, num7, ft.size); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num7, null, 0.02f); } ft.titanGetHit(baseG.GetPhotonView().viewID, num7); } } else if (((ct = item.transform.root.GetComponent <COLOSSAL_TITAN>()) != null) && !ct.hasDie) { Vector3 vector9 = currentCameraT.main_object.rigidbody.velocity - item.transform.root.rigidbody.velocity; int num8 = (int)((vector9.magnitude * 10f) * this.scoreMulti); num8 = Mathf.Max(10, num8); AddStats(ct.name, num8, ct.size); if ((int)FengGameManagerMKII.settings[320] == 1) { IN_GAME_MAIN_CAMERA.instance.startSnapShot(item.transform.position, num8, null, 0.02f); } ct.titanGetHit(baseG.GetPhotonView().viewID, num8); } this.showCriticalHitFX(otherG.transform.position); } } else if (otherG.tag == "titaneye") { if (!this.currentHits.Contains(otherG)) { this.currentHits.Add(otherG); GameObject gameObject = otherG.transform.root.gameObject; FEMALE_TITAN ft = gameObject.GetComponent <FEMALE_TITAN>(); TITAN tit = null; if (ft != null) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!ft.hasDie) { ft.hitEye(); } } else if (!PhotonNetwork.isMasterClient) { if (!ft.hasDie) { object[] objArray5 = new object[] { baseG.GetPhotonView().viewID }; ft.photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, objArray5); } } else if (!ft.hasDie) { ft.hitEyeRPC(baseG.GetPhotonView().viewID); } } else if ((tit = gameObject.GetComponent <TITAN>()).abnormalType != AbnormalType.TYPE_CRAWLER) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!tit.hasDie) { tit.hitEye(); } } else if (!PhotonNetwork.isMasterClient) { if (!tit.hasDie) { object[] objArray6 = new object[] { baseG.GetPhotonView().viewID }; tit.photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, objArray6); } } else if (!tit.hasDie) { tit.hitEyeRPC(baseG.GetPhotonView().viewID); } this.showCriticalHitFX(otherG.transform.position); } } } else if ((otherG.tag == "titanankle") && !this.currentHits.Contains(otherG)) { this.currentHits.Add(otherG); GameObject obj3 = otherG.transform.root.gameObject; Vector3 vector10 = currentCameraT.main_object.rigidbody.velocity - obj3.rigidbody.velocity; int num9 = (int)((vector10.magnitude * 10f) * this.scoreMulti); num9 = Mathf.Max(10, num9); TITAN tit = obj3.GetComponent <TITAN>(); FEMALE_TITAN ft = null; if ((tit != null) && (tit.abnormalType != AbnormalType.TYPE_CRAWLER)) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (!tit.hasDie) { tit.hitAnkle(); } } else { if (!PhotonNetwork.isMasterClient) { if (!tit.hasDie) { object[] objArray7 = new object[] { baseG.GetPhotonView().viewID }; tit.photonView.RPC("hitAnkleRPC", PhotonTargets.MasterClient, objArray7); } } else if (!tit.hasDie) { tit.hitAnkle(); } this.showCriticalHitFX(otherG.transform.position); } } else if ((ft = obj3.GetComponent <FEMALE_TITAN>()) != null) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (otherG.name == "ankleR") { if (!ft.hasDie) { ft.hitAnkleR(num9); } } else if (!ft.hasDie) { ft.hitAnkleL(num9); } } else if (otherG.name == "ankleR") { if (!PhotonNetwork.isMasterClient) { if (!ft.hasDie) { object[] objArray8 = new object[] { baseG.GetPhotonView().viewID, num9 }; ft.photonView.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, objArray8); } } else if (!ft.hasDie) { ft.hitAnkleRRPC(baseG.GetPhotonView().viewID, num9); } } else if (!PhotonNetwork.isMasterClient) { if (!ft.hasDie) { object[] objArray9 = new object[] { baseG.GetPhotonView().viewID, num9 }; ft.photonView.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, objArray9); } } else if (!ft.hasDie) { ft.hitAnkleLRPC(baseG.GetPhotonView().viewID, num9); } this.showCriticalHitFX(otherG.transform.position); } } } }
private void OnTriggerStay(Collider other) { if (this.active_me) { GameObject otherG = other.gameObject; Transform otherT = other.transform; if (!this.currentHitsII.Contains(otherG)) { this.currentHitsII.Add(otherG); mainCamera.startShake(0.1f, 0.1f, 0.95f); if (otherT.root.gameObject.CompareTag("titan")) { this.hero.slashHit.Play(); if (IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.SINGLE) { PhotonNetwork.Instantiate("hitMeat", this.baseT.position, Quaternion.Euler(270f, 0f, 0f), 0, null); } else { ((GameObject)UnityEngine.Object.Instantiate(CLEARSKIES.CacheResources.Load("hitMeat"))).transform.position = baseT.position; } this.hero.useBlade(0); } } string tag; if ((tag = otherG.tag) != null) { HitBox component = otherG.GetComponent <HitBox>(); Transform componentT, componentTroot; GameObject componentGO; MONO monosingletone; switch (tag) { case "playerHitbox": if (LevelInfo.getInfo(FengGameManagerMKII.level).pvp) { float b = 1f - (Vector3.Distance(otherT.position, this.baseT.position) * 0.05f); b = Mathf.Min(1f, b); if ((componentTroot = (componentT = component.transform).root) != null) { HERO Hero = componentTroot.GetComponent <HERO>(); if (Hero != null && Hero.myTeam != this.myTeam && !Hero.isInvincible() && !Hero.isGrabbed) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { Hero.die((componentTroot.position - this.baseT.position).normalized * b * 1000f + Vector3.up * 50f, false); return; } if (!Hero.HasDied()) { Hero.markDie(); object[] parameters = new object[] { (componentTroot.position - baseT.position).normalized * b * 1000f + Vector3.up * 50f, false, basePV.viewID, basePV.owner.customProperties[PhotonPlayerProperty.name], false }; Hero.photonView.RPC("netDie", PhotonTargets.All, parameters); } } } } break; case "titanneck": if ((componentGO = (componentTroot = (componentT = component.transform).root).gameObject) != null) { if (this.checkIfBehind(componentGO) && !this.currentHits.Contains(component)) { component.hitPosition = (Vector3)((this.baseT.position + componentT.position) * 0.5f); this.currentHits.Add(component); this.meatDie.Play(); monosingletone = componentTroot.GetComponent <MONO>(); SPECIES specie = monosingletone.species; switch (specie) { case SPECIES.Titan: TITAN titan = monosingletone as TITAN; if (titan != null && !titan.hasDie) { int num2 = this.Damage(componentTroot); if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { if (PlayerPrefs.HasKey("EnableSS") && (PlayerPrefs.GetInt("EnableSS") == 1)) { mainCamera.startSnapShot2(componentT.position, num2, componentGO, 0.02f); } titan.die(); this.napeMeat(this.hero.rigidbody.velocity, componentTroot); FengGameManagerMKII.instance.netShowDamage(num2); FengGameManagerMKII.instance.playerKillInfoSingleUpdate(num2); } else { if (!PhotonNetwork.isMasterClient) { if (PlayerPrefs.HasKey("EnableSS") && (PlayerPrefs.GetInt("EnableSS") == 1)) { mainCamera.startSnapShot2(componentT.position, num2, componentGO, 0.02f); titan.asClientLookTarget = false; } object[] objArray2 = new object[] { basePV.viewID, num2 }; titan.photonView.RPC("titanGetHit", titan.photonView.owner, objArray2); } else { if (PlayerPrefs.HasKey("EnableSS") && (PlayerPrefs.GetInt("EnableSS") == 1)) { mainCamera.startSnapShot2(componentT.position, num2, componentGO, 0.02f); } titan.titanGetHit(this.basePV.viewID, num2); } } } break; case SPECIES.Hero | SPECIES.Titan: break; case SPECIES.FemaleTitan: FEMALE_TITAN female_titan = monosingletone as FEMALE_TITAN; this.hero.useBlade(0x7fffffff); if (female_titan != null && !female_titan.hasDie) { int num2 = this.Damage(componentTroot); if (!PhotonNetwork.isMasterClient) { object[] objArray3 = new object[] { this.basePV.viewID, num2 }; female_titan.photonView.RPC("titanGetHit", female_titan.photonView.owner, objArray3); } else { if (PlayerPrefs.HasKey("EnableSS") && (PlayerPrefs.GetInt("EnableSS") == 1)) { mainCamera.startSnapShot2(componentT.position, num2, null, 0.02f); } female_titan.titanGetHit(this.basePV.viewID, num2); } } break; default: if (monosingletone.species == SPECIES.ColossalTitan) { COLOSSAL_TITAN colossal_titan = monosingletone as COLOSSAL_TITAN; this.hero.useBlade(0x7fffffff); if (!colossal_titan.hasDie) { int num2 = this.Damage(componentTroot); if (!PhotonNetwork.isMasterClient) { object[] objArray4 = new object[] { this.basePV.viewID, num2 }; colossal_titan.photonView.RPC("titanGetHit", colossal_titan.photonView.owner, objArray4); } else if (PlayerPrefs.HasKey("EnableSS") && (PlayerPrefs.GetInt("EnableSS") == 1)) { mainCamera.startSnapShot2(componentT.position, num2, null, 0.02f); } colossal_titan.titanGetHit(this.basePV.viewID, num2); } } break; } this.showCriticalHitFX(); } } break; case "titaneye": if (!this.currentHits.Contains(otherG)) { this.currentHits.Add(otherG); componentT = otherG.transform; if (componentT != null) { monosingletone = componentT.root.GetComponent <MONO>(); if (monosingletone != null) { switch (monosingletone.species) { case SPECIES.Titan: TITAN titan = monosingletone as TITAN; if (titan.abnormalType != AbnormalType.TYPE_CRAWLER && !titan.hasDie) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { titan.hitEye(); } else if (!PhotonNetwork.isMasterClient) { object[] objArray6 = new object[] { this.basePV.viewID }; titan.photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, objArray6); } else { titan.hitEyeRPC(this.baseT.root.gameObject.GetPhotonView().viewID); } this.showCriticalHitFX(); } break; case SPECIES.FemaleTitan: FEMALE_TITAN female_titan = monosingletone as FEMALE_TITAN; if (!female_titan.hasDie) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { female_titan.hitEye(); } else if (!PhotonNetwork.isMasterClient) { object[] objArray5 = new object[] { this.basePV.viewID }; female_titan.photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, objArray5); } else { female_titan.hitEyeRPC(this.basePV.viewID); } this.showCriticalHitFX(); } break; } } } } break; case "titanankle": if (!this.currentHits.Contains(otherG)) { this.currentHits.Add(otherG); componentT = otherG.transform; if (componentT != null) { monosingletone = componentT.root.GetComponent <MONO>(); switch (monosingletone.species) { case SPECIES.Titan: TITAN titan = monosingletone as TITAN; if (titan.abnormalType != AbnormalType.TYPE_CRAWLER && !titan.hasDie) { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { titan.hitAnkle(); } else if (!PhotonNetwork.isMasterClient) { object[] objArray6 = new object[] { this.basePV.viewID }; titan.GetComponent <TITAN>().photonView.RPC("hitAnkleRPC", PhotonTargets.MasterClient, objArray6); } else { titan.hitAnkle(); } this.showCriticalHitFX(); } break; case SPECIES.FemaleTitan: FEMALE_TITAN female_titan = monosingletone as FEMALE_TITAN; if (!female_titan.hasDie) { int num2 = this.Damage(female_titan); if (otherG.name == "ankleR") { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { female_titan.hitAnkleR(num2); FengGameManagerMKII.instance.netShowDamage(num2); } else if (!PhotonNetwork.isMasterClient) { object[] objArray5 = new object[] { this.basePV.viewID }; female_titan.photonView.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, objArray5); } else { female_titan.hitAnkleRRPC(this.basePV.viewID, num2); } } else if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { female_titan.hitAnkleL(num2); FengGameManagerMKII.instance.netShowDamage(num2); } else if (!PhotonNetwork.isMasterClient) { object[] objArray5 = new object[] { this.basePV.viewID }; female_titan.photonView.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, objArray5); } else { female_titan.hitAnkleLRPC(this.basePV.viewID, num2); } this.showCriticalHitFX(); } break; } } } break; default: return; } } } }
private void Update() { if (this.launched) { this.baseT.Rotate(this.r); this.v -= (Vector3)((20f * Vector3.up) * Time.deltaTime); this.baseT.position += this.v * Time.deltaTime; if ((IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) || this.basePV.isMine) { LayerMask mask = ((int)1) << LayerMask.NameToLayer("Ground"); LayerMask mask2 = ((int)1) << LayerMask.NameToLayer("Players"); LayerMask mask3 = ((int)1) << LayerMask.NameToLayer("EnemyAABB"); LayerMask mask4 = (mask2 | mask) | mask3; foreach (RaycastHit hit in Physics.SphereCastAll(this.baseT.position, 2.5f * this.baseT.lossyScale.x, this.baseT.position - this.oldP, Vector3.Distance(this.baseT.position, this.oldP), mask4)) { Collider collider = hit.collider; if (!(collider == null)) { GameObject gameObject = collider.gameObject; if (!(gameObject == null)) { GameObject gameObject2 = gameObject.transform.root.gameObject; if (!(gameObject2 == null)) { switch (gameObject.layer) { case 8: case 13: if (gameObject2.tag.NullFix() == "Player") { MONO component = gameObject2.GetComponent <MONO>(); if (!(component == null)) { if (component.species == SPECIES.Hero) { HERO hero = component as HERO; if (!hero.HasDied() && !hero.isInvincible()) { this.hitPlayer(gameObject2, hero); } } else if (component.species == SPECIES.TitanEren) { TITAN_EREN titan_EREN = component as TITAN_EREN; if (!titan_EREN.isHit) { titan_EREN.hitByTitan(); } } } } break; case 9: this.explore(); break; case 11: { TITAN component2 = gameObject2.GetComponent <TITAN>(); if (component2 != null && !component2.hasDie) { Vector3 position = this.baseT.position; if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { component2.hitAnkle(); } else { PhotonView photonView = PhotonView.Find(this.viewID); if (photonView != null) { Vector3 position2 = photonView.transform.position; } component2.photonView.RPC("hitAnkleRPC", PhotonTargets.All, new object[0]); } } this.explore(); break; } } } } } } this.oldP = this.baseT.position; // if (LayerMask.LayerToName(hit.collider.gameObject.layer) == "EnemyAABB") // { // GameObject gameObject = hit.collider.gameObject.transform.root.gameObject; // if ((gameObject.GetComponent<TITAN>() != null) && !gameObject.GetComponent<TITAN>().hasDie) // { // gameObject.GetComponent<TITAN>().hitAnkle(); // Vector3 position = this.baseT.position; // if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) // { // gameObject.GetComponent<TITAN>().hitAnkle(); // } // else // { // if ((this.baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>() != null) && (PhotonView.Find(this.baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>().myOwnerViewID) != null)) // { // position = PhotonView.Find(this.baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>().myOwnerViewID).transform.position; // } // gameObject.GetComponent<HERO>().photonView.RPC("hitAnkleRPC", PhotonTargets.All, new object[0]); // } // } // this.explore(); // } // else if (LayerMask.LayerToName(hit.collider.gameObject.layer) == "Players") // { // GameObject hero = hit.collider.gameObject.transform.root.gameObject; // if (hero.GetComponent<TITAN_EREN>() != null) // { // if (!hero.GetComponent<TITAN_EREN>().isHit) // { // hero.GetComponent<TITAN_EREN>().hitByTitan(); // } // } // else if ((hero.GetComponent<HERO>() != null) && !hero.GetComponent<HERO>().isInvincible()) // { // this.hitPlayer(hero); // } // } // else if (LayerMask.LayerToName(hit.collider.gameObject.layer) == "Ground") // { // this.explore(); // } //} //this.oldP = this.baseT.position; } } }
private void Update() { if (this.launched) { baseT.Rotate(this.r); this.v -= (Vector3)((20f * Vector3.up) * Time.deltaTime); baseT.position += (Vector3)(this.v * Time.deltaTime); if ((IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.MULTIPLAYER) || PhotonNetwork.isMasterClient) { LayerMask mask = ((int)1) << LayerMask.NameToLayer("Ground"); LayerMask mask2 = ((int)1) << LayerMask.NameToLayer("Players"); LayerMask mask3 = ((int)1) << LayerMask.NameToLayer("EnemyAABB"); LayerMask mask4 = (mask2 | mask) | mask3; foreach (RaycastHit hit in Physics.SphereCastAll(baseT.position, 2.5f * baseT.lossyScale.x, baseT.position - this.oldP, Vector3.Distance(baseT.position, this.oldP), (int)mask4)) { string namelayer = LayerMask.LayerToName(hit.collider.gameObject.layer); if (namelayer == "EnemyAABB") { GameObject gameObject = hit.collider.gameObject.transform.root.gameObject; TITAN titan = gameObject.GetComponent <TITAN>(); if ((titan != null) && !titan.hasDie) { titan.hitAnkle(); Vector3 position = baseT.position; if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { titan.hitAnkle(); } else { EnemyfxIDcontainer fx = baseT.root.gameObject.GetComponent <EnemyfxIDcontainer>(); PhotonView viev = PhotonView.Find(fx.myOwnerViewID); if ((fx != null) && (viev != null)) { Vector3 vector2 = viev.transform.position; } gameObject.GetComponent <HERO>().photonView.RPC("hitAnkleRPC", PhotonTargets.All, new object[0]); } } this.explore(); } else if (namelayer == "Players") { GameObject hero = hit.collider.gameObject.transform.root.gameObject; TITAN_EREN te = hero.GetComponent <TITAN_EREN>(); HERO hr = null; if (te != null) { if (!te.isHit) { te.hitByTitan(); } } else if (((hr = hero.GetComponent <HERO>()) != null) && !hr.isInvincible()) { this.hitPlayer(hr); } } else if (namelayer != "Leave") { this.explore(); } } this.oldP = baseT.position; } } }