Skip to content

Commit 4ef2730

Browse files
authored
Merge pull request #42 from UncomplicatedCustomServer/Dev
4.1.0
2 parents 0424604 + c899f3f commit 4ef2730

183 files changed

Lines changed: 4501 additions & 4167 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
## Requirements
5959

60-
- **LabApi** >= `v1.2.0` **or** **Exiled** >= `v9.9.2`
60+
- **LabApi** >= `v1.1.5` **or** **Exiled** >= `v9.9.2`
6161

6262
## Installation
6363
#### LabApi:
@@ -78,67 +78,71 @@
7878
After installation, UCI will generate default configuration files in your server's config directory. Here's a basic example of creating a custom item:
7979

8080
```yaml
81-
# Sets the ID of the custom item. Custom items cannot share IDs.
8281
id: 2
83-
# Sets the name of the custom item.
8482
name: FunnyGun
85-
# Sets the description of the custom item. This is shown as part of a hint when the item is equipped or picked up.
8683
description: A weapon that has a shotgun-like bullet spread
87-
# The extended description of the custom item. Used by the `.customiteminfo` command
8884
extended_description: ''
89-
# Sets the badge name of the custom item. Remove the text in quotes to disable it.
9085
badge_name: FunnyGun
91-
# Sets the badge color of the custom item.
9286
badge_color: pumpkin
93-
# Sets the weight of the custom item. This affects movement speed when equipped.
9487
weight: 2
95-
# Sets the item the custom item will use.
9688
item: GunFRMG0
97-
# Sets the scale of the custom item when dropped.
9889
scale:
9990
x: 1
10091
y: 1
10192
z: 1
102-
# Defines the spawn settings for the custom item. Information on rooms can be found in the UCI Information forum on Discord.
10393
spawn:
104-
# If true, the custom item can spawn. If false, it will not.
10594
do_spawn: true
106-
# The number of custom items to spawn.
10795
count: 1
10896
spawn_settings:
109-
- chance: 30
110-
rotation:
111-
x: 0
112-
y: 0
113-
z: 0
114-
w: 0
115-
# The room(s) where the custom item can spawn.
116-
dynamic_spawn:
117-
- room: Lcz914
118-
coords:
119-
x: 1
120-
y: 1
121-
z: 1
122-
# Sets the custom flags of the custom item. Information about custom flags can be found in the UCI Information forum on Discord.
123-
custom_flags: InfiniteAmmo, ItemGlow, DistruptorTracer
124-
# Settings for the CustomFlags. You can remove any unused settings.
125-
flag_settings: []
97+
- chance: 100
98+
locker_settings:
99+
enable: true
100+
locker_type: RifleRack
101+
room: HczWarhead
102+
zone: HeavyContainment
103+
chamber: MainChamber
104+
offset:
105+
x: 0
106+
y: 0
107+
z: 0
108+
- chance: 100
109+
locker_settings:
110+
enable: true
111+
locker_type: RifleRack
112+
room: Hcz049
113+
zone: HeavyContainment
114+
chamber: MainChamber
115+
offset:
116+
x: 0
117+
y: 0
118+
z: 0
119+
custom_modules:
120+
InfiniteAmmo: []
121+
ItemGlow:
122+
- GlowColor: '#00FF00'
123+
range: 5
124+
intensity: 2
125+
DistruptorTracer: []
126+
PickupHintOverride:
127+
- hint: 'This is a funny gun!'
128+
duration: 5
129+
EquipHintOverride:
130+
- hint: 'You have equipped the funny gun!'
131+
duration: 5
126132
arguments:
127133
OnShotWeapon: action Example
128134
OnAimedWeapon: Player::Damage(10, "Test", 'AIMING')
129-
# Sets the custom data type the item will use.
130135
custom_item_type: Weapon
131-
# Specifies the modifications the custom item will have.
132136
custom_data:
133137
damage: 2.75
134138
max_ammo: 150
135139
max_magazine_ammo: 150
136-
max_barrel_ammo: 100
140+
max_barrel_ammo: 15
137141
penetration: 1.24000001
138142
inaccuracy: 1.24000001
139143
aiming_inaccuracy: 1.24000001
140144
damage_falloff_distance: 1
141-
attachments: DotScope
145+
attachments: DotSight
142146
enable_friendly_fire: false
143147
```
144148
@@ -195,7 +199,7 @@ Your donations help us maintain and improve our plugins for the entire SCP:SL co
195199

196200
- **Mr. Baguetter**
197201
- Discord: `@ender1992`
198-
- Email: `baguetter@thaumielscpsl.site`
202+
- Email: `Mr.Baguetter1@gmail.com`
199203

200204
### Community
201205

UncomplicatedCustomItems.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Global
1717
Release|x64 = Release|x64
1818
EndGlobalSection
1919
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Debug|Any CPU.ActiveCfg = Exiled|Any CPU
21-
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Debug|Any CPU.Build.0 = Exiled|Any CPU
20+
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Debug|Any CPU.ActiveCfg = LabApi|Any CPU
21+
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Debug|Any CPU.Build.0 = LabApi|Any CPU
2222
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Debug|x64.ActiveCfg = LabApi|x64
2323
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Debug|x64.Build.0 = LabApi|x64
2424
{B39EE633-0EFE-42FC-B3E8-C6C4C86029E5}.Exiled|Any CPU.ActiveCfg = Exiled|Any CPU

UncomplicatedCustomItems/API/Components/CollisionHandler.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="CollisionHandler.cs" company="ExMod Team">
3+
// Copyright (c) ExMod Team. All rights reserved.
4+
// Licensed under the CC BY-SA 3.0 license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
// This file contains code originally licensed under CC BY-SA 3.0.
8+
// Modifications and adaptations by UCSC are licensed under GNU AGPL v3.
9+
// See LICENSE file for full GNU AGPL v3 license text.
10+
// -----------------------------------------------------------------------
11+
112
using System;
213
using InventorySystem.Items.ThrowableProjectiles;
3-
using UncomplicatedCustomItems.API.Features.Helper;
14+
using UncomplicatedCustomItems.API.Features.Manager;
415
using UnityEngine;
516

617
namespace UncomplicatedCustomItems.API.Components
@@ -9,9 +20,9 @@ public class CollisionHandler : MonoBehaviour
920
{
1021
private bool initialized;
1122

12-
public GameObject Owner { get; private set; }
23+
public GameObject? Owner { get; private set; }
1324

14-
public EffectGrenade Grenade { get; private set; }
25+
public EffectGrenade? Grenade { get; private set; }
1526

1627
public void Init(GameObject owner, ThrownProjectile grenade)
1728
{
@@ -38,17 +49,17 @@ private void OnCollisionEnter(Collision collision)
3849
{
3950
LogManager.Error("collision is null!");
4051
}
41-
if (!collision.collider)
52+
if (!collision?.collider)
4253
{
4354
LogManager.Error("water :|");
4455
}
45-
if (collision.collider.gameObject == null)
56+
if (collision?.collider.gameObject == null)
4657
{
4758
LogManager.Error("Null collider gameobject");
4859
}
49-
if (!(collision.collider.gameObject == Owner) && !collision.collider.gameObject.TryGetComponent<EffectGrenade>(out var _))
60+
if (!(collision?.collider.gameObject == Owner) && !collision!.collider.gameObject.TryGetComponent<EffectGrenade>(out var _))
5061
{
51-
Grenade.TargetTime = 0.10000000149011612;
62+
Grenade?.TargetTime = 0.10000000149011612;
5263
}
5364
}
5465
}

UncomplicatedCustomItems/API/Components/DebugUI.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public enum Segment
2222

2323
public class DebugUI : MonoBehaviour
2424
{
25-
private Player Player;
26-
private StringBuilder Builder;
25+
private Player? Player;
26+
private StringBuilder? Builder;
2727
public readonly List<Segment> ActiveSegments = [];
2828

2929
public void Init(Player player)
@@ -34,7 +34,7 @@ public void Init(Player player)
3434

3535
private void Update()
3636
{
37-
if (ActiveSegments.Count <= 0)
37+
if (ActiveSegments.Count <= 0 || Builder == null || Player == null)
3838
return;
3939

4040
Builder.Clear();
@@ -59,19 +59,19 @@ public void AddSegment(Segment segment)
5959

6060
private void HandleBaseSegment()
6161
{
62-
if (!ActiveSegments.Contains(Segment.Base))
62+
if (!ActiveSegments.Contains(Segment.Base) || Builder == null || Player == null)
6363
return;
6464

6565
Builder.AppendLine($"UCI Debug Menu {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
6666
Builder.AppendLine($"");
67-
Builder.AppendLine($"Room Name: {Player.CachedRoom.Name}");
68-
Builder.AppendLine($"Local Position: {Player.CachedRoom.LocalPosition(Player.Position)}");
69-
Builder.AppendLine($"World Position: {Player.CachedRoom.Position}");
67+
Builder.AppendLine($"Room Name: {Player.CachedRoom?.Name ?? RoomName.Unnamed}");
68+
Builder.AppendLine($"Local Position: {Player.CachedRoom?.LocalPosition(Player.Position)}");
69+
Builder.AppendLine($"World Position: {Player.CachedRoom?.Position}");
7070
}
7171

7272
private void HandleTotalItemsSegment()
7373
{
74-
if (!ActiveSegments.Contains(Segment.TotalItems))
74+
if (!ActiveSegments.Contains(Segment.TotalItems) || Builder == null || Player == null)
7575
return;
7676

7777
Builder.AppendLine($"Total Custom Items: {CustomItem.List.Count()}");
@@ -82,13 +82,13 @@ private void HandleTotalItemsSegment()
8282

8383
private void HandleZoneInformationSegment()
8484
{
85-
if (!ActiveSegments.Contains(Segment.ZoneInformation))
85+
if (!ActiveSegments.Contains(Segment.ZoneInformation) || Builder == null || Player == null)
8686
return;
8787

88-
Builder.AppendLine($"Total Custom Items on Surface Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.Surface).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.Surface).Count()}");
89-
Builder.AppendLine($"Total Custom Items in Entrance Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.Entrance).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.Entrance).Count()}");
90-
Builder.AppendLine($"Total Custom Items in Heavy Containment Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.HeavyContainment).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.HeavyContainment).Count()}");
91-
Builder.AppendLine($"Total Custom Items in Light Containment Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.LightContainment).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup.Room.Zone == FacilityZone.LightContainment).Count()}");
88+
Builder.AppendLine($"Total Custom Items on Surface Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.Surface).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.Surface).Count()}");
89+
Builder.AppendLine($"Total Custom Items in Entrance Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.Entrance).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.Entrance).Count()}");
90+
Builder.AppendLine($"Total Custom Items in Heavy Containment Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.HeavyContainment).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.HeavyContainment).Count()}");
91+
Builder.AppendLine($"Total Custom Items in Light Containment Zone: {SummonedCustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.LightContainment).Count() + SummonedAPICustomItem.List.Where(s => s.IsPickup && s.Pickup!.Room!.Zone == FacilityZone.LightContainment).Count()}");
9292
}
9393
}
9494
}

0 commit comments

Comments
 (0)