Skip to content

Commit

Permalink
Journal Entry Update. Now dependancy: FrogCore. You can get it from h…
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFrog6002 committed Oct 18, 2020
1 parent 5bec62c commit 1eb15be
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 18 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# HollowKnight.Uuwuu
Hollow Knight mod that adds an harder version of uumuu to godhome
By RedFrog6002

Hollow Knight mod that adds an harder version of uumuu to godhome

# Mod Installer Readme
By RedFrog6002
Uumuu but only a little bit harder

Uuwuu because I couldn't think of anything else

also if it is too hard, there is a new charm
also if it is too hard, there is a new charm that makes it easier

your reward is a journal entry

if you feel it's too easy, beat it 3 times to get the notes of the entry
Binary file removed Uuwuu/Resources/Spellmaster.png
Binary file not shown.
Binary file added Uuwuu/Resources/Uumuu_picture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Uuwuu/Resources/Uumuu_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Uuwuu/Resources/Uuwuu2.png
Binary file not shown.
Binary file added Uuwuu/Resources/divider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Uuwuu/Resources/glass.png
Binary file not shown.
3 changes: 3 additions & 0 deletions Uuwuu/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ public bool EquippedCharm
base.SetBool(value);
}
}
public bool haskilled = false;
public bool newentry = true;
public int killsleft = 3;
}
}
3 changes: 2 additions & 1 deletion Uuwuu/Uumuu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private static ParticleSystem AddTrail(GameObject go, float offset = 0f, Color?
}
private Vector2 box;
private Vector2 circle;
// Token: 0x06000090 RID: 144 RVA: 0x0000253E File Offset: 0x0000073E
private IEnumerator Start()
{
yield return null;
Expand Down Expand Up @@ -94,6 +93,8 @@ private IEnumerator Start()
base.gameObject.GetComponent<global::tk2dSprite>().color = new Color(1f, 2f, 1f, 1f);
base.gameObject.GetComponent<global::tk2dSprite>().FlipX = true;
base.gameObject.GetComponent<global::tk2dSprite>().FlipY = true;
string s = "CustomJournal" + Uuwuu.Instance.jh.entrynumber;
Modding.ReflectionHelper.SetAttr<EnemyDeathEffects, string>(GetComponent<EnemyDeathEffects>(), "playerDataName", s);
base.gameObject.transform.SetScaleX(base.gameObject.transform.GetScaleX() + 0.07f);
base.gameObject.transform.SetScaleY(base.gameObject.transform.GetScaleY() + 0.07f);
box = base.gameObject.GetComponent<BoxCollider2D>().offset;
Expand Down
80 changes: 70 additions & 10 deletions Uuwuu/Uuwuu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using SFCore;
using FrogCore;

namespace Uuwuu
{
Expand Down Expand Up @@ -127,20 +128,24 @@ private string OnLangGet(string key, string sheettitle)
// Token: 0x0600004C RID: 76 RVA: 0x0000235A File Offset: 0x0000055A
private void SaveGame(SaveGameData data)
{
Uuwuu.AddComponent();
AddComponent();
}

// Token: 0x0600004E RID: 78 RVA: 0x00002384 File Offset: 0x00000584
private static void AddComponent()
private void AddComponent()
{
GameManager.instance.gameObject.AddComponent<UumuuFinder>();
jh.playerData.haskilled = Settings.haskilled;
jh.playerData.killsremaining = Settings.killsleft;
jh.playerData.newentry = Settings.newentry;
}

// Token: 0x0600004F RID: 79 RVA: 0x00003350 File Offset: 0x00001550
public void Unload()
{
ModHooks.Instance.BeforeSavegameSaveHook -= Instance_BeforeSavegameSaveHook;
ModHooks.Instance.AfterSavegameLoadHook -= this.SaveGame;
ModHooks.Instance.NewGameHook -= Uuwuu.AddComponent;
ModHooks.Instance.NewGameHook -= AddComponent;
ModHooks.Instance.LanguageGetHook -= this.OnLangGet;
UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= this.SceneChanged;
ModHooks.Instance.GetPlayerVariableHook -= this.GetVariableHook;
Expand Down Expand Up @@ -172,7 +177,7 @@ public override void Initialize(Dictionary<string, Dictionary<string, GameObject
this.SetupSettings();
ModHooks.Instance.BeforeSavegameSaveHook += Instance_BeforeSavegameSaveHook;
ModHooks.Instance.AfterSavegameLoadHook += this.SaveGame;
ModHooks.Instance.NewGameHook += Uuwuu.AddComponent;
ModHooks.Instance.NewGameHook += AddComponent;
ModHooks.Instance.LanguageGetHook += this.OnLangGet;
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += this.SceneChanged;
ModHooks.Instance.GetPlayerVariableHook += this.GetVariableHook;
Expand Down Expand Up @@ -200,20 +205,77 @@ public override void Initialize(Dictionary<string, Dictionary<string, GameObject
tex.LoadImage(buffer);

//Create sprite from texture
Sprites.Add(res, Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)));
Sprites2[1] = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
Sprites.Add("Charm", Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)));
Log("Created sprite from embedded image: " + res);
}
}
if (res.Contains("Uumuu_picture.png"))
{
using (Stream s = asm.GetManifestResourceStream(res))
{
if (s == null) continue;
byte[] buffer = new byte[s.Length];
s.Read(buffer, 0, buffer.Length);
s.Dispose();

//Create texture from bytes
Texture2D tex = new Texture2D(1, 1);
tex.LoadImage(buffer);

//Create sprite from texture
Sprites.Add("Picture", Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)));
Log("Created sprite from embedded image: " + res);
}
}
if (res.Contains("Uumuu_portrait.png"))
{
using (Stream s = asm.GetManifestResourceStream(res))
{
if (s == null) continue;
byte[] buffer = new byte[s.Length];
s.Read(buffer, 0, buffer.Length);
s.Dispose();

//Create texture from bytes
Texture2D tex = new Texture2D(1, 1);
tex.LoadImage(buffer);

//Create sprite from texture
Sprites.Add("Portrait", Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)));
Log("Created sprite from embedded image: " + res);
}
}
if (res.Contains("divider.png"))
{
using (Stream s = asm.GetManifestResourceStream(res))
{
if (s == null) continue;
byte[] buffer = new byte[s.Length];
s.Read(buffer, 0, buffer.Length);
s.Dispose();

//Create texture from bytes
Texture2D tex = new Texture2D(1, 1);
tex.LoadImage(buffer);

//Create sprite from texture
Sprites.Add("Divider", Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)));
Log("Created sprite from embedded image: " + res);
}
}
}
this.ChHelper = new CharmHelper();
ChHelper.customCharms = 1;
ChHelper.customSprites[0] = Uuwuu.Instance.Sprites2[1];
ChHelper.customSprites[0] = Uuwuu.Instance.Sprites["Charm"];
jh = JournalHelper.AddJournalEntry(Sprites["Portrait"], Sprites["Picture"], new JournalHelper.JournalPlayerData() { haskilled = false, Hidden = true, killsremaining = 3, newentry = true }, new JournalHelper.JournalNameStrings() { name = "Uuwuu", desc = "Hidden master of the Fog Canyon", note = "I'm gonna kill you uwu - Uuwuu", shortname = "Uuwuu" }, JournalHelper.EntryType.Custom, Sprites["Divider"]);
}

public JournalHelper jh { get; set; }
private void Instance_BeforeSavegameSaveHook(SaveGameData data)
{
PlayerData.instance.statueStateUumuu.usingAltVersion = false;
Settings.haskilled = jh.playerData.haskilled;
Settings.killsleft = jh.playerData.killsremaining;
Settings.newentry = jh.playerData.newentry;
}

private void SetupSettings()
Expand Down Expand Up @@ -267,8 +329,6 @@ private object GetVariableHook(Type t, string key, object orig)
public int charmnum1 = 41;

public Dictionary<string, Sprite> Sprites = new Dictionary<string, Sprite>();

public Sprite[] Sprites2 = new Sprite[2];
public CharmHelper ChHelper { get; private set; }
}
}
13 changes: 10 additions & 3 deletions Uuwuu/Uuwuu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Hollow Knight\hollow_knight_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="FrogCore">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Hollow Knight\hollow_knight_Data\Managed\Mods\FrogCore.dll</HintPath>
</Reference>
<Reference Include="ModCommon">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Hollow Knight\hollow_knight_Data\Managed\Mods\ModCommon.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -105,10 +108,14 @@
<Compile Include="UumuuFinder.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Spellmaster.png" />
<EmbeddedResource Include="Resources\glass.png" />
<EmbeddedResource Include="Resources\Uuwuu2.png" />
<EmbeddedResource Include="Resources\Uuwuu.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Uumuu_picture.png" />
<EmbeddedResource Include="Resources\Uumuu_portrait.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\divider.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

0 comments on commit 1eb15be

Please sign in to comment.