realtinymonster/moontest — pull request #28 by fishyWET (2014-10-16 15:40:54+00:00)
Title: Spacesuits "armors"

As previously promised in irc, spacesuit armors.
In this pull request i have removed all traces of the old spacesuit and added the new spacesuit. Also with this update will also be inventory change to allow slots for placing of spacesuits, adding of ability to view what is a player holding in his/ her hand (can be easily removed by removing wieldview.lua & transform.lua).
Since the spacesuit is a new content, i will have a lengthy explanation on how it works.
2 types of stuff the player can equip to their slot, the 4 slots on the right allows equipping of spacesuits with the parts "helmet", "upper torso", "lower torso", "boots", the 2 slots on the left allows equipping of any oxygen tank.
Purpose of the spacesuit:
The spacesuit provides a backup "breath giver", once it detects the player health is being damaged, it will give a certain amount of breath to the player, amount stated on "armor_drown" group. Apart from that, the spacesuit also work as armors, protecting the player from attacks (not fall damage). Also i wanted to intentionally make the player remove their spacesuit when not expose to the outside world and so, in order to do that so, i made sure that spacesuits will decrease the speed of the player, the better the spacesuit is, the more speed it reduces, forcing the player to remove his/her spacesuit at times when it is not needed to ensure there will be no speed burden. Finally the spacesuit is also a requirement for the oxygen tanks to work, only with 4 parts of the spacesuit equipped will the oxygen tank work.
Purpose of the oxygen tank:
The oxygen tank, as the name states, gives out oxygen (breath) to the player, as stated above it will only work in the presence of the 4 pieces of spacesuit equipped. Once the 4 pieces of spacesuit are equipped, the oxygen tank will automatically release full breath to the player on detecting that the player have 3 or less bubbles (amount of breath given can be toggle via "breath_use" group), in the process of giving out oxygen (breath), it will also wear out slowly. Oxygen tanks unlike the spacesuits are not intended to be a source of protection, so the oxygen tanks can only take a few hits (2-4 hits either from drowning/ falling) and afterwards it will be "punctured" and disappear from player's oxygen tank slots.
Crafting:
The 4 spacesuits are each made of the different materials, weakest being the "skylab" is made out of steel ingots, followed by "apollo" made by copper ingots, "baseline emu" made by titanium ingots and finally "enhanced emu" made by mese crystals, note that i do not know which materials are more important /rare in moontest or which are more suitable so feel free to change it afterwards.
The 3 oxygen tanks, mese, titanium, steel, are made out of what their name states so, likewise i do not know what materials to use here so feel free to change it afterwards too.