Skip to content

Commit

Permalink
Merge pull request #264 from jpw1991/263-prepare-for-ashlands
Browse files Browse the repository at this point in the history
263 prepare for ashlands
  • Loading branch information
jpw1991 authored May 14, 2024
2 parents 37f2e34 + 7f831c3 commit 3da4a78
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 28 deletions.
4 changes: 2 additions & 2 deletions ChebsNecromancy/BasePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ internal class BasePlugin : BaseUnityPlugin
{
public const string PluginGuid = "com.chebgonaz.ChebsNecromancy";
public const string PluginName = "ChebsNecromancy";
public const string PluginVersion = "4.9.1";
public const string PluginVersion = "4.10.0";
private const string ConfigFileName = PluginGuid + ".cfg";
private static readonly string ConfigFileFullPath = Path.Combine(Paths.ConfigPath, ConfigFileName);

public readonly System.Version ChebsValheimLibraryVersion = new("2.5.4");
public readonly System.Version ChebsValheimLibraryVersion = new("2.6.1");

private readonly Harmony harmony = new(PluginGuid);

Expand Down
9 changes: 4 additions & 5 deletions ChebsNecromancy/ChebsNecromancy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Guid>e3243d22-4307-4008-ba36-9f326008cde5</Guid>

<!-- Version Information -->
<Version>4.9.1.0</Version>
<Version>4.10.0.0</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>

Expand All @@ -36,13 +36,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1">
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ChebsValheimLibrary" Version="2.5.4"/>
<PackageReference Include="HarmonyX" Version="2.10.2"/>
<PackageReference Include="JotunnLib" Version="2.16.2"/>
<PackageReference Include="ChebsValheimLibrary" Version="2.6.1" />
<PackageReference Include="JotunnLib" Version="2.19.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion ChebsNecromancy/Items/Armor/Player/NecromancerHood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override void UpdateRecipe()
UpdateRecipe(CraftingStationRequired, CraftingCost, CraftingStationLevel);
}

public override CustomItem GetCustomItemFromPrefab(GameObject prefab)
public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixReference = true)
{
ItemConfig config = new ItemConfig();
config.Name = "$item_chebgonaz_necromancerhood";
Expand Down
2 changes: 1 addition & 1 deletion ChebsNecromancy/Items/Armor/Player/SpectralShroud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public override void UpdateRecipe()
UpdateRecipe(CraftingStationRequired, CraftingCost, CraftingStationLevel);
}

public override CustomItem GetCustomItemFromPrefab(GameObject prefab)
public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixReference = true)
{
ItemConfig config = new ItemConfig();
config.Name = "$item_friendlyskeletonwand_spectralshroud";
Expand Down
2 changes: 1 addition & 1 deletion ChebsNecromancy/Items/Wands/DraugrWand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public override void UpdateRecipe()
UpdateRecipe(CraftingStationRequired, CraftingCost, CraftingStationLevel);
}

public override CustomItem GetCustomItemFromPrefab(GameObject prefab)
public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixReference = true)
{
var config = new ItemConfig();
config.Name = "$item_friendlyskeletonwand_draugrwand";
Expand Down
2 changes: 1 addition & 1 deletion ChebsNecromancy/Items/Wands/OrbOfBeckoning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public override void UpdateRecipe()
UpdateRecipe(CraftingStationRequired, CraftingCost, CraftingStationLevel);
}

public override CustomItem GetCustomItemFromPrefab(GameObject prefab)
public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixReference = true)
{
ItemConfig config = new();
config.Name = NameLocalization;
Expand Down
2 changes: 1 addition & 1 deletion ChebsNecromancy/Items/Wands/SkeletonWand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public override void UpdateRecipe()
UpdateRecipe(CraftingStationRequired, CraftingCost, CraftingStationLevel);
}

public override CustomItem GetCustomItemFromPrefab(GameObject prefab)
public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixReference = true)
{
ItemConfig config = new ItemConfig();
config.Name = "$item_friendlyskeletonwand";
Expand Down
6 changes: 3 additions & 3 deletions ChebsNecromancy/Items/Wands/Wand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public virtual void CreateButtons()
Name = ItemName + "Follow",
Config = FollowConfig,
GamepadConfig = FollowGamepadConfig,
HintToken = "$friendlyskeletonwand_follow",
HintToken = "$chebgonaz_follow",
BlockOtherInputs = true
};
InputManager.Instance.AddButton(BasePlugin.PluginGuid, FollowButton);
Expand All @@ -161,7 +161,7 @@ public virtual void CreateButtons()
Name = ItemName + "Wait",
Config = WaitConfig,
GamepadConfig = WaitGamepadConfig,
HintToken = "$friendlyskeletonwand_wait",
HintToken = "$chebgonaz_wait",
BlockOtherInputs = true
};
InputManager.Instance.AddButton(BasePlugin.PluginGuid, WaitButton);
Expand Down Expand Up @@ -263,7 +263,7 @@ public void MakeNearbyMinionsFollow(float radius, bool follow)
if (distance > radius && !minionFollowingOrb) continue;

MessageHud.instance.ShowMessage(MessageHud.MessageType.Center,
follow ? "$friendlyskeletonwand_skeletonfollowing" : "$friendlyskeletonwand_skeletonwaiting");
follow ? "$chebgonaz_skeletonfollowing" : "$chebgonaz_skeletonwaiting");
if (follow)
{
minion.Follow(player.gameObject);
Expand Down
4 changes: 2 additions & 2 deletions ChebsNecromancy/Package/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ChebsNecromancy",
"description": "Cheb's Necromancy adds Necromancy to Valheim via craftable wands and structures. Minions will follow you, guard your base, and perform menial tasks.",
"version_number": "4.9.1",
"version_number": "4.10.0",
"website_url": "https://github.com/jpw1991/chebs-necromancy",
"dependencies": [
"ValheimModding-Jotunn-2.16.2"
"ValheimModding-Jotunn-2.19.3"
]
}
16 changes: 8 additions & 8 deletions ChebsNecromancy/Structures/TreasurePylon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ IEnumerator LookForPieces()
while (true)
{
yield return new WaitForSeconds(UpdateInterval.Value + Random.value);

if (!piece.m_nview.IsOwner()) continue;
if (!piece || !piece.m_nview.IsOwner()) continue;

var playersInRange = new List<Player>();
Player.GetPlayersInRange(transform.position, PlayerDetectionDistance, playersInRange);
Expand All @@ -102,7 +102,7 @@ IEnumerator LookForPieces()
c => c.m_piece != null && c.m_piece.IsPlacedByPlayer()
&& allowedContainers.Contains(c.m_piece.m_nview.GetPrefabName()), true);

for (int i = 0; i < nearbyContainers.Count; i++)
for (var i = 0; i < nearbyContainers.Count; i++)
{
yield return new WaitWhile(() => playersInRange[0].IsSleeping());

Expand All @@ -123,19 +123,19 @@ IEnumerator LookForPieces()
var currentContainerInventory = nearbyContainers[i].GetInventory();
//var currentContainerItems = currentContainerInventory.GetAllItems();

for (int j = 0; j < nearbyContainers.Count; j++)
for (var j = 0; j < nearbyContainers.Count; j++)
{
if (j == i) continue; // skip over self

var otherInventory = nearbyContainers[j].GetInventory();
var otherItems = otherInventory.GetAllItems();

for (int k = otherItems.Count - 1; k > -1; k--)
for (var k = otherItems.Count - 1; k > -1; k--)
{
ItemDrop.ItemData jItem = otherItems[k];
var jItem = otherItems[k];

int currentContainerItemCount = currentContainerInventory.CountItems(jItem.m_shared.m_name);
int otherContainerItemCount = otherInventory.CountItems(jItem.m_shared.m_name);
var currentContainerItemCount = currentContainerInventory.CountItems(jItem.m_shared.m_name);
var otherContainerItemCount = otherInventory.CountItems(jItem.m_shared.m_name);

if (currentContainerItemCount > otherContainerItemCount)
{
Expand Down
2 changes: 1 addition & 1 deletion Friendly-Skeleton-Wand.wiki
Submodule Friendly-Skeleton-Wand.wiki updated from 9dc209 to f040d3
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ A special thanks to the people who've helped me along the way:

Date | Version | Notes
--- | --- | ---
25/04/2024 | 4.10.0 | Prepare for ashlands; upgrade CVL
28/01/2024 | 4.9.1 | Reduce logging in case of missing bone color data
27/01/2024 | 4.9.0 | Add different healing levels & spells to the priests; fix a bug that erased some default equipment set in Unity
25/01/2024 | 4.8.0 | Add skeleton priest to heal other minions
Expand Down
9 changes: 7 additions & 2 deletions Translations/Russian/chebsnecromancy.russian.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@
"chebgonaz_miniontype_poison": "Ядовитого скелета",
"chebgonaz_miniontype_mage": "Мага",
"chebgonaz_miniontype_leech": "Пиявку",
"chebgonaz_miniontype_battleneckro": "Боевого никса"
}
"chebgonaz_miniontype_priest": "Жреца",
"chebgonaz_miniontype_battleneckro": "Боевого никса",
"chebgonaz_worker_target": "Цель",
"chebgonaz_worker_cantfindtarget": "Не могу найти цель.",
"chebgonaz_phylactery_name": "Филактерий",
"chebgonaz_phylactery_desc": "Некроманту не составит труда избежать смерти. Все что требуется, это другая душа, которую нужно принести в жертву богам вместо своей собственной."
}

0 comments on commit 3da4a78

Please sign in to comment.