Skip to content

Commit 8b6cd02

Browse files
committed
Initial Commit
0 parents  commit 8b6cd02

File tree

7 files changed

+381
-0
lines changed

7 files changed

+381
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Shardbyte
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!--
2+
#
3+
#
4+
###########################
5+
# #
6+
# Saint @ Shardbyte.com #
7+
# #
8+
###########################
9+
# Author: Shardbyte
10+
# License: MIT
11+
#
12+
-->
13+
<div id="header" align="center">
14+
<img src="https://raw.githubusercontent.com/Shardbyte/Shardbyte/main/img/logo-shardbyte-master-light.webp" alt="logo-shardbyte" width="150"/>
15+
</div>
16+
17+
---
18+
19+
## Overview
20+
21+
**FeatherLight** is a mod for SPT that makes multiple categories of items weightless, enhancing your gameplay experience by reducing encumbrance and allowing for greater mobility and agility in raids.
22+
23+
## Features
24+
25+
- **Weightless Items**: Multiple categories of items are set to zero weight.
26+
- **Improved Mobility**: Move faster and carry more without the burden of weight.
27+
- **Customizable**: Easily adjust which categories of items are weightless.
28+
29+
## Usage
30+
31+
After installing the FeatherLight mod, the following categories of items will be weightless by default:
32+
- Ammo
33+
- Throwables (Grenades)
34+
- Food
35+
- Drink
36+
- Medical Supplies
37+
38+
### Customization
39+
40+
To customize which categories of items are weightless:
41+
42+
1. Open the `config.jsonc` file located in the mod's directory.
43+
2. Edit the configuration to include or exclude categories as needed.
44+
3. Save your changes and restart SPT for the changes to take effect.
45+
46+
Example configuration:
47+
```jsonc
48+
{
49+
// Make Ammo weightless
50+
// Default: true
51+
"lightAmmo": {
52+
"enabled": true
53+
},
54+
// Make Throwables weightless
55+
// Default: true
56+
"lightThrowables": {
57+
"enabled": true
58+
},
59+
// Make Food weightless
60+
// Default: true
61+
"lightFood": {
62+
"enabled": true
63+
},
64+
// Make Drinks weightless
65+
// Default: true
66+
"lightDrink": {
67+
"enabled": true
68+
},
69+
// Make Medical Supplies weightless
70+
// Default: true
71+
"lightMeds": {
72+
"enabled": true
73+
}
74+
}
75+
```
76+
77+
### Compatibility
78+
79+
**FeatherLight** is compatible with the latest version of SPT and works seamlessly with most other mods.
80+
- Supports: 3.9.0-3.9.x
81+
82+
### License
83+
84+
This project is licensed under the MIT License - see the LICENSE file for details.
85+
86+
Enjoy a lighter, faster Tarkov experience with FeatherLight!
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Shardbyte
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!--
2+
#
3+
#
4+
###########################
5+
# #
6+
# Saint @ Shardbyte.com #
7+
# #
8+
###########################
9+
# Author: Shardbyte
10+
# License: MIT
11+
#
12+
-->
13+
<div id="header" align="center">
14+
<img src="https://raw.githubusercontent.com/Shardbyte/Shardbyte/main/img/logo-shardbyte-master-light.webp" alt="logo-shardbyte" width="150"/>
15+
</div>
16+
17+
---
18+
19+
## Overview
20+
21+
**FeatherLight** is a mod for SPT that makes multiple categories of items weightless, enhancing your gameplay experience by reducing encumbrance and allowing for greater mobility and agility in raids.
22+
23+
## Features
24+
25+
- **Weightless Items**: Multiple categories of items are set to zero weight.
26+
- **Improved Mobility**: Move faster and carry more without the burden of weight.
27+
- **Customizable**: Easily adjust which categories of items are weightless.
28+
29+
## Usage
30+
31+
After installing the FeatherLight mod, the following categories of items will be weightless by default:
32+
- Ammo
33+
- Throwables (Grenades)
34+
- Food
35+
- Drink
36+
- Medical Supplies
37+
38+
### Customization
39+
40+
To customize which categories of items are weightless:
41+
42+
1. Open the `config.jsonc` file located in the mod's directory.
43+
2. Edit the configuration to include or exclude categories as needed.
44+
3. Save your changes and restart SPT for the changes to take effect.
45+
46+
Example configuration:
47+
```jsonc
48+
{
49+
// Make Ammo weightless
50+
// Default: true
51+
"lightAmmo": {
52+
"enabled": true
53+
},
54+
// Make Throwables weightless
55+
// Default: true
56+
"lightThrowables": {
57+
"enabled": true
58+
},
59+
// Make Food weightless
60+
// Default: true
61+
"lightFood": {
62+
"enabled": true
63+
},
64+
// Make Drinks weightless
65+
// Default: true
66+
"lightDrink": {
67+
"enabled": true
68+
},
69+
// Make Medical Supplies weightless
70+
// Default: true
71+
"lightMeds": {
72+
"enabled": true
73+
}
74+
}
75+
```
76+
77+
### Compatibility
78+
79+
**FeatherLight** is compatible with the latest version of SPT and works seamlessly with most other mods.
80+
- Supports: 3.9.0-3.9.x
81+
82+
### License
83+
84+
This project is licensed under the MIT License - see the LICENSE file for details.
85+
86+
Enjoy a lighter, faster Tarkov experience with FeatherLight!
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Make Ammo weightless
3+
// Default: true
4+
"lightAmmo": {
5+
"enabled": true
6+
},
7+
// Make Throwables weightless
8+
// Default: true
9+
"lightThrowables": {
10+
"enabled": true
11+
},
12+
// Make Food weightless
13+
// Default: true
14+
"lightFood": {
15+
"enabled": true
16+
},
17+
// Make Drinks weightless
18+
// Default: true
19+
"lightDrink": {
20+
"enabled": true
21+
},
22+
// Make Medical Supplies weightless
23+
// Default: true
24+
"lightMeds": {
25+
"enabled": true
26+
}
27+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "FeatherLight",
3+
"version": "1.0.0",
4+
"sptVersion": "~3.9",
5+
"loadBefore": [],
6+
"loadAfter": [],
7+
"incompatibilities": [],
8+
"isBundleMod": false,
9+
"main": "src/mod.js",
10+
"scripts": {
11+
"setup": "npm i",
12+
"build": "node ./build.mjs",
13+
"buildinfo": "node ./build.mjs --verbose"
14+
},
15+
"devDependencies": {
16+
"@types/node": "20.11",
17+
"@typescript-eslint/eslint-plugin": "7.2",
18+
"@typescript-eslint/parser": "7.2",
19+
"archiver": "^6.0",
20+
"eslint": "8.57",
21+
"fs-extra": "11.2",
22+
"ignore": "^5.2",
23+
"tsyringe": "4.8.0",
24+
"typescript": "5.4",
25+
"winston": "3.12"
26+
},
27+
"author": "Shardbyte",
28+
"contributors": ["Chomp"],
29+
"license": "MIT"
30+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import { DependencyContainer } from "tsyringe";
2+
3+
import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
4+
import { DatabaseServer } from "@spt/servers/DatabaseServer";
5+
import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables";
6+
import { ItemHelper } from "@spt/helpers/ItemHelper";
7+
import { BaseClasses } from "@spt/models/enums/BaseClasses";
8+
import { VFS } from "@spt/utils/VFS";
9+
import { jsonc } from "jsonc";
10+
import path from "path";
11+
12+
13+
class FeatherLight implements IPostDBLoadMod
14+
{
15+
16+
private modConfig;
17+
public postDBLoad(container: DependencyContainer): void
18+
19+
{
20+
const vfs = container.resolve<VFS>("VFS");
21+
this.modConfig = jsonc.parse(vfs.readFile(path.resolve(__dirname, "../config/config.jsonc")));
22+
23+
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
24+
const tables: IDatabaseTables = databaseServer.getTables();
25+
const itemHelper: ItemHelper = container.resolve<ItemHelper>("ItemHelper");
26+
const items = Object.values(tables.templates.items);
27+
28+
// -------------------- Ammos --------------------
29+
30+
if (this.modConfig.lightAmmo.enabled) {
31+
// Base Class: 5485a8684bdc2da71d8b4567
32+
const ammos = items.filter(x => itemHelper.isOfBaseclass(x._id, BaseClasses.AMMO));
33+
34+
for (const itemAmmo of ammos)
35+
{
36+
if (itemAmmo._props.Weight)
37+
{
38+
// Set its weight to 0
39+
itemAmmo._props.Weight = 0;
40+
}
41+
}
42+
}
43+
44+
// -------------------- Throwables --------------------
45+
46+
if (this.modConfig.lightThrowables.enabled) {
47+
// Base Class: 5485a8684bdc2da71d8b4567
48+
const throwables = items.filter(x => itemHelper.isOfBaseclass(x._id, BaseClasses.THROW_WEAPON));
49+
50+
for (const itemThrowables of throwables)
51+
{
52+
if (itemThrowables._props.Weight)
53+
{
54+
// Set its weight to 0
55+
itemThrowables._props.Weight = 0;
56+
}
57+
}
58+
}
59+
60+
// -------------------- Foods --------------------
61+
62+
if (this.modConfig.lightFood.enabled) {
63+
// Base Class: 5448e8d04bdc2ddf718b4569
64+
const foods = items.filter(x => itemHelper.isOfBaseclass(x._id, BaseClasses.FOOD));
65+
66+
for (const itemFood of foods)
67+
{
68+
if (itemFood._props.Weight)
69+
{
70+
// Set its weight to 0
71+
itemFood._props.Weight = 0;
72+
}
73+
}
74+
}
75+
76+
// -------------------- Drinks --------------------
77+
78+
if (this.modConfig.lightDrink.enabled) {
79+
// Base Class: 543be6674bdc2df1348b4569
80+
const drinks = items.filter(x => itemHelper.isOfBaseclass(x._id, BaseClasses.FOOD_DRINK));
81+
82+
for (const itemDrink of drinks)
83+
{
84+
if (itemDrink._props.Weight)
85+
{
86+
// Set its weight to 0
87+
itemDrink._props.Weight = 0;
88+
}
89+
}
90+
}
91+
92+
// -------------------- Meds --------------------
93+
94+
if (this.modConfig.lightMeds.enabled) {
95+
// Base Class Meds:
96+
const meds = items.filter(x => itemHelper.isOfBaseclass(x._id, BaseClasses.MEDS));
97+
98+
for (const itemMeds of meds)
99+
{
100+
if (itemMeds._props.Weight)
101+
{
102+
// Set its weight to 0
103+
itemMeds._props.Weight = 0;
104+
}
105+
}
106+
}
107+
}
108+
}
109+
110+
export const mod = new FeatherLight();

0 commit comments

Comments
 (0)