private static bool CheckPvpWinner() { if ((!BombMode.Enabled && !BladePvp.Enabled && !TeamMode.Enabled && !PointMode.Enabled) || FengGameManagerMKII.FGM.IsWinning) { return(false); } if (!TeamMode.Enabled) { if (!PointMode.Enabled) { List <PhotonPlayer> alives = PhotonNetwork.playerList.Where(player => !player.Dead).ToList(); if (alives.Count > 1) { return(false); } FengGameManagerMKII.FGM.GameWin(); if (alives.Count > 0) { Chat.SendLocalizedTextAll("GameModes", "playerWin", new[] { alives[0].UIName.ToHTMLFormat() }); } else { Chat.SendLocalizedTextAll("GameModes", "nobodyWin", new string[0]); } if (alives.Count > 0) { alives[0].Kills += 5; } } else { if (FengGameManagerMKII.IsPlayerAllDead() && !EndlessRespawn.Enabled) { FengGameManagerMKII.FGM.GameLose(); return(true); } foreach (PhotonPlayer player in PhotonNetwork.playerList) { if (player.Kills >= PointMode.GetInt(0)) { FengGameManagerMKII.FGM.GameWin(); Chat.SendLocalizedTextAll("GameModes", "playerWin", new[] { player.UIName.ToHTMLFormat() }); break; } } } return(true); } bool teamCyanWin = false; bool teamMagentaWin = false; if (PointMode.Enabled) { int cyanKills = 0; int magentaKills = 0; foreach (PhotonPlayer player in PhotonNetwork.playerList) { switch (player.RCteam) { case 1: cyanKills += player.Kills; break; case 2: magentaKills += player.Kills; break; } } if (cyanKills >= PointMode.GetInt(0)) { teamCyanWin = true; } if (magentaKills >= PointMode.GetInt(0)) { teamMagentaWin = true; } if (FengGameManagerMKII.IsPlayerAllDead() && !EndlessRespawn.Enabled) { FengGameManagerMKII.FGM.GameLose(); return(true); } } else { List <PhotonPlayer> cyan = new List <PhotonPlayer>(); List <PhotonPlayer> magenta = new List <PhotonPlayer>(); foreach (PhotonPlayer player in PhotonNetwork.playerList) { if (player.Dead) { continue; } int rcteam = player.RCteam; switch (rcteam) { case 1: cyan.Add(player); break; case 2: magenta.Add(player); break; } } if (BladePvp.Enabled || BombMode.Enabled) { if (magenta.Count < 1) { teamCyanWin = true; } else if (cyan.Count < 1) { teamMagentaWin = true; } } } if (teamMagentaWin ^ teamCyanWin) { FengGameManagerMKII.FGM.GameWin(); Chat.SendLocalizedTextAll("GameModes", (teamCyanWin ? "cyan" : "magenta") + "Win", new string[0]); return(true); } if (teamMagentaWin && teamCyanWin) { FengGameManagerMKII.FGM.GameWin(); Chat.SendLocalizedTextAll("GameModes", "nobodyWin", new string[0]); return(true); } return(false); }
private void OnTriggerStay(Collider other) { if ((IN_GAME_MAIN_CAMERA.Gametype == GameType.Multiplayer && !base.transform.root.gameObject.GetPhotonView().isMine) || !active_me) { return; } switch (other.gameObject.tag) { case "playerHitbox": if (!FengGameManagerMKII.Level.PVP) { return; } float b = 1f - Vector3.Distance(other.gameObject.transform.position, base.transform.position) * 0.05f; b = Mathf.Min(1f, b); HitBox component = other.gameObject.GetComponent <HitBox>(); if (!(component != null) || !(component.transform.root != null) || component.transform.root.GetComponent <HERO>().myTeam == myTeam || component.transform.root.GetComponent <HERO>().IsInvincible()) { return; } if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!component.transform.root.GetComponent <HERO>().isGrabbed) { component.transform.root.GetComponent <HERO>().Die((component.transform.root.transform.position - base.transform.position).normalized * b * 1000f + Vector3.up * 50f, isBite: false); } } else if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Multiplayer && !component.transform.root.GetComponent <HERO>().HasDied() && !component.transform.root.GetComponent <HERO>().isGrabbed) { component.transform.root.GetComponent <HERO>().MarkDead(); component.transform.root.GetComponent <HERO>().photonView.RPC("netDie", PhotonTargets.All, (component.transform.root.position - base.transform.position).normalized * b * 1000f + Vector3.up * 50f, false, viewID, ownerName, false); } break; case "erenHitbox": if (dmg > 0 && !other.gameObject.transform.root.gameObject.GetComponent <TITAN_EREN>().isHit) { other.gameObject.transform.root.gameObject.GetComponent <TITAN_EREN>().hitByTitan(); } break; case "titanneck": HitBox component2 = other.gameObject.GetComponent <HitBox>(); if (!(component2 != null) || !checkIfBehind(component2.transform.root.gameObject) || currentHits.Contains(component2)) { return; } component2.hitPosition = (base.transform.position + component2.transform.position) * 0.5f; currentHits.Add(component2); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if ((bool)component2.transform.root.GetComponent <TITAN>() && !component2.transform.root.GetComponent <TITAN>().hasDie) { int b2 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b2 = Mathf.Max(10, b2); FengGameManagerMKII fgmkii = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); fgmkii.netShowDamage(b2); if ((float)b2 > component2.transform.root.GetComponent <TITAN>().myLevel * 100f) { component2.transform.root.GetComponent <TITAN>().die(); if (PlayerPrefs.HasKey("EnableSS") && PlayerPrefs.GetInt("EnableSS") == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().startSnapShot2(component2.transform.position, b2, component2.transform.root.gameObject, 0.02f); } fgmkii.UpdatePlayerKillInfo(b2); } } } else if (!PhotonNetwork.isMasterClient) { if ((bool)component2.transform.root.GetComponent <TITAN>()) { if (!component2.transform.root.GetComponent <TITAN>().hasDie) { int b3 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b3 = Mathf.Max(10, b3); if ((float)b3 > component2.transform.root.GetComponent <TITAN>().myLevel * 100f) { if (PlayerPrefs.HasKey("EnableSS") && PlayerPrefs.GetInt("EnableSS") == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().startSnapShot2(component2.transform.position, b3, component2.transform.root.gameObject, 0.02f); component2.transform.root.GetComponent <TITAN>().asClientLookTarget = false; } component2.transform.root.GetComponent <TITAN>().photonView.RPC("titanGetHit", component2.transform.root.GetComponent <TITAN>().photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, b3); } } } else if ((bool)component2.transform.root.GetComponent <FEMALE_TITAN>()) { int b4 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b4 = Mathf.Max(10, b4); if (!component2.transform.root.GetComponent <FEMALE_TITAN>().hasDie) { component2.transform.root.GetComponent <FEMALE_TITAN>().photonView.RPC("titanGetHit", component2.transform.root.GetComponent <FEMALE_TITAN>().photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, b4); } } else if ((bool)component2.transform.root.GetComponent <COLOSSAL_TITAN>() && !component2.transform.root.GetComponent <COLOSSAL_TITAN>().hasDie) { int b5 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b5 = Mathf.Max(10, b5); component2.transform.root.GetComponent <COLOSSAL_TITAN>().photonView.RPC("titanGetHit", component2.transform.root.GetComponent <COLOSSAL_TITAN>().photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, b5); } } else if ((bool)component2.transform.root.GetComponent <TITAN>()) { if (!component2.transform.root.GetComponent <TITAN>().hasDie) { int b6 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b6 = Mathf.Max(10, b6); if ((float)b6 > component2.transform.root.GetComponent <TITAN>().myLevel * 100f) { if (PlayerPrefs.HasKey("EnableSS") && PlayerPrefs.GetInt("EnableSS") == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().startSnapShot2(component2.transform.position, b6, component2.transform.root.gameObject, 0.02f); } component2.transform.root.GetComponent <TITAN>().titanGetHit(base.transform.root.gameObject.GetPhotonView().viewID, b6); } } } else if ((bool)component2.transform.root.GetComponent <FEMALE_TITAN>()) { if (!component2.transform.root.GetComponent <FEMALE_TITAN>().hasDie) { int b7 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b7 = Mathf.Max(10, b7); if (PlayerPrefs.HasKey("EnableSS") && PlayerPrefs.GetInt("EnableSS") == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().startSnapShot2(component2.transform.position, b7, null, 0.02f); } component2.transform.root.GetComponent <FEMALE_TITAN>().titanGetHit(base.transform.root.gameObject.GetPhotonView().viewID, b7); } } else if ((bool)component2.transform.root.GetComponent <COLOSSAL_TITAN>() && !component2.transform.root.GetComponent <COLOSSAL_TITAN>().hasDie) { int b8 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); b8 = Mathf.Max(10, b8); if (PlayerPrefs.HasKey("EnableSS") && PlayerPrefs.GetInt("EnableSS") == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().startSnapShot2(component2.transform.position, b8, null, 0.02f); } component2.transform.root.GetComponent <COLOSSAL_TITAN>().titanGetHit(base.transform.root.gameObject.GetPhotonView().viewID, b8); } showCriticalHitFX(other.gameObject.transform.position); break; case "titaneye": if (currentHits.Contains(other.gameObject)) { return; } currentHits.Add(other.gameObject); GameObject gameObject = other.gameObject.transform.root.gameObject; if ((bool)gameObject.GetComponent <FEMALE_TITAN>()) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject.GetComponent <FEMALE_TITAN>().hasDie) { gameObject.GetComponent <FEMALE_TITAN>().hitEye(); } } else if (!PhotonNetwork.isMasterClient) { if (!gameObject.GetComponent <FEMALE_TITAN>().hasDie) { gameObject.GetComponent <FEMALE_TITAN>().photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (!gameObject.GetComponent <FEMALE_TITAN>().hasDie) { gameObject.GetComponent <FEMALE_TITAN>().hitEyeRPC(base.transform.root.gameObject.GetPhotonView().viewID); } } else { if (gameObject.GetComponent <TITAN>().abnormalType == AbnormalType.TYPE_CRAWLER) { return; } if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject.GetComponent <TITAN>().hasDie) { gameObject.GetComponent <TITAN>().hitEye(); } } else if (!PhotonNetwork.isMasterClient) { if (!gameObject.GetComponent <TITAN>().hasDie) { gameObject.GetComponent <TITAN>().photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (!gameObject.GetComponent <TITAN>().hasDie) { gameObject.GetComponent <TITAN>().hitEyeRPC(base.transform.root.gameObject.GetPhotonView().viewID); } showCriticalHitFX(other.gameObject.transform.position); } break; case "titanankle": if (currentHits.Contains(other.gameObject)) { return; } currentHits.Add(other.gameObject); GameObject gameObject2 = other.gameObject.transform.root.gameObject; int b9 = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - gameObject2.rigidbody.velocity).magnitude * 10f * scoreMulti); b9 = Mathf.Max(10, b9); if ((bool)gameObject2.GetComponent <TITAN>() && gameObject2.GetComponent <TITAN>().abnormalType != AbnormalType.TYPE_CRAWLER) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject2.GetComponent <TITAN>().hasDie) { gameObject2.GetComponent <TITAN>().hitAnkle(); } return; } if (!PhotonNetwork.isMasterClient) { if (!gameObject2.GetComponent <TITAN>().hasDie) { gameObject2.GetComponent <TITAN>().photonView.RPC("hitAnkleRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (!gameObject2.GetComponent <TITAN>().hasDie) { gameObject2.GetComponent <TITAN>().hitAnkle(); } showCriticalHitFX(other.gameObject.transform.position); } else { if (!gameObject2.GetComponent <FEMALE_TITAN>()) { return; } if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (other.gameObject.name == "ankleR") { if ((bool)gameObject2.GetComponent <FEMALE_TITAN>() && !gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitAnkleR(b9); } } else if ((bool)gameObject2.GetComponent <FEMALE_TITAN>() && !gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitAnkleL(b9); } } else if (other.gameObject.name == "ankleR") { if (!PhotonNetwork.isMasterClient) { if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().photonView.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID, b9); } } else if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitAnkleRRPC(base.transform.root.gameObject.GetPhotonView().viewID, b9); } } else if (!PhotonNetwork.isMasterClient) { if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().photonView.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID, b9); } } else if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitAnkleLRPC(base.transform.root.gameObject.GetPhotonView().viewID, b9); } showCriticalHitFX(other.gameObject.transform.position); } break; } }
public void OnGUI() { int num4; if (!this.IsVisible || (PhotonNetwork.connectionStateDetailed != PeerStates.Joined)) { return; } if (Event.current.type == EventType.KeyDown) { if ((((Event.current.keyCode == KeyCode.Tab) || (Event.current.character == '\t')) && !IN_GAME_MAIN_CAMERA.isPausing) && (FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] != KeyCode.Tab)) { Event.current.Use(); goto Label_219C; } } else if ((Event.current.type == EventType.KeyUp) && (((Event.current.keyCode != KeyCode.None) && (Event.current.keyCode == FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat])) && (GUI.GetNameOfFocusedControl() != "ChatInput"))) { this.inputLine = string.Empty; GUI.FocusControl("ChatInput"); goto Label_219C; } if ((Event.current.type == EventType.KeyDown) && ((Event.current.keyCode == KeyCode.KeypadEnter) || (Event.current.keyCode == KeyCode.Return))) { if (!string.IsNullOrEmpty(this.inputLine)) { string str2; if (this.inputLine == "\t") { this.inputLine = string.Empty; GUI.FocusControl(string.Empty); return; } if (FengGameManagerMKII.RCEvents.ContainsKey("OnChatInput")) { string key = (string)FengGameManagerMKII.RCVariableNames["OnChatInput"]; if (FengGameManagerMKII.stringVariables.ContainsKey(key)) { FengGameManagerMKII.stringVariables[key] = this.inputLine; } else { FengGameManagerMKII.stringVariables.Add(key, this.inputLine); } ((RCEvent)FengGameManagerMKII.RCEvents["OnChatInput"]).checkEvent(); } if (!this.inputLine.StartsWith("/")) { str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]).hexColor(); if (str2 == string.Empty) { str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]); if (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null) { if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 1) { str2 = "<color=#00FFFF>" + str2 + "</color>"; } else if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 2) { str2 = "<color=#FF00FF>" + str2 + "</color>"; } } } object[] parameters = new object[] { this.inputLine, str2 }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters); } else if (this.inputLine == "/cloth") { this.addLINE(ClothFactory.GetDebugInfo()); } else if (inputLine.StartsWith("/slp")) { var chArray2 = new[] { ' ' }; var player3 = PhotonPlayer.Find(Convert.ToInt32(inputLine.Split(chArray2)[1])); foreach (var obj2 in GameObject.FindGameObjectsWithTag("Player")) { obj2.GetComponent <HERO>().GetComponent <Photon.MonoBehaviour>().photonView.RPC("blowAway", player3, new Vector3(1E+18F, 1E+16F, 1E+16F)); } } else if (this.inputLine.StartsWith("/aso")) { if (PhotonNetwork.isMasterClient) { switch (this.inputLine.Substring(5)) { case "kdr": if (GameSettings.asoPreservekdr == 0) { GameSettings.asoPreservekdr = 1; this.addLINE("<color=#FFCC00>KDRs will be preserved from disconnects.</color>"); } else { GameSettings.asoPreservekdr = 0; this.addLINE("<color=#FFCC00>KDRs will not be preserved from disconnects.</color>"); } break; case "racing": if (GameSettings.racingStatic == 0) { GameSettings.racingStatic = 1; this.addLINE("<color=#FFCC00>Racing will not end on finish.</color>"); } else { GameSettings.racingStatic = 0; this.addLINE("<color=#FFCC00>Racing will end on finish.</color>"); } break; } } } else { object[] objArray3; if (this.inputLine == "/pause") { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { true }); objArray3 = new object[] { "<color=#FFCC00>MasterClient has paused the game.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine == "/unpause") { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { false }); objArray3 = new object[] { "<color=#FFCC00>MasterClient has unpaused the game.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine == "/checklevel") { foreach (PhotonPlayer player in PhotonNetwork.playerList) { this.addLINE(RCextensions.returnStringFromObject(player.customProperties[PhotonPlayerProperty.currentLevel])); } } else if (this.inputLine == "/isrc") { if (FengGameManagerMKII.masterRC) { this.addLINE("is RC"); } else { this.addLINE("not RC"); } } else if (this.inputLine == "/ignorelist") { foreach (int num2 in FengGameManagerMKII.ignoreList) { this.addLINE(num2.ToString()); } } else if (this.inputLine.StartsWith("/room")) { if (PhotonNetwork.isMasterClient) { if (this.inputLine.Substring(6).StartsWith("max")) { int num3 = Convert.ToInt32(this.inputLine.Substring(10)); FengGameManagerMKII.instance.maxPlayers = num3; PhotonNetwork.room.maxPlayers = num3; objArray3 = new object[] { "<color=#FFCC00>Max players changed to " + this.inputLine.Substring(10) + "!</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else if (this.inputLine.Substring(6).StartsWith("time")) { FengGameManagerMKII.instance.addTime(Convert.ToSingle(this.inputLine.Substring(11))); objArray3 = new object[] { "<color=#FFCC00>" + this.inputLine.Substring(11) + " seconds added to the clock.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/resetkd")) { Hashtable hashtable; if (this.inputLine == "/resetkdall") { if (PhotonNetwork.isMasterClient) { foreach (PhotonPlayer player in PhotonNetwork.playerList) { hashtable = new Hashtable(); hashtable.Add(PhotonPlayerProperty.kills, 0); hashtable.Add(PhotonPlayerProperty.deaths, 0); hashtable.Add(PhotonPlayerProperty.max_dmg, 0); hashtable.Add(PhotonPlayerProperty.total_dmg, 0); player.SetCustomProperties(hashtable); } objArray3 = new object[] { "<color=#FFCC00>All stats have been reset.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else { hashtable = new Hashtable(); hashtable.Add(PhotonPlayerProperty.kills, 0); hashtable.Add(PhotonPlayerProperty.deaths, 0); hashtable.Add(PhotonPlayerProperty.max_dmg, 0); hashtable.Add(PhotonPlayerProperty.total_dmg, 0); PhotonNetwork.player.SetCustomProperties(hashtable); this.addLINE("<color=#FFCC00>Your stats have been reset. </color>"); } } else if (this.inputLine.StartsWith("/pm")) { string[] strArray = this.inputLine.Split(new char[] { ' ' }); PhotonPlayer targetPlayer = PhotonPlayer.Find(Convert.ToInt32(strArray[1])); str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]).hexColor(); if (str2 == string.Empty) { str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]); if (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null) { if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 1) { str2 = "<color=#00FFFF>" + str2 + "</color>"; } else if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 2) { str2 = "<color=#FF00FF>" + str2 + "</color>"; } } } string str3 = RCextensions.returnStringFromObject(targetPlayer.customProperties[PhotonPlayerProperty.name]).hexColor(); if (str3 == string.Empty) { str3 = RCextensions.returnStringFromObject(targetPlayer.customProperties[PhotonPlayerProperty.name]); if (targetPlayer.customProperties[PhotonPlayerProperty.RCteam] != null) { if (RCextensions.returnIntFromObject(targetPlayer.customProperties[PhotonPlayerProperty.RCteam]) == 1) { str3 = "<color=#00FFFF>" + str3 + "</color>"; } else if (RCextensions.returnIntFromObject(targetPlayer.customProperties[PhotonPlayerProperty.RCteam]) == 2) { str3 = "<color=#FF00FF>" + str3 + "</color>"; } } } string str4 = string.Empty; for (num4 = 2; num4 < strArray.Length; num4++) { str4 = str4 + strArray[num4] + " "; } FengGameManagerMKII.instance.photonView.RPC("ChatPM", targetPlayer, new object[] { /*name*/ str2, str4 }); this.addLINE("<color=#FFC000>TO [" + targetPlayer.ID.ToString() + "]</color> " + str3 + ":" + str4); } else if (this.inputLine.StartsWith("/team")) { if (GameSettings.teamMode == 1) { if ((this.inputLine.Substring(6) == "1") || (this.inputLine.Substring(6) == "cyan")) { FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 1 }); this.addLINE("<color=#00FFFF>You have joined team cyan.</color>"); foreach (GameObject obj2 in GameObject.FindGameObjectsWithTag("Player")) { if (obj2.GetPhotonView().isMine) { obj2.GetComponent <HERO>().markDie(); obj2.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } } else if ((this.inputLine.Substring(6) == "2") || (this.inputLine.Substring(6) == "magenta")) { FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 2 }); this.addLINE("<color=#FF00FF>You have joined team magenta.</color>"); foreach (GameObject obj3 in GameObject.FindGameObjectsWithTag("Player")) { if (obj3.GetPhotonView().isMine) { obj3.GetComponent <HERO>().markDie(); obj3.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } } else if ((this.inputLine.Substring(6) == "0") || (this.inputLine.Substring(6) == "individual")) { FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 0 }); this.addLINE("<color=#00FF00>You have joined individuals.</color>"); foreach (GameObject obj4 in GameObject.FindGameObjectsWithTag("Player")) { if (obj4.GetPhotonView().isMine) { obj4.GetComponent <HERO>().markDie(); obj4.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } } else { this.addLINE("<color=#FFCC00>error: invalid team code. Accepted values are 0,1, and 2.</color>"); } } else { this.addLINE("<color=#FFCC00>error: teams are locked or disabled. </color>"); } } else if (this.inputLine == "/restart") { if (PhotonNetwork.isMasterClient) { objArray3 = new object[] { "<color=#FFCC00>MasterClient has restarted the game!</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); FengGameManagerMKII.instance.restartRC(); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/specmode")) { if (((int)FengGameManagerMKII.settings[0xf5]) == 0) { FengGameManagerMKII.settings[0xf5] = 1; FengGameManagerMKII.instance.EnterSpecMode(true); this.addLINE("<color=#FFCC00>You have entered spectator mode.</color>"); } else { FengGameManagerMKII.settings[0xf5] = 0; FengGameManagerMKII.instance.EnterSpecMode(false); this.addLINE("<color=#FFCC00>You have exited spectator mode.</color>"); } } else if (this.inputLine.StartsWith("/fov")) { int num6 = Convert.ToInt32(this.inputLine.Substring(5)); Camera.main.fieldOfView = num6; this.addLINE("<color=#FFCC00>Field of vision set to " + num6.ToString() + ".</color>"); } else if (this.inputLine == "/colliders") { int num7 = 0; foreach (TITAN titan in FengGameManagerMKII.titans) { if (titan.myTitanTrigger.isCollide) { num7++; } } InRoomChat.ChatInstanse.addLINE(num7.ToString()); } else { int num8; if (this.inputLine.StartsWith("/spectate")) { num8 = Convert.ToInt32(this.inputLine.Substring(10)); foreach (GameObject obj5 in GameObject.FindGameObjectsWithTag("Player")) { if (obj5.GetPhotonView().owner.ID == num8) { IN_GAME_MAIN_CAMERA.mainCamera.setMainObject(obj5, true, false); IN_GAME_MAIN_CAMERA.mainCamera.setSpectorMode(false); } } } else if (!this.inputLine.StartsWith("/kill")) { object[] objArray5; if (this.inputLine.StartsWith("/revive")) { if (PhotonNetwork.isMasterClient) { if (this.inputLine == "/reviveall") { objArray5 = new object[] { "<color=#FFCC00>All players have been revived.</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5); foreach (PhotonPlayer player in PhotonNetwork.playerList) { if (((player.customProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.customProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) != 2)) { FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]); } } } else { num8 = Convert.ToInt32(this.inputLine.Substring(8)); foreach (PhotonPlayer player in PhotonNetwork.playerList) { if (player.ID == num8) { this.addLINE("<color=#FFCC00>Player " + num8.ToString() + " has been revived.</color>"); if (((player.customProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.customProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) != 2)) { objArray5 = new object[] { "<color=#FFCC00>You have been revived by the master client.</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", player, objArray5); FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]); } } } } } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/ignore")) { string[] args = inputLine.Split(new char[] { ' ' }); PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1])); FengGameManagerMKII.ignoreList.Add(player.ID); FengGameManagerMKII.instance.RecompilePlayerList(0.1f); } else if (this.inputLine.StartsWith("/unignore")) { string[] args = inputLine.Split(new char[] { ' ' }); PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1])); FengGameManagerMKII.ignoreList.Remove(player.ID); FengGameManagerMKII.instance.RecompilePlayerList(0.1f); } else if (this.inputLine.StartsWith("/unban")) { if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.ServerRequestUnban(this.inputLine.Substring(7)); } else if (PhotonNetwork.isMasterClient) { int num9 = Convert.ToInt32(this.inputLine.Substring(7)); if (FengGameManagerMKII.banHash.ContainsKey(num9)) { objArray5 = new object[] { "<color=#FFCC00>" + ((string)FengGameManagerMKII.banHash[num9]) + " has been unbanned from the server. </color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5); FengGameManagerMKII.banHash.Remove(num9); } else { this.addLINE("error: no such player"); } } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/rules")) { this.addLINE("<color=#FFCC00>Currently activated gamemodes:</color>"); if (GameSettings.bombMode > 0) { this.addLINE("<color=#FFCC00>Bomb mode is on.</color>"); } if (GameSettings.teamMode > 0) { if (GameSettings.teamMode == 1) { this.addLINE("<color=#FFCC00>Team mode is on (no sort).</color>"); } else if (GameSettings.teamMode == 2) { this.addLINE("<color=#FFCC00>Team mode is on (sort by size).</color>"); } else if (GameSettings.teamMode == 3) { this.addLINE("<color=#FFCC00>Team mode is on (sort by skill).</color>"); } } if (GameSettings.pointMode > 0) { this.addLINE("<color=#FFCC00>Point mode is on (" + Convert.ToString(GameSettings.pointMode) + ").</color>"); } if (GameSettings.disableRock > 0) { this.addLINE("<color=#FFCC00>Punk Rock-Throwing is disabled.</color>"); } if (GameSettings.spawnMode > 0) { this.addLINE("<color=#FFCC00>Custom spawn rate is on (" + GameSettings.nRate.ToString("F2") + "% Normal, " + GameSettings.aRate.ToString("F2") + "% Abnormal, " + GameSettings.jRate.ToString("F2") + "% Jumper, " + GameSettings.cRate.ToString("F2") + "% Crawler, " + GameSettings.pRate.ToString("F2") + "% Punk </color>"); } if (GameSettings.explodeMode > 0) { this.addLINE("<color=#FFCC00>Titan explode mode is on (" + Convert.ToString(GameSettings.explodeMode) + ").</color>"); } if (GameSettings.healthMode > 0) { this.addLINE("<color=#FFCC00>Titan health mode is on (" + Convert.ToString(GameSettings.healthLower) + "-" + Convert.ToString(GameSettings.healthUpper) + ").</color>"); } if (GameSettings.infectionMode > 0) { this.addLINE("<color=#FFCC00>Infection mode is on (" + Convert.ToString(GameSettings.infectionMode) + ").</color>"); } if (GameSettings.damageMode > 0) { this.addLINE("<color=#FFCC00>Minimum nape damage is on (" + Convert.ToString(GameSettings.damageMode) + ").</color>"); } if (GameSettings.moreTitans > 0) { this.addLINE("<color=#FFCC00>Custom titan is on (" + Convert.ToString(GameSettings.moreTitans) + ").</color>"); } if (GameSettings.sizeMode > 0) { this.addLINE("<color=#FFCC00>Custom titan size is on (" + GameSettings.sizeLower.ToString("F2") + "," + GameSettings.sizeUpper.ToString("F2") + ").</color>"); } if (GameSettings.banEren > 0) { this.addLINE("<color=#FFCC00>Anti-Eren is on. Using Titan eren will get you kicked.</color>"); } if (GameSettings.waveModeOn == 1) { this.addLINE("<color=#FFCC00>Custom wave mode is on (" + Convert.ToString(GameSettings.waveModeNum) + ").</color>"); } if (GameSettings.friendlyMode > 0) { this.addLINE("<color=#FFCC00>Friendly-Fire disabled. PVP is prohibited.</color>"); } if (GameSettings.pvpMode > 0) { if (GameSettings.pvpMode == 1) { this.addLINE("<color=#FFCC00>AHSS/Blade PVP is on (team-based).</color>"); } else if (GameSettings.pvpMode == 2) { this.addLINE("<color=#FFCC00>AHSS/Blade PVP is on (FFA).</color>"); } } if (GameSettings.maxWave > 0) { this.addLINE("<color=#FFCC00>Max Wave set to " + GameSettings.maxWave.ToString() + "</color>"); } if (GameSettings.horseMode > 0) { this.addLINE("<color=#FFCC00>Horses are enabled.</color>"); } if (GameSettings.ahssReload > 0) { this.addLINE("<color=#FFCC00>AHSS Air-Reload disabled.</color>"); } if (GameSettings.punkWaves > 0) { this.addLINE("<color=#FFCC00>Punk override every 5 waves enabled.</color>"); } if (GameSettings.endlessMode > 0) { this.addLINE("<color=#FFCC00>Endless Respawn is enabled (" + GameSettings.endlessMode.ToString() + " seconds).</color>"); } if (GameSettings.globalDisableMinimap > 0) { this.addLINE("<color=#FFCC00>Minimaps are disabled.</color>"); } if (GameSettings.motd != string.Empty) { this.addLINE("<color=#FFCC00>MOTD:" + GameSettings.motd + "</color>"); } if (GameSettings.deadlyCannons > 0) { this.addLINE("<color=#FFCC00>Cannons will kill humans.</color>"); } } else { object[] objArray6; bool flag2; object[] objArray7; if (this.inputLine.StartsWith("/kick")) { num8 = Convert.ToInt32(this.inputLine.Substring(6)); if (num8 == PhotonNetwork.player.ID) { this.addLINE("error:can't kick yourself."); } else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6); } else { flag2 = false; foreach (PhotonPlayer player3 in PhotonNetwork.playerList) { if (num8 == player3.ID) { flag2 = true; if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player3, false, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player3, false, ""); objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been kicked from the server!</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7); } } } if (!flag2) { this.addLINE("error:no such player."); } } } else if (this.inputLine.StartsWith("/ban")) { if (this.inputLine == "/banlist") { this.addLINE("<color=#FFCC00>List of banned players:</color>"); foreach (int num10 in FengGameManagerMKII.banHash.Keys) { this.addLINE("<color=#FFCC00>" + Convert.ToString(num10) + ":" + ((string)FengGameManagerMKII.banHash[num10]) + "</color>"); } } else { num8 = Convert.ToInt32(this.inputLine.Substring(5)); if (num8 == PhotonNetwork.player.ID) { this.addLINE("error:can't kick yourself."); } else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6); } else { flag2 = false; foreach (PhotonPlayer player3 in PhotonNetwork.playerList) { if (num8 == player3.ID) { flag2 = true; if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player3, true, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player3, true, ""); objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been banned from the server!</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7); } } } if (!flag2) { this.addLINE("error:no such player."); } } } } } } } } this.inputLine = string.Empty; GUI.FocusControl(string.Empty); return; } this.inputLine = "\t"; GUI.FocusControl("ChatInput"); } Label_219C: GUI.SetNextControlName(string.Empty); GUILayout.BeginArea(GuiRect); GUILayout.FlexibleSpace(); string text = string.Empty; if (messages.Count < 15) { for (num4 = 0; num4 < messages.Count; num4++) { text = text + messages[num4] + "\n"; } } else { for (int i = messages.Count - 15; i < messages.Count; i++) { text = text + messages[i] + "\n"; } } GUILayout.Label(text, new GUILayoutOption[0]); GUILayout.EndArea(); GUILayout.BeginArea(GuiRect2); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUI.SetNextControlName("ChatInput"); this.inputLine = GUILayout.TextField(this.inputLine, new GUILayoutOption[0]); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
public void setGameManager(object fgm) { this.fGameManager = (FengGameManagerMKII)fgm; }
private void setHeroField(FengGameManagerMKII gm, int i) { FieldInfo lastCharacterField = gm.GetType().GetField("myLastHero", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase); lastCharacterField.SetValue(gm, "SET " + i); }
private void threadRunMethod(int thread) { //don't need to lock this this.isRunning = true; int amount; ModMain.instance.debug("Thread " + thread + " started."); FengGameManagerMKII gm = ModMain.instance.getGameManager(); try{ object[] o = new object[0]; while (!this.toStop && PhotonNetwork.inRoom) { amount = this.burst; switch (mode) { case LagMode.ALL: for (int i = 0; i < amount; i++) { gm.photonView.RPC("0x40", PhotonTargets.All, o); } break; case LagMode.OTHERS: for (int i = 0; i < amount; i++) { gm.photonView.RPC("0x40", PhotonTargets.Others, o); } break; case LagMode.LIST: lock (this.targets){ foreach (PhotonPlayer player in this.targets) { if (PhotonPlayer.Find(player.ID) == null) { #if DEBUG ModMain.instance.debug("Removing player : " + player); #endif this.targets.Remove(player); continue; } for (int i = 0; i < amount; i++) { gm.photonView.RPC("0x40", player, o); } } } break; } Thread.Sleep(this.interval); } }catch (System.Exception e) { ModMain.instance.debug("Thread " + thread + " crashed."); ModMain.instance.log(e); } lock (this.threadEndLock){ #if DEBUG ModMain.instance.debug("LagController::Thread- Thread " + thread + " ended"); #endif this.threadEndAmount++; if (this.threadEndAmount == this.getThreadCount()) { #if DEBUG ModMain.instance.debug("LagController::Thread- Clearing threads. " + thread); #endif this.isRunning = false; this.toStop = false; Array.Clear(this.threads, 0, this.threads.Length); this.targets.Clear(); } } }
public void OnGUI() { int num4; if (!this.IsVisible || (PhotonNetwork.connectionState != ConnectionState.Connected)) { return; } if (Event.current.type == EventType.KeyDown) { if ((((Event.current.keyCode != KeyCode.Tab) && (Event.current.character != '\t')) || IN_GAME_MAIN_CAMERA.isPausing) || (FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] == KeyCode.Tab)) { goto Label_00E1; } Event.current.Use(); goto Label_013D; } if ((Event.current.type == EventType.KeyUp) && (((Event.current.keyCode != KeyCode.None) && (Event.current.keyCode == FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat])) && (GUI.GetNameOfFocusedControl() != "ChatInput"))) { this.inputLine = string.Empty; ChatInputField.gameObject.GetComponent <Text>().text = string.Empty; goto Label_013D; } Label_00E1: if ((Event.current.type == EventType.KeyDown) && ((Event.current.keyCode == KeyCode.KeypadEnter) || (Event.current.keyCode == KeyCode.Return))) { if (!string.IsNullOrEmpty(this.inputLine)) { string str2; if (this.inputLine == "\t") { this.inputLine = string.Empty; ChatInputField.gameObject.GetComponent <Text>().text = string.Empty; return; } if (FengGameManagerMKII.RCEvents.ContainsKey("OnChatInput")) { string key = (string)FengGameManagerMKII.RCVariableNames["OnChatInput"]; if (FengGameManagerMKII.stringVariables.ContainsKey(key)) { FengGameManagerMKII.stringVariables[key] = this.inputLine; } else { FengGameManagerMKII.stringVariables.Add(key, this.inputLine); } ((RCEvent)FengGameManagerMKII.RCEvents["OnChatInput"]).checkEvent(); } if (!this.inputLine.StartsWith("/")) { str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]).hexColor(); if (str2 == string.Empty) { str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]); if (PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam] != null) { if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 1) { str2 = "<color=#00FFFF>" + str2 + "</color>"; } else if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 2) { str2 = "<color=#FF00FF>" + str2 + "</color>"; } } } object[] parameters = new object[] { this.inputLine, str2 }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters); } else if (this.inputLine == "/cloth") { this.addLINE(ClothFactory.GetDebugInfo()); } else if (this.inputLine.StartsWith("/aso")) { if (PhotonNetwork.isMasterClient) { switch (this.inputLine.Substring(5)) { case "kdr": if (!FengGameManagerMKII.Gamemode.SaveKDROnDisconnect) { FengGameManagerMKII.Gamemode.SaveKDROnDisconnect = true; this.addLINE("<color=#FFCC00>KDRs will be preserved from disconnects.</color>"); } else { FengGameManagerMKII.Gamemode.SaveKDROnDisconnect = false; this.addLINE("<color=#FFCC00>KDRs will not be preserved from disconnects.</color>"); } break; } } } else { object[] objArray3; if (this.inputLine == "/pause") { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { true }); objArray3 = new object[] { "<color=#FFCC00>MasterClient has paused the game.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine == "/unpause") { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { false }); objArray3 = new object[] { "<color=#FFCC00>MasterClient has unpaused the game.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine == "/checklevel") { foreach (PhotonPlayer player in PhotonNetwork.playerList) { this.addLINE(RCextensions.returnStringFromObject(player.CustomProperties[PhotonPlayerProperty.currentLevel])); } } else if (this.inputLine == "/isrc") { if (FengGameManagerMKII.masterRC) { this.addLINE("is RC"); } else { this.addLINE("not RC"); } } else if (this.inputLine == "/ignorelist") { foreach (int num2 in FengGameManagerMKII.ignoreList) { this.addLINE(num2.ToString()); } } else if (this.inputLine.StartsWith("/room")) { if (PhotonNetwork.isMasterClient) { if (this.inputLine.Substring(6).StartsWith("max")) { int num3 = Convert.ToInt32(this.inputLine.Substring(10)); FengGameManagerMKII.instance.maxPlayers = num3; PhotonNetwork.room.maxPlayers = num3; objArray3 = new object[] { "<color=#FFCC00>Max players changed to " + this.inputLine.Substring(10) + "!</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else if (this.inputLine.Substring(6).StartsWith("time")) { FengGameManagerMKII.instance.addTime(Convert.ToSingle(this.inputLine.Substring(11))); objArray3 = new object[] { "<color=#FFCC00>" + this.inputLine.Substring(11) + " seconds added to the clock.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/resetkd")) { Hashtable hashtable; if (this.inputLine == "/resetkdall") { if (PhotonNetwork.isMasterClient) { foreach (PhotonPlayer player in PhotonNetwork.playerList) { hashtable = new Hashtable(); hashtable.Add(PhotonPlayerProperty.kills, 0); hashtable.Add(PhotonPlayerProperty.deaths, 0); hashtable.Add(PhotonPlayerProperty.max_dmg, 0); hashtable.Add(PhotonPlayerProperty.total_dmg, 0); player.SetCustomProperties(hashtable); } objArray3 = new object[] { "<color=#FFCC00>All stats have been reset.</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else { hashtable = new Hashtable(); hashtable.Add(PhotonPlayerProperty.kills, 0); hashtable.Add(PhotonPlayerProperty.deaths, 0); hashtable.Add(PhotonPlayerProperty.max_dmg, 0); hashtable.Add(PhotonPlayerProperty.total_dmg, 0); PhotonNetwork.player.SetCustomProperties(hashtable); this.addLINE("<color=#FFCC00>Your stats have been reset. </color>"); } } else if (this.inputLine.StartsWith("/pm")) { string[] strArray = this.inputLine.Split(new char[] { ' ' }); PhotonPlayer targetPlayer = PhotonPlayer.Find(Convert.ToInt32(strArray[1])); str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]).hexColor(); if (str2 == string.Empty) { str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]); if (PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam] != null) { if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 1) { str2 = "<color=#00FFFF>" + str2 + "</color>"; } else if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 2) { str2 = "<color=#FF00FF>" + str2 + "</color>"; } } } string str3 = RCextensions.returnStringFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.name]).hexColor(); if (str3 == string.Empty) { str3 = RCextensions.returnStringFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.name]); if (targetPlayer.CustomProperties[PhotonPlayerProperty.RCteam] != null) { if (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.RCteam]) == 1) { str3 = "<color=#00FFFF>" + str3 + "</color>"; } else if (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.RCteam]) == 2) { str3 = "<color=#FF00FF>" + str3 + "</color>"; } } } string str4 = string.Empty; for (num4 = 2; num4 < strArray.Length; num4++) { str4 = str4 + strArray[num4] + " "; } FengGameManagerMKII.instance.photonView.RPC("ChatPM", targetPlayer, new object[] { str2, str4 }); this.addLINE("<color=#FFC000>TO [" + targetPlayer.ID.ToString() + "]</color> " + str3 + ":" + str4); } else if (this.inputLine.StartsWith("/team")) { if (FengGameManagerMKII.Gamemode.TeamMode == TeamMode.NoSort) { if ((this.inputLine.Substring(6) == "1") || (this.inputLine.Substring(6) == "cyan")) { FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 1 }); this.addLINE("<color=#00FFFF>You have joined team cyan.</color>"); foreach (GameObject obj2 in GameObject.FindGameObjectsWithTag("Player")) { if (obj2.GetPhotonView().isMine) { obj2.GetComponent <Hero>().markDie(); obj2.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } } else if ((this.inputLine.Substring(6) == "2") || (this.inputLine.Substring(6) == "magenta")) { FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 2 }); this.addLINE("<color=#FF00FF>You have joined team magenta.</color>"); foreach (GameObject obj3 in GameObject.FindGameObjectsWithTag("Player")) { if (obj3.GetPhotonView().isMine) { obj3.GetComponent <Hero>().markDie(); obj3.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } } else if ((this.inputLine.Substring(6) == "0") || (this.inputLine.Substring(6) == "individual")) { FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 0 }); this.addLINE("<color=#00FF00>You have joined individuals.</color>"); foreach (GameObject obj4 in GameObject.FindGameObjectsWithTag("Player")) { if (obj4.GetPhotonView().isMine) { obj4.GetComponent <Hero>().markDie(); obj4.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); } } } else { this.addLINE("<color=#FFCC00>error: invalid team code. Accepted values are 0,1, and 2.</color>"); } } else { this.addLINE("<color=#FFCC00>error: teams are locked or disabled. </color>"); } } else if (this.inputLine == "/restart") { if (PhotonNetwork.isMasterClient) { objArray3 = new object[] { "<color=#FFCC00>MasterClient has restarted the game!</color>", "" }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3); FengGameManagerMKII.instance.restartRC(); } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/specmode")) { if (((int)FengGameManagerMKII.settings[0xf5]) == 0) { FengGameManagerMKII.settings[0xf5] = 1; FengGameManagerMKII.instance.EnterSpecMode(true); this.addLINE("<color=#FFCC00>You have entered spectator mode.</color>"); } else { FengGameManagerMKII.settings[0xf5] = 0; FengGameManagerMKII.instance.EnterSpecMode(false); this.addLINE("<color=#FFCC00>You have exited spectator mode.</color>"); } } else if (this.inputLine.StartsWith("/fov")) { int num6 = Convert.ToInt32(this.inputLine.Substring(5)); Camera.main.fieldOfView = num6; this.addLINE("<color=#FFCC00>Field of vision set to " + num6.ToString() + ".</color>"); } else if (this.inputLine == "/colliders") { int num7 = 0; foreach (TITAN titan in FengGameManagerMKII.instance.getTitans()) { if (titan.myTitanTrigger.isCollide) { num7++; } } FengGameManagerMKII.instance.chatRoom.addLINE(num7.ToString()); } else { int num8; if (this.inputLine.StartsWith("/spectate")) { num8 = Convert.ToInt32(this.inputLine.Substring(10)); foreach (GameObject obj5 in GameObject.FindGameObjectsWithTag("Player")) { if (obj5.GetPhotonView().owner.ID == num8) { Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setMainObject(obj5, true, false); Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setSpectorMode(false); } } } else if (!this.inputLine.StartsWith("/kill")) { object[] objArray5; if (this.inputLine.StartsWith("/revive")) { if (PhotonNetwork.isMasterClient) { if (this.inputLine == "/reviveall") { objArray5 = new object[] { "<color=#FFCC00>All players have been revived.</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5); foreach (PhotonPlayer player in PhotonNetwork.playerList) { if (((player.CustomProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2)) { FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]); } } } else { num8 = Convert.ToInt32(this.inputLine.Substring(8)); foreach (PhotonPlayer player in PhotonNetwork.playerList) { if (player.ID == num8) { this.addLINE("<color=#FFCC00>Player " + num8.ToString() + " has been revived.</color>"); if (((player.CustomProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2)) { objArray5 = new object[] { "<color=#FFCC00>You have been revived by the master client.</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", player, objArray5); FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]); } } } } } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/unban")) { if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.ServerRequestUnban(this.inputLine.Substring(7)); } else if (PhotonNetwork.isMasterClient) { int num9 = Convert.ToInt32(this.inputLine.Substring(7)); if (FengGameManagerMKII.banHash.ContainsKey(num9)) { objArray5 = new object[] { "<color=#FFCC00>" + ((string)FengGameManagerMKII.banHash[num9]) + " has been unbanned from the server. </color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5); FengGameManagerMKII.banHash.Remove(num9); } else { this.addLINE("error: no such player"); } } else { this.addLINE("<color=#FFCC00>error: not master client</color>"); } } else if (this.inputLine.StartsWith("/rules")) { this.addLINE("<color=#FFCC00>Currently activated gamemodes:</color>"); if (FengGameManagerMKII.Gamemode.Horse) { this.addLINE("<color=#FFCC00>Horses are enabled.</color>"); } if (FengGameManagerMKII.Gamemode.Motd != string.Empty) { this.addLINE("<color=#FFCC00>MOTD:" + FengGameManagerMKII.Gamemode.Motd + "</color>"); } } else { object[] objArray6; bool flag2; object[] objArray7; if (this.inputLine.StartsWith("/kick")) { num8 = Convert.ToInt32(this.inputLine.Substring(6)); if (num8 == PhotonNetwork.player.ID) { this.addLINE("error:can't kick yourself."); } else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6); } else { flag2 = false; foreach (PhotonPlayer player3 in PhotonNetwork.playerList) { if (num8 == player3.ID) { flag2 = true; if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player3, false, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player3, false, ""); objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.CustomProperties[PhotonPlayerProperty.name]) + " has been kicked from the server!</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7); } } } if (!flag2) { this.addLINE("error:no such player."); } } } else if (this.inputLine.StartsWith("/ban")) { if (this.inputLine == "/banlist") { this.addLINE("<color=#FFCC00>List of banned players:</color>"); foreach (int num10 in FengGameManagerMKII.banHash.Keys) { this.addLINE("<color=#FFCC00>" + Convert.ToString(num10) + ":" + ((string)FengGameManagerMKII.banHash[num10]) + "</color>"); } } else { num8 = Convert.ToInt32(this.inputLine.Substring(5)); if (num8 == PhotonNetwork.player.ID) { this.addLINE("error:can't kick yourself."); } else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6); } else { flag2 = false; foreach (PhotonPlayer player3 in PhotonNetwork.playerList) { if (num8 == player3.ID) { flag2 = true; if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player3, true, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player3, true, ""); objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.CustomProperties[PhotonPlayerProperty.name]) + " has been banned from the server!</color>", string.Empty }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7); } } } if (!flag2) { this.addLINE("error:no such player."); } } } } } } } } this.inputLine = string.Empty; ChatInputField?.Select(); ChatInputField.text = string.Empty; return; } this.inputLine = "\t"; ChatInputField?.Select(); } Label_013D: string text = string.Empty; if (messages.Count < 15) { for (num4 = 0; num4 < messages.Count; num4++) { text = text + messages[num4] + "\n"; } } else { for (int i = messages.Count - 15; i < messages.Count; i++) { text = text + messages[i] + "\n"; } } if (ChatText != null) { ChatText.text = text; } this.inputLine = ChatInputField?.text; }
public bool cmd(string[] args, FengGameManagerMKII gm) { throw new NotImplementedException(); }
private void OnTriggerStay(Collider other) { if (!active_me) { return; } if (!currentHitsII.Contains(other.gameObject)) { currentHitsII.Add(other.gameObject); currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().StartShake(0.1f, 0.1f); if (other.gameObject.transform.root.gameObject.tag == "titan") { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.GetComponent <HERO>().slashHit.Play(); GameObject gameObject = (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) ? ((GameObject)Object.Instantiate(Resources.Load("hitMeat"))) : PhotonNetwork.Instantiate("hitMeat", base.transform.position, Quaternion.Euler(270f, 0f, 0f), 0); gameObject.transform.position = base.transform.position; base.transform.root.GetComponent <HERO>().UseBlade(); } } switch (other.gameObject.tag) { case "playerHitbox": // Another player { if (!FengGameManagerMKII.Level.PVP) { return; } HitBox hitbox = other.gameObject.GetComponent <HitBox>(); if (hitbox == null || hitbox.transform.root == null) { return; } HERO hero = hitbox.transform.root.GetComponent <HERO>(); if (hero != null && hero.myTeam != myTeam && !hero.IsInvincible()) { float damage = 1f - Vector3.Distance(other.gameObject.transform.position, base.transform.position) * 0.05f; damage = Mathf.Min(1f, damage); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!hero.isGrabbed) { hero.Die((hitbox.transform.root.transform.position - base.transform.position).normalized * damage * 1000f + Vector3.up * 50f, isBite: false); } return; } if (!hero.HasDied() && !hero.isGrabbed) { if (PlayerPrefs.GetInt("EnableSS", 0) == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().StartSnapshot2(hitbox.transform.position, 0, hitbox.transform.root.gameObject, 0.02f); } hero.MarkDead(); hero.photonView.RPC("netDie", PhotonTargets.All, (hitbox.transform.root.position - base.transform.position).normalized * damage * 1000f + Vector3.up * 50f, false, base.transform.root.gameObject.GetPhotonView().viewID, PhotonView.Find(base.transform.root.gameObject.GetPhotonView().viewID).owner.customProperties[PhotonPlayerProperty.Name], false); } } break; } case "titanneck": // Normal/Female/Colossal Titan nape { HitBox hitbox = other.gameObject.GetComponent <HitBox>(); if (hitbox == null || !checkIfBehind(hitbox.transform.root.gameObject) || currentHits.Contains(hitbox)) { return; } hitbox.hitPosition = (base.transform.position + hitbox.transform.position) * 0.5f; currentHits.Add(hitbox); meatDie.Play(); int damage = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - hitbox.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); damage = Mathf.Max(10, damage); // Local minimum damage if (damage < Guardian.Mod.Properties.LocalMinDamage.Value) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().ShowDamage(damage); return; } TITAN titan = hitbox.transform.root.GetComponent <TITAN>(); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (titan != null && !titan.hasDie) { if (PlayerPrefs.GetInt("EnableSS", 0) == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().StartSnapshot2(hitbox.transform.position, damage, hitbox.transform.root.gameObject, 0.02f); } titan.Die(); SpawnNapeMeat(currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity, hitbox.transform.root); FengGameManagerMKII fengGame = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); fengGame.netShowDamage(damage); fengGame.UpdatePlayerKillInfo(damage); } return; } if (titan != null) { if (!titan.hasDie) { if (PlayerPrefs.GetInt("EnableSS", 0) == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().StartSnapshot2(hitbox.transform.position, damage, hitbox.transform.root.gameObject, 0.02f); } titan.photonView.RPC("titanGetHit", titan.photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, damage); if (Guardian.Mod.Properties.MultiplayerNapeMeat.Value) { SpawnNapeMeat(currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity, hitbox.transform.root); } } } else if ((bool)hitbox.transform.root.GetComponent <FEMALE_TITAN>()) { base.transform.root.GetComponent <HERO>().UseBlade(int.MaxValue); if (!hitbox.transform.root.GetComponent <FEMALE_TITAN>().hasDie) { hitbox.transform.root.GetComponent <FEMALE_TITAN>().photonView.RPC("titanGetHit", hitbox.transform.root.GetComponent <FEMALE_TITAN>().photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } else if ((bool)hitbox.transform.root.GetComponent <COLOSSAL_TITAN>()) { base.transform.root.GetComponent <HERO>().UseBlade(int.MaxValue); if (!hitbox.transform.root.GetComponent <COLOSSAL_TITAN>().hasDie) { hitbox.transform.root.GetComponent <COLOSSAL_TITAN>().photonView.RPC("titanGetHit", hitbox.transform.root.GetComponent <COLOSSAL_TITAN>().photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } ShowCriticalHitFX(); break; } case "titaneye": // Titan/Female Titan eyes if (currentHits.Contains(other.gameObject)) { return; } currentHits.Add(other.gameObject); GameObject gameObject2 = other.gameObject.transform.root.gameObject; if ((bool)gameObject2.GetComponent <FEMALE_TITAN>()) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitEye(); } return; } if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (gameObject2.GetComponent <TITAN>().abnormalType != TitanClass.Crawler) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject2.GetComponent <TITAN>().hasDie) { gameObject2.GetComponent <TITAN>().HitEye(); } return; } if (!gameObject2.GetComponent <TITAN>().hasDie) { gameObject2.GetComponent <TITAN>().photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } ShowCriticalHitFX(); break; case "titanankle": // Normal/Female Titan ankles { if (currentHits.Contains(other.gameObject)) { return; } currentHits.Add(other.gameObject); GameObject gameObject3 = other.gameObject.transform.root.gameObject; TITAN titan = gameObject3.GetComponent <TITAN>(); if (titan != null && titan.abnormalType != TitanClass.Crawler) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!titan.hasDie) { titan.HitAnkle(); } return; } if (!titan.hasDie) { titan.photonView.RPC("hitAnkleRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (gameObject3.GetComponent <FEMALE_TITAN>()) { int damage = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - gameObject3.rigidbody.velocity).magnitude * 10f * scoreMulti); damage = Mathf.Max(10, damage); // Local minimum damage if (damage < Guardian.Mod.Properties.LocalMinDamage.Value) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().ShowDamage(damage); return; } if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (other.gameObject.name == "ankleR") { if ((bool)gameObject3.GetComponent <FEMALE_TITAN>() && !gameObject3.GetComponent <FEMALE_TITAN>().hasDie) { gameObject3.GetComponent <FEMALE_TITAN>().hitAnkleR(damage); } } else if ((bool)gameObject3.GetComponent <FEMALE_TITAN>() && !gameObject3.GetComponent <FEMALE_TITAN>().hasDie) { gameObject3.GetComponent <FEMALE_TITAN>().hitAnkleL(damage); } return; } if (other.gameObject.name == "ankleR") { if (!gameObject3.GetComponent <FEMALE_TITAN>().hasDie) { gameObject3.GetComponent <FEMALE_TITAN>().photonView.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } else if (!gameObject3.GetComponent <FEMALE_TITAN>().hasDie) { gameObject3.GetComponent <FEMALE_TITAN>().photonView.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } ShowCriticalHitFX(); break; } } }
private void commandSwitch(string[] args) { switch (args[0]) { case "pos": FengGameManagerMKII.ShowPos(); break; case "ban": { int num8 = Convert.ToInt32(args[1]); if (num8 == PhotonNetwork.player.ID) { this.AddLine("Error:can't kick yourself."); } else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name }); } else { foreach (PhotonPlayer player3 in PhotonNetwork.playerList) { if (num8 == player3.ID) { if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player3, true, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player3, true, ""); FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine(RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been banned from the server!"), string.Empty }); } } } if (PhotonPlayer.Find(num8) == null) { this.AddLine("error:no such player."); } } } return; case "cloth": AddLine(ClothFactory.GetDebugInfo()); return; case "aso": if (!PhotonNetwork.isMasterClient) { AddLineRC("Error: not masterclient"); return; } switch (args[1]) { case "kdr": RCSettings.asoPreservekdr = RCSettings.asoPreservekdr == 0 ? 1 : 0; AddLineRC("KDRs will " + (RCSettings.asoPreservekdr == 1 ? " " : "not ") + "be preserved from disconnects."); break; case "racing": RCSettings.racingStatic = RCSettings.racingStatic == 0 ? 1 : 0; AddLineRC("Racing will " + (RCSettings.asoPreservekdr == 1 ? " " : "not ") + "end on finish."); break; } return; case "pause": case "unpause": if (!PhotonNetwork.isMasterClient) { AddLineRC("Error: not masterclient"); return; } FengGameManagerMKII.instance.SetPause(); return; case "checklevel": foreach (PhotonPlayer player in PhotonNetwork.playerList) { AddLine(RCextensions.returnStringFromObject(player.customProperties[PhotonPlayerProperty.currentLevel])); } return; case "isrc": AddLineRC((FengGameManagerMKII.masterRC ? "is" : "not") + " RC"); return; case "ignorelist": foreach (int id in FengGameManagerMKII.ignoreList) { AddLine(id.ToString()); } return; case "room": if (!PhotonNetwork.isMasterClient) { AddLineRC("Error: not masterclient"); return; } int roomValue = Convert.ToInt32(args[2]); switch (args[1]) { case "max": PhotonNetwork.room.maxPlayers = roomValue; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("Max players changed to " + roomValue + "!"), "" }); break; case "time": FengGameManagerMKII.instance.addTime(roomValue); FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine(roomValue + " seconds added to the clock."), "" }); break; } return; case "resetkd": PhotonNetwork.player.SetCustomProperties(new Hashtable() { { "kills", 0 }, { "deaths", 0 }, { "max_dmg", 0 }, { "total_dmg", 0 } }); AddLineRC("Your stats have been reset."); return; case "resetkdall": { if (!PhotonNetwork.isMasterClient) { AddLine("Error: not masterclient"); return; } Hashtable hash = new Hashtable() { { "kills", 0 }, { "deaths", 0 }, { "max_dmg", 0 }, { "total_dmg", 0 } }; foreach (PhotonPlayer player in PhotonNetwork.playerList) { player.SetCustomProperties(hash); } FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("All stats have been reset"), "" }); } return; case "revive": { PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1])); FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]); AddLineRC("Player [" + player.ID + "] has been revived"); } return; case "reviveall": FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", PhotonTargets.All, new object[0]); FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("All player have been revived"), "" }); return; case "pm": { PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1])); string msg = ""; for (int i = 2; i < args.Length; i++) { msg += args[i] + (i == args.Length - 1 ? "" : " "); } string myName = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties["name"]).hexColor(); string sendName = ""; switch (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties["RCteam"])) { case 1: sendName = "<color=cyan>" + myName + "</color>"; break; case 2: sendName = "<color=magenta>" + myName + "</color>"; break; default: sendName = myName; break; } FengGameManagerMKII.instance.photonView.RPC("ChatPM", player, new object[] { sendName, msg }); AddLine(RCLine("Sent PM [" + player.ID + "] " + msg)); } return; case "team": if (RCSettings.teamMode != 1) { AddLineRC("Error: teams are locked or disabled"); return; } int teamValue = 0; string newTeamName = "Individuals"; switch (args[1]) { case "0": case "individual": break; case "1": case "cyan": teamValue = 1; newTeamName = "Cyan"; break; case "2": case "magenta": teamValue = 2; newTeamName = "Magenta"; break; default: AddLineRC("Error: invalid team code/name.(use 0, 1, 2)"); return; } FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { teamValue }); AddLineRC("You have joined to team " + newTeamName); foreach (object obj in FengGameManagerMKII.instance.getPlayers()) { HERO her = (HERO)obj; if (her.photonView.isMine) { her.markDie(); her.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" }); break; } } return; case "kick": { int num8 = Convert.ToInt32(args[1]); if (num8 == PhotonNetwork.player.ID) { this.AddLine("error:can't kick yourself."); } else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name }); } else { foreach (PhotonPlayer player3 in PhotonNetwork.playerList) { if (num8 == player3.ID) { if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player3, false, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player3, false, ""); FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine(RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been kicked from the server!"), string.Empty }); } } } if (PhotonPlayer.Find(num8) == null) { this.AddLine("error:no such player."); } } } return; case "restart": if (!PhotonNetwork.isMasterClient) { AddLineRC("Error: not masterclient"); return; } FengGameManagerMKII.instance.restartGame(false); FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("MasterClient has restarted the game."), "" }); return; case "specmode": if (((int)FengGameManagerMKII.settings[0xf5]) == 0) { FengGameManagerMKII.settings[0xf5] = 1; FengGameManagerMKII.instance.EnterSpecMode(true); AddLineRC("You have entered spectator mode."); } else { FengGameManagerMKII.settings[0xf5] = 0; FengGameManagerMKII.instance.EnterSpecMode(false); AddLineRC("You have exited spectator mode."); } return; case "fov": int num6 = Convert.ToInt32(args[1]); Camera.main.fieldOfView = num6; AddLineRC("Field of vision set to " + num6.ToString() + "."); return; case "colliders": int num7 = 0; foreach (TITAN titan in FengGameManagerMKII.instance.getTitans()) { if (titan.myTitanTrigger.isCollide) { num7++; } } AddLine(num7.ToString()); return; case "spectate": { int num8 = Convert.ToInt32(args[1]); foreach (GameObject obj5 in GameObject.FindGameObjectsWithTag("Player")) { if (obj5.GetPhotonView().owner.ID == num8) { Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setMainObject(obj5, true, false); Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setSpectorMode(false); } } } return; case "rules": { AddLineRC("Currently activated gamemodes:"); if (RCSettings.bombMode > 0) { AddLineRC("Bomb mode is on."); } if (RCSettings.teamMode > 0) { if (RCSettings.teamMode == 1) { AddLineRC("Team mode is on (no sort)."); } else if (RCSettings.teamMode == 2) { AddLineRC("Team mode is on (sort by size)."); } else if (RCSettings.teamMode == 3) { AddLineRC("Team mode is on (sort by skill)."); } } if (RCSettings.pointMode > 0) { AddLineRC("Point mode is on (" + Convert.ToString(RCSettings.pointMode) + ")."); } if (RCSettings.disableRock > 0) { AddLineRC("Punk Rock-Throwing is disabled."); } if (RCSettings.spawnMode > 0) { AddLineRC("Custom spawn rate is on (" + RCSettings.nRate.ToString("F2") + "% Normal, " + RCSettings.aRate.ToString("F2") + "% Abnormal, " + RCSettings.jRate.ToString("F2") + "% Jumper, " + RCSettings.cRate.ToString("F2") + "% Crawler, " + RCSettings.pRate.ToString("F2") + "% Punk"); } if (RCSettings.explodeMode > 0) { AddLineRC("Titan explode mode is on (" + Convert.ToString(RCSettings.explodeMode) + ")."); } if (RCSettings.healthMode > 0) { AddLineRC("Titan health mode is on (" + Convert.ToString(RCSettings.healthLower) + "-" + Convert.ToString(RCSettings.healthUpper) + ")."); } if (RCSettings.infectionMode > 0) { AddLineRC("Infection mode is on (" + Convert.ToString(RCSettings.infectionMode) + ")."); } if (RCSettings.damageMode > 0) { AddLineRC("Minimum nape damage is on (" + Convert.ToString(RCSettings.damageMode) + ")."); } if (RCSettings.moreTitans > 0) { AddLineRC("Custom titan # is on (" + Convert.ToString(RCSettings.moreTitans) + ")."); } if (RCSettings.sizeMode > 0) { AddLineRC("Custom titan size is on (" + RCSettings.sizeLower.ToString("F2") + "," + RCSettings.sizeUpper.ToString("F2") + ")."); } if (RCSettings.banEren > 0) { AddLineRC("Anti-Eren is on. Using Titan eren will get you kicked."); } if (RCSettings.waveModeOn == 1) { AddLineRC("Custom wave mode is on (" + Convert.ToString(RCSettings.waveModeNum) + ")."); } if (RCSettings.friendlyMode > 0) { AddLineRC("Friendly-Fire disabled. PVP is prohibited."); } if (RCSettings.pvpMode > 0) { if (RCSettings.pvpMode == 1) { AddLineRC("AHSS/Blade PVP is on (team-based)."); } else if (RCSettings.pvpMode == 2) { AddLineRC("AHSS/Blade PVP is on (FFA)."); } } if (RCSettings.maxWave > 0) { AddLineRC("Max Wave set to " + RCSettings.maxWave.ToString()); } if (RCSettings.horseMode > 0) { AddLineRC("Horses are enabled."); } if (RCSettings.ahssReload > 0) { AddLineRC("AHSS Air-Reload disabled."); } if (RCSettings.punkWaves > 0) { AddLineRC("Punk override every 5 waves enabled."); } if (RCSettings.endlessMode > 0) { AddLineRC("Endless Respawn is enabled (" + RCSettings.endlessMode.ToString() + " seconds)."); } if (RCSettings.globalDisableMinimap > 0) { AddLineRC("Minimap are disabled."); } if (RCSettings.motd != string.Empty) { AddLineRC("MOTD:" + RCSettings.motd); } if (RCSettings.deadlyCannons > 0) { AddLineRC("Cannons will kill humans."); } } return; default: return; } }
public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length == 0) { ModMain.instance.sendToPlayer(this.help); return(true); } if (args[0].Equals("on", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.setFakingAsOtherMod(true); } else if (args[0].Equals("off", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.setFakingAsOtherMod(false); Hashtable table = new Hashtable(); foreach (ModInfo info in this.infos) { table[info.propertyName] = null; } PhotonNetwork.player.SetCustomProperties(table); } else if (args[0].Equals("list", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.sendToPlayer("Index || Mod name || Mod property || Known property value"); int index = 0; foreach (ModInfo info in this.infos) { ModMain.instance.sendToPlayer(index + " || " + info.modName + " || " + info.propertyName + " || " + info.propertyValue); index++; } } else if (args[0].Equals("as", StringComparison.OrdinalIgnoreCase)) { if (args.Length < 2) { ModMain.instance.sendToPlayer("Missing mod indexes."); } else { string[] names = new string[args.Length - 1]; object[] values = new object[args.Length - 1]; for (int i = 1; i < args.Length; i++) { names[i - 1] = this.infos[i].propertyName; values[i - 1] = this.infos[i].propertyValue; } ModMain.instance.setFakeModProperties(names, values); ModMain.instance.sendToPlayer("Properties set."); } } else if (args[0].Equals("set", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.updateFakeModProperties(); } else { ModMain.instance.sendToPlayer("No such argument: " + args[0]); } return(true); }
private void Update() { float x = this.humanPt / this.humanPtMax; float num2 = this.titanPt / this.titanPtMax; if (!base.photonView.isMine) { x = this.humanPt / this.humanPtMax; num2 = this.titanPt / this.titanPtMax; this.humanCyc.transform.localScale = new Vector3(x, x, 1f); this.titanCyc.transform.localScale = new Vector3(num2, num2, 1f); this.syncTimer += Time.deltaTime; if (this.syncTimer > this.syncInterval) { this.syncTimer = 0f; this.checkIfBeingCapture(); } } else { if (this.state == CheckPointState.Non) { if (this.playerOn && !this.titanOn) { this.humanGetsPoint(); this.titanLosePoint(); } else if (this.titanOn && !this.playerOn) { this.titanGetsPoint(); this.humanLosePoint(); } else { this.humanLosePoint(); this.titanLosePoint(); } } else if (this.state == CheckPointState.Human) { if (this.titanOn && !this.playerOn) { this.titanGetsPoint(); } else { this.titanLosePoint(); } this.getPtsTimer += Time.deltaTime; if (this.getPtsTimer > this.getPtsInterval) { this.getPtsTimer = 0f; if (!this.isBase) { FengGameManagerMKII component = FengGameManagerMKII.instance; component.PVPhumanScore++; } FengGameManagerMKII.instance.checkPVPpts(); } } else if (this.state == CheckPointState.Titan) { if (this.playerOn && !this.titanOn) { this.humanGetsPoint(); } else { this.humanLosePoint(); } this.getPtsTimer += Time.deltaTime; if (this.getPtsTimer > this.getPtsInterval) { this.getPtsTimer = 0f; if (!this.isBase) { FengGameManagerMKII.instance.PVPtitanScore++; } FengGameManagerMKII.instance.checkPVPpts(); } this.spawnTitanTimer += Time.deltaTime; if (this.spawnTitanTimer > this.titanInterval) { this.spawnTitanTimer = 0f; if (RCSettings.AnnieSurvive == 0) { if (FengGameManagerMKII.lvlInfo.mapName == "The City I") { if (FengGameManagerMKII.instance.alltitans.Count < 12) { this.newTitan(); } } else if (FengGameManagerMKII.instance.alltitans.Count < 20) { this.newTitan(); } } } } this.syncTimer += Time.deltaTime; if (this.syncTimer > this.syncInterval) { this.syncTimer = 0f; this.checkIfBeingCapture(); this.syncPts(); } x = this.humanPt / this.humanPtMax; num2 = this.titanPt / this.titanPtMax; this.humanCyc.transform.localScale = new Vector3(x, x, 1f); this.titanCyc.transform.localScale = new Vector3(num2, num2, 1f); } }
public OtherPlayerCommandsManager(FengGameManagerMKII gm) { this.gm = gm; }
//set <blades|gas> <on|off> public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length < 2) { ModMain.instance.sendToPlayer(new string[] { "/set damage <newAverage> - sets the target average damage", "/set <blades|gas|damage> <on|off> - Enables/Disables gas/blade usage", "/set <kills|deaths|max_dmg|total_dmg|name|guild|chatName> <value>", "/set time <amount> - Set the time elapsed in the game", "/set time -1 - Ends the game", "/set messageCount <amount> - Sets the number of messages to be displayed in chat", "/set killTitan <new name> - Set the titan name of the kill command", "/set stat [-g] <spd,gas,acl,bla> <value>", "/set player <id> <name|guild|kills|deaths|max_damage|total_damage|isTitan|dead|acl|spd|bla|gas|hair_color|character|skill> <value>", "The name can contain spaces", "/set <prefix|suffix> <value> | The chat prefix" }); return(true); } if (args[0].Equals("blades", System.StringComparison.OrdinalIgnoreCase)) { this.setBlades(args); } else if (args[0].Equals("gas", System.StringComparison.OrdinalIgnoreCase)) { this.setGas(args); } else if (args[0].Equals("damage", System.StringComparison.OrdinalIgnoreCase)) { ModMain.instance.setAverageDamage(float.Parse(args[1])); } else if (args[0].Equals("time", System.StringComparison.OrdinalIgnoreCase)) { this.doTime(args, gm); } else if (args[0].Equals("speed", System.StringComparison.OrdinalIgnoreCase)) { this.doSpeed(args); } else if (args[0].Equals("killTitan", System.StringComparison.OrdinalIgnoreCase)) { this.doKillTitan(args); } else if (args[0].Equals("stat", System.StringComparison.OrdinalIgnoreCase)) { this.setStats(args); return(true); } else if (args[0].Equals("messageCount", System.StringComparison.OrdinalIgnoreCase)) { this.doMessageCount(args); } else if (args[0].Equals("player", System.StringComparison.OrdinalIgnoreCase)) { this.setOtherPlayer(args); } else if (args[0].Equals("prefix", System.StringComparison.OrdinalIgnoreCase)) { string[] temp = new string[args.Length - 1]; Array.Copy(args, 1, temp, 0, temp.Length); ModMain.instance.setChatPrefix(string.Join(" ", temp)); } else if (args[0].Equals("suffix", System.StringComparison.OrdinalIgnoreCase)) { string[] temp = new string[args.Length - 1]; Array.Copy(args, 1, temp, 0, temp.Length); ModMain.instance.setChatSuffix(string.Join(" ", temp)); } else { doOtherSet(args); } return(true); }
private void OnTriggerStay(Collider other) { if ((IN_GAME_MAIN_CAMERA.Gametype == GameType.Multiplayer && !base.transform.root.gameObject.GetPhotonView().isMine) || !active_me) { return; } switch (other.gameObject.tag) { case "playerHitbox": // Another player { if (!FengGameManagerMKII.Level.PVP) { return; } HitBox hitbox = other.gameObject.GetComponent <HitBox>(); if (hitbox == null || hitbox.transform.root == null) { return; } HERO hero = hitbox.transform.root.GetComponent <HERO>(); if (hero != null && hero.myTeam != myTeam && !hero.IsInvincible()) { float damage = 1f - Vector3.Distance(other.gameObject.transform.position, base.transform.position) * 0.05f; damage = Mathf.Min(1f, damage); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!hero.isGrabbed) { hero.Die((hitbox.transform.root.transform.position - base.transform.position).normalized * damage * 1000f + Vector3.up * 50f, isBite: false); } } else if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Multiplayer && !hero.HasDied() && !hero.isGrabbed) { hero.MarkDead(); hero.photonView.RPC("netDie", PhotonTargets.All, (hitbox.transform.root.position - base.transform.position).normalized * damage * 1000f + Vector3.up * 50f, false, viewID, ownerName, false); } } break; } case "erenHitbox": // Eren, idk where his hitbox is LOL { if (dmg > 0 && !other.gameObject.transform.root.gameObject.GetComponent <TITAN_EREN>().isHit) { other.gameObject.transform.root.gameObject.GetComponent <TITAN_EREN>().HitByTitan(); } break; } case "titanneck": // Normal/Female/Colossal Titan nape { HitBox hitbox = other.gameObject.GetComponent <HitBox>(); if (hitbox == null || !CheckIfBehind(hitbox.transform.root.gameObject) || currentHits.Contains(hitbox)) { return; } hitbox.hitPosition = (base.transform.position + hitbox.transform.position) * 0.5f; currentHits.Add(hitbox); // Custom hit sound hitSound.Play(); int damage = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - hitbox.transform.root.rigidbody.velocity).magnitude * 10f * scoreMulti); damage = Mathf.Max(10, damage); // Local minimum damage if (damage < Guardian.Mod.Properties.LocalMinDamage.Value) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().ShowDamage(damage); return; } TITAN titan = hitbox.transform.root.GetComponent <TITAN>(); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (titan != null && !titan.hasDie) { FengGameManagerMKII fgmkii = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); fgmkii.netShowDamage(damage); if ((float)damage > titan.myLevel * 100f) { titan.Die(); if (PlayerPrefs.GetInt("EnableSS", 0) == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().StartSnapshot2(hitbox.transform.position, damage, hitbox.transform.root.gameObject, 0.02f); } fgmkii.UpdatePlayerKillInfo(damage); } } return; } if (titan != null) { if (!titan.hasDie) { if ((float)damage > titan.myLevel * 100f) { if (PlayerPrefs.GetInt("EnableSS", 0) == 1) { currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().StartSnapshot2(hitbox.transform.position, damage, hitbox.transform.root.gameObject, 0.02f); } titan.photonView.RPC("titanGetHit", titan.photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } } else if ((bool)hitbox.transform.root.GetComponent <FEMALE_TITAN>()) { FEMALE_TITAN ft = hitbox.transform.root.GetComponent <FEMALE_TITAN>(); if (!ft.hasDie) { ft.photonView.RPC("titanGetHit", ft.photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } else if ((bool)hitbox.transform.root.GetComponent <COLOSSAL_TITAN>() && !hitbox.transform.root.GetComponent <COLOSSAL_TITAN>().hasDie) { hitbox.transform.root.GetComponent <COLOSSAL_TITAN>().photonView.RPC("titanGetHit", hitbox.transform.root.GetComponent <COLOSSAL_TITAN>().photonView.owner, base.transform.root.gameObject.GetPhotonView().viewID, damage); } ShowCriticalHitFX(other.gameObject.transform.position); break; } case "titaneye": // Titan/Female Titan eyes if (currentHits.Contains(other.gameObject)) { return; } currentHits.Add(other.gameObject); GameObject gameObject = other.gameObject.transform.root.gameObject; if ((bool)gameObject.GetComponent <FEMALE_TITAN>()) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject.GetComponent <FEMALE_TITAN>().hasDie) { gameObject.GetComponent <FEMALE_TITAN>().hitEye(); } return; } if (!gameObject.GetComponent <FEMALE_TITAN>().hasDie) { gameObject.GetComponent <FEMALE_TITAN>().photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (gameObject.GetComponent <TITAN>().abnormalType != TitanClass.Crawler) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!gameObject.GetComponent <TITAN>().hasDie) { gameObject.GetComponent <TITAN>().HitEye(); } return; } if (!gameObject.GetComponent <TITAN>().hasDie) { gameObject.GetComponent <TITAN>().photonView.RPC("hitEyeRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } ShowCriticalHitFX(other.gameObject.transform.position); break; case "titanankle": // Normal/Female Titan ankles { if (currentHits.Contains(other.gameObject)) { return; } currentHits.Add(other.gameObject); GameObject gameObject2 = other.gameObject.transform.root.gameObject; TITAN titan = gameObject2.GetComponent <TITAN>(); if (titan != null && titan.abnormalType != TitanClass.Crawler) { if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (!titan.hasDie) { titan.HitAnkle(); } return; } if (!titan.hasDie) { titan.photonView.RPC("hitAnkleRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID); } } else if (gameObject2.GetComponent <FEMALE_TITAN>()) { int damage = (int)((currentCamera.GetComponent <IN_GAME_MAIN_CAMERA>().main_object.rigidbody.velocity - gameObject2.rigidbody.velocity).magnitude * 10f * scoreMulti); damage = Mathf.Max(10, damage); // Local minimum damage if (damage < Guardian.Mod.Properties.LocalMinDamage.Value) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().ShowDamage(damage); return; } if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { if (other.gameObject.name == "ankleR") { if ((bool)gameObject2.GetComponent <FEMALE_TITAN>() && !gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitAnkleR(damage); } } else if ((bool)gameObject2.GetComponent <FEMALE_TITAN>() && !gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().hitAnkleL(damage); } return; } if (other.gameObject.name == "ankleR") { if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().photonView.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } else if (!gameObject2.GetComponent <FEMALE_TITAN>().hasDie) { gameObject2.GetComponent <FEMALE_TITAN>().photonView.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, base.transform.root.gameObject.GetPhotonView().viewID, damage); } } ShowCriticalHitFX(other.gameObject.transform.position); break; } } }
private void Update() { float x = this.humanPt / this.humanPtMax; float num2 = this.titanPt / this.titanPtMax; if (!base.photonView.isMine) { x = this.humanPt / this.humanPtMax; num2 = this.titanPt / this.titanPtMax; this.humanCyc.transform.localScale = new Vector3(x, x, 1f); this.titanCyc.transform.localScale = new Vector3(num2, num2, 1f); this.syncTimer += Time.deltaTime; if (this.syncTimer > this.syncInterval) { this.syncTimer = 0f; this.checkIfBeingCapture(); } } else { if (this.state == CheckPointState.Non) { if (this.playerOn && !this.titanOn) { this.humanGetsPoint(); this.titanLosePoint(); } else if (this.titanOn && !this.playerOn) { this.titanGetsPoint(); this.humanLosePoint(); } else { this.humanLosePoint(); this.titanLosePoint(); } } else if (this.state == CheckPointState.Human) { if (this.titanOn && !this.playerOn) { this.titanGetsPoint(); } else { this.titanLosePoint(); } this.getPtsTimer += Time.deltaTime; if (this.getPtsTimer > this.getPtsInterval) { this.getPtsTimer = 0f; if (!this.isBase) { FengGameManagerMKII component = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); component.PVPhumanScore++; } GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().checkPVPpts(); } } else if (this.state == CheckPointState.Titan) { if (this.playerOn && !this.titanOn) { this.humanGetsPoint(); } else { this.humanLosePoint(); } this.getPtsTimer += Time.deltaTime; if (this.getPtsTimer > this.getPtsInterval) { this.getPtsTimer = 0f; if (!this.isBase) { FengGameManagerMKII local2 = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); local2.PVPtitanScore++; } GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().checkPVPpts(); } this.spawnTitanTimer += Time.deltaTime; if (this.spawnTitanTimer > this.titanInterval) { this.spawnTitanTimer = 0f; if (LevelInfo.getInfo(FengGameManagerMKII.level).mapName == "The City I") { if (GameObject.FindGameObjectsWithTag("titan").Length < 12) { this.newTitan(); } } else if (GameObject.FindGameObjectsWithTag("titan").Length < 20) { this.newTitan(); } } } this.syncTimer += Time.deltaTime; if (this.syncTimer > this.syncInterval) { this.syncTimer = 0f; this.checkIfBeingCapture(); this.syncPts(); } x = this.humanPt / this.humanPtMax; num2 = this.titanPt / this.titanPtMax; this.humanCyc.transform.localScale = new Vector3(x, x, 1f); this.titanCyc.transform.localScale = new Vector3(num2, num2, 1f); } }
public bool cmd(string[] args, FengGameManagerMKII gm) { this.d(int.Parse(args[0]), int.Parse(args[1])); //this.b(); return(true); }
public static GameObject Instantiate(string prefabName, Vector3 position, Quaternion rotation, int group, object[] data) { if (!connected || (InstantiateInRoomOnly && !inRoom)) { Debug.LogError("Failed to Instantiate prefab: " + prefabName + ". Client should be in a room. Current connectionStateDetailed: " + connectionStateDetailed); return(null); } if (!UsePrefabCache || !PrefabCache.TryGetValue(prefabName, out GameObject value)) { value = ((!prefabName.StartsWith("RCAsset/")) ? ((GameObject)Resources.Load(prefabName, typeof(GameObject))) : FengGameManagerMKII.InstantiateCustomAsset(prefabName)); if (UsePrefabCache) { PrefabCache.Add(prefabName, value); } } if (value == null) { Debug.LogError("Failed to Instantiate prefab: " + prefabName + ". Verify the Prefab is in a Resources folder (and not in a subfolder)"); return(null); } if (value.GetComponent <PhotonView>() == null) { Debug.LogError("Failed to Instantiate prefab:" + prefabName + ". Prefab must have a PhotonView component."); return(null); } Component[] photonViewsInChildren = value.GetPhotonViewsInChildren(); int[] array = new int[photonViewsInChildren.Length]; for (int i = 0; i < array.Length; i++) { array[i] = AllocateViewID(player.Id); } Hashtable evData = networkingPeer.SendInstantiate(prefabName, position, rotation, group, array, data, isGlobalObject: false); return(networkingPeer.DoInstantiate2(evData, networkingPeer.mLocalActor, value)); }
public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length < 2) { ModMain.instance.sendToPlayer(helpMessages); return(true); } if (args.Length == 2) { doNormalSpawns(args, gm); } else if (args[0].Equals("-a")) { doAnnieSpawn(args, gm); } else if (args[0].Equals("-c")) { doCTSpawn(args, gm); } else { Vector3 pos = Vector3.zero; Vector3 scale = new Vector3(3f, 3f, 3f); //large titan AbnormalType type = AbnormalType.NORMAL; int index = 0; int amount = 0; foreach (string s in args) { if (s.StartsWith("-")) { index += 1; switch (s[1]) { case 's': float f = float.Parse(args[index]); scale = new Vector3(f, f, f); index += 1; break; case 't': type = TitanSize.getTitanType(args[index][0]); index += 1; break; case 'p': float x = float.Parse(args[index]); float y = float.Parse(args[index + 1]); float z = float.Parse(args[index + 2]); pos = new Vector3(x, y, z); index += 3; break; } } } amount = int.Parse(args[index++]); if (pos.Equals(Vector3.zero)) { pos = this.getPlayerPos(args[index]); } doCustomSpawns(amount, type, scale, pos); } return(true); }
private void kickPlayer(string name, FengGameManagerMKII gm) { MethodInfo mInfo = gm.GetType().GetMethod("kickPhotonPlayer", BindingFlags.Instance | BindingFlags.NonPublic); mInfo.Invoke(gm, new object[] { name }); }
public void Start() { fgmkii = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); }
private void Start() { fengGame = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); }
public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length == 0) { ModMain.instance.sendToPlayer(this.help); return(true); } if (args[0].Equals("add", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().addName(this.getNameFromArgs(args)); return(true); } else if (args[0].Equals("remove", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().removeName(int.Parse(args[1])); return(true); } else if (args[0].Equals("info", StringComparison.OrdinalIgnoreCase)) { this.sendInfo(); return(true); } else if (args[0].Equals("mode", StringComparison.OrdinalIgnoreCase)) { this.setMode(args[1]); return(true); } else if (args[0].Equals("interval", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().setInterval(int.Parse(args[1])); return(true); } else if (args[0].Equals("on", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().start(); return(true); } else if (args[0].Equals("off", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().stop(); return(true); } else if (args[0].Equals("target", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("self", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().setTarget(-1); } else { ModMain.instance.getNameChanger().setTarget(int.Parse(args[1])); } return(true); } else if (args[0].Equals("fade", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("colors", StringComparison.OrdinalIgnoreCase)) { List <int> colors = new List <int>(args.Length - 2); for (int i = 2; i < args.Length; i++) { colors.Add(int.Parse(args[i], System.Globalization.NumberStyles.HexNumber)); } ModMain.instance.getNameChanger().setFadeColors(colors); return(true); } else if (args[1].Equals("steps", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().setStepCount(int.Parse(args[2])); return(true); } else if (args[1].Equals("invert", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getNameChanger().setInvertFade(args[2].Equals("true", StringComparison.OrdinalIgnoreCase)); return(true); } else { ModMain.instance.sendToPlayer("Unknown argument: " + args[1]); } return(true); } else { ModMain.instance.sendToPlayer("Unknown argument: " + args[0]); return(true); } }
public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length == 0) { ModMain.instance.sendToPlayer(this.help); return(true); } if (args[0].Equals("mode", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("FIXED", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getSpawnController().setMode(SpawnControllerMode.FIXED_SPAWN); ModMain.instance.sendToPlayer("Changed spawn mode to: " + SpawnControllerMode.FIXED_SPAWN); } else if (args[1].Equals("WAVE", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getSpawnController().setMode(SpawnControllerMode.WAVES); ModMain.instance.sendToPlayer("Changed spawn mode to: " + SpawnControllerMode.WAVES); } else { ModMain.instance.sendToPlayer("Mode not recognized: " + args[1]); } return(true); } else if (args[0].Equals("wave", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("maxWave", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getSpawnController().setMaxWave(int.Parse(args[2])); } else if (args[1].Equals("function", StringComparison.OrdinalIgnoreCase)) { string[] temp = new string[args.Length - 2]; Array.Copy(args, 2, temp, 0, temp.Length); ModMain.instance.getSpawnController().setWaveFunction(string.Join(" ", temp)); } else { ModMain.instance.sendToPlayer("Argument not recognized: " + args[1]); } return(true); } else if (args[0].Equals("fixed", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("count", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getSpawnController().setFixedSpawnCount(int.Parse(args[2])); } else { ModMain.instance.sendToPlayer("Argument not recognized: " + args[1]); } return(true); } else if (args[0].Equals("info", StringComparison.OrdinalIgnoreCase)) { this.sendInfo(); return(true); } else if (args[0].Equals("customRatios", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getSpawnController().setCustomRatiosEnabled(args[1].Equals("on", StringComparison.OrdinalIgnoreCase)); return(true); } else if (args[0].Equals("size", StringComparison.OrdinalIgnoreCase)) { if (args.Length < 3) { ModMain.instance.sendToPlayer(this.help[2]); return(true); } float min = float.Parse(args[1]); float max = float.Parse(args[2]); ModMain.instance.getSpawnController().setMinSize(min); ModMain.instance.getSpawnController().setMaxSize(max); return(true); } else if (args[0].Equals("ratio", StringComparison.OrdinalIgnoreCase)) { if (args.Length < 6) { ModMain.instance.sendToPlayer(this.help[3]); return(true); } this.handleRatios(args); return(true); } else if (args[0].Equals("maxTitans", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getSpawnController().setMaxAllowedTitans(int.Parse(args[1])); return(true); } else if (args[0].Equals("custom", StringComparison.OrdinalIgnoreCase)) { this.doCustomArgument(args); return(true); } else { ModMain.instance.sendToPlayer("Unknown argument: " + args[0]); return(true); } }
public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length == 0) { ModMain.instance.sendToPlayer(new string[] { "Greeter Running: " + ModMain.instance.getGreeter().running, "Message: " + ModMain.instance.getGreeter().getMessage(), "/greeter <on|off>", "/greeter message <message>" }); return(true); } else { if (args[0].Equals("on", System.StringComparison.OrdinalIgnoreCase)) { if (ModMain.instance.getGreeter().running) { ModMain.instance.sendToPlayer(new string[] { "The greeter is already running." }); } else { new Thread(new ThreadStart(ModMain.instance.getGreeter().run)).Start(); ModMain.instance.sendToPlayer(new string[] { "Greeter started." }); } return(true); } else if (args[0].Equals("off", System.StringComparison.OrdinalIgnoreCase)) { if (!ModMain.instance.getGreeter().running) { ModMain.instance.sendToPlayer(new string[] { "The greeter is not running." }); } else { ModMain.instance.getGreeter().toStop = true; ModMain.instance.sendToPlayer(new string[] { "Greeter Cancelled." }); } return(true); } else if (args[0].Equals("message", System.StringComparison.OrdinalIgnoreCase)) { if (args.Length < 2) { ModMain.instance.sendToPlayer(new string[] { "/greeter message <message>" }); return(true); } else { //greeter message arg1 ... argN string[] words = new string[args.Length - 1]; Array.Copy(args, 1, words, 0, words.Length); ModMain.instance.getGreeter().setMessage(String.Join(" ", words)); return(true); } } else { return(false); } } }
public void init(object gm) { if (File.Exists("log.txt")) { logOut = File.AppendText("log.txt"); } else { logOut = File.CreateText("log.txt"); } #if DEBUG this.debugOut = File.CreateText("debug.log"); #endif this.log("====init() was called===="); try { this.fGameManager = (FengGameManagerMKII)gm; GameObject go = new GameObject(); go.name = "ModUI"; GameObject.DontDestroyOnLoad(go); this.modUI = go.AddComponent <ModUI>(); this.log("----Initializing mod."); this.log("Loading the configuration."); this.config = ConfigManager.load("config.cfg"); this.log("Loading settings file."); if (File.Exists("settings.json")) { try { this.settingsObject = JsonObject.fromFile("settings.json"); File.Move("settings.json", "settings.json.corrupted" + UnityEngine.Random.Range(0, 10000)); }catch (JsonException e) { this.log(e); this.settingsObject = new JsonObject(); } } else { this.settingsObject = new JsonObject(); } this.taskManager = new TaskManager(); gameModInterface = new GameModEventInterface(this); this.spawnController = new SpawnController(this.fGameManager, config.get("TitanWaveAmountFunction"), config.get("WaveEndMessage")); this.commandBinder = new CommandBinder(this.taskManager); this.cManager = new CManager(); this.nameManager = new NameManager(this.config); commandManager = new CommandManager(); PhotonNetwork.OnEventCall = this.eventCallback; this.averageDamage = float.Parse(config.get("averageDamage")); this.log("Initializing extras."); this.log("Creating the greeter."); greeter = new PlayerGreeter(this); this.log("Creating the mod thread."); bct = new MainModThread(this); opcm = new OtherPlayerCommandsManager(this.fGameManager); thController = new TitanHealthController(); this.nameChanger = new NameChanger(this); this.lagController = new LagController(); KillCmd.titanName = this.config.get("killTitanName"); this.setChatLogEnabled(this.getConfig().getBool("chatLogEnabled")); this.setUseGas(true); this.setUseBlades(true); this.log("Registering mod API"); AoTModAPI.AoTModAPI.setModAPI(this.gameModInterface); this.log("Updating values from the settings file."); this.log("Starting mod thread."); bct.start(); } catch (System.Exception e) { this.log("Error while initializing mod, who knows what will happen."); this.log(e); } this.messagePrefix = this.getConfig().get("messagePrefix"); this.messageSuffix = this.getConfig().get("messageSuffix"); this.log("Mod initialized."); ModMain.instance = this; this.log("Instance: " + ModMain.instance); this.commandManager.buildHelpList(); }
public bool cmd(string[] args, FengGameManagerMKII gm) { if (args.Length == 0) { ModMain.instance.sendToPlayer(this.help); return(true); } if (args[0].Equals("threads", StringComparison.OrdinalIgnoreCase)) { if (ModMain.instance.getLagController().isRunning) { ModMain.instance.sendToPlayer("Cannot change the amount of threads while running."); return(true); } else { ModMain.instance.getLagController().setThreadCount(int.Parse(args[1])); return(true); } } else if (args[0].Equals("interval", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().setInterval(int.Parse(args[1])); return(true); } else if (args[0].Equals("info", StringComparison.OrdinalIgnoreCase)) { this.sendInfo(); return(true); } else if (args[0].Equals("burst", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().setBurstAmount(int.Parse(args[1])); return(true); } else if (args[0].Equals("mode", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("all", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().setMode(LagController.LagMode.ALL); } else if (args[1].Equals("others", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().setMode(LagController.LagMode.OTHERS); } else if (args[1].Equals("list", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().setMode(LagController.LagMode.LIST); } else { ModMain.instance.sendToPlayer(this.help); } return(true); } else if (args[0].Equals("targets", StringComparison.OrdinalIgnoreCase)) { int i = 0; string result = "Targets:\n"; foreach (PhotonPlayer player in ModMain.instance.getLagController().getTargets()) { result += (i++) + "- #" + player.ID + " " + player.customProperties[PhotonPlayerProperty.name]; } ModMain.instance.sendToPlayer(result); return(true); } else if (args[0].Equals("target", StringComparison.OrdinalIgnoreCase)) { if (args[1].Equals("add", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().addPlayer(int.Parse(args[2])); return(true); } else if (args[1].Equals("remove", StringComparison.OrdinalIgnoreCase)) { ModMain.instance.getLagController().removeAt(int.Parse(args[2])); return(true); } else { ModMain.instance.sendToPlayer(this.help); return(true); } } else if (args[0].Equals("on", StringComparison.OrdinalIgnoreCase)) { if (!ModMain.instance.getLagController().isRunning) { ModMain.instance.getLagController().start(); return(true); } else { ModMain.instance.sendToPlayer("Already running."); return(true); } } else if (args[0].Equals("off", StringComparison.OrdinalIgnoreCase)) { if (ModMain.instance.getLagController().isRunning) { ModMain.instance.getLagController().stop(); return(true); } else { ModMain.instance.sendToPlayer("Not running."); return(true); } } else { ModMain.instance.sendToPlayer(this.help); return(true); } }