Anti-TP (add-on)

This commit is contained in:
Gurge44 committed 2024-04-20 20:53:59 +02:00
1 parent 7ade24bd87
commit eaca1b88f9
7 files changed
+26 -2

No files matched your search

+1
View File
@@ -325,6 +325,7 @@ public enum CustomRoles
// Sub-role after 500
NotAssigned = 500,
Antidote,
AntiTP,
Asthmatic,
Autopsy,
Avanger,
+4 -1
View File
@@ -1,4 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AU/@EntryIndexedValue">AU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CD/@EntryIndexedValue">CD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CK/@EntryIndexedValue">CK</s:String>
@@ -24,5 +26,6 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SSCD/@EntryIndexedValue">SSCD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TMP/@EntryIndexedValue">TMP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EHR/@EntryIndexedValue">EHR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TP/@EntryIndexedValue">TP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VN/@EntryIndexedValue">VN</s:String></wpf:ResourceDictionary>
+1
View File
@@ -112,6 +112,7 @@ public static class Utils
public static bool TP(CustomNetworkTransform nt, Vector2 location, bool log = true)
{
var pc = nt.myPlayer;
if (pc.Is(CustomRoles.AntiTP)) return false;
if (pc.inVent || pc.inMovingPlat || pc.onLadder || !pc.IsAlive() || pc.MyPhysics.Animations.IsPlayingAnyLadderAnimation() || pc.MyPhysics.Animations.IsPlayingEnterVentAnimation())
{
if (log) Logger.Warn($"Target ({pc.GetNameWithRole().RemoveHtmlTags()}) is in an un-teleportable state - Teleporting canceled", "TP");
+5 -1
View File
@@ -263,6 +263,7 @@
"Ntr": "Neptune",
"Watcher": "Watcher",
"Sleuth": "Sleuth",
"AntiTP": "Anti-TP",
"Taskcounter": "Taskcounter",
"Bloodlust": "Bloodlust",
"Stained": "Stained",
@@ -323,6 +324,7 @@
"Prefix.Ntr": "Neptune",
"Prefix.Watcher": "Watcher",
"Prefix.Sleuth": "Sleuth",
"Prefix.AntiTP": "Anti-TP",
"Prefix.Taskcounter": "Taskcounter",
"Prefix.Bloodlust": "Bloodlust",
"Prefix.Stained": "Stained",
@@ -580,6 +582,7 @@
"AsthmaticInfo": "Stop And Go",
"MagnetInfo": "Pull your victims to you",
"SleuthInfo": "Know the roles of the bodies you report",
"AntiTPInfo": "You can't be teleported",
"TaskcounterInfo": "You see the total tasks completed in real time",
"BloodlustInfo": "You can kill",
"StainedInfo": "Your killer gets a violet name for 3s",
@@ -595,7 +598,7 @@
"LazyInfo": "You're too lazy",
"AutopsyInfo": "You see how others died",
"DiscoInfo": "You continuously change colors",
"Sonar": "You have an arrow pointing to the nearest player",
"SonarInfo": "You have an arrow pointing to the nearest player",
"LoyalInfo": "You cannot be recruited",
"EvilSpiritInfo": "You are an evil Spirit",
"RecruitInfo": "Help the Jackal",
@@ -788,6 +791,7 @@
"WatcherInfoLong": "(Add-ons):\\nDuring the meeting, Watcher can see everyone's votes.",
"MagnetInfoLong": "(Add-ons):\\nWhen you kill, your victims lunge to you, instead of you lunging to them",
"SleuthInfoLong": "(Add-ons):\\nYou know the roles of the bodies you report.",
"AntiTPInfoLong": "(Add-ons):\\nYou cannot be teleported.",
"TaskcounterInfoLong": "(Add-ons):\\nTask Counter can see the total number of tasks completed (by everyone all together) next to their role name, which updates in real-time.",
"BloodlustInfoLong": "(Add-ons):\\nYou can kill. You are a neutral killer, while also keeping the ability of your role (as much as host-only limitations allow).",
"StainedInfoLong": "(Add-ons):\\nYour killer gets a violet name for 3 seconds.",
+12
View File
@@ -0,0 +1,12 @@
namespace EHR.Roles.AddOns.Common
{
public class AntiTP : IAddon
{
public AddonTypes Type => AddonTypes.Mixed;
public void SetupCustomOption()
{
Options.SetupAdtRoleOptions(16894, CustomRoles.AntiTP, canSetNum: true, teamSpawnOptions: true);
}
}
}
+2
View File
@@ -90,6 +90,8 @@ namespace EHR.Neutral
pc.Notify(Translator.GetString(GetNotify(kvp.Value.Instruction, kvp.Value.DoAction, false)), 300f);
}
Utils.NotifyRoles(SpecifySeer: physics.myPlayer, SpecifyTarget: physics.myPlayer);
}
static string GetNotify(Instruction instruction, bool doAction, bool forSimon)
+1
View File
@@ -493,6 +493,7 @@ public class Main : BasePlugin
{ CustomRoles.Madmate, "#ff1919" },
{ CustomRoles.Watcher, "#800080" },
{ CustomRoles.Sleuth, "#30221c" },
{ CustomRoles.AntiTP, "#fcba03" },
{ CustomRoles.Taskcounter, "#ff1919" },
{ CustomRoles.Stained, "#e6bf91" },
{ CustomRoles.Clumsy, "#b8b8b8" },