Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

### LethalLib project
!/LethalLib
!deps
LethalLib/[Bb]in
LethalLib/[Oo]bj
LethalLib/[Dd]ist
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## LethalLib [1.2.0]

### Fixed

- Updated mod version to work with V80 Lethal.

## LethalLib [1.1.1]

### Added
Expand Down
26 changes: 26 additions & 0 deletions LethalLib/Extras/SpawnableMapObjectDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,30 @@ namespace LethalLib.Extras;
public class SpawnableMapObjectDef : ScriptableObject
{
public SpawnableMapObject spawnableMapObject;

private IndoorMapHazardType runtimeCreatedIndoorMapHazardType;
internal IndoorMapHazardType ConvertToIndoorMapHazardType()
{
if (runtimeCreatedIndoorMapHazardType != null)
{
return runtimeCreatedIndoorMapHazardType;
}

IndoorMapHazardType indoorMapHazardType = ScriptableObject.CreateInstance<IndoorMapHazardType>();
if (spawnableMapObject == null)
{
return indoorMapHazardType;
}

indoorMapHazardType.prefabToSpawn = spawnableMapObject.prefabToSpawn;
indoorMapHazardType.requireDistanceBetweenSpawns = spawnableMapObject.requireDistanceBetweenSpawns;
indoorMapHazardType.disallowSpawningNearEntrances = spawnableMapObject.disallowSpawningNearEntrances;
indoorMapHazardType.spawnFacingAwayFromWall = spawnableMapObject.spawnFacingAwayFromWall;
indoorMapHazardType.spawnWithBackToWall = spawnableMapObject.spawnWithBackToWall;
indoorMapHazardType.spawnWithBackFlushAgainstWall = spawnableMapObject.spawnWithBackFlushAgainstWall;
indoorMapHazardType.spawnFacingWall = spawnableMapObject.spawnFacingWall;

runtimeCreatedIndoorMapHazardType = indoorMapHazardType;
return runtimeCreatedIndoorMapHazardType;
}
}
35 changes: 32 additions & 3 deletions LethalLib/LethalLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<!-- Runtime dependencies -->
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<PackageReference Include="UnityEngine.Modules" Version="2022.3.9" PrivateAssets="all"/>
<PackageReference Include="UnityEngine.Modules" Version="2022.3.62" PrivateAssets="all"/>
<!--
<Reference Include="Assembly-CSharp">
<HintPath>$(LethalCompanyDir)Lethal Company_Data/Managed/Assembly-CSharp.dll</HintPath>
</Reference>
Expand All @@ -52,13 +53,41 @@
<Reference Include="Unity.Netcode.Runtime" Publicize="true">
<HintPath>$(LethalCompanyDir)Lethal Company_Data/Managed/Unity.Netcode.Runtime.dll</HintPath>
</Reference>
<Reference Include="DunGen" Publicize="true">
<HintPath>$(LethalCompanyDir)Lethal Company_Data/Managed/DunGen.dll</HintPath>
</Reference>
<Reference Include="MMHOOK_Assembly-CSharp">
<HintPath>$(TestProfileDir)BepInEx/plugins/MMHOOK/MMHOOK_Assembly-CSharp.dll</HintPath>
</Reference>
</Reference> -->

<Reference Include="Assembly-CSharp.dll">
<PrivateAssets>all</PrivateAssets>
<Publicize>true</Publicize>
<HintPath>..\deps\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.Netcode.Runtime.dll" Publicize="true">
<PrivateAssets>all</PrivateAssets>
<HintPath>..\deps\Unity.Netcode.Runtime.dll</HintPath>
</Reference>
<Reference Include="DunGen.dll" Publicize="true">
<PrivateAssets>all</PrivateAssets>
<HintPath>..\deps\DunGen.dll</HintPath>
</Reference>
<Reference Include="Unity.InputSystem.dll" Publicize="true">
<PrivateAssets>all</PrivateAssets>
<HintPath>..\deps\Unity.InputSystem.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass.dll" Publicize="true">
<PrivateAssets>all</PrivateAssets>
<HintPath>..\deps\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="MMHOOK_Assembly-CSharp">
<PrivateAssets>all</PrivateAssets>
<HintPath>..\deps\MMHOOK_Assembly-CSharp.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup Condition="$(CI) == 'true'">
<PackageReference Include="LethalCompany.GameLibs.Steam" Version="70.0.0-ngd.0" Publicize="true" PrivateAssets="all" />
<Reference Include="MMHOOK_Assembly-CSharp">
<HintPath>$(ProjectDir)../lib/MMHOOK_Assembly-CSharp.dll</HintPath>
</Reference>
Expand Down
18 changes: 3 additions & 15 deletions LethalLib/Modules/Enemies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ private static void QuickMenuManager_Start(On.QuickMenuManager.orig_Start orig,
foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies)
{
if (inside.All(x => x.enemyType == spawnableEnemy.enemy)) continue;
SpawnableEnemyWithRarity spawnableEnemyWithRarity = new SpawnableEnemyWithRarity
{
enemyType = spawnableEnemy.enemy,
rarity = spawnableEnemy.rarity
};
SpawnableEnemyWithRarity spawnableEnemyWithRarity = new SpawnableEnemyWithRarity(spawnableEnemy.enemy, spawnableEnemy.rarity);
switch (spawnableEnemy.spawnType)
{
case SpawnType.Default:
Expand Down Expand Up @@ -118,11 +114,7 @@ private static void Terminal_Start(On.Terminal.orig_Start orig, Terminal self)
// if doesn't contain noun, add it
if (!itemInfoNouns.Any(x => x.noun.word == keyword.word))
{
itemInfoNouns.Add(new CompatibleNoun()
{
noun = keyword,
result = spawnableEnemy.terminalNode
});
itemInfoNouns.Add(new CompatibleNoun(keyword, spawnableEnemy.terminalNode));
}
infoKeyword.compatibleNouns = itemInfoNouns.ToArray();

Expand Down Expand Up @@ -246,11 +238,7 @@ private static void AddEnemyToLevel(SpawnableEnemy spawnableEnemy, SelectableLev
rarity = spawnableEnemy.levelRarities[Levels.LevelTypes.All];
}

var spawnableEnemyWithRarity = new SpawnableEnemyWithRarity()
{
enemyType = spawnableEnemy.enemy,
rarity = rarity
};
var spawnableEnemyWithRarity = new SpawnableEnemyWithRarity(spawnableEnemy.enemy, rarity);

// make sure spawnableScrap does not already contain item
//Plugin.logger.LogInfo($"Checking if {spawnableEnemy.enemy.name} is already in {name}");
Expand Down
Loading
Loading