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

fix: shooting the crowd no longer breaks the game #51

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions asset_patches/assets/data/Papers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<page image="JuicerCheckFailedInner3.png"/>
</paper>

<!-- Make the keys appear on the right instead of travelers seemingly giving them -->
<paper id="KeyTranq" outer="KeyTranqOuter.png" reveal="spitfromright" sounds="metal" oddshape="true">
<page image="KeyTranqInner.png"/>
</paper>

<paper id="KeyKill" outer="KeyKillOuter.png" reveal="spitfromright" sounds="metal" oddshape="true">
<page image="KeyKillInner.png"/>
</paper>

<!-- Rules -->
<paper id="Rules" outer="RulesOuter.png" font="regular" textcolor="0x574848" dock="true">
<page id="home" image="RulesInnerHome.png" backcolor="0xe4e6bd">
Expand Down
10 changes: 7 additions & 3 deletions psp-papers-mod/src/Patches/BorderPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ public static void SendChatterRunner() {
[HarmonyPrefix]
[HarmonyPatch("checkSniped", typeof(Person), typeof(PointData), typeof(string))]
private static bool SnipedPrefix(Person person, PointData pos, string shotAnim, ref bool __result) {
if (person.id != "waiting" && person.id != "guard0" && person.id != "guard1") return true;
if (person.id != "guard0" && person.id != "guard1") return true;
// Killing two left guards during detains breaks the game

// Killing the people in queue breaks the game
// So does killing the two left guards during detains
__result = false;
return false;
}
Expand All @@ -55,6 +54,11 @@ private static bool SnipedPrefix(Person person, PointData pos, string shotAnim,
private static void SnipedPostfix(Person person, PointData pos, string shotAnim, ref bool __result) {
if (!__result) return;

// Can't call traveler if they were shot, have to remove from queue
if (person.id == "waiting") {
Border.waitingLine.people.remove(person);
}

Console.Out.WriteLine("SNIPED " + person.id + " SHOTANIM: " + shotAnim);
}

Expand Down