New event: Approaching unknown shuttle (#24490)
* setup codebase * Add first shuttle * tak * sync striker * sync 2 * pipipi * Preloaded roundstart shuttles! * Make it abstract "PreloaderGrid" not "PreloaderShuttle" * to do * added china cuisin shuttle * fixes * add disaster evacpod * remove enemy * final shuttles * weight 5 -> 10 * move data to component * remove autotrailer touching * doc, respath * fix frozen positioning * fixes + cvar * finally * fix evacpod * remove blacklistrules * remove `UnknownShuttleSpawnRule`, refactor `LoadMapRule` to support preloaded grids * use tryload * cleanup * fixes * use preloadedgrid for loneops * weight unknown shuttles differently (preliminal) * leftover * cleanup and raffling * partial review * singleton gridpreloader no station coupling * fix grid atmoses * `roleLoadout` support for `LoadoutComponent`, fix missing gear * weighting changes * init logic fix --------- Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -9,7 +9,7 @@ using Robust.Shared.Random;
|
||||
namespace Content.Shared.Clothing;
|
||||
|
||||
/// <summary>
|
||||
/// Assigns a loadout to an entity based on the startingGear prototype
|
||||
/// Assigns a loadout to an entity based on the RoleLoadout prototype
|
||||
/// </summary>
|
||||
public sealed class LoadoutSystem : EntitySystem
|
||||
{
|
||||
@@ -110,10 +110,22 @@ public sealed class LoadoutSystem : EntitySystem
|
||||
|
||||
private void OnMapInit(EntityUid uid, LoadoutComponent component, MapInitEvent args)
|
||||
{
|
||||
if (component.Prototypes == null)
|
||||
// Use starting gear if specified
|
||||
if (component.StartingGear != null)
|
||||
{
|
||||
var gear = _protoMan.Index(_random.Pick(component.StartingGear));
|
||||
_station.EquipStartingGear(uid, gear);
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.RoleLoadout == null)
|
||||
return;
|
||||
|
||||
var proto = _protoMan.Index<StartingGearPrototype>(_random.Pick(component.Prototypes));
|
||||
_station.EquipStartingGear(uid, proto);
|
||||
// ...otherwise equip from role loadout
|
||||
var id = _random.Pick(component.RoleLoadout);
|
||||
var proto = _protoMan.Index(id);
|
||||
var loadout = new RoleLoadout(id);
|
||||
loadout.SetDefault(_protoMan, true);
|
||||
_station.EquipRoleLoadout(uid, loadout, proto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user