Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Refactor armor.dm and add a new item armor painter to change icon state (skull, paddles etc...) #5726

Closed
wants to merge 12 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,9 @@
list("Shoulder Holster", 0.75, /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR),

list("ARMOR", -1, null, null),
list("M3 Pattern Carrier Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium/carrier, VENDOR_ITEM_REGULAR),
list("M3 Pattern Padded Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium/padded, VENDOR_ITEM_REGULAR),
list("M3 Pattern Padless Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium/padless, VENDOR_ITEM_REGULAR),
list("M3 Pattern Ridged Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium/padless_lines, VENDOR_ITEM_REGULAR),
list("M3 Pattern Skull Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium/skull, VENDOR_ITEM_REGULAR),
list("M3 Pattern Smooth Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium/smooth, VENDOR_ITEM_REGULAR),
list("M3-EOD Pattern Heavy Armor", round(scale * 10), /obj/item/clothing/suit/storage/marine/heavy, VENDOR_ITEM_REGULAR),
list("M3-L Pattern Light Armor", round(scale * 10), /obj/item/clothing/suit/storage/marine/light, VENDOR_ITEM_REGULAR),
list("M3-L Pattern Marine Light Armor", round(scale * 10), /obj/item/clothing/suit/storage/marine/light, VENDOR_ITEM_REGULAR),
list("M3 Pattern Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/medium, VENDOR_ITEM_REGULAR),
list("M3-EOD Pattern Marine Heavy Armor", round(scale * 10), /obj/item/clothing/suit/storage/marine/heavy, VENDOR_ITEM_REGULAR),

list("BACKPACK", -1, null, null, null),
list("Lightweight IMP Backpack", round(scale * 15), /obj/item/storage/backpack/marine, VENDOR_ITEM_REGULAR),
Expand Down Expand Up @@ -191,6 +186,7 @@
list("Falling Falcons Shoulder Patch", round(scale * 15), /obj/item/clothing/accessory/patch/falcon, VENDOR_ITEM_REGULAR),
list("USCM Shoulder Patch", round(scale * 15), /obj/item/clothing/accessory/patch, VENDOR_ITEM_REGULAR),
list("Bedroll", round(scale * 20), /obj/item/roller/bedroll, VENDOR_ITEM_REGULAR),
list("Armor Painter", round(scale * 20), /obj/item/device/armor_painter, VENDOR_ITEM_REGULAR),

list("OPTICS", -1, null, null, null),
list("Advanced Medical Optic (CORPSMAN ONLY)", round(scale * 4), /obj/item/device/helmet_visor/medical/advanced, VENDOR_ITEM_REGULAR),
Expand Down
73 changes: 73 additions & 0 deletions code/game/objects/items/devices/armor_painter.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//proc that allow to repaint/change sprite for

GLOBAL_LIST_INIT(armor_paints_light, list("padded" = "L1", "padless" = "L2", "padless_lines" = "L3", "carrier" = "L4", "skull" = "L5", "smooth" = "L6"))
GLOBAL_LIST_INIT(armor_paints_medium, list("padded" = "1", "padless" = "2", "padless_lines" = "3", "carrier" = "4", "skull" = "5", "smooth" = "6"))
GLOBAL_LIST_INIT(armor_paints_heavy, list("padded" = "H1", "padless" = "H2", "padless_lines" = "H3", "carrier" = "H4", "skull" = "H5", "smooth" = "H6"))
/obj/item/device/armor_painter
name = "armor painter"
icon = 'icons/obj/items/items.dmi'
icon_state = "camo"
item_state = "flight"
var/list/modes_light
var/list/modes_medium
var/list/modes_heavy
var/mode

/obj/item/device/armor_painter/New()
..()

modes_light = new()
for(var/C in GLOB.armor_paints_light)
modes_light += "[C]"
mode = pick(modes_light)

modes_medium = new()
for(var/C in GLOB.armor_paints_medium)
modes_medium += "[C]"
mode = pick(modes_medium)

modes_heavy = new()
for(var/C in GLOB.armor_paints_heavy)
modes_heavy += "[C]"
mode = pick(modes_heavy)


/obj/item/device/armor_painter/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity)
to_chat(user, "target isn't at proximity.")
return

if(!in_range(user, A))
to_chat(user, "target isn't in range.")
return

if(istype(A,/obj/item/clothing/suit/storage/marine/light))
to_chat(user, "it's an light armor.")
A.icon_state = (GLOB.armor_paints_light[mode])
return

if(istype(A,/obj/item/clothing/suit/storage/marine/medium))
to_chat(user, "it's an medium armor.")
A.icon_state = (GLOB.armor_paints_medium[mode])
return

if(istype(A,/obj/item/clothing/suit/storage/marine/heavy))
A.icon_state = (GLOB.armor_paints_heavy[mode])
to_chat(user, "it's an heavy armor.")
return

/obj/item/device/armor_painter/attack_self(mob/user)
..()
var/type = tgui_input_list(usr, "What type of armor?", "Armor painter", list("light", "medium", "heavy"))
switch(type)
if("light")
mode = tgui_input_list(usr, "Which armor tag do you want to use?", "Armor painter", modes_light)
if("medium")
mode = tgui_input_list(usr, "Which armor tag do you want to use?", "Armor painter", modes_medium)
if("heavy")
mode = tgui_input_list(usr, "Which armor tag do you want to use?", "Armor painter", modes_heavy)

/obj/item/device/armor_painter/get_examine_text(mob/user)
. = ..()
. += "It is in [mode] mode."

1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@
#include "code\game\objects\items\circuitboards\mecha.dm"
#include "code\game\objects\items\circuitboards\robot_modules.dm"
#include "code\game\objects\items\devices\aicard.dm"
#include "code\game\objects\items\devices\armor_painter.dm"
#include "code\game\objects\items\devices\autopsy_scanner.dm"
#include "code\game\objects\items\devices\binoculars.dm"
#include "code\game\objects\items\devices\cictablet.dm"
Expand Down
Loading