Skip to content

Commit

Permalink
Merge pull request #10 from AzumattDev/master
Browse files Browse the repository at this point in the history
v1.2.8
  • Loading branch information
AzumattDev authored Jul 11, 2023
2 parents 1e827c7 + ce1b0a2 commit d841e77
Show file tree
Hide file tree
Showing 21 changed files with 1,069 additions and 394 deletions.
165 changes: 92 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,103 @@
![enter image description here](https://i.imgur.com/OAfRGXK.jpg)
![Valheim VeinMine](https://i.imgur.com/OAfRGXK.jpg)

Tired of mining for ages?
With Veinmine you're able to mine the whole ore/rock vein at once!
You can do this by holding down the assigned key (Left Alt by default) while mining!

`Version checks with itself. If installed on the server, it will kick clients who do not have it installed.`

`This mod uses ServerSync, if installed on the server and all clients, it will sync all configs to client`

`This mod uses a file watcher. If the configuration file is not changed with BepInEx Configuration manager, but changed in the file directly on the server, upon file save, it will sync the changes to all clients.`

## **Version 1.0.0 - Progressive mode added!**

### **Please delete your previous config when updating as it might break something.**

You can now enable progressive mode in the config, making it so veinmining is scaled by your Pickaxes level. This is intended to be a less OP way of veinmining, where the tradeoff is taking higher durability damage (and less xp) than if you mined manually.
You can now enable progressive mode in the config, making it so veinmining is scaled by your Pickaxes level. This is
intended to be a less OP way of veinmining, where the tradeoff is taking higher durability damage (and less xp) than if
you mined manually.

The radius of the veinmined area is also scaled by your Pickaxes level.

It works by checking for rocks in a radius set by the Progressive Level Multiplier value in the config. This value is
multiplied by your Pickaxes level to obtain a radius.

By default, it's set to 0.1 so assuming your Pickaxes level is 20, the radius will be 0.1 * 20 = 2.

What does 2 mean, you ask?

The radius of the veinmined area is also scaled by your Pickaxes level.

It works by checking for rocks in a radius set by the Progressive Level Multiplier value in the config. This value is multiplied by your Pickaxes level to obtain a radius.

By default, it's set to 0.1 so assuming your Pickaxes level is 20, the radius will be 0.1 * 20 = 2.

What does 2 mean, you ask?

It's simple! A standard 2x2 floor piece has a length of 2, exactly like its name suggests.
# Changelog
## 1.2.6
- Compatibility with Mistlands and fix for Silver ore exception.
### 1.2.5
- Tentative fix for multiplayer veinmining by replacing the use of Player.m_localPlayer with Player.GetClosestPlayer.
### 1.2.4
- Fixed an exception that was thrown when mining Leviathans.
- Added veinmining support for Leviathans and Glowing Metal (Flametal Ore).
### 1.2.3
- Fixed a bug that allowed players to veinmine (and gain exp) without a pickaxe.
### 1.2.2
- Possible fix for ore drop quantities (Not sure why they weren't correct, as I don't change drop rates)
### 1.2.1
- Compatibility for Hearth and Home;
- Tentative fix for ores spawning at 0,0 (unable to test without other players)
### 1.2.0
- Replaced 'Even' spread damage option with 'Level' as even was useless when the mined vein had a large number of sections.
- Refactored code.
### 1.1.9
- Fixed incompatibility with Rocky Ore mod.
### 1.1.8
- Fixed a bug that was causing no ores to be dropped (hopefully)
### 1.1.7
- Fixed a bug that caused ores to drop every single pickaxe swing when mining manually.
### 1.1.6
- Fixed a bug that was causing no drops to be received when veinmining.
### 1.1.5
#### Please delete your previous config when updating to this version.
- Damage text when veinmining should now display on top of each rock section
- Veinmining when Progressive mode is disabled is now instant
- Spread damage now has two options: Even and Distance
- Even is the same as previous versions
- Distance makes it so the damage dealt to a rock section is based on distance. The farther away a section is, the less damage is dealt.

### 1.1.4
- Fixed a bug where if you had spread damage enabled, mining damage would also be reduced when mining manually.
### 1.1.3
- Added config option for spreading damage in progressive mode (divides your mining damage equally between all rock sections affected, as opposed to doing full damage to all sections)
- This is disabled by default.
### 1.1.2
- Fixed incompatibility with mods that alter the pickaxe's durability drain values. The value modified by such mods (m_useDurabilityDrain) is now multiplied by the result of the previous formula (which is shown in the config). Take this into account when editing this mod's durability modifier.
### 1.1.1
- Added config options for durability and xp multipliers for Progressive mode.
### 1.1.0
- Durability taken is now scaled to the player's Pickaxes level when Progressive mode is enabled. This is meant to (somewhat) balance veinmining so it fits in with vanilla.
- The formula is (120 - Level) / 20, so if you have level 50: (120 - 50) / 20 = 3.5 durability taken **per rock section veinmined**
### 1.0.1
- Removed log messages to avoid spam.
### 1.0.0
- Added Progressive mode.
#### 0.0.1.4
- Fixed a bug that allowed monsters to veinmine and/or give XP to the player.
#### 0.0.1.3
- Indestructible items no longer lose durability. (such as items from Epic Loot)
- Added config option to disable mining visual effects, which *might* help reduce fps lag. (disabled by default)
#### 0.0.1.2
- Added config option for veinmining to take pickaxe durability for each section mined (default = true).
- XP is now only awarded if the section mined wasn't already destroyed.
- Fixed a NullReferenceException thrown when there were more than 128 rock sections.
#### 0.0.1.1
- Mining xp is now awarded for every rock section mined.
#### 0.0.1.0
- Initial release

---

<details>
<summary><b>Installation Instructions</b></summary>

***You must have BepInEx installed correctly! I can not stress this enough.***

### Manual Installation

`Note: (Manual installation is likely how you have to do this on a server, make sure BepInEx is installed on the server correctly)`

1. **Download the latest release of BepInEx.**
2. **Extract the contents of the zip file to your game's root folder.**
3. **Download the latest release of VeinMine from Thunderstore.io. (or Nexus Mods)**
4. **Extract the contents of the zip file to the `BepInEx/plugins` folder.**
5. **Launch the game.**

### Installation through Vortex

https://www.youtube.com/watch?v=Kt_6lwGd2Ns

### Installation through r2modman or Thunderstore Mod Manager

1. **Install [r2modman](https://valheim.thunderstore.io/package/ebkr/r2modman/)
or [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager).**

> For r2modman, you can also install it through the Thunderstore site.
![](https://i.imgur.com/s4X4rEs.png "r2modman Download")

> For Thunderstore Mod Manager, you can also install it through the Overwolf app store
![](https://i.imgur.com/HQLZFp4.png "Thunderstore Mod Manager Download")
2. **Open the Mod Manager and search for "" under the Online
tab. `Note: You can also search for "Azumatt" to find all my mods.`**

`The image below shows VikingShip as an example, but it was easier to reuse the image.`

![](https://i.imgur.com/5CR5XKu.png)

3. **Click the Download button to install the mod.**
4. **Launch the game.**

</details>

<br>
<br>

`Feel free to reach out to me on discord if you need manual download assistance.`

# Current Author (Maintainer) Information

### Azumatt

`DISCORD:` Azumatt#2625

`STEAM:` https://steamcommunity.com/id/azumatt/

`GITHUB:` https://github.com/AzumattDev

For Questions or Comments, find me in the Odin Plus Team Discord or in mine:

[![https://i.imgur.com/XXP6HCU.png](https://i.imgur.com/XXP6HCU.png)](https://discord.gg/Pb6bVMnFb2)
<a href="https://discord.gg/pdHgy6Bsng"><img src="https://i.imgur.com/Xlcbmm9.png" href="https://discord.gg/pdHgy6Bsng" width="175" height="175"></a>

<hr>

# Original Author Information

### WiseHorror

`DISCORD:` WiseHorror (wisehorror)

`GitHub:` https://github.com/WiseHorror
9 changes: 8 additions & 1 deletion VeinMine/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
libs/
bin/
obj/
/packages/
riderModule.iml
/_ReSharper.Caches/
VeinMine.sln.DotSettings.user
.idea
.vs
4 changes: 2 additions & 2 deletions VeinMine/Functions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace WiseHorror.Veinmine
namespace Veinmine
{
class Functions
{
Expand Down Expand Up @@ -34,7 +34,7 @@ public static HitData SpreadDamage(HitData hit)
{
if (hit != null)
{
if (VeinMine.spreadDamageType.Value == VeinMine.spreadTypes.level)
if (VeinMinePlugin.spreadDamageType.Value == VeinMinePlugin.SpreadTypes.Level)
{
float modifier = (float)GetSkillLevel(Player.GetClosestPlayer(hit.m_point, 5f).GetSkills(), Skills.SkillType.Pickaxes) * 0.01f;
hit.m_damage.m_pickaxe *= modifier;
Expand Down
10 changes: 10 additions & 0 deletions VeinMine/ILRepack.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="ILRepacker" AfterTargets="Build">
<ItemGroup>
<InputAssemblies Include="$(TargetPath)" />
<InputAssemblies Include="$(OutputPath)\ServerSync.dll" />
</ItemGroup>
<ILRepack Parallel="true" DebugInfo="true" Internalize="true" InputAssemblies="@(InputAssemblies)" OutputFile="$(TargetPath)" TargetKind="SameAsPrimaryAssembly" LibraryPath="$(OutputPath)" />
</Target>
</Project>
5 changes: 5 additions & 0 deletions VeinMine/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Copyright 2023 WiseHorror/Azumatt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added VeinMine/Nexus/Veinmine_v1.2.8.zip
Binary file not shown.
Loading

0 comments on commit d841e77

Please sign in to comment.