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

Fix janky apply_borg_disguise #3

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@
if(capped)
return
if(istype(target, /obj/item/clothing/head/cardborg)) // Spraypainting your cardborg suit for more fashion options.
cardborg_recolour(target)
cardborg_recolor(target)
return
if(istype(target, /obj/item/clothing/suit/cardborg))
cardborg_recolour(target)
cardborg_recolor(target)
return
else
if(iscarbon(target))
Expand Down
107 changes: 54 additions & 53 deletions code/modules/clothing/suits/cardborg_suit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,63 +199,64 @@ CONTENTS:

/obj/item/clothing/suit/cardborg/equipped(mob/living/user, slot)
..()
if(slot == SLOT_HUD_OUTER_SUIT)
apply_borg_disguise(user)
if(ishuman(user) && slot == SLOT_HUD_OUTER_SUIT)
var/mob/living/carbon/human/H = user
if(istype(H.head, /obj/item/clothing/head/cardborg))
var/obj/item/clothing/head/cardborg/head = H.head
src.apply_borg_disguise(user, head)

/obj/item/clothing/suit/cardborg/dropped(mob/living/user)
..()
user.remove_alt_appearance("borg_disguise_variant")

/obj/item/clothing/suit/cardborg/proc/apply_borg_disguise(mob/living/carbon/human/H, obj/item/clothing/head/cardborg/borghead)
if(!istype(H))
if(!istype(H) || !istype(borghead))
return
if(!borghead)
borghead = H.head // This actually stops the disguise from applying just from having it in your hands AGHHHH!
if(istype(borghead, /obj/item/clothing/head/cardborg)) // Why is this done this way? because equipped() is called BEFORE THE ITEM IS IN THE SLOT WHYYYY!
var/borg_disguise_variant
var/disguise_eyes
borg_disguise_variant = pick(borghead.available_disguises)
switch(borg_disguise_variant) // We need to know what glowy bits to stick on.
if("Standard", "Standard-Secy", "Standard-Engi", "Standard-Mine", "Standard-Serv", "Standard-Jani")
disguise_eyes = "eyes-Standard"
if("Cricket-SEC", "Cricket-ENGI", "Cricket-MINE", "Cricket-SERV", "Cricket-MEDI", "Cricket-Jani")
disguise_eyes = "eyes-Cricket"
if("ertgamma", "nano_bloodhound")
disguise_eyes = "eyes-ertgamma"
if("bloodhound")
disguise_eyes = "eyes-bloodhound"
if("syndie_bloodhound")
disguise_eyes = "eyes-syndie_bloodhound"
if("syndi-engi")
disguise_eyes = "eyes-syndi-engi"
if("lavaland")
disguise_eyes = "eyes-lavaland"
if("Miner")
disguise_eyes = "eyes-Miner"
if("droid-miner")
disguise_eyes = "eyes-droid-miner"
if("droid-medical")
disguise_eyes = "eyes-droid-medical"
if("landmate")
disguise_eyes = "eyes-landmate"
if("Engineering")
disguise_eyes = "eyes-Engineering"
if("surgeon")
disguise_eyes = "eyes-surgeon"
if("mopgearrex")
disguise_eyes = "eyes-mopgearrex"
if("toiletbot")
disguise_eyes = "eyes-toiletbot"
if("qualified_doctor")
disguise_eyes = "eyes-qualified_doctor"
if("custodiborg")
disguise_eyes = "eyes-custodiborg"
if("heavySec")
disguise_eyes = "eyes-heavySec"
if("squatminer")
disguise_eyes = "eyes-squatminer"
var/image/I = image(icon = 'icons/mob/robots.dmi' , icon_state = borg_disguise_variant, loc = H) // Now you're a robot!
I.override = 1
if(disguise_eyes)
I.overlays += image(icon = 'icons/mob/robots.dmi', icon_state = disguise_eyes) // Gotta look realistic, have some glowy bits!
H.add_alt_appearance("borg_disguise_variant", I, GLOB.silicon_mob_list+H) // You look like a robot to robots (including yourself because you're totally a robot)!

var/borg_disguise_variant
var/disguise_eyes
borg_disguise_variant = pick(borghead.available_disguises)
switch(borg_disguise_variant) // We need to know what glowy bits to stick on.
if("Standard", "Standard-Secy", "Standard-Engi", "Standard-Mine", "Standard-Serv", "Standard-Jani")
disguise_eyes = "eyes-Standard"
if("Cricket-SEC", "Cricket-ENGI", "Cricket-MINE", "Cricket-SERV", "Cricket-MEDI", "Cricket-Jani")
disguise_eyes = "eyes-Cricket"
if("ertgamma", "nano_bloodhound")
disguise_eyes = "eyes-ertgamma"
if("bloodhound")
disguise_eyes = "eyes-bloodhound"
if("syndie_bloodhound")
disguise_eyes = "eyes-syndie_bloodhound"
if("syndi-engi")
disguise_eyes = "eyes-syndi-engi"
if("lavaland")
disguise_eyes = "eyes-lavaland"
if("Miner")
disguise_eyes = "eyes-Miner"
if("droid-miner")
disguise_eyes = "eyes-droid-miner"
if("droid-medical")
disguise_eyes = "eyes-droid-medical"
if("landmate")
disguise_eyes = "eyes-landmate"
if("Engineering")
disguise_eyes = "eyes-Engineering"
if("surgeon")
disguise_eyes = "eyes-surgeon"
if("mopgearrex")
disguise_eyes = "eyes-mopgearrex"
if("toiletbot")
disguise_eyes = "eyes-toiletbot"
if("qualified_doctor")
disguise_eyes = "eyes-qualified_doctor"
if("custodiborg")
disguise_eyes = "eyes-custodiborg"
if("heavySec")
disguise_eyes = "eyes-heavySec"
if("squatminer")
disguise_eyes = "eyes-squatminer"
var/image/I = image(icon = 'icons/mob/robots.dmi' , icon_state = borg_disguise_variant, loc = H) // Now you're a robot!
I.override = 1
if(disguise_eyes)
I.overlays += image(icon = 'icons/mob/robots.dmi', icon_state = disguise_eyes) // Gotta look realistic, have some glowy bits!
H.add_alt_appearance("borg_disguise_variant", I, GLOB.silicon_mob_list+H) // You look like a robot to robots (including yourself because you're totally a robot)!