Skip to content
This repository was archived by the owner on Sep 4, 2023. It is now read-only.

Commit abdc883

Browse files
committed
more options
1 parent 8420fd9 commit abdc883

File tree

5 files changed

+70
-31
lines changed

5 files changed

+70
-31
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- master
1010

11+
env:
12+
EXILED_REFERENCES_PATH: ${{ github.workspace }}/BetterDoggie/lib
13+
1114
jobs:
1215
build:
1316
runs-on: windows-latest
@@ -40,6 +43,8 @@ jobs:
4043
run: ./7zip.exe e References.zip -oBetterDoggie/lib/ -r -y
4144

4245
- name: Build
46+
env:
47+
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }}
4348
run: msbuild BetterDoggie.sln -p:Configuration=release
4449

4550
- name: Upload Build

BetterDoggie/BetterDoggie.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class BetterDoggie : Plugin<Config>
1414
public override string Author => "Parkeymon";
1515
public override string Name => "BetterDoggie";
1616
public override string Prefix => "better_doggie";
17-
public override Version Version => new Version(1, 0, 0);
17+
public override Version Version => new Version(1, 1, 0);
1818
public override Version RequiredExiledVersion => new Version(3, 0, 5);
1919
public override PluginPriority Priority => PluginPriority.Low;
2020

BetterDoggie/BetterDoggie.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
<ItemGroup>
1212
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
13-
<HintPath>lib\Assembly-CSharp-Publicized.dll</HintPath>
13+
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-Publicized.dll</HintPath>
1414
</Reference>
1515
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
16-
<HintPath>lib\Assembly-CSharp-firstpass.dll</HintPath>
16+
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll</HintPath>
1717
</Reference>
1818
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
19-
<HintPath>lib\Mirror.dll</HintPath>
19+
<HintPath>$(EXILED_REFERENCES)\Mirror.dll</HintPath>
2020
</Reference>
2121
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
22-
<HintPath>lib\UnityEngine.CoreModule.dll</HintPath>
22+
<HintPath>$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll</HintPath>
2323
</Reference>
2424
</ItemGroup>
2525

BetterDoggie/Config.cs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,46 @@
33
using UnityEngine;
44
using System.ComponentModel;
55
using Exiled.API.Interfaces;
6+
using Exiled.API.Features;
67

78
public class Config : IConfig
89
{
910
[Description("Is the plugin enabled?")]
1011
public bool IsEnabled { get; set; } = true;
1112

12-
[Description("The size the 939 will be sized to.")]
13+
[Description("The max HP that dog will spawn with")]
14+
public int DoggieHealth { get; set; } = 1500;
15+
16+
[Description("The maximum AHP the dog can spawn with.")]
17+
public int DoggieAhp { get; set; } = 600;
18+
19+
[Description("Should the dog get the SCP-207 effect?")]
20+
public bool ColaSpeedBoost { get; set; } = true;
21+
22+
[Description("The size the the dog will be sized to.")]
1323
public Vector3 DoggieScale { get; set; } = new Vector3(.85f, .85f, .85f);
1424

15-
[Description("The base amount of damage 939 will do.")]
25+
[Description("The base amount of damage the dog will do.")]
1626
public float BaseDamage { get; set; } = 40f;
1727

18-
[Description("The maximum amount of additional damage 939 can deal.")]
28+
[Description("The maximum amount of additional damage the dog can deal.")]
1929
public float MaxDamageBoost { get; set; } = 150f;
2030

21-
[Description("Message to send to players when they spawn as 939")]
22-
public string SpawnMessage { get; set; } =
31+
[Description("Message to send to players when they spawn as the dog.")]
32+
public Broadcast SpawnBroadcast { get; set; } = new Broadcast(
2333
"<color=orange>You have spawned as an <color=red>upgraded</color> SCP-939! You run <color=red>faster</color> but slow down when you attack! " +
24-
"You can also bust down doors and pry gates when your Hume shield is below 50!</color>";
25-
34+
"You can also bust down doors and pry gates when your Hume shield is below 50!</color>", 8);
35+
2636
[Description("Can 939 bust open doors and gates if it is below a certain AHP?")]
2737
public bool EnableDogDoorBusting { get; set; } = true;
28-
38+
2939
[Description("The dog has to have an AHP lower than this to bust doors.")]
3040
public int DoorBustAhp { get; set; } = 50;
41+
42+
[Description("Gives 939 a speed boost when it busts down a door.")]
43+
public bool EnableBustSpeedBoost { get; set; } = true;
44+
45+
[Description("The amount of coke to give the dog when he busts down a door. (Max of 4)")]
46+
public byte BustBoostAmount { get; set; } = 2;
3147
}
3248
}

BetterDoggie/EventHandlers.cs

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,33 @@ public static void OnChangingRoles(ChangingRoleEventArgs ev)
1717

1818
Timing.CallDelayed(2f, () =>
1919
{
20-
ev.Player.Broadcast(8, BetterDoggie.Singleton.Config.SpawnMessage);
21-
20+
ev.Player.Broadcast(BetterDoggie.Singleton.Config.SpawnBroadcast);
21+
22+
ev.Player.Health = BetterDoggie.Singleton.Config.DoggieHealth;
23+
ev.Player.MaxHealth = BetterDoggie.Singleton.Config.DoggieHealth;
24+
ev.Player.ArtificialHealth = BetterDoggie.Singleton.Config.DoggieAhp;
25+
ev.Player.MaxArtificialHealth = BetterDoggie.Singleton.Config.DoggieAhp;
26+
2227
ev.Player.Scale = BetterDoggie.Singleton.Config.DoggieScale;
23-
ev.Player.EnableEffect<Scp207>();
28+
29+
if (BetterDoggie.Singleton.Config.ColaSpeedBoost)
30+
ev.Player.EnableEffect<Scp207>();
2431
});
2532
}
2633

2734
public static void OnHurtingPlayer(HurtingEventArgs ev)
2835
{
29-
if (ev.Attacker.Role != RoleType.Scp93953 && ev.Attacker.Role != RoleType.Scp93989)
36+
if (ev.Attacker.Role != RoleType.Scp93953 && ev.Attacker.Role != RoleType.Scp93989 || ev.Attacker == ev.Target)
3037
return;
3138

3239
if (ev.DamageType == DamageTypes.Scp207)
3340
{
3441
ev.IsAllowed = false;
3542
return;
3643
}
37-
38-
if (ev.Attacker == ev.Target)
39-
return;
4044

41-
// 600 Is the maximum hume shield of 939
42-
ev.Amount = BetterDoggie.Singleton.Config.BaseDamage + Math.Abs(ev.Attacker.ArtificialHealth - 600) / 600 * BetterDoggie.Singleton.Config.MaxDamageBoost;
45+
var maxHume = BetterDoggie.Singleton.Config.DoggieAhp;
46+
ev.Amount = BetterDoggie.Singleton.Config.BaseDamage + Math.Abs(ev.Attacker.ArtificialHealth - maxHume) / maxHume * BetterDoggie.Singleton.Config.MaxDamageBoost;
4347

4448
ev.Attacker.EnableEffect<SinkHole>(3f, true);
4549
ev.Attacker.ChangeEffectIntensity<SinkHole>(2);
@@ -54,19 +58,33 @@ public static void OnInteractingDoor(InteractingDoorEventArgs ev)
5458
return;
5559

5660
if (ev.Player.ArtificialHealth <= BetterDoggie.Singleton.Config.DoorBustAhp)
57-
BustDoor(ev.Door.Base, ev.Player);
61+
BustDoor(ev.Door.Base, ev.Player, BetterDoggie.Singleton.Config.EnableBustSpeedBoost);
5862
}
59-
60-
private static void BustDoor(DoorVariant door, Player ply)
63+
64+
/// <summary>
65+
/// Busts down a door and applies effect
66+
/// </summary>
67+
/// <param name="door"></param>
68+
/// <param name="ply"></param>
69+
/// <param name="speedBoost"></param>
70+
private static void BustDoor(DoorVariant door, Player ply, bool speedBoost)
6171
{
62-
if (door is IDamageableDoor damage)
63-
damage.IsDestroyed = true;
72+
switch (door)
73+
{
74+
case IDamageableDoor damage:
75+
damage.IsDestroyed = true;
76+
break;
77+
case PryableDoor pryableDoor:
78+
pryableDoor.TryPryGate();
79+
break;
80+
}
6481

65-
if (door is PryableDoor pryableDoor)
66-
pryableDoor.TryPryGate();
82+
if (!speedBoost)
83+
return;
6784

68-
ply.ChangeEffectIntensity<Scp207>(2);
69-
Timing.CallDelayed(2f, () => ply.ChangeEffectIntensity<Scp207>(1));
85+
ply.ChangeEffectIntensity<Scp207>(BetterDoggie.Singleton.Config.BustBoostAmount);
86+
if (BetterDoggie.Singleton.Config.ColaSpeedBoost)
87+
Timing.CallDelayed(2f, () => ply.ChangeEffectIntensity<Scp207>(1));
7088
}
7189
}
7290
}

0 commit comments

Comments
 (0)