From f77d208d0470344f5133cf8a3df3af9a7538d984 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Sat, 22 Jun 2013 22:19:52 -0700 Subject: [PATCH] Fixes #3131 --- code/game/mecha/equipment/tools/tools.dm | 14 +++++++++++- code/game/mecha/mecha.dm | 28 ++++++++++++++++++++++++ code/game/mecha/working/ripley.dm | 18 +++------------ code/modules/customitems/item_defines.dm | 23 +++++++++++++------ 4 files changed, 60 insertions(+), 23 deletions(-) diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 0cb83e5ac55..81243486139 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -1053,4 +1053,16 @@ set_ready_state(0) chassis.use_power(energy_drain) do_after_cooldown() - return 1 \ No newline at end of file + 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 = '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. \ No newline at end of file diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 9d8291733cb..c94c38c6c32 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -759,6 +759,34 @@ user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]") return + else if(istype(W, /obj/item/weapon/paintkit)) + + 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/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 + src.reset_icon() + + user.drop_item() + del(P) + else call((proc_res["dynattackby"]||src), "dynattackby")(W,user) /* diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index 84bff5cffc4..d7e6a00fdbf 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -2,6 +2,7 @@ desc = "Autonomous Power Loader Unit. The workhorse of the exosuit world." name = "APLU \"Ripley\"" icon_state = "ripley" + initial_icon = "ripley" step_in = 6 max_temperature = 20000 health = 200 @@ -19,6 +20,7 @@ desc = "Standart APLU chassis was refitted with additional thermal protection and cistern." name = "APLU \"Firefighter\"" icon_state = "firefighter" + initial_icon = "firefighter" max_temperature = 65000 health = 250 lights_power = 8 @@ -107,18 +109,4 @@ T.Entered(A) step_rand(A) ..() - return - - -/obj/mecha/working/ripley/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/fluff/sven_fjeltson_1))//this shit broke ripleys - src.icon_state = "earth" - src.initial_icon = "earth" - src.name = "APLU \"Strike the Earth!\"" - src.desc = "Looks like an over worked, under maintained Ripley with some horrific damage." - user << "You pick up your old \"Strike the Earth!\" APLU." - user.drop_item() - del(W) - return - else - ..() + return \ No newline at end of file diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 086f04efa0f..33c1aafbb4c 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -1,4 +1,3 @@ -hi // Add custom items you give to people here, and put their icons in custom_items.dmi // Remember to change 'icon = 'custom_items.dmi'' for items not using /obj/item/fluff as a base // Clothing item_state doesn't use custom_items.dmi. Just add them to the normal clothing files. @@ -359,19 +358,29 @@ hi ////// Ripley customisation kit - Butchery Royce - MayeDay -/obj/item/weapon/fluff/butcher_royce_1 +/obj/item/weapon/paintkit/fluff/butcher_royce_1 name = "Ripley customisation kit" desc = "A kit containing all the needed tools and parts to turn an APLU Ripley into a Titan's Fist worker mech." icon = 'custom_items.dmi' icon_state = "royce_kit" + new_name = "APLU \"Titan's Fist\"" + new_desc = "This ordinary mining Ripley has been customized to look like a unit of the Titans Fist." + new_icon = "titan" + allowed_types = list("ripley","firefighter") + ////// Ripley customisation kit - Sven Fjeltson - Mordeth221 -/obj/item/weapon/fluff/sven_fjeltson_1 - name = "Mercenary APLU kit" - desc = "A kit containing all the needed tools and parts to turn an APLU Ripley into an old Mercenaries APLU." - icon = 'custom_items.dmi' - icon_state = "sven_kit" +/obj/item/weapon/paintkit/fluff/sven_fjeltson_1 + name = "Mercenary APLU kit" + desc = "A kit containing all the needed tools and parts to turn an APLU Ripley into an old Mercenaries APLU." + icon = 'custom_items.dmi' + icon_state = "sven_kit" + + new_name = "APLU \"Strike the Earth!\"" + new_desc = "Looks like an over worked, under maintained Ripley with some horrific damage." + new_icon = "earth" + allowed_types = list("ripley","firefighter") ////////////////////////////////// //////////// Clothing ////////////