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

Commit

Permalink
Added name of player that sent you a fool trap to notification
Browse files Browse the repository at this point in the history
  • Loading branch information
silent-destroyer committed Sep 9, 2023
1 parent f9deeb5 commit 8a1c12c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Patches/ItemPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public enum ItemResult {
GameObject.Find("_GameGUI(Clone)/PauseMenu/") != null || GameObject.Find("_OptionsGUI(Clone)") != null || PlayerCharacter.InstanceIsDead) {
return ItemResult.TemporaryFailure;
}

if (!ItemLookup.Items.ContainsKey(ItemName)) {
return ItemResult.PermanentFailure;
}
Expand Down Expand Up @@ -302,7 +302,7 @@ public enum ItemResult {
}

if (Item.Type == ItemTypes.FOOLTRAP) {
ApplyFoolEffect();
ApplyFoolEffect(networkItem.Player);
}

if (Item.Type == ItemTypes.SPECIAL) {
Expand Down Expand Up @@ -354,29 +354,39 @@ public enum ItemResult {
return ItemResult.Success;
}

private static void ApplyFoolEffect() {
private static void ApplyFoolEffect(int Player) {
System.Random Random = new System.Random();
int FoolType = PlayerCharacterPatches.StungByBee ? Random.Next(21, 100) : Random.Next(100);
string FoolMessageTop = $"";
string FoolMessageBottom = $"";
if (FoolType < 35) {
SFX.PlayAudioClipAtFox(PlayerCharacter.instance.bigHurtSFX);
PlayerCharacter.instance.IDamageable_ReceiveDamage(PlayerCharacter.instance.hp / 3, 0, Vector3.zero, 0, 0);
ShowNotification($"yoo R A \"<#ffd700>FOOL<#ffffff>!!\"", $"\"(\"it wuhz A swRm uhv <#ffd700>bEz\"...)\"");
FoolMessageTop = $"yoo R A \"<#ffd700>FOOL<#ffffff>!!\"";
FoolMessageBottom = $"\"(\"it wuhz A swRm uhv <#ffd700>bEz\"...)\"";
PlayerCharacterPatches.StungByBee = true;
PlayerCharacter.instance.Flinch(true);
} else if (FoolType >= 35 && FoolType < 50) {
PlayerCharacter.ApplyRadiationAsDamageInHP(0f);
PlayerCharacter.instance.stamina = 0;
PlayerCharacter.instance.cachedFireController.FireAmount = 3f;
SFX.PlayAudioClipAtFox(PlayerCharacter.instance.bigHurtSFX);
ShowNotification($"yoo R A \"<#FF3333>FOOL<#ffffff>!!\"", $"iz it hawt in hEr?");
FoolMessageTop = $"yoo R A \"<#FF3333>FOOL<#ffffff>!!\"";
FoolMessageBottom = $"iz it hawt in hEr?";
PlayerCharacter.instance.Flinch(true);
} else if (FoolType >= 50) {
PlayerCharacter.ApplyRadiationAsDamageInHP(PlayerCharacter.instance.maxhp * .2f);
SFX.PlayAudioClipAtFox(PlayerCharacter.instance.bigHurtSFX);
SFX.PlayAudioClipAtFox(PlayerCharacter.standardFreezeSFX);
PlayerCharacter.instance.AddFreezeTime(3f);
ShowNotification($"yoo R A \"<#86A5FF>FOOL<#ffffff>!!\"", $"hahvi^ ahn Is tIm?");
FoolMessageTop = $"yoo R A \"<#86A5FF>FOOL<#ffffff>!!\"";
FoolMessageBottom = $"hahvi^ ahn Is tIm?";
}

if (Player != Archipelago.instance.GetPlayerSlot()) {
FoolMessageTop = $"\"{Archipelago.instance.GetPlayerName(Player)}\" %i^ks {FoolMessageTop}";
}
ShowNotification(FoolMessageTop, FoolMessageBottom);
}

public static void PotionCombine_Show_PostFixPatch(PotionCombine __instance) {
Expand Down

0 comments on commit 8a1c12c

Please sign in to comment.