mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 17:42:26 +00:00
Removed custom item defines, refactored mech kits.
This commit is contained in:
@@ -1070,18 +1070,6 @@
|
||||
do_after_cooldown()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/paintkit //Please don't use this for anything, it's a base type for custom mech paintjobs.
|
||||
name = "mecha customisation kit"
|
||||
desc = "A generic kit containing all the needed tools and parts to turn a mech into another mech."
|
||||
icon = 'icons/obj/custom_items.dmi'
|
||||
icon_state = "royce_kit"
|
||||
|
||||
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?
|
||||
var/removable = null //Can the kit be removed?
|
||||
var/list/allowed_types = list() //Types of mech that the kit will work on.
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
name = "passenger compartment"
|
||||
desc = "A mountable passenger compartment for exo-suits. Rather cramped."
|
||||
|
||||
@@ -814,13 +814,13 @@
|
||||
user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]")
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/paintkit))
|
||||
else 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/weapon/paintkit/P = W
|
||||
var/obj/item/device/kit/paint/P = W
|
||||
var/found = null
|
||||
|
||||
for(var/type in P.allowed_types)
|
||||
@@ -838,9 +838,7 @@
|
||||
src.desc = P.new_desc
|
||||
src.initial_icon = P.new_icon
|
||||
src.reset_icon()
|
||||
|
||||
user.drop_item()
|
||||
qdel(P)
|
||||
P.use(1, user)
|
||||
|
||||
else
|
||||
call((proc_res["dynattackby"]||src), "dynattackby")(W,user)
|
||||
|
||||
58
code/game/objects/items/paintkit.dm
Normal file
58
code/game/objects/items/paintkit.dm
Normal file
@@ -0,0 +1,58 @@
|
||||
/obj/item/device/kit
|
||||
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?
|
||||
var/uses = 2 // Uses before the kit deletes itself.
|
||||
|
||||
/obj/item/device/kit/proc/use(var/amt, var/mob/user)
|
||||
uses -= amt
|
||||
playsound(get_turf(user), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(uses<1)
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
|
||||
// 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
|
||||
name = "voidsuit modification kit"
|
||||
desc = "A kit for modifying a voidsuit."
|
||||
icon = 'icons/obj/custom_items.dmi'
|
||||
icon_state = "salvage_kit"
|
||||
var/new_light_overlay
|
||||
|
||||
/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/O as obj, mob/user as mob)
|
||||
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
|
||||
item_state = kit.new_icon
|
||||
if(kit.new_light_overlay)
|
||||
light_overlay = kit.new_light_overlay
|
||||
user << "You set about modifying the helmet into [src]."
|
||||
kit.use(1,user)
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/suit/space/void/attackby(var/obj/item/O as obj, mob/user as mob)
|
||||
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
|
||||
item_state = kit.new_icon
|
||||
user << "You set about modifying the suit into [src]."
|
||||
kit.use(1,user)
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
// Actual application of this kit is handled in mecha.dm attackby().
|
||||
/obj/item/device/kit/paint
|
||||
name = "mecha customisation kit"
|
||||
desc = "A generic kit containing all the needed tools and parts to turn a mech into another mech."
|
||||
icon = 'icons/obj/custom_items.dmi'
|
||||
icon_state = "royce_kit"
|
||||
|
||||
var/removable = null
|
||||
var/list/allowed_types = list()
|
||||
Reference in New Issue
Block a user