コード例 #1
0
        private void OnDeath(Synapse.Api.Events.SynapseEventArguments.PlayerDeathEventArgs ev)
        {
            if (ev.Victim.RoleID == 56)
            {
                Map.Get.AnnounceScpDeath("0 5 6");
                ev.Victim.Ammo5 = 0;
                ev.Victim.Ammo7 = 0;
                ev.Victim.Ammo9 = 0;
            }


            if (ev.Killer == null || ev.Killer == ev.Victim)
            {
                return;
            }

            if (ev.Victim.RoleID == 56)
            {
                ev.Killer.SendBroadcast(7, PluginClass.GetTranslation("killed035"));
            }
            else if (ev.Killer.RoleID == 56)
            {
                ev.Victim.OpenReportWindow(PluginClass.GetTranslation("killedby035"));
            }
        }
コード例 #2
0
ファイル: PluginClass.cs プロジェクト: TypicalIllusion/Scp056
        public override void Load()
        {
            Server.Get.RoleManager.RegisterCustomRole <Scp056PlayerScript>();
            pclass = this;
            var trans = new Dictionary <string, string>
            {
                { "spawn", "<color=blue><b>You are now</b></color> <color=red><b>SCP</b></color> <color=blue><b>056</b></color>\nYour goal is it to kill all Humans\nYour special abillity is that you can use the .056 command in your Console to swap your class\nPress esc to close" },
                { "targets", "There still exist %targets% more Targets to kill for you" },
                { "killed035", "<color=blue><b>You have killed</b></color> <color=red><b>SCP</b></color> <color=black><b>056</b></color>" },
                { "killedby035", "<color=blue><b>You are killed by</b></color> <color=red><b>SCP</b></color> <color=black><b>056</b></color>" }
            };

            Translation.CreateTranslations(trans);

            new EventHandlers();
        }
コード例 #3
0
        private void OnKeyPress(Synapse.Api.Events.SynapseEventArguments.PlayerKeyPressEventArgs ev)
        {
#if DEBUG
            if (ev.KeyCode == KeyCode.Alpha7)
            {
                ev.Player.CustomRole = new Scp056PlayerScript();
            }
#endif
            if (ev.Player.RoleID != 56)
            {
                return;
            }

            RoleType role;

            switch (ev.KeyCode)
            {
            case KeyCode.Alpha1: role = RoleType.ClassD; break;

            case KeyCode.Alpha2: role = RoleType.Scientist; break;

            case KeyCode.Alpha3: role = RoleType.FacilityGuard; break;

            case KeyCode.Alpha4: role = RoleType.NtfLieutenant; break;

            case KeyCode.Alpha5: role = RoleType.ChaosInsurgency; break;

            case KeyCode.Alpha6:
                var targets = Server.Get.GetPlayers(x => x.RealTeam == Team.MTF || x.RealTeam == Team.CDP || x.RealTeam == Team.RSC).Count;
                ev.Player.SendBroadcast(7, PluginClass.GetTranslation("targets").Replace("%targets%", targets.ToString()));
                return;

            default: return;
            }

            ev.Player.ChangeRoleAtPosition(role);
            ev.Player.MaxHealth = PluginClass.Config.Scp056Health;
            ev.Player.Ammo5     = 999;
            ev.Player.Ammo7     = 999;
            ev.Player.Ammo9     = 999;
        }
コード例 #4
0
        public override void Spawn()
        {
            Spawned         = false;
            Player.RoleType = RoleType.FacilityGuard;

            Player.Inventory.Clear();

            foreach (var item in PluginClass.Config.Items)
            {
                Player.Inventory.AddItem(item.Parse());
            }

            Player.Health    = PluginClass.Config.Scp056Health;
            Player.MaxHealth = PluginClass.Config.Scp056Health;

            Player.Ammo5 = 999;
            Player.Ammo7 = 999;
            Player.Ammo9 = 999;

            Player.OpenReportWindow(PluginClass.GetTranslation("spawn"));
        }
コード例 #5
0
        public CommandResult Execute(CommandContext context)
        {
            var result = new CommandResult();

            if (context.Arguments.Count < 1)
            {
                context.Arguments = new System.ArraySegment <string>(new[] { "" });
            }

            if (context.Player.RoleID != 56)
            {
                result.Message = "You are Not Scp056";
                result.State   = CommandResultState.Error;
                return(result);
            }

            switch (context.Arguments.First().ToLower())
            {
            case "class":
                if (context.Arguments.Count < 2)
                {
                    context.Arguments = new System.ArraySegment <string>(new[] { "class", "" });
                }

                RoleType role;

                switch (context.Arguments.ElementAt(1).ToLower())
                {
                case "d": role = RoleType.ClassD; break;

                case "s": role = RoleType.Scientist; break;

                case "c": role = RoleType.ChaosInsurgency; break;

                case "m": role = RoleType.NtfLieutenant; break;

                case "g": role = RoleType.FacilityGuard; break;

                default:
                    result.Message = "You have to enter a valid letter" +
                                     "\nD => D-Personnel" +
                                     "\nS => Scientist" +
                                     "\nC => Chaos" +
                                     "\nM => Mtf Lieutnant" +
                                     "\nG => Guard";
                    result.State = CommandResultState.Error;
                    return(result);
                }

                context.Player.ChangeRoleAtPosition(role);
                context.Player.Ammo5     = 999;
                context.Player.Ammo7     = 999;
                context.Player.Ammo9     = 999;
                context.Player.MaxHealth = PluginClass.Config.Scp056Health;
                result.Message           = "You succesfully swaped your Role";
                result.State             = CommandResultState.Ok;
                return(result);

            case "targets":
                var targets = Server.Get.GetPlayers(x => x.RealTeam == Team.MTF || x.RealTeam == Team.CDP || x.RealTeam == Team.RSC).Count;
                result.Message = PluginClass.GetTranslation("targets").Replace("%targets%", targets.ToString());
                result.State   = CommandResultState.Ok;
                return(result);

            default:
                result.State   = CommandResultState.Error;
                result.Message = "Please type one of these 056 commands in:" +
                                 "\n.056 class D => Changes your Role to a D-Personnel" +
                                 "\n.056 class S => Changes your Role to a Scientist" +
                                 "\n.056 class C => Changes your Role to a Chaos" +
                                 "\n.056 class M => Changes your Role to a Mtf Lieutnant" +
                                 "\n.056 class G => Changes your Role to a Guard" +
                                 "\n.056 targets displays you how many targets are left";
                return(result);
            }
        }