8 Commits
0.0.1 ... 1.0.0

42 changed files with 216 additions and 69 deletions

2
.gitignore vendored
View File

@@ -3,4 +3,4 @@ obj/
/packages/
riderModule.iml
/_ReSharper.Caches/
bundles/
WeebSights/WeebSights.csproj.user

View File

@@ -1,15 +1,55 @@
# SamSWAT's Anime Sight 4.0 Port
This mod allows you to use SamSWAT's Anime Sights on SPT >=4.0.0.
# SamSWAT's Anime Iron Sight 4.0 Port
This mods adds new Rear Iron Sights with anime art at the back, so you can fulfill your dream to raid with your Waifu.
## Features
+ Adds 24 rear sights with anime girls on them. 8 for MCX and 16 for MBUS weapons.
+ Rear sights are sold by the Mechanic and on the Flea Market
+ Easily add new and edit current iron sights by editing JSON files (guide below)
## Known Issues
+ Added sights does not spawn in raids
+ Internationalization support not working
## Installation
1. Download the zip file
2. Extract in game folder
3. Download the original SamSWAT's Anime Sight
4. Use WTT-BundleMaster to fix the bundles
5. Add the new bundles to the mod folder
6. Start server
1. Download the latest versions on the Releases page
2. Extract the downloaded ZIP file on the root of your SPT Installation
3. Start up the server
## How to add new sights or edit them
This mod has a small JSON interpreter that allows you to add and edit new back iron sights into the game.
### items.jsonc
All you have to do is open `db/items.jsonc` with your preferred text editor and add the follow structure for your iron sight:
```json
{
"id": "YOUR_ITEM_MONGOID",
"clone_from_tpl": "ITEM_TO_CLONE_FROM_MONGOID",
"bundle_path": "path/to/your/bundle.bundle",
"price": 4000, // Item price. This will be used on Handbook and Mechanic
"ergonomics": 3 // Ergo boost. You can set this to any value, but play nice ;) (or dont, I'm not the SPT police)
}
```
### Locales
Then, you need to add the Name, ShortName and Description of your item, otherwise it will have a weird name.<br>
To do that, open `db/locales/en.json` with your preferred text editor and add the follow structure:
```json
"YOUR_ITEM_MONGOID": {
"name": "Your beautiful item name",
"short_name": "Short name",
"description": "Very detailed and incredible item description that will give the player a lot of information and totally not be useless"
}
```
### Contribuiting
(WIP)<br>
To contribuite to this project, please follow good coding standards. Make sure your commits
follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and that all PRs are done to the `develop` branch
## Credits
SamSWAT - For making the original mod and bundles<br>
GrooveyPenguinX - For making WTT-BundleMaster, used to fix the original bundles<br>
Rexana - For giving the idea.
+ [**Rexana**](https://forge.sp-tarkov.com/user/38525/rexana) - For giving the idea.
+ [**GrooveyPenguinX**](https://forge.sp-tarkov.com/user/30890/grooveypenguinx) - For making [WTT-BundleMaster](https://github.com/GrooveypenguinX/WTT-BundleMaster), used to fix the original bundles
+ [**SamSWAT**](https://forge.sp-tarkov.com/user/200/samswat) - For making the [original mod and bundles](https://forge.sp-tarkov.com/mod/316/anime-rear-sights)
+ [**ApertureAwesome**](https://steamcommunity.com/profiles/76561198224517144) - [Girls Frontline M4 SOPMOD II](https://steamcommunity.com/sharedfiles/filedetails/?id=1628771637).
+ [**ApertureAwesome**](https://steamcommunity.com/profiles/76561198224517144) - [Ram & Rem](https://steamcommunity.com/sharedfiles/filedetails/?id=1636845240)
+ [**Farengar**](https://steamcommunity.com/profiles/76561198020115276), [**tac.error**](https://steamcommunity.com/profiles/76561198057580968), [**Rymd**](https://steamcommunity.com/profiles/76561198104088584) - [Ai Fuyuumi](https://steamcommunity.com/sharedfiles/filedetails/?id=1484273642)
+ [**Sumerikan**](https://www.reddit.com/user/SUMERIKAN/) - [Art for Anti 1 & 2](https://www.reddit.com/r/PhantomForces/comments/cenaum/animu_sight_anti/)
+ And one more unknown artist...

View File

@@ -1,28 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>WeebSights</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SPTarkov.Server.Core" Version="4.0.3" />
</ItemGroup>
<ItemGroup>
<Content Include="bundles\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Update="bundles.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="db\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{D2A6BE7F-0C34-4655-88EF-BC319CD2C069}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeebSights", "WeebSights\WeebSights.csproj", "{D2A6BE7F-0C34-4655-88EF-BC319CD2C069}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -4,12 +4,11 @@ using SPTarkov.DI.Annotations;
using SPTarkov.Server.Core.DI;
using SPTarkov.Server.Core.Models.Enums;
using SPTarkov.Server.Core.Models.Utils;
using SPTarkov.Server.Core.Services;
using WeebSights.Services;
namespace WeebSights;
[Injectable(TypePriority = OnLoadOrder.PostSptModLoader + 1)]
[Injectable(TypePriority = OnLoadOrder.PostDBModLoader + 1)]
public class Mod(ISptLogger<Mod> logger,
WeebItemService weebItemService,
WeebTraderService weebTraderService,
@@ -19,7 +18,6 @@ public class Mod(ISptLogger<Mod> logger,
{
var stopWatch = Stopwatch.StartNew();
var currentAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
logger.Info($"[Weeb Iron Sights] Loaded in {currentAssemblyPath}");
if (!weebLocaleService.TryLoadLocales(Path.Join(currentAssemblyPath, "/db/locales/en.json"), out var locales))
{
logger.Error("[Weeb Iron Sights] Failed to load locales. Names might be weird");

View File

@@ -7,13 +7,13 @@ public record ModMetadata : AbstractModMetadata
public override string Name { get; init; } = "Weeb Iron Sights";
public override string Author { get; init; } = "yuyui.moe";
public override List<string>? Contributors { get; init; } = ["SamSWAT"];
public override SemanticVersioning.Version Version { get; init; } = new("0.0.1");
public override SemanticVersioning.Version Version { get; init; } = new("1.0.0");
public override SemanticVersioning.Range SptVersion { get; init; } = new("~4.0.0");
public override List<string>? Incompatibilities { get; init; }
public override Dictionary<string, SemanticVersioning.Range>? ModDependencies { get; init; }
public override string? Url { get; init; }
public override string? Url { get; init; } = "https://github.com/yuyuimoe/SamSwat-AnimeSights-4.0/";
public override bool? IsBundleMod { get; init; } = true;
public override string? License { get; init; } = "MIT";
public override string ModGuid { get; init; } = "moe.yuyui.animesights-port";

View File

@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
namespace WeebSights.Models;

View File

@@ -0,0 +1,14 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"SPTarkov.Server": {
"commandName": "Executable",
"executablePath": "$(SPTPath)/SPT.Server.Linux",
"commandLineArgs": "--disable-software-rasterizer",
"workingDirectory": "$(SPTPath)",
"environmentVariables": {
}
}
}
}

View File

@@ -54,7 +54,9 @@ public class WeebItemService(ISptLogger<WeebItemService> logger, JsonUtil jsonUt
logger.Error("[Weeb Iron Sights] Failed to add filter to item " + item.Key);
continue;
}
#if DEBUG
logger.Success($"[Weeb Iron Sights] Added {sight.Id} to filter on item {item.Key}");
#endif
}
}

View File

@@ -6,7 +6,7 @@ using WeebSights.Models;
namespace WeebSights.Services;
[Injectable(TypePriority = OnLoadOrder.PostDBModLoader + 4)]
[Injectable]
public class WeebLocaleService(JsonUtil jsonUtil)
{
public bool TryLoadLocales(string filePath, out Dictionary<MongoId, WeebLocaleConfig> outputObject)

View File

@@ -10,7 +10,7 @@ using SPTarkov.Server.Core.Services;
namespace WeebSights.Services;
[Injectable(TypePriority = OnLoadOrder.PostDBModLoader + 2)]
[Injectable]
public class WeebTraderService(ISptLogger<WeebTraderService> logger, DatabaseService databaseService)
{
public bool AddToAssortFromItemClone(MongoId traderId, IEnumerable<CreateItemResult> itemCloneResults)
@@ -23,7 +23,7 @@ public class WeebTraderService(ISptLogger<WeebTraderService> logger, DatabaseSer
foreach (var itemResult in itemCloneResults)
{
var item = databaseService.GetItems().FirstOrDefault(i => i.Key == itemResult.ItemId);
var item = databaseService.GetItems().First(i => i.Key == itemResult.ItemId);
var traderItem = GenerateItemForTrader(item);
var traderBarter = new BarterScheme()
{
@@ -32,11 +32,24 @@ public class WeebTraderService(ISptLogger<WeebTraderService> logger, DatabaseSer
};
trader.Assort.Items.Add(traderItem);
if (!trader.Assort.BarterScheme.TryAdd(item.Key, [[traderBarter]]))
if (!trader.Assort.BarterScheme.TryAdd(traderItem.Id, [[traderBarter]]))
{
logger.Error($"[Weeb Iron Sights] Failed to add barter for item {item.Value.Name} with ID {item.Value.Id} in MECHANIC");
logger.Error(
$"[Weeb Iron Sights] Failed to add barter {traderItem.Id} for item {item.Value.Name} with ID {item.Value.Id} in {trader.Base.Name}. Item will not be added");
trader.Assort.Items.Remove(traderItem);
continue;
}
logger.Success($"[Weeb Iron Sights] Added item {item.Value.Name} with ID {item.Value.Id} to MECHANIC");
if (!trader.Assort.LoyalLevelItems.TryAdd(traderItem.Id, 1))
{
logger.Critical(
$"[Weeb Iron Sight] Failed to add loyalty requirements for item {item.Value.Name} with ID {item.Value.Id} in {trader.Base.Name}. Item will not be added");
trader.Assort.Items.Remove(traderItem);
continue;
}
#if DEBUG
logger.Success($"[Weeb Iron Sights] Added item {traderItem.Id} with ID {item.Value.Id} and barter {traderItem.Id} to MECHANIC");
#endif
}
return true;
@@ -46,7 +59,7 @@ public class WeebTraderService(ISptLogger<WeebTraderService> logger, DatabaseSer
{
return new Item
{
Id = databaseItem.Key,
Id = new MongoId(),
Template = databaseItem.Value.Id,
ParentId = "hideout",
SlotId = "hideout",

View File

@@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>WeebSights</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>WeebSights</AssemblyName>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SPTarkov.Server.Core" Version="4.0.3" />
</ItemGroup>
<ItemGroup>
<Content Include="bundles\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="WeebSights.csproj.user" />
</ItemGroup>
<ItemGroup>
<Content Include="bundles.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="db\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')" />
<PropertyGroup>
<ModsDirectoryPath>$(SPTPath)user/mods/$(MSBuildProjectName)</ModsDirectoryPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</PropertyGroup>
<Target Name="CopyToSPT" AfterTargets="AfterBuild" Condition="'$(SPTPath)' != ''">
<Message Importance="high" Text="Copying mods to $(ModsDirectoryPath)" />
<Delete Files="$(OutputPath)/$(MSBuildProjectName).deps.json" />
<ItemGroup>
<FilesToCopy Include="$(OutputPath)/**" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(ModsDirectoryPath)\%(RecursiveDir)" ContinueOnError="false" />
<Message Text="Files copied" />
</Target>
<Target Name="MakeZIPFile" AfterTargets="AfterBuild" Condition="'$(Configuration)' == 'Release'">
<ItemGroup>
<FilesToMove Include="$(OutputPath)/**"/>
</ItemGroup>
<PropertyGroup>
<FolderToMove>$(OutputPath)../package/SPT/user/mods/$(MSBuildProjectName)</FolderToMove>
</PropertyGroup>
<Message Importance="high" Text="Making zip file for redistribution" />
<MakeDir Directories="$(FolderToMove)"/>
<Move SourceFiles="@(FilesToMove)" DestinationFolder="$(FolderToMove)\%(RecursiveDir)" />
<ZipDirectory DestinationFile="$(OutputPath)../$(MSBuildProjectName)-$(AssemblyVersion)" SourceDirectory="$(OutputPath)../package/" />
</Target>
</Project>

View File

@@ -0,0 +1,45 @@
Copyright (c) 2021 SamSWAT. All rights reserved.
Developed by: SamSWAT
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions
of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License").
To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of
Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor
receives from making the Licensed Material available under these terms and conditions.
License grant.
> Subject to the terms and conditions of this Public License, the Licensor hereby grants You
a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise
the Licensed Rights in the Licensed Material to:
* reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
* produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
> Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use,
this Public License does not apply, and You do not need to comply with its terms and conditions.
> Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights
in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so.
The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures.
For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
> Downstream recipients.
* Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor
to exercise the Licensed Rights under the terms and conditions of this Public License.
* No downstream restrictions. You may not offer or impose any additional or different terms or conditions on,
or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed Material.
> No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are,
or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
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
CONTRIBUTORS 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 WITH
THE SOFTWARE.

View File

@@ -94,50 +94,50 @@
"id": "6753d006cec7fc449f055453",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_anime.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
},
{
"id": "6753d006cec7fc449f055454",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_anime2.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
},
{
"id": "6753d006cec7fc449f055455",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_anime3.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
},
{
"id": "6753d006cec7fc449f055456",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_anime3v2.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
},
{
"id": "6753d006cec7fc449f055457",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_anti.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
},
{
"id": "6753d006cec7fc449f055458",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_anti2.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
},
{
"id": "6753d006cec7fc449f055459",
"clone_from_tpl": "5fc0fa957283c4046c58147e", //IRONSIGHT_MCX_FLIPUP_REAR_SIGHT
"bundle_path": "assets/content/items/mods/sights rear/sight_rear_all_sig_flip_up_ramrem.bundle",
"price": 4000,
"ergonomics": 3
"price": 2500,
"ergonomics": 2
}
]