master
← beck-thompson:chameleon-clothing-fast-switch
opened 05:24AM - 16 Dec 24 UTC
## About the PR
Added a chameleon controller implant that you can get in the … standard chameleon bundle!
## Why / Balance
Right now it takes a very long time to switch all the clothing one by one. This will allow you to still have fine grained control, but also quickly switch entire jobs in a matter of seconds. With the AI ever watching hopefully this lets antags using the chameleon clothing get a little more of an edge. It also uses your loadout from your profile, so you can make a decent amount of customization changes!
I'm planning on adding more stuff to this implant as well (E.g chameleon ID icon change) but wanted to keep it simple for the first PR.
## Technical details
It is a lot... Most of the file changes are just UI stuff, the thing that you should probably focus on is `ChameleonControllerSystem.cs` and `SharedStationSpawningSystem.cs`. The loadout system is confusing so there is a lot of odd logic. Basically, I get the users profile, try to find if they have a loadout for a given job, if they do, use that as the clothing, if they don't and if they don't create a new one with the default!
```
profile.Loadouts.TryGetValue(jobProtoId, out var loadout);
loadout ??= new RoleLoadout(jobProtoId);
loadout.SetDefault(profile, session, _proto);
```
Then, I got through every slot and try to get the item stored for that slot with the new `GetGearForSlot` function.
```
var proto = _stationSpawningSystem.GetGearForSlot(loadout, slot.Name) ?? ((IEquipmentLoadout) startingGearPrototype).GetGear(slot.Name);
```
If their profile doesn't have anything for that slot, I see if there is any "starting gear" for that goes in the slot.
## Media
https://github.com/user-attachments/assets/db872245-4c61-4e7b-92f7-9464e6fecc2d
## Requirements
- [x] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [x] I have added media to this PR or it does not require an ingame showcase.
## Breaking changes
All jobs now need a `chameleonOutfit` prototype (This is *only* an integration test fail, not having it won't actually break anything). To do a basic version just add this prototype:
```
- type: chameleonOutfit
id: JOBNAMEChameleonOutfit
job: JOBNAME
hasMindShield: true #change this to what make sense obviously!
```
This will add a chameleon outfit to the chameleon controller that is purely based off the players loadout and default settings. Look at the prototype definition for more information on how to make a more detailed outfit.
If your fork doesn't use jobs/chameleon items, its probably best to just remove the integration test.
**Changelog**
:cl: Beck, SlamBamActionman
- add: Added a chameleon controller implant that allows you to quickly switch between job outfits! It also interacts with Agent IDs and fake mindshield implant. Will use your profile's loadout if possible.
- add: The chameleon kit now includes the chameleon controller implant.
[Breaking Changes]
All jobs now need a chameleonOutfit
prototype (This is only an integration test fail, not having it won’t actually break anything). To do a basic version just add this prototype:
- type: chameleonOutfit
id: JOBNAMEChameleonOutfit
job: JOBNAME
hasMindShield: true #change this to what make sense obviously!
This will add a chameleon outfit to the chameleon controller that is purely based off the players loadout and default settings. Look at the prototype definition for more information on how to make a more detailed outfit.
If your fork doesn’t use jobs/chameleon items, its probably best to just remove the integration test.