diff --git a/SCPDiscordPlugin/Config.cs b/SCPDiscordPlugin/Config.cs index 08c9cd8c..c0dfb83f 100644 --- a/SCPDiscordPlugin/Config.cs +++ b/SCPDiscordPlugin/Config.cs @@ -24,7 +24,7 @@ public static class Config { { "settings.playercount", true }, { "settings.verbose", true }, - { "settings.debug", true }, + { "settings.debug", true }, { "settings.metrics", true }, { "settings.configvalidation", true }, { "settings.rolesync", false } @@ -63,6 +63,10 @@ public static class Config { "channels.onstopcountdown.noplayer", new string[]{ } }, { "channels.onsummonvehicle.chaos", new string[]{ } }, { "channels.onsummonvehicle.mtf", new string[]{ } }, + { "channels.ongeneratorfinish", new string[]{ } }, + { "channels.onscpdeathannouncement", new string[]{ } }, + { "channels.oncassiecustomannouncement", new string[]{ } }, + { "channels.oncassieteamannouncement", new string[]{ } }, // Player events { "channels.on079addexp", new string[]{ } }, diff --git a/SCPDiscordPlugin/EventListeners/EnvironmentEventListener.cs b/SCPDiscordPlugin/EventListeners/EnvironmentEventListener.cs index 51c9eff5..96ae8e21 100644 --- a/SCPDiscordPlugin/EventListeners/EnvironmentEventListener.cs +++ b/SCPDiscordPlugin/EventListeners/EnvironmentEventListener.cs @@ -129,22 +129,52 @@ public void OnSummonVehicle(SummonVehicleEvent ev) public void OnGeneratorFinish(GeneratorFinishEvent ev) { - this.plugin.VerboseError("Event not yet implemented"); + Dictionary variables = new Dictionary + { + { "room", ev.Generator.Room.RoomType.ToString() } + }; + this.plugin.SendMessage(Config.GetArray("channels.ongeneratorfinish"), "environment.ongeneratorfinish", variables); } public void OnScpDeathAnnouncement(ScpDeathAnnouncementEvent ev) { - this.plugin.VerboseError("Event not yet implemented"); + if (!ev.ShouldPlay) return; + + Dictionary variables = new Dictionary + { + { "ipaddress", ev.DeadPlayer.IPAddress }, + { "name", ev.DeadPlayer.Name }, + { "playerid", ev.DeadPlayer.PlayerID.ToString() }, + { "steamid", ev.DeadPlayer.GetParsedUserID() }, + { "class", ev.DeadPlayer.PlayerRole.RoleID.ToString() }, + { "team", ev.DeadPlayer.PlayerRole.Team.ToString() } + }; + this.plugin.SendMessage(Config.GetArray("channels.onscpdeathannouncement"), "environment.onscpdeathannouncement", variables); } public void OnCassieCustomAnnouncement(CassieCustomAnnouncementEvent ev) { - this.plugin.VerboseError("Event not yet implemented"); + if (!ev.Allow) return; + + Dictionary variables = new Dictionary + { + { "words", ev.Words } + }; + + this.plugin.SendMessage(Config.GetArray("channels.oncassiecustomannouncement"), "environment.oncassiecustomannouncement", variables); } public void OnCassieTeamAnnouncement(CassieTeamAnnouncementEvent ev) { - this.plugin.VerboseError("Event not yet implemented"); + if (!ev.Allow) return; + + Dictionary variables = new Dictionary + { + { "cassieunitname", ev.CassieUnitName }, + { "scpsleft", ev.SCPsLeft.ToString() } + }; + + this.plugin.SendMessage(Config.GetArray("channels.oncassieteamannouncement"), "environment.oncassieteamannouncement", variables); } } } \ No newline at end of file diff --git a/SCPDiscordPlugin/Language.cs b/SCPDiscordPlugin/Language.cs index f8520df1..464b6a59 100644 --- a/SCPDiscordPlugin/Language.cs +++ b/SCPDiscordPlugin/Language.cs @@ -61,6 +61,10 @@ internal static class Language "environment.ondecontaminate", "environment.onsummonvehicle.chaos", "environment.onsummonvehicle.mtf", + "environment.ongeneratorfinish", + "environment.onscpdeathannouncement", + "environment.oncassiecustomannouncement", + "environment.oncassieteamannouncement", "player.onplayerhurt.noattacker", "player.onplayerhurt.friendlyfire", diff --git a/SCPDiscordPlugin/Languages/english-emote.yml b/SCPDiscordPlugin/Languages/english-emote.yml index 9f966099..3f46250c 100644 --- a/SCPDiscordPlugin/Languages/english-emote.yml +++ b/SCPDiscordPlugin/Languages/english-emote.yml @@ -285,6 +285,29 @@ environment: mtf: message: ":helicopter: **MTF helicopter is in visual range of the site, preparing to land.**" regex: [] + + ongeneratorfinish: + # room + message: ":electric_plug: Generator has finished charging up in " + regex: [ ] + onscpdeathannouncement: + # ipaddress + # name + # playerid + # steamid + # class + # team + message: ":white_check_mark: has been recontained or neutralized." + regex: [ ] + oncassiecustomannouncement: + # words + message: ":loudspeaker: C.A.S.S.I.E Announcement: " + regex: [ ] + oncassieteamannouncement: + # cassieunitname + # scpsleft + message: ":cop: **MTF has entered the facility.**" + regex: [ ] player: onplayerhurt: @@ -1075,7 +1098,7 @@ team: # players - List # spawnchaos - bool mtf: - message: ":cop: **Mobile TaskForce Epsilon-11 designated Nine-Tailed Fox has entered the facility.**" + message: ":cop: **Mobile Task Force Epsilon-11 designated Nine-Tailed Fox has entered the facility.**" regex: [] ci: message: ":spy: **Facility incursion detected, intruders identified as members of hostile GOI \"Chaos Insurgency\".**" diff --git a/SCPDiscordPlugin/Languages/english.yml b/SCPDiscordPlugin/Languages/english.yml index 0cf1e00a..9e1381df 100644 --- a/SCPDiscordPlugin/Languages/english.yml +++ b/SCPDiscordPlugin/Languages/english.yml @@ -286,6 +286,28 @@ environment: mtf: message: "**MTF helicopter is in visual range of the site, preparing to land.**" regex: [] + ongeneratorfinish: + # room + message: "Generator has finished charging up in " + regex: [ ] + onscpdeathannouncement: + # ipaddress + # name + # playerid + # steamid + # class + # team + message: " has been recontained or neutralized." + regex: [ ] + oncassiecustomannouncement: + # words + message: "C.A.S.S.I.E Announcement: " + regex: [ ] + oncassieteamannouncement: + # cassieunitname + # scpsleft + message: "**MTF has entered the facility.**" + regex: [ ] player: onplayerhurt: @@ -1009,7 +1031,7 @@ team: # players - List # spawnchaos - bool mtf: - message: "**Mobile TaskForce Epsilon-11 designated Nine-Tailed Fox has entered the facility.**" + message: "**Mobile Task Force Epsilon-11 designated Nine-Tailed Fox has entered the facility.**" regex: [] ci: message: "**Facility incursion detected, intruders identified as members of hostile GOI \"Chaos Insurgency\".**" diff --git a/SCPDiscordPlugin/SCPDiscord.cs b/SCPDiscordPlugin/SCPDiscord.cs index 5698d8bb..fc7670aa 100644 --- a/SCPDiscordPlugin/SCPDiscord.cs +++ b/SCPDiscordPlugin/SCPDiscord.cs @@ -25,7 +25,7 @@ namespace SCPDiscord name = "SCPDiscord", description = "SCP:SL - Discord bridge.", id = "karlofduty.scpdiscord", - version = "2.0.1", + version = "2.0.2", SmodMajor = 3, SmodMinor = 10, SmodRevision = 0 diff --git a/SCPDiscordPlugin/config.yml b/SCPDiscordPlugin/config.yml index 47c79615..ffa2f7f8 100644 --- a/SCPDiscordPlugin/config.yml +++ b/SCPDiscordPlugin/config.yml @@ -88,6 +88,10 @@ channels: onsummonvehicle: chaos: [ "default" ] mtf: [ "default" ] + ongeneratorfinish: [ "default" ] + onscpdeathannouncement: [] + oncassiecustomannouncement: [] + oncassieteamannouncement: [] # Player events onplayerhurt: