-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModClass.cs
More file actions
42 lines (39 loc) · 1.79 KB
/
Copy pathModClass.cs
File metadata and controls
42 lines (39 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections;
using System.Collections.Generic;
using Modding;
using UnityEngine;
namespace Nomoreshards
{
public class Nomoreshards : Mod
{
//int lb = 0;
public Nomoreshards() : base("No More Shards") { }
public override string GetVersion() => "1.0";
public override void Initialize()
{
ModHooks.GetPlayerIntHook += ModHooks_GetPlayerIntHook;
ModHooks.GetPlayerBoolHook += ModHooks_GetPlayerBoolHook;
ModHooks.LanguageGetHook += ModHooks_LanguageGetHook;
}
private string ModHooks_LanguageGetHook(string key, string sheetTitle, string orig)
{
//Custom text for the Ancient Mask.
if (key == "INV_DESC_HEARTPIECE_ALL") return "An ancient artifact that brings unrestrained protection to its wearer, shielding the true form beneath.\n\nTo power it, collect the broken shards of its replicas scattered throughout the world.";
else return orig;
}
private int ModHooks_GetPlayerIntHook(string name, int orig)
{
if (name == "MPReserveCap") return 132; //Makes it so Ancient Vessel with appear at 4 vessels
if (name == "MPReserveMax" && orig > 132) return 132; //Caps vessels at 4 since the fifth breaks the game
if (name == "heartPieces") return 3; //Sets mask shards constantly at 3 so pickups will always be the 4th
else if (name == "vesselFragments") return 3; //Same with vessels, but idk why 2 didn't work and had to be 3
else return orig;
}
private bool ModHooks_GetPlayerBoolHook(string name, bool orig)
{
if (name == "heartPieceMax") return true; //This makes Ancient Mask always show up
else return orig;
}
}
}