Chameleon controller implant (Clothing fast switch) (#33887)

* Add the chameleon controller implant

* address the issues (Git please dont kill me)

* Address the review and fix some merge conflicts!

* Cleanup

* Add use delay

* Silly mistakes

* Making a PR at 2 am: Gone wrong

* Predict use delay and disable the buttons until you can choose another

* First phase custom clothing

* Better system, now relays to agent id and mindshield. Chameleon loadouts are a lot better to work with as well

* Address the review! No more evil goto

* Slams way is better I should have read more closely xD

* Some of the jobs

* Add to Cargo, CentComm, Service, Passenger, Ninja, Cluwne, Wizard + Minor changes to existing; Add chameleon to bandanas, medals, jugsuits and HUDs

* Add everything else

* Fix test

* Job name

* This looks better

* Add department organization

* Minor cleanup

* Added some mindshields

* Remove redudent comment and change funcion name to be clearer

* Fix cluwne outfit

* fix merge conflicts

---------

Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
This commit is contained in:
beck-thompson
2025-05-30 03:07:25 -07:00
committed by GitHub
parent fa3468270e
commit 05fac53de6
79 changed files with 1437 additions and 3 deletions

View File

@@ -100,6 +100,45 @@ public abstract class SharedJobSystem : EntitySystem
return false;
}
/// <summary>
/// Tries to get all the departments for a given job. Will return an empty list if none are found.
/// </summary>
public bool TryGetAllDepartments(string jobProto, out List<DepartmentPrototype> departmentPrototypes)
{
// not sorting it since there should only be 1 primary department for a job.
// this is enforced by the job tests.
var departmentProtos = _prototypes.EnumeratePrototypes<DepartmentPrototype>();
departmentPrototypes = new List<DepartmentPrototype>();
var found = false;
foreach (var department in departmentProtos)
{
if (department.Roles.Contains(jobProto))
{
departmentPrototypes.Add(department);
found = true;
}
}
return found;
}
/// <summary>
/// Try to get the lowest weighted department for the given job. If the job has no departments will return null.
/// </summary>
public bool TryGetLowestWeightDepartment(string jobProto, [NotNullWhen(true)] out DepartmentPrototype? departmentPrototype)
{
departmentPrototype = null;
if (!TryGetAllDepartments(jobProto, out var departmentPrototypes) || departmentPrototypes.Count == 0)
return false;
departmentPrototypes.Sort((x, y) => y.Weight.CompareTo(x.Weight));
departmentPrototype = departmentPrototypes[0];
return true;
}
public bool MindHasJobWithId(EntityUid? mindId, string prototypeId)
{