tgstation/-tg-station — pull request #3460 by CollenN (2014-04-20 01:08:15+00:00)
Title: Mutantrace Updates

This pull request is a combination of a bunch of things regarding mutantraces that I added... They use a lot of the same code, so it only made sense to put them all in one pull request.

The first, and most major addition, is a character setting called "mutant color." It allows you to choose what color you will be when you have certain mutantraces. At the moment, the only mutantraces with colors are lizardpeople, plantpeople, jellypeople, slimepeople, and regular (not adamantine) golems. You cannot choose any color, however - because the sprites look pretty terrible with dark colors, your color needs to have a luminosity/value above a certain point in order to be accepted.

You can choose your mutant color even if you don't have a mutantrace, because this also effects you if you gain a mutantrace during the round, such as being turned into a slimeperson via xenobiology.

At first I was using the color value in order to accomplish this, but that ended up making all the overlays colored as well. I tried a bunch of things, and asked around in coderbus, but nothing really worked. So instead, I ended up using the blend function.

HOWEVER! I knew that when called constantly, that function would cause lag, so I did a bit of ~code wizardry~ to make it so that it only blended once or twice. I added a proc called update_mutcolor() to humans, which handles the mutantrace colors. This proc is called when one of the following four things happen: 1) You join the game with a mutant race. 2) An admin manually regenerates your icons. 3) Something else calls regenerate_icons. 4) You turn into a slimeperson through slime mutagen, or you turn into a plantperson after being revived in a pod.

This means that lag from this is practically non-existent, which is a better solution than calling it every time the rest of update_icons is run.

![mutantraces](https://cloud.githubusercontent.com/assets/4349173/2749783/fba56a7c-c824-11e3-8b7f-7fe14402a26c.png)

I have also added a few other small things. As you can see in the image above, I modified some parts of the lizard, flower, and jelly sprites, mainly adding small little details to the head areas.

I have also removed the bonuses that plant people get in light, so that they can be chosen as a mutantrace at roundstart. I know, it's sad, but people almost never become plantpeople during rounds anyway so it's not like people will be missing out on everything. Plantpeople now function almost exactly the same as humans.

I also added jellypeople to the mutantrace selection list. These have been in the icons for awhile, likely a remnant of the old metroids that xenobiology used. They have no benefits nor detriments. They use a different eye icon than everything else, because they have three eyes instead of two, making them a truly alien race. (Which I would like to see more of in the future.)

You can now see your mutantrace on the character prefs window, along with your mutantcolor. I should warn that jellies don't look right in the prefs panel because they use alpha and that does not really look too good when blown out of proportion on a black background. However, they do look fine in-game.

The last thing I added was hair for slime people. Rather than having hair built into their sprite, they now have hair just like humans do. It adapts to the slimeperson's mutantcolor, and is semitransparent, giving it a gooey appearance.

The main purpose of this update was to make mutantraces seem more diverse for servers that have mutantraces enabled, that way there won't be a bunch of lizardmen running about that look exactly the same. I am not a master coder, so if you see anything that could be improved, please mention it below and I will attempt to fix it. Probably won't get around to it right away, since tomorrow is Easter and all.