Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-01-20

This commit is contained in:
Leshana
2018-01-21 00:23:00 -05:00
15 changed files with 283 additions and 115 deletions
+155 -63
View File
@@ -1,15 +1,18 @@
/obj/item/device/kit
icon_state = "modkit"
icon = 'icons/obj/device.dmi'
var/new_name = "mech" //What is the variant called?
var/new_desc = "A mech." //How is the new mech described?
var/new_icon = "ripley" //What base icon will the new mech use?
w_class = ITEMSIZE_SMALL
var/new_name = "custom item"
var/new_desc = "A custom item."
var/new_icon
var/new_icon_file
var/new_icon_override_file
var/uses = 1 // Uses before the kit deletes itself.
var/list/allowed_types = list()
/obj/item/device/kit/examine()
..()
usr << "It has [uses] [uses>1?"uses":"use"] left."
to_chat(usr, "It has [uses] use\s left.")
/obj/item/device/kit/proc/use(var/amt, var/mob/user)
uses -= amt
@@ -18,6 +21,42 @@
user.drop_item()
qdel(src)
/obj/item/device/kit/proc/can_customize(var/obj/item/I)
return is_type_in_list(I, allowed_types)
/obj/item/device/kit/proc/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data)
new_name = kit_name
new_desc = kit_desc
new_icon = kit_icon
new_icon_file = kit_icon_file
new_icon_override_file = kit_icon_override_file
for(var/path in splittext(additional_data, ", "))
allowed_types |= text2path(path)
/obj/item/device/kit/proc/customize(var/obj/item/I, var/mob/user)
if(can_customize(I))
I.name = new_name ? new_name : I.name
I.desc = new_desc ? new_desc : I.desc
I.icon = new_icon_file ? new_icon_file : I.icon
I.icon_override = new_icon_override_file ? new_icon_override_file : I.icon_override
if(new_icon)
I.icon_state = new_icon
var/obj/item/clothing/under/U = I
if(istype(U))
U.worn_state = I.icon_state
U.update_rolldown_status()
use(1, user)
// Generic use
/obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/kit))
var/obj/item/device/kit/K = W
K.customize(src, user)
return
..()
// Root hardsuit kit defines.
// Icons for modified hardsuits need to be in the proper .dmis because suit cyclers may cock them up.
/obj/item/device/kit/suit
@@ -25,88 +64,141 @@
desc = "A kit for modifying a voidsuit."
uses = 2
var/new_light_overlay
var/new_mob_icon_file
/obj/item/device/kit/suit/can_customize(var/obj/item/I)
return istype(I, /obj/item/clothing/head/helmet/space/void) || istype(I, /obj/item/clothing/suit/space/void) || istype(I, /obj/item/clothing/suit/storage/hooded/explorer)
/obj/item/device/kit/suit/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data)
..()
new_light_overlay = additional_data
/obj/item/device/kit/suit/customize(var/obj/item/I, var/mob/user)
if(can_customize(I))
if(istype(I, /obj/item/clothing/head/helmet/space/void))
var/obj/item/clothing/head/helmet/space/void/helmet = I
helmet.name = "[new_name] suit helmet"
helmet.desc = new_desc
helmet.icon_state = "[new_icon]_helmet"
helmet.item_state = "[new_icon]_helmet"
if(new_icon_file)
helmet.icon = new_icon_file
if(new_icon_override_file)
helmet.icon_override = new_icon_override_file
if(new_light_overlay)
helmet.light_overlay = new_light_overlay
to_chat(user, "You set about modifying the helmet into [helmet].")
var/mob/living/carbon/human/H = user
if(istype(H))
helmet.species_restricted = list(H.species.get_bodytype(H))
else if(istype(I, /obj/item/clothing/suit/storage/hooded))
var/obj/item/clothing/suit/storage/hooded/suit = I
suit.name = "[new_name] suit"
suit.desc = new_desc
suit.icon_state = "[new_icon]_suit"
suit.toggleicon = "[new_icon]_suit"
suit.item_state = "[new_icon]_suit"
var/obj/item/clothing/head/hood/S = suit.hood
S.icon_state = "[new_icon]_helmet"
S.item_state = "[new_icon]_helmet"
if(new_icon_file)
suit.icon = new_icon_file
S.icon = new_icon_file
if(new_icon_override_file)
suit.icon_override = new_icon_override_file
S.icon_override = new_icon_override_file
to_chat(user, "You set about modifying the suit into [suit].")
var/mob/living/carbon/human/H = user
if(istype(H))
suit.species_restricted = list(H.species.get_bodytype(H))
else
var/obj/item/clothing/suit/space/void/suit = I
suit.name = "[new_name] voidsuit"
suit.desc = new_desc
suit.icon_state = "[new_icon]_suit"
suit.item_state = "[new_icon]_suit"
if(new_icon_file)
suit.icon = new_icon_file
if(new_icon_override_file)
suit.icon_override = new_icon_override_file
to_chat(user, "You set about modifying the suit into [suit].")
var/mob/living/carbon/human/H = user
if(istype(H))
suit.species_restricted = list(H.species.get_bodytype(H))
use(1,user)
/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/O, var/mob/user)
if(istype(O,/obj/item/device/kit/suit))
var/obj/item/device/kit/suit/kit = O
name = "[kit.new_name] suit helmet"
desc = kit.new_desc
icon_state = "[kit.new_icon]_helmet"
item_state = "[kit.new_icon]_helmet"
if(kit.new_icon_file)
icon = kit.new_icon_file
if(kit.new_mob_icon_file)
icon_override = kit.new_mob_icon_file
if(kit.new_light_overlay)
light_overlay = kit.new_light_overlay
user << "You set about modifying the helmet into [src]."
var/mob/living/carbon/human/H = user
if(istype(H))
species_restricted = list(H.species.get_bodytype())
kit.use(1,user)
return 1
kit.customize(src, user)
return
return ..()
/obj/item/clothing/suit/space/void/attackby(var/obj/item/O, var/mob/user)
if(istype(O,/obj/item/device/kit/suit))
var/obj/item/device/kit/suit/kit = O
name = "[kit.new_name] voidsuit"
desc = kit.new_desc
icon_state = "[kit.new_icon]_suit"
item_state = "[kit.new_icon]_suit"
if(kit.new_icon_file)
icon = kit.new_icon_file
if(kit.new_mob_icon_file)
icon_override = kit.new_mob_icon_file
user << "You set about modifying the suit into [src]."
var/mob/living/carbon/human/H = user
if(istype(H))
species_restricted = list(H.species.get_bodytype())
kit.use(1,user)
return 1
kit.customize(src, user)
return
return ..()
/obj/item/clothing/suit/storage/hooded/attackby(var/obj/item/O, var/mob/user)
if(istype(O,/obj/item/device/kit/suit))
var/obj/item/device/kit/suit/kit = O
kit.customize(src, user)
return
return ..()
/obj/item/device/kit/paint
name = "mecha customisation kit"
desc = "A kit containing all the needed tools and parts to repaint a mech."
var/removable = null
var/list/allowed_types = list()
/obj/item/device/kit/paint/can_customize(var/obj/mecha/M)
if(!istype(M))
return 0
for(var/type in allowed_types)
if(type == M.initial_icon)
return 1
/obj/item/device/kit/paint/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data)
..()
allowed_types = splittext(additional_data, ", ")
/obj/item/device/kit/paint/examine()
..()
usr << "This kit will convert an exosuit into: [new_name]."
usr << "This kit can be used on the following exosuit models:"
to_chat(usr, "This kit will convert an exosuit into: [new_name].")
to_chat(usr, "This kit can be used on the following exosuit models:")
for(var/exotype in allowed_types)
usr << "- [capitalize(exotype)]"
to_chat(usr, "- [capitalize(exotype)]")
/obj/item/device/kit/paint/customize(var/obj/mecha/M, var/mob/user)
if(!can_customize(M))
to_chat(user, "That kit isn't meant for use on this class of exosuit.")
return
if(M.occupant)
to_chat(user, "You can't customize a mech while someone is piloting it - that would be unsafe!")
return
user.visible_message("[user] opens [src] and spends some quality time customising [M].")
M.name = new_name
M.desc = new_desc
M.initial_icon = new_icon
if(new_icon_file)
M.icon = new_icon_file
M.reset_icon()
use(1, user)
/obj/mecha/attackby(var/obj/item/weapon/W, var/mob/user)
if(istype(W, /obj/item/device/kit/paint))
if(occupant)
user << "You can't customize a mech while someone is piloting it - that would be unsafe!"
return
var/obj/item/device/kit/paint/P = W
var/found = null
for(var/type in P.allowed_types)
if(type==src.initial_icon)
found = 1
break
if(!found)
user << "That kit isn't meant for use on this class of exosuit."
return
user.visible_message("[user] opens [P] and spends some quality time customising [src].")
src.name = P.new_name
src.desc = P.new_desc
src.initial_icon = P.new_icon
if(P.new_icon_file)
src.icon = P.new_icon_file
src.reset_icon()
P.use(1, user)
return 1
P.customize(src, user)
return
else
return ..()
@@ -147,6 +147,76 @@
</body>
</html>"}
// TESLA Engine
/obj/item/weapon/book/manual/tesla_engine
name = "Tesla Operating Manual"
icon_state ="bookTesla"
author = "Engineering Encyclopedia"
title = "Tesla Engine User's Guide"
dat = {"<html>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
h2 {font-size: 15px; margin: 15px 0px 5px;}
li {margin: 2px 0px 2px 15px;}
ul {margin: 5px; padding: 0px;}
ol {margin: 5px; padding: 0px 15px;}
body {font-size: 13px; font-family: Verdana;}
</style>
</head>
<body>
<h1>OPERATING MANUAL FOR MK 2 PROTOTYPE TESLA ENGINE &apos;EDISON&apos;S BANE&apos;</h1>
<br>
<h2>OPERATING PRINCIPLES</h2>
<p>This big floaty ball of pure electricity can only be contained by the containment field. It periodically will discharge energy in the form of an electric shock which can be harvested for energy.</p>
<p>When you shoot the energy ball with the Particle Accelerator, it gains energy, and when enough energy is accumulated a mini-energy ball that orbits the big energy ball will be formed. This can happen as many times as you let it, each mini-ball will send off an extra shock when the energy ball pulses. Be warned, the more mini-balls the energy ball has, the more shocks it sends out at once and the further it can travel each move.</p>
<p>An energy ball will shoot bolts of electricity off at conductors, which it prioritizes in this order:
<ol>
<li>Tesla coils</li>
<li>Grounding rods</li>
<li>People and animals</li>
<li>Machines</li>
</ol>
</p>
<p>Tesla Coils will attract the energy ball&apos;s bolts. They will take half the power of the bolt (if they are connected to a wire node), pump it into the powernet it is hooked to, and then will send the other half of the power to the next available conductor, which follows the criteria listed above. Preferably, this will be another coil to harness more of the power and pump it into the grid.</p>
<p>Grounding Rods are safety precautions to prevent the tesla bolts from hitting machinery or personnel. If the tesla is loose, being near one will usually keep you safe from direct shocks.</p>
<br>
<h2>STARTUP PROCEDURE</h2>
<ol>
<li>Bolt and weld down the Field Generators, ensuring they form a complete rectangle.</li>
<li>Bolt and weld down the Emitters, ensuring their fire will strike the corner Field Generators</li>
<li>Bolt down the Tesla Generator inside the rectangle formed by the Field Generators in a spot where it will be struck by fire from the Particle Accelerator</li>
<li>Bolt down Telsa Coils and Grounding Rods</li>
<li>Activate the Emitters</li>
<li>Activate each of the Field Generators, then wait until the containment field has completely formed.</li>
<li>Setup the Particle Accelerator (see our best seller <i>&quot;Particle Accelerator User&apos;s Guide&quot;</i>!) and activate it.</li>
<li>After a short time the Telsa Generator will create an energy ball, being consumed in the process.</li>
</ol>
<br>
<h2>OPERATION AND MAINTENANCE</h2>
<ol>
<li>Ensure that electrical protection and meson goggles are worn at all times while working in the engine room.</li>
<li>Ensure that Telsa Coils and/or Grounding Rods are placed to safely collect or ground any and all shock.</li>
<li>Ensure that all Emitters remain activated and have unobstructed lines of fire to the Field Generators.</li>
<li>Do <b>not</b> let the Emitters run out of power.</li>
</ol>
<br>
<h2>SHUTDOWN PROCEDURE</h2>
<ol>
<li>De-activate the Particle Accelerator. The energy ball will begin to shrink and lose mini-balls.</li>
<li>When the energy ball has completely dissipated, the Emitters can be de-activated.</li>
</ol>
<br>
<h2>ENERGY BALL ESCAPE PROCEDURE</h2>
<ol>
<li>Do not let it escape.</li>
<li>Have someone ready to blame when it does escape.</li>
<li>Buy our forthcoming manual &quot;<i>Celebrity Grounding Rod Shelters of the Galaxy</i>&quot;</li>
</ol>
</body>
</html>"}
//R-UST port
/obj/item/weapon/book/manual/rust_engine
name = "R-UST Operating Manual"