Files
Polaris/code/game/objects/items/devices/modkit.dm
Neerti 99eb6f9404 Updates Tools
Adds toolspeed var, which is a multiplier on how 'fast' the tool works.  0.5 means it goes twice as fast.
Adds usesound var, which determines what sound is used when a tool is being used.
Changes a lot of code to use those two vars instead.
Adds 'ayyy' tools, which are ported from /tg/'s abductor gamemode.  They're currently admin only but I might make them obtainable by xenoarch later.
Adds powertools, also from /tg/.  CE starts with them in a new toolbelt that spawns in their locker, ported from (you guessed it) /tg/.
Changes welder sprites to look nicer, ported yet again from /tg/.  Modified the blue welder slightly so it can be the electric welder sprite.
Adds various sounds from /tg/, for tools and welders.
2017-08-03 04:49:23 -04:00

73 lines
2.1 KiB
Plaintext

#define MODKIT_HELMET 1
#define MODKIT_SUIT 2
#define MODKIT_FULL 3
/obj/item/device/modkit
name = "hardsuit modification kit"
desc = "A kit containing all the needed tools and parts to modify a hardsuit for another user."
icon_state = "modkit"
var/parts = MODKIT_FULL
var/target_species = "Human"
var/list/permitted_types = list(
/obj/item/clothing/head/helmet/space/void,
/obj/item/clothing/suit/space/void
)
/obj/item/device/modkit/afterattack(obj/item/O, mob/user as mob, proximity)
if(!proximity)
return
if (!target_species)
return //it shouldn't be null, okay?
if(!parts)
user << "<span class='warning'>This kit has no parts for this modification left.</span>"
user.drop_from_inventory(src)
qdel(src)
return
var/allowed = 0
for (var/permitted_type in permitted_types)
if(istype(O, permitted_type))
allowed = 1
var/obj/item/clothing/I = O
if (!istype(I) || !allowed)
user << "<span class='notice'>[src] is unable to modify that.</span>"
return
var/excluding = ("exclude" in I.species_restricted)
var/in_list = (target_species in I.species_restricted)
if (excluding ^ in_list)
user << "<span class='notice'>[I] is already modified.</span>"
return
if(!isturf(O.loc))
user << "<span class='warning'>[O] must be safely placed on the ground for modification.</span>"
return
playsound(src.loc, O.usesound, 100, 1)
user.visible_message("<span class='notice'>\The [user] opens \the [src] and modifies \the [O].</span>","<span class='notice'>You open \the [src] and modify \the [O].</span>")
I.refit_for_species(target_species)
if (istype(I, /obj/item/clothing/head/helmet))
parts &= ~MODKIT_HELMET
if (istype(I, /obj/item/clothing/suit))
parts &= ~MODKIT_SUIT
if(!parts)
user.drop_from_inventory(src)
qdel(src)
/obj/item/device/modkit/examine(mob/user)
..(user)
user << "It looks as though it modifies hardsuits to fit [target_species] users."
/obj/item/device/modkit/tajaran
name = "tajaran hardsuit modification kit"
desc = "A kit containing all the needed tools and parts to modify a hardsuit for another user. This one looks like it's meant for Tajaran."
target_species = "Tajara"