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

Outfit cleanup #16857

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Outfit cleanup #16857

wants to merge 22 commits into from

Conversation

ivanmixo
Copy link
Contributor

@ivanmixo ivanmixo commented Dec 29, 2024

About The Pull Request

Took the absolute behemoth that #16627 is and brought it down to just the outfit changes. I've also moved all the outfit datums into their own folders in their own files instead of them being put in the already crammed job files/folders.

Example

The goal is to turn this

/datum/outfit/job/deathsquad/standard
	name = "Deathsquad Standard"
	jobtype = /datum/job/deathsquad/standard
	id = /obj/item/card/id/silver
	belt = /obj/item/weapon/gun/energy/lasgun/pulse
	ears = /obj/item/radio/headset/distress/commando
	w_uniform = /obj/item/clothing/under/marine/veteran/pmc/commando
	shoes = /obj/item/clothing/shoes/marine/deathsquad
	wear_suit = /obj/item/clothing/suit/storage/marine/veteran/pmc/commando
	gloves = /obj/item/clothing/gloves/marine/veteran/pmc/commando
	head = /obj/item/clothing/head/helmet/marine/veteran/pmc/commando
	mask = /obj/item/clothing/mask/gas/pmc
	glasses = /obj/item/clothing/glasses/night/m42_night_goggles
	suit_store = /obj/item/weapon/gun/flamer/big_flamer/marinestandard/deathsquad
	r_store = /obj/item/storage/pouch/medkit
	l_store = /obj/item/storage/pouch/grenade
	back = /obj/item/storage/backpack/commando
	implants = list(/obj/item/implant/suicide_dust)

/datum/outfit/job/deathsquad/standard/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
	. = ..()
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/acid, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/neuro, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/drain, SLOT_IN_SUIT)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/smokebomb/cloak, SLOT_IN_SUIT)

	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_HEAD)
	H.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba, SLOT_IN_HEAD)

	H.equip_to_slot_or_del(new /obj/item/storage/pill_bottle/hypervene, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/storage/pill_bottle/packet/ryetalyn, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/advanced/oxycodone, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/hypospray/autoinjector/elite, SLOT_IN_R_POUCH)

	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/phosphorus, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/phosphorus, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)
	H.equip_to_slot_or_del(new /obj/item/explosive/grenade/pmc, SLOT_IN_L_POUCH)

	H.equip_to_slot_or_del(new /obj/item/tool/crowbar/red, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/binoculars, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/explosive/plastique, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/reagent_containers/food/snacks/wrapped/chunk, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/weapon/energy/sword/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/weapon/shield/energy, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/cell/lasgun/pulse, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)
	H.equip_to_slot_or_del(new /obj/item/ammo_magazine/flamer_tank/large/X/deathsquad, SLOT_IN_BACKPACK)

Into this

/datum/outfit/job/deathsquad/standard
	name = "Deathsquad Standard"
	jobtype = /datum/job/deathsquad/standard
	id = /obj/item/card/id/silver
	belt = /obj/item/weapon/gun/energy/lasgun/pulse
	ears = /obj/item/radio/headset/distress/commando
	w_uniform = /obj/item/clothing/under/marine/veteran/pmc/commando
	shoes = /obj/item/clothing/shoes/marine/deathsquad
	wear_suit = /obj/item/clothing/suit/storage/marine/veteran/pmc/commando
	gloves = /obj/item/clothing/gloves/marine/veteran/pmc/commando
	head = /obj/item/clothing/head/helmet/marine/veteran/pmc/commando
	mask = /obj/item/clothing/mask/gas/pmc
	glasses = /obj/item/clothing/glasses/night/m42_night_goggles
	suit_store = /obj/item/weapon/gun/flamer/big_flamer/marinestandard/deathsquad
	r_pocket = /obj/item/storage/pouch/medkit
	l_pocket = /obj/item/storage/pouch/grenade
	back = /obj/item/storage/backpack/commando
	implants = list(/obj/item/implant/suicide_dust)

	backpack_contents = list(
		/obj/item/explosive/plastique = 6,
		/obj/item/tool/crowbar/red = 1,
		/obj/item/binoculars = 1,
		/obj/item/reagent_containers/food/snacks/wrapped/chunk = 1,
		/obj/item/weapon/energy/sword/deathsquad = 1,
		/obj/item/weapon/shield/energy = 1,
		/obj/item/cell/lasgun/pulse = 1,
		/obj/item/ammo_magazine/flamer_tank/large/X/deathsquad = 7,
	)

	suit_contents = list(
		/obj/item/explosive/grenade/pmc = 2,
		/obj/item/explosive/grenade/smokebomb/acid = 1,
		/obj/item/explosive/grenade/smokebomb/neuro = 1,
		/obj/item/explosive/grenade/smokebomb/drain = 1,
		/obj/item/explosive/grenade/smokebomb/cloak = 1,
	)

	head_contents = list(
		/obj/item/explosive/plastique = 1,
		/obj/item/clothing/mask/cigarette/cigar/cohiba = 1,
	)

	l_pocket_contents = list(
		/obj/item/explosive/grenade/pmc = 4,
		/obj/item/explosive/grenade/phosphorus = 2,
	)

	r_pocket_contents = list(
		/obj/item/storage/pill_bottle/hypervene = 1,
		/obj/item/storage/pill_bottle/packet/ryetalyn = 1,
		/obj/item/reagent_containers/hypospray/advanced/oxycodone = 1,
		/obj/item/reagent_containers/hypospray/autoinjector/elite = 4,
	)

Why It's Good For The Game

This makes the outfit code so much less cancer to both write and look at, and it also adds safeguards against trying to cram too much stuff into a single container. Very cool.

Changelog

🆑
refactor: Refactored the way outfits populate the contents of containers
/:cl:

@tgstation-server tgstation-server added the Refactor Improves underlying code to make systems more modular and functional. label Dec 29, 2024
@github-actions github-actions bot added the Merge Conflict Pull request is in a conflicted state with base branch. label Jan 3, 2025
implants += imptype
return TRUE

/datum/outfit/proc/from_mob(mob/living/base)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be handling container contents at all? Also could use autodocs on a bunch of these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not my code, I just moved this from another file. I don't even know if the file things even work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merge Conflict Pull request is in a conflicted state with base branch. Refactor Improves underlying code to make systems more modular and functional.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants