Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Fix swooper button error
Browse files Browse the repository at this point in the history
  • Loading branch information
ismywb committed Jan 23, 2023
1 parent 6557e74 commit cd9bf1f
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions TheOtherRoles/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ public static void setCustomButtonCooldowns() {
bodyGuardGuardButton.MaxTimer = 0f;
garlicButton.MaxTimer = 0f;
jackalKillButton.MaxTimer = Jackal.cooldown;
Helpers.Log("Pre Swoop Button Set time");
if (!CustomOptionHolder.swooperAsWell.getBool())
swooperKillButton.MaxTimer = Jackal.cooldown;
Helpers.Log("Post Swoop Button Set time");
werewolfKillButton.MaxTimer = Werewolf.killCooldown;

sidekickKillButton.MaxTimer = Sidekick.cooldown;
Expand Down Expand Up @@ -1157,26 +1159,24 @@ public static void createButtonsPostfix(HudManager __instance) {
);


if (!CustomOptionHolder.swooperAsWell.getBool()) {

// Swooper Kill
swooperKillButton = new CustomButton(
() => {
if (Helpers.checkAndDoVetKill(Swooper.currentTarget)) return;
if (Helpers.checkMuderAttemptAndKill(Swooper.swooper, Swooper.currentTarget) == MurderAttemptResult.SuppressKill) return;
swooperKillButton.Timer = swooperKillButton.MaxTimer;
Swooper.currentTarget = null;
},
() => { return Swooper.swooper != null && Swooper.swooper == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; },
() => { showTargetNameOnButton(Swooper.currentTarget, swooperKillButton, "KILL"); return Swooper.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
() => { swooperKillButton.Timer = swooperKillButton.MaxTimer;},
__instance.KillButton.graphic.sprite,
new Vector3(0, 1f, 0),
__instance,
KeyCode.Q
);
}

// Swooper Kill
swooperKillButton = new CustomButton(
() => {
if (Helpers.checkAndDoVetKill(Swooper.currentTarget)) return;
if (Helpers.checkMuderAttemptAndKill(Swooper.swooper, Swooper.currentTarget) == MurderAttemptResult.SuppressKill) return;
swooperKillButton.Timer = swooperKillButton.MaxTimer;
Swooper.currentTarget = null;
},
() => { return Swooper.swooper != null && Swooper.swooper == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; },
() => { showTargetNameOnButton(Swooper.currentTarget, swooperKillButton, "KILL"); return Swooper.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
() => { swooperKillButton.Timer = swooperKillButton.MaxTimer;},
__instance.KillButton.graphic.sprite,
CustomButton.ButtonPositions.upperRowCenter,
__instance,
KeyCode.Q
);

swooperSwoopButton = new CustomButton(
() => { /* On Use */
Expand Down

0 comments on commit cd9bf1f

Please sign in to comment.