-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RoleDistr doesn't affect users in azkaban 019 now spawns in right place + added commands for its breach/recontain
- Loading branch information
1 parent
1674dae
commit b59c01d
Showing
10 changed files
with
162 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using CommandSystem; | ||
using Exiled.API.Enums; | ||
using Exiled.API.Features.Doors; | ||
using Exiled.API.Features.Pickups; | ||
using InventorySystem.Items.Usables.Scp244; | ||
using MEC; | ||
|
||
namespace VeryUsualDay.Commands | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
public class Breach019 : ICommand | ||
{ | ||
public string Command => "breach019"; | ||
public string[] Aliases => null; | ||
public string Description => "Открывает SCP-019 без дыма."; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response) | ||
{ | ||
Door.Get(DoorType.Scp173Armory).Lock(float.PositiveInfinity, DoorLockType.AdminCommand); | ||
VeryUsualDay.Instance.Vase.As<Scp244Pickup>().State = Scp244State.Active; | ||
Timing.CallDelayed(1f, () => | ||
{ | ||
VeryUsualDay.Instance.Vase.As<Scp244Pickup>().State = Scp244State.Idle; | ||
}); | ||
response = "SCP-019 открыт."; | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using CommandSystem; | ||
using Exiled.API.Features.Items; | ||
using UnityEngine; | ||
|
||
namespace VeryUsualDay.Commands | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
public class Recontain019 : ICommand | ||
{ | ||
public string Command => "recontain019"; | ||
public string[] Aliases => null; | ||
public string Description => "Восстанавливает ОУС SCP-019."; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response) | ||
{ | ||
VeryUsualDay.Instance.Vase.Destroy(); | ||
var vase = Item.Create(ItemType.SCP244a); | ||
vase.Scale = new Vector3(8f, 8f, 8f); | ||
VeryUsualDay.Instance.Vase = vase.CreatePickup(VeryUsualDay.Instance.VaseCoords); | ||
response = "SCP-019 закрыт."; | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System.Collections.Generic; | ||
using System.Net.Http; | ||
using System.Net.Http.Headers; | ||
using System.Text; | ||
using Exiled.API.Enums; | ||
using MEC; | ||
using Newtonsoft.Json; | ||
using PlayerRoles; | ||
|
||
namespace VeryUsualDay | ||
{ | ||
public static class PrisonController | ||
{ | ||
public static bool SendToPrison(Exiled.API.Features.Player player, int durationSeconds, string reason) | ||
{ | ||
using (var client = new HttpClient()) | ||
{ | ||
var data = new Dictionary<string, string> | ||
{ | ||
{ "steamId", player.UserId }, | ||
{ "time", durationSeconds.ToString() }, | ||
{ "reason", reason } | ||
}; | ||
var json = JsonConvert.SerializeObject(data); | ||
HttpContent content = new StringContent(json, Encoding.UTF8, "application/json"); | ||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", VeryUsualDay.Instance.Config.AuthToken); | ||
var response = client.PostAsync($"http://justmeow.ru:9000/aban", content).Result; | ||
if (response.IsSuccessStatusCode && VeryUsualDay.Instance.IsEnabledInRound) | ||
{ | ||
player.Role.Set(RoleTypeId.Tutorial); | ||
Timing.CallDelayed(0.5f, () => | ||
{ | ||
if (durationSeconds == 0) | ||
{ | ||
player.UnMute(); | ||
player.DisableEffect(EffectType.SilentWalk); | ||
player.SessionVariables.Remove("isInPrison"); | ||
player.SessionVariables.Remove("prisonTime"); | ||
player.SessionVariables.Remove("prisonReason"); | ||
} | ||
else | ||
{ | ||
player.Mute(); | ||
player.EnableEffect(EffectType.SilentWalk, 255); | ||
player.Teleport(VeryUsualDay.PrisonPosition); | ||
player.SessionVariables.Add("isInPrison", true); | ||
player.SessionVariables.Add("prisonTime", durationSeconds); | ||
player.SessionVariables.Add("prisonReason", reason); | ||
} | ||
}); | ||
} | ||
return response.IsSuccessStatusCode; | ||
} | ||
} | ||
|
||
public static (bool, int, string) CheckIfPlayerInPrison(Exiled.API.Features.Player player) | ||
{ | ||
using (var client = new HttpClient()) | ||
{ | ||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", VeryUsualDay.Instance.Config.AuthToken); | ||
var response = client.GetAsync($"http://justmeow.ru:9000/aban?steamId={player.UserId}").Result; | ||
var content = response.Content.ReadAsStringAsync().Result; | ||
var json = JsonConvert.DeserializeObject<List<string>>(content); | ||
return (response.IsSuccessStatusCode, int.Parse(json[0]), json[1]); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters