Skip to content

Commit

Permalink
Fix structural integrity values and cleanup mapped settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Grantapher committed Jun 12, 2024
1 parent 7431b08 commit e18ea01
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 418 deletions.
85 changes: 85 additions & 0 deletions lib/config-util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
export const assignEach: (section: string, value: string, settings: string[]) => { [setting: string]: string } = (
section: string,
value: string,
settings: string[]
) => {
const prefix = `VPCFG_${section}_`;
return settings.map((setting) => ({ [prefix + setting]: value })).reduce((prev, curr) => Object.assign(prev, curr));
};

export const ALL_STRUCTURAL_INTEGRITY_MODIFIER_SETTINGS = [
"wood",
"stone",
"iron",
"hardWood",
"marble",
"ashstone",
"ancient",
];

export const ALL_DURABILITY_SETTINGS = [
"axes",
"pickaxes",
"hammer",
"cultivator",
"hoe",
"weapons",
"armor",
"bows",
"shields",
"torch",
];

export const ALL_EXPERIENCE_SETTINGS = [
"swords",
"knives",
"clubs",
"polearms",
"spears",
"blocking",
"axes",
"bows",
"elementalMagic",
"bloodMagic",
"unarmed",
"pickaxes",
"woodCutting",
"crossbows",
"jump",
"sneak",
"run",
"swim",
"fishing",
"ride",
];

export const ALL_GATHERING_SETTINGS = [
"wood",
"fineWood",
"coreWood",
"elderBark",
"yggdrasilWood",
"stone",
"blackMarble",
"tinOre",
"copperOre",
"copperScrap",
"ironScrap",
"silverOre",
"chitin",
"feather",
"grausten",
"blackwood",
"flametalOre",
"proustitePowder",
];

export const ALL_PICKABLE_SETTINGS = [
"edibles",
"flowersAndIngredients",
"materials",
"valuables",
"surtlingCores",
"blackCores",
"questItems",
];
53 changes: 9 additions & 44 deletions lib/valheim-plus-config-ezpz.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ALL_EXPERIENCE_SETTINGS, ALL_GATHERING_SETTINGS, ALL_PICKABLE_SETTINGS, assignEach } from "./config-util";

export default {
// Valheim plus options as env config...
VPCFG_Server_enabled: "true", // enable V+, server syncing of configs, and enforcing v+ installations
Expand All @@ -23,6 +25,9 @@ export default {
VPCFG_CraftFromChest_enabled: "true", // craft from chests/carts/ships around your nearest workbench
VPCFG_CraftFromChest_range: "30",

VPCFG_Experience_enabled: "true", // 5x all experience
...assignEach("Experience", "400", ALL_EXPERIENCE_SETTINGS),

VPCFG_Fermenter_enabled: "true",
VPCFG_Fermenter_showDuration: "true", // show mins/secs to finishing
VPCFG_Fermenter_fermenterDuration: "1200", // .5x
Expand Down Expand Up @@ -58,6 +63,7 @@ export default {

VPCFG_Gathering_enabled: "true", // see bottom for rates
VPCFG_Gathering_dropChance: "900", // 10x drop chance
...assignEach("Gathering", "200", ALL_GATHERING_SETTINGS), // 3x all drop amounts

VPCFG_GridAlignment_enabled: "true", // global grid alignment when building using left alt

Expand Down Expand Up @@ -98,6 +104,9 @@ export default {
VPCFG_Map_shareMapProgression: "true", // share map among players
VPCFG_Map_shareAllPins: "true", // share pins among players

VPCFG_Pickable_enabled: "true", // 3x all drop amounts
...assignEach("Pickable", "200", ALL_PICKABLE_SETTINGS),

VPCFG_Player_enabled: "true",
VPCFG_Player_baseMegingjordBuff: "300", // belt does 2x weight instead of the 1.5x default
VPCFG_Player_baseAutoPickUpRange: "3", // 1.5x auto pickup range
Expand Down Expand Up @@ -155,48 +164,4 @@ export default {
VPCFG_Workbench_enabled: "true",
VPCFG_Workbench_workbenchRange: "30", // 1.5x radius
VPCFG_Workbench_workbenchAttachmentRange: "10", // 2x radius

VPCFG_Experience_enabled: "true", // 5x all experience
...[
"swords",
"knives",
"clubs",
"polearms",
"spears",
"blocking",
"axes",
"bows",
"fireMagic",
"frostMagic",
"unarmed",
"pickaxes",
"woodCutting",
"jump",
"sneak",
"run",
"swim",
"ride",
]
.map((it) => ({ [`VPCFG_Experience_${it}`]: "400" }))
.reduce((prev, curr) => Object.assign(prev, curr)),

...[
// 3x all drop amounts
"wood",
"stone",
"fineWood",
"coreWood",
"elderBark",
"ironScrap",
"tinOre",
"copperOre",
"silverOre",
"Chitin",
]
.map((it) => ({ [`VPCFG_Gathering_${it}`]: "200" }))
.reduce((prev, curr) => Object.assign(prev, curr)),
VPCFG_Pickable_enabled: "true", // 3x all drop rates
...["edibles", "flowersAndIngredients", "materials", "valuables", "surtlingCores"]
.map((it) => ({ [`VPCFG_Pickable_${it}`]: "200" }))
.reduce((prev, curr) => Object.assign(prev, curr)),
};
Loading

0 comments on commit e18ea01

Please sign in to comment.