Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
added translate
Browse files Browse the repository at this point in the history
  • Loading branch information
iRebbok committed Oct 6, 2019
1 parent 858636f commit 87e80e3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
8 changes: 7 additions & 1 deletion scp035/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ partial class EventHandler : IEventHandlerWaitingForPlayers, IEventHandlerRoundS
private bool corrodeLifeSteal;
private bool isEnabled;

public EventHandler(Plugin plugin)
// Translate
private uint bctime;
private string infection;
private string picked;
private string hiding;

public EventHandler(Plugin plugin)
{
instance = plugin;
hInstance = this;
Expand Down
16 changes: 12 additions & 4 deletions scp035/Logic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ private void LoadConfigs()
corrodeInterval = instance.GetConfigFloat("035_corrode_interval");
corrodeLifeSteal = instance.GetConfigBool("035_corrode_life_steal");
isEnabled = instance.GetConfigBool("035_enabled");
}

int ConfigBCTime = instance.GetConfigInt("035_bc_time");
if (ConfigBCTime > -1) bctime = (uint)ConfigBCTime;
else bctime = 10;

hiding = instance.GetTranslation("hiding");
picked = instance.GetTranslation("picked");
infection = instance.GetTranslation("infection");
}

private void ResetItemDurability()
{
Expand Down Expand Up @@ -123,12 +131,12 @@ private void InfectPlayer(Player player, Smod2.API.Item pItem)
p035.SetAmmo(AmmoType.DROPPED_7, player.GetAmmo(AmmoType.DROPPED_7));
p035.SetAmmo(AmmoType.DROPPED_9, player.GetAmmo(AmmoType.DROPPED_9));
p035.SetRank("red", "SCP-035");
p035.PersonalBroadcast(10, $"You are <color=\"red\">SCP-035!</color> You have infected a body and have gained control over it, use it to help the other SCPs!", false);
p035.PersonalBroadcast(bctime, infection, false);
scpPlayer = p035;
isRotating = false;

player.ChangeRole(Role.SPECTATOR);
player.PersonalBroadcast(10, $"You have picked up <color=\"red\">SCP-035.</color> He has infected your body and is now in control of you.", false);
player.PersonalBroadcast(bctime, picked, false);

if (spawnNewItems) RemovePossessedItems(); else ResetItemDurability();
}
Expand Down Expand Up @@ -167,7 +175,7 @@ private void CorrodePlayer(Player player)
public bool HandleHideTagHook(CharacterClassManager __instance)
{
bool a = __instance.SteamId == scpPlayer?.SteamId;
if (a) __instance.TargetConsolePrint(__instance.connectionToClient, "You're not trying to exploit the system by hiding your tag as SCP-035 now, are you?", "green");
if (a) __instance.TargetConsolePrint(__instance.connectionToClient, hiding, "green");
return !a;
}
}
Expand Down
7 changes: 6 additions & 1 deletion scp035/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public override void Register()
AddConfig(new Smod2.Config.ConfigSetting("035_corrode_interval", 1f, false, true, "The interval in seconds for corrosion damage."));
AddConfig(new Smod2.Config.ConfigSetting("035_corrode_life_steal", true, false, true, "If SCP-035 should steal any health taken from other players by corrosion."));
AddConfig(new Smod2.Config.ConfigSetting("035_enabled", true, false, true, "If SCP-035 is enabled."));
}

AddConfig(new Smod2.Config.ConfigSetting("035_bc_time", 10, true, "Broadcast time"));
AddTranslation(new Smod2.Lang.LangSetting("infection", "You are <color=red>SCP-035!</color> You have infected a body and have gained control over it, use it to help the other SCPs!", "SCP035"));
AddTranslation(new Smod2.Lang.LangSetting("picked", "You have picked up <color=red>SCP-035.</color> He has infected your body and is now in control of you.", "SCP035"));
AddTranslation(new Smod2.Lang.LangSetting("hiding", "You're not trying to exploit the system by hiding your tag as SCP-035 now, are you?", "SCP035)"));
}
}
}
14 changes: 7 additions & 7 deletions scp035/scp035.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\Desktop\References\0Harmony.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Desktop\3.5.0\Assembly-CSharp.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Smod2, Version=3.4.1.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Desktop\3.5.0\Smod2.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\Smod2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -54,13 +54,13 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\UnityEngine.Networking.dll</HintPath>
<HintPath>F:\Visual Studio\forproject\UnityEngine.Networking.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 87e80e3

Please sign in to comment.