Skip to content

Commit

Permalink
Feat/lr (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS authored Mar 3, 2024
2 parents e649e00 + a6b172f commit 0cb80de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lang/Jailbreak.English/LastRequest/LastRequestMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,18 @@ public IView InformLastRequest(AbstractLastRequest lr)
return new SimpleView()
{
PREFIX,
lr.prisoner, "is", lr.type.ToFriendlyString(),
"against", lr.guard
lr.prisoner, "is preparing a", lr.type.ToFriendlyString(),
"Last Request against", lr.guard
};
}

public IView AnnounceLastRequest(AbstractLastRequest lr)
{
return new SimpleView()
{
lr.prisoner, "is", lr.type.ToFriendlyString(),
"against", lr.guard
PREFIX,
lr.prisoner, "is doing a", lr.type.ToFriendlyString(),
"Last Request against", lr.guard
};
}

Expand Down
9 changes: 7 additions & 2 deletions mod/Jailbreak.LastRequest/LastRequests/ShotForShot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ShotForShot(BasePlugin plugin, ILastRequestManager manager, CCSPlayerCont
{
}

public override LRType type => LRType.GunToss;
public override LRType type => LRType.ShotForShot;
private CCSPlayerController whosShot;

public override void Setup()
Expand Down Expand Up @@ -90,7 +90,6 @@ public override void Execute()
PrintToParticipants("Health was the deciding factor. ");
}

manager.EndLastRequest(this, result);
if (result == LRResult.GuardWin)
prisoner.Pawn.Value?.CommitSuicide(false, true);
else
Expand All @@ -109,6 +108,12 @@ public HookResult OnPlayerShoot(EventPlayerShoot @event, GameEventInfo info)

if (player.Slot != prisoner.Slot && player.Slot != guard.Slot)
return HookResult.Continue;
if (player.Slot != whosShot.Slot)
{
PrintToParticipants(player.PlayerName + " cheated.");
player.Pawn.Value?.CommitSuicide(false, true);
return HookResult.Handled;
}

PrintToParticipants(player.PlayerName + " has shot.");
var opponent = player.Slot == prisoner.Slot ? guard : prisoner;
Expand Down

0 comments on commit 0cb80de

Please sign in to comment.