AddLine() public method

public AddLine ( string newLine ) : void
newLine string
return void
Exemplo n.º 1
0
        public override void Execute(InRoomChat irc, string[] args)
        {
            if (RCSettings.TeamMode == 1)
            {
                if (args.Length < 1)
                {
                    return;
                }

                if (args[0].Equals("1") || args[0].Equals("cyan", StringComparison.OrdinalIgnoreCase))
                {
                    FengGameManagerMKII.Instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, 1);
                    irc.AddLine("You have joined team Cyan.".AsColor("00FFFF"));

                    HERO hero = PhotonNetwork.player.GetHero();
                    if (hero == null || hero.HasDied())
                    {
                        return;
                    }

                    hero.MarkDead();
                    hero.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                }
                else if (args[0].Equals("2") || args[0].Equals("magenta", StringComparison.OrdinalIgnoreCase))
                {
                    FengGameManagerMKII.Instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, 2);
                    irc.AddLine("You have joined team Magenta.".AsColor("FF00FF"));

                    HERO hero = PhotonNetwork.player.GetHero();
                    if (hero == null || hero.HasDied())
                    {
                        return;
                    }

                    hero.MarkDead();
                    hero.photonView.RPC("netDie2", PhotonTargets.All, -1, "Team Switch");
                }
                else if (args[0].Equals("0") || args[0].Equals("individual", StringComparison.OrdinalIgnoreCase))
                {
                    FengGameManagerMKII.Instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, 0);
                    irc.AddLine("You have joined team Individual.".AsColor("FFFFFF"));

                    HERO hero = PhotonNetwork.player.GetHero();
                    if (hero == null || hero.HasDied())
                    {
                        return;
                    }

                    hero.MarkDead();
                    hero.photonView.RPC("netDie2", PhotonTargets.All, -1, "Team Switch");
                }
                else
                {
                    irc.AddLine("Invalid team. Accepted values are 0, 1, and 2.".AsColor("FFCC00"));
                }
            }
            else
            {
                irc.AddLine("Teams are either locked or disabled.".AsColor("FFCC00"));
            }
        }
Exemplo n.º 2
0
        public override void Execute(InRoomChat irc, string[] args)
        {
            irc.AddLine("Currently activated gamemodes:".WithColor("ffcc00"));

            // Bomb Mode
            if (RCSettings.BombMode > 0)
            {
                irc.AddLine("PVP Bomb Mode enabled.".WithColor("ffcc00"));
            }

            // Team Mode
            if (RCSettings.TeamMode > 0)
            {
                string str = string.Empty;
                switch (RCSettings.TeamMode)
                {
                case 1:
                    str = "No sort";
                    break;

                case 2:
                    str = "Locked by Size";
                    break;

                case 3:
                    str = "Locked by Skill";
                    break;
                }
                irc.AddLine("Team Mode enabled</color> (" + str + ").".WithColor("ffcc00"));
            }

            // Point Limit
            if (RCSettings.PointMode > 0)
            {
                irc.AddLine($"Point Limit enabled ({RCSettings.PointMode}).".WithColor("ffcc00"));
            }

            if (RCSettings.DisableRock > 0)
            {
                irc.AddLine("Punk Rock-Throwing disabled.".WithColor("ffcc00"));
            }
            if (RCSettings.SpawnMode > 0)
            {
                irc.AddLine(("Custom spawn rate enabled (" + RCSettings.NormalRate.ToString("F2") + "% Normal, " + RCSettings.AberrantRate.ToString("F2") + "% Abnormal, " + RCSettings.JumperRate.ToString("F2") + "% Jumper, " + RCSettings.CrawlerRate.ToString("F2") + "% Crawler, " + RCSettings.PunkRate.ToString("F2") + "% Punk ").WithColor("ffcc00"));
            }
            if (RCSettings.ExplodeMode > 0)
            {
                irc.AddLine($"Titan explode mode enabled ({RCSettings.ExplodeMode}).".WithColor("ffcc00"));
            }
            if (RCSettings.HealthMode > 0)
            {
                irc.AddLine(("Titan health mode enabled (" + RCSettings.HealthLower + "-" + RCSettings.HealthUpper + ").").WithColor("ffcc00"));
            }
            if (RCSettings.InfectionMode > 0)
            {
                irc.AddLine($"Infection mode enabled ({RCSettings.InfectionMode}).".WithColor("ffcc00"));
            }
            if (RCSettings.DamageMode > 0)
            {
                irc.AddLine($"Minimum nape damage enabled ({RCSettings.DamageMode}).".WithColor("ffcc00"));
            }
            if (RCSettings.MoreTitans > 0)
            {
                irc.AddLine(("Custom titan # enabled (" + RCSettings.MoreTitans + ").").WithColor("ffcc00"));
            }
            if (RCSettings.SizeMode > 0)
            {
                irc.AddLine(("Custom titan size enabled (" + RCSettings.SizeLower.ToString("F2") + "," + RCSettings.SizeUpper.ToString("F2") + ").").WithColor("ffcc00"));
            }
            if (RCSettings.BanEren > 0)
            {
                irc.AddLine("Anti-Eren enabled. Using Titan Eren will get you kicked.".WithColor("ffcc00"));
            }
            if (RCSettings.WaveModeOn == 1)
            {
                irc.AddLine($"Custom wave mode enabled ({RCSettings.WaveModeNum}).".WithColor("ffcc00"));
            }
            if (RCSettings.FriendlyMode > 0)
            {
                irc.AddLine("Friendly-Fire disabled. PVP is prohibited.".WithColor("ffcc00"));
            }
            if (RCSettings.PvPMode > 0)
            {
                if (RCSettings.PvPMode == 1)
                {
                    irc.AddLine("AHSS/Blade PVP is on (team-based).".WithColor("ffcc00"));
                }
                else if (RCSettings.PvPMode == 2)
                {
                    irc.AddLine("AHSS/Blade PVP is on (FFA).".WithColor("ffcc00"));
                }
            }
            if (RCSettings.MaxWave > 0)
            {
                irc.AddLine($"Max Wave set to {RCSettings.MaxWave}".WithColor("ffcc00"));
            }
            if (RCSettings.HorseMode > 0)
            {
                irc.AddLine("Horses are enabled.".WithColor("ffcc00"));
            }
            if (RCSettings.AhssReload > 0)
            {
                irc.AddLine("AHSS Air-Reload disabled.".WithColor("ffcc00"));
            }
            if (RCSettings.PunkWaves > 0)
            {
                irc.AddLine("Punk override every 5 waves enabled.".WithColor("ffcc00"));
            }
            if (RCSettings.EndlessMode > 0)
            {
                irc.AddLine($"Endless Respawn is enabled ({RCSettings.EndlessMode}s).".WithColor("ffcc00"));
            }
            if (RCSettings.GlobalDisableMinimap > 0)
            {
                irc.AddLine("Minimaps are disabled.".WithColor("ffcc00"));
            }
            if (RCSettings.DeadlyCannons > 0)
            {
                irc.AddLine("Cannons will kill humans.".WithColor("ffcc00"));
            }

            // MOTD
            if (RCSettings.Motd != string.Empty)
            {
                irc.AddLine("MOTD: ".WithColor("ffcc00") + RCSettings.Motd);
            }
        }
Exemplo n.º 3
0
        public override void Execute(InRoomChat irc, string[] args)
        {
            irc.AddLine("Currently activated gamemodes:".AsColor("FFCC00"));

            // Bomb Mode
            if (RCSettings.BombMode > 0)
            {
                irc.AddLine("PVP Bomb Mode enabled.".AsColor("FFCC00"));
            }

            // Global Minimap Disable
            if (RCSettings.GlobalDisableMinimap > 0)
            {
                irc.AddLine("Minimaps are disabled.".AsColor("FFCC00"));
            }

            // Horses
            if (RCSettings.HorseMode > 0)
            {
                irc.AddLine("Horses are enabled.".AsColor("FFCC00"));
            }

            // Punk Waves
            if (RCSettings.PunkWaves > 0)
            {
                irc.AddLine("Punk override every 5 waves enabled.".AsColor("FFCC00"));
            }

            // AHSS Air-Reload
            if (RCSettings.AhssReload > 0)
            {
                irc.AddLine("AHSS Air-Reload disabled.".AsColor("FFCC00"));
            }

            // Team Sorting
            if (RCSettings.TeamMode > 0)
            {
                string str = string.Empty;
                switch (RCSettings.TeamMode)
                {
                case 1:
                    str = "No sort";
                    break;

                case 2:
                    str = "Locked by Size";
                    break;

                case 3:
                    str = "Locked by Skill";
                    break;
                }

                irc.AddLine("Team Mode enabled (".AsColor("FFCC00") + str + ").".AsColor("FFCC00"));
            }

            // Point Limit
            if (RCSettings.PointMode > 0)
            {
                irc.AddLine("Point Limit enabled (".AsColor("FFCC00") + RCSettings.PointMode + ").".AsColor("FFCC00"));
            }

            // Punk Rocks
            if (RCSettings.DisableRock > 0)
            {
                irc.AddLine("Punk Rock-Throwing disabled.".AsColor("FFCC00"));
            }

            // Titan Explode
            if (RCSettings.ExplodeMode > 0)
            {
                irc.AddLine("Titan explode mode enabled (".AsColor("FFCC00")
                            + RCSettings.ExplodeMode + ").".AsColor("FFCC00"));
            }

            // Titan Health
            if (RCSettings.HealthMode > 0)
            {
                irc.AddLine("Titan health mode enabled (".AsColor("FFCC00")
                            + RCSettings.HealthLower + "-".AsColor("FFCC00")
                            + RCSettings.HealthUpper + ").".AsColor("FFCC00"));
            }

            // Infection
            if (RCSettings.InfectionMode > 0)
            {
                irc.AddLine("Infection mode enabled (".AsColor("FFCC00") + RCSettings.InfectionMode + ").".AsColor("FFCC00"));
            }

            // Anti-Eren
            if (RCSettings.BanEren > 0)
            {
                irc.AddLine("Anti-Eren enabled. Using Titan Eren will get you kicked.".AsColor("FFCC00"));
            }

            // Custom Titan Count
            if (RCSettings.MoreTitans > 0)
            {
                irc.AddLine("Custom Titan # enabled (".AsColor("FFCC00") + RCSettings.MoreTitans + ").".AsColor("FFCC00"));
            }

            // Minimum Damage
            if (RCSettings.MinimumDamage > 0)
            {
                irc.AddLine("Minimum nape damage enabled (".AsColor("FFCC00") + RCSettings.MinimumDamage + ").".AsColor("FFCC00"));
            }

            // Custom Titan Sizes
            if (RCSettings.SizeMode > 0)
            {
                irc.AddLine("Custom titan size enabled (".AsColor("FFCC00")
                            + RCSettings.SizeLower.ToString("F2") + ", ".AsColor("FFCC00")
                            + RCSettings.SizeUpper.ToString("F2") + ").".AsColor("FFCC00"));
            }

            // Custom Spawn Rates
            if (RCSettings.SpawnMode > 0)
            {
                irc.AddLine("Custom spawn rate enabled (".AsColor("FFCC00")
                            + RCSettings.NormalRate.ToString("F2") + "% Normal, ".AsColor("FFCC00")
                            + RCSettings.AberrantRate.ToString("F2") + "% Abnormal, ".AsColor("FFCC00")
                            + RCSettings.JumperRate.ToString("F2") + "% Jumper, ".AsColor("FFCC00")
                            + RCSettings.CrawlerRate.ToString("F2") + "% Crawler, ".AsColor("FFCC00")
                            + RCSettings.PunkRate.ToString("F2") + "% Punk.".AsColor("FFCC00"));
            }

            // Wave Mode (Titan count multiplier?)
            if (RCSettings.WaveModeOn == 1)
            {
                irc.AddLine("Custom wave mode enabled (".AsColor("FFCC00") + RCSettings.WaveModeNum + ").".AsColor("FFCC00"));
            }

            // Friendly Fire
            if (RCSettings.FriendlyMode > 0)
            {
                irc.AddLine("Friendly-Fire disabled. PVP is not allowed.".AsColor("FFCC00"));
            }

            // PVP Mode
            if (RCSettings.PvPMode > 0)
            {
                if (RCSettings.PvPMode == 1)
                {
                    irc.AddLine("AHSS/Blade PVP is on (Team-Based).".AsColor("FFCC00"));
                }
                else if (RCSettings.PvPMode == 2)
                {
                    irc.AddLine("AHSS/Blade PVP is on (FFA).".AsColor("FFCC00"));
                }
            }

            // Max Wave
            if (RCSettings.MaxWave > 0)
            {
                irc.AddLine("Max Wave set to ".AsColor("FFCC00") + RCSettings.MaxWave + ".".AsColor("FFCC00"));
            }

            // Endless Respawn
            if (RCSettings.EndlessMode > 0)
            {
                irc.AddLine("Endless Respawn enabled (".AsColor("FFCC00") + RCSettings.EndlessMode + "s).".AsColor("FFCC00"));
            }

            // Deadly Cannons
            if (RCSettings.DeadlyCannons > 0)
            {
                irc.AddLine("Cannons will kill humans.".AsColor("FFCC00"));
            }

            // ASO
            if (RCSettings.RacingStatic > 0)
            {
                irc.AddLine("Racing will not restart on win".AsColor("FFCC00"));
            }

            // MOTD
            if (RCSettings.Motd.Length > 0)
            {
                irc.AddLine("MOTD: ".AsColor("FFCC00") + RCSettings.Motd);
            }
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public override void Execute(InRoomChat irc, string[] args)
        {
            if (FengGameManagerMKII.Level.Mode == GameMode.Racing)
            {
                irc.AddLine("Teleport can NOT be used while in Racing.".AsColor("FF0000"));
                return;
            }

            if (args.Length > 3) // Player(s) -> Coordinate
            {
                if (!float.TryParse(args[1], out float x) || !float.TryParse(args[2], out float y) || !float.TryParse(args[3], out float z))
                {
                    return;
                }

                if (args[0].Equals("all", StringComparison.OrdinalIgnoreCase))
                {
                    foreach (PhotonPlayer player in PhotonNetwork.playerList)
                    {
                        Photon.MonoBehaviour mb = player.IsTitan ? (Photon.MonoBehaviour)player.GetTitan() : (Photon.MonoBehaviour)player.GetHero();
                        if (mb == null)
                        {
                            continue;
                        }

                        mb.photonView.RPC("moveToRPC", player, x, y, z);
                    }

                    GameHelper.Broadcast($"Teleported everyone to {x:F3} / {y:F3} / {z:F3}");
                }
                else if (int.TryParse(args[0], out int id))
                {
                    PhotonPlayer player = PhotonPlayer.Find(id);
                    if (player == null)
                    {
                        return;
                    }

                    Photon.MonoBehaviour mb = player.IsTitan ? (Photon.MonoBehaviour)player.GetTitan() : (Photon.MonoBehaviour)player.GetHero();
                    if (mb == null)
                    {
                        return;
                    }

                    mb.photonView.RPC("moveToRPC", player, x, y, z);
                    FengGameManagerMKII.Instance.photonView.RPC("Chat", player, $"Teleported you to {x:F3} {y:F3} {z:F3}", string.Empty);
                }
            }
            else if (args.Length > 2) // You -> Coordinate
            {
                if (!float.TryParse(args[0], out float x) || !float.TryParse(args[1], out float y) || !float.TryParse(args[2], out float z))
                {
                    return;
                }

                Photon.MonoBehaviour mb = PhotonNetwork.player.IsTitan ? (Photon.MonoBehaviour)PhotonNetwork.player.GetTitan() : (Photon.MonoBehaviour)PhotonNetwork.player.GetHero();
                if (mb == null)
                {
                    return;
                }

                mb.transform.position = new UnityEngine.Vector3(x, y, z);
                irc.AddLine($"Teleported you to {x:F3} {y:F3} {z:F3}");
            }
            else if (args.Length > 1) // Player(s) -> Target
            {
                if (!int.TryParse(args[1], out int targetId))
                {
                    return;
                }

                PhotonPlayer target = PhotonPlayer.Find(targetId);
                if (target == null)
                {
                    return;
                }

                Photon.MonoBehaviour targetMb = target.IsTitan ? (Photon.MonoBehaviour)target.GetTitan() : (Photon.MonoBehaviour)target.GetHero();
                if (targetMb == null)
                {
                    return;
                }

                if (args[0].Equals("all", StringComparison.OrdinalIgnoreCase))
                {
                    foreach (PhotonPlayer player in PhotonNetwork.playerList)
                    {
                        Photon.MonoBehaviour mb = player.IsTitan ? (Photon.MonoBehaviour)player.GetTitan() : (Photon.MonoBehaviour)player.GetHero();
                        if (mb == null)
                        {
                            continue;
                        }

                        mb.photonView.RPC("moveToRPC", player, targetMb.transform.position.x, targetMb.transform.position.y, targetMb.transform.position.z);
                    }

                    GameHelper.Broadcast($"Teleported everyone to #{targetId}");
                }
                else if (int.TryParse(args[0], out int id))
                {
                    PhotonPlayer player = PhotonPlayer.Find(id);
                    if (player == null)
                    {
                        return;
                    }

                    Photon.MonoBehaviour mb = player.IsTitan ? (Photon.MonoBehaviour)player.GetTitan() : (Photon.MonoBehaviour)player.GetHero();
                    if (mb == null)
                    {
                        return;
                    }

                    mb.photonView.RPC("moveToRPC", player, targetMb.transform.position.x, targetMb.transform.position.y, targetMb.transform.position.z);
                    FengGameManagerMKII.Instance.photonView.RPC("Chat", player, $"Teleported you to #{targetId}", string.Empty);
                }
            }
            else if (args.Length > 0)// All -> You or You -> Target
            {
                Photon.MonoBehaviour myMb = PhotonNetwork.player.IsTitan ? (Photon.MonoBehaviour)PhotonNetwork.player.GetTitan() : (Photon.MonoBehaviour)PhotonNetwork.player.GetHero();
                if (myMb == null)
                {
                    return;
                }

                if (args[0].Equals("all", StringComparison.OrdinalIgnoreCase))
                {
                    foreach (PhotonPlayer player in PhotonNetwork.playerList)
                    {
                        Photon.MonoBehaviour mb = player.IsTitan ? (Photon.MonoBehaviour)player.GetTitan() : (Photon.MonoBehaviour)player.GetHero();
                        if (mb == null)
                        {
                            continue;
                        }

                        mb.photonView.RPC("moveToRPC", player, myMb.transform.position.x, myMb.transform.position.y, myMb.transform.position.z);
                    }

                    GameHelper.Broadcast("Teleported everyone to MasterClient!");
                }
                else if (int.TryParse(args[0], out int id))
                {
                    PhotonPlayer player = PhotonPlayer.Find(id);
                    if (player == null)
                    {
                        return;
                    }

                    Photon.MonoBehaviour mb = player.IsTitan ? (Photon.MonoBehaviour)player.GetTitan() : (Photon.MonoBehaviour)player.GetHero();
                    if (mb == null)
                    {
                        return;
                    }

                    myMb.transform.position = mb.transform.position;
                    irc.AddLine($"Teleported you to #{id}");
                }
            }
        }
Exemplo n.º 6
0
        public override void Execute(InRoomChat irc, string[] args)
        {
            if (args.Length < 2)
            {
                return;
            }

            // Time left
            if (args[0].Equals("time", StringComparison.OrdinalIgnoreCase) && int.TryParse(args[1], out int time))
            {
                FengGameManagerMKII.Instance.AddTime(time);
                GameHelper.Broadcast($"Added {time}s to the clock!");
            }

            // Max players
            if (args[0].Equals("max", StringComparison.OrdinalIgnoreCase) && int.TryParse(args[1], out int max))
            {
                PhotonNetwork.room.expectedMaxPlayers = max;
                PhotonNetwork.room.maxPlayers         = PhotonNetwork.room.expectedMaxPlayers;
                GameHelper.Broadcast($"Max players is now {max}!");
            }

            // Allowing joins or not
            if (args[0].Equals("open", StringComparison.OrdinalIgnoreCase))
            {
                PhotonNetwork.room.expectedJoinability = args[1].Equals("true", StringComparison.OrdinalIgnoreCase);
                PhotonNetwork.room.open = PhotonNetwork.room.expectedJoinability;
                GameHelper.Broadcast($"Room is {(PhotonNetwork.room.open ? "now" : "no longer")} allowing joins!");
            }

            // Visible in lobby or not
            if (args[0].Equals("visible", StringComparison.OrdinalIgnoreCase))
            {
                PhotonNetwork.room.expectedVisibility = args[1].Equals("true", StringComparison.OrdinalIgnoreCase);
                PhotonNetwork.room.visible            = PhotonNetwork.room.expectedVisibility;
                GameHelper.Broadcast($"Room is {(PhotonNetwork.room.visible ? "now" : "no longer")} being shown in the lobby!");
            }

            // Player TTL
            if (args[0].Equals("pttl", StringComparison.OrdinalIgnoreCase) && int.TryParse(args[1], out int pttl))
            {
                if (PhotonNetwork.player.Id == 1)
                {
                    PhotonNetwork.room.playerTtl = pttl;
                    GameHelper.Broadcast($"Player TTL is now {pttl}ms!");
                }
                else
                {
                    irc.AddLine("You must be the room creator to execute this!".AsColor("FF0000"));
                }
            }

            // Room TTL
            if (args[0].Equals("rttl", StringComparison.OrdinalIgnoreCase) && int.TryParse(args[1], out int rttl))
            {
                if (PhotonNetwork.player.Id == 1)
                {
                    PhotonNetwork.room.emptyRoomTtl = rttl;
                    GameHelper.Broadcast($"Room TTL is now {rttl}ms!");
                }
                else
                {
                    irc.AddLine("You must be the room creator to execute this!".AsColor("FF0000"));
                }
            }
        }