Skip to content

Commit

Permalink
Heart and Home update
Browse files Browse the repository at this point in the history
-Updated skills
-Updated food consumed
-Update item list
  • Loading branch information
james2432 committed Dec 23, 2021
1 parent 63df059 commit 9fbd36e
Show file tree
Hide file tree
Showing 40 changed files with 866 additions and 32 deletions.
2 changes: 1 addition & 1 deletion ValheimCharacterEditor/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ValheimCharacterEditor/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using System.Linq;
using System.Collections.Generic;

namespace ValheimCharacterEditor
{
Expand Down
Binary file added ValheimCharacterEditor/Images/Acorn.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 ValheimCharacterEditor/Images/ArmorRootChest.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 ValheimCharacterEditor/Images/ArmorRootLegs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ValheimCharacterEditor/Images/BirchSeeds.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 ValheimCharacterEditor/Images/BlackSoup.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 ValheimCharacterEditor/Images/BoarJerky.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 ValheimCharacterEditor/Images/CookedDeerMeat.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 ValheimCharacterEditor/Images/CookedWolfMeat.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 ValheimCharacterEditor/Images/DeerMeat.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 ValheimCharacterEditor/Images/DeerStew.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 ValheimCharacterEditor/Images/EyesCream.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 ValheimCharacterEditor/Images/FishCooked.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 ValheimCharacterEditor/Images/FishRaw.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 ValheimCharacterEditor/Images/HelmetRoot.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 ValheimCharacterEditor/Images/LoxSaddle.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 ValheimCharacterEditor/Images/OnionSoup.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 ValheimCharacterEditor/Images/Pukeberries.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 ValheimCharacterEditor/Images/Root.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ValheimCharacterEditor/Images/Tar.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 ValheimCharacterEditor/Images/Thunderstone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ValheimCharacterEditor/Images/TrophyGrowth.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 ValheimCharacterEditor/Images/WolfJerky.png
Binary file added ValheimCharacterEditor/Images/WolfMeat.png
Binary file added ValheimCharacterEditor/Images/WolfSkewer.png
Binary file added ValheimCharacterEditor/Images/knife_butcher.png
Binary file added ValheimCharacterEditor/Images/knife_silver.png
Binary file added ValheimCharacterEditor/Images/mincemeatsauce.png
Binary file added ValheimCharacterEditor/Images/onion.png
Binary file added ValheimCharacterEditor/Images/onionseeds.png
36 changes: 28 additions & 8 deletions ValheimCharacterEditor/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,24 @@ static public ValheimEngine.Character CharacterReadData(string path)
character.Foods = new List<ValheimEngine.Character.Food>();
for (var i = 0; i < numberOfConsumedFood; i++)
{
var food = new ValheimEngine.Character.Food
ValheimEngine.Character.Food food;
if (character.InventoryVersion < 25) //Pre-Heart and home
{
Name = byteAccess.ReadString(),
HpLeft = byteAccess.ReadSingle(),
StaminaLeft = byteAccess.ReadSingle()
};
food = new ValheimEngine.Character.Food
{
Name = byteAccess.ReadString(),
HpLeft = byteAccess.ReadSingle(),
StaminaLeft = byteAccess.ReadSingle()
};
}
else //heart and home release
{
food = new ValheimEngine.Character.Food
{
Name = byteAccess.ReadString(),
TimeEaten = byteAccess.ReadSingle()
};
}
character.Foods.Add(food);
}

Expand Down Expand Up @@ -287,9 +299,17 @@ static public byte[] CharacterWriteData(ValheimEngine.Character character)
byteAccess2.Write(character.Foods.Count);
foreach (var food in character.Foods)
{
byteAccess2.Write(food.Name);
byteAccess2.Write(food.HpLeft);
byteAccess2.Write(food.StaminaLeft);
if (character.InventoryVersion < 25)//pre-heart and home
{
byteAccess2.Write(food.Name);
byteAccess2.Write(food.HpLeft);
byteAccess2.Write(food.StaminaLeft);
}
else //Heart and home
{
byteAccess2.Write(food.Name);
byteAccess2.Write(food.TimeEaten);
}
}

byteAccess2.Write(character.SkillsVersion);
Expand Down
Loading

0 comments on commit 9fbd36e

Please sign in to comment.