public override void Execute(InRoomChat irc, string[] args) { if (args.Length > 0 && int.TryParse(args[0], out int id)) { PhotonPlayer player = PhotonPlayer.Find(id); if (player != null) { irc.AddLine($"Whois Report (#{player.Id})".WithColor("aaff00").AsBold()); irc.AddLine("Name: ".WithColor("ffcc00") + GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).Colored()); irc.AddLine("Guild: ".WithColor("ffcc00") + GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Guild]).Colored()); irc.AddLine("Status: ".WithColor("ffcc00") + (GExtensions.AsBool(player.customProperties[PhotonPlayerProperty.Dead]) ? "Dead" : "Alive")); int kills = GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.Kills]); int deaths = GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.Deaths]); irc.AddLine("Kills: ".WithColor("ffcc00") + kills); irc.AddLine("Deaths: ".WithColor("ffcc00") + deaths); irc.AddLine("K/D Ratio: ".WithColor("ffcc00") + (deaths == 0 ? kills : ((double)kills / (double)deaths)) + $" ({kills}:{deaths})"); irc.AddLine("Max Damage: ".WithColor("ffcc00") + GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.MaxDamage])); irc.AddLine("Total Damage: ".WithColor("ffcc00") + GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.TotalDamage])); string team = "Human (Blade)"; if (GameHelper.IsAHSS(player)) { team = "Human (AHSS)"; } else if (GameHelper.IsPT(player)) { team = "Player Titan"; } irc.AddLine("Team: ".WithColor("ffcc00") + team); } } }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length < 1 || !int.TryParse(args[0], out int id)) { return; } if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.ServerRequestUnban(id.ToString()); } else if (PhotonNetwork.isMasterClient) { if (!FengGameManagerMKII.BanHash.ContainsKey(id)) { return; } GameHelper.Broadcast($"{GExtensions.AsString(FengGameManagerMKII.BanHash[id])} has been unbanned.".AsColor("FFCC00")); FengGameManagerMKII.BanHash.Remove(id); } else { irc.AddLine("Command requires master client.".AsColor("FF0000")); } }
public void Explode(float radius) { disabled = true; base.rigidbody.velocity = Vector3.zero; Vector3 position = base.transform.position; myExplosion = PhotonNetwork.Instantiate("RCAsset/BombExplodeMain", position, Quaternion.Euler(0f, 0f, 0f), 0); foreach (HERO player in FengGameManagerMKII.Instance.heroes) { GameObject gameObject = player.gameObject; if (Vector3.Distance(gameObject.transform.position, position) < radius && !gameObject.GetPhotonView().isMine&& !player.bombImmune) { PhotonPlayer owner = gameObject.GetPhotonView().owner; if (RCSettings.TeamMode > 0 && PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCTeam] != null && owner.customProperties[PhotonPlayerProperty.RCTeam] != null) { int num = GExtensions.AsInt(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCTeam]); int num2 = GExtensions.AsInt(owner.customProperties[PhotonPlayerProperty.RCTeam]); if (num == 0 || num != num2) { gameObject.GetComponent <HERO>().MarkDead(); gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]) + " "); FengGameManagerMKII.Instance.UpdatePlayerKillInfo(0, PhotonNetwork.player); } } else { gameObject.GetComponent <HERO>().MarkDead(); gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]) + " "); FengGameManagerMKII.Instance.UpdatePlayerKillInfo(0, PhotonNetwork.player); } } } StartCoroutine(WaitAndFade(1.5f)); }
private void OnSelectionChange() { if (GExtensions.TryParseEnum(GetComponent <UIPopupList>().selection, out DayLight dayLight)) { IN_GAME_MAIN_CAMERA.Time = dayLight; } }
// Deadly hooks private void HandleHookToObj(int viewId) { PhotonView pv = PhotonView.Find(viewId); if (pv == null || !Guardian.Mod.Properties.DeadlyHooks.Value || !PhotonNetwork.isMasterClient) { return; } HERO hero = pv.gameObject.GetComponent <HERO>(); if (hero == null || hero.HasDied()) { return; } string killer = GExtensions.AsString(photonView.owner.customProperties[PhotonPlayerProperty.Name]); if (killer.StripNGUI().Length < 1) { killer = "Player"; } killer += $" [FFCC00]({photonView.owner.Id})[FFFFFF]"; hero.MarkDead(); hero.photonView.RPC("netDie2", pv.owner, -1, $"{killer}'s hook"); }
void OnPhotonCustomRoomPropertiesChanged(ExitGames.Client.Photon.Hashtable propertiesThatChanged) { NetworkPatches.OnRoomPropertyModification(propertiesThatChanged); if (!FirstJoin) { PhotonPlayer sender = null; if (propertiesThatChanged.ContainsKey("sender") && propertiesThatChanged["sender"] is PhotonPlayer) { sender = (PhotonPlayer)propertiesThatChanged["sender"]; } if (sender == null || sender.isMasterClient) { if (propertiesThatChanged.ContainsKey("Map") && propertiesThatChanged["Map"] is string && IsMultiMap) { LevelInfo levelInfo = LevelInfo.GetInfo((string)propertiesThatChanged["Map"]); if (levelInfo != null) { FengGameManagerMKII.Level = levelInfo; } } if (propertiesThatChanged.ContainsKey("Lighting") && propertiesThatChanged["Lighting"] is string) { if (GExtensions.TryParseEnum((string)propertiesThatChanged["Lighting"], out DayLight time)) { Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setDayLight(time); } } } } }
private void OnSelectionChange() { if (GExtensions.TryParseEnum(GetComponent <UIPopupList>().selection, out CameraType cameraType)) { IN_GAME_MAIN_CAMERA.CameraMode = cameraType; } PlayerPrefs.SetString("cameraType", GetComponent <UIPopupList>().selection); }
public override void Execute(InRoomChat irc, string[] args) { irc.AddLine("List of banned players:".WithColor("FFCC00")); foreach (int id in FengGameManagerMKII.BanHash.Keys) { irc.AddLine($"{id}: {GExtensions.AsString(FengGameManagerMKII.BanHash[id]).Colored()}"); } }
public void destroyMe() { if (disabled) { return; } disabled = true; GameObject gameObject = PhotonNetwork.Instantiate("FX/boom4", base.transform.position, base.transform.rotation, 0); EnemyCheckCollider[] componentsInChildren = gameObject.GetComponentsInChildren <EnemyCheckCollider>(); foreach (EnemyCheckCollider enemyCheckCollider in componentsInChildren) { enemyCheckCollider.dmg = 0; } if (RCSettings.DeadlyCannons == 1) { foreach (HERO hero in FengGameManagerMKII.Instance.Heroes) { if (hero != null && Vector3.Distance(hero.transform.position, base.transform.position) <= 20f && !hero.photonView.isMine) { PhotonPlayer owner = hero.photonView.owner; if (RCSettings.TeamMode > 0 && PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCTeam] != null && owner.customProperties[PhotonPlayerProperty.RCTeam] != null) { int num = GExtensions.AsInt(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCTeam]); int num2 = GExtensions.AsInt(owner.customProperties[PhotonPlayerProperty.RCTeam]); if (num == 0 || num != num2) { hero.MarkDead(); hero.photonView.RPC("netDie2", PhotonTargets.All, -1, GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]) + " "); FengGameManagerMKII.Instance.UpdatePlayerKillInfo(0, PhotonNetwork.player); } } else { hero.MarkDead(); hero.photonView.RPC("netDie2", PhotonTargets.All, -1, GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]) + " "); FengGameManagerMKII.Instance.UpdatePlayerKillInfo(0, PhotonNetwork.player); } } } } if (myTitanTriggers != null) { for (int j = 0; j < myTitanTriggers.Count; j++) { if (myTitanTriggers[j] != null) { myTitanTriggers[j].isCollide = false; } } } PhotonNetwork.Destroy(base.gameObject); }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length > 0) { string name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]).Colored(); if (name.Uncolored().Length <= 0) { name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]); } FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, Mod.HandleChat(string.Join(" ", args), name)); } }
public override void OnPlayerLeave(PhotonPlayer player) { if (GameOver || (player != PlayerOne && player != PlayerTwo)) { return; } GameOver = true; GameHelper.Broadcast($"{GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity().AsColor("FFFFFF")} forfeit!".AsColor("FF0000")); FengGameManagerMKII.Instance.FinishGame(); }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length < 1 || !int.TryParse(args[0], out int id)) { return; } PhotonPlayer player = PhotonPlayer.Find(id); if (player == null) { return; } irc.AddLine($"Whois Report (#{player.Id})".AsColor("AAFF00").AsBold()); irc.AddLine("Name: ".AsColor("FFCC00") + GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity()); irc.AddLine("Guild: ".AsColor("FFCC00") + GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Guild]).NGUIToUnity()); irc.AddLine("Status: ".AsColor("FFCC00") + (GExtensions.AsBool(player.customProperties[PhotonPlayerProperty.IsDead]) ? "Dead" : "Alive")); int kills = GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.Kills]); int deaths = GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.Deaths]); int totalDamage = GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.TotalDamage]); irc.AddLine("Kills: ".AsColor("FFCC00") + kills); irc.AddLine("Deaths: ".AsColor("FFCC00") + deaths); irc.AddLine("K/D Ratio: ".AsColor("FFCC00") + (deaths < 2 ? kills : (kills / (double)deaths)).ToString("F2") + $" ({kills}:{deaths})"); irc.AddLine("Max Damage: ".AsColor("FFCC00") + GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.MaxDamage])); irc.AddLine("Total Damage: ".AsColor("FFCC00") + totalDamage); irc.AddLine("Average Damage: ".AsColor("FFCC00") + (kills == 0 ? "n/a" : (totalDamage / kills).ToString())); float bombRadius = GExtensions.AsFloat(player.customProperties[PhotonPlayerProperty.RCBombRadius]); if (player.customProperties.ContainsKey(PhotonPlayerProperty.RCBombRadius)) { irc.AddLine("Bomb Radius: ".AsColor("FFCC00") + ((bombRadius - 20f) / 4f)); } string team = "Human (Blade)"; if (player.IsAhss) { team = "Human (AHSS)"; } else if (player.IsTitan) { team = "Player Titan"; } irc.AddLine("Team: ".AsColor("FFCC00") + team); }
public bool AreAllPlayersDead() { foreach (PhotonPlayer photonPlayer in PhotonNetwork.playerList) { if (GExtensions.AsInt(photonPlayer.customProperties[PhotonPlayerProperty.IsTitan]) == 1) { if (!GExtensions.AsBool(photonPlayer.customProperties[PhotonPlayerProperty.Dead])) { return(false); } } } return(true); }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length < 1) { return; } string name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity(); if (name.StripNGUI().Length < 1) { name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]); } FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, InRoomChat.FormatMessage(string.Join(" ", args), name)); }
void OnLevelWasLoaded(int level) { RenderSettings.haloStrength = 100; if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { string difficulty = "Training"; switch (IN_GAME_MAIN_CAMERA.Difficulty) { case 0: difficulty = "Normal"; break; case 1: difficulty = "Hard"; break; case 2: difficulty = "Abnormal"; break; } DiscordHelper.SetPresence(new Discord.Activity { Details = $"Playing in singleplayer.", State = $"{FengGameManagerMKII.Level.Name} / {difficulty}" }); } if (FirstJoin) { FirstJoin = false; string joinMessage = Properties.JoinMessage.Value.Colored(); if (joinMessage.Uncolored().Length <= 0) { joinMessage = Properties.JoinMessage.Value; } if (joinMessage.Length > 0) { string name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]).Colored(); if (name.Uncolored().Length <= 0) { name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]); } FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, HandleChat(joinMessage, name)); } } }
public void Start() { if (base.photonView == null) { return; } PhotonPlayer owner = base.photonView.owner; if (RCSettings.TeamMode > 0) { switch (GExtensions.AsInt(owner.customProperties[PhotonPlayerProperty.RCTeam])) { case 1: GetComponent <ParticleSystem>().startColor = Color.cyan; break; case 2: GetComponent <ParticleSystem>().startColor = Color.magenta; break; default: { float r = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombR]); float g = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombG]); float b = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombB]); float b2 = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombA]); b2 = Mathf.Max(0.5f, b2); GetComponent <ParticleSystem>().startColor = new Color(r, g, b, b2); break; } } } else { float r = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombR]); float g = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombG]); float b = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombB]); float b2 = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombA]); b2 = Mathf.Max(0.5f, b2); GetComponent <ParticleSystem>().startColor = new Color(r, g, b, b2); } float value = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombRadius]) * 2f; GetComponent <ParticleSystem>().startSize = Mathf.Clamp(value, 40f, 120f); }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length > 0 && GExtensions.TryParseEnum(args[0], out DayLight dayLight)) { if (PhotonNetwork.isMasterClient) { PhotonNetwork.room.SetCustomProperties(new ExitGames.Client.Photon.Hashtable { { "Lighting", args[0].ToUpper() } }); GameHelper.Broadcast($"The current map lighting is now {args[0].ToUpper()}!"); } else { Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setDayLight(dayLight); irc.AddLine($"Map lighting is now {args[0].ToUpper()}."); } } }
public override void OnPlayerKilled(HERO hero, int killerId, bool wasKilledByTitan) { if (GameOver || (hero.photonView.owner != PlayerOne && hero.photonView.owner != PlayerTwo)) { return; } GameOver = true; if (hero.photonView.owner == PlayerOne) { GameHelper.Broadcast($"{GExtensions.AsString(PlayerTwo.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity().AsColor("FFFFFF")} wins!".AsColor("AAFF00")); } else if (hero.photonView.owner == PlayerTwo) { GameHelper.Broadcast($"{GExtensions.AsString(PlayerOne.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity().AsColor("FFFFFF")} wins!".AsColor("AAFF00")); } FengGameManagerMKII.Instance.FinishGame(); }
public override void Execute(InRoomChat irc, string[] args) { List <string> guests = new List <string>(); foreach (PhotonPlayer player in PhotonNetwork.otherPlayers) { string name = GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]); if (GuestNamePattern.IsMatch(name)) { FengGameManagerMKII.Instance.KickPlayer(player, false, string.Empty); guests.Add(name); } } GameHelper.Broadcast($"Guest-Be-Gone kicked {guests.Count} guest(s)!"); if (guests.Count > 0) { GameHelper.Broadcast($"Guests kicked: " + string.Join(", ", guests.Select(name => name.NGUIToUnity()).ToArray())); } }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length < 1 || !int.TryParse(args[0], out int id)) { return; } PhotonPlayer player = PhotonPlayer.Find(id); if (player == null || player.isLocal || player.isMasterClient) { return; } if (!PhotonNetwork.isMasterClient && !FengGameManagerMKII.OnPrivateServer) { string name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity(); if (name.Length == 0) { name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]); } FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, "/kick #" + id, name); } else { string reason = args.Length > 1 ? string.Join(" ", args.CopyOfRange(1, args.Length)) : "Banned."; FengGameManagerMKII.Instance.KickPlayer(player, true, reason); if (FengGameManagerMKII.OnPrivateServer) { return; } GameHelper.Broadcast(GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).NGUIToUnity() + " has been banned!"); GameHelper.Broadcast($"Reason: \"{reason}\""); } }
public override void Execute(InRoomChat irc, string[] args) { if (args.Length > 0 && int.TryParse(args[0], out int id)) { if (id != PhotonNetwork.player.Id) { if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient)) { string name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]).Colored(); if (name == string.Empty) { name = GExtensions.AsString(PhotonNetwork.player.customProperties[PhotonPlayerProperty.Name]); } FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, "/kick #" + id, name); } else { PhotonPlayer player = PhotonPlayer.Find(id); if (player != null) { string reason = args.Length > 1 ? string.Join(" ", args.CopyOfRange(1, args.Length)) : "Kicked."; if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.Instance.KickPlayer(player, false, reason); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.Instance.KickPlayer(player, false, reason); FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).Colored() + " has been kicked from the server!".WithColor("FFCC00"), string.Empty); FengGameManagerMKII.Instance.photonView.RPC("Chat", PhotonTargets.All, $"Reason: {reason}".WithColor("FFCC00"), string.Empty); } } } } } }
public void Awake() { if (base.photonView == null) { return; } base.photonView.observed = this; correctPlayerPos = base.transform.position; correctPlayerRot = Quaternion.identity; PhotonPlayer owner = base.photonView.owner; if (RCSettings.TeamMode > 0) { switch (GExtensions.AsInt(owner.customProperties[PhotonPlayerProperty.RCTeam])) { case 1: GetComponent <ParticleSystem>().startColor = Color.cyan; return; case 2: GetComponent <ParticleSystem>().startColor = Color.magenta; return; } float r = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombR]); float g = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombG]); float b = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombB]); GetComponent <ParticleSystem>().startColor = new Color(r, g, b, 1f); } else { float r = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombR]); float g = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombG]); float b = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombB]); GetComponent <ParticleSystem>().startColor = new Color(r, g, b, 1f); } }
public static List <string> GetMods(PhotonPlayer player) { ExitGames.Client.Photon.Hashtable properties = player.customProperties; List <string> mods = new List <string>(); // Neko if (player.isNeko) { string userType = "[ffffff]"; if (player.isNekoUser) { userType += "(User)"; } if (player.isNekoOwner) { userType += "(Owner)"; } mods.Add($"[ee00ee][Neko{userType}]"); } // Fox if (player.isFoxMod) { mods.Add("[ff6600][Fox]"); } // Cyrus Essentials if (player.isCyrus) { mods.Add("[ffff00][CE]"); } // Anarchy if (player.isAnarchy) { mods.Add("[ffffff][Anarchy]"); } // KnK if (player.isKnK) { mods.Add("[ff0000][KnK]"); } // NRC if (player.isNRC) { mods.Add("[ffffff][NRC]"); } // TRAP if (player.isTrap) { mods.Add("[ee66ff][TRAP]"); } // RC83 if (player.isRC83) { mods.Add("[ffffff][RC83]"); } // Guardian (mine!!) if (properties.ContainsKey("GuardianMod") && properties["GuardianMod"] is int) { mods.Add($"[0099ff][Guardian]"); } if ((properties.ContainsKey("A.S Guard") && properties["A.S Guard"] is int) || (properties.ContainsKey("Allstar Mod") && properties["Allstar Mod"] is int)) { mods.Add("[ffffff][[ff0000]A[-]llStar]"); } // DogS if (properties.ContainsKey("dogshitmod") && GExtensions.AsString(properties["dogshitmod"]).Equals("dogshitmod")) { mods.Add("[ffffff][DogS]"); } // LNON if (properties.ContainsKey("LNON")) { mods.Add("[ffffff][LNON]"); } // Ignis if (properties.ContainsKey("Ignis")) { mods.Add("[ffffff][Ignis]"); } // PedoBear if (player.isPedoBear || properties.ContainsKey("PBModRC")) { mods.Add("[ffffff][[ff6600]P[553300]B[-][-]]"); } // Disciple if (properties.ContainsKey("DiscipleMod")) { mods.Add("[777777][Disciple]"); } // TLW if (properties.ContainsKey("TLW")) { mods.Add("[ffffff][TLW]"); } // ARC if (properties.ContainsKey("ARC-CREADOR")) { mods.Add("[ffffff][ARC (Creator)]"); } if (properties.ContainsKey("ARC")) { mods.Add("[ffffff][ARC]"); } // SRC if (properties.ContainsKey("SRC")) { mods.Add("[ffffff][SRC]"); } // Cyan Mod if (player.isCyan || properties.ContainsKey("CyanMod") || properties.ContainsKey("CyanModNew")) { mods.Add("[00ffff][Cyan Mod]"); } // Expedition if (player.isExpedition || properties.ContainsKey("ExpMod") || properties.ContainsKey("EMID") || properties.ContainsKey("Version") || properties.ContainsKey("Pref")) { string version = "[ffffff]v"; if (properties.ContainsKey("Version")) { version += GExtensions.AsFloat(properties["Version"]); } if (properties.ContainsKey("Pref")) { version += GExtensions.AsString(properties["Pref"]); } mods.Add($"[009900][Exp {version}[-]]"); } // Universe if (player.isUniverse || properties.ContainsKey("UPublica") || properties.ContainsKey("UPublica2") || properties.ContainsKey("UGrup") || properties.ContainsKey("Hats") || properties.ContainsKey("UYoutube") || properties.ContainsKey("UVip") || properties.ContainsKey("SUniverse") || properties.ContainsKey("UAdmin") || properties.ContainsKey("coins") || (properties.ContainsKey(string.Empty) && properties[string.Empty] is string)) { string edition = "[ffffff]"; if (properties.ContainsKey("UYoutube")) { edition += "(You[ff0000]Tube[-])"; } if (properties.ContainsKey("UVip")) { edition += "([ffcc00]VIP[-])"; } if (properties.ContainsKey("UAdmin")) { edition += "([ff0000]Admin[-])"; } mods.Add($"[aa00aa][Universe{edition}[-]]"); } // Teiko if (properties.ContainsKey("Teiko")) { mods.Add("[aed6f1][Teiko]"); } // SLB if (properties.ContainsKey("Wings") || properties.ContainsKey("EarCat") || properties.ContainsKey("Horns")) { mods.Add("[ffffff][SLB]"); } // Ranked RC if (player.isRankedRC || properties.ContainsKey("bronze") || properties.ContainsKey("diamond") || (properties.ContainsKey(string.Empty) && properties[string.Empty] is int)) { mods.Add("[ffffff][Ranked RC]"); } // DeadInside if (properties.ContainsKey("DeadInside")) { mods.Add("[000000][DeadInside]"); } // DFSAO if (properties.ContainsKey("DFSAO")) { mods.Add("[ffffff][DFSAO]"); } // AoE if (properties.ContainsKey("AOE") && GExtensions.AsString(properties["AOE"]).Equals("Made By Exile")) { mods.Add("[0000ff][AoE]"); } string name = GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]); string guild = GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Guild]); // Parrot if (guild.StartsWith("[00FF00]PARROT'S MOD")) { mods.Add("[00ff00][PARROT]"); } // Unknown if (player.isUnknown || properties.ContainsKey("Taquila") || properties.ContainsKey("Pain") || properties.ContainsKey("uishot")) { mods.Add("[ffffff][???]"); } // RC if (properties.ContainsKey(PhotonPlayerProperty.RCTeam) || properties.ContainsKey(PhotonPlayerProperty.RCBombR) || properties.ContainsKey(PhotonPlayerProperty.RCBombG) || properties.ContainsKey(PhotonPlayerProperty.RCBombB) || properties.ContainsKey(PhotonPlayerProperty.RCBombA) || properties.ContainsKey(PhotonPlayerProperty.RCBombRadius) || properties.ContainsKey(PhotonPlayerProperty.CustomBool) || properties.ContainsKey(PhotonPlayerProperty.CustomFloat) || properties.ContainsKey(PhotonPlayerProperty.CustomInt) || properties.ContainsKey(PhotonPlayerProperty.CustomString)) { mods.Add("[9999ff][RC]"); } // >48/>40 chars if (name.Length > 48 || guild.Length > 40) { string lengthFlags = string.Empty; if (name.Length > 48) { lengthFlags += ">48"; } if (guild.Length > 40) { lengthFlags += name.Length > 48 ? "|>40" : ">40"; } mods.Add($"[ffffff][{lengthFlags}]"); } // Vanilla if (mods.Count == 0) { mods.Add("[ffddaa][Vanilla]"); } return(mods); }
void OnLevelWasLoaded(int level) { ApplyCustomRenderSettings(); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer || PhotonNetwork.offlineMode) { string difficulty = IN_GAME_MAIN_CAMERA.Difficulty switch { 0 => "Normal", 1 => "Hard", 2 => "Abnormal", _ => "Training" }; DiscordRPC.SetPresence(new Discord.Activity { Details = $"Playing offline.", State = $"{FengGameManagerMKII.Level.Name} / {difficulty}" }); } if (PhotonNetwork.isMasterClient) { Gamemodes.CurrentMode.OnReset(); } if (HasJoinedRoom) { return; } HasJoinedRoom = true; string joinMessage = Properties.JoinMessage.Value.NGUIToUnity(); if (joinMessage.StripNGUI().Length < 1) { joinMessage = Properties.JoinMessage.Value; } if (joinMessage.Length < 1) { return; } Commands.Find("say").Execute(InRoomChat.Instance, joinMessage.Split(' ')); } void OnPhotonPlayerConnected(PhotonPlayer player) { if (PhotonNetwork.isMasterClient) { Gamemodes.CurrentMode.OnPlayerJoin(player); } Logger.Info($"({player.Id}) " + player.Username.NGUIToUnity() + " connected.".AsColor("00FF00")); } void OnPhotonPlayerDisconnected(PhotonPlayer player) { if (PhotonNetwork.isMasterClient) { Gamemodes.CurrentMode.OnPlayerLeave(player); } Logger.Info($"({player.Id}) " + player.Username.NGUIToUnity() + " disconnected.".AsColor("FF0000")); } void OnPhotonPlayerPropertiesChanged(object[] playerAndUpdatedProps) { NetworkChecker.OnPlayerPropertyModification(playerAndUpdatedProps); ModDetector.OnPlayerPropertyModification(playerAndUpdatedProps); } void OnPhotonCustomRoomPropertiesChanged(ExitGames.Client.Photon.Hashtable propertiesThatChanged) { NetworkChecker.OnRoomPropertyModification(propertiesThatChanged); PhotonPlayer sender = null; if (propertiesThatChanged.ContainsKey("sender") && propertiesThatChanged["sender"] is PhotonPlayer player) { sender = player; } if (sender != null && !sender.isMasterClient) { return; } if (propertiesThatChanged.ContainsKey("Map") && propertiesThatChanged["Map"] is string mapName) { LevelInfo levelInfo = LevelInfo.GetInfo(mapName); if (levelInfo != null) { FengGameManagerMKII.Level = levelInfo; } } if (propertiesThatChanged.ContainsKey("Lighting") && propertiesThatChanged["Lighting"] is string lightLevel && GExtensions.TryParseEnum(lightLevel, out DayLight time)) { Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().SetLighting(time); } } void OnJoinedLobby() { // TODO: Begin working on Friend system with Photon Friend API PhotonNetwork.playerName = Properties.PhotonUserId.Value; } void OnJoinedRoom() { HasJoinedRoom = false; // TODO: Potentially use custom event/group combo to sync game-settings whilst not triggering other mods int[] groups = new int[byte.MaxValue]; for (int i = 0; i < byte.MaxValue; i++) { groups[i] = i + 1; } PhotonNetwork.SetReceivingEnabled(groups, null); PhotonNetwork.SetSendingEnabled(groups, null); PhotonNetwork.player.SetCustomProperties(new ExitGames.Client.Photon.Hashtable { { CustomPropertyName, Build } }); StartCoroutine(CoUpdateMyPing()); string[] roomInfo = PhotonNetwork.room.name.Split('`'); if (roomInfo.Length < 7) { return; } DiscordRPC.SetPresence(new Discord.Activity { Details = $"Playing in {(roomInfo[5].Length < 1 ? string.Empty : "[PWD]")} {roomInfo[0].StripNGUI()}", State = $"({NetworkHelper.GetRegionCode().ToUpper()}) {roomInfo[1]} / {roomInfo[2].ToUpper()}" }); }
public void Start() { if (base.photonView == null) { return; } PhotonPlayer owner = base.photonView.owner; if (RCSettings.TeamMode > 0) { switch (GExtensions.AsInt(owner.customProperties[PhotonPlayerProperty.RCTeam])) { case 1: GetComponentInChildren <ParticleSystem>().startColor = Color.cyan; break; case 2: GetComponentInChildren <ParticleSystem>().startColor = Color.magenta; break; default: { float r = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombR]); float g = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombG]); float b = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombB]); float a = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombA]); a = Mathf.Max(0.5f, a); GetComponentInChildren <ParticleSystem>().startColor = new Color(r, g, b, a); break; } } } else { float r = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombR]); float g = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombG]); float b = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombB]); float a = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombA]); a = Mathf.Max(0.5f, a); GetComponentInChildren <ParticleSystem>().startColor = new Color(r, g, b, a); } float value = GExtensions.AsFloat(owner.customProperties[PhotonPlayerProperty.RCBombRadius]) * 2f; GetComponentInChildren <ParticleSystem>().startSize = Mathf.Clamp(value, 40f, 120f); if (PhotonNetwork.isMasterClient && Guardian.Mod.Properties.BombsKillTitans.Value) { foreach (TITAN titan in FengGameManagerMKII.Instance.Titans) { if ((titan.neck.position - base.transform.position).sqrMagnitude <= 400) // 20 units { if (titan.abnormalType == TitanClass.Crawler) { titan.DieBlow(base.transform.position, 0.2f); } else { titan.DieHeadBlow(base.transform.position, 0.2f); } string titanName = titan.name; if (titan.nonAI) { titanName = GExtensions.AsString(titan.photonView.owner.customProperties[PhotonPlayerProperty.Name]); } FengGameManagerMKII.Instance.SendKillInfo(false, GExtensions.AsString(base.photonView.owner.customProperties[PhotonPlayerProperty.Name]), true, titanName); FengGameManagerMKII.Instance.UpdatePlayerKillInfo(0, base.photonView.owner); break; } } } }
public bool CheckObject(string key, PhotonPlayer photonPlayer, int[] viewIDS) { if (!photonPlayer.isMasterClient && !photonPlayer.isLocal) { int num = photonPlayer.Id * PhotonNetwork.MAX_VIEW_IDS; int num2 = num + PhotonNetwork.MAX_VIEW_IDS; foreach (int num3 in viewIDS) { if (num3 <= num || num3 >= num2) { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning invalid photon view."); } return(false); } } key = key.ToLower(); switch (key) { case "rcasset/bombmain": case "rcasset/bombexplodemain": if (RCSettings.BombMode > 0) { return(Instantiated(photonPlayer, GameResource.Bomb)); } if (PhotonNetwork.isMasterClient && !FengGameManagerMKII.Instance.restartingBomb) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning bomb item (" + key + ")."); } return(false); case "hook": case "aottg_hero 1": return(Instantiated(photonPlayer, GameResource.General)); case "hitmeat2": return(Instantiated(photonPlayer, GameResource.BloodEffect)); case "hitmeat": case "redcross": case "redcross1": return(Instantiated(photonPlayer, GameResource.BladeHit)); case "fx/flarebullet1": case "fx/flarebullet2": case "fx/flarebullet3": return(Instantiated(photonPlayer, GameResource.Flare)); case "fx/shotgun": case "fx/shotgun 1": return(Instantiated(photonPlayer, GameResource.GunShot)); case "fx/fxtitanspawn": case "fx/boom1": case "fx/boom3": case "fx/boom5": case "fx/rockthrow": case "fx/bite": if (!FengGameManagerMKII.Level.PlayerTitans && RCSettings.InfectionMode <= 0 && FengGameManagerMKII.Level.Mode != GameMode.BOSS_FIGHT_CT) { if (PhotonNetwork.isMasterClient && !FengGameManagerMKII.Instance.restartingTitan) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: false, "spawning titan effects."); } return(false); } return(Instantiated(photonPlayer, GameResource.Effect)); case "fx/boom2": case "fx/boom4": case "fx/fxtitandie": case "fx/fxtitandie1": case "fx/boost_smoke": case "fx/thunder": return(Instantiated(photonPlayer, GameResource.Effect)); case "rcasset/cannonballobject": return(Instantiated(photonPlayer, GameResource.Bomb)); case "rcasset/cannonwall": case "rcasset/cannonground": if (PhotonNetwork.isMasterClient && !FengGameManagerMKII.Instance.allowedToCannon.ContainsKey(photonPlayer.Id) && !FengGameManagerMKII.Instance.restartingMC) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: false, "spawning cannon item (" + key + ")."); } return(Instantiated(photonPlayer, GameResource.General)); case "rcasset/cannonwallprop": case "rcasset/cannongroundprop": if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning MC item (" + key + ")."); } return(false); case "titan_eren": if (GExtensions.AsString(photonPlayer.customProperties[PhotonPlayerProperty.Character]).ToUpper() != "EREN") { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning titan eren (" + key + ")."); } return(false); } if (RCSettings.BanEren > 0) { if (PhotonNetwork.isMasterClient && !FengGameManagerMKII.Instance.restartingEren) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: false, "spawning titan eren (" + key + ")."); } return(false); } return(Instantiated(photonPlayer, GameResource.General)); case "fx/justSmoke": case "bloodexplore": case "bloodsplatter": return(Instantiated(photonPlayer, GameResource.Effect)); case "hitmeatbig": if (GExtensions.AsString(photonPlayer.customProperties[PhotonPlayerProperty.Character]).ToUpper() != "EREN") { if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning eren effect (" + key + ")."); } return(false); } if (RCSettings.BanEren > 0) { if (PhotonNetwork.isMasterClient && !FengGameManagerMKII.Instance.restartingEren) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: false, "spawning eren effect (" + key + ")."); } return(false); } return(Instantiated(photonPlayer, GameResource.Effect)); case "fx/colossal_steam_dmg": case "fx/colossal_steam": case "fx/boom1_ct_kick": if (PhotonNetwork.isMasterClient && FengGameManagerMKII.Level.Mode != GameMode.BOSS_FIGHT_CT) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning colossal effect (" + key + ")."); return(false); } return(Instantiated(photonPlayer, GameResource.Effect)); case "rock": if (PhotonNetwork.isMasterClient && FengGameManagerMKII.Level.Mode != GameMode.BOSS_FIGHT_CT) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning MC item (" + key + ")."); return(false); } return(Instantiated(photonPlayer, GameResource.General)); case "horse": if (!FengGameManagerMKII.Level.Horses && RCSettings.HorseMode == 0) { if (PhotonNetwork.isMasterClient && !FengGameManagerMKII.Instance.restartingHorse) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning horse (" + key + ")."); } return(false); } return(Instantiated(photonPlayer, GameResource.General)); case "titan_ver3.1": if (PhotonNetwork.isMasterClient) { if (!FengGameManagerMKII.Level.PlayerTitans && RCSettings.InfectionMode <= 0 && FengGameManagerMKII.Level.Mode != GameMode.BOSS_FIGHT_CT && !FengGameManagerMKII.Instance.restartingTitan) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: false, "spawning titan (" + key + ")."); return(false); } if (FengGameManagerMKII.Level.Mode != GameMode.BOSS_FIGHT_CT) { int num4 = 0; foreach (TITAN titan in FengGameManagerMKII.Instance.titans) { if (titan.photonView.owner == photonPlayer) { num4++; } } if (num4 > 1) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: false, "spawning titan (" + key + ")."); return(false); } } } else if (FengGameManagerMKII.MasterRC && FengGameManagerMKII.Level.Mode != GameMode.BOSS_FIGHT_CT) { int num4 = 0; foreach (TITAN titan2 in FengGameManagerMKII.Instance.titans) { if (titan2.photonView.owner == photonPlayer) { num4++; } } if (num4 > 1) { return(false); } } return(Instantiated(photonPlayer, GameResource.General)); case "colossal_titan": case "female_titan": case "titan_eren_trost": case "aot_supply": case "monsterprefab": case "titan_new_1": case "titan_new_2": if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.Instance.KickPlayer(photonPlayer, ban: true, "spawning MC item (" + key + ")."); return(false); } if (FengGameManagerMKII.MasterRC) { return(false); } return(Instantiated(photonPlayer, GameResource.General)); default: return(false); } } return(true); }
void OnPhotonPlayerDisconnected(PhotonPlayer player) { Logger.Info($"[{player.Id}] ".WithColor("FFCC00") + GExtensions.AsString(player.customProperties[PhotonPlayerProperty.Name]).Colored() + " disconnected.".WithColor("FF0000")); }
public static bool IsDead(PhotonPlayer player) { return(GExtensions.AsBool(player.customProperties[PhotonPlayerProperty.Dead])); }
public static bool IsAHSS(PhotonPlayer player) { return(GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.Team]) == 2); }
public static bool IsPT(PhotonPlayer player) { return(GExtensions.AsInt(player.customProperties[PhotonPlayerProperty.IsTitan]) == 2); }