From a7c539ac329abb5c7a7b9f609f6fc8e270072b6b Mon Sep 17 00:00:00 2001 From: Lin Date: Fri, 10 Jan 2020 01:34:39 +0000 Subject: [PATCH 1/2] Ports reagents id removal and typepath usage. --- .../LavaRuins/lavaland_surface_pizzaparty.dmm | 2 +- _maps/RandomRuins/SpaceRuins/TheDerelict.dmm | 2 +- code/__HELPERS/_cit_helpers.dm | 4 +- code/__HELPERS/cmp.dm | 3 + code/__HELPERS/global_lists.dm | 2 +- code/__HELPERS/mobs.dm | 4 +- code/datums/datumvars.dm | 2856 +++++++++-------- code/datums/diseases/_disease.dm | 2 +- code/datums/diseases/advance/advance.dm | 980 +++--- .../diseases/advance/symptoms/choking.dm | 290 +- code/datums/diseases/advance/symptoms/fire.dm | 4 +- .../diseases/advance/symptoms/flesh_eating.dm | 4 +- code/datums/diseases/advance/symptoms/heal.dm | 15 +- .../diseases/advance/symptoms/sensory.dm | 8 +- code/datums/diseases/anxiety.dm | 2 +- code/datums/diseases/beesease.dm | 76 +- code/datums/diseases/brainrot.dm | 118 +- code/datums/diseases/cold.dm | 104 +- code/datums/diseases/cold9.dm | 76 +- code/datums/diseases/dna_spread.dm | 148 +- code/datums/diseases/fake_gbs.dm | 64 +- code/datums/diseases/flu.dm | 108 +- code/datums/diseases/fluspanish.dm | 72 +- code/datums/diseases/gbs.dm | 62 +- code/datums/diseases/heart_failure.dm | 2 +- code/datums/diseases/magnitis.dm | 134 +- code/datums/diseases/parrotpossession.dm | 2 +- code/datums/diseases/pierrot_throat.dm | 108 +- code/datums/diseases/retrovirus.dm | 166 +- code/datums/diseases/rhumba_beat.dm | 90 +- code/datums/diseases/transformation.dm | 654 ++-- code/datums/diseases/tuberculosis.dm | 2 +- code/datums/diseases/wizarditis.dm | 234 +- code/datums/recipe.dm | 2 +- code/datums/status_effects/debuffs.dm | 2 +- code/datums/traits/negative.dm | 2 +- .../game/gamemodes/clown_ops/clown_weapons.dm | 4 +- code/game/machinery/Sleeper.dm | 820 ++--- code/game/machinery/bloodbankgen.dm | 6 +- code/game/machinery/limbgrower.dm | 16 +- .../mecha/equipment/tools/medical_tools.dm | 1111 ++++--- code/game/mecha/equipment/tools/work_tools.dm | 2 +- code/game/mecha/mecha_defense.dm | 8 +- .../effects/decals/cleanable/aliens.dm | 142 +- .../objects/effects/decals/cleanable/gibs.dm | 9 +- .../objects/effects/decals/cleanable/misc.dm | 512 ++- .../effects/decals/cleanable/robots.dm | 130 +- .../effects/effect_system/effects_foam.dm | 694 ++-- code/game/objects/effects/mines.dm | 352 +- code/game/objects/items/RSF.dm | 2 +- code/game/objects/items/airlock_painter.dm | 252 +- code/game/objects/items/apc_frame.dm | 2 +- code/game/objects/items/cigs_lighters.dm | 2136 ++++++------ .../items/circuitboards/circuitboard.dm | 2 +- code/game/objects/items/clown_items.dm | 342 +- code/game/objects/items/crayons.dm | 30 +- .../objects/items/devices/dogborg_sleeper.dm | 9 +- code/game/objects/items/devices/flashlight.dm | 1091 +++---- code/game/objects/items/devices/scanners.dm | 1687 +++++----- code/game/objects/items/extinguisher.dm | 514 +-- .../objects/items/grenades/chem_grenade.dm | 1204 +++---- .../objects/items/grenades/clusterbuster.dm | 6 +- code/game/objects/items/hot_potato.dm | 342 +- .../objects/items/implants/implant_misc.dm | 2 +- code/game/objects/items/kitchen.dm | 472 +-- code/game/objects/items/mop.dm | 4 +- code/game/objects/items/religion.dm | 2 +- .../objects/items/robot/robot_upgrades.dm | 1384 ++++---- code/game/objects/items/stacks/bscrystal.dm | 178 +- code/game/objects/items/stacks/medical.dm | 384 +-- .../game/objects/items/stacks/sheets/light.dm | 70 +- .../objects/items/stacks/sheets/mineral.dm | 16 +- .../items/stacks/sheets/sheet_types.dm | 14 +- code/game/objects/items/storage/book.dm | 16 +- code/game/objects/items/tanks/watertank.dm | 18 +- code/game/objects/items/tools/weldingtool.dm | 16 +- code/game/objects/items/trash.dm | 170 +- code/game/objects/structures/divine.dm | 4 +- code/game/objects/structures/watercloset.dm | 9 +- code/game/turfs/turf.dm | 8 +- .../abductor/equipment/abduction_gear.dm | 2 +- .../antagonists/abductor/equipment/gland.dm | 15 +- .../antagonists/blob/blob/blobs/blob_mobs.dm | 4 +- .../changeling/powers/adrenaline.dm | 2 +- .../antagonists/changeling/powers/linglink.dm | 2 +- .../changeling/powers/mutations.dm | 2 +- .../antagonists/changeling/powers/panacea.dm | 8 +- .../changeling/powers/tiny_prick.dm | 532 +-- .../clockcult/clock_helpers/slab_abilities.dm | 6 +- code/modules/antagonists/cult/cult_items.dm | 6 +- code/modules/antagonists/cult/ritual.dm | 8 +- code/modules/antagonists/devil/devil.dm | 4 +- .../nukeop/equipment/nuclearbomb.dm | 2 +- .../revenant/revenant_abilities.dm | 2 +- .../awaymissions/mission_code/snowdin.dm | 2 +- code/modules/cargo/bounties/reagent.dm | 6 +- code/modules/client/preferences.dm | 6 +- code/modules/client/preferences_savefile.dm | 7 +- code/modules/clothing/clothing.dm | 814 ++--- code/modules/clothing/outfits/standard.dm | 2 +- code/modules/events/holiday/vday.dm | 2 +- code/modules/events/vent_clog.dm | 424 ++- code/modules/events/wizard/invincible.dm | 2 +- code/modules/food_and_drinks/drinks/drinks.dm | 47 +- .../food_and_drinks/drinks/drinks/bottle.dm | 109 +- .../drinks/drinks/drinkingglass.dm | 10 +- .../modules/food_and_drinks/food/condiment.dm | 77 +- .../food_and_drinks/food/customizables.dm | 4 +- code/modules/food_and_drinks/food/snacks.dm | 14 +- .../food_and_drinks/food/snacks/dough.dm | 16 +- .../food_and_drinks/food/snacks/meat.dm | 46 +- .../food_and_drinks/food/snacks_bread.dm | 74 +- .../food_and_drinks/food/snacks_burgers.dm | 93 +- .../food_and_drinks/food/snacks_cake.dm | 60 +- .../food_and_drinks/food/snacks_egg.dm | 24 +- .../food_and_drinks/food/snacks_frozen.dm | 60 +- .../food_and_drinks/food/snacks_meat.dm | 100 +- .../food_and_drinks/food/snacks_other.dm | 156 +- .../food_and_drinks/food/snacks_pastry.dm | 189 +- .../food_and_drinks/food/snacks_pie.dm | 78 +- .../food_and_drinks/food/snacks_pizza.dm | 34 +- .../food_and_drinks/food/snacks_salad.dm | 40 +- .../food/snacks_sandwichtoast.dm | 54 +- .../food_and_drinks/food/snacks_soup.dm | 92 +- .../food_and_drinks/food/snacks_spaghetti.dm | 30 +- .../food_and_drinks/food/snacks_sushi.dm | 26 +- .../food_and_drinks/food/snacks_vend.dm | 18 +- .../kitchen_machinery/deep_fryer.dm | 6 +- .../kitchen_machinery/food_cart.dm | 10 +- .../kitchen_machinery/gibber.dm | 2 +- .../kitchen_machinery/grill.dm | 6 +- .../kitchen_machinery/icecream_vat.dm | 60 +- .../kitchen_machinery/microwave.dm | 4 +- .../food_and_drinks/recipes/drinks_recipes.dm | 783 +++-- .../food_and_drinks/recipes/food_mixtures.dm | 80 +- .../recipes/tablecraft/recipes_pastry.dm | 6 +- code/modules/holiday/easter.dm | 14 +- code/modules/holiday/halloween/jacqueen.dm | 7 +- code/modules/hydroponics/beekeeping/beebox.dm | 4 +- .../hydroponics/beekeeping/honeycomb.dm | 6 +- code/modules/hydroponics/biogenerator.dm | 630 ++-- code/modules/hydroponics/fermenting_barrel.dm | 2 +- code/modules/hydroponics/grown.dm | 338 +- code/modules/hydroponics/grown/ambrosia.dm | 6 +- code/modules/hydroponics/grown/apple.dm | 8 +- code/modules/hydroponics/grown/banana.dm | 14 +- code/modules/hydroponics/grown/beans.dm | 6 +- code/modules/hydroponics/grown/berries.dm | 38 +- code/modules/hydroponics/grown/cannabis.dm | 38 +- code/modules/hydroponics/grown/cereals.dm | 16 +- code/modules/hydroponics/grown/chili.dm | 6 +- code/modules/hydroponics/grown/citrus.dm | 22 +- .../hydroponics/grown/cocoa_vanilla.dm | 17 +- code/modules/hydroponics/grown/corn.dm | 6 +- code/modules/hydroponics/grown/eggplant.dm | 6 +- code/modules/hydroponics/grown/flowers.dm | 24 +- .../modules/hydroponics/grown/grass_carpet.dm | 4 +- code/modules/hydroponics/grown/kudzu.dm | 16 +- code/modules/hydroponics/grown/melon.dm | 6 +- code/modules/hydroponics/grown/misc.dm | 56 +- code/modules/hydroponics/grown/mushrooms.dm | 26 +- code/modules/hydroponics/grown/nettle.dm | 4 +- code/modules/hydroponics/grown/onion.dm | 8 +- code/modules/hydroponics/grown/peach.dm | 4 +- code/modules/hydroponics/grown/peanuts.dm | 6 +- code/modules/hydroponics/grown/pineapple.dm | 2 +- code/modules/hydroponics/grown/potato.dm | 10 +- code/modules/hydroponics/grown/pumpkin.dm | 8 +- code/modules/hydroponics/grown/replicapod.dm | 4 +- code/modules/hydroponics/grown/root.dm | 12 +- code/modules/hydroponics/grown/tea_coffee.dm | 23 +- code/modules/hydroponics/grown/tobacco.dm | 6 +- code/modules/hydroponics/grown/tomato.dm | 22 +- code/modules/hydroponics/hydroitemdefines.dm | 390 +-- code/modules/hydroponics/hydroponics.dm | 1894 +++++------ code/modules/hydroponics/plant_genes.dm | 6 +- code/modules/hydroponics/seeds.dm | 820 ++--- .../integrated_electronics/passive/power.dm | 7 +- .../subtypes/reagents.dm | 10 +- code/modules/mining/lavaland/ash_flora.dm | 12 +- .../mining/lavaland/necropolis_chests.dm | 3 +- code/modules/mining/ores_coins.dm | 974 +++--- code/modules/mob/living/blood.dm | 14 +- code/modules/mob/living/bloodcrawl.dm | 4 +- code/modules/mob/living/brain/brain_item.dm | 16 +- .../modules/mob/living/carbon/alien/organs.dm | 4 +- .../carbon/alien/special/alien_embryo.dm | 274 +- code/modules/mob/living/carbon/carbon.dm | 2 +- .../mob/living/carbon/carbon_defense.dm | 972 +++--- .../mob/living/carbon/human/examine.dm | 841 +++-- .../mob/living/carbon/human/species.dm | 4 +- .../carbon/human/species_types/flypeople.dm | 72 +- .../carbon/human/species_types/golems.dm | 2018 ++++++------ .../carbon/human/species_types/jellypeople.dm | 1474 ++++----- .../carbon/human/species_types/mushpeople.dm | 4 +- .../carbon/human/species_types/podpeople.dm | 4 +- .../carbon/human/species_types/synths.dm | 258 +- code/modules/mob/living/carbon/life.dm | 1546 ++++----- .../mob/living/carbon/monkey/monkey.dm | 350 +- code/modules/mob/living/living.dm | 6 +- code/modules/mob/living/living_defense.dm | 1032 +++--- .../mob/living/silicon/robot/robot_modules.dm | 1290 ++++---- .../mob/living/simple_animal/astral.dm | 2 +- .../mob/living/simple_animal/bot/medbot.dm | 1400 ++++---- .../mob/living/simple_animal/bot/secbot.dm | 892 ++--- .../mob/living/simple_animal/friendly/cat.dm | 638 ++-- .../simple_animal/friendly/farm_animals.dm | 696 ++-- .../living/simple_animal/friendly/mouse.dm | 4 +- .../living/simple_animal/friendly/snake.dm | 4 +- .../mob/living/simple_animal/hostile/bees.dm | 19 +- .../simple_animal/hostile/giant_spider.dm | 1074 +++---- .../simple_animal/hostile/jungle/leaper.dm | 5 +- .../hostile/mining_mobs/gutlunch.dm | 4 +- .../living/simple_animal/hostile/mushroom.dm | 384 +-- .../mob/living/simple_animal/slime/slime.dm | 4 +- .../suit/n_suit_verbs/ninja_adrenaline.dm | 4 +- code/modules/ninja/suit/suit_attackby.dm | 8 +- code/modules/paperwork/pen.dm | 436 +-- code/modules/paperwork/photocopier.dm | 680 ++-- code/modules/photography/photos/photo.dm | 186 +- code/modules/power/cable.dm | 1700 +++++----- code/modules/power/cell.dm | 722 ++--- code/modules/power/lighting.dm | 4 +- .../ammunition/ballistic/shotgun.dm | 282 +- code/modules/projectiles/projectile.dm | 1282 ++++---- .../projectile/bullets/dart_syringe.dm | 173 +- code/modules/reagents/chemistry/holder.dm | 112 +- .../chemistry/machinery/chem_dispenser.dm | 262 +- .../chemistry/machinery/chem_master.dm | 30 +- .../chemistry/machinery/chem_synthesizer.dm | 10 +- .../reagents/chemistry/machinery/pandemic.dm | 10 +- .../chemistry/machinery/reagentgrinder.dm | 22 +- code/modules/reagents/chemistry/reagents.dm | 50 +- .../chemistry/reagents/alcohol_reagents.dm | 170 +- .../chemistry/reagents/blob_reagents.dm | 31 +- .../chemistry/reagents/drink_reagents.dm | 87 +- .../chemistry/reagents/drug_reagents.dm | 39 +- .../chemistry/reagents/food_reagents.dm | 71 +- .../chemistry/reagents/impure_reagents.dm | 3 +- .../chemistry/reagents/medicine_reagents.dm | 144 +- .../chemistry/reagents/other_reagents.dm | 239 +- .../reagents/pyrotechnic_reagents.dm | 25 +- .../chemistry/reagents/toxin_reagents.dm | 88 +- .../reagents/chemistry/recipes/drugs.dm | 54 +- .../reagents/chemistry/recipes/medicine.dm | 284 +- .../reagents/chemistry/recipes/others.dm | 424 +-- .../chemistry/recipes/pyrotechnics.dm | 174 +- .../chemistry/recipes/slime_extracts.dm | 134 +- .../reagents/chemistry/recipes/special.dm | 5 +- .../reagents/chemistry/recipes/toxins.dm | 122 +- code/modules/reagents/reagent_containers.dm | 445 ++- .../reagents/reagent_containers/blood_pack.dm | 4 +- .../reagents/reagent_containers/borghydro.dm | 520 +-- .../reagents/reagent_containers/bottle.dm | 130 +- .../reagents/reagent_containers/dropper.dm | 204 +- .../reagents/reagent_containers/glass.dm | 744 ++--- .../reagents/reagent_containers/hypospray.dm | 1192 ++++--- .../reagents/reagent_containers/hypovial.dm | 71 +- .../reagents/reagent_containers/medspray.dm | 13 +- .../reagents/reagent_containers/patch.dm | 4 +- .../reagents/reagent_containers/pill.dm | 50 +- .../reagents/reagent_containers/rags.dm | 4 +- .../reagents/reagent_containers/spray.dm | 630 ++-- .../reagents/reagent_containers/syringes.dm | 702 ++-- code/modules/reagents/reagent_dispenser.dm | 507 ++- code/modules/research/designs.dm | 166 +- .../research/designs/autobotter_designs.dm | 52 +- .../research/designs/biogenerator_designs.dm | 6 +- .../research/designs/limbgrower_designs.dm | 10 +- .../research/designs/weapon_designs.dm | 4 +- code/modules/research/experimentor.dm | 1332 ++++---- .../modules/research/machinery/_production.dm | 728 ++--- .../nanites/nanite_programs/buffing.dm | 2 +- .../nanites/nanite_programs/healing.dm | 7 +- code/modules/research/rdconsole.dm | 2262 ++++++------- .../xenobiology/crossbreeding/__corecross.dm | 14 +- .../xenobiology/crossbreeding/_misc.dm | 2 +- .../crossbreeding/_status_effects.dm | 4 +- .../xenobiology/crossbreeding/burning.dm | 14 +- .../xenobiology/crossbreeding/charged.dm | 4 +- .../xenobiology/crossbreeding/chilling.dm | 6 +- .../xenobiology/crossbreeding/consuming.dm | 6 +- .../xenobiology/crossbreeding/industrial.dm | 8 +- .../xenobiology/crossbreeding/regenerative.dm | 8 +- .../crossbreeding/selfsustaining.dm | 6 +- .../research/xenobiology/xenobiology.dm | 70 +- .../surgery/advanced/necrotic_revival.dm | 2 +- .../modules/surgery/advanced/viral_bonding.dm | 2 +- code/modules/surgery/embalming.dm | 2 +- code/modules/surgery/graft_synthtissue.dm | 6 +- code/modules/surgery/organs/appendix.dm | 2 +- code/modules/surgery/organs/augments_chest.dm | 2 +- code/modules/surgery/organs/heart.dm | 4 +- code/modules/surgery/organs/liver.dm | 254 +- code/modules/surgery/organs/lungs.dm | 15 +- code/modules/surgery/organs/organ_internal.dm | 2 +- code/modules/vehicles/cars/clowncar.dm | 2 +- .../code/modules/crafting/bounties.dm | 6 +- hyperstation/code/modules/resize/sizechems.dm | 3 - icons/obj/food/containers.dmi | Bin 11879 -> 12143 bytes .../code/datums/status_effects/chems.dm | 20 +- .../game/objects/items/storage/firstaid.dm | 46 +- .../code/modules/arousal/arousal.dm | 6 +- .../code/modules/arousal/organs/breasts.dm | 4 +- .../code/modules/arousal/organs/genitals.dm | 2 +- .../code/modules/arousal/organs/testicles.dm | 2 +- .../code/modules/arousal/organs/womb.dm | 2 +- .../modules/clothing/glasses/phantomthief.dm | 9 +- .../code/modules/mining/mining_ruins.dm | 2 +- .../mob/living/simple_animal/banana_spider.dm | 6 +- .../boxes_magazines/external/pistol.dm | 4 +- .../reagents/chemistry/reagents/MKUltra.dm | 12 +- .../reagents/chemistry/reagents/SDGF.dm | 33 +- .../reagents/chemistry/reagents/astrogen.dm | 3 +- .../chemistry/reagents/eigentstasium.dm | 8 +- .../chemistry/reagents/enlargement.dm | 22 +- .../chemistry/reagents/fermi_reagents.dm | 37 +- .../reagents/chemistry/reagents/healing.dm | 18 +- .../chemistry/reagents/other_reagents.dm | 1 - .../reagents/chemistry/recipes/fermi.dm | 119 +- .../modules/reagents/reagents/cit_reagents.dm | 32 +- .../code/modules/vore/eating/voreitems.dm | 7 +- .../modules/vore/resizing/sizechemicals.dm | 17 +- 323 files changed, 31959 insertions(+), 32469 deletions(-) diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm index 21f2d380..b66fbdf3 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm @@ -28,7 +28,7 @@ "g" = ( /obj/structure/reagent_dispensers/water_cooler{ name = "punch cooler"; - reagent_id = "bacchus_blessing" + reagent_id = /datum/reagent/consumable/ethanol/bacchus_blessing }, /obj/effect/decal/cleanable/dirt, /turf/open/floor/wood{ diff --git a/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm b/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm index e5038c07..1464dd95 100644 --- a/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm +++ b/_maps/RandomRuins/SpaceRuins/TheDerelict.dmm @@ -3410,7 +3410,7 @@ "lq" = ( /obj/structure/table, /obj/item/reagent_containers/glass/beaker{ - list_reagents = list("sacid" = 50) + list_reagents = list(/datum/reagent/toxin/acid = 50) }, /obj/item/paper/crumpled/bloody/ruins/thederelict/unfinished, /obj/item/pen, diff --git a/code/__HELPERS/_cit_helpers.dm b/code/__HELPERS/_cit_helpers.dm index bfa8f704..bbb487fd 100644 --- a/code/__HELPERS/_cit_helpers.dm +++ b/code/__HELPERS/_cit_helpers.dm @@ -68,8 +68,8 @@ GLOBAL_LIST_EMPTY(breasts_shapes_icons) GLOBAL_LIST_EMPTY(vagina_shapes_list) GLOBAL_LIST_INIT(cum_into_containers_list, list(/obj/item/reagent_containers/food/snacks/pie)) //Yer fuggin snowflake name list jfc GLOBAL_LIST_INIT(dick_nouns, list("dick","cock","member","shaft")) -GLOBAL_LIST_INIT(cum_id_list,"semen") -GLOBAL_LIST_INIT(milk_id_list,"milk") +GLOBAL_LIST_INIT(cum_id_list, /datum/reagent/consumable/semen) +GLOBAL_LIST_INIT(milk_id_list, /datum/reagent/consumable/milk) GLOBAL_LIST_INIT(dildo_shapes, list( "Human" = "human", diff --git a/code/__HELPERS/cmp.dm b/code/__HELPERS/cmp.dm index 34f75d0b..e0d54c9e 100644 --- a/code/__HELPERS/cmp.dm +++ b/code/__HELPERS/cmp.dm @@ -85,6 +85,9 @@ GLOBAL_VAR_INIT(cmp_field, "name") /proc/cmp_numbered_displays_name_dsc(datum/numbered_display/A, datum/numbered_display/B) return sorttext(B.sample_object.name, A.sample_object.name) +/proc/cmp_reagents_asc(datum/reagent/a, datum/reagent/b) + return sorttext(initial(b.name),initial(a.name)) + /proc/cmp_quirk_asc(datum/quirk/A, datum/quirk/B) var/a_sign = num2sign(initial(A.value) * -1) var/b_sign = num2sign(initial(B.value) * -1) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index f39668e7..e87c6c9c 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -55,7 +55,7 @@ init_sprite_accessory_subtypes(/datum/sprite_accessory/vagina, GLOB.vagina_shapes_list) init_sprite_accessory_subtypes(/datum/sprite_accessory/breasts, GLOB.breasts_shapes_list) GLOB.breasts_size_list = list ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o") //We need the list to choose from initialized, but it's no longer a sprite_accessory thing. - GLOB.genital_fluids_list = list ("milk", "water", "semen", "femcum") + GLOB.genital_fluids_list = list (/datum/reagent/consumable/milk, /datum/reagent/water, /datum/reagent/consumable/semen, /datum/reagent/consumable/femcum) GLOB.gentlemans_organ_names = list("phallus", "willy", "dick", "prick", "member", "tool", "gentleman's organ", "cock", "wang", "knob", "dong", "joystick", "pecker", "johnson", "weenie", "tadger", "schlong", "thirsty ferret", "baloney pony", "schlanger") for(var/K in GLOB.breasts_shapes_list) var/datum/sprite_accessory/breasts/value = GLOB.breasts_shapes_list[K] diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index cce58af7..49ffe578 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -196,7 +196,7 @@ "balls_cum_rate" = CUM_RATE, "balls_cum_mult" = CUM_RATE_MULT, "balls_efficiency" = CUM_EFFICIENCY, - "balls_fluid" = "semen", + "balls_fluid" = /datum/reagent/consumable/semen, "has_ovi" = FALSE, "ovi_shape" = "knotted", "ovi_length" = 6, @@ -211,7 +211,7 @@ "breasts_color" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "breasts_size" = pick(GLOB.breasts_size_list), "breasts_shape" = "Pair", - "breasts_fluid" = "milk", + "breasts_fluid" = /datum/reagent/consumable/milk, "breasts_producing" = FALSE, "has_vag" = FALSE, "vag_shape" = pick(GLOB.vagina_shapes_list), diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 8e004c69..9f9fe9de 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1,1426 +1,1430 @@ -#define VV_MSG_MARKED "
Marked Object" -#define VV_MSG_EDITED "
Var Edited" -#define VV_MSG_DELETED "
Deleted" - -/datum/proc/CanProcCall(procname) - return TRUE - -/datum/proc/can_vv_get(var_name) - return TRUE - -/datum/proc/vv_edit_var(var_name, var_value) //called whenever a var is edited - if(var_name == NAMEOF(src, vars)) - return FALSE - vars[var_name] = var_value - datum_flags |= DF_VAR_EDITED - return TRUE - -/datum/proc/vv_get_var(var_name) - switch(var_name) - if ("vars") - return debug_variable(var_name, list(), 0, src) - return debug_variable(var_name, vars[var_name], 0, src) - -//please call . = ..() first and append to the result, that way parent items are always at the top and child items are further down -//add separaters by doing . += "---" -/datum/proc/vv_get_dropdown() - . = list() - . += "---" - .["Call Proc"] = "?_src_=vars;[HrefToken()];proc_call=[REF(src)]" - .["Mark Object"] = "?_src_=vars;[HrefToken()];mark_object=[REF(src)]" - .["Delete"] = "?_src_=vars;[HrefToken()];delete=[REF(src)]" - .["Show VV To Player"] = "?_src_=vars;[HrefToken(TRUE)];expose=[REF(src)]" - - -/datum/proc/on_reagent_change(changetype) - return - - -/client/proc/debug_variables(datum/D in world) - set category = "Debug" - set name = "View Variables" - //set src in world - var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round. - - if(!usr.client || !usr.client.holder) //The usr vs src abuse in this proc is intentional and must not be changed - to_chat(usr, "You need to be an administrator to access this.") - return - - if(!D) - return - - var/islist = islist(D) - if (!islist && !istype(D)) - return - - var/title = "" - var/refid = REF(D) - var/icon/sprite - var/hash - - var/type = /list - if (!islist) - type = D.type - - - - if(istype(D, /atom)) - var/atom/AT = D - if(AT.icon && AT.icon_state) - sprite = new /icon(AT.icon, AT.icon_state) - hash = md5(AT.icon) - hash = md5(hash + AT.icon_state) - src << browse_rsc(sprite, "vv[hash].png") - - title = "[D] ([REF(D)]) = [type]" - var/formatted_type = replacetext("[type]", "/", "/") - - var/sprite_text - if(sprite) - sprite_text = "" - var/list/atomsnowflake = list() - - if(istype(D, /atom)) - var/atom/A = D - if(isliving(A)) - atomsnowflake += "[D]" - atomsnowflake += "
<< [dir2text(A.dir) || A.dir] >>" - var/mob/living/M = A - atomsnowflake += {" -
[M.ckey || "No ckey"] / [M.real_name || "No real name"] -
- BRUTE:[M.getBruteLoss()] - FIRE:[M.getFireLoss()] - TOXIN:[M.getToxLoss()] - OXY:[M.getOxyLoss()] - CLONE:[M.getCloneLoss()] - BRAIN:[M.getOrganLoss(ORGAN_SLOT_BRAIN)] - STAMINA:[M.getStaminaLoss()] - AROUSAL:[M.getArousalLoss()] - "} - if(GLOB.Debug2) - atomsnowflake += {" - HEART:[M.getOrganLoss(ORGAN_SLOT_HEART)] - LIVER:[M.getOrganLoss(ORGAN_SLOT_LIVER)] - LUNGS:[M.getOrganLoss(ORGAN_SLOT_LUNGS)] - EYES:[M.getOrganLoss(ORGAN_SLOT_EYES)] - EARS:[M.getOrganLoss(ORGAN_SLOT_EARS)] - STOMACH:[M.getOrganLoss(ORGAN_SLOT_STOMACH)] - TONGUE:[M.getOrganLoss(ORGAN_SLOT_TONGUE)] - APPENDIX:[M.getOrganLoss(ORGAN_SLOT_APPENDIX)] - "} - atomsnowflake += {" - - "} - else - atomsnowflake += "[D]" - atomsnowflake += "
<< [dir2text(A.dir) || A.dir] >>" - else if("name" in D.vars) - atomsnowflake += "[D]" - else - atomsnowflake += "[formatted_type]" - formatted_type = null - - var/marked - if(holder && holder.marked_datum && holder.marked_datum == D) - marked = VV_MSG_MARKED - var/varedited_line = "" - if(!islist && (D.datum_flags & DF_VAR_EDITED)) - varedited_line = VV_MSG_EDITED - var/deleted_line - if(!islist && D.gc_destroyed) - deleted_line = VV_MSG_DELETED - - var/list/dropdownoptions = list() - if (islist) - dropdownoptions = list( - "---", - "Add Item" = "?_src_=vars;[HrefToken()];listadd=[refid]", - "Remove Nulls" = "?_src_=vars;[HrefToken()];listnulls=[refid]", - "Remove Dupes" = "?_src_=vars;[HrefToken()];listdupes=[refid]", - "Set len" = "?_src_=vars;[HrefToken()];listlen=[refid]", - "Shuffle" = "?_src_=vars;[HrefToken()];listshuffle=[refid]", - "Show VV To Player" = "?_src_=vars;[HrefToken()];expose=[refid]" - ) - else - dropdownoptions = D.vv_get_dropdown() - var/list/dropdownoptions_html = list() - - for (var/name in dropdownoptions) - var/link = dropdownoptions[name] - if (link) - dropdownoptions_html += "" - else - dropdownoptions_html += "" - - var/list/names = list() - if (!islist) - for (var/V in D.vars) - names += V - sleep(1)//For some reason, without this sleep, VVing will cause client to disconnect on certain objects. - - var/list/variable_html = list() - if (islist) - var/list/L = D - for (var/i in 1 to L.len) - var/key = L[i] - var/value - if (IS_NORMAL_LIST(L) && !isnum(key)) - value = L[key] - variable_html += debug_variable(i, value, 0, D) - else - - names = sortList(names) - for (var/V in names) - if(D.can_vv_get(V)) - variable_html += D.vv_get_var(V) - - var/html = {" - - - [title] - - - - -
- - - - - -
- - - - -
- [sprite_text] -
- [atomsnowflake.Join()] -
-
-
- [formatted_type] - [marked] - [varedited_line] - [deleted_line] -
-
-
- Refresh -
- -
-
-
-
-
- - E - Edit, tries to determine the variable type by itself.
- C - Change, asks you for the var type first.
- M - Mass modify: changes this variable for all objects of this type.
-
-
- - - - - -
-
- Search: -
-
- -
-
-
    - [variable_html.Join()] -
- - - -"} - src << browse(html, "window=variables[refid];size=475x650") - - -/client/proc/vv_update_display(datum/D, span, content) - src << output("[span]:[content]", "variables[REF(D)].browser:replace_span") - - -#define VV_HTML_ENCODE(thing) ( sanitize ? html_encode(thing) : thing ) -/proc/debug_variable(name, value, level, datum/DA = null, sanitize = TRUE) - var/header - if(DA) - if (islist(DA)) - var/index = name - if (value) - name = DA[name] //name is really the index until this line - else - value = DA[name] - header = "
  • (E) (C) (-) " - else - header = "
  • (E) (C) (M) " - else - header = "
  • " - - var/item - if (isnull(value)) - item = "[VV_HTML_ENCODE(name)] = null" - - else if (istext(value)) - item = "[VV_HTML_ENCODE(name)] = \"[VV_HTML_ENCODE(value)]\"" - - else if (isicon(value)) - #ifdef VARSICON - var/icon/I = new/icon(value) - var/rnd = rand(1,10000) - var/rname = "tmp[REF(I)][rnd].png" - usr << browse_rsc(I, rname) - item = "[VV_HTML_ENCODE(name)] = ([value]) " - #else - item = "[VV_HTML_ENCODE(name)] = /icon ([value])" - #endif - - else if (isfile(value)) - item = "[VV_HTML_ENCODE(name)] = '[value]'" - - else if (istype(value, /datum)) - var/datum/D = value - if ("[D]" != "[D.type]") //if the thing as a name var, lets use it. - item = "[VV_HTML_ENCODE(name)] [REF(value)] = [D] [D.type]" - else - item = "[VV_HTML_ENCODE(name)] [REF(value)] = [D.type]" - - else if (islist(value)) - var/list/L = value - var/list/items = list() - - if (L.len > 0 && !(name == "underlays" || name == "overlays" || L.len > (IS_NORMAL_LIST(L) ? 50 : 150))) - for (var/i in 1 to L.len) - var/key = L[i] - var/val - if (IS_NORMAL_LIST(L) && !isnum(key)) - val = L[key] - if (isnull(val)) // we still want to display non-null false values, such as 0 or "" - val = key - key = i - - items += debug_variable(key, val, level + 1, sanitize = sanitize) - - item = "[VV_HTML_ENCODE(name)] = /list ([L.len])
      [items.Join()]
    " - else - item = "[VV_HTML_ENCODE(name)] = /list ([L.len])" - - else if (name in GLOB.bitfields) - var/list/flags = list() - for (var/i in GLOB.bitfields[name]) - if (value & GLOB.bitfields[name][i]) - flags += i - item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(jointext(flags, ", "))]" - else - item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(value)]" - - return "[header][item]
  • " - -#undef VV_HTML_ENCODE - -/client/proc/view_var_Topic(href, href_list, hsrc) - if( (usr.client != src) || !src.holder || !holder.CheckAdminHref(href, href_list)) - return - if(href_list["Vars"]) - debug_variables(locate(href_list["Vars"])) - - else if(href_list["datumrefresh"]) - var/datum/DAT = locate(href_list["datumrefresh"]) - if(!DAT) //can't be an istype() because /client etc aren't datums - return - src.debug_variables(DAT) - - else if(href_list["mob_player_panel"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["mob_player_panel"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - src.holder.show_player_panel(M) - - else if(href_list["godmode"]) - if(!check_rights(R_ADMIN)) - return - - var/mob/M = locate(href_list["godmode"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - src.cmd_admin_godmode(M) - - else if(href_list["mark_object"]) - if(!check_rights(NONE)) - return - - var/datum/D = locate(href_list["mark_object"]) - if(!istype(D)) - to_chat(usr, "This can only be done to instances of type /datum") - return - - if(holder.marked_datum) - vv_update_display(holder.marked_datum, "marked", "") - holder.marked_datum = D - vv_update_display(D, "marked", VV_MSG_MARKED) - - else if(href_list["proc_call"]) - if(!check_rights(NONE)) - return - - var/T = locate(href_list["proc_call"]) - - if(T) - callproc_datum(T) - - else if(href_list["delete"]) - if(!check_rights(R_DEBUG, 0)) - return - - var/datum/D = locate(href_list["delete"]) - if(!istype(D)) - to_chat(usr, "Unable to locate item!") - admin_delete(D) - if (isturf(D)) // show the turf that took its place - debug_variables(D) - - else if(href_list["osay"]) - if(!check_rights(R_FUN, 0)) - return - usr.client.object_say(locate(href_list["osay"])) - - else if(href_list["regenerateicons"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["regenerateicons"]) in GLOB.mob_list - if(!ismob(M)) - to_chat(usr, "This can only be done to instances of type /mob") - return - M.regenerate_icons() - else if(href_list["expose"]) - if(!check_rights(R_ADMIN, FALSE)) - return - var/thing = locate(href_list["expose"]) - if (!thing) - return - var/value = vv_get_value(VV_CLIENT) - if (value["class"] != VV_CLIENT) - return - var/client/C = value["value"] - if (!C) - return - var/prompt = alert("Do you want to grant [C] access to view this VV window? (they will not be able to edit or change anything nor open nested vv windows unless they themselves are an admin)", "Confirm", "Yes", "No") - if (prompt != "Yes" || !usr.client) - return - message_admins("[key_name_admin(usr)] Showed [key_name_admin(C)] a VV window") - log_admin("Admin [key_name(usr)] Showed [key_name(C)] a VV window of a [thing]") - to_chat(C, "[usr.client.holder.fakekey ? "an Administrator" : "[usr.client.key]"] has granted you access to view a View Variables window") - C.debug_variables(thing) - - -//Needs +VAREDIT past this point - - else if(check_rights(R_VAREDIT)) - - - //~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records). - - if(href_list["rename"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["rename"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - var/new_name = stripped_input(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN) - if( !new_name || !M ) - return - - message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].") - M.fully_replace_character_name(M.real_name,new_name) - vv_update_display(M, "name", new_name) - vv_update_display(M, "real_name", M.real_name || "No real name") - - else if(href_list["varnameedit"] && href_list["datumedit"]) - if(!check_rights(NONE)) - return - - var/datum/D = locate(href_list["datumedit"]) - if(!istype(D, /datum)) - to_chat(usr, "This can only be used on datums") - return - - if (!modify_variables(D, href_list["varnameedit"], 1)) - return - switch(href_list["varnameedit"]) - if("name") - vv_update_display(D, "name", "[D]") - if("dir") - if(isatom(D)) - var/dir = D.vars["dir"] - vv_update_display(D, "dir", dir2text(dir) || dir) - if("ckey") - if(isliving(D)) - vv_update_display(D, "ckey", D.vars["ckey"] || "No ckey") - if("real_name") - if(isliving(D)) - vv_update_display(D, "real_name", D.vars["real_name"] || "No real name") - - else if(href_list["varnamechange"] && href_list["datumchange"]) - if(!check_rights(NONE)) - return - - var/D = locate(href_list["datumchange"]) - if(!istype(D, /datum)) - to_chat(usr, "This can only be used on datums") - return - - modify_variables(D, href_list["varnamechange"], 0) - - else if(href_list["varnamemass"] && href_list["datummass"]) - if(!check_rights(NONE)) - return - - var/datum/D = locate(href_list["datummass"]) - if(!istype(D)) - to_chat(usr, "This can only be used on instances of type /datum") - return - - cmd_mass_modify_object_variables(D, href_list["varnamemass"]) - - else if(href_list["listedit"] && href_list["index"]) - var/index = text2num(href_list["index"]) - if (!index) - return - - var/list/L = locate(href_list["listedit"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - mod_list(L, null, "list", "contents", index, autodetect_class = TRUE) - - else if(href_list["listchange"] && href_list["index"]) - var/index = text2num(href_list["index"]) - if (!index) - return - - var/list/L = locate(href_list["listchange"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - mod_list(L, null, "list", "contents", index, autodetect_class = FALSE) - - else if(href_list["listremove"] && href_list["index"]) - var/index = text2num(href_list["index"]) - if (!index) - return - - var/list/L = locate(href_list["listremove"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - var/variable = L[index] - var/prompt = alert("Do you want to remove item number [index] from list?", "Confirm", "Yes", "No") - if (prompt != "Yes") - return - L.Cut(index, index+1) - log_world("### ListVarEdit by [src]: /list's contents: REMOVED=[html_encode("[variable]")]") - log_admin("[key_name(src)] modified list's contents: REMOVED=[variable]") - message_admins("[key_name_admin(src)] modified list's contents: REMOVED=[variable]") - - else if(href_list["listadd"]) - var/list/L = locate(href_list["listadd"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - mod_list_add(L, null, "list", "contents") - - else if(href_list["listdupes"]) - var/list/L = locate(href_list["listdupes"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - uniqueList_inplace(L) - log_world("### ListVarEdit by [src]: /list contents: CLEAR DUPES") - log_admin("[key_name(src)] modified list's contents: CLEAR DUPES") - message_admins("[key_name_admin(src)] modified list's contents: CLEAR DUPES") - - else if(href_list["listnulls"]) - var/list/L = locate(href_list["listnulls"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - listclearnulls(L) - log_world("### ListVarEdit by [src]: /list contents: CLEAR NULLS") - log_admin("[key_name(src)] modified list's contents: CLEAR NULLS") - message_admins("[key_name_admin(src)] modified list's contents: CLEAR NULLS") - - else if(href_list["listlen"]) - var/list/L = locate(href_list["listlen"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - var/value = vv_get_value(VV_NUM) - if (value["class"] != VV_NUM) - return - - L.len = value["value"] - log_world("### ListVarEdit by [src]: /list len: [L.len]") - log_admin("[key_name(src)] modified list's len: [L.len]") - message_admins("[key_name_admin(src)] modified list's len: [L.len]") - - else if(href_list["listshuffle"]) - var/list/L = locate(href_list["listshuffle"]) - if (!istype(L)) - to_chat(usr, "This can only be used on instances of type /list") - return - - shuffle_inplace(L) - log_world("### ListVarEdit by [src]: /list contents: SHUFFLE") - log_admin("[key_name(src)] modified list's contents: SHUFFLE") - message_admins("[key_name_admin(src)] modified list's contents: SHUFFLE") - - else if(href_list["give_spell"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["give_spell"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - src.give_spell(M) - - else if(href_list["remove_spell"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["remove_spell"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - remove_spell(M) - - else if(href_list["give_disease"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["give_disease"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - src.give_disease(M) - - else if(href_list["gib"]) - if(!check_rights(R_FUN)) - return - - var/mob/M = locate(href_list["gib"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - src.cmd_admin_gib(M) - - else if(href_list["build_mode"]) - if(!check_rights(R_BUILDMODE)) - return - - var/mob/M = locate(href_list["build_mode"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - togglebuildmode(M) - - else if(href_list["drop_everything"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["drop_everything"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - if(usr.client) - usr.client.cmd_admin_drop_everything(M) - - else if(href_list["direct_control"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["direct_control"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - - if(usr.client) - usr.client.cmd_assume_direct_control(M) - - else if(href_list["offer_control"]) - if(!check_rights(NONE)) - return - - var/mob/M = locate(href_list["offer_control"]) in GLOB.mob_list - if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") - return - offer_control(M) - - else if (href_list["modarmor"]) - if(!check_rights(NONE)) - return - - var/obj/O = locate(href_list["modarmor"]) - if(!istype(O)) - to_chat(usr, "This can only be used on instances of type /obj") - return - - var/list/pickerlist = list() - var/list/armorlist = O.armor.getList() - - for (var/i in armorlist) - pickerlist += list(list("value" = armorlist[i], "name" = i)) - - var/list/result = presentpicker(usr, "Modify armor", "Modify armor: [O]", Button1="Save", Button2 = "Cancel", Timeout=FALSE, inputtype = "text", values = pickerlist) - - if (islist(result)) - if (result["button"] == 2) // If the user pressed the cancel button - return - // text2num conveniently returns a null on invalid values - O.armor = O.armor.setRating(melee = text2num(result["values"]["melee"]),\ - bullet = text2num(result["values"]["bullet"]),\ - laser = text2num(result["values"]["laser"]),\ - energy = text2num(result["values"]["energy"]),\ - bomb = text2num(result["values"]["bomb"]),\ - bio = text2num(result["values"]["bio"]),\ - rad = text2num(result["values"]["rad"]),\ - fire = text2num(result["values"]["fire"]),\ - acid = text2num(result["values"]["acid"])) - log_admin("[key_name(usr)] modified the armor on [O] ([O.type]) to melee: [O.armor.melee], bullet: [O.armor.bullet], laser: [O.armor.laser], energy: [O.armor.energy], bomb: [O.armor.bomb], bio: [O.armor.bio], rad: [O.armor.rad], fire: [O.armor.fire], acid: [O.armor.acid]") - message_admins("[key_name_admin(usr)] modified the armor on [O] ([O.type]) to melee: [O.armor.melee], bullet: [O.armor.bullet], laser: [O.armor.laser], energy: [O.armor.energy], bomb: [O.armor.bomb], bio: [O.armor.bio], rad: [O.armor.rad], fire: [O.armor.fire], acid: [O.armor.acid]") - else - return - - else if(href_list["delall"]) - if(!check_rights(R_DEBUG|R_SERVER)) - return - - var/obj/O = locate(href_list["delall"]) - if(!isobj(O)) - to_chat(usr, "This can only be used on instances of type /obj") - return - - var/action_type = alert("Strict type ([O.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel") - if(action_type == "Cancel" || !action_type) - return - - if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes") - return - - if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes") - return - - var/O_type = O.type - switch(action_type) - if("Strict type") - var/i = 0 - for(var/obj/Obj in world) - if(Obj.type == O_type) - i++ - qdel(Obj) - CHECK_TICK - if(!i) - to_chat(usr, "No objects of this type exist") - return - log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") - message_admins("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") - if("Type and subtypes") - var/i = 0 - for(var/obj/Obj in world) - if(istype(Obj,O_type)) - i++ - qdel(Obj) - CHECK_TICK - if(!i) - to_chat(usr, "No objects of this type exist") - return - log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") - message_admins("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") - - else if(href_list["addreagent"]) - if(!check_rights(NONE)) - return - - var/atom/A = locate(href_list["addreagent"]) - - if(!A.reagents) - var/amount = input(usr, "Specify the reagent size of [A]", "Set Reagent Size", 50) as num - if(amount) - A.create_reagents(amount) - - if(A.reagents) - var/chosen_id - var/list/reagent_options = sortList(GLOB.chemical_reagents_list) - switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID")) - if("Enter ID") - var/valid_id - while(!valid_id) - chosen_id = stripped_input(usr, "Enter the ID of the reagent you want to add.") - if(!chosen_id) //Get me out of here! - break - for(var/ID in reagent_options) - if(ID == chosen_id) - valid_id = 1 - if(!valid_id) - to_chat(usr, "A reagent with that ID doesn't exist!") - if("Choose ID") - chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_options - if(chosen_id) - var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num - if(amount) - A.reagents.add_reagent(chosen_id, amount) - log_admin("[key_name(usr)] has added [amount] units of [chosen_id] to \the [A]") - message_admins("[key_name(usr)] has added [amount] units of [chosen_id] to \the [A]") - - else if(href_list["explode"]) - if(!check_rights(R_FUN)) - return - - var/atom/A = locate(href_list["explode"]) - if(!isobj(A) && !ismob(A) && !isturf(A)) - to_chat(usr, "This can only be done to instances of type /obj, /mob and /turf") - return - - src.cmd_admin_explosion(A) - - else if(href_list["emp"]) - if(!check_rights(R_FUN)) - return - - var/atom/A = locate(href_list["emp"]) - if(!isobj(A) && !ismob(A) && !isturf(A)) - to_chat(usr, "This can only be done to instances of type /obj, /mob and /turf") - return - - src.cmd_admin_emp(A) - - else if(href_list["modtransform"]) - if(!check_rights(R_DEBUG)) - return - - var/atom/A = locate(href_list["modtransform"]) - if(!istype(A)) - to_chat(usr, "This can only be done to atoms.") - return - - var/result = input(usr, "Choose the transformation to apply","Transform Mod") as null|anything in list("Scale","Translate","Rotate") - var/matrix/M = A.transform - switch(result) - if("Scale") - var/x = input(usr, "Choose x mod","Transform Mod") as null|num - var/y = input(usr, "Choose y mod","Transform Mod") as null|num - if(!isnull(x) && !isnull(y)) - A.transform = M.Scale(x,y) - if("Translate") - var/x = input(usr, "Choose x mod","Transform Mod") as null|num - var/y = input(usr, "Choose y mod","Transform Mod") as null|num - if(!isnull(x) && !isnull(y)) - A.transform = M.Translate(x,y) - if("Rotate") - var/angle = input(usr, "Choose angle to rotate","Transform Mod") as null|num - if(!isnull(angle)) - A.transform = M.Turn(angle) - - else if(href_list["rotatedatum"]) - if(!check_rights(NONE)) - return - - var/atom/A = locate(href_list["rotatedatum"]) - if(!istype(A)) - to_chat(usr, "This can only be done to instances of type /atom") - return - - switch(href_list["rotatedir"]) - if("right") - A.setDir(turn(A.dir, -45)) - if("left") - A.setDir(turn(A.dir, 45)) - vv_update_display(A, "dir", dir2text(A.dir)) - - else if(href_list["editorgans"]) - if(!check_rights(NONE)) - return - - var/mob/living/carbon/C = locate(href_list["editorgans"]) in GLOB.mob_list - if(!istype(C)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - manipulate_organs(C) - - else if(href_list["givemartialart"]) - if(!check_rights(NONE)) - return - - var/mob/living/carbon/C = locate(href_list["givemartialart"]) in GLOB.carbon_list - if(!istype(C)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - var/list/artpaths = subtypesof(/datum/martial_art) - var/list/artnames = list() - for(var/i in artpaths) - var/datum/martial_art/M = i - artnames[initial(M.name)] = M - - var/result = input(usr, "Choose the martial art to teach","JUDO CHOP") as null|anything in artnames - if(!usr) - return - if(QDELETED(C)) - to_chat(usr, "Mob doesn't exist anymore") - return - - if(result) - var/chosenart = artnames[result] - var/datum/martial_art/MA = new chosenart - MA.teach(C) - - else if(href_list["givetrauma"]) - if(!check_rights(NONE)) - return - - var/mob/living/carbon/C = locate(href_list["givetrauma"]) in GLOB.mob_list - if(!istype(C)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - var/list/traumas = subtypesof(/datum/brain_trauma) - var/result = input(usr, "Choose the brain trauma to apply","Traumatize") as null|anything in traumas - if(!usr) - return - if(QDELETED(C)) - to_chat(usr, "Mob doesn't exist anymore") - return - - if(result) - C.gain_trauma(result) - - else if(href_list["curetraumas"]) - if(!check_rights(NONE)) - return - - var/mob/living/carbon/C = locate(href_list["curetraumas"]) in GLOB.mob_list - if(!istype(C)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - C.cure_all_traumas(TRAUMA_RESILIENCE_ABSOLUTE) - - else if(href_list["hallucinate"]) - if(!check_rights(NONE)) - return - - var/mob/living/carbon/C = locate(href_list["hallucinate"]) in GLOB.mob_list - if(!istype(C)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - var/list/hallucinations = subtypesof(/datum/hallucination) - var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in hallucinations - if(!usr) - return - if(QDELETED(C)) - to_chat(usr, "Mob doesn't exist anymore") - return - - if(result) - new result(C, TRUE) - - else if(href_list["makehuman"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/monkey/Mo = locate(href_list["makehuman"]) in GLOB.mob_list - if(!istype(Mo)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/monkey") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") - return - if(!Mo) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("humanone"=href_list["makehuman"])) - - else if(href_list["makemonkey"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["makemonkey"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") - return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("monkeyone"=href_list["makemonkey"])) - - else if(href_list["makerobot"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["makerobot"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") - return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makerobot"=href_list["makerobot"])) - - else if(href_list["makealien"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["makealien"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") - return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makealien"=href_list["makealien"])) - - else if(href_list["makeslime"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["makeslime"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") - return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makeslime"=href_list["makeslime"])) - - else if(href_list["makeai"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/H = locate(href_list["makeai"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") - return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makeai"=href_list["makeai"])) - - else if(href_list["setspecies"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["setspecies"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - var/result = input(usr, "Please choose a new species","Species") as null|anything in GLOB.species_list - - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - - if(result) - var/newtype = GLOB.species_list[result] - admin_ticket_log("[key_name_admin(usr)] has modified the bodyparts of [H] to [result]") - H.set_species(newtype) - - else if(href_list["editbodypart"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/C = locate(href_list["editbodypart"]) in GLOB.mob_list - if(!istype(C)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon") - return - - var/edit_action = input(usr, "What would you like to do?","Modify Body Part") as null|anything in list("add","remove", "augment") - if(!edit_action) - return - var/list/limb_list = list(BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) - if(edit_action == "augment") - limb_list += BODY_ZONE_CHEST - var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in limb_list - - if(!C) - to_chat(usr, "Mob doesn't exist anymore") - return - - if(result) - var/obj/item/bodypart/BP = C.get_bodypart(result) - switch(edit_action) - if("remove") - if(BP) - BP.drop_limb() - else - to_chat(usr, "[C] doesn't have such bodypart.") - if("add") - if(BP) - to_chat(usr, "[C] already has such bodypart.") - else - if(!C.regenerate_limb(result)) - to_chat(usr, "[C] cannot have such bodypart.") - if("augment") - if(ishuman(C)) - if(BP) - BP.change_bodypart_status(BODYPART_ROBOTIC, TRUE, TRUE) - else - to_chat(usr, "[C] doesn't have such bodypart.") - else - to_chat(usr, "Only humans can be augmented.") - admin_ticket_log("[key_name_admin(usr)] has modified the bodyparts of [C]") - - - else if(href_list["purrbation"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["purrbation"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - if(!ishumanbasic(H)) - to_chat(usr, "This can only be done to the basic human species at the moment.") - return - - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - - var/success = purrbation_toggle(H) - if(success) - to_chat(usr, "Put [H] on purrbation.") - log_admin("[key_name(usr)] has put [key_name(H)] on purrbation.") - var/msg = "[key_name_admin(usr)] has put [key_name(H)] on purrbation." - message_admins(msg) - admin_ticket_log(H, msg) - - else - to_chat(usr, "Removed [H] from purrbation.") - log_admin("[key_name(usr)] has removed [key_name(H)] from purrbation.") - var/msg = "[key_name_admin(usr)] has removed [key_name(H)] from purrbation." - message_admins(msg) - admin_ticket_log(H, msg) - - else if(href_list["adjustDamage"] && href_list["mobToDamage"]) - if(!check_rights(NONE)) - return - - var/mob/living/L = locate(href_list["mobToDamage"]) in GLOB.mob_list - if(!istype(L)) - return - - var/Text = href_list["adjustDamage"] - - var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num - - if(!L) - to_chat(usr, "Mob doesn't exist anymore") - return - - var/newamt - switch(Text) - if("brute") - L.adjustBruteLoss(amount) - newamt = L.getBruteLoss() - if("fire") - L.adjustFireLoss(amount) - newamt = L.getFireLoss() - if("toxin") - L.adjustToxLoss(amount) - newamt = L.getToxLoss() - if("oxygen") - L.adjustOxyLoss(amount) - newamt = L.getOxyLoss() - if("brain") - L.adjustOrganLoss(ORGAN_SLOT_BRAIN, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_BRAIN) - if("clone") - L.adjustCloneLoss(amount) - newamt = L.getCloneLoss() - if("stamina") - L.adjustStaminaLoss(amount) - newamt = L.getStaminaLoss() - if("arousal") - L.adjustArousalLoss(amount) - newamt = L.getArousalLoss() - if("heart") - L.adjustOrganLoss(ORGAN_SLOT_HEART, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_HEART) - if("liver") - L.adjustOrganLoss(ORGAN_SLOT_LIVER, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_LIVER) - if("lungs") - L.adjustOrganLoss(ORGAN_SLOT_LUNGS, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_LUNGS) - if("eye_sight") - L.adjustOrganLoss(ORGAN_SLOT_EYES, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_EYES) - if("ears") - L.adjustOrganLoss(ORGAN_SLOT_EARS, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_EARS) - if("stomach") - L.adjustOrganLoss(ORGAN_SLOT_STOMACH, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_STOMACH) - if("tongue") - L.adjustOrganLoss(ORGAN_SLOT_TONGUE, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_TONGUE) - if("appendix") - L.adjustOrganLoss(ORGAN_SLOT_APPENDIX, amount) - newamt = L.getOrganLoss(ORGAN_SLOT_APPENDIX) - else - to_chat(usr, "You caused an error. DEBUG: Text:[Text] Mob:[L]") - return - - if(amount != 0) - log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ") - var/msg = "[key_name(usr)] dealt [amount] amount of [Text] damage to [L] " - message_admins("[msg]") - admin_ticket_log(L, msg) - vv_update_display(L, Text, "[newamt]") - else if(href_list["copyoutfit"]) - if(!check_rights(R_SPAWN)) - return - var/mob/living/carbon/human/H = locate(href_list["copyoutfit"]) in GLOB.carbon_list - if(istype(H)) - H.copy_outfit() - else if(href_list["modquirks"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/living/carbon/human/H = locate(href_list["modquirks"]) in GLOB.mob_list - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - var/list/options = list("Clear"="Clear") - for(var/x in subtypesof(/datum/quirk)) - var/datum/quirk/T = x - var/qname = initial(T.name) - options[H.has_quirk(T) ? "[qname] (Remove)" : "[qname] (Add)"] = T - - var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in options - if(result) - if(result == "Clear") - for(var/datum/quirk/q in H.roundstart_quirks) - H.remove_quirk(q.type) - else - var/T = options[result] - if(H.has_quirk(T)) - H.remove_quirk(T) - else - H.add_quirk(T,TRUE) +#define VV_MSG_MARKED "
    Marked Object" +#define VV_MSG_EDITED "
    Var Edited" +#define VV_MSG_DELETED "
    Deleted" + +/datum/proc/CanProcCall(procname) + return TRUE + +/datum/proc/can_vv_get(var_name) + return TRUE + +/datum/proc/vv_edit_var(var_name, var_value) //called whenever a var is edited + if(var_name == NAMEOF(src, vars)) + return FALSE + vars[var_name] = var_value + datum_flags |= DF_VAR_EDITED + return TRUE + +/datum/proc/vv_get_var(var_name) + switch(var_name) + if ("vars") + return debug_variable(var_name, list(), 0, src) + return debug_variable(var_name, vars[var_name], 0, src) + +//please call . = ..() first and append to the result, that way parent items are always at the top and child items are further down +//add separaters by doing . += "---" +/datum/proc/vv_get_dropdown() + . = list() + . += "---" + .["Call Proc"] = "?_src_=vars;[HrefToken()];proc_call=[REF(src)]" + .["Mark Object"] = "?_src_=vars;[HrefToken()];mark_object=[REF(src)]" + .["Delete"] = "?_src_=vars;[HrefToken()];delete=[REF(src)]" + .["Show VV To Player"] = "?_src_=vars;[HrefToken(TRUE)];expose=[REF(src)]" + + +/datum/proc/on_reagent_change(changetype) + return + + +/client/proc/debug_variables(datum/D in world) + set category = "Debug" + set name = "View Variables" + //set src in world + var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round. + + if(!usr.client || !usr.client.holder) //The usr vs src abuse in this proc is intentional and must not be changed + to_chat(usr, "You need to be an administrator to access this.") + return + + if(!D) + return + + var/islist = islist(D) + if (!islist && !istype(D)) + return + + var/title = "" + var/refid = REF(D) + var/icon/sprite + var/hash + + var/type = /list + if (!islist) + type = D.type + + + + if(istype(D, /atom)) + var/atom/AT = D + if(AT.icon && AT.icon_state) + sprite = new /icon(AT.icon, AT.icon_state) + hash = md5(AT.icon) + hash = md5(hash + AT.icon_state) + src << browse_rsc(sprite, "vv[hash].png") + + title = "[D] ([REF(D)]) = [type]" + var/formatted_type = replacetext("[type]", "/", "/") + + var/sprite_text + if(sprite) + sprite_text = "" + var/list/atomsnowflake = list() + + if(istype(D, /atom)) + var/atom/A = D + if(isliving(A)) + atomsnowflake += "[D]" + atomsnowflake += "
    << [dir2text(A.dir) || A.dir] >>" + var/mob/living/M = A + atomsnowflake += {" +
    [M.ckey || "No ckey"] / [M.real_name || "No real name"] +
    + BRUTE:[M.getBruteLoss()] + FIRE:[M.getFireLoss()] + TOXIN:[M.getToxLoss()] + OXY:[M.getOxyLoss()] + CLONE:[M.getCloneLoss()] + BRAIN:[M.getOrganLoss(ORGAN_SLOT_BRAIN)] + STAMINA:[M.getStaminaLoss()] + AROUSAL:[M.getArousalLoss()] + "} + if(GLOB.Debug2) + atomsnowflake += {" + HEART:[M.getOrganLoss(ORGAN_SLOT_HEART)] + LIVER:[M.getOrganLoss(ORGAN_SLOT_LIVER)] + LUNGS:[M.getOrganLoss(ORGAN_SLOT_LUNGS)] + EYES:[M.getOrganLoss(ORGAN_SLOT_EYES)] + EARS:[M.getOrganLoss(ORGAN_SLOT_EARS)] + STOMACH:[M.getOrganLoss(ORGAN_SLOT_STOMACH)] + TONGUE:[M.getOrganLoss(ORGAN_SLOT_TONGUE)] + APPENDIX:[M.getOrganLoss(ORGAN_SLOT_APPENDIX)] + "} + atomsnowflake += {" + + "} + else + atomsnowflake += "[D]" + atomsnowflake += "
    << [dir2text(A.dir) || A.dir] >>" + else if("name" in D.vars) + atomsnowflake += "[D]" + else + atomsnowflake += "[formatted_type]" + formatted_type = null + + var/marked + if(holder && holder.marked_datum && holder.marked_datum == D) + marked = VV_MSG_MARKED + var/varedited_line = "" + if(!islist && (D.datum_flags & DF_VAR_EDITED)) + varedited_line = VV_MSG_EDITED + var/deleted_line + if(!islist && D.gc_destroyed) + deleted_line = VV_MSG_DELETED + + var/list/dropdownoptions = list() + if (islist) + dropdownoptions = list( + "---", + "Add Item" = "?_src_=vars;[HrefToken()];listadd=[refid]", + "Remove Nulls" = "?_src_=vars;[HrefToken()];listnulls=[refid]", + "Remove Dupes" = "?_src_=vars;[HrefToken()];listdupes=[refid]", + "Set len" = "?_src_=vars;[HrefToken()];listlen=[refid]", + "Shuffle" = "?_src_=vars;[HrefToken()];listshuffle=[refid]", + "Show VV To Player" = "?_src_=vars;[HrefToken()];expose=[refid]" + ) + else + dropdownoptions = D.vv_get_dropdown() + var/list/dropdownoptions_html = list() + + for (var/name in dropdownoptions) + var/link = dropdownoptions[name] + if (link) + dropdownoptions_html += "" + else + dropdownoptions_html += "" + + var/list/names = list() + if (!islist) + for (var/V in D.vars) + names += V + sleep(1)//For some reason, without this sleep, VVing will cause client to disconnect on certain objects. + + var/list/variable_html = list() + if (islist) + var/list/L = D + for (var/i in 1 to L.len) + var/key = L[i] + var/value + if (IS_NORMAL_LIST(L) && !isnum(key)) + value = L[key] + variable_html += debug_variable(i, value, 0, D) + else + + names = sortList(names) + for (var/V in names) + if(D.can_vv_get(V)) + variable_html += D.vv_get_var(V) + + var/html = {" + + + [title] + + + + +
    + + + + + +
    + + + + +
    + [sprite_text] +
    + [atomsnowflake.Join()] +
    +
    +
    + [formatted_type] + [marked] + [varedited_line] + [deleted_line] +
    +
    +
    + Refresh +
    + +
    +
    +
    +
    +
    + + E - Edit, tries to determine the variable type by itself.
    + C - Change, asks you for the var type first.
    + M - Mass modify: changes this variable for all objects of this type.
    +
    +
    + + + + + +
    +
    + Search: +
    +
    + +
    +
    +
      + [variable_html.Join()] +
    + + + +"} + src << browse(html, "window=variables[refid];size=475x650") + + +/client/proc/vv_update_display(datum/D, span, content) + src << output("[span]:[content]", "variables[REF(D)].browser:replace_span") + + +#define VV_HTML_ENCODE(thing) ( sanitize ? html_encode(thing) : thing ) +/proc/debug_variable(name, value, level, datum/DA = null, sanitize = TRUE) + var/header + if(DA) + if (islist(DA)) + var/index = name + if (value) + name = DA[name] //name is really the index until this line + else + value = DA[name] + header = "
  • (E) (C) (-) " + else + header = "
  • (E) (C) (M) " + else + header = "
  • " + + var/item + if (isnull(value)) + item = "[VV_HTML_ENCODE(name)] = null" + + else if (istext(value)) + item = "[VV_HTML_ENCODE(name)] = \"[VV_HTML_ENCODE(value)]\"" + + else if (isicon(value)) + #ifdef VARSICON + var/icon/I = new/icon(value) + var/rnd = rand(1,10000) + var/rname = "tmp[REF(I)][rnd].png" + usr << browse_rsc(I, rname) + item = "[VV_HTML_ENCODE(name)] = ([value]) " + #else + item = "[VV_HTML_ENCODE(name)] = /icon ([value])" + #endif + + else if (isfile(value)) + item = "[VV_HTML_ENCODE(name)] = '[value]'" + + else if (istype(value, /datum)) + var/datum/D = value + if ("[D]" != "[D.type]") //if the thing as a name var, lets use it. + item = "[VV_HTML_ENCODE(name)] [REF(value)] = [D] [D.type]" + else + item = "[VV_HTML_ENCODE(name)] [REF(value)] = [D.type]" + + else if (islist(value)) + var/list/L = value + var/list/items = list() + + if (L.len > 0 && !(name == "underlays" || name == "overlays" || L.len > (IS_NORMAL_LIST(L) ? 50 : 150))) + for (var/i in 1 to L.len) + var/key = L[i] + var/val + if (IS_NORMAL_LIST(L) && !isnum(key)) + val = L[key] + if (isnull(val)) // we still want to display non-null false values, such as 0 or "" + val = key + key = i + + items += debug_variable(key, val, level + 1, sanitize = sanitize) + + item = "[VV_HTML_ENCODE(name)] = /list ([L.len])
      [items.Join()]
    " + else + item = "[VV_HTML_ENCODE(name)] = /list ([L.len])" + + else if (name in GLOB.bitfields) + var/list/flags = list() + for (var/i in GLOB.bitfields[name]) + if (value & GLOB.bitfields[name][i]) + flags += i + item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(jointext(flags, ", "))]" + else + item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(value)]" + + return "[header][item]
  • " + +#undef VV_HTML_ENCODE + +/client/proc/view_var_Topic(href, href_list, hsrc) + if( (usr.client != src) || !src.holder || !holder.CheckAdminHref(href, href_list)) + return + if(href_list["Vars"]) + debug_variables(locate(href_list["Vars"])) + + else if(href_list["datumrefresh"]) + var/datum/DAT = locate(href_list["datumrefresh"]) + if(!DAT) //can't be an istype() because /client etc aren't datums + return + src.debug_variables(DAT) + + else if(href_list["mob_player_panel"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["mob_player_panel"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + src.holder.show_player_panel(M) + + else if(href_list["godmode"]) + if(!check_rights(R_ADMIN)) + return + + var/mob/M = locate(href_list["godmode"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + src.cmd_admin_godmode(M) + + else if(href_list["mark_object"]) + if(!check_rights(NONE)) + return + + var/datum/D = locate(href_list["mark_object"]) + if(!istype(D)) + to_chat(usr, "This can only be done to instances of type /datum") + return + + if(holder.marked_datum) + vv_update_display(holder.marked_datum, "marked", "") + holder.marked_datum = D + vv_update_display(D, "marked", VV_MSG_MARKED) + + else if(href_list["proc_call"]) + if(!check_rights(NONE)) + return + + var/T = locate(href_list["proc_call"]) + + if(T) + callproc_datum(T) + + else if(href_list["delete"]) + if(!check_rights(R_DEBUG, 0)) + return + + var/datum/D = locate(href_list["delete"]) + if(!istype(D)) + to_chat(usr, "Unable to locate item!") + admin_delete(D) + if (isturf(D)) // show the turf that took its place + debug_variables(D) + + else if(href_list["osay"]) + if(!check_rights(R_FUN, 0)) + return + usr.client.object_say(locate(href_list["osay"])) + + else if(href_list["regenerateicons"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["regenerateicons"]) in GLOB.mob_list + if(!ismob(M)) + to_chat(usr, "This can only be done to instances of type /mob") + return + M.regenerate_icons() + else if(href_list["expose"]) + if(!check_rights(R_ADMIN, FALSE)) + return + var/thing = locate(href_list["expose"]) + if (!thing) + return + var/value = vv_get_value(VV_CLIENT) + if (value["class"] != VV_CLIENT) + return + var/client/C = value["value"] + if (!C) + return + var/prompt = alert("Do you want to grant [C] access to view this VV window? (they will not be able to edit or change anything nor open nested vv windows unless they themselves are an admin)", "Confirm", "Yes", "No") + if (prompt != "Yes" || !usr.client) + return + message_admins("[key_name_admin(usr)] Showed [key_name_admin(C)] a VV window") + log_admin("Admin [key_name(usr)] Showed [key_name(C)] a VV window of a [thing]") + to_chat(C, "[usr.client.holder.fakekey ? "an Administrator" : "[usr.client.key]"] has granted you access to view a View Variables window") + C.debug_variables(thing) + + +//Needs +VAREDIT past this point + + else if(check_rights(R_VAREDIT)) + + + //~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records). + + if(href_list["rename"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["rename"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + var/new_name = stripped_input(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN) + if( !new_name || !M ) + return + + message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].") + M.fully_replace_character_name(M.real_name,new_name) + vv_update_display(M, "name", new_name) + vv_update_display(M, "real_name", M.real_name || "No real name") + + else if(href_list["varnameedit"] && href_list["datumedit"]) + if(!check_rights(NONE)) + return + + var/datum/D = locate(href_list["datumedit"]) + if(!istype(D, /datum)) + to_chat(usr, "This can only be used on datums") + return + + if (!modify_variables(D, href_list["varnameedit"], 1)) + return + switch(href_list["varnameedit"]) + if("name") + vv_update_display(D, "name", "[D]") + if("dir") + if(isatom(D)) + var/dir = D.vars["dir"] + vv_update_display(D, "dir", dir2text(dir) || dir) + if("ckey") + if(isliving(D)) + vv_update_display(D, "ckey", D.vars["ckey"] || "No ckey") + if("real_name") + if(isliving(D)) + vv_update_display(D, "real_name", D.vars["real_name"] || "No real name") + + else if(href_list["varnamechange"] && href_list["datumchange"]) + if(!check_rights(NONE)) + return + + var/D = locate(href_list["datumchange"]) + if(!istype(D, /datum)) + to_chat(usr, "This can only be used on datums") + return + + modify_variables(D, href_list["varnamechange"], 0) + + else if(href_list["varnamemass"] && href_list["datummass"]) + if(!check_rights(NONE)) + return + + var/datum/D = locate(href_list["datummass"]) + if(!istype(D)) + to_chat(usr, "This can only be used on instances of type /datum") + return + + cmd_mass_modify_object_variables(D, href_list["varnamemass"]) + + else if(href_list["listedit"] && href_list["index"]) + var/index = text2num(href_list["index"]) + if (!index) + return + + var/list/L = locate(href_list["listedit"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + mod_list(L, null, "list", "contents", index, autodetect_class = TRUE) + + else if(href_list["listchange"] && href_list["index"]) + var/index = text2num(href_list["index"]) + if (!index) + return + + var/list/L = locate(href_list["listchange"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + mod_list(L, null, "list", "contents", index, autodetect_class = FALSE) + + else if(href_list["listremove"] && href_list["index"]) + var/index = text2num(href_list["index"]) + if (!index) + return + + var/list/L = locate(href_list["listremove"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + var/variable = L[index] + var/prompt = alert("Do you want to remove item number [index] from list?", "Confirm", "Yes", "No") + if (prompt != "Yes") + return + L.Cut(index, index+1) + log_world("### ListVarEdit by [src]: /list's contents: REMOVED=[html_encode("[variable]")]") + log_admin("[key_name(src)] modified list's contents: REMOVED=[variable]") + message_admins("[key_name_admin(src)] modified list's contents: REMOVED=[variable]") + + else if(href_list["listadd"]) + var/list/L = locate(href_list["listadd"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + mod_list_add(L, null, "list", "contents") + + else if(href_list["listdupes"]) + var/list/L = locate(href_list["listdupes"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + uniqueList_inplace(L) + log_world("### ListVarEdit by [src]: /list contents: CLEAR DUPES") + log_admin("[key_name(src)] modified list's contents: CLEAR DUPES") + message_admins("[key_name_admin(src)] modified list's contents: CLEAR DUPES") + + else if(href_list["listnulls"]) + var/list/L = locate(href_list["listnulls"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + listclearnulls(L) + log_world("### ListVarEdit by [src]: /list contents: CLEAR NULLS") + log_admin("[key_name(src)] modified list's contents: CLEAR NULLS") + message_admins("[key_name_admin(src)] modified list's contents: CLEAR NULLS") + + else if(href_list["listlen"]) + var/list/L = locate(href_list["listlen"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + var/value = vv_get_value(VV_NUM) + if (value["class"] != VV_NUM) + return + + L.len = value["value"] + log_world("### ListVarEdit by [src]: /list len: [L.len]") + log_admin("[key_name(src)] modified list's len: [L.len]") + message_admins("[key_name_admin(src)] modified list's len: [L.len]") + + else if(href_list["listshuffle"]) + var/list/L = locate(href_list["listshuffle"]) + if (!istype(L)) + to_chat(usr, "This can only be used on instances of type /list") + return + + shuffle_inplace(L) + log_world("### ListVarEdit by [src]: /list contents: SHUFFLE") + log_admin("[key_name(src)] modified list's contents: SHUFFLE") + message_admins("[key_name_admin(src)] modified list's contents: SHUFFLE") + + else if(href_list["give_spell"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["give_spell"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + src.give_spell(M) + + else if(href_list["remove_spell"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["remove_spell"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + remove_spell(M) + + else if(href_list["give_disease"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["give_disease"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + src.give_disease(M) + + else if(href_list["gib"]) + if(!check_rights(R_FUN)) + return + + var/mob/M = locate(href_list["gib"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + src.cmd_admin_gib(M) + + else if(href_list["build_mode"]) + if(!check_rights(R_BUILDMODE)) + return + + var/mob/M = locate(href_list["build_mode"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + togglebuildmode(M) + + else if(href_list["drop_everything"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["drop_everything"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + if(usr.client) + usr.client.cmd_admin_drop_everything(M) + + else if(href_list["direct_control"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["direct_control"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + + if(usr.client) + usr.client.cmd_assume_direct_control(M) + + else if(href_list["offer_control"]) + if(!check_rights(NONE)) + return + + var/mob/M = locate(href_list["offer_control"]) in GLOB.mob_list + if(!istype(M)) + to_chat(usr, "This can only be used on instances of type /mob") + return + offer_control(M) + + else if (href_list["modarmor"]) + if(!check_rights(NONE)) + return + + var/obj/O = locate(href_list["modarmor"]) + if(!istype(O)) + to_chat(usr, "This can only be used on instances of type /obj") + return + + var/list/pickerlist = list() + var/list/armorlist = O.armor.getList() + + for (var/i in armorlist) + pickerlist += list(list("value" = armorlist[i], "name" = i)) + + var/list/result = presentpicker(usr, "Modify armor", "Modify armor: [O]", Button1="Save", Button2 = "Cancel", Timeout=FALSE, inputtype = "text", values = pickerlist) + + if (islist(result)) + if (result["button"] == 2) // If the user pressed the cancel button + return + // text2num conveniently returns a null on invalid values + O.armor = O.armor.setRating(melee = text2num(result["values"]["melee"]),\ + bullet = text2num(result["values"]["bullet"]),\ + laser = text2num(result["values"]["laser"]),\ + energy = text2num(result["values"]["energy"]),\ + bomb = text2num(result["values"]["bomb"]),\ + bio = text2num(result["values"]["bio"]),\ + rad = text2num(result["values"]["rad"]),\ + fire = text2num(result["values"]["fire"]),\ + acid = text2num(result["values"]["acid"])) + log_admin("[key_name(usr)] modified the armor on [O] ([O.type]) to melee: [O.armor.melee], bullet: [O.armor.bullet], laser: [O.armor.laser], energy: [O.armor.energy], bomb: [O.armor.bomb], bio: [O.armor.bio], rad: [O.armor.rad], fire: [O.armor.fire], acid: [O.armor.acid]") + message_admins("[key_name_admin(usr)] modified the armor on [O] ([O.type]) to melee: [O.armor.melee], bullet: [O.armor.bullet], laser: [O.armor.laser], energy: [O.armor.energy], bomb: [O.armor.bomb], bio: [O.armor.bio], rad: [O.armor.rad], fire: [O.armor.fire], acid: [O.armor.acid]") + else + return + + else if(href_list["delall"]) + if(!check_rights(R_DEBUG|R_SERVER)) + return + + var/obj/O = locate(href_list["delall"]) + if(!isobj(O)) + to_chat(usr, "This can only be used on instances of type /obj") + return + + var/action_type = alert("Strict type ([O.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel") + if(action_type == "Cancel" || !action_type) + return + + if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes") + return + + if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes") + return + + var/O_type = O.type + switch(action_type) + if("Strict type") + var/i = 0 + for(var/obj/Obj in world) + if(Obj.type == O_type) + i++ + qdel(Obj) + CHECK_TICK + if(!i) + to_chat(usr, "No objects of this type exist") + return + log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") + message_admins("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") + if("Type and subtypes") + var/i = 0 + for(var/obj/Obj in world) + if(istype(Obj,O_type)) + i++ + qdel(Obj) + CHECK_TICK + if(!i) + to_chat(usr, "No objects of this type exist") + return + log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") + message_admins("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") + + else if(href_list["addreagent"]) + if(!check_rights(NONE)) + return + + var/atom/A = locate(href_list["addreagent"]) + + if(!A.reagents) + var/amount = input(usr, "Specify the reagent size of [A]", "Set Reagent Size", 50) as num + if(amount) + A.create_reagents(amount) + + if(A.reagents) + var/chosen_id + switch(alert(usr, "Choose a method.", "Add Reagents", "Search", "Choose from a list", "I'm feeling lucky")) + if("Search") + var/valid_id + while(!valid_id) + chosen_id = input(usr, "Enter the ID of the reagent you want to add.", "Search reagents") as null|text + if(isnull(chosen_id)) //Get me out of here! + break + if(!ispath(text2path(chosen_id))) + chosen_id = pick_closest_path(chosen_id, make_types_fancy(subtypesof(/datum/reagent))) + if(ispath(chosen_id)) + valid_id = TRUE + else + valid_id = TRUE + if(!valid_id) + to_chat(usr, "A reagent with that ID doesn't exist!") + if("Choose from a list") + chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in subtypesof(/datum/reagent) + if("I'm feeling lucky") + chosen_id = pick(subtypesof(/datum/reagent)) + if(chosen_id) + var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num + if(amount) + A.reagents.add_reagent(chosen_id, amount) + log_admin("[key_name(usr)] has added [amount] units of [chosen_id] to \the [A]") + message_admins("[key_name(usr)] has added [amount] units of [chosen_id] to \the [A]") + + else if(href_list["explode"]) + if(!check_rights(R_FUN)) + return + + var/atom/A = locate(href_list["explode"]) + if(!isobj(A) && !ismob(A) && !isturf(A)) + to_chat(usr, "This can only be done to instances of type /obj, /mob and /turf") + return + + src.cmd_admin_explosion(A) + + else if(href_list["emp"]) + if(!check_rights(R_FUN)) + return + + var/atom/A = locate(href_list["emp"]) + if(!isobj(A) && !ismob(A) && !isturf(A)) + to_chat(usr, "This can only be done to instances of type /obj, /mob and /turf") + return + + src.cmd_admin_emp(A) + + else if(href_list["modtransform"]) + if(!check_rights(R_DEBUG)) + return + + var/atom/A = locate(href_list["modtransform"]) + if(!istype(A)) + to_chat(usr, "This can only be done to atoms.") + return + + var/result = input(usr, "Choose the transformation to apply","Transform Mod") as null|anything in list("Scale","Translate","Rotate") + var/matrix/M = A.transform + switch(result) + if("Scale") + var/x = input(usr, "Choose x mod","Transform Mod") as null|num + var/y = input(usr, "Choose y mod","Transform Mod") as null|num + if(!isnull(x) && !isnull(y)) + A.transform = M.Scale(x,y) + if("Translate") + var/x = input(usr, "Choose x mod","Transform Mod") as null|num + var/y = input(usr, "Choose y mod","Transform Mod") as null|num + if(!isnull(x) && !isnull(y)) + A.transform = M.Translate(x,y) + if("Rotate") + var/angle = input(usr, "Choose angle to rotate","Transform Mod") as null|num + if(!isnull(angle)) + A.transform = M.Turn(angle) + + else if(href_list["rotatedatum"]) + if(!check_rights(NONE)) + return + + var/atom/A = locate(href_list["rotatedatum"]) + if(!istype(A)) + to_chat(usr, "This can only be done to instances of type /atom") + return + + switch(href_list["rotatedir"]) + if("right") + A.setDir(turn(A.dir, -45)) + if("left") + A.setDir(turn(A.dir, 45)) + vv_update_display(A, "dir", dir2text(A.dir)) + + else if(href_list["editorgans"]) + if(!check_rights(NONE)) + return + + var/mob/living/carbon/C = locate(href_list["editorgans"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + manipulate_organs(C) + + else if(href_list["givemartialart"]) + if(!check_rights(NONE)) + return + + var/mob/living/carbon/C = locate(href_list["givemartialart"]) in GLOB.carbon_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + var/list/artpaths = subtypesof(/datum/martial_art) + var/list/artnames = list() + for(var/i in artpaths) + var/datum/martial_art/M = i + artnames[initial(M.name)] = M + + var/result = input(usr, "Choose the martial art to teach","JUDO CHOP") as null|anything in artnames + if(!usr) + return + if(QDELETED(C)) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + var/chosenart = artnames[result] + var/datum/martial_art/MA = new chosenart + MA.teach(C) + + else if(href_list["givetrauma"]) + if(!check_rights(NONE)) + return + + var/mob/living/carbon/C = locate(href_list["givetrauma"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + var/list/traumas = subtypesof(/datum/brain_trauma) + var/result = input(usr, "Choose the brain trauma to apply","Traumatize") as null|anything in traumas + if(!usr) + return + if(QDELETED(C)) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + C.gain_trauma(result) + + else if(href_list["curetraumas"]) + if(!check_rights(NONE)) + return + + var/mob/living/carbon/C = locate(href_list["curetraumas"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + C.cure_all_traumas(TRAUMA_RESILIENCE_ABSOLUTE) + + else if(href_list["hallucinate"]) + if(!check_rights(NONE)) + return + + var/mob/living/carbon/C = locate(href_list["hallucinate"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + var/list/hallucinations = subtypesof(/datum/hallucination) + var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in hallucinations + if(!usr) + return + if(QDELETED(C)) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + new result(C, TRUE) + + else if(href_list["makehuman"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/monkey/Mo = locate(href_list["makehuman"]) in GLOB.mob_list + if(!istype(Mo)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/monkey") + return + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + return + if(!Mo) + to_chat(usr, "Mob doesn't exist anymore") + return + holder.Topic(href, list("humanone"=href_list["makehuman"])) + + else if(href_list["makemonkey"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["makemonkey"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + return + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + holder.Topic(href, list("monkeyone"=href_list["makemonkey"])) + + else if(href_list["makerobot"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["makerobot"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + return + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + holder.Topic(href, list("makerobot"=href_list["makerobot"])) + + else if(href_list["makealien"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["makealien"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + return + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + holder.Topic(href, list("makealien"=href_list["makealien"])) + + else if(href_list["makeslime"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["makeslime"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + return + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + holder.Topic(href, list("makeslime"=href_list["makeslime"])) + + else if(href_list["makeai"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/H = locate(href_list["makeai"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + return + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + holder.Topic(href, list("makeai"=href_list["makeai"])) + + else if(href_list["setspecies"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["setspecies"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + var/result = input(usr, "Please choose a new species","Species") as null|anything in GLOB.species_list + + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + var/newtype = GLOB.species_list[result] + admin_ticket_log("[key_name_admin(usr)] has modified the bodyparts of [H] to [result]") + H.set_species(newtype) + + else if(href_list["editbodypart"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/C = locate(href_list["editbodypart"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + var/edit_action = input(usr, "What would you like to do?","Modify Body Part") as null|anything in list("add","remove", "augment") + if(!edit_action) + return + var/list/limb_list = list(BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) + if(edit_action == "augment") + limb_list += BODY_ZONE_CHEST + var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in limb_list + + if(!C) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + var/obj/item/bodypart/BP = C.get_bodypart(result) + switch(edit_action) + if("remove") + if(BP) + BP.drop_limb() + else + to_chat(usr, "[C] doesn't have such bodypart.") + if("add") + if(BP) + to_chat(usr, "[C] already has such bodypart.") + else + if(!C.regenerate_limb(result)) + to_chat(usr, "[C] cannot have such bodypart.") + if("augment") + if(ishuman(C)) + if(BP) + BP.change_bodypart_status(BODYPART_ROBOTIC, TRUE, TRUE) + else + to_chat(usr, "[C] doesn't have such bodypart.") + else + to_chat(usr, "Only humans can be augmented.") + admin_ticket_log("[key_name_admin(usr)] has modified the bodyparts of [C]") + + + else if(href_list["purrbation"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["purrbation"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + if(!ishumanbasic(H)) + to_chat(usr, "This can only be done to the basic human species at the moment.") + return + + if(!H) + to_chat(usr, "Mob doesn't exist anymore") + return + + var/success = purrbation_toggle(H) + if(success) + to_chat(usr, "Put [H] on purrbation.") + log_admin("[key_name(usr)] has put [key_name(H)] on purrbation.") + var/msg = "[key_name_admin(usr)] has put [key_name(H)] on purrbation." + message_admins(msg) + admin_ticket_log(H, msg) + + else + to_chat(usr, "Removed [H] from purrbation.") + log_admin("[key_name(usr)] has removed [key_name(H)] from purrbation.") + var/msg = "[key_name_admin(usr)] has removed [key_name(H)] from purrbation." + message_admins(msg) + admin_ticket_log(H, msg) + + else if(href_list["adjustDamage"] && href_list["mobToDamage"]) + if(!check_rights(NONE)) + return + + var/mob/living/L = locate(href_list["mobToDamage"]) in GLOB.mob_list + if(!istype(L)) + return + + var/Text = href_list["adjustDamage"] + + var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num + + if(!L) + to_chat(usr, "Mob doesn't exist anymore") + return + + var/newamt + switch(Text) + if("brute") + L.adjustBruteLoss(amount) + newamt = L.getBruteLoss() + if("fire") + L.adjustFireLoss(amount) + newamt = L.getFireLoss() + if("toxin") + L.adjustToxLoss(amount) + newamt = L.getToxLoss() + if("oxygen") + L.adjustOxyLoss(amount) + newamt = L.getOxyLoss() + if("brain") + L.adjustOrganLoss(ORGAN_SLOT_BRAIN, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_BRAIN) + if("clone") + L.adjustCloneLoss(amount) + newamt = L.getCloneLoss() + if("stamina") + L.adjustStaminaLoss(amount) + newamt = L.getStaminaLoss() + if("arousal") + L.adjustArousalLoss(amount) + newamt = L.getArousalLoss() + if("heart") + L.adjustOrganLoss(ORGAN_SLOT_HEART, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_HEART) + if("liver") + L.adjustOrganLoss(ORGAN_SLOT_LIVER, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_LIVER) + if("lungs") + L.adjustOrganLoss(ORGAN_SLOT_LUNGS, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_LUNGS) + if("eye_sight") + L.adjustOrganLoss(ORGAN_SLOT_EYES, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_EYES) + if("ears") + L.adjustOrganLoss(ORGAN_SLOT_EARS, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_EARS) + if("stomach") + L.adjustOrganLoss(ORGAN_SLOT_STOMACH, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_STOMACH) + if("tongue") + L.adjustOrganLoss(ORGAN_SLOT_TONGUE, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_TONGUE) + if("appendix") + L.adjustOrganLoss(ORGAN_SLOT_APPENDIX, amount) + newamt = L.getOrganLoss(ORGAN_SLOT_APPENDIX) + else + to_chat(usr, "You caused an error. DEBUG: Text:[Text] Mob:[L]") + return + + if(amount != 0) + log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ") + var/msg = "[key_name(usr)] dealt [amount] amount of [Text] damage to [L] " + message_admins("[msg]") + admin_ticket_log(L, msg) + vv_update_display(L, Text, "[newamt]") + else if(href_list["copyoutfit"]) + if(!check_rights(R_SPAWN)) + return + var/mob/living/carbon/human/H = locate(href_list["copyoutfit"]) in GLOB.carbon_list + if(istype(H)) + H.copy_outfit() + else if(href_list["modquirks"]) + if(!check_rights(R_SPAWN)) + return + + var/mob/living/carbon/human/H = locate(href_list["modquirks"]) in GLOB.mob_list + if(!istype(H)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") + return + + var/list/options = list("Clear"="Clear") + for(var/x in subtypesof(/datum/quirk)) + var/datum/quirk/T = x + var/qname = initial(T.name) + options[H.has_quirk(T) ? "[qname] (Remove)" : "[qname] (Add)"] = T + + var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in options + if(result) + if(result == "Clear") + for(var/datum/quirk/q in H.roundstart_quirks) + H.remove_quirk(q.type) + else + var/T = options[result] + if(H.has_quirk(T)) + H.remove_quirk(T) + else + H.add_quirk(T,TRUE) diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 8a696666..056f99c7 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -103,7 +103,7 @@ if(!(spread_flags & DISEASE_SPREAD_AIRBORNE) && !force_spread) return - if(affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10))) + if(affected_mob.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10))) return var/spread_range = 2 diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index b70f44fd..0ecb8e74 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -1,488 +1,492 @@ -/* - - Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties - which add onto the overall disease. - - If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus. - -*/ - - - - -/* - - PROPERTIES - - */ - -/datum/disease/advance - name = "Unknown" // We will always let our Virologist name our disease. - desc = "An engineered disease which can contain a multitude of symptoms." - form = "Advance Disease" // Will let med-scanners know that this disease was engineered. - agent = "advance microbes" - max_stages = 5 - spread_text = "Unknown" - viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - - // NEW VARS - var/list/properties = list() - var/list/symptoms = list() // The symptoms of the disease. - var/id = "" - var/processing = FALSE - var/mutable = TRUE //set to FALSE to prevent most in-game methods of altering the disease via virology - var/oldres //To prevent setting new cures unless resistance changes. - - // The order goes from easy to cure to hard to cure. Keep in mind that sentient diseases pick two cures from tier 6 and up, ensure they wont react away in bodies. - var/static/list/advance_cures = list( - list( // level 1 - "copper", "silver", "iodine", "iron", "carbon" - ), - list( // level 2 - "potassium", "ethanol", "lithium", "silicon", "bromine" - ), - list( // level 3 - "sodiumchloride", "sugar", "orangejuice", "tomatojuice", "milk" - ), - list( //level 4 - "spaceacillin", "salglu_solution", "epinephrine", "charcoal" - ), - list( //level 5 - "oil", "synaptizine", "mannitol", "space_drugs", "cryptobiolin" - ), - list( // level 6 - "phenol", "inacusiate", "oculine", "antihol" - ), - list( // level 7 - "leporazine", "mindbreaker", "corazone" - ), - list( // level 8 - "pax", "happiness", "ephedrine" - ), - list( // level 9 - "lipolicide", "sal_acid" - ), - list( // level 10 - "haloperidol", "aranesp", "diphenhydramine" - ), - list( //level 11 - "modafinil", "anacea" - ) - ) - -/* - - OLD PROCS - - */ - -/datum/disease/advance/New() - Refresh() - -/datum/disease/advance/Destroy() - if(processing) - for(var/datum/symptom/S in symptoms) - S.End(src) - return ..() - -/datum/disease/advance/try_infect(var/mob/living/infectee, make_copy = TRUE) - //see if we are more transmittable than enough diseases to replace them - //diseases replaced in this way do not confer immunity - var/list/advance_diseases = list() - for(var/datum/disease/advance/P in infectee.diseases) - advance_diseases += P - var/replace_num = advance_diseases.len + 1 - DISEASE_LIMIT //amount of diseases that need to be removed to fit this one - if(replace_num > 0) - sortTim(advance_diseases, /proc/cmp_advdisease_resistance_asc) - for(var/i in 1 to replace_num) - var/datum/disease/advance/competition = advance_diseases[i] - if(totalTransmittable() > competition.totalResistance()) - competition.cure(FALSE) - else - return FALSE //we are not strong enough to bully our way in - infect(infectee, make_copy) - return TRUE - -// Randomly pick a symptom to activate. -/datum/disease/advance/stage_act() - ..() - if(carrier) - return - - if(symptoms && symptoms.len) - if(!processing) - processing = TRUE - for(var/datum/symptom/S in symptoms) - if(S.Start(src)) //this will return FALSE if the symptom is neutered - S.next_activation = world.time + rand(S.symptom_delay_min * 10, S.symptom_delay_max * 10) - S.on_stage_change(src) - - for(var/datum/symptom/S in symptoms) - S.Activate(src) - -// Tell symptoms stage changed -/datum/disease/advance/update_stage(new_stage) - ..() - for(var/datum/symptom/S in symptoms) - S.on_stage_change(src) - -// Compares type then ID. -/datum/disease/advance/IsSame(datum/disease/advance/D) - - if(!(istype(D, /datum/disease/advance))) - return 0 - - if(GetDiseaseID() != D.GetDiseaseID()) - return 0 - return 1 - -// Returns the advance disease with a different reference memory. -/datum/disease/advance/Copy() - var/datum/disease/advance/A = ..() - QDEL_LIST(A.symptoms) - for(var/datum/symptom/S in symptoms) - A.symptoms += S.Copy() - A.properties = properties.Copy() - A.id = id - A.oldres = oldres - //this is a new disease starting over at stage 1, so processing is not copied - return A - -//Describe this disease to an admin in detail (for logging) -/datum/disease/advance/admin_details() - var/list/name_symptoms = list() - for(var/datum/symptom/S in symptoms) - name_symptoms += S.name - return "[name] sym:[english_list(name_symptoms)] r:[totalResistance()] s:[totalStealth()] ss:[totalStageSpeed()] t:[totalTransmittable()]" -/* - - NEW PROCS - - */ - -// Mix the symptoms of two diseases (the src and the argument) -/datum/disease/advance/proc/Mix(datum/disease/advance/D) - if(!(IsSame(D))) - var/list/possible_symptoms = shuffle(D.symptoms) - for(var/datum/symptom/S in possible_symptoms) - AddSymptom(S.Copy()) - -/datum/disease/advance/proc/HasSymptom(datum/symptom/S) - for(var/datum/symptom/symp in symptoms) - if(symp.type == S.type) - return 1 - return 0 - -// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated. -/datum/disease/advance/proc/GenerateSymptoms(level_min, level_max, amount_get = 0) - - var/list/generated = list() // Symptoms we generated. - - // Generate symptoms. By default, we only choose non-deadly symptoms. - var/list/possible_symptoms = list() - for(var/symp in SSdisease.list_symptoms) - var/datum/symptom/S = new symp - if(S.naturally_occuring && S.level >= level_min && S.level <= level_max) - if(!HasSymptom(S)) - possible_symptoms += S - - if(!possible_symptoms.len) - return generated - - // Random chance to get more than one symptom - var/number_of = amount_get - if(!amount_get) - number_of = 1 - while(prob(20)) - number_of += 1 - - for(var/i = 1; number_of >= i && possible_symptoms.len; i++) - generated += pick_n_take(possible_symptoms) - - return generated - -/datum/disease/advance/proc/Refresh(new_name = FALSE) - GenerateProperties() - AssignProperties() - if(processing && symptoms && symptoms.len) - for(var/datum/symptom/S in symptoms) - S.Start(src) - S.on_stage_change(src) - id = null - - var/the_id = GetDiseaseID() - if(!SSdisease.archive_diseases[the_id]) - SSdisease.archive_diseases[the_id] = src // So we don't infinite loop - SSdisease.archive_diseases[the_id] = Copy() - if(new_name) - AssignName() - -//Generate disease properties based on the effects. Returns an associated list. -/datum/disease/advance/proc/GenerateProperties() - properties = list("resistance" = 0, "stealth" = 0, "stage_rate" = 0, "transmittable" = 0, "severity" = 0) - - for(var/datum/symptom/S in symptoms) - properties["resistance"] += S.resistance - properties["stealth"] += S.stealth - properties["stage_rate"] += S.stage_speed - properties["transmittable"] += S.transmittable - if(!S.neutered) - properties["severity"] = max(properties["severity"], S.severity) // severity is based on the highest severity non-neutered symptom - -// Assign the properties that are in the list. -/datum/disease/advance/proc/AssignProperties() - - if(properties && properties.len) - if(properties["stealth"] >= 2) - visibility_flags |= HIDDEN_SCANNER - else - visibility_flags &= ~HIDDEN_SCANNER - - SetSpread(CLAMP(2 ** (properties["transmittable"] - symptoms.len), DISEASE_SPREAD_BLOOD, DISEASE_SPREAD_AIRBORNE)) - - permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1) - cure_chance = 15 - CLAMP(properties["resistance"], -5, 5) // can be between 10 and 20 - stage_prob = max(properties["stage_rate"], 2) - SetSeverity(properties["severity"]) - GenerateCure(properties) - else - CRASH("Our properties were empty or null!") - - -// Assign the spread type and give it the correct description. -/datum/disease/advance/proc/SetSpread(spread_id) - switch(spread_id) - if(DISEASE_SPREAD_NON_CONTAGIOUS) - spread_flags = DISEASE_SPREAD_NON_CONTAGIOUS - spread_text = "None" - if(DISEASE_SPREAD_SPECIAL) - spread_flags = DISEASE_SPREAD_SPECIAL - spread_text = "None" - if(DISEASE_SPREAD_BLOOD) - spread_flags = DISEASE_SPREAD_BLOOD - spread_text = "Blood" - if(DISEASE_SPREAD_CONTACT_FLUIDS) - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_FLUIDS - spread_text = "Fluids" - if(DISEASE_SPREAD_CONTACT_SKIN) - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_FLUIDS | DISEASE_SPREAD_CONTACT_SKIN - spread_text = "On contact" - if(DISEASE_SPREAD_AIRBORNE) - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_FLUIDS | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_AIRBORNE - spread_text = "Airborne" - -/datum/disease/advance/proc/SetSeverity(level_sev) - - switch(level_sev) - - if(-INFINITY to 0) - severity = DISEASE_SEVERITY_POSITIVE - if(1) - severity = DISEASE_SEVERITY_NONTHREAT - if(2) - severity = DISEASE_SEVERITY_MINOR - if(3) - severity = DISEASE_SEVERITY_MEDIUM - if(4) - severity = DISEASE_SEVERITY_HARMFUL - if(5) - severity = DISEASE_SEVERITY_DANGEROUS - if(6 to INFINITY) - severity = DISEASE_SEVERITY_BIOHAZARD - else - severity = "Unknown" - - -// Will generate a random cure, the less resistance the symptoms have, the harder the cure. -/datum/disease/advance/proc/GenerateCure() - if(properties && properties.len) - var/res = CLAMP(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) - if(res == oldres) - return - cures = list(pick(advance_cures[res])) - oldres = res - - // Get the cure name from the cure_id - var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]] - cure_text = D.name - -// Randomly generate a symptom, has a chance to lose or gain a symptom. -/datum/disease/advance/proc/Evolve(min_level, max_level, ignore_mutable = FALSE) - if(!mutable && !ignore_mutable) - return - var/s = safepick(GenerateSymptoms(min_level, max_level, 1)) - if(s) - AddSymptom(s) - Refresh(TRUE) - return - -// Randomly remove a symptom. -/datum/disease/advance/proc/Devolve(ignore_mutable = FALSE) - if(!mutable && !ignore_mutable) - return - if(symptoms.len > 1) - var/s = safepick(symptoms) - if(s) - RemoveSymptom(s) - Refresh(TRUE) - -// Randomly neuter a symptom. -/datum/disease/advance/proc/Neuter(ignore_mutable = FALSE) - if(!mutable && !ignore_mutable) - return - if(symptoms.len) - var/s = safepick(symptoms) - if(s) - NeuterSymptom(s) - Refresh(TRUE) - -// Name the disease. -/datum/disease/advance/proc/AssignName(name = "Unknown") - Refresh() - var/datum/disease/advance/A = SSdisease.archive_diseases[GetDiseaseID()] - A.name = name - for(var/datum/disease/advance/AD in SSdisease.active_diseases) - AD.Refresh() - -// Return a unique ID of the disease. -/datum/disease/advance/GetDiseaseID() - if(!id) - var/list/L = list() - for(var/datum/symptom/S in symptoms) - if(S.neutered) - L += "[S.id]N" - else - L += S.id - L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. - var/result = jointext(L, ":") - id = result - return id - - -// Add a symptom, if it is over the limit we take a random symptom away and add the new one. -/datum/disease/advance/proc/AddSymptom(datum/symptom/S) - - if(HasSymptom(S)) - return - - if(!(symptoms.len < (VIRUS_SYMPTOM_LIMIT - 1) + rand(-1, 1))) - RemoveSymptom(pick(symptoms)) - symptoms += S - S.OnAdd(src) - -// Simply removes the symptom. -/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S) - symptoms -= S - S.OnRemove(src) - -// Neuter a symptom, so it will only affect stats -/datum/disease/advance/proc/NeuterSymptom(datum/symptom/S) - if(!S.neutered) - S.neutered = TRUE - S.name += " (neutered)" - S.OnRemove(src) - -/* - - Static Procs - -*/ - -// Mix a list of advance diseases and return the mixed result. -/proc/Advance_Mix(var/list/D_list) - var/list/diseases = list() - - for(var/datum/disease/advance/A in D_list) - diseases += A.Copy() - - if(!diseases.len) - return null - if(diseases.len <= 1) - return pick(diseases) // Just return the only entry. - - var/i = 0 - // Mix our diseases until we are left with only one result. - while(i < 20 && diseases.len > 1) - - i++ - - var/datum/disease/advance/D1 = pick(diseases) - diseases -= D1 - - var/datum/disease/advance/D2 = pick(diseases) - D2.Mix(D1) - - // Should be only 1 entry left, but if not let's only return a single entry - var/datum/disease/advance/to_return = pick(diseases) - to_return.Refresh(1) - return to_return - -/proc/SetViruses(datum/reagent/R, list/data) - if(data) - var/list/preserve = list() - if(istype(data) && data["viruses"]) - for(var/datum/disease/A in data["viruses"]) - preserve += A.Copy() - R.data = data.Copy() - if(preserve.len) - R.data["viruses"] = preserve - -/proc/AdminCreateVirus(client/user) - - if(!user) - return - - var/i = VIRUS_SYMPTOM_LIMIT - - var/datum/disease/advance/D = new() - D.symptoms = list() - - var/list/symptoms = list() - symptoms += "Done" - symptoms += SSdisease.list_symptoms.Copy() - do - if(user) - var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms - if(isnull(symptom)) - return - else if(istext(symptom)) - i = 0 - else if(ispath(symptom)) - var/datum/symptom/S = new symptom - if(!D.HasSymptom(S)) - D.symptoms += S - i -= 1 - while(i > 0) - - if(D.symptoms.len > 0) - - var/new_name = stripped_input(user, "Name your new disease.", "New Name") - if(!new_name) - return - D.AssignName(new_name) - D.Refresh() - for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) - if(!is_station_level(H.z)) - continue - if(!H.HasDisease(D)) - H.ForceContractDisease(D) - break - - var/list/name_symptoms = list() - for(var/datum/symptom/S in D.symptoms) - name_symptoms += S.name - message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.admin_details()]") - log_virus("[key_name(user)] has triggered a custom virus outbreak of [D.admin_details()]!") - - -/datum/disease/advance/proc/totalStageSpeed() - return properties["stage_rate"] - -/datum/disease/advance/proc/totalStealth() - return properties["stealth"] - -/datum/disease/advance/proc/totalResistance() - return properties["resistance"] - -/datum/disease/advance/proc/totalTransmittable() - return properties["transmittable"] +/* + + Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties + which add onto the overall disease. + + If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus. + +*/ + + + + +/* + + PROPERTIES + + */ + +/datum/disease/advance + name = "Unknown" // We will always let our Virologist name our disease. + desc = "An engineered disease which can contain a multitude of symptoms." + form = "Advance Disease" // Will let med-scanners know that this disease was engineered. + agent = "advance microbes" + max_stages = 5 + spread_text = "Unknown" + viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + + // NEW VARS + var/list/properties = list() + var/list/symptoms = list() // The symptoms of the disease. + var/id = "" + var/processing = FALSE + var/mutable = TRUE //set to FALSE to prevent most in-game methods of altering the disease via virology + var/oldres //To prevent setting new cures unless resistance changes. + + // The order goes from easy to cure to hard to cure. Keep in mind that sentient diseases pick two cures from tier 6 and up, ensure they wont react away in bodies. + var/static/list/advance_cures = list( + list( // level 1 + /datum/reagent/copper, /datum/reagent/silver, /datum/reagent/iodine, /datum/reagent/iron, /datum/reagent/carbon + ), + list( // level 2 + /datum/reagent/potassium, /datum/reagent/consumable/ethanol, /datum/reagent/lithium, + /datum/reagent/silicon, /datum/reagent/bromine + ), + list( // level 3 + /datum/reagent/consumable/sodiumchloride, /datum/reagent/consumable/sugar, /datum/reagent/consumable/orangejuice, + /datum/reagent/consumable/tomatojuice, /datum/reagent/consumable/milk + ), + list( //level 4 + /datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salglu_solution, + /datum/reagent/medicine/epinephrine, /datum/reagent/medicine/charcoal + ), + list( //level 5 + /datum/reagent/oil, /datum/reagent/medicine/synaptizine, /datum/reagent/medicine/mannitol, + /datum/reagent/drug/space_drugs, /datum/reagent/cryptobiolin + ), + list( // level 6 + /datum/reagent/phenol, /datum/reagent/medicine/inacusiate, /datum/reagent/medicine/oculine, /datum/reagent/medicine/antihol + ), + list( // level 7 + /datum/reagent/medicine/leporazine, /datum/reagent/toxin/mindbreaker, /datum/reagent/medicine/corazone + ), + list( // level 8 + /datum/reagent/pax, /datum/reagent/drug/happiness, /datum/reagent/medicine/ephedrine + ), + list( // level 9 + /datum/reagent/toxin/lipolicide, /datum/reagent/medicine/sal_acid + ), + list( // level 10 + /datum/reagent/medicine/haloperidol, /datum/reagent/drug/aranesp, /datum/reagent/medicine/diphenhydramine + ), + list( //level 11 + /datum/reagent/medicine/modafinil, /datum/reagent/toxin/anacea + ) + ) + +/* + + OLD PROCS + + */ + +/datum/disease/advance/New() + Refresh() + +/datum/disease/advance/Destroy() + if(processing) + for(var/datum/symptom/S in symptoms) + S.End(src) + return ..() + +/datum/disease/advance/try_infect(var/mob/living/infectee, make_copy = TRUE) + //see if we are more transmittable than enough diseases to replace them + //diseases replaced in this way do not confer immunity + var/list/advance_diseases = list() + for(var/datum/disease/advance/P in infectee.diseases) + advance_diseases += P + var/replace_num = advance_diseases.len + 1 - DISEASE_LIMIT //amount of diseases that need to be removed to fit this one + if(replace_num > 0) + sortTim(advance_diseases, /proc/cmp_advdisease_resistance_asc) + for(var/i in 1 to replace_num) + var/datum/disease/advance/competition = advance_diseases[i] + if(totalTransmittable() > competition.totalResistance()) + competition.cure(FALSE) + else + return FALSE //we are not strong enough to bully our way in + infect(infectee, make_copy) + return TRUE + +// Randomly pick a symptom to activate. +/datum/disease/advance/stage_act() + ..() + if(carrier) + return + + if(symptoms && symptoms.len) + if(!processing) + processing = TRUE + for(var/datum/symptom/S in symptoms) + if(S.Start(src)) //this will return FALSE if the symptom is neutered + S.next_activation = world.time + rand(S.symptom_delay_min * 10, S.symptom_delay_max * 10) + S.on_stage_change(src) + + for(var/datum/symptom/S in symptoms) + S.Activate(src) + +// Tell symptoms stage changed +/datum/disease/advance/update_stage(new_stage) + ..() + for(var/datum/symptom/S in symptoms) + S.on_stage_change(src) + +// Compares type then ID. +/datum/disease/advance/IsSame(datum/disease/advance/D) + + if(!(istype(D, /datum/disease/advance))) + return 0 + + if(GetDiseaseID() != D.GetDiseaseID()) + return 0 + return 1 + +// Returns the advance disease with a different reference memory. +/datum/disease/advance/Copy() + var/datum/disease/advance/A = ..() + QDEL_LIST(A.symptoms) + for(var/datum/symptom/S in symptoms) + A.symptoms += S.Copy() + A.properties = properties.Copy() + A.id = id + A.oldres = oldres + //this is a new disease starting over at stage 1, so processing is not copied + return A + +//Describe this disease to an admin in detail (for logging) +/datum/disease/advance/admin_details() + var/list/name_symptoms = list() + for(var/datum/symptom/S in symptoms) + name_symptoms += S.name + return "[name] sym:[english_list(name_symptoms)] r:[totalResistance()] s:[totalStealth()] ss:[totalStageSpeed()] t:[totalTransmittable()]" +/* + + NEW PROCS + + */ + +// Mix the symptoms of two diseases (the src and the argument) +/datum/disease/advance/proc/Mix(datum/disease/advance/D) + if(!(IsSame(D))) + var/list/possible_symptoms = shuffle(D.symptoms) + for(var/datum/symptom/S in possible_symptoms) + AddSymptom(S.Copy()) + +/datum/disease/advance/proc/HasSymptom(datum/symptom/S) + for(var/datum/symptom/symp in symptoms) + if(symp.type == S.type) + return 1 + return 0 + +// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated. +/datum/disease/advance/proc/GenerateSymptoms(level_min, level_max, amount_get = 0) + + var/list/generated = list() // Symptoms we generated. + + // Generate symptoms. By default, we only choose non-deadly symptoms. + var/list/possible_symptoms = list() + for(var/symp in SSdisease.list_symptoms) + var/datum/symptom/S = new symp + if(S.naturally_occuring && S.level >= level_min && S.level <= level_max) + if(!HasSymptom(S)) + possible_symptoms += S + + if(!possible_symptoms.len) + return generated + + // Random chance to get more than one symptom + var/number_of = amount_get + if(!amount_get) + number_of = 1 + while(prob(20)) + number_of += 1 + + for(var/i = 1; number_of >= i && possible_symptoms.len; i++) + generated += pick_n_take(possible_symptoms) + + return generated + +/datum/disease/advance/proc/Refresh(new_name = FALSE) + GenerateProperties() + AssignProperties() + if(processing && symptoms && symptoms.len) + for(var/datum/symptom/S in symptoms) + S.Start(src) + S.on_stage_change(src) + id = null + + var/the_id = GetDiseaseID() + if(!SSdisease.archive_diseases[the_id]) + SSdisease.archive_diseases[the_id] = src // So we don't infinite loop + SSdisease.archive_diseases[the_id] = Copy() + if(new_name) + AssignName() + +//Generate disease properties based on the effects. Returns an associated list. +/datum/disease/advance/proc/GenerateProperties() + properties = list("resistance" = 0, "stealth" = 0, "stage_rate" = 0, "transmittable" = 0, "severity" = 0) + + for(var/datum/symptom/S in symptoms) + properties["resistance"] += S.resistance + properties["stealth"] += S.stealth + properties["stage_rate"] += S.stage_speed + properties["transmittable"] += S.transmittable + if(!S.neutered) + properties["severity"] = max(properties["severity"], S.severity) // severity is based on the highest severity non-neutered symptom + +// Assign the properties that are in the list. +/datum/disease/advance/proc/AssignProperties() + + if(properties && properties.len) + if(properties["stealth"] >= 2) + visibility_flags |= HIDDEN_SCANNER + else + visibility_flags &= ~HIDDEN_SCANNER + + SetSpread(CLAMP(2 ** (properties["transmittable"] - symptoms.len), DISEASE_SPREAD_BLOOD, DISEASE_SPREAD_AIRBORNE)) + + permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1) + cure_chance = 15 - CLAMP(properties["resistance"], -5, 5) // can be between 10 and 20 + stage_prob = max(properties["stage_rate"], 2) + SetSeverity(properties["severity"]) + GenerateCure(properties) + else + CRASH("Our properties were empty or null!") + + +// Assign the spread type and give it the correct description. +/datum/disease/advance/proc/SetSpread(spread_id) + switch(spread_id) + if(DISEASE_SPREAD_NON_CONTAGIOUS) + spread_flags = DISEASE_SPREAD_NON_CONTAGIOUS + spread_text = "None" + if(DISEASE_SPREAD_SPECIAL) + spread_flags = DISEASE_SPREAD_SPECIAL + spread_text = "None" + if(DISEASE_SPREAD_BLOOD) + spread_flags = DISEASE_SPREAD_BLOOD + spread_text = "Blood" + if(DISEASE_SPREAD_CONTACT_FLUIDS) + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_FLUIDS + spread_text = "Fluids" + if(DISEASE_SPREAD_CONTACT_SKIN) + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_FLUIDS | DISEASE_SPREAD_CONTACT_SKIN + spread_text = "On contact" + if(DISEASE_SPREAD_AIRBORNE) + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_FLUIDS | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_AIRBORNE + spread_text = "Airborne" + +/datum/disease/advance/proc/SetSeverity(level_sev) + + switch(level_sev) + + if(-INFINITY to 0) + severity = DISEASE_SEVERITY_POSITIVE + if(1) + severity = DISEASE_SEVERITY_NONTHREAT + if(2) + severity = DISEASE_SEVERITY_MINOR + if(3) + severity = DISEASE_SEVERITY_MEDIUM + if(4) + severity = DISEASE_SEVERITY_HARMFUL + if(5) + severity = DISEASE_SEVERITY_DANGEROUS + if(6 to INFINITY) + severity = DISEASE_SEVERITY_BIOHAZARD + else + severity = "Unknown" + + +// Will generate a random cure, the less resistance the symptoms have, the harder the cure. +/datum/disease/advance/proc/GenerateCure() + if(properties && properties.len) + var/res = CLAMP(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) + if(res == oldres) + return + cures = list(pick(advance_cures[res])) + oldres = res + + // Get the cure name from the cure_id + var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]] + cure_text = D.name + +// Randomly generate a symptom, has a chance to lose or gain a symptom. +/datum/disease/advance/proc/Evolve(min_level, max_level, ignore_mutable = FALSE) + if(!mutable && !ignore_mutable) + return + var/s = safepick(GenerateSymptoms(min_level, max_level, 1)) + if(s) + AddSymptom(s) + Refresh(TRUE) + return + +// Randomly remove a symptom. +/datum/disease/advance/proc/Devolve(ignore_mutable = FALSE) + if(!mutable && !ignore_mutable) + return + if(symptoms.len > 1) + var/s = safepick(symptoms) + if(s) + RemoveSymptom(s) + Refresh(TRUE) + +// Randomly neuter a symptom. +/datum/disease/advance/proc/Neuter(ignore_mutable = FALSE) + if(!mutable && !ignore_mutable) + return + if(symptoms.len) + var/s = safepick(symptoms) + if(s) + NeuterSymptom(s) + Refresh(TRUE) + +// Name the disease. +/datum/disease/advance/proc/AssignName(name = "Unknown") + Refresh() + var/datum/disease/advance/A = SSdisease.archive_diseases[GetDiseaseID()] + A.name = name + for(var/datum/disease/advance/AD in SSdisease.active_diseases) + AD.Refresh() + +// Return a unique ID of the disease. +/datum/disease/advance/GetDiseaseID() + if(!id) + var/list/L = list() + for(var/datum/symptom/S in symptoms) + if(S.neutered) + L += "[S.id]N" + else + L += S.id + L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. + var/result = jointext(L, ":") + id = result + return id + + +// Add a symptom, if it is over the limit we take a random symptom away and add the new one. +/datum/disease/advance/proc/AddSymptom(datum/symptom/S) + + if(HasSymptom(S)) + return + + if(!(symptoms.len < (VIRUS_SYMPTOM_LIMIT - 1) + rand(-1, 1))) + RemoveSymptom(pick(symptoms)) + symptoms += S + S.OnAdd(src) + +// Simply removes the symptom. +/datum/disease/advance/proc/RemoveSymptom(datum/symptom/S) + symptoms -= S + S.OnRemove(src) + +// Neuter a symptom, so it will only affect stats +/datum/disease/advance/proc/NeuterSymptom(datum/symptom/S) + if(!S.neutered) + S.neutered = TRUE + S.name += " (neutered)" + S.OnRemove(src) + +/* + + Static Procs + +*/ + +// Mix a list of advance diseases and return the mixed result. +/proc/Advance_Mix(var/list/D_list) + var/list/diseases = list() + + for(var/datum/disease/advance/A in D_list) + diseases += A.Copy() + + if(!diseases.len) + return null + if(diseases.len <= 1) + return pick(diseases) // Just return the only entry. + + var/i = 0 + // Mix our diseases until we are left with only one result. + while(i < 20 && diseases.len > 1) + + i++ + + var/datum/disease/advance/D1 = pick(diseases) + diseases -= D1 + + var/datum/disease/advance/D2 = pick(diseases) + D2.Mix(D1) + + // Should be only 1 entry left, but if not let's only return a single entry + var/datum/disease/advance/to_return = pick(diseases) + to_return.Refresh(1) + return to_return + +/proc/SetViruses(datum/reagent/R, list/data) + if(data) + var/list/preserve = list() + if(istype(data) && data["viruses"]) + for(var/datum/disease/A in data["viruses"]) + preserve += A.Copy() + R.data = data.Copy() + if(preserve.len) + R.data["viruses"] = preserve + +/proc/AdminCreateVirus(client/user) + + if(!user) + return + + var/i = VIRUS_SYMPTOM_LIMIT + + var/datum/disease/advance/D = new() + D.symptoms = list() + + var/list/symptoms = list() + symptoms += "Done" + symptoms += SSdisease.list_symptoms.Copy() + do + if(user) + var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms + if(isnull(symptom)) + return + else if(istext(symptom)) + i = 0 + else if(ispath(symptom)) + var/datum/symptom/S = new symptom + if(!D.HasSymptom(S)) + D.symptoms += S + i -= 1 + while(i > 0) + + if(D.symptoms.len > 0) + + var/new_name = stripped_input(user, "Name your new disease.", "New Name") + if(!new_name) + return + D.AssignName(new_name) + D.Refresh() + for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) + if(!is_station_level(H.z)) + continue + if(!H.HasDisease(D)) + H.ForceContractDisease(D) + break + + var/list/name_symptoms = list() + for(var/datum/symptom/S in D.symptoms) + name_symptoms += S.name + message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.admin_details()]") + log_virus("[key_name(user)] has triggered a custom virus outbreak of [D.admin_details()]!") + + +/datum/disease/advance/proc/totalStageSpeed() + return properties["stage_rate"] + +/datum/disease/advance/proc/totalStealth() + return properties["stealth"] + +/datum/disease/advance/proc/totalResistance() + return properties["resistance"] + +/datum/disease/advance/proc/totalTransmittable() + return properties["transmittable"] diff --git a/code/datums/diseases/advance/symptoms/choking.dm b/code/datums/diseases/advance/symptoms/choking.dm index 20684839..1ad56b09 100644 --- a/code/datums/diseases/advance/symptoms/choking.dm +++ b/code/datums/diseases/advance/symptoms/choking.dm @@ -1,145 +1,145 @@ -/* -////////////////////////////////////// - -Choking - Very very noticable. - Lowers resistance. - Decreases stage speed. - Decreases transmittablity tremendously. - Moderate Level. -Bonus - Inflicts spikes of oxyloss -////////////////////////////////////// -*/ - -/datum/symptom/choking - - name = "Choking" - desc = "The virus causes inflammation of the host's air conduits, leading to intermittent choking." - stealth = -3 - resistance = -2 - stage_speed = -2 - transmittable = -4 - level = 3 - severity = 3 - base_message_chance = 15 - symptom_delay_min = 10 - symptom_delay_max = 30 - threshold_desc = "Stage Speed 8: Causes choking more frequently.
    \ - Stealth 4: The symptom remains hidden until active." - -/datum/symptom/choking/Start(datum/disease/advance/A) - if(!..()) - return - if(A.properties["stage_rate"] >= 8) - symptom_delay_min = 7 - symptom_delay_max = 24 - if(A.properties["stealth"] >= 4) - suppress_warning = TRUE - -/datum/symptom/choking/Activate(datum/disease/advance/A) - if(!..()) - return - var/mob/living/M = A.affected_mob - switch(A.stage) - if(1, 2) - if(prob(base_message_chance) && !suppress_warning) - to_chat(M, "[pick("You're having difficulty breathing.", "Your breathing becomes heavy.")]") - if(3, 4) - if(!suppress_warning) - to_chat(M, "[pick("Your windpipe feels like a straw.", "Your breathing becomes tremendously difficult.")]") - else - to_chat(M, "You feel very [pick("dizzy","woozy","faint")].") //fake bloodloss messages - Choke_stage_3_4(M, A) - M.emote("gasp") - else - to_chat(M, "[pick("You're choking!", "You can't breathe!")]") - Choke(M, A) - M.emote("gasp") - -/datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A) - M.adjustOxyLoss(rand(6,13)) - return 1 - -/datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A) - M.adjustOxyLoss(rand(10,18)) - return 1 - -/* -////////////////////////////////////// - -Asphyxiation - - Very very noticable. - Decreases stage speed. - Decreases transmittablity. - -Bonus - Inflicts large spikes of oxyloss - Introduces Asphyxiating drugs to the system - Causes cardiac arrest on dying victims. - -////////////////////////////////////// -*/ - -/datum/symptom/asphyxiation - - name = "Acute respiratory distress syndrome" - desc = "The virus causes shrinking of the host's lungs, causing severe asphyxiation. May also lead to heart attacks." - stealth = -2 - resistance = -0 - stage_speed = -1 - transmittable = -2 - level = 7 - severity = 6 - base_message_chance = 15 - symptom_delay_min = 14 - symptom_delay_max = 30 - var/paralysis = FALSE - threshold_desc = "Stage Speed 8: Additionally synthesizes pancuronium and sodium thiopental inside the host.
    \ - Transmission 8: Doubles the damage caused by the symptom." - - -/datum/symptom/asphyxiation/Start(datum/disease/advance/A) - if(!..()) - return - if(A.properties["stage_rate"] >= 8) - paralysis = TRUE - if(A.properties["transmittable"] >= 8) - power = 2 - -/datum/symptom/asphyxiation/Activate(datum/disease/advance/A) - if(!..()) - return - var/mob/living/M = A.affected_mob - switch(A.stage) - if(3, 4) - to_chat(M, "[pick("Your windpipe feels thin.", "Your lungs feel small.")]") - Asphyxiate_stage_3_4(M, A) - M.emote("gasp") - if(5) - to_chat(M, "[pick("Your lungs hurt!", "It hurts to breathe!")]") - Asphyxiate(M, A) - M.emote("gasp") - if(M.getOxyLoss() >= 120) - M.visible_message("[M] stops breathing, as if their lungs have totally collapsed!") - Asphyxiate_death(M, A) - return - -/datum/symptom/asphyxiation/proc/Asphyxiate_stage_3_4(mob/living/M, datum/disease/advance/A) - var/get_damage = rand(10,15) * power - M.adjustOxyLoss(get_damage) - return 1 - -/datum/symptom/asphyxiation/proc/Asphyxiate(mob/living/M, datum/disease/advance/A) - var/get_damage = rand(15,21) * power - M.adjustOxyLoss(get_damage) - if(paralysis) - M.reagents.add_reagent_list(list("pancuronium" = 3, "sodium_thiopental" = 3)) - return 1 - -/datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A) - var/get_damage = rand(25,35) * power - M.adjustOxyLoss(get_damage) - M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2) - return 1 +/* +////////////////////////////////////// + +Choking + Very very noticable. + Lowers resistance. + Decreases stage speed. + Decreases transmittablity tremendously. + Moderate Level. +Bonus + Inflicts spikes of oxyloss +////////////////////////////////////// +*/ + +/datum/symptom/choking + + name = "Choking" + desc = "The virus causes inflammation of the host's air conduits, leading to intermittent choking." + stealth = -3 + resistance = -2 + stage_speed = -2 + transmittable = -4 + level = 3 + severity = 3 + base_message_chance = 15 + symptom_delay_min = 10 + symptom_delay_max = 30 + threshold_desc = "Stage Speed 8: Causes choking more frequently.
    \ + Stealth 4: The symptom remains hidden until active." + +/datum/symptom/choking/Start(datum/disease/advance/A) + if(!..()) + return + if(A.properties["stage_rate"] >= 8) + symptom_delay_min = 7 + symptom_delay_max = 24 + if(A.properties["stealth"] >= 4) + suppress_warning = TRUE + +/datum/symptom/choking/Activate(datum/disease/advance/A) + if(!..()) + return + var/mob/living/M = A.affected_mob + switch(A.stage) + if(1, 2) + if(prob(base_message_chance) && !suppress_warning) + to_chat(M, "[pick("You're having difficulty breathing.", "Your breathing becomes heavy.")]") + if(3, 4) + if(!suppress_warning) + to_chat(M, "[pick("Your windpipe feels like a straw.", "Your breathing becomes tremendously difficult.")]") + else + to_chat(M, "You feel very [pick("dizzy","woozy","faint")].") //fake bloodloss messages + Choke_stage_3_4(M, A) + M.emote("gasp") + else + to_chat(M, "[pick("You're choking!", "You can't breathe!")]") + Choke(M, A) + M.emote("gasp") + +/datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A) + M.adjustOxyLoss(rand(6,13)) + return 1 + +/datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A) + M.adjustOxyLoss(rand(10,18)) + return 1 + +/* +////////////////////////////////////// + +Asphyxiation + + Very very noticable. + Decreases stage speed. + Decreases transmittablity. + +Bonus + Inflicts large spikes of oxyloss + Introduces Asphyxiating drugs to the system + Causes cardiac arrest on dying victims. + +////////////////////////////////////// +*/ + +/datum/symptom/asphyxiation + + name = "Acute respiratory distress syndrome" + desc = "The virus causes shrinking of the host's lungs, causing severe asphyxiation. May also lead to heart attacks." + stealth = -2 + resistance = -0 + stage_speed = -1 + transmittable = -2 + level = 7 + severity = 6 + base_message_chance = 15 + symptom_delay_min = 14 + symptom_delay_max = 30 + var/paralysis = FALSE + threshold_desc = "Stage Speed 8: Additionally synthesizes pancuronium and sodium thiopental inside the host.
    \ + Transmission 8: Doubles the damage caused by the symptom." + + +/datum/symptom/asphyxiation/Start(datum/disease/advance/A) + if(!..()) + return + if(A.properties["stage_rate"] >= 8) + paralysis = TRUE + if(A.properties["transmittable"] >= 8) + power = 2 + +/datum/symptom/asphyxiation/Activate(datum/disease/advance/A) + if(!..()) + return + var/mob/living/M = A.affected_mob + switch(A.stage) + if(3, 4) + to_chat(M, "[pick("Your windpipe feels thin.", "Your lungs feel small.")]") + Asphyxiate_stage_3_4(M, A) + M.emote("gasp") + if(5) + to_chat(M, "[pick("Your lungs hurt!", "It hurts to breathe!")]") + Asphyxiate(M, A) + M.emote("gasp") + if(M.getOxyLoss() >= 120) + M.visible_message("[M] stops breathing, as if their lungs have totally collapsed!") + Asphyxiate_death(M, A) + return + +/datum/symptom/asphyxiation/proc/Asphyxiate_stage_3_4(mob/living/M, datum/disease/advance/A) + var/get_damage = rand(10,15) * power + M.adjustOxyLoss(get_damage) + return 1 + +/datum/symptom/asphyxiation/proc/Asphyxiate(mob/living/M, datum/disease/advance/A) + var/get_damage = rand(15,21) * power + M.adjustOxyLoss(get_damage) + if(paralysis) + M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3)) + return 1 + +/datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A) + var/get_damage = rand(25,35) * power + M.adjustOxyLoss(get_damage) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2) + return 1 diff --git a/code/datums/diseases/advance/symptoms/fire.dm b/code/datums/diseases/advance/symptoms/fire.dm index 8e0839bc..387de2dd 100644 --- a/code/datums/diseases/advance/symptoms/fire.dm +++ b/code/datums/diseases/advance/symptoms/fire.dm @@ -155,7 +155,7 @@ Bonus M.adjust_fire_stacks(get_stacks) M.adjustFireLoss(get_stacks/2) if(chems) - M.reagents.add_reagent("clf3", 2 * power) + M.reagents.add_reagent(/datum/reagent/clf3, 2 * power) return 1 /datum/symptom/alkali/proc/Alkali_fire_stage_5(mob/living/M, datum/disease/advance/A) @@ -163,5 +163,5 @@ Bonus M.adjust_fire_stacks(get_stacks) M.adjustFireLoss(get_stacks) if(chems) - M.reagents.add_reagent_list(list("napalm" = 4 * power, "clf3" = 4 * power)) + M.reagents.add_reagent_list(list(/datum/reagent/napalm = 4 * power, /datum/reagent/clf3 = 4 * power)) return 1 diff --git a/code/datums/diseases/advance/symptoms/flesh_eating.dm b/code/datums/diseases/advance/symptoms/flesh_eating.dm index 2d5d22a6..097966c1 100644 --- a/code/datums/diseases/advance/symptoms/flesh_eating.dm +++ b/code/datums/diseases/advance/symptoms/flesh_eating.dm @@ -124,7 +124,7 @@ Bonus var/get_damage = rand(6,10) M.adjustBruteLoss(get_damage) if(chems) - M.reagents.add_reagent_list(list("heparin" = 2, "lipolicide" = 2)) + M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2)) if(zombie) - M.reagents.add_reagent("romerol", 1) + M.reagents.add_reagent(/datum/reagent/romerol, 1) return 1 diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index cee9be9e..4e501d2e 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -117,8 +117,9 @@ power = 2 /datum/symptom/heal/chem/Heal(mob/living/M, datum/disease/advance/A, actual_power) - for(var/datum/reagent/R in M.reagents.reagent_list) //Not just toxins! - M.reagents.remove_reagent(R.id, actual_power) + for(var/E in M.reagents.reagent_list) //Not just toxins! + var/datum/reagent/R = E + M.reagents.remove_reagent(R.type, actual_power) if(food_conversion) M.nutrition += 0.3 if(prob(2)) @@ -329,11 +330,11 @@ if(M.fire_stacks < 0) M.fire_stacks = min(M.fire_stacks + 1 * absorption_coeff, 0) . += power - if(M.reagents.has_reagent("holywater")) - M.reagents.remove_reagent("holywater", 0.5 * absorption_coeff) + if(M.reagents.has_reagent(/datum/reagent/water/holywater)) + M.reagents.remove_reagent(/datum/reagent/water/holywater, 0.5 * absorption_coeff) . += power * 0.75 - else if(M.reagents.has_reagent("water")) - M.reagents.remove_reagent("water", 0.5 * absorption_coeff) + else if(M.reagents.has_reagent(/datum/reagent/water)) + M.reagents.remove_reagent(/datum/reagent/water, 0.5 * absorption_coeff) . += power * 0.5 /datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power) @@ -392,7 +393,7 @@ plasmamount = environment.gases[/datum/gas/plasma] if(plasmamount && plasmamount > GLOB.meta_gas_visibility[/datum/gas/plasma]) //if there's enough plasma in the air to see . += power * 0.5 - if(M.reagents.has_reagent("plasma")) + if(M.reagents.has_reagent(/datum/reagent/toxin/plasma)) . += power * 0.75 /datum/symptom/heal/plasma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power) diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm index a6194f41..58b64ae4 100644 --- a/code/datums/diseases/advance/symptoms/sensory.dm +++ b/code/datums/diseases/advance/symptoms/sensory.dm @@ -44,10 +44,10 @@ if(A.stage >= 4) M.drowsyness = max(0, M.drowsyness - 2) - if(M.reagents.has_reagent("mindbreaker")) - M.reagents.remove_reagent("mindbreaker", 5) - if(M.reagents.has_reagent("histamine")) - M.reagents.remove_reagent("histamine", 5) + if(M.reagents.has_reagent(/datum/reagent/toxin/mindbreaker)) + M.reagents.remove_reagent(/datum/reagent/toxin/mindbreaker, 5) + if(M.reagents.has_reagent(/datum/reagent/toxin/histamine)) + M.reagents.remove_reagent(/datum/reagent/toxin/histamine, 5) M.hallucination = max(0, M.hallucination - 10) if(A.stage >= 5) diff --git a/code/datums/diseases/anxiety.dm b/code/datums/diseases/anxiety.dm index 2d96157b..20ecceb2 100644 --- a/code/datums/diseases/anxiety.dm +++ b/code/datums/diseases/anxiety.dm @@ -5,7 +5,7 @@ spread_text = "On contact" spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS cure_text = "Ethanol" - cures = list("ethanol") + cures = list(/datum/reagent/consumable/ethanol) agent = "Excess Lepidopticides" viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) desc = "If left untreated subject will regurgitate butterflies." diff --git a/code/datums/diseases/beesease.dm b/code/datums/diseases/beesease.dm index afecbe60..edd6f151 100644 --- a/code/datums/diseases/beesease.dm +++ b/code/datums/diseases/beesease.dm @@ -1,39 +1,39 @@ -/datum/disease/beesease - name = "Beesease" - form = "Infection" - max_stages = 4 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Sugar" - cures = list("sugar") - agent = "Apidae Infection" - viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - desc = "If left untreated subject will regurgitate bees." - severity = DISEASE_SEVERITY_MEDIUM - infectable_biotypes = list(MOB_ORGANIC, MOB_UNDEAD) //bees nesting in corpses - -/datum/disease/beesease/stage_act() - ..() - switch(stage) - if(2) //also changes say, see say.dm - if(prob(2)) - to_chat(affected_mob, "You taste honey in your mouth.") - if(3) - if(prob(10)) - to_chat(affected_mob, "Your stomach rumbles.") - if(prob(2)) - to_chat(affected_mob, "Your stomach stings painfully.") - if(prob(20)) - affected_mob.adjustToxLoss(2) - affected_mob.updatehealth() - if(4) - if(prob(10)) - affected_mob.visible_message("[affected_mob] buzzes.", \ - "Your stomach buzzes violently!") - if(prob(5)) - to_chat(affected_mob, "You feel something moving in your throat.") - if(prob(1)) - affected_mob.visible_message("[affected_mob] coughs up a swarm of bees!", \ - "You cough up a swarm of bees!") - new /mob/living/simple_animal/hostile/poison/bees(affected_mob.loc) +/datum/disease/beesease + name = "Beesease" + form = "Infection" + max_stages = 4 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Sugar" + cures = list(/datum/reagent/consumable/sugar) + agent = "Apidae Infection" + viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + desc = "If left untreated subject will regurgitate bees." + severity = DISEASE_SEVERITY_MEDIUM + infectable_biotypes = list(MOB_ORGANIC, MOB_UNDEAD) //bees nesting in corpses + +/datum/disease/beesease/stage_act() + ..() + switch(stage) + if(2) //also changes say, see say.dm + if(prob(2)) + to_chat(affected_mob, "You taste honey in your mouth.") + if(3) + if(prob(10)) + to_chat(affected_mob, "Your stomach rumbles.") + if(prob(2)) + to_chat(affected_mob, "Your stomach stings painfully.") + if(prob(20)) + affected_mob.adjustToxLoss(2) + affected_mob.updatehealth() + if(4) + if(prob(10)) + affected_mob.visible_message("[affected_mob] buzzes.", \ + "Your stomach buzzes violently!") + if(prob(5)) + to_chat(affected_mob, "You feel something moving in your throat.") + if(prob(1)) + affected_mob.visible_message("[affected_mob] coughs up a swarm of bees!", \ + "You cough up a swarm of bees!") + new /mob/living/simple_animal/hostile/poison/bees(affected_mob.loc) return \ No newline at end of file diff --git a/code/datums/diseases/brainrot.dm b/code/datums/diseases/brainrot.dm index da8aa61f..1028d1ff 100644 --- a/code/datums/diseases/brainrot.dm +++ b/code/datums/diseases/brainrot.dm @@ -1,59 +1,59 @@ -/datum/disease/brainrot - name = "Brainrot" - max_stages = 4 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Mannitol" - cures = list("mannitol") - agent = "Cryptococcus Cosmosis" - viable_mobtypes = list(/mob/living/carbon/human) - cure_chance = 15//higher chance to cure, since two reagents are required - desc = "This disease destroys the braincells, causing brain fever, brain necrosis and general intoxication." - required_organs = list(/obj/item/organ/brain) - severity = DISEASE_SEVERITY_HARMFUL - -/datum/disease/brainrot/stage_act() //Removed toxloss because damaging diseases are pretty horrible. Last round it killed the entire station because the cure didn't work -- Urist -ACTUALLY Removed rather than commented out, I don't see it returning - RR - ..() - - switch(stage) - if(2) - if(prob(2)) - affected_mob.emote("blink") - if(prob(2)) - affected_mob.emote("yawn") - if(prob(2)) - to_chat(affected_mob, "You don't feel like yourself.") - if(prob(5)) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1, 170) - affected_mob.updatehealth() - if(3) - if(prob(2)) - affected_mob.emote("stare") - if(prob(2)) - affected_mob.emote("drool") - if(prob(10)) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2, 170) - affected_mob.updatehealth() - if(prob(2)) - to_chat(affected_mob, "Your try to remember something important...but can't.") - - if(4) - if(prob(2)) - affected_mob.emote("stare") - if(prob(2)) - affected_mob.emote("drool") - if(prob(15)) - affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 170) - affected_mob.updatehealth() - if(prob(2)) - to_chat(affected_mob, "Strange buzzing fills your head, removing all thoughts.") - if(prob(3)) - to_chat(affected_mob, "You lose consciousness...") - affected_mob.visible_message("[affected_mob] suddenly collapses") - affected_mob.Unconscious(rand(100,200)) - if(prob(1)) - affected_mob.emote("snore") - if(prob(15)) - affected_mob.stuttering += 3 - - return +/datum/disease/brainrot + name = "Brainrot" + max_stages = 4 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Mannitol" + cures = list(/datum/reagent/medicine/mannitol) + agent = "Cryptococcus Cosmosis" + viable_mobtypes = list(/mob/living/carbon/human) + cure_chance = 15//higher chance to cure, since two reagents are required + desc = "This disease destroys the braincells, causing brain fever, brain necrosis and general intoxication." + required_organs = list(/obj/item/organ/brain) + severity = DISEASE_SEVERITY_HARMFUL + +/datum/disease/brainrot/stage_act() //Removed toxloss because damaging diseases are pretty horrible. Last round it killed the entire station because the cure didn't work -- Urist -ACTUALLY Removed rather than commented out, I don't see it returning - RR + ..() + + switch(stage) + if(2) + if(prob(2)) + affected_mob.emote("blink") + if(prob(2)) + affected_mob.emote("yawn") + if(prob(2)) + to_chat(affected_mob, "You don't feel like yourself.") + if(prob(5)) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1, 170) + affected_mob.updatehealth() + if(3) + if(prob(2)) + affected_mob.emote("stare") + if(prob(2)) + affected_mob.emote("drool") + if(prob(10)) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2, 170) + affected_mob.updatehealth() + if(prob(2)) + to_chat(affected_mob, "Your try to remember something important...but can't.") + + if(4) + if(prob(2)) + affected_mob.emote("stare") + if(prob(2)) + affected_mob.emote("drool") + if(prob(15)) + affected_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 170) + affected_mob.updatehealth() + if(prob(2)) + to_chat(affected_mob, "Strange buzzing fills your head, removing all thoughts.") + if(prob(3)) + to_chat(affected_mob, "You lose consciousness...") + affected_mob.visible_message("[affected_mob] suddenly collapses") + affected_mob.Unconscious(rand(100,200)) + if(prob(1)) + affected_mob.emote("snore") + if(prob(15)) + affected_mob.stuttering += 3 + + return diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index b6ee48c5..8bbb05e1 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -1,53 +1,53 @@ -/datum/disease/cold - name = "The Cold" - max_stages = 3 - cure_text = "Rest & Spaceacillin" - cures = list("spaceacillin") - agent = "XY-rhinovirus" - viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - permeability_mod = 0.5 - desc = "If left untreated the subject will contract the flu." - severity = DISEASE_SEVERITY_NONTHREAT - -/datum/disease/cold/stage_act() - ..() - switch(stage) - if(2) - if(affected_mob.lying && prob(40)) //changed FROM prob(10) until sleeping is fixed - to_chat(affected_mob, "You feel better.") - cure() - return - if(prob(1) && prob(5)) - to_chat(affected_mob, "You feel better.") - cure() - return - if(prob(1)) - affected_mob.emote("sneeze") - if(prob(1)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your throat feels sore.") - if(prob(1)) - to_chat(affected_mob, "Mucous runs down the back of your throat.") - if(3) - if(affected_mob.lying && prob(25)) //changed FROM prob(5) until sleeping is fixed - to_chat(affected_mob, "You feel better.") - cure() - return - if(prob(1) && prob(1)) - to_chat(affected_mob, "You feel better.") - cure() - return - if(prob(1)) - affected_mob.emote("sneeze") - if(prob(1)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your throat feels sore.") - if(prob(1)) - to_chat(affected_mob, "Mucous runs down the back of your throat.") - if(prob(1) && prob(50)) - if(!affected_mob.disease_resistances.Find(/datum/disease/flu)) - var/datum/disease/Flu = new /datum/disease/flu() - affected_mob.ForceContractDisease(Flu, FALSE, TRUE) +/datum/disease/cold + name = "The Cold" + max_stages = 3 + cure_text = "Rest & Spaceacillin" + cures = list(/datum/reagent/medicine/spaceacillin) + agent = "XY-rhinovirus" + viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + permeability_mod = 0.5 + desc = "If left untreated the subject will contract the flu." + severity = DISEASE_SEVERITY_NONTHREAT + +/datum/disease/cold/stage_act() + ..() + switch(stage) + if(2) + if(affected_mob.lying && prob(40)) //changed FROM prob(10) until sleeping is fixed + to_chat(affected_mob, "You feel better.") + cure() + return + if(prob(1) && prob(5)) + to_chat(affected_mob, "You feel better.") + cure() + return + if(prob(1)) + affected_mob.emote("sneeze") + if(prob(1)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your throat feels sore.") + if(prob(1)) + to_chat(affected_mob, "Mucous runs down the back of your throat.") + if(3) + if(affected_mob.lying && prob(25)) //changed FROM prob(5) until sleeping is fixed + to_chat(affected_mob, "You feel better.") + cure() + return + if(prob(1) && prob(1)) + to_chat(affected_mob, "You feel better.") + cure() + return + if(prob(1)) + affected_mob.emote("sneeze") + if(prob(1)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your throat feels sore.") + if(prob(1)) + to_chat(affected_mob, "Mucous runs down the back of your throat.") + if(prob(1) && prob(50)) + if(!affected_mob.disease_resistances.Find(/datum/disease/flu)) + var/datum/disease/Flu = new /datum/disease/flu() + affected_mob.ForceContractDisease(Flu, FALSE, TRUE) cure() \ No newline at end of file diff --git a/code/datums/diseases/cold9.dm b/code/datums/diseases/cold9.dm index af2bfe6b..eea31471 100644 --- a/code/datums/diseases/cold9.dm +++ b/code/datums/diseases/cold9.dm @@ -1,39 +1,39 @@ -/datum/disease/cold9 - name = "The Cold" - max_stages = 3 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Common Cold Anti-bodies & Spaceacillin" - cures = list("spaceacillin") - agent = "ICE9-rhinovirus" - viable_mobtypes = list(/mob/living/carbon/human) - desc = "If left untreated the subject will slow, as if partly frozen." - severity = DISEASE_SEVERITY_HARMFUL - -/datum/disease/cold9/stage_act() - ..() - switch(stage) - if(2) - affected_mob.adjust_bodytemperature(-10) - if(prob(1) && prob(10)) - to_chat(affected_mob, "You feel better.") - cure() - return - if(prob(1)) - affected_mob.emote("sneeze") - if(prob(1)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your throat feels sore.") - if(prob(5)) - to_chat(affected_mob, "You feel stiff.") - if(3) - affected_mob.adjust_bodytemperature(-20) - if(prob(1)) - affected_mob.emote("sneeze") - if(prob(1)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your throat feels sore.") - if(prob(10)) +/datum/disease/cold9 + name = "The Cold" + max_stages = 3 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Common Cold Anti-bodies & Spaceacillin" + cures = list(/datum/reagent/medicine/spaceacillin) + agent = "ICE9-rhinovirus" + viable_mobtypes = list(/mob/living/carbon/human) + desc = "If left untreated the subject will slow, as if partly frozen." + severity = DISEASE_SEVERITY_HARMFUL + +/datum/disease/cold9/stage_act() + ..() + switch(stage) + if(2) + affected_mob.adjust_bodytemperature(-10) + if(prob(1) && prob(10)) + to_chat(affected_mob, "You feel better.") + cure() + return + if(prob(1)) + affected_mob.emote("sneeze") + if(prob(1)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your throat feels sore.") + if(prob(5)) + to_chat(affected_mob, "You feel stiff.") + if(3) + affected_mob.adjust_bodytemperature(-20) + if(prob(1)) + affected_mob.emote("sneeze") + if(prob(1)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your throat feels sore.") + if(prob(10)) to_chat(affected_mob, "You feel stiff.") \ No newline at end of file diff --git a/code/datums/diseases/dna_spread.dm b/code/datums/diseases/dna_spread.dm index fdaf0d28..972a7f4e 100644 --- a/code/datums/diseases/dna_spread.dm +++ b/code/datums/diseases/dna_spread.dm @@ -1,74 +1,74 @@ -/datum/disease/dnaspread - name = "Space Retrovirus" - max_stages = 4 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Mutadone" - cures = list("mutadone") - disease_flags = CAN_CARRY|CAN_RESIST|CURABLE - agent = "S4E1 retrovirus" - viable_mobtypes = list(/mob/living/carbon/human) - var/datum/dna/original_dna = null - var/transformed = 0 - desc = "This disease transplants the genetic code of the initial vector into new hosts." - severity = DISEASE_SEVERITY_MEDIUM - - -/datum/disease/dnaspread/stage_act() - ..() - if(!affected_mob.dna) - cure() - if((NOTRANSSTING in affected_mob.dna.species.species_traits) || (NO_DNA_COPY in affected_mob.dna.species.species_traits)) //Only species that can be spread by transformation sting can be spread by the retrovirus - cure() - - if(!strain_data["dna"]) - //Absorbs the target DNA. - strain_data["dna"] = new affected_mob.dna.type - affected_mob.dna.copy_dna(strain_data["dna"]) - carrier = TRUE - stage = 4 - return - - switch(stage) - if(2 || 3) //Pretend to be a cold and give time to spread. - if(prob(8)) - affected_mob.emote("sneeze") - if(prob(8)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your muscles ache.") - if(prob(20)) - affected_mob.take_bodypart_damage(1) - if(prob(1)) - to_chat(affected_mob, "Your stomach hurts.") - if(prob(20)) - affected_mob.adjustToxLoss(2) - affected_mob.updatehealth() - if(4) - if(!transformed && !carrier) - //Save original dna for when the disease is cured. - original_dna = new affected_mob.dna.type - affected_mob.dna.copy_dna(original_dna) - - to_chat(affected_mob, "You don't feel like yourself..") - var/datum/dna/transform_dna = strain_data["dna"] - - transform_dna.transfer_identity(affected_mob, transfer_SE = 1) - affected_mob.real_name = affected_mob.dna.real_name - affected_mob.updateappearance(mutcolor_update=1) - affected_mob.domutcheck() - - transformed = 1 - carrier = 1 //Just chill out at stage 4 - - return - -/datum/disease/dnaspread/Destroy() - if (original_dna && transformed && affected_mob) - original_dna.transfer_identity(affected_mob, transfer_SE = 1) - affected_mob.real_name = affected_mob.dna.real_name - affected_mob.updateappearance(mutcolor_update=1) - affected_mob.domutcheck() - - to_chat(affected_mob, "You feel more like yourself.") - return ..() +/datum/disease/dnaspread + name = "Space Retrovirus" + max_stages = 4 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Mutadone" + cures = list(/datum/reagent/medicine/mutadone) + disease_flags = CAN_CARRY|CAN_RESIST|CURABLE + agent = "S4E1 retrovirus" + viable_mobtypes = list(/mob/living/carbon/human) + var/datum/dna/original_dna = null + var/transformed = 0 + desc = "This disease transplants the genetic code of the initial vector into new hosts." + severity = DISEASE_SEVERITY_MEDIUM + + +/datum/disease/dnaspread/stage_act() + ..() + if(!affected_mob.dna) + cure() + if((NOTRANSSTING in affected_mob.dna.species.species_traits) || (NO_DNA_COPY in affected_mob.dna.species.species_traits)) //Only species that can be spread by transformation sting can be spread by the retrovirus + cure() + + if(!strain_data["dna"]) + //Absorbs the target DNA. + strain_data["dna"] = new affected_mob.dna.type + affected_mob.dna.copy_dna(strain_data["dna"]) + carrier = TRUE + stage = 4 + return + + switch(stage) + if(2 || 3) //Pretend to be a cold and give time to spread. + if(prob(8)) + affected_mob.emote("sneeze") + if(prob(8)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your muscles ache.") + if(prob(20)) + affected_mob.take_bodypart_damage(1) + if(prob(1)) + to_chat(affected_mob, "Your stomach hurts.") + if(prob(20)) + affected_mob.adjustToxLoss(2) + affected_mob.updatehealth() + if(4) + if(!transformed && !carrier) + //Save original dna for when the disease is cured. + original_dna = new affected_mob.dna.type + affected_mob.dna.copy_dna(original_dna) + + to_chat(affected_mob, "You don't feel like yourself..") + var/datum/dna/transform_dna = strain_data["dna"] + + transform_dna.transfer_identity(affected_mob, transfer_SE = 1) + affected_mob.real_name = affected_mob.dna.real_name + affected_mob.updateappearance(mutcolor_update=1) + affected_mob.domutcheck() + + transformed = 1 + carrier = 1 //Just chill out at stage 4 + + return + +/datum/disease/dnaspread/Destroy() + if (original_dna && transformed && affected_mob) + original_dna.transfer_identity(affected_mob, transfer_SE = 1) + affected_mob.real_name = affected_mob.dna.real_name + affected_mob.updateappearance(mutcolor_update=1) + affected_mob.domutcheck() + + to_chat(affected_mob, "You feel more like yourself.") + return ..() diff --git a/code/datums/diseases/fake_gbs.dm b/code/datums/diseases/fake_gbs.dm index 6b364112..70bcc67d 100644 --- a/code/datums/diseases/fake_gbs.dm +++ b/code/datums/diseases/fake_gbs.dm @@ -1,32 +1,32 @@ -/datum/disease/fake_gbs - name = "GBS" - max_stages = 5 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Synaptizine & Sulfur" - cures = list("synaptizine","sulfur") - agent = "Gravitokinetic Bipotential SADS-" - viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - desc = "If left untreated death will occur." - severity = DISEASE_SEVERITY_BIOHAZARD - -/datum/disease/fake_gbs/stage_act() - ..() - switch(stage) - if(2) - if(prob(1)) - affected_mob.emote("sneeze") - if(3) - if(prob(5)) - affected_mob.emote("cough") - else if(prob(5)) - affected_mob.emote("gasp") - if(prob(10)) - to_chat(affected_mob, "You're starting to feel very weak...") - if(4) - if(prob(10)) - affected_mob.emote("cough") - - if(5) - if(prob(10)) - affected_mob.emote("cough") +/datum/disease/fake_gbs + name = "GBS" + max_stages = 5 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Synaptizine & Sulfur" + cures = list(/datum/reagent/medicine/synaptizine,/datum/reagent/sulfur) + agent = "Gravitokinetic Bipotential SADS-" + viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + desc = "If left untreated death will occur." + severity = DISEASE_SEVERITY_BIOHAZARD + +/datum/disease/fake_gbs/stage_act() + ..() + switch(stage) + if(2) + if(prob(1)) + affected_mob.emote("sneeze") + if(3) + if(prob(5)) + affected_mob.emote("cough") + else if(prob(5)) + affected_mob.emote("gasp") + if(prob(10)) + to_chat(affected_mob, "You're starting to feel very weak...") + if(4) + if(prob(10)) + affected_mob.emote("cough") + + if(5) + if(prob(10)) + affected_mob.emote("cough") diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index c51d34aa..4fc646a5 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -1,54 +1,54 @@ -/datum/disease/flu - name = "The Flu" - max_stages = 3 - spread_text = "Airborne" - cure_text = "Spaceacillin" - cures = list("spaceacillin") - cure_chance = 10 - agent = "H13N1 flu virion" - viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - permeability_mod = 0.75 - desc = "If left untreated the subject will feel quite unwell." - severity = DISEASE_SEVERITY_MINOR - -/datum/disease/flu/stage_act() - ..() - switch(stage) - if(2) - if(affected_mob.lying && prob(20)) - to_chat(affected_mob, "You feel better.") - stage-- - return - if(prob(1)) - affected_mob.emote("sneeze") - if(prob(1)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your muscles ache.") - if(prob(20)) - affected_mob.take_bodypart_damage(1) - if(prob(1)) - to_chat(affected_mob, "Your stomach hurts.") - if(prob(20)) - affected_mob.adjustToxLoss(1) - affected_mob.updatehealth() - - if(3) - if(affected_mob.lying && prob(15)) - to_chat(affected_mob, "You feel better.") - stage-- - return - if(prob(1)) - affected_mob.emote("sneeze") - if(prob(1)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "Your muscles ache.") - if(prob(20)) - affected_mob.take_bodypart_damage(1) - if(prob(1)) - to_chat(affected_mob, "Your stomach hurts.") - if(prob(20)) - affected_mob.adjustToxLoss(1) - affected_mob.updatehealth() - return +/datum/disease/flu + name = "The Flu" + max_stages = 3 + spread_text = "Airborne" + cure_text = "Spaceacillin" + cures = list(/datum/reagent/medicine/spaceacillin) + cure_chance = 10 + agent = "H13N1 flu virion" + viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + permeability_mod = 0.75 + desc = "If left untreated the subject will feel quite unwell." + severity = DISEASE_SEVERITY_MINOR + +/datum/disease/flu/stage_act() + ..() + switch(stage) + if(2) + if(affected_mob.lying && prob(20)) + to_chat(affected_mob, "You feel better.") + stage-- + return + if(prob(1)) + affected_mob.emote("sneeze") + if(prob(1)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your muscles ache.") + if(prob(20)) + affected_mob.take_bodypart_damage(1) + if(prob(1)) + to_chat(affected_mob, "Your stomach hurts.") + if(prob(20)) + affected_mob.adjustToxLoss(1) + affected_mob.updatehealth() + + if(3) + if(affected_mob.lying && prob(15)) + to_chat(affected_mob, "You feel better.") + stage-- + return + if(prob(1)) + affected_mob.emote("sneeze") + if(prob(1)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "Your muscles ache.") + if(prob(20)) + affected_mob.take_bodypart_damage(1) + if(prob(1)) + to_chat(affected_mob, "Your stomach hurts.") + if(prob(20)) + affected_mob.adjustToxLoss(1) + affected_mob.updatehealth() + return diff --git a/code/datums/diseases/fluspanish.dm b/code/datums/diseases/fluspanish.dm index 2258f84d..1557ddfb 100644 --- a/code/datums/diseases/fluspanish.dm +++ b/code/datums/diseases/fluspanish.dm @@ -1,36 +1,36 @@ -/datum/disease/fluspanish - name = "Spanish inquisition Flu" - max_stages = 3 - spread_text = "Airborne" - cure_text = "Spaceacillin & Anti-bodies to the common flu" - cures = list("spaceacillin") - cure_chance = 10 - agent = "1nqu1s1t10n flu virion" - viable_mobtypes = list(/mob/living/carbon/human) - permeability_mod = 0.75 - desc = "If left untreated the subject will burn to death for being a heretic." - severity = DISEASE_SEVERITY_DANGEROUS - -/datum/disease/fluspanish/stage_act() - ..() - switch(stage) - if(2) - affected_mob.adjust_bodytemperature(10) - if(prob(5)) - affected_mob.emote("sneeze") - if(prob(5)) - affected_mob.emote("cough") - if(prob(1)) - to_chat(affected_mob, "You're burning in your own skin!") - affected_mob.take_bodypart_damage(0,5) - - if(3) - affected_mob.adjust_bodytemperature(20) - if(prob(5)) - affected_mob.emote("sneeze") - if(prob(5)) - affected_mob.emote("cough") - if(prob(5)) - to_chat(affected_mob, "You're burning in your own skin!") - affected_mob.take_bodypart_damage(0,5) - return +/datum/disease/fluspanish + name = "Spanish inquisition Flu" + max_stages = 3 + spread_text = "Airborne" + cure_text = "Spaceacillin & Anti-bodies to the common flu" + cures = list(/datum/reagent/medicine/spaceacillin) + cure_chance = 10 + agent = "1nqu1s1t10n flu virion" + viable_mobtypes = list(/mob/living/carbon/human) + permeability_mod = 0.75 + desc = "If left untreated the subject will burn to death for being a heretic." + severity = DISEASE_SEVERITY_DANGEROUS + +/datum/disease/fluspanish/stage_act() + ..() + switch(stage) + if(2) + affected_mob.adjust_bodytemperature(10) + if(prob(5)) + affected_mob.emote("sneeze") + if(prob(5)) + affected_mob.emote("cough") + if(prob(1)) + to_chat(affected_mob, "You're burning in your own skin!") + affected_mob.take_bodypart_damage(0,5) + + if(3) + affected_mob.adjust_bodytemperature(20) + if(prob(5)) + affected_mob.emote("sneeze") + if(prob(5)) + affected_mob.emote("cough") + if(prob(5)) + to_chat(affected_mob, "You're burning in your own skin!") + affected_mob.take_bodypart_damage(0,5) + return diff --git a/code/datums/diseases/gbs.dm b/code/datums/diseases/gbs.dm index 679d0dee..8a6eab60 100644 --- a/code/datums/diseases/gbs.dm +++ b/code/datums/diseases/gbs.dm @@ -1,31 +1,31 @@ -/datum/disease/gbs - name = "GBS" - max_stages = 4 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Synaptizine & Sulfur" - cures = list("synaptizine","sulfur") - cure_chance = 15//higher chance to cure, since two reagents are required - agent = "Gravitokinetic Bipotential SADS+" - viable_mobtypes = list(/mob/living/carbon/human) - disease_flags = CAN_CARRY|CAN_RESIST|CURABLE - permeability_mod = 1 - severity = DISEASE_SEVERITY_BIOHAZARD - -/datum/disease/gbs/stage_act() - ..() - switch(stage) - if(2) - if(prob(5)) - affected_mob.emote("cough") - if(3) - if(prob(5)) - affected_mob.emote("gasp") - if(prob(10)) - to_chat(affected_mob, "Your body hurts all over!") - if(4) - to_chat(affected_mob, "Your body feels as if it's trying to rip itself apart!") - if(prob(50)) - affected_mob.gib() - else - return +/datum/disease/gbs + name = "GBS" + max_stages = 4 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Synaptizine & Sulfur" + cures = list(/datum/reagent/medicine/synaptizine,/datum/reagent/sulfur) + cure_chance = 15//higher chance to cure, since two reagents are required + agent = "Gravitokinetic Bipotential SADS+" + viable_mobtypes = list(/mob/living/carbon/human) + disease_flags = CAN_CARRY|CAN_RESIST|CURABLE + permeability_mod = 1 + severity = DISEASE_SEVERITY_BIOHAZARD + +/datum/disease/gbs/stage_act() + ..() + switch(stage) + if(2) + if(prob(5)) + affected_mob.emote("cough") + if(3) + if(prob(5)) + affected_mob.emote("gasp") + if(prob(10)) + to_chat(affected_mob, "Your body hurts all over!") + if(4) + to_chat(affected_mob, "Your body feels as if it's trying to rip itself apart!") + if(prob(50)) + affected_mob.gib() + else + return diff --git a/code/datums/diseases/heart_failure.dm b/code/datums/diseases/heart_failure.dm index 2389052a..196cd95f 100644 --- a/code/datums/diseases/heart_failure.dm +++ b/code/datums/diseases/heart_failure.dm @@ -58,7 +58,7 @@ H.visible_message("[H] clutches at [H.p_their()] chest as if [H.p_their()] heart is stopping!") H.adjustStaminaLoss(60) H.set_heartattack(TRUE) - H.reagents.add_reagent("corazone", 3) // To give the victim a final chance to shock their heart before losing consciousness + H.reagents.add_reagent(/datum/reagent/medicine/corazone, 3) // To give the victim a final chance to shock their heart before losing consciousness cure() else diff --git a/code/datums/diseases/magnitis.dm b/code/datums/diseases/magnitis.dm index bd05f151..cb00f571 100644 --- a/code/datums/diseases/magnitis.dm +++ b/code/datums/diseases/magnitis.dm @@ -1,68 +1,68 @@ -/datum/disease/magnitis - name = "Magnitis" - max_stages = 4 - spread_text = "Airborne" - cure_text = "Iron" - cures = list("iron") - agent = "Fukkos Miracos" - viable_mobtypes = list(/mob/living/carbon/human) - disease_flags = CAN_CARRY|CAN_RESIST|CURABLE - permeability_mod = 0.75 - desc = "This disease disrupts the magnetic field of your body, making it act as if a powerful magnet. Injections of iron help stabilize the field." - severity = DISEASE_SEVERITY_MEDIUM - infectable_biotypes = list(MOB_ORGANIC, MOB_ROBOTIC) - process_dead = TRUE - -/datum/disease/magnitis/stage_act() - ..() - switch(stage) - if(2) - if(prob(2)) - to_chat(affected_mob, "You feel a slight shock course through your body.") - if(prob(2)) - for(var/obj/M in orange(2,affected_mob)) - if(!M.anchored && (M.flags_1 & CONDUCT_1)) - step_towards(M,affected_mob) - for(var/mob/living/silicon/S in orange(2,affected_mob)) - if(isAI(S)) - continue - step_towards(S,affected_mob) - if(3) - if(prob(2)) - to_chat(affected_mob, "You feel a strong shock course through your body.") - if(prob(2)) - to_chat(affected_mob, "You feel like clowning around.") - if(prob(4)) - for(var/obj/M in orange(4,affected_mob)) - if(!M.anchored && (M.flags_1 & CONDUCT_1)) - var/i - var/iter = rand(1,2) - for(i=0,iYou feel a powerful shock course through your body.") - if(prob(2)) - to_chat(affected_mob, "You query upon the nature of miracles.") - if(prob(8)) - for(var/obj/M in orange(6,affected_mob)) - if(!M.anchored && (M.flags_1 & CONDUCT_1)) - var/i - var/iter = rand(1,3) - for(i=0,iYou feel a slight shock course through your body.") + if(prob(2)) + for(var/obj/M in orange(2,affected_mob)) + if(!M.anchored && (M.flags_1 & CONDUCT_1)) + step_towards(M,affected_mob) + for(var/mob/living/silicon/S in orange(2,affected_mob)) + if(isAI(S)) + continue + step_towards(S,affected_mob) + if(3) + if(prob(2)) + to_chat(affected_mob, "You feel a strong shock course through your body.") + if(prob(2)) + to_chat(affected_mob, "You feel like clowning around.") + if(prob(4)) + for(var/obj/M in orange(4,affected_mob)) + if(!M.anchored && (M.flags_1 & CONDUCT_1)) + var/i + var/iter = rand(1,2) + for(i=0,iYou feel a powerful shock course through your body.") + if(prob(2)) + to_chat(affected_mob, "You query upon the nature of miracles.") + if(prob(8)) + for(var/obj/M in orange(6,affected_mob)) + if(!M.anchored && (M.flags_1 & CONDUCT_1)) + var/i + var/iter = rand(1,3) + for(i=0,iYou feel a little silly.") - if(2) - if(prob(10)) - to_chat(affected_mob, "You start seeing rainbows.") - if(3) - if(prob(10)) - to_chat(affected_mob, "Your thoughts are interrupted by a loud HONK!") - if(4) - if(prob(5)) - affected_mob.say( pick( list("HONK!", "Honk!", "Honk.", "Honk?", "Honk!!", "Honk?!", "Honk...") ) , forced = "pierrot's throat") - -/datum/disease/pierrot_throat/after_add() - RegisterSignal(affected_mob, COMSIG_MOB_SAY, .proc/handle_speech) - -/datum/disease/pierrot_throat/proc/handle_speech(datum/source, list/speech_args) - var/message = speech_args[SPEECH_MESSAGE] - var/list/split_message = splittext(message, " ") //List each word in the message - var/applied = 0 - for (var/i in 1 to length(split_message)) - if(prob(3 * stage)) //Stage 1: 3% Stage 2: 6% Stage 3: 9% Stage 4: 12% - if(findtext(split_message[i], "*") || findtext(split_message[i], ";") || findtext(split_message[i], ":")) - continue - split_message[i] = "HONK" - if (applied++ > stage) - break - if (applied) - speech_args[SPEECH_SPANS] |= SPAN_CLOWN // a little bonus - message = jointext(split_message, " ") - speech_args[SPEECH_MESSAGE] = message - -/datum/disease/pierrot_throat/Destroy() - UnregisterSignal(affected_mob, COMSIG_MOB_SAY) - return ..() - -/datum/disease/pierrot_throat/remove_disease() - UnregisterSignal(affected_mob, COMSIG_MOB_SAY) +/datum/disease/pierrot_throat + name = "Pierrot's Throat" + max_stages = 4 + spread_text = "Airborne" + cure_text = "Banana products, especially banana bread." + cures = list(/datum/reagent/consumable/banana) + cure_chance = 75 + agent = "H0NI<42 Virus" + viable_mobtypes = list(/mob/living/carbon/human) + permeability_mod = 0.75 + desc = "If left untreated the subject will probably drive others to insanity." + severity = DISEASE_SEVERITY_MEDIUM + +/datum/disease/pierrot_throat/stage_act() + ..() + switch(stage) + if(1) + if(prob(10)) + to_chat(affected_mob, "You feel a little silly.") + if(2) + if(prob(10)) + to_chat(affected_mob, "You start seeing rainbows.") + if(3) + if(prob(10)) + to_chat(affected_mob, "Your thoughts are interrupted by a loud HONK!") + if(4) + if(prob(5)) + affected_mob.say( pick( list("HONK!", "Honk!", "Honk.", "Honk?", "Honk!!", "Honk?!", "Honk...") ) , forced = "pierrot's throat") + +/datum/disease/pierrot_throat/after_add() + RegisterSignal(affected_mob, COMSIG_MOB_SAY, .proc/handle_speech) + +/datum/disease/pierrot_throat/proc/handle_speech(datum/source, list/speech_args) + var/message = speech_args[SPEECH_MESSAGE] + var/list/split_message = splittext(message, " ") //List each word in the message + var/applied = 0 + for (var/i in 1 to length(split_message)) + if(prob(3 * stage)) //Stage 1: 3% Stage 2: 6% Stage 3: 9% Stage 4: 12% + if(findtext(split_message[i], "*") || findtext(split_message[i], ";") || findtext(split_message[i], ":")) + continue + split_message[i] = "HONK" + if (applied++ > stage) + break + if (applied) + speech_args[SPEECH_SPANS] |= SPAN_CLOWN // a little bonus + message = jointext(split_message, " ") + speech_args[SPEECH_MESSAGE] = message + +/datum/disease/pierrot_throat/Destroy() + UnregisterSignal(affected_mob, COMSIG_MOB_SAY) + return ..() + +/datum/disease/pierrot_throat/remove_disease() + UnregisterSignal(affected_mob, COMSIG_MOB_SAY) return ..() \ No newline at end of file diff --git a/code/datums/diseases/retrovirus.dm b/code/datums/diseases/retrovirus.dm index 0d62e8b0..5854249e 100644 --- a/code/datums/diseases/retrovirus.dm +++ b/code/datums/diseases/retrovirus.dm @@ -1,84 +1,84 @@ -/datum/disease/dna_retrovirus - name = "Retrovirus" - max_stages = 4 - spread_text = "Contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Rest or an injection of mutadone" - cure_chance = 6 - agent = "" - viable_mobtypes = list(/mob/living/carbon/human) - desc = "A DNA-altering retrovirus that scrambles the structural and unique enzymes of a host constantly." - severity = DISEASE_SEVERITY_HARMFUL - permeability_mod = 0.4 - stage_prob = 2 - var/restcure = 0 - -/datum/disease/dna_retrovirus/New() - ..() - agent = "Virus class [pick("A","B","C","D","E","F")][pick("A","B","C","D","E","F")]-[rand(50,300)]" - if(prob(40)) - cures = list("mutadone") - else - restcure = 1 - -/datum/disease/dna_retrovirus/Copy() - var/datum/disease/dna_retrovirus/D = ..() - D.restcure = restcure - return D - -/datum/disease/dna_retrovirus/stage_act() - ..() - switch(stage) - if(1) - if(restcure) - if(affected_mob.lying && prob(30)) - to_chat(affected_mob, "You feel better.") - cure() - return - if (prob(8)) - to_chat(affected_mob, "Your head hurts.") - if (prob(9)) - to_chat(affected_mob, "You feel a tingling sensation in your chest.") - if (prob(9)) - to_chat(affected_mob, "You feel angry.") - if(2) - if(restcure) - if(affected_mob.lying && prob(20)) - to_chat(affected_mob, "You feel better.") - cure() - return - if (prob(8)) - to_chat(affected_mob, "Your skin feels loose.") - if (prob(10)) - to_chat(affected_mob, "You feel very strange.") - if (prob(4)) - to_chat(affected_mob, "You feel a stabbing pain in your head!") - affected_mob.Unconscious(40) - if (prob(4)) - to_chat(affected_mob, "Your stomach churns.") - if(3) - if(restcure) - if(affected_mob.lying && prob(20)) - to_chat(affected_mob, "You feel better.") - cure() - return - if (prob(10)) - to_chat(affected_mob, "Your entire body vibrates.") - - if (prob(35)) - if(prob(50)) - scramble_dna(affected_mob, 1, 0, rand(15,45)) - else - scramble_dna(affected_mob, 0, 1, rand(15,45)) - - if(4) - if(restcure) - if(affected_mob.lying && prob(5)) - to_chat(affected_mob, "You feel better.") - cure() - return - if (prob(60)) - if(prob(50)) - scramble_dna(affected_mob, 1, 0, rand(50,75)) - else +/datum/disease/dna_retrovirus + name = "Retrovirus" + max_stages = 4 + spread_text = "Contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Rest or an injection of mutadone" + cure_chance = 6 + agent = "" + viable_mobtypes = list(/mob/living/carbon/human) + desc = "A DNA-altering retrovirus that scrambles the structural and unique enzymes of a host constantly." + severity = DISEASE_SEVERITY_HARMFUL + permeability_mod = 0.4 + stage_prob = 2 + var/restcure = 0 + +/datum/disease/dna_retrovirus/New() + ..() + agent = "Virus class [pick("A","B","C","D","E","F")][pick("A","B","C","D","E","F")]-[rand(50,300)]" + if(prob(40)) + cures = list(/datum/reagent/medicine/mutadone) + else + restcure = 1 + +/datum/disease/dna_retrovirus/Copy() + var/datum/disease/dna_retrovirus/D = ..() + D.restcure = restcure + return D + +/datum/disease/dna_retrovirus/stage_act() + ..() + switch(stage) + if(1) + if(restcure) + if(affected_mob.lying && prob(30)) + to_chat(affected_mob, "You feel better.") + cure() + return + if (prob(8)) + to_chat(affected_mob, "Your head hurts.") + if (prob(9)) + to_chat(affected_mob, "You feel a tingling sensation in your chest.") + if (prob(9)) + to_chat(affected_mob, "You feel angry.") + if(2) + if(restcure) + if(affected_mob.lying && prob(20)) + to_chat(affected_mob, "You feel better.") + cure() + return + if (prob(8)) + to_chat(affected_mob, "Your skin feels loose.") + if (prob(10)) + to_chat(affected_mob, "You feel very strange.") + if (prob(4)) + to_chat(affected_mob, "You feel a stabbing pain in your head!") + affected_mob.Unconscious(40) + if (prob(4)) + to_chat(affected_mob, "Your stomach churns.") + if(3) + if(restcure) + if(affected_mob.lying && prob(20)) + to_chat(affected_mob, "You feel better.") + cure() + return + if (prob(10)) + to_chat(affected_mob, "Your entire body vibrates.") + + if (prob(35)) + if(prob(50)) + scramble_dna(affected_mob, 1, 0, rand(15,45)) + else + scramble_dna(affected_mob, 0, 1, rand(15,45)) + + if(4) + if(restcure) + if(affected_mob.lying && prob(5)) + to_chat(affected_mob, "You feel better.") + cure() + return + if (prob(60)) + if(prob(50)) + scramble_dna(affected_mob, 1, 0, rand(50,75)) + else scramble_dna(affected_mob, 0, 1, rand(50,75)) \ No newline at end of file diff --git a/code/datums/diseases/rhumba_beat.dm b/code/datums/diseases/rhumba_beat.dm index de9b66f2..da6e7da8 100644 --- a/code/datums/diseases/rhumba_beat.dm +++ b/code/datums/diseases/rhumba_beat.dm @@ -1,45 +1,45 @@ -/datum/disease/rhumba_beat - name = "The Rhumba Beat" - max_stages = 5 - spread_text = "On contact" - spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS - cure_text = "Chick Chicky Boom!" - cures = list("plasma") - agent = "Unknown" - viable_mobtypes = list(/mob/living/carbon/human) - permeability_mod = 1 - severity = DISEASE_SEVERITY_BIOHAZARD - -/datum/disease/rhumba_beat/stage_act() - ..() - if(affected_mob.ckey == "rosham") - cure() - return - switch(stage) - if(2) - if(prob(45)) - affected_mob.adjustFireLoss(5) - affected_mob.updatehealth() - if(prob(1)) - to_chat(affected_mob, "You feel strange...") - if(3) - if(prob(5)) - to_chat(affected_mob, "You feel the urge to dance...") - else if(prob(5)) - affected_mob.emote("gasp") - else if(prob(10)) - to_chat(affected_mob, "You feel the need to chick chicky boom...") - if(4) - if(prob(20)) - if (prob(50)) - affected_mob.adjust_fire_stacks(2) - affected_mob.IgniteMob() - else - affected_mob.emote("gasp") - to_chat(affected_mob, "You feel a burning beat inside...") - if(5) - to_chat(affected_mob, "Your body is unable to contain the Rhumba Beat...") - if(prob(50)) - explosion(get_turf(affected_mob), -1, 0, 2, 3, 0, 2) // This is equivalent to a lvl 1 fireball - else - return +/datum/disease/rhumba_beat + name = "The Rhumba Beat" + max_stages = 5 + spread_text = "On contact" + spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS + cure_text = "Chick Chicky Boom!" + cures = list(/datum/reagent/toxin/plasma) + agent = "Unknown" + viable_mobtypes = list(/mob/living/carbon/human) + permeability_mod = 1 + severity = DISEASE_SEVERITY_BIOHAZARD + +/datum/disease/rhumba_beat/stage_act() + ..() + if(affected_mob.ckey == "rosham") + cure() + return + switch(stage) + if(2) + if(prob(45)) + affected_mob.adjustFireLoss(5) + affected_mob.updatehealth() + if(prob(1)) + to_chat(affected_mob, "You feel strange...") + if(3) + if(prob(5)) + to_chat(affected_mob, "You feel the urge to dance...") + else if(prob(5)) + affected_mob.emote("gasp") + else if(prob(10)) + to_chat(affected_mob, "You feel the need to chick chicky boom...") + if(4) + if(prob(20)) + if (prob(50)) + affected_mob.adjust_fire_stacks(2) + affected_mob.IgniteMob() + else + affected_mob.emote("gasp") + to_chat(affected_mob, "You feel a burning beat inside...") + if(5) + to_chat(affected_mob, "Your body is unable to contain the Rhumba Beat...") + if(prob(50)) + explosion(get_turf(affected_mob), -1, 0, 2, 3, 0, 2) // This is equivalent to a lvl 1 fireball + else + return diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 292f93aa..26bc7897 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -1,327 +1,327 @@ -/datum/disease/transformation - name = "Transformation" - max_stages = 5 - spread_text = "Acute" - spread_flags = DISEASE_SPREAD_SPECIAL - cure_text = "A coder's love (theoretical)." - agent = "Shenanigans" - viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey, /mob/living/carbon/alien) - severity = DISEASE_SEVERITY_BIOHAZARD - stage_prob = 10 - visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC - disease_flags = CURABLE - var/list/stage1 = list("You feel unremarkable.") - var/list/stage2 = list("You feel boring.") - var/list/stage3 = list("You feel utterly plain.") - var/list/stage4 = list("You feel white bread.") - var/list/stage5 = list("Oh the humanity!") - var/new_form = /mob/living/carbon/human - var/bantype - -/datum/disease/transformation/Copy() - var/datum/disease/transformation/D = ..() - D.stage1 = stage1?.Copy() - D.stage2 = stage2?.Copy() - D.stage3 = stage3?.Copy() - D.stage4 = stage4?.Copy() - D.stage5 = stage5?.Copy() - D.new_form = D.new_form - return D - -/datum/disease/transformation/stage_act() - ..() - switch(stage) - if(1) - if (prob(stage_prob) && stage1) - to_chat(affected_mob, pick(stage1)) - if(2) - if (prob(stage_prob) && stage2) - to_chat(affected_mob, pick(stage2)) - if(3) - if (prob(stage_prob*2) && stage3) - to_chat(affected_mob, pick(stage3)) - if(4) - if (prob(stage_prob*2) && stage4) - to_chat(affected_mob, pick(stage4)) - if(5) - do_disease_transformation(affected_mob) - -/datum/disease/transformation/proc/do_disease_transformation(mob/living/affected_mob) - if(istype(affected_mob, /mob/living/carbon) && affected_mob.stat != DEAD) - if(stage5) - to_chat(affected_mob, pick(stage5)) - if(QDELETED(affected_mob)) - return - if(affected_mob.notransform) - return - affected_mob.notransform = 1 - for(var/obj/item/W in affected_mob.get_equipped_items(TRUE)) - affected_mob.dropItemToGround(W) - for(var/obj/item/I in affected_mob.held_items) - affected_mob.dropItemToGround(I) - var/mob/living/new_mob = new new_form(affected_mob.loc) - if(istype(new_mob)) - if(bantype && jobban_isbanned(affected_mob, bantype)) - replace_banned_player(new_mob) - new_mob.a_intent = INTENT_HARM - if(affected_mob.mind) - affected_mob.mind.transfer_to(new_mob) - else - new_mob.key = affected_mob.key - - new_mob.name = affected_mob.real_name - new_mob.real_name = new_mob.name - qdel(affected_mob) - -/datum/disease/transformation/proc/replace_banned_player(var/mob/living/new_mob) // This can run well after the mob has been transferred, so need a handle on the new mob to kill it if needed. - set waitfor = FALSE - - var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [affected_mob.name]?", bantype, null, bantype, 50, affected_mob) - if(LAZYLEN(candidates)) - var/mob/dead/observer/C = pick(candidates) - to_chat(affected_mob, "Your mob has been taken over by a ghost! Appeal your job ban if you want to avoid this in the future!") - message_admins("[key_name_admin(C)] has taken control of ([key_name_admin(affected_mob)]) to replace a jobbaned player.") - affected_mob.ghostize(0) - affected_mob.key = C.key - else - to_chat(new_mob, "Your mob has been claimed by death! Appeal your job ban if you want to avoid this in the future!") - new_mob.death() - if (!QDELETED(new_mob)) - new_mob.ghostize(can_reenter_corpse = FALSE) - new_mob.key = null - -/datum/disease/transformation/jungle_fever - name = "Jungle Fever" - cure_text = "Death." - cures = list("adminordrazine") - spread_text = "Monkey Bites" - spread_flags = DISEASE_SPREAD_SPECIAL - viable_mobtypes = list(/mob/living/carbon/monkey, /mob/living/carbon/human) - permeability_mod = 1 - cure_chance = 1 - disease_flags = CAN_CARRY|CAN_RESIST - desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey." - severity = DISEASE_SEVERITY_BIOHAZARD - stage_prob = 4 - visibility_flags = 0 - agent = "Kongey Vibrion M-909" - new_form = /mob/living/carbon/monkey - bantype = ROLE_MONKEY - - - stage1 = list() - stage2 = list() - stage3 = list() - stage4 = list("Your back hurts.", "You breathe through your mouth.", - "You have a craving for bananas.", "Your mind feels clouded.") - stage5 = list("You feel like monkeying around.") - -/datum/disease/transformation/jungle_fever/do_disease_transformation(mob/living/carbon/affected_mob) - if(affected_mob.mind && !is_monkey(affected_mob.mind)) - add_monkey(affected_mob.mind) - if(ishuman(affected_mob)) - var/mob/living/carbon/monkey/M = affected_mob.monkeyize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSE) - M.ventcrawler = VENTCRAWLER_ALWAYS - - -/datum/disease/transformation/jungle_fever/stage_act() - ..() - switch(stage) - if(2) - if(prob(2)) - to_chat(affected_mob, "Your [pick("back", "arm", "leg", "elbow", "head")] itches.") - if(3) - if(prob(4)) - to_chat(affected_mob, "You feel a stabbing pain in your head.") - affected_mob.confused += 10 - if(4) - if(prob(3)) - affected_mob.say(pick("Eeek, ook ook!", "Eee-eeek!", "Eeee!", "Ungh, ungh."), forced = "jungle fever") - -/datum/disease/transformation/jungle_fever/cure() - remove_monkey(affected_mob.mind) - ..() - -/datum/disease/transformation/jungle_fever/monkeymode - visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC - disease_flags = CAN_CARRY //no vaccines! no cure! - -/datum/disease/transformation/jungle_fever/monkeymode/after_add() - if(affected_mob && !is_monkey_leader(affected_mob.mind)) - visibility_flags = NONE - - - -/datum/disease/transformation/robot - - name = "Robotic Transformation" - cure_text = "An injection of copper." - cures = list("copper") - cure_chance = 5 - agent = "R2D2 Nanomachines" - desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg." - severity = DISEASE_SEVERITY_BIOHAZARD - visibility_flags = 0 - stage1 = list() - stage2 = list("Your joints feel stiff.", "Beep...boop..") - stage3 = list("Your joints feel very stiff.", "Your skin feels loose.", "You can feel something move...inside.") - stage4 = list("Your skin feels very loose.", "You can feel... something...inside you.") - stage5 = list("Your skin feels as if it's about to burst off!") - new_form = /mob/living/silicon/robot - infectable_biotypes = list(MOB_ORGANIC, MOB_UNDEAD, MOB_ROBOTIC) - bantype = "Cyborg" - -/datum/disease/transformation/robot/stage_act() - ..() - switch(stage) - if(3) - if (prob(8)) - affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"), forced = "robotic transformation") - if (prob(4)) - to_chat(affected_mob, "You feel a stabbing pain in your head.") - affected_mob.Unconscious(40) - if(4) - if (prob(20)) - affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."), forced = "robotic transformation") - - -/datum/disease/transformation/xeno - - name = "Xenomorph Transformation" - cure_text = "Spaceacillin & Glycerol" - cures = list("spaceacillin", "glycerol") - cure_chance = 5 - agent = "Rip-LEY Alien Microbes" - desc = "This disease changes the victim into a xenomorph." - severity = DISEASE_SEVERITY_BIOHAZARD - visibility_flags = 0 - stage1 = list() - stage2 = list("Your throat feels scratchy.", "Kill...") - stage3 = list("Your throat feels very scratchy.", "Your skin feels tight.", "You can feel something move...inside.") - stage4 = list("Your skin feels very tight.", "Your blood boils!", "You can feel... something...inside you.") - stage5 = list("Your skin feels as if it's about to burst off!") - new_form = /mob/living/carbon/alien/humanoid/hunter - bantype = ROLE_ALIEN - -/datum/disease/transformation/xeno/stage_act() - ..() - switch(stage) - if(3) - if (prob(4)) - to_chat(affected_mob, "You feel a stabbing pain in your head.") - affected_mob.Unconscious(40) - if(4) - if (prob(20)) - affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"), forced = "xenomorph transformation") - - -/datum/disease/transformation/slime - name = "Advanced Mutation Transformation" - cure_text = "frost oil" - cures = list("frostoil") - cure_chance = 80 - agent = "Advanced Mutation Toxin" - desc = "This highly concentrated extract converts anything into more of itself." - severity = DISEASE_SEVERITY_BIOHAZARD - visibility_flags = 0 - stage1 = list("You don't feel very well.") - stage2 = list("Your skin feels a little slimy.") - stage3 = list("Your appendages are melting away.", "Your limbs begin to lose their shape.") - stage4 = list("You are turning into a slime.") - stage5 = list("You have become a slime.") - new_form = /mob/living/simple_animal/slime/random - -/datum/disease/transformation/slime/stage_act() - ..() - switch(stage) - if(1) - if(ishuman(affected_mob) && affected_mob.dna) - if(affected_mob.dna.species.id == "slime" || affected_mob.dna.species.id == "stargazer" || affected_mob.dna.species.id == "lum") - stage = 5 - if(3) - if(ishuman(affected_mob)) - var/mob/living/carbon/human/human = affected_mob - if(human.dna.species.id != "slime" && affected_mob.dna.species.id != "stargazer" && affected_mob.dna.species.id != "lum") - human.set_species(/datum/species/jelly/slime) - -/datum/disease/transformation/corgi - name = "The Barkening" - cure_text = "Death" - cures = list("adminordrazine") - agent = "Fell Doge Majicks" - desc = "This disease transforms the victim into a corgi." - severity = DISEASE_SEVERITY_BIOHAZARD - visibility_flags = 0 - stage1 = list("BARK.") - stage2 = list("You feel the need to wear silly hats.") - stage3 = list("Must... eat... chocolate....", "YAP") - stage4 = list("Visions of washing machines assail your mind!") - stage5 = list("AUUUUUU!!!") - new_form = /mob/living/simple_animal/pet/dog/corgi - -/datum/disease/transformation/corgi/stage_act() - ..() - switch(stage) - if(3) - if (prob(8)) - affected_mob.say(pick("YAP", "Woof!"), forced = "corgi transformation") - if(4) - if (prob(20)) - affected_mob.say(pick("Bark!", "AUUUUUU"), forced = "corgi transformation") - -/datum/disease/transformation/morph - name = "Gluttony's Blessing" - cure_text = "nothing" - cures = list("adminordrazine") - agent = "Gluttony's Blessing" - desc = "A 'gift' from somewhere terrible." - stage_prob = 20 - severity = DISEASE_SEVERITY_BIOHAZARD - visibility_flags = 0 - stage1 = list("Your stomach rumbles.") - stage2 = list("Your skin feels saggy.") - stage3 = list("Your appendages are melting away.", "Your limbs begin to lose their shape.") - stage4 = list("You're ravenous.") - stage5 = list("You have become a morph.") - new_form = /mob/living/simple_animal/hostile/morph - infectable_biotypes = list(MOB_ORGANIC, MOB_INORGANIC, MOB_UNDEAD) //magic! - -/datum/disease/transformation/gondola - name = "Gondola Transformation" - cure_text = "Condensed Capsaicin, ingested or injected." //getting pepper sprayed doesn't help - cures = list("condensedcapsaicin") //beats the hippie crap right out of your system - cure_chance = 80 - stage_prob = 5 - agent = "Tranquility" - desc = "Consuming the flesh of a Gondola comes at a terrible price." - severity = DISEASE_SEVERITY_BIOHAZARD - visibility_flags = 0 - stage1 = list("You seem a little lighter in your step.") - stage2 = list("You catch yourself smiling for no reason.") - stage3 = list("A cruel sense of calm overcomes you.", "You can't feel your arms!", "You let go of the urge to hurt clowns.") - stage4 = list("You can't feel your arms. It does not bother you anymore.", "You forgive the clown for hurting you.") - stage5 = list("You have become a Gondola.") - new_form = /mob/living/simple_animal/pet/gondola - -/datum/disease/transformation/gondola/stage_act() - ..() - switch(stage) - if(2) - if (prob(5)) - affected_mob.emote("smile") - if (prob(20)) - affected_mob.reagents.add_reagent_list(list("pax" = 5)) - if(3) - if (prob(5)) - affected_mob.emote("smile") - if (prob(20)) - affected_mob.reagents.add_reagent_list(list("pax" = 5)) - if(4) - if (prob(5)) - affected_mob.emote("smile") - if (prob(20)) - affected_mob.reagents.add_reagent_list(list("pax" = 5)) - if (prob(2)) - to_chat(affected_mob, "You let go of what you were holding.") - var/obj/item/I = affected_mob.get_active_held_item() - affected_mob.dropItemToGround(I) +/datum/disease/transformation + name = "Transformation" + max_stages = 5 + spread_text = "Acute" + spread_flags = DISEASE_SPREAD_SPECIAL + cure_text = "A coder's love (theoretical)." + agent = "Shenanigans" + viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey, /mob/living/carbon/alien) + severity = DISEASE_SEVERITY_BIOHAZARD + stage_prob = 10 + visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC + disease_flags = CURABLE + var/list/stage1 = list("You feel unremarkable.") + var/list/stage2 = list("You feel boring.") + var/list/stage3 = list("You feel utterly plain.") + var/list/stage4 = list("You feel white bread.") + var/list/stage5 = list("Oh the humanity!") + var/new_form = /mob/living/carbon/human + var/bantype + +/datum/disease/transformation/Copy() + var/datum/disease/transformation/D = ..() + D.stage1 = stage1?.Copy() + D.stage2 = stage2?.Copy() + D.stage3 = stage3?.Copy() + D.stage4 = stage4?.Copy() + D.stage5 = stage5?.Copy() + D.new_form = D.new_form + return D + +/datum/disease/transformation/stage_act() + ..() + switch(stage) + if(1) + if (prob(stage_prob) && stage1) + to_chat(affected_mob, pick(stage1)) + if(2) + if (prob(stage_prob) && stage2) + to_chat(affected_mob, pick(stage2)) + if(3) + if (prob(stage_prob*2) && stage3) + to_chat(affected_mob, pick(stage3)) + if(4) + if (prob(stage_prob*2) && stage4) + to_chat(affected_mob, pick(stage4)) + if(5) + do_disease_transformation(affected_mob) + +/datum/disease/transformation/proc/do_disease_transformation(mob/living/affected_mob) + if(istype(affected_mob, /mob/living/carbon) && affected_mob.stat != DEAD) + if(stage5) + to_chat(affected_mob, pick(stage5)) + if(QDELETED(affected_mob)) + return + if(affected_mob.notransform) + return + affected_mob.notransform = 1 + for(var/obj/item/W in affected_mob.get_equipped_items(TRUE)) + affected_mob.dropItemToGround(W) + for(var/obj/item/I in affected_mob.held_items) + affected_mob.dropItemToGround(I) + var/mob/living/new_mob = new new_form(affected_mob.loc) + if(istype(new_mob)) + if(bantype && jobban_isbanned(affected_mob, bantype)) + replace_banned_player(new_mob) + new_mob.a_intent = INTENT_HARM + if(affected_mob.mind) + affected_mob.mind.transfer_to(new_mob) + else + new_mob.key = affected_mob.key + + new_mob.name = affected_mob.real_name + new_mob.real_name = new_mob.name + qdel(affected_mob) + +/datum/disease/transformation/proc/replace_banned_player(var/mob/living/new_mob) // This can run well after the mob has been transferred, so need a handle on the new mob to kill it if needed. + set waitfor = FALSE + + var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [affected_mob.name]?", bantype, null, bantype, 50, affected_mob) + if(LAZYLEN(candidates)) + var/mob/dead/observer/C = pick(candidates) + to_chat(affected_mob, "Your mob has been taken over by a ghost! Appeal your job ban if you want to avoid this in the future!") + message_admins("[key_name_admin(C)] has taken control of ([key_name_admin(affected_mob)]) to replace a jobbaned player.") + affected_mob.ghostize(0) + affected_mob.key = C.key + else + to_chat(new_mob, "Your mob has been claimed by death! Appeal your job ban if you want to avoid this in the future!") + new_mob.death() + if (!QDELETED(new_mob)) + new_mob.ghostize(can_reenter_corpse = FALSE) + new_mob.key = null + +/datum/disease/transformation/jungle_fever + name = "Jungle Fever" + cure_text = "Death." + cures = list(/datum/reagent/medicine/adminordrazine) + spread_text = "Monkey Bites" + spread_flags = DISEASE_SPREAD_SPECIAL + viable_mobtypes = list(/mob/living/carbon/monkey, /mob/living/carbon/human) + permeability_mod = 1 + cure_chance = 1 + disease_flags = CAN_CARRY|CAN_RESIST + desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey." + severity = DISEASE_SEVERITY_BIOHAZARD + stage_prob = 4 + visibility_flags = 0 + agent = "Kongey Vibrion M-909" + new_form = /mob/living/carbon/monkey + bantype = ROLE_MONKEY + + + stage1 = list() + stage2 = list() + stage3 = list() + stage4 = list("Your back hurts.", "You breathe through your mouth.", + "You have a craving for bananas.", "Your mind feels clouded.") + stage5 = list("You feel like monkeying around.") + +/datum/disease/transformation/jungle_fever/do_disease_transformation(mob/living/carbon/affected_mob) + if(affected_mob.mind && !is_monkey(affected_mob.mind)) + add_monkey(affected_mob.mind) + if(ishuman(affected_mob)) + var/mob/living/carbon/monkey/M = affected_mob.monkeyize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSE) + M.ventcrawler = VENTCRAWLER_ALWAYS + + +/datum/disease/transformation/jungle_fever/stage_act() + ..() + switch(stage) + if(2) + if(prob(2)) + to_chat(affected_mob, "Your [pick("back", "arm", "leg", "elbow", "head")] itches.") + if(3) + if(prob(4)) + to_chat(affected_mob, "You feel a stabbing pain in your head.") + affected_mob.confused += 10 + if(4) + if(prob(3)) + affected_mob.say(pick("Eeek, ook ook!", "Eee-eeek!", "Eeee!", "Ungh, ungh."), forced = "jungle fever") + +/datum/disease/transformation/jungle_fever/cure() + remove_monkey(affected_mob.mind) + ..() + +/datum/disease/transformation/jungle_fever/monkeymode + visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC + disease_flags = CAN_CARRY //no vaccines! no cure! + +/datum/disease/transformation/jungle_fever/monkeymode/after_add() + if(affected_mob && !is_monkey_leader(affected_mob.mind)) + visibility_flags = NONE + + + +/datum/disease/transformation/robot + + name = "Robotic Transformation" + cure_text = "An injection of copper." + cures = list(/datum/reagent/copper) + cure_chance = 5 + agent = "R2D2 Nanomachines" + desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg." + severity = DISEASE_SEVERITY_BIOHAZARD + visibility_flags = 0 + stage1 = list() + stage2 = list("Your joints feel stiff.", "Beep...boop..") + stage3 = list("Your joints feel very stiff.", "Your skin feels loose.", "You can feel something move...inside.") + stage4 = list("Your skin feels very loose.", "You can feel... something...inside you.") + stage5 = list("Your skin feels as if it's about to burst off!") + new_form = /mob/living/silicon/robot + infectable_biotypes = list(MOB_ORGANIC, MOB_UNDEAD, MOB_ROBOTIC) + bantype = "Cyborg" + +/datum/disease/transformation/robot/stage_act() + ..() + switch(stage) + if(3) + if (prob(8)) + affected_mob.say(pick("Beep, boop", "beep, beep!", "Boop...bop"), forced = "robotic transformation") + if (prob(4)) + to_chat(affected_mob, "You feel a stabbing pain in your head.") + affected_mob.Unconscious(40) + if(4) + if (prob(20)) + affected_mob.say(pick("beep, beep!", "Boop bop boop beep.", "kkkiiiill mmme", "I wwwaaannntt tttoo dddiiieeee..."), forced = "robotic transformation") + + +/datum/disease/transformation/xeno + + name = "Xenomorph Transformation" + cure_text = "Spaceacillin & Glycerol" + cures = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/glycerol) + cure_chance = 5 + agent = "Rip-LEY Alien Microbes" + desc = "This disease changes the victim into a xenomorph." + severity = DISEASE_SEVERITY_BIOHAZARD + visibility_flags = 0 + stage1 = list() + stage2 = list("Your throat feels scratchy.", "Kill...") + stage3 = list("Your throat feels very scratchy.", "Your skin feels tight.", "You can feel something move...inside.") + stage4 = list("Your skin feels very tight.", "Your blood boils!", "You can feel... something...inside you.") + stage5 = list("Your skin feels as if it's about to burst off!") + new_form = /mob/living/carbon/alien/humanoid/hunter + bantype = ROLE_ALIEN + +/datum/disease/transformation/xeno/stage_act() + ..() + switch(stage) + if(3) + if (prob(4)) + to_chat(affected_mob, "You feel a stabbing pain in your head.") + affected_mob.Unconscious(40) + if(4) + if (prob(20)) + affected_mob.say(pick("You look delicious.", "Going to... devour you...", "Hsssshhhhh!"), forced = "xenomorph transformation") + + +/datum/disease/transformation/slime + name = "Advanced Mutation Transformation" + cure_text = "frost oil" + cures = list(/datum/reagent/consumable/frostoil) + cure_chance = 80 + agent = "Advanced Mutation Toxin" + desc = "This highly concentrated extract converts anything into more of itself." + severity = DISEASE_SEVERITY_BIOHAZARD + visibility_flags = 0 + stage1 = list("You don't feel very well.") + stage2 = list("Your skin feels a little slimy.") + stage3 = list("Your appendages are melting away.", "Your limbs begin to lose their shape.") + stage4 = list("You are turning into a slime.") + stage5 = list("You have become a slime.") + new_form = /mob/living/simple_animal/slime/random + +/datum/disease/transformation/slime/stage_act() + ..() + switch(stage) + if(1) + if(ishuman(affected_mob) && affected_mob.dna) + if(affected_mob.dna.species.id == "slime" || affected_mob.dna.species.id == "stargazer" || affected_mob.dna.species.id == "lum") + stage = 5 + if(3) + if(ishuman(affected_mob)) + var/mob/living/carbon/human/human = affected_mob + if(human.dna.species.id != "slime" && affected_mob.dna.species.id != "stargazer" && affected_mob.dna.species.id != "lum") + human.set_species(/datum/species/jelly/slime) + +/datum/disease/transformation/corgi + name = "The Barkening" + cure_text = "Death" + cures = list(/datum/reagent/medicine/adminordrazine) + agent = "Fell Doge Majicks" + desc = "This disease transforms the victim into a corgi." + severity = DISEASE_SEVERITY_BIOHAZARD + visibility_flags = 0 + stage1 = list("BARK.") + stage2 = list("You feel the need to wear silly hats.") + stage3 = list("Must... eat... chocolate....", "YAP") + stage4 = list("Visions of washing machines assail your mind!") + stage5 = list("AUUUUUU!!!") + new_form = /mob/living/simple_animal/pet/dog/corgi + +/datum/disease/transformation/corgi/stage_act() + ..() + switch(stage) + if(3) + if (prob(8)) + affected_mob.say(pick("YAP", "Woof!"), forced = "corgi transformation") + if(4) + if (prob(20)) + affected_mob.say(pick("Bark!", "AUUUUUU"), forced = "corgi transformation") + +/datum/disease/transformation/morph + name = "Gluttony's Blessing" + cure_text = "nothing" + cures = list(/datum/reagent/medicine/adminordrazine) + agent = "Gluttony's Blessing" + desc = "A 'gift' from somewhere terrible." + stage_prob = 20 + severity = DISEASE_SEVERITY_BIOHAZARD + visibility_flags = 0 + stage1 = list("Your stomach rumbles.") + stage2 = list("Your skin feels saggy.") + stage3 = list("Your appendages are melting away.", "Your limbs begin to lose their shape.") + stage4 = list("You're ravenous.") + stage5 = list("You have become a morph.") + new_form = /mob/living/simple_animal/hostile/morph + infectable_biotypes = list(MOB_ORGANIC, MOB_INORGANIC, MOB_UNDEAD) //magic! + +/datum/disease/transformation/gondola + name = "Gondola Transformation" + cure_text = "Condensed Capsaicin, ingested or injected." //getting pepper sprayed doesn't help + cures = list(/datum/reagent/consumable/condensedcapsaicin) //beats the hippie crap right out of your system + cure_chance = 80 + stage_prob = 5 + agent = "Tranquility" + desc = "Consuming the flesh of a Gondola comes at a terrible price." + severity = DISEASE_SEVERITY_BIOHAZARD + visibility_flags = 0 + stage1 = list("You seem a little lighter in your step.") + stage2 = list("You catch yourself smiling for no reason.") + stage3 = list("A cruel sense of calm overcomes you.", "You can't feel your arms!", "You let go of the urge to hurt clowns.") + stage4 = list("You can't feel your arms. It does not bother you anymore.", "You forgive the clown for hurting you.") + stage5 = list("You have become a Gondola.") + new_form = /mob/living/simple_animal/pet/gondola + +/datum/disease/transformation/gondola/stage_act() + ..() + switch(stage) + if(2) + if (prob(5)) + affected_mob.emote("smile") + if (prob(20)) + affected_mob.reagents.add_reagent(/datum/reagent/pax, 5) + if(3) + if (prob(5)) + affected_mob.emote("smile") + if (prob(20)) + affected_mob.reagents.add_reagent(/datum/reagent/pax, 5) + if(4) + if (prob(5)) + affected_mob.emote("smile") + if (prob(20)) + affected_mob.reagents.add_reagent(/datum/reagent/pax, 5) + if (prob(2)) + to_chat(affected_mob, "You let go of what you were holding.") + var/obj/item/I = affected_mob.get_active_held_item() + affected_mob.dropItemToGround(I) diff --git a/code/datums/diseases/tuberculosis.dm b/code/datums/diseases/tuberculosis.dm index 788107c4..23902603 100644 --- a/code/datums/diseases/tuberculosis.dm +++ b/code/datums/diseases/tuberculosis.dm @@ -4,7 +4,7 @@ max_stages = 5 spread_text = "Airborne" cure_text = "Spaceacillin & salbutamol" - cures = list("spaceacillin", "salbutamol") + cures = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salbutamol) agent = "Fungal Tubercle bacillus Cosmosis" viable_mobtypes = list(/mob/living/carbon/human) cure_chance = 5//like hell are you getting out of hell diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index 69bf1557..244cc819 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -1,117 +1,117 @@ -/datum/disease/wizarditis - name = "Wizarditis" - max_stages = 4 - spread_text = "Airborne" - cure_text = "The Manly Dorf" - cures = list("manlydorf") - cure_chance = 100 - agent = "Rincewindus Vulgaris" - viable_mobtypes = list(/mob/living/carbon/human) - disease_flags = CAN_CARRY|CAN_RESIST|CURABLE - permeability_mod = 0.75 - desc = "Some speculate that this virus is the cause of the Space Wizard Federation's existence. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition." - severity = DISEASE_SEVERITY_HARMFUL - required_organs = list(/obj/item/bodypart/head) - -/* -BIRUZ BENNAR -SCYAR NILA - teleport -NEC CANTIO - dis techno -EI NATH - shocking grasp -AULIE OXIN FIERA - knock -TARCOL MINTI ZHERI - forcewall -STI KALY - blind -*/ - -/datum/disease/wizarditis/stage_act() - ..() - - switch(stage) - if(2) - if(prob(1)&&prob(50)) - affected_mob.say(pick("You shall not pass!", "Expeliarmus!", "By Merlins beard!", "Feel the power of the Dark Side!"), forced = "wizarditis") - if(prob(1)&&prob(50)) - to_chat(affected_mob, "You feel [pick("that you don't have enough mana", "that the winds of magic are gone", "an urge to summon familiar")].") - - - if(3) - if(prob(1)&&prob(50)) - affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!", "STI KALY!", "TARCOL MINTI ZHERI!"), forced = "wizarditis") - if(prob(1)&&prob(50)) - to_chat(affected_mob, "You feel [pick("the magic bubbling in your veins","that this location gives you a +1 to INT","an urge to summon familiar")].") - - if(4) - - if(prob(1)) - affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!","STI KALY!","EI NATH!"), forced = "wizarditis") - return - if(prob(1)&&prob(50)) - to_chat(affected_mob, "You feel [pick("the tidal wave of raw power building inside","that this location gives you a +2 to INT and +1 to WIS","an urge to teleport")].") - spawn_wizard_clothes(50) - if(prob(1)&&prob(1)) - teleport() - return - - - -/datum/disease/wizarditis/proc/spawn_wizard_clothes(chance = 0) - if(ishuman(affected_mob)) - var/mob/living/carbon/human/H = affected_mob - if(prob(chance)) - if(!istype(H.head, /obj/item/clothing/head/wizard)) - if(!H.dropItemToGround(H.head)) - qdel(H.head) - H.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(H), SLOT_HEAD) - return - if(prob(chance)) - if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) - if(!H.dropItemToGround(H.wear_suit)) - qdel(H.wear_suit) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(H), SLOT_WEAR_SUIT) - return - if(prob(chance)) - if(!istype(H.shoes, /obj/item/clothing/shoes/sandal/magic)) - if(!H.dropItemToGround(H.shoes)) - qdel(H.shoes) - H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal/magic(H), SLOT_SHOES) - return - else - var/mob/living/carbon/H = affected_mob - if(prob(chance)) - var/obj/item/staff/S = new(H) - if(!H.put_in_hands(S)) - qdel(S) - - -/datum/disease/wizarditis/proc/teleport() - var/list/theareas = get_areas_in_range(80, affected_mob) - for(var/area/space/S in theareas) - theareas -= S - - if(!theareas||!theareas.len) - return - - var/area/thearea = pick(theareas) - - var/list/L = list() - for(var/turf/T in get_area_turfs(thearea.type)) - if(T.z != affected_mob.z) - continue - if(T.name == "space") - continue - if(!T.density) - var/clear = 1 - for(var/obj/O in T) - if(O.density) - clear = 0 - break - if(clear) - L+=T - - if(!L) - return - - affected_mob.say("SCYAR NILA [uppertext(thearea.name)]!", forced = "wizarditis teleport") - affected_mob.forceMove(pick(L)) - - return +/datum/disease/wizarditis + name = "Wizarditis" + max_stages = 4 + spread_text = "Airborne" + cure_text = "The Manly Dorf" + cures = list(/datum/reagent/consumable/ethanol/manly_dorf) + cure_chance = 100 + agent = "Rincewindus Vulgaris" + viable_mobtypes = list(/mob/living/carbon/human) + disease_flags = CAN_CARRY|CAN_RESIST|CURABLE + permeability_mod = 0.75 + desc = "Some speculate that this virus is the cause of the Space Wizard Federation's existence. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition." + severity = DISEASE_SEVERITY_HARMFUL + required_organs = list(/obj/item/bodypart/head) + +/* +BIRUZ BENNAR +SCYAR NILA - teleport +NEC CANTIO - dis techno +EI NATH - shocking grasp +AULIE OXIN FIERA - knock +TARCOL MINTI ZHERI - forcewall +STI KALY - blind +*/ + +/datum/disease/wizarditis/stage_act() + ..() + + switch(stage) + if(2) + if(prob(1)&&prob(50)) + affected_mob.say(pick("You shall not pass!", "Expeliarmus!", "By Merlins beard!", "Feel the power of the Dark Side!"), forced = "wizarditis") + if(prob(1)&&prob(50)) + to_chat(affected_mob, "You feel [pick("that you don't have enough mana", "that the winds of magic are gone", "an urge to summon familiar")].") + + + if(3) + if(prob(1)&&prob(50)) + affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!", "STI KALY!", "TARCOL MINTI ZHERI!"), forced = "wizarditis") + if(prob(1)&&prob(50)) + to_chat(affected_mob, "You feel [pick("the magic bubbling in your veins","that this location gives you a +1 to INT","an urge to summon familiar")].") + + if(4) + + if(prob(1)) + affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!","STI KALY!","EI NATH!"), forced = "wizarditis") + return + if(prob(1)&&prob(50)) + to_chat(affected_mob, "You feel [pick("the tidal wave of raw power building inside","that this location gives you a +2 to INT and +1 to WIS","an urge to teleport")].") + spawn_wizard_clothes(50) + if(prob(1)&&prob(1)) + teleport() + return + + + +/datum/disease/wizarditis/proc/spawn_wizard_clothes(chance = 0) + if(ishuman(affected_mob)) + var/mob/living/carbon/human/H = affected_mob + if(prob(chance)) + if(!istype(H.head, /obj/item/clothing/head/wizard)) + if(!H.dropItemToGround(H.head)) + qdel(H.head) + H.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(H), SLOT_HEAD) + return + if(prob(chance)) + if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) + if(!H.dropItemToGround(H.wear_suit)) + qdel(H.wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(H), SLOT_WEAR_SUIT) + return + if(prob(chance)) + if(!istype(H.shoes, /obj/item/clothing/shoes/sandal/magic)) + if(!H.dropItemToGround(H.shoes)) + qdel(H.shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal/magic(H), SLOT_SHOES) + return + else + var/mob/living/carbon/H = affected_mob + if(prob(chance)) + var/obj/item/staff/S = new(H) + if(!H.put_in_hands(S)) + qdel(S) + + +/datum/disease/wizarditis/proc/teleport() + var/list/theareas = get_areas_in_range(80, affected_mob) + for(var/area/space/S in theareas) + theareas -= S + + if(!theareas||!theareas.len) + return + + var/area/thearea = pick(theareas) + + var/list/L = list() + for(var/turf/T in get_area_turfs(thearea.type)) + if(T.z != affected_mob.z) + continue + if(T.name == "space") + continue + if(!T.density) + var/clear = 1 + for(var/obj/O in T) + if(O.density) + clear = 0 + break + if(clear) + L+=T + + if(!L) + return + + affected_mob.say("SCYAR NILA [uppertext(thearea.name)]!", forced = "wizarditis teleport") + affected_mob.forceMove(pick(L)) + + return diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 0ceb4443..c4d0d6f9 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -88,7 +88,7 @@ var/obj/result_obj = new result(container) for (var/obj/O in (container.contents-result_obj)) if (O.reagents) - O.reagents.del_reagent("nutriment") + O.reagents.del_reagent(/datum/reagent/consumable/nutriment) O.reagents.update_total() O.reagents.trans_to(result_obj, O.reagents.total_volume) qdel(O) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index d79bda0f..20bba021 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -349,7 +349,7 @@ /datum/status_effect/cultghost/tick() if(owner.reagents) - owner.reagents.del_reagent("holywater") //can't be deconverted + owner.reagents.del_reagent(/datum/reagent/water/holywater) //can't be deconverted /datum/status_effect/crusher_mark id = "crusher_mark" diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 4bd28fbc..23f88169 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -314,7 +314,7 @@ medical_record_text = "Patient suffers from acute Reality Dissociation Syndrome and experiences vivid hallucinations." /datum/quirk/insanity/on_process() - if(quirk_holder.reagents.has_reagent("mindbreaker")) + if(quirk_holder.reagents.has_reagent(/datum/reagent/toxin/mindbreaker)) quirk_holder.hallucination = 0 return if(prob(2)) //we'll all be mad soon enough diff --git a/code/game/gamemodes/clown_ops/clown_weapons.dm b/code/game/gamemodes/clown_ops/clown_weapons.dm index 6e409951..020ea95f 100644 --- a/code/game/gamemodes/clown_ops/clown_weapons.dm +++ b/code/game/gamemodes/clown_ops/clown_weapons.dm @@ -8,7 +8,7 @@ spray_range = 1 stream_range = 1 volume = 30 - list_reagents = list("lube" = 30) + list_reagents = list(/datum/reagent/lube = 30) //COMBAT CLOWN SHOES //Clown shoes with combat stats and noslip. Of course they still squeak. @@ -165,7 +165,7 @@ customfoodfilling = FALSE seed = null tastes = list("explosives" = 10) - list_reagents = list("vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) /obj/item/grown/bananapeel/bombanana desc = "A peel from a banana. Why is it beeping?" diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 027458e3..09d31b9a 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -1,410 +1,410 @@ -/obj/machinery/sleep_console - name = "sleeper console" - icon = 'icons/obj/machines/sleeper.dmi' - icon_state = "console" - density = FALSE - -/obj/machinery/sleeper - name = "sleeper" - desc = "An enclosed machine used to stabilize and heal patients." - icon = 'icons/obj/machines/sleeper.dmi' - icon_state = "sleeper" - density = FALSE - state_open = TRUE - circuit = /obj/item/circuitboard/machine/sleeper - req_access = list(ACCESS_CMO) //Used for reagent deletion and addition of non medicines - var/efficiency = 1 - var/min_health = -25 - var/list/available_chems - var/controls_inside = FALSE - var/list/possible_chems = list( - list("epinephrine", "morphine", "salbutamol", "bicaridine", "kelotane"), - list("oculine","inacusiate"), - list("antitoxin", "mutadone", "mannitol", "pen_acid"), - list("omnizine") - ) - var/list/chem_buttons //Used when emagged to scramble which chem is used, eg: antitoxin -> morphine - var/scrambled_chems = FALSE //Are chem buttons scrambled? used as a warning - var/enter_message = "You feel cool air surround you. You go numb as your senses turn inward." - -/obj/machinery/sleeper/Initialize() - . = ..() - create_reagents(500, NO_REACT) - occupant_typecache = GLOB.typecache_living - update_icon() - reset_chem_buttons() - RefreshParts() - add_inital_chems() - -/obj/machinery/sleeper/on_deconstruction() - var/obj/item/reagent_containers/sleeper_buffer/buffer = new (loc) - buffer.volume = reagents.maximum_volume - buffer.reagents.maximum_volume = reagents.maximum_volume - reagents.trans_to(buffer.reagents, reagents.total_volume) - -/obj/machinery/sleeper/proc/add_inital_chems() - for(var/i in available_chems) - var/datum/reagent/R = reagents.has_reagent(i) - if(!R) - reagents.add_reagent(i, (20)) - continue - if(R.volume < 20) - reagents.add_reagent(i, (20 - R.volume)) - -/obj/machinery/sleeper/RefreshParts() - var/E - for(var/obj/item/stock_parts/matter_bin/B in component_parts) - E += B.rating - var/I - for(var/obj/item/stock_parts/manipulator/M in component_parts) - I += M.rating - - efficiency = initial(efficiency)* E - min_health = initial(min_health) - (10*(E-1)) // CIT CHANGE - changes min health equation to be min_health - (matterbin rating * 10) - available_chems = list() - for(var/i in 1 to I) - available_chems |= possible_chems[i] - reset_chem_buttons() - - //Total container size 500 - 2000u - if(reagents) - reagents.maximum_volume = (500*E) - - -/obj/machinery/sleeper/update_icon() - icon_state = initial(icon_state) - if(state_open) - icon_state += "-open" - -/obj/machinery/sleeper/container_resist(mob/living/user) - visible_message("[occupant] emerges from [src]!", - "You climb out of [src]!") - open_machine() - -/obj/machinery/sleeper/Exited(atom/movable/user) - if (!state_open && user == occupant) - container_resist(user) - -/obj/machinery/sleeper/relaymove(mob/user) - if (!state_open) - container_resist(user) - -/obj/machinery/sleeper/open_machine() - if(!state_open && !panel_open) - ..() - -/obj/machinery/sleeper/close_machine(mob/user) - if((isnull(user) || istype(user)) && state_open && !panel_open) - ..(user) - var/mob/living/mob_occupant = occupant - if(mob_occupant && mob_occupant.stat != DEAD) - to_chat(occupant, "[enter_message]") - -/obj/machinery/sleeper/emp_act(severity) - . = ..() - if (. & EMP_PROTECT_SELF) - return - if(is_operational() && occupant) - var/datum/reagent/R = pick(reagents.reagent_list) - inject_chem(R.id, occupant) - open_machine() - //Is this too much? - if(severity == EMP_HEAVY) - var/chem = pick(available_chems) - available_chems -= chem - available_chems += get_random_reagent_id() - reset_chem_buttons() - -/obj/machinery/sleeper/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/reagent_containers/sleeper_buffer)) - var/obj/item/reagent_containers/sleeper_buffer/SB = I - if((SB.reagents.total_volume + reagents.total_volume) < reagents.maximum_volume) - SB.reagents.trans_to(reagents, SB.reagents.total_volume) - visible_message("[user] places the [SB] into the [src].") - qdel(SB) - return - else - SB.reagents.trans_to(reagents, SB.reagents.total_volume) - visible_message("[user] adds as much as they can to the [src] from the [SB].") - return - if(istype(I, /obj/item/reagent_containers)) - var/obj/item/reagent_containers/RC = I - if(RC.reagents.total_volume == 0) - to_chat(user, "The [I] is empty!") - for(var/datum/reagent/R in RC.reagents.reagent_list) - if((obj_flags & EMAGGED) || (allowed(usr))) - break - if(!istype(R, /datum/reagent/medicine)) - visible_message("The [src] gives out a hearty boop and rejects the [I]. The Sleeper's screen flashes with a pompous \"Medicines only, please.\"") - return - RC.reagents.trans_to(reagents, 1000) - visible_message("[user] adds as much as they can to the [src] from the [I].") - return - - -/obj/machinery/sleeper/MouseDrop_T(mob/target, mob/user) - if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser()) - return - close_machine(target) - -/obj/machinery/sleeper/screwdriver_act(mob/living/user, obj/item/I) - . = TRUE - if(..()) - return - if(occupant) - to_chat(user, "[src] is currently occupied!") - return - if(state_open) - to_chat(user, "[src] must be closed to [panel_open ? "close" : "open"] its maintenance hatch!") - return - if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) - return - return FALSE - -/obj/machinery/sleeper/wrench_act(mob/living/user, obj/item/I) - . = ..() - if(default_change_direction_wrench(user, I)) - return TRUE - -/obj/machinery/sleeper/crowbar_act(mob/living/user, obj/item/I) - . = ..() - if(default_pry_open(I)) - return TRUE - if(default_deconstruction_crowbar(I)) - return TRUE - -/obj/machinery/sleeper/default_pry_open(obj/item/I) //wew - . = !(state_open || panel_open || (flags_1 & NODECONSTRUCT_1)) && I.tool_behaviour == TOOL_CROWBAR - if(.) - I.play_tool_sound(src, 50) - visible_message("[usr] pries open [src].", "You pry open [src].") - open_machine() - -/obj/machinery/sleeper/AltClick(mob/user) - if(!user.canUseTopic(src, !issilicon(user))) - return - if(state_open) - close_machine() - else - open_machine() - -/obj/machinery/sleeper/examine(mob/user) - . = ..() - . += "Alt-click [src] to [state_open ? "close" : "open"] it." - -/obj/machinery/sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) - - if(controls_inside && state == GLOB.notcontained_state) - state = GLOB.default_state // If it has a set of controls on the inside, make it actually controllable by the mob in it. - - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "sleeper", name, 550, 700, master_ui, state) - ui.open() - -/obj/machinery/sleeper/ui_data() - var/list/data = list() - data["occupied"] = occupant ? 1 : 0 - data["open"] = state_open - data["efficiency"] = efficiency - data["current_vol"] = reagents.total_volume - data["tot_capacity"] = reagents.maximum_volume - - data["chems"] = list() - for(var/chem in available_chems) - var/datum/reagent/R = reagents.has_reagent(chem) - R = GLOB.chemical_reagents_list[chem] - data["synthchems"] += list(list("name" = R.name, "id" = R.id, "synth_allowed" = synth_allowed(chem))) - for(var/datum/reagent/R in reagents.reagent_list) - data["chems"] += list(list("name" = R.name, "id" = R.id, "vol" = R.volume, "purity" = R.purity, "allowed" = chem_allowed(R.id))) - - data["occupant"] = list() - var/mob/living/mob_occupant = occupant - if(mob_occupant) - data["occupant"]["name"] = mob_occupant.name - switch(mob_occupant.stat) - if(CONSCIOUS) - data["occupant"]["stat"] = "Conscious" - data["occupant"]["statstate"] = "good" - if(SOFT_CRIT) - data["occupant"]["stat"] = "Conscious" - data["occupant"]["statstate"] = "average" - if(UNCONSCIOUS) - data["occupant"]["stat"] = "Unconscious" - data["occupant"]["statstate"] = "average" - if(DEAD) - data["occupant"]["stat"] = "Dead" - data["occupant"]["statstate"] = "bad" - data["occupant"]["health"] = mob_occupant.health - data["occupant"]["maxHealth"] = mob_occupant.maxHealth - data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD - data["occupant"]["bruteLoss"] = mob_occupant.getBruteLoss() - data["occupant"]["oxyLoss"] = mob_occupant.getOxyLoss() - data["occupant"]["toxLoss"] = mob_occupant.getToxLoss() - data["occupant"]["fireLoss"] = mob_occupant.getFireLoss() - data["occupant"]["cloneLoss"] = mob_occupant.getCloneLoss() - data["occupant"]["brainLoss"] = mob_occupant.getOrganLoss(ORGAN_SLOT_BRAIN) - data["occupant"]["reagents"] = list() - if(mob_occupant.reagents && mob_occupant.reagents.reagent_list.len) - for(var/datum/reagent/R in mob_occupant.reagents.reagent_list) - data["occupant"]["reagents"] += list(list("name" = R.name, "volume" = R.volume)) - data["occupant"]["failing_organs"] = list() - var/mob/living/carbon/C = mob_occupant - if(C) - for(var/obj/item/organ/Or in C.getFailingOrgans()) - if(istype(Or, /obj/item/organ/brain)) - continue - data["occupant"]["failing_organs"] += list(list("name" = Or.name)) - - if(mob_occupant.has_dna()) // Blood-stuff is mostly a copy-paste from the healthscanner. - var/blood_id = C.get_blood_id() - if(blood_id) - data["occupant"]["blood"] = list() // We can start populating this list. - var/blood_type = C.dna.blood_type - if(blood_id != "blood") // special blood substance - var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id] - if(R) - blood_type = R.name - else - blood_type = blood_id - data["occupant"]["blood"]["maxBloodVolume"] = (BLOOD_VOLUME_NORMAL*C.blood_ratio) - data["occupant"]["blood"]["currentBloodVolume"] = C.blood_volume - data["occupant"]["blood"]["dangerBloodVolume"] = BLOOD_VOLUME_SAFE - data["occupant"]["blood"]["bloodType"] = blood_type - return data - -/obj/machinery/sleeper/ui_act(action, params) - if(..()) - return - var/mob/living/mob_occupant = occupant - - switch(action) - if("door") - if(state_open) - close_machine() - else - open_machine() - . = TRUE - if("inject") - var/chem = params["chem"] - var/amount = text2num(params["volume"]) - if(!is_operational() || !mob_occupant) - return - if(mob_occupant.health < min_health && chem != "epinephrine") - return - if(inject_chem(chem, usr, amount)) - . = TRUE - if(scrambled_chems && prob(5)) - to_chat(usr, "Chemical system re-route detected, results may not be as expected!") - if("synth") - var/chem = params["chem"] - if(!is_operational()) - return - reagents.add_reagent(chem_buttons[chem], 10) //other_purity = 0.75 for when the mechanics are in - if("purge") - var/chem = params["chem"] - if(allowed(usr)) - if(!is_operational()) - return - reagents.remove_reagent(chem, 10) - return - if(chem in available_chems) - if(!is_operational()) - return - /*var/datum/reagent/R = reagents.has_reagent(chem) //For when purity effects are in - if(R.purity < 0.8)*/ - reagents.remove_reagent(chem, 10) - else - visible_message("Access Denied.") - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - - -/obj/machinery/sleeper/emag_act(mob/user) - . = ..() - obj_flags |= EMAGGED - scramble_chem_buttons() - to_chat(user, "You scramble the sleeper's user interface!") - return TRUE - -//trans to -/obj/machinery/sleeper/proc/inject_chem(chem, mob/user, volume = 10) - if(chem_allowed(chem)) - reagents.trans_id_to(occupant, chem, volume)//emag effect kicks in here so that the "intended" chem is used for all checks, for extra FUUU - if(user) - log_combat(user, occupant, "injected [chem] into", addition = "via [src]") - return TRUE - -/obj/machinery/sleeper/proc/chem_allowed(chem) - var/mob/living/mob_occupant = occupant - if(!mob_occupant || !mob_occupant.reagents) - return - var/amount = mob_occupant.reagents.get_reagent_amount(chem) + 10 <= 20 * efficiency - var/occ_health = mob_occupant.health > min_health || chem == "epinephrine" - return amount && occ_health - -/obj/machinery/sleeper/proc/synth_allowed(chem) - var/datum/reagent/R = reagents.has_reagent(chem) - if(!R) - return TRUE - if(R.volume < 50) - return TRUE - return FALSE - -/obj/machinery/sleeper/proc/reset_chem_buttons() - scrambled_chems = FALSE - LAZYINITLIST(chem_buttons) - for(var/chem in available_chems) - chem_buttons[chem] = chem - -/obj/machinery/sleeper/proc/scramble_chem_buttons() - scrambled_chems = TRUE - var/list/av_chem = available_chems.Copy() - for(var/chem in av_chem) - chem_buttons[chem] = pick_n_take(av_chem) //no dupes, allow for random buttons to still be correct - - -/obj/machinery/sleeper/syndie - icon_state = "sleeper_s" - controls_inside = TRUE - -/obj/machinery/sleeper/syndie/Initialize() - . = ..() - component_parts = list() - component_parts += new /obj/item/circuitboard/machine/sleeper/syndie(null) - component_parts += new /obj/item/stock_parts/matter_bin/super(null) - component_parts += new /obj/item/stock_parts/manipulator/pico(null) - component_parts += new /obj/item/stack/sheet/glass(null) - component_parts += new /obj/item/stack/sheet/glass(null) - component_parts += new /obj/item/stack/cable_coil(null) - RefreshParts() - -/obj/machinery/sleeper/syndie/fullupgrade/Initialize() - . = ..() - component_parts = list() - component_parts += new /obj/item/circuitboard/machine/sleeper/syndie(null) - component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null) - component_parts += new /obj/item/stock_parts/manipulator/femto(null) - component_parts += new /obj/item/stack/sheet/glass(null) - component_parts += new /obj/item/stack/sheet/glass(null) - component_parts += new /obj/item/stack/cable_coil(null) - RefreshParts() - -/obj/machinery/sleeper/clockwork - name = "soothing sleeper" - desc = "A large cryogenics unit built from brass. Its surface is pleasantly cool the touch." - icon_state = "sleeper_clockwork" - enter_message = "You hear the gentle hum and click of machinery, and are lulled into a sense of peace." - possible_chems = list(list("epinephrine", "salbutamol", "bicaridine", "kelotane", "oculine", "inacusiate", "mannitol")) - -/obj/machinery/sleeper/clockwork/process() - if(occupant && isliving(occupant)) - var/mob/living/L = occupant - if(GLOB.clockwork_vitality) //If there's Vitality, the sleeper has passive healing - GLOB.clockwork_vitality = max(0, GLOB.clockwork_vitality - 1) - L.adjustBruteLoss(-1) - L.adjustFireLoss(-1) - L.adjustOxyLoss(-5) - -/obj/machinery/sleeper/old - icon_state = "oldpod" +/obj/machinery/sleep_console + name = "sleeper console" + icon = 'icons/obj/machines/sleeper.dmi' + icon_state = "console" + density = FALSE + +/obj/machinery/sleeper + name = "sleeper" + desc = "An enclosed machine used to stabilize and heal patients." + icon = 'icons/obj/machines/sleeper.dmi' + icon_state = "sleeper" + density = FALSE + state_open = TRUE + circuit = /obj/item/circuitboard/machine/sleeper + req_access = list(ACCESS_CMO) //Used for reagent deletion and addition of non medicines + var/efficiency = 1 + var/min_health = -25 + var/list/available_chems + var/controls_inside = FALSE + var/list/possible_chems = list( + list(/datum/reagent/medicine/epinephrine, /datum/reagent/medicine/morphine, /datum/reagent/medicine/salbutamol, /datum/reagent/medicine/bicaridine, /datum/reagent/medicine/kelotane), + list(/datum/reagent/medicine/oculine,/datum/reagent/medicine/inacusiate), + list(/datum/reagent/medicine/antitoxin, /datum/reagent/medicine/mutadone, /datum/reagent/medicine/mannitol, /datum/reagent/medicine/pen_acid), + list(/datum/reagent/medicine/omnizine) + ) + var/list/chem_buttons //Used when emagged to scramble which chem is used, eg: antitoxin -> morphine + var/scrambled_chems = FALSE //Are chem buttons scrambled? used as a warning + var/enter_message = "You feel cool air surround you. You go numb as your senses turn inward." + +/obj/machinery/sleeper/Initialize() + . = ..() + create_reagents(500, NO_REACT) + occupant_typecache = GLOB.typecache_living + update_icon() + reset_chem_buttons() + RefreshParts() + add_inital_chems() + +/obj/machinery/sleeper/on_deconstruction() + var/obj/item/reagent_containers/sleeper_buffer/buffer = new (loc) + buffer.volume = reagents.maximum_volume + buffer.reagents.maximum_volume = reagents.maximum_volume + reagents.trans_to(buffer.reagents, reagents.total_volume) + +/obj/machinery/sleeper/proc/add_inital_chems() + for(var/i in available_chems) + var/datum/reagent/R = reagents.has_reagent(i) + if(!R) + reagents.add_reagent(i, (20)) + continue + if(R.volume < 20) + reagents.add_reagent(i, (20 - R.volume)) + +/obj/machinery/sleeper/RefreshParts() + var/E + for(var/obj/item/stock_parts/matter_bin/B in component_parts) + E += B.rating + var/I + for(var/obj/item/stock_parts/manipulator/M in component_parts) + I += M.rating + + efficiency = initial(efficiency)* E + min_health = initial(min_health) - (10*(E-1)) // CIT CHANGE - changes min health equation to be min_health - (matterbin rating * 10) + available_chems = list() + for(var/i in 1 to I) + available_chems |= possible_chems[i] + reset_chem_buttons() + + //Total container size 500 - 2000u + if(reagents) + reagents.maximum_volume = (500*E) + + +/obj/machinery/sleeper/update_icon() + icon_state = initial(icon_state) + if(state_open) + icon_state += "-open" + +/obj/machinery/sleeper/container_resist(mob/living/user) + visible_message("[occupant] emerges from [src]!", + "You climb out of [src]!") + open_machine() + +/obj/machinery/sleeper/Exited(atom/movable/user) + if (!state_open && user == occupant) + container_resist(user) + +/obj/machinery/sleeper/relaymove(mob/user) + if (!state_open) + container_resist(user) + +/obj/machinery/sleeper/open_machine() + if(!state_open && !panel_open) + ..() + +/obj/machinery/sleeper/close_machine(mob/user) + if((isnull(user) || istype(user)) && state_open && !panel_open) + ..(user) + var/mob/living/mob_occupant = occupant + if(mob_occupant && mob_occupant.stat != DEAD) + to_chat(occupant, "[enter_message]") + +/obj/machinery/sleeper/emp_act(severity) + . = ..() + if (. & EMP_PROTECT_SELF) + return + if(is_operational() && occupant) + var/datum/reagent/R = pick(reagents.reagent_list) + inject_chem(R.type, occupant) + open_machine() + //Is this too much? + if(severity == EMP_HEAVY) + var/chem = pick(available_chems) + available_chems -= chem + available_chems += get_random_reagent_id() + reset_chem_buttons() + +/obj/machinery/sleeper/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/reagent_containers/sleeper_buffer)) + var/obj/item/reagent_containers/sleeper_buffer/SB = I + if((SB.reagents.total_volume + reagents.total_volume) < reagents.maximum_volume) + SB.reagents.trans_to(reagents, SB.reagents.total_volume) + visible_message("[user] places the [SB] into the [src].") + qdel(SB) + return + else + SB.reagents.trans_to(reagents, SB.reagents.total_volume) + visible_message("[user] adds as much as they can to the [src] from the [SB].") + return + if(istype(I, /obj/item/reagent_containers)) + var/obj/item/reagent_containers/RC = I + if(RC.reagents.total_volume == 0) + to_chat(user, "The [I] is empty!") + for(var/datum/reagent/R in RC.reagents.reagent_list) + if((obj_flags & EMAGGED) || (allowed(usr))) + break + if(!istype(R, /datum/reagent/medicine)) + visible_message("The [src] gives out a hearty boop and rejects the [I]. The Sleeper's screen flashes with a pompous \"Medicines only, please.\"") + return + RC.reagents.trans_to(reagents, 1000) + visible_message("[user] adds as much as they can to the [src] from the [I].") + return + + +/obj/machinery/sleeper/MouseDrop_T(mob/target, mob/user) + if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser()) + return + close_machine(target) + +/obj/machinery/sleeper/screwdriver_act(mob/living/user, obj/item/I) + . = TRUE + if(..()) + return + if(occupant) + to_chat(user, "[src] is currently occupied!") + return + if(state_open) + to_chat(user, "[src] must be closed to [panel_open ? "close" : "open"] its maintenance hatch!") + return + if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) + return + return FALSE + +/obj/machinery/sleeper/wrench_act(mob/living/user, obj/item/I) + . = ..() + if(default_change_direction_wrench(user, I)) + return TRUE + +/obj/machinery/sleeper/crowbar_act(mob/living/user, obj/item/I) + . = ..() + if(default_pry_open(I)) + return TRUE + if(default_deconstruction_crowbar(I)) + return TRUE + +/obj/machinery/sleeper/default_pry_open(obj/item/I) //wew + . = !(state_open || panel_open || (flags_1 & NODECONSTRUCT_1)) && I.tool_behaviour == TOOL_CROWBAR + if(.) + I.play_tool_sound(src, 50) + visible_message("[usr] pries open [src].", "You pry open [src].") + open_machine() + +/obj/machinery/sleeper/AltClick(mob/user) + if(!user.canUseTopic(src, !issilicon(user))) + return + if(state_open) + close_machine() + else + open_machine() + +/obj/machinery/sleeper/examine(mob/user) + . = ..() + . += "Alt-click [src] to [state_open ? "close" : "open"] it." + +/obj/machinery/sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) + + if(controls_inside && state == GLOB.notcontained_state) + state = GLOB.default_state // If it has a set of controls on the inside, make it actually controllable by the mob in it. + + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "sleeper", name, 550, 700, master_ui, state) + ui.open() + +/obj/machinery/sleeper/ui_data() + var/list/data = list() + data["occupied"] = occupant ? 1 : 0 + data["open"] = state_open + data["efficiency"] = efficiency + data["current_vol"] = reagents.total_volume + data["tot_capacity"] = reagents.maximum_volume + + data["chems"] = list() + for(var/chem in available_chems) + var/datum/reagent/R = reagents.has_reagent(chem) + R = GLOB.chemical_reagents_list[chem] + data["synthchems"] += list(list("name" = R.name, "id" = R.type, "synth_allowed" = synth_allowed(chem))) + for(var/datum/reagent/R in reagents.reagent_list) + data["chems"] += list(list("name" = R.name, "id" = R.type, "vol" = R.volume, "purity" = R.purity, "allowed" = chem_allowed(R.type))) + + data["occupant"] = list() + var/mob/living/mob_occupant = occupant + if(mob_occupant) + data["occupant"]["name"] = mob_occupant.name + switch(mob_occupant.stat) + if(CONSCIOUS) + data["occupant"]["stat"] = "Conscious" + data["occupant"]["statstate"] = "good" + if(SOFT_CRIT) + data["occupant"]["stat"] = "Conscious" + data["occupant"]["statstate"] = "average" + if(UNCONSCIOUS) + data["occupant"]["stat"] = "Unconscious" + data["occupant"]["statstate"] = "average" + if(DEAD) + data["occupant"]["stat"] = "Dead" + data["occupant"]["statstate"] = "bad" + data["occupant"]["health"] = mob_occupant.health + data["occupant"]["maxHealth"] = mob_occupant.maxHealth + data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD + data["occupant"]["bruteLoss"] = mob_occupant.getBruteLoss() + data["occupant"]["oxyLoss"] = mob_occupant.getOxyLoss() + data["occupant"]["toxLoss"] = mob_occupant.getToxLoss() + data["occupant"]["fireLoss"] = mob_occupant.getFireLoss() + data["occupant"]["cloneLoss"] = mob_occupant.getCloneLoss() + data["occupant"]["brainLoss"] = mob_occupant.getOrganLoss(ORGAN_SLOT_BRAIN) + data["occupant"]["reagents"] = list() + if(mob_occupant.reagents && mob_occupant.reagents.reagent_list.len) + for(var/datum/reagent/R in mob_occupant.reagents.reagent_list) + data["occupant"]["reagents"] += list(list("name" = R.name, "volume" = R.volume)) + data["occupant"]["failing_organs"] = list() + var/mob/living/carbon/C = mob_occupant + if(C) + for(var/obj/item/organ/Or in C.getFailingOrgans()) + if(istype(Or, /obj/item/organ/brain)) + continue + data["occupant"]["failing_organs"] += list(list("name" = Or.name)) + + if(mob_occupant.has_dna()) // Blood-stuff is mostly a copy-paste from the healthscanner. + var/blood_id = C.get_blood_id() + if(blood_id) + data["occupant"]["blood"] = list() // We can start populating this list. + var/blood_type = C.dna.blood_type + if(blood_id != "blood") // special blood substance + var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id] + if(R) + blood_type = R.name + else + blood_type = blood_id + data["occupant"]["blood"]["maxBloodVolume"] = (BLOOD_VOLUME_NORMAL*C.blood_ratio) + data["occupant"]["blood"]["currentBloodVolume"] = C.blood_volume + data["occupant"]["blood"]["dangerBloodVolume"] = BLOOD_VOLUME_SAFE + data["occupant"]["blood"]["bloodType"] = blood_type + return data + +/obj/machinery/sleeper/ui_act(action, params) + if(..()) + return + var/mob/living/mob_occupant = occupant + + switch(action) + if("door") + if(state_open) + close_machine() + else + open_machine() + . = TRUE + if("inject") + var/chem = text2path(params["chem"]) + var/amount = text2num(params["volume"]) + if(!is_operational() || !mob_occupant || isnull(chem)) + return + if(mob_occupant.health < min_health && chem != /datum/reagent/medicine/epinephrine) + return + if(inject_chem(chem, usr, amount)) + . = TRUE + if(scrambled_chems && prob(5)) + to_chat(usr, "Chemical system re-route detected, results may not be as expected!") + if("synth") + var/chem = text2path(params["chem"]) + if(!is_operational()) + return + reagents.add_reagent(chem_buttons[chem], 10) //other_purity = 0.75 for when the mechanics are in + if("purge") + var/chem = text2path(params["chem"]) + if(allowed(usr)) + if(!is_operational()) + return + reagents.remove_reagent(chem, 10) + return + if(chem in available_chems) + if(!is_operational()) + return + /*var/datum/reagent/R = reagents.has_reagent(chem) //For when purity effects are in + if(R.purity < 0.8)*/ + reagents.remove_reagent(chem, 10) + else + visible_message("Access Denied.") + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + +/obj/machinery/sleeper/emag_act(mob/user) + . = ..() + obj_flags |= EMAGGED + scramble_chem_buttons() + to_chat(user, "You scramble the sleeper's user interface!") + return TRUE + +//trans to +/obj/machinery/sleeper/proc/inject_chem(chem, mob/user, volume = 10) + if(chem_allowed(chem)) + reagents.trans_id_to(occupant, chem, volume)//emag effect kicks in here so that the "intended" chem is used for all checks, for extra FUUU + if(user) + log_combat(user, occupant, "injected [chem] into", addition = "via [src]") + return TRUE + +/obj/machinery/sleeper/proc/chem_allowed(chem) + var/mob/living/mob_occupant = occupant + if(!mob_occupant || !mob_occupant.reagents) + return + var/amount = mob_occupant.reagents.get_reagent_amount(chem) + 10 <= 20 * efficiency + var/occ_health = mob_occupant.health > min_health || chem == /datum/reagent/medicine/epinephrine + return amount && occ_health + +/obj/machinery/sleeper/proc/synth_allowed(chem) + var/datum/reagent/R = reagents.has_reagent(chem) + if(!R) + return TRUE + if(R.volume < 50) + return TRUE + return FALSE + +/obj/machinery/sleeper/proc/reset_chem_buttons() + scrambled_chems = FALSE + LAZYINITLIST(chem_buttons) + for(var/chem in available_chems) + chem_buttons[chem] = chem + +/obj/machinery/sleeper/proc/scramble_chem_buttons() + scrambled_chems = TRUE + var/list/av_chem = available_chems.Copy() + for(var/chem in av_chem) + chem_buttons[chem] = pick_n_take(av_chem) //no dupes, allow for random buttons to still be correct + + +/obj/machinery/sleeper/syndie + icon_state = "sleeper_s" + controls_inside = TRUE + +/obj/machinery/sleeper/syndie/Initialize() + . = ..() + component_parts = list() + component_parts += new /obj/item/circuitboard/machine/sleeper/syndie(null) + component_parts += new /obj/item/stock_parts/matter_bin/super(null) + component_parts += new /obj/item/stock_parts/manipulator/pico(null) + component_parts += new /obj/item/stack/sheet/glass(null) + component_parts += new /obj/item/stack/sheet/glass(null) + component_parts += new /obj/item/stack/cable_coil(null) + RefreshParts() + +/obj/machinery/sleeper/syndie/fullupgrade/Initialize() + . = ..() + component_parts = list() + component_parts += new /obj/item/circuitboard/machine/sleeper/syndie(null) + component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null) + component_parts += new /obj/item/stock_parts/manipulator/femto(null) + component_parts += new /obj/item/stack/sheet/glass(null) + component_parts += new /obj/item/stack/sheet/glass(null) + component_parts += new /obj/item/stack/cable_coil(null) + RefreshParts() + +/obj/machinery/sleeper/clockwork + name = "soothing sleeper" + desc = "A large cryogenics unit built from brass. Its surface is pleasantly cool the touch." + icon_state = "sleeper_clockwork" + enter_message = "You hear the gentle hum and click of machinery, and are lulled into a sense of peace." + possible_chems = list(list("epinephrine", "salbutamol", "bicaridine", "kelotane", "oculine", "inacusiate", "mannitol")) + +/obj/machinery/sleeper/clockwork/process() + if(occupant && isliving(occupant)) + var/mob/living/L = occupant + if(GLOB.clockwork_vitality) //If there's Vitality, the sleeper has passive healing + GLOB.clockwork_vitality = max(0, GLOB.clockwork_vitality - 1) + L.adjustBruteLoss(-1) + L.adjustFireLoss(-1) + L.adjustOxyLoss(-5) + +/obj/machinery/sleeper/old + icon_state = "oldpod" diff --git a/code/game/machinery/bloodbankgen.dm b/code/game/machinery/bloodbankgen.dm index c92e5508..948e9b98 100644 --- a/code/game/machinery/bloodbankgen.dm +++ b/code/game/machinery/bloodbankgen.dm @@ -123,15 +123,15 @@ if(reagents.total_volume >= reagents.maximum_volume || !bag || !bag.reagents.total_volume) beep_stop_pumping() return - var/blood_amount = bag.reagents.get_reagent_amount("blood") + var/blood_amount = bag.reagents.get_reagent_amount(/datum/reagent/blood) //monitor the machine and blood bag's reagents storage. var/amount = min(blood_amount, min(transfer_amount, reagents.maximum_volume - reagents.total_volume)) if(!amount) beep_stop_pumping() return var/bonus = bag.blood_type == "SY" ? 0 : 5 * efficiency //no infinite loops using synthetics. - reagents.add_reagent("syntheticblood", amount + bonus) - bag.reagents.remove_reagent("blood", amount) + reagents.add_reagent(/datum/reagent/blood/synthetics, amount + bonus) + bag.reagents.remove_reagent(/datum/reagent/blood, amount) update_icon() if(filling) diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index c7ccc18f..a5b4b36e 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -87,7 +87,7 @@ selected_category = href_list["category"] if(href_list["disposeI"]) //Get rid of a reagent incase you add the wrong one by mistake - reagents.del_reagent(href_list["disposeI"]) + reagents.del_reagent(text2path(href_list["disposeI"])) if(href_list["make"]) @@ -98,10 +98,10 @@ return - var/synth_cost = being_built.reagents_list["synthflesh"]*prod_coeff + var/synth_cost = being_built.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff var/power = max(2000, synth_cost/5) - if(reagents.has_reagent("synthflesh", being_built.reagents_list["synthflesh"]*prod_coeff)) + if(reagents.has_reagent(/datum/reagent/medicine/synthflesh, being_built.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff)) busy = TRUE use_power(power) flick("limbgrower_fill",src) @@ -115,8 +115,8 @@ return /obj/machinery/limbgrower/proc/build_item() - if(reagents.has_reagent("synthflesh", being_built.reagents_list["synthflesh"]*prod_coeff)) //sanity check, if this happens we are in big trouble - reagents.remove_reagent("synthflesh",being_built.reagents_list["synthflesh"]*prod_coeff) + if(reagents.has_reagent(/datum/reagent/medicine/synthflesh, being_built.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff)) //sanity check, if this happens we are in big trouble + reagents.remove_reagent(/datum/reagent/medicine/synthflesh, being_built.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff) var/buildpath = being_built.build_path if(ispath(buildpath, /obj/item/bodypart)) //This feels like spatgheti code, but i need to initilise a limb somehow build_limb(buildpath) @@ -197,7 +197,7 @@ for(var/datum/reagent/R in reagents.reagent_list) dat += "[R.name]: [R.volume]" - dat += "Purge
    " + dat += "Purge
    " dat += "" return dat @@ -207,12 +207,12 @@ return dat /obj/machinery/limbgrower/proc/can_build(datum/design/D) - return (reagents.has_reagent("synthflesh", D.reagents_list["synthflesh"]*prod_coeff)) //Return whether the machine has enough synthflesh to produce the design + return (reagents.has_reagent(/datum/reagent/medicine/synthflesh, D.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff)) //Return whether the machine has enough synthflesh to produce the design /obj/machinery/limbgrower/proc/get_design_cost(datum/design/D) var/dat if(D.reagents_list["synthflesh"]) - dat += "[D.reagents_list["synthflesh"] * prod_coeff] Synthetic flesh " + dat += "[D.reagents_list[/datum/reagent/medicine/synthflesh] * prod_coeff] Synthetic flesh " return dat /obj/machinery/limbgrower/emag_act(mob/user) diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index a2f8bb57..9d0fce23 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -1,556 +1,555 @@ -// Sleeper, Medical Beam, and Syringe gun - -/obj/item/mecha_parts/mecha_equipment/medical - -/obj/item/mecha_parts/mecha_equipment/medical/Initialize() - . = ..() - START_PROCESSING(SSobj, src) - -/obj/item/mecha_parts/mecha_equipment/medical/can_attach(obj/mecha/medical/M) - if(..() && istype(M)) - return 1 - - -/obj/item/mecha_parts/mecha_equipment/medical/attach(obj/mecha/M) - ..() - START_PROCESSING(SSobj, src) - -/obj/item/mecha_parts/mecha_equipment/medical/Destroy() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/process() - if(!chassis) - STOP_PROCESSING(SSobj, src) - return 1 - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/detach() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper - name = "mounted sleeper" - desc = "Equipment for medical exosuits. A mounted sleeper that stabilizes patients and can inject reagents in the exosuit's reserves." - icon = 'icons/obj/machines/sleeper.dmi' - icon_state = "sleeper" - energy_drain = 20 - range = MECHA_MELEE - equip_cooldown = 20 - var/mob/living/carbon/patient = null - var/inject_amount = 10 - salvageable = 0 - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Destroy() - for(var/atom/movable/AM in src) - AM.forceMove(get_turf(src)) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Exit(atom/movable/O) - return 0 - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/action(mob/living/carbon/target) - if(!action_checks(target)) - return - if(!istype(target)) - return - if(!patient_insertion_check(target)) - return - occupant_message("You start putting [target] into [src]...") - chassis.visible_message("[chassis] starts putting [target] into \the [src].") - if(do_after_cooldown(target)) - if(!patient_insertion_check(target)) - return - target.forceMove(src) - patient = target - START_PROCESSING(SSobj, src) - update_equip_info() - occupant_message("[target] successfully loaded into [src]. Life support functions engaged.") - chassis.visible_message("[chassis] loads [target] into [src].") - log_message("[target] loaded. Life support functions engaged.") - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/patient_insertion_check(mob/living/carbon/target) - if(target.buckled) - occupant_message("[target] will not fit into the sleeper because [target.p_theyre()] buckled to [target.buckled]!") - return - if(target.has_buckled_mobs()) - occupant_message("[target] will not fit into the sleeper because of the creatures attached to it!") - return - if(patient) - occupant_message("The sleeper is already occupied!") - return - return 1 - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/go_out() - if(!patient) - return - patient.forceMove(get_turf(src)) - occupant_message("[patient] ejected. Life support functions disabled.") - log_message("[patient] ejected. Life support functions disabled.") - STOP_PROCESSING(SSobj, src) - patient = null - update_equip_info() - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/detach() - if(patient) - occupant_message("Unable to detach [src] - equipment occupied!") - return - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/get_equip_info() - var/output = ..() - if(output) - var/temp = "" - if(patient) - temp = "
    \[Occupant: [patient] ([patient.stat > 1 ? "*DECEASED*" : "Health: [patient.health]%"])\]
    View stats|Eject" - return "[output] [temp]" - return - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Topic(href,href_list) - ..() - var/datum/topic_input/afilter = new /datum/topic_input(href,href_list) - if(afilter.get("eject")) - go_out() - if(afilter.get("view_stats")) - chassis.occupant << browse(get_patient_stats(),"window=msleeper") - onclose(chassis.occupant, "msleeper") - return - if(afilter.get("inject")) - inject_reagent(afilter.getType("inject", /datum/reagent),afilter.getObj("source")) - return - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_stats() - if(!patient) - return - return {" - - [patient] statistics - - - - -

    Health statistics

    -
    - [get_patient_dam()] -
    -

    Reagents in bloodstream

    -
    - [get_patient_reagents()] -
    -
    - [get_available_reagents()] -
    - - "} - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_dam() - var/t1 - switch(patient.stat) - if(0) - t1 = "Conscious" - if(1) - t1 = "Unconscious" - if(2) - t1 = "*dead*" - else - t1 = "Unknown" - return {"Health: [patient.stat > 1 ? "[t1]" : "[patient.health]% ([t1])"]
    - Core Temperature: [patient.bodytemperature-T0C]°C ([patient.bodytemperature*1.8-459.67]°F)
    - Brute Damage: [patient.getBruteLoss()]%
    - Respiratory Damage: [patient.getOxyLoss()]%
    - Toxin Content: [patient.getToxLoss()]%
    - Burn Severity: [patient.getFireLoss()]%
    - [patient.getCloneLoss() ? "Subject appears to have cellular damage." : ""]
    - [patient.getOrganLoss(ORGAN_SLOT_BRAIN) ? "Significant brain damage detected." : ""]
    - [length(patient.get_traumas()) ? "Brain Traumas detected." : ""]
    - "} - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_reagents() - if(patient.reagents) - for(var/datum/reagent/R in patient.reagents.reagent_list) - if(R.volume > 0) - . += "[R]: [round(R.volume,0.01)]
    " - return . || "None" - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_available_reagents() - var/output - var/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun) in chassis - if(SG && SG.reagents && islist(SG.reagents.reagent_list)) - for(var/datum/reagent/R in SG.reagents.reagent_list) - if(R.volume > 0) - output += "Inject [R.name]
    " - return output - - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/inject_reagent(datum/reagent/R,obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/SG) - if(!R || !patient || !SG || !(SG in chassis.equipment)) - return 0 - var/to_inject = min(R.volume, inject_amount) - if(to_inject && patient.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2) - occupant_message("Injecting [patient] with [to_inject] units of [R.name].") - log_message("Injecting [patient] with [to_inject] units of [R.name].") - log_combat(chassis.occupant, patient, "injected", "[name] ([R] - [to_inject] units)") - SG.reagents.trans_id_to(patient,R.id,to_inject) - update_equip_info() - return - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/update_equip_info() - if(..()) - if(patient) - send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_patient_dam()) - send_byjax(chassis.occupant,"msleeper.browser","reagents",get_patient_reagents()) - send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents()) - return 1 - return - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/container_resist(mob/living/user) - go_out() - -/obj/item/mecha_parts/mecha_equipment/medical/sleeper/process() - if(..()) - return - if(!chassis.has_charge(energy_drain)) - set_ready_state(1) - log_message("Deactivated.") - occupant_message("[src] deactivated - no power.") - STOP_PROCESSING(SSobj, src) - return - var/mob/living/carbon/M = patient - if(!M) - return - if(M.health > 0) - M.adjustOxyLoss(-1) - M.AdjustStun(-80) - M.AdjustKnockdown(-80) - M.AdjustUnconscious(-80) - if(M.reagents.get_reagent_amount("epinephrine") < 5) - M.reagents.add_reagent("epinephrine", 5) - chassis.use_power(energy_drain) - update_equip_info() - - - - -///////////////////////////////// Syringe Gun /////////////////////////////////////////////////////////////// - - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun - name = "exosuit syringe gun" - desc = "Equipment for medical exosuits. A chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur." - icon = 'icons/obj/guns/projectile.dmi' - icon_state = "syringegun" - var/list/syringes - var/list/known_reagents - var/list/processed_reagents - var/max_syringes = 10 - var/max_volume = 75 //max reagent volume - var/synth_speed = 5 //[num] reagent units per cycle - energy_drain = 10 - var/mode = 0 //0 - fire syringe, 1 - analyze reagents. - range = MECHA_MELEE|MECHA_RANGED - equip_cooldown = 10 - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Initialize() - . = ..() - create_reagents(max_volume, NO_REACT) - syringes = new - known_reagents = list("epinephrine"="Epinephrine","charcoal"="Charcoal") - processed_reagents = new - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/detach() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Destroy() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/critfail() - ..() - if(reagents) - DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/can_attach(obj/mecha/medical/M) - if(..()) - if(istype(M)) - return 1 - return 0 - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/get_equip_info() - var/output = ..() - if(output) - return "[output] \[[mode? "Analyze" : "Launch"]\]
    \[Syringes: [syringes.len]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]
    Reagents list" - return - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/action(atom/movable/target) - if(!action_checks(target)) - return - if(istype(target, /obj/item/reagent_containers/syringe)) - return load_syringe(target) - if(istype(target, /obj/item/storage))//Loads syringes from boxes - for(var/obj/item/reagent_containers/syringe/S in target.contents) - load_syringe(S) - return - if(mode) - return analyze_reagents(target) - if(!syringes.len) - occupant_message("No syringes loaded.") - return - if(reagents.total_volume<=0) - occupant_message("No available reagents to load syringe with.") - return - var/turf/trg = get_turf(target) - var/obj/item/reagent_containers/syringe/mechsyringe = syringes[1] - mechsyringe.forceMove(get_turf(chassis)) - reagents.trans_to(mechsyringe, min(mechsyringe.volume, reagents.total_volume)) - syringes -= mechsyringe - mechsyringe.icon = 'icons/obj/chemical.dmi' - mechsyringe.icon_state = "syringeproj" - playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1) - log_message("Launched [mechsyringe] from [src], targeting [target].") - var/mob/originaloccupant = chassis.occupant - spawn(0) - src = null //if src is deleted, still process the syringe - for(var/i=0, i<6, i++) - if(!mechsyringe) - break - if(step_towards(mechsyringe,trg)) - var/list/mobs = new - for(var/mob/living/carbon/M in mechsyringe.loc) - mobs += M - var/mob/living/carbon/M = safepick(mobs) - if(M) - var/R - mechsyringe.visible_message(" [M] was hit by the syringe!") - if(M.can_inject(null, 1)) - if(mechsyringe.reagents) - for(var/datum/reagent/A in mechsyringe.reagents.reagent_list) - R += A.id + " (" - R += num2text(A.volume) + ")," - mechsyringe.icon_state = initial(mechsyringe.icon_state) - mechsyringe.icon = initial(mechsyringe.icon) - mechsyringe.reagents.reaction(M, INJECT) - mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume) - M.take_bodypart_damage(2) - log_combat(originaloccupant, M, "shot", "syringegun") - break - else if(mechsyringe.loc == trg) - mechsyringe.icon_state = initial(mechsyringe.icon_state) - mechsyringe.icon = initial(mechsyringe.icon) - mechsyringe.update_icon() - break - else - mechsyringe.icon_state = initial(mechsyringe.icon_state) - mechsyringe.icon = initial(mechsyringe.icon) - mechsyringe.update_icon() - break - sleep(1) - return 1 - - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Topic(href,href_list) - ..() - var/datum/topic_input/afilter = new (href,href_list) - if(afilter.get("toggle_mode")) - mode = !mode - update_equip_info() - return - if(afilter.get("select_reagents")) - processed_reagents.len = 0 - var/m = 0 - var/message - for(var/i=1 to known_reagents.len) - if(m>=synth_speed) - break - var/reagent = afilter.get("reagent_[i]") - if(reagent && (reagent in known_reagents)) - message = "[m ? ", " : null][known_reagents[reagent]]" - processed_reagents += reagent - m++ - if(processed_reagents.len) - message += " added to production" - START_PROCESSING(SSobj, src) - occupant_message(message) - occupant_message("Reagent processing started.") - log_message("Reagent processing started.") - return - if(afilter.get("show_reagents")) - chassis.occupant << browse(get_reagents_page(),"window=msyringegun") - if(afilter.get("purge_reagent")) - var/reagent = afilter.get("purge_reagent") - if(reagent) - reagents.del_reagent(reagent) - return - if(afilter.get("purge_all")) - reagents.clear_reagents() - return - return - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_page() - var/output = {" - - Reagent Synthesizer - - - - -

    Current reagents:

    -
    - [get_current_reagents()] -
    -

    Reagents production:

    -
    - [get_reagents_form()] -
    - - - "} - return output - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_form() - var/r_list = get_reagents_list() - var/inputs - if(r_list) - inputs += "" - inputs += "" - inputs += "" - var/output = {"
    - [r_list || "No known reagents"] - [inputs] -
    - [r_list? "Only the first [synth_speed] selected reagent\s will be added to production" : null] - "} - return output - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_list() - var/output - for(var/i=1 to known_reagents.len) - var/reagent_id = known_reagents[i] - output += {" [known_reagents[reagent_id]]
    "} - return output - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_current_reagents() - var/output - for(var/datum/reagent/R in reagents.reagent_list) - if(R.volume > 0) - output += "[R]: [round(R.volume,0.001)] - Purge Reagent
    " - if(output) - output += "Total: [round(reagents.total_volume,0.001)]/[reagents.maximum_volume] - Purge All" - return output || "None" - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/load_syringe(obj/item/reagent_containers/syringe/S) - if(syringes.len= 2) - occupant_message("The syringe is too far away.") - return 0 - for(var/obj/structure/D in S.loc)//Basic level check for structures in the way (Like grilles and windows) - if(!(D.CanPass(S,src.loc))) - occupant_message("Unable to load syringe.") - return 0 - for(var/obj/machinery/door/D in S.loc)//Checks for doors - if(!(D.CanPass(S,src.loc))) - occupant_message("Unable to load syringe.") - return 0 - S.reagents.trans_to(src, S.reagents.total_volume) - S.forceMove(src) - syringes += S - occupant_message("Syringe loaded.") - update_equip_info() - return 1 - occupant_message("[src]'s syringe chamber is full.") - return 0 - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/analyze_reagents(atom/A) - if(get_dist(src,A) >= 4) - occupant_message("The object is too far away.") - return 0 - if(!A.reagents || ismob(A)) - occupant_message("No reagent info gained from [A].") - return 0 - occupant_message("Analyzing reagents...") - for(var/datum/reagent/R in A.reagents.reagent_list) - if(R.can_synth && add_known_reagent(R.id,R.name)) - occupant_message("Reagent analyzed, identified as [R.name] and added to database.") - send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) - occupant_message("Analyzis complete.") - return 1 - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/add_known_reagent(r_id,r_name) - if(!(r_id in known_reagents)) - known_reagents += r_id - known_reagents[r_id] = r_name - return 1 - return 0 - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/update_equip_info() - if(..()) - send_byjax(chassis.occupant,"msyringegun.browser","reagents",get_current_reagents()) - send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) - return 1 - return - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/on_reagent_change(changetype) - ..() - update_equip_info() - return - - -/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/process() - if(..()) - return - if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain)) - occupant_message("Reagent processing stopped.") - log_message("Reagent processing stopped.") - STOP_PROCESSING(SSobj, src) - return - var/amount = synth_speed / processed_reagents.len - for(var/reagent in processed_reagents) - reagents.add_reagent(reagent,amount) - chassis.use_power(energy_drain) - -///////////////////////////////// Medical Beam /////////////////////////////////////////////////////////////// - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam - name = "exosuit medical beamgun" - desc = "Equipment for medical exosuits. Generates a focused beam of medical nanites." - icon_state = "mecha_medigun" - energy_drain = 10 - range = MECHA_MELEE|MECHA_RANGED - equip_cooldown = 0 - var/obj/item/gun/medbeam/mech/medigun - materials = list(MAT_METAL = 15000, MAT_GLASS = 8000, MAT_PLASMA = 3000, MAT_GOLD = 8000, MAT_DIAMOND = 2000) - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/Initialize() - . = ..() - medigun = new(src) - - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/Destroy() - qdel(medigun) - return ..() - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/process() - if(..()) - return - medigun.process() - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/action(atom/target) - medigun.process_fire(target, loc) - - -/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/detach() - STOP_PROCESSING(SSobj, src) - medigun.LoseTarget() - return ..() +// Sleeper, Medical Beam, and Syringe gun + +/obj/item/mecha_parts/mecha_equipment/medical + +/obj/item/mecha_parts/mecha_equipment/medical/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + +/obj/item/mecha_parts/mecha_equipment/medical/can_attach(obj/mecha/medical/M) + if(..() && istype(M)) + return 1 + + +/obj/item/mecha_parts/mecha_equipment/medical/attach(obj/mecha/M) + ..() + START_PROCESSING(SSobj, src) + +/obj/item/mecha_parts/mecha_equipment/medical/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/process() + if(!chassis) + STOP_PROCESSING(SSobj, src) + return 1 + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/detach() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper + name = "mounted sleeper" + desc = "Equipment for medical exosuits. A mounted sleeper that stabilizes patients and can inject reagents in the exosuit's reserves." + icon = 'icons/obj/machines/sleeper.dmi' + icon_state = "sleeper" + energy_drain = 20 + range = MECHA_MELEE + equip_cooldown = 20 + var/mob/living/carbon/patient = null + var/inject_amount = 10 + salvageable = 0 + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Destroy() + for(var/atom/movable/AM in src) + AM.forceMove(get_turf(src)) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Exit(atom/movable/O) + return 0 + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/action(mob/living/carbon/target) + if(!action_checks(target)) + return + if(!istype(target)) + return + if(!patient_insertion_check(target)) + return + occupant_message("You start putting [target] into [src]...") + chassis.visible_message("[chassis] starts putting [target] into \the [src].") + if(do_after_cooldown(target)) + if(!patient_insertion_check(target)) + return + target.forceMove(src) + patient = target + START_PROCESSING(SSobj, src) + update_equip_info() + occupant_message("[target] successfully loaded into [src]. Life support functions engaged.") + chassis.visible_message("[chassis] loads [target] into [src].") + log_message("[target] loaded. Life support functions engaged.") + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/patient_insertion_check(mob/living/carbon/target) + if(target.buckled) + occupant_message("[target] will not fit into the sleeper because [target.p_theyre()] buckled to [target.buckled]!") + return + if(target.has_buckled_mobs()) + occupant_message("[target] will not fit into the sleeper because of the creatures attached to it!") + return + if(patient) + occupant_message("The sleeper is already occupied!") + return + return 1 + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/go_out() + if(!patient) + return + patient.forceMove(get_turf(src)) + occupant_message("[patient] ejected. Life support functions disabled.") + log_message("[patient] ejected. Life support functions disabled.") + STOP_PROCESSING(SSobj, src) + patient = null + update_equip_info() + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/detach() + if(patient) + occupant_message("Unable to detach [src] - equipment occupied!") + return + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/get_equip_info() + var/output = ..() + if(output) + var/temp = "" + if(patient) + temp = "
    \[Occupant: [patient] ([patient.stat > 1 ? "*DECEASED*" : "Health: [patient.health]%"])\]
    View stats|Eject" + return "[output] [temp]" + return + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/Topic(href,href_list) + ..() + var/datum/topic_input/afilter = new /datum/topic_input(href,href_list) + if(afilter.get("eject")) + go_out() + if(afilter.get("view_stats")) + chassis.occupant << browse(get_patient_stats(),"window=msleeper") + onclose(chassis.occupant, "msleeper") + return + if(afilter.get("inject")) + inject_reagent(afilter.getType("inject", /datum/reagent),afilter.getObj("source")) + return + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_stats() + if(!patient) + return + return {" + + [patient] statistics + + + + +

    Health statistics

    +
    + [get_patient_dam()] +
    +

    Reagents in bloodstream

    +
    + [get_patient_reagents()] +
    +
    + [get_available_reagents()] +
    + + "} + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_dam() + var/t1 + switch(patient.stat) + if(0) + t1 = "Conscious" + if(1) + t1 = "Unconscious" + if(2) + t1 = "*dead*" + else + t1 = "Unknown" + return {"Health: [patient.stat > 1 ? "[t1]" : "[patient.health]% ([t1])"]
    + Core Temperature: [patient.bodytemperature-T0C]°C ([patient.bodytemperature*1.8-459.67]°F)
    + Brute Damage: [patient.getBruteLoss()]%
    + Respiratory Damage: [patient.getOxyLoss()]%
    + Toxin Content: [patient.getToxLoss()]%
    + Burn Severity: [patient.getFireLoss()]%
    + [patient.getCloneLoss() ? "Subject appears to have cellular damage." : ""]
    + [patient.getOrganLoss(ORGAN_SLOT_BRAIN) ? "Significant brain damage detected." : ""]
    + [length(patient.get_traumas()) ? "Brain Traumas detected." : ""]
    + "} + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_reagents() + if(patient.reagents) + for(var/datum/reagent/R in patient.reagents.reagent_list) + if(R.volume > 0) + . += "[R]: [round(R.volume,0.01)]
    " + return . || "None" + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_available_reagents() + var/output + var/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun) in chassis + if(SG && SG.reagents && islist(SG.reagents.reagent_list)) + for(var/datum/reagent/R in SG.reagents.reagent_list) + if(R.volume > 0) + output += "Inject [R.name]
    " + return output + + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/inject_reagent(datum/reagent/R,obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/SG) + if(!R || !patient || !SG || !(SG in chassis.equipment)) + return 0 + var/to_inject = min(R.volume, inject_amount) + if(to_inject && patient.reagents.get_reagent_amount(R.type) + to_inject <= inject_amount*2) + occupant_message("Injecting [patient] with [to_inject] units of [R.name].") + log_message("Injecting [patient] with [to_inject] units of [R.name].") + log_combat(chassis.occupant, patient, "injected", "[name] ([R] - [to_inject] units)") + SG.reagents.trans_id_to(patient,R.type,to_inject) + update_equip_info() + return + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/update_equip_info() + if(..()) + if(patient) + send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_patient_dam()) + send_byjax(chassis.occupant,"msleeper.browser","reagents",get_patient_reagents()) + send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents()) + return 1 + return + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/container_resist(mob/living/user) + go_out() + +/obj/item/mecha_parts/mecha_equipment/medical/sleeper/process() + if(..()) + return + if(!chassis.has_charge(energy_drain)) + set_ready_state(1) + log_message("Deactivated.") + occupant_message("[src] deactivated - no power.") + STOP_PROCESSING(SSobj, src) + return + var/mob/living/carbon/M = patient + if(!M) + return + if(M.health > 0) + M.adjustOxyLoss(-1) + M.AdjustStun(-80) + M.AdjustKnockdown(-80) + M.AdjustUnconscious(-80) + if(M.reagents.get_reagent_amount(/datum/reagent/medicine/epinephrine) < 5) + M.reagents.add_reagent(/datum/reagent/medicine/epinephrine, 5) + chassis.use_power(energy_drain) + update_equip_info() + + + + +///////////////////////////////// Syringe Gun /////////////////////////////////////////////////////////////// + + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun + name = "exosuit syringe gun" + desc = "Equipment for medical exosuits. A chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur." + icon = 'icons/obj/guns/projectile.dmi' + icon_state = "syringegun" + var/list/syringes + var/list/known_reagents + var/list/processed_reagents + var/max_syringes = 10 + var/max_volume = 75 //max reagent volume + var/synth_speed = 5 //[num] reagent units per cycle + energy_drain = 10 + var/mode = 0 //0 - fire syringe, 1 - analyze reagents. + range = MECHA_MELEE|MECHA_RANGED + equip_cooldown = 10 + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Initialize() + . = ..() + create_reagents(max_volume, NO_REACT) + syringes = new + known_reagents = list(/datum/reagent/medicine/epinephrine = "Epinephrine", /datum/reagent/medicine/charcoal = "Charcoal") + processed_reagents = new + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/detach() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/critfail() + ..() + if(reagents) + DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/can_attach(obj/mecha/medical/M) + if(..()) + if(istype(M)) + return 1 + return 0 + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/get_equip_info() + var/output = ..() + if(output) + return "[output] \[[mode? "Analyze" : "Launch"]\]
    \[Syringes: [syringes.len]/[max_syringes] | Reagents: [reagents.total_volume]/[reagents.maximum_volume]\]
    Reagents list" + return + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/action(atom/movable/target) + if(!action_checks(target)) + return + if(istype(target, /obj/item/reagent_containers/syringe)) + return load_syringe(target) + if(istype(target, /obj/item/storage))//Loads syringes from boxes + for(var/obj/item/reagent_containers/syringe/S in target.contents) + load_syringe(S) + return + if(mode) + return analyze_reagents(target) + if(!syringes.len) + occupant_message("No syringes loaded.") + return + if(reagents.total_volume<=0) + occupant_message("No available reagents to load syringe with.") + return + var/turf/trg = get_turf(target) + var/obj/item/reagent_containers/syringe/mechsyringe = syringes[1] + mechsyringe.forceMove(get_turf(chassis)) + reagents.trans_to(mechsyringe, min(mechsyringe.volume, reagents.total_volume)) + syringes -= mechsyringe + mechsyringe.icon = 'icons/obj/chemical.dmi' + mechsyringe.icon_state = "syringeproj" + playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1) + log_message("Launched [mechsyringe] from [src], targeting [target].") + var/mob/originaloccupant = chassis.occupant + spawn(0) + src = null //if src is deleted, still process the syringe + for(var/i=0, i<6, i++) + if(!mechsyringe) + break + if(step_towards(mechsyringe,trg)) + var/list/mobs = new + for(var/mob/living/carbon/M in mechsyringe.loc) + mobs += M + var/mob/living/carbon/M = safepick(mobs) + if(M) + var/R + mechsyringe.visible_message(" [M] was hit by the syringe!") + if(M.can_inject(null, 1)) + if(mechsyringe.reagents) + for(var/datum/reagent/A in mechsyringe.reagents.reagent_list) + R += "[A.name] ([num2text(A.volume)]" + mechsyringe.icon_state = initial(mechsyringe.icon_state) + mechsyringe.icon = initial(mechsyringe.icon) + mechsyringe.reagents.reaction(M, INJECT) + mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume) + M.take_bodypart_damage(2) + log_combat(originaloccupant, M, "shot", "syringegun") + break + else if(mechsyringe.loc == trg) + mechsyringe.icon_state = initial(mechsyringe.icon_state) + mechsyringe.icon = initial(mechsyringe.icon) + mechsyringe.update_icon() + break + else + mechsyringe.icon_state = initial(mechsyringe.icon_state) + mechsyringe.icon = initial(mechsyringe.icon) + mechsyringe.update_icon() + break + sleep(1) + return 1 + + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/Topic(href,href_list) + ..() + var/datum/topic_input/afilter = new (href,href_list) + if(afilter.get("toggle_mode")) + mode = !mode + update_equip_info() + return + if(afilter.get("select_reagents")) + processed_reagents.len = 0 + var/m = 0 + var/message + for(var/i=1 to known_reagents.len) + if(m>=synth_speed) + break + var/reagent = afilter.get("reagent_[i]") + if(reagent && (reagent in known_reagents)) + message = "[m ? ", " : null][known_reagents[reagent]]" + processed_reagents += reagent + m++ + if(processed_reagents.len) + message += " added to production" + START_PROCESSING(SSobj, src) + occupant_message(message) + occupant_message("Reagent processing started.") + log_message("Reagent processing started.") + return + if(afilter.get("show_reagents")) + chassis.occupant << browse(get_reagents_page(),"window=msyringegun") + if(afilter.get("purge_reagent")) + var/reagent = afilter.get("purge_reagent") + if(reagent) + reagents.del_reagent(reagent) + return + if(afilter.get("purge_all")) + reagents.clear_reagents() + return + return + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_page() + var/output = {" + + Reagent Synthesizer + + + + +

    Current reagents:

    +
    + [get_current_reagents()] +
    +

    Reagents production:

    +
    + [get_reagents_form()] +
    + + + "} + return output + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_form() + var/r_list = get_reagents_list() + var/inputs + if(r_list) + inputs += "" + inputs += "" + inputs += "" + var/output = {"
    + [r_list || "No known reagents"] + [inputs] +
    + [r_list? "Only the first [synth_speed] selected reagent\s will be added to production" : null] + "} + return output + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_reagents_list() + var/output + for(var/i=1 to known_reagents.len) + var/reagent_id = known_reagents[i] + output += {" [known_reagents[reagent_id]]
    "} + return output + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/get_current_reagents() + var/output + for(var/datum/reagent/R in reagents.reagent_list) + if(R.volume > 0) + output += "[R]: [round(R.volume,0.001)] - Purge Reagent
    " + if(output) + output += "Total: [round(reagents.total_volume,0.001)]/[reagents.maximum_volume] - Purge All" + return output || "None" + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/load_syringe(obj/item/reagent_containers/syringe/S) + if(syringes.len= 2) + occupant_message("The syringe is too far away.") + return 0 + for(var/obj/structure/D in S.loc)//Basic level check for structures in the way (Like grilles and windows) + if(!(D.CanPass(S,src.loc))) + occupant_message("Unable to load syringe.") + return 0 + for(var/obj/machinery/door/D in S.loc)//Checks for doors + if(!(D.CanPass(S,src.loc))) + occupant_message("Unable to load syringe.") + return 0 + S.reagents.trans_to(src, S.reagents.total_volume) + S.forceMove(src) + syringes += S + occupant_message("Syringe loaded.") + update_equip_info() + return 1 + occupant_message("[src]'s syringe chamber is full.") + return 0 + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/analyze_reagents(atom/A) + if(get_dist(src,A) >= 4) + occupant_message("The object is too far away.") + return 0 + if(!A.reagents || ismob(A)) + occupant_message("No reagent info gained from [A].") + return 0 + occupant_message("Analyzing reagents...") + for(var/datum/reagent/R in A.reagents.reagent_list) + if(R.can_synth && add_known_reagent(R.type,R.name)) + occupant_message("Reagent analyzed, identified as [R.name] and added to database.") + send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) + occupant_message("Analyzis complete.") + return 1 + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/add_known_reagent(r_id,r_name) + if(!(r_id in known_reagents)) + known_reagents += r_id + known_reagents[r_id] = r_name + return 1 + return 0 + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/update_equip_info() + if(..()) + send_byjax(chassis.occupant,"msyringegun.browser","reagents",get_current_reagents()) + send_byjax(chassis.occupant,"msyringegun.browser","reagents_form",get_reagents_form()) + return 1 + return + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/on_reagent_change(changetype) + ..() + update_equip_info() + return + + +/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/process() + if(..()) + return + if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain)) + occupant_message("Reagent processing stopped.") + log_message("Reagent processing stopped.") + STOP_PROCESSING(SSobj, src) + return + var/amount = synth_speed / processed_reagents.len + for(var/reagent in processed_reagents) + reagents.add_reagent(reagent,amount) + chassis.use_power(energy_drain) + +///////////////////////////////// Medical Beam /////////////////////////////////////////////////////////////// + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam + name = "exosuit medical beamgun" + desc = "Equipment for medical exosuits. Generates a focused beam of medical nanites." + icon_state = "mecha_medigun" + energy_drain = 10 + range = MECHA_MELEE|MECHA_RANGED + equip_cooldown = 0 + var/obj/item/gun/medbeam/mech/medigun + materials = list(MAT_METAL = 15000, MAT_GLASS = 8000, MAT_PLASMA = 3000, MAT_GOLD = 8000, MAT_DIAMOND = 2000) + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/Initialize() + . = ..() + medigun = new(src) + + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/Destroy() + qdel(medigun) + return ..() + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/process() + if(..()) + return + medigun.process() + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/action(atom/target) + medigun.process_fire(target, loc) + + +/obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/detach() + STOP_PROCESSING(SSobj, src) + medigun.LoseTarget() + return ..() diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index a2222fa2..c89fe14e 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -169,7 +169,7 @@ /obj/item/mecha_parts/mecha_equipment/extinguisher/Initialize() . = ..() create_reagents(1000) - reagents.add_reagent("water", 1000) + reagents.add_reagent(/datum/reagent/water, 1000) /obj/item/mecha_parts/mecha_equipment/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch. if(!action_checks(target) || get_dist(chassis, target)>3) diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index e07d46dd..a5ed0df2 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -289,10 +289,10 @@ /obj/mecha/proc/mech_toxin_damage(mob/living/target) playsound(src, 'sound/effects/spray2.ogg', 50, 1) if(target.reagents) - if(target.reagents.get_reagent_amount("cryptobiolin") + force < force*2) - target.reagents.add_reagent("cryptobiolin", force/2) - if(target.reagents.get_reagent_amount("toxin") + force < force*2) - target.reagents.add_reagent("toxin", force/2.5) + if(target.reagents.get_reagent_amount(/datum/reagent/cryptobiolin) + force < force*2) + target.reagents.add_reagent(/datum/reagent/cryptobiolin, force/2) + if(target.reagents.get_reagent_amount(/datum/reagent/toxin) + force < force*2) + target.reagents.add_reagent(/datum/reagent/toxin, force/2.5) /obj/mecha/mech_melee_attack(obj/mecha/M) diff --git a/code/game/objects/effects/decals/cleanable/aliens.dm b/code/game/objects/effects/decals/cleanable/aliens.dm index 022cc0ba..676581a2 100644 --- a/code/game/objects/effects/decals/cleanable/aliens.dm +++ b/code/game/objects/effects/decals/cleanable/aliens.dm @@ -1,71 +1,71 @@ -// Note: BYOND is object oriented. There is no reason for this to be copy/pasted blood code. - -/obj/effect/decal/cleanable/blood/xeno - name = "xeno blood" - desc = "It's green and acidic. It looks like... blood?" - color = BLOOD_COLOR_XENO - -/obj/effect/decal/cleanable/blood/splatter/xeno - color = BLOOD_COLOR_XENO - -/obj/effect/decal/cleanable/blood/gibs/xeno - color = BLOOD_COLOR_XENO - gibs_reagent_id = "liquidxenogibs" - gibs_bloodtype = "X*" - -/obj/effect/decal/cleanable/blood/gibs/xeno/Initialize(mapload, list/datum/disease/diseases) - . = ..() - update_icon() - -/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon() - add_atom_colour(blood_DNA_to_color(), FIXED_COLOUR_PRIORITY) - cut_overlays() - var/mutable_appearance/flesh = mutable_appearance(icon, "[icon_state]x_flesh") - flesh.appearance_flags = RESET_COLOR - flesh.color = body_colors - add_overlay(flesh) - -/obj/effect/decal/cleanable/blood/gibs/xeno/streak(list/directions) - set waitfor = FALSE - var/list/diseases = list() - SEND_SIGNAL(src, COMSIG_GIBS_STREAK, directions, diseases) - var/direction = pick(directions) - for(var/i in 0 to pick(0, 200; 1, 150; 2, 50)) - sleep(2) - if(i > 0) - var/obj/effect/decal/cleanable/blood/splatter/xeno/splat = new /obj/effect/decal/cleanable/blood/splatter/xeno(loc, diseases) - splat.transfer_blood_dna(blood_DNA, diseases) - if(!step_to(src, get_step(src, direction), 0)) - break - -/obj/effect/decal/cleanable/blood/gibs/xeno/up - random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibup1","gibup1","gibup1") - -/obj/effect/decal/cleanable/blood/gibs/xeno/down - random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibdown1","gibdown1","gibdown1") - -/obj/effect/decal/cleanable/blood/gibs/xeno/body - random_icon_states = list("gibhead", "gibtorso") - -/obj/effect/decal/cleanable/blood/gibs/xeno/torso - random_icon_states = list("gibtorso") - -/obj/effect/decal/cleanable/blood/gibs/xeno/limb - random_icon_states = list("gibleg", "gibarm") - -/obj/effect/decal/cleanable/blood/gibs/xeno/core - random_icon_states = list("gibmid1", "gibmid2", "gibmid3") - -/obj/effect/decal/cleanable/blood/gibs/xeno/larva - random_icon_states = list("xgiblarva1", "xgiblarva2") - -/obj/effect/decal/cleanable/blood/gibs/xeno/larva/body - random_icon_states = list("xgiblarvahead", "xgiblarvatorso") - -/obj/effect/decal/cleanable/blood/xtracks - icon_state = "tracks" - random_icon_states = null - -/obj/effect/decal/cleanable/blood/xtracks/Initialize() - add_blood_DNA(list("UNKNOWN DNA" = "X*")) - . = ..() +// Note: BYOND is object oriented. There is no reason for this to be copy/pasted blood code. + +/obj/effect/decal/cleanable/blood/xeno + name = "xeno blood" + desc = "It's green and acidic. It looks like... blood?" + color = BLOOD_COLOR_XENO + +/obj/effect/decal/cleanable/blood/splatter/xeno + color = BLOOD_COLOR_XENO + +/obj/effect/decal/cleanable/blood/gibs/xeno + color = BLOOD_COLOR_XENO + gibs_reagent_id = /datum/reagent/liquidgibs/xeno + gibs_bloodtype = "X*" + +/obj/effect/decal/cleanable/blood/gibs/xeno/Initialize(mapload, list/datum/disease/diseases) + . = ..() + update_icon() + +/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon() + add_atom_colour(blood_DNA_to_color(), FIXED_COLOUR_PRIORITY) + cut_overlays() + var/mutable_appearance/flesh = mutable_appearance(icon, "[icon_state]x_flesh") + flesh.appearance_flags = RESET_COLOR + flesh.color = body_colors + add_overlay(flesh) + +/obj/effect/decal/cleanable/blood/gibs/xeno/streak(list/directions) + set waitfor = FALSE + var/list/diseases = list() + SEND_SIGNAL(src, COMSIG_GIBS_STREAK, directions, diseases) + var/direction = pick(directions) + for(var/i in 0 to pick(0, 200; 1, 150; 2, 50)) + sleep(2) + if(i > 0) + var/obj/effect/decal/cleanable/blood/splatter/xeno/splat = new /obj/effect/decal/cleanable/blood/splatter/xeno(loc, diseases) + splat.transfer_blood_dna(blood_DNA, diseases) + if(!step_to(src, get_step(src, direction), 0)) + break + +/obj/effect/decal/cleanable/blood/gibs/xeno/up + random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibup1","gibup1","gibup1") + +/obj/effect/decal/cleanable/blood/gibs/xeno/down + random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibdown1","gibdown1","gibdown1") + +/obj/effect/decal/cleanable/blood/gibs/xeno/body + random_icon_states = list("gibhead", "gibtorso") + +/obj/effect/decal/cleanable/blood/gibs/xeno/torso + random_icon_states = list("gibtorso") + +/obj/effect/decal/cleanable/blood/gibs/xeno/limb + random_icon_states = list("gibleg", "gibarm") + +/obj/effect/decal/cleanable/blood/gibs/xeno/core + random_icon_states = list("gibmid1", "gibmid2", "gibmid3") + +/obj/effect/decal/cleanable/blood/gibs/xeno/larva + random_icon_states = list("xgiblarva1", "xgiblarva2") + +/obj/effect/decal/cleanable/blood/gibs/xeno/larva/body + random_icon_states = list("xgiblarvahead", "xgiblarvatorso") + +/obj/effect/decal/cleanable/blood/xtracks + icon_state = "tracks" + random_icon_states = null + +/obj/effect/decal/cleanable/blood/xtracks/Initialize() + add_blood_DNA(list("UNKNOWN DNA" = "X*")) + . = ..() diff --git a/code/game/objects/effects/decals/cleanable/gibs.dm b/code/game/objects/effects/decals/cleanable/gibs.dm index 287bbd88..1a235e4d 100644 --- a/code/game/objects/effects/decals/cleanable/gibs.dm +++ b/code/game/objects/effects/decals/cleanable/gibs.dm @@ -7,7 +7,7 @@ mergeable_decal = FALSE bloodiness = 0 var/body_colors = "#e3ba84" //a default color just in case. - var/gibs_reagent_id = "liquidgibs" + var/gibs_reagent_id = /datum/reagent/liquidgibs var/gibs_bloodtype = "A+" /obj/effect/decal/cleanable/blood/gibs/Initialize(mapload, list/datum/disease/diseases) @@ -121,7 +121,6 @@ //Lizards /obj/effect/decal/cleanable/blood/gibs/human/lizard body_colors = "117720" - gibs_reagent_id = "liquidgibs" gibs_bloodtype = "L" /obj/effect/decal/cleanable/blood/gibs/human/lizard/Initialize(mapload, list/datum/disease/diseases) @@ -149,7 +148,7 @@ // Slime Gibs /obj/effect/decal/cleanable/blood/gibs/slime desc = "They look gooey and gruesome." - gibs_reagent_id = "liquidslimegibs" + gibs_reagent_id = /datum/reagent/liquidgibs/slime gibs_bloodtype = "GEL" /obj/effect/decal/cleanable/blood/gibs/slime/Initialize(mapload, list/datum/disease/diseases) @@ -188,7 +187,7 @@ /obj/effect/decal/cleanable/blood/gibs/synth desc = "They look sludgy and disgusting." - gibs_reagent_id = "liquidsyntheticgibs" + gibs_reagent_id = /datum/reagent/liquidgibs/synth gibs_bloodtype = "SY" /obj/effect/decal/cleanable/blood/gibs/synth/Initialize(mapload, list/datum/disease/diseases) @@ -199,7 +198,7 @@ /obj/effect/decal/cleanable/blood/gibs/ipc desc = "They look sharp yet oozing." body_colors = "00ff00" - gibs_reagent_id = "liquidoilgibs" + gibs_reagent_id = /datum/reagent/liquidgibs/oil gibs_bloodtype = "HF" /obj/effect/decal/cleanable/blood/gibs/ipc/Initialize(mapload, list/datum/disease/diseases) diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index cae889f3..6a257860 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -1,257 +1,255 @@ -/obj/effect/decal/cleanable/generic - name = "clutter" - desc = "Someone should clean that up." - icon = 'icons/obj/objects.dmi' - icon_state = "shards" - -/obj/effect/decal/cleanable/ash - name = "ashes" - desc = "Ashes to ashes, dust to dust, and into space." - icon = 'icons/obj/objects.dmi' - icon_state = "ash" - mergeable_decal = FALSE - -/obj/effect/decal/cleanable/ash/Initialize() - . = ..() - reagents.add_reagent("ash", 30) - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - -/obj/effect/decal/cleanable/ash/crematorium -//crematoriums need their own ash cause default ash deletes itself if created in an obj - turf_loc_check = FALSE - -/obj/effect/decal/cleanable/ash/large - name = "large pile of ashes" - icon_state = "big_ash" - -/obj/effect/decal/cleanable/ash/large/Initialize() - . = ..() - reagents.add_reagent("ash", 30) //double the amount of ash. - -/obj/effect/decal/cleanable/glass - name = "tiny shards" - desc = "Back to sand." - icon = 'icons/obj/shards.dmi' - icon_state = "tiny" - -/obj/effect/decal/cleanable/glass/Initialize() - . = ..() - setDir(pick(GLOB.cardinals)) - -/obj/effect/decal/cleanable/glass/ex_act() - qdel(src) - -/obj/effect/decal/cleanable/dirt - name = "dirt" - desc = "Someone should clean that up." - icon_state = "dirt" - canSmoothWith = list(/obj/effect/decal/cleanable/dirt, /turf/closed/wall, /obj/structure/falsewall) - smooth = SMOOTH_FALSE - mouse_opacity = MOUSE_OPACITY_TRANSPARENT - -/obj/effect/decal/cleanable/dirt/Initialize() - . = ..() - var/turf/T = get_turf(src) - if(T.tiled_dirt) - smooth = SMOOTH_MORE - icon = 'icons/effects/dirt.dmi' - icon_state = "" - queue_smooth(src) - queue_smooth_neighbors(src) - -/obj/effect/decal/cleanable/dirt/Destroy() - queue_smooth_neighbors(src) - return ..() - -/obj/effect/decal/cleanable/flour - name = "flour" - desc = "It's still good. Four second rule!" - icon_state = "flour" - -/obj/effect/decal/cleanable/greenglow/ecto - name = "ectoplasmic puddle" - desc = "You know who to call." - light_power = 2 - -/obj/effect/decal/cleanable/greenglow - name = "glowing goo" - desc = "Jeez. I hope that's not for lunch." - light_color = LIGHT_COLOR_GREEN - icon_state = "greenglow" - -/obj/effect/decal/cleanable/greenglow/Initialize(mapload) - . = ..() - set_light(2, 0.8, "#22FFAA") - -/obj/effect/decal/cleanable/greenglow/radioactive - name = "radioactive hazard" - desc = "You should really clean this up..." - var/rad_pulse_strength = 5 - var/last_event = 0 - var/active = null - -/obj/effect/decal/cleanable/greenglow/radioactive/Crossed(atom/movable/O) - . = ..() - if(ismob(O)) - radiate() - -/obj/effect/decal/cleanable/greenglow/radioactive/proc/radiate() - if(!active) - if(world.time > last_event+15) - active = 1 - radiation_pulse(src, rad_pulse_strength) - for(var/obj/effect/decal/cleanable/greenglow/radioactive/T in orange(1,src)) - T.radiate() - last_event = world.time - active = 0 - return - -/obj/effect/decal/cleanable/greenglow/ex_act() - return - -/obj/effect/decal/cleanable/cobweb - name = "cobweb" - desc = "Somebody should remove that." - gender = NEUTER - layer = WALL_OBJ_LAYER - icon_state = "cobweb1" - resistance_flags = FLAMMABLE - -/obj/effect/decal/cleanable/cobweb/cobweb2 - icon_state = "cobweb2" - -/obj/effect/decal/cleanable/molten_object - name = "gooey grey mass" - desc = "It looks like a melted... something." - gender = NEUTER - icon = 'icons/effects/effects.dmi' - icon_state = "molten" - mergeable_decal = FALSE - -/obj/effect/decal/cleanable/molten_object/large - name = "big gooey grey mass" - icon_state = "big_molten" - -//Vomit (sorry) -/obj/effect/decal/cleanable/vomit - name = "vomit" - desc = "Gosh, how unpleasant." - icon = 'icons/effects/blood.dmi' - icon_state = "vomit_1" - random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4") - -/obj/effect/decal/cleanable/vomit/attack_hand(mob/user) - . = ..() - if(.) - return - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(isflyperson(H)) - playsound(get_turf(src), 'sound/items/drink.ogg', 50, 1) //slurp - H.visible_message("[H] extends a small proboscis into the vomit pool, sucking it with a slurping sound.") - if(reagents) - for(var/datum/reagent/R in reagents.reagent_list) - if (istype(R, /datum/reagent/consumable)) - var/datum/reagent/consumable/nutri_check = R - if(nutri_check.nutriment_factor >0) - H.nutrition += nutri_check.nutriment_factor * nutri_check.volume - reagents.remove_reagent(nutri_check.id,nutri_check.volume) - reagents.trans_to(H, reagents.total_volume) - qdel(src) - -/obj/effect/decal/cleanable/vomit/old - name = "crusty dried vomit" - desc = "You try not to look at the chunks, and fail." - -/obj/effect/decal/cleanable/vomit/old/Initialize(mapload, list/datum/disease/diseases) - . = ..() - icon_state += "-old" - -/obj/effect/decal/cleanable/tomato_smudge - name = "tomato smudge" - desc = "It's red." - gender = NEUTER - icon = 'icons/effects/tomatodecal.dmi' - random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3") - -/obj/effect/decal/cleanable/plant_smudge - name = "plant smudge" - gender = NEUTER - icon = 'icons/effects/tomatodecal.dmi' - random_icon_states = list("smashed_plant") - -/obj/effect/decal/cleanable/egg_smudge - name = "smashed egg" - desc = "Seems like this one won't hatch." - gender = NEUTER - icon = 'icons/effects/tomatodecal.dmi' - random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3") - -/obj/effect/decal/cleanable/pie_smudge //honk - name = "smashed pie" - desc = "It's pie cream from a cream pie." - gender = NEUTER - icon = 'icons/effects/tomatodecal.dmi' - random_icon_states = list("smashed_pie") - -/obj/effect/decal/cleanable/chem_pile - name = "chemical pile" - desc = "A pile of chemicals. You can't quite tell what's inside it." - gender = NEUTER - icon = 'icons/obj/objects.dmi' - icon_state = "ash" - -/obj/effect/decal/cleanable/shreds - name = "shreds" - desc = "The shredded remains of what appears to be clothing." - icon_state = "shreds" - gender = PLURAL - mergeable_decal = FALSE - -/obj/effect/decal/cleanable/shreds/ex_act(severity, target) - if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion. - qdel(src) - -/obj/effect/decal/cleanable/shreds/Initialize() - pixel_x = rand(-10, 10) - pixel_y = rand(-10, 10) - . = ..() - -/obj/effect/decal/cleanable/salt - name = "salt pile" - desc = "A sizable pile of table salt. Someone must be upset." - icon = 'icons/effects/tomatodecal.dmi' - icon_state = "salt_pile" - gender = NEUTER - -/obj/effect/decal/cleanable/glitter - name = "generic glitter pile" - desc = "The herpes of arts and crafts." - icon = 'icons/effects/atmospherics.dmi' - gender = NEUTER - -/obj/effect/decal/cleanable/glitter/pink - name = "pink glitter" - icon_state = "plasma_old" - -/obj/effect/decal/cleanable/glitter/white - name = "white glitter" - icon_state = "nitrous_oxide_old" - -/obj/effect/decal/cleanable/glitter/blue - name = "blue glitter" - icon_state = "freon_old" - -/obj/effect/decal/cleanable/plasma - name = "stabilized plasma" - desc = "A puddle of stabilized plasma." - icon_state = "flour" - color = "#9e0089" - -/obj/effect/decal/cleanable/insectguts - name = "insect guts" - desc = "One bug squashed. Four more will rise in its place." - icon = 'icons/effects/blood.dmi' - icon_state = "xfloor1" - random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7") +/obj/effect/decal/cleanable/generic + name = "clutter" + desc = "Someone should clean that up." + icon = 'icons/obj/objects.dmi' + icon_state = "shards" + +/obj/effect/decal/cleanable/ash + name = "ashes" + desc = "Ashes to ashes, dust to dust, and into space." + icon = 'icons/obj/objects.dmi' + icon_state = "ash" + mergeable_decal = FALSE + +/obj/effect/decal/cleanable/ash/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/ash, 30) + pixel_x = rand(-5, 5) + pixel_y = rand(-5, 5) + +/obj/effect/decal/cleanable/ash/crematorium +//crematoriums need their own ash cause default ash deletes itself if created in an obj + turf_loc_check = FALSE + +/obj/effect/decal/cleanable/ash/large + name = "large pile of ashes" + icon_state = "big_ash" + +/obj/effect/decal/cleanable/ash/large/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/ash, 30) //double the amount of ash. + +/obj/effect/decal/cleanable/glass + name = "tiny shards" + desc = "Back to sand." + icon = 'icons/obj/shards.dmi' + icon_state = "tiny" + +/obj/effect/decal/cleanable/glass/Initialize() + . = ..() + setDir(pick(GLOB.cardinals)) + +/obj/effect/decal/cleanable/glass/ex_act() + qdel(src) + +/obj/effect/decal/cleanable/dirt + name = "dirt" + desc = "Someone should clean that up." + icon_state = "dirt" + canSmoothWith = list(/obj/effect/decal/cleanable/dirt, /turf/closed/wall, /obj/structure/falsewall) + smooth = SMOOTH_FALSE + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + +/obj/effect/decal/cleanable/dirt/Initialize() + . = ..() + var/turf/T = get_turf(src) + if(T.tiled_dirt) + smooth = SMOOTH_MORE + icon = 'icons/effects/dirt.dmi' + icon_state = "" + queue_smooth(src) + queue_smooth_neighbors(src) + +/obj/effect/decal/cleanable/dirt/Destroy() + queue_smooth_neighbors(src) + return ..() + +/obj/effect/decal/cleanable/flour + name = "flour" + desc = "It's still good. Four second rule!" + icon_state = "flour" + +/obj/effect/decal/cleanable/greenglow/ecto + name = "ectoplasmic puddle" + desc = "You know who to call." + light_power = 2 + +/obj/effect/decal/cleanable/greenglow + name = "glowing goo" + desc = "Jeez. I hope that's not for lunch." + light_color = LIGHT_COLOR_GREEN + icon_state = "greenglow" + +/obj/effect/decal/cleanable/greenglow/Initialize(mapload) + . = ..() + set_light(2, 0.8, "#22FFAA") + +/obj/effect/decal/cleanable/greenglow/radioactive + name = "radioactive hazard" + desc = "You should really clean this up..." + var/rad_pulse_strength = 5 + var/last_event = 0 + var/active = null + +/obj/effect/decal/cleanable/greenglow/radioactive/Crossed(atom/movable/O) + . = ..() + if(ismob(O)) + radiate() + +/obj/effect/decal/cleanable/greenglow/radioactive/proc/radiate() + if(!active) + if(world.time > last_event+15) + active = 1 + radiation_pulse(src, rad_pulse_strength) + for(var/obj/effect/decal/cleanable/greenglow/radioactive/T in orange(1,src)) + T.radiate() + last_event = world.time + active = 0 + return + +/obj/effect/decal/cleanable/greenglow/ex_act() + return + +/obj/effect/decal/cleanable/cobweb + name = "cobweb" + desc = "Somebody should remove that." + gender = NEUTER + layer = WALL_OBJ_LAYER + icon_state = "cobweb1" + resistance_flags = FLAMMABLE + +/obj/effect/decal/cleanable/cobweb/cobweb2 + icon_state = "cobweb2" + +/obj/effect/decal/cleanable/molten_object + name = "gooey grey mass" + desc = "It looks like a melted... something." + gender = NEUTER + icon = 'icons/effects/effects.dmi' + icon_state = "molten" + mergeable_decal = FALSE + +/obj/effect/decal/cleanable/molten_object/large + name = "big gooey grey mass" + icon_state = "big_molten" + +//Vomit (sorry) +/obj/effect/decal/cleanable/vomit + name = "vomit" + desc = "Gosh, how unpleasant." + icon = 'icons/effects/blood.dmi' + icon_state = "vomit_1" + random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4") + +/obj/effect/decal/cleanable/vomit/attack_hand(mob/user) + . = ..() + if(.) + return + if(ishuman(user)) + var/mob/living/carbon/human/H = user + if(isflyperson(H)) + playsound(get_turf(src), 'sound/items/drink.ogg', 50, 1) //slurp + H.visible_message("[H] extends a small proboscis into the vomit pool, sucking it with a slurping sound.") + if(reagents) + for(var/datum/reagent/consumable/R in reagents.reagent_list) + if(R.nutriment_factor > 0) + H.nutrition += R.nutriment_factor * R.volume + reagents.del_reagent(R.type) + reagents.trans_to(H, reagents.total_volume) + qdel(src) + +/obj/effect/decal/cleanable/vomit/old + name = "crusty dried vomit" + desc = "You try not to look at the chunks, and fail." + +/obj/effect/decal/cleanable/vomit/old/Initialize(mapload, list/datum/disease/diseases) + . = ..() + icon_state += "-old" + +/obj/effect/decal/cleanable/tomato_smudge + name = "tomato smudge" + desc = "It's red." + gender = NEUTER + icon = 'icons/effects/tomatodecal.dmi' + random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3") + +/obj/effect/decal/cleanable/plant_smudge + name = "plant smudge" + gender = NEUTER + icon = 'icons/effects/tomatodecal.dmi' + random_icon_states = list("smashed_plant") + +/obj/effect/decal/cleanable/egg_smudge + name = "smashed egg" + desc = "Seems like this one won't hatch." + gender = NEUTER + icon = 'icons/effects/tomatodecal.dmi' + random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3") + +/obj/effect/decal/cleanable/pie_smudge //honk + name = "smashed pie" + desc = "It's pie cream from a cream pie." + gender = NEUTER + icon = 'icons/effects/tomatodecal.dmi' + random_icon_states = list("smashed_pie") + +/obj/effect/decal/cleanable/chem_pile + name = "chemical pile" + desc = "A pile of chemicals. You can't quite tell what's inside it." + gender = NEUTER + icon = 'icons/obj/objects.dmi' + icon_state = "ash" + +/obj/effect/decal/cleanable/shreds + name = "shreds" + desc = "The shredded remains of what appears to be clothing." + icon_state = "shreds" + gender = PLURAL + mergeable_decal = FALSE + +/obj/effect/decal/cleanable/shreds/ex_act(severity, target) + if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion. + qdel(src) + +/obj/effect/decal/cleanable/shreds/Initialize() + pixel_x = rand(-10, 10) + pixel_y = rand(-10, 10) + . = ..() + +/obj/effect/decal/cleanable/salt + name = "salt pile" + desc = "A sizable pile of table salt. Someone must be upset." + icon = 'icons/effects/tomatodecal.dmi' + icon_state = "salt_pile" + gender = NEUTER + +/obj/effect/decal/cleanable/glitter + name = "generic glitter pile" + desc = "The herpes of arts and crafts." + icon = 'icons/effects/atmospherics.dmi' + gender = NEUTER + +/obj/effect/decal/cleanable/glitter/pink + name = "pink glitter" + icon_state = "plasma_old" + +/obj/effect/decal/cleanable/glitter/white + name = "white glitter" + icon_state = "nitrous_oxide_old" + +/obj/effect/decal/cleanable/glitter/blue + name = "blue glitter" + icon_state = "freon_old" + +/obj/effect/decal/cleanable/plasma + name = "stabilized plasma" + desc = "A puddle of stabilized plasma." + icon_state = "flour" + color = "#9e0089" + +/obj/effect/decal/cleanable/insectguts + name = "insect guts" + desc = "One bug squashed. Four more will rise in its place." + icon = 'icons/effects/blood.dmi' + icon_state = "xfloor1" + random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7") diff --git a/code/game/objects/effects/decals/cleanable/robots.dm b/code/game/objects/effects/decals/cleanable/robots.dm index cd208d33..3e94abbf 100644 --- a/code/game/objects/effects/decals/cleanable/robots.dm +++ b/code/game/objects/effects/decals/cleanable/robots.dm @@ -1,65 +1,65 @@ -// Note: BYOND is object oriented. There is no reason for this to be copy/pasted blood code. - -/obj/effect/decal/cleanable/robot_debris - name = "robot debris" - desc = "It's a useless heap of junk... or is it?" - icon = 'icons/mob/robots.dmi' - icon_state = "gib1" - layer = LOW_OBJ_LAYER - random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7") - blood_state = BLOOD_STATE_OIL - bloodiness = BLOOD_AMOUNT_PER_DECAL - mergeable_decal = FALSE - -/obj/effect/decal/cleanable/robot_debris/Initialize(mapload, list/datum/disease/diseases) - . = ..() - reagents.add_reagent("liquidoilgibs", 5) - -/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions) - set waitfor = 0 - var/direction = pick(directions) - for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++) - sleep(2) - if (i > 0) - if (prob(40)) - new /obj/effect/decal/cleanable/oil/streak(src.loc) - else if (prob(10)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(3, 1, src) - s.start() - if (!step_to(src, get_step(src, direction), 0)) - break - -/obj/effect/decal/cleanable/robot_debris/ex_act() - return - -/obj/effect/decal/cleanable/robot_debris/limb - random_icon_states = list("gibarm", "gibleg") - -/obj/effect/decal/cleanable/robot_debris/up - random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibup1","gibup1") - -/obj/effect/decal/cleanable/robot_debris/down - random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown1","gibdown1") - -/obj/effect/decal/cleanable/oil - name = "motor oil" - desc = "It's black and greasy. Looks like Beepsky made another mess." - icon = 'icons/mob/robots.dmi' - icon_state = "floor1" - random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") - blood_state = BLOOD_STATE_OIL - bloodiness = BLOOD_AMOUNT_PER_DECAL - -/obj/effect/decal/cleanable/oil/Initialize() - . = ..() - reagents.add_reagent("oil", 30) - reagents.add_reagent("liquidoilgibs", 5) - -/obj/effect/decal/cleanable/oil/streak - random_icon_states = list("streak1", "streak2", "streak3", "streak4", "streak5") - -/obj/effect/decal/cleanable/oil/slippery - -/obj/effect/decal/cleanable/oil/slippery/Initialize() - AddComponent(/datum/component/slippery, 80, (NO_SLIP_WHEN_WALKING | SLIDE)) +// Note: BYOND is object oriented. There is no reason for this to be copy/pasted blood code. + +/obj/effect/decal/cleanable/robot_debris + name = "robot debris" + desc = "It's a useless heap of junk... or is it?" + icon = 'icons/mob/robots.dmi' + icon_state = "gib1" + layer = LOW_OBJ_LAYER + random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7") + blood_state = BLOOD_STATE_OIL + bloodiness = BLOOD_AMOUNT_PER_DECAL + mergeable_decal = FALSE + +/obj/effect/decal/cleanable/robot_debris/Initialize(mapload, list/datum/disease/diseases) + . = ..() + reagents.add_reagent(/datum/reagent/liquidgibs, 5) + +/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions) + set waitfor = 0 + var/direction = pick(directions) + for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++) + sleep(2) + if (i > 0) + if (prob(40)) + new /obj/effect/decal/cleanable/oil/streak(src.loc) + else if (prob(10)) + var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread + s.set_up(3, 1, src) + s.start() + if (!step_to(src, get_step(src, direction), 0)) + break + +/obj/effect/decal/cleanable/robot_debris/ex_act() + return + +/obj/effect/decal/cleanable/robot_debris/limb + random_icon_states = list("gibarm", "gibleg") + +/obj/effect/decal/cleanable/robot_debris/up + random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibup1","gibup1") + +/obj/effect/decal/cleanable/robot_debris/down + random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown1","gibdown1") + +/obj/effect/decal/cleanable/oil + name = "motor oil" + desc = "It's black and greasy. Looks like Beepsky made another mess." + icon = 'icons/mob/robots.dmi' + icon_state = "floor1" + random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") + blood_state = BLOOD_STATE_OIL + bloodiness = BLOOD_AMOUNT_PER_DECAL + +/obj/effect/decal/cleanable/oil/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/oil, 30) + reagents.add_reagent(/datum/reagent/liquidgibs/oil, 5) + +/obj/effect/decal/cleanable/oil/streak + random_icon_states = list("streak1", "streak2", "streak3", "streak4", "streak5") + +/obj/effect/decal/cleanable/oil/slippery + +/obj/effect/decal/cleanable/oil/slippery/Initialize() + AddComponent(/datum/component/slippery, 80, (NO_SLIP_WHEN_WALKING | SLIDE)) diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 06fa3612..5c809a35 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -1,347 +1,347 @@ -// Foam -// Similar to smoke, but slower and mobs absorb its reagent through their exposed skin. -#define ALUMINUM_FOAM 1 -#define IRON_FOAM 2 -#define RESIN_FOAM 3 - - -/obj/effect/particle_effect/foam - name = "foam" - icon_state = "foam" - opacity = 0 - anchored = TRUE - density = FALSE - layer = EDGED_TURF_LAYER - mouse_opacity = MOUSE_OPACITY_TRANSPARENT - var/amount = 3 - animate_movement = 0 - var/metal = 0 - var/lifetime = 40 - var/reagent_divisor = 7 - var/static/list/blacklisted_turfs = typecacheof(list( - /turf/open/space/transit, - /turf/open/chasm, - /turf/open/lava)) - -/obj/effect/particle_effect/foam/firefighting - name = "firefighting foam" - lifetime = 20 //doesn't last as long as normal foam - amount = 0 //no spread - var/absorbed_plasma = 0 - -/obj/effect/particle_effect/foam/firefighting/MakeSlippery() - return - -/obj/effect/particle_effect/foam/firefighting/process() - ..() - - var/turf/open/T = get_turf(src) - var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T) - if(hotspot && istype(T) && T.air) - qdel(hotspot) - var/datum/gas_mixture/G = T.air - var/plas_amt = min(30,G.gases[/datum/gas/plasma]) //Absorb some plasma - G.gases[/datum/gas/plasma] -= plas_amt - absorbed_plasma += plas_amt - if(G.temperature > T20C) - G.temperature = max(G.temperature/2,T20C) - GAS_GARBAGE_COLLECT(G.gases) - T.air_update_turf() - -/obj/effect/particle_effect/foam/firefighting/kill_foam() - STOP_PROCESSING(SSfastprocess, src) - - if(absorbed_plasma) - var/obj/effect/decal/cleanable/plasma/P = (locate(/obj/effect/decal/cleanable/plasma) in get_turf(src)) - if(!P) - P = new(loc) - P.reagents.add_reagent("stable_plasma", absorbed_plasma) - - flick("[icon_state]-disolve", src) - QDEL_IN(src, 5) - -/obj/effect/particle_effect/foam/firefighting/foam_mob(mob/living/L) - if(!istype(L)) - return - L.adjust_fire_stacks(-2) - L.ExtinguishMob() - -/obj/effect/particle_effect/foam/firefighting/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - return - -/obj/effect/particle_effect/foam/metal - name = "aluminium foam" - metal = ALUMINUM_FOAM - icon_state = "mfoam" - -/obj/effect/particle_effect/foam/metal/MakeSlippery() - return - -/obj/effect/particle_effect/foam/metal/smart - name = "smart foam" - -/obj/effect/particle_effect/foam/metal/iron - name = "iron foam" - metal = IRON_FOAM - -/obj/effect/particle_effect/foam/metal/resin - name = "resin foam" - metal = RESIN_FOAM - -/obj/effect/particle_effect/foam/long_life - lifetime = 150 - -/obj/effect/particle_effect/foam/Initialize() - . = ..() - MakeSlippery() - create_reagents(1000) //limited by the size of the reagent holder anyway. - START_PROCESSING(SSfastprocess, src) - playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3) - -/obj/effect/particle_effect/foam/proc/MakeSlippery() - AddComponent(/datum/component/slippery, 100) - -/obj/effect/particle_effect/foam/Destroy() - STOP_PROCESSING(SSfastprocess, src) - return ..() - - -/obj/effect/particle_effect/foam/proc/kill_foam() - STOP_PROCESSING(SSfastprocess, src) - switch(metal) - if(ALUMINUM_FOAM) - new /obj/structure/foamedmetal(get_turf(src)) - if(IRON_FOAM) - new /obj/structure/foamedmetal/iron(get_turf(src)) - if(RESIN_FOAM) - new /obj/structure/foamedmetal/resin(get_turf(src)) - flick("[icon_state]-disolve", src) - QDEL_IN(src, 5) - -/obj/effect/particle_effect/foam/smart/kill_foam() //Smart foam adheres to area borders for walls - STOP_PROCESSING(SSfastprocess, src) - if(metal) - var/turf/T = get_turf(src) - if(isspaceturf(T)) //Block up any exposed space - T.PlaceOnTop(/turf/open/floor/plating/foam) - for(var/direction in GLOB.cardinals) - var/turf/cardinal_turf = get_step(T, direction) - if(get_area(cardinal_turf) != get_area(T)) //We're at an area boundary, so let's block off this turf! - new/obj/structure/foamedmetal(T) - break - flick("[icon_state]-disolve", src) - QDEL_IN(src, 5) - -/obj/effect/particle_effect/foam/process() - lifetime-- - if(lifetime < 1) - kill_foam() - return - - var/fraction = 1/initial(reagent_divisor) - for(var/obj/O in range(0,src)) - if(O.type == src.type) - continue - if(isturf(O.loc)) - var/turf/T = O.loc - if(T.intact && O.level == 1) //hidden under the floor - continue - if(lifetime % reagent_divisor) - reagents.reaction(O, VAPOR, fraction) - var/hit = 0 - for(var/mob/living/L in range(0,src)) - hit += foam_mob(L) - if(hit) - lifetime++ //this is so the decrease from mobs hit and the natural decrease don't cumulate. - var/T = get_turf(src) - if(lifetime % reagent_divisor) - reagents.reaction(T, VAPOR, fraction) - - if(--amount < 0) - return - spread_foam() - -/obj/effect/particle_effect/foam/proc/foam_mob(mob/living/L) - if(lifetime<1) - return 0 - if(!istype(L)) - return 0 - var/fraction = 1/initial(reagent_divisor) - if(lifetime % reagent_divisor) - reagents.reaction(L, VAPOR, fraction) - lifetime-- - return 1 - -/obj/effect/particle_effect/foam/proc/spread_foam() - var/turf/t_loc = get_turf(src) - for(var/turf/T in t_loc.GetAtmosAdjacentTurfs()) - var/obj/effect/particle_effect/foam/foundfoam = locate() in T //Don't spread foam where there's already foam! - if(foundfoam) - continue - - if(is_type_in_typecache(T, blacklisted_turfs)) - continue - - for(var/mob/living/L in T) - foam_mob(L) - var/obj/effect/particle_effect/foam/F = new src.type(T) - F.amount = amount - reagents.copy_to(F, (reagents.total_volume)) - F.add_atom_colour(color, FIXED_COLOUR_PRIORITY) - F.metal = metal - - -/obj/effect/particle_effect/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(prob(max(0, exposed_temperature - 475))) //foam dissolves when heated - kill_foam() - - -/obj/effect/particle_effect/foam/metal/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - return - - -/////////////////////////////////////////////// -//FOAM EFFECT DATUM -/datum/effect_system/foam_spread - var/amount = 10 // the size of the foam spread. - var/obj/chemholder - effect_type = /obj/effect/particle_effect/foam - var/metal = 0 - - -/datum/effect_system/foam_spread/metal - effect_type = /obj/effect/particle_effect/foam/metal - - -/datum/effect_system/foam_spread/metal/smart - effect_type = /obj/effect/particle_effect/foam/smart - - -/datum/effect_system/foam_spread/long - effect_type = /obj/effect/particle_effect/foam/long_life - -/datum/effect_system/foam_spread/New() - ..() - chemholder = new /obj() - var/datum/reagents/R = new/datum/reagents(1000) - chemholder.reagents = R - R.my_atom = chemholder - -/datum/effect_system/foam_spread/Destroy() - qdel(chemholder) - chemholder = null - return ..() - -/datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null) - if(isturf(loca)) - location = loca - else - location = get_turf(loca) - - amount = round(sqrt(amt / 2), 1) - carry.copy_to(chemholder, carry.total_volume) - -/datum/effect_system/foam_spread/metal/set_up(amt=5, loca, datum/reagents/carry = null, metaltype) - ..() - metal = metaltype - -/datum/effect_system/foam_spread/start() - var/obj/effect/particle_effect/foam/F = new effect_type(location) - var/foamcolor = mix_color_from_reagents(chemholder.reagents.reagent_list) - chemholder.reagents.copy_to(F, chemholder.reagents.total_volume/amount) - F.add_atom_colour(foamcolor, FIXED_COLOUR_PRIORITY) - F.amount = amount - F.metal = metal - - -////////////////////////////////////////////////////////// -// FOAM STRUCTURE. Formed by metal foams. Dense and opaque, but easy to break -/obj/structure/foamedmetal - icon = 'icons/effects/effects.dmi' - icon_state = "metalfoam" - density = TRUE - opacity = 1 // changed in New() - anchored = TRUE - layer = EDGED_TURF_LAYER - resistance_flags = FIRE_PROOF | ACID_PROOF - name = "foamed metal" - desc = "A lightweight foamed metal wall." - gender = PLURAL - max_integrity = 20 - CanAtmosPass = ATMOS_PASS_DENSITY - -/obj/structure/foamedmetal/Initialize() - . = ..() - air_update_turf(1) - -/obj/structure/foamedmetal/Move() - var/turf/T = loc - . = ..() - move_update_air(T) - -/obj/structure/foamedmetal/attack_paw(mob/user) - return attack_hand(user) - -/obj/structure/foamedmetal/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) - playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1) - -/obj/structure/foamedmetal/attack_hand(mob/user) - . = ..() - if(.) - return - user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation(src, ATTACK_EFFECT_PUNCH) - to_chat(user, "You hit [src] but bounce off it!") - playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1) - -/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target) - return !density - -/obj/structure/foamedmetal/iron - max_integrity = 50 - icon_state = "ironfoam" - -//Atmos Backpack Resin, transparent, prevents atmos and filters the air -/obj/structure/foamedmetal/resin - name = "\improper ATMOS Resin" - desc = "A lightweight, transparent resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature." - opacity = FALSE - icon_state = "atmos_resin" - alpha = 120 - max_integrity = 10 - -/obj/structure/foamedmetal/resin/Initialize() - . = ..() - if(isopenturf(loc)) - var/turf/open/O = loc - O.ClearWet() - if(O.air) - var/datum/gas_mixture/G = O.air - G.temperature = 293.15 - for(var/obj/effect/hotspot/H in O) - qdel(H) - var/list/G_gases = G.gases - for(var/I in G_gases) - if(I == /datum/gas/oxygen || I == /datum/gas/nitrogen) - continue - G_gases[I] = 0 - GAS_GARBAGE_COLLECT(G.gases) - O.air_update_turf() - for(var/obj/machinery/atmospherics/components/unary/U in O) - if(!U.welded) - U.welded = TRUE - U.update_icon() - U.visible_message("[U] sealed shut!") - for(var/mob/living/L in O) - L.ExtinguishMob() - for(var/obj/item/Item in O) - Item.extinguish() - -/obj/structure/foamedmetal/resin/CanPass(atom/movable/mover, turf/target) - if(istype(mover) && (mover.pass_flags & PASSGLASS)) - return TRUE - . = ..() - -#undef ALUMINUM_FOAM -#undef IRON_FOAM -#undef RESIN_FOAM +// Foam +// Similar to smoke, but slower and mobs absorb its reagent through their exposed skin. +#define ALUMINUM_FOAM 1 +#define IRON_FOAM 2 +#define RESIN_FOAM 3 + + +/obj/effect/particle_effect/foam + name = "foam" + icon_state = "foam" + opacity = 0 + anchored = TRUE + density = FALSE + layer = EDGED_TURF_LAYER + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + var/amount = 3 + animate_movement = 0 + var/metal = 0 + var/lifetime = 40 + var/reagent_divisor = 7 + var/static/list/blacklisted_turfs = typecacheof(list( + /turf/open/space/transit, + /turf/open/chasm, + /turf/open/lava)) + +/obj/effect/particle_effect/foam/firefighting + name = "firefighting foam" + lifetime = 20 //doesn't last as long as normal foam + amount = 0 //no spread + var/absorbed_plasma = 0 + +/obj/effect/particle_effect/foam/firefighting/MakeSlippery() + return + +/obj/effect/particle_effect/foam/firefighting/process() + ..() + + var/turf/open/T = get_turf(src) + var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T) + if(hotspot && istype(T) && T.air) + qdel(hotspot) + var/datum/gas_mixture/G = T.air + var/plas_amt = min(30,G.gases[/datum/gas/plasma]) //Absorb some plasma + G.gases[/datum/gas/plasma] -= plas_amt + absorbed_plasma += plas_amt + if(G.temperature > T20C) + G.temperature = max(G.temperature/2,T20C) + GAS_GARBAGE_COLLECT(G.gases) + T.air_update_turf() + +/obj/effect/particle_effect/foam/firefighting/kill_foam() + STOP_PROCESSING(SSfastprocess, src) + + if(absorbed_plasma) + var/obj/effect/decal/cleanable/plasma/P = (locate(/obj/effect/decal/cleanable/plasma) in get_turf(src)) + if(!P) + P = new(loc) + P.reagents.add_reagent(/datum/reagent/stable_plasma, absorbed_plasma) + + flick("[icon_state]-disolve", src) + QDEL_IN(src, 5) + +/obj/effect/particle_effect/foam/firefighting/foam_mob(mob/living/L) + if(!istype(L)) + return + L.adjust_fire_stacks(-2) + L.ExtinguishMob() + +/obj/effect/particle_effect/foam/firefighting/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + return + +/obj/effect/particle_effect/foam/metal + name = "aluminium foam" + metal = ALUMINUM_FOAM + icon_state = "mfoam" + +/obj/effect/particle_effect/foam/metal/MakeSlippery() + return + +/obj/effect/particle_effect/foam/metal/smart + name = "smart foam" + +/obj/effect/particle_effect/foam/metal/iron + name = "iron foam" + metal = IRON_FOAM + +/obj/effect/particle_effect/foam/metal/resin + name = "resin foam" + metal = RESIN_FOAM + +/obj/effect/particle_effect/foam/long_life + lifetime = 150 + +/obj/effect/particle_effect/foam/Initialize() + . = ..() + MakeSlippery() + create_reagents(1000) //limited by the size of the reagent holder anyway. + START_PROCESSING(SSfastprocess, src) + playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3) + +/obj/effect/particle_effect/foam/proc/MakeSlippery() + AddComponent(/datum/component/slippery, 100) + +/obj/effect/particle_effect/foam/Destroy() + STOP_PROCESSING(SSfastprocess, src) + return ..() + + +/obj/effect/particle_effect/foam/proc/kill_foam() + STOP_PROCESSING(SSfastprocess, src) + switch(metal) + if(ALUMINUM_FOAM) + new /obj/structure/foamedmetal(get_turf(src)) + if(IRON_FOAM) + new /obj/structure/foamedmetal/iron(get_turf(src)) + if(RESIN_FOAM) + new /obj/structure/foamedmetal/resin(get_turf(src)) + flick("[icon_state]-disolve", src) + QDEL_IN(src, 5) + +/obj/effect/particle_effect/foam/smart/kill_foam() //Smart foam adheres to area borders for walls + STOP_PROCESSING(SSfastprocess, src) + if(metal) + var/turf/T = get_turf(src) + if(isspaceturf(T)) //Block up any exposed space + T.PlaceOnTop(/turf/open/floor/plating/foam) + for(var/direction in GLOB.cardinals) + var/turf/cardinal_turf = get_step(T, direction) + if(get_area(cardinal_turf) != get_area(T)) //We're at an area boundary, so let's block off this turf! + new/obj/structure/foamedmetal(T) + break + flick("[icon_state]-disolve", src) + QDEL_IN(src, 5) + +/obj/effect/particle_effect/foam/process() + lifetime-- + if(lifetime < 1) + kill_foam() + return + + var/fraction = 1/initial(reagent_divisor) + for(var/obj/O in range(0,src)) + if(O.type == src.type) + continue + if(isturf(O.loc)) + var/turf/T = O.loc + if(T.intact && O.level == 1) //hidden under the floor + continue + if(lifetime % reagent_divisor) + reagents.reaction(O, VAPOR, fraction) + var/hit = 0 + for(var/mob/living/L in range(0,src)) + hit += foam_mob(L) + if(hit) + lifetime++ //this is so the decrease from mobs hit and the natural decrease don't cumulate. + var/T = get_turf(src) + if(lifetime % reagent_divisor) + reagents.reaction(T, VAPOR, fraction) + + if(--amount < 0) + return + spread_foam() + +/obj/effect/particle_effect/foam/proc/foam_mob(mob/living/L) + if(lifetime<1) + return 0 + if(!istype(L)) + return 0 + var/fraction = 1/initial(reagent_divisor) + if(lifetime % reagent_divisor) + reagents.reaction(L, VAPOR, fraction) + lifetime-- + return 1 + +/obj/effect/particle_effect/foam/proc/spread_foam() + var/turf/t_loc = get_turf(src) + for(var/turf/T in t_loc.GetAtmosAdjacentTurfs()) + var/obj/effect/particle_effect/foam/foundfoam = locate() in T //Don't spread foam where there's already foam! + if(foundfoam) + continue + + if(is_type_in_typecache(T, blacklisted_turfs)) + continue + + for(var/mob/living/L in T) + foam_mob(L) + var/obj/effect/particle_effect/foam/F = new src.type(T) + F.amount = amount + reagents.copy_to(F, (reagents.total_volume)) + F.add_atom_colour(color, FIXED_COLOUR_PRIORITY) + F.metal = metal + + +/obj/effect/particle_effect/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(prob(max(0, exposed_temperature - 475))) //foam dissolves when heated + kill_foam() + + +/obj/effect/particle_effect/foam/metal/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + return + + +/////////////////////////////////////////////// +//FOAM EFFECT DATUM +/datum/effect_system/foam_spread + var/amount = 10 // the size of the foam spread. + var/obj/chemholder + effect_type = /obj/effect/particle_effect/foam + var/metal = 0 + + +/datum/effect_system/foam_spread/metal + effect_type = /obj/effect/particle_effect/foam/metal + + +/datum/effect_system/foam_spread/metal/smart + effect_type = /obj/effect/particle_effect/foam/smart + + +/datum/effect_system/foam_spread/long + effect_type = /obj/effect/particle_effect/foam/long_life + +/datum/effect_system/foam_spread/New() + ..() + chemholder = new /obj() + var/datum/reagents/R = new/datum/reagents(1000) + chemholder.reagents = R + R.my_atom = chemholder + +/datum/effect_system/foam_spread/Destroy() + qdel(chemholder) + chemholder = null + return ..() + +/datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null) + if(isturf(loca)) + location = loca + else + location = get_turf(loca) + + amount = round(sqrt(amt / 2), 1) + carry.copy_to(chemholder, carry.total_volume) + +/datum/effect_system/foam_spread/metal/set_up(amt=5, loca, datum/reagents/carry = null, metaltype) + ..() + metal = metaltype + +/datum/effect_system/foam_spread/start() + var/obj/effect/particle_effect/foam/F = new effect_type(location) + var/foamcolor = mix_color_from_reagents(chemholder.reagents.reagent_list) + chemholder.reagents.copy_to(F, chemholder.reagents.total_volume/amount) + F.add_atom_colour(foamcolor, FIXED_COLOUR_PRIORITY) + F.amount = amount + F.metal = metal + + +////////////////////////////////////////////////////////// +// FOAM STRUCTURE. Formed by metal foams. Dense and opaque, but easy to break +/obj/structure/foamedmetal + icon = 'icons/effects/effects.dmi' + icon_state = "metalfoam" + density = TRUE + opacity = 1 // changed in New() + anchored = TRUE + layer = EDGED_TURF_LAYER + resistance_flags = FIRE_PROOF | ACID_PROOF + name = "foamed metal" + desc = "A lightweight foamed metal wall." + gender = PLURAL + max_integrity = 20 + CanAtmosPass = ATMOS_PASS_DENSITY + +/obj/structure/foamedmetal/Initialize() + . = ..() + air_update_turf(1) + +/obj/structure/foamedmetal/Move() + var/turf/T = loc + . = ..() + move_update_air(T) + +/obj/structure/foamedmetal/attack_paw(mob/user) + return attack_hand(user) + +/obj/structure/foamedmetal/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) + playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1) + +/obj/structure/foamedmetal/attack_hand(mob/user) + . = ..() + if(.) + return + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src, ATTACK_EFFECT_PUNCH) + to_chat(user, "You hit [src] but bounce off it!") + playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1) + +/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target) + return !density + +/obj/structure/foamedmetal/iron + max_integrity = 50 + icon_state = "ironfoam" + +//Atmos Backpack Resin, transparent, prevents atmos and filters the air +/obj/structure/foamedmetal/resin + name = "\improper ATMOS Resin" + desc = "A lightweight, transparent resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature." + opacity = FALSE + icon_state = "atmos_resin" + alpha = 120 + max_integrity = 10 + +/obj/structure/foamedmetal/resin/Initialize() + . = ..() + if(isopenturf(loc)) + var/turf/open/O = loc + O.ClearWet() + if(O.air) + var/datum/gas_mixture/G = O.air + G.temperature = 293.15 + for(var/obj/effect/hotspot/H in O) + qdel(H) + var/list/G_gases = G.gases + for(var/I in G_gases) + if(I == /datum/gas/oxygen || I == /datum/gas/nitrogen) + continue + G_gases[I] = 0 + GAS_GARBAGE_COLLECT(G.gases) + O.air_update_turf() + for(var/obj/machinery/atmospherics/components/unary/U in O) + if(!U.welded) + U.welded = TRUE + U.update_icon() + U.visible_message("[U] sealed shut!") + for(var/mob/living/L in O) + L.ExtinguishMob() + for(var/obj/item/Item in O) + Item.extinguish() + +/obj/structure/foamedmetal/resin/CanPass(atom/movable/mover, turf/target) + if(istype(mover) && (mover.pass_flags & PASSGLASS)) + return TRUE + . = ..() + +#undef ALUMINUM_FOAM +#undef IRON_FOAM +#undef RESIN_FOAM diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 2e1e7e00..8ae6ba9c 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -1,176 +1,176 @@ -/obj/effect/mine - name = "dummy mine" - desc = "Better stay away from that thing." - density = FALSE - anchored = TRUE - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "uglymine" - var/triggered = 0 - -/obj/effect/mine/proc/mineEffect(mob/victim) - to_chat(victim, "*click*") - -/obj/effect/mine/Crossed(AM as mob|obj) - if(isturf(loc)) - if(ismob(AM)) - var/mob/MM = AM - if(!(MM.movement_type & FLYING)) - triggermine(AM) - else - triggermine(AM) - -/obj/effect/mine/proc/triggermine(mob/victim) - if(triggered) - return - visible_message("[victim] sets off [icon2html(src, viewers(src))] [src]!") - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(3, 1, src) - s.start() - mineEffect(victim) - triggered = 1 - qdel(src) - - -/obj/effect/mine/explosive - name = "explosive mine" - var/range_devastation = 0 - var/range_heavy = 1 - var/range_light = 2 - var/range_flash = 3 - -/obj/effect/mine/explosive/mineEffect(mob/victim) - explosion(loc, range_devastation, range_heavy, range_light, range_flash) - - -/obj/effect/mine/stun - name = "stun mine" - var/stun_time = 80 - -/obj/effect/mine/stun/mineEffect(mob/living/victim) - if(isliving(victim)) - victim.Knockdown(stun_time) - -/obj/effect/mine/kickmine - name = "kick mine" - -/obj/effect/mine/kickmine/mineEffect(mob/victim) - if(isliving(victim) && victim.client) - to_chat(victim, "You have been kicked FOR NO REISIN!") - qdel(victim.client) - - -/obj/effect/mine/gas - name = "oxygen mine" - var/gas_amount = 360 - var/gas_type = "o2" - -/obj/effect/mine/gas/mineEffect(mob/victim) - atmos_spawn_air("[gas_type]=[gas_amount]") - - -/obj/effect/mine/gas/plasma - name = "plasma mine" - gas_type = "plasma" - - -/obj/effect/mine/gas/n2o - name = "\improper N2O mine" - gas_type = "n2o" - - -/obj/effect/mine/sound - name = "honkblaster 1000" - var/sound = 'sound/items/bikehorn.ogg' - -/obj/effect/mine/sound/mineEffect(mob/victim) - playsound(loc, sound, 100, 1) - - -/obj/effect/mine/sound/bwoink - name = "bwoink mine" - sound = 'sound/effects/adminhelp.ogg' - -/obj/effect/mine/pickup - name = "pickup" - desc = "pick me up" - icon = 'icons/effects/effects.dmi' - icon_state = "electricity2" - density = FALSE - var/duration = 0 - -/obj/effect/mine/pickup/Initialize() - . = ..() - animate(src, pixel_y = 4, time = 20, loop = -1) - -/obj/effect/mine/pickup/triggermine(mob/victim) - if(triggered) - return - triggered = 1 - invisibility = INVISIBILITY_ABSTRACT - mineEffect(victim) - qdel(src) - - -/obj/effect/mine/pickup/bloodbath - name = "Red Orb" - desc = "You feel angry just looking at it." - duration = 1200 //2min - color = "#FF0000" - -/obj/effect/mine/pickup/bloodbath/mineEffect(mob/living/carbon/victim) - if(!victim.client || !istype(victim)) - return - to_chat(victim, "RIP AND TEAR") - var/old_color = victim.client.color - var/static/list/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0) - var/static/list/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0) - - spawn(0) - new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0) - - var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc) - victim.log_message("entered a blood frenzy", LOG_ATTACK) - - ADD_TRAIT(chainsaw, TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT) - victim.drop_all_held_items() - victim.put_in_hands(chainsaw, forced = TRUE) - chainsaw.attack_self(victim) - chainsaw.wield(victim) - victim.reagents.add_reagent("adminordrazine",25) - to_chat(victim, "KILL, KILL, KILL! YOU HAVE NO ALLIES ANYMORE, KILL THEM ALL!") - - victim.client.color = pure_red - animate(victim.client,color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT) - sleep(10) - animate(victim.client,color = old_color, time = duration)//, easing = SINE_EASING|EASE_OUT) - sleep(duration) - to_chat(victim, "Your bloodlust seeps back into the bog of your subconscious and you regain self control.") - qdel(chainsaw) - victim.log_message("exited a blood frenzy", LOG_ATTACK) - qdel(src) - -/obj/effect/mine/pickup/healing - name = "Blue Orb" - desc = "You feel better just looking at it." - color = "#0000FF" - -/obj/effect/mine/pickup/healing/mineEffect(mob/living/carbon/victim) - if(!victim.client || !istype(victim)) - return - to_chat(victim, "You feel great!") - victim.revive(full_heal = 1, admin_revive = 1) - -/obj/effect/mine/pickup/speed - name = "Yellow Orb" - desc = "You feel faster just looking at it." - color = "#FFFF00" - duration = 300 - -/obj/effect/mine/pickup/speed/mineEffect(mob/living/carbon/victim) - if(!victim.client || !istype(victim)) - return - to_chat(victim, "You feel fast!") - ADD_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb") - sleep(duration) - REMOVE_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb") - to_chat(victim, "You slow down.") +/obj/effect/mine + name = "dummy mine" + desc = "Better stay away from that thing." + density = FALSE + anchored = TRUE + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "uglymine" + var/triggered = 0 + +/obj/effect/mine/proc/mineEffect(mob/victim) + to_chat(victim, "*click*") + +/obj/effect/mine/Crossed(AM as mob|obj) + if(isturf(loc)) + if(ismob(AM)) + var/mob/MM = AM + if(!(MM.movement_type & FLYING)) + triggermine(AM) + else + triggermine(AM) + +/obj/effect/mine/proc/triggermine(mob/victim) + if(triggered) + return + visible_message("[victim] sets off [icon2html(src, viewers(src))] [src]!") + var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread + s.set_up(3, 1, src) + s.start() + mineEffect(victim) + triggered = 1 + qdel(src) + + +/obj/effect/mine/explosive + name = "explosive mine" + var/range_devastation = 0 + var/range_heavy = 1 + var/range_light = 2 + var/range_flash = 3 + +/obj/effect/mine/explosive/mineEffect(mob/victim) + explosion(loc, range_devastation, range_heavy, range_light, range_flash) + + +/obj/effect/mine/stun + name = "stun mine" + var/stun_time = 80 + +/obj/effect/mine/stun/mineEffect(mob/living/victim) + if(isliving(victim)) + victim.Knockdown(stun_time) + +/obj/effect/mine/kickmine + name = "kick mine" + +/obj/effect/mine/kickmine/mineEffect(mob/victim) + if(isliving(victim) && victim.client) + to_chat(victim, "You have been kicked FOR NO REISIN!") + qdel(victim.client) + + +/obj/effect/mine/gas + name = "oxygen mine" + var/gas_amount = 360 + var/gas_type = "o2" + +/obj/effect/mine/gas/mineEffect(mob/victim) + atmos_spawn_air("[gas_type]=[gas_amount]") + + +/obj/effect/mine/gas/plasma + name = "plasma mine" + gas_type = "plasma" + + +/obj/effect/mine/gas/n2o + name = "\improper N2O mine" + gas_type = "n2o" + + +/obj/effect/mine/sound + name = "honkblaster 1000" + var/sound = 'sound/items/bikehorn.ogg' + +/obj/effect/mine/sound/mineEffect(mob/victim) + playsound(loc, sound, 100, 1) + + +/obj/effect/mine/sound/bwoink + name = "bwoink mine" + sound = 'sound/effects/adminhelp.ogg' + +/obj/effect/mine/pickup + name = "pickup" + desc = "pick me up" + icon = 'icons/effects/effects.dmi' + icon_state = "electricity2" + density = FALSE + var/duration = 0 + +/obj/effect/mine/pickup/Initialize() + . = ..() + animate(src, pixel_y = 4, time = 20, loop = -1) + +/obj/effect/mine/pickup/triggermine(mob/victim) + if(triggered) + return + triggered = 1 + invisibility = INVISIBILITY_ABSTRACT + mineEffect(victim) + qdel(src) + + +/obj/effect/mine/pickup/bloodbath + name = "Red Orb" + desc = "You feel angry just looking at it." + duration = 1200 //2min + color = "#FF0000" + +/obj/effect/mine/pickup/bloodbath/mineEffect(mob/living/carbon/victim) + if(!victim.client || !istype(victim)) + return + to_chat(victim, "RIP AND TEAR") + var/old_color = victim.client.color + var/static/list/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0) + var/static/list/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0) + + spawn(0) + new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0) + + var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc) + victim.log_message("entered a blood frenzy", LOG_ATTACK) + + ADD_TRAIT(chainsaw, TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT) + victim.drop_all_held_items() + victim.put_in_hands(chainsaw, forced = TRUE) + chainsaw.attack_self(victim) + chainsaw.wield(victim) + victim.reagents.add_reagent(/datum/reagent/medicine/adminordrazine,25) + to_chat(victim, "KILL, KILL, KILL! YOU HAVE NO ALLIES ANYMORE, KILL THEM ALL!") + + victim.client.color = pure_red + animate(victim.client,color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT) + sleep(10) + animate(victim.client,color = old_color, time = duration)//, easing = SINE_EASING|EASE_OUT) + sleep(duration) + to_chat(victim, "Your bloodlust seeps back into the bog of your subconscious and you regain self control.") + qdel(chainsaw) + victim.log_message("exited a blood frenzy", LOG_ATTACK) + qdel(src) + +/obj/effect/mine/pickup/healing + name = "Blue Orb" + desc = "You feel better just looking at it." + color = "#0000FF" + +/obj/effect/mine/pickup/healing/mineEffect(mob/living/carbon/victim) + if(!victim.client || !istype(victim)) + return + to_chat(victim, "You feel great!") + victim.revive(full_heal = 1, admin_revive = 1) + +/obj/effect/mine/pickup/speed + name = "Yellow Orb" + desc = "You feel faster just looking at it." + color = "#FFFF00" + duration = 300 + +/obj/effect/mine/pickup/speed/mineEffect(mob/living/carbon/victim) + if(!victim.client || !istype(victim)) + return + to_chat(victim, "You feel fast!") + ADD_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb") + sleep(duration) + REMOVE_TRAIT(victim, TRAIT_GOTTAGOREALLYFAST, "yellow_orb") + to_chat(victim, "You slow down.") diff --git a/code/game/objects/items/RSF.dm b/code/game/objects/items/RSF.dm index b6196b0c..62d6aae7 100644 --- a/code/game/objects/items/RSF.dm +++ b/code/game/objects/items/RSF.dm @@ -180,7 +180,7 @@ RSF to_chat(user, "Fabricating Cookie..") var/obj/item/reagent_containers/food/snacks/cookie/S = new /obj/item/reagent_containers/food/snacks/cookie(T) if(toxin) - S.reagents.add_reagent("chloralhydratedelayed", 10) + S.reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 10) if (iscyborg(user)) var/mob/living/silicon/robot/R = user R.cell.charge -= 100 diff --git a/code/game/objects/items/airlock_painter.dm b/code/game/objects/items/airlock_painter.dm index 1dac4df9..2a91584e 100644 --- a/code/game/objects/items/airlock_painter.dm +++ b/code/game/objects/items/airlock_painter.dm @@ -1,126 +1,126 @@ -/obj/item/airlock_painter - name = "airlock painter" - desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob." - icon = 'icons/obj/objects.dmi' - icon_state = "paint sprayer" - item_state = "paint sprayer" - - w_class = WEIGHT_CLASS_SMALL - - materials = list(MAT_METAL=50, MAT_GLASS=50) - - flags_1 = CONDUCT_1 - item_flags = NOBLUDGEON - slot_flags = ITEM_SLOT_BELT - usesound = 'sound/effects/spray2.ogg' - - var/obj/item/toner/ink = null - -/obj/item/airlock_painter/Initialize() - . = ..() - ink = new /obj/item/toner(src) - -//This proc doesn't just check if the painter can be used, but also uses it. -//Only call this if you are certain that the painter will be used right after this check! -/obj/item/airlock_painter/proc/use_paint(mob/user) - if(can_use(user)) - ink.charges-- - playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1) - return 1 - else - return 0 - -//This proc only checks if the painter can be used. -//Call this if you don't want the painter to be used right after this check, for example -//because you're expecting user input. -/obj/item/airlock_painter/proc/can_use(mob/user) - if(!ink) - to_chat(user, "There is no toner cartridge installed in [src]!") - return 0 - else if(ink.charges < 1) - to_chat(user, "[src] is out of ink!") - return 0 - else - return 1 - -/obj/item/airlock_painter/suicide_act(mob/user) - var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS) - - if(can_use(user) && L) - user.visible_message("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!") - use(user) - - // Once you've inhaled the toner, you throw up your lungs - // and then die. - - // Find out if there is an open turf in front of us, - // and if not, pick the turf we are standing on. - var/turf/T = get_step(get_turf(src), user.dir) - if(!isopenturf(T)) - T = get_turf(src) - - // they managed to lose their lungs between then and - // now. Good job. - if(!L) - return OXYLOSS - - L.Remove(user) - - // make some colorful reagent, and apply it to the lungs - L.create_reagents(10) - L.reagents.add_reagent("colorful_reagent", 10) - L.reagents.reaction(L, TOUCH, 1) - - // TODO maybe add some colorful vomit? - - user.visible_message("[user] vomits out [user.p_their()] [L]!") - playsound(user.loc, 'sound/effects/splat.ogg', 50, 1) - - L.forceMove(T) - - return (TOXLOSS|OXYLOSS) - else if(can_use(user) && !L) - user.visible_message("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide.") - user.reagents.add_reagent("colorful_reagent", 1) - user.reagents.reaction(user, TOUCH, 1) - return TOXLOSS - - else - user.visible_message("[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner.") - return SHAME - - -/obj/item/airlock_painter/examine(mob/user) - . = ..() - if(!ink) - . += "It doesn't have a toner cartridge installed." - return - var/ink_level = "high" - if(ink.charges < 1) - ink_level = "empty" - else if((ink.charges/ink.max_charges) <= 0.25) //25% - ink_level = "low" - else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit) - ink_level = "dangerously high" - . += "Its ink levels look [ink_level]." - -/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/toner)) - if(ink) - to_chat(user, "[src] already contains \a [ink].") - return - if(!user.transferItemToLoc(W, src)) - return - to_chat(user, "You install [W] into [src].") - ink = W - playsound(src.loc, 'sound/machines/click.ogg', 50, 1) - else - return ..() - -/obj/item/airlock_painter/attack_self(mob/user) - if(ink) - playsound(src.loc, 'sound/machines/click.ogg', 50, 1) - ink.forceMove(user.drop_location()) - user.put_in_hands(ink) - to_chat(user, "You remove [ink] from [src].") - ink = null +/obj/item/airlock_painter + name = "airlock painter" + desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob." + icon = 'icons/obj/objects.dmi' + icon_state = "paint sprayer" + item_state = "paint sprayer" + + w_class = WEIGHT_CLASS_SMALL + + materials = list(MAT_METAL=50, MAT_GLASS=50) + + flags_1 = CONDUCT_1 + item_flags = NOBLUDGEON + slot_flags = ITEM_SLOT_BELT + usesound = 'sound/effects/spray2.ogg' + + var/obj/item/toner/ink = null + +/obj/item/airlock_painter/Initialize() + . = ..() + ink = new /obj/item/toner(src) + +//This proc doesn't just check if the painter can be used, but also uses it. +//Only call this if you are certain that the painter will be used right after this check! +/obj/item/airlock_painter/proc/use_paint(mob/user) + if(can_use(user)) + ink.charges-- + playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1) + return 1 + else + return 0 + +//This proc only checks if the painter can be used. +//Call this if you don't want the painter to be used right after this check, for example +//because you're expecting user input. +/obj/item/airlock_painter/proc/can_use(mob/user) + if(!ink) + to_chat(user, "There is no toner cartridge installed in [src]!") + return 0 + else if(ink.charges < 1) + to_chat(user, "[src] is out of ink!") + return 0 + else + return 1 + +/obj/item/airlock_painter/suicide_act(mob/user) + var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS) + + if(can_use(user) && L) + user.visible_message("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!") + use(user) + + // Once you've inhaled the toner, you throw up your lungs + // and then die. + + // Find out if there is an open turf in front of us, + // and if not, pick the turf we are standing on. + var/turf/T = get_step(get_turf(src), user.dir) + if(!isopenturf(T)) + T = get_turf(src) + + // they managed to lose their lungs between then and + // now. Good job. + if(!L) + return OXYLOSS + + L.Remove(user) + + // make some colorful reagent, and apply it to the lungs + L.create_reagents(10) + L.reagents.add_reagent(/datum/reagent/colorful_reagent, 10) + L.reagents.reaction(L, TOUCH, 1) + + // TODO maybe add some colorful vomit? + + user.visible_message("[user] vomits out [user.p_their()] [L]!") + playsound(user.loc, 'sound/effects/splat.ogg', 50, 1) + + L.forceMove(T) + + return (TOXLOSS|OXYLOSS) + else if(can_use(user) && !L) + user.visible_message("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide.") + user.reagents.add_reagent(/datum/reagent/colorful_reagent, 1) + user.reagents.reaction(user, TOUCH, 1) + return TOXLOSS + + else + user.visible_message("[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner.") + return SHAME + + +/obj/item/airlock_painter/examine(mob/user) + . = ..() + if(!ink) + . += "It doesn't have a toner cartridge installed." + return + var/ink_level = "high" + if(ink.charges < 1) + ink_level = "empty" + else if((ink.charges/ink.max_charges) <= 0.25) //25% + ink_level = "low" + else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit) + ink_level = "dangerously high" + . += "Its ink levels look [ink_level]." + +/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/toner)) + if(ink) + to_chat(user, "[src] already contains \a [ink].") + return + if(!user.transferItemToLoc(W, src)) + return + to_chat(user, "You install [W] into [src].") + ink = W + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + else + return ..() + +/obj/item/airlock_painter/attack_self(mob/user) + if(ink) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + ink.forceMove(user.drop_location()) + user.put_in_hands(ink) + to_chat(user, "You remove [ink] from [src].") + ink = null diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index 25ae1822..c725148d 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -120,4 +120,4 @@ flags_1 = CONDUCT_1 w_class = WEIGHT_CLASS_SMALL materials = list(MAT_METAL=50, MAT_GLASS=50) - grind_results = list("iron" = 10, "silicon" = 10) + grind_results = list(/datum/reagent/iron = 10, /datum/reagent/silicon = 10) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 6dae3a41..6982bba9 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -1,1068 +1,1068 @@ -//cleansed 9/15/2012 17:48 - -/* -CONTAINS: -MATCHES -CIGARETTES -CIGARS -SMOKING PIPES -CHEAP LIGHTERS -ZIPPO - -CIGARETTE PACKETS ARE IN FANCY.DM -*/ - -/////////// -//MATCHES// -/////////// -/obj/item/match - name = "match" - desc = "A simple match stick, used for lighting fine smokables." - icon = 'icons/obj/cigarettes.dmi' - icon_state = "match_unlit" - var/lit = FALSE - var/burnt = FALSE - var/smoketime = 5 - w_class = WEIGHT_CLASS_TINY - heat = 1000 - grind_results = list("phosphorus" = 2) - -/obj/item/match/process() - smoketime-- - if(smoketime < 1) - matchburnout() - else - open_flame(heat) - -/obj/item/match/fire_act(exposed_temperature, exposed_volume) - matchignite() - -/obj/item/match/proc/matchignite() - if(!lit && !burnt) - lit = TRUE - icon_state = "match_lit" - damtype = "fire" - force = 3 - hitsound = 'sound/items/welder.ogg' - item_state = "cigon" - name = "lit match" - desc = "A match. This one is lit." - attack_verb = list("burnt","singed") - START_PROCESSING(SSobj, src) - update_icon() - -/obj/item/match/proc/matchburnout() - if(lit) - lit = FALSE - burnt = TRUE - damtype = "brute" - force = initial(force) - icon_state = "match_burnt" - item_state = "cigoff" - name = "burnt match" - desc = "A match. This one has seen better days." - attack_verb = list("flicked") - STOP_PROCESSING(SSobj, src) - -/obj/item/match/dropped(mob/user) - matchburnout() - . = ..() - -/obj/item/match/attack(mob/living/carbon/M, mob/living/carbon/user) - if(!isliving(M)) - return - if(lit && M.IgniteMob()) - message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]") - log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]") - var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M) - if(lit && cig && user.a_intent == INTENT_HELP) - if(cig.lit) - to_chat(user, "[cig] is already lit.") - if(M == user) - cig.attackby(src, user) - else - cig.light("[user] holds [src] out for [M], and lights [cig].") - else - ..() - -/obj/item/proc/help_light_cig(mob/living/M) - var/mask_item = M.get_item_by_slot(SLOT_WEAR_MASK) - if(istype(mask_item, /obj/item/clothing/mask/cigarette)) - return mask_item - -/obj/item/match/is_hot() - return lit * heat - -////////////////// -//FINE SMOKABLES// -////////////////// -/obj/item/clothing/mask/cigarette - name = "cigarette" - desc = "A roll of tobacco and nicotine." - icon_state = "cigoff" - throw_speed = 0.5 - item_state = "cigoff" - w_class = WEIGHT_CLASS_TINY - body_parts_covered = null - grind_results = list() - var/lit = FALSE - var/starts_lit = FALSE - var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi - var/icon_off = "cigoff" - var/type_butt = /obj/item/cigbutt - var/lastHolder = null - var/smoketime = 300 - var/chem_volume = 30 - var/list/list_reagents = list("nicotine" = 15) - heat = 1000 - -/obj/item/clothing/mask/cigarette/suicide_act(mob/user) - user.visible_message("[user] is huffing [src] as quickly as [user.p_they()] can! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer.") - return (TOXLOSS|OXYLOSS) - -/obj/item/clothing/mask/cigarette/Initialize() - . = ..() - create_reagents(chem_volume, INJECTABLE | NO_REACT) // so it doesn't react until you light it - if(list_reagents) - reagents.add_reagent_list(list_reagents) - if(starts_lit) - light() - AddComponent(/datum/component/knockoff,90,list(BODY_ZONE_PRECISE_MOUTH),list(SLOT_WEAR_MASK))//90% to knock off when wearing a mask - -/obj/item/clothing/mask/cigarette/Destroy() - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/item/clothing/mask/cigarette/attackby(obj/item/W, mob/user, params) - if(!lit && smoketime > 0) - var/lighting_text = W.ignition_effect(src, user) - if(lighting_text) - light(lighting_text) - else - return ..() - -/obj/item/clothing/mask/cigarette/afterattack(obj/item/reagent_containers/glass/glass, mob/user, proximity) - . = ..() - if(!proximity || lit) //can't dip if cigarette is lit (it will heat the reagents in the glass instead) - return - if(istype(glass)) //you can dip cigarettes into beakers - if(glass.reagents.trans_to(src, chem_volume)) //if reagents were transfered, show the message - to_chat(user, "You dip \the [src] into \the [glass].") - else //if not, either the beaker was empty, or the cigarette was full - if(!glass.reagents.total_volume) - to_chat(user, "[glass] is empty.") - else - to_chat(user, "[src] is full.") - - -/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null) - if(lit) - return - if(!(flags_1 & INITIALIZED_1)) - icon_state = icon_on - item_state = icon_on - return - - lit = TRUE - name = "lit [name]" - attack_verb = list("burnt", "singed") - hitsound = 'sound/items/welder.ogg' - damtype = "fire" - force = 4 - if(reagents.get_reagent_amount("plasma")) // the plasma explodes when exposed to fire - var/datum/effect_system/reagents_explosion/e = new() - e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0) - e.start() - qdel(src) - return - if(reagents.get_reagent_amount("welding_fuel")) // the fuel explodes, too, but much less violently - var/datum/effect_system/reagents_explosion/e = new() - e.set_up(round(reagents.get_reagent_amount("welding_fuel") / 5, 1), get_turf(src), 0, 0) - e.start() - qdel(src) - return - // allowing reagents to react after being lit - DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) - reagents.handle_reactions() - icon_state = icon_on - item_state = icon_on - if(flavor_text) - var/turf/T = get_turf(src) - T.visible_message(flavor_text) - START_PROCESSING(SSobj, src) - - //can't think of any other way to update the overlays :< - if(ismob(loc)) - var/mob/M = loc - M.update_inv_wear_mask() - M.update_inv_hands() - - -/obj/item/clothing/mask/cigarette/proc/handle_reagents() - if(reagents.total_volume) - if(iscarbon(loc)) - var/mob/living/carbon/C = loc - if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob - var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1) - reagents.reaction(C, INGEST, fraction) - if(!reagents.trans_to(C, REAGENTS_METABOLISM)) - reagents.remove_any(REAGENTS_METABOLISM) - return - reagents.remove_any(REAGENTS_METABOLISM) - - -/obj/item/clothing/mask/cigarette/process() - var/turf/location = get_turf(src) - var/mob/living/M = loc - if(isliving(loc)) - M.IgniteMob() - smoketime-- - if(smoketime < 1) - new type_butt(location) - if(ismob(loc)) - to_chat(M, "Your [name] goes out.") - qdel(src) - return - open_flame() - if(reagents && reagents.total_volume) - handle_reagents() - -/obj/item/clothing/mask/cigarette/attack_self(mob/user) - if(lit) - user.visible_message("[user] calmly drops and treads on \the [src], putting it out instantly.") - new type_butt(user.loc) - new /obj/effect/decal/cleanable/ash(user.loc) - qdel(src) - . = ..() - -/obj/item/clothing/mask/cigarette/attack(mob/living/carbon/M, mob/living/carbon/user) - if(!istype(M)) - return ..() - if(M.on_fire && !lit) - light("[user] lights [src] with [M]'s burning body. What a cold-blooded badass.") - return - var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M) - if(lit && cig && user.a_intent == INTENT_HELP) - if(cig.lit) - to_chat(user, "The [cig.name] is already lit.") - if(M == user) - cig.attackby(src, user) - else - cig.light("[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name].") - else - return ..() - -/obj/item/clothing/mask/cigarette/fire_act(exposed_temperature, exposed_volume) - light() - -/obj/item/clothing/mask/cigarette/is_hot() - return lit * heat - -// Cigarette brands. - -/obj/item/clothing/mask/cigarette/space_cigarette - desc = "A Space Cigarette brand cigarette." - -/obj/item/clothing/mask/cigarette/dromedary - desc = "A DromedaryCo brand cigarette." - list_reagents = list("nicotine" = 7.5, "silicon" = 7.5) - -/obj/item/clothing/mask/cigarette/smokekins - desc = "A Kinaris Corp brand cigarette" - list_reagents = list("nicotine" = 7.5, "gold" = 1) - -/obj/item/clothing/mask/cigarette/uplift - desc = "An Uplift Smooth brand cigarette." - list_reagents = list("nicotine" = 7.5, "menthol" = 7.5) - -/obj/item/clothing/mask/cigarette/robust - desc = "A Robust brand cigarette." - list_reagents = list("nicotine" = 7.5, "grenadine" = 7.5) - -/obj/item/clothing/mask/cigarette/robustgold - desc = "A Robust Gold brand cigarette." - list_reagents = list("nicotine" = 15, "gold" = 1) - -/obj/item/clothing/mask/cigarette/carp - desc = "A Carp Classic brand cigarette." - list_reagents = list("nicotine" = 7.5, "sodiumchloride" = 7.5) - -/obj/item/clothing/mask/cigarette/syndicate - desc = "An unknown brand cigarette." - list_reagents = list("nicotine" = 15, "omnizine" = 15) - -/obj/item/clothing/mask/cigarette/shadyjims - desc = "A Shady Jim's Super Slims cigarette." - list_reagents = list("nicotine" = 15, "lipolicide" = 4, "ammonia" = 2, "plantbgone" = 1, "toxin" = 1.5) - -/obj/item/clothing/mask/cigarette/xeno - desc = "A Xeno Filtered brand cigarette." - list_reagents = list ("nicotine" = 20, "regen_jelly" = 15, "krokodil" = 4) - -// Rollies. - -/obj/item/clothing/mask/cigarette/rollie - name = "rollie" - desc = "A roll of dried plant matter wrapped in thin paper." - icon_state = "spliffoff" - icon_on = "spliffon" - icon_off = "spliffoff" - type_butt = /obj/item/cigbutt/roach - throw_speed = 0.5 - item_state = "spliffoff" - smoketime = 180 - chem_volume = 50 - list_reagents = null - -/obj/item/clothing/mask/cigarette/rollie/New() - ..() - src.pixel_x = rand(-5, 5) - src.pixel_y = rand(-5, 5) - -/obj/item/clothing/mask/cigarette/rollie/nicotine - list_reagents = list("nicotine" = 15) - -/obj/item/clothing/mask/cigarette/rollie/trippy - list_reagents = list("nicotine" = 15, "mushroomhallucinogen" = 35) - starts_lit = TRUE - -/obj/item/clothing/mask/cigarette/rollie/cannabis - list_reagents = list("space_drugs" = 15, "lipolicide" = 35) - -/obj/item/clothing/mask/cigarette/rollie/mindbreaker - list_reagents = list("mindbreaker" = 35, "lipolicide" = 15) - -/obj/item/cigbutt/roach - name = "roach" - desc = "A manky old roach, or for non-stoners, a used rollup." - icon_state = "roach" - -/obj/item/cigbutt/roach/New() - ..() - src.pixel_x = rand(-5, 5) - src.pixel_y = rand(-5, 5) - - -//////////// -// CIGARS // -//////////// -/obj/item/clothing/mask/cigarette/cigar - name = "premium cigar" - desc = "A brown roll of tobacco and... well, you're not quite sure. This thing's huge!" - icon_state = "cigaroff" - icon_on = "cigaron" - icon_off = "cigaroff" //make sure to add positional sprites in icons/obj/cigarettes.dmi if you add more. - type_butt = /obj/item/cigbutt/cigarbutt - throw_speed = 0.5 - item_state = "cigaroff" - smoketime = 1500 - chem_volume = 40 - -/obj/item/clothing/mask/cigarette/cigar/cohiba - name = "\improper Cohiba Robusto cigar" - desc = "There's little more you could want from a cigar." - icon_state = "cigar2off" - icon_on = "cigar2on" - icon_off = "cigar2off" - smoketime = 2000 - chem_volume = 80 - - -/obj/item/clothing/mask/cigarette/cigar/havana - name = "premium Havanian cigar" - desc = "A cigar fit for only the best of the best." - icon_state = "cigar2off" - icon_on = "cigar2on" - icon_off = "cigar2off" - smoketime = 7200 - chem_volume = 50 - -/obj/item/cigbutt - name = "cigarette butt" - desc = "A manky old cigarette butt." - icon = 'icons/obj/clothing/masks.dmi' - icon_state = "cigbutt" - w_class = WEIGHT_CLASS_TINY - throwforce = 0 - grind_results = list("carbon" = 2) - -/obj/item/cigbutt/cigarbutt - name = "cigar butt" - desc = "A manky old cigar butt." - icon_state = "cigarbutt" - -///////////////// -//SMOKING PIPES// -///////////////// -/obj/item/clothing/mask/cigarette/pipe - name = "smoking pipe" - desc = "A pipe, for smoking. Probably made of meerschaum or something." - icon_state = "pipeoff" - item_state = "pipeoff" - icon_on = "pipeon" //Note - these are in masks.dmi - icon_off = "pipeoff" - smoketime = 0 - chem_volume = 100 - list_reagents = null - var/packeditem = 0 - -/obj/item/clothing/mask/cigarette/pipe/Initialize() - . = ..() - name = "empty [initial(name)]" - -/obj/item/clothing/mask/cigarette/pipe/Destroy() - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/item/clothing/mask/cigarette/pipe/process() - var/turf/location = get_turf(src) - smoketime-- - if(smoketime < 1) - new /obj/effect/decal/cleanable/ash(location) - if(ismob(loc)) - var/mob/living/M = loc - to_chat(M, "Your [name] goes out.") - lit = 0 - icon_state = icon_off - item_state = icon_off - M.update_inv_wear_mask() - packeditem = 0 - name = "empty [initial(name)]" - STOP_PROCESSING(SSobj, src) - return - open_flame() - if(reagents && reagents.total_volume) // check if it has any reagents at all - handle_reagents() - - -/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/reagent_containers/food/snacks/grown)) - var/obj/item/reagent_containers/food/snacks/grown/G = O - if(!packeditem) - if(G.dry == 1) - to_chat(user, "You stuff [O] into [src].") - smoketime = 400 - packeditem = 1 - name = "[O.name]-packed [initial(name)]" - if(O.reagents) - O.reagents.trans_to(src, O.reagents.total_volume) - qdel(O) - else - to_chat(user, "It has to be dried first!") - else - to_chat(user, "It is already packed!") - else - var/lighting_text = O.ignition_effect(src,user) - if(lighting_text) - if(smoketime > 0) - light(lighting_text) - else - to_chat(user, "There is nothing to smoke!") - else - return ..() - -/obj/item/clothing/mask/cigarette/pipe/attack_self(mob/user) - var/turf/location = get_turf(user) - if(lit) - user.visible_message("[user] puts out [src].", "You put out [src].") - lit = 0 - icon_state = icon_off - item_state = icon_off - STOP_PROCESSING(SSobj, src) - return - if(!lit && smoketime > 0) - to_chat(user, "You empty [src] onto [location].") - new /obj/effect/decal/cleanable/ash(location) - packeditem = 0 - smoketime = 0 - reagents.clear_reagents() - name = "empty [initial(name)]" - return - -/obj/item/clothing/mask/cigarette/pipe/cobpipe - name = "corn cob pipe" - desc = "A nicotine delivery system popularized by folksy backwoodsmen and kept popular in the modern age and beyond by space hipsters. Can be loaded with objects." - icon_state = "cobpipeoff" - item_state = "cobpipeoff" - icon_on = "cobpipeon" //Note - these are in masks.dmi - icon_off = "cobpipeoff" - smoketime = 0 - - -///////// -//ZIPPO// -///////// -/obj/item/lighter - name = "\improper Zippo lighter" - desc = "The zippo." - icon = 'icons/obj/cigarettes.dmi' - icon_state = "zippo" - item_state = "zippo" - w_class = WEIGHT_CLASS_TINY - flags_1 = CONDUCT_1 - slot_flags = ITEM_SLOT_BELT - var/lit = 0 - var/fancy = TRUE - var/overlay_state - var/overlay_list = list( - "plain", - "dame", - "thirteen", - "snake" - ) - heat = 1500 - resistance_flags = FIRE_PROOF - light_color = LIGHT_COLOR_FIRE - grind_results = list("iron" = 1, "welding_fuel" = 5, "oil" = 5) - -/obj/item/lighter/Initialize() - . = ..() - if(!overlay_state) - overlay_state = pick(overlay_list) - update_icon() - -/obj/item/lighter/suicide_act(mob/living/carbon/user) - if (lit) - user.visible_message("[user] begins holding \the [src]'s flame up to [user.p_their()] face! It looks like [user.p_theyre()] trying to commit suicide!") - playsound(src, 'sound/items/welder.ogg', 50, 1) - return FIRELOSS - else - user.visible_message("[user] begins whacking [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return BRUTELOSS - -/obj/item/lighter/update_icon() - cut_overlays() - var/mutable_appearance/lighter_overlay = mutable_appearance(icon,"lighter_overlay_[overlay_state][lit ? "-on" : ""]") - icon_state = "[initial(icon_state)][lit ? "-on" : ""]" - add_overlay(lighter_overlay) - -/obj/item/lighter/ignition_effect(atom/A, mob/user) - if(is_hot()) - . = "With a single flick of [user.p_their()] wrist, [user] smoothly lights [A] with [src]. Damn [user.p_theyre()] cool." - -/obj/item/lighter/proc/set_lit(new_lit) - lit = new_lit - if(lit) - force = 5 - damtype = "fire" - hitsound = 'sound/items/welder.ogg' - attack_verb = list("burnt", "singed") - set_light(2, 0.6, LIGHT_COLOR_FIRE) - START_PROCESSING(SSobj, src) - else - hitsound = "swing_hit" - force = 0 - attack_verb = null //human_defense.dm takes care of it - set_light(0) - STOP_PROCESSING(SSobj, src) - update_icon() - -/obj/item/lighter/attack_self(mob/living/user) - if(user.is_holding(src)) - if(!lit) - set_lit(TRUE) - if(fancy) - user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", "Without even breaking stride, you flip open and light [src] in one smooth movement.") - else - var/prot = FALSE - var/mob/living/carbon/human/H = user - - if(istype(H) && H.gloves) - var/obj/item/clothing/gloves/G = H.gloves - if(G.max_heat_protection_temperature) - prot = (G.max_heat_protection_temperature > 360) - else - prot = TRUE - - if(prot || prob(75)) - user.visible_message("After a few attempts, [user] manages to light [src].", "After a few attempts, you manage to light [src].") - else - var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND - user.apply_damage(5, BURN, hitzone) - user.visible_message("After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn [user.p_their()] finger in the process.", "You burn yourself while lighting the lighter!") - SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "burnt_thumb", /datum/mood_event/burnt_thumb) - - else - set_lit(FALSE) - if(fancy) - user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what [user.p_theyre()] doing. Wow.", "You quietly shut off [src] without even looking at what you're doing. Wow.") - else - user.visible_message("[user] quietly shuts off [src].", "You quietly shut off [src].") - else - . = ..() - -/obj/item/lighter/attack(mob/living/carbon/M, mob/living/carbon/user) - if(lit && M.IgniteMob()) - message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]") - log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]") - var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M) - if(lit && cig && user.a_intent == INTENT_HELP) - if(cig.lit) - to_chat(user, "The [cig.name] is already lit.") - if(M == user) - cig.attackby(src, user) - else - if(fancy) - cig.light("[user] whips the [name] out and holds it for [M]. [user.p_their(TRUE)] arm is as steady as the unflickering flame [user.p_they()] light[user.p_s()] \the [cig] with.") - else - cig.light("[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name].") - else - ..() - -/obj/item/lighter/process() - open_flame() - -/obj/item/lighter/is_hot() - return lit * heat - - -/obj/item/lighter/greyscale - name = "cheap lighter" - desc = "A cheap-as-free lighter." - icon_state = "lighter" - fancy = FALSE - overlay_list = list( - "transp", - "tall", - "matte", - "zoppo" //u cant stoppo th zoppo - ) - var/lighter_color - var/list/color_list = list( //Same 16 color selection as electronic assemblies - COLOR_ASSEMBLY_BLACK, - COLOR_FLOORTILE_GRAY, - COLOR_ASSEMBLY_BGRAY, - COLOR_ASSEMBLY_WHITE, - COLOR_ASSEMBLY_RED, - COLOR_ASSEMBLY_ORANGE, - COLOR_ASSEMBLY_BEIGE, - COLOR_ASSEMBLY_BROWN, - COLOR_ASSEMBLY_GOLD, - COLOR_ASSEMBLY_YELLOW, - COLOR_ASSEMBLY_GURKHA, - COLOR_ASSEMBLY_LGREEN, - COLOR_ASSEMBLY_GREEN, - COLOR_ASSEMBLY_LBLUE, - COLOR_ASSEMBLY_BLUE, - COLOR_ASSEMBLY_PURPLE - ) - -/obj/item/lighter/greyscale/Initialize() - . = ..() - if(!lighter_color) - lighter_color = pick(color_list) - update_icon() - -/obj/item/lighter/greyscale/update_icon() - cut_overlays() - var/mutable_appearance/lighter_overlay = mutable_appearance(icon,"lighter_overlay_[overlay_state][lit ? "-on" : ""]") - icon_state = "[initial(icon_state)][lit ? "-on" : ""]" - lighter_overlay.color = lighter_color - add_overlay(lighter_overlay) - -/obj/item/lighter/greyscale/ignition_effect(atom/A, mob/user) - if(is_hot()) - . = "After some fiddling, [user] manages to light [A] with [src]." - - -/obj/item/lighter/slime - name = "slime zippo" - desc = "A specialty zippo made from slimes and industry. Has a much hotter flame than normal." - icon_state = "slighter" - heat = 3000 //Blue flame! - light_color = LIGHT_COLOR_CYAN - overlay_state = "slime" - grind_results = list("iron" = 1, "welding_fuel" = 5, "pyroxadone" = 5) - - -/////////// -//ROLLING// -/////////// -/obj/item/rollingpaper - name = "rolling paper" - desc = "A thin piece of paper used to make fine smokeables." - icon = 'icons/obj/cigarettes.dmi' - icon_state = "cig_paper" - w_class = WEIGHT_CLASS_TINY - -/obj/item/rollingpaper/afterattack(atom/target, mob/user, proximity) - . = ..() - if(!proximity) - return - if(istype(target, /obj/item/reagent_containers/food/snacks/grown)) - var/obj/item/reagent_containers/food/snacks/grown/O = target - if(O.dry) - var/obj/item/clothing/mask/cigarette/rollie/R = new /obj/item/clothing/mask/cigarette/rollie(user.loc) - R.chem_volume = target.reagents.total_volume - target.reagents.trans_to(R, R.chem_volume) - qdel(target) - qdel(src) - user.put_in_active_hand(R) - to_chat(user, "You roll the [target.name] into a rolling paper.") - R.desc = "Dried [target.name] rolled up in a thin piece of paper." - else - to_chat(user, "You need to dry this first!") - -/////////////// -//VAPE NATION// -/////////////// -/obj/item/clothing/mask/vape - name = "\improper E-Cigarette" - desc = "A classy and highly sophisticated electronic cigarette, for classy and dignified gentlemen. A warning label reads \"Warning: Do not fill with flammable materials.\""//<<< i'd vape to that. - icon = 'icons/obj/clothing/masks.dmi' - icon_state = null - item_state = null - w_class = WEIGHT_CLASS_TINY - var/chem_volume = 100 - var/vapetime = FALSE //this so it won't puff out clouds every tick - var/screw = FALSE // kinky - var/super = FALSE //for the fattest vapes dude. - -/obj/item/clothing/mask/vape/suicide_act(mob/user) - user.visible_message("[user] is puffin hard on dat vape, [user.p_they()] trying to join the vape life on a whole notha plane!")//it doesn't give you cancer, it is cancer - return (TOXLOSS|OXYLOSS) - - -/obj/item/clothing/mask/vape/Initialize(mapload, param_color) - . = ..() - create_reagents(chem_volume, NO_REACT) // so it doesn't react until you light it - reagents.add_reagent("nicotine", 50) - if(!icon_state) - if(!param_color) - param_color = pick("red","blue","black","white","green","purple","yellow","orange") - icon_state = "[param_color]_vape" - item_state = "[param_color]_vape" - -/obj/item/clothing/mask/vape/attackby(obj/item/O, mob/user, params) - if(O.tool_behaviour == TOOL_SCREWDRIVER) - if(!screw) - screw = TRUE - to_chat(user, "You open the cap on [src].") - ENABLE_BITFIELD(reagents.reagents_holder_flags, OPENCONTAINER) - if(obj_flags & EMAGGED) - add_overlay("vapeopen_high") - else if(super) - add_overlay("vapeopen_med") - else - add_overlay("vapeopen_low") - else - screw = FALSE - to_chat(user, "You close the cap on [src].") - DISABLE_BITFIELD(reagents.reagents_holder_flags, OPENCONTAINER) - cut_overlays() - - if(O.tool_behaviour == TOOL_MULTITOOL) - if(screw && !(obj_flags & EMAGGED))//also kinky - if(!super) - cut_overlays() - super = TRUE - to_chat(user, "You increase the voltage of [src].") - add_overlay("vapeopen_med") - else - cut_overlays() - super = FALSE - to_chat(user, "You decrease the voltage of [src].") - add_overlay("vapeopen_low") - - if(screw && (obj_flags & EMAGGED)) - to_chat(user, "[src] can't be modified!") - - else - ..() - -/obj/item/clothing/mask/vape/emag_act(mob/user)// I WON'T REGRET WRITTING THIS, SURLY. - if(screw) - if(!(obj_flags & EMAGGED)) - cut_overlays() - obj_flags |= EMAGGED - super = FALSE - to_chat(user, "You maximize the voltage of [src].") - add_overlay("vapeopen_high") - var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect - sp.set_up(5, 1, src) - sp.start() - else - to_chat(user, "[src] is already emagged!") - else - to_chat(user, "You need to open the cap to do that.") - -/obj/item/clothing/mask/vape/attack_self(mob/user) - if(reagents.total_volume > 0) - to_chat(user, "You empty [src] of all reagents.") - reagents.clear_reagents() - -/obj/item/clothing/mask/vape/equipped(mob/user, slot) - if(slot == SLOT_WEAR_MASK) - if(!screw) - to_chat(user, "You start puffing on the vape.") - DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) - START_PROCESSING(SSobj, src) - else //it will not start if the vape is opened. - to_chat(user, "You need to close the cap first!") - -/obj/item/clothing/mask/vape/dropped(mob/user) - var/mob/living/carbon/C = user - if(C.get_item_by_slot(SLOT_WEAR_MASK) == src) - ENABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) - STOP_PROCESSING(SSobj, src) - -/obj/item/clothing/mask/vape/proc/hand_reagents()//had to rename to avoid duplicate error - if(reagents.total_volume) - if(iscarbon(loc)) - var/mob/living/carbon/C = loc - if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob - var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1) //this will react instantly, making them a little more dangerous than cigarettes - reagents.reaction(C, INGEST, fraction) - if(!reagents.trans_to(C, REAGENTS_METABOLISM)) - reagents.remove_any(REAGENTS_METABOLISM) - if(reagents.get_reagent_amount("welding_fuel")) - //HOT STUFF - C.fire_stacks = 2 - C.IgniteMob() - - if(reagents.get_reagent_amount("plasma")) // the plasma explodes when exposed to fire - var/datum/effect_system/reagents_explosion/e = new() - e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0) - e.start() - qdel(src) - return - reagents.remove_any(REAGENTS_METABOLISM) - -/obj/item/clothing/mask/vape/process() - var/mob/living/M = loc - - if(isliving(loc)) - M.IgniteMob() - - vapetime++ - - if(!reagents.total_volume) - if(ismob(loc)) - to_chat(M, "[src] is empty!") - STOP_PROCESSING(SSobj, src) - //it's reusable so it won't unequip when empty - return - //open flame removed because vapes are a closed system, they wont light anything on fire - - if(super && vapetime > 3)//Time to start puffing those fat vapes, yo. - var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new - s.set_up(reagents, 1, 24, loc) - s.start() - vapetime = 0 - - if((obj_flags & EMAGGED) && vapetime > 3) - var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new - s.set_up(reagents, 4, 24, loc) - s.start() - vapetime = 0 - if(prob(5))//small chance for the vape to break and deal damage if it's emagged - playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0) - M.apply_damage(20, BURN, BODY_ZONE_HEAD) - M.Knockdown(300, 1, 0) - var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread - sp.set_up(5, 1, src) - sp.start() - to_chat(M, "[src] suddenly explodes in your mouth!") - qdel(src) - return - - if(reagents && reagents.total_volume) - hand_reagents() - -/////////////// -/////BONGS///// -/////////////// - -/obj/item/bong - name = "bong" - desc = "A water bong used for smoking dried plants." - icon = 'icons/obj/bongs.dmi' - icon_state = null - item_state = null - w_class = WEIGHT_CLASS_NORMAL - light_color = "#FFCC66" - var/icon_off = "bong" - var/icon_on = "bong_lit" - var/chem_volume = 100 - var/last_used_time //for cooldown - var/firecharges = 0 //used for counting how many hits can be taken before the flame goes out - var/list/list_reagents = list() //For the base reagents bongs could get - - -/obj/item/bong/Initialize() - . = ..() - create_reagents(chem_volume, NO_REACT) // so it doesn't react until you light it - reagents.add_reagent_list(list_reagents) - icon_state = icon_off - -/obj/item/bong/attackby(obj/item/O, mob/user, params) - . = ..() - //If we're using a dried plant.. - if(istype(O,/obj/item/reagent_containers/food/snacks)) - var/obj/item/reagent_containers/food/snacks/DP = O - if (DP.dry) - //Nothing if our bong is full - if (reagents.holder_full()) - user.show_message("The bowl is full!", 1) - return - - //Transfer reagents and remove the plant - user.show_message("You stuff the [DP] into the [src]'s bowl.", 1) - DP.reagents.trans_to(src, 100) - qdel(DP) - return - else - user.show_message("[DP] must be dried first!", 1) - return - - if (O.heat > 500) - if (reagents && reagents.total_volume) //if there's stuff in the bong - var/lighting_text = O.ignition_effect(src, user) - if(lighting_text) - //Logic regarding igniting it on - if (firecharges == 0) - user.show_message("You light the [src] with the [O]!", 1) - bongturnon() - else - user.show_message("You rekindle [src]'s flame with the [O]!", 1) - - firecharges = 1 - return - else - user.show_message("There's nothing to light up in the bowl.", 1) - return - -/obj/item/bong/CtrlShiftClick(mob/user) //empty reagents on alt click - if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) - return - - if (reagents && reagents.total_volume) - user.show_message("You empty the [src].", 1) - reagents.clear_reagents() - if(firecharges) - firecharges = 0 - bongturnoff() - else - user.show_message("The [src] is already empty.", 1) - -/obj/item/bong/AltClick(mob/user) - if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) - return - - if(firecharges) - firecharges = 0 - bongturnoff() - user.show_message("You quench the flame.", 1) - -/obj/item/bong/examine(mob/user) - . = ..() - if(!reagents.total_volume) - . += "The bowl is empty." - else if (reagents.total_volume > 80) - . += "The bowl is filled to the brim." - else if (reagents.total_volume > 40) - . += "The bowl has plenty weed in it." - else - . += "The bowl has some weed in it." - - . += "Ctrl+Shift-click to empty." - . += "Alt-click to extinguish." - -/obj/item/bong/ignition_effect(atom/A, mob/user) - if(firecharges) - . = "[user] lights [A] off of the [src]." - else - . = "" - -/obj/item/bong/attack(mob/living/carbon/M, mob/living/carbon/user, obj/target) - //if it's lit up, some stuff in the bowl and the user is a target, and we're not on cooldown - if (!reagents) - return - - if (M ==! user) - return - - if(user.is_mouth_covered(head_only = 1)) - to_chat(user, "Remove your headgear first.") - return - - if(user.is_mouth_covered(mask_only = 1)) - to_chat(user, "Remove your mask first.") - return - - if (!reagents.total_volume) - to_chat(user, "There's nothing in the bowl.") - return - - if (!firecharges) - to_chat(user, "You have to light it up first.") - return - - if (last_used_time + 30 < world.time) - var/hit_strength - var/noise - var/hittext = "" - //if the intent is help then you take a small hit, else a big one - if (user.a_intent == INTENT_HARM) - hit_strength = 2 - noise = 100 - hittext = "big hit" - else - hit_strength = 1 - noise = 70 - hittext = "hit" - //bubbling sound - playsound(user.loc,'sound/effects/bonghit.ogg', noise, 1) - - last_used_time = world.time - - //message - user.visible_message("[user] begins to take a "+ hittext +" from the [src]!", \ - "You begin to take a "+ hittext +" from [src].") - - //we take a hit here, after an uninterrupted delay - if(do_after(user, 25, target = user)) - if (reagents && reagents.total_volume) - var/fraction = 12 * hit_strength - - var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new - s.set_up(reagents, hit_strength, 18, user.loc) - s.start() - - reagents.reaction(user, INGEST, fraction) - if(!reagents.trans_to(user, fraction)) - reagents.remove_any(fraction) - - if (hit_strength == 2 && prob(15)) - user.emote("cough") - user.adjustOxyLoss(15) - - //playsound(user.loc, 'sound/effects/smoke.ogg', 10, 1, -3) - - user.visible_message("[user] takes a "+ hittext +" from the [src]!", \ - "You take a "+ hittext +" from [src].") - - firecharges = firecharges - 1 - if (firecharges == 0) - bongturnoff() - if (!reagents.total_volume) - firecharges = 0 - bongturnoff() - - - -/obj/item/bong/proc/bongturnon() - icon_state = icon_on - set_light(3, 0.8) - -/obj/item/bong/proc/bongturnoff() - icon_state = icon_off - set_light(0, 0.0) - - - -/obj/item/bong/coconut - name = "coconut bong" - icon_off = "coconut_bong" - icon_on = "coconut_bong_lit" - desc = "A water bong used for smoking dried plants. This one's made out of a coconut and some bamboo" +//cleansed 9/15/2012 17:48 + +/* +CONTAINS: +MATCHES +CIGARETTES +CIGARS +SMOKING PIPES +CHEAP LIGHTERS +ZIPPO + +CIGARETTE PACKETS ARE IN FANCY.DM +*/ + +/////////// +//MATCHES// +/////////// +/obj/item/match + name = "match" + desc = "A simple match stick, used for lighting fine smokables." + icon = 'icons/obj/cigarettes.dmi' + icon_state = "match_unlit" + var/lit = FALSE + var/burnt = FALSE + var/smoketime = 5 + w_class = WEIGHT_CLASS_TINY + heat = 1000 + grind_results = list(/datum/reagent/phosphorus = 2) + +/obj/item/match/process() + smoketime-- + if(smoketime < 1) + matchburnout() + else + open_flame(heat) + +/obj/item/match/fire_act(exposed_temperature, exposed_volume) + matchignite() + +/obj/item/match/proc/matchignite() + if(!lit && !burnt) + lit = TRUE + icon_state = "match_lit" + damtype = "fire" + force = 3 + hitsound = 'sound/items/welder.ogg' + item_state = "cigon" + name = "lit match" + desc = "A match. This one is lit." + attack_verb = list("burnt","singed") + START_PROCESSING(SSobj, src) + update_icon() + +/obj/item/match/proc/matchburnout() + if(lit) + lit = FALSE + burnt = TRUE + damtype = "brute" + force = initial(force) + icon_state = "match_burnt" + item_state = "cigoff" + name = "burnt match" + desc = "A match. This one has seen better days." + attack_verb = list("flicked") + STOP_PROCESSING(SSobj, src) + +/obj/item/match/dropped(mob/user) + matchburnout() + . = ..() + +/obj/item/match/attack(mob/living/carbon/M, mob/living/carbon/user) + if(!isliving(M)) + return + if(lit && M.IgniteMob()) + message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]") + log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]") + var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M) + if(lit && cig && user.a_intent == INTENT_HELP) + if(cig.lit) + to_chat(user, "[cig] is already lit.") + if(M == user) + cig.attackby(src, user) + else + cig.light("[user] holds [src] out for [M], and lights [cig].") + else + ..() + +/obj/item/proc/help_light_cig(mob/living/M) + var/mask_item = M.get_item_by_slot(SLOT_WEAR_MASK) + if(istype(mask_item, /obj/item/clothing/mask/cigarette)) + return mask_item + +/obj/item/match/is_hot() + return lit * heat + +////////////////// +//FINE SMOKABLES// +////////////////// +/obj/item/clothing/mask/cigarette + name = "cigarette" + desc = "A roll of tobacco and nicotine." + icon_state = "cigoff" + throw_speed = 0.5 + item_state = "cigoff" + w_class = WEIGHT_CLASS_TINY + body_parts_covered = null + grind_results = list() + var/lit = FALSE + var/starts_lit = FALSE + var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi + var/icon_off = "cigoff" + var/type_butt = /obj/item/cigbutt + var/lastHolder = null + var/smoketime = 300 + var/chem_volume = 30 + var/list/list_reagents = list(/datum/reagent/drug/nicotine = 15) + heat = 1000 + +/obj/item/clothing/mask/cigarette/suicide_act(mob/user) + user.visible_message("[user] is huffing [src] as quickly as [user.p_they()] can! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer.") + return (TOXLOSS|OXYLOSS) + +/obj/item/clothing/mask/cigarette/Initialize() + . = ..() + create_reagents(chem_volume, INJECTABLE | NO_REACT) // so it doesn't react until you light it + if(list_reagents) + reagents.add_reagent_list(list_reagents) + if(starts_lit) + light() + AddComponent(/datum/component/knockoff,90,list(BODY_ZONE_PRECISE_MOUTH),list(SLOT_WEAR_MASK))//90% to knock off when wearing a mask + +/obj/item/clothing/mask/cigarette/Destroy() + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/clothing/mask/cigarette/attackby(obj/item/W, mob/user, params) + if(!lit && smoketime > 0) + var/lighting_text = W.ignition_effect(src, user) + if(lighting_text) + light(lighting_text) + else + return ..() + +/obj/item/clothing/mask/cigarette/afterattack(obj/item/reagent_containers/glass/glass, mob/user, proximity) + . = ..() + if(!proximity || lit) //can't dip if cigarette is lit (it will heat the reagents in the glass instead) + return + if(istype(glass)) //you can dip cigarettes into beakers + if(glass.reagents.trans_to(src, chem_volume)) //if reagents were transfered, show the message + to_chat(user, "You dip \the [src] into \the [glass].") + else //if not, either the beaker was empty, or the cigarette was full + if(!glass.reagents.total_volume) + to_chat(user, "[glass] is empty.") + else + to_chat(user, "[src] is full.") + + +/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null) + if(lit) + return + if(!(flags_1 & INITIALIZED_1)) + icon_state = icon_on + item_state = icon_on + return + + lit = TRUE + name = "lit [name]" + attack_verb = list("burnt", "singed") + hitsound = 'sound/items/welder.ogg' + damtype = "fire" + force = 4 + if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma)) // the plasma explodes when exposed to fire + var/datum/effect_system/reagents_explosion/e = new() + e.set_up(round(reagents.get_reagent_amount(/datum/reagent/toxin/plasma) / 2.5, 1), get_turf(src), 0, 0) + e.start() + qdel(src) + return + if(reagents.get_reagent_amount(/datum/reagent/fuel)) // the fuel explodes, too, but much less violently + var/datum/effect_system/reagents_explosion/e = new() + e.set_up(round(reagents.get_reagent_amount(/datum/reagent/fuel) / 5, 1), get_turf(src), 0, 0) + e.start() + qdel(src) + return + // allowing reagents to react after being lit + DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) + reagents.handle_reactions() + icon_state = icon_on + item_state = icon_on + if(flavor_text) + var/turf/T = get_turf(src) + T.visible_message(flavor_text) + START_PROCESSING(SSobj, src) + + //can't think of any other way to update the overlays :< + if(ismob(loc)) + var/mob/M = loc + M.update_inv_wear_mask() + M.update_inv_hands() + + +/obj/item/clothing/mask/cigarette/proc/handle_reagents() + if(reagents.total_volume) + if(iscarbon(loc)) + var/mob/living/carbon/C = loc + if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob + var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1) + reagents.reaction(C, INGEST, fraction) + if(!reagents.trans_to(C, REAGENTS_METABOLISM)) + reagents.remove_any(REAGENTS_METABOLISM) + return + reagents.remove_any(REAGENTS_METABOLISM) + + +/obj/item/clothing/mask/cigarette/process() + var/turf/location = get_turf(src) + var/mob/living/M = loc + if(isliving(loc)) + M.IgniteMob() + smoketime-- + if(smoketime < 1) + new type_butt(location) + if(ismob(loc)) + to_chat(M, "Your [name] goes out.") + qdel(src) + return + open_flame() + if(reagents && reagents.total_volume) + handle_reagents() + +/obj/item/clothing/mask/cigarette/attack_self(mob/user) + if(lit) + user.visible_message("[user] calmly drops and treads on \the [src], putting it out instantly.") + new type_butt(user.loc) + new /obj/effect/decal/cleanable/ash(user.loc) + qdel(src) + . = ..() + +/obj/item/clothing/mask/cigarette/attack(mob/living/carbon/M, mob/living/carbon/user) + if(!istype(M)) + return ..() + if(M.on_fire && !lit) + light("[user] lights [src] with [M]'s burning body. What a cold-blooded badass.") + return + var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M) + if(lit && cig && user.a_intent == INTENT_HELP) + if(cig.lit) + to_chat(user, "The [cig.name] is already lit.") + if(M == user) + cig.attackby(src, user) + else + cig.light("[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name].") + else + return ..() + +/obj/item/clothing/mask/cigarette/fire_act(exposed_temperature, exposed_volume) + light() + +/obj/item/clothing/mask/cigarette/is_hot() + return lit * heat + +// Cigarette brands. + +/obj/item/clothing/mask/cigarette/space_cigarette + desc = "A Space Cigarette brand cigarette." + +/obj/item/clothing/mask/cigarette/dromedary + desc = "A DromedaryCo brand cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 7.5, /datum/reagent/silicon = 7.5) + +/obj/item/clothing/mask/cigarette/smokekins + desc = "A Kinaris Corp brand cigarette" + list_reagents = list(/datum/reagent/drug/nicotine = 7.5, /datum/reagent/gold = 1) + +/obj/item/clothing/mask/cigarette/uplift + desc = "An Uplift Smooth brand cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 7.5, /datum/reagent/consumable/menthol = 7.5) + +/obj/item/clothing/mask/cigarette/robust + desc = "A Robust brand cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 7.5, /datum/reagent/consumable/grenadine = 7.5) + +/obj/item/clothing/mask/cigarette/robustgold + desc = "A Robust Gold brand cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/gold = 1) + +/obj/item/clothing/mask/cigarette/carp + desc = "A Carp Classic brand cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 7.5, /datum/reagent/consumable/sodiumchloride = 7.5) + +/obj/item/clothing/mask/cigarette/syndicate + desc = "An unknown brand cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/medicine/omnizine = 15) + +/obj/item/clothing/mask/cigarette/shadyjims + desc = "A Shady Jim's Super Slims cigarette." + list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/toxin/lipolicide = 4, /datum/reagent/ammonia = 2, /datum/reagent/toxin/plantbgone = 1, /datum/reagent/toxin = 1.5) + +/obj/item/clothing/mask/cigarette/xeno + desc = "A Xeno Filtered brand cigarette." + list_reagents = list (/datum/reagent/drug/nicotine = 20, /datum/reagent/medicine/regen_jelly = 15, /datum/reagent/drug/krokodil = 4) + +// Rollies. + +/obj/item/clothing/mask/cigarette/rollie + name = "rollie" + desc = "A roll of dried plant matter wrapped in thin paper." + icon_state = "spliffoff" + icon_on = "spliffon" + icon_off = "spliffoff" + type_butt = /obj/item/cigbutt/roach + throw_speed = 0.5 + item_state = "spliffoff" + smoketime = 180 + chem_volume = 50 + list_reagents = null + +/obj/item/clothing/mask/cigarette/rollie/New() + ..() + src.pixel_x = rand(-5, 5) + src.pixel_y = rand(-5, 5) + +/obj/item/clothing/mask/cigarette/rollie/nicotine + list_reagents = list(/datum/reagent/drug/nicotine = 15) + +/obj/item/clothing/mask/cigarette/rollie/trippy + list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/drug/mushroomhallucinogen = 35) + starts_lit = TRUE + +/obj/item/clothing/mask/cigarette/rollie/cannabis + list_reagents = list(/datum/reagent/drug/space_drugs = 15, /datum/reagent/toxin/lipolicide = 35) + +/obj/item/clothing/mask/cigarette/rollie/mindbreaker + list_reagents = list(/datum/reagent/toxin/mindbreaker = 35, /datum/reagent/toxin/lipolicide = 15) + +/obj/item/cigbutt/roach + name = "roach" + desc = "A manky old roach, or for non-stoners, a used rollup." + icon_state = "roach" + +/obj/item/cigbutt/roach/New() + ..() + src.pixel_x = rand(-5, 5) + src.pixel_y = rand(-5, 5) + + +//////////// +// CIGARS // +//////////// +/obj/item/clothing/mask/cigarette/cigar + name = "premium cigar" + desc = "A brown roll of tobacco and... well, you're not quite sure. This thing's huge!" + icon_state = "cigaroff" + icon_on = "cigaron" + icon_off = "cigaroff" //make sure to add positional sprites in icons/obj/cigarettes.dmi if you add more. + type_butt = /obj/item/cigbutt/cigarbutt + throw_speed = 0.5 + item_state = "cigaroff" + smoketime = 1500 + chem_volume = 40 + +/obj/item/clothing/mask/cigarette/cigar/cohiba + name = "\improper Cohiba Robusto cigar" + desc = "There's little more you could want from a cigar." + icon_state = "cigar2off" + icon_on = "cigar2on" + icon_off = "cigar2off" + smoketime = 2000 + chem_volume = 80 + + +/obj/item/clothing/mask/cigarette/cigar/havana + name = "premium Havanian cigar" + desc = "A cigar fit for only the best of the best." + icon_state = "cigar2off" + icon_on = "cigar2on" + icon_off = "cigar2off" + smoketime = 7200 + chem_volume = 50 + +/obj/item/cigbutt + name = "cigarette butt" + desc = "A manky old cigarette butt." + icon = 'icons/obj/clothing/masks.dmi' + icon_state = "cigbutt" + w_class = WEIGHT_CLASS_TINY + throwforce = 0 + grind_results = list(/datum/reagent/carbon = 2) + +/obj/item/cigbutt/cigarbutt + name = "cigar butt" + desc = "A manky old cigar butt." + icon_state = "cigarbutt" + +///////////////// +//SMOKING PIPES// +///////////////// +/obj/item/clothing/mask/cigarette/pipe + name = "smoking pipe" + desc = "A pipe, for smoking. Probably made of meerschaum or something." + icon_state = "pipeoff" + item_state = "pipeoff" + icon_on = "pipeon" //Note - these are in masks.dmi + icon_off = "pipeoff" + smoketime = 0 + chem_volume = 100 + list_reagents = null + var/packeditem = 0 + +/obj/item/clothing/mask/cigarette/pipe/Initialize() + . = ..() + name = "empty [initial(name)]" + +/obj/item/clothing/mask/cigarette/pipe/Destroy() + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/clothing/mask/cigarette/pipe/process() + var/turf/location = get_turf(src) + smoketime-- + if(smoketime < 1) + new /obj/effect/decal/cleanable/ash(location) + if(ismob(loc)) + var/mob/living/M = loc + to_chat(M, "Your [name] goes out.") + lit = 0 + icon_state = icon_off + item_state = icon_off + M.update_inv_wear_mask() + packeditem = 0 + name = "empty [initial(name)]" + STOP_PROCESSING(SSobj, src) + return + open_flame() + if(reagents && reagents.total_volume) // check if it has any reagents at all + handle_reagents() + + +/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/O, mob/user, params) + if(istype(O, /obj/item/reagent_containers/food/snacks/grown)) + var/obj/item/reagent_containers/food/snacks/grown/G = O + if(!packeditem) + if(G.dry == 1) + to_chat(user, "You stuff [O] into [src].") + smoketime = 400 + packeditem = 1 + name = "[O.name]-packed [initial(name)]" + if(O.reagents) + O.reagents.trans_to(src, O.reagents.total_volume) + qdel(O) + else + to_chat(user, "It has to be dried first!") + else + to_chat(user, "It is already packed!") + else + var/lighting_text = O.ignition_effect(src,user) + if(lighting_text) + if(smoketime > 0) + light(lighting_text) + else + to_chat(user, "There is nothing to smoke!") + else + return ..() + +/obj/item/clothing/mask/cigarette/pipe/attack_self(mob/user) + var/turf/location = get_turf(user) + if(lit) + user.visible_message("[user] puts out [src].", "You put out [src].") + lit = 0 + icon_state = icon_off + item_state = icon_off + STOP_PROCESSING(SSobj, src) + return + if(!lit && smoketime > 0) + to_chat(user, "You empty [src] onto [location].") + new /obj/effect/decal/cleanable/ash(location) + packeditem = 0 + smoketime = 0 + reagents.clear_reagents() + name = "empty [initial(name)]" + return + +/obj/item/clothing/mask/cigarette/pipe/cobpipe + name = "corn cob pipe" + desc = "A nicotine delivery system popularized by folksy backwoodsmen and kept popular in the modern age and beyond by space hipsters. Can be loaded with objects." + icon_state = "cobpipeoff" + item_state = "cobpipeoff" + icon_on = "cobpipeon" //Note - these are in masks.dmi + icon_off = "cobpipeoff" + smoketime = 0 + + +///////// +//ZIPPO// +///////// +/obj/item/lighter + name = "\improper Zippo lighter" + desc = "The zippo." + icon = 'icons/obj/cigarettes.dmi' + icon_state = "zippo" + item_state = "zippo" + w_class = WEIGHT_CLASS_TINY + flags_1 = CONDUCT_1 + slot_flags = ITEM_SLOT_BELT + var/lit = 0 + var/fancy = TRUE + var/overlay_state + var/overlay_list = list( + "plain", + "dame", + "thirteen", + "snake" + ) + heat = 1500 + resistance_flags = FIRE_PROOF + light_color = LIGHT_COLOR_FIRE + grind_results = list(/datum/reagent/iron = 1, /datum/reagent/fuel = 5, /datum/reagent/oil = 5) + +/obj/item/lighter/Initialize() + . = ..() + if(!overlay_state) + overlay_state = pick(overlay_list) + update_icon() + +/obj/item/lighter/suicide_act(mob/living/carbon/user) + if (lit) + user.visible_message("[user] begins holding \the [src]'s flame up to [user.p_their()] face! It looks like [user.p_theyre()] trying to commit suicide!") + playsound(src, 'sound/items/welder.ogg', 50, 1) + return FIRELOSS + else + user.visible_message("[user] begins whacking [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return BRUTELOSS + +/obj/item/lighter/update_icon() + cut_overlays() + var/mutable_appearance/lighter_overlay = mutable_appearance(icon,"lighter_overlay_[overlay_state][lit ? "-on" : ""]") + icon_state = "[initial(icon_state)][lit ? "-on" : ""]" + add_overlay(lighter_overlay) + +/obj/item/lighter/ignition_effect(atom/A, mob/user) + if(is_hot()) + . = "With a single flick of [user.p_their()] wrist, [user] smoothly lights [A] with [src]. Damn [user.p_theyre()] cool." + +/obj/item/lighter/proc/set_lit(new_lit) + lit = new_lit + if(lit) + force = 5 + damtype = "fire" + hitsound = 'sound/items/welder.ogg' + attack_verb = list("burnt", "singed") + set_light(2, 0.6, LIGHT_COLOR_FIRE) + START_PROCESSING(SSobj, src) + else + hitsound = "swing_hit" + force = 0 + attack_verb = null //human_defense.dm takes care of it + set_light(0) + STOP_PROCESSING(SSobj, src) + update_icon() + +/obj/item/lighter/attack_self(mob/living/user) + if(user.is_holding(src)) + if(!lit) + set_lit(TRUE) + if(fancy) + user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", "Without even breaking stride, you flip open and light [src] in one smooth movement.") + else + var/prot = FALSE + var/mob/living/carbon/human/H = user + + if(istype(H) && H.gloves) + var/obj/item/clothing/gloves/G = H.gloves + if(G.max_heat_protection_temperature) + prot = (G.max_heat_protection_temperature > 360) + else + prot = TRUE + + if(prot || prob(75)) + user.visible_message("After a few attempts, [user] manages to light [src].", "After a few attempts, you manage to light [src].") + else + var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND + user.apply_damage(5, BURN, hitzone) + user.visible_message("After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn [user.p_their()] finger in the process.", "You burn yourself while lighting the lighter!") + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "burnt_thumb", /datum/mood_event/burnt_thumb) + + else + set_lit(FALSE) + if(fancy) + user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what [user.p_theyre()] doing. Wow.", "You quietly shut off [src] without even looking at what you're doing. Wow.") + else + user.visible_message("[user] quietly shuts off [src].", "You quietly shut off [src].") + else + . = ..() + +/obj/item/lighter/attack(mob/living/carbon/M, mob/living/carbon/user) + if(lit && M.IgniteMob()) + message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]") + log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]") + var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M) + if(lit && cig && user.a_intent == INTENT_HELP) + if(cig.lit) + to_chat(user, "The [cig.name] is already lit.") + if(M == user) + cig.attackby(src, user) + else + if(fancy) + cig.light("[user] whips the [name] out and holds it for [M]. [user.p_their(TRUE)] arm is as steady as the unflickering flame [user.p_they()] light[user.p_s()] \the [cig] with.") + else + cig.light("[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name].") + else + ..() + +/obj/item/lighter/process() + open_flame() + +/obj/item/lighter/is_hot() + return lit * heat + + +/obj/item/lighter/greyscale + name = "cheap lighter" + desc = "A cheap-as-free lighter." + icon_state = "lighter" + fancy = FALSE + overlay_list = list( + "transp", + "tall", + "matte", + "zoppo" //u cant stoppo th zoppo + ) + var/lighter_color + var/list/color_list = list( //Same 16 color selection as electronic assemblies + COLOR_ASSEMBLY_BLACK, + COLOR_FLOORTILE_GRAY, + COLOR_ASSEMBLY_BGRAY, + COLOR_ASSEMBLY_WHITE, + COLOR_ASSEMBLY_RED, + COLOR_ASSEMBLY_ORANGE, + COLOR_ASSEMBLY_BEIGE, + COLOR_ASSEMBLY_BROWN, + COLOR_ASSEMBLY_GOLD, + COLOR_ASSEMBLY_YELLOW, + COLOR_ASSEMBLY_GURKHA, + COLOR_ASSEMBLY_LGREEN, + COLOR_ASSEMBLY_GREEN, + COLOR_ASSEMBLY_LBLUE, + COLOR_ASSEMBLY_BLUE, + COLOR_ASSEMBLY_PURPLE + ) + +/obj/item/lighter/greyscale/Initialize() + . = ..() + if(!lighter_color) + lighter_color = pick(color_list) + update_icon() + +/obj/item/lighter/greyscale/update_icon() + cut_overlays() + var/mutable_appearance/lighter_overlay = mutable_appearance(icon,"lighter_overlay_[overlay_state][lit ? "-on" : ""]") + icon_state = "[initial(icon_state)][lit ? "-on" : ""]" + lighter_overlay.color = lighter_color + add_overlay(lighter_overlay) + +/obj/item/lighter/greyscale/ignition_effect(atom/A, mob/user) + if(is_hot()) + . = "After some fiddling, [user] manages to light [A] with [src]." + + +/obj/item/lighter/slime + name = "slime zippo" + desc = "A specialty zippo made from slimes and industry. Has a much hotter flame than normal." + icon_state = "slighter" + heat = 3000 //Blue flame! + light_color = LIGHT_COLOR_CYAN + overlay_state = "slime" + grind_results = list(/datum/reagent/iron = 1, /datum/reagent/fuel = 5, /datum/reagent/medicine/pyroxadone = 5) + + +/////////// +//ROLLING// +/////////// +/obj/item/rollingpaper + name = "rolling paper" + desc = "A thin piece of paper used to make fine smokeables." + icon = 'icons/obj/cigarettes.dmi' + icon_state = "cig_paper" + w_class = WEIGHT_CLASS_TINY + +/obj/item/rollingpaper/afterattack(atom/target, mob/user, proximity) + . = ..() + if(!proximity) + return + if(istype(target, /obj/item/reagent_containers/food/snacks/grown)) + var/obj/item/reagent_containers/food/snacks/grown/O = target + if(O.dry) + var/obj/item/clothing/mask/cigarette/rollie/R = new /obj/item/clothing/mask/cigarette/rollie(user.loc) + R.chem_volume = target.reagents.total_volume + target.reagents.trans_to(R, R.chem_volume) + qdel(target) + qdel(src) + user.put_in_active_hand(R) + to_chat(user, "You roll the [target.name] into a rolling paper.") + R.desc = "Dried [target.name] rolled up in a thin piece of paper." + else + to_chat(user, "You need to dry this first!") + +/////////////// +//VAPE NATION// +/////////////// +/obj/item/clothing/mask/vape + name = "\improper E-Cigarette" + desc = "A classy and highly sophisticated electronic cigarette, for classy and dignified gentlemen. A warning label reads \"Warning: Do not fill with flammable materials.\""//<<< i'd vape to that. + icon = 'icons/obj/clothing/masks.dmi' + icon_state = null + item_state = null + w_class = WEIGHT_CLASS_TINY + var/chem_volume = 100 + var/vapetime = FALSE //this so it won't puff out clouds every tick + var/screw = FALSE // kinky + var/super = FALSE //for the fattest vapes dude. + +/obj/item/clothing/mask/vape/suicide_act(mob/user) + user.visible_message("[user] is puffin hard on dat vape, [user.p_they()] trying to join the vape life on a whole notha plane!")//it doesn't give you cancer, it is cancer + return (TOXLOSS|OXYLOSS) + + +/obj/item/clothing/mask/vape/Initialize(mapload, param_color) + . = ..() + create_reagents(chem_volume, NO_REACT) // so it doesn't react until you light it + reagents.add_reagent(/datum/reagent/drug/nicotine, 50) + if(!icon_state) + if(!param_color) + param_color = pick("red","blue","black","white","green","purple","yellow","orange") + icon_state = "[param_color]_vape" + item_state = "[param_color]_vape" + +/obj/item/clothing/mask/vape/attackby(obj/item/O, mob/user, params) + if(O.tool_behaviour == TOOL_SCREWDRIVER) + if(!screw) + screw = TRUE + to_chat(user, "You open the cap on [src].") + ENABLE_BITFIELD(reagents.reagents_holder_flags, OPENCONTAINER) + if(obj_flags & EMAGGED) + add_overlay("vapeopen_high") + else if(super) + add_overlay("vapeopen_med") + else + add_overlay("vapeopen_low") + else + screw = FALSE + to_chat(user, "You close the cap on [src].") + DISABLE_BITFIELD(reagents.reagents_holder_flags, OPENCONTAINER) + cut_overlays() + + if(O.tool_behaviour == TOOL_MULTITOOL) + if(screw && !(obj_flags & EMAGGED))//also kinky + if(!super) + cut_overlays() + super = TRUE + to_chat(user, "You increase the voltage of [src].") + add_overlay("vapeopen_med") + else + cut_overlays() + super = FALSE + to_chat(user, "You decrease the voltage of [src].") + add_overlay("vapeopen_low") + + if(screw && (obj_flags & EMAGGED)) + to_chat(user, "[src] can't be modified!") + + else + ..() + +/obj/item/clothing/mask/vape/emag_act(mob/user)// I WON'T REGRET WRITTING THIS, SURLY. + if(screw) + if(!(obj_flags & EMAGGED)) + cut_overlays() + obj_flags |= EMAGGED + super = FALSE + to_chat(user, "You maximize the voltage of [src].") + add_overlay("vapeopen_high") + var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect + sp.set_up(5, 1, src) + sp.start() + else + to_chat(user, "[src] is already emagged!") + else + to_chat(user, "You need to open the cap to do that.") + +/obj/item/clothing/mask/vape/attack_self(mob/user) + if(reagents.total_volume > 0) + to_chat(user, "You empty [src] of all reagents.") + reagents.clear_reagents() + +/obj/item/clothing/mask/vape/equipped(mob/user, slot) + if(slot == SLOT_WEAR_MASK) + if(!screw) + to_chat(user, "You start puffing on the vape.") + DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) + START_PROCESSING(SSobj, src) + else //it will not start if the vape is opened. + to_chat(user, "You need to close the cap first!") + +/obj/item/clothing/mask/vape/dropped(mob/user) + var/mob/living/carbon/C = user + if(C.get_item_by_slot(SLOT_WEAR_MASK) == src) + ENABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) + STOP_PROCESSING(SSobj, src) + +/obj/item/clothing/mask/vape/proc/hand_reagents()//had to rename to avoid duplicate error + if(reagents.total_volume) + if(iscarbon(loc)) + var/mob/living/carbon/C = loc + if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob + var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1) //this will react instantly, making them a little more dangerous than cigarettes + reagents.reaction(C, INGEST, fraction) + if(!reagents.trans_to(C, REAGENTS_METABOLISM)) + reagents.remove_any(REAGENTS_METABOLISM) + if(reagents.get_reagent_amount(/datum/reagent/fuel)) + //HOT STUFF + C.fire_stacks = 2 + C.IgniteMob() + + if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma)) // the plasma explodes when exposed to fire + var/datum/effect_system/reagents_explosion/e = new() + e.set_up(round(reagents.get_reagent_amount(/datum/reagent/toxin/plasma) / 2.5, 1), get_turf(src), 0, 0) + e.start() + qdel(src) + return + reagents.remove_any(REAGENTS_METABOLISM) + +/obj/item/clothing/mask/vape/process() + var/mob/living/M = loc + + if(isliving(loc)) + M.IgniteMob() + + vapetime++ + + if(!reagents.total_volume) + if(ismob(loc)) + to_chat(M, "[src] is empty!") + STOP_PROCESSING(SSobj, src) + //it's reusable so it won't unequip when empty + return + //open flame removed because vapes are a closed system, they wont light anything on fire + + if(super && vapetime > 3)//Time to start puffing those fat vapes, yo. + var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new + s.set_up(reagents, 1, 24, loc) + s.start() + vapetime = 0 + + if((obj_flags & EMAGGED) && vapetime > 3) + var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new + s.set_up(reagents, 4, 24, loc) + s.start() + vapetime = 0 + if(prob(5))//small chance for the vape to break and deal damage if it's emagged + playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0) + M.apply_damage(20, BURN, BODY_ZONE_HEAD) + M.Knockdown(300, 1, 0) + var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread + sp.set_up(5, 1, src) + sp.start() + to_chat(M, "[src] suddenly explodes in your mouth!") + qdel(src) + return + + if(reagents && reagents.total_volume) + hand_reagents() + +/////////////// +/////BONGS///// +/////////////// + +/obj/item/bong + name = "bong" + desc = "A water bong used for smoking dried plants." + icon = 'icons/obj/bongs.dmi' + icon_state = null + item_state = null + w_class = WEIGHT_CLASS_NORMAL + light_color = "#FFCC66" + var/icon_off = "bong" + var/icon_on = "bong_lit" + var/chem_volume = 100 + var/last_used_time //for cooldown + var/firecharges = 0 //used for counting how many hits can be taken before the flame goes out + var/list/list_reagents = list() //For the base reagents bongs could get + + +/obj/item/bong/Initialize() + . = ..() + create_reagents(chem_volume, NO_REACT) // so it doesn't react until you light it + reagents.add_reagent_list(list_reagents) + icon_state = icon_off + +/obj/item/bong/attackby(obj/item/O, mob/user, params) + . = ..() + //If we're using a dried plant.. + if(istype(O,/obj/item/reagent_containers/food/snacks)) + var/obj/item/reagent_containers/food/snacks/DP = O + if (DP.dry) + //Nothing if our bong is full + if (reagents.holder_full()) + user.show_message("The bowl is full!", 1) + return + + //Transfer reagents and remove the plant + user.show_message("You stuff the [DP] into the [src]'s bowl.", 1) + DP.reagents.trans_to(src, 100) + qdel(DP) + return + else + user.show_message("[DP] must be dried first!", 1) + return + + if (O.heat > 500) + if (reagents && reagents.total_volume) //if there's stuff in the bong + var/lighting_text = O.ignition_effect(src, user) + if(lighting_text) + //Logic regarding igniting it on + if (firecharges == 0) + user.show_message("You light the [src] with the [O]!", 1) + bongturnon() + else + user.show_message("You rekindle [src]'s flame with the [O]!", 1) + + firecharges = 1 + return + else + user.show_message("There's nothing to light up in the bowl.", 1) + return + +/obj/item/bong/CtrlShiftClick(mob/user) //empty reagents on alt click + if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + + if (reagents && reagents.total_volume) + user.show_message("You empty the [src].", 1) + reagents.clear_reagents() + if(firecharges) + firecharges = 0 + bongturnoff() + else + user.show_message("The [src] is already empty.", 1) + +/obj/item/bong/AltClick(mob/user) + if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + + if(firecharges) + firecharges = 0 + bongturnoff() + user.show_message("You quench the flame.", 1) + +/obj/item/bong/examine(mob/user) + . = ..() + if(!reagents.total_volume) + . += "The bowl is empty." + else if (reagents.total_volume > 80) + . += "The bowl is filled to the brim." + else if (reagents.total_volume > 40) + . += "The bowl has plenty weed in it." + else + . += "The bowl has some weed in it." + + . += "Ctrl+Shift-click to empty." + . += "Alt-click to extinguish." + +/obj/item/bong/ignition_effect(atom/A, mob/user) + if(firecharges) + . = "[user] lights [A] off of the [src]." + else + . = "" + +/obj/item/bong/attack(mob/living/carbon/M, mob/living/carbon/user, obj/target) + //if it's lit up, some stuff in the bowl and the user is a target, and we're not on cooldown + if (!reagents) + return + + if (M ==! user) + return + + if(user.is_mouth_covered(head_only = 1)) + to_chat(user, "Remove your headgear first.") + return + + if(user.is_mouth_covered(mask_only = 1)) + to_chat(user, "Remove your mask first.") + return + + if (!reagents.total_volume) + to_chat(user, "There's nothing in the bowl.") + return + + if (!firecharges) + to_chat(user, "You have to light it up first.") + return + + if (last_used_time + 30 < world.time) + var/hit_strength + var/noise + var/hittext = "" + //if the intent is help then you take a small hit, else a big one + if (user.a_intent == INTENT_HARM) + hit_strength = 2 + noise = 100 + hittext = "big hit" + else + hit_strength = 1 + noise = 70 + hittext = "hit" + //bubbling sound + playsound(user.loc,'sound/effects/bonghit.ogg', noise, 1) + + last_used_time = world.time + + //message + user.visible_message("[user] begins to take a "+ hittext +" from the [src]!", \ + "You begin to take a "+ hittext +" from [src].") + + //we take a hit here, after an uninterrupted delay + if(do_after(user, 25, target = user)) + if (reagents && reagents.total_volume) + var/fraction = 12 * hit_strength + + var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new + s.set_up(reagents, hit_strength, 18, user.loc) + s.start() + + reagents.reaction(user, INGEST, fraction) + if(!reagents.trans_to(user, fraction)) + reagents.remove_any(fraction) + + if (hit_strength == 2 && prob(15)) + user.emote("cough") + user.adjustOxyLoss(15) + + //playsound(user.loc, 'sound/effects/smoke.ogg', 10, 1, -3) + + user.visible_message("[user] takes a "+ hittext +" from the [src]!", \ + "You take a "+ hittext +" from [src].") + + firecharges = firecharges - 1 + if (firecharges == 0) + bongturnoff() + if (!reagents.total_volume) + firecharges = 0 + bongturnoff() + + + +/obj/item/bong/proc/bongturnon() + icon_state = icon_on + set_light(3, 0.8) + +/obj/item/bong/proc/bongturnoff() + icon_state = icon_off + set_light(0, 0.0) + + + +/obj/item/bong/coconut + name = "coconut bong" + icon_off = "coconut_bong" + icon_on = "coconut_bong_lit" + desc = "A water bong used for smoking dried plants. This one's made out of a coconut and some bamboo" diff --git a/code/game/objects/items/circuitboards/circuitboard.dm b/code/game/objects/items/circuitboards/circuitboard.dm index 8106733a..5f87f9ff 100644 --- a/code/game/objects/items/circuitboards/circuitboard.dm +++ b/code/game/objects/items/circuitboards/circuitboard.dm @@ -12,7 +12,7 @@ righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' materials = list(MAT_GLASS=1000) w_class = WEIGHT_CLASS_SMALL - grind_results = list("silicon" = 20) + grind_results = list(/datum/reagent/silicon = 20) var/build_path = null /obj/item/circuitboard/proc/apply_default_parts(obj/machinery/M) diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm index 770d1805..5d3cdaa6 100644 --- a/code/game/objects/items/clown_items.dm +++ b/code/game/objects/items/clown_items.dm @@ -1,171 +1,171 @@ -/* Clown Items - * Contains: - * Soap - * Bike Horns - * Air Horns - * Canned Laughter - */ - -/* - * Soap - */ - -/obj/item/soap - name = "soap" - desc = "A cheap bar of soap. Doesn't smell." - gender = PLURAL - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "soap" - lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' - w_class = WEIGHT_CLASS_TINY - item_flags = NOBLUDGEON - throwforce = 0 - throw_speed = 3 - throw_range = 7 - grind_results = list("lye" = 10) - var/cleanspeed = 50 //slower than mop - force_string = "robust... against germs" - -/obj/item/soap/Initialize() - . = ..() - AddComponent(/datum/component/slippery, 80) - -/obj/item/soap/nanotrasen - desc = "A Kinaris.Co brand bar of soap. Smells of plasma." - icon_state = "soapnt" - -/obj/item/soap/homemade - desc = "A homemade bar of soap. Smells of... well...." - icon_state = "soapgibs" - cleanspeed = 45 // a little faster to reward chemists for going to the effort - -/obj/item/soap/deluxe - desc = "A deluxe Waffle Co. brand bar of soap. Smells of high-class luxury." - icon_state = "soapdeluxe" - cleanspeed = 40 //same speed as mop because deluxe -- captain gets one of these - -/obj/item/soap/syndie - desc = "An untrustworthy bar of soap made of strong chemical agents that dissolve blood faster." - icon_state = "soapsyndie" - cleanspeed = 10 //much faster than mop so it is useful for traitors who want to clean crime scenes - -/obj/item/soap/suicide_act(mob/user) - user.say(";FFFFFFFFFFFFFFFFUUUUUUUDGE!!", forced="soap suicide") - user.visible_message("[user] lifts [src] to [user.p_their()] mouth and gnaws on it furiously, producing a thick froth! [user.p_they(TRUE)]'ll never get that BB gun now!") - new /obj/effect/particle_effect/foam(loc) - return (TOXLOSS) - -/obj/item/soap/afterattack(atom/target, mob/user, proximity) - . = ..() - if(!proximity || !check_allowed_items(target)) - return - //I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing. - //So this is a workaround. This also makes more sense from an IC standpoint. ~Carn - if(user.client && ((target in user.client.screen) && !user.is_holding(target))) - to_chat(user, "You need to take that [target.name] off before cleaning it!") - else if(istype(target, /obj/effect/decal/cleanable)) - user.visible_message("[user] begins to scrub \the [target.name] out with [src].", "You begin to scrub \the [target.name] out with [src]...") - if(do_after(user, src.cleanspeed, target = target)) - to_chat(user, "You scrub \the [target.name] out.") - qdel(target) - else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH) - var/mob/living/carbon/human/H = user - user.visible_message("\the [user] washes \the [target]'s mouth out with [src.name]!", "You wash \the [target]'s mouth out with [src.name]!") //washes mouth out with soap sounds better than 'the soap' here - H.lip_style = null //removes lipstick - H.update_body() - return - else if(istype(target, /obj/structure/window)) - user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") - if(do_after(user, src.cleanspeed, target = target)) - to_chat(user, "You clean \the [target.name].") - target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - target.set_opacity(initial(target.opacity)) - else - user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") - if(do_after(user, src.cleanspeed, target = target)) - to_chat(user, "You clean \the [target.name].") - var/obj/effect/decal/cleanable/C = locate() in target - qdel(C) - target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - SEND_SIGNAL(target, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM) - target.wash_cream() - return - - -/* - * Bike Horns - */ - -/obj/item/bikehorn - name = "bike horn" - desc = "A horn off of a bicycle." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "bike_horn" - item_state = "bike_horn" - lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi' - throwforce = 0 - hitsound = null //To prevent tap.ogg playing, as the item lacks of force - w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - attack_verb = list("HONKED") - -/obj/item/bikehorn/Initialize() - . = ..() - AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 50) - -/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user) - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "honk", /datum/mood_event/honk) - return ..() - -/obj/item/bikehorn/suicide_act(mob/user) - user.visible_message("[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!") - playsound(src, 'sound/items/bikehorn.ogg', 50, 1) - return (BRUTELOSS) - -//air horn -/obj/item/bikehorn/airhorn - name = "air horn" - desc = "Damn son, where'd you find this?" - icon_state = "air_horn" - -/obj/item/bikehorn/airhorn/Initialize() - . = ..() - AddComponent(/datum/component/squeak, list('sound/items/airhorn2.ogg'=1), 50) - -//golden bikehorn -/obj/item/bikehorn/golden - name = "golden bike horn" - desc = "Golden? Clearly, it's made with bananium! Honk!" - icon_state = "gold_horn" - item_state = "gold_horn" - var/flip_cooldown = 0 - -/obj/item/bikehorn/golden/attack() - if(flip_cooldown < world.time) - flip_mobs() - return ..() - -/obj/item/bikehorn/golden/attack_self(mob/user) - if(flip_cooldown < world.time) - flip_mobs() - ..() - -/obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user) - var/turf/T = get_turf(src) - for(M in ohearers(7, T)) - if(ishuman(M) && M.can_hear()) - var/mob/living/carbon/human/H = M - if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) - continue - M.emote("flip") - flip_cooldown = world.time + 7 - -//canned laughter -/obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter - name = "Canned Laughter" - desc = "Just looking at this makes you want to giggle." - icon_state = "laughter" - list_reagents = list("laughter" = 50) \ No newline at end of file +/* Clown Items + * Contains: + * Soap + * Bike Horns + * Air Horns + * Canned Laughter + */ + +/* + * Soap + */ + +/obj/item/soap + name = "soap" + desc = "A cheap bar of soap. Doesn't smell." + gender = PLURAL + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "soap" + lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' + w_class = WEIGHT_CLASS_TINY + item_flags = NOBLUDGEON + throwforce = 0 + throw_speed = 3 + throw_range = 7 + grind_results = list(/datum/reagent/lye = 10) + var/cleanspeed = 50 //slower than mop + force_string = "robust... against germs" + +/obj/item/soap/Initialize() + . = ..() + AddComponent(/datum/component/slippery, 80) + +/obj/item/soap/nanotrasen + desc = "A Kinaris.Co brand bar of soap. Smells of plasma." + icon_state = "soapnt" + +/obj/item/soap/homemade + desc = "A homemade bar of soap. Smells of... well...." + icon_state = "soapgibs" + cleanspeed = 45 // a little faster to reward chemists for going to the effort + +/obj/item/soap/deluxe + desc = "A deluxe Waffle Co. brand bar of soap. Smells of high-class luxury." + icon_state = "soapdeluxe" + cleanspeed = 40 //same speed as mop because deluxe -- captain gets one of these + +/obj/item/soap/syndie + desc = "An untrustworthy bar of soap made of strong chemical agents that dissolve blood faster." + icon_state = "soapsyndie" + cleanspeed = 10 //much faster than mop so it is useful for traitors who want to clean crime scenes + +/obj/item/soap/suicide_act(mob/user) + user.say(";FFFFFFFFFFFFFFFFUUUUUUUDGE!!", forced="soap suicide") + user.visible_message("[user] lifts [src] to [user.p_their()] mouth and gnaws on it furiously, producing a thick froth! [user.p_they(TRUE)]'ll never get that BB gun now!") + new /obj/effect/particle_effect/foam(loc) + return (TOXLOSS) + +/obj/item/soap/afterattack(atom/target, mob/user, proximity) + . = ..() + if(!proximity || !check_allowed_items(target)) + return + //I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing. + //So this is a workaround. This also makes more sense from an IC standpoint. ~Carn + if(user.client && ((target in user.client.screen) && !user.is_holding(target))) + to_chat(user, "You need to take that [target.name] off before cleaning it!") + else if(istype(target, /obj/effect/decal/cleanable)) + user.visible_message("[user] begins to scrub \the [target.name] out with [src].", "You begin to scrub \the [target.name] out with [src]...") + if(do_after(user, src.cleanspeed, target = target)) + to_chat(user, "You scrub \the [target.name] out.") + qdel(target) + else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH) + var/mob/living/carbon/human/H = user + user.visible_message("\the [user] washes \the [target]'s mouth out with [src.name]!", "You wash \the [target]'s mouth out with [src.name]!") //washes mouth out with soap sounds better than 'the soap' here + H.lip_style = null //removes lipstick + H.update_body() + return + else if(istype(target, /obj/structure/window)) + user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") + if(do_after(user, src.cleanspeed, target = target)) + to_chat(user, "You clean \the [target.name].") + target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) + target.set_opacity(initial(target.opacity)) + else + user.visible_message("[user] begins to clean \the [target.name] with [src]...", "You begin to clean \the [target.name] with [src]...") + if(do_after(user, src.cleanspeed, target = target)) + to_chat(user, "You clean \the [target.name].") + var/obj/effect/decal/cleanable/C = locate() in target + qdel(C) + target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) + SEND_SIGNAL(target, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM) + target.wash_cream() + return + + +/* + * Bike Horns + */ + +/obj/item/bikehorn + name = "bike horn" + desc = "A horn off of a bicycle." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "bike_horn" + item_state = "bike_horn" + lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi' + throwforce = 0 + hitsound = null //To prevent tap.ogg playing, as the item lacks of force + w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + attack_verb = list("HONKED") + +/obj/item/bikehorn/Initialize() + . = ..() + AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 50) + +/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "honk", /datum/mood_event/honk) + return ..() + +/obj/item/bikehorn/suicide_act(mob/user) + user.visible_message("[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!") + playsound(src, 'sound/items/bikehorn.ogg', 50, 1) + return (BRUTELOSS) + +//air horn +/obj/item/bikehorn/airhorn + name = "air horn" + desc = "Damn son, where'd you find this?" + icon_state = "air_horn" + +/obj/item/bikehorn/airhorn/Initialize() + . = ..() + AddComponent(/datum/component/squeak, list('sound/items/airhorn2.ogg'=1), 50) + +//golden bikehorn +/obj/item/bikehorn/golden + name = "golden bike horn" + desc = "Golden? Clearly, it's made with bananium! Honk!" + icon_state = "gold_horn" + item_state = "gold_horn" + var/flip_cooldown = 0 + +/obj/item/bikehorn/golden/attack() + if(flip_cooldown < world.time) + flip_mobs() + return ..() + +/obj/item/bikehorn/golden/attack_self(mob/user) + if(flip_cooldown < world.time) + flip_mobs() + ..() + +/obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user) + var/turf/T = get_turf(src) + for(M in ohearers(7, T)) + if(ishuman(M) && M.can_hear()) + var/mob/living/carbon/human/H = M + if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) + continue + M.emote("flip") + flip_cooldown = world.time + 7 + +//canned laughter +/obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter + name = "Canned Laughter" + desc = "Just looking at this makes you want to giggle." + icon_state = "laughter" + list_reagents = list(/datum/reagent/consumable/laughter = 50) \ No newline at end of file diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 6e1bac03..0176ee61 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -59,7 +59,7 @@ var/edible = TRUE // That doesn't mean eating it is a good idea - var/list/reagent_contents = list("nutriment" = 1) + var/list/reagent_contents = list(/datum/reagent/consumable/nutriment = 1) // If the user can toggle the colour, a la vanilla spraycan var/can_change_colour = FALSE @@ -485,63 +485,63 @@ icon_state = "crayonred" paint_color = "#DA0000" item_color = "red" - reagent_contents = list("nutriment" = 1, "redcrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/red = 1) /obj/item/toy/crayon/orange icon_state = "crayonorange" paint_color = "#FF9300" item_color = "orange" - reagent_contents = list("nutriment" = 1, "orangecrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/orange = 1) /obj/item/toy/crayon/yellow icon_state = "crayonyellow" paint_color = "#FFF200" item_color = "yellow" - reagent_contents = list("nutriment" = 1, "yellowcrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/yellow = 1) /obj/item/toy/crayon/green icon_state = "crayongreen" paint_color = "#A8E61D" item_color = "green" - reagent_contents = list("nutriment" = 1, "greencrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/green = 1) /obj/item/toy/crayon/blue icon_state = "crayonblue" paint_color = "#00B7EF" item_color = "blue" - reagent_contents = list("nutriment" = 1, "bluecrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/blue = 1) /obj/item/toy/crayon/purple icon_state = "crayonpurple" paint_color = "#DA00FF" item_color = "purple" - reagent_contents = list("nutriment" = 1, "purplecrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/purple = 1) /obj/item/toy/crayon/black icon_state = "crayonblack" paint_color = "#1C1C1C" //Not completely black because total black looks bad. So Mostly Black. item_color = "black" - reagent_contents = list("nutriment" = 1, "blackcrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/black = 1) /obj/item/toy/crayon/white icon_state = "crayonwhite" paint_color = "#FFFFFF" item_color = "white" - reagent_contents = list("nutriment" = 1, "whitecrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/white = 1) /obj/item/toy/crayon/mime icon_state = "crayonmime" desc = "A very sad-looking crayon." paint_color = "#FFFFFF" item_color = "mime" - reagent_contents = list("nutriment" = 1, "invisiblecrayonpowder" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/invisible = 1) charges = -1 /obj/item/toy/crayon/rainbow icon_state = "crayonrainbow" paint_color = "#FFF000" item_color = "rainbow" - reagent_contents = list("nutriment" = 1, "colorful_reagent" = 1) + reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent = 1) drawtype = RANDOM_ANY // just the default starter. charges = -1 @@ -621,7 +621,7 @@ can_change_colour = TRUE gang = TRUE //Gang check is true for all things upon the honored hierarchy of spraycans, except those that are FALSE. - reagent_contents = list("welding_fuel" = 1, "ethanol" = 1) + reagent_contents = list(/datum/reagent/fuel = 1, /datum/reagent/consumable/ethanol = 1) pre_noise = TRUE post_noise = FALSE @@ -778,7 +778,7 @@ volume_multiplier = 25 charges = 100 - reagent_contents = list("clf3" = 1) + reagent_contents = list(/datum/reagent/clf3 = 1) actually_paints = FALSE paint_color = "#000000" @@ -791,7 +791,7 @@ use_overlays = FALSE gang = FALSE - reagent_contents = list("lube" = 1, "banana" = 1) + reagent_contents = list(/datum/reagent/lube = 1, /datum/reagent/consumable/banana = 1) volume_multiplier = 5 /obj/item/toy/crayon/spraycan/lubecan/isValidSurface(surface) @@ -811,7 +811,7 @@ pre_noise = FALSE post_noise = FALSE - reagent_contents = list("nothing" = 1, "mutetoxin" = 1) + reagent_contents = list(/datum/reagent/consumable/nothing = 1, /datum/reagent/toxin/mutetoxin = 1) /obj/item/toy/crayon/spraycan/gang charges = 20 // Charges back to 20, which is the default value for them. diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index ca1648bb..6db2e9af 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -13,7 +13,8 @@ var/cleaning = FALSE var/cleaning_cycles = 10 var/patient_laststat = null - var/list/injection_chems = list("antitoxin", "epinephrine", "salbutamol", "bicaridine", "kelotane") + var/list/injection_chems = list(/datum/reagent/medicine/antitoxin, /datum/reagent/medicine/epinephrine, + /datum/reagent/medicine/salbutamol, /datum/reagent/medicine/bicaridine, /datum/reagent/medicine/kelotane) var/eject_port = "ingestion" var/escape_in_progress = FALSE var/message_cooldown @@ -184,7 +185,7 @@ data["chem"] = list() for(var/chem in injection_chems) var/datum/reagent/R = GLOB.chemical_reagents_list[chem] - data["chem"] += list(list("name" = R.name, "id" = R.id)) + data["chem"] += list(list("name" = R.name, "id" = R.type)) data["occupant"] = list() var/mob/living/mob_occupant = patient @@ -227,8 +228,8 @@ go_out() . = TRUE if("inject") - var/chem = params["chem"] - if(!patient) + var/chem = text2path(params["chem"]) + if(!patient || !chem) return inject_chem(chem) . = TRUE diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 5eea5703..278d5115 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -1,545 +1,546 @@ -/obj/item/flashlight - name = "flashlight" - desc = "A hand-held emergency light." - icon = 'icons/obj/lighting.dmi' - icon_state = "flashlight" - item_state = "flashlight" - lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' - righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - w_class = WEIGHT_CLASS_SMALL - flags_1 = CONDUCT_1 - slot_flags = ITEM_SLOT_BELT - materials = list(MAT_METAL=50, MAT_GLASS=20) - actions_types = list(/datum/action/item_action/toggle_light) - var/on = FALSE - var/brightness_on = 4 //range of light when on - var/flashlight_power = 0.8 //strength of the light when on - light_color = "#FFCC66" - -/obj/item/flashlight/Initialize() - . = ..() - if(icon_state == "[initial(icon_state)]-on") - on = TRUE - update_brightness() - -/obj/item/flashlight/proc/update_brightness(mob/user = null) - if(on) - icon_state = "[initial(icon_state)]-on" - if(flashlight_power) - set_light(l_range = brightness_on, l_power = flashlight_power) - else - set_light(brightness_on) - else - icon_state = initial(icon_state) - set_light(0) - -/obj/item/flashlight/attack_self(mob/user) - on = !on - update_brightness(user) - playsound(user, on ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, 1) - for(var/X in actions) - var/datum/action/A = X - A.UpdateButtonIcon() - return 1 - -/obj/item/flashlight/suicide_act(mob/living/carbon/human/user) - if (user.eye_blind) - user.visible_message("[user] is putting [src] close to [user.p_their()] eyes and turning it on ... but [user.p_theyre()] blind!") - return SHAME - user.visible_message("[user] is putting [src] close to [user.p_their()] eyes and turning it on! It looks like [user.p_theyre()] trying to commit suicide!") - return (FIRELOSS) - -/obj/item/flashlight/attack(mob/living/carbon/M, mob/living/carbon/human/user) - add_fingerprint(user) - if(istype(M) && on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) - - if((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) //too dumb to use flashlight properly - return ..() //just hit them in the head - - if(!user.IsAdvancedToolUser()) - to_chat(user, "You don't have the dexterity to do this!") - return - - if(!M.get_bodypart(BODY_ZONE_HEAD)) - to_chat(user, "[M] doesn't have a head!") - return - - if(flashlight_power < 0.3) - to_chat(user, "\The [src] isn't bright enough to see anything! ") - return - - switch(user.zone_selected) - if(BODY_ZONE_PRECISE_EYES) - if((M.head && M.head.flags_cover & HEADCOVERSEYES) || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) || (M.glasses && M.glasses.flags_cover & GLASSESCOVERSEYES)) - to_chat(user, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSEYES) ? "helmet" : (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) ? "mask": "glasses"] first.") - return - - var/obj/item/organ/eyes/E = M.getorganslot(ORGAN_SLOT_EYES) - if(!E) - to_chat(user, "[M] doesn't have any eyes!") - return - - if(M == user) //they're using it on themselves - if(M.flash_act(visual = 1)) - M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes! Trippy!") - else - M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes.") - else - user.visible_message("[user] directs [src] to [M]'s eyes.", \ - "You direct [src] to [M]'s eyes.") - if(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_BLIND)) || !M.flash_act(visual = 1)) //mob is dead or fully blind - to_chat(user, "[M]'s pupils don't react to the light!") - else if(M.dna && M.dna.check_mutation(XRAY)) //mob has X-ray vision - to_chat(user, "[M]'s pupils give an eerie glow!") - else //they're okay! - to_chat(user, "[M]'s pupils narrow.") - - if(BODY_ZONE_PRECISE_MOUTH) - - if(M.is_mouth_covered()) - to_chat(user, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSMOUTH) ? "helmet" : "mask"] first.") - return - - var/their = M.p_their() - - var/list/mouth_organs = new - for(var/obj/item/organ/O in M.internal_organs) - if(O.zone == BODY_ZONE_PRECISE_MOUTH) - mouth_organs.Add(O) - var/organ_list = "" - var/organ_count = LAZYLEN(mouth_organs) - if(organ_count) - for(var/I in 1 to organ_count) - if(I > 1) - if(I == mouth_organs.len) - organ_list += ", and " - else - organ_list += ", " - var/obj/item/organ/O = mouth_organs[I] - organ_list += (O.gender == "plural" ? O.name : "\an [O.name]") - - var/pill_count = 0 - for(var/datum/action/item_action/hands_free/activate_pill/AP in M.actions) - pill_count++ - - if(M == user) - var/can_use_mirror = FALSE - if(isturf(user.loc)) - var/obj/structure/mirror/mirror = locate(/obj/structure/mirror, user.loc) - if(mirror) - switch(user.dir) - if(NORTH) - can_use_mirror = mirror.pixel_y > 0 - if(SOUTH) - can_use_mirror = mirror.pixel_y < 0 - if(EAST) - can_use_mirror = mirror.pixel_x > 0 - if(WEST) - can_use_mirror = mirror.pixel_x < 0 - - M.visible_message("[M] directs [src] to [their] mouth.", \ - "You point [src] into your mouth.") - if(!can_use_mirror) - to_chat(user, "You can't see anything without a mirror.") - return - if(organ_count) - to_chat(user, "Inside your mouth [organ_count > 1 ? "are" : "is"] [organ_list].") - else - to_chat(user, "There's nothing inside your mouth.") - if(pill_count) - to_chat(user, "You have [pill_count] implanted pill[pill_count > 1 ? "s" : ""].") - - else - user.visible_message("[user] directs [src] to [M]'s mouth.",\ - "You direct [src] to [M]'s mouth.") - if(organ_count) - to_chat(user, "Inside [their] mouth [organ_count > 1 ? "are" : "is"] [organ_list].") - else - to_chat(user, "[M] doesn't have any organs in [their] mouth.") - if(pill_count) - to_chat(user, "[M] has [pill_count] pill[pill_count > 1 ? "s" : ""] implanted in [their] teeth.") - - else - return ..() - -/obj/item/flashlight/pen - name = "penlight" - desc = "A pen-sized light, used by medical staff. It can also be used to create a hologram to alert people of incoming medical assistance." - icon_state = "penlight" - item_state = "" - flags_1 = CONDUCT_1 - brightness_on = 2 - light_color = "#FFDDCC" - flashlight_power = 0.3 - var/holo_cooldown = 0 - -/obj/item/flashlight/pen/afterattack(atom/target, mob/user, proximity_flag) - . = ..() - if(!proximity_flag) - if(holo_cooldown > world.time) - to_chat(user, "[src] is not ready yet!") - return - var/T = get_turf(target) - if(locate(/mob/living) in T) - new /obj/effect/temp_visual/medical_holosign(T,user) //produce a holographic glow - holo_cooldown = world.time + 100 - return - -/obj/effect/temp_visual/medical_holosign - name = "medical holosign" - desc = "A small holographic glow that indicates a medic is coming to treat a patient." - icon_state = "medi_holo" - duration = 30 - -/obj/effect/temp_visual/medical_holosign/Initialize(mapload, creator) - . = ..() - playsound(loc, 'sound/machines/ping.ogg', 50, 0) //make some noise! - if(creator) - visible_message("[creator] created a medical hologram!") - - -/obj/item/flashlight/seclite - name = "seclite" - desc = "A robust flashlight used by security." - icon_state = "seclite" - item_state = "seclite" - lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' - force = 9 // Not as good as a stun baton. - brightness_on = 5 // A little better than the standard flashlight. - light_color = "#CDDDFF" - flashlight_power = 0.9 - hitsound = 'sound/weapons/genhit1.ogg' - -// the desk lamps are a bit special -/obj/item/flashlight/lamp - name = "desk lamp" - desc = "A desk lamp with an adjustable mount." - icon_state = "lamp" - item_state = "lamp" - lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' - righthand_file = 'icons/mob/inhands/items_righthand.dmi' - force = 10 - brightness_on = 5 - light_color = "#FFDDBB" - w_class = WEIGHT_CLASS_BULKY - flags_1 = CONDUCT_1 - materials = list() - on = TRUE - - -// green-shaded desk lamp -/obj/item/flashlight/lamp/green - desc = "A classic green-shaded desk lamp." - icon_state = "lampgreen" - item_state = "lampgreen" - - - -/obj/item/flashlight/lamp/verb/toggle_light() - set name = "Toggle light" - set category = "Object" - set src in oview(1) - - if(!usr.stat) - attack_self(usr) - -//Bananalamp -/obj/item/flashlight/lamp/bananalamp - name = "banana lamp" - desc = "Only a clown would think to make a ghetto banana-shaped lamp. Even has a goofy pullstring." - icon_state = "bananalamp" - item_state = "bananalamp" - -// FLARES - -/obj/item/flashlight/flare - name = "flare" - desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'." - w_class = WEIGHT_CLASS_SMALL - brightness_on = 7 // Pretty bright. - light_color = "#FA421A" - icon_state = "flare" - item_state = "flare" - actions_types = list() - var/fuel = 0 - var/on_damage = 7 - var/produce_heat = 1500 - heat = 1000 - light_color = LIGHT_COLOR_FLARE - grind_results = list("sulfur" = 15) - -/obj/item/flashlight/flare/New() - fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds. - ..() - -/obj/item/flashlight/flare/process() - open_flame(heat) - fuel = max(fuel - 1, 0) - if(!fuel || !on) - turn_off() - if(!fuel) - icon_state = "[initial(icon_state)]-empty" - STOP_PROCESSING(SSobj, src) - -/obj/item/flashlight/flare/ignition_effect(atom/A, mob/user) - if(fuel && on) - . = "[user] lights [A] with [src] like a real \ - badass." - else - . = "" - -/obj/item/flashlight/flare/proc/turn_off() - on = FALSE - force = initial(src.force) - damtype = initial(src.damtype) - if(ismob(loc)) - var/mob/U = loc - update_brightness(U) - else - update_brightness(null) - -/obj/item/flashlight/flare/update_brightness(mob/user = null) - ..() - if(on) - item_state = "[initial(item_state)]-on" - else - item_state = "[initial(item_state)]" - -/obj/item/flashlight/flare/attack_self(mob/user) - - // Usual checks - if(!fuel) - to_chat(user, "[src] is out of fuel!") - return - if(on) - to_chat(user, "[src] is already on.") - return - - . = ..() - // All good, turn it on. - if(.) - user.visible_message("[user] lights \the [src].", "You light \the [src]!") - force = on_damage - damtype = "fire" - START_PROCESSING(SSobj, src) - -/obj/item/flashlight/flare/is_hot() - return on * heat - -/obj/item/flashlight/flare/torch - name = "torch" - desc = "A torch fashioned from some leaves and a log." - w_class = WEIGHT_CLASS_BULKY - brightness_on = 4 - light_color = "#FAA44B" - icon_state = "torch" - item_state = "torch" - lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' - righthand_file = 'icons/mob/inhands/items_righthand.dmi' - light_color = LIGHT_COLOR_ORANGE - on_damage = 10 - slot_flags = null - -/obj/item/flashlight/lantern - name = "lantern" - icon_state = "lantern" - item_state = "lantern" - lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi' - desc = "A mining lantern." - brightness_on = 6 // luminosity when on - light_color = "#FFAA44" - flashlight_power = 0.75 - - -/obj/item/flashlight/slime - gender = PLURAL - name = "glowing slime extract" - desc = "Extract from a yellow slime. It emits a strong light when squeezed." - icon = 'icons/obj/lighting.dmi' - icon_state = "slime" - item_state = "slime" - w_class = WEIGHT_CLASS_SMALL - slot_flags = ITEM_SLOT_BELT - materials = list() - brightness_on = 6 //luminosity when on - light_color = "#FFEEAA" - flashlight_power = 0.6 - -/obj/item/flashlight/emp - var/emp_max_charges = 4 - var/emp_cur_charges = 4 - var/charge_tick = 0 - - -/obj/item/flashlight/emp/New() - ..() - START_PROCESSING(SSobj, src) - -/obj/item/flashlight/emp/Destroy() - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/item/flashlight/emp/process() - charge_tick++ - if(charge_tick < 10) - return FALSE - charge_tick = 0 - emp_cur_charges = min(emp_cur_charges+1, emp_max_charges) - return TRUE - -/obj/item/flashlight/emp/attack(mob/living/M, mob/living/user) - if(on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) // call original attack when examining organs - ..() - return - -/obj/item/flashlight/emp/afterattack(atom/movable/A, mob/user, proximity) - . = ..() - if(!proximity) - return - - if(emp_cur_charges > 0) - emp_cur_charges -= 1 - - if(ismob(A)) - var/mob/M = A - log_combat(user, M, "attacked", "EMP-light") - M.visible_message("[user] blinks \the [src] at \the [A].", \ - "[user] blinks \the [src] at you.") - else - A.visible_message("[user] blinks \the [src] at \the [A].") - to_chat(user, "\The [src] now has [emp_cur_charges] charge\s.") - A.emp_act(EMP_HEAVY) - else - to_chat(user, "\The [src] needs time to recharge!") - return - -/obj/item/flashlight/emp/debug //for testing emp_act() - name = "debug EMP flashlight" - emp_max_charges = 100 - emp_cur_charges = 100 - -// Glowsticks, in the uncomfortable range of similar to flares, -// but not similar enough to make it worth a refactor -/obj/item/flashlight/glowstick - name = "glowstick" - desc = "A military-grade glowstick." - w_class = WEIGHT_CLASS_SMALL - brightness_on = 4 - color = LIGHT_COLOR_GREEN - icon_state = "glowstick" - item_state = "glowstick" - grind_results = list("phenol" = 15, "hydrogen" = 10, "oxygen" = 5) //Meth-in-a-stick - var/fuel = 0 - -/obj/item/flashlight/glowstick/Initialize() - fuel = rand(1600, 2000) - light_color = color - . = ..() - -/obj/item/flashlight/glowstick/Destroy() - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/item/flashlight/glowstick/process() - fuel = max(fuel - 1, 0) - if(!fuel) - turn_off() - STOP_PROCESSING(SSobj, src) - update_icon() - -/obj/item/flashlight/glowstick/proc/turn_off() - on = FALSE - update_icon() - -/obj/item/flashlight/glowstick/update_icon() - item_state = "glowstick" - cut_overlays() - if(!fuel) - icon_state = "glowstick-empty" - cut_overlays() - set_light(0) - else if(on) - var/mutable_appearance/glowstick_overlay = mutable_appearance(icon, "glowstick-glow") - glowstick_overlay.color = color - add_overlay(glowstick_overlay) - item_state = "glowstick-on" - set_light(brightness_on) - else - icon_state = "glowstick" - cut_overlays() - -/obj/item/flashlight/glowstick/attack_self(mob/user) - if(!fuel) - to_chat(user, "[src] is spent.") - return - if(on) - to_chat(user, "[src] is already lit.") - return - - . = ..() - if(.) - user.visible_message("[user] cracks and shakes [src].", "You crack and shake [src], turning it on!") - activate() - -/obj/item/flashlight/glowstick/proc/activate() - if(!on) - on = TRUE - START_PROCESSING(SSobj, src) - -/obj/item/flashlight/glowstick/red - name = "red glowstick" - color = LIGHT_COLOR_RED - -/obj/item/flashlight/glowstick/blue - name = "blue glowstick" - color = LIGHT_COLOR_BLUE - -/obj/item/flashlight/glowstick/cyan - name = "cyan glowstick" - color = LIGHT_COLOR_CYAN - -/obj/item/flashlight/glowstick/orange - name = "orange glowstick" - color = LIGHT_COLOR_ORANGE - -/obj/item/flashlight/glowstick/yellow - name = "yellow glowstick" - color = LIGHT_COLOR_YELLOW - -/obj/item/flashlight/glowstick/pink - name = "pink glowstick" - color = LIGHT_COLOR_PINK - -/obj/item/flashlight/spotlight //invisible lighting source - name = "disco light" - desc = "Groovy..." - icon_state = null - light_color = null - brightness_on = 0 - flashlight_power = 1 - light_range = 0 - light_power = 10 - alpha = 0 - layer = 0 - on = TRUE - anchored = TRUE - var/range = null - resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF - -/obj/item/flashlight/flashdark - name = "flashdark" - desc = "A strange device manufactured with mysterious elements that somehow emits darkness. Or maybe it just sucks in light? Nobody knows for sure." - icon_state = "flashdark" - item_state = "flashdark" - brightness_on = 2.5 - flashlight_power = -3 - -/obj/item/flashlight/eyelight - name = "eyelight" - desc = "This shouldn't exist outside of someone's head, how are you seeing this?" - brightness_on = 15 - flags_1 = CONDUCT_1 - item_flags = DROPDEL - actions_types = list() +/obj/item/flashlight + name = "flashlight" + desc = "A hand-held emergency light." + icon = 'icons/obj/lighting.dmi' + icon_state = "flashlight" + item_state = "flashlight" + lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' + w_class = WEIGHT_CLASS_SMALL + flags_1 = CONDUCT_1 + slot_flags = ITEM_SLOT_BELT + materials = list(MAT_METAL=50, MAT_GLASS=20) + actions_types = list(/datum/action/item_action/toggle_light) + var/on = FALSE + var/brightness_on = 4 //range of light when on + var/flashlight_power = 0.8 //strength of the light when on + light_color = "#FFCC66" + +/obj/item/flashlight/Initialize() + . = ..() + if(icon_state == "[initial(icon_state)]-on") + on = TRUE + update_brightness() + +/obj/item/flashlight/proc/update_brightness(mob/user = null) + if(on) + icon_state = "[initial(icon_state)]-on" + if(flashlight_power) + set_light(l_range = brightness_on, l_power = flashlight_power) + else + set_light(brightness_on) + else + icon_state = initial(icon_state) + set_light(0) + +/obj/item/flashlight/attack_self(mob/user) + on = !on + update_brightness(user) + playsound(user, on ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, 1) + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + return 1 + +/obj/item/flashlight/suicide_act(mob/living/carbon/human/user) + if (user.eye_blind) + user.visible_message("[user] is putting [src] close to [user.p_their()] eyes and turning it on ... but [user.p_theyre()] blind!") + return SHAME + user.visible_message("[user] is putting [src] close to [user.p_their()] eyes and turning it on! It looks like [user.p_theyre()] trying to commit suicide!") + return (FIRELOSS) + +/obj/item/flashlight/attack(mob/living/carbon/M, mob/living/carbon/human/user) + add_fingerprint(user) + if(istype(M) && on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) + + if((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) //too dumb to use flashlight properly + return ..() //just hit them in the head + + if(!user.IsAdvancedToolUser()) + to_chat(user, "You don't have the dexterity to do this!") + return + + if(!M.get_bodypart(BODY_ZONE_HEAD)) + to_chat(user, "[M] doesn't have a head!") + return + + if(flashlight_power < 0.3) + to_chat(user, "\The [src] isn't bright enough to see anything! ") + return + + switch(user.zone_selected) + if(BODY_ZONE_PRECISE_EYES) + if((M.head && M.head.flags_cover & HEADCOVERSEYES) || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) || (M.glasses && M.glasses.flags_cover & GLASSESCOVERSEYES)) + to_chat(user, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSEYES) ? "helmet" : (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) ? "mask": "glasses"] first.") + return + + var/obj/item/organ/eyes/E = M.getorganslot(ORGAN_SLOT_EYES) + if(!E) + to_chat(user, "[M] doesn't have any eyes!") + return + + if(M == user) //they're using it on themselves + if(M.flash_act(visual = 1)) + M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes! Trippy!") + else + M.visible_message("[M] directs [src] to [M.p_their()] eyes.", "You wave the light in front of your eyes.") + else + user.visible_message("[user] directs [src] to [M]'s eyes.", \ + "You direct [src] to [M]'s eyes.") + if(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_BLIND)) || !M.flash_act(visual = 1)) //mob is dead or fully blind + to_chat(user, "[M]'s pupils don't react to the light!") + else if(M.dna && M.dna.check_mutation(XRAY)) //mob has X-ray vision + to_chat(user, "[M]'s pupils give an eerie glow!") + else //they're okay! + to_chat(user, "[M]'s pupils narrow.") + + if(BODY_ZONE_PRECISE_MOUTH) + + if(M.is_mouth_covered()) + to_chat(user, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSMOUTH) ? "helmet" : "mask"] first.") + return + + var/their = M.p_their() + + var/list/mouth_organs = new + for(var/obj/item/organ/O in M.internal_organs) + if(O.zone == BODY_ZONE_PRECISE_MOUTH) + mouth_organs.Add(O) + var/organ_list = "" + var/organ_count = LAZYLEN(mouth_organs) + if(organ_count) + for(var/I in 1 to organ_count) + if(I > 1) + if(I == mouth_organs.len) + organ_list += ", and " + else + organ_list += ", " + var/obj/item/organ/O = mouth_organs[I] + organ_list += (O.gender == "plural" ? O.name : "\an [O.name]") + + var/pill_count = 0 + for(var/datum/action/item_action/hands_free/activate_pill/AP in M.actions) + pill_count++ + + if(M == user) + var/can_use_mirror = FALSE + if(isturf(user.loc)) + var/obj/structure/mirror/mirror = locate(/obj/structure/mirror, user.loc) + if(mirror) + switch(user.dir) + if(NORTH) + can_use_mirror = mirror.pixel_y > 0 + if(SOUTH) + can_use_mirror = mirror.pixel_y < 0 + if(EAST) + can_use_mirror = mirror.pixel_x > 0 + if(WEST) + can_use_mirror = mirror.pixel_x < 0 + + M.visible_message("[M] directs [src] to [their] mouth.", \ + "You point [src] into your mouth.") + if(!can_use_mirror) + to_chat(user, "You can't see anything without a mirror.") + return + if(organ_count) + to_chat(user, "Inside your mouth [organ_count > 1 ? "are" : "is"] [organ_list].") + else + to_chat(user, "There's nothing inside your mouth.") + if(pill_count) + to_chat(user, "You have [pill_count] implanted pill[pill_count > 1 ? "s" : ""].") + + else + user.visible_message("[user] directs [src] to [M]'s mouth.",\ + "You direct [src] to [M]'s mouth.") + if(organ_count) + to_chat(user, "Inside [their] mouth [organ_count > 1 ? "are" : "is"] [organ_list].") + else + to_chat(user, "[M] doesn't have any organs in [their] mouth.") + if(pill_count) + to_chat(user, "[M] has [pill_count] pill[pill_count > 1 ? "s" : ""] implanted in [their] teeth.") + + else + return ..() + +/obj/item/flashlight/pen + name = "penlight" + desc = "A pen-sized light, used by medical staff. It can also be used to create a hologram to alert people of incoming medical assistance." + icon_state = "penlight" + item_state = "" + flags_1 = CONDUCT_1 + brightness_on = 2 + light_color = "#FFDDCC" + flashlight_power = 0.3 + var/holo_cooldown = 0 + +/obj/item/flashlight/pen/afterattack(atom/target, mob/user, proximity_flag) + . = ..() + if(!proximity_flag) + if(holo_cooldown > world.time) + to_chat(user, "[src] is not ready yet!") + return + var/T = get_turf(target) + if(locate(/mob/living) in T) + new /obj/effect/temp_visual/medical_holosign(T,user) //produce a holographic glow + holo_cooldown = world.time + 100 + return + +/obj/effect/temp_visual/medical_holosign + name = "medical holosign" + desc = "A small holographic glow that indicates a medic is coming to treat a patient." + icon_state = "medi_holo" + duration = 30 + +/obj/effect/temp_visual/medical_holosign/Initialize(mapload, creator) + . = ..() + playsound(loc, 'sound/machines/ping.ogg', 50, 0) //make some noise! + if(creator) + visible_message("[creator] created a medical hologram!") + + +/obj/item/flashlight/seclite + name = "seclite" + desc = "A robust flashlight used by security." + icon_state = "seclite" + item_state = "seclite" + lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' + force = 9 // Not as good as a stun baton. + brightness_on = 5 // A little better than the standard flashlight. + light_color = "#CDDDFF" + flashlight_power = 0.9 + hitsound = 'sound/weapons/genhit1.ogg' + +// the desk lamps are a bit special +/obj/item/flashlight/lamp + name = "desk lamp" + desc = "A desk lamp with an adjustable mount." + icon_state = "lamp" + item_state = "lamp" + lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' + righthand_file = 'icons/mob/inhands/items_righthand.dmi' + force = 10 + brightness_on = 5 + light_color = "#FFDDBB" + w_class = WEIGHT_CLASS_BULKY + flags_1 = CONDUCT_1 + materials = list() + on = TRUE + + +// green-shaded desk lamp +/obj/item/flashlight/lamp/green + desc = "A classic green-shaded desk lamp." + icon_state = "lampgreen" + item_state = "lampgreen" + + + +/obj/item/flashlight/lamp/verb/toggle_light() + set name = "Toggle light" + set category = "Object" + set src in oview(1) + + if(!usr.stat) + attack_self(usr) + +//Bananalamp +/obj/item/flashlight/lamp/bananalamp + name = "banana lamp" + desc = "Only a clown would think to make a ghetto banana-shaped lamp. Even has a goofy pullstring." + icon_state = "bananalamp" + item_state = "bananalamp" + +// FLARES + +/obj/item/flashlight/flare + name = "flare" + desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'." + w_class = WEIGHT_CLASS_SMALL + brightness_on = 7 // Pretty bright. + light_color = "#FA421A" + icon_state = "flare" + item_state = "flare" + actions_types = list() + var/fuel = 0 + var/on_damage = 7 + var/produce_heat = 1500 + heat = 1000 + light_color = LIGHT_COLOR_FLARE + grind_results = list(/datum/reagent/sulfur = 15) + +/obj/item/flashlight/flare/New() + fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds. + ..() + +/obj/item/flashlight/flare/process() + open_flame(heat) + fuel = max(fuel - 1, 0) + if(!fuel || !on) + turn_off() + if(!fuel) + icon_state = "[initial(icon_state)]-empty" + STOP_PROCESSING(SSobj, src) + +/obj/item/flashlight/flare/ignition_effect(atom/A, mob/user) + if(fuel && on) + . = "[user] lights [A] with [src] like a real \ + badass." + else + . = "" + +/obj/item/flashlight/flare/proc/turn_off() + on = FALSE + force = initial(src.force) + damtype = initial(src.damtype) + if(ismob(loc)) + var/mob/U = loc + update_brightness(U) + else + update_brightness(null) + +/obj/item/flashlight/flare/update_brightness(mob/user = null) + ..() + if(on) + item_state = "[initial(item_state)]-on" + else + item_state = "[initial(item_state)]" + +/obj/item/flashlight/flare/attack_self(mob/user) + + // Usual checks + if(!fuel) + to_chat(user, "[src] is out of fuel!") + return + if(on) + to_chat(user, "[src] is already on.") + return + + . = ..() + // All good, turn it on. + if(.) + user.visible_message("[user] lights \the [src].", "You light \the [src]!") + force = on_damage + damtype = "fire" + START_PROCESSING(SSobj, src) + +/obj/item/flashlight/flare/is_hot() + return on * heat + +/obj/item/flashlight/flare/torch + name = "torch" + desc = "A torch fashioned from some leaves and a log." + w_class = WEIGHT_CLASS_BULKY + brightness_on = 4 + light_color = "#FAA44B" + icon_state = "torch" + item_state = "torch" + lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' + righthand_file = 'icons/mob/inhands/items_righthand.dmi' + light_color = LIGHT_COLOR_ORANGE + on_damage = 10 + slot_flags = null + +/obj/item/flashlight/lantern + name = "lantern" + icon_state = "lantern" + item_state = "lantern" + lefthand_file = 'icons/mob/inhands/equipment/mining_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi' + desc = "A mining lantern." + brightness_on = 6 // luminosity when on + light_color = "#FFAA44" + flashlight_power = 0.75 + + +/obj/item/flashlight/slime + gender = PLURAL + name = "glowing slime extract" + desc = "Extract from a yellow slime. It emits a strong light when squeezed." + icon = 'icons/obj/lighting.dmi' + icon_state = "slime" + item_state = "slime" + w_class = WEIGHT_CLASS_SMALL + slot_flags = ITEM_SLOT_BELT + materials = list() + brightness_on = 6 //luminosity when on + light_color = "#FFEEAA" + flashlight_power = 0.6 + +/obj/item/flashlight/emp + var/emp_max_charges = 4 + var/emp_cur_charges = 4 + var/charge_tick = 0 + + +/obj/item/flashlight/emp/New() + ..() + START_PROCESSING(SSobj, src) + +/obj/item/flashlight/emp/Destroy() + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/flashlight/emp/process() + charge_tick++ + if(charge_tick < 10) + return FALSE + charge_tick = 0 + emp_cur_charges = min(emp_cur_charges+1, emp_max_charges) + return TRUE + +/obj/item/flashlight/emp/attack(mob/living/M, mob/living/user) + if(on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) // call original attack when examining organs + ..() + return + +/obj/item/flashlight/emp/afterattack(atom/movable/A, mob/user, proximity) + . = ..() + if(!proximity) + return + + if(emp_cur_charges > 0) + emp_cur_charges -= 1 + + if(ismob(A)) + var/mob/M = A + log_combat(user, M, "attacked", "EMP-light") + M.visible_message("[user] blinks \the [src] at \the [A].", \ + "[user] blinks \the [src] at you.") + else + A.visible_message("[user] blinks \the [src] at \the [A].") + to_chat(user, "\The [src] now has [emp_cur_charges] charge\s.") + A.emp_act(EMP_HEAVY) + else + to_chat(user, "\The [src] needs time to recharge!") + return + +/obj/item/flashlight/emp/debug //for testing emp_act() + name = "debug EMP flashlight" + emp_max_charges = 100 + emp_cur_charges = 100 + +// Glowsticks, in the uncomfortable range of similar to flares, +// but not similar enough to make it worth a refactor +/obj/item/flashlight/glowstick + name = "glowstick" + desc = "A military-grade glowstick." + w_class = WEIGHT_CLASS_SMALL + brightness_on = 4 + color = LIGHT_COLOR_GREEN + icon_state = "glowstick" + item_state = "glowstick" + grind_results = list(/datum/reagent/phenol = 15, /datum/reagent/hydrogen = 10, /datum/reagent/oxygen = 5) //Meth-in-a-stick + rad_flags = RAD_NO_CONTAMINATE + var/fuel = 0 + +/obj/item/flashlight/glowstick/Initialize() + fuel = rand(1600, 2000) + light_color = color + . = ..() + +/obj/item/flashlight/glowstick/Destroy() + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/flashlight/glowstick/process() + fuel = max(fuel - 1, 0) + if(!fuel) + turn_off() + STOP_PROCESSING(SSobj, src) + update_icon() + +/obj/item/flashlight/glowstick/proc/turn_off() + on = FALSE + update_icon() + +/obj/item/flashlight/glowstick/update_icon() + item_state = "glowstick" + cut_overlays() + if(!fuel) + icon_state = "glowstick-empty" + cut_overlays() + set_light(0) + else if(on) + var/mutable_appearance/glowstick_overlay = mutable_appearance(icon, "glowstick-glow") + glowstick_overlay.color = color + add_overlay(glowstick_overlay) + item_state = "glowstick-on" + set_light(brightness_on) + else + icon_state = "glowstick" + cut_overlays() + +/obj/item/flashlight/glowstick/attack_self(mob/user) + if(!fuel) + to_chat(user, "[src] is spent.") + return + if(on) + to_chat(user, "[src] is already lit.") + return + + . = ..() + if(.) + user.visible_message("[user] cracks and shakes [src].", "You crack and shake [src], turning it on!") + activate() + +/obj/item/flashlight/glowstick/proc/activate() + if(!on) + on = TRUE + START_PROCESSING(SSobj, src) + +/obj/item/flashlight/glowstick/red + name = "red glowstick" + color = LIGHT_COLOR_RED + +/obj/item/flashlight/glowstick/blue + name = "blue glowstick" + color = LIGHT_COLOR_BLUE + +/obj/item/flashlight/glowstick/cyan + name = "cyan glowstick" + color = LIGHT_COLOR_CYAN + +/obj/item/flashlight/glowstick/orange + name = "orange glowstick" + color = LIGHT_COLOR_ORANGE + +/obj/item/flashlight/glowstick/yellow + name = "yellow glowstick" + color = LIGHT_COLOR_YELLOW + +/obj/item/flashlight/glowstick/pink + name = "pink glowstick" + color = LIGHT_COLOR_PINK + +/obj/item/flashlight/spotlight //invisible lighting source + name = "disco light" + desc = "Groovy..." + icon_state = null + light_color = null + brightness_on = 0 + flashlight_power = 1 + light_range = 0 + light_power = 10 + alpha = 0 + layer = 0 + on = TRUE + anchored = TRUE + var/range = null + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + +/obj/item/flashlight/flashdark + name = "flashdark" + desc = "A strange device manufactured with mysterious elements that somehow emits darkness. Or maybe it just sucks in light? Nobody knows for sure." + icon_state = "flashdark" + item_state = "flashdark" + brightness_on = 2.5 + flashlight_power = -3 + +/obj/item/flashlight/eyelight + name = "eyelight" + desc = "This shouldn't exist outside of someone's head, how are you seeing this?" + brightness_on = 15 + flags_1 = CONDUCT_1 + item_flags = DROPDEL + actions_types = list() diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 906cf6da..c54f9aba 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -1,844 +1,843 @@ - -/* - -CONTAINS: -T-RAY -HEALTH ANALYZER -GAS ANALYZER -SLIME SCANNER -NANITE SCANNER -GENE SCANNER - -*/ -/obj/item/t_scanner - name = "\improper T-ray scanner" - desc = "A terahertz-ray emitter and scanner used to detect underfloor objects such as cables and pipes." - icon = 'icons/obj/device.dmi' - icon_state = "t-ray0" - var/on = FALSE - slot_flags = ITEM_SLOT_BELT - w_class = WEIGHT_CLASS_SMALL - item_state = "electronic" - lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' - righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - materials = list(MAT_METAL=150) - -/obj/item/t_scanner/suicide_act(mob/living/carbon/user) - user.visible_message("[user] begins to emit terahertz-rays into [user.p_their()] brain with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return TOXLOSS - -/obj/item/t_scanner/attack_self(mob/user) - - on = !on - icon_state = copytext(icon_state, 1, length(icon_state))+"[on]" - - if(on) - START_PROCESSING(SSobj, src) - -/obj/item/t_scanner/process() - if(!on) - STOP_PROCESSING(SSobj, src) - return null - scan() - -/obj/item/t_scanner/proc/scan() - t_ray_scan(loc) - -/proc/t_ray_scan(mob/viewer, flick_time = 8, distance = 3) - if(!ismob(viewer) || !viewer.client) - return - var/list/t_ray_images = list() - for(var/obj/O in orange(distance, viewer) ) - if(O.level != 1) - continue - - if(O.invisibility == INVISIBILITY_MAXIMUM) - var/image/I = new(loc = get_turf(O)) - var/mutable_appearance/MA = new(O) - MA.alpha = 128 - MA.dir = O.dir - I.appearance = MA - t_ray_images += I - if(t_ray_images.len) - flick_overlay(t_ray_images, list(viewer.client), flick_time) - -/obj/item/healthanalyzer - name = "health analyzer" - icon = 'icons/obj/device.dmi' - icon_state = "health" - item_state = "healthanalyzer" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - desc = "A hand-held body scanner able to distinguish vital signs of the subject." - flags_1 = CONDUCT_1 - item_flags = NOBLUDGEON - slot_flags = ITEM_SLOT_BELT - throwforce = 3 - w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - materials = list(MAT_METAL=200) - var/mode = 1 - var/scanmode = 0 - var/advanced = FALSE - -/obj/item/healthanalyzer/suicide_act(mob/living/carbon/user) - user.visible_message("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!") - return BRUTELOSS - -/obj/item/healthanalyzer/attack_self(mob/user) - if(!scanmode) - to_chat(user, "You switch the health analyzer to scan chemical contents.") - scanmode = 1 - else - to_chat(user, "You switch the health analyzer to check physical health.") - scanmode = 0 - -/obj/item/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user) - - // Clumsiness/brain damage check - if ((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) - to_chat(user, "You stupidly try to analyze the floor's vitals!") - user.visible_message("[user] has analyzed the floor's vitals!") - var/msg = "*---------*\nAnalyzing results for The floor:\n\tOverall status: Healthy\n" - msg += "Key: Suffocation/Toxin/Burn/Brute\n" - msg += "\tDamage specifics: 0-0-0-0\n" - msg += "Body temperature: ???\n" - msg += "*---------*" - to_chat(user, msg) - return - - user.visible_message("[user] has analyzed [M]'s vitals.") - - if(scanmode == 0) - healthscan(user, M, mode, advanced) - else if(scanmode == 1) - chemscan(user, M) - - add_fingerprint(user) - - -// Used by the PDA medical scanner too -/proc/healthscan(mob/user, mob/living/M, mode = 1, advanced = FALSE) - if(isliving(user) && (user.incapacitated() || user.eye_blind)) - return - //Damage specifics - var/oxy_loss = M.getOxyLoss() - var/tox_loss = M.getToxLoss() - var/fire_loss = M.getFireLoss() - var/brute_loss = M.getBruteLoss() - var/mob_status = (M.stat == DEAD ? "Deceased" : "[round(M.health/M.maxHealth,0.01)*100] % healthy") - - if(HAS_TRAIT(M, TRAIT_FAKEDEATH) && !advanced) - mob_status = "Deceased" - oxy_loss = max(rand(1, 40), oxy_loss, (300 - (tox_loss + fire_loss + brute_loss))) // Random oxygen loss - - if(ishuman(M)) - var/mob/living/carbon/human/H = M - if(H.undergoing_cardiac_arrest() && H.stat != DEAD) - to_chat(user, "Subject suffering from heart attack: Apply defibrillation or other electric shock immediately!") - if(H.undergoing_liver_failure() && H.stat != DEAD) //might be depreciated BUG_PROBABLE_CAUSE - to_chat(user, "Subject is suffering from liver failure: Apply Corazone and begin a liver transplant immediately!") - - var/msg = "*---------*\nAnalyzing results for [M]:\n\tOverall status: [mob_status]\n" - - // Damage descriptions - if(brute_loss > 10) - msg += "\t[brute_loss > 50 ? "Severe" : "Minor"] tissue damage detected.\n" - if(fire_loss > 10) - msg += "\t[fire_loss > 50 ? "Severe" : "Minor"] burn damage detected.\n" - if(oxy_loss > 10) - msg += "\t[oxy_loss > 50 ? "Severe" : "Minor"] oxygen deprivation detected.\n" - if(tox_loss > 10) - msg += "\t[tox_loss > 50 ? "Severe" : "Minor"] amount of toxin damage detected.\n" - if(M.getStaminaLoss()) - msg += "\tSubject appears to be suffering from fatigue.\n" - if(advanced) - msg += "\tFatigue Level: [M.getStaminaLoss()]%.\n" - if (M.getCloneLoss()) - msg += "\tSubject appears to have [M.getCloneLoss() > 30 ? "Severe" : "Minor"] cellular damage.\n" - if(advanced) - msg += "\tCellular Damage Level: [M.getCloneLoss()].\n" - if (!M.getorgan(/obj/item/organ/brain)) - to_chat(user, "\tSubject lacks a brain.") //Unsure how this won't proc for 50% of the cit playerbase (This is a joke everyone on cit a cute.) - if(ishuman(M) && advanced) // Should I make this not advanced? - var/mob/living/carbon/human/H = M - var/obj/item/organ/liver/L = H.getorganslot("liver") - if(L) - if(L.swelling > 20) - msg += "\tSubject is suffering from an enlarged liver.\n" //i.e. shrink their liver or give them a transplant. - else - msg += "\tSubject's liver is missing.\n" - var/obj/item/organ/tongue/T = H.getorganslot("tongue") - if(T) - if(T.damage > 40) - msg += "\tSubject is suffering from severe burn tissue on their tongue.\n" //i.e. their tongue is shot - if(T.name == "fluffy tongue") - msg += "\tSubject is suffering from a fluffified tongue. Suggested cure: Yamerol or a tongue transplant.\n" - else - msg += "\tSubject's tongue is missing.\n" - var/obj/item/organ/lungs/Lung = H.getorganslot("lungs") - if(Lung) - if(Lung.damage > 150) - msg += "\tSubject is suffering from acute emphysema leading to trouble breathing.\n" //i.e. Their lungs are shot - else - msg += "\tSubject's lungs have collapsed from trauma!\n" - var/obj/item/organ/genital/penis/P = H.getorganslot("penis") - if(P) - if(P.length>20) - msg += "\tSubject has a sizeable gentleman's organ at [P.length] inches.\n" - var/obj/item/organ/genital/breasts/Br = H.getorganslot("breasts") - if(Br) - if(Br.cached_size>5) - msg += "\tSubject has a sizeable bosom with a [Br.size] cup.\n" - if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 200 || !M.getorgan(/obj/item/organ/brain)) - msg += "\tSubject's brain function is non-existent.\n" - else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 120) - msg += "\tSevere brain damage detected. Subject likely to have mental traumas.\n" - else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 45) - msg += "\tBrain damage detected.\n" - - if(iscarbon(M)) - - var/mob/living/carbon/C = M - if(LAZYLEN(C.get_traumas())) - var/list/trauma_text = list() - for(var/datum/brain_trauma/B in C.get_traumas()) - var/trauma_desc = "" - switch(B.resilience) - if(TRAUMA_RESILIENCE_SURGERY) - trauma_desc += "severe " - if(TRAUMA_RESILIENCE_LOBOTOMY) - trauma_desc += "deep-rooted " - if(TRAUMA_RESILIENCE_MAGIC, TRAUMA_RESILIENCE_ABSOLUTE) - trauma_desc += "permanent " - trauma_desc += B.scan_desc - trauma_text += trauma_desc - msg += "\tCerebral traumas detected: subject appears to be suffering from [english_list(trauma_text)].\n" - if(C.roundstart_quirks.len) - msg += "\tSubject has the following physiological traits: [C.get_trait_string()].\n" - if(advanced) - msg += "\tBrain Activity Level: [(200 - M.getOrganLoss(ORGAN_SLOT_BRAIN))/2]%.\n" - if(M.radiation) - msg += "\tSubject is irradiated.\n" - if(advanced) - msg += "\tRadiation Level: [M.radiation]%.\n" - - if(advanced && M.hallucinating()) - msg += "\tSubject is hallucinating.\n" - - //MKUltra - if(advanced && M.has_status_effect(/datum/status_effect/chem/enthrall)) - msg += "\tSubject has abnormal brain fuctions.\n" - - //Astrogen shenanigans - if(advanced && M.reagents.has_reagent("astral")) - if(M.mind) - msg += "\tWarning: subject may be possesed.\n" - else - msg += "\tSubject appears to be astrally projecting.\n" - - //Eyes and ears - if(advanced) - if(iscarbon(M)) - var/mob/living/carbon/C = M - var/obj/item/organ/ears/ears = C.getorganslot(ORGAN_SLOT_EARS) - msg += "\t==EAR STATUS==\n" - if(istype(ears)) - var/healthy = TRUE - if(HAS_TRAIT_FROM(C, TRAIT_DEAF, GENETIC_MUTATION)) - healthy = FALSE - msg += "\tSubject is genetically deaf.\n" - else if(HAS_TRAIT(C, TRAIT_DEAF)) - healthy = FALSE - msg += "\tSubject is deaf.\n" - else - if(ears.damage) - to_chat(user, "\tSubject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.") - healthy = FALSE - if(ears.deaf) - to_chat(user, "\tSubject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.") - healthy = FALSE - if(healthy) - msg += "\tHealthy.\n" - else - msg += "\tSubject does not have ears.\n" - var/obj/item/organ/eyes/eyes = C.getorganslot(ORGAN_SLOT_EYES) - msg += "\t==EYE STATUS==\n" - if(istype(eyes)) - var/healthy = TRUE - if(HAS_TRAIT(C, TRAIT_BLIND)) - msg += "\tSubject is blind.\n" - healthy = FALSE - if(HAS_TRAIT(C, TRAIT_NEARSIGHT)) - msg += "\tSubject is nearsighted.\n" - healthy = FALSE - if(eyes.damage > 30) - msg += "\tSubject has severe eye damage.\n" - healthy = FALSE - else if(eyes.damage > 20) - msg += "\tSubject has significant eye damage.\n" - healthy = FALSE - else if(eyes.damage) - msg += "\tSubject has minor eye damage.\n" - healthy = FALSE - if(healthy) - msg += "\tHealthy.\n" - else - msg += "\tSubject does not have eyes.\n" - - - if(ishuman(M)) - var/mob/living/carbon/human/H = M - var/ldamage = H.return_liver_damage() - if(ldamage > 10) - msg += "\t[ldamage > 45 ? "Severe" : "Minor"] liver damage detected.\n" - if(advanced && H.has_dna()) - to_chat(user, "\tGenetic Stability: [H.dna.stability]%.") - // Body part damage report - if(iscarbon(M) && mode == 1) - var/mob/living/carbon/C = M - var/list/damaged = C.get_damaged_bodyparts(1,1) - if(length(damaged)>0 || oxy_loss>0 || tox_loss>0 || fire_loss>0) - msg += "\tDamage: Brute-Burn-Toxin-Suffocation\n\t\tSpecifics: [brute_loss]-[fire_loss]-[tox_loss]-[oxy_loss]\n" - for(var/obj/item/bodypart/org in damaged) - msg += "\t\t[capitalize(org.name)]: [(org.brute_dam > 0) ? "[org.brute_dam]" : "0"]-[(org.burn_dam > 0) ? "[org.burn_dam]" : "0"]\n" - - //Bones broken report! Hyperstation 13 - if(iscarbon(M) && mode == 1) - var/mob/living/carbon/C = M - for(var/X in C.bodyparts) - var/obj/item/bodypart/LB = X - var/broken = LB.broken - if(broken == 1) - msg += "\tSubjects [LB.name] is fractured!\n" - -//Organ damages report - if(ishuman(M)) - var/mob/living/carbon/human/H = M - var/minor_damage - var/major_damage - var/max_damage - var/report_organs = FALSE - - //Piece together the lists to be reported - for(var/O in H.internal_organs) - var/obj/item/organ/organ = O - if(organ.organ_flags & ORGAN_FAILING) - report_organs = TRUE //if we report one organ, we report all organs, even if the lists are empty, just for consistency - if(max_damage) - max_damage += ", " //prelude the organ if we've already reported an organ - max_damage += organ.name //this just slaps the organ name into the string of text - else - max_damage = "\tNon-Functional Organs: " //our initial statement - max_damage += organ.name - else if(organ.damage > organ.high_threshold) - report_organs = TRUE - if(major_damage) - major_damage += ", " - major_damage += organ.name - else - major_damage = "\tSeverely Damaged Organs: " - major_damage += organ.name - else if(organ.damage > organ.low_threshold) - report_organs = TRUE - if(minor_damage) - minor_damage += ", " - minor_damage += organ.name - else - minor_damage = "\tMildly Damaged Organs: " - minor_damage += organ.name - - if(report_organs) //we either finish the list, or set it to be empty if no organs were reported in that category - if(!max_damage) - max_damage = "\tNon-Functional Organs: " - else - max_damage += "" - if(!major_damage) - major_damage = "\tSeverely Damaged Organs: " - else - major_damage += "" - if(!minor_damage) - minor_damage = "\tMildly Damaged Organs: " - else - minor_damage += "" - msg += "[minor_damage]" - msg += "[major_damage]" - msg += "[max_damage]" - - // Species and body temperature - if(ishuman(M)) - var/mob/living/carbon/human/H = M - var/datum/species/S = H.dna.species - var/mutant = FALSE - if (H.dna.check_mutation(HULK)) - mutant = TRUE - else if (S.mutantlungs != initial(S.mutantlungs)) - mutant = TRUE - else if (S.mutant_brain != initial(S.mutant_brain)) - mutant = TRUE - else if (S.mutant_heart != initial(S.mutant_heart)) - mutant = TRUE - else if (S.mutanteyes != initial(S.mutanteyes)) - mutant = TRUE - else if (S.mutantears != initial(S.mutantears)) - mutant = TRUE - else if (S.mutanthands != initial(S.mutanthands)) - mutant = TRUE - else if (S.mutanttongue != initial(S.mutanttongue)) - mutant = TRUE - else if (S.mutanttail != initial(S.mutanttail)) - mutant = TRUE - else if (S.mutantliver != initial(S.mutantliver)) - mutant = TRUE - else if (S.mutantstomach != initial(S.mutantstomach)) - mutant = TRUE - - msg += "Species: [H.dna.custom_species ? H.dna.custom_species : S.name] Base: [S.name]\n" - if(mutant) - msg += "Subject has mutations present." - msg += "Body temperature: [round(M.bodytemperature-T0C,0.1)] °C ([round(M.bodytemperature*1.8-459.67,0.1)] °F)\n" - - // Time of death - if(M.tod && (M.stat == DEAD || ((HAS_TRAIT(M, TRAIT_FAKEDEATH)) && !advanced))) - msg += "Time of Death: [M.tod]\n" - var/tdelta = round(world.time - M.timeofdeath) - if(tdelta < (DEFIB_TIME_LIMIT * 10)) - msg += "Subject died [DisplayTimeText(tdelta)] ago, defibrillation may be possible!\n" - - for(var/thing in M.diseases) - var/datum/disease/D = thing - if(!(D.visibility_flags & HIDDEN_SCANNER)) - msg += "Warning: [D.form] detected\nName: [D.name].\nType: [D.spread_text].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure_text]\n" - - // Blood Level - if(M.has_dna()) - var/mob/living/carbon/C = M - var/blood_id = C.get_blood_id() - if(blood_id) - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if(H.bleed_rate) - msg += "Subject is bleeding!\n" - var/blood_percent = round((C.scan_blood_volume() / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) - var/blood_type = C.dna.blood_type - if(blood_id != ("blood" || "jellyblood"))//special blood substance - var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id] - if(R) - blood_type = R.name - else - blood_type = blood_id - if(C.scan_blood_volume() <= (BLOOD_VOLUME_SAFE*C.blood_ratio) && C.scan_blood_volume() > (BLOOD_VOLUME_OKAY*C.blood_ratio)) - msg += "LOW blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" - else if(C.scan_blood_volume() <= (BLOOD_VOLUME_OKAY*C.blood_ratio)) - msg += "CRITICAL blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" - else - msg += "Blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" - - var/cyberimp_detect - for(var/obj/item/organ/cyberimp/CI in C.internal_organs) - if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant) - cyberimp_detect += "[C.name] is modified with a [CI.name].
    " - if(cyberimp_detect) - msg += "Detected cybernetic modifications:\n" - msg += "[cyberimp_detect]\n" - msg += "*---------*
    " - to_chat(user, msg) - SEND_SIGNAL(M, COMSIG_NANITE_SCAN, user, FALSE) - -/proc/chemscan(mob/living/user, mob/living/M) - if(istype(M)) - if(M.reagents) - var/msg = "*---------*\n" - if(M.reagents.reagent_list.len) - var/list/datum/reagent/reagents = list() - for(var/datum/reagent/R in M.reagents.reagent_list) - if(R.chemical_flags & REAGENT_INVISIBLE) - continue - reagents += R - - if(length(reagents)) - msg += "Subject contains the following reagents:\n" - for(var/datum/reagent/R in reagents) - msg += "[R.volume] units of [R.name][R.overdosed == 1 ? " - OVERDOSING" : "."]\n" - else - msg += "Subject contains no reagents.\n" - - else - msg += "Subject contains no reagents.\n" - if(M.reagents.addiction_list.len) - msg += "Subject is addicted to the following reagents:\n" - for(var/datum/reagent/R in M.reagents.addiction_list) - msg += "[R.name]\n" - else - msg += "Subject is not addicted to any reagents.\n" - msg += "*---------*
    " - to_chat(user, msg) - - if(M.reagents.has_reagent("fermiTox")) - var/datum/reagent/fermiTox = M.reagents.has_reagent("fermiTox") - switch(fermiTox.volume) - if(5 to 10) - msg += "Subject contains a low amount of toxic isomers.\n" - if(10 to 25) - msg += "Subject contains toxic isomers.\n" - if(25 to 50) - msg += "Subject contains a substantial amount of toxic isomers.\n" - if(50 to 95) - msg += "Subject contains a high amount of toxic isomers.\n" - if(95 to INFINITY) - msg += "Subject contains a extremely dangerous amount of toxic isomers.\n" - -/obj/item/healthanalyzer/verb/toggle_mode() - set name = "Switch Verbosity" - set category = "Object" - - if(usr.stat || !usr.canmove || usr.restrained()) - return - - mode = !mode - switch (mode) - if(1) - to_chat(usr, "The scanner now shows specific limb damage.") - if(0) - to_chat(usr, "The scanner no longer shows limb damage.") - -/obj/item/healthanalyzer/advanced - name = "advanced health analyzer" - icon_state = "health_adv" - desc = "A hand-held body scanner able to distinguish vital signs of the subject with high accuracy." - advanced = TRUE - -/obj/item/analyzer - desc = "A hand-held environmental scanner which reports current gas levels. Alt-Click to use the built in barometer function." - name = "analyzer" - icon = 'icons/obj/device.dmi' - icon_state = "analyzer" - item_state = "analyzer" - lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - w_class = WEIGHT_CLASS_SMALL - flags_1 = CONDUCT_1 - item_flags = NOBLUDGEON - slot_flags = ITEM_SLOT_BELT - throwforce = 0 - throw_speed = 3 - throw_range = 7 - tool_behaviour = TOOL_ANALYZER - materials = list(MAT_METAL=30, MAT_GLASS=20) - grind_results = list("mercury" = 5, "iron" = 5, "silicon" = 5) - var/cooldown = FALSE - var/cooldown_time = 250 - var/accuracy // 0 is the best accuracy. - -/obj/item/analyzer/examine(mob/user) - . = ..() - . += "Alt-click [src] to activate the barometer function." - -/obj/item/analyzer/suicide_act(mob/living/carbon/user) - user.visible_message("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!") - return BRUTELOSS - -/obj/item/analyzer/attack_self(mob/user) - add_fingerprint(user) - - if (user.stat || user.eye_blind) - return - - var/turf/location = user.loc - if(!istype(location)) - return - - var/datum/gas_mixture/environment = location.return_air() - - var/pressure = environment.return_pressure() - var/total_moles = environment.total_moles() - - to_chat(user, "Results:") - if(abs(pressure - ONE_ATMOSPHERE) < 10) - to_chat(user, "Pressure: [round(pressure, 0.01)] kPa") - else - to_chat(user, "Pressure: [round(pressure, 0.01)] kPa") - if(total_moles) - var/list/env_gases = environment.gases - - var/o2_concentration = env_gases[/datum/gas/oxygen]/total_moles - var/n2_concentration = env_gases[/datum/gas/nitrogen]/total_moles - var/co2_concentration = env_gases[/datum/gas/carbon_dioxide]/total_moles - var/plasma_concentration = env_gases[/datum/gas/plasma]/total_moles - - if(abs(n2_concentration - N2STANDARD) < 20) - to_chat(user, "Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/nitrogen], 0.01)] mol)") - else - to_chat(user, "Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/nitrogen], 0.01)] mol)") - - if(abs(o2_concentration - O2STANDARD) < 2) - to_chat(user, "Oxygen: [round(o2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/oxygen], 0.01)] mol)") - else - to_chat(user, "Oxygen: [round(o2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/oxygen], 0.01)] mol)") - - if(co2_concentration > 0.01) - to_chat(user, "CO2: [round(co2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/carbon_dioxide], 0.01)] mol)") - else - to_chat(user, "CO2: [round(co2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/carbon_dioxide], 0.01)] mol)") - - if(plasma_concentration > 0.005) - to_chat(user, "Plasma: [round(plasma_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/plasma], 0.01)] mol)") - else - to_chat(user, "Plasma: [round(plasma_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/plasma], 0.01)] mol)") - - GAS_GARBAGE_COLLECT(environment.gases) - - for(var/id in env_gases) - if(id in GLOB.hardcoded_gases) - continue - var/gas_concentration = env_gases[id]/total_moles - to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(env_gases[id], 0.01)] mol)") - to_chat(user, "Temperature: [round(environment.temperature-T0C, 0.01)] °C ([round(environment.temperature, 0.01)] K)") - -/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens - ..() - - if(user.canUseTopic(src)) - - if(cooldown) - to_chat(user, "[src]'s barometer function is preparing itself.") - return - - var/turf/T = get_turf(user) - if(!T) - return - - playsound(src, 'sound/effects/pop.ogg', 100) - var/area/user_area = T.loc - var/datum/weather/ongoing_weather = null - - if(!user_area.outdoors) - to_chat(user, "[src]'s barometer function won't work indoors!") - return - - for(var/V in SSweather.processing) - var/datum/weather/W = V - if(W.barometer_predictable && (T.z in W.impacted_z_levels) && W.area_type == user_area.type && !(W.stage == END_STAGE)) - ongoing_weather = W - break - - if(ongoing_weather) - if((ongoing_weather.stage == MAIN_STAGE) || (ongoing_weather.stage == WIND_DOWN_STAGE)) - to_chat(user, "[src]'s barometer function can't trace anything while the storm is [ongoing_weather.stage == MAIN_STAGE ? "already here!" : "winding down."]") - return - - to_chat(user, "The next [ongoing_weather] will hit in [butchertime(ongoing_weather.next_hit_time - world.time)].") - if(ongoing_weather.aesthetic) - to_chat(user, "[src]'s barometer function says that the next storm will breeze on by.") - else - var/next_hit = SSweather.next_hit_by_zlevel["[T.z]"] - var/fixed = next_hit ? next_hit - world.time : -1 - if(fixed < 0) - to_chat(user, "[src]'s barometer function was unable to trace any weather patterns.") - else - to_chat(user, "[src]'s barometer function says a storm will land in approximately [butchertime(fixed)].") - cooldown = TRUE - addtimer(CALLBACK(src,/obj/item/analyzer/proc/ping), cooldown_time) - -/obj/item/analyzer/proc/ping() - if(isliving(loc)) - var/mob/living/L = loc - to_chat(L, "[src]'s barometer function is ready!") - playsound(src, 'sound/machines/click.ogg', 100) - cooldown = FALSE - -/obj/item/analyzer/proc/butchertime(amount) - if(!amount) - return - if(accuracy) - var/inaccurate = round(accuracy*(1/3)) - if(prob(50)) - amount -= inaccurate - if(prob(50)) - amount += inaccurate - return DisplayTimeText(max(1,amount)) - -/proc/atmosanalyzer_scan(mixture, mob/living/user, atom/target = src) - var/icon = target - user.visible_message("[user] has used the analyzer on [icon2html(icon, viewers(src))] [target].", "You use the analyzer on [icon2html(icon, user)] [target].") - to_chat(user, "Results of analysis of [icon2html(icon, user)] [target].") - - var/list/airs = islist(mixture) ? mixture : list(mixture) - for(var/g in airs) - if(airs.len > 1) //not a unary gas mixture - to_chat(user, "Node [airs.Find(g)]") - var/datum/gas_mixture/air_contents = g - - var/total_moles = air_contents.total_moles() - var/pressure = air_contents.return_pressure() - var/volume = air_contents.return_volume() //could just do mixture.volume... but safety, I guess? - var/temperature = air_contents.temperature - var/cached_scan_results = air_contents.analyzer_results - - if(total_moles > 0) - to_chat(user, "Moles: [round(total_moles, 0.01)] mol") - to_chat(user, "Volume: [volume] L") - to_chat(user, "Pressure: [round(pressure,0.01)] kPa") - - var/list/cached_gases = air_contents.gases - for(var/id in cached_gases) - var/gas_concentration = cached_gases[id]/total_moles - to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(cached_gases[id], 0.01)] mol)") - to_chat(user, "Temperature: [round(temperature - T0C,0.01)] °C ([round(temperature, 0.01)] K)") - - else - if(airs.len > 1) - to_chat(user, "This node is empty!") - else - to_chat(user, "[target] is empty!") - - if(cached_scan_results && cached_scan_results["fusion"]) //notify the user if a fusion reaction was detected - var/instability = round(cached_scan_results["fusion"], 0.01) - to_chat(user, "Large amounts of free neutrons detected in the air indicate that a fusion reaction took place.") - to_chat(user, "Instability of the last fusion reaction: [instability].") - return - -//slime scanner - -/obj/item/slime_scanner - name = "slime scanner" - desc = "A device that analyzes a slime's internal composition and measures its stats." - icon = 'icons/obj/device.dmi' - icon_state = "adv_spectrometer" - item_state = "analyzer" - lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - w_class = WEIGHT_CLASS_SMALL - flags_1 = CONDUCT_1 - throwforce = 0 - throw_speed = 3 - throw_range = 7 - materials = list(MAT_METAL=30, MAT_GLASS=20) - -/obj/item/slime_scanner/attack(mob/living/M, mob/living/user) - if(user.stat || user.eye_blind) - return - if (!isslime(M)) - to_chat(user, "This device can only scan slimes!") - return - var/mob/living/simple_animal/slime/T = M - slime_scan(T, user) - -/proc/slime_scan(mob/living/simple_animal/slime/T, mob/living/user) - to_chat(user, "========================") - to_chat(user, "Slime scan results:") - to_chat(user, "[T.colour] [T.is_adult ? "adult" : "baby"] slime") - to_chat(user, "Nutrition: [T.nutrition]/[T.get_max_nutrition()]") - if (T.nutrition < T.get_starve_nutrition()) - to_chat(user, "Warning: slime is starving!") - else if (T.nutrition < T.get_hunger_nutrition()) - to_chat(user, "Warning: slime is hungry") - to_chat(user, "Electric change strength: [T.powerlevel]") - to_chat(user, "Health: [round(T.health/T.maxHealth,0.01)*100]%") - if (T.slime_mutation[4] == T.colour) - to_chat(user, "This slime does not evolve any further.") - else - if (T.slime_mutation[3] == T.slime_mutation[4]) - if (T.slime_mutation[2] == T.slime_mutation[1]) - to_chat(user, "Possible mutation: [T.slime_mutation[3]]") - to_chat(user, "Genetic destability: [T.mutation_chance/2] % chance of mutation on splitting") - else - to_chat(user, "Possible mutations: [T.slime_mutation[1]], [T.slime_mutation[2]], [T.slime_mutation[3]] (x2)") - to_chat(user, "Genetic destability: [T.mutation_chance] % chance of mutation on splitting") - else - to_chat(user, "Possible mutations: [T.slime_mutation[1]], [T.slime_mutation[2]], [T.slime_mutation[3]], [T.slime_mutation[4]]") - to_chat(user, "Genetic destability: [T.mutation_chance] % chance of mutation on splitting") - if (T.cores > 1) - to_chat(user, "Multiple cores detected") - to_chat(user, "Growth progress: [T.amount_grown]/[SLIME_EVOLUTION_THRESHOLD]") - if(T.effectmod) - to_chat(user, "Core mutation in progress: [T.effectmod]") - to_chat(user, "Progress in core mutation: [T.applied] / [SLIME_EXTRACT_CROSSING_REQUIRED]") - to_chat(user, "========================") - - -/obj/item/nanite_scanner - name = "nanite scanner" - icon = 'icons/obj/device.dmi' - icon_state = "nanite_scanner" - item_state = "nanite_remote" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - desc = "A hand-held body scanner able to detect nanites and their programming." - flags_1 = CONDUCT_1 - item_flags = NOBLUDGEON - slot_flags = ITEM_SLOT_BELT - throwforce = 3 - w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - materials = list(MAT_METAL=200) - -/obj/item/nanite_scanner/attack(mob/living/M, mob/living/carbon/human/user) - user.visible_message("[user] has analyzed [M]'s nanites.") - - add_fingerprint(user) - - var/response = SEND_SIGNAL(M, COMSIG_NANITE_SCAN, user, TRUE) - if(!response) - to_chat(user, "No nanites detected in the subject.") - -/obj/item/sequence_scanner - name = "genetic sequence scanner" - icon = 'icons/obj/device.dmi' - icon_state = "gene" - item_state = "healthanalyzer" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - desc = "A hand-held scanner able to swiftly scan someone for potential mutations. Hold near a DNA console to update from their database." - flags_1 = CONDUCT_1 - item_flags = NOBLUDGEON - slot_flags = ITEM_SLOT_BELT - throwforce = 3 - w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - materials = list(MAT_METAL=200) - var/list/discovered = list() //hit a dna console to update the scanners database - -/obj/item/sequence_scanner/attack(mob/living/M, mob/living/carbon/human/user) - user.visible_message("[user] has analyzed [M]'s genetic sequence.") - - add_fingerprint(user) - - gene_scan(M, user, src) - -/obj/item/sequence_scanner/afterattack(obj/O, mob/user, proximity) - . = ..() - if(!istype(O) || !proximity) - return - - if(istype(O, /obj/machinery/computer/scan_consolenew)) - var/obj/machinery/computer/scan_consolenew/C = O - if(C.stored_research) - to_chat(user, "[name] database updated.") - discovered = C.stored_research.discovered_mutations - else - to_chat(user,"No database to update from.") - -/proc/gene_scan(mob/living/carbon/C, mob/living/user, obj/item/sequence_scanner/G) - if(!iscarbon(C) || !C.has_dna()) - return - to_chat(user, "[C.name]'s potential mutations.") - for(var/A in C.dna.mutation_index) - var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(A) - var/mut_name - if(G && (A in G.discovered)) - mut_name = "[HM.name] ([HM.alias])" - else - mut_name = HM.alias - var/temp = GET_GENE_STRING(HM.type, C.dna) - var/display - for(var/i in 0 to length(temp) / DNA_MUTATION_BLOCKS-1) - if(i) - display += "-" - display += copytext(temp, 1 + i*DNA_MUTATION_BLOCKS, DNA_MUTATION_BLOCKS*(1+i) + 1) - - - to_chat(user, "- [mut_name] > [display]") + +/* + +CONTAINS: +T-RAY +HEALTH ANALYZER +GAS ANALYZER +SLIME SCANNER +NANITE SCANNER +GENE SCANNER + +*/ +/obj/item/t_scanner + name = "\improper T-ray scanner" + desc = "A terahertz-ray emitter and scanner used to detect underfloor objects such as cables and pipes." + icon = 'icons/obj/device.dmi' + icon_state = "t-ray0" + var/on = FALSE + slot_flags = ITEM_SLOT_BELT + w_class = WEIGHT_CLASS_SMALL + item_state = "electronic" + lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' + materials = list(MAT_METAL=150) + +/obj/item/t_scanner/suicide_act(mob/living/carbon/user) + user.visible_message("[user] begins to emit terahertz-rays into [user.p_their()] brain with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return TOXLOSS + +/obj/item/t_scanner/attack_self(mob/user) + + on = !on + icon_state = copytext(icon_state, 1, length(icon_state))+"[on]" + + if(on) + START_PROCESSING(SSobj, src) + +/obj/item/t_scanner/process() + if(!on) + STOP_PROCESSING(SSobj, src) + return null + scan() + +/obj/item/t_scanner/proc/scan() + t_ray_scan(loc) + +/proc/t_ray_scan(mob/viewer, flick_time = 8, distance = 3) + if(!ismob(viewer) || !viewer.client) + return + var/list/t_ray_images = list() + for(var/obj/O in orange(distance, viewer) ) + if(O.level != 1) + continue + + if(O.invisibility == INVISIBILITY_MAXIMUM) + var/image/I = new(loc = get_turf(O)) + var/mutable_appearance/MA = new(O) + MA.alpha = 128 + MA.dir = O.dir + I.appearance = MA + t_ray_images += I + if(t_ray_images.len) + flick_overlay(t_ray_images, list(viewer.client), flick_time) + +/obj/item/healthanalyzer + name = "health analyzer" + icon = 'icons/obj/device.dmi' + icon_state = "health" + item_state = "healthanalyzer" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + desc = "A hand-held body scanner able to distinguish vital signs of the subject." + flags_1 = CONDUCT_1 + item_flags = NOBLUDGEON + slot_flags = ITEM_SLOT_BELT + throwforce = 3 + w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + materials = list(MAT_METAL=200) + var/mode = 1 + var/scanmode = 0 + var/advanced = FALSE + +/obj/item/healthanalyzer/suicide_act(mob/living/carbon/user) + user.visible_message("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!") + return BRUTELOSS + +/obj/item/healthanalyzer/attack_self(mob/user) + if(!scanmode) + to_chat(user, "You switch the health analyzer to scan chemical contents.") + scanmode = 1 + else + to_chat(user, "You switch the health analyzer to check physical health.") + scanmode = 0 + +/obj/item/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user) + + // Clumsiness/brain damage check + if ((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50)) + to_chat(user, "You stupidly try to analyze the floor's vitals!") + user.visible_message("[user] has analyzed the floor's vitals!") + var/msg = "*---------*\nAnalyzing results for The floor:\n\tOverall status: Healthy\n" + msg += "Key: Suffocation/Toxin/Burn/Brute\n" + msg += "\tDamage specifics: 0-0-0-0\n" + msg += "Body temperature: ???\n" + msg += "*---------*" + to_chat(user, msg) + return + + user.visible_message("[user] has analyzed [M]'s vitals.") + + if(scanmode == 0) + healthscan(user, M, mode, advanced) + else if(scanmode == 1) + chemscan(user, M) + + add_fingerprint(user) + + +// Used by the PDA medical scanner too +/proc/healthscan(mob/user, mob/living/M, mode = 1, advanced = FALSE) + if(isliving(user) && (user.incapacitated() || user.eye_blind)) + return + //Damage specifics + var/oxy_loss = M.getOxyLoss() + var/tox_loss = M.getToxLoss() + var/fire_loss = M.getFireLoss() + var/brute_loss = M.getBruteLoss() + var/mob_status = (M.stat == DEAD ? "Deceased" : "[round(M.health/M.maxHealth,0.01)*100] % healthy") + + if(HAS_TRAIT(M, TRAIT_FAKEDEATH) && !advanced) + mob_status = "Deceased" + oxy_loss = max(rand(1, 40), oxy_loss, (300 - (tox_loss + fire_loss + brute_loss))) // Random oxygen loss + + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.undergoing_cardiac_arrest() && H.stat != DEAD) + to_chat(user, "Subject suffering from heart attack: Apply defibrillation or other electric shock immediately!") + if(H.undergoing_liver_failure() && H.stat != DEAD) //might be depreciated BUG_PROBABLE_CAUSE + to_chat(user, "Subject is suffering from liver failure: Apply Corazone and begin a liver transplant immediately!") + + var/msg = "*---------*\nAnalyzing results for [M]:\n\tOverall status: [mob_status]\n" + + // Damage descriptions + if(brute_loss > 10) + msg += "\t[brute_loss > 50 ? "Severe" : "Minor"] tissue damage detected.\n" + if(fire_loss > 10) + msg += "\t[fire_loss > 50 ? "Severe" : "Minor"] burn damage detected.\n" + if(oxy_loss > 10) + msg += "\t[oxy_loss > 50 ? "Severe" : "Minor"] oxygen deprivation detected.\n" + if(tox_loss > 10) + msg += "\t[tox_loss > 50 ? "Severe" : "Minor"] amount of toxin damage detected.\n" + if(M.getStaminaLoss()) + msg += "\tSubject appears to be suffering from fatigue.\n" + if(advanced) + msg += "\tFatigue Level: [M.getStaminaLoss()]%.\n" + if (M.getCloneLoss()) + msg += "\tSubject appears to have [M.getCloneLoss() > 30 ? "Severe" : "Minor"] cellular damage.\n" + if(advanced) + msg += "\tCellular Damage Level: [M.getCloneLoss()].\n" + if (!M.getorgan(/obj/item/organ/brain)) + to_chat(user, "\tSubject lacks a brain.") //Unsure how this won't proc for 50% of the cit playerbase (This is a joke everyone on cit a cute.) + if(ishuman(M) && advanced) // Should I make this not advanced? + var/mob/living/carbon/human/H = M + var/obj/item/organ/liver/L = H.getorganslot("liver") + if(L) + if(L.swelling > 20) + msg += "\tSubject is suffering from an enlarged liver.\n" //i.e. shrink their liver or give them a transplant. + else + msg += "\tSubject's liver is missing.\n" + var/obj/item/organ/tongue/T = H.getorganslot("tongue") + if(T) + if(T.damage > 40) + msg += "\tSubject is suffering from severe burn tissue on their tongue.\n" //i.e. their tongue is shot + if(T.name == "fluffy tongue") + msg += "\tSubject is suffering from a fluffified tongue. Suggested cure: Yamerol or a tongue transplant.\n" + else + msg += "\tSubject's tongue is missing.\n" + var/obj/item/organ/lungs/Lung = H.getorganslot("lungs") + if(Lung) + if(Lung.damage > 150) + msg += "\tSubject is suffering from acute emphysema leading to trouble breathing.\n" //i.e. Their lungs are shot + else + msg += "\tSubject's lungs have collapsed from trauma!\n" + var/obj/item/organ/genital/penis/P = H.getorganslot("penis") + if(P) + if(P.length>20) + msg += "\tSubject has a sizeable gentleman's organ at [P.length] inches.\n" + var/obj/item/organ/genital/breasts/Br = H.getorganslot("breasts") + if(Br) + if(Br.cached_size>5) + msg += "\tSubject has a sizeable bosom with a [Br.size] cup.\n" + if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 200 || !M.getorgan(/obj/item/organ/brain)) + msg += "\tSubject's brain function is non-existent.\n" + else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 120) + msg += "\tSevere brain damage detected. Subject likely to have mental traumas.\n" + else if (M.getOrganLoss(ORGAN_SLOT_BRAIN) >= 45) + msg += "\tBrain damage detected.\n" + + if(iscarbon(M)) + + var/mob/living/carbon/C = M + if(LAZYLEN(C.get_traumas())) + var/list/trauma_text = list() + for(var/datum/brain_trauma/B in C.get_traumas()) + var/trauma_desc = "" + switch(B.resilience) + if(TRAUMA_RESILIENCE_SURGERY) + trauma_desc += "severe " + if(TRAUMA_RESILIENCE_LOBOTOMY) + trauma_desc += "deep-rooted " + if(TRAUMA_RESILIENCE_MAGIC, TRAUMA_RESILIENCE_ABSOLUTE) + trauma_desc += "permanent " + trauma_desc += B.scan_desc + trauma_text += trauma_desc + msg += "\tCerebral traumas detected: subject appears to be suffering from [english_list(trauma_text)].\n" + if(C.roundstart_quirks.len) + msg += "\tSubject has the following physiological traits: [C.get_trait_string()].\n" + if(advanced) + msg += "\tBrain Activity Level: [(200 - M.getOrganLoss(ORGAN_SLOT_BRAIN))/2]%.\n" + if(M.radiation) + msg += "\tSubject is irradiated.\n" + if(advanced) + msg += "\tRadiation Level: [M.radiation]%.\n" + + if(advanced && M.hallucinating()) + msg += "\tSubject is hallucinating.\n" + + //MKUltra + if(advanced && M.has_status_effect(/datum/status_effect/chem/enthrall)) + msg += "\tSubject has abnormal brain fuctions.\n" + + //Astrogen shenanigans + if(advanced && M.reagents.has_reagent("astral")) + if(M.mind) + msg += "\tWarning: subject may be possesed.\n" + else + msg += "\tSubject appears to be astrally projecting.\n" + + //Eyes and ears + if(advanced) + if(iscarbon(M)) + var/mob/living/carbon/C = M + var/obj/item/organ/ears/ears = C.getorganslot(ORGAN_SLOT_EARS) + msg += "\t==EAR STATUS==\n" + if(istype(ears)) + var/healthy = TRUE + if(HAS_TRAIT_FROM(C, TRAIT_DEAF, GENETIC_MUTATION)) + healthy = FALSE + msg += "\tSubject is genetically deaf.\n" + else if(HAS_TRAIT(C, TRAIT_DEAF)) + healthy = FALSE + msg += "\tSubject is deaf.\n" + else + if(ears.damage) + to_chat(user, "\tSubject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.") + healthy = FALSE + if(ears.deaf) + to_chat(user, "\tSubject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.") + healthy = FALSE + if(healthy) + msg += "\tHealthy.\n" + else + msg += "\tSubject does not have ears.\n" + var/obj/item/organ/eyes/eyes = C.getorganslot(ORGAN_SLOT_EYES) + msg += "\t==EYE STATUS==\n" + if(istype(eyes)) + var/healthy = TRUE + if(HAS_TRAIT(C, TRAIT_BLIND)) + msg += "\tSubject is blind.\n" + healthy = FALSE + if(HAS_TRAIT(C, TRAIT_NEARSIGHT)) + msg += "\tSubject is nearsighted.\n" + healthy = FALSE + if(eyes.damage > 30) + msg += "\tSubject has severe eye damage.\n" + healthy = FALSE + else if(eyes.damage > 20) + msg += "\tSubject has significant eye damage.\n" + healthy = FALSE + else if(eyes.damage) + msg += "\tSubject has minor eye damage.\n" + healthy = FALSE + if(healthy) + msg += "\tHealthy.\n" + else + msg += "\tSubject does not have eyes.\n" + + + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/ldamage = H.return_liver_damage() + if(ldamage > 10) + msg += "\t[ldamage > 45 ? "Severe" : "Minor"] liver damage detected.\n" + if(advanced && H.has_dna()) + to_chat(user, "\tGenetic Stability: [H.dna.stability]%.") + // Body part damage report + if(iscarbon(M) && mode == 1) + var/mob/living/carbon/C = M + var/list/damaged = C.get_damaged_bodyparts(1,1) + if(length(damaged)>0 || oxy_loss>0 || tox_loss>0 || fire_loss>0) + msg += "\tDamage: Brute-Burn-Toxin-Suffocation\n\t\tSpecifics: [brute_loss]-[fire_loss]-[tox_loss]-[oxy_loss]\n" + for(var/obj/item/bodypart/org in damaged) + msg += "\t\t[capitalize(org.name)]: [(org.brute_dam > 0) ? "[org.brute_dam]" : "0"]-[(org.burn_dam > 0) ? "[org.burn_dam]" : "0"]\n" + + //Bones broken report! Hyperstation 13 + if(iscarbon(M) && mode == 1) + var/mob/living/carbon/C = M + for(var/X in C.bodyparts) + var/obj/item/bodypart/LB = X + var/broken = LB.broken + if(broken == 1) + msg += "\tSubjects [LB.name] is fractured!\n" + +//Organ damages report + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/minor_damage + var/major_damage + var/max_damage + var/report_organs = FALSE + + //Piece together the lists to be reported + for(var/O in H.internal_organs) + var/obj/item/organ/organ = O + if(organ.organ_flags & ORGAN_FAILING) + report_organs = TRUE //if we report one organ, we report all organs, even if the lists are empty, just for consistency + if(max_damage) + max_damage += ", " //prelude the organ if we've already reported an organ + max_damage += organ.name //this just slaps the organ name into the string of text + else + max_damage = "\tNon-Functional Organs: " //our initial statement + max_damage += organ.name + else if(organ.damage > organ.high_threshold) + report_organs = TRUE + if(major_damage) + major_damage += ", " + major_damage += organ.name + else + major_damage = "\tSeverely Damaged Organs: " + major_damage += organ.name + else if(organ.damage > organ.low_threshold) + report_organs = TRUE + if(minor_damage) + minor_damage += ", " + minor_damage += organ.name + else + minor_damage = "\tMildly Damaged Organs: " + minor_damage += organ.name + + if(report_organs) //we either finish the list, or set it to be empty if no organs were reported in that category + if(!max_damage) + max_damage = "\tNon-Functional Organs: " + else + max_damage += "" + if(!major_damage) + major_damage = "\tSeverely Damaged Organs: " + else + major_damage += "" + if(!minor_damage) + minor_damage = "\tMildly Damaged Organs: " + else + minor_damage += "" + msg += "[minor_damage]" + msg += "[major_damage]" + msg += "[max_damage]" + + // Species and body temperature + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/datum/species/S = H.dna.species + var/mutant = FALSE + if (H.dna.check_mutation(HULK)) + mutant = TRUE + else if (S.mutantlungs != initial(S.mutantlungs)) + mutant = TRUE + else if (S.mutant_brain != initial(S.mutant_brain)) + mutant = TRUE + else if (S.mutant_heart != initial(S.mutant_heart)) + mutant = TRUE + else if (S.mutanteyes != initial(S.mutanteyes)) + mutant = TRUE + else if (S.mutantears != initial(S.mutantears)) + mutant = TRUE + else if (S.mutanthands != initial(S.mutanthands)) + mutant = TRUE + else if (S.mutanttongue != initial(S.mutanttongue)) + mutant = TRUE + else if (S.mutanttail != initial(S.mutanttail)) + mutant = TRUE + else if (S.mutantliver != initial(S.mutantliver)) + mutant = TRUE + else if (S.mutantstomach != initial(S.mutantstomach)) + mutant = TRUE + + msg += "Species: [H.dna.custom_species ? H.dna.custom_species : S.name] Base: [S.name]\n" + if(mutant) + msg += "Subject has mutations present." + msg += "Body temperature: [round(M.bodytemperature-T0C,0.1)] °C ([round(M.bodytemperature*1.8-459.67,0.1)] °F)\n" + + // Time of death + if(M.tod && (M.stat == DEAD || ((HAS_TRAIT(M, TRAIT_FAKEDEATH)) && !advanced))) + msg += "Time of Death: [M.tod]\n" + var/tdelta = round(world.time - M.timeofdeath) + if(tdelta < (DEFIB_TIME_LIMIT * 10)) + msg += "Subject died [DisplayTimeText(tdelta)] ago, defibrillation may be possible!\n" + + for(var/thing in M.diseases) + var/datum/disease/D = thing + if(!(D.visibility_flags & HIDDEN_SCANNER)) + msg += "Warning: [D.form] detected\nName: [D.name].\nType: [D.spread_text].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure_text]\n" + + // Blood Level + if(M.has_dna()) + var/mob/living/carbon/C = M + var/blood_id = C.get_blood_id() + if(blood_id) + if(ishuman(C)) + var/mob/living/carbon/human/H = C + if(H.bleed_rate) + msg += "Subject is bleeding!\n" + var/blood_percent = round((C.scan_blood_volume() / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) + var/blood_type = C.dna.blood_type + if(blood_id != ("blood" || "jellyblood"))//special blood substance + var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id] + if(R) + blood_type = R.name + else + blood_type = blood_id + if(C.scan_blood_volume() <= (BLOOD_VOLUME_SAFE*C.blood_ratio) && C.scan_blood_volume() > (BLOOD_VOLUME_OKAY*C.blood_ratio)) + msg += "LOW blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" + else if(C.scan_blood_volume() <= (BLOOD_VOLUME_OKAY*C.blood_ratio)) + msg += "CRITICAL blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" + else + msg += "Blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" + + var/cyberimp_detect + for(var/obj/item/organ/cyberimp/CI in C.internal_organs) + if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant) + cyberimp_detect += "[C.name] is modified with a [CI.name].
    " + if(cyberimp_detect) + msg += "Detected cybernetic modifications:\n" + msg += "[cyberimp_detect]\n" + msg += "*---------*
    " + to_chat(user, msg) + SEND_SIGNAL(M, COMSIG_NANITE_SCAN, user, FALSE) + +/proc/chemscan(mob/living/user, mob/living/M) + if(istype(M)) + if(M.reagents) + var/msg = "*---------*\n" + if(M.reagents.reagent_list.len) + var/list/datum/reagent/reagents = list() + for(var/datum/reagent/R in M.reagents.reagent_list) + if(R.chemical_flags & REAGENT_INVISIBLE) + continue + reagents += R + + if(length(reagents)) + msg += "Subject contains the following reagents:\n" + for(var/datum/reagent/R in reagents) + msg += "[R.volume] units of [R.name][R.overdosed == 1 ? " - OVERDOSING" : "."]\n" + else + msg += "Subject contains no reagents.\n" + + else + msg += "Subject contains no reagents.\n" + if(M.reagents.addiction_list.len) + msg += "Subject is addicted to the following reagents:\n" + for(var/datum/reagent/R in M.reagents.addiction_list) + msg += "[R.name]\n" + else + msg += "Subject is not addicted to any reagents.\n" + msg += "*---------*
    " + to_chat(user, msg) + + var/datum/reagent/impure/fermiTox/F = M.reagents.has_reagent(/datum/reagent/impure/fermiTox) + switch(F?.volume) + if(5 to 10) + msg += "Subject contains a low amount of toxic isomers.\n" + if(10 to 25) + msg += "Subject contains toxic isomers.\n" + if(25 to 50) + msg += "Subject contains a substantial amount of toxic isomers.\n" + if(50 to 95) + msg += "Subject contains a high amount of toxic isomers.\n" + if(95 to INFINITY) + msg += "Subject contains a extremely dangerous amount of toxic isomers.\n" + +/obj/item/healthanalyzer/verb/toggle_mode() + set name = "Switch Verbosity" + set category = "Object" + + if(usr.stat || !usr.canmove || usr.restrained()) + return + + mode = !mode + switch (mode) + if(1) + to_chat(usr, "The scanner now shows specific limb damage.") + if(0) + to_chat(usr, "The scanner no longer shows limb damage.") + +/obj/item/healthanalyzer/advanced + name = "advanced health analyzer" + icon_state = "health_adv" + desc = "A hand-held body scanner able to distinguish vital signs of the subject with high accuracy." + advanced = TRUE + +/obj/item/analyzer + desc = "A hand-held environmental scanner which reports current gas levels. Alt-Click to use the built in barometer function." + name = "analyzer" + icon = 'icons/obj/device.dmi' + icon_state = "analyzer" + item_state = "analyzer" + lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' + w_class = WEIGHT_CLASS_SMALL + flags_1 = CONDUCT_1 + item_flags = NOBLUDGEON + slot_flags = ITEM_SLOT_BELT + throwforce = 0 + throw_speed = 3 + throw_range = 7 + tool_behaviour = TOOL_ANALYZER + materials = list(MAT_METAL=30, MAT_GLASS=20) + grind_results = list(/datum/reagent/mercury = 5, /datum/reagent/iron = 5, /datum/reagent/silicon = 5) + var/cooldown = FALSE + var/cooldown_time = 250 + var/accuracy // 0 is the best accuracy. + +/obj/item/analyzer/examine(mob/user) + . = ..() + . += "Alt-click [src] to activate the barometer function." + +/obj/item/analyzer/suicide_act(mob/living/carbon/user) + user.visible_message("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!") + return BRUTELOSS + +/obj/item/analyzer/attack_self(mob/user) + add_fingerprint(user) + + if (user.stat || user.eye_blind) + return + + var/turf/location = user.loc + if(!istype(location)) + return + + var/datum/gas_mixture/environment = location.return_air() + + var/pressure = environment.return_pressure() + var/total_moles = environment.total_moles() + + to_chat(user, "Results:") + if(abs(pressure - ONE_ATMOSPHERE) < 10) + to_chat(user, "Pressure: [round(pressure, 0.01)] kPa") + else + to_chat(user, "Pressure: [round(pressure, 0.01)] kPa") + if(total_moles) + var/list/env_gases = environment.gases + + var/o2_concentration = env_gases[/datum/gas/oxygen]/total_moles + var/n2_concentration = env_gases[/datum/gas/nitrogen]/total_moles + var/co2_concentration = env_gases[/datum/gas/carbon_dioxide]/total_moles + var/plasma_concentration = env_gases[/datum/gas/plasma]/total_moles + + if(abs(n2_concentration - N2STANDARD) < 20) + to_chat(user, "Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/nitrogen], 0.01)] mol)") + else + to_chat(user, "Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/nitrogen], 0.01)] mol)") + + if(abs(o2_concentration - O2STANDARD) < 2) + to_chat(user, "Oxygen: [round(o2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/oxygen], 0.01)] mol)") + else + to_chat(user, "Oxygen: [round(o2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/oxygen], 0.01)] mol)") + + if(co2_concentration > 0.01) + to_chat(user, "CO2: [round(co2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/carbon_dioxide], 0.01)] mol)") + else + to_chat(user, "CO2: [round(co2_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/carbon_dioxide], 0.01)] mol)") + + if(plasma_concentration > 0.005) + to_chat(user, "Plasma: [round(plasma_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/plasma], 0.01)] mol)") + else + to_chat(user, "Plasma: [round(plasma_concentration*100, 0.01)] % ([round(env_gases[/datum/gas/plasma], 0.01)] mol)") + + GAS_GARBAGE_COLLECT(environment.gases) + + for(var/id in env_gases) + if(id in GLOB.hardcoded_gases) + continue + var/gas_concentration = env_gases[id]/total_moles + to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(env_gases[id], 0.01)] mol)") + to_chat(user, "Temperature: [round(environment.temperature-T0C, 0.01)] °C ([round(environment.temperature, 0.01)] K)") + +/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens + ..() + + if(user.canUseTopic(src)) + + if(cooldown) + to_chat(user, "[src]'s barometer function is preparing itself.") + return + + var/turf/T = get_turf(user) + if(!T) + return + + playsound(src, 'sound/effects/pop.ogg', 100) + var/area/user_area = T.loc + var/datum/weather/ongoing_weather = null + + if(!user_area.outdoors) + to_chat(user, "[src]'s barometer function won't work indoors!") + return + + for(var/V in SSweather.processing) + var/datum/weather/W = V + if(W.barometer_predictable && (T.z in W.impacted_z_levels) && W.area_type == user_area.type && !(W.stage == END_STAGE)) + ongoing_weather = W + break + + if(ongoing_weather) + if((ongoing_weather.stage == MAIN_STAGE) || (ongoing_weather.stage == WIND_DOWN_STAGE)) + to_chat(user, "[src]'s barometer function can't trace anything while the storm is [ongoing_weather.stage == MAIN_STAGE ? "already here!" : "winding down."]") + return + + to_chat(user, "The next [ongoing_weather] will hit in [butchertime(ongoing_weather.next_hit_time - world.time)].") + if(ongoing_weather.aesthetic) + to_chat(user, "[src]'s barometer function says that the next storm will breeze on by.") + else + var/next_hit = SSweather.next_hit_by_zlevel["[T.z]"] + var/fixed = next_hit ? next_hit - world.time : -1 + if(fixed < 0) + to_chat(user, "[src]'s barometer function was unable to trace any weather patterns.") + else + to_chat(user, "[src]'s barometer function says a storm will land in approximately [butchertime(fixed)].") + cooldown = TRUE + addtimer(CALLBACK(src,/obj/item/analyzer/proc/ping), cooldown_time) + +/obj/item/analyzer/proc/ping() + if(isliving(loc)) + var/mob/living/L = loc + to_chat(L, "[src]'s barometer function is ready!") + playsound(src, 'sound/machines/click.ogg', 100) + cooldown = FALSE + +/obj/item/analyzer/proc/butchertime(amount) + if(!amount) + return + if(accuracy) + var/inaccurate = round(accuracy*(1/3)) + if(prob(50)) + amount -= inaccurate + if(prob(50)) + amount += inaccurate + return DisplayTimeText(max(1,amount)) + +/proc/atmosanalyzer_scan(mixture, mob/living/user, atom/target = src) + var/icon = target + user.visible_message("[user] has used the analyzer on [icon2html(icon, viewers(src))] [target].", "You use the analyzer on [icon2html(icon, user)] [target].") + to_chat(user, "Results of analysis of [icon2html(icon, user)] [target].") + + var/list/airs = islist(mixture) ? mixture : list(mixture) + for(var/g in airs) + if(airs.len > 1) //not a unary gas mixture + to_chat(user, "Node [airs.Find(g)]") + var/datum/gas_mixture/air_contents = g + + var/total_moles = air_contents.total_moles() + var/pressure = air_contents.return_pressure() + var/volume = air_contents.return_volume() //could just do mixture.volume... but safety, I guess? + var/temperature = air_contents.temperature + var/cached_scan_results = air_contents.analyzer_results + + if(total_moles > 0) + to_chat(user, "Moles: [round(total_moles, 0.01)] mol") + to_chat(user, "Volume: [volume] L") + to_chat(user, "Pressure: [round(pressure,0.01)] kPa") + + var/list/cached_gases = air_contents.gases + for(var/id in cached_gases) + var/gas_concentration = cached_gases[id]/total_moles + to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(cached_gases[id], 0.01)] mol)") + to_chat(user, "Temperature: [round(temperature - T0C,0.01)] °C ([round(temperature, 0.01)] K)") + + else + if(airs.len > 1) + to_chat(user, "This node is empty!") + else + to_chat(user, "[target] is empty!") + + if(cached_scan_results && cached_scan_results["fusion"]) //notify the user if a fusion reaction was detected + var/instability = round(cached_scan_results["fusion"], 0.01) + to_chat(user, "Large amounts of free neutrons detected in the air indicate that a fusion reaction took place.") + to_chat(user, "Instability of the last fusion reaction: [instability].") + return + +//slime scanner + +/obj/item/slime_scanner + name = "slime scanner" + desc = "A device that analyzes a slime's internal composition and measures its stats." + icon = 'icons/obj/device.dmi' + icon_state = "adv_spectrometer" + item_state = "analyzer" + lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' + w_class = WEIGHT_CLASS_SMALL + flags_1 = CONDUCT_1 + throwforce = 0 + throw_speed = 3 + throw_range = 7 + materials = list(MAT_METAL=30, MAT_GLASS=20) + +/obj/item/slime_scanner/attack(mob/living/M, mob/living/user) + if(user.stat || user.eye_blind) + return + if (!isslime(M)) + to_chat(user, "This device can only scan slimes!") + return + var/mob/living/simple_animal/slime/T = M + slime_scan(T, user) + +/proc/slime_scan(mob/living/simple_animal/slime/T, mob/living/user) + to_chat(user, "========================") + to_chat(user, "Slime scan results:") + to_chat(user, "[T.colour] [T.is_adult ? "adult" : "baby"] slime") + to_chat(user, "Nutrition: [T.nutrition]/[T.get_max_nutrition()]") + if (T.nutrition < T.get_starve_nutrition()) + to_chat(user, "Warning: slime is starving!") + else if (T.nutrition < T.get_hunger_nutrition()) + to_chat(user, "Warning: slime is hungry") + to_chat(user, "Electric change strength: [T.powerlevel]") + to_chat(user, "Health: [round(T.health/T.maxHealth,0.01)*100]%") + if (T.slime_mutation[4] == T.colour) + to_chat(user, "This slime does not evolve any further.") + else + if (T.slime_mutation[3] == T.slime_mutation[4]) + if (T.slime_mutation[2] == T.slime_mutation[1]) + to_chat(user, "Possible mutation: [T.slime_mutation[3]]") + to_chat(user, "Genetic destability: [T.mutation_chance/2] % chance of mutation on splitting") + else + to_chat(user, "Possible mutations: [T.slime_mutation[1]], [T.slime_mutation[2]], [T.slime_mutation[3]] (x2)") + to_chat(user, "Genetic destability: [T.mutation_chance] % chance of mutation on splitting") + else + to_chat(user, "Possible mutations: [T.slime_mutation[1]], [T.slime_mutation[2]], [T.slime_mutation[3]], [T.slime_mutation[4]]") + to_chat(user, "Genetic destability: [T.mutation_chance] % chance of mutation on splitting") + if (T.cores > 1) + to_chat(user, "Multiple cores detected") + to_chat(user, "Growth progress: [T.amount_grown]/[SLIME_EVOLUTION_THRESHOLD]") + if(T.effectmod) + to_chat(user, "Core mutation in progress: [T.effectmod]") + to_chat(user, "Progress in core mutation: [T.applied] / [SLIME_EXTRACT_CROSSING_REQUIRED]") + to_chat(user, "========================") + + +/obj/item/nanite_scanner + name = "nanite scanner" + icon = 'icons/obj/device.dmi' + icon_state = "nanite_scanner" + item_state = "nanite_remote" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + desc = "A hand-held body scanner able to detect nanites and their programming." + flags_1 = CONDUCT_1 + item_flags = NOBLUDGEON + slot_flags = ITEM_SLOT_BELT + throwforce = 3 + w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + materials = list(MAT_METAL=200) + +/obj/item/nanite_scanner/attack(mob/living/M, mob/living/carbon/human/user) + user.visible_message("[user] has analyzed [M]'s nanites.") + + add_fingerprint(user) + + var/response = SEND_SIGNAL(M, COMSIG_NANITE_SCAN, user, TRUE) + if(!response) + to_chat(user, "No nanites detected in the subject.") + +/obj/item/sequence_scanner + name = "genetic sequence scanner" + icon = 'icons/obj/device.dmi' + icon_state = "gene" + item_state = "healthanalyzer" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + desc = "A hand-held scanner able to swiftly scan someone for potential mutations. Hold near a DNA console to update from their database." + flags_1 = CONDUCT_1 + item_flags = NOBLUDGEON + slot_flags = ITEM_SLOT_BELT + throwforce = 3 + w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + materials = list(MAT_METAL=200) + var/list/discovered = list() //hit a dna console to update the scanners database + +/obj/item/sequence_scanner/attack(mob/living/M, mob/living/carbon/human/user) + user.visible_message("[user] has analyzed [M]'s genetic sequence.") + + add_fingerprint(user) + + gene_scan(M, user, src) + +/obj/item/sequence_scanner/afterattack(obj/O, mob/user, proximity) + . = ..() + if(!istype(O) || !proximity) + return + + if(istype(O, /obj/machinery/computer/scan_consolenew)) + var/obj/machinery/computer/scan_consolenew/C = O + if(C.stored_research) + to_chat(user, "[name] database updated.") + discovered = C.stored_research.discovered_mutations + else + to_chat(user,"No database to update from.") + +/proc/gene_scan(mob/living/carbon/C, mob/living/user, obj/item/sequence_scanner/G) + if(!iscarbon(C) || !C.has_dna()) + return + to_chat(user, "[C.name]'s potential mutations.") + for(var/A in C.dna.mutation_index) + var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(A) + var/mut_name + if(G && (A in G.discovered)) + mut_name = "[HM.name] ([HM.alias])" + else + mut_name = HM.alias + var/temp = GET_GENE_STRING(HM.type, C.dna) + var/display + for(var/i in 0 to length(temp) / DNA_MUTATION_BLOCKS-1) + if(i) + display += "-" + display += copytext(temp, 1 + i*DNA_MUTATION_BLOCKS, DNA_MUTATION_BLOCKS*(1+i) + 1) + + + to_chat(user, "- [mut_name] > [display]") diff --git a/code/game/objects/items/extinguisher.dm b/code/game/objects/items/extinguisher.dm index d54cf4b1..4585685c 100644 --- a/code/game/objects/items/extinguisher.dm +++ b/code/game/objects/items/extinguisher.dm @@ -1,257 +1,257 @@ -/obj/item/extinguisher - name = "fire extinguisher" - desc = "A traditional red fire extinguisher." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "fire_extinguisher0" - item_state = "fire_extinguisher" - hitsound = 'sound/weapons/smash.ogg' - flags_1 = CONDUCT_1 - throwforce = 10 - w_class = WEIGHT_CLASS_NORMAL - throw_speed = 2 - throw_range = 7 - force = 10 - materials = list(MAT_METAL = 90) - attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") - dog_fashion = /datum/dog_fashion/back - resistance_flags = FIRE_PROOF - var/max_water = 50 - var/last_use = 1 - var/chem = "water" - var/safety = TRUE - var/refilling = FALSE - var/tanktype = /obj/structure/reagent_dispensers/watertank - var/sprite_name = "fire_extinguisher" - var/power = 5 //Maximum distance launched water will travel - var/precision = FALSE //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row - var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled - -/obj/item/extinguisher/mini - name = "pocket fire extinguisher" - desc = "A light and compact fibreglass-framed model fire extinguisher." - icon_state = "miniFE0" - item_state = "miniFE" - hitsound = null //it is much lighter, after all. - flags_1 = null //doesn't CONDUCT_1 - throwforce = 2 - w_class = WEIGHT_CLASS_SMALL - force = 3 - materials = list(MAT_METAL = 50, MAT_GLASS = 40) - max_water = 30 - sprite_name = "miniFE" - dog_fashion = null - -/obj/item/extinguisher/mini/family - name = "pocket fire extinguisher" - desc = "A old fashen pocket fire extinguisher that has been modified with a larger water tank, and a small high-power sprayer. It feels cool to the touch and has a small humming to it..." - icon_state = "miniFE0" - item_state = "miniFE" - throwforce = 1 - w_class = WEIGHT_CLASS_SMALL - force = 2 - max_water = 40 - power = 7 - cooling_power = 3 - -/obj/item/extinguisher/Initialize() - . = ..() - create_reagents(max_water, AMOUNT_VISIBLE) - reagents.add_reagent(chem, max_water) - - -/obj/item/extinguisher/advanced - name = "advanced fire extinguisher" - desc = "Used to stop thermonuclear fires from spreading inside your engine." - icon_state = "foam_extinguisher0" - //item_state = "foam_extinguisher" needs sprite - dog_fashion = null - chem = "firefighting_foam" - tanktype = /obj/structure/reagent_dispensers/foamtank - sprite_name = "foam_extinguisher" - precision = TRUE - -/obj/item/extinguisher/proc/refill() - create_reagents(max_water, AMOUNT_VISIBLE) - reagents.add_reagent(chem, max_water) - -/obj/item/extinguisher/suicide_act(mob/living/carbon/user) - if (!safety && (reagents.total_volume >= 1)) - user.visible_message("[user] puts the nozzle to [user.p_their()] mouth. It looks like [user.p_theyre()] trying to extinguish the spark of life!") - afterattack(user,user) - return OXYLOSS - else if (safety && (reagents.total_volume >= 1)) - user.visible_message("[user] puts the nozzle to [user.p_their()] mouth... The safety's still on!") - return SHAME - else - user.visible_message("[user] puts the nozzle to [user.p_their()] mouth... [src] is empty!") - return SHAME - -/obj/item/extinguisher/attack_self(mob/user) - safety = !safety - src.icon_state = "[sprite_name][!safety]" - to_chat(user, "The safety is [safety ? "on" : "off"].") - return - -/obj/item/extinguisher/attack(mob/M, mob/user) - if(user.a_intent == INTENT_HELP && !safety) //If we're on help intent and going to spray people, don't bash them. - return FALSE - else - return ..() - -/obj/item/extinguisher/attack_obj(obj/O, mob/living/user) - if(AttemptRefill(O, user)) - refilling = TRUE - return FALSE - else - return ..() - -/obj/item/extinguisher/examine(mob/user) - . = ..() - . += "The safety is [safety ? "on" : "off"]." - - if(reagents.total_volume) - . += "You can loose its screws to empty it." - -/obj/item/extinguisher/proc/AttemptRefill(atom/target, mob/user) - if(istype(target, tanktype) && target.Adjacent(user)) - var/safety_save = safety - safety = TRUE - if(reagents.total_volume == reagents.maximum_volume) - to_chat(user, "\The [src] is already full!") - safety = safety_save - return 1 - var/obj/structure/reagent_dispensers/W = target //will it work? - var/transferred = W.reagents.trans_to(src, max_water) - if(transferred > 0) - to_chat(user, "\The [src] has been refilled by [transferred] units.") - playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6) - for(var/datum/reagent/water/R in reagents.reagent_list) - R.cooling_temperature = cooling_power - else - to_chat(user, "\The [W] is empty!") - safety = safety_save - return 1 - else - return 0 - -/obj/item/extinguisher/afterattack(atom/target, mob/user , flag) - . = ..() - // Make it so the extinguisher doesn't spray yourself when you click your inventory items - if (target.loc == user) - return - //TODO; Add support for reagents in water. - if(refilling) - refilling = FALSE - return - if (!safety) - if (src.reagents.total_volume < 1) - to_chat(usr, "\The [src] is empty!") - return - - if (world.time < src.last_use + 12) - return - - src.last_use = world.time - - playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3) - - var/direction = get_dir(src,target) - - if(user.buckled && isobj(user.buckled) && !user.buckled.anchored) - var/obj/B = user.buckled - var/movementdirection = turn(direction,180) - addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection), 1) - - else user.newtonian_move(turn(direction, 180)) - - //Get all the turfs that can be shot at - var/turf/T = get_turf(target) - var/turf/T1 = get_step(T,turn(direction, 90)) - var/turf/T2 = get_step(T,turn(direction, -90)) - var/list/the_targets = list(T,T1,T2) - if(precision) - var/turf/T3 = get_step(T1, turn(direction, 90)) - var/turf/T4 = get_step(T2,turn(direction, -90)) - the_targets.Add(T3,T4) - - var/list/water_particles=list() - for(var/a=0, a<5, a++) - var/obj/effect/particle_effect/water/W = new /obj/effect/particle_effect/water(get_turf(src)) - var/my_target = pick(the_targets) - water_particles[W] = my_target - // If precise, remove turf from targets so it won't be picked more than once - if(precision) - the_targets -= my_target - var/datum/reagents/R = new/datum/reagents(5) - W.reagents = R - R.my_atom = W - reagents.trans_to(W,1) - - //Make em move dat ass, hun - addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, water_particles), 2) - -//Particle movement loop -/obj/item/extinguisher/proc/move_particles(var/list/particles, var/repetition=0) - //Check if there's anything in here first - if(!particles || particles.len == 0) - return - // Second loop: Get all the water particles and make them move to their target - for(var/obj/effect/particle_effect/water/W in particles) - var/turf/my_target = particles[W] - if(!W) - continue - step_towards(W,my_target) - if(!W.reagents) - continue - W.reagents.reaction(get_turf(W)) - for(var/A in get_turf(W)) - W.reagents.reaction(A) - if(W.loc == my_target) - break - if(repetition < power) - repetition++ - addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, particles, repetition), 2) - -//Chair movement loop -/obj/item/extinguisher/proc/move_chair(var/obj/B, var/movementdirection, var/repetition=0) - step(B, movementdirection) - - var/timer_seconds - switch(repetition) - if(0 to 2) - timer_seconds = 1 - if(3 to 4) - timer_seconds = 2 - if(5 to 8) - timer_seconds = 3 - else - return - - repetition++ - addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection, repetition), timer_seconds) - -/obj/item/extinguisher/screwdriver_act(mob/user, obj/item/tool) - if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user))) - return - EmptyExtinguisher(user) - -/obj/item/extinguisher/proc/EmptyExtinguisher(var/mob/user) - if(loc == user && reagents.total_volume) - reagents.clear_reagents() - - var/turf/T = get_turf(loc) - if(isopenturf(T)) - var/turf/open/theturf = T - theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS) - - user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "You quietly empty out \the [src] by loosing the release valve's screws.") - -//firebot assembly -/obj/item/extinguisher/attackby(obj/O, mob/user, params) - if(istype(O, /obj/item/bodypart/l_arm/robot) || istype(O, /obj/item/bodypart/r_arm/robot)) - to_chat(user, "You add [O] to [src].") - qdel(O) - qdel(src) - user.put_in_hands(new /obj/item/bot_assembly/firebot) - else - ..() +/obj/item/extinguisher + name = "fire extinguisher" + desc = "A traditional red fire extinguisher." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "fire_extinguisher0" + item_state = "fire_extinguisher" + hitsound = 'sound/weapons/smash.ogg' + flags_1 = CONDUCT_1 + throwforce = 10 + w_class = WEIGHT_CLASS_NORMAL + throw_speed = 2 + throw_range = 7 + force = 10 + materials = list(MAT_METAL = 90) + attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") + dog_fashion = /datum/dog_fashion/back + resistance_flags = FIRE_PROOF + var/max_water = 50 + var/last_use = 1 + var/chem = /datum/reagent/water + var/safety = TRUE + var/refilling = FALSE + var/tanktype = /obj/structure/reagent_dispensers/watertank + var/sprite_name = "fire_extinguisher" + var/power = 5 //Maximum distance launched water will travel + var/precision = FALSE //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row + var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled + +/obj/item/extinguisher/mini + name = "pocket fire extinguisher" + desc = "A light and compact fibreglass-framed model fire extinguisher." + icon_state = "miniFE0" + item_state = "miniFE" + hitsound = null //it is much lighter, after all. + flags_1 = null //doesn't CONDUCT_1 + throwforce = 2 + w_class = WEIGHT_CLASS_SMALL + force = 3 + materials = list(MAT_METAL = 50, MAT_GLASS = 40) + max_water = 30 + sprite_name = "miniFE" + dog_fashion = null + +/obj/item/extinguisher/mini/family + name = "pocket fire extinguisher" + desc = "A old fashen pocket fire extinguisher that has been modified with a larger water tank, and a small high-power sprayer. It feels cool to the touch and has a small humming to it..." + icon_state = "miniFE0" + item_state = "miniFE" + throwforce = 1 + w_class = WEIGHT_CLASS_SMALL + force = 2 + max_water = 40 + power = 7 + cooling_power = 3 + +/obj/item/extinguisher/Initialize() + . = ..() + create_reagents(max_water, AMOUNT_VISIBLE) + reagents.add_reagent(chem, max_water) + + +/obj/item/extinguisher/advanced + name = "advanced fire extinguisher" + desc = "Used to stop thermonuclear fires from spreading inside your engine." + icon_state = "foam_extinguisher0" + //item_state = "foam_extinguisher" needs sprite + dog_fashion = null + chem = "firefighting_foam" + tanktype = /obj/structure/reagent_dispensers/foamtank + sprite_name = "foam_extinguisher" + precision = TRUE + +/obj/item/extinguisher/proc/refill() + create_reagents(max_water, AMOUNT_VISIBLE) + reagents.add_reagent(chem, max_water) + +/obj/item/extinguisher/suicide_act(mob/living/carbon/user) + if (!safety && (reagents.total_volume >= 1)) + user.visible_message("[user] puts the nozzle to [user.p_their()] mouth. It looks like [user.p_theyre()] trying to extinguish the spark of life!") + afterattack(user,user) + return OXYLOSS + else if (safety && (reagents.total_volume >= 1)) + user.visible_message("[user] puts the nozzle to [user.p_their()] mouth... The safety's still on!") + return SHAME + else + user.visible_message("[user] puts the nozzle to [user.p_their()] mouth... [src] is empty!") + return SHAME + +/obj/item/extinguisher/attack_self(mob/user) + safety = !safety + src.icon_state = "[sprite_name][!safety]" + to_chat(user, "The safety is [safety ? "on" : "off"].") + return + +/obj/item/extinguisher/attack(mob/M, mob/user) + if(user.a_intent == INTENT_HELP && !safety) //If we're on help intent and going to spray people, don't bash them. + return FALSE + else + return ..() + +/obj/item/extinguisher/attack_obj(obj/O, mob/living/user) + if(AttemptRefill(O, user)) + refilling = TRUE + return FALSE + else + return ..() + +/obj/item/extinguisher/examine(mob/user) + . = ..() + . += "The safety is [safety ? "on" : "off"]." + + if(reagents.total_volume) + . += "You can loose its screws to empty it." + +/obj/item/extinguisher/proc/AttemptRefill(atom/target, mob/user) + if(istype(target, tanktype) && target.Adjacent(user)) + var/safety_save = safety + safety = TRUE + if(reagents.total_volume == reagents.maximum_volume) + to_chat(user, "\The [src] is already full!") + safety = safety_save + return 1 + var/obj/structure/reagent_dispensers/W = target //will it work? + var/transferred = W.reagents.trans_to(src, max_water) + if(transferred > 0) + to_chat(user, "\The [src] has been refilled by [transferred] units.") + playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6) + for(var/datum/reagent/water/R in reagents.reagent_list) + R.cooling_temperature = cooling_power + else + to_chat(user, "\The [W] is empty!") + safety = safety_save + return 1 + else + return 0 + +/obj/item/extinguisher/afterattack(atom/target, mob/user , flag) + . = ..() + // Make it so the extinguisher doesn't spray yourself when you click your inventory items + if (target.loc == user) + return + //TODO; Add support for reagents in water. + if(refilling) + refilling = FALSE + return + if (!safety) + if (src.reagents.total_volume < 1) + to_chat(usr, "\The [src] is empty!") + return + + if (world.time < src.last_use + 12) + return + + src.last_use = world.time + + playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3) + + var/direction = get_dir(src,target) + + if(user.buckled && isobj(user.buckled) && !user.buckled.anchored) + var/obj/B = user.buckled + var/movementdirection = turn(direction,180) + addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection), 1) + + else user.newtonian_move(turn(direction, 180)) + + //Get all the turfs that can be shot at + var/turf/T = get_turf(target) + var/turf/T1 = get_step(T,turn(direction, 90)) + var/turf/T2 = get_step(T,turn(direction, -90)) + var/list/the_targets = list(T,T1,T2) + if(precision) + var/turf/T3 = get_step(T1, turn(direction, 90)) + var/turf/T4 = get_step(T2,turn(direction, -90)) + the_targets.Add(T3,T4) + + var/list/water_particles=list() + for(var/a=0, a<5, a++) + var/obj/effect/particle_effect/water/W = new /obj/effect/particle_effect/water(get_turf(src)) + var/my_target = pick(the_targets) + water_particles[W] = my_target + // If precise, remove turf from targets so it won't be picked more than once + if(precision) + the_targets -= my_target + var/datum/reagents/R = new/datum/reagents(5) + W.reagents = R + R.my_atom = W + reagents.trans_to(W,1) + + //Make em move dat ass, hun + addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, water_particles), 2) + +//Particle movement loop +/obj/item/extinguisher/proc/move_particles(var/list/particles, var/repetition=0) + //Check if there's anything in here first + if(!particles || particles.len == 0) + return + // Second loop: Get all the water particles and make them move to their target + for(var/obj/effect/particle_effect/water/W in particles) + var/turf/my_target = particles[W] + if(!W) + continue + step_towards(W,my_target) + if(!W.reagents) + continue + W.reagents.reaction(get_turf(W)) + for(var/A in get_turf(W)) + W.reagents.reaction(A) + if(W.loc == my_target) + break + if(repetition < power) + repetition++ + addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, particles, repetition), 2) + +//Chair movement loop +/obj/item/extinguisher/proc/move_chair(var/obj/B, var/movementdirection, var/repetition=0) + step(B, movementdirection) + + var/timer_seconds + switch(repetition) + if(0 to 2) + timer_seconds = 1 + if(3 to 4) + timer_seconds = 2 + if(5 to 8) + timer_seconds = 3 + else + return + + repetition++ + addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection, repetition), timer_seconds) + +/obj/item/extinguisher/screwdriver_act(mob/user, obj/item/tool) + if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + EmptyExtinguisher(user) + +/obj/item/extinguisher/proc/EmptyExtinguisher(var/mob/user) + if(loc == user && reagents.total_volume) + reagents.clear_reagents() + + var/turf/T = get_turf(loc) + if(isopenturf(T)) + var/turf/open/theturf = T + theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS) + + user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "You quietly empty out \the [src] by loosing the release valve's screws.") + +//firebot assembly +/obj/item/extinguisher/attackby(obj/O, mob/user, params) + if(istype(O, /obj/item/bodypart/l_arm/robot) || istype(O, /obj/item/bodypart/r_arm/robot)) + to_chat(user, "You add [O] to [src].") + qdel(O) + qdel(src) + user.put_in_hands(new /obj/item/bot_assembly/firebot) + else + ..() diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm index a21d14ca..92bc25ea 100644 --- a/code/game/objects/items/grenades/chem_grenade.dm +++ b/code/game/objects/items/grenades/chem_grenade.dm @@ -1,602 +1,602 @@ -#define EMPTY 1 -#define WIRED 2 -#define READY 3 - -/obj/item/grenade/chem_grenade - name = "chemical grenade" - desc = "A custom made grenade." - icon_state = "chemg" - item_state = "flashbang" - w_class = WEIGHT_CLASS_SMALL - force = 2 - var/stage = EMPTY - var/list/beakers = list() - var/list/allowed_containers = list(/obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle) - var/affected_area = 3 - var/obj/item/assembly_holder/nadeassembly = null - var/assemblyattacher - var/ignition_temp = 10 // The amount of heat added to the reagents when this grenade goes off. - var/threatscale = 1 // Used by advanced grenades to make them slightly more worthy. - var/no_splash = FALSE //If the grenade deletes even if it has no reagents to splash with. Used for slime core reactions. - var/casedesc = "This basic model accepts both beakers and bottles. It heats contents by 10°K upon ignition." // Appears when examining empty casings. - -/obj/item/grenade/chem_grenade/Initialize() - . = ..() - create_reagents(1000) - stage_change() // If no argument is set, it will change the stage to the current stage, useful for stock grenades that start READY. - -/obj/item/grenade/chem_grenade/examine(mob/user) - display_timer = (stage == READY && !nadeassembly) //show/hide the timer based on assembly state - . = ..() - if(user.can_see_reagents()) - var/count = 0 - if(beakers.len) - . += "You scan the grenade and detect the following reagents:" - for(var/obj/item/reagent_containers/glass/G in beakers) - var/textcount = thtotext(++count) - for(var/datum/reagent/R in G.reagents.reagent_list) - . += "[R.volume] units of [R.name] in the [textcount] beaker." - if(beakers.len == 1) - . += "You detect no second beaker in the grenade." - else - . += "You scan the grenade, but detect nothing." - - -/obj/item/grenade/chem_grenade/attack_self(mob/user) - if(stage == READY && !active) - if(nadeassembly) - nadeassembly.attack_self(user) - else - ..() - - -/obj/item/grenade/chem_grenade/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/screwdriver)) - if(stage == WIRED) - if(beakers.len) - stage_change(READY) - to_chat(user, "You lock the [initial(name)] assembly.") - I.play_tool_sound(src, 25) - else - to_chat(user, "You need to add at least one beaker before locking the [initial(name)] assembly!") - else if(stage == READY && !nadeassembly) - det_time = det_time == 50 ? 30 : 50 //toggle between 30 and 50 - to_chat(user, "You modify the time delay. It's set for [DisplayTimeText(det_time)].") - else if(stage == EMPTY) - to_chat(user, "You need to add an activation mechanism!") - - else if(stage == WIRED && is_type_in_list(I, allowed_containers)) - . = 1 //no afterattack - if(beakers.len == 2) - to_chat(user, "[src] can not hold more containers!") - return - else - if(I.reagents.total_volume) - if(!user.transferItemToLoc(I, src)) - return - to_chat(user, "You add [I] to the [initial(name)] assembly.") - beakers += I - var/reagent_list = pretty_string_from_reagent_list(I.reagents) - user.log_message("inserted [I] ([reagent_list]) into [src]",LOG_GAME) - else - to_chat(user, "[I] is empty!") - - else if(stage == EMPTY && istype(I, /obj/item/assembly_holder)) - . = 1 // no afterattack - var/obj/item/assembly_holder/A = I - if(isigniter(A.a_left) == isigniter(A.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it - return - if(!user.transferItemToLoc(I, src)) - return - - nadeassembly = A - A.master = src - assemblyattacher = user.ckey - - stage_change(WIRED) - to_chat(user, "You add [A] to the [initial(name)] assembly.") - - else if(stage == EMPTY && istype(I, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/C = I - if (C.use(1)) - det_time = 50 // In case the cable_coil was removed and readded. - stage_change(WIRED) - to_chat(user, "You rig the [initial(name)] assembly.") - else - to_chat(user, "You need one length of coil to wire the assembly!") - return - - else if(stage == READY && istype(I, /obj/item/wirecutters) && !active) - stage_change(WIRED) - to_chat(user, "You unlock the [initial(name)] assembly.") - - else if(stage == WIRED && istype(I, /obj/item/wrench)) - if(beakers.len) - for(var/obj/O in beakers) - O.forceMove(drop_location()) - if(!O.reagents) - continue - var/reagent_list = pretty_string_from_reagent_list(O.reagents) - user.log_message("removed [O] ([reagent_list]) from [src]", LOG_GAME) - beakers = list() - to_chat(user, "You open the [initial(name)] assembly and remove the payload.") - return // First use of the wrench remove beakers, then use the wrench to remove the activation mechanism. - if(nadeassembly) - nadeassembly.forceMove(drop_location()) - nadeassembly.master = null - nadeassembly = null - else // If "nadeassembly = null && stage == WIRED", then it most have been cable_coil that was used. - new /obj/item/stack/cable_coil(get_turf(src),1) - stage_change(EMPTY) - to_chat(user, "You remove the activation mechanism from the [initial(name)] assembly.") - else - return ..() - -/obj/item/grenade/chem_grenade/proc/stage_change(N) - if(N) - stage = N - if(stage == EMPTY) - name = "[initial(name)] casing" - desc = "A do it yourself [initial(name)]! [initial(casedesc)]" - icon_state = initial(icon_state) - else if(stage == WIRED) - name = "unsecured [initial(name)]" - desc = "An unsecured [initial(name)] assembly." - icon_state = "[initial(icon_state)]_ass" - else if(stage == READY) - name = initial(name) - desc = initial(desc) - icon_state = "[initial(icon_state)]_locked" - - -//assembly stuff -/obj/item/grenade/chem_grenade/receive_signal() - prime() - - -/obj/item/grenade/chem_grenade/Crossed(atom/movable/AM) - if(nadeassembly) - nadeassembly.Crossed(AM) - -/obj/item/grenade/chem_grenade/on_found(mob/finder) - if(nadeassembly) - nadeassembly.on_found(finder) - -/obj/item/grenade/chem_grenade/log_grenade(mob/user, turf/T) - ..() - var/reagent_string = "" - var/beaker_number = 1 - for(var/obj/exploded_beaker in beakers) - if(!exploded_beaker.reagents) - continue - reagent_string += "[exploded_beaker] [beaker_number++] : " + pretty_string_from_reagent_list(exploded_beaker.reagents.reagent_list) + ";" - var/message = "[src] primed by [user] at [ADMIN_VERBOSEJMP(T)] contained [reagent_string]." - GLOB.bombers += message - message_admins(message) - user.log_message("primed [src] ([reagent_string])",LOG_GAME) - -/obj/item/grenade/chem_grenade/prime() - if(stage != READY) - return - - var/list/datum/reagents/reactants = list() - for(var/obj/item/reagent_containers/glass/G in beakers) - reactants += G.reagents - - var/turf/detonation_turf = get_turf(src) - - if(!chem_splash(detonation_turf, affected_area, reactants, ignition_temp, threatscale) && !no_splash) - playsound(src, 'sound/items/screwdriver2.ogg', 50, 1) - if(beakers.len) - for(var/obj/O in beakers) - O.forceMove(drop_location()) - beakers = list() - stage_change(EMPTY) - return - - if(nadeassembly) - var/mob/M = get_mob_by_ckey(assemblyattacher) - var/mob/last = get_mob_by_ckey(nadeassembly.fingerprintslast) - message_admins("grenade primed by an assembly, attached by [ADMIN_LOOKUPFLW(M)] and last touched by [ADMIN_LOOKUPFLW(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name]) at [ADMIN_VERBOSEJMP(detonation_turf)].") - log_game("grenade primed by an assembly, attached by [key_name(M)] and last touched by [key_name(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name]) at [AREACOORD(detonation_turf)]") - - log_game("A grenade detonated at [AREACOORD(detonation_turf)]") - - update_mob() - - qdel(src) - -//Large chem grenades accept slime cores and use the appropriately. -/obj/item/grenade/chem_grenade/large - name = "large grenade" - desc = "A custom made large grenade. Larger splash range and increased ignition temperature compared to basic grenades. Fits exotic containers." - casedesc = "This casing affects a larger area than the basic model and can fit exotic containers, including slime cores. Heats contents by 25°K upon ignition." - icon_state = "large_grenade" - allowed_containers = list(/obj/item/reagent_containers/glass, /obj/item/reagent_containers/food/condiment, /obj/item/reagent_containers/food/drinks) - affected_area = 5 - ignition_temp = 25 // Large grenades are slightly more effective at setting off heat-sensitive mixtures than smaller grenades. - threatscale = 1.1 // 10% more effective. - -/obj/item/grenade/chem_grenade/large/prime() - if(stage != READY) - return - - for(var/obj/item/slime_extract/S in beakers) - if(S.Uses) - for(var/obj/item/reagent_containers/glass/G in beakers) - G.reagents.trans_to(S, G.reagents.total_volume) - - //If there is still a core (sometimes it's used up) - //and there are reagents left, behave normally, - //otherwise drop it on the ground for timed reactions like gold. - - if(S) - if(S.reagents && S.reagents.total_volume) - for(var/obj/item/reagent_containers/glass/G in beakers) - S.reagents.trans_to(G, S.reagents.total_volume) - else - S.forceMove(get_turf(src)) - no_splash = TRUE - ..() - - //I tried to just put it in the allowed_containers list but - //if you do that it must have reagents. If you're going to - //make a special case you might as well do it explicitly. -Sayu -/obj/item/grenade/chem_grenade/large/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/slime_extract) && stage == WIRED) - if(!user.transferItemToLoc(I, src)) - return - to_chat(user, "You add [I] to the [initial(name)] assembly.") - beakers += I - else - return ..() - -/obj/item/grenade/chem_grenade/cryo // Intended for rare cryogenic mixes. Cools the area moderately upon detonation. - name = "cryo grenade" - desc = "A custom made cryogenic grenade. Rapidly cools contents upon ignition." - casedesc = "Upon ignition, it rapidly cools contents by 100°K. Smaller splash range than regular casings." - icon_state = "cryog" - affected_area = 2 - ignition_temp = -100 - -/obj/item/grenade/chem_grenade/pyro // Intended for pyrotechnical mixes. Produces a small fire upon detonation, igniting potentially flammable mixtures. - name = "pyro grenade" - desc = "A custom made pyrotechnical grenade. Heats up contents upon ignition." - casedesc = "Upon ignition, it rapidly heats contents by 500°K." - icon_state = "pyrog" - ignition_temp = 500 // This is enough to expose a hotspot. - -/obj/item/grenade/chem_grenade/adv_release // Intended for weaker, but longer lasting effects. Could have some interesting uses. - name = "advanced release grenade" - desc = "A custom made advanced release grenade. It is able to be detonated more than once. Can be configured using a multitool." - casedesc = "This casing is able to detonate more than once. Can be configured using a multitool." - icon_state = "timeg" - var/unit_spread = 10 // Amount of units per repeat. Can be altered with a multitool. - -/obj/item/grenade/chem_grenade/adv_release/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/multitool)) - switch(unit_spread) - if(0 to 24) - unit_spread += 5 - if(25 to 99) - unit_spread += 25 - else - unit_spread = 5 - to_chat(user, " You set the time release to [unit_spread] units per detonation.") - return - ..() - -/obj/item/grenade/chem_grenade/adv_release/prime() - if(stage != READY) - return - - var/total_volume = 0 - for(var/obj/item/reagent_containers/RC in beakers) - total_volume += RC.reagents.total_volume - if(!total_volume) - qdel(src) - qdel(nadeassembly) - return - var/fraction = unit_spread/total_volume - var/datum/reagents/reactants = new(unit_spread) - reactants.my_atom = src - for(var/obj/item/reagent_containers/RC in beakers) - RC.reagents.trans_to(reactants, RC.reagents.total_volume*fraction, threatscale, 1, 1) - chem_splash(get_turf(src), affected_area, list(reactants), ignition_temp, threatscale) - - var/turf/DT = get_turf(src) - if(nadeassembly) - var/mob/M = get_mob_by_ckey(assemblyattacher) - var/mob/last = get_mob_by_ckey(nadeassembly.fingerprintslast) - message_admins("grenade primed by an assembly at [AREACOORD(DT)], attached by [ADMIN_LOOKUPFLW(M)] and last touched by [ADMIN_LOOKUPFLW(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name]).") - log_game("grenade primed by an assembly at [AREACOORD(DT)], attached by [key_name(M)] and last touched by [key_name(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name])") - else - addtimer(CALLBACK(src, .proc/prime), det_time) - log_game("A grenade detonated at [AREACOORD(DT)]") - - - - - -////////////////////////////// -////// PREMADE GRENADES ////// -////////////////////////////// - -/obj/item/grenade/chem_grenade/metalfoam - name = "metal foam grenade" - desc = "Used for emergency sealing of hull breaches." - stage = READY - -/obj/item/grenade/chem_grenade/metalfoam/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/B2 = new(src) - - B1.reagents.add_reagent("aluminium", 30) - B2.reagents.add_reagent("foaming_agent", 10) - B2.reagents.add_reagent("facid", 10) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/smart_metal_foam - name = "smart metal foam grenade" - desc = "Used for emergency sealing of hull breaches, while keeping areas accessible." - stage = READY - -/obj/item/grenade/chem_grenade/smart_metal_foam/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/B2 = new(src) - - B1.reagents.add_reagent("aluminium", 75) - B2.reagents.add_reagent("smart_foaming_agent", 25) - B2.reagents.add_reagent("facid", 25) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/incendiary - name = "incendiary grenade" - desc = "Used for clearing rooms of living things." - stage = READY - -/obj/item/grenade/chem_grenade/incendiary/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/B2 = new(src) - - B1.reagents.add_reagent("phosphorus", 25) - B2.reagents.add_reagent("stable_plasma", 25) - B2.reagents.add_reagent("sacid", 25) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/antiweed - name = "weedkiller grenade" - desc = "Used for purging large areas of invasive plant species. Contents under pressure. Do not directly inhale contents." - stage = READY - -/obj/item/grenade/chem_grenade/antiweed/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/B2 = new(src) - - B1.reagents.add_reagent("plantbgone", 25) - B1.reagents.add_reagent("potassium", 25) - B2.reagents.add_reagent("phosphorus", 25) - B2.reagents.add_reagent("sugar", 25) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/cleaner - name = "cleaner grenade" - desc = "BLAM!-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas." - stage = READY - -/obj/item/grenade/chem_grenade/cleaner/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/plastic/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/plastic/B2 = new(src) - - B1.reagents.add_reagent("fluorosurfactant", 40) - B2.reagents.add_reagent("water", 40) - B2.reagents.add_reagent("cleaner", 10) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/ez_clean - name = "cleaner grenade" - desc = "Waffle Co.-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas." - stage = READY - -/obj/item/grenade/chem_grenade/ez_clean/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/plastic/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/plastic/B2 = new(src) - - B1.reagents.add_reagent("fluorosurfactant", 40) - B2.reagents.add_reagent("water", 40) - B2.reagents.add_reagent("ez_clean", 60) //ensures a t h i c c distribution - - beakers += B1 - beakers += B2 - - - -/obj/item/grenade/chem_grenade/teargas - name = "teargas grenade" - desc = "Used for nonlethal riot control. Contents under pressure. Do not directly inhale contents." - stage = READY - -/obj/item/grenade/chem_grenade/teargas/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/large/B2 = new(src) - - B1.reagents.add_reagent("condensedcapsaicin", 60) - B1.reagents.add_reagent("potassium", 40) - B2.reagents.add_reagent("phosphorus", 40) - B2.reagents.add_reagent("sugar", 40) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/facid - name = "acid grenade" - desc = "Used for melting armoured opponents." - stage = READY - -/obj/item/grenade/chem_grenade/facid/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) - - B1.reagents.add_reagent("facid", 290) - B1.reagents.add_reagent("potassium", 10) - B2.reagents.add_reagent("phosphorus", 10) - B2.reagents.add_reagent("sugar", 10) - B2.reagents.add_reagent("facid", 280) - - beakers += B1 - beakers += B2 - - -/obj/item/grenade/chem_grenade/colorful - name = "colorful grenade" - desc = "Used for wide scale painting projects." - stage = READY - -/obj/item/grenade/chem_grenade/colorful/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/B2 = new(src) - - B1.reagents.add_reagent("colorful_reagent", 25) - B1.reagents.add_reagent("potassium", 25) - B2.reagents.add_reagent("phosphorus", 25) - B2.reagents.add_reagent("sugar", 25) - - beakers += B1 - beakers += B2 - -/obj/item/grenade/chem_grenade/glitter - name = "generic glitter grenade" - desc = "You shouldn't see this description." - stage = READY - var/glitter_type = "glitter" - -/obj/item/grenade/chem_grenade/glitter/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/B2 = new(src) - - B1.reagents.add_reagent(glitter_type, 25) - B1.reagents.add_reagent("potassium", 25) - B2.reagents.add_reagent("phosphorus", 25) - B2.reagents.add_reagent("sugar", 25) - - beakers += B1 - beakers += B2 - -/obj/item/grenade/chem_grenade/glitter/pink - name = "pink glitter bomb" - desc = "For that HOT glittery look." - glitter_type = "pink_glitter" - -/obj/item/grenade/chem_grenade/glitter/blue - name = "blue glitter bomb" - desc = "For that COOL glittery look." - glitter_type = "blue_glitter" - -/obj/item/grenade/chem_grenade/glitter/white - name = "white glitter bomb" - desc = "For that somnolent glittery look." - glitter_type = "white_glitter" - -/obj/item/grenade/chem_grenade/clf3 - name = "clf3 grenade" - desc = "BURN!-brand foaming clf3. In a special applicator for rapid purging of wide areas." - stage = READY - -/obj/item/grenade/chem_grenade/clf3/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) - - B1.reagents.add_reagent("fluorosurfactant", 250) - B1.reagents.add_reagent("clf3", 50) - B2.reagents.add_reagent("water", 250) - B2.reagents.add_reagent("clf3", 50) - - beakers += B1 - beakers += B2 - -/obj/item/grenade/chem_grenade/bioterrorfoam - name = "Bio terror foam grenade" - desc = "Tiger Cooperative chemical foam grenade. Causes temporary irration, blindness, confusion, mutism, and mutations to carbon based life forms. Contains additional spore toxin." - stage = READY - -/obj/item/grenade/chem_grenade/bioterrorfoam/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) - - B1.reagents.add_reagent("cryptobiolin", 75) - B1.reagents.add_reagent("water", 50) - B1.reagents.add_reagent("mutetoxin", 50) - B1.reagents.add_reagent("spore", 75) - B1.reagents.add_reagent("itching_powder", 50) - B2.reagents.add_reagent("fluorosurfactant", 150) - B2.reagents.add_reagent("mutagen", 150) - beakers += B1 - beakers += B2 - -/obj/item/grenade/chem_grenade/tuberculosis - name = "Fungal tuberculosis grenade" - desc = "WARNING: GRENADE WILL RELEASE DEADLY SPORES CONTAINING ACTIVE AGENTS. SEAL SUIT AND AIRFLOW BEFORE USE." - stage = READY - -/obj/item/grenade/chem_grenade/tuberculosis/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) - - B1.reagents.add_reagent("potassium", 50) - B1.reagents.add_reagent("phosphorus", 50) - B1.reagents.add_reagent("fungalspores", 200) - B2.reagents.add_reagent("blood", 250) - B2.reagents.add_reagent("sugar", 50) - - beakers += B1 - beakers += B2 - -/obj/item/grenade/chem_grenade/holy - name = "holy hand grenade" - desc = "A vessel of concentrated religious might." - icon_state = "holy_grenade" - stage = READY - -/obj/item/grenade/chem_grenade/holy/Initialize() - . = ..() - var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src) - var/obj/item/reagent_containers/glass/beaker/large/B2 = new(src) - - B1.reagents.add_reagent("potassium", 100) - B2.reagents.add_reagent("holywater", 100) - - beakers += B1 - beakers += B2 - -#undef READY -#undef WIRED -#undef EMPTY +#define EMPTY 1 +#define WIRED 2 +#define READY 3 + +/obj/item/grenade/chem_grenade + name = "chemical grenade" + desc = "A custom made grenade." + icon_state = "chemg" + item_state = "flashbang" + w_class = WEIGHT_CLASS_SMALL + force = 2 + var/stage = EMPTY + var/list/beakers = list() + var/list/allowed_containers = list(/obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle) + var/affected_area = 3 + var/obj/item/assembly_holder/nadeassembly = null + var/assemblyattacher + var/ignition_temp = 10 // The amount of heat added to the reagents when this grenade goes off. + var/threatscale = 1 // Used by advanced grenades to make them slightly more worthy. + var/no_splash = FALSE //If the grenade deletes even if it has no reagents to splash with. Used for slime core reactions. + var/casedesc = "This basic model accepts both beakers and bottles. It heats contents by 10°K upon ignition." // Appears when examining empty casings. + +/obj/item/grenade/chem_grenade/Initialize() + . = ..() + create_reagents(1000) + stage_change() // If no argument is set, it will change the stage to the current stage, useful for stock grenades that start READY. + +/obj/item/grenade/chem_grenade/examine(mob/user) + display_timer = (stage == READY && !nadeassembly) //show/hide the timer based on assembly state + . = ..() + if(user.can_see_reagents()) + var/count = 0 + if(beakers.len) + . += "You scan the grenade and detect the following reagents:" + for(var/obj/item/reagent_containers/glass/G in beakers) + var/textcount = thtotext(++count) + for(var/datum/reagent/R in G.reagents.reagent_list) + . += "[R.volume] units of [R.name] in the [textcount] beaker." + if(beakers.len == 1) + . += "You detect no second beaker in the grenade." + else + . += "You scan the grenade, but detect nothing." + + +/obj/item/grenade/chem_grenade/attack_self(mob/user) + if(stage == READY && !active) + if(nadeassembly) + nadeassembly.attack_self(user) + else + ..() + + +/obj/item/grenade/chem_grenade/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/screwdriver)) + if(stage == WIRED) + if(beakers.len) + stage_change(READY) + to_chat(user, "You lock the [initial(name)] assembly.") + I.play_tool_sound(src, 25) + else + to_chat(user, "You need to add at least one beaker before locking the [initial(name)] assembly!") + else if(stage == READY && !nadeassembly) + det_time = det_time == 50 ? 30 : 50 //toggle between 30 and 50 + to_chat(user, "You modify the time delay. It's set for [DisplayTimeText(det_time)].") + else if(stage == EMPTY) + to_chat(user, "You need to add an activation mechanism!") + + else if(stage == WIRED && is_type_in_list(I, allowed_containers)) + . = 1 //no afterattack + if(beakers.len == 2) + to_chat(user, "[src] can not hold more containers!") + return + else + if(I.reagents.total_volume) + if(!user.transferItemToLoc(I, src)) + return + to_chat(user, "You add [I] to the [initial(name)] assembly.") + beakers += I + var/reagent_list = pretty_string_from_reagent_list(I.reagents) + user.log_message("inserted [I] ([reagent_list]) into [src]",LOG_GAME) + else + to_chat(user, "[I] is empty!") + + else if(stage == EMPTY && istype(I, /obj/item/assembly_holder)) + . = 1 // no afterattack + var/obj/item/assembly_holder/A = I + if(isigniter(A.a_left) == isigniter(A.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it + return + if(!user.transferItemToLoc(I, src)) + return + + nadeassembly = A + A.master = src + assemblyattacher = user.ckey + + stage_change(WIRED) + to_chat(user, "You add [A] to the [initial(name)] assembly.") + + else if(stage == EMPTY && istype(I, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/C = I + if (C.use(1)) + det_time = 50 // In case the cable_coil was removed and readded. + stage_change(WIRED) + to_chat(user, "You rig the [initial(name)] assembly.") + else + to_chat(user, "You need one length of coil to wire the assembly!") + return + + else if(stage == READY && istype(I, /obj/item/wirecutters) && !active) + stage_change(WIRED) + to_chat(user, "You unlock the [initial(name)] assembly.") + + else if(stage == WIRED && istype(I, /obj/item/wrench)) + if(beakers.len) + for(var/obj/O in beakers) + O.forceMove(drop_location()) + if(!O.reagents) + continue + var/reagent_list = pretty_string_from_reagent_list(O.reagents) + user.log_message("removed [O] ([reagent_list]) from [src]", LOG_GAME) + beakers = list() + to_chat(user, "You open the [initial(name)] assembly and remove the payload.") + return // First use of the wrench remove beakers, then use the wrench to remove the activation mechanism. + if(nadeassembly) + nadeassembly.forceMove(drop_location()) + nadeassembly.master = null + nadeassembly = null + else // If "nadeassembly = null && stage == WIRED", then it most have been cable_coil that was used. + new /obj/item/stack/cable_coil(get_turf(src),1) + stage_change(EMPTY) + to_chat(user, "You remove the activation mechanism from the [initial(name)] assembly.") + else + return ..() + +/obj/item/grenade/chem_grenade/proc/stage_change(N) + if(N) + stage = N + if(stage == EMPTY) + name = "[initial(name)] casing" + desc = "A do it yourself [initial(name)]! [initial(casedesc)]" + icon_state = initial(icon_state) + else if(stage == WIRED) + name = "unsecured [initial(name)]" + desc = "An unsecured [initial(name)] assembly." + icon_state = "[initial(icon_state)]_ass" + else if(stage == READY) + name = initial(name) + desc = initial(desc) + icon_state = "[initial(icon_state)]_locked" + + +//assembly stuff +/obj/item/grenade/chem_grenade/receive_signal() + prime() + + +/obj/item/grenade/chem_grenade/Crossed(atom/movable/AM) + if(nadeassembly) + nadeassembly.Crossed(AM) + +/obj/item/grenade/chem_grenade/on_found(mob/finder) + if(nadeassembly) + nadeassembly.on_found(finder) + +/obj/item/grenade/chem_grenade/log_grenade(mob/user, turf/T) + ..() + var/reagent_string = "" + var/beaker_number = 1 + for(var/obj/exploded_beaker in beakers) + if(!exploded_beaker.reagents) + continue + reagent_string += "[exploded_beaker] [beaker_number++] : " + pretty_string_from_reagent_list(exploded_beaker.reagents.reagent_list) + ";" + var/message = "[src] primed by [user] at [ADMIN_VERBOSEJMP(T)] contained [reagent_string]." + GLOB.bombers += message + message_admins(message) + user.log_message("primed [src] ([reagent_string])",LOG_GAME) + +/obj/item/grenade/chem_grenade/prime() + if(stage != READY) + return + + var/list/datum/reagents/reactants = list() + for(var/obj/item/reagent_containers/glass/G in beakers) + reactants += G.reagents + + var/turf/detonation_turf = get_turf(src) + + if(!chem_splash(detonation_turf, affected_area, reactants, ignition_temp, threatscale) && !no_splash) + playsound(src, 'sound/items/screwdriver2.ogg', 50, 1) + if(beakers.len) + for(var/obj/O in beakers) + O.forceMove(drop_location()) + beakers = list() + stage_change(EMPTY) + return + + if(nadeassembly) + var/mob/M = get_mob_by_ckey(assemblyattacher) + var/mob/last = get_mob_by_ckey(nadeassembly.fingerprintslast) + message_admins("grenade primed by an assembly, attached by [ADMIN_LOOKUPFLW(M)] and last touched by [ADMIN_LOOKUPFLW(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name]) at [ADMIN_VERBOSEJMP(detonation_turf)].") + log_game("grenade primed by an assembly, attached by [key_name(M)] and last touched by [key_name(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name]) at [AREACOORD(detonation_turf)]") + + log_game("A grenade detonated at [AREACOORD(detonation_turf)]") + + update_mob() + + qdel(src) + +//Large chem grenades accept slime cores and use the appropriately. +/obj/item/grenade/chem_grenade/large + name = "large grenade" + desc = "A custom made large grenade. Larger splash range and increased ignition temperature compared to basic grenades. Fits exotic containers." + casedesc = "This casing affects a larger area than the basic model and can fit exotic containers, including slime cores. Heats contents by 25°K upon ignition." + icon_state = "large_grenade" + allowed_containers = list(/obj/item/reagent_containers/glass, /obj/item/reagent_containers/food/condiment, /obj/item/reagent_containers/food/drinks) + affected_area = 5 + ignition_temp = 25 // Large grenades are slightly more effective at setting off heat-sensitive mixtures than smaller grenades. + threatscale = 1.1 // 10% more effective. + +/obj/item/grenade/chem_grenade/large/prime() + if(stage != READY) + return + + for(var/obj/item/slime_extract/S in beakers) + if(S.Uses) + for(var/obj/item/reagent_containers/glass/G in beakers) + G.reagents.trans_to(S, G.reagents.total_volume) + + //If there is still a core (sometimes it's used up) + //and there are reagents left, behave normally, + //otherwise drop it on the ground for timed reactions like gold. + + if(S) + if(S.reagents && S.reagents.total_volume) + for(var/obj/item/reagent_containers/glass/G in beakers) + S.reagents.trans_to(G, S.reagents.total_volume) + else + S.forceMove(get_turf(src)) + no_splash = TRUE + ..() + + //I tried to just put it in the allowed_containers list but + //if you do that it must have reagents. If you're going to + //make a special case you might as well do it explicitly. -Sayu +/obj/item/grenade/chem_grenade/large/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/slime_extract) && stage == WIRED) + if(!user.transferItemToLoc(I, src)) + return + to_chat(user, "You add [I] to the [initial(name)] assembly.") + beakers += I + else + return ..() + +/obj/item/grenade/chem_grenade/cryo // Intended for rare cryogenic mixes. Cools the area moderately upon detonation. + name = "cryo grenade" + desc = "A custom made cryogenic grenade. Rapidly cools contents upon ignition." + casedesc = "Upon ignition, it rapidly cools contents by 100°K. Smaller splash range than regular casings." + icon_state = "cryog" + affected_area = 2 + ignition_temp = -100 + +/obj/item/grenade/chem_grenade/pyro // Intended for pyrotechnical mixes. Produces a small fire upon detonation, igniting potentially flammable mixtures. + name = "pyro grenade" + desc = "A custom made pyrotechnical grenade. Heats up contents upon ignition." + casedesc = "Upon ignition, it rapidly heats contents by 500°K." + icon_state = "pyrog" + ignition_temp = 500 // This is enough to expose a hotspot. + +/obj/item/grenade/chem_grenade/adv_release // Intended for weaker, but longer lasting effects. Could have some interesting uses. + name = "advanced release grenade" + desc = "A custom made advanced release grenade. It is able to be detonated more than once. Can be configured using a multitool." + casedesc = "This casing is able to detonate more than once. Can be configured using a multitool." + icon_state = "timeg" + var/unit_spread = 10 // Amount of units per repeat. Can be altered with a multitool. + +/obj/item/grenade/chem_grenade/adv_release/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/multitool)) + switch(unit_spread) + if(0 to 24) + unit_spread += 5 + if(25 to 99) + unit_spread += 25 + else + unit_spread = 5 + to_chat(user, " You set the time release to [unit_spread] units per detonation.") + return + ..() + +/obj/item/grenade/chem_grenade/adv_release/prime() + if(stage != READY) + return + + var/total_volume = 0 + for(var/obj/item/reagent_containers/RC in beakers) + total_volume += RC.reagents.total_volume + if(!total_volume) + qdel(src) + qdel(nadeassembly) + return + var/fraction = unit_spread/total_volume + var/datum/reagents/reactants = new(unit_spread) + reactants.my_atom = src + for(var/obj/item/reagent_containers/RC in beakers) + RC.reagents.trans_to(reactants, RC.reagents.total_volume*fraction, threatscale, 1, 1) + chem_splash(get_turf(src), affected_area, list(reactants), ignition_temp, threatscale) + + var/turf/DT = get_turf(src) + if(nadeassembly) + var/mob/M = get_mob_by_ckey(assemblyattacher) + var/mob/last = get_mob_by_ckey(nadeassembly.fingerprintslast) + message_admins("grenade primed by an assembly at [AREACOORD(DT)], attached by [ADMIN_LOOKUPFLW(M)] and last touched by [ADMIN_LOOKUPFLW(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name]).") + log_game("grenade primed by an assembly at [AREACOORD(DT)], attached by [key_name(M)] and last touched by [key_name(last)] ([nadeassembly.a_left.name] and [nadeassembly.a_right.name])") + else + addtimer(CALLBACK(src, .proc/prime), det_time) + log_game("A grenade detonated at [AREACOORD(DT)]") + + + + + +////////////////////////////// +////// PREMADE GRENADES ////// +////////////////////////////// + +/obj/item/grenade/chem_grenade/metalfoam + name = "metal foam grenade" + desc = "Used for emergency sealing of hull breaches." + stage = READY + +/obj/item/grenade/chem_grenade/metalfoam/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/aluminium, 30) + B2.reagents.add_reagent(/datum/reagent/foaming_agent, 10) + B2.reagents.add_reagent(/datum/reagent/toxin/acid/fluacid, 10) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/smart_metal_foam + name = "smart metal foam grenade" + desc = "Used for emergency sealing of hull breaches, while keeping areas accessible." + stage = READY + +/obj/item/grenade/chem_grenade/smart_metal_foam/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/aluminium, 75) + B2.reagents.add_reagent(/datum/reagent/smart_foaming_agent, 25) + B2.reagents.add_reagent(/datum/reagent/toxin/acid/fluacid, 25) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/incendiary + name = "incendiary grenade" + desc = "Used for clearing rooms of living things." + stage = READY + +/obj/item/grenade/chem_grenade/incendiary/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/phosphorus, 25) + B2.reagents.add_reagent(/datum/reagent/stable_plasma, 25) + B2.reagents.add_reagent(/datum/reagent/toxin/acid, 25) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/antiweed + name = "weedkiller grenade" + desc = "Used for purging large areas of invasive plant species. Contents under pressure. Do not directly inhale contents." + stage = READY + +/obj/item/grenade/chem_grenade/antiweed/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/toxin/plantbgone, 25) + B1.reagents.add_reagent(/datum/reagent/potassium, 25) + B2.reagents.add_reagent(/datum/reagent/phosphorus, 25) + B2.reagents.add_reagent(/datum/reagent/consumable/sugar, 25) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/cleaner + name = "cleaner grenade" + desc = "BLAM!-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas." + stage = READY + +/obj/item/grenade/chem_grenade/cleaner/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/plastic/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/plastic/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/fluorosurfactant, 40) + B2.reagents.add_reagent(/datum/reagent/water, 40) + B2.reagents.add_reagent(/datum/reagent/space_cleaner, 10) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/ez_clean + name = "cleaner grenade" + desc = "Waffle Co.-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas." + stage = READY + +/obj/item/grenade/chem_grenade/ez_clean/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/plastic/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/plastic/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/fluorosurfactant, 40) + B2.reagents.add_reagent(/datum/reagent/water, 40) + B2.reagents.add_reagent(/datum/reagent/space_cleaner/ez_clean, 60) //ensures a t h i c c distribution + + beakers += B1 + beakers += B2 + + + +/obj/item/grenade/chem_grenade/teargas + name = "teargas grenade" + desc = "Used for nonlethal riot control. Contents under pressure. Do not directly inhale contents." + stage = READY + +/obj/item/grenade/chem_grenade/teargas/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/large/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/consumable/condensedcapsaicin, 60) + B1.reagents.add_reagent(/datum/reagent/potassium, 40) + B2.reagents.add_reagent(/datum/reagent/phosphorus, 40) + B2.reagents.add_reagent(/datum/reagent/consumable/sugar, 40) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/facid + name = "acid grenade" + desc = "Used for melting armoured opponents." + stage = READY + +/obj/item/grenade/chem_grenade/facid/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/toxin/acid/fluacid, 290) + B1.reagents.add_reagent(/datum/reagent/potassium, 10) + B2.reagents.add_reagent(/datum/reagent/phosphorus, 10) + B2.reagents.add_reagent(/datum/reagent/consumable/sugar, 10) + B2.reagents.add_reagent(/datum/reagent/toxin/acid/fluacid, 280) + + beakers += B1 + beakers += B2 + + +/obj/item/grenade/chem_grenade/colorful + name = "colorful grenade" + desc = "Used for wide scale painting projects." + stage = READY + +/obj/item/grenade/chem_grenade/colorful/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/colorful_reagent, 25) + B1.reagents.add_reagent(/datum/reagent/potassium, 25) + B2.reagents.add_reagent(/datum/reagent/phosphorus, 25) + B2.reagents.add_reagent(/datum/reagent/consumable/sugar, 25) + + beakers += B1 + beakers += B2 + +/obj/item/grenade/chem_grenade/glitter + name = "generic glitter grenade" + desc = "You shouldn't see this description." + stage = READY + var/glitter_type = /datum/reagent/glitter + +/obj/item/grenade/chem_grenade/glitter/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/B2 = new(src) + + B1.reagents.add_reagent(glitter_type, 25) + B1.reagents.add_reagent(/datum/reagent/potassium, 25) + B2.reagents.add_reagent(/datum/reagent/phosphorus, 25) + B2.reagents.add_reagent(/datum/reagent/consumable/sugar, 25) + + beakers += B1 + beakers += B2 + +/obj/item/grenade/chem_grenade/glitter/pink + name = "pink glitter bomb" + desc = "For that HOT glittery look." + glitter_type = /datum/reagent/glitter/pink + +/obj/item/grenade/chem_grenade/glitter/blue + name = "blue glitter bomb" + desc = "For that COOL glittery look." + glitter_type = /datum/reagent/glitter/blue + +/obj/item/grenade/chem_grenade/glitter/white + name = "white glitter bomb" + desc = "For that somnolent glittery look." + glitter_type = /datum/reagent/glitter/white + +/obj/item/grenade/chem_grenade/clf3 + name = "clf3 grenade" + desc = "BURN!-brand foaming clf3. In a special applicator for rapid purging of wide areas." + stage = READY + +/obj/item/grenade/chem_grenade/clf3/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/fluorosurfactant, 250) + B1.reagents.add_reagent(/datum/reagent/clf3, 50) + B2.reagents.add_reagent(/datum/reagent/water, 250) + B2.reagents.add_reagent(/datum/reagent/clf3, 50) + + beakers += B1 + beakers += B2 + +/obj/item/grenade/chem_grenade/bioterrorfoam + name = "Bio terror foam grenade" + desc = "Tiger Cooperative chemical foam grenade. Causes temporary irration, blindness, confusion, mutism, and mutations to carbon based life forms. Contains additional spore toxin." + stage = READY + +/obj/item/grenade/chem_grenade/bioterrorfoam/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/cryptobiolin, 75) + B1.reagents.add_reagent(/datum/reagent/water, 50) + B1.reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 50) + B1.reagents.add_reagent(/datum/reagent/toxin/spore, 75) + B1.reagents.add_reagent(/datum/reagent/toxin/itching_powder, 50) + B2.reagents.add_reagent(/datum/reagent/fluorosurfactant, 150) + B2.reagents.add_reagent(/datum/reagent/toxin/mutagen, 150) + beakers += B1 + beakers += B2 + +/obj/item/grenade/chem_grenade/tuberculosis + name = "Fungal tuberculosis grenade" + desc = "WARNING: GRENADE WILL RELEASE DEADLY SPORES CONTAINING ACTIVE AGENTS. SEAL SUIT AND AIRFLOW BEFORE USE." + stage = READY + +/obj/item/grenade/chem_grenade/tuberculosis/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/bluespace/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/bluespace/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/potassium, 50) + B1.reagents.add_reagent(/datum/reagent/phosphorus, 50) + B1.reagents.add_reagent(/datum/reagent/fungalspores, 200) + B2.reagents.add_reagent(/datum/reagent/blood, 250) + B2.reagents.add_reagent(/datum/reagent/consumable/sugar, 50) + + beakers += B1 + beakers += B2 + +/obj/item/grenade/chem_grenade/holy + name = "holy hand grenade" + desc = "A vessel of concentrated religious might." + icon_state = "holy_grenade" + stage = READY + +/obj/item/grenade/chem_grenade/holy/Initialize() + . = ..() + var/obj/item/reagent_containers/glass/beaker/large/B1 = new(src) + var/obj/item/reagent_containers/glass/beaker/large/B2 = new(src) + + B1.reagents.add_reagent(/datum/reagent/potassium, 100) + B2.reagents.add_reagent(/datum/reagent/water/holywater, 100) + + beakers += B1 + beakers += B2 + +#undef READY +#undef WIRED +#undef EMPTY diff --git a/code/game/objects/items/grenades/clusterbuster.dm b/code/game/objects/items/grenades/clusterbuster.dm index 923361de..c16b4a30 100644 --- a/code/game/objects/items/grenades/clusterbuster.dm +++ b/code/game/objects/items/grenades/clusterbuster.dm @@ -94,11 +94,11 @@ var/chem = pick(slime_chems) var/amount = 5 if(chem == "lesser plasma") //In the rare case we get another rainbow. - chem = "plasma" + chem = /datum/reagent/toxin/plasma amount = 4 if(chem == "holy water and uranium") - chem = "uranium" - reagents.add_reagent("holywater") + chem = /datum/reagent/uranium + reagents.add_reagent(/datum/reagent/water/holywater) reagents.add_reagent(chem,amount) /obj/effect/payload_spawner/random_slime/spawn_payload(type, numspawned) diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm index d74a611f..16ac2ad6 100644 --- a/code/game/objects/items/hot_potato.dm +++ b/code/game/objects/items/hot_potato.dm @@ -1,171 +1,171 @@ -//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY! -/obj/item/hot_potato - name = "hot potato" - desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" You can attack anyone with it to force it on them instead of yourself!" - icon = 'icons/obj/hydroponics/harvest.dmi' - icon_state = "potato" - item_flags = NOBLUDGEON - force = 0 - var/icon_off = "potato" - var/icon_on = "potato_active" - var/detonation_timerid - var/activation_time = 0 - var/timer = 600 //deciseconds - var/show_timer = FALSE - var/reusable = FALSE //absolute madman - var/sticky = TRUE - var/forceful_attachment = TRUE - var/stimulant = TRUE - var/detonate_explosion = TRUE - var/detonate_dev_range = 0 - var/detonate_heavy_range = 0 - var/detonate_light_range = 2 - var/detonate_flash_range = 5 - var/detonate_fire_range = 5 - - var/active = FALSE - - var/color_val = FALSE - - var/datum/weakref/current - -/obj/item/hot_potato/Destroy() - if(active) - deactivate() - return ..() - -/obj/item/hot_potato/proc/colorize(mob/target) - //Clear color from old target - if(current) - var/mob/M = current.resolve() - if(istype(M)) - M.remove_atom_colour(FIXED_COLOUR_PRIORITY) - //Give to new target - current = null - //Swap colors - color_val = !color_val - if(istype(target)) - current = WEAKREF(target) - target.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY) - -/obj/item/hot_potato/proc/detonate() - var/atom/location = loc - location.visible_message("[src] [detonate_explosion? "explodes" : "activates"]!", "[src] activates! You've ran out of time!") - if(detonate_explosion) - explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range) - deactivate() - if(!reusable) - var/mob/M = loc - if(istype(M)) - M.dropItemToGround(src, TRUE) - qdel(src) - -/obj/item/hot_potato/attack_self(mob/user) - if(activate(timer, user)) - user.visible_message("[user] squeezes [src], which promptly starts to flash red-hot colors!", "You squeeze [src], activating its countdown and attachment mechanism!", - "You hear a mechanical click and a loud beeping!") - return - return ..() - -/obj/item/hot_potato/process() - if(stimulant) - if(isliving(loc)) - var/mob/living/L = loc - L.SetStun(0) - L.SetKnockdown(0) - L.SetSleeping(0) - L.SetUnconscious(0) - L.reagents.add_reagent("muscle_stimulant", CLAMP(5 - L.reagents.get_reagent_amount("muscle_stimulant"), 0, 5)) //If you don't have legs or get bola'd, tough luck! - colorize(L) - -/obj/item/hot_potato/examine(mob/user) - . = ..() - if(active) - . += "[src] is flashing red-hot! You should probably get rid of it!" - if(show_timer) - . += "[src]'s timer looks to be at [DisplayTimeText(activation_time - world.time)]!" - -/obj/item/hot_potato/equipped(mob/user) - . = ..() - if(active) - to_chat(user, "You have a really bad feeling about [src]!") - -/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params) - . = ..() - if(!adjacent || !ismob(target)) - return - force_onto(target, user) - -/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user) - if(!istype(victim) || user != loc || victim == user) - return FALSE - if(!victim.client) - to_chat(user, "[src] refuses to attach to a non-sapient creature!") - if(victim.stat != CONSCIOUS || !victim.get_num_legs()) - to_chat(user, "[src] refuses to attach to someone incapable of using it!") - user.temporarilyRemoveItemFromInventory(src, TRUE) - . = FALSE - if(!victim.put_in_hands(src)) - if(forceful_attachment) - victim.dropItemToGround(victim.get_inactive_held_item()) - if(!victim.put_in_hands(src)) - victim.dropItemToGround(victim.get_active_held_item()) - if(victim.put_in_hands(src)) - . = TRUE - else - . = TRUE - else - . = TRUE - if(.) - log_combat(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") - user.visible_message("[user] forces [src] onto [victim]!", "You force [src] onto [victim]!", "You hear a mechanical click and a beep.") - colorize(null) - else - log_combat(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") - user.visible_message("[user] tried to force [src] onto [victim], but it could not attach!", "You try to force [src] onto [victim], but it is unable to attach!", "You hear a mechanical click and two buzzes.") - user.put_in_hands(src) - -/obj/item/hot_potato/dropped(mob/user) - . = ..() - colorize(null) - -/obj/item/hot_potato/proc/activate(delay, mob/user) - if(active) - return - update_icon() - if(sticky) - ADD_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT) - name = "primed [name]" - activation_time = timer + world.time - detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE) - START_PROCESSING(SSfastprocess, src) - var/turf/T = get_turf(src) - message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [ADMIN_VERBOSEJMP(T)]") - log_game("[user ? "[key_name(user)] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [AREACOORD(T)]") - active = TRUE - -/obj/item/hot_potato/proc/deactivate() - update_icon() - name = initial(name) - REMOVE_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT) - deltimer(detonation_timerid) - STOP_PROCESSING(SSfastprocess, src) - detonation_timerid = null - colorize(null) - active = FALSE - -/obj/item/hot_potato/update_icon() - icon_state = active? icon_on : icon_off - -/obj/item/hot_potato/syndicate - detonate_light_range = 4 - detonate_fire_range = 5 - -/obj/item/hot_potato/harmless - detonate_explosion = FALSE - -/obj/item/hot_potato/harmless/toy - desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" You can attack anyone with it to put it on them instead, if they have a free hand to take it!" - sticky = FALSE - reusable = TRUE - forceful_attachment = FALSE +//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY! +/obj/item/hot_potato + name = "hot potato" + desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" You can attack anyone with it to force it on them instead of yourself!" + icon = 'icons/obj/hydroponics/harvest.dmi' + icon_state = "potato" + item_flags = NOBLUDGEON + force = 0 + var/icon_off = "potato" + var/icon_on = "potato_active" + var/detonation_timerid + var/activation_time = 0 + var/timer = 600 //deciseconds + var/show_timer = FALSE + var/reusable = FALSE //absolute madman + var/sticky = TRUE + var/forceful_attachment = TRUE + var/stimulant = TRUE + var/detonate_explosion = TRUE + var/detonate_dev_range = 0 + var/detonate_heavy_range = 0 + var/detonate_light_range = 2 + var/detonate_flash_range = 5 + var/detonate_fire_range = 5 + + var/active = FALSE + + var/color_val = FALSE + + var/datum/weakref/current + +/obj/item/hot_potato/Destroy() + if(active) + deactivate() + return ..() + +/obj/item/hot_potato/proc/colorize(mob/target) + //Clear color from old target + if(current) + var/mob/M = current.resolve() + if(istype(M)) + M.remove_atom_colour(FIXED_COLOUR_PRIORITY) + //Give to new target + current = null + //Swap colors + color_val = !color_val + if(istype(target)) + current = WEAKREF(target) + target.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY) + +/obj/item/hot_potato/proc/detonate() + var/atom/location = loc + location.visible_message("[src] [detonate_explosion? "explodes" : "activates"]!", "[src] activates! You've ran out of time!") + if(detonate_explosion) + explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range) + deactivate() + if(!reusable) + var/mob/M = loc + if(istype(M)) + M.dropItemToGround(src, TRUE) + qdel(src) + +/obj/item/hot_potato/attack_self(mob/user) + if(activate(timer, user)) + user.visible_message("[user] squeezes [src], which promptly starts to flash red-hot colors!", "You squeeze [src], activating its countdown and attachment mechanism!", + "You hear a mechanical click and a loud beeping!") + return + return ..() + +/obj/item/hot_potato/process() + if(stimulant) + if(isliving(loc)) + var/mob/living/L = loc + L.SetStun(0) + L.SetKnockdown(0) + L.SetSleeping(0) + L.SetUnconscious(0) + L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck! + colorize(L) + +/obj/item/hot_potato/examine(mob/user) + . = ..() + if(active) + . += "[src] is flashing red-hot! You should probably get rid of it!" + if(show_timer) + . += "[src]'s timer looks to be at [DisplayTimeText(activation_time - world.time)]!" + +/obj/item/hot_potato/equipped(mob/user) + . = ..() + if(active) + to_chat(user, "You have a really bad feeling about [src]!") + +/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params) + . = ..() + if(!adjacent || !ismob(target)) + return + force_onto(target, user) + +/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user) + if(!istype(victim) || user != loc || victim == user) + return FALSE + if(!victim.client) + to_chat(user, "[src] refuses to attach to a non-sapient creature!") + if(victim.stat != CONSCIOUS || !victim.get_num_legs()) + to_chat(user, "[src] refuses to attach to someone incapable of using it!") + user.temporarilyRemoveItemFromInventory(src, TRUE) + . = FALSE + if(!victim.put_in_hands(src)) + if(forceful_attachment) + victim.dropItemToGround(victim.get_inactive_held_item()) + if(!victim.put_in_hands(src)) + victim.dropItemToGround(victim.get_active_held_item()) + if(victim.put_in_hands(src)) + . = TRUE + else + . = TRUE + else + . = TRUE + if(.) + log_combat(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") + user.visible_message("[user] forces [src] onto [victim]!", "You force [src] onto [victim]!", "You hear a mechanical click and a beep.") + colorize(null) + else + log_combat(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") + user.visible_message("[user] tried to force [src] onto [victim], but it could not attach!", "You try to force [src] onto [victim], but it is unable to attach!", "You hear a mechanical click and two buzzes.") + user.put_in_hands(src) + +/obj/item/hot_potato/dropped(mob/user) + . = ..() + colorize(null) + +/obj/item/hot_potato/proc/activate(delay, mob/user) + if(active) + return + update_icon() + if(sticky) + ADD_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT) + name = "primed [name]" + activation_time = timer + world.time + detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE) + START_PROCESSING(SSfastprocess, src) + var/turf/T = get_turf(src) + message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [ADMIN_VERBOSEJMP(T)]") + log_game("[user ? "[key_name(user)] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [AREACOORD(T)]") + active = TRUE + +/obj/item/hot_potato/proc/deactivate() + update_icon() + name = initial(name) + REMOVE_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT) + deltimer(detonation_timerid) + STOP_PROCESSING(SSfastprocess, src) + detonation_timerid = null + colorize(null) + active = FALSE + +/obj/item/hot_potato/update_icon() + icon_state = active? icon_on : icon_off + +/obj/item/hot_potato/syndicate + detonate_light_range = 4 + detonate_fire_range = 5 + +/obj/item/hot_potato/harmless + detonate_explosion = FALSE + +/obj/item/hot_potato/harmless/toy + desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" You can attack anyone with it to put it on them instead, if they have a free hand to take it!" + sticky = FALSE + reusable = TRUE + forceful_attachment = FALSE diff --git a/code/game/objects/items/implants/implant_misc.dm b/code/game/objects/items/implants/implant_misc.dm index 75b0c677..6cdc5ee8 100644 --- a/code/game/objects/items/implants/implant_misc.dm +++ b/code/game/objects/items/implants/implant_misc.dm @@ -33,7 +33,7 @@ /obj/item/implant/adrenalin/activate() . = ..() uses-- - imp_in.do_adrenaline(150, TRUE, 0, 0, TRUE, list("inaprovaline" = 3, "synaptizine" = 10, "regen_jelly" = 10, "stimulants" = 10), "You feel a sudden surge of energy!") + imp_in.do_adrenaline(150, TRUE, 0, 0, TRUE, list(/datum/reagent/medicine/inaprovaline = 3, /datum/reagent/medicine/synaptizine = 10, /datum/reagent/medicine/regen_jelly = 10, /datum/reagent/medicine/stimulants = 10), "You feel a sudden surge of energy!") to_chat(imp_in, "You feel a sudden surge of energy!") if(!uses) qdel(src) diff --git a/code/game/objects/items/kitchen.dm b/code/game/objects/items/kitchen.dm index a1ee1d1d..b1662c12 100644 --- a/code/game/objects/items/kitchen.dm +++ b/code/game/objects/items/kitchen.dm @@ -1,236 +1,236 @@ -/* Kitchen tools - * Contains: - * Fork - * Kitchen knives - * Ritual Knife - * Butcher's cleaver - * Combat Knife - * Rolling Pins - */ - -/obj/item/kitchen - icon = 'icons/obj/kitchen.dmi' - lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' - -/obj/item/kitchen/fork - name = "fork" - desc = "Pointy." - icon_state = "fork" - force = 5 - w_class = WEIGHT_CLASS_TINY - grind_results = list(/datum/reagent/iron = 3, /datum/reagent/silver = 3) - throwforce = 0 - throw_speed = 3 - throw_range = 5 - materials = list(MAT_METAL=80) - flags_1 = CONDUCT_1 - attack_verb = list("attacked", "stabbed", "poked") - hitsound = 'sound/weapons/bladeslice.ogg' - armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30) - var/datum/reagent/forkload //used to eat omelette - -/obj/item/kitchen/fork/suicide_act(mob/living/carbon/user) - user.visible_message("[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!") - playsound(src, 'sound/items/eatfood.ogg', 50, 1) - return BRUTELOSS - -/obj/item/kitchen/fork/attack(mob/living/carbon/M, mob/living/carbon/user) - if(!istype(M)) - return ..() - - if(forkload) - if(M == user) - M.visible_message("[user] eats a delicious forkful of omelette!") - M.reagents.add_reagent(forkload.id, 1) - else - M.visible_message("[user] feeds [M] a delicious forkful of omelette!") - M.reagents.add_reagent(forkload.id, 1) - icon_state = "fork" - forkload = null - - else if(user.zone_selected == BODY_ZONE_PRECISE_EYES) - return eyestab(M,user) - else - return ..() - -/obj/item/kitchen/fork/plastic - name = "plastic fork" - desc = "Really takes you back to highschool lunch." - icon_state = "plastic_fork" - force = 0 - w_class = WEIGHT_CLASS_TINY - throwforce = 0 - grind_results = list(/datum/material/plastic=80) - var/break_chance = 25 - -/obj/item/kitchen/fork/plastic/afterattack(mob/living/carbon/user) - .=..() - if(prob(break_chance)) - user.visible_message("[user]'s fork snaps into tiny pieces in their hand.") - qdel(src) - -/obj/item/kitchen/knife - name = "kitchen knife" - icon_state = "knife" - desc = "A general purpose Chef's Knife made by SpaceCook Incorporated. Guaranteed to stay sharp for years to come." - grind_results = list(/datum/reagent/iron = 3, /datum/reagent/silver = 3) - flags_1 = CONDUCT_1 - force = 10 - w_class = WEIGHT_CLASS_SMALL - throwforce = 10 - hitsound = 'sound/weapons/bladeslice.ogg' - throw_speed = 3 - throw_range = 6 - materials = list(MAT_METAL=12000) - attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - sharpness = IS_SHARP_ACCURATE - armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) - var/bayonet = FALSE //Can this be attached to a gun? - -/obj/item/kitchen/knife/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force - -/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user) - if(user.zone_selected == BODY_ZONE_PRECISE_EYES) - return eyestab(M,user) - else - return ..() - -/obj/item/kitchen/knife/suicide_act(mob/user) - user.visible_message(pick("[user] is slitting [user.p_their()] wrists with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.", \ - "[user] is slitting [user.p_their()] throat with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.", \ - "[user] is slitting [user.p_their()] stomach open with the [src.name]! It looks like [user.p_theyre()] trying to commit seppuku.")) - return (BRUTELOSS) - -/obj/item/kitchen/knife/plastic - name = "plastic knife" - icon_state = "plastic_knife" - item_state = "knife" - desc = "A very safe, barely sharp knife made of plastic. Good for cutting food and not much else." - force = 0 - w_class = WEIGHT_CLASS_TINY - throwforce = 0 - throw_range = 5 - grind_results = list(/datum/material/plastic = 100) - attack_verb = list("prodded", "whiffed","scratched", "poked") - sharpness = IS_SHARP - var/break_chance = 25 - -/obj/item/kitchen/knife/plastic/afterattack(mob/living/carbon/user) - .=..() - if(prob(break_chance)) - user.visible_message("[user]'s knife snaps into tiny pieces in their hand.") - qdel(src) - -/obj/item/kitchen/knife/ritual - name = "ritual knife" - desc = "The unearthly energies that once powered this blade are now dormant." - icon = 'icons/obj/wizard.dmi' - icon_state = "render" - item_state = "knife" - lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' - w_class = WEIGHT_CLASS_NORMAL - -/obj/item/kitchen/knife/butcher - name = "butcher's cleaver" - icon_state = "butch" - desc = "A huge thing used for chopping and chopping up meat. This includes clowns and clown by-products." - flags_1 = CONDUCT_1 - force = 15 - throwforce = 10 - materials = list(MAT_METAL=18000) - attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - w_class = WEIGHT_CLASS_NORMAL - -/obj/item/kitchen/knife/combat - name = "combat knife" - icon_state = "buckknife" - item_state = "knife" - desc = "A military combat utility survival knife." - force = 20 - throwforce = 20 - attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut") - bayonet = TRUE - -/obj/item/kitchen/knife/combat/survival - name = "survival knife" - icon_state = "survivalknife" - item_state = "knife" - desc = "A hunting grade survival knife." - force = 15 - throwforce = 15 - bayonet = TRUE - -/obj/item/kitchen/knife/combat/bone - name = "bone dagger" - item_state = "bone_dagger" - icon_state = "bone_dagger" - lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' - righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' - desc = "A sharpened bone. The bare minimum in survival." - force = 15 - throwforce = 15 - materials = list() - -/obj/item/kitchen/knife/combat/cyborg - name = "cyborg knife" - icon = 'icons/obj/items_cyborg.dmi' - icon_state = "knife" - desc = "A cyborg-mounted plasteel knife. Extremely sharp and durable." - -/obj/item/kitchen/knife/carrotshiv - name = "carrot shiv" - icon_state = "carrotshiv" - item_state = "carrotshiv" - lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' - righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' - desc = "Unlike other carrots, you should probably keep this far away from your eyes." - force = 8 - throwforce = 12//fuck git - materials = list() - attack_verb = list("shanked", "shivved") - armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0) - -/obj/item/kitchen/rollingpin - name = "rolling pin" - desc = "Used to knock out the Bartender." - icon_state = "rolling_pin" - force = 8 - throwforce = 5 - throw_speed = 3 - throw_range = 7 - w_class = WEIGHT_CLASS_NORMAL - attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") - -/obj/item/kitchen/rollingpin/suicide_act(mob/living/carbon/user) - user.visible_message("[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return BRUTELOSS -/* Trays moved to /obj/item/storage/bag */ - -/obj/item/kitchen/spoon/plastic - name = "plastic spoon" - desc = "Just be careful your food doesn't melt the spoon first." - icon_state = "plastic_spoon" - force = 0 - w_class = WEIGHT_CLASS_TINY - throwforce = 0 - grind_results = list(/datum/material/plastic=120) - var/break_chance = 25 - -/obj/item/kitchen/knife/plastic/afterattack(mob/living/carbon/user) - .=..() - if(prob(break_chance)) - user.visible_message("[user]'s spoon snaps into tiny pieces in their hand.") - qdel(src) - -/obj/item/kitchen/knife/scimitar - name = "Scimitar knife" - desc = "A knife used to cleanly butcher. Its razor-sharp edge has been honed for butchering, but has been poorly maintained over the years." - attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - -/obj/item/kitchen/knife/scimiar/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 90 - force, 100, force - 60) //bonus chance increases depending on force +/* Kitchen tools + * Contains: + * Fork + * Kitchen knives + * Ritual Knife + * Butcher's cleaver + * Combat Knife + * Rolling Pins + */ + +/obj/item/kitchen + icon = 'icons/obj/kitchen.dmi' + lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' + +/obj/item/kitchen/fork + name = "fork" + desc = "Pointy." + icon_state = "fork" + force = 5 + w_class = WEIGHT_CLASS_TINY + grind_results = list(/datum/reagent/iron = 3, /datum/reagent/silver = 3) + throwforce = 0 + throw_speed = 3 + throw_range = 5 + materials = list(MAT_METAL=80) + flags_1 = CONDUCT_1 + attack_verb = list("attacked", "stabbed", "poked") + hitsound = 'sound/weapons/bladeslice.ogg' + armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30) + var/datum/reagent/forkload //used to eat omelette + +/obj/item/kitchen/fork/suicide_act(mob/living/carbon/user) + user.visible_message("[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!") + playsound(src, 'sound/items/eatfood.ogg', 50, 1) + return BRUTELOSS + +/obj/item/kitchen/fork/attack(mob/living/carbon/M, mob/living/carbon/user) + if(!istype(M)) + return ..() + + if(forkload) + if(M == user) + M.visible_message("[user] eats a delicious forkful of omelette!") + M.reagents.add_reagent(forkload.type, 1) + else + M.visible_message("[user] feeds [M] a delicious forkful of omelette!") + M.reagents.add_reagent(forkload.type, 1) + icon_state = "fork" + forkload = null + + else if(user.zone_selected == BODY_ZONE_PRECISE_EYES) + return eyestab(M,user) + else + return ..() + +/obj/item/kitchen/fork/plastic + name = "plastic fork" + desc = "Really takes you back to highschool lunch." + icon_state = "plastic_fork" + force = 0 + w_class = WEIGHT_CLASS_TINY + throwforce = 0 + grind_results = list(/datum/material/plastic=80) + var/break_chance = 25 + +/obj/item/kitchen/fork/plastic/afterattack(mob/living/carbon/user) + .=..() + if(prob(break_chance)) + user.visible_message("[user]'s fork snaps into tiny pieces in their hand.") + qdel(src) + +/obj/item/kitchen/knife + name = "kitchen knife" + icon_state = "knife" + desc = "A general purpose Chef's Knife made by SpaceCook Incorporated. Guaranteed to stay sharp for years to come." + grind_results = list(/datum/reagent/iron = 3, /datum/reagent/silver = 3) + flags_1 = CONDUCT_1 + force = 10 + w_class = WEIGHT_CLASS_SMALL + throwforce = 10 + hitsound = 'sound/weapons/bladeslice.ogg' + throw_speed = 3 + throw_range = 6 + materials = list(MAT_METAL=12000) + attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + sharpness = IS_SHARP_ACCURATE + armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) + var/bayonet = FALSE //Can this be attached to a gun? + +/obj/item/kitchen/knife/Initialize() + . = ..() + AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force + +/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user) + if(user.zone_selected == BODY_ZONE_PRECISE_EYES) + return eyestab(M,user) + else + return ..() + +/obj/item/kitchen/knife/suicide_act(mob/user) + user.visible_message(pick("[user] is slitting [user.p_their()] wrists with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.", \ + "[user] is slitting [user.p_their()] throat with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.", \ + "[user] is slitting [user.p_their()] stomach open with the [src.name]! It looks like [user.p_theyre()] trying to commit seppuku.")) + return (BRUTELOSS) + +/obj/item/kitchen/knife/plastic + name = "plastic knife" + icon_state = "plastic_knife" + item_state = "knife" + desc = "A very safe, barely sharp knife made of plastic. Good for cutting food and not much else." + force = 0 + w_class = WEIGHT_CLASS_TINY + throwforce = 0 + throw_range = 5 + grind_results = list(/datum/material/plastic = 100) + attack_verb = list("prodded", "whiffed","scratched", "poked") + sharpness = IS_SHARP + var/break_chance = 25 + +/obj/item/kitchen/knife/plastic/afterattack(mob/living/carbon/user) + .=..() + if(prob(break_chance)) + user.visible_message("[user]'s knife snaps into tiny pieces in their hand.") + qdel(src) + +/obj/item/kitchen/knife/ritual + name = "ritual knife" + desc = "The unearthly energies that once powered this blade are now dormant." + icon = 'icons/obj/wizard.dmi' + icon_state = "render" + item_state = "knife" + lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' + w_class = WEIGHT_CLASS_NORMAL + +/obj/item/kitchen/knife/butcher + name = "butcher's cleaver" + icon_state = "butch" + desc = "A huge thing used for chopping and chopping up meat. This includes clowns and clown by-products." + flags_1 = CONDUCT_1 + force = 15 + throwforce = 10 + materials = list(MAT_METAL=18000) + attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + w_class = WEIGHT_CLASS_NORMAL + +/obj/item/kitchen/knife/combat + name = "combat knife" + icon_state = "buckknife" + item_state = "knife" + desc = "A military combat utility survival knife." + force = 20 + throwforce = 20 + attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut") + bayonet = TRUE + +/obj/item/kitchen/knife/combat/survival + name = "survival knife" + icon_state = "survivalknife" + item_state = "knife" + desc = "A hunting grade survival knife." + force = 15 + throwforce = 15 + bayonet = TRUE + +/obj/item/kitchen/knife/combat/bone + name = "bone dagger" + item_state = "bone_dagger" + icon_state = "bone_dagger" + lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' + desc = "A sharpened bone. The bare minimum in survival." + force = 15 + throwforce = 15 + materials = list() + +/obj/item/kitchen/knife/combat/cyborg + name = "cyborg knife" + icon = 'icons/obj/items_cyborg.dmi' + icon_state = "knife" + desc = "A cyborg-mounted plasteel knife. Extremely sharp and durable." + +/obj/item/kitchen/knife/carrotshiv + name = "carrot shiv" + icon_state = "carrotshiv" + item_state = "carrotshiv" + lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' + desc = "Unlike other carrots, you should probably keep this far away from your eyes." + force = 8 + throwforce = 12//fuck git + materials = list() + attack_verb = list("shanked", "shivved") + armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0) + +/obj/item/kitchen/rollingpin + name = "rolling pin" + desc = "Used to knock out the Bartender." + icon_state = "rolling_pin" + force = 8 + throwforce = 5 + throw_speed = 3 + throw_range = 7 + w_class = WEIGHT_CLASS_NORMAL + attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") + +/obj/item/kitchen/rollingpin/suicide_act(mob/living/carbon/user) + user.visible_message("[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return BRUTELOSS +/* Trays moved to /obj/item/storage/bag */ + +/obj/item/kitchen/spoon/plastic + name = "plastic spoon" + desc = "Just be careful your food doesn't melt the spoon first." + icon_state = "plastic_spoon" + force = 0 + w_class = WEIGHT_CLASS_TINY + throwforce = 0 + grind_results = list(/datum/material/plastic=120) + var/break_chance = 25 + +/obj/item/kitchen/knife/plastic/afterattack(mob/living/carbon/user) + .=..() + if(prob(break_chance)) + user.visible_message("[user]'s spoon snaps into tiny pieces in their hand.") + qdel(src) + +/obj/item/kitchen/knife/scimitar + name = "Scimitar knife" + desc = "A knife used to cleanly butcher. Its razor-sharp edge has been honed for butchering, but has been poorly maintained over the years." + attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + +/obj/item/kitchen/knife/scimiar/Initialize() + . = ..() + AddComponent(/datum/component/butchering, 90 - force, 100, force - 60) //bonus chance increases depending on force diff --git a/code/game/objects/items/mop.dm b/code/game/objects/items/mop.dm index 5d384a93..a8b28f25 100644 --- a/code/game/objects/items/mop.dm +++ b/code/game/objects/items/mop.dm @@ -25,7 +25,7 @@ /obj/item/mop/proc/clean(turf/A) - if(reagents.has_reagent("water", 1) || reagents.has_reagent("holywater", 1) || reagents.has_reagent("vodka", 1) || reagents.has_reagent("cleaner", 1)) + if(reagents.has_reagent(/datum/reagent/water, 1) || reagents.has_reagent(/datum/reagent/water/holywater, 1) || reagents.has_reagent(/datum/reagent/consumable/ethanol/vodka, 1) || reagents.has_reagent(/datum/reagent/space_cleaner, 1)) SEND_SIGNAL(A, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM) A.clean_blood() for(var/obj/effect/O in A) @@ -98,7 +98,7 @@ stamusage = 1 var/refill_enabled = TRUE //Self-refill toggle for when a janitor decides to mop with something other than water. var/refill_rate = 1 //Rate per process() tick mop refills itself - var/refill_reagent = "water" //Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING + var/refill_reagent = /datum/reagent/water //Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING /obj/item/mop/advanced/New() ..() diff --git a/code/game/objects/items/religion.dm b/code/game/objects/items/religion.dm index b792458f..47b766c5 100644 --- a/code/game/objects/items/religion.dm +++ b/code/game/objects/items/religion.dm @@ -98,7 +98,7 @@ /obj/item/banner/medical/special_inspiration(mob/living/carbon/human/H) H.adjustToxLoss(-15) H.setOxyLoss(0) - H.reagents.add_reagent("inaprovaline", 5) + H.reagents.add_reagent(/datum/reagent/medicine/inaprovaline, 5) /obj/item/banner/science name = "sciencia banner" diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 7fcd7eff..5e7081c1 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -1,692 +1,692 @@ -// robot_upgrades.dm -// Contains various borg upgrades. - -/obj/item/borg/upgrade - name = "borg upgrade module." - desc = "Protected by FRM." - icon = 'icons/obj/module.dmi' - icon_state = "cyborg_upgrade" - var/locked = FALSE - var/installed = 0 - var/require_module = 0 - var/module_type = null - // if true, is not stored in the robot to be ejected - // if module is reset - var/one_use = FALSE - -/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr) - if(R.stat == DEAD) - to_chat(user, "[src] will not function on a deceased cyborg.") - return FALSE - if(module_type && !istype(R.module, module_type)) - to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!") - to_chat(user, "There's no mounting point for the module!") - return FALSE - return TRUE - -/obj/item/borg/upgrade/proc/deactivate(mob/living/silicon/robot/R, user = usr) - if (!(src in R.upgrades)) - return FALSE - return TRUE - -/obj/item/borg/upgrade/rename - name = "cyborg reclassification board" - desc = "Used to rename a cyborg." - icon_state = "cyborg_upgrade1" - var/heldname = "" - one_use = TRUE - -/obj/item/borg/upgrade/rename/attack_self(mob/user) - heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN) - -/obj/item/borg/upgrade/rename/action(mob/living/silicon/robot/R) - . = ..() - if(.) - var/oldname = R.real_name - R.custom_name = heldname - R.updatename() - if(oldname == R.real_name) - R.notify_ai(RENAME, oldname, R.real_name) - -/obj/item/borg/upgrade/restart - name = "cyborg emergency reboot module" - desc = "Used to force a reboot of a disabled-but-repaired cyborg, bringing it back online." - icon_state = "cyborg_upgrade1" - one_use = TRUE - -/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R, user = usr) - if(R.health < 0) - to_chat(user, "You have to repair the cyborg before using this module!") - return FALSE - - if(R.mind) - R.mind.grab_ghost() - playsound(loc, 'sound/voice/liveagain.ogg', 75, 1) - - R.revive() - -/obj/item/borg/upgrade/vtec - name = "cyborg VTEC module" - desc = "Used to kick in a cyborg's VTEC systems, increasing their speed." - icon_state = "cyborg_upgrade2" - require_module = 1 - -/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - if(R.speed < 0) - to_chat(R, "A VTEC unit is already installed!") - to_chat(user, "There's no room for another VTEC unit!") - return FALSE - - //R.speed = -2 // Gotta go fast. - //Citadel change - makes vtecs give an ability rather than reducing the borg's speed instantly - R.AddAbility(new/obj/effect/proc_holder/silicon/cyborg/vtecControl) - -/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - R.speed = initial(R.speed) - -/obj/item/borg/upgrade/disablercooler - name = "cyborg rapid disabler cooling module" - desc = "Used to cool a mounted disabler, increasing the potential current in it and thus its recharge rate." - icon_state = "cyborg_upgrade3" - require_module = 1 - //module_type = /obj/item/robot_module/security - -/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules - if(!T) - to_chat(user, "There's no disabler in this unit!") - return FALSE - if(T.charge_delay <= 2) - to_chat(R, "A cooling unit is already installed!") - to_chat(user, "There's no room for another cooling unit!") - return FALSE - - T.charge_delay = max(2 , T.charge_delay - 4) - -/obj/item/borg/upgrade/disablercooler/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules - if(!T) - return FALSE - T.charge_delay = initial(T.charge_delay) - -/obj/item/borg/upgrade/thrusters - name = "ion thruster upgrade" - desc = "An energy-operated thruster system for cyborgs." - icon_state = "cyborg_upgrade3" - -/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - if(R.ionpulse) - to_chat(user, "This unit already has ion thrusters installed!") - return FALSE - - R.ionpulse = TRUE - -/obj/item/borg/upgrade/thrusters/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - R.ionpulse = FALSE - -/obj/item/borg/upgrade/ddrill - name = "mining cyborg diamond drill" - desc = "A diamond drill replacement for the mining module's standard drill." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/miner - -/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - for(var/obj/item/pickaxe/drill/cyborg/D in R.module) - R.module.remove_module(D, TRUE) - for(var/obj/item/shovel/S in R.module) - R.module.remove_module(S, TRUE) - - var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module) - R.module.basic_modules += DD - R.module.add_module(DD, FALSE, TRUE) - -/obj/item/borg/upgrade/ddrill/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - for(var/obj/item/pickaxe/drill/cyborg/diamond/DD in R.module) - R.module.remove_module(DD, TRUE) - - var/obj/item/pickaxe/drill/cyborg/D = new (R.module) - R.module.basic_modules += D - R.module.add_module(D, FALSE, TRUE) - var/obj/item/shovel/S = new (R.module) - R.module.basic_modules += S - R.module.add_module(S, FALSE, TRUE) - -/obj/item/borg/upgrade/soh - name = "mining cyborg satchel of holding" - desc = "A satchel of holding replacement for mining cyborg's ore satchel module." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/miner - -/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R) - . = ..() - if(.) - for(var/obj/item/storage/bag/ore/cyborg/S in R.module) - R.module.remove_module(S, TRUE) - - var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module) - R.module.basic_modules += H - R.module.add_module(H, FALSE, TRUE) - -/obj/item/borg/upgrade/soh/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - for(var/obj/item/storage/bag/ore/holding/H in R.module) - R.module.remove_module(H, TRUE) - - var/obj/item/storage/bag/ore/cyborg/S = new (R.module) - R.module.basic_modules += S - R.module.add_module(S, FALSE, TRUE) - -/obj/item/borg/upgrade/tboh - name = "janitor cyborg trash bag of holding" - desc = "A trash bag of holding replacement for the janiborg's standard trash bag." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/janitor - -/obj/item/borg/upgrade/tboh/action(mob/living/silicon/robot/R) - . = ..() - if(.) - for(var/obj/item/storage/bag/trash/cyborg/TB in R.module.modules) - R.module.remove_module(TB, TRUE) - - var/obj/item/storage/bag/trash/bluespace/cyborg/B = new /obj/item/storage/bag/trash/bluespace/cyborg(R.module) - R.module.basic_modules += B - R.module.add_module(B, FALSE, TRUE) - -/obj/item/borg/upgrade/tboh/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - for(var/obj/item/storage/bag/trash/bluespace/cyborg/B in R.module.modules) - R.module.remove_module(B, TRUE) - - var/obj/item/storage/bag/trash/cyborg/TB = new (R.module) - R.module.basic_modules += TB - R.module.add_module(TB, FALSE, TRUE) - -/obj/item/borg/upgrade/amop - name = "janitor cyborg advanced mop" - desc = "An advanced mop replacement for the janiborg's standard mop." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/janitor - -/obj/item/borg/upgrade/amop/action(mob/living/silicon/robot/R) - . = ..() - if(.) - for(var/obj/item/mop/cyborg/M in R.module.modules) - R.module.remove_module(M, TRUE) - - var/obj/item/mop/advanced/cyborg/A = new /obj/item/mop/advanced/cyborg(R.module) - R.module.basic_modules += A - R.module.add_module(A, FALSE, TRUE) - -/obj/item/borg/upgrade/amop/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - for(var/obj/item/mop/advanced/cyborg/A in R.module.modules) - R.module.remove_module(A, TRUE) - - var/obj/item/mop/cyborg/M = new (R.module) - R.module.basic_modules += M - R.module.add_module(M, FALSE, TRUE) - -/obj/item/borg/upgrade/syndicate - name = "illegal equipment module" - desc = "Unlocks the hidden, deadlier functions of a cyborg." - icon_state = "cyborg_upgrade3" - require_module = 1 - -/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - if(R.emagged) - return FALSE - - R.SetEmagged(1) - - return TRUE - -/obj/item/borg/upgrade/syndicate/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - R.SetEmagged(FALSE) - -/obj/item/borg/upgrade/lavaproof - name = "mining cyborg lavaproof tracks" - desc = "An upgrade kit to apply specialized coolant systems and insulation layers to mining cyborg tracks, enabling them to withstand exposure to molten rock." - icon_state = "ash_plating" - resistance_flags = LAVA_PROOF | FIRE_PROOF - require_module = 1 - module_type = /obj/item/robot_module/miner - -/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - R.weather_immunities += "lava" - -/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - R.weather_immunities -= "lava" - -/obj/item/borg/upgrade/selfrepair - name = "self-repair module" - desc = "This module will repair the cyborg over time." - icon_state = "cyborg_upgrade5" - require_module = 1 - var/repair_amount = -1 - var/repair_tick = 1 - var/msg_cooldown = 0 - var/on = FALSE - var/powercost = 10 - var/mob/living/silicon/robot/cyborg - var/datum/action/toggle_action - -/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/obj/item/borg/upgrade/selfrepair/U = locate() in R - if(U) - to_chat(user, "This unit is already equipped with a self-repair module.") - return FALSE - - cyborg = R - icon_state = "selfrepair_off" - toggle_action = new /datum/action/item_action/toggle(src) - toggle_action.Grant(R) - -/obj/item/borg/upgrade/selfrepair/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - toggle_action.Remove(cyborg) - QDEL_NULL(toggle_action) - cyborg = null - deactivate_sr() - -/obj/item/borg/upgrade/selfrepair/dropped() - . = ..() - addtimer(CALLBACK(src, .proc/check_dropped), 1) - -/obj/item/borg/upgrade/selfrepair/proc/check_dropped() - if(loc != cyborg) - toggle_action.Remove(cyborg) - QDEL_NULL(toggle_action) - cyborg = null - deactivate_sr() - -/obj/item/borg/upgrade/selfrepair/ui_action_click() - on = !on - if(on) - to_chat(cyborg, "You activate the self-repair module.") - START_PROCESSING(SSobj, src) - else - to_chat(cyborg, "You deactivate the self-repair module.") - STOP_PROCESSING(SSobj, src) - update_icon() - -/obj/item/borg/upgrade/selfrepair/update_icon() - if(cyborg) - icon_state = "selfrepair_[on ? "on" : "off"]" - for(var/X in actions) - var/datum/action/A = X - A.UpdateButtonIcon() - else - icon_state = "cyborg_upgrade5" - -/obj/item/borg/upgrade/selfrepair/proc/deactivate_sr() - STOP_PROCESSING(SSobj, src) - on = FALSE - update_icon() - -/obj/item/borg/upgrade/selfrepair/process() - if(!repair_tick) - repair_tick = 1 - return - - if(cyborg && (cyborg.stat != DEAD) && on) - if(!cyborg.cell) - to_chat(cyborg, "Self-repair module deactivated. Please, insert the power cell.") - deactivate_sr() - return - - if(cyborg.cell.charge < powercost * 2) - to_chat(cyborg, "Self-repair module deactivated. Please recharge.") - deactivate_sr() - return - - if(cyborg.health < cyborg.maxHealth) - if(cyborg.health < 0) - repair_amount = -2.5 - powercost = 30 - else - repair_amount = -1 - powercost = 10 - cyborg.adjustBruteLoss(repair_amount) - cyborg.adjustFireLoss(repair_amount) - cyborg.updatehealth() - cyborg.cell.use(powercost) - else - cyborg.cell.use(5) - repair_tick = 0 - - if((world.time - 2000) > msg_cooldown ) - var/msgmode = "standby" - if(cyborg.health < 0) - msgmode = "critical" - else if(cyborg.health < cyborg.maxHealth) - msgmode = "normal" - to_chat(cyborg, "Self-repair is active in [msgmode] mode.") - msg_cooldown = world.time - else - deactivate_sr() - -/obj/item/borg/upgrade/hypospray - name = "medical cyborg hypospray advanced synthesiser" - desc = "An upgrade to the Medical module cyborg's hypospray, allowing it \ - to produce more advanced and complex medical reagents." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/medical - var/list/additional_reagents = list() - -/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) - if(H.accepts_reagent_upgrades) - for(var/re in additional_reagents) - H.add_reagent(re) - -/obj/item/borg/upgrade/hypospray/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) - if(H.accepts_reagent_upgrades) - for(var/re in additional_reagents) - H.del_reagent(re) - -/obj/item/borg/upgrade/hypospray/expanded - name = "medical cyborg expanded hypospray" - desc = "An upgrade to the Medical module's hypospray, allowing it \ - to treat a wider range of conditions and problems." - additional_reagents = list("mannitol", "oculine", "inacusiate", - "mutadone", "haloperidol") - -/obj/item/borg/upgrade/hypospray/high_strength - name = "medical cyborg high-strength hypospray" - desc = "An upgrade to the Medical module's hypospray, containing \ - stronger versions of existing chemicals." - additional_reagents = list("oxandrolone", "sal_acid", "rezadone", - "pen_acid") - -/obj/item/borg/upgrade/piercing_hypospray - name = "cyborg piercing hypospray" - desc = "An upgrade to a cyborg's hypospray, allowing it to \ - pierce armor and thick material." - icon_state = "cyborg_upgrade3" - -/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/found_hypo = FALSE - for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) - H.bypass_protection = TRUE - found_hypo = TRUE - - if(!found_hypo) - return FALSE - -/obj/item/borg/upgrade/piercing_hypospray/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) - H.bypass_protection = initial(H.bypass_protection) - -/obj/item/borg/upgrade/defib - name = "medical cyborg defibrillator" - desc = "An upgrade to the Medical module, installing a built-in \ - defibrillator, for on the scene revival." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/medical - -/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module) - R.module.basic_modules += S - R.module.add_module(S, FALSE, TRUE) - -/obj/item/borg/upgrade/defib/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/twohanded/shockpaddles/cyborg/S = locate() in R.module - R.module.remove_module(S, TRUE) - -/obj/item/borg/upgrade/processor - name = "medical cyborg surgical processor" - desc = "An upgrade to the Medical module, installing a processor \ - capable of scanning surgery disks and carrying \ - out procedures" - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = /obj/item/robot_module/medical - -/obj/item/borg/upgrade/processor/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/obj/item/surgical_processor/SP = new(R.module) - R.module.basic_modules += SP - R.module.add_module(SP, FALSE, TRUE) - -/obj/item/borg/upgrade/processor/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/surgical_processor/SP = locate() in R.module - R.module.remove_module(SP, TRUE) - -/obj/item/borg/upgrade/advhealth - name = "advanced cyborg health scanner" - desc = "An upgrade to the Medical modules, installing a built-in \ - advanced health scanner, for better readings on patients." - icon_state = "cyborg_upgrade3" - require_module = 1 - module_type = list( - /obj/item/robot_module/medical, - /obj/item/robot_module/syndicate_medical, - /obj/item/robot_module/medihound, - /obj/item/robot_module/borgi) - -/obj/item/borg/upgrade/advhealth/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/obj/item/healthanalyzer/advanced/AH = new(R.module) - R.module.basic_modules += AH - R.module.add_module(AH, FALSE, TRUE) - -/obj/item/borg/upgrade/processor/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/healthanalyzer/advanced/AH = locate() in R.module - R.module.remove_module(AH, TRUE) - -/obj/item/borg/upgrade/ai - name = "B.O.R.I.S. module" - desc = "Bluespace Optimized Remote Intelligence Synchronization. An uplink device which takes the place of an MMI in cyborg endoskeletons, creating a robotic shell controlled by an AI." - icon_state = "boris" - -/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - if(R.shell) - to_chat(user, "This unit is already an AI shell!") - return FALSE - if(R.key) //You cannot replace a player unless the key is completely removed. - to_chat(user, "Intelligence patterns detected in this [R.braintype]. Aborting.") - return FALSE - - R.make_shell(src) - -/obj/item/borg/upgrade/ai/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - if(R.shell) - R.undeploy() - R.notify_ai(AI_SHELL) - -/obj/item/borg/upgrade/expand - name = "borg expander" - desc = "A cyborg resizer, it makes a cyborg huge." - icon_state = "cyborg_upgrade3" - -/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - - if(R.hasExpanded) - to_chat(usr, "This unit already has an expand module installed!") - return FALSE - - R.notransform = TRUE - var/prev_lockcharge = R.lockcharge - R.SetLockdown(1) - R.anchored = TRUE - var/datum/effect_system/smoke_spread/smoke = new - smoke.set_up(1, R.loc) - smoke.start() - sleep(2) - for(var/i in 1 to 4) - playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1) - sleep(12) - if(!prev_lockcharge) - R.SetLockdown(0) - R.anchored = FALSE - R.notransform = FALSE - R.resize = 2 - R.hasExpanded = TRUE - R.update_transform() - -/obj/item/borg/upgrade/expand/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - R.resize = 0.5 - R.hasExpanded = FALSE - R.update_transform() - -/obj/item/borg/upgrade/rped - name = "engineering cyborg RPED" - desc = "A rapid part exchange device for the engineering cyborg." - icon = 'icons/obj/storage.dmi' - icon_state = "borgrped" - require_module = TRUE - module_type = /obj/item/robot_module/engineering - -/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - - var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R - if(RPED) - to_chat(user, "This unit is already equipped with a RPED module.") - return FALSE - - RPED = new(R.module) - R.module.basic_modules += RPED - R.module.add_module(RPED, FALSE, TRUE) - -/obj/item/borg/upgrade/rped/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R.module - if (RPED) - R.module.remove_module(RPED, TRUE) - -/obj/item/borg/upgrade/circuit_app - name = "circuit manipulation apparatus" - desc = "An engineering cyborg upgrade allowing for manipulation of circuit boards." - icon_state = "cyborg_upgrade3" - require_module = TRUE - module_type = list(/obj/item/robot_module/engineering) - -/obj/item/borg/upgrade/circuit_app/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - var/obj/item/borg/apparatus/circuit/C = locate() in R.module.modules - if(C) - to_chat(user, "This unit is already equipped with a circuit apparatus!") - return FALSE - - C = new(R.module) - R.module.basic_modules += C - R.module.add_module(C, FALSE, TRUE) - -/obj/item/borg/upgrade/circuit_app/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/borg/apparatus/circuit/C = locate() in R.module.modules - if (C) - R.module.remove_module(C, TRUE) - -/obj/item/borg/upgrade/pinpointer - name = "medical cyborg crew pinpointer" - desc = "A crew pinpointer module for the medical cyborg." - icon = 'icons/obj/device.dmi' - icon_state = "pinpointer_crew" - require_module = TRUE - module_type = /obj/item/robot_module/medical - -/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - - var/obj/item/pinpointer/crew/PP = locate() in R - if(PP) - to_chat(user, "This unit is already equipped with a pinpointer module.") - return FALSE - - PP = new(R.module) - R.module.basic_modules += PP - R.module.add_module(PP, FALSE, TRUE) - -/obj/item/borg/upgrade/pinpointer/deactivate(mob/living/silicon/robot/R, user = usr) - . = ..() - if (.) - var/obj/item/pinpointer/crew/PP = locate() in R.module - if (PP) - R.module.remove_module(PP, TRUE) - -/obj/item/borg/upgrade/transform - name = "borg module picker (Standard)" - desc = "Allows you to to turn a cyborg into a standard cyborg." - icon_state = "cyborg_upgrade3" - var/obj/item/robot_module/new_module = /obj/item/robot_module/standard - -/obj/item/borg/upgrade/transform/action(mob/living/silicon/robot/R, user = usr) - . = ..() - if(.) - R.module.transform_to(new_module) - -/obj/item/borg/upgrade/transform/clown - name = "borg module picker (Clown)" - desc = "Allows you to to turn a cyborg into a clown, honk." - icon_state = "cyborg_upgrade3" - new_module = /obj/item/robot_module/clown +// robot_upgrades.dm +// Contains various borg upgrades. + +/obj/item/borg/upgrade + name = "borg upgrade module." + desc = "Protected by FRM." + icon = 'icons/obj/module.dmi' + icon_state = "cyborg_upgrade" + var/locked = FALSE + var/installed = 0 + var/require_module = 0 + var/module_type = null + // if true, is not stored in the robot to be ejected + // if module is reset + var/one_use = FALSE + +/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr) + if(R.stat == DEAD) + to_chat(user, "[src] will not function on a deceased cyborg.") + return FALSE + if(module_type && !istype(R.module, module_type)) + to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!") + to_chat(user, "There's no mounting point for the module!") + return FALSE + return TRUE + +/obj/item/borg/upgrade/proc/deactivate(mob/living/silicon/robot/R, user = usr) + if (!(src in R.upgrades)) + return FALSE + return TRUE + +/obj/item/borg/upgrade/rename + name = "cyborg reclassification board" + desc = "Used to rename a cyborg." + icon_state = "cyborg_upgrade1" + var/heldname = "" + one_use = TRUE + +/obj/item/borg/upgrade/rename/attack_self(mob/user) + heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN) + +/obj/item/borg/upgrade/rename/action(mob/living/silicon/robot/R) + . = ..() + if(.) + var/oldname = R.real_name + R.custom_name = heldname + R.updatename() + if(oldname == R.real_name) + R.notify_ai(RENAME, oldname, R.real_name) + +/obj/item/borg/upgrade/restart + name = "cyborg emergency reboot module" + desc = "Used to force a reboot of a disabled-but-repaired cyborg, bringing it back online." + icon_state = "cyborg_upgrade1" + one_use = TRUE + +/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R, user = usr) + if(R.health < 0) + to_chat(user, "You have to repair the cyborg before using this module!") + return FALSE + + if(R.mind) + R.mind.grab_ghost() + playsound(loc, 'sound/voice/liveagain.ogg', 75, 1) + + R.revive() + +/obj/item/borg/upgrade/vtec + name = "cyborg VTEC module" + desc = "Used to kick in a cyborg's VTEC systems, increasing their speed." + icon_state = "cyborg_upgrade2" + require_module = 1 + +/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + if(R.speed < 0) + to_chat(R, "A VTEC unit is already installed!") + to_chat(user, "There's no room for another VTEC unit!") + return FALSE + + //R.speed = -2 // Gotta go fast. + //Citadel change - makes vtecs give an ability rather than reducing the borg's speed instantly + R.AddAbility(new/obj/effect/proc_holder/silicon/cyborg/vtecControl) + +/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + R.speed = initial(R.speed) + +/obj/item/borg/upgrade/disablercooler + name = "cyborg rapid disabler cooling module" + desc = "Used to cool a mounted disabler, increasing the potential current in it and thus its recharge rate." + icon_state = "cyborg_upgrade3" + require_module = 1 + //module_type = /obj/item/robot_module/security + +/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules + if(!T) + to_chat(user, "There's no disabler in this unit!") + return FALSE + if(T.charge_delay <= 2) + to_chat(R, "A cooling unit is already installed!") + to_chat(user, "There's no room for another cooling unit!") + return FALSE + + T.charge_delay = max(2 , T.charge_delay - 4) + +/obj/item/borg/upgrade/disablercooler/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/gun/energy/disabler/cyborg/T = locate() in R.module.modules + if(!T) + return FALSE + T.charge_delay = initial(T.charge_delay) + +/obj/item/borg/upgrade/thrusters + name = "ion thruster upgrade" + desc = "An energy-operated thruster system for cyborgs." + icon_state = "cyborg_upgrade3" + +/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + if(R.ionpulse) + to_chat(user, "This unit already has ion thrusters installed!") + return FALSE + + R.ionpulse = TRUE + +/obj/item/borg/upgrade/thrusters/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + R.ionpulse = FALSE + +/obj/item/borg/upgrade/ddrill + name = "mining cyborg diamond drill" + desc = "A diamond drill replacement for the mining module's standard drill." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/miner + +/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + for(var/obj/item/pickaxe/drill/cyborg/D in R.module) + R.module.remove_module(D, TRUE) + for(var/obj/item/shovel/S in R.module) + R.module.remove_module(S, TRUE) + + var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module) + R.module.basic_modules += DD + R.module.add_module(DD, FALSE, TRUE) + +/obj/item/borg/upgrade/ddrill/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + for(var/obj/item/pickaxe/drill/cyborg/diamond/DD in R.module) + R.module.remove_module(DD, TRUE) + + var/obj/item/pickaxe/drill/cyborg/D = new (R.module) + R.module.basic_modules += D + R.module.add_module(D, FALSE, TRUE) + var/obj/item/shovel/S = new (R.module) + R.module.basic_modules += S + R.module.add_module(S, FALSE, TRUE) + +/obj/item/borg/upgrade/soh + name = "mining cyborg satchel of holding" + desc = "A satchel of holding replacement for mining cyborg's ore satchel module." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/miner + +/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R) + . = ..() + if(.) + for(var/obj/item/storage/bag/ore/cyborg/S in R.module) + R.module.remove_module(S, TRUE) + + var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module) + R.module.basic_modules += H + R.module.add_module(H, FALSE, TRUE) + +/obj/item/borg/upgrade/soh/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + for(var/obj/item/storage/bag/ore/holding/H in R.module) + R.module.remove_module(H, TRUE) + + var/obj/item/storage/bag/ore/cyborg/S = new (R.module) + R.module.basic_modules += S + R.module.add_module(S, FALSE, TRUE) + +/obj/item/borg/upgrade/tboh + name = "janitor cyborg trash bag of holding" + desc = "A trash bag of holding replacement for the janiborg's standard trash bag." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/janitor + +/obj/item/borg/upgrade/tboh/action(mob/living/silicon/robot/R) + . = ..() + if(.) + for(var/obj/item/storage/bag/trash/cyborg/TB in R.module.modules) + R.module.remove_module(TB, TRUE) + + var/obj/item/storage/bag/trash/bluespace/cyborg/B = new /obj/item/storage/bag/trash/bluespace/cyborg(R.module) + R.module.basic_modules += B + R.module.add_module(B, FALSE, TRUE) + +/obj/item/borg/upgrade/tboh/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + for(var/obj/item/storage/bag/trash/bluespace/cyborg/B in R.module.modules) + R.module.remove_module(B, TRUE) + + var/obj/item/storage/bag/trash/cyborg/TB = new (R.module) + R.module.basic_modules += TB + R.module.add_module(TB, FALSE, TRUE) + +/obj/item/borg/upgrade/amop + name = "janitor cyborg advanced mop" + desc = "An advanced mop replacement for the janiborg's standard mop." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/janitor + +/obj/item/borg/upgrade/amop/action(mob/living/silicon/robot/R) + . = ..() + if(.) + for(var/obj/item/mop/cyborg/M in R.module.modules) + R.module.remove_module(M, TRUE) + + var/obj/item/mop/advanced/cyborg/A = new /obj/item/mop/advanced/cyborg(R.module) + R.module.basic_modules += A + R.module.add_module(A, FALSE, TRUE) + +/obj/item/borg/upgrade/amop/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + for(var/obj/item/mop/advanced/cyborg/A in R.module.modules) + R.module.remove_module(A, TRUE) + + var/obj/item/mop/cyborg/M = new (R.module) + R.module.basic_modules += M + R.module.add_module(M, FALSE, TRUE) + +/obj/item/borg/upgrade/syndicate + name = "illegal equipment module" + desc = "Unlocks the hidden, deadlier functions of a cyborg." + icon_state = "cyborg_upgrade3" + require_module = 1 + +/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + if(R.emagged) + return FALSE + + R.SetEmagged(1) + + return TRUE + +/obj/item/borg/upgrade/syndicate/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + R.SetEmagged(FALSE) + +/obj/item/borg/upgrade/lavaproof + name = "mining cyborg lavaproof tracks" + desc = "An upgrade kit to apply specialized coolant systems and insulation layers to mining cyborg tracks, enabling them to withstand exposure to molten rock." + icon_state = "ash_plating" + resistance_flags = LAVA_PROOF | FIRE_PROOF + require_module = 1 + module_type = /obj/item/robot_module/miner + +/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + R.weather_immunities += "lava" + +/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + R.weather_immunities -= "lava" + +/obj/item/borg/upgrade/selfrepair + name = "self-repair module" + desc = "This module will repair the cyborg over time." + icon_state = "cyborg_upgrade5" + require_module = 1 + var/repair_amount = -1 + var/repair_tick = 1 + var/msg_cooldown = 0 + var/on = FALSE + var/powercost = 10 + var/mob/living/silicon/robot/cyborg + var/datum/action/toggle_action + +/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/obj/item/borg/upgrade/selfrepair/U = locate() in R + if(U) + to_chat(user, "This unit is already equipped with a self-repair module.") + return FALSE + + cyborg = R + icon_state = "selfrepair_off" + toggle_action = new /datum/action/item_action/toggle(src) + toggle_action.Grant(R) + +/obj/item/borg/upgrade/selfrepair/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + toggle_action.Remove(cyborg) + QDEL_NULL(toggle_action) + cyborg = null + deactivate_sr() + +/obj/item/borg/upgrade/selfrepair/dropped() + . = ..() + addtimer(CALLBACK(src, .proc/check_dropped), 1) + +/obj/item/borg/upgrade/selfrepair/proc/check_dropped() + if(loc != cyborg) + toggle_action.Remove(cyborg) + QDEL_NULL(toggle_action) + cyborg = null + deactivate_sr() + +/obj/item/borg/upgrade/selfrepair/ui_action_click() + on = !on + if(on) + to_chat(cyborg, "You activate the self-repair module.") + START_PROCESSING(SSobj, src) + else + to_chat(cyborg, "You deactivate the self-repair module.") + STOP_PROCESSING(SSobj, src) + update_icon() + +/obj/item/borg/upgrade/selfrepair/update_icon() + if(cyborg) + icon_state = "selfrepair_[on ? "on" : "off"]" + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + else + icon_state = "cyborg_upgrade5" + +/obj/item/borg/upgrade/selfrepair/proc/deactivate_sr() + STOP_PROCESSING(SSobj, src) + on = FALSE + update_icon() + +/obj/item/borg/upgrade/selfrepair/process() + if(!repair_tick) + repair_tick = 1 + return + + if(cyborg && (cyborg.stat != DEAD) && on) + if(!cyborg.cell) + to_chat(cyborg, "Self-repair module deactivated. Please, insert the power cell.") + deactivate_sr() + return + + if(cyborg.cell.charge < powercost * 2) + to_chat(cyborg, "Self-repair module deactivated. Please recharge.") + deactivate_sr() + return + + if(cyborg.health < cyborg.maxHealth) + if(cyborg.health < 0) + repair_amount = -2.5 + powercost = 30 + else + repair_amount = -1 + powercost = 10 + cyborg.adjustBruteLoss(repair_amount) + cyborg.adjustFireLoss(repair_amount) + cyborg.updatehealth() + cyborg.cell.use(powercost) + else + cyborg.cell.use(5) + repair_tick = 0 + + if((world.time - 2000) > msg_cooldown ) + var/msgmode = "standby" + if(cyborg.health < 0) + msgmode = "critical" + else if(cyborg.health < cyborg.maxHealth) + msgmode = "normal" + to_chat(cyborg, "Self-repair is active in [msgmode] mode.") + msg_cooldown = world.time + else + deactivate_sr() + +/obj/item/borg/upgrade/hypospray + name = "medical cyborg hypospray advanced synthesiser" + desc = "An upgrade to the Medical module cyborg's hypospray, allowing it \ + to produce more advanced and complex medical reagents." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/medical + var/list/additional_reagents = list() + +/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) + if(H.accepts_reagent_upgrades) + for(var/re in additional_reagents) + H.add_reagent(re) + +/obj/item/borg/upgrade/hypospray/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) + if(H.accepts_reagent_upgrades) + for(var/re in additional_reagents) + H.del_reagent(re) + +/obj/item/borg/upgrade/hypospray/expanded + name = "medical cyborg expanded hypospray" + desc = "An upgrade to the Medical module's hypospray, allowing it \ + to treat a wider range of conditions and problems." + additional_reagents = list(/datum/reagent/medicine/mannitol, /datum/reagent/medicine/oculine, /datum/reagent/medicine/inacusiate, + /datum/reagent/medicine/mutadone, /datum/reagent/medicine/haloperidol) + +/obj/item/borg/upgrade/hypospray/high_strength + name = "medical cyborg high-strength hypospray" + desc = "An upgrade to the Medical module's hypospray, containing \ + stronger versions of existing chemicals." + additional_reagents = list(/datum/reagent/medicine/oxandrolone, /datum/reagent/medicine/sal_acid, + /datum/reagent/medicine/rezadone, /datum/reagent/medicine/pen_acid) + +/obj/item/borg/upgrade/piercing_hypospray + name = "cyborg piercing hypospray" + desc = "An upgrade to a cyborg's hypospray, allowing it to \ + pierce armor and thick material." + icon_state = "cyborg_upgrade3" + +/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/found_hypo = FALSE + for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) + H.bypass_protection = TRUE + found_hypo = TRUE + + if(!found_hypo) + return FALSE + +/obj/item/borg/upgrade/piercing_hypospray/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + for(var/obj/item/reagent_containers/borghypo/H in R.module.modules) + H.bypass_protection = initial(H.bypass_protection) + +/obj/item/borg/upgrade/defib + name = "medical cyborg defibrillator" + desc = "An upgrade to the Medical module, installing a built-in \ + defibrillator, for on the scene revival." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/medical + +/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module) + R.module.basic_modules += S + R.module.add_module(S, FALSE, TRUE) + +/obj/item/borg/upgrade/defib/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/twohanded/shockpaddles/cyborg/S = locate() in R.module + R.module.remove_module(S, TRUE) + +/obj/item/borg/upgrade/processor + name = "medical cyborg surgical processor" + desc = "An upgrade to the Medical module, installing a processor \ + capable of scanning surgery disks and carrying \ + out procedures" + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = /obj/item/robot_module/medical + +/obj/item/borg/upgrade/processor/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/obj/item/surgical_processor/SP = new(R.module) + R.module.basic_modules += SP + R.module.add_module(SP, FALSE, TRUE) + +/obj/item/borg/upgrade/processor/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/surgical_processor/SP = locate() in R.module + R.module.remove_module(SP, TRUE) + +/obj/item/borg/upgrade/advhealth + name = "advanced cyborg health scanner" + desc = "An upgrade to the Medical modules, installing a built-in \ + advanced health scanner, for better readings on patients." + icon_state = "cyborg_upgrade3" + require_module = 1 + module_type = list( + /obj/item/robot_module/medical, + /obj/item/robot_module/syndicate_medical, + /obj/item/robot_module/medihound, + /obj/item/robot_module/borgi) + +/obj/item/borg/upgrade/advhealth/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/obj/item/healthanalyzer/advanced/AH = new(R.module) + R.module.basic_modules += AH + R.module.add_module(AH, FALSE, TRUE) + +/obj/item/borg/upgrade/processor/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/healthanalyzer/advanced/AH = locate() in R.module + R.module.remove_module(AH, TRUE) + +/obj/item/borg/upgrade/ai + name = "B.O.R.I.S. module" + desc = "Bluespace Optimized Remote Intelligence Synchronization. An uplink device which takes the place of an MMI in cyborg endoskeletons, creating a robotic shell controlled by an AI." + icon_state = "boris" + +/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + if(R.shell) + to_chat(user, "This unit is already an AI shell!") + return FALSE + if(R.key) //You cannot replace a player unless the key is completely removed. + to_chat(user, "Intelligence patterns detected in this [R.braintype]. Aborting.") + return FALSE + + R.make_shell(src) + +/obj/item/borg/upgrade/ai/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + if(R.shell) + R.undeploy() + R.notify_ai(AI_SHELL) + +/obj/item/borg/upgrade/expand + name = "borg expander" + desc = "A cyborg resizer, it makes a cyborg huge." + icon_state = "cyborg_upgrade3" + +/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + + if(R.hasExpanded) + to_chat(usr, "This unit already has an expand module installed!") + return FALSE + + R.notransform = TRUE + var/prev_lockcharge = R.lockcharge + R.SetLockdown(1) + R.anchored = TRUE + var/datum/effect_system/smoke_spread/smoke = new + smoke.set_up(1, R.loc) + smoke.start() + sleep(2) + for(var/i in 1 to 4) + playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1) + sleep(12) + if(!prev_lockcharge) + R.SetLockdown(0) + R.anchored = FALSE + R.notransform = FALSE + R.resize = 2 + R.hasExpanded = TRUE + R.update_transform() + +/obj/item/borg/upgrade/expand/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + R.resize = 0.5 + R.hasExpanded = FALSE + R.update_transform() + +/obj/item/borg/upgrade/rped + name = "engineering cyborg RPED" + desc = "A rapid part exchange device for the engineering cyborg." + icon = 'icons/obj/storage.dmi' + icon_state = "borgrped" + require_module = TRUE + module_type = /obj/item/robot_module/engineering + +/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + + var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R + if(RPED) + to_chat(user, "This unit is already equipped with a RPED module.") + return FALSE + + RPED = new(R.module) + R.module.basic_modules += RPED + R.module.add_module(RPED, FALSE, TRUE) + +/obj/item/borg/upgrade/rped/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R.module + if (RPED) + R.module.remove_module(RPED, TRUE) + +/obj/item/borg/upgrade/circuit_app + name = "circuit manipulation apparatus" + desc = "An engineering cyborg upgrade allowing for manipulation of circuit boards." + icon_state = "cyborg_upgrade3" + require_module = TRUE + module_type = list(/obj/item/robot_module/engineering) + +/obj/item/borg/upgrade/circuit_app/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + var/obj/item/borg/apparatus/circuit/C = locate() in R.module.modules + if(C) + to_chat(user, "This unit is already equipped with a circuit apparatus!") + return FALSE + + C = new(R.module) + R.module.basic_modules += C + R.module.add_module(C, FALSE, TRUE) + +/obj/item/borg/upgrade/circuit_app/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/borg/apparatus/circuit/C = locate() in R.module.modules + if (C) + R.module.remove_module(C, TRUE) + +/obj/item/borg/upgrade/pinpointer + name = "medical cyborg crew pinpointer" + desc = "A crew pinpointer module for the medical cyborg." + icon = 'icons/obj/device.dmi' + icon_state = "pinpointer_crew" + require_module = TRUE + module_type = /obj/item/robot_module/medical + +/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + + var/obj/item/pinpointer/crew/PP = locate() in R + if(PP) + to_chat(user, "This unit is already equipped with a pinpointer module.") + return FALSE + + PP = new(R.module) + R.module.basic_modules += PP + R.module.add_module(PP, FALSE, TRUE) + +/obj/item/borg/upgrade/pinpointer/deactivate(mob/living/silicon/robot/R, user = usr) + . = ..() + if (.) + var/obj/item/pinpointer/crew/PP = locate() in R.module + if (PP) + R.module.remove_module(PP, TRUE) + +/obj/item/borg/upgrade/transform + name = "borg module picker (Standard)" + desc = "Allows you to to turn a cyborg into a standard cyborg." + icon_state = "cyborg_upgrade3" + var/obj/item/robot_module/new_module = /obj/item/robot_module/standard + +/obj/item/borg/upgrade/transform/action(mob/living/silicon/robot/R, user = usr) + . = ..() + if(.) + R.module.transform_to(new_module) + +/obj/item/borg/upgrade/transform/clown + name = "borg module picker (Clown)" + desc = "Allows you to to turn a cyborg into a clown, honk." + icon_state = "cyborg_upgrade3" + new_module = /obj/item/robot_module/clown diff --git a/code/game/objects/items/stacks/bscrystal.dm b/code/game/objects/items/stacks/bscrystal.dm index acf95ada..acfc6100 100644 --- a/code/game/objects/items/stacks/bscrystal.dm +++ b/code/game/objects/items/stacks/bscrystal.dm @@ -1,89 +1,89 @@ -//Bluespace crystals, used in telescience and when crushed it will blink you to a random turf. -/obj/item/stack/ore/bluespace_crystal - name = "bluespace crystal" - desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate." - icon = 'icons/obj/telescience.dmi' - icon_state = "bluespace_crystal" - singular_name = "bluespace crystal" - w_class = WEIGHT_CLASS_TINY - materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) - points = 50 - var/blink_range = 8 // The teleport range when crushed/thrown at someone. - refined_type = /obj/item/stack/sheet/bluespace_crystal - grind_results = list("bluespace" = 20) - -/obj/item/stack/ore/bluespace_crystal/refined - name = "refined bluespace crystal" - points = 0 - refined_type = null - -/obj/item/stack/ore/bluespace_crystal/Initialize() - . = ..() - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - -/obj/item/stack/ore/bluespace_crystal/get_part_rating() - return 1 - -/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user) - user.visible_message("[user] crushes [src]!", "You crush [src]!") - new /obj/effect/particle_effect/sparks(loc) - playsound(loc, "sparks", 50, 1) - blink_mob(user) - use(1) - -/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L) - do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) - -/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) - if(!..()) // not caught in mid-air - visible_message("[src] fizzles and disappears upon impact!") - var/turf/T = get_turf(hit_atom) - new /obj/effect/particle_effect/sparks(T) - playsound(loc, "sparks", 50, 1) - if(isliving(hit_atom)) - blink_mob(hit_atom) - use(1) - -//Artificial bluespace crystal, doesn't give you much research. -/obj/item/stack/ore/bluespace_crystal/artificial - name = "artificial bluespace crystal" - desc = "An artificially made bluespace crystal, it looks delicate." - materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT*0.5) - blink_range = 4 // Not as good as the organic stuff! - points = 0 //nice try - refined_type = null - grind_results = list("bluespace" = 10, "silicon" = 20) - -//Polycrystals, aka stacks -/obj/item/stack/sheet/bluespace_crystal - name = "bluespace polycrystal" - icon = 'icons/obj/telescience.dmi' - icon_state = "polycrystal" - item_state = "sheet-polycrystal" - singular_name = "bluespace polycrystal" - desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." - materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) - attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed") - novariants = TRUE - grind_results = list("bluespace" = 20) - point_value = 30 - var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined - -/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening - to_chat(user, "You cannot crush the polycrystal in-hand, try breaking one off.") - -//ATTACK HAND IGNORING PARENT RETURN VALUE -/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user) - if(user.get_inactive_held_item() == src) - if(zero_amount()) - return - var/BC = new crystal_type(src) - user.put_in_hands(BC) - use(1) - if(!amount) - to_chat(user, "You break the final crystal off.") - else - to_chat(user, "You break off a crystal.") - else - ..() +//Bluespace crystals, used in telescience and when crushed it will blink you to a random turf. +/obj/item/stack/ore/bluespace_crystal + name = "bluespace crystal" + desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate." + icon = 'icons/obj/telescience.dmi' + icon_state = "bluespace_crystal" + singular_name = "bluespace crystal" + w_class = WEIGHT_CLASS_TINY + materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) + points = 50 + var/blink_range = 8 // The teleport range when crushed/thrown at someone. + refined_type = /obj/item/stack/sheet/bluespace_crystal + grind_results = list(/datum/reagent/bluespace = 20) + +/obj/item/stack/ore/bluespace_crystal/refined + name = "refined bluespace crystal" + points = 0 + refined_type = null + +/obj/item/stack/ore/bluespace_crystal/Initialize() + . = ..() + pixel_x = rand(-5, 5) + pixel_y = rand(-5, 5) + +/obj/item/stack/ore/bluespace_crystal/get_part_rating() + return 1 + +/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user) + user.visible_message("[user] crushes [src]!", "You crush [src]!") + new /obj/effect/particle_effect/sparks(loc) + playsound(loc, "sparks", 50, 1) + blink_mob(user) + use(1) + +/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L) + do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) + +/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + if(!..()) // not caught in mid-air + visible_message("[src] fizzles and disappears upon impact!") + var/turf/T = get_turf(hit_atom) + new /obj/effect/particle_effect/sparks(T) + playsound(loc, "sparks", 50, 1) + if(isliving(hit_atom)) + blink_mob(hit_atom) + use(1) + +//Artificial bluespace crystal, doesn't give you much research. +/obj/item/stack/ore/bluespace_crystal/artificial + name = "artificial bluespace crystal" + desc = "An artificially made bluespace crystal, it looks delicate." + materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT*0.5) + blink_range = 4 // Not as good as the organic stuff! + points = 0 //nice try + refined_type = null + grind_results = list(/datum/reagent/bluespace = 10, /datum/reagent/silicon = 20) + +//Polycrystals, aka stacks +/obj/item/stack/sheet/bluespace_crystal + name = "bluespace polycrystal" + icon = 'icons/obj/telescience.dmi' + icon_state = "polycrystal" + item_state = "sheet-polycrystal" + singular_name = "bluespace polycrystal" + desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." + materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT) + attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed") + novariants = TRUE + grind_results = list(/datum/reagent/bluespace = 20) + point_value = 30 + var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined + +/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening + to_chat(user, "You cannot crush the polycrystal in-hand, try breaking one off.") + +//ATTACK HAND IGNORING PARENT RETURN VALUE +/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user) + if(user.get_inactive_held_item() == src) + if(zero_amount()) + return + var/BC = new crystal_type(src) + user.put_in_hands(BC) + use(1) + if(!amount) + to_chat(user, "You break the final crystal off.") + else + to_chat(user, "You break off a crystal.") + else + ..() diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index caab2855..cc044c18 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -1,192 +1,192 @@ -/obj/item/stack/medical - name = "medical pack" - singular_name = "medical pack" - icon = 'icons/obj/stack_objects.dmi' - amount = 6 - max_amount = 6 - w_class = WEIGHT_CLASS_TINY - full_w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - resistance_flags = FLAMMABLE - max_integrity = 40 - novariants = FALSE - var/heal_brute = 0 - var/heal_burn = 0 - var/stop_bleeding = 0 - var/self_delay = 50 - var/fix_bone= 0 - -/obj/item/stack/medical/attack(mob/living/M, mob/user) - if(M.stat == DEAD && !stop_bleeding) - var/t_him = "it" - if(M.gender == MALE) - t_him = "him" - else if(M.gender == FEMALE) - t_him = "her" - to_chat(user, "\The [M] is dead, you cannot help [t_him]!") - return - - if(!iscarbon(M) && !isanimal(M)) - to_chat(user, "You don't know how to apply \the [src] to [M]!") - return 1 - - var/obj/item/bodypart/affecting - if(iscarbon(M)) - var/mob/living/carbon/C = M - affecting = C.get_bodypart(check_zone(user.zone_selected)) - if(!affecting) //Missing limb? - to_chat(user, "[C] doesn't have \a [parse_zone(user.zone_selected)]!") - return - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if(stop_bleeding) - if(H.bleedsuppress) - to_chat(user, "[H]'s bleeding is already bandaged!") - return - else if(!H.bleed_rate) - to_chat(user, "[H] isn't bleeding!") - return - - - if(isliving(M)) - if(!M.can_inject(user, 1)) - return - - if(user) - if (M != user) - if (isanimal(M)) - var/mob/living/simple_animal/critter = M - if (!(critter.healable)) - to_chat(user, " You cannot use [src] on [M]!") - return - else if (critter.health == critter.maxHealth) - to_chat(user, " [M] is at full health.") - return - else if(src.heal_brute < 1) - to_chat(user, " [src] won't help [M] at all.") - return - user.visible_message("[user] applies [src] on [M].", "You apply [src] on [M].") - else - var/t_himself = "itself" - if(user.gender == MALE) - t_himself = "himself" - else if(user.gender == FEMALE) - t_himself = "herself" - user.visible_message("[user] starts to apply [src] on [t_himself]...", "You begin applying [src] on yourself...") - if(!do_mob(user, M, self_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject,user,1))) - return - user.visible_message("[user] applies [src] on [t_himself].", "You apply [src] on yourself.") - - - if(iscarbon(M)) - var/mob/living/carbon/C = M - affecting = C.get_bodypart(check_zone(user.zone_selected)) - if(!affecting) //Missing limb? - to_chat(user, "[C] doesn't have \a [parse_zone(user.zone_selected)]!") - return - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if(stop_bleeding) - if(!H.bleedsuppress) //so you can't stack bleed suppression - H.suppress_bloodloss(stop_bleeding) - if(affecting.status == BODYPART_ORGANIC) //Limb must be organic to be healed - RR - if(affecting.heal_damage(heal_brute, heal_burn)) - C.update_damage_overlays() - if (fix_bone) //Fix broken bones on targeted limb - if(affecting.broken == 1) - affecting.broken = 0 - affecting.disabled = 0 - else - to_chat(user, "Medicine won't work on a robotic limb!") - else - M.heal_bodypart_damage((src.heal_brute/2), (src.heal_burn/2)) - - use(1) - -/obj/item/stack/medical/plaster_gauze - name = "plaster gauze" - gender = PLURAL - singular_name = "plaster gauze" - desc = "A roll of plaster of paris that is extremely effective at aiding bone fractures, but does not heal wounds." - icon_state = "pgauze" - self_delay = 300 - max_amount = 10 - fix_bone = 1 - -/obj/item/stack/medical/plaster_gauze/suicide_act(mob/user) - user.visible_message("[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (BRUTELOSS) - -/obj/item/stack/medical/bruise_pack - name = "bruise pack" - singular_name = "bruise pack" - desc = "A therapeutic gel pack and bandages designed to treat blunt-force trauma." - icon_state = "brutepack" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - heal_brute = 40 - self_delay = 20 - grind_results = list("styptic_powder" = 10) - -/obj/item/stack/medical/bruise_pack/suicide_act(mob/user) - user.visible_message("[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (BRUTELOSS) - -/obj/item/stack/medical/gauze - name = "medical gauze" - desc = "A roll of elastic cloth that is extremely effective at stopping bleeding, but does not heal wounds." - gender = PLURAL - singular_name = "medical gauze" - icon_state = "gauze" - stop_bleeding = 1800 - self_delay = 20 - max_amount = 12 - - -/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/wirecutters) || I.is_sharp()) - if(get_amount() < 2) - to_chat(user, "You need at least two gauzes to do this!") - return - new /obj/item/stack/sheet/cloth(user.drop_location()) - user.visible_message("[user] cuts [src] into pieces of cloth with [I].", \ - "You cut [src] into pieces of cloth with [I].", \ - "You hear cutting.") - use(2) - else - return ..() - -/obj/item/stack/medical/gauze/suicide_act(mob/living/user) - user.visible_message("[user] begins tightening \the [src] around [user.p_their()] neck! It looks like [user.p_they()] forgot how to use medical supplies!") - return OXYLOSS - -/obj/item/stack/medical/gauze/improvised - name = "improvised gauze" - singular_name = "improvised gauze" - desc = "A roll of cloth roughly cut from something that can stop bleeding, but does not heal wounds." - stop_bleeding = 900 - -/obj/item/stack/medical/gauze/cyborg - materials = list() - is_cyborg = 1 - cost = 250 - -/obj/item/stack/medical/ointment - name = "ointment" - desc = "Used to treat those nasty burn wounds." - gender = PLURAL - singular_name = "ointment" - icon_state = "ointment" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - heal_burn = 40 - self_delay = 20 - grind_results = list("silver_sulfadiazine" = 10) - -/obj/item/stack/medical/ointment/suicide_act(mob/living/user) - user.visible_message("[user] is squeezing \the [src] into [user.p_their()] mouth! [user.p_do(TRUE)]n't [user.p_they()] know that stuff is toxic?") - return TOXLOSS - -/obj/item/stack/medical/get_belt_overlay() - return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch") +/obj/item/stack/medical + name = "medical pack" + singular_name = "medical pack" + icon = 'icons/obj/stack_objects.dmi' + amount = 6 + max_amount = 6 + w_class = WEIGHT_CLASS_TINY + full_w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + resistance_flags = FLAMMABLE + max_integrity = 40 + novariants = FALSE + var/heal_brute = 0 + var/heal_burn = 0 + var/stop_bleeding = 0 + var/self_delay = 50 + var/fix_bone= 0 + +/obj/item/stack/medical/attack(mob/living/M, mob/user) + if(M.stat == DEAD && !stop_bleeding) + var/t_him = "it" + if(M.gender == MALE) + t_him = "him" + else if(M.gender == FEMALE) + t_him = "her" + to_chat(user, "\The [M] is dead, you cannot help [t_him]!") + return + + if(!iscarbon(M) && !isanimal(M)) + to_chat(user, "You don't know how to apply \the [src] to [M]!") + return 1 + + var/obj/item/bodypart/affecting + if(iscarbon(M)) + var/mob/living/carbon/C = M + affecting = C.get_bodypart(check_zone(user.zone_selected)) + if(!affecting) //Missing limb? + to_chat(user, "[C] doesn't have \a [parse_zone(user.zone_selected)]!") + return + if(ishuman(C)) + var/mob/living/carbon/human/H = C + if(stop_bleeding) + if(H.bleedsuppress) + to_chat(user, "[H]'s bleeding is already bandaged!") + return + else if(!H.bleed_rate) + to_chat(user, "[H] isn't bleeding!") + return + + + if(isliving(M)) + if(!M.can_inject(user, 1)) + return + + if(user) + if (M != user) + if (isanimal(M)) + var/mob/living/simple_animal/critter = M + if (!(critter.healable)) + to_chat(user, " You cannot use [src] on [M]!") + return + else if (critter.health == critter.maxHealth) + to_chat(user, " [M] is at full health.") + return + else if(src.heal_brute < 1) + to_chat(user, " [src] won't help [M] at all.") + return + user.visible_message("[user] applies [src] on [M].", "You apply [src] on [M].") + else + var/t_himself = "itself" + if(user.gender == MALE) + t_himself = "himself" + else if(user.gender == FEMALE) + t_himself = "herself" + user.visible_message("[user] starts to apply [src] on [t_himself]...", "You begin applying [src] on yourself...") + if(!do_mob(user, M, self_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject,user,1))) + return + user.visible_message("[user] applies [src] on [t_himself].", "You apply [src] on yourself.") + + + if(iscarbon(M)) + var/mob/living/carbon/C = M + affecting = C.get_bodypart(check_zone(user.zone_selected)) + if(!affecting) //Missing limb? + to_chat(user, "[C] doesn't have \a [parse_zone(user.zone_selected)]!") + return + if(ishuman(C)) + var/mob/living/carbon/human/H = C + if(stop_bleeding) + if(!H.bleedsuppress) //so you can't stack bleed suppression + H.suppress_bloodloss(stop_bleeding) + if(affecting.status == BODYPART_ORGANIC) //Limb must be organic to be healed - RR + if(affecting.heal_damage(heal_brute, heal_burn)) + C.update_damage_overlays() + if (fix_bone) //Fix broken bones on targeted limb + if(affecting.broken == 1) + affecting.broken = 0 + affecting.disabled = 0 + else + to_chat(user, "Medicine won't work on a robotic limb!") + else + M.heal_bodypart_damage((src.heal_brute/2), (src.heal_burn/2)) + + use(1) + +/obj/item/stack/medical/plaster_gauze + name = "plaster gauze" + gender = PLURAL + singular_name = "plaster gauze" + desc = "A roll of plaster of paris that is extremely effective at aiding bone fractures, but does not heal wounds." + icon_state = "pgauze" + self_delay = 300 + max_amount = 10 + fix_bone = 1 + +/obj/item/stack/medical/plaster_gauze/suicide_act(mob/user) + user.visible_message("[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (BRUTELOSS) + +/obj/item/stack/medical/bruise_pack + name = "bruise pack" + singular_name = "bruise pack" + desc = "A therapeutic gel pack and bandages designed to treat blunt-force trauma." + icon_state = "brutepack" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + heal_brute = 40 + self_delay = 20 + grind_results = list(/datum/reagent/medicine/styptic_powder = 10) + +/obj/item/stack/medical/bruise_pack/suicide_act(mob/user) + user.visible_message("[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (BRUTELOSS) + +/obj/item/stack/medical/gauze + name = "medical gauze" + desc = "A roll of elastic cloth that is extremely effective at stopping bleeding, but does not heal wounds." + gender = PLURAL + singular_name = "medical gauze" + icon_state = "gauze" + stop_bleeding = 1800 + self_delay = 20 + max_amount = 12 + + +/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/wirecutters) || I.is_sharp()) + if(get_amount() < 2) + to_chat(user, "You need at least two gauzes to do this!") + return + new /obj/item/stack/sheet/cloth(user.drop_location()) + user.visible_message("[user] cuts [src] into pieces of cloth with [I].", \ + "You cut [src] into pieces of cloth with [I].", \ + "You hear cutting.") + use(2) + else + return ..() + +/obj/item/stack/medical/gauze/suicide_act(mob/living/user) + user.visible_message("[user] begins tightening \the [src] around [user.p_their()] neck! It looks like [user.p_they()] forgot how to use medical supplies!") + return OXYLOSS + +/obj/item/stack/medical/gauze/improvised + name = "improvised gauze" + singular_name = "improvised gauze" + desc = "A roll of cloth roughly cut from something that can stop bleeding, but does not heal wounds." + stop_bleeding = 900 + +/obj/item/stack/medical/gauze/cyborg + materials = list() + is_cyborg = 1 + cost = 250 + +/obj/item/stack/medical/ointment + name = "ointment" + desc = "Used to treat those nasty burn wounds." + gender = PLURAL + singular_name = "ointment" + icon_state = "ointment" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + heal_burn = 40 + self_delay = 20 + grind_results = list(/datum/reagent/medicine/silver_sulfadiazine = 10) + +/obj/item/stack/medical/ointment/suicide_act(mob/living/user) + user.visible_message("[user] is squeezing \the [src] into [user.p_their()] mouth! [user.p_do(TRUE)]n't [user.p_they()] know that stuff is toxic?") + return TOXLOSS + +/obj/item/stack/medical/get_belt_overlay() + return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch") diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm index 49244772..c42cfbe5 100644 --- a/code/game/objects/items/stacks/sheets/light.dm +++ b/code/game/objects/items/stacks/sheets/light.dm @@ -1,35 +1,35 @@ -/obj/item/stack/light_w - name = "wired glass tile" - singular_name = "wired glass floor tile" - desc = "A glass tile, which is wired, somehow." - icon = 'icons/obj/tiles.dmi' - icon_state = "glass_wire" - w_class = WEIGHT_CLASS_NORMAL - force = 3 - throwforce = 5 - throw_speed = 3 - throw_range = 7 - flags_1 = CONDUCT_1 - max_amount = 60 - grind_results = list("silicon" = 20, "copper" = 5) - -/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/stack/sheet/metal)) - var/obj/item/stack/sheet/metal/M = O - if (M.use(1)) - var/obj/item/L = new /obj/item/stack/tile/light(user.drop_location()) - to_chat(user, "You make a light tile.") - L.add_fingerprint(user) - use(1) - else - to_chat(user, "You need one metal sheet to finish the light tile!") - else - return ..() - -/obj/item/stack/light_w/wirecutter_act(mob/living/user, obj/item/I) - var/atom/Tsec = user.drop_location() - var/obj/item/stack/cable_coil/CC = new (Tsec, 5) - CC.add_fingerprint(user) - var/obj/item/stack/sheet/glass/G = new (Tsec) - G.add_fingerprint(user) - use(1) +/obj/item/stack/light_w + name = "wired glass tile" + singular_name = "wired glass floor tile" + desc = "A glass tile, which is wired, somehow." + icon = 'icons/obj/tiles.dmi' + icon_state = "glass_wire" + w_class = WEIGHT_CLASS_NORMAL + force = 3 + throwforce = 5 + throw_speed = 3 + throw_range = 7 + flags_1 = CONDUCT_1 + max_amount = 60 + grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/copper = 5) + +/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params) + if(istype(O, /obj/item/stack/sheet/metal)) + var/obj/item/stack/sheet/metal/M = O + if (M.use(1)) + var/obj/item/L = new /obj/item/stack/tile/light(user.drop_location()) + to_chat(user, "You make a light tile.") + L.add_fingerprint(user) + use(1) + else + to_chat(user, "You need one metal sheet to finish the light tile!") + else + return ..() + +/obj/item/stack/light_w/wirecutter_act(mob/living/user, obj/item/I) + var/atom/Tsec = user.drop_location() + var/obj/item/stack/cable_coil/CC = new (Tsec, 5) + CC.add_fingerprint(user) + var/obj/item/stack/sheet/glass/G = new (Tsec) + G.add_fingerprint(user) + use(1) diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 1f1ceb3b..c27f4e65 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -108,7 +108,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ sheettype = "diamond" materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT) novariants = TRUE - grind_results = list("carbon" = 20) + grind_results = list(/datum/reagent/carbon = 20) point_value = 25 merge_type = /obj/item/stack/sheet/mineral/diamond @@ -135,7 +135,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \ sheettype = "uranium" materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT) novariants = TRUE - grind_results = list("uranium" = 20) + grind_results = list(/datum/reagent/uranium = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/uranium @@ -162,7 +162,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \ resistance_flags = FLAMMABLE max_integrity = 100 materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT) - grind_results = list("plasma" = 20) + grind_results = list(/datum/reagent/toxin/plasma = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/plasma @@ -203,7 +203,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \ singular_name = "gold bar" sheettype = "gold" materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT) - grind_results = list("gold" = 20) + grind_results = list(/datum/reagent/gold = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/gold @@ -232,7 +232,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \ singular_name = "silver bar" sheettype = "silver" materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT) - grind_results = list("silver" = 20) + grind_results = list(/datum/reagent/silver = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/silver tableVariant = /obj/structure/table/optable @@ -262,7 +262,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \ sheettype = "bananium" materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT) novariants = TRUE - grind_results = list("banana" = 20) + grind_results = list(/datum/reagent/consumable/banana = 20) point_value = 50 merge_type = /obj/item/stack/sheet/mineral/bananium @@ -342,7 +342,7 @@ GLOBAL_LIST_INIT(plastitanium_recipes, list ( \ singular_name = "snow block" force = 1 throwforce = 2 - grind_results = list("ice" = 20) + grind_results = list(/datum/reagent/consumable/ice = 20) merge_type = /obj/item/stack/sheet/mineral/snow GLOBAL_LIST_INIT(snow_recipes, list ( \ @@ -422,7 +422,7 @@ GLOBAL_LIST_INIT(abductor_recipes, list ( \ icon_state = "slag" singular_name = "coal lump" merge_type = /obj/item/stack/sheet/mineral/coal - grind_results = list("carbon" = 20) + grind_results = list(/datum/reagent/carbon = 20) /obj/item/stack/sheet/mineral/coal/attackby(obj/item/W, mob/user, params) if(W.get_temperature() > 300)//If the temperature of the object is over 300, then ignite diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index f475e13d..635035f1 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -107,7 +107,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ flags_1 = CONDUCT_1 resistance_flags = FIRE_PROOF merge_type = /obj/item/stack/sheet/metal - grind_results = list("iron" = 20) + grind_results = list(/datum/reagent/iron = 20) point_value = 2 tableVariant = /obj/structure/table @@ -170,7 +170,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 80) resistance_flags = FIRE_PROOF merge_type = /obj/item/stack/sheet/plasteel - grind_results = list("iron" = 20, "plasma" = 20) + grind_results = list(/datum/reagent/iron = 20, /datum/reagent/toxin/plasma = 20) point_value = 23 tableVariant = /obj/structure/table/reinforced @@ -235,7 +235,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ resistance_flags = FLAMMABLE merge_type = /obj/item/stack/sheet/mineral/wood novariants = TRUE - grind_results = list("carbon" = 20) + grind_results = list(/datum/reagent/carbon = 20) /obj/item/stack/sheet/mineral/wood/Initialize(mapload, new_amount, merge = TRUE) recipes = GLOB.wood_recipes @@ -484,7 +484,7 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list ( \ sheettype = "runed" merge_type = /obj/item/stack/sheet/runed_metal novariants = TRUE - grind_results = list("iron" = 5, "blood" = 15) + grind_results = list(/datum/reagent/iron = 5, /datum/reagent/blood = 15) /obj/item/stack/sheet/runed_metal/ratvar_act() new /obj/item/stack/tile/brass(loc, amount) @@ -560,7 +560,7 @@ GLOBAL_LIST_INIT(brass_recipes, list ( \ throw_range = 3 turf_type = /turf/open/floor/clockwork novariants = FALSE - grind_results = list("iron" = 5, "teslium" = 15, "holyoil" = 1) + grind_results = list(/datum/reagent/iron = 5, /datum/reagent/teslium = 15, /datum/reagent/fuel/holyoil = 1) merge_type = /obj/item/stack/tile/brass tableVariant = /obj/structure/table/reinforced/brass @@ -613,7 +613,7 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ throw_range = 3 turf_type = /turf/open/floor/bronze novariants = FALSE - grind_results = list("iron" = 5, "copper" = 3) //we have no "tin" reagent so this is the closest thing + grind_results = list(/datum/reagent/iron = 5, /datum/reagent/copper = 3) //we have no "tin" reagent so this is the closest thing merge_type = /obj/item/stack/tile/bronze tableVariant = /obj/structure/table/bronze @@ -667,7 +667,7 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ w_class = WEIGHT_CLASS_NORMAL throw_speed = 1 throw_range = 3 - grind_results = list("carbon" = 10) + grind_results = list(/datum/reagent/carbon = 10) merge_type = /obj/item/stack/sheet/bone GLOBAL_LIST_INIT(plastic_recipes, list( diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index c658eee3..e47021c1 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -163,16 +163,16 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", for(var/obj/effect/rune/R in orange(2,user)) R.invisibility = 0 if(user.mind && (user.mind.isholy)) - if(A.reagents && A.reagents.has_reagent("water")) // blesses all the water in the holder + if(A.reagents && A.reagents.has_reagent(/datum/reagent/water)) // blesses all the water in the holder to_chat(user, "You bless [A].") - var/water2holy = A.reagents.get_reagent_amount("water") - A.reagents.del_reagent("water") - A.reagents.add_reagent("holywater",water2holy) - if(A.reagents && A.reagents.has_reagent("unholywater")) // yeah yeah, copy pasted code - sue me + var/water2holy = A.reagents.get_reagent_amount(/datum/reagent/water) + A.reagents.del_reagent(/datum/reagent/water) + A.reagents.add_reagent(/datum/reagent/water/holywater,water2holy) + if(A.reagents && A.reagents.has_reagent(/datum/reagent/fuel/unholywater)) // yeah yeah, copy pasted code - sue me to_chat(user, "You purify [A].") - var/unholy2clean = A.reagents.get_reagent_amount("unholywater") - A.reagents.del_reagent("unholywater") - A.reagents.add_reagent("holywater",unholy2clean) + var/unholy2clean = A.reagents.get_reagent_amount(/datum/reagent/fuel/unholywater) + A.reagents.del_reagent(/datum/reagent/fuel/unholywater) + A.reagents.add_reagent(/datum/reagent/water/holywater,unholy2clean) if(istype(A, /obj/item/twohanded/required/cult_bastard) && !iscultist(user)) var/obj/item/twohanded/required/cult_bastard/sword = A to_chat(user, "You begin to exorcise [sword].") diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm index 8f2b8509..59628460 100644 --- a/code/game/objects/items/tanks/watertank.dm +++ b/code/game/objects/items/tanks/watertank.dm @@ -148,7 +148,7 @@ /obj/item/watertank/janitor/Initialize() . = ..() - reagents.add_reagent("cleaner", 500) + reagents.add_reagent(/datum/reagent/space_cleaner, 500) /obj/item/reagent_containers/spray/mister/janitor name = "janitor spray nozzle" @@ -184,7 +184,7 @@ /obj/item/watertank/atmos/Initialize() . = ..() - reagents.add_reagent("water", 200) + reagents.add_reagent(/datum/reagent/water, 200) /obj/item/watertank/atmos/make_noz() return new /obj/item/extinguisher/mini/nozzle(src) @@ -436,13 +436,13 @@ /obj/item/watertank/op/Initialize() . = ..() - reagents.add_reagent("mutagen",350) - reagents.add_reagent("napalm",125) - reagents.add_reagent("welding_fuel",125) - reagents.add_reagent("clf3",300) - reagents.add_reagent("cryptobiolin",350) - reagents.add_reagent("plasma",250) - reagents.add_reagent("condensedcapsaicin",500) + reagents.add_reagent(/datum/reagent/toxin/mutagen,350) + reagents.add_reagent(/datum/reagent/napalm,125) + reagents.add_reagent(/datum/reagent/fuel,125) + reagents.add_reagent(/datum/reagent/clf3,300) + reagents.add_reagent(/datum/reagent/cryptobiolin,350) + reagents.add_reagent(/datum/reagent/toxin/plasma,250) + reagents.add_reagent(/datum/reagent/consumable/condensedcapsaicin,500) /obj/item/reagent_containers/spray/mister/op desc = "A mister nozzle attached to several extended water tanks. It suspiciously has a compressor in the system and is labelled entirely in New Cyrillic." diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 9177602f..e3711971 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -37,7 +37,7 @@ /obj/item/weldingtool/Initialize() . = ..() create_reagents(max_fuel) - reagents.add_reagent("welding_fuel", max_fuel) + reagents.add_reagent(/datum/reagent/fuel, max_fuel) update_icon() @@ -97,7 +97,7 @@ /obj/item/weldingtool/proc/explode() var/turf/T = get_turf(loc) - var/plasmaAmount = reagents.get_reagent_amount("plasma") + var/plasmaAmount = reagents.get_reagent_amount(/datum/reagent/toxin/plasma) dyn_explosion(T, plasmaAmount/5)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder qdel(src) @@ -142,7 +142,7 @@ /obj/item/weldingtool/attack_self(mob/user) - if(src.reagents.has_reagent("plasma")) + if(src.reagents.has_reagent(/datum/reagent/toxin/plasma)) message_admins("[ADMIN_LOOKUPFLW(user)] activated a rigged welder at [AREACOORD(user)].") explode() switched_on(user) @@ -154,7 +154,7 @@ // Returns the amount of fuel in the welder /obj/item/weldingtool/proc/get_fuel() - return reagents.get_reagent_amount("welding_fuel") + return reagents.get_reagent_amount(/datum/reagent/fuel) // Uses fuel from the welding tool. @@ -165,7 +165,7 @@ if(used) burned_fuel_for = 0 if(get_fuel() >= used) - reagents.remove_reagent("welding_fuel", used) + reagents.remove_reagent(/datum/reagent/fuel, used) check_fuel() return TRUE else @@ -331,7 +331,7 @@ /obj/item/weldingtool/abductor/process() if(get_fuel() <= max_fuel) - reagents.add_reagent("welding_fuel", 1) + reagents.add_reagent(/datum/reagent/fuel, 1) ..() /obj/item/weldingtool/hugetank @@ -375,7 +375,7 @@ ..() if(get_fuel() < max_fuel && nextrefueltick < world.time) nextrefueltick = world.time + 10 - reagents.add_reagent("welding_fuel", 1) + reagents.add_reagent(/datum/reagent/fuel, 1) /obj/item/weldingtool/advanced name = "advanced welding tool" @@ -388,7 +388,7 @@ /obj/item/weldingtool/advanced/process() if(get_fuel() <= max_fuel) - reagents.add_reagent("welding_fuel", 1) + reagents.add_reagent(/datum/reagent/fuel, 1) ..() #undef WELDER_FUEL_BURN_INTERVAL diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 734b7b89..89354a01 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -1,85 +1,85 @@ -//Added by Jack Rost -/obj/item/trash - icon = 'icons/obj/janitor.dmi' - lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi' - righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi' - desc = "This is rubbish." - w_class = WEIGHT_CLASS_TINY - resistance_flags = FLAMMABLE - -/obj/item/trash/raisins - name = "\improper 4no raisins" - icon_state= "4no_raisins" - -/obj/item/trash/candy - name = "candy" - icon_state= "candy" - -/obj/item/trash/cheesie - name = "cheesie honkers" - icon_state = "cheesie_honkers" - -/obj/item/trash/chips - name = "chips" - icon_state = "chips" - -/obj/item/trash/popcorn - name = "popcorn" - icon_state = "popcorn" - -/obj/item/trash/sosjerky - name = "\improper Scaredy's Private Reserve Beef Jerky" - icon_state = "sosjerky" - -/obj/item/trash/syndi_cakes - name = "syndi-cakes" - icon_state = "syndi_cakes" - -/obj/item/trash/waffles - name = "waffles tray" - icon_state = "waffles" - -/obj/item/trash/plate - name = "plate" - icon_state = "plate" - resistance_flags = NONE - -/obj/item/trash/pistachios - name = "pistachios pack" - icon_state = "pistachios_pack" - -/obj/item/trash/semki - name = "semki pack" - icon_state = "semki_pack" - -/obj/item/trash/tray - name = "tray" - icon_state = "tray" - resistance_flags = NONE - -/obj/item/trash/candle - name = "candle" - icon = 'icons/obj/candle.dmi' - icon_state = "candle4" - -/obj/item/trash/can - name = "crushed can" - icon_state = "cola" - resistance_flags = NONE - grind_results = list("aluminium" = 10) - -/obj/item/trash/boritos - name = "boritos bag" - icon_state = "boritos" - grind_results = list("aluminium" = 1) //from the mylar bag - -/obj/item/trash/soy_food - name = "soyfood" - icon_state = "soy_food" - -/obj/item/trash/carbonnanotube_noodles - name = "carbon nanotube noodles" - icon_state = "carbonnanotube_noodles" - -/obj/item/trash/attack(mob/M, mob/living/user) - return +//Added by Jack Rost +/obj/item/trash + icon = 'icons/obj/janitor.dmi' + lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi' + desc = "This is rubbish." + w_class = WEIGHT_CLASS_TINY + resistance_flags = FLAMMABLE + +/obj/item/trash/raisins + name = "\improper 4no raisins" + icon_state= "4no_raisins" + +/obj/item/trash/candy + name = "candy" + icon_state= "candy" + +/obj/item/trash/cheesie + name = "cheesie honkers" + icon_state = "cheesie_honkers" + +/obj/item/trash/chips + name = "chips" + icon_state = "chips" + +/obj/item/trash/popcorn + name = "popcorn" + icon_state = "popcorn" + +/obj/item/trash/sosjerky + name = "\improper Scaredy's Private Reserve Beef Jerky" + icon_state = "sosjerky" + +/obj/item/trash/syndi_cakes + name = "syndi-cakes" + icon_state = "syndi_cakes" + +/obj/item/trash/waffles + name = "waffles tray" + icon_state = "waffles" + +/obj/item/trash/plate + name = "plate" + icon_state = "plate" + resistance_flags = NONE + +/obj/item/trash/pistachios + name = "pistachios pack" + icon_state = "pistachios_pack" + +/obj/item/trash/semki + name = "semki pack" + icon_state = "semki_pack" + +/obj/item/trash/tray + name = "tray" + icon_state = "tray" + resistance_flags = NONE + +/obj/item/trash/candle + name = "candle" + icon = 'icons/obj/candle.dmi' + icon_state = "candle4" + +/obj/item/trash/can + name = "crushed can" + icon_state = "cola" + resistance_flags = NONE + grind_results = list(/datum/reagent/aluminium = 10) + +/obj/item/trash/boritos + name = "boritos bag" + icon_state = "boritos" + grind_results = list(/datum/reagent/aluminium = 1) //from the mylar bag + +/obj/item/trash/soy_food + name = "soyfood" + icon_state = "soy_food" + +/obj/item/trash/carbonnanotube_noodles + name = "carbon nanotube noodles" + icon_state = "carbonnanotube_noodles" + +/obj/item/trash/attack(mob/M, mob/living/user) + return diff --git a/code/game/objects/structures/divine.dm b/code/game/objects/structures/divine.dm index 5fd480f6..91836b83 100644 --- a/code/game/objects/structures/divine.dm +++ b/code/game/objects/structures/divine.dm @@ -39,7 +39,7 @@ return last_process = world.time to_chat(user, "The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.") - user.reagents.add_reagent("godblood",20) + user.reagents.add_reagent(/datum/reagent/medicine/omnizine/godblood,20) update_icons() addtimer(CALLBACK(src, .proc/update_icons), time_between_uses) @@ -48,4 +48,4 @@ if(last_process + time_between_uses > world.time) icon_state = "fountain" else - icon_state = "fountain-red" \ No newline at end of file + icon_state = "fountain-red" diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 92d9e550..cc201ae9 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -101,7 +101,7 @@ if (!open) return var/obj/item/reagent_containers/RG = I - RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this)) + RG.reagents.add_reagent(/datum/reagent/water, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this)) to_chat(user, "You fill [RG] from [src]. Gross.") else return ..() @@ -199,8 +199,7 @@ icon = 'icons/obj/items_and_weapons.dmi' icon_state = "urinalcake" w_class = WEIGHT_CLASS_TINY - list_reagents = list(chlorine = 3, ammonia = 1) - foodtype = TOXIC | GROSS + list_reagents = list(/datum/reagent/chlorine = 3, /datum/reagent/ammonia = 1) /obj/item/reagent_containers/food/snacks/urinalcake/attack_self(mob/living/user) user.visible_message("[user] squishes [src]!", "You squish [src].", "You hear a squish.") @@ -462,7 +461,7 @@ desc = "A sink used for washing one's hands and face." anchored = TRUE var/busy = FALSE //Something's being washed at the moment - var/dispensedreagent = "water" // for whenever plumbing happens + var/dispensedreagent = /datum/reagent/water // for whenever plumbing happens /obj/structure/sink/attack_hand(mob/living/user) @@ -537,7 +536,7 @@ return if(istype(O, /obj/item/mop)) - O.reagents.add_reagent("[dispensedreagent]", 5) + O.reagents.add_reagent(dispensedreagent, 5) to_chat(user, "You wet [O] in [src].") playsound(loc, 'sound/effects/slosh.ogg', 25, 1) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 180ef378..5652e067 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -557,12 +557,10 @@ clear_reagents_to_vomit_pool(C,V) /proc/clear_reagents_to_vomit_pool(mob/living/carbon/M, obj/effect/decal/cleanable/vomit/V) + for(var/datum/reagent/consumable/R in M.reagents.reagent_list) //clears the stomach of anything that might be digested as food + if(R.nutriment_factor > 0) + M.reagents.del_reagent(R.type) M.reagents.trans_to(V, M.reagents.total_volume / 10) - for(var/datum/reagent/R in M.reagents.reagent_list) //clears the stomach of anything that might be digested as food - if(istype(R, /datum/reagent/consumable)) - var/datum/reagent/consumable/nutri_check = R - if(nutri_check.nutriment_factor >0) - M.reagents.remove_reagent(R.id,R.volume) //Whatever happens after high temperature fire dies out or thermite reaction works. //Should return new turf diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 2f5ef65e..75cf91f7 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -757,7 +757,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} can_buckle = 1 buckle_lying = 1 - var/static/list/injected_reagents = list("corazone") + var/static/list/injected_reagents = list(/datum/reagent/medicine/corazone) /obj/structure/table/optable/abductor/Crossed(atom/movable/AM) . = ..() diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 35a1135b..c2b4f548 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -297,21 +297,14 @@ var/list/possible_reagents = list() /obj/item/organ/heart/gland/chem/Initialize() - ..() - for(var/X in subtypesof(/datum/reagent/drug)) - var/datum/reagent/R = X - possible_reagents += initial(R.id) - for(var/X in subtypesof(/datum/reagent/medicine)) - var/datum/reagent/R = X - possible_reagents += initial(R.id) - for(var/X in typesof(/datum/reagent/toxin)) - var/datum/reagent/R = X - possible_reagents += initial(R.id) + . = ..() + for(var/R in subtypesof(/datum/reagent/drug) + subtypesof(/datum/reagent/medicine) + typesof(/datum/reagent/toxin)) + possible_reagents += R /obj/item/organ/heart/gland/chem/activate() var/chem_to_add = pick(possible_reagents) owner.reagents.add_reagent(chem_to_add, 2) - owner.adjustToxLoss(-2, TRUE, TRUE) + owner.adjustToxLoss(-5, TRUE, TRUE) ..() /obj/item/organ/heart/gland/plasma diff --git a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm index 3cb90d64..182fcea0 100644 --- a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm @@ -143,9 +143,9 @@ create_reagents(10) if(overmind && overmind.blob_reagent_datum) - reagents.add_reagent(overmind.blob_reagent_datum.id, 10) + reagents.add_reagent(overmind.blob_reagent_datum.type, 10) else - reagents.add_reagent("spore", 10) + reagents.add_reagent(/datum/reagent/toxin/spore, 10) // Attach the smoke spreader and setup/start it. S.attach(location) diff --git a/code/modules/antagonists/changeling/powers/adrenaline.dm b/code/modules/antagonists/changeling/powers/adrenaline.dm index 256d3e89..ba403888 100644 --- a/code/modules/antagonists/changeling/powers/adrenaline.dm +++ b/code/modules/antagonists/changeling/powers/adrenaline.dm @@ -13,5 +13,5 @@ //Recover from stuns. /obj/effect/proc_holder/changeling/adrenaline/sting_action(mob/living/user) - user.do_adrenaline(0, FALSE, 70, 0, TRUE, list("epinephrine" = 3, "changelingmeth" = 10, "mannitol" = 10, "regen_jelly" = 10, "changelingadrenaline" = 5), "Energy rushes through us.", 0, 0.75, 0) + user.do_adrenaline(0, FALSE, 70, 0, TRUE, list(/datum/reagent/medicine/epinephrine = 3, /datum/reagent/drug/methamphetamine/changeling = 10, /datum/reagent/medicine/mannitol = 10, /datum/reagent/medicine/regen_jelly = 10, /datum/reagent/medicine/changelingadrenaline = 5), "Energy rushes through us.", 0, 0.75, 0) return TRUE \ No newline at end of file diff --git a/code/modules/antagonists/changeling/powers/linglink.dm b/code/modules/antagonists/changeling/powers/linglink.dm index 971c8110..332f5435 100644 --- a/code/modules/antagonists/changeling/powers/linglink.dm +++ b/code/modules/antagonists/changeling/powers/linglink.dm @@ -58,7 +58,7 @@ target.mind.linglink = 1 target.say("[MODE_TOKEN_CHANGELING] AAAAARRRRGGGGGHHHHH!!") to_chat(target, "You can now communicate in the changeling hivemind, say \"[MODE_TOKEN_CHANGELING] message\" to communicate!") - target.reagents.add_reagent("salbutamol", 40) // So they don't choke to death while you interrogate them + target.reagents.add_reagent(/datum/reagent/medicine/salbutamol, 40) // So they don't choke to death while you interrogate them sleep(1800) SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]", "[i]")) if(!do_mob(user, target, 20)) diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index c428c56d..b91c3146 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -500,7 +500,7 @@ /obj/item/clothing/suit/space/changeling/process() if(ishuman(loc)) var/mob/living/carbon/human/H = loc - H.reagents.add_reagent("salbutamol", REAGENTS_METABOLISM) + H.reagents.add_reagent(/datum/reagent/medicine/salbutamol, REAGENTS_METABOLISM) /obj/item/clothing/head/helmet/space/changeling name = "flesh mass" diff --git a/code/modules/antagonists/changeling/powers/panacea.dm b/code/modules/antagonists/changeling/powers/panacea.dm index 8d571d21..2a0451bc 100644 --- a/code/modules/antagonists/changeling/powers/panacea.dm +++ b/code/modules/antagonists/changeling/powers/panacea.dm @@ -28,10 +28,10 @@ C.vomit(0, toxic = TRUE) O.forceMove(get_turf(user)) - user.reagents.add_reagent("mutadone", 10) - user.reagents.add_reagent("pen_jelly", 20) - user.reagents.add_reagent("antihol", 10) - user.reagents.add_reagent("mannitol", 25) + user.reagents.add_reagent(/datum/reagent/medicine/mutadone, 10) + user.reagents.add_reagent(/datum/reagent/medicine/pen_acid/pen_jelly, 20) + user.reagents.add_reagent(/datum/reagent/medicine/antihol, 10) + user.reagents.add_reagent(/datum/reagent/medicine/mannitol, 25) if(isliving(user)) var/mob/living/L = user diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index 04e9b8ef..dc7887ee 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -1,266 +1,266 @@ -/obj/effect/proc_holder/changeling/sting - name = "Tiny Prick" - desc = "Stabby stabby." - var/sting_icon = null - -/obj/effect/proc_holder/changeling/sting/Click() - var/mob/user = usr - if(!user || !user.mind) - return - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - if(!changeling) - return - if(!changeling.chosen_sting) - set_sting(user) - else - unset_sting(user) - return - -/obj/effect/proc_holder/changeling/sting/proc/set_sting(mob/user) - to_chat(user, "We prepare our sting, use alt+click or middle mouse button on target to sting them.") - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - changeling.chosen_sting = src - - user.hud_used.lingstingdisplay.icon_state = sting_icon - user.hud_used.lingstingdisplay.invisibility = 0 - -/obj/effect/proc_holder/changeling/sting/proc/unset_sting(mob/user) - to_chat(user, "We retract our sting, we can't sting anyone for now.") - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - changeling.chosen_sting = null - - user.hud_used.lingstingdisplay.icon_state = null - user.hud_used.lingstingdisplay.invisibility = INVISIBILITY_ABSTRACT - -/mob/living/carbon/proc/unset_sting() - if(mind) - var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling && changeling.chosen_sting) - changeling.chosen_sting.unset_sting(src) - -/obj/effect/proc_holder/changeling/sting/can_sting(mob/user, mob/target) - if(!..()) - return - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - if(!changeling.chosen_sting) - to_chat(user, "We haven't prepared our sting yet!") - if(!iscarbon(target)) - return - if(!isturf(user.loc)) - return - if(!AStar(user, target.loc, /turf/proc/Distance, changeling.sting_range, simulated_only = 0)) - return - return 1 - -/obj/effect/proc_holder/changeling/sting/sting_feedback(mob/user, mob/target) - if(!target) - return - to_chat(user, "We stealthily sting [target.name].") - if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) - to_chat(target, "You feel a tiny prick.") - return 1 - - -/obj/effect/proc_holder/changeling/sting/transformation - name = "Temporary Transformation Sting" - desc = "We silently sting a human, injecting a chemical that forces them to transform into a chosen being for a limited time. Additional stings extend the duration." - helptext = "The victim will transform much like a changeling would for a limited time. Does not provide a warning to others. Mutations will not be transferred, and monkeys will become human. This ability is loud, and might cause our blood to react violently to heat." - sting_icon = "sting_transform" - chemical_cost = 10 - dna_cost = 2 - loudness = 1 - var/datum/changelingprofile/selected_dna = null - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_transform" - action_background_icon_state = "bg_ling" - -/obj/effect/proc_holder/changeling/sting/transformation/Click() - var/mob/user = usr - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling.chosen_sting) - unset_sting(user) - return - selected_dna = changeling.select_dna("Select the target DNA: ", "Target DNA") - if(!selected_dna) - return - if(NOTRANSSTING in selected_dna.dna.species.species_traits) - to_chat(user, "That DNA is not compatible with changeling retrovirus!") - return - ..() - -/obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target) - if(!..()) - return - if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) - to_chat(user, "Our sting appears ineffective against its DNA.") - return 0 - return 1 - -/obj/effect/proc_holder/changeling/sting/transformation/sting_action(mob/user, mob/target) - - if(ismonkey(target)) - to_chat(user, "Our genes cry out as we sting [target.name]!") - - var/mob/living/carbon/C = target - . = TRUE - if(istype(C)) - if(C.reagents.has_reagent("changeling_sting_real")) - C.reagents.add_reagent("changeling_sting_real",120) - log_combat(user, target, "stung", "transformation sting", ", extending the duration.") - else - C.reagents.add_reagent("changeling_sting_real",120,list("desired_dna" = selected_dna.dna)) - log_combat(user, target, "stung", "transformation sting", " new identity is '[selected_dna.dna.real_name]'") - - -/obj/effect/proc_holder/changeling/sting/false_armblade - name = "False Armblade Sting" - desc = "We silently sting a human, injecting a retrovirus that mutates their arm to temporarily appear as an armblade." - helptext = "The victim will form an armblade much like a changeling would, except the armblade is dull and useless. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." - sting_icon = "sting_armblade" - chemical_cost = 20 - dna_cost = 1 - loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_fake" - action_background_icon_state = "bg_ling" - -/obj/item/melee/arm_blade/false - desc = "A grotesque mass of flesh that used to be your arm. Although it looks dangerous at first, you can tell it's actually quite dull and useless." - force = 5 //Basically as strong as a punch - fake = TRUE - -/obj/effect/proc_holder/changeling/sting/false_armblade/can_sting(mob/user, mob/target) - if(!..()) - return - if(isliving(target)) - var/mob/living/L = target - if((HAS_TRAIT(L, TRAIT_HUSK)) || !L.has_dna()) - to_chat(user, "Our sting appears ineffective against its DNA.") - return 0 - return 1 - -/obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) - log_combat(user, target, "stung", object="false armblade sting") - - var/obj/item/held = target.get_active_held_item() - if(held && !target.dropItemToGround(held)) - to_chat(user, "[held] is stuck to [target.p_their()] hand, you cannot grow a false armblade over it!") - return - - if(ismonkey(target)) - to_chat(user, "Our genes cry out as we sting [target.name]!") - - var/obj/item/melee/arm_blade/false/blade = new(target,1) - target.put_in_hands(blade) - target.visible_message("A grotesque blade forms around [target.name]\'s arm!", "Your arm twists and mutates, transforming into a horrific monstrosity!", "You hear organic matter ripping and tearing!") - playsound(target, 'sound/effects/blobattack.ogg', 30, 1) - - addtimer(CALLBACK(src, .proc/remove_fake, target, blade), 600) - return TRUE - -/obj/effect/proc_holder/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/melee/arm_blade/false/blade) - playsound(target, 'sound/effects/blobattack.ogg', 30, 1) - target.visible_message("With a sickening crunch, \ - [target] reforms [target.p_their()] [blade.name] into an arm!", - "[blade] reforms back to normal.", - "Your eyes burn horrifically!") - target.become_nearsighted(EYE_DAMAGE) - target.blind_eyes(20) - target.blur_eyes(40) - return TRUE - -/obj/effect/proc_holder/changeling/sting/LSD - name = "Hallucination Sting" - desc = "Causes terror in the target and deals a minor amount of toxin damage." - helptext = "We evolve the ability to sting a target with a powerful toxic hallucinogenic chemical. The target does not notice they have been stung, and the effect begins instantaneously. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." - sting_icon = "sting_lsd" - chemical_cost = 10 - dna_cost = 1 - loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_lsd" - action_background_icon_state = "bg_ling" - -/obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/target) - log_combat(user, target, "stung", "LSD sting") - if(target.reagents) - target.reagents.add_reagent("regenerative_materia", 5) - target.reagents.add_reagent("mindbreaker", 5) - return TRUE - -/obj/effect/proc_holder/changeling/sting/cryo - name = "Cryogenic Sting" - desc = "We silently sting a human with a cocktail of chemicals that freeze them." - helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." - sting_icon = "sting_cryo" - chemical_cost = 15 - dna_cost = 2 - loudness = 1 - action_icon = 'icons/mob/actions/actions_changeling.dmi' - action_icon_state = "ling_sting_cryo" - action_background_icon_state = "bg_ling" - -/obj/effect/proc_holder/changeling/sting/cryo/sting_action(mob/user, mob/target) - log_combat(user, target, "stung", "cryo sting") - if(target.reagents) - target.reagents.add_reagent("frostoil", 30) - return TRUE +/obj/effect/proc_holder/changeling/sting + name = "Tiny Prick" + desc = "Stabby stabby." + var/sting_icon = null + +/obj/effect/proc_holder/changeling/sting/Click() + var/mob/user = usr + if(!user || !user.mind) + return + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + if(!changeling) + return + if(!changeling.chosen_sting) + set_sting(user) + else + unset_sting(user) + return + +/obj/effect/proc_holder/changeling/sting/proc/set_sting(mob/user) + to_chat(user, "We prepare our sting, use alt+click or middle mouse button on target to sting them.") + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + changeling.chosen_sting = src + + user.hud_used.lingstingdisplay.icon_state = sting_icon + user.hud_used.lingstingdisplay.invisibility = 0 + +/obj/effect/proc_holder/changeling/sting/proc/unset_sting(mob/user) + to_chat(user, "We retract our sting, we can't sting anyone for now.") + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + changeling.chosen_sting = null + + user.hud_used.lingstingdisplay.icon_state = null + user.hud_used.lingstingdisplay.invisibility = INVISIBILITY_ABSTRACT + +/mob/living/carbon/proc/unset_sting() + if(mind) + var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling && changeling.chosen_sting) + changeling.chosen_sting.unset_sting(src) + +/obj/effect/proc_holder/changeling/sting/can_sting(mob/user, mob/target) + if(!..()) + return + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + if(!changeling.chosen_sting) + to_chat(user, "We haven't prepared our sting yet!") + if(!iscarbon(target)) + return + if(!isturf(user.loc)) + return + if(!AStar(user, target.loc, /turf/proc/Distance, changeling.sting_range, simulated_only = 0)) + return + return 1 + +/obj/effect/proc_holder/changeling/sting/sting_feedback(mob/user, mob/target) + if(!target) + return + to_chat(user, "We stealthily sting [target.name].") + if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) + to_chat(target, "You feel a tiny prick.") + return 1 + + +/obj/effect/proc_holder/changeling/sting/transformation + name = "Temporary Transformation Sting" + desc = "We silently sting a human, injecting a chemical that forces them to transform into a chosen being for a limited time. Additional stings extend the duration." + helptext = "The victim will transform much like a changeling would for a limited time. Does not provide a warning to others. Mutations will not be transferred, and monkeys will become human. This ability is loud, and might cause our blood to react violently to heat." + sting_icon = "sting_transform" + chemical_cost = 10 + dna_cost = 2 + loudness = 1 + var/datum/changelingprofile/selected_dna = null + action_icon = 'icons/mob/actions/actions_changeling.dmi' + action_icon_state = "ling_sting_transform" + action_background_icon_state = "bg_ling" + +/obj/effect/proc_holder/changeling/sting/transformation/Click() + var/mob/user = usr + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling.chosen_sting) + unset_sting(user) + return + selected_dna = changeling.select_dna("Select the target DNA: ", "Target DNA") + if(!selected_dna) + return + if(NOTRANSSTING in selected_dna.dna.species.species_traits) + to_chat(user, "That DNA is not compatible with changeling retrovirus!") + return + ..() + +/obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target) + if(!..()) + return + if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) + to_chat(user, "Our sting appears ineffective against its DNA.") + return 0 + return 1 + +/obj/effect/proc_holder/changeling/sting/transformation/sting_action(mob/user, mob/target) + + if(ismonkey(target)) + to_chat(user, "Our genes cry out as we sting [target.name]!") + + var/mob/living/carbon/C = target + . = TRUE + if(istype(C)) + if(C.reagents.has_reagent(/datum/reagent/changeling_string)) + C.reagents.add_reagent(/datum/reagent/changeling_string,120) + log_combat(user, target, "stung", "transformation sting", ", extending the duration.") + else + C.reagents.add_reagent(/datum/reagent/changeling_string,120,list("desired_dna" = selected_dna.dna)) + log_combat(user, target, "stung", "transformation sting", " new identity is '[selected_dna.dna.real_name]'") + + +/obj/effect/proc_holder/changeling/sting/false_armblade + name = "False Armblade Sting" + desc = "We silently sting a human, injecting a retrovirus that mutates their arm to temporarily appear as an armblade." + helptext = "The victim will form an armblade much like a changeling would, except the armblade is dull and useless. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + sting_icon = "sting_armblade" + chemical_cost = 20 + dna_cost = 1 + loudness = 1 + action_icon = 'icons/mob/actions/actions_changeling.dmi' + action_icon_state = "ling_sting_fake" + action_background_icon_state = "bg_ling" + +/obj/item/melee/arm_blade/false + desc = "A grotesque mass of flesh that used to be your arm. Although it looks dangerous at first, you can tell it's actually quite dull and useless." + force = 5 //Basically as strong as a punch + fake = TRUE + +/obj/effect/proc_holder/changeling/sting/false_armblade/can_sting(mob/user, mob/target) + if(!..()) + return + if(isliving(target)) + var/mob/living/L = target + if((HAS_TRAIT(L, TRAIT_HUSK)) || !L.has_dna()) + to_chat(user, "Our sting appears ineffective against its DNA.") + return 0 + return 1 + +/obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) + log_combat(user, target, "stung", object="false armblade sting") + + var/obj/item/held = target.get_active_held_item() + if(held && !target.dropItemToGround(held)) + to_chat(user, "[held] is stuck to [target.p_their()] hand, you cannot grow a false armblade over it!") + return + + if(ismonkey(target)) + to_chat(user, "Our genes cry out as we sting [target.name]!") + + var/obj/item/melee/arm_blade/false/blade = new(target,1) + target.put_in_hands(blade) + target.visible_message("A grotesque blade forms around [target.name]\'s arm!", "Your arm twists and mutates, transforming into a horrific monstrosity!", "You hear organic matter ripping and tearing!") + playsound(target, 'sound/effects/blobattack.ogg', 30, 1) + + addtimer(CALLBACK(src, .proc/remove_fake, target, blade), 600) + return TRUE + +/obj/effect/proc_holder/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/melee/arm_blade/false/blade) + playsound(target, 'sound/effects/blobattack.ogg', 30, 1) + target.visible_message("With a sickening crunch, \ + [target] reforms [target.p_their()] [blade.name] into an arm!", + "[blade] reforms back to normal.", + "Your eyes burn horrifically!") + target.become_nearsighted(EYE_DAMAGE) + target.blind_eyes(20) + target.blur_eyes(40) + return TRUE + +/obj/effect/proc_holder/changeling/sting/LSD + name = "Hallucination Sting" + desc = "Causes terror in the target and deals a minor amount of toxin damage." + helptext = "We evolve the ability to sting a target with a powerful toxic hallucinogenic chemical. The target does not notice they have been stung, and the effect begins instantaneously. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + sting_icon = "sting_lsd" + chemical_cost = 10 + dna_cost = 1 + loudness = 1 + action_icon = 'icons/mob/actions/actions_changeling.dmi' + action_icon_state = "ling_sting_lsd" + action_background_icon_state = "bg_ling" + +/obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/target) + log_combat(user, target, "stung", "LSD sting") + if(target.reagents) + target.reagents.add_reagent(/datum/reagent/blob/regenerative_materia, 5) + target.reagents.add_reagent(/datum/reagent/toxin/mindbreaker, 5) + return TRUE + +/obj/effect/proc_holder/changeling/sting/cryo + name = "Cryogenic Sting" + desc = "We silently sting a human with a cocktail of chemicals that freeze them." + helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat." + sting_icon = "sting_cryo" + chemical_cost = 15 + dna_cost = 2 + loudness = 1 + action_icon = 'icons/mob/actions/actions_changeling.dmi' + action_icon_state = "ling_sting_cryo" + action_background_icon_state = "bg_ling" + +/obj/effect/proc_holder/changeling/sting/cryo/sting_action(mob/user, mob/target) + log_combat(user, target, "stung", "cryo sting") + if(target.reagents) + target.reagents.add_reagent(/datum/reagent/consumable/frostoil, 30) + return TRUE diff --git a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm index 23caa788..3cb409a4 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm @@ -100,7 +100,7 @@ var/burndamage = L.getFireLoss() var/oxydamage = L.getOxyLoss() var/totaldamage = brutedamage + burndamage + oxydamage - if(!totaldamage && (!L.reagents || !L.reagents.has_reagent("holywater"))) + if(!totaldamage && (!L.reagents || !L.reagents.has_reagent(/datum/reagent/water/holywater))) to_chat(ranged_ability_user, "\"[L] is unhurt and untainted.\"") return TRUE @@ -108,7 +108,7 @@ to_chat(ranged_ability_user, "You bathe [L == ranged_ability_user ? "yourself":"[L]"] in Inath-neq's power!") var/targetturf = get_turf(L) - var/has_holy_water = (L.reagents && L.reagents.has_reagent("holywater")) + var/has_holy_water = (L.reagents && L.reagents.has_reagent(/datum/reagent/water/holywater)) var/healseverity = max(round(totaldamage*0.05, 1), 1) //shows the general severity of the damage you just healed, 1 glow per 20 for(var/i in 1 to healseverity) new /obj/effect/temp_visual/heal(targetturf, "#1E8CE1") @@ -129,7 +129,7 @@ playsound(targetturf, 'sound/magic/staff_healing.ogg', 50, 1) if(has_holy_water) - L.reagents.remove_reagent("holywater", 1000) + L.reagents.del_reagent(/datum/reagent/water/holywater) remove_ranged_ability() diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index b638372d..47e7d201 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -502,7 +502,7 @@ icon = 'icons/obj/drinks.dmi' icon_state = "holyflask" color = "#333333" - list_reagents = list("unholywater" = 50) + list_reagents = list(/datum/reagent/fuel/unholywater = 50) /obj/item/shuttle_curse name = "cursed orb" @@ -809,7 +809,7 @@ if(ishuman(target)) var/mob/living/carbon/human/H = target if(H.stat != DEAD) - H.reagents.add_reagent("unholywater", 4) + H.reagents.add_reagent(/datum/reagent/fuel/unholywater, 4) if(isshade(target) || isconstruct(target)) var/mob/living/simple_animal/M = target if(M.health+5 < M.maxHealth) @@ -910,7 +910,7 @@ if(ishuman(target)) var/mob/living/carbon/human/H = target if(H.stat != DEAD) - H.reagents.add_reagent("unholywater", 7) + H.reagents.add_reagent(/datum/reagent/fuel/unholywater, 7) if(isshade(target) || isconstruct(target)) var/mob/living/simple_animal/M = target if(M.health+15 < M.maxHealth) diff --git a/code/modules/antagonists/cult/ritual.dm b/code/modules/antagonists/cult/ritual.dm index 805b6f82..7ca0071c 100644 --- a/code/modules/antagonists/cult/ritual.dm +++ b/code/modules/antagonists/cult/ritual.dm @@ -24,11 +24,11 @@ This file contains the cult dagger and rune list code /obj/item/melee/cultblade/dagger/attack(mob/living/M, mob/living/user) if(iscultist(M)) - if(M.reagents && M.reagents.has_reagent("holywater")) //allows cultists to be rescued from the clutches of ordained religion + if(M.reagents && M.reagents.has_reagent(/datum/reagent/water/holywater)) //allows cultists to be rescued from the clutches of ordained religion to_chat(user, "You remove the taint from [M]." ) - var/holy2unholy = M.reagents.get_reagent_amount("holywater") - M.reagents.del_reagent("holywater") - M.reagents.add_reagent("unholywater",holy2unholy) + var/holy2unholy = M.reagents.get_reagent_amount(/datum/reagent/water/holywater) + M.reagents.del_reagent(/datum/reagent/water/holywater) + M.reagents.add_reagent(/datum/reagent/fuel/unholywater,holy2unholy) log_combat(user, M, "smacked", src, " removing the holy water from them") return FALSE . = ..() diff --git a/code/modules/antagonists/devil/devil.dm b/code/modules/antagonists/devil/devil.dm index dc649025..08db3208 100644 --- a/code/modules/antagonists/devil/devil.dm +++ b/code/modules/antagonists/devil/devil.dm @@ -384,14 +384,14 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", if(BANISH_WATER) if(iscarbon(body)) var/mob/living/carbon/H = body - return H.reagents.has_reagent("holy water") + return H.reagents.has_reagent(/datum/reagent/water/holywater) return 0 if(BANISH_COFFIN) return (body && istype(body.loc, /obj/structure/closet/crate/coffin)) if(BANISH_FORMALDYHIDE) if(iscarbon(body)) var/mob/living/carbon/H = body - return H.reagents.has_reagent("formaldehyde") + return H.reagents.has_reagent(/datum/reagent/toxin/formaldehyde) return 0 if(BANISH_RUNES) if(body) diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm index 69b4f7e9..2c50b419 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm @@ -513,7 +513,7 @@ /obj/machinery/nuclearbomb/beer/proc/fizzbuzz() var/datum/reagents/R = new/datum/reagents(1000) R.my_atom = src - R.add_reagent("beer", 100) + R.add_reagent(/datum/reagent/consumable/ethanol/beer, 100) var/datum/effect_system/foam_spread/foam = new foam.set_up(200, get_turf(src), R) diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index dba4c23c..481d200f 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -351,7 +351,7 @@ to_chat(H, "You feel [pick("suddenly sick", "a surge of nausea", "like your skin is wrong")].") else if(mob.reagents) - mob.reagents.add_reagent("plasma", 5) + mob.reagents.add_reagent(/datum/reagent/toxin/plasma, 5) else mob.adjustToxLoss(5) for(var/obj/structure/spacevine/vine in T) //Fucking with botanists, the ability. diff --git a/code/modules/awaymissions/mission_code/snowdin.dm b/code/modules/awaymissions/mission_code/snowdin.dm index 7cb77173..24f83ba9 100644 --- a/code/modules/awaymissions/mission_code/snowdin.dm +++ b/code/modules/awaymissions/mission_code/snowdin.dm @@ -175,7 +175,7 @@ if(C.reagents.total_volume >= C.volume) to_chat(user, "[C] is full.") return - C.reagents.add_reagent("plasma", rand(5, 10)) + C.reagents.add_reagent(/datum/reagent/toxin/plasma, rand(5, 10)) user.visible_message("[user] scoops some plasma from the [src] with \the [C].", "You scoop out some plasma from the [src] using \the [C].") /turf/open/lava/plasma/burn_stuff(AM) diff --git a/code/modules/cargo/bounties/reagent.dm b/code/modules/cargo/bounties/reagent.dm index ee122a11..35bd95c1 100644 --- a/code/modules/cargo/bounties/reagent.dm +++ b/code/modules/cargo/bounties/reagent.dm @@ -12,7 +12,7 @@ /datum/bounty/reagent/applies_to(obj/O) if(!istype(O, /obj/item/reagent_containers)) return FALSE - if(!O.reagents || !O.reagents.has_reagent(wanted_reagent.id)) + if(!O.reagents || !O.reagents.has_reagent(wanted_reagent.type)) return FALSE if(O.flags_1 & HOLOGRAM_1) return FALSE @@ -21,7 +21,7 @@ /datum/bounty/reagent/ship(obj/O) if(!applies_to(O)) return - shipped_volume += O.reagents.get_reagent_amount(wanted_reagent.id) + shipped_volume += O.reagents.get_reagent_amount(wanted_reagent.type) if(shipped_volume > required_volume) shipped_volume = required_volume @@ -29,7 +29,7 @@ if(!istype(other_bounty, /datum/bounty/reagent)) return TRUE var/datum/bounty/reagent/R = other_bounty - return wanted_reagent.id != R.wanted_reagent.id + return wanted_reagent.type != R.wanted_reagent.type /datum/bounty/reagent/simple_drink name = "Simple Drink" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 7a3de0b6..0e0d3e5e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) "balls_cum_rate" = CUM_RATE, "balls_cum_mult" = CUM_RATE_MULT, "balls_efficiency" = CUM_EFFICIENCY, - "balls_fluid" = "semen", + "balls_fluid" = /datum/reagent/consumable/semen, "has_ovi" = FALSE, "ovi_shape" = "knotted", "ovi_length" = 6, @@ -159,7 +159,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) "breasts_color" = "fff", "breasts_size" = "C", "breasts_shape" = "Pair", - "breasts_fluid" = "milk", + "breasts_fluid" = /datum/reagent/consumable/milk, "breasts_producing" = FALSE, "has_vag" = FALSE, "vag_shape" = "Human", @@ -171,7 +171,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) "womb_cum_rate" = CUM_RATE, "womb_cum_mult" = CUM_RATE_MULT, "womb_efficiency" = CUM_EFFICIENCY, - "womb_fluid" = "femcum", + "womb_fluid" = /datum/reagent/consumable/femcum, "ipc_screen" = "Sunburst", "ipc_antenna" = "None", "flavor_text" = "" diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 4b3b222d..1de8ccf0 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -5,7 +5,7 @@ // You do not need to raise this if you are adding new values that have sane defaults. // Only raise this value when changing the meaning/format/name/layout of an existing value // where you would want the updater procs below to run -#define SAVEFILE_VERSION_MAX 21 +#define SAVEFILE_VERSION_MAX 22 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -51,6 +51,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car pda_style = "mono" if(current_version < 20) pda_color = "#808000" + if(current_version < 22) + if(features["balls_fluid"]) + features["balls_fluid"] = /datum/reagent/consumable/semen + if(features["breasts_fluid"]) + features["breasts_fluid"] = /datum/reagent/consumable/milk /datum/preferences/proc/load_path(ckey,filename="preferences.sav") if(!ckey) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 9829d3b3..a28b15f8 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,407 +1,407 @@ -/obj/item/clothing - name = "clothing" - resistance_flags = FLAMMABLE - max_integrity = 200 - integrity_failure = 80 - var/damaged_clothes = 0 //similar to machine's BROKEN stat and structure's broken var - var/flash_protect = 0 //What level of bright light protection item has. 1 = Flashers, Flashes, & Flashbangs | 2 = Welding | -1 = OH GOD WELDING BURNT OUT MY RETINAS - var/tint = 0 //Sets the item's level of visual impairment tint, normally set to the same as flash_protect - var/up = 0 //but separated to allow items to protect but not impair vision, like space helmets - var/visor_flags = 0 //flags that are added/removed when an item is adjusted up/down - var/visor_flags_inv = 0 //same as visor_flags, but for flags_inv - var/visor_flags_cover = 0 //same as above, but for flags_cover -//what to toggle when toggled with weldingvisortoggle() - var/visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT | VISOR_VISIONFLAGS | VISOR_DARKNESSVIEW | VISOR_INVISVIEW - lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi' - righthand_file = 'icons/mob/inhands/clothing_righthand.dmi' - var/alt_desc = null - var/toggle_message = null - var/alt_toggle_message = null - var/active_sound = null - var/toggle_cooldown = null - var/cooldown = 0 - var/obj/item/flashlight/F = null - var/can_flashlight = 0 - - var/blocks_shove_knockdown = FALSE //Whether wearing the clothing item blocks the ability for shove to knock down. - - var/clothing_flags = NONE - - //Var modification - PLEASE be careful with this I know who you are and where you live - var/list/user_vars_to_edit //VARNAME = VARVALUE eg: "name" = "butts" - var/list/user_vars_remembered //Auto built by the above + dropped() + equipped() - - var/pocket_storage_component_path - - //These allow head/mask items to dynamically alter the user's hair - // and facial hair, checking hair_extensions.dmi and facialhair_extensions.dmi - // for a state matching hair_state+dynamic_hair_suffix - // THESE OVERRIDE THE HIDEHAIR FLAGS - var/dynamic_hair_suffix = ""//head > mask for head hair - var/dynamic_fhair_suffix = ""//mask > head for facial hair - - - //basically a restriction list. - var/list/species_restricted = null - //Basically syntax is species_restricted = list("Species Name","Species Name") - //Add a "exclude" string to do the opposite, making it only only species listed that can't wear it. - //You append this to clothing objects. - //Hyper change// - Variables for HS13 checks - var/roomy = 0 //0 For false - - -/obj/item/clothing/Initialize() - . = ..() - if(CHECK_BITFIELD(clothing_flags, VOICEBOX_TOGGLABLE)) - actions_types += /datum/action/item_action/toggle_voice_box - if(ispath(pocket_storage_component_path)) - LoadComponent(pocket_storage_component_path) - -/obj/item/clothing/MouseDrop(atom/over_object) - . = ..() - var/mob/M = usr - - if(ismecha(M.loc)) // stops inventory actions in a mech - return - - if(!M.incapacitated() && loc == M && istype(over_object, /obj/screen/inventory/hand)) - var/obj/screen/inventory/hand/H = over_object - if(M.putItemFromInventoryInHandIfPossible(src, H.held_index)) - add_fingerprint(usr) - -/obj/item/reagent_containers/food/snacks/clothing - name = "oops" - desc = "If you're reading this it means I messed up. This is related to moths eating clothes and I didn't know a better way to do it than making a new food object." - list_reagents = list("nutriment" = 1) - tastes = list("dust" = 1, "lint" = 1) - foodtype = CLOTH - -/obj/item/clothing/attack(mob/M, mob/user, def_zone) - if(user.a_intent != INTENT_HARM && (ismoth(M) || isinsect(M))) - var/obj/item/reagent_containers/food/snacks/clothing/clothing_as_food = new - clothing_as_food.name = name - if(clothing_as_food.attack(M, user, def_zone)) - take_damage(15, sound_effect=FALSE) - qdel(clothing_as_food) - else - return ..() - -/obj/item/clothing/attackby(obj/item/W, mob/user, params) - if(damaged_clothes && istype(W, /obj/item/stack/sheet/cloth)) - var/obj/item/stack/sheet/cloth/C = W - C.use(1) - update_clothes_damaged_state(FALSE) - obj_integrity = max_integrity - to_chat(user, "You fix the damage on [src] with [C].") - return 1 - //Hyper Change// - if(istype(W, /obj/item/bluespace_thread)) - var/obj/item/bluespace_thread/B = W - if ((istype(src, /obj/item/clothing/under) || istype(src, /obj/item/clothing/suit)) && roomy != 1) //Make sure the thread is used on an item that could be ripped off in the first place - roomy = TRUE //True - user.show_message("You add a few stiches to your clothing, and find them to fit a little looser.", 1) - B.uses -= 1 //One use has been used - if(B.uses <= 0) - user.show_message("The thread has been used up!", 1) - qdel(B) - else - user.show_message("You probably don't need any more room in that.", 1) - return ..() - -/obj/item/clothing/Destroy() - user_vars_remembered = null //Oh god somebody put REFERENCES in here? not to worry, we'll clean it up - return ..() - -/obj/item/clothing/dropped(mob/user) - ..() - if(!istype(user)) - return - if(LAZYLEN(user_vars_remembered)) - for(var/variable in user_vars_remembered) - if(variable in user.vars) - if(user.vars[variable] == user_vars_to_edit[variable]) //Is it still what we set it to? (if not we best not change it) - user.vars[variable] = user_vars_remembered[variable] - user_vars_remembered = initial(user_vars_remembered) // Effectively this sets it to null. - -/obj/item/clothing/equipped(mob/user, slot) - ..() - if (!istype(user)) - return - if(slot_flags & slotdefine2slotbit(slot)) //Was equipped to a valid slot for this item? - if (LAZYLEN(user_vars_to_edit)) - for(var/variable in user_vars_to_edit) - if(variable in user.vars) - LAZYSET(user_vars_remembered, variable, user.vars[variable]) - user.vv_edit_var(variable, user_vars_to_edit[variable]) - -/obj/item/clothing/examine(mob/user) - . = ..() - if(damaged_clothes) - . += "It looks damaged!" - var/datum/component/storage/pockets = GetComponent(/datum/component/storage) - if(pockets) - var/list/how_cool_are_your_threads = list("") - if(pockets.attack_hand_interact) - how_cool_are_your_threads += "[src]'s storage opens when clicked.\n" - else - how_cool_are_your_threads += "[src]'s storage opens when dragged to yourself.\n" - how_cool_are_your_threads += "[src] can store [pockets.max_items] item\s.\n" - how_cool_are_your_threads += "[src] can store items that are [weightclass2text(pockets.max_w_class)] or smaller.\n" - if(pockets.quickdraw) - how_cool_are_your_threads += "You can quickly remove an item from [src] using Alt-Click.\n" - if(pockets.silent) - how_cool_are_your_threads += "Adding or removing items from [src] makes no noise.\n" - how_cool_are_your_threads += "" - . += how_cool_are_your_threads.Join() - -/obj/item/clothing/obj_break(damage_flag) - if(!damaged_clothes) - update_clothes_damaged_state(TRUE) - if(ismob(loc)) //It's not important enough to warrant a message if nobody's wearing it - var/mob/M = loc - to_chat(M, "Your [name] starts to fall apart!") - -/obj/item/clothing/proc/update_clothes_damaged_state(damaging = TRUE) - var/index = "[REF(initial(icon))]-[initial(icon_state)]" - var/static/list/damaged_clothes_icons = list() - if(damaging) - damaged_clothes = 1 - var/icon/damaged_clothes_icon = damaged_clothes_icons[index] - if(!damaged_clothes_icon) - damaged_clothes_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply damaged effect to the initial icon_state for each object - damaged_clothes_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) - damaged_clothes_icon.Blend(icon('icons/effects/item_damage.dmi', "itemdamaged"), ICON_MULTIPLY) //adds damage effect and the remaining white areas become transparant - damaged_clothes_icon = fcopy_rsc(damaged_clothes_icon) - damaged_clothes_icons[index] = damaged_clothes_icon - add_overlay(damaged_clothes_icon, 1) - else - damaged_clothes = 0 - cut_overlay(damaged_clothes_icons[index], TRUE) - - -/* -SEE_SELF // can see self, no matter what -SEE_MOBS // can see all mobs, no matter what -SEE_OBJS // can see all objs, no matter what -SEE_TURFS // can see all turfs (and areas), no matter what -SEE_PIXELS// if an object is located on an unlit area, but some of its pixels are - // in a lit area (via pixel_x,y or smooth movement), can see those pixels -BLIND // can't see anything -*/ - -/proc/generate_female_clothing(index,t_color,icon,type) - var/icon/female_clothing_icon = icon("icon"=icon, "icon_state"=t_color) - var/icon/female_s = icon("icon"='icons/mob/uniform.dmi', "icon_state"="[(type == FEMALE_UNIFORM_FULL) ? "female_full" : "female_top"]") - female_clothing_icon.Blend(female_s, ICON_MULTIPLY) - female_clothing_icon = fcopy_rsc(female_clothing_icon) - GLOB.female_clothing_icons[index] = female_clothing_icon - -/obj/item/clothing/under/verb/toggle() - set name = "Adjust Suit Sensors" - set category = "Object" - set src in usr - var/mob/M = usr - if (istype(M, /mob/dead/)) - return - if (!can_use(M)) - return - if(src.has_sensor == LOCKED_SENSORS) - to_chat(usr, "The controls are locked.") - return 0 - if(src.has_sensor == BROKEN_SENSORS) - to_chat(usr, "The sensors have shorted out!") - return 0 - if(src.has_sensor <= NO_SENSORS) - to_chat(usr, "This suit does not have any sensors.") - return 0 - - var/list/modes = list("Off", "Binary vitals", "Exact vitals", "Tracking beacon") - var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes - if(get_dist(usr, src) > 1) - to_chat(usr, "You have moved too far away!") - return - sensor_mode = modes.Find(switchMode) - 1 - - if (src.loc == usr) - switch(sensor_mode) - if(0) - to_chat(usr, "You disable your suit's remote sensing equipment.") - if(1) - to_chat(usr, "Your suit will now only report whether you are alive or dead.") - if(2) - to_chat(usr, "Your suit will now only report your exact vital lifesigns.") - if(3) - to_chat(usr, "Your suit will now report your exact vital lifesigns as well as your coordinate position.") - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.w_uniform == src) - H.update_suit_sensors() - - ..() - -/obj/item/clothing/under/CtrlClick(mob/user) - . = ..() - - if (!(item_flags & IN_INVENTORY)) - return - - if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) - return - - if(has_sensor == LOCKED_SENSORS) - to_chat(user, "The controls are locked.") - return - if(has_sensor == BROKEN_SENSORS) - to_chat(user, "The sensors have shorted out!") - return - if(has_sensor <= NO_SENSORS) - to_chat(user, "This suit does not have any sensors.") - return - - sensor_mode = SENSOR_COORDS - - to_chat(user, "Your suit will now report your exact vital lifesigns as well as your coordinate position.") - - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(H.w_uniform == src) - H.update_suit_sensors() - -/obj/item/clothing/under/AltClick(mob/user) - if(..()) - return 1 - - if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) - return - else - if(attached_accessory) - remove_accessory(user) - else - rolldown() - -/obj/item/clothing/under/verb/jumpsuit_adjust() - set name = "Adjust Jumpsuit Style" - set category = null - set src in usr - rolldown() - -/obj/item/clothing/under/proc/rolldown() - if(!can_use(usr)) - return - if(!can_adjust) - to_chat(usr, "You cannot wear this suit any differently!") - return - if(toggle_jumpsuit_adjust()) - to_chat(usr, "You adjust the suit to wear it more casually.") - else - to_chat(usr, "You adjust the suit back to normal.") - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - H.update_inv_w_uniform() - H.update_body() - -/obj/item/clothing/under/proc/toggle_jumpsuit_adjust() - adjusted = !adjusted - - if(adjusted) - if(fitted != FEMALE_UNIFORM_TOP) - fitted = NO_FEMALE_UNIFORM - if(!alt_covers_chest) // for the special snowflake suits that expose the chest when adjusted - body_parts_covered &= ~CHEST - else - fitted = initial(fitted) - if(!alt_covers_chest) - body_parts_covered |= CHEST - - return adjusted - -/obj/item/clothing/proc/weldingvisortoggle(mob/user) //proc to toggle welding visors on helmets, masks, goggles, etc. - if(!can_use(user)) - return FALSE - - visor_toggling() - - to_chat(user, "You adjust \the [src] [up ? "up" : "down"].") - - if(iscarbon(user)) - var/mob/living/carbon/C = user - C.head_update(src, forced = 1) - for(var/X in actions) - var/datum/action/A = X - A.UpdateButtonIcon() - return TRUE - -/obj/item/clothing/proc/visor_toggling() //handles all the actual toggling of flags - up = !up - clothing_flags ^= visor_flags - flags_inv ^= visor_flags_inv - flags_cover ^= initial(flags_cover) - icon_state = "[initial(icon_state)][up ? "up" : ""]" - if(visor_vars_to_toggle & VISOR_FLASHPROTECT) - flash_protect ^= initial(flash_protect) - if(visor_vars_to_toggle & VISOR_TINT) - tint ^= initial(tint) - -/obj/item/clothing/head/helmet/space/plasmaman/visor_toggling() //handles all the actual toggling of flags - up = !up - clothing_flags ^= visor_flags - flags_inv ^= visor_flags_inv - icon_state = "[initial(icon_state)]" - if(visor_vars_to_toggle & VISOR_FLASHPROTECT) - flash_protect ^= initial(flash_protect) - if(visor_vars_to_toggle & VISOR_TINT) - tint ^= initial(tint) - -/obj/item/clothing/proc/can_use(mob/user) - if(user && ismob(user)) - if(!user.incapacitated()) - return 1 - return 0 - - -/obj/item/clothing/obj_destruction(damage_flag) - if(damage_flag == "bomb" || damage_flag == "melee") - var/turf/T = get_turf(src) - spawn(1) //so the shred survives potential turf change from the explosion. - var/obj/effect/decal/cleanable/shreds/Shreds = new(T) - Shreds.desc = "The sad remains of what used to be [name]." - deconstruct(FALSE) - else - ..() - - - -//Species-restricted clothing check. - Thanks Oraclestation, BS13, /vg/station etc. -/obj/item/clothing/mob_can_equip(mob/M, slot, disable_warning = TRUE) - - //if we can't equip the item anyway, don't bother with species_restricted (also cuts down on spam) - if(!..()) - return FALSE - - // Skip species restriction checks on non-equipment slots - if(slot in list(SLOT_IN_BACKPACK, SLOT_L_STORE, SLOT_R_STORE)) - return TRUE - - if(species_restricted && ishuman(M)) - - var/wearable = null - var/exclusive = null - var/mob/living/carbon/human/H = M - - if("exclude" in species_restricted) //TURNS IT INTO A BLACKLIST - AKA ALL MINUS SPECIES LISTED. - exclusive = TRUE - - if(H.dna.species) - if(exclusive) - if(!(H.dna.species.name in species_restricted)) - wearable = TRUE - else - if(H.dna.species.name in species_restricted) - wearable = TRUE - - if(!wearable) - to_chat(M, "Your species cannot wear [src].") - return FALSE - - return TRUE +/obj/item/clothing + name = "clothing" + resistance_flags = FLAMMABLE + max_integrity = 200 + integrity_failure = 80 + var/damaged_clothes = 0 //similar to machine's BROKEN stat and structure's broken var + var/flash_protect = 0 //What level of bright light protection item has. 1 = Flashers, Flashes, & Flashbangs | 2 = Welding | -1 = OH GOD WELDING BURNT OUT MY RETINAS + var/tint = 0 //Sets the item's level of visual impairment tint, normally set to the same as flash_protect + var/up = 0 //but separated to allow items to protect but not impair vision, like space helmets + var/visor_flags = 0 //flags that are added/removed when an item is adjusted up/down + var/visor_flags_inv = 0 //same as visor_flags, but for flags_inv + var/visor_flags_cover = 0 //same as above, but for flags_cover +//what to toggle when toggled with weldingvisortoggle() + var/visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT | VISOR_VISIONFLAGS | VISOR_DARKNESSVIEW | VISOR_INVISVIEW + lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi' + righthand_file = 'icons/mob/inhands/clothing_righthand.dmi' + var/alt_desc = null + var/toggle_message = null + var/alt_toggle_message = null + var/active_sound = null + var/toggle_cooldown = null + var/cooldown = 0 + var/obj/item/flashlight/F = null + var/can_flashlight = 0 + + var/blocks_shove_knockdown = FALSE //Whether wearing the clothing item blocks the ability for shove to knock down. + + var/clothing_flags = NONE + + //Var modification - PLEASE be careful with this I know who you are and where you live + var/list/user_vars_to_edit //VARNAME = VARVALUE eg: "name" = "butts" + var/list/user_vars_remembered //Auto built by the above + dropped() + equipped() + + var/pocket_storage_component_path + + //These allow head/mask items to dynamically alter the user's hair + // and facial hair, checking hair_extensions.dmi and facialhair_extensions.dmi + // for a state matching hair_state+dynamic_hair_suffix + // THESE OVERRIDE THE HIDEHAIR FLAGS + var/dynamic_hair_suffix = ""//head > mask for head hair + var/dynamic_fhair_suffix = ""//mask > head for facial hair + + + //basically a restriction list. + var/list/species_restricted = null + //Basically syntax is species_restricted = list("Species Name","Species Name") + //Add a "exclude" string to do the opposite, making it only only species listed that can't wear it. + //You append this to clothing objects. + //Hyper change// - Variables for HS13 checks + var/roomy = 0 //0 For false + + +/obj/item/clothing/Initialize() + . = ..() + if(CHECK_BITFIELD(clothing_flags, VOICEBOX_TOGGLABLE)) + actions_types += /datum/action/item_action/toggle_voice_box + if(ispath(pocket_storage_component_path)) + LoadComponent(pocket_storage_component_path) + +/obj/item/clothing/MouseDrop(atom/over_object) + . = ..() + var/mob/M = usr + + if(ismecha(M.loc)) // stops inventory actions in a mech + return + + if(!M.incapacitated() && loc == M && istype(over_object, /obj/screen/inventory/hand)) + var/obj/screen/inventory/hand/H = over_object + if(M.putItemFromInventoryInHandIfPossible(src, H.held_index)) + add_fingerprint(usr) + +/obj/item/reagent_containers/food/snacks/clothing + name = "oops" + desc = "If you're reading this it means I messed up. This is related to moths eating clothes and I didn't know a better way to do it than making a new food object." + list_reagents = list(/datum/reagent/consumable/nutriment = 1) + tastes = list("dust" = 1, "lint" = 1) + foodtype = CLOTH + +/obj/item/clothing/attack(mob/M, mob/user, def_zone) + if(user.a_intent != INTENT_HARM && (ismoth(M) || isinsect(M))) + var/obj/item/reagent_containers/food/snacks/clothing/clothing_as_food = new + clothing_as_food.name = name + if(clothing_as_food.attack(M, user, def_zone)) + take_damage(15, sound_effect=FALSE) + qdel(clothing_as_food) + else + return ..() + +/obj/item/clothing/attackby(obj/item/W, mob/user, params) + if(damaged_clothes && istype(W, /obj/item/stack/sheet/cloth)) + var/obj/item/stack/sheet/cloth/C = W + C.use(1) + update_clothes_damaged_state(FALSE) + obj_integrity = max_integrity + to_chat(user, "You fix the damage on [src] with [C].") + return 1 + //Hyper Change// + if(istype(W, /obj/item/bluespace_thread)) + var/obj/item/bluespace_thread/B = W + if ((istype(src, /obj/item/clothing/under) || istype(src, /obj/item/clothing/suit)) && roomy != 1) //Make sure the thread is used on an item that could be ripped off in the first place + roomy = TRUE //True + user.show_message("You add a few stiches to your clothing, and find them to fit a little looser.", 1) + B.uses -= 1 //One use has been used + if(B.uses <= 0) + user.show_message("The thread has been used up!", 1) + qdel(B) + else + user.show_message("You probably don't need any more room in that.", 1) + return ..() + +/obj/item/clothing/Destroy() + user_vars_remembered = null //Oh god somebody put REFERENCES in here? not to worry, we'll clean it up + return ..() + +/obj/item/clothing/dropped(mob/user) + ..() + if(!istype(user)) + return + if(LAZYLEN(user_vars_remembered)) + for(var/variable in user_vars_remembered) + if(variable in user.vars) + if(user.vars[variable] == user_vars_to_edit[variable]) //Is it still what we set it to? (if not we best not change it) + user.vars[variable] = user_vars_remembered[variable] + user_vars_remembered = initial(user_vars_remembered) // Effectively this sets it to null. + +/obj/item/clothing/equipped(mob/user, slot) + ..() + if (!istype(user)) + return + if(slot_flags & slotdefine2slotbit(slot)) //Was equipped to a valid slot for this item? + if (LAZYLEN(user_vars_to_edit)) + for(var/variable in user_vars_to_edit) + if(variable in user.vars) + LAZYSET(user_vars_remembered, variable, user.vars[variable]) + user.vv_edit_var(variable, user_vars_to_edit[variable]) + +/obj/item/clothing/examine(mob/user) + . = ..() + if(damaged_clothes) + . += "It looks damaged!" + var/datum/component/storage/pockets = GetComponent(/datum/component/storage) + if(pockets) + var/list/how_cool_are_your_threads = list("") + if(pockets.attack_hand_interact) + how_cool_are_your_threads += "[src]'s storage opens when clicked.\n" + else + how_cool_are_your_threads += "[src]'s storage opens when dragged to yourself.\n" + how_cool_are_your_threads += "[src] can store [pockets.max_items] item\s.\n" + how_cool_are_your_threads += "[src] can store items that are [weightclass2text(pockets.max_w_class)] or smaller.\n" + if(pockets.quickdraw) + how_cool_are_your_threads += "You can quickly remove an item from [src] using Alt-Click.\n" + if(pockets.silent) + how_cool_are_your_threads += "Adding or removing items from [src] makes no noise.\n" + how_cool_are_your_threads += "" + . += how_cool_are_your_threads.Join() + +/obj/item/clothing/obj_break(damage_flag) + if(!damaged_clothes) + update_clothes_damaged_state(TRUE) + if(ismob(loc)) //It's not important enough to warrant a message if nobody's wearing it + var/mob/M = loc + to_chat(M, "Your [name] starts to fall apart!") + +/obj/item/clothing/proc/update_clothes_damaged_state(damaging = TRUE) + var/index = "[REF(initial(icon))]-[initial(icon_state)]" + var/static/list/damaged_clothes_icons = list() + if(damaging) + damaged_clothes = 1 + var/icon/damaged_clothes_icon = damaged_clothes_icons[index] + if(!damaged_clothes_icon) + damaged_clothes_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply damaged effect to the initial icon_state for each object + damaged_clothes_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) + damaged_clothes_icon.Blend(icon('icons/effects/item_damage.dmi', "itemdamaged"), ICON_MULTIPLY) //adds damage effect and the remaining white areas become transparant + damaged_clothes_icon = fcopy_rsc(damaged_clothes_icon) + damaged_clothes_icons[index] = damaged_clothes_icon + add_overlay(damaged_clothes_icon, 1) + else + damaged_clothes = 0 + cut_overlay(damaged_clothes_icons[index], TRUE) + + +/* +SEE_SELF // can see self, no matter what +SEE_MOBS // can see all mobs, no matter what +SEE_OBJS // can see all objs, no matter what +SEE_TURFS // can see all turfs (and areas), no matter what +SEE_PIXELS// if an object is located on an unlit area, but some of its pixels are + // in a lit area (via pixel_x,y or smooth movement), can see those pixels +BLIND // can't see anything +*/ + +/proc/generate_female_clothing(index,t_color,icon,type) + var/icon/female_clothing_icon = icon("icon"=icon, "icon_state"=t_color) + var/icon/female_s = icon("icon"='icons/mob/uniform.dmi', "icon_state"="[(type == FEMALE_UNIFORM_FULL) ? "female_full" : "female_top"]") + female_clothing_icon.Blend(female_s, ICON_MULTIPLY) + female_clothing_icon = fcopy_rsc(female_clothing_icon) + GLOB.female_clothing_icons[index] = female_clothing_icon + +/obj/item/clothing/under/verb/toggle() + set name = "Adjust Suit Sensors" + set category = "Object" + set src in usr + var/mob/M = usr + if (istype(M, /mob/dead/)) + return + if (!can_use(M)) + return + if(src.has_sensor == LOCKED_SENSORS) + to_chat(usr, "The controls are locked.") + return 0 + if(src.has_sensor == BROKEN_SENSORS) + to_chat(usr, "The sensors have shorted out!") + return 0 + if(src.has_sensor <= NO_SENSORS) + to_chat(usr, "This suit does not have any sensors.") + return 0 + + var/list/modes = list("Off", "Binary vitals", "Exact vitals", "Tracking beacon") + var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes + if(get_dist(usr, src) > 1) + to_chat(usr, "You have moved too far away!") + return + sensor_mode = modes.Find(switchMode) - 1 + + if (src.loc == usr) + switch(sensor_mode) + if(0) + to_chat(usr, "You disable your suit's remote sensing equipment.") + if(1) + to_chat(usr, "Your suit will now only report whether you are alive or dead.") + if(2) + to_chat(usr, "Your suit will now only report your exact vital lifesigns.") + if(3) + to_chat(usr, "Your suit will now report your exact vital lifesigns as well as your coordinate position.") + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.w_uniform == src) + H.update_suit_sensors() + + ..() + +/obj/item/clothing/under/CtrlClick(mob/user) + . = ..() + + if (!(item_flags & IN_INVENTORY)) + return + + if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + + if(has_sensor == LOCKED_SENSORS) + to_chat(user, "The controls are locked.") + return + if(has_sensor == BROKEN_SENSORS) + to_chat(user, "The sensors have shorted out!") + return + if(has_sensor <= NO_SENSORS) + to_chat(user, "This suit does not have any sensors.") + return + + sensor_mode = SENSOR_COORDS + + to_chat(user, "Your suit will now report your exact vital lifesigns as well as your coordinate position.") + + if(ishuman(user)) + var/mob/living/carbon/human/H = user + if(H.w_uniform == src) + H.update_suit_sensors() + +/obj/item/clothing/under/AltClick(mob/user) + if(..()) + return 1 + + if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + else + if(attached_accessory) + remove_accessory(user) + else + rolldown() + +/obj/item/clothing/under/verb/jumpsuit_adjust() + set name = "Adjust Jumpsuit Style" + set category = null + set src in usr + rolldown() + +/obj/item/clothing/under/proc/rolldown() + if(!can_use(usr)) + return + if(!can_adjust) + to_chat(usr, "You cannot wear this suit any differently!") + return + if(toggle_jumpsuit_adjust()) + to_chat(usr, "You adjust the suit to wear it more casually.") + else + to_chat(usr, "You adjust the suit back to normal.") + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + H.update_inv_w_uniform() + H.update_body() + +/obj/item/clothing/under/proc/toggle_jumpsuit_adjust() + adjusted = !adjusted + + if(adjusted) + if(fitted != FEMALE_UNIFORM_TOP) + fitted = NO_FEMALE_UNIFORM + if(!alt_covers_chest) // for the special snowflake suits that expose the chest when adjusted + body_parts_covered &= ~CHEST + else + fitted = initial(fitted) + if(!alt_covers_chest) + body_parts_covered |= CHEST + + return adjusted + +/obj/item/clothing/proc/weldingvisortoggle(mob/user) //proc to toggle welding visors on helmets, masks, goggles, etc. + if(!can_use(user)) + return FALSE + + visor_toggling() + + to_chat(user, "You adjust \the [src] [up ? "up" : "down"].") + + if(iscarbon(user)) + var/mob/living/carbon/C = user + C.head_update(src, forced = 1) + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + return TRUE + +/obj/item/clothing/proc/visor_toggling() //handles all the actual toggling of flags + up = !up + clothing_flags ^= visor_flags + flags_inv ^= visor_flags_inv + flags_cover ^= initial(flags_cover) + icon_state = "[initial(icon_state)][up ? "up" : ""]" + if(visor_vars_to_toggle & VISOR_FLASHPROTECT) + flash_protect ^= initial(flash_protect) + if(visor_vars_to_toggle & VISOR_TINT) + tint ^= initial(tint) + +/obj/item/clothing/head/helmet/space/plasmaman/visor_toggling() //handles all the actual toggling of flags + up = !up + clothing_flags ^= visor_flags + flags_inv ^= visor_flags_inv + icon_state = "[initial(icon_state)]" + if(visor_vars_to_toggle & VISOR_FLASHPROTECT) + flash_protect ^= initial(flash_protect) + if(visor_vars_to_toggle & VISOR_TINT) + tint ^= initial(tint) + +/obj/item/clothing/proc/can_use(mob/user) + if(user && ismob(user)) + if(!user.incapacitated()) + return 1 + return 0 + + +/obj/item/clothing/obj_destruction(damage_flag) + if(damage_flag == "bomb" || damage_flag == "melee") + var/turf/T = get_turf(src) + spawn(1) //so the shred survives potential turf change from the explosion. + var/obj/effect/decal/cleanable/shreds/Shreds = new(T) + Shreds.desc = "The sad remains of what used to be [name]." + deconstruct(FALSE) + else + ..() + + + +//Species-restricted clothing check. - Thanks Oraclestation, BS13, /vg/station etc. +/obj/item/clothing/mob_can_equip(mob/M, slot, disable_warning = TRUE) + + //if we can't equip the item anyway, don't bother with species_restricted (also cuts down on spam) + if(!..()) + return FALSE + + // Skip species restriction checks on non-equipment slots + if(slot in list(SLOT_IN_BACKPACK, SLOT_L_STORE, SLOT_R_STORE)) + return TRUE + + if(species_restricted && ishuman(M)) + + var/wearable = null + var/exclusive = null + var/mob/living/carbon/human/H = M + + if("exclude" in species_restricted) //TURNS IT INTO A BLACKLIST - AKA ALL MINUS SPECIES LISTED. + exclusive = TRUE + + if(H.dna.species) + if(exclusive) + if(!(H.dna.species.name in species_restricted)) + wearable = TRUE + else + if(H.dna.species.name in species_restricted) + wearable = TRUE + + if(!wearable) + to_chat(M, "Your species cannot wear [src].") + return FALSE + + return TRUE diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index 377ac910..bb89aae2 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -53,7 +53,7 @@ return var/obj/item/reagent_containers/glass/bucket/bucket = H.get_item_for_held_index(1) - bucket.reagents.add_reagent("water",70) + bucket.reagents.add_reagent(/datum/reagent/water,70) /datum/outfit/laser_tag name = "Laser Tag Red" diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm index a95bd2fd..ac0a7605 100644 --- a/code/modules/events/holiday/vday.dm +++ b/code/modules/events/holiday/vday.dm @@ -157,7 +157,7 @@ icon = 'icons/obj/holiday_misc.dmi' icon_state = "candyheart" desc = "A heart-shaped candy that reads: " - list_reagents = list("sugar" = 2) + list_reagents = list(/datum/reagent/consumable/sugar = 2) junkiness = 5 /obj/item/reagent_containers/food/snacks/candyheart/New() diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm index 3f4b7661..6ec2865f 100644 --- a/code/modules/events/vent_clog.dm +++ b/code/modules/events/vent_clog.dm @@ -1,213 +1,211 @@ -/datum/round_event_control/vent_clog - name = "Clogged Vents: Normal" - typepath = /datum/round_event/vent_clog - weight = 8 - max_occurrences = 1 - min_players = 25 - -/datum/round_event/vent_clog - announceWhen = 1 - startWhen = 5 - endWhen = 35 - var/interval = 2 - var/list/vents = list() - var/randomProbability = 1 - var/reagentsAmount = 100 - var/list/saferChems = list( - "water", - "carbon", - "flour", - "cleaner", - "nutriment", - "condensedcapsaicin", - "mushroomhallucinogen", - "lube", - "pink_glitter", - "cryptobiolin", - "plantbgone", - "blood", - "charcoal", - "space_drugs", - "morphine", - "holywater", - "ethanol", - "hot_coco", - "sacid", - "mindbreaker", - "rotatium", - "bluespace", - "pax", - "laughter", - "concentrated_barbers_aid", - "colorful_reagent", - "dizzysolution", - "tiresolution", - "sodiumchloride", - "beer", - "sugar", - "white_glitter", - "growthchem", - "shrinkchem", - "cornoil", - "uranium", - "carpet", - "firefighting_foam", - "semen", - "femcum", - "tearjuice", - "strange_reagent" - - ) - //needs to be chemid unit checked at some point - -/datum/round_event/vent_clog/announce() - priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejection of contents may occur.", "Atmospherics alert") - -/datum/round_event/vent_clog/setup() - endWhen = rand(120, 180) - for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/temp_vent in GLOB.machines) - var/turf/T = get_turf(temp_vent) - var/area/A = T.loc - if(T && is_station_level(T.z) && !temp_vent.welded && !A.safe) - vents += temp_vent - - if(!vents.len) - return kill() - -/datum/round_event/vent_clog/tick() - - if(!vents.len) - return kill() - - CHECK_TICK - - var/obj/machinery/atmospherics/components/unary/vent = pick(vents) - vents -= vent - - if(!vent || vent.welded) - return - - var/turf/T = get_turf(vent) - if(!T) - return - - var/datum/reagents/R = new/datum/reagents(1000) - R.my_atom = vent - if (prob(randomProbability)) - R.add_reagent(get_random_reagent_id(), reagentsAmount) - else - R.add_reagent(pick(saferChems), reagentsAmount) - - var/datum/effect_system/smoke_spread/chem/smoke_machine/C = new - C.set_up(R,16,1,T) - C.start() - playsound(T, 'sound/effects/smoke.ogg', 50, 1, -3) - -/datum/round_event_control/vent_clog/threatening - name = "Clogged Vents: Threatening" - typepath = /datum/round_event/vent_clog/threatening - weight = 4 - min_players = 35 - max_occurrences = 1 - earliest_start = 35 MINUTES - -/datum/round_event/vent_clog/threatening - randomProbability = 10 - reagentsAmount = 200 - -/datum/round_event_control/vent_clog/catastrophic - name = "Clogged Vents: Catastrophic" - typepath = /datum/round_event/vent_clog/catastrophic - weight = 2 - min_players = 45 - max_occurrences = 1 - earliest_start = 45 MINUTES - -/datum/round_event/vent_clog/catastrophic - randomProbability = 30 - reagentsAmount = 250 - -/datum/round_event_control/vent_clog/beer - name = "Clogged Vents: Beer" - typepath = /datum/round_event/vent_clog/beer - max_occurrences = 0 - -/datum/round_event/vent_clog/beer - reagentsAmount = 100 - -/datum/round_event_control/vent_clog/plasma_decon - name = "Anti-Plasma Flood" - typepath = /datum/round_event/vent_clog/plasma_decon - max_occurrences = 0 - -/datum/round_event_control/vent_clog/female - name = "Clogged Vents; Girlcum" - typepath = /datum/round_event/vent_clog/female - max_occurrences = 0 - -/datum/round_event/vent_clog/female - reagentsAmount = 100 - -/datum/round_event_control/vent_clog/male - name = "Clogged Vents: Semen" - typepath = /datum/round_event/vent_clog/male - max_occurrences = 0 - -/datum/round_event/vent_clog/male - reagentsAmount = 100 - -/datum/round_event/vent_clog/beer/announce() - priority_announce("The scrubbers network is experiencing an unexpected surge of pressurized beer. Some ejection of contents may occur.", "Atmospherics alert") - -/datum/round_event/vent_clog/beer/start() - for(var/obj/machinery/atmospherics/components/unary/vent in vents) - if(vent && vent.loc && !vent.welded) - var/datum/reagents/R = new/datum/reagents(1000) - R.my_atom = vent - R.add_reagent("beer", reagentsAmount) - - var/datum/effect_system/foam_spread/foam = new - foam.set_up(200, get_turf(vent), R) - foam.start() - CHECK_TICK - -/datum/round_event/vent_clog/male/announce() - priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejaculation of contents may occur.", "Atmospherics alert") - -/datum/round_event/vent_clog/male/start() - for(var/obj/machinery/atmospherics/components/unary/vent in vents) - if(vent && vent.loc && !vent.welded) - var/datum/reagents/R = new/datum/reagents(1000) - R.my_atom = vent - R.add_reagent("semen", reagentsAmount) - - var/datum/effect_system/foam_spread/foam = new - foam.set_up(200, get_turf(vent), R) - foam.start() - CHECK_TICK - -/datum/round_event/vent_clog/female/announce() - priority_announce("The scrubbers network is experiencing a backpressure squirt. Some ejection of contents may occur.", "Atmospherics alert") - -/datum/round_event/vent_clog/female/start() - for(var/obj/machinery/atmospherics/components/unary/vent in vents) - if(vent && vent.loc && !vent.welded) - var/datum/reagents/R = new/datum/reagents(1000) - R.my_atom = vent - R.add_reagent("femcum", reagentsAmount) - - var/datum/effect_system/foam_spread/foam = new - foam.set_up(200, get_turf(vent), R) - foam.start() - CHECK_TICK - -/datum/round_event/vent_clog/plasma_decon/announce() - priority_announce("We are deploying an experimental plasma decontamination system. Please stand away from the vents and do not breathe the smoke that comes out.", "Central Command Update") - -/datum/round_event/vent_clog/plasma_decon/start() - for(var/obj/machinery/atmospherics/components/unary/vent in vents) - if(vent && vent.loc && !vent.welded) - var/datum/effect_system/smoke_spread/freezing/decon/smoke = new - smoke.set_up(7, get_turf(vent), 7) - smoke.start() - CHECK_TICK +/datum/round_event_control/vent_clog + name = "Clogged Vents: Normal" + typepath = /datum/round_event/vent_clog + weight = 8 + max_occurrences = 1 + min_players = 25 + +/datum/round_event/vent_clog + announceWhen = 1 + startWhen = 5 + endWhen = 35 + var/interval = 2 + var/list/vents = list() + var/randomProbability = 1 + var/reagentsAmount = 100 + var/list/saferChems = list( + /datum/reagent/water, + /datum/reagent/carbon, + /datum/reagent/consumable/flour, + /datum/reagent/space_cleaner, + /datum/reagent/consumable/nutriment, + /datum/reagent/consumable/condensedcapsaicin, + /datum/reagent/drug/mushroomhallucinogen, + /datum/reagent/lube, + /datum/reagent/glitter/pink, + /datum/reagent/cryptobiolin, + /datum/reagent/toxin/plantbgone, + /datum/reagent/blood, + /datum/reagent/medicine/charcoal, + /datum/reagent/drug/space_drugs, + /datum/reagent/medicine/morphine, + /datum/reagent/water/holywater, + /datum/reagent/consumable/ethanol, + /datum/reagent/consumable/hot_coco, + /datum/reagent/toxin/acid, + /datum/reagent/toxin/mindbreaker, + /datum/reagent/toxin/rotatium, + /datum/reagent/bluespace, + /datum/reagent/pax, + /datum/reagent/consumable/laughter, + /datum/reagent/concentrated_barbers_aid, + /datum/reagent/colorful_reagent, + /datum/reagent/peaceborg_confuse, + /datum/reagent/peaceborg_tire, + /datum/reagent/consumable/sodiumchloride, + /datum/reagent/consumable/ethanol/beer, + /datum/reagent/hair_dye, + /datum/reagent/consumable/sugar, + /datum/reagent/glitter/white, + /datum/reagent/growthserum, + /datum/reagent/consumable/cornoil, + /datum/reagent/uranium, + /datum/reagent/carpet, + /datum/reagent/firefighting_foam, + /datum/reagent/consumable/tearjuice, + /datum/reagent/medicine/strange_reagent + + ) + //needs to be chemid unit checked at some point + +/datum/round_event/vent_clog/announce() + priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejection of contents may occur.", "Atmospherics alert") + +/datum/round_event/vent_clog/setup() + endWhen = rand(120, 180) + for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/temp_vent in GLOB.machines) + var/turf/T = get_turf(temp_vent) + var/area/A = T.loc + if(T && is_station_level(T.z) && !temp_vent.welded && !A.safe) + vents += temp_vent + + if(!vents.len) + return kill() + +/datum/round_event/vent_clog/tick() + + if(!vents.len) + return kill() + + CHECK_TICK + + var/obj/machinery/atmospherics/components/unary/vent = pick(vents) + vents -= vent + + if(!vent || vent.welded) + return + + var/turf/T = get_turf(vent) + if(!T) + return + + var/datum/reagents/R = new/datum/reagents(1000) + R.my_atom = vent + if (prob(randomProbability)) + R.add_reagent(get_random_reagent_id(), reagentsAmount) + else + R.add_reagent(pick(saferChems), reagentsAmount) + + var/datum/effect_system/smoke_spread/chem/smoke_machine/C = new + C.set_up(R,16,1,T) + C.start() + playsound(T, 'sound/effects/smoke.ogg', 50, 1, -3) + +/datum/round_event_control/vent_clog/threatening + name = "Clogged Vents: Threatening" + typepath = /datum/round_event/vent_clog/threatening + weight = 4 + min_players = 35 + max_occurrences = 1 + earliest_start = 35 MINUTES + +/datum/round_event/vent_clog/threatening + randomProbability = 10 + reagentsAmount = 200 + +/datum/round_event_control/vent_clog/catastrophic + name = "Clogged Vents: Catastrophic" + typepath = /datum/round_event/vent_clog/catastrophic + weight = 2 + min_players = 45 + max_occurrences = 1 + earliest_start = 45 MINUTES + +/datum/round_event/vent_clog/catastrophic + randomProbability = 30 + reagentsAmount = 250 + +/datum/round_event_control/vent_clog/beer + name = "Clogged Vents: Beer" + typepath = /datum/round_event/vent_clog/beer + max_occurrences = 0 + +/datum/round_event/vent_clog/beer + reagentsAmount = 100 + +/datum/round_event_control/vent_clog/plasma_decon + name = "Anti-Plasma Flood" + typepath = /datum/round_event/vent_clog/plasma_decon + max_occurrences = 0 + +/datum/round_event_control/vent_clog/female + name = "Clogged Vents; Girlcum" + typepath = /datum/round_event/vent_clog/female + max_occurrences = 0 + +/datum/round_event/vent_clog/female + reagentsAmount = 100 + +/datum/round_event_control/vent_clog/male + name = "Clogged Vents: Semen" + typepath = /datum/round_event/vent_clog/male + max_occurrences = 0 + +/datum/round_event/vent_clog/male + reagentsAmount = 100 + +/datum/round_event/vent_clog/beer/announce() + priority_announce("The scrubbers network is experiencing an unexpected surge of pressurized beer. Some ejection of contents may occur.", "Atmospherics alert") + +/datum/round_event/vent_clog/beer/start() + for(var/obj/machinery/atmospherics/components/unary/vent in vents) + if(vent && vent.loc && !vent.welded) + var/datum/reagents/R = new/datum/reagents(1000) + R.my_atom = vent + R.add_reagent(/datum/reagent/consumable/ethanol/beer, reagentsAmount) + + var/datum/effect_system/foam_spread/foam = new + foam.set_up(200, get_turf(vent), R) + foam.start() + CHECK_TICK + +/datum/round_event/vent_clog/male/announce() + priority_announce("The scrubbers network is experiencing a backpressure surge. Some ejaculation of contents may occur.", "Atmospherics alert") + +/datum/round_event/vent_clog/male/start() + for(var/obj/machinery/atmospherics/components/unary/vent in vents) + if(vent && vent.loc && !vent.welded) + var/datum/reagents/R = new/datum/reagents(1000) + R.my_atom = vent + R.add_reagent(/datum/reagent/consumable/semen, reagentsAmount) + + var/datum/effect_system/foam_spread/foam = new + foam.set_up(200, get_turf(vent), R) + foam.start() + CHECK_TICK + +/datum/round_event/vent_clog/female/announce() + priority_announce("The scrubbers network is experiencing a backpressure squirt. Some ejection of contents may occur.", "Atmospherics alert") + +/datum/round_event/vent_clog/female/start() + for(var/obj/machinery/atmospherics/components/unary/vent in vents) + if(vent && vent.loc && !vent.welded) + var/datum/reagents/R = new/datum/reagents(1000) + R.my_atom = vent + R.add_reagent(/datum/reagent/consumable/femcum, reagentsAmount) + + var/datum/effect_system/foam_spread/foam = new + foam.set_up(200, get_turf(vent), R) + foam.start() + CHECK_TICK + +/datum/round_event/vent_clog/plasma_decon/announce() + priority_announce("We are deploying an experimental plasma decontamination system. Please stand away from the vents and do not breathe the smoke that comes out.", "Central Command Update") + +/datum/round_event/vent_clog/plasma_decon/start() + for(var/obj/machinery/atmospherics/components/unary/vent in vents) + if(vent && vent.loc && !vent.welded) + var/datum/effect_system/smoke_spread/freezing/decon/smoke = new + smoke.set_up(7, get_turf(vent), 7) + smoke.start() + CHECK_TICK diff --git a/code/modules/events/wizard/invincible.dm b/code/modules/events/wizard/invincible.dm index 209bdd26..6ba9b44e 100644 --- a/code/modules/events/wizard/invincible.dm +++ b/code/modules/events/wizard/invincible.dm @@ -8,5 +8,5 @@ /datum/round_event/wizard/invincible/start() for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - H.reagents.add_reagent("adminordrazine", 40) //100 ticks of absolute invinciblity (barring gibs) + H.reagents.add_reagent(/datum/reagent/medicine/adminordrazine, 40) //100 ticks of absolute invinciblity (barring gibs) to_chat(H, "You feel invincible, nothing can hurt you!") \ No newline at end of file diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index 12db17f4..ad99e583 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -201,7 +201,7 @@ name = "robust coffee" desc = "Careful, the beverage you're about to enjoy is extremely hot." icon_state = "coffee" - list_reagents = list("coffee" = 30) + list_reagents = list(/datum/reagent/consumable/coffee = 30) spillable = TRUE resistance_flags = FREEZE_PROOF isGlass = FALSE @@ -219,7 +219,7 @@ name = "ice cup" desc = "Careful, cold ice, do not chew." icon_state = "coffee" - list_reagents = list("ice" = 30) + list_reagents = list(/datum/reagent/consumable/ice = 30) spillable = TRUE isGlass = FALSE @@ -245,12 +245,12 @@ /obj/item/reagent_containers/food/drinks/mug/tea name = "Duke Purple tea" desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea." - list_reagents = list("tea" = 30) + list_reagents = list(/datum/reagent/consumable/tea = 30) /obj/item/reagent_containers/food/drinks/mug/coco name = "Dutch hot coco" desc = "Made in Space South America." - list_reagents = list("hot_coco" = 30, "sugar" = 5) + list_reagents = list(/datum/reagent/consumable/hot_coco = 30, /datum/reagent/consumable/sugar = 5) foodtype = SUGAR resistance_flags = FREEZE_PROOF @@ -260,7 +260,7 @@ name = "cup ramen" desc = "Just add 10ml of water, self heats! A taste that reminds you of your school years." icon_state = "ramen" - list_reagents = list("dry_ramen" = 30) + list_reagents = list(/datum/reagent/consumable/dry_ramen = 30) foodtype = GRAIN isGlass = FALSE @@ -268,20 +268,20 @@ name = "space beer" desc = "Beer. In space." icon_state = "beer" - list_reagents = list("beer" = 30) + list_reagents = list(/datum/reagent/consumable/ethanol/beer = 30) foodtype = GRAIN | ALCOHOL /obj/item/reagent_containers/food/drinks/beer/light name = "Carp Lite" desc = "Brewed with \"Pure Ice Asteroid Spring Water\"." - list_reagents = list("light_beer" = 30) + list_reagents = list(/datum/reagent/consumable/ethanol/beer/light = 30) /obj/item/reagent_containers/food/drinks/ale name = "Magm-Ale" desc = "A true dorf's drink of choice." icon_state = "alebottle" item_state = "beer" - list_reagents = list("ale" = 30) + list_reagents = list(/datum/reagent/consumable/ethanol/ale = 30) foodtype = GRAIN | ALCOHOL /obj/item/reagent_containers/food/drinks/sillycup @@ -404,7 +404,7 @@ name = "detective's flask" desc = "The detective's only true friend." icon_state = "detflask" - list_reagents = list("whiskey" = 30) + list_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 30) /obj/item/reagent_containers/food/drinks/britcup name = "cup" @@ -454,27 +454,26 @@ name = "Space Cola" desc = "Cola. in space." icon_state = "cola" - list_reagents = list("cola" = 30) + list_reagents = list(/datum/reagent/consumable/space_cola = 30) foodtype = SUGAR /obj/item/reagent_containers/food/drinks/soda_cans/tonic name = "T-Borg's tonic water" desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away." icon_state = "tonic" - list_reagents = list("tonic" = 50) - foodtype = ALCOHOL + list_reagents = list(/datum/reagent/consumable/tonic = 50) /obj/item/reagent_containers/food/drinks/soda_cans/sodawater name = "soda water" desc = "A can of soda water. Why not make a scotch and soda?" icon_state = "sodawater" - list_reagents = list("sodawater" = 50) + list_reagents = list(/datum/reagent/consumable/sodawater = 50) /obj/item/reagent_containers/food/drinks/soda_cans/lemon_lime name = "orange soda" desc = "You wanted ORANGE. It gave you Lemon Lime." icon_state = "lemon-lime" - list_reagents = list("lemon_lime" = 30) + list_reagents = list(/datum/reagent/consumable/lemon_lime = 30) foodtype = FRUIT /obj/item/reagent_containers/food/drinks/soda_cans/lemon_lime/Initialize() @@ -485,66 +484,66 @@ name = "Space-Up!" desc = "Tastes like a hull breach in your mouth." icon_state = "space-up" - list_reagents = list("space_up" = 30) + list_reagents = list(/datum/reagent/consumable/space_up = 30) foodtype = SUGAR | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/starkist name = "Star-kist" desc = "The taste of a star in liquid form. And, a bit of tuna...?" icon_state = "starkist" - list_reagents = list("cola" = 15, "orangejuice" = 15) + list_reagents = list(/datum/reagent/consumable/space_cola = 15, /datum/reagent/consumable/orangejuice = 15) foodtype = SUGAR | FRUIT | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/space_mountain_wind name = "Space Mountain Wind" desc = "Blows right through you like a space wind." icon_state = "space_mountain_wind" - list_reagents = list("spacemountainwind" = 30) + list_reagents = list(/datum/reagent/consumable/spacemountainwind = 30) foodtype = SUGAR | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/thirteenloko name = "Thirteen Loko" desc = "The CMO has advised crew members that consumption of Thirteen Loko may result in seizures, blindness, drunkenness, or even death. Please Drink Responsibly." icon_state = "thirteen_loko" - list_reagents = list("thirteenloko" = 30) + list_reagents = list(/datum/reagent/consumable/ethanol/thirteenloko = 30) foodtype = SUGAR | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/dr_gibb name = "Dr. Gibb" desc = "A delicious mixture of 42 different flavors." icon_state = "dr_gibb" - list_reagents = list("dr_gibb" = 30) + list_reagents = list(/datum/reagent/consumable/dr_gibb = 30) foodtype = SUGAR | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/pwr_game name = "Pwr Game" desc = "The only drink with the PWR that true gamers crave." icon_state = "purple_can" - list_reagents = list("pwr_game" = 30) + list_reagents = list(/datum/reagent/consumable/pwr_game = 30) /obj/item/reagent_containers/food/drinks/soda_cans/shamblers name = "Shambler's juice" desc = "~Shake me up some of that Shambler's Juice!~" icon_state = "shamblers" - list_reagents = list("shamblers" = 30) + list_reagents = list(/datum/reagent/consumable/shamblers = 30) foodtype = SUGAR | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/grey_bull name = "Grey Bull" desc = "Grey Bull, it gives you gloves!" icon_state = "energy_drink" - list_reagents = list("grey_bull" = 20) + list_reagents = list(/datum/reagent/consumable/grey_bull = 20) foodtype = SUGAR | JUNKFOOD /obj/item/reagent_containers/food/drinks/soda_cans/air name = "canned air" desc = "There is no air shortage. Do not drink." icon_state = "air" - list_reagents = list("nitrogen" = 24, "oxygen" = 6) + list_reagents = list(/datum/reagent/nitrogen = 24, /datum/reagent/oxygen = 6) /obj/item/reagent_containers/food/drinks/soda_cans/monkey_energy name = "Monkey Energy" desc = "Unleash the ape!" icon_state = "monkey_energy" - list_reagents = list("monkey_energy" = 50) + list_reagents = list(/datum/reagent/consumable/monkey_energy = 50) foodtype = SUGAR | JUNKFOOD diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index bab2d677..2e2a4b34 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -131,88 +131,87 @@ name = "Griffeater gin" desc = "A bottle of high quality gin, produced in the New London Space Station." icon_state = "ginbottle" - list_reagents = list("gin" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/gin = 100) /obj/item/reagent_containers/food/drinks/bottle/gin/empty - list_reagents = list("gin" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/whiskey name = "Uncle Git's special reserve" desc = "A premium single-malt whiskey, gently matured inside the tunnels of a nuclear shelter. TUNNEL WHISKEY RULES." icon_state = "whiskeybottle" - list_reagents = list("whiskey" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 100) /obj/item/reagent_containers/food/drinks/bottle/whiskey/empty - list_reagents = list("whiskey" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/vodka name = "Tunguska triple distilled" desc = "Aah, vodka. Prime choice of drink AND fuel by Russians worldwide." icon_state = "vodkabottle" - list_reagents = list("vodka" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/vodka = 100) /obj/item/reagent_containers/food/drinks/bottle/vodka/empty - list_reagents = list("vodka" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/vodka/badminka name = "Badminka vodka" desc = "The label's written in Cyrillic. All you can make out is the name and a word that looks vaguely like 'Vodka'." icon_state = "badminka" - list_reagents = list("vodka" = 100) /obj/item/reagent_containers/food/drinks/bottle/tequila name = "Caccavo guaranteed quality tequila" desc = "Made from premium petroleum distillates, pure thalidomide and other fine quality ingredients!" icon_state = "tequilabottle" - list_reagents = list("tequila" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/tequila = 100) /obj/item/reagent_containers/food/drinks/bottle/tequila/empty - list_reagents = list("tequila" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/bottleofnothing name = "bottle of nothing" desc = "A bottle filled with nothing." icon_state = "bottleofnothing" - list_reagents = list("nothing" = 100) + list_reagents = list(/datum/reagent/consumable/nothing = 100) foodtype = NONE /obj/item/reagent_containers/food/drinks/bottle/bottleofnothing/empty - list_reagents = list("nothing" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/patron name = "Wrapp Artiste Patron" desc = "Silver laced tequila, served in space night clubs across the galaxy." icon_state = "patronbottle" - list_reagents = list("patron" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/patron = 100) /obj/item/reagent_containers/food/drinks/bottle/patron/empty - list_reagents = list("patron" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/rum name = "Captain Pete's Cuban spiced rum" desc = "This isn't just rum, oh no. It's practically GRIFF in a bottle." icon_state = "rumbottle" - list_reagents = list("rum" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/rum = 100) /obj/item/reagent_containers/food/drinks/bottle/rum/empty - list_reagents = list("rum" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/holywater name = "flask of holy water" desc = "A flask of the chaplain's holy water." icon_state = "holyflask" - list_reagents = list("holywater" = 100) + list_reagents = list(/datum/reagent/water/holywater = 100) foodtype = NONE /obj/item/reagent_containers/food/drinks/bottle/holywater/hell desc = "A flask of holy water...it's been sitting in the Necropolis a while though." - list_reagents = list("hell_water" = 100) + list_reagents = list(/datum/reagent/hellwater = 100) /obj/item/reagent_containers/food/drinks/bottle/holyoil name = "flask of zelus oil" desc = "A brass flask of Zelus oil, a viscous fluid scenting of brass. Can be thrown to deal damage from afar." icon_state = "zelusflask" - list_reagents = list("holyoil" = 30) + list_reagents = list(/datum/reagent/fuel/holyoil = 30) volume = 30 foodtype = NONE force = 18 @@ -220,63 +219,63 @@ knockdown_duration = 18 /obj/item/reagent_containers/food/drinks/bottle/holyoil/empty - list_reagents = list("holyoil" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/vermouth name = "Goldeneye vermouth" desc = "Sweet, sweet dryness~" icon_state = "vermouthbottle" - list_reagents = list("vermouth" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/vermouth = 100) /obj/item/reagent_containers/food/drinks/bottle/vermouth/empty - list_reagents = list("vermouth" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/kahlua name = "Robert Robust's coffee liqueur" desc = "A widely known, Mexican coffee-flavoured liqueur. In production since 1936, HONK." icon_state = "kahluabottle" - list_reagents = list("kahlua" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/kahlua = 100) foodtype = VEGETABLES /obj/item/reagent_containers/food/drinks/bottle/kahlua/empty - list_reagents = list("kahlua" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/goldschlager name = "College Girl goldschlager" desc = "Because they are the only ones who will drink 100 proof cinnamon schnapps." icon_state = "goldschlagerbottle" - list_reagents = list("goldschlager" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/goldschlager = 100) /obj/item/reagent_containers/food/drinks/bottle/goldschlager/empty - list_reagents = list("goldschlager" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/cognac name = "Chateau de Baton premium cognac" desc = "A sweet and strongly alchoholic drink, made after numerous distillations and years of maturing. You might as well not scream 'SHITCURITY' this time." icon_state = "cognacbottle" - list_reagents = list("cognac" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/cognac = 100) /obj/item/reagent_containers/food/drinks/bottle/cognac/empty - list_reagents = list("cognac" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/wine name = "Doublebeard's bearded special wine" desc = "A faint aura of unease and asspainery surrounds the bottle." icon_state = "winebottle" - list_reagents = list("wine" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/wine = 100) foodtype = FRUIT | ALCOHOL /obj/item/reagent_containers/food/drinks/bottle/wine/empty - list_reagents = list("wine" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/absinthe name = "extra-strong absinthe" desc = "An strong alcoholic drink brewed and distributed by" icon_state = "absinthebottle" - list_reagents = list("absinthe" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/absinthe = 100) /obj/item/reagent_containers/food/drinks/bottle/absinthe/empty - list_reagents = list("absinthe" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/absinthe/Initialize() . = ..() @@ -329,7 +328,7 @@ name = "bottle of lizard wine" desc = "An alcoholic beverage from Space China, made by infusing lizard tails in ethanol. Inexplicably popular among command staff." icon_state = "lizardwine" - list_reagents = list("lizardwine" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/lizardwine = 100) foodtype = FRUIT | ALCOHOL /obj/item/reagent_containers/food/drinks/bottle/hcider @@ -337,28 +336,28 @@ desc = "Apple juice for adults." icon_state = "hcider" volume = 50 - list_reagents = list("hcider" = 50) + list_reagents = list(/datum/reagent/consumable/ethanol/hcider = 50) /obj/item/reagent_containers/food/drinks/bottle/hcider/empty - list_reagents = list("hcider" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/grappa name = "Phillipes well-aged Grappa" desc = "Bottle of Grappa." icon_state = "grappabottle" - list_reagents = list("grappa" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/grappa = 100) /obj/item/reagent_containers/food/drinks/bottle/grappa/empty - list_reagents = list("grappa" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/sake name = "Ryo's traditional sake" desc = "Sweet as can be, and burns like fire going down." icon_state = "sakebottle" - list_reagents = list("sake" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/sake = 100) /obj/item/reagent_containers/food/drinks/bottle/sake/empty - list_reagents = list("sake" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/sake/Initialize() . = ..() @@ -375,48 +374,48 @@ name = "Fernet Bronca" desc = "A bottle of pure Fernet Bronca, produced in Cordoba Space Station" icon_state = "fernetbottle" - list_reagents = list("fernet" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/fernet = 100) /obj/item/reagent_containers/food/drinks/bottle/fernet/empty - list_reagents = list("fernet" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/applejack name = "Buckin' Bronco's Applejack" desc = "Kicks like a horse, tastes like an apple!" icon_state = "applejack_bottle" - list_reagents = list("applejack" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/applejack = 100) foodtype = FRUIT /obj/item/reagent_containers/food/drinks/bottle/applejack/empty - list_reagents = list("applejack" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/champagne name = "Eau d' Dandy Brut Champagne" desc = "Finely sourced from only the most pretentious French vineyards." icon_state = "champagne_bottle" - list_reagents = list("champagne" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/champagne = 100) /obj/item/reagent_containers/food/drinks/bottle/champagne/empty - list_reagents = list("champagne" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/blazaam name = "Ginbad's Blazaam" desc = "You feel like you should give the bottle a good rub before opening." icon_state = "blazaambottle" - list_reagents = list("blazaam" = 100) + list_reagents = list(/datum/reagent/consumable/ethanol/blazaam = 100) /obj/item/reagent_containers/food/drinks/bottle/blazaam/empty - list_reagents = list("blazaam" = 0) + list_reagents = null /obj/item/reagent_containers/food/drinks/bottle/trappist name = "Mont de Requin Trappistes Bleu" desc = "Brewed in space-Belgium. Fancy!" icon_state = "trappistbottle" volume = 50 - list_reagents = list("trappist" = 50) + list_reagents = list(/datum/reagent/consumable/ethanol/trappist = 50) /obj/item/reagent_containers/food/drinks/bottle/trappist/empty - list_reagents = list("trappist" = 0) + list_reagents = null //////////////////////////JUICES AND STUFF /////////////////////// @@ -428,7 +427,7 @@ lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' isGlass = FALSE - list_reagents = list("orangejuice" = 100) + list_reagents = list(/datum/reagent/consumable/orangejuice = 100) foodtype = FRUIT| BREAKFAST /obj/item/reagent_containers/food/drinks/bottle/cream @@ -439,7 +438,7 @@ lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' isGlass = FALSE - list_reagents = list("cream" = 100) + list_reagents = list(/datum/reagent/consumable/cream = 100) foodtype = DAIRY /obj/item/reagent_containers/food/drinks/bottle/tomatojuice @@ -450,7 +449,7 @@ lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' isGlass = FALSE - list_reagents = list("tomatojuice" = 100) + list_reagents = list(/datum/reagent/consumable/tomatojuice = 100) foodtype = VEGETABLES /obj/item/reagent_containers/food/drinks/bottle/limejuice @@ -461,7 +460,7 @@ lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' isGlass = FALSE - list_reagents = list("limejuice" = 100) + list_reagents = list(/datum/reagent/consumable/limejuice = 100) foodtype = FRUIT /obj/item/reagent_containers/food/drinks/bottle/menthol @@ -472,7 +471,7 @@ lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' isGlass = FALSE - list_reagents = list("menthol" = 100) + list_reagents = list(/datum/reagent/consumable/menthol = 100) /obj/item/reagent_containers/food/drinks/bottle/pineapplejuice name = "pineapple juice" @@ -501,11 +500,11 @@ desc = "Contains 0% real cherries!" icon_state = "grenadine" isGlass = TRUE - list_reagents = list("grenadine" = 100) + list_reagents = list(/datum/reagent/consumable/grenadine = 100) foodtype = FRUIT /obj/item/reagent_containers/food/drinks/bottle/grenadine/empty - list_reagents = list("grenadine" = 0) + list_reagents = null ////////////////////////// MOLOTOV /////////////////////// /obj/item/reagent_containers/food/drinks/bottle/molotov diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm index 1e5c2eaf..0d769932 100644 --- a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm +++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm @@ -81,19 +81,19 @@ /obj/item/reagent_containers/food/drinks/drinkingglass/filled/soda name = "Soda Water" - list_reagents = list("sodawater" = 50) + list_reagents = list(/datum/reagent/consumable/sodawater = 50) /obj/item/reagent_containers/food/drinks/drinkingglass/filled/cola name = "Space Cola" - list_reagents = list("cola" = 50) + list_reagents = list(/datum/reagent/consumable/space_cola = 50) /obj/item/reagent_containers/food/drinks/drinkingglass/filled/nuka_cola name = "Nuka Cola" - list_reagents = list("nuka_cola" = 50) + list_reagents = list(/datum/reagent/consumable/nuka_cola = 50) /obj/item/reagent_containers/food/drinks/drinkingglass/filled/syndicatebomb name = "Syndicat Bomb" - list_reagents = list("syndicatebomb" = 50) + list_reagents = list(/datum/reagent/consumable/ethanol/syndicatebomb = 50) /obj/item/reagent_containers/food/drinks/drinkingglass/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/reagent_containers/food/snacks/egg)) //breaking eggs @@ -103,7 +103,7 @@ to_chat(user, "[src] is full.") else to_chat(user, "You break [E] in [src].") - reagents.add_reagent("eggyolk", 5) + reagents.add_reagent(/datum/reagent/consumable/eggyolk, 5) qdel(E) return else diff --git a/code/modules/food_and_drinks/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm index 71ad4c86..d8dafb7b 100644 --- a/code/modules/food_and_drinks/food/condiment.dm +++ b/code/modules/food_and_drinks/food/condiment.dm @@ -15,21 +15,18 @@ volume = 50 //Possible_states has the reagent id as key and a list of, in order, the icon_state, the name and the desc as values. Used in the on_reagent_change(changetype) to change names, descs and sprites. var/list/possible_states = list( - "slimejelly" = list("slimejelly", "slime jelly jar", "Ooey, gooey, toxic goodness."), - "cherryjelly" = list("cherryjelly", "cherry jelly jar", "A sugary spread made from cherries. Delicious!"), - "bluecherryjelly" = list("bluecherryjelly", "blue cherry jelly jar", "A crazy sweet jelly made from blue cherries! It's blue da ba dee-licious!"), - "ketchup" = list("ketchup", "ketchup bottle", "You feel more American already."), - "capsaicin" = list("hotsauce", "hotsauce bottle", "You can almost TASTE the stomach ulcers now!"), - "enzyme" = list("enzyme", "universal enzyme bottle", "Used in cooking various dishes"), - "soysauce" = list("soysauce", "soy sauce bottle", "A salty soy-based flavoring"), - "frostoil" = list("coldsauce", "coldsauce bottle", "Leaves the tongue numb in its passage"), - "sodiumchloride" = list("saltshakersmall", "salt shaker", "Salt. From space oceans, presumably"), - "blackpepper" = list("peppermillsmall", "pepper mill", "Often used to flavor food or make people sneeze"), - "cornoil" = list("oliveoil", "corn oil bottle", "A delicious oil used in cooking. Made from corn"), - "sugar" = list("emptycondiment", "sugar bottle", "Tasty spacey sugar!"), - "mayonnaise" = list("mayonnaise", "mayonnaise jar", "An oily condiment made from egg yolks."), - "bbqsauce" = list("condi_bbq", "BBQ sauce", "Hand wipes not included."), - "peanut_butter" = list("peanutbutter", "peanut butter jar", "A deliciously and sticky spread made from peanuts.")) + /datum/reagent/consumable/ketchup = list("ketchup", "ketchup bottle", "You feel more American already."), + /datum/reagent/consumable/capsaicin = list("hotsauce", "hotsauce bottle", "You can almost TASTE the stomach ulcers now!"), + /datum/reagent/consumable/enzyme = list("enzyme", "universal enzyme bottle", "Used in cooking various dishes"), + /datum/reagent/consumable/soysauce = list("soysauce", "soy sauce bottle", "A salty soy-based flavoring"), + /datum/reagent/consumable/frostoil = list("coldsauce", "coldsauce bottle", "Leaves the tongue numb in its passage"), + /datum/reagent/consumable/sodiumchloride = list("saltshakersmall", "salt shaker", "Salt. From space oceans, presumably"), + /datum/reagent/consumable/blackpepper = list("peppermillsmall", "pepper mill", "Often used to flavor food or make people sneeze"), + /datum/reagent/consumable/cornoil = list("oliveoil", "corn oil bottle", "A delicious oil used in cooking. Made from corn"), + /datum/reagent/consumable/sugar = list("emptycondiment", "sugar bottle", "Tasty spacey sugar!"), + /datum/reagent/consumable/mayonnaise = list("mayonnaise", "mayonnaise jar", "An oily condiment made from egg yolks."), + /datum/reagent/consumable/bbqsauce = list("bbqsauce", "BBQ sauce", "Hand wipes not included."), + /datum/reagent/consumable/peanut_butter = list("peanutbutter", "peanut butter jar", "A deliciously and sticky spread made from peanuts.")) var/originalname = "condiment" //Can't use initial(name) for this. This stores the name set by condimasters. /obj/item/reagent_containers/food/condiment/suicide_act(mob/living/carbon/user) @@ -119,12 +116,12 @@ name = "universal enzyme" desc = "Used in cooking various dishes." icon_state = "enzyme" - list_reagents = list("enzyme" = 50) + list_reagents = list(/datum/reagent/consumable/enzyme = 50) /obj/item/reagent_containers/food/condiment/sugar name = "sugar bottle" desc = "Tasty spacey sugar!" - list_reagents = list("sugar" = 50) + list_reagents = list(/datum/reagent/consumable/sugar = 50) /obj/item/reagent_containers/food/condiment/saltshaker //Separate from above since it's a small shaker rather then name = "salt shaker" // a large one. @@ -133,7 +130,7 @@ possible_transfer_amounts = list(1,20) //for clown turning the lid off amount_per_transfer_from_this = 1 volume = 20 - list_reagents = list("sodiumchloride" = 20) + list_reagents = list(/datum/reagent/consumable/sodiumchloride = 20) possible_states = list() /obj/item/reagent_containers/food/condiment/saltshaker/on_reagent_change(changetype) @@ -156,11 +153,11 @@ if(!proximity) return if(isturf(target)) - if(!reagents.has_reagent("sodiumchloride", 2)) + if(!reagents.has_reagent(/datum/reagent/consumable/sodiumchloride, 2)) to_chat(user, "You don't have enough salt to make a pile!") return user.visible_message("[user] shakes some salt onto [target].", "You shake some salt onto [target].") - reagents.remove_reagent("sodiumchloride", 2) + reagents.remove_reagent(/datum/reagent/consumable/sodiumchloride, 2) new/obj/effect/decal/cleanable/salt(target) return @@ -171,7 +168,7 @@ possible_transfer_amounts = list(1,20) //for clown turning the lid off amount_per_transfer_from_this = 1 volume = 20 - list_reagents = list("blackpepper" = 20) + list_reagents = list(/datum/reagent/consumable/blackpepper = 20) possible_states = list() /obj/item/reagent_containers/food/condiment/peppermill/on_reagent_change(changetype) @@ -187,7 +184,7 @@ item_state = "carton" lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' - list_reagents = list("milk" = 50) + list_reagents = list(/datum/reagent/consumable/milk = 50) possible_states = list() /obj/item/reagent_containers/food/condiment/flour @@ -195,7 +192,7 @@ desc = "A big bag of flour. Good for baking!" icon_state = "flour" item_state = "flour" - list_reagents = list("flour" = 30) + list_reagents = list(/datum/reagent/consumable/flour = 30) possible_states = list() /obj/item/reagent_containers/food/condiment/soymilk @@ -205,7 +202,7 @@ item_state = "carton" lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi' - list_reagents = list("soymilk" = 50) + list_reagents = list(/datum/reagent/consumable/soymilk = 50) possible_states = list() /obj/item/reagent_containers/food/condiment/rice @@ -213,21 +210,21 @@ desc = "A big bag of rice. Good for cooking!" icon_state = "rice" item_state = "flour" - list_reagents = list("rice" = 30) + list_reagents = list(/datum/reagent/consumable/rice = 30) possible_states = list() /obj/item/reagent_containers/food/condiment/soysauce name = "soy sauce" desc = "A salty soy-based flavoring." icon_state = "soysauce" - list_reagents = list("soysauce" = 50) + list_reagents = list(/datum/reagent/consumable/soysauce = 50) possible_states = list() /obj/item/reagent_containers/food/condiment/mayonnaise name = "mayonnaise" desc = "An oily condiment made from egg yolks." icon_state = "mayonnaise" - list_reagents = list("mayonnaise" = 50) + list_reagents = list(/datum/reagent/consumable/mayonnaise = 50) possible_states = list() @@ -241,7 +238,17 @@ volume = 10 amount_per_transfer_from_this = 10 possible_transfer_amounts = list() - possible_states = list("ketchup" = list("condi_ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("condi_hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "soysauce" = list("condi_soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("condi_frostoil", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("condi_salt", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("condi_pepper", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("condi_cornoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("condi_sugar", "Sugar", "Tasty spacey sugar!"), "astrotame" = list("condi_astrotame", "Astrotame", "The sweetness of a thousand sugars but none of the calories.")) + possible_states = list(/datum/reagent/consumable/ketchup = list("condi_ketchup", "Ketchup", "You feel more American already."), + /datum/reagent/consumable/capsaicin = list("condi_hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), + /datum/reagent/consumable/soysauce = list("condi_soysauce", "Soy Sauce", "A salty soy-based flavoring"), + /datum/reagent/consumable/frostoil = list("condi_frostoil", "Coldsauce", "Leaves the tongue numb in it's passage"), + /datum/reagent/consumable/sodiumchloride = list("condi_salt", "Salt Shaker", "Salt. From space oceans, presumably"), + /datum/reagent/consumable/blackpepper = list("condi_pepper", "Pepper Mill", "Often used to flavor food or make people sneeze"), + /datum/reagent/consumable/cornoil = list("condi_cornoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), + /datum/reagent/consumable/sugar = list("condi_sugar", "Sugar", "Tasty spacey sugar!"), + /datum/reagent/consumable/astrotame = list("condi_astrotame", "Astrotame", "The sweetness of a thousand sugars but none of the calories."), + /datum/reagent/consumable/mustard = list("condi_mustard", "Mustard", "A spice mixed with enzymes and water."), + /datum/reagent/consumable/bbqsauce = list("condi_bbq", "BBQ sauce", "Hand wipes not included.")) /obj/item/reagent_containers/food/condiment/pack/attack(mob/M, mob/user, def_zone) //Can't feed these to people directly. return @@ -284,20 +291,26 @@ /obj/item/reagent_containers/food/condiment/pack/ketchup name = "ketchup pack" originalname = "ketchup" - list_reagents = list("ketchup" = 10) + list_reagents = list(/datum/reagent/consumable/ketchup = 10) + +//Mustard +/obj/item/reagent_containers/food/condiment/pack/mustard + name = "mustard pack" + originalname = "mustard" + list_reagents = list(/datum/reagent/consumable/mustard = 10) //Hot sauce /obj/item/reagent_containers/food/condiment/pack/hotsauce name = "hotsauce pack" originalname = "hotsauce" - list_reagents = list("capsaicin" = 10) + list_reagents = list(/datum/reagent/consumable/capsaicin = 10) /obj/item/reagent_containers/food/condiment/pack/astrotame name = "astrotame pack" originalname = "astrotame" - list_reagents = list("astrotame" = 5) + list_reagents = list(/datum/reagent/consumable/astrotame = 5) /obj/item/reagent_containers/food/condiment/pack/bbqsauce name = "bbq sauce pack" originalname = "bbq sauce" - list_reagents = list("bbqsauce" = 10) + list_reagents = list(/datum/reagent/consumable/bbqsauce = 10) diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm index df5e6a87..2ad46b80 100644 --- a/code/modules/food_and_drinks/food/customizables.dm +++ b/code/modules/food_and_drinks/food/customizables.dm @@ -187,7 +187,7 @@ desc = "Delicious food on a stick." ingredients_placement = INGREDIENTS_LINE trash = /obj/item/stack/rods - list_reagents = list("nutriment" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) ingMax = 6 icon_state = "rod" @@ -302,7 +302,7 @@ else if(contents.len >= 20) to_chat(user, "You can't add more ingredients to [src]!") else - if(reagents.has_reagent("water", 10)) //are we starting a soup or a salad? + if(reagents.has_reagent(/datum/reagent/water, 10)) //are we starting a soup or a salad? var/obj/item/reagent_containers/food/snacks/customizable/A = new/obj/item/reagent_containers/food/snacks/customizable/soup(get_turf(src)) A.initialize_custom_food(src, S, user) else diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index 5be34a0e..be09a91d 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -19,11 +19,9 @@ Here is an example of the new formatting for anyone who wants to add more food i name = "Xenoburger" //Name that displays in the UI. desc = "Smells caustic. Tastes like heresy." //Duh icon_state = "xburger" //Refers to an icon in food.dmi -/obj/item/reagent_containers/food/snacks/xenoburger/Initialize() //Don't mess with this. | nO I WILL MESS WITH THIS - . = ..() //Same here. - reagents.add_reagent("xenomicrobes", 10) //This is what is in the food item. you may copy/paste - reagents.add_reagent("nutriment", 2) //this line of code for all the contents. - bitesize = 3 //This is the amount each bite consumes. + list_reagents = list(/datum/reagent/xenomicrobes = 10, + /datum/reagent/consumable/nutriment = 2) //What's inside the snack. + bitesize = 3 //This is the amount each bite consumes. ``` All foods are distributed among various categories. Use common sense. @@ -62,7 +60,7 @@ All foods are distributed among various categories. Use common sense. if(list_reagents) for(var/rid in list_reagents) var/amount = list_reagents[rid] - if(rid == "nutriment" || rid == "vitamin") + if(rid == /datum/reagent/consumable/nutriment || rid == /datum/reagent/consumable/nutriment/vitamin) reagents.add_reagent(rid, amount, tastes.Copy()) else reagents.add_reagent(rid, amount) @@ -208,7 +206,7 @@ All foods are distributed among various categories. Use common sense. if(bonus_reagents && bonus_reagents.len) for(var/r_id in bonus_reagents) var/amount = bonus_reagents[r_id] - if(r_id == "nutriment" || r_id == "vitamin") + if(r_id == /datum/reagent/consumable/nutriment || r_id == /datum/reagent/consumable/nutriment/vitamin) reagents.add_reagent(r_id, amount, tastes) else reagents.add_reagent(r_id, amount) @@ -287,7 +285,7 @@ All foods are distributed among various categories. Use common sense. if(S.bonus_reagents && S.bonus_reagents.len) for(var/r_id in S.bonus_reagents) var/amount = S.bonus_reagents[r_id] * cooking_efficiency - if(r_id == "nutriment" || r_id == "vitamin") + if(r_id == /datum/reagent/consumable/nutriment || r_id == /datum/reagent/consumable/nutriment/vitamin) S.reagents.add_reagent(r_id, amount, tastes) else S.reagents.add_reagent(r_id, amount) diff --git a/code/modules/food_and_drinks/food/snacks/dough.dm b/code/modules/food_and_drinks/food/snacks/dough.dm index 6ae8836b..e071fb3d 100644 --- a/code/modules/food_and_drinks/food/snacks/dough.dm +++ b/code/modules/food_and_drinks/food/snacks/dough.dm @@ -8,7 +8,7 @@ icon = 'icons/obj/food/food_ingredients.dmi' icon_state = "dough" cooked_type = /obj/item/reagent_containers/food/snacks/store/bread/plain - list_reagents = list("nutriment" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) w_class = WEIGHT_CLASS_NORMAL tastes = list("dough" = 1) foodtype = GRAIN @@ -36,7 +36,7 @@ slice_path = /obj/item/reagent_containers/food/snacks/doughslice slices_num = 3 cooked_type = /obj/item/reagent_containers/food/snacks/pizzabread - list_reagents = list("nutriment" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) w_class = WEIGHT_CLASS_NORMAL tastes = list("dough" = 1) foodtype = GRAIN @@ -47,7 +47,7 @@ icon = 'icons/obj/food/food_ingredients.dmi' icon_state = "pizzabread" custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/pizza - list_reagents = list("nutriment" = 7) + list_reagents = list(/datum/reagent/consumable/nutriment = 7) w_class = WEIGHT_CLASS_NORMAL tastes = list("bread" = 1) foodtype = GRAIN @@ -69,7 +69,7 @@ desc = "A base for any self-respecting burger." icon = 'icons/obj/food/burgerbread.dmi' icon_state = "bun" - list_reagents = list("nutriment" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/burger filling_color = "#CD853F" tastes = list("bun" = 1) // the bun tastes of bun. @@ -81,7 +81,7 @@ icon = 'icons/obj/food/food_ingredients.dmi' icon_state = "cakebatter" cooked_type = /obj/item/reagent_containers/food/snacks/store/cake/plain - list_reagents = list("nutriment" = 9) + list_reagents = list(/datum/reagent/consumable/nutriment = 9) w_class = WEIGHT_CLASS_NORMAL tastes = list("batter" = 1) foodtype = GRAIN | DAIRY @@ -106,7 +106,7 @@ slice_path = /obj/item/reagent_containers/food/snacks/rawpastrybase slices_num = 3 cooked_type = /obj/item/reagent_containers/food/snacks/pie/plain - list_reagents = list("nutriment" = 9) + list_reagents = list(/datum/reagent/consumable/nutriment = 9) w_class = WEIGHT_CLASS_NORMAL tastes = list("dough" = 1) foodtype = GRAIN | DAIRY @@ -118,7 +118,7 @@ icon_state = "rawpastrybase" cooked_type = /obj/item/reagent_containers/food/snacks/pastrybase filling_color = "#CD853F" - list_reagents = list("nutriment" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) tastes = list("raw pastry" = 1) foodtype = GRAIN | DAIRY @@ -127,7 +127,7 @@ desc = "A base for any self-respecting pastry." icon = 'icons/obj/food/food_ingredients.dmi' icon_state = "pastrybase" - list_reagents = list("nutriment" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) filling_color = "#CD853F" tastes = list("pastry" = 1) foodtype = GRAIN | DAIRY diff --git a/code/modules/food_and_drinks/food/snacks/meat.dm b/code/modules/food_and_drinks/food/snacks/meat.dm index 159f25f0..a62ab42d 100644 --- a/code/modules/food_and_drinks/food/snacks/meat.dm +++ b/code/modules/food_and_drinks/food/snacks/meat.dm @@ -8,7 +8,7 @@ icon_state = "meat" dried_type = /obj/item/reagent_containers/food/snacks/sosjerky/healthy bitesize = 3 - list_reagents = list("nutriment" = 3, "cooking_oil" = 2) //Meat has fats that a food processor can process into cooking oil + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/cooking_oil = 2) //Meat has fats that a food processor can process into cooking oil cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/plain slice_path = /obj/item/reagent_containers/food/snacks/meat/rawcutlet/plain slices_num = 3 @@ -63,7 +63,7 @@ icon_state = "crabmeatraw" cooked_type = /obj/item/reagent_containers/food/snacks/meat/crab bitesize = 3 - list_reagents = list("nutriment" = 1, "cooking_oil" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/cooking_oil = 3) filling_color = "#EAD079" tastes = list("raw crab" = 1) foodtype = RAW | MEAT @@ -72,8 +72,8 @@ name = "crab meat" desc = "Some deliciously cooked crab meat." icon_state = "crabmeat" - list_reagents = list("nutriment" = 2) - bonus_reagents = list("nutriment" = 3, "vitamin" = 2, "cooking_oil" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/cooking_oil = 2) filling_color = "#DFB73A" tastes = list("crab" = 1) foodtype = MEAT @@ -88,7 +88,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/slime icon_state = "slimemeat" desc = "Because jello wasn't offensive enough to vegans." - list_reagents = list("nutriment" = 3, "slimejelly" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/toxin/slimejelly = 3) filling_color = "#00FFFF" tastes = list("slime" = 1, "jelly" = 1) foodtype = MEAT | RAW | TOXIC @@ -96,7 +96,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/golem icon_state = "golemmeat" desc = "Edible rocks, welcome to the future." - list_reagents = list("nutriment" = 3, "iron" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/iron = 3) filling_color = "#A9A9A9" tastes = list("rock" = 1) foodtype = MEAT | RAW | GROSS @@ -131,7 +131,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/fly icon_state = "flymeat" desc = "Nothing says tasty like maggot filled radioactive mutant flesh." - list_reagents = list("nutriment" = 3, "uranium" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/uranium = 3) tastes = list("maggots" = 1, "the inside of a reactor" = 1) foodtype = MEAT | RAW | GROSS @@ -192,7 +192,7 @@ name = "killer tomato meat" desc = "A slice from a huge tomato." icon_state = "tomatomeat" - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) filling_color = "#FF0000" cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/killertomato slice_path = /obj/item/reagent_containers/food/snacks/meat/rawcutlet/killertomato @@ -203,7 +203,7 @@ name = "bear meat" desc = "A very manly slab of meat." icon_state = "bearmeat" - list_reagents = list("nutriment" = 12, "morphine" = 5, "vitamin" = 2, "cooking_oil" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 12, /datum/reagent/medicine/morphine = 5, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/cooking_oil = 6) filling_color = "#FFB6C1" cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/bear slice_path = /obj/item/reagent_containers/food/snacks/meat/rawcutlet/bear @@ -214,7 +214,7 @@ name = "xeno meat" desc = "A slab of meat." icon_state = "xenomeat" - list_reagents = list("nutriment" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) bitesize = 4 filling_color = "#32CD32" cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/xeno @@ -226,7 +226,7 @@ name = "spider meat" desc = "A slab of spider meat." icon_state = "spidermeat" - list_reagents = list("nutriment" = 3, "toxin" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/toxin = 3, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#7CFC00" cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/spider slice_path = /obj/item/reagent_containers/food/snacks/meat/rawcutlet/spider @@ -236,7 +236,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/goliath name = "goliath meat" desc = "A slab of goliath meat. It's not very edible now, but it cooks great in lava." - list_reagents = list("nutriment" = 3, "toxin" = 5, "cooking_oil" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/toxin = 5, /datum/reagent/consumable/cooking_oil = 3) icon_state = "goliathmeat" tastes = list("meat" = 1) foodtype = RAW | MEAT | TOXIC @@ -249,7 +249,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/meatwheat name = "meatwheat clump" desc = "This doesn't look like meat, but your standards aren't that high to begin with." - list_reagents = list("nutriment" = 3, "vitamin" = 2, "cooking_oil" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/cooking_oil = 1) filling_color = rgb(150, 0, 0) icon_state = "meatwheat_clump" bitesize = 4 @@ -259,7 +259,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/gorilla name = "gorilla meat" desc = "Much meatier than monkey meat." - list_reagents = list("nutriment" = 5, "vitamin" = 1, "cooking_oil" = 5) //Plenty of fat! + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1, /datum/reagent/consumable/cooking_oil = 5) //Plenty of fat! /obj/item/reagent_containers/food/snacks/meat/rawbacon name = "raw piece of bacon" @@ -267,7 +267,7 @@ icon_state = "bacon" cooked_type = /obj/item/reagent_containers/food/snacks/meat/bacon bitesize = 2 - list_reagents = list("nutriment" = 1, "cooking_oil" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/cooking_oil = 3) filling_color = "#B22222" tastes = list("bacon" = 1) foodtype = RAW | MEAT @@ -276,8 +276,8 @@ name = "piece of bacon" desc = "A delicious piece of bacon." icon_state = "baconcooked" - list_reagents = list("nutriment" = 2) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1, "cooking_oil" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1, /datum/reagent/consumable/cooking_oil = 2) filling_color = "#854817" tastes = list("bacon" = 1) foodtype = MEAT | BREAKFAST @@ -285,7 +285,7 @@ /obj/item/reagent_containers/food/snacks/meat/slab/gondola name = "gondola meat" desc = "According to legends of old, consuming raw gondola flesh grants one inner peace." - list_reagents = list("nutriment" = 3, "tranquility" = 5, "cooking_oil" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/tranquility = 5, /datum/reagent/consumable/cooking_oil = 3) tastes = list("meat" = 4, "tranquility" = 1) filling_color = "#9A6750" cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/gondola @@ -299,8 +299,8 @@ name = "steak" desc = "A piece of hot spicy meat." icon_state = "meatsteak" - list_reagents = list("nutriment" = 5) - bonus_reagents = list("nutriment" = 2, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 1) trash = /obj/item/trash/plate filling_color = "#B22222" foodtype = MEAT @@ -361,7 +361,7 @@ icon_state = "rawcutlet" cooked_type = /obj/item/reagent_containers/food/snacks/meat/cutlet/plain bitesize = 2 - list_reagents = list("nutriment" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) filling_color = "#B22222" tastes = list("meat" = 1) var/meat_type = "meat" @@ -425,8 +425,8 @@ desc = "A cooked meat cutlet." icon_state = "cutlet" bitesize = 2 - list_reagents = list("nutriment" = 2) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#B22222" tastes = list("meat" = 1) foodtype = MEAT diff --git a/code/modules/food_and_drinks/food/snacks_bread.dm b/code/modules/food_and_drinks/food/snacks_bread.dm index 69f1a11b..b0644dc3 100644 --- a/code/modules/food_and_drinks/food/snacks_bread.dm +++ b/code/modules/food_and_drinks/food/snacks_bread.dm @@ -12,7 +12,7 @@ bitesize = 2 custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/sandwich filling_color = "#FFA500" - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) slot_flags = ITEM_SLOT_HEAD customfoodfilling = 0 //to avoid infinite bread-ception foodtype = GRAIN @@ -22,8 +22,8 @@ name = "bread" desc = "Some plain old earthen bread." icon_state = "bread" - bonus_reagents = list("nutriment" = 7) - list_reagents = list("nutriment" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 7) + list_reagents = list(/datum/reagent/consumable/nutriment = 10) custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/bread slice_path = /obj/item/reagent_containers/food/snacks/breadslice/plain tastes = list("bread" = 10) @@ -41,8 +41,8 @@ desc = "The culinary base of every self-respecting eloquen/tg/entleman." icon_state = "meatbread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/meat - bonus_reagents = list("nutriment" = 5, "vitamin" = 10) - list_reagents = list("nutriment" = 30, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bread" = 10, "meat" = 10) foodtype = GRAIN | MEAT @@ -57,8 +57,8 @@ desc = "The culinary base of every self-respecting eloquen/tg/entleman. Extra Heretical." icon_state = "xenomeatbread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/xenomeat - bonus_reagents = list("nutriment" = 5, "vitamin" = 10) - list_reagents = list("nutriment" = 30, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bread" = 10, "acid" = 10) foodtype = GRAIN | MEAT @@ -67,7 +67,7 @@ desc = "A slice of delicious meatbread. Extra Heretical." icon_state = "xenobreadslice" filling_color = "#32CD32" - list_reagents = list("nutriment" = 6, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/store/bread/spidermeat @@ -75,8 +75,8 @@ desc = "Reassuringly green meatloaf made from spider meat." icon_state = "spidermeatbread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/spidermeat - bonus_reagents = list("nutriment" = 5, "vitamin" = 10) - list_reagents = list("nutriment" = 30, "toxin" = 15, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/toxin = 15, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bread" = 10, "cobwebs" = 5) foodtype = GRAIN | MEAT | TOXIC @@ -85,7 +85,7 @@ desc = "A slice of meatloaf made from an animal that most likely still wants you dead." icon_state = "xenobreadslice" filling_color = "#7CFC00" - list_reagents = list("nutriment" = 6, "toxin" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/toxin = 3, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | MEAT | TOXIC /obj/item/reagent_containers/food/snacks/store/bread/banana @@ -93,8 +93,8 @@ desc = "A heavenly and filling treat." icon_state = "bananabread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/banana - bonus_reagents = list("nutriment" = 5, "banana" = 20) - list_reagents = list("nutriment" = 20, "banana" = 20) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/banana = 20) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/consumable/banana = 20) tastes = list("bread" = 10) // bananjuice will also flavour foodtype = GRAIN | FRUIT @@ -104,7 +104,7 @@ desc = "A slice of delicious banana bread." icon_state = "bananabreadslice" filling_color = "#FFD700" - list_reagents = list("nutriment" = 4, "banana" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/banana = 4) foodtype = GRAIN | FRUIT /obj/item/reagent_containers/food/snacks/store/bread/tofu @@ -112,8 +112,8 @@ desc = "Like meatbread but for vegetarians. Not guaranteed to give superpowers." icon_state = "tofubread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/tofu - bonus_reagents = list("nutriment" = 5, "vitamin" = 10) - list_reagents = list("nutriment" = 20, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bread" = 10, "tofu" = 10) foodtype = GRAIN | VEGETABLES @@ -122,7 +122,7 @@ desc = "A slice of delicious tofubread." icon_state = "tofubreadslice" filling_color = "#FF8C00" - list_reagents = list("nutriment" = 4, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | VEGETABLES /obj/item/reagent_containers/food/snacks/store/bread/creamcheese @@ -130,8 +130,8 @@ desc = "Yum yum yum!" icon_state = "creamcheesebread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/creamcheese - bonus_reagents = list("nutriment" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 20, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bread" = 10, "cheese" = 10) foodtype = GRAIN | DAIRY @@ -140,7 +140,7 @@ desc = "A slice of yum!" icon_state = "creamcheesebreadslice" filling_color = "#FF8C00" - list_reagents = list("nutriment" = 4, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | DAIRY /obj/item/reagent_containers/food/snacks/store/bread/mimana @@ -148,8 +148,8 @@ desc = "Best eaten in silence." icon_state = "mimanabread" slice_path = /obj/item/reagent_containers/food/snacks/breadslice/mimana - bonus_reagents = list("nutriment" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 20, "mutetoxin" = 5, "nothing" = 5, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/toxin/mutetoxin = 5, /datum/reagent/consumable/nothing = 5, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bread" = 10, "silence" = 10) foodtype = GRAIN | FRUIT @@ -158,7 +158,7 @@ desc = "A slice of silence!" icon_state = "mimanabreadslice" filling_color = "#C0C0C0" - list_reagents = list("nutriment" = 2, "mutetoxin" = 1, "nothing" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/toxin/mutetoxin = 1, /datum/reagent/consumable/nothing = 1, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | FRUIT /obj/item/reagent_containers/food/snacks/breadslice/custom @@ -172,8 +172,8 @@ desc = "Bon appetit!" icon = 'icons/obj/food/burgerbread.dmi' icon_state = "baguette" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) bitesize = 3 w_class = WEIGHT_CLASS_NORMAL tastes = list("bread" = 1) @@ -201,12 +201,12 @@ GLOBAL_VAR_INIT(frying_hardmode, TRUE) GLOBAL_VAR_INIT(frying_bad_chem_add_volume, TRUE) GLOBAL_LIST_INIT(frying_bad_chems, list( -"bad_food" = 10, -"clf3" = 2, -"aranesp" = 2, -"blackpowder" = 10, -"phlogiston" = 3, -"cyanide" = 3, +/datum/reagent/toxin/bad_food = 10, +/datum/reagent/clf3 = 2, +/datum/reagent/drug/aranesp = 2, +/datum/reagent/blackpowder = 10, +/datum/reagent/phlogiston = 3, +/datum/reagent/toxin/cyanide = 3, )) /obj/item/reagent_containers/food/snacks/deepfryholder/Initialize(mapload, obj/item/fried) @@ -280,8 +280,8 @@ GLOBAL_LIST_INIT(frying_bad_chems, list( icon_state = "butteredtoast" bitesize = 3 filling_color = "#FFA500" - list_reagents = list("nutriment" = 4) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("butter" = 1, "toast" = 1) foodtype = GRAIN | BREAKFAST @@ -291,8 +291,8 @@ GLOBAL_LIST_INIT(frying_bad_chems, list( icon = 'icons/obj/food/food.dmi' icon_state = "butterbiscuit" filling_color = "#F0E68C" - list_reagents = list("nutriment" = 5) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("butter" = 1, "biscuit" = 1) foodtype = GRAIN | BREAKFAST @@ -303,8 +303,8 @@ GLOBAL_LIST_INIT(frying_bad_chems, list( icon_state = "butterdog" bitesize = 1 filling_color = "#F1F49A" - list_reagents = list("nutriment" = 5) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("butter", "exotic butter") /obj/item/reagent_containers/food/snacks/butterdog/ComponentInitialize() diff --git a/code/modules/food_and_drinks/food/snacks_burgers.dm b/code/modules/food_and_drinks/food/snacks_burgers.dm index 1935a2de..515da570 100644 --- a/code/modules/food_and_drinks/food/snacks_burgers.dm +++ b/code/modules/food_and_drinks/food/snacks_burgers.dm @@ -3,14 +3,14 @@ icon = 'icons/obj/food/burgerbread.dmi' icon_state = "hburger" bitesize = 3 - list_reagents = list("nutriment" = 6, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("bun" = 4) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/plain name = "burger" desc = "The cornerstone of every nutritious breakfast." - bonus_reagents = list("vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/plain/Initialize() @@ -31,7 +31,7 @@ var/subjectjob = null name = "human burger" desc = "A bloody burger." - bonus_reagents = list("vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 4) foodtype = MEAT | GRAIN | GROSS /obj/item/reagent_containers/food/snacks/burger/human/CheckParts(list/parts_list) @@ -50,13 +50,13 @@ /obj/item/reagent_containers/food/snacks/burger/corgi name = "corgi burger" desc = "You monster." - bonus_reagents = list("vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | MEAT | GROSS /obj/item/reagent_containers/food/snacks/burger/appendix name = "appendix burger" desc = "Tastes like appendicitis." - bonus_reagents = list("nutriment" = 6, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 6) icon_state = "appendixburger" tastes = list("bun" = 4, "grass" = 2) foodtype = GRAIN | MEAT | GROSS @@ -65,7 +65,7 @@ name = "fillet -o- carp sandwich" desc = "Almost like a carp is yelling somewhere... Give me back that fillet -o- carp, give me that carp." icon_state = "fishburger" - bonus_reagents = list("nutriment" = 2, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("bun" = 4, "fish" = 4) foodtype = GRAIN | MEAT @@ -73,7 +73,7 @@ name = "tofu burger" desc = "What.. is that meat?" icon_state = "tofuburger" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("bun" = 4, "tofu" = 4) foodtype = GRAIN | VEGETABLES @@ -81,8 +81,8 @@ name = "roburger" desc = "The lettuce is the only organic component. Beep." icon_state = "roburger" - bonus_reagents = list("nutriment" = 2, "nanomachines" = 2, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "nanomachines" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/nanomachines = 2, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/nanomachines = 5, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("bun" = 4, "lettuce" = 2, "sludge" = 1) foodtype = GRAIN | TOXIC @@ -91,8 +91,8 @@ desc = "This massive patty looks like poison. Beep." icon_state = "roburger" volume = 120 - bonus_reagents = list("nutriment" = 5, "nanomachines" = 70, "vitamin" = 10) - list_reagents = list("nutriment" = 6, "nanomachines" = 70, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/nanomachines = 70, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/nanomachines = 70, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("bun" = 4, "lettuce" = 2, "sludge" = 1) foodtype = GRAIN | TOXIC @@ -100,7 +100,7 @@ name = "xenoburger" desc = "Smells caustic. Tastes like heresy." icon_state = "xburger" - bonus_reagents = list("nutriment" = 2, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("bun" = 4, "acid" = 4) foodtype = GRAIN | MEAT @@ -108,29 +108,29 @@ name = "bearger" desc = "Best served rawr." icon_state = "bearger" - bonus_reagents = list("nutriment" = 3, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 6) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/clown name = "clown burger" desc = "This tastes funny..." icon_state = "clownburger" - bonus_reagents = list("nutriment" = 4, "vitamin" = 6, "banana" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 6, /datum/reagent/consumable/banana = 6) foodtype = GRAIN | FRUIT /obj/item/reagent_containers/food/snacks/burger/mime name = "mime burger" desc = "Its taste defies language." icon_state = "mimeburger" - bonus_reagents = list("nutriment" = 4, "vitamin" = 6, "nothing" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 6, /datum/reagent/consumable/nothing = 6) foodtype = GRAIN /obj/item/reagent_containers/food/snacks/burger/brain name = "brainburger" desc = "A strange looking burger. It looks almost sentient." icon_state = "brainburger" - bonus_reagents = list("nutriment" = 6, "mannitol" = 6, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "mannitol" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/medicine/mannitol = 6, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/medicine/mannitol = 5, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("bun" = 4, "brains" = 2) foodtype = GRAIN | MEAT | GROSS @@ -139,7 +139,7 @@ name = "ghost burger" desc = "Too Spooky!" icon_state = "ghostburger" - bonus_reagents = list("nutriment" = 5, "vitamin" = 12) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 12) tastes = list("bun" = 4, "ectoplasm" = 2) foodtype = GRAIN alpha = 170 @@ -188,7 +188,7 @@ desc = "Perfect for hiding the fact it's burnt to a crisp." icon_state = "cburger" color = "#DA0000FF" - bonus_reagents = list("redcrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/red = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/orange @@ -196,7 +196,7 @@ desc = "Contains 0% juice." icon_state = "cburger" color = "#FF9300FF" - bonus_reagents = list("orangecrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/orange = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/yellow @@ -204,7 +204,7 @@ desc = "Bright to the last bite." icon_state = "cburger" color = "#FFF200FF" - bonus_reagents = list("yellowcrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/yellow = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/green @@ -212,7 +212,7 @@ desc = "It's not tainted meat, it's painted meat!" icon_state = "cburger" color = "#A8E61DFF" - bonus_reagents = list("greencrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/green = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/blue @@ -220,7 +220,7 @@ desc = "Is this blue rare?" icon_state = "cburger" color = "#00B7EFFF" - bonus_reagents = list("bluecrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/blue = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/purple @@ -228,7 +228,7 @@ desc = "Regal and low class at the same time." icon_state = "cburger" color = "#DA00FFFF" - bonus_reagents = list("purplecrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/purple = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/black @@ -236,7 +236,7 @@ desc = "This is overcooked." icon_state = "cburger" color = "#1C1C1C" - bonus_reagents = list("blackcrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/black = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/white @@ -244,14 +244,14 @@ desc = "Delicous Titanium!" icon_state = "cburger" color = "#FFFFFF" - bonus_reagents = list("whitecrayonpowder" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/white = 10, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/spell name = "spell burger" desc = "This is absolutely Ei Nath." icon_state = "spellburger" - bonus_reagents = list("nutriment" = 6, "vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("bun" = 4, "magic" = 2) foodtype = GRAIN | MEAT @@ -259,8 +259,8 @@ name = "big bite burger" desc = "Forget the Big Mac. THIS is the future!" icon_state = "bigbiteburger" - bonus_reagents = list("vitamin" = 6) - list_reagents = list("nutriment" = 10, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 2) w_class = WEIGHT_CLASS_NORMAL foodtype = GRAIN | MEAT @@ -272,21 +272,21 @@ foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/jelly/slime - bonus_reagents = list("slimejelly" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "slimejelly" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | TOXIC /obj/item/reagent_containers/food/snacks/burger/jelly/cherry - bonus_reagents = list("cherryjelly" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "cherryjelly" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | FRUIT /obj/item/reagent_containers/food/snacks/burger/superbite name = "super bite burger" desc = "This is a mountain of a burger. FOOD!" icon_state = "superbiteburger" - bonus_reagents = list("vitamin" = 10) - list_reagents = list("nutriment" = 40, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 40, /datum/reagent/consumable/nutriment/vitamin = 5) w_class = WEIGHT_CLASS_NORMAL bitesize = 7 volume = 100 @@ -297,29 +297,29 @@ name = "five alarm burger" desc = "HOT! HOT!" icon_state = "fivealarmburger" - bonus_reagents = list("nutriment" = 2, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "capsaicin" = 5, "condensedcapsaicin" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/capsaicin = 5, /datum/reagent/consumable/condensedcapsaicin = 5, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | MEAT /obj/item/reagent_containers/food/snacks/burger/rat name = "rat burger" desc = "Pretty much what you'd expect..." icon_state = "ratburger" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | MEAT | GROSS /obj/item/reagent_containers/food/snacks/burger/baseball name = "home run baseball burger" desc = "It's still warm. The steam coming off of it looks like baseball." icon_state = "baseball" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) foodtype = GRAIN | GROSS /obj/item/reagent_containers/food/snacks/burger/baconburger name = "bacon burger" desc = "The perfect combination of all things American." icon_state = "baconburger" - bonus_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("bun" = 4, "bacon" = 2) foodtype = GRAIN | MEAT @@ -328,13 +328,14 @@ desc = "A sticky and salty burger." icon_state = "cumburger" tastes = list("bun" = 4, "salt" = 5) - bonus_reagents = list("nutriment" = 3, "vitamin" = 10, "semen" = 10, "aphro" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/semen = 10, /datum/reagent/drug/anaphrodisiac = 3) foodtype = GRAIN + /obj/item/reagent_containers/food/snacks/burger/soylent name = "soylent burger" desc = "A eco-friendly burger made using upcycled low value biomass." icon_state = "soylentburger" - bonus_reagents = list("nutriment" = 5, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("bun" = 2, "assistant" = 4) foodtype = GRAIN | MEAT | DAIRY @@ -342,7 +343,7 @@ name = "mcrib" desc = "An elusive rib shaped burger with limited availablity across the galaxy. Not as good as you remember it." icon_state = "mcrib" - bonus_reagents = list("bbqsauce" = 5, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/bbqsauce = 5, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("bun" = 2, "pork patty" = 4) foodtype = GRAIN | MEAT @@ -351,7 +352,7 @@ desc = "A cheap and greasy imitation of an eggs benedict." icon_state = "mcguffin" tastes = list("muffin" = 2, "bacon" = 3) - bonus_reagents = list("eggyolk" = 3, "nutriment" = 1) + bonus_reagents = list(/datum/reagent/consumable/eggyolk = 3, /datum/reagent/consumable/nutriment = 1) foodtype = GRAIN | MEAT | BREAKFAST /obj/item/reagent_containers/food/snacks/burger/chicken @@ -359,7 +360,7 @@ desc = "A delicious chicken sandwich, it is said the proceeds from this treat helps criminalize homosexuality on the space frontier." icon_state = "chickenburger" tastes = list("bun" = 2, "chicken" = 4, "God's covenant" = 1) - bonus_reagents = list("mayonnaise" = 3, "cooking_oil" = 2, "nutriment" = 2) + bonus_reagents = list(/datum/reagent/consumable/mayonnaise = 3, /datum/reagent/consumable/cooking_oil = 2, /datum/reagent/consumable/nutriment = 2) foodtype = GRAIN | MEAT | FRIED /obj/item/reagent_containers/food/snacks/burger/cheese @@ -367,7 +368,7 @@ desc = "This noble burger stands proudly clad in golden cheese." icon_state = "cheeseburger" tastes = list("bun" = 2, "beef patty" = 4, "cheese" = 3) - bonus_reagents = list("nutriment" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1) foodtype = GRAIN | MEAT | DAIRY /obj/item/reagent_containers/food/snacks/burger/cheese/Initialize() diff --git a/code/modules/food_and_drinks/food/snacks_cake.dm b/code/modules/food_and_drinks/food/snacks_cake.dm index 1b24512f..e08e8f3e 100644 --- a/code/modules/food_and_drinks/food/snacks_cake.dm +++ b/code/modules/food_and_drinks/food/snacks_cake.dm @@ -4,14 +4,14 @@ slices_num = 5 bitesize = 3 volume = 80 - list_reagents = list("nutriment" = 20, "vitamin" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("cake" = 1) foodtype = GRAIN | DAIRY /obj/item/reagent_containers/food/snacks/cakeslice icon = 'icons/obj/food/piecake.dmi' trash = /obj/item/trash/plate - list_reagents = list("nutriment" = 4, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 1) customfoodfilling = 0 //to avoid infinite cake-ception tastes = list("cake" = 1) foodtype = GRAIN | DAIRY @@ -21,7 +21,7 @@ desc = "A plain cake, not a lie." icon_state = "plaincake" custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/cake - bonus_reagents = list("nutriment" = 10, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("sweetness" = 2,"cake" = 5) foodtype = GRAIN | DAIRY | SUGAR @@ -40,8 +40,8 @@ icon_state = "carrotcake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/carrot slices_num = 5 - bonus_reagents = list("nutriment" = 3, "oculine" = 5, "vitamin" = 10) - list_reagents = list("nutriment" = 20, "oculine" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/medicine/oculine = 5, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/medicine/oculine = 10, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("cake" = 5, "sweetness" = 2, "carrot" = 1) foodtype = GRAIN | DAIRY | VEGETABLES | SUGAR @@ -50,7 +50,7 @@ desc = "Carrotty slice of Carrot Cake, carrots are good for your eyes! Also not a lie." icon_state = "carrotcake_slice" filling_color = "#FFA500" - list_reagents = list("nutriment" = 4, "oculine" = 2, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/medicine/oculine = 2, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("cake" = 5, "sweetness" = 2, "carrot" = 1) foodtype = GRAIN | DAIRY | VEGETABLES | SUGAR @@ -60,8 +60,8 @@ icon_state = "braincake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/brain slices_num = 5 - bonus_reagents = list("nutriment" = 5, "mannitol" = 10, "vitamin" = 10) - list_reagents = list("nutriment" = 20, "mannitol" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/medicine/mannitol = 10, /datum/reagent/consumable/nutriment/vitamin = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/medicine/mannitol = 10, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("cake" = 5, "sweetness" = 2, "brains" = 1) foodtype = GRAIN | DAIRY | MEAT | GROSS | SUGAR @@ -71,7 +71,7 @@ desc = "Lemme tell you something about prions. THEY'RE DELICIOUS." icon_state = "braincakeslice" filling_color = "#FF69B4" - list_reagents = list("nutriment" = 4, "mannitol" = 2, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/medicine/mannitol = 2, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("cake" = 5, "sweetness" = 2, "brains" = 1) foodtype = GRAIN | DAIRY | MEAT | GROSS | SUGAR @@ -81,7 +81,7 @@ icon_state = "cheesecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/cheese slices_num = 5 - bonus_reagents = list("vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("cake" = 4, "cream cheese" = 3) foodtype = GRAIN | DAIRY @@ -99,7 +99,7 @@ icon_state = "orangecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/orange slices_num = 5 - bonus_reagents = list("nutriment" = 3, "vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("cake" = 5, "sweetness" = 2, "oranges" = 2) foodtype = GRAIN | DAIRY | FRUIT | SUGAR @@ -117,7 +117,7 @@ icon_state = "limecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/lime slices_num = 5 - bonus_reagents = list("nutriment" = 3, "vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("cake" = 5, "sweetness" = 2, "unbearable sourness" = 2) foodtype = GRAIN | DAIRY | FRUIT | SUGAR @@ -135,7 +135,7 @@ icon_state = "lemoncake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/lemon slices_num = 5 - bonus_reagents = list("nutriment" = 3, "vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("cake" = 5, "sweetness" = 2, "sourness" = 2) foodtype = GRAIN | DAIRY | FRUIT | SUGAR @@ -153,7 +153,7 @@ icon_state = "chocolatecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/chocolate slices_num = 5 - bonus_reagents = list("nutriment" = 3, "vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("cake" = 5, "sweetness" = 1, "chocolate" = 4) foodtype = GRAIN | DAIRY | JUNKFOOD | SUGAR @@ -171,8 +171,8 @@ icon_state = "birthdaycake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/birthday slices_num = 5 - bonus_reagents = list("nutriment" = 7, "sprinkles" = 10, "vitamin" = 5) - list_reagents = list("nutriment" = 20, "sprinkles" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/sprinkles = 10, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 20, /datum/reagent/consumable/sprinkles = 10, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("cake" = 5, "sweetness" = 1) foodtype = GRAIN | DAIRY | JUNKFOOD | SUGAR @@ -181,7 +181,7 @@ desc = "A slice of your birthday." icon_state = "birthdaycakeslice" filling_color = "#DC143C" - list_reagents = list("nutriment" = 4, "sprinkles" = 2, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/sprinkles = 2, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("cake" = 5, "sweetness" = 1) foodtype = GRAIN | DAIRY | JUNKFOOD | SUGAR @@ -191,7 +191,7 @@ icon_state = "applecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/apple slices_num = 5 - bonus_reagents = list("nutriment" = 3, "vitamin" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 10) tastes = list("cake" = 5, "sweetness" = 1, "apple" = 1) foodtype = GRAIN | DAIRY | FRUIT | SUGAR @@ -214,7 +214,7 @@ desc = "A cake made of slimes. Probably not electrified." icon_state = "slimecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/slimecake - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("cake" = 5, "sweetness" = 1, "slime" = 1) foodtype = GRAIN | DAIRY | SUGAR @@ -231,7 +231,7 @@ desc = "A hollow cake with real pumpkin." icon_state = "pumpkinspicecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/pumpkinspice - bonus_reagents = list("nutriment" = 3, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("cake" = 5, "sweetness" = 1, "pumpkin" = 1) foodtype = GRAIN | DAIRY | VEGETABLES | SUGAR @@ -248,7 +248,7 @@ desc = "A plain cake, filled with assortment of blackberries and strawberries!" icon_state = "blackbarry_strawberries_cake_vanilla_cake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/bsvc - bonus_reagents = list("nutriment" = 14, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 14, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("blackbarry" = 2, "strawberries" = 2, "vanilla" = 2, "sweetness" = 2, "cake" = 3) foodtype = GRAIN | DAIRY | FRUIT | SUGAR @@ -265,7 +265,7 @@ desc = "A plain cake, filled with assortment of blackberries and strawberries!" icon_state = "blackbarry_strawberries_cake_coco_cake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/bscc - bonus_reagents = list("nutriment" = 14, "vitamin" = 4, "cocoa" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 14, /datum/reagent/consumable/nutriment/vitamin = 4, /datum/reagent/consumable/coco = 5) tastes = list("blackberry" = 2, "strawberries" = 2, "chocolate" = 2, "sweetness" = 2,"cake" = 3) foodtype = GRAIN | DAIRY | FRUIT | SUGAR @@ -282,7 +282,7 @@ desc = "A cake made for angels and chaplains alike! Contains holy water." icon_state = "holy_cake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/holy_cake_slice - bonus_reagents = list("nutriment" = 1, "vitamin" = 3, "holy_water" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3, /datum/reagent/water/holywater = 10) tastes = list("cake" = 5, "sweetness" = 1, "clouds" = 1) foodtype = GRAIN | DAIRY | SUGAR @@ -300,7 +300,7 @@ obj/item/reagent_containers/food/snacks/store/cake/pound_cake icon_state = "pound_cake" slices_num = 7 //Its ment to feed the party slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/pound_cake_slice - bonus_reagents = list("nutriment" = 60) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 60) tastes = list("cake" = 5, "sweetness" = 1, "batter" = 1) foodtype = GRAIN | DAIRY | SUGAR | JUNKFOOD @@ -317,7 +317,7 @@ obj/item/reagent_containers/food/snacks/store/cake/pound_cake desc = "A cake that is made with electronic boards and leaks acid..." icon_state = "hardware_cake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/hardware_cake_slice - bonus_reagents = list("sacid" = 15, "oil" = 15) + bonus_reagents = list(/datum/reagent/toxin/acid = 15, /datum/reagent/oil = 15) tastes = list("acid" = 1, "metal" = 1, "regret" = 10) foodtype = GRAIN | GROSS @@ -334,8 +334,8 @@ obj/item/reagent_containers/food/snacks/store/cake/pound_cake desc = "A vanilla frosted cake." icon_state = "vanillacake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/vanilla_slice - bonus_reagents = list("sugar" = 15, "vanilla" = 15) - tastes = list("caje" = 1, "sugar" = 1, "vanilla" = 10) + bonus_reagents = list(/datum/reagent/consumable/sugar = 15, /datum/reagent/consumable/vanilla = 15) + tastes = list("cake" = 1, "sugar" = 1, "vanilla" = 10) foodtype = GRAIN | SUGAR | DAIRY /obj/item/reagent_containers/food/snacks/cakeslice/vanilla_slice @@ -351,7 +351,7 @@ obj/item/reagent_containers/food/snacks/store/cake/pound_cake desc = "A funny cake with a clown face on it." icon_state = "clowncake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/clown_slice - bonus_reagents = list("sugar" = 15, "laugher" = 15) + bonus_reagents = list(/datum/reagent/consumable/sugar = 15, /datum/reagent/consumable/laughter = 15) tastes = list("cake" = 1, "sugar" = 1, "joy" = 10) foodtype = GRAIN | SUGAR | DAIRY @@ -368,7 +368,7 @@ obj/item/reagent_containers/food/snacks/store/cake/pound_cake desc = "A peach filled cake." icon_state = "peachcake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/peach_slice - bonus_reagents = list("sugar" = 5, "peachjuice" = 15) + bonus_reagents = list(/datum/reagent/consumable/sugar = 5, /datum/reagent/consumable/peachjuice = 15) tastes = list("cake" = 1, "sugar" = 1, "peachjuice" = 10) foodtype = GRAIN | SUGAR | DAIRY @@ -385,7 +385,7 @@ obj/item/reagent_containers/food/snacks/store/cake/pound_cake desc = "A spaceman's trumpet frosted cake." icon_state = "trumpetcake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/trumpet - bonus_reagents = list("polypyr" = 15, "cream" = 5, "vitamin" = 5, "berryjuice" = 5) + bonus_reagents = list(/datum/reagent/medicine/polypyr = 15, /datum/reagent/consumable/cream = 5, /datum/reagent/consumable/nutriment/vitamin = 5, /datum/reagent/consumable/berryjuice = 5) filling_color = "#7A3D80" tastes = list("cake" = 4, "violets" = 2, "jam" = 2) foodtype = GRAIN | DAIRY | FRUIT | SUGAR diff --git a/code/modules/food_and_drinks/food/snacks_egg.dm b/code/modules/food_and_drinks/food/snacks_egg.dm index 273168fb..f01966a0 100644 --- a/code/modules/food_and_drinks/food/snacks_egg.dm +++ b/code/modules/food_and_drinks/food/snacks_egg.dm @@ -5,8 +5,8 @@ name = "chocolate egg" desc = "Such, sweet, fattening food." icon_state = "chocolateegg" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 4, "sugar" = 2, "cocoa" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/coco = 2) filling_color = "#A0522D" tastes = list("chocolate" = 4, "sweetness" = 1) foodtype = JUNKFOOD | SUGAR @@ -15,7 +15,7 @@ name = "egg" desc = "An egg!" icon_state = "egg" - list_reagents = list("eggyolk" = 5) + list_reagents = list(/datum/reagent/consumable/eggyolk = 5) cooked_type = /obj/item/reagent_containers/food/snacks/boiledegg filling_color = "#F0E68C" foodtype = MEAT @@ -89,10 +89,10 @@ name = "fried egg" desc = "A fried egg, with a touch of salt and pepper." icon_state = "friedegg" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) bitesize = 1 filling_color = "#FFFFF0" - list_reagents = list("nutriment" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3) tastes = list("egg" = 4, "salt" = 1, "pepper" = 1) foodtype = MEAT | FRIED | BREAKFAST @@ -100,9 +100,9 @@ name = "boiled egg" desc = "A hard boiled egg." icon_state = "egg" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#FFFFF0" - list_reagents = list("nutriment" = 2, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("egg" = 1) foodtype = MEAT | BREAKFAST @@ -111,8 +111,8 @@ desc = "That's all you can say!" icon_state = "omelette" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) bitesize = 1 w_class = WEIGHT_CLASS_NORMAL tastes = list("egg" = 1, "cheese" = 1) @@ -129,7 +129,7 @@ "You take a piece of omelette with your fork.") var/datum/reagent/R = pick(reagents.reagent_list) - reagents.remove_reagent(R.id, 1) + reagents.remove_reagent(R.type, 1) F.forkload = R if(reagents.total_volume <= 0) qdel(src) @@ -140,9 +140,9 @@ name = "eggs benedict" desc = "There is only one egg on this, how rude." icon_state = "benedict" - bonus_reagents = list("vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 4) trash = /obj/item/trash/plate w_class = WEIGHT_CLASS_NORMAL - list_reagents = list("nutriment" = 6, "vitamin" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("egg" = 1, "bacon" = 1, "bun" = 1) foodtype = MEAT | BREAKFAST diff --git a/code/modules/food_and_drinks/food/snacks_frozen.dm b/code/modules/food_and_drinks/food/snacks_frozen.dm index 45e5dbe7..8de7e170 100644 --- a/code/modules/food_and_drinks/food/snacks_frozen.dm +++ b/code/modules/food_and_drinks/food/snacks_frozen.dm @@ -3,8 +3,8 @@ desc = "Portable Ice-cream in its own packaging." icon = 'icons/obj/food/food.dmi' icon_state = "icecreamsandwich" - bonus_reagents = list("nutriment" = 1, "ice" = 2) - list_reagents = list("nutriment" = 2, "ice" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/ice = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/ice = 2) tastes = list("ice cream" = 1) foodtype = GRAIN | DAIRY @@ -12,8 +12,8 @@ name = "sundae" desc = "A classic dessert." icon_state = "sundae" - bonus_reagents = list("nutriment" = 2, "vitamin" = 1) - list_reagents = list("nutriment" = 6, "banana" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/banana = 5, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#FFFACD" tastes = list("ice cream" = 1, "banana" = 1) foodtype = FRUIT | DAIRY | SUGAR @@ -22,8 +22,8 @@ name = "honkdae" desc = "The clown's favorite dessert." icon_state = "honkdae" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "banana" = 10, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/banana = 10, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#FFFACD" tastes = list("ice cream" = 1, "banana" = 1, "a bad joke" = 1) foodtype = FRUIT | DAIRY | SUGAR @@ -32,8 +32,8 @@ name = "space freezy" desc = "The best icecream in space." icon_state = "spacefreezy" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "bluecherryjelly" = 5, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/bluecherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#87CEFA" tastes = list("blue cherries" = 2, "ice cream" = 2) foodtype = FRUIT | DAIRY @@ -47,8 +47,8 @@ icon = 'icons/obj/food/snowcones.dmi' icon_state = "flavorless_sc" trash = /obj/item/reagent_containers/food/drinks/sillycup //We dont eat paper cups - bonus_reagents = list("water" = 10) //Base line will allways give water - list_reagents = list("water" = 1) // We dont get food for water/juices + bonus_reagents = list(/datum/reagent/water = 10) //Base line will allways give water + list_reagents = list(/datum/reagent/water = 1) // We dont get food for water/juices filling_color = "#FFFFFF" //Ice is white tastes = list("ice" = 1, "water" = 1) foodtype = SUGAR //We use SUGAR as a base line to act in as junkfood, other wise we use fruit @@ -57,7 +57,7 @@ name = "lime snowcone" desc = "Lime syrup drizzled over a snowball in a paper cup." icon_state = "lime_sc" - list_reagents = list("nutriment" = 1, "limejuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/limejuice = 5) tastes = list("ice" = 1, "water" = 1, "limes" = 5) foodtype = FRUIT @@ -65,7 +65,7 @@ name = "lemon snowcone" desc = "Lemon syrup drizzled over a snowball in a paper cup." icon_state = "lemon_sc" - list_reagents = list("nutriment" = 1, "lemonjuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/lemonjuice = 5) tastes = list("ice" = 1, "water" = 1, "lemons" = 5) foodtype = FRUIT @@ -73,7 +73,7 @@ name = "apple snowcone" desc = "Apple syrup drizzled over a snowball in a paper cup." icon_state = "amber_sc" - list_reagents = list("nutriment" = 1, "applejuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/applejuice = 5) tastes = list("ice" = 1, "water" = 1, "apples" = 5) foodtype = FRUIT @@ -81,7 +81,7 @@ name = "grape snowcone" desc = "Grape syrup drizzled over a snowball in a paper cup." icon_state = "grape_sc" - list_reagents = list("nutriment" = 1, "grapejuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/grapejuice = 5) tastes = list("ice" = 1, "water" = 1, "grape" = 5) foodtype = FRUIT @@ -89,7 +89,7 @@ name = "orange snowcone" desc = "Orange syrup drizzled over a snowball in a paper cup." icon_state = "orange_sc" - list_reagents = list("nutriment" = 1, "orangejuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/orangejuice = 5) tastes = list("ice" = 1, "water" = 1, "orange" = 5) foodtype = FRUIT @@ -97,7 +97,7 @@ name = "bluecherry snowcone" desc = "Bluecherry syrup drizzled over a snowball in a paper cup, how rare!" icon_state = "blue_sc" - list_reagents = list("nutriment" = 1, "bluecherryjelly" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/bluecherryjelly = 5) tastes = list("ice" = 1, "water" = 1, "blue" = 5, "cherries" = 5) foodtype = FRUIT @@ -105,7 +105,7 @@ name = "cherry snowcone" desc = "Cherry syrup drizzled over a snowball in a paper cup." icon_state = "red_sc" - list_reagents = list("nutriment" = 1, "cherryjelly" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/cherryjelly = 5) tastes = list("ice" = 1, "water" = 1, "red" = 5, "cherries" = 5) foodtype = FRUIT @@ -113,7 +113,7 @@ name = "kiwi snowcone" desc = "A kiwi snowball in a paper cup." icon_state = "kiwi_sc" - list_reagents = list("nutriment" = 3, "vitamin" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("ice" = 1, "space" = 3, "kiwi" = 5) foodtype = FRUIT @@ -121,7 +121,7 @@ name = "peach snowcone" desc = "A peach snowball in a paper cup." icon_state = "peach_sc" - list_reagents = list("nutriment" = 1, "peachjuice" = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/peachjuice = 10) tastes = list("ice" = 1, "water" = 1, " peach" = 5) foodtype = FRUIT @@ -129,7 +129,7 @@ name = "strawberry snowcone" desc = "A strawberry snowball in a paper cup." icon_state = "blue_sc" - list_reagents = list("nutriment" = 1, "berryjuice" = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/berryjuice = 10) tastes = list("ice" = 1, "water" = 1, " strawberry" = 5) foodtype = FRUIT @@ -137,7 +137,7 @@ name = "berry snowcone" desc = "Berry syrup drizzled over a snowball in a paper cup." icon_state = "berry_sc" - list_reagents = list("nutriment" = 1, "berryjuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/berryjuice = 5) tastes = list("ice" = 1, "water" = 1, "berries" = 5) foodtype = FRUIT @@ -145,7 +145,7 @@ name = "fruit salad snowcone" desc = "A delightful mix of citrus syrups drizzled over a snowball in a paper cup." icon_state = "fruitsalad_sc" - list_reagents = list("nutriment" = 1, "lemonjuice" = 5, "limejuice" = 5, "orangejuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/lemonjuice = 5, /datum/reagent/consumable/limejuice = 5, /datum/reagent/consumable/orangejuice = 5) tastes = list("ice" = 1, "water" = 1, "oranges" = 5, "limes" = 5, "lemons" = 5, "citrus" = 5, "salad" = 5) foodtype = FRUIT @@ -153,7 +153,7 @@ name = "pineapple snowcone" desc = "Pineapple syrup drizzled over a snowball in a paper cup." icon_state = "pineapple_sc" - list_reagents = list("nutriment" = 1, "pineapplejuice" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/water = 10) tastes = list("ice" = 1, "water" = 1, "pineapples" = 5) foodtype = PINEAPPLE //Pineapple to allow all that like pineapple to enjoy @@ -161,47 +161,47 @@ name = "mime snowcone" desc = "..." icon_state = "mime_sc" - list_reagents = list("nutriment" = 1, "nothing" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nothing = 5) tastes = list("ice" = 1, "water" = 1, "nothing" = 5) /obj/item/reagent_containers/food/snacks/snowcones/clown name = "clown snowcone" desc = "Laughter drizzled over a snowball in a paper cup." icon_state = "clown_sc" - list_reagents = list("nutriment" = 1, "laughter" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/laughter = 5) tastes = list("ice" = 1, "water" = 1, "jokes" = 5, "brainfreeze" = 5, "joy" = 5) /obj/item/reagent_containers/food/snacks/snowcones/soda name = "space cola snowcone" desc = "Space Cola drizzled over a snowball in a paper cup." icon_state = "soda_sc" - list_reagents = list("nutriment" = 1, "space_cola" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/space_cola = 5) tastes = list("ice" = 1, "water" = 1, "cola" = 5) /obj/item/reagent_containers/food/snacks/snowcones/spacemountainwind name = "Space Mountain Wind snowcone" desc = "Space Mountain Wind drizzled over a snowball in a paper cup." icon_state = "kiwi_sc" - list_reagents = list("nutriment" = 1, "spacemountainwind" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/spacemountainwind = 5) tastes = list("ice" = 1, "water" = 1, "mountain wind" = 5) /obj/item/reagent_containers/food/snacks/snowcones/pwrgame name = "pwrgame snowcone" desc = "Pwrgame soda drizzled over a snowball in a paper cup." icon_state = "pwrgame_sc" - list_reagents = list("nutriment" = 1, "pwr_game" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/pwr_game = 5) tastes = list("ice" = 1, "water" = 1, "valid" = 5, "salt" = 5, "wats" = 5) /obj/item/reagent_containers/food/snacks/snowcones/honey name = "honey snowcone" desc = "Honey drizzled over a snowball in a paper cup." icon_state = "amber_sc" - list_reagents = list("nutriment" = 1, "honey" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/honey = 5) tastes = list("ice" = 1, "water" = 1, "flowers" = 5, "sweetness" = 5, "wax" = 1) /obj/item/reagent_containers/food/snacks/snowcones/rainbow name = "rainbow snowcone" desc = "A very colorful snowball in a paper cup." icon_state = "rainbow_sc" - list_reagents = list("nutriment" = 5, "laughter" = 25) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/laughter = 25) tastes = list("ice" = 1, "water" = 1, "sunlight" = 5, "light" = 5, "slime" = 5, "paint" = 3, "clouds" = 3) diff --git a/code/modules/food_and_drinks/food/snacks_meat.dm b/code/modules/food_and_drinks/food/snacks_meat.dm index bd01d4c7..6f3b3b3b 100644 --- a/code/modules/food_and_drinks/food/snacks_meat.dm +++ b/code/modules/food_and_drinks/food/snacks_meat.dm @@ -8,10 +8,10 @@ desc = "A grifftastic sandwich that burns your tongue and then leaves it numb!" icon_state = "cubancarp" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) bitesize = 3 filling_color = "#CD853F" - list_reagents = list("nutriment" = 6, "capsaicin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/capsaicin = 1) tastes = list("fish" = 4, "batter" = 1, "hot peppers" = 1) foodtype = MEAT @@ -19,7 +19,7 @@ name = "carp fillet" desc = "A fillet of spess carp meat." icon_state = "fishfillet" - list_reagents = list("nutriment" = 3, "carpotoxin" = 2, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/toxin/carpotoxin = 2, /datum/reagent/consumable/nutriment/vitamin = 2) bitesize = 6 filling_color = "#FA8072" tastes = list("fish" = 1) @@ -37,8 +37,8 @@ name = "fish fingers" desc = "A finger of fish." icon_state = "fishfingers" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) bitesize = 1 filling_color = "#CD853F" tastes = list("fish" = 1, "breadcrumbs" = 1) @@ -48,8 +48,8 @@ name = "fish and chips" desc = "I do say so myself chap." icon_state = "fishandchips" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) filling_color = "#FA8072" tastes = list("fish" = 1, "chips" = 1) foodtype = MEAT | VEGETABLES | FRIED @@ -59,8 +59,8 @@ desc = "A small cylindrical kudzu skin, filled with rice and fish." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_basic" - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) bitesize = 10 filling_color = "#F2EEEA" //rgb(242, 238, 234) tastes = list("fish" = 1, "rice" = 2, "salt" = 1) @@ -71,8 +71,8 @@ desc = "A peace of carp lightly placed on some rice." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_adv" - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) bitesize = 10 filling_color = "#F2EEEA" //rgb(242, 238, 234) tastes = list("fish" = 2, "rice" = 2, "salt" = 1) @@ -83,8 +83,8 @@ desc = "A well prepared peace of the best of the carp fillet placed on rice. Looks fancy and fresh!" icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_pro" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) bitesize = 10 filling_color = "#F2EEEA" //rgb(242, 238, 234) tastes = list("fish" = 3, "rice" = 2, "salt" = 1) @@ -97,7 +97,7 @@ name = "tofu" desc = "We all love tofu." icon_state = "tofu" - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) filling_color = "#F0E68C" tastes = list("tofu" = 1) foodtype = VEGETABLES @@ -106,7 +106,7 @@ name = "spider leg" desc = "A still twitching leg of a giant spider... you don't really want to eat this, do you?" icon_state = "spiderleg" - list_reagents = list("nutriment" = 2, "toxin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/toxin = 2) cooked_type = /obj/item/reagent_containers/food/snacks/boiledspiderleg filling_color = "#000000" tastes = list("cobwebs" = 1) @@ -117,8 +117,8 @@ desc = "Now you can feel like a real tourist vacationing in Ireland." icon_state = "cornedbeef" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) tastes = list("meat" = 1, "cabbage" = 1) foodtype = MEAT | VEGETABLES @@ -127,8 +127,8 @@ desc = "Because eating bear wasn't manly enough." icon_state = "bearsteak" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 2, "vitamin" = 6) - list_reagents = list("nutriment" = 2, "vitamin" = 5, "manlydorf" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 5, /datum/reagent/consumable/ethanol/manly_dorf = 5) tastes = list("meat" = 1, "salmon" = 1) foodtype = MEAT | ALCOHOL @@ -136,7 +136,7 @@ name = "meatball" desc = "A ball of meat." icon_state = "meatball" - list_reagents = list("nutriment" = 4, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#800000" tastes = list("meat" = 1) foodtype = MEAT @@ -146,8 +146,8 @@ desc = "A piece of mixed, long meat." icon_state = "sausage" filling_color = "#CD5C5C" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 6, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("meat" = 1) foodtype = MEAT | BREAKFAST var/roasted = FALSE @@ -160,35 +160,35 @@ trash = /obj/item/stack/rods icon_state = "kebab" w_class = WEIGHT_CLASS_NORMAL - list_reagents = list("nutriment" = 8) + list_reagents = list(/datum/reagent/consumable/nutriment = 8) tastes = list("meat" = 3, "metal" = 1) foodtype = MEAT /obj/item/reagent_containers/food/snacks/kebab/human name = "human-kebab" desc = "A human meat, on a stick." - bonus_reagents = list("nutriment" = 1, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("tender meat" = 3, "metal" = 1) foodtype = MEAT | GROSS /obj/item/reagent_containers/food/snacks/kebab/monkey name = "meat-kebab" desc = "Delicious meat, on a stick." - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("meat" = 3, "metal" = 1) foodtype = MEAT /obj/item/reagent_containers/food/snacks/kebab/tofu name = "tofu-kebab" desc = "Vegan meat, on a stick." - bonus_reagents = list("nutriment" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1) tastes = list("tofu" = 3, "metal" = 1) foodtype = VEGETABLES /obj/item/reagent_containers/food/snacks/kebab/tail name = "lizard-tail kebab" desc = "Severed lizard tail on a stick." - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("meat" = 8, "metal" = 4, "scales" = 1) foodtype = MEAT @@ -196,7 +196,7 @@ name = "raw khinkali" desc = "One hundred khinkalis? Do I look like a pig?" icon_state = "khinkali" - list_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) cooked_type = /obj/item/reagent_containers/food/snacks/khinkali tastes = list("meat" = 1, "onions" = 1, "garlic" = 1) foodtype = MEAT @@ -205,7 +205,7 @@ name = "khinkali" desc = "One hundred khinkalis? Do I look like a pig?" icon_state = "khinkali" - list_reagents = list("nutriment" = 4, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 2) bitesize = 3 filling_color = "#F0F0F0" tastes = list("meat" = 1, "onions" = 1, "garlic" = 1) @@ -216,7 +216,7 @@ desc = "Just add water!" icon_state = "monkeycube" bitesize = 12 - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) filling_color = "#CD853F" tastes = list("the jungle" = 1, "bananas" = 1) foodtype = MEAT | SUGAR @@ -245,10 +245,10 @@ name = "enchiladas" desc = "Viva La Mexico!" icon_state = "enchiladas" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) bitesize = 4 filling_color = "#FFA07A" - list_reagents = list("nutriment" = 8, "capsaicin" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/capsaicin = 6) tastes = list("hot peppers" = 1, "meat" = 3, "cheese" = 1, "sour cream" = 1) foodtype = MEAT @@ -257,8 +257,8 @@ desc = "Even non-vegetarians will LOVE this!" icon_state = "stewedsoymeat" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1) - list_reagents = list("nutriment" = 8) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 8) filling_color = "#D2691E" tastes = list("soy" = 1, "vegetables" = 1) foodtype = VEGETABLES @@ -272,8 +272,8 @@ desc = "A giant spider's leg that's still twitching after being cooked. Gross!" icon_state = "spiderlegcooked" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "capsaicin" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 3, "capsaicin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/capsaicin = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/capsaicin = 2) filling_color = "#000000" tastes = list("hot peppers" = 1, "cobwebs" = 1) foodtype = MEAT @@ -283,8 +283,8 @@ desc = "Would you eat them on a train? Would you eat them on a plane? Would you eat them on a state of the art corporate deathtrap floating through space?" icon_state = "spidereggsham" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) - list_reagents = list("nutriment" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) bitesize = 4 filling_color = "#7FFF00" tastes = list("meat" = 1, "the colour green" = 1) @@ -294,8 +294,8 @@ name = "carp sashimi" desc = "Celebrate surviving attack from hostile alien lifeforms by hospitalising yourself." icon_state = "sashimi" - bonus_reagents = list("nutriment" = 1, "capsaicin" = 4, "vitamin" = 4) - list_reagents = list("nutriment" = 6, "capsaicin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/capsaicin = 4, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/capsaicin = 5) filling_color = "#FA8072" tastes = list("fish" = 1, "hot peppers" = 1) foodtype = MEAT | TOXIC @@ -303,8 +303,8 @@ /obj/item/reagent_containers/food/snacks/nugget name = "chicken nugget" filling_color = "#B22222" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) tastes = list("\"chicken\"" = 1) foodtype = MEAT @@ -318,8 +318,8 @@ name = "pig in a blanket" desc = "A tiny sausage wrapped in a flakey, buttery roll. Free this pig from its blanket prison by eating it." icon_state = "pigblanket" - list_reagents = list("nutriment" = 6, "vitamin" = 1) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#800000" tastes = list("meat" = 1, "butter" = 1) @@ -328,7 +328,7 @@ desc = "Not so delicious rat meat, on a stick." icon_state = "ratkebab" w_class = WEIGHT_CLASS_NORMAL - list_reagents = list("nutriment" = 6, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("rat meat" = 1, "metal" = 1) foodtype = MEAT | GROSS @@ -336,20 +336,20 @@ name = "double rat-kebab" icon_state = "doubleratkebab" tastes = list("rat meat" = 2, "metal" = 1) - bonus_reagents = list("nutriment" = 6, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) /obj/item/reagent_containers/food/snacks/kebab/fiesta name = "fiesta skewer" icon_state = "fiestaskewer" tastes = list("tex-mex" = 3, "cumin" = 2) - bonus_reagents = list("vitamin" = 5, "capsaicin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 5, /datum/reagent/consumable/capsaicin = 3) /obj/item/reagent_containers/food/snacks/bbqribs name = "bbq ribs" desc = "BBQ ribs, slathered in a healthy coating of BBQ sauce. The least vegan thing to ever exist." icon_state = "ribs" w_class = WEIGHT_CLASS_NORMAL - list_reagents = list("nutriment" = 8, "vitamin" = 2, "bbqsauce" = 5) - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/bbqsauce = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("meat" = 3, "smokey sauce" = 1) - foodtype = MEAT \ No newline at end of file + foodtype = MEAT diff --git a/code/modules/food_and_drinks/food/snacks_other.dm b/code/modules/food_and_drinks/food/snacks_other.dm index d86643db..ba145ca2 100644 --- a/code/modules/food_and_drinks/food/snacks_other.dm +++ b/code/modules/food_and_drinks/food/snacks_other.dm @@ -7,7 +7,7 @@ icon_state = "cheesewheel" slice_path = /obj/item/reagent_containers/food/snacks/cheesewedge slices_num = 5 - list_reagents = list("nutriment" = 15, "vitamin" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 15, /datum/reagent/consumable/nutriment/vitamin = 5) w_class = WEIGHT_CLASS_NORMAL tastes = list("cheese" = 1) foodtype = DAIRY @@ -17,7 +17,7 @@ desc = "A wedge of delicious Cheddar. The cheese wheel it was cut from can't have gone far." icon_state = "cheesewedge" filling_color = "#FFD700" - list_reagents = list("nutriment" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("cheese" = 1) foodtype = DAIRY @@ -28,13 +28,13 @@ filling_color = "#FF1493" tastes = list("watermelon" = 1) foodtype = FRUIT - juice_results = list("watermelonjuice" = 5) + juice_results = list(/datum/reagent/consumable/watermelonjuice = 5) /obj/item/reagent_containers/food/snacks/candy_corn name = "candy corn" desc = "It's a handful of candy corn. Can be stored in a detective's hat." icon_state = "candy_corn" - list_reagents = list("nutriment" = 4, "sugar" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/sugar = 2) filling_color = "#FF8C00" tastes = list("candy corn" = 1) foodtype = JUNKFOOD | SUGAR @@ -43,7 +43,7 @@ name = "chocolate bar" desc = "Such, sweet, fattening food." icon_state = "chocolatebar" - list_reagents = list("nutriment" = 2, "sugar" = 2, "cocoa" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/coco = 2) filling_color = "#A0522D" tastes = list("chocolate" = 1) foodtype = JUNKFOOD | SUGAR @@ -53,7 +53,7 @@ name = "huge mushroom slice" desc = "A slice from a huge mushroom." icon_state = "hugemushroomslice" - list_reagents = list("nutriment" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("mushroom" = 1) foodtype = VEGETABLES @@ -62,7 +62,7 @@ desc = "Now let's find some cinema." icon_state = "popcorn" trash = /obj/item/trash/popcorn - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) bitesize = 0.1 //this snack is supposed to be eating during looooong time. And this it not dinner food! --rastaf0 filling_color = "#FFEFD5" tastes = list("popcorn" = 3, "butter" = 1) @@ -76,8 +76,8 @@ name = "loaded baked potato" desc = "Totally baked." icon_state = "loadedbakedpotato" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) filling_color = "#D2B48C" tastes = list("potato" = 1) foodtype = VEGETABLES | DAIRY @@ -87,7 +87,7 @@ desc = "AKA: French Fries, Freedom Fries, etc." icon_state = "fries" trash = /obj/item/trash/plate - list_reagents = list("nutriment" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) filling_color = "#FFD700" tastes = list("fries" = 3, "salt" = 1) foodtype = VEGETABLES | GRAIN | FRIED @@ -97,7 +97,7 @@ name = "tator tot" desc = "A large fried potato nugget that may or may not try to valid you." icon_state = "tatortot" - list_reagents = list("nutriment" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) filling_color = "FFD700" tastes = list("potato" = 3, "valids" = 1) foodtype = FRIED | VEGETABLES @@ -108,7 +108,7 @@ desc = "Dope from a soy." icon_state = "soydope" trash = /obj/item/trash/plate - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) filling_color = "#DEB887" tastes = list("soy" = 1) foodtype = VEGETABLES @@ -119,8 +119,8 @@ desc = "Fries. Covered in cheese. Duh." icon_state = "cheesyfries" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) filling_color = "#FFD700" tastes = list("fries" = 3, "cheese" = 1) foodtype = VEGETABLES | GRAIN @@ -129,7 +129,7 @@ name = "burned mess" desc = "Someone should be demoted from cook for this." icon_state = "badrecipe" - list_reagents = list("bad_food" = 30) + list_reagents = list(/datum/reagent/toxin/bad_food = 30) filling_color = "#8B4513" foodtype = GROSS dunkable = TRUE @@ -139,7 +139,7 @@ desc = "Tasty fries from fresh Carrots." icon_state = "carrotfries" trash = /obj/item/trash/plate - list_reagents = list("nutriment" = 3, "oculine" = 3, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/medicine/oculine = 3, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#FFA500" tastes = list("carrots" = 3, "salt" = 1) foodtype = VEGETABLES @@ -149,8 +149,8 @@ desc = "An apple coated in sugary sweetness." icon_state = "candiedapple" bitesize = 3 - bonus_reagents = list("nutriment" = 2, "sugar" = 3) - list_reagents = list("nutriment" = 3, "sugar" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/sugar = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/sugar = 2) filling_color = "#FF4500" tastes = list("apple" = 2, "sweetness" = 2) foodtype = JUNKFOOD | FRUIT | SUGAR @@ -161,7 +161,7 @@ icon_state = "mint" bitesize = 1 trash = /obj/item/trash/plate - list_reagents = list("minttoxin" = 2) + list_reagents = list(/datum/reagent/toxin/minttoxin = 2) filling_color = "#800000" foodtype = TOXIC | SUGAR @@ -169,8 +169,8 @@ name = "egg wrap" desc = "The precursor to Pigs in a Blanket." icon_state = "eggwrap" - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) - list_reagents = list("nutriment" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) filling_color = "#F0E68C" tastes = list("egg" = 1) foodtype = MEAT | GRAIN @@ -179,8 +179,8 @@ name = "tin of beans" desc = "Musical fruit in a slightly less musical container." icon_state = "beans" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 10) filling_color = "#B22222" tastes = list("beans" = 1) foodtype = VEGETABLES @@ -189,7 +189,7 @@ name = "spider eggs" desc = "A cluster of juicy spider eggs. A great side dish for when you care not for your health." icon_state = "spidereggs" - list_reagents = list("nutriment" = 2, "toxin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/toxin = 2) filling_color = "#008000" tastes = list("cobwebs" = 1) foodtype = MEAT | TOXIC @@ -198,7 +198,7 @@ name = "spiderling" desc = "It's slightly twitching in your hand. Ew..." icon_state = "spiderling" - list_reagents = list("nutriment" = 1, "toxin" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/toxin = 4) filling_color = "#00800" tastes = list("cobwebs" = 1, "guts" = 2) foodtype = MEAT | TOXIC @@ -207,7 +207,7 @@ name = "spider lollipop" desc = "Still gross, but at least it has a mountain of sugar on it." icon_state = "spiderlollipop" - list_reagents = list("nutriment" = 1, "toxin" = 1, "iron" = 10, "sugar" = 5, "omnizine" = 2) //lollipop, but vitamins = toxins + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/toxin = 1, /datum/reagent/iron = 10, /datum/reagent/consumable/sugar = 5, /datum/reagent/medicine/omnizine = 2) //lollipop, but vitamins = toxins filling_color = "#00800" tastes = list("cobwebs" = 1, "sugar" = 2) foodtype = JUNKFOOD | SUGAR @@ -217,7 +217,7 @@ desc = "Spider eggs wrapped in a thin salted Kudzu pod" icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_egg" - list_reagents = list("nutriment" = 6, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#FF3333" // R225 G051 B051 tastes = list("seaweed" = 1, "cobwebs" = 1, "salty" = 2) foodtype = MEAT | VEGETABLES @@ -226,8 +226,8 @@ name = "chocolate coin" desc = "A completely edible but nonflippable festive coin." icon_state = "chococoin" - bonus_reagents = list("nutriment" = 1, "sugar" = 1) - list_reagents = list("nutriment" = 3, "cocoa" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/coco = 1) filling_color = "#A0522D" tastes = list("chocolate" = 1) foodtype = JUNKFOOD | SUGAR @@ -236,8 +236,8 @@ name = "fudge dice" desc = "A little cube of chocolate that tends to have a less intense taste if you eat too many at once." icon_state = "chocodice" - bonus_reagents = list("nutriment" = 1, "sugar" = 1) - list_reagents = list("nutriment" = 3, "cocoa" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/coco = 1) filling_color = "#A0522D" trash = /obj/item/dice/fudge tastes = list("fudge" = 1) @@ -247,8 +247,8 @@ name = "chocolate orange" desc = "A festive chocolate orange." icon_state = "chocoorange" - bonus_reagents = list("nutriment" = 1, "sugar" = 1) - list_reagents = list("nutriment" = 3, "sugar" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/sugar = 1) filling_color = "#A0522D" tastes = list("chocolate" = 3, "oranges" = 1) foodtype = JUNKFOOD | SUGAR @@ -258,8 +258,8 @@ desc = "The only good recipe for eggplant." icon_state = "eggplantparm" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) - list_reagents = list("nutriment" = 6, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#BA55D3" tastes = list("eggplant" = 3, "cheese" = 1) foodtype = VEGETABLES | DAIRY @@ -269,7 +269,7 @@ desc = "The base for all your burritos." icon = 'icons/obj/food/food_ingredients.dmi' icon_state = "tortilla" - list_reagents = list("nutriment" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#FFEFD5" tastes = list("tortilla" = 1) foodtype = GRAIN @@ -278,8 +278,8 @@ name = "burrito" desc = "Tortilla wrapped goodness." icon_state = "burrito" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 4, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#FFEFD5" tastes = list("torilla" = 2, "meat" = 3) foodtype = GRAIN | MEAT @@ -288,8 +288,8 @@ name = "cheesy burrito" desc = "It's a burrito filled with cheese." icon_state = "cheesyburrito" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 4, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#FFD800" tastes = list("torilla" = 2, "meat" = 3, "cheese" = 1) foodtype = GRAIN | MEAT | DAIRY @@ -298,8 +298,8 @@ name = "carne asada burrito" desc = "The best burrito for meat lovers." icon_state = "carneburrito" - bonus_reagents = list("nutriment" = 2, "vitamin" = 1) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#A0522D" tastes = list("torilla" = 2, "meat" = 4) foodtype = GRAIN | MEAT @@ -308,8 +308,8 @@ name = "fuego plasma burrito" desc = "A super spicy burrito." icon_state = "fuegoburrito" - bonus_reagents = list("nutriment" = 2, "vitamin" = 3) - list_reagents = list("nutriment" = 4, "capsaicin" = 5, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/capsaicin = 5, /datum/reagent/consumable/nutriment/vitamin = 3) filling_color = "#FF2000" tastes = list("torilla" = 2, "meat" = 3, "hot peppers" = 1) foodtype = GRAIN | MEAT @@ -319,7 +319,7 @@ desc = "Made with roasted sweet potatoes!" icon_state = "yakiimo" trash = /obj/item/trash/plate - list_reagents = list("nutriment" = 5, "vitamin" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#8B1105" tastes = list("sweet potato" = 1) foodtype = GRAIN | VEGETABLES | SUGAR @@ -329,7 +329,7 @@ desc = "Sweet and crunchy." icon_state = "roastparsnip" trash = /obj/item/trash/plate - list_reagents = list("nutriment" = 3, "vitamin" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#FF5500" tastes = list("parsnip" = 1) foodtype = VEGETABLES @@ -338,8 +338,8 @@ name = "melon fruit bowl" desc = "For people who wants edible fruit bowls." icon_state = "melonfruitbowl" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#FF5500" w_class = WEIGHT_CLASS_NORMAL tastes = list("melon" = 1) @@ -349,8 +349,8 @@ name = "nachos" desc = "Chips from Space Mexico." icon_state = "nachos" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 6, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#F4A460" tastes = list("nachos" = 1) foodtype = VEGETABLES | FRIED @@ -359,8 +359,8 @@ name = "cheesy nachos" desc = "The delicious combination of nachos and melting cheese." icon_state = "cheesynachos" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 3) filling_color = "#FFD700" tastes = list("nachos" = 2, "cheese" = 1) foodtype = VEGETABLES | FRIED | DAIRY @@ -369,8 +369,8 @@ name = "Cuban nachos" desc = "That's some dangerously spicy nachos." icon_state = "cubannachos" - bonus_reagents = list("nutriment" = 2, "vitamin" = 3) - list_reagents = list("nutriment" = 7, "capsaicin" = 8, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/capsaicin = 8, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#DC143C" tastes = list("nachos" = 2, "hot pepper" = 1) foodtype = VEGETABLES | FRIED | DAIRY @@ -379,8 +379,8 @@ name = "melon keg" desc = "Who knew vodka was a fruit?" icon_state = "melonkeg" - bonus_reagents = list("nutriment" = 3, "vitamin" = 3) - list_reagents = list("nutriment" = 9, "vodka" = 15, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 9, /datum/reagent/consumable/ethanol/vodka = 15, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#FFD700" volume = 80 bitesize = 5 @@ -391,8 +391,8 @@ name = "honey nut bar" desc = "Oats and nuts compressed together into a bar, held together with a honey glaze." icon_state = "honeybar" - bonus_reagents = list("nutriment" = 2, "honey" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 5, "honey" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/honey = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/honey = 5) filling_color = "#F2CE91" tastes = list("oats" = 3, "nuts" = 2, "honey" = 1) foodtype = FRUIT | SUGAR @@ -401,8 +401,8 @@ name = "stuffed legion" desc = "The former skull of a damned human, filled with goliath meat. It has a decorative lava pool made of ketchup and hotsauce." icon_state = "stuffed_legion" - bonus_reagents = list("vitamin" = 3, "capsaicin" = 1, "tricordrazine" = 5) - list_reagents = list("nutriment" = 5, "vitamin" = 5, "capsaicin" = 2, "tricordrazine" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 3, /datum/reagent/consumable/capsaicin = 1, /datum/reagent/medicine/tricordrazine = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5, /datum/reagent/consumable/capsaicin = 2, /datum/reagent/medicine/tricordrazine = 10) tastes = list("death" = 2, "rock" = 1, "meat" = 1, "hot peppers" = 1) foodtype = MEAT @@ -410,8 +410,8 @@ name = "Powercrepe" desc = "With great power, comes great crepes. It looks like a pancake filled with jelly but packs quite a punch." icon_state = "powercrepe" - bonus_reagents = list("nutriment" = 5, "vitamin" = 3, "iron" = 10) - list_reagents = list("nutriment" = 10, "vitamin" = 5, "cherryjelly" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 3, /datum/reagent/iron = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 5, /datum/reagent/consumable/cherryjelly = 5) force = 20 throwforce = 10 block_chance = 50 @@ -426,7 +426,7 @@ desc = "A delicious lollipop. Makes for a great Valentine's present." icon = 'icons/obj/lollipop.dmi' icon_state = "lollipop_stick" - list_reagents = list("nutriment" = 1, "vitamin" = 1, "iron" = 10, "sugar" = 5, "omnizine" = 2) //Honk + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1, /datum/reagent/iron = 10, /datum/reagent/consumable/sugar = 5, /datum/reagent/medicine/omnizine = 2) //Honk var/mutable_appearance/head var/headcolor = rgb(0, 0, 0) tastes = list("candy" = 1) @@ -468,7 +468,7 @@ desc = "A colorful, sugary gumball." icon = 'icons/obj/lollipop.dmi' icon_state = "gumball" - list_reagents = list("sugar" = 5, "bicaridine" = 2, "kelotane" = 2) //Kek + list_reagents = list(/datum/reagent/consumable/sugar = 5, /datum/reagent/medicine/bicaridine = 2, /datum/reagent/medicine/kelotane = 2) //Kek tastes = list("candy") foodtype = JUNKFOOD @@ -495,8 +495,8 @@ name = "taco" desc = "A traditional taco with meat, cheese, and lettuce." icon_state = "taco" - bonus_reagents = list("nutriment" = 3, "vitamin" = 2) - list_reagents = list("nutriment" = 4, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "F0D830" tastes = list("taco" = 4, "meat" = 2, "cheese" = 2, "lettuce" = 1) foodtype = MEAT | DAIRY | GRAIN | VEGETABLES @@ -504,8 +504,8 @@ /obj/item/reagent_containers/food/snacks/taco/plain desc = "A traditional taco with meat and cheese, minus the rabbit food." icon_state = "taco_plain" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 3, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("taco" = 4, "meat" = 2, "cheese" = 2) foodtype = MEAT | DAIRY | GRAIN @@ -513,8 +513,8 @@ name = "Bran Requests Cereal" desc = "A dry cereal that satiates your requests for bran. Tastes uniquely like raisins and salt." icon_state = "bran_requests" - list_reagents = list("nutriment" = 3, "vitamin" = 2, "sodiumchloride" = 5) - bonus_reagents = list("sodiumchloride" = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/sodiumchloride = 5) + bonus_reagents = list(/datum/reagent/consumable/sodiumchloride = 10) tastes = list("bran" = 4, "raisins" = 3, "salt" = 1) foodtype = GRAIN | FRUIT @@ -522,7 +522,7 @@ name = "stick of butter" desc = "A stick of delicious, golden, fatty goodness." icon_state = "butter" - list_reagents = list("nutriment" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) filling_color = "#FFD700" tastes = list("butter" = 1) foodtype = DAIRY @@ -531,7 +531,7 @@ name = "onion rings" desc = "Onion slices coated in batter." icon_state = "onionrings" - list_reagents = list("nutriment" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3) filling_color = "#C0C9A0" gender = PLURAL tastes = list("batter" = 3, "onion" = 1) @@ -550,7 +550,7 @@ name = "chocolate" desc = "A tiny and sweet chocolate. Has a 'strawberry' filling!" icon_state = "tiny_chocolate" - list_reagents = list("nutriment" = 1, "sugar" = 1, "cocoa" = 1, "aphro" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/coco = 1, /datum/reagent/drug/aphrodisiac = 1) filling_color = "#A0522D" tastes = list("chocolate" = 1) foodtype = JUNKFOOD | SUGAR @@ -560,7 +560,7 @@ desc = "A ball of rice with some light salt and a wrap of Kudzu skin." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "riceball" - list_reagents = list("nutriment" = 6, "sodiumchloride" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/sodiumchloride = 2) tastes = list("rice" = 3, "salt" = 1) foodtype = GRAIN @@ -568,7 +568,7 @@ name = "Canned Peaches" desc = "Just a nice can of ripe peaches swimming in their own juices." icon_state = "peachcan" - list_reagents = list("peachjuice" = 20, "sugar" = 8, "nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/peachjuice = 20, /datum/reagent/consumable/sugar = 8, /datum/reagent/consumable/nutriment = 2) filling_color = "#ffdf26" w_class = WEIGHT_CLASS_NORMAL tastes = list("peaches" = 7, "tin" = 1) @@ -584,7 +584,7 @@ name = "Chocolate dipped strawberries" desc = "A strawberry dipped in a bit of chocolate." icon_state = "chocolatestrawberry" - list_reagents = list("sugar" = 5, "nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/sugar = 5, /datum/reagent/consumable/nutriment = 2) filling_color = "#ffdf26" w_class = WEIGHT_CLASS_NORMAL tastes = list("strawberries" = 5, "chocolate" = 3) @@ -595,7 +595,7 @@ name = "Chocolate dipped banana" desc = "A banana dipped in a bit of chocolate and held on a stick." icon_state = "banana_coco" - list_reagents = list("sugar" = 5, "nutriment" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/sugar = 5, /datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#ffdf26" tastes = list("banana" = 5, "chocolate" = 3) foodtype = FRUIT | SUGAR @@ -607,7 +607,7 @@ icon_state = "boritos" trash = /obj/item/trash/boritos bitesize = 2 - list_reagents = list("nutriment" = 3, "cooking_oil" = 2, "sodiumchloride" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/cooking_oil = 2, /datum/reagent/consumable/sodiumchloride = 3) filling_color = "#ECA735" tastes = list("fried corn" = 1) foodtype = JUNKFOOD | FRIED diff --git a/code/modules/food_and_drinks/food/snacks_pastry.dm b/code/modules/food_and_drinks/food/snacks_pastry.dm index 1695329a..058040a5 100644 --- a/code/modules/food_and_drinks/food/snacks_pastry.dm +++ b/code/modules/food_and_drinks/food/snacks_pastry.dm @@ -8,8 +8,8 @@ icon = 'icons/obj/food/donut.dmi' icon_state = "donut" bitesize = 5 - bonus_reagents = list("sugar" = 1) - list_reagents = list("nutriment" = 3, "sprinkles" = 1, "sugar" = 2) + bonus_reagents = list(/datum/reagent/consumable/sugar = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/sugar = 2) filling_color = "#D2691E" tastes = list("donut" = 1) foodtype = JUNKFOOD | GRAIN | FRIED | SUGAR | BREAKFAST @@ -30,7 +30,7 @@ is_decorated = TRUE name = "[decorated_adjective] [name]" icon_state = decorated_icon //delish~! - reagents.add_reagent("sprinkles", 1) + reagents.add_reagent(/datum/reagent/consumable/sprinkles, 1) filling_color = "#FF69B4" return TRUE @@ -58,15 +58,18 @@ /obj/item/reagent_containers/food/snacks/donut/chaos/Initialize() . = ..() - extra_reagent = pick("nutriment", "capsaicin", "frostoil", "krokodil", "plasma", "cocoa", "slimejelly", "banana", "berryjuice", "omnizine") + extra_reagent = pick(/datum/reagent/consumable/nutriment, /datum/reagent/consumable/capsaicin, /datum/reagent/consumable/frostoil, + /datum/reagent/drug/krokodil, /datum/reagent/toxin/plasma, /datum/reagent/consumable/coco, + /datum/reagent/toxin/slimejelly, /datum/reagent/consumable/banana, /datum/reagent/consumable/berryjuice, + /datum/reagent/medicine/omnizine) reagents.add_reagent(extra_reagent, 3) /obj/item/reagent_containers/food/snacks/donut/meat name = "Meat Donut" desc = "Tastes as gross as it looks." icon_state = "donut_meat" - bonus_reagents = list("ketchup" = 1) - list_reagents = list("nutriment" = 3, "ketchup" = 2) + bonus_reagents = list(/datum/reagent/consumable/ketchup = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/ketchup = 2) tastes = list("meat" = 1) foodtype = JUNKFOOD | MEAT | GROSS | FRIED | BREAKFAST @@ -74,7 +77,7 @@ name = "pink donut" desc = "Goes great with a soy latte." icon_state = "donut_pink" - bonus_reagents = list("berryjuice" = 3, "sprinkles" = 1) //Extra sprinkles to reward frosting + bonus_reagents = list(/datum/reagent/consumable/berryjuice = 3, /datum/reagent/consumable/sprinkles = 1) //Extra sprinkles to reward frosting filling_color = "#E57d9A" decorated_icon = "donut_homer" @@ -82,7 +85,7 @@ name = "spaceman's donut" desc = "Goes great with a cold beaker of malk." icon_state = "donut_purple" - bonus_reagents = list("polypyr" = 3, "sprinkles" = 1) + bonus_reagents = list(/datum/reagent/medicine/polypyr = 3, /datum/reagent/consumable/sprinkles = 1) tastes = list("donut" = 3, "violets" = 1) is_decorated = TRUE filling_color = "#8739BF" @@ -91,7 +94,7 @@ name = "apple donut" desc = "Goes great with a shot of cinnamon schnapps." icon_state = "donut_green" - bonus_reagents = list("applejuice" = 3, "sprinkles" = 1) + bonus_reagents = list(/datum/reagent/consumable/applejuice = 3, /datum/reagent/consumable/sprinkles = 1) tastes = list("donut" = 3, "green apples" = 1) is_decorated = TRUE filling_color = "#6ABE30" @@ -100,7 +103,7 @@ name = "caramel donut" desc = "Goes great with a mug of hot coco." icon_state = "donut_beige" - bonus_reagents = list("caramel" = 3, "sprinkles" = 1) + bonus_reagents = list(/datum/reagent/consumable/caramel = 3, /datum/reagent/consumable/sprinkles = 1) tastes = list("donut" = 3, "buttery sweetness" = 1) is_decorated = TRUE filling_color = "#D4AD5B" @@ -109,7 +112,7 @@ name = "chocolate donut" desc = "Goes great with a glass of warm milk." icon_state = "donut_choc" - bonus_reagents = list("hot_coco" = 3, "sprinkles" = 1) //the coco reagent is just bitter. + bonus_reagents = list(/datum/reagent/consumable/hot_coco = 3, /datum/reagent/consumable/sprinkles = 1) //the coco reagent is just bitter. tastes = list("donut" = 4, "bitterness" = 1) decorated_icon = "donut_choc_sprinkles" filling_color = "#4F230D" @@ -118,7 +121,7 @@ name = "blumpkin donut" desc = "Goes great with a mug of soothing drunken blumpkin." icon_state = "donut_blue" - bonus_reagents = list("blumpkinjuice" = 3, "sprinkles" = 1) + bonus_reagents = list(/datum/reagent/consumable/blumpkinjuice = 3, /datum/reagent/consumable/sprinkles = 1) tastes = list("donut" = 2, "blumpkin" = 1) is_decorated = TRUE filling_color = "#2788C4" @@ -127,7 +130,7 @@ name = "bungo donut" desc = "Goes great with a mason jar of hippie's delight." icon_state = "donut_yellow" - bonus_reagents = list("bungojuice" = 3, "sprinkles" = 1) + bonus_reagents = list(/datum/reagent/consumable/bungojuice = 3, /datum/reagent/consumable/sprinkles = 1) tastes = list("donut" = 3, "tropical sweetness" = 1) is_decorated = TRUE filling_color = "#DEC128" @@ -136,7 +139,7 @@ name = "matcha donut" desc = "Goes great with a cup of tea." icon_state = "donut_olive" - bonus_reagents = list("teapowder = 3", "sprinkles" = 1) + bonus_reagents = list(/datum/reagent/toxin/teapowder = 3, /datum/reagent/consumable/sprinkles = 1) tastes = list("donut" = 3, "matcha" = 1) is_decorated = TRUE filling_color = "#879630" @@ -146,8 +149,8 @@ desc = "That cream looks a little runny..." icon_state = "donut_cum" bitesize = 10 - bonus_reagents = list("semen" = 1) - list_reagents = list("nutriment" = 3, "sugar" = 2, "semen" = 5) + bonus_reagents = list(/datum/reagent/consumable/semen = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/semen = 5) filling_color = "#FFFFFF" tastes = list("donut" = 1, "salt" = 3) foodtype = JUNKFOOD | GRAIN | FRIED | SUGAR @@ -159,7 +162,7 @@ desc = "You jelly?" icon_state = "jelly" decorated_icon = "jelly_homer" - bonus_reagents = list("sugar" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/nutriment/vitamin = 1) extra_reagent = "berryjuice" tastes = list("jelly" = 1, "donut" = 3) foodtype = JUNKFOOD | GRAIN | FRIED | FRUIT | SUGAR | BREAKFAST @@ -167,7 +170,7 @@ /obj/item/reagent_containers/food/snacks/donut/jelly/Initialize() . = ..() if(extra_reagent) - reagents.add_reagent("[extra_reagent]", 3) + reagents.add_reagent(extra_reagent, 3) /obj/item/reagent_containers/food/snacks/donut/jelly/plain //use this ingame to avoid inheritance related crafting issues. @@ -175,7 +178,7 @@ name = "pink jelly donut" desc = "Goes great with a soy latte." icon_state = "jelly_pink" - bonus_reagents = list("berryjuice" = 3, "sprinkles" = 1, "vitamin" = 1) //Extra sprinkles to reward frosting. + bonus_reagents = list(/datum/reagent/consumable/berryjuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) //Extra sprinkles to reward frosting. filling_color = "#E57d9A" decorated_icon = "jelly_homer" @@ -183,7 +186,7 @@ name = "spaceman's jelly donut" desc = "Goes great with a cold beaker of malk." icon_state = "jelly_purple" - bonus_reagents = list("polypyr" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/medicine/polypyr = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "violets" = 1) is_decorated = TRUE filling_color = "#8739BF" @@ -192,7 +195,7 @@ name = "apple jelly donut" desc = "Goes great with a shot of cinnamon schnapps." icon_state = "jelly_green" - bonus_reagents = list("applejuice" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/applejuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "green apples" = 1) is_decorated = TRUE filling_color = "#6ABE30" @@ -201,7 +204,7 @@ name = "caramel jelly donut" desc = "Goes great with a mug of hot coco." icon_state = "jelly_beige" - bonus_reagents = list("caramel" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/caramel = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "buttery sweetness" = 1) is_decorated = TRUE filling_color = "#D4AD5B" @@ -209,8 +212,8 @@ /obj/item/reagent_containers/food/snacks/donut/jelly/choco name = "chocolate jelly donut" desc = "Goes great with a glass of warm milk." - icon_state = "jelly_choco" - bonus_reagents = list("hot_coco" = 3, "sprinkles" = 1, "vitamin" = 1) //the coco reagent is just bitter. + icon_state = "jelly_choc" + bonus_reagents = list(/datum/reagent/consumable/hot_coco = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) //the coco reagent is just bitter. tastes = list("jelly" = 1, "donut" = 4, "bitterness" = 1) decorated_icon = "jelly_choco_sprinkles" filling_color = "#4F230D" @@ -219,7 +222,7 @@ name = "blumpkin jelly donut" desc = "Goes great with a mug of soothing drunken blumpkin." icon_state = "jelly_blue" - bonus_reagents = list("blumpkinjuice" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/blumpkinjuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 2, "blumpkin" = 1) is_decorated = TRUE filling_color = "#2788C4" @@ -228,7 +231,7 @@ name = "bungo jelly donut" desc = "Goes great with a mason jar of hippie's delight." icon_state = "jelly_yellow" - bonus_reagents = list("bungojuice" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/bungojuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "tropical sweetness" = 1) is_decorated = TRUE filling_color = "#DEC128" @@ -237,7 +240,7 @@ name = "matcha jelly donut" desc = "Goes great with a cup of tea." icon_state = "jelly_olive" - bonus_reagents = list("teapowder" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/toxin/teapowder = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "matcha" = 1) is_decorated = TRUE filling_color = "#879630" @@ -257,14 +260,14 @@ name = "pink jelly donut" desc = "Goes great with a soy latte." icon_state = "jelly_pink" - bonus_reagents = list("berryjuice" = 3, "sprinkles" = 1, "vitamin" = 1) //Extra sprinkles to reward frosting + bonus_reagents = list(/datum/reagent/consumable/berryjuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) //Extra sprinkles to reward frosting filling_color = "#E57d9A" /obj/item/reagent_containers/food/snacks/donut/jelly/slimejelly/trumpet name = "spaceman's jelly donut" desc = "Goes great with a cold beaker of malk." icon_state = "jelly_purple" - bonus_reagents = list("polypyr" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/medicine/polypyr = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "violets" = 1) is_decorated = TRUE filling_color = "#8739BF" @@ -273,7 +276,7 @@ name = "apple jelly donut" desc = "Goes great with a shot of cinnamon schnapps." icon_state = "jelly_green" - bonus_reagents = list("applejuice" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/applejuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "green apples" = 1) is_decorated = TRUE filling_color = "#6ABE30" @@ -282,7 +285,7 @@ name = "caramel jelly donut" desc = "Goes great with a mug of hot coco." icon_state = "jelly_beige" - bonus_reagents = list("caramel" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/caramel = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "buttery sweetness" = 1) is_decorated = TRUE filling_color = "#D4AD5B" @@ -290,8 +293,8 @@ /obj/item/reagent_containers/food/snacks/donut/jelly/slimejelly/choco name = "chocolate jelly donut" desc = "Goes great with a glass of warm milk." - icon_state = "jelly_choco" - bonus_reagents = list("hot_coco" = 3, "sprinkles" = 1, "vitamin" = 1) //the coco reagent is just bitter. + icon_state = "jelly_choc" + bonus_reagents = list(/datum/reagent/consumable/hot_coco = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) //the coco reagent is just bitter. tastes = list("jelly" = 1, "donut" = 4, "bitterness" = 1) decorated_icon = "jelly_choco_sprinkles" filling_color = "#4F230D" @@ -300,7 +303,7 @@ name = "blumpkin jelly donut" desc = "Goes great with a mug of soothing drunken blumpkin." icon_state = "jelly_blue" - bonus_reagents = list("blumpkinjuice" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/blumpkinjuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 2, "blumpkin" = 1) is_decorated = TRUE filling_color = "#2788C4" @@ -309,7 +312,7 @@ name = "bungo jelly donut" desc = "Goes great with a mason jar of hippie's delight." icon_state = "jelly_yellow" - bonus_reagents = list("bungojuice" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/bungojuice = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "tropical sweetness" = 1) is_decorated = TRUE filling_color = "#DEC128" @@ -318,7 +321,7 @@ name = "matcha jelly donut" desc = "Goes great with a cup of tea." icon_state = "jelly_olive" - bonus_reagents = list("teapowder" = 3, "sprinkles" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/toxin/teapowder = 3, /datum/reagent/consumable/sprinkles = 1, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("jelly" = 1, "donut" = 3, "matcha" = 1) is_decorated = TRUE filling_color = "#879630" @@ -328,8 +331,8 @@ desc = "A sugar glazed donut." icon_state = "donut_glaze" bitesize = 10 - bonus_reagents = list("sugar" = 3) - list_reagents = list("nutriment" = 3, "sugar" = 8) + bonus_reagents = list(/datum/reagent/consumable/sugar = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/sugar = 8) filling_color = "#FFFFFF" tastes = list("donut" = 1, "salt" = 3) foodtype = JUNKFOOD | GRAIN | FRIED | SUGAR @@ -340,8 +343,8 @@ name = "muffin" desc = "A delicious and spongy little cake." icon_state = "muffin" - bonus_reagents = list("vitamin" = 1) - list_reagents = list("nutriment" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) filling_color = "#F4A460" tastes = list("muffin" = 1) foodtype = GRAIN | SUGAR | BREAKFAST @@ -365,8 +368,8 @@ name = "chawanmushi" desc = "A legendary egg custard that makes friends out of enemies. Probably too hot for a cat to eat." icon_state = "chawanmushi" - bonus_reagents = list("vitamin" = 1) - list_reagents = list("nutriment" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) filling_color = "#FFE4E1" tastes = list("custard" = 1) foodtype = GRAIN | MEAT | VEGETABLES @@ -378,8 +381,8 @@ desc = "Mmm, waffles." icon_state = "waffles" trash = /obj/item/trash/waffles - bonus_reagents = list("vitamin" = 1) - list_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#D2691E" tastes = list("waffles" = 1) foodtype = GRAIN | SUGAR | BREAKFAST @@ -389,8 +392,8 @@ desc = "Not made of people. Honest." //Totally people. icon_state = "soylent_green" trash = /obj/item/trash/waffles - bonus_reagents = list("vitamin" = 1) - list_reagents = list("nutriment" = 10, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#9ACD32" tastes = list("waffles" = 7, "people" = 1) foodtype = GRAIN | MEAT @@ -400,8 +403,8 @@ desc = "Not made of people. Honest." //Actually honest for once. icon_state = "soylent_yellow" trash = /obj/item/trash/waffles - bonus_reagents = list("vitamin" = 1) - list_reagents = list("nutriment" = 10, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#9ACD32" tastes = list("waffles" = 7, "the colour green" = 1) foodtype = GRAIN @@ -412,8 +415,8 @@ icon_state = "rofflewaffles" trash = /obj/item/trash/waffles bitesize = 4 - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 8, "mushroomhallucinogen" = 2, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/drug/mushroomhallucinogen = 2, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#00BFFF" tastes = list("waffle" = 1, "mushrooms" = 1) foodtype = GRAIN | VEGETABLES | SUGAR | BREAKFAST @@ -425,8 +428,8 @@ desc = "COOKIE!!!" icon_state = "COOKIE!!!" bitesize = 1 - bonus_reagents = list("nutriment" = 1) - list_reagents = list("nutriment" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) filling_color = "#F0E68C" tastes = list("cookie" = 1) foodtype = GRAIN | SUGAR @@ -436,7 +439,7 @@ name = "\improper Donk-pocket" desc = "The food of choice for the seasoned traitor." icon_state = "donkpocket" - list_reagents = list("nutriment" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) cooked_type = /obj/item/reagent_containers/food/snacks/donkpocket/warm filling_color = "#CD853F" tastes = list("meat" = 2, "dough" = 2, "laziness" = 1) @@ -445,8 +448,8 @@ /obj/item/reagent_containers/food/snacks/donkpocket/warm name = "warm Donk-pocket" desc = "The heated food of choice for the seasoned traitor." - bonus_reagents = list("omnizine" = 3) - list_reagents = list("nutriment" = 4, "omnizine" = 3) + bonus_reagents = list(/datum/reagent/medicine/omnizine = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/medicine/omnizine = 3) cooked_type = null tastes = list("meat" = 2, "dough" = 2, "laziness" = 1) foodtype = GRAIN @@ -455,7 +458,7 @@ name = "\improper Dank-pocket" desc = "The food of choice for the seasoned botanist." icon_state = "dankpocket" - list_reagents = list("lipolicide" = 3, "space_drugs" = 3, "nutriment" = 4) + list_reagents = list(/datum/reagent/toxin/lipolicide = 3, /datum/reagent/drug/space_drugs = 3, /datum/reagent/consumable/nutriment = 4) filling_color = "#00FF00" tastes = list("meat" = 2, "dough" = 2) foodtype = GRAIN | VEGETABLES @@ -464,8 +467,8 @@ name = "fortune cookie" desc = "A true prophecy in each cookie!" icon_state = "fortune_cookie" - bonus_reagents = list("nutriment" = 2) - list_reagents = list("nutriment" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3) filling_color = "#F4A460" tastes = list("cookie" = 1) foodtype = GRAIN | SUGAR @@ -474,8 +477,8 @@ name = "poppy pretzel" desc = "It's all twisted up!" icon_state = "poppypretzel" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) filling_color = "#F0E68C" tastes = list("pretzel" = 1) foodtype = GRAIN | SUGAR @@ -484,8 +487,8 @@ name = "plump helmet biscuit" desc = "This is a finely-prepared plump helmet biscuit. The ingredients are exceptionally minced plump helmet, and well-minced dwarven wheat flour." icon_state = "phelmbiscuit" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) filling_color = "#F0E68C" tastes = list("mushroom" = 1, "biscuit" = 1) foodtype = GRAIN | VEGETABLES @@ -495,18 +498,18 @@ if(fey) name = "exceptional plump helmet biscuit" desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump helmet biscuit!" - bonus_reagents = list("omnizine" = 5, "nutriment" = 1, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/medicine/omnizine = 5, /datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) . = ..() if(fey) - reagents.add_reagent("omnizine", 5) + reagents.add_reagent(/datum/reagent/medicine/omnizine, 5) /obj/item/reagent_containers/food/snacks/cracker name = "cracker" desc = "It's a salted cracker." icon_state = "cracker" bitesize = 1 - bonus_reagents = list("nutriment" = 1) - list_reagents = list("nutriment" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) filling_color = "#F0E68C" tastes = list("cracker" = 1) foodtype = GRAIN @@ -516,8 +519,8 @@ desc = "Fresh footlong ready to go down on." icon_state = "hotdog" bitesize = 3 - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) - list_reagents = list("nutriment" = 6, "ketchup" = 3, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/ketchup = 3, /datum/reagent/consumable/nutriment/vitamin = 3) filling_color = "#8B0000" tastes = list("bun" = 3, "meat" = 2) foodtype = GRAIN | MEAT | VEGETABLES @@ -526,8 +529,8 @@ name = "meat bun" desc = "Has the potential to not be Dog." icon_state = "meatbun" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#8B0000" tastes = list("bun" = 3, "meat" = 2) foodtype = GRAIN | MEAT | VEGETABLES @@ -536,7 +539,7 @@ name = "khachapuri" desc = "Bread with egg and cheese?" icon_state = "khachapuri" - list_reagents = list("nutriment" = 12, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 12, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#FFFF4D" tastes = list("bread" = 1, "egg" = 1, "cheese" = 1) foodtype = GRAIN | MEAT | DAIRY @@ -545,8 +548,8 @@ name = "sugar cookie" desc = "Just like your little sister used to make." icon_state = "sugarcookie" - bonus_reagents = list("nutriment" = 1, "sugar" = 3) - list_reagents = list("nutriment" = 3, "sugar" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/sugar = 3) filling_color = "#CD853F" tastes = list("sweetness" = 1) foodtype = GRAIN | JUNKFOOD | SUGAR @@ -556,8 +559,8 @@ name = "chocolate cornet" desc = "Which side's the head, the fat end or the thin end?" icon_state = "chococornet" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#FFE4C4" tastes = list("biscuit" = 3, "chocolate" = 1) foodtype = GRAIN | JUNKFOOD @@ -566,8 +569,8 @@ name = "oatmeal cookie" desc = "The best of both cookie and oat." icon_state = "oatmealcookie" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#D2691E" tastes = list("cookie" = 2, "oat" = 1) foodtype = GRAIN @@ -577,8 +580,8 @@ name = "raisin cookie" desc = "Why would you put raisins on a cookie?" icon_state = "raisincookie" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#F0E68C" tastes = list("cookie" = 1, "raisins" = 1) foodtype = GRAIN | FRUIT @@ -588,8 +591,8 @@ name = "cherry cupcake" desc = "A sweet cupcake with cherry bits." icon_state = "cherrycupcake" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#F0E68C" tastes = list("cake" = 3, "cherry" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -598,8 +601,8 @@ name = "blue cherry cupcake" desc = "Blue cherries inside a delicious cupcake." icon_state = "bluecherrycupcake" - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#F0E68C" tastes = list("cake" = 3, "blue cherry" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -608,8 +611,8 @@ name = "strawberry cupcake" desc = "Strawberry inside a delicious cupcake." icon_state = "strawberrycupcake" - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#F0E68C" tastes = list("cake" = 2, "strawberry" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -618,8 +621,8 @@ name = "honey bun" desc = "A sticky pastry bun glazed with honey." icon_state = "honeybun" - bonus_reagents = list("nutriment" = 1, "honey" = 1) - list_reagents = list("nutriment" = 5, "honey" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/honey = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/honey = 5) filling_color = "#F2CE91" tastes = list("pastry" = 1, "sweetness" = 1) foodtype = GRAIN | SUGAR @@ -631,8 +634,8 @@ desc = "A fluffy pancake. The softer, superior relative of the waffle." icon_state = "pancakes_1" item_state = "pancakes" - bonus_reagents = list("vitamin" = 1) - list_reagents = list("nutriment" = 4, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 1) filling_color = "#D2691E" tastes = list("pancakes" = 1) foodtype = GRAIN | SUGAR | BREAKFAST @@ -642,8 +645,8 @@ desc = "A fluffy and delicious blueberry pancake." icon_state = "bbpancakes_1" item_state = "bbpancakes" - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("pancakes" = 1, "blueberries" = 1) /obj/item/reagent_containers/food/snacks/pancakes/chocolatechip @@ -651,8 +654,8 @@ desc = "A fluffy and delicious chocolate chip pancake." icon_state = "ccpancakes_1" item_state = "ccpancakes" - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 6, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("pancakes" = 1, "chocolate" = 1) /obj/item/reagent_containers/food/snacks/pancakes/Initialize() diff --git a/code/modules/food_and_drinks/food/snacks_pie.dm b/code/modules/food_and_drinks/food/snacks_pie.dm index a920b467..4d4a4f00 100644 --- a/code/modules/food_and_drinks/food/snacks_pie.dm +++ b/code/modules/food_and_drinks/food/snacks_pie.dm @@ -5,7 +5,7 @@ bitesize = 3 w_class = WEIGHT_CLASS_NORMAL volume = 80 - list_reagents = list("nutriment" = 10, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("pie" = 1) foodtype = GRAIN @@ -14,7 +14,7 @@ desc = "A simple pie, still delicious." icon_state = "pie" custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/pie - bonus_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("pie" = 1) foodtype = GRAIN @@ -23,8 +23,8 @@ desc = "Just like back home, on clown planet! HONK!" icon_state = "pie" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "banana" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/banana = 5, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("pie" = 1) foodtype = GRAIN | DAIRY | SUGAR var/stunning = TRUE @@ -61,7 +61,7 @@ qdel(src) /obj/item/reagent_containers/food/snacks/pie/cream/nostun - list_reagents = list("laughter" = 15) + list_reagents = list(/datum/reagent/consumable/laughter = 15) stunning = FALSE /obj/item/reagent_containers/food/snacks/pie/cream/body @@ -90,8 +90,8 @@ name = "berry clafoutis" desc = "No black birds, this is a good sign." icon_state = "berryclafoutis" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 10, "berryjuice" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/berryjuice = 5, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("pie" = 1, "blackberries" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -99,8 +99,8 @@ name = "beary pie" desc = "No brown bears, this is a good sign." icon_state = "bearypie" - bonus_reagents = list("nutriment" = 2, "vitamin" = 3) - list_reagents = list("nutriment" = 2, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("pie" = 1, "meat" = 1, "salmon" = 1) foodtype = GRAIN | SUGAR @@ -108,7 +108,7 @@ name = "meat-pie" icon_state = "meatpie" desc = "An old barber recipe, very delicious!" - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("pie" = 1, "meat" = 1) foodtype = GRAIN | MEAT @@ -117,7 +117,7 @@ name = "tofu-pie" icon_state = "meatpie" desc = "A delicious tofu pie." - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("pie" = 1, "tofu" = 1) foodtype = GRAIN @@ -127,8 +127,8 @@ desc = "Sweet and tasty poison pie." icon_state = "amanita_pie" bitesize = 4 - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 6, "amatoxin" = 3, "mushroomhallucinogen" = 1, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/toxin/amatoxin = 3, /datum/reagent/drug/mushroomhallucinogen = 1, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("pie" = 1, "mushroom" = 1) foodtype = GRAIN | VEGETABLES | TOXIC | GROSS @@ -137,7 +137,7 @@ name = "plump pie" desc = "I bet you love stuff made out of plump helmets!" icon_state = "plump_pie" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("pie" = 1, "mushroom" = 1) foodtype = GRAIN | VEGETABLES @@ -148,9 +148,9 @@ if(fey) name = "exceptional plump pie" desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump pie!" - bonus_reagents = list("nutriment" = 1, "omnizine" = 5, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/medicine/omnizine = 5, /datum/reagent/consumable/nutriment/vitamin = 4) if(fey) - reagents.add_reagent("omnizine", 5) + reagents.add_reagent(/datum/reagent/medicine/omnizine, 5) /obj/item/reagent_containers/food/snacks/pie/xemeatpie @@ -158,7 +158,7 @@ icon_state = "xenomeatpie" desc = "A delicious meatpie. Probably heretical." trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("pie" = 1, "meat" = 1, "acid" = 1) foodtype = GRAIN | MEAT @@ -167,7 +167,7 @@ name = "apple pie" desc = "A pie containing sweet sweet love...or apple." icon_state = "applepie" - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("pie" = 1, "apple" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -175,7 +175,7 @@ name = "cherry pie" desc = "Taste so good, make a grown man cry." icon_state = "cherrypie" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("pie" = 7, "Nicole Paige Brooks" = 2) foodtype = GRAIN | FRUIT | SUGAR @@ -186,7 +186,7 @@ icon_state = "pumpkinpie" slice_path = /obj/item/reagent_containers/food/snacks/pumpkinpieslice slices_num = 5 - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("pie" = 1, "pumpkin" = 1) foodtype = GRAIN | VEGETABLES @@ -197,7 +197,7 @@ icon_state = "pumpkinpieslice" trash = /obj/item/trash/plate filling_color = "#FFA500" - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) tastes = list("pie" = 1, "pumpkin" = 1) foodtype = GRAIN | VEGETABLES @@ -205,8 +205,8 @@ name = "golden apple streusel tart" desc = "A tasty dessert that won't make it through a metal detector." icon_state = "gappletart" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 8, "gold" = 5, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/gold = 5, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("pie" = 1, "apple" = 1, "expensive metal" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -214,8 +214,8 @@ name = "grape tart" desc = "A tasty dessert that reminds you of the wine you didn't make." icon_state = "grapetart" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 4, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("pie" = 1, "grape" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -223,8 +223,8 @@ name = "mime tart" desc = "..." icon_state = "mimetart" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4, "nothing" = 10) - list_reagents = list("nutriment" = 5, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4, /datum/reagent/consumable/nothing = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("pie" = 1, "nothing" = 1) foodtype = GRAIN @@ -232,8 +232,8 @@ name = "berry tart" desc = "A tasty dessert of many different small barries on a thin pie crust." icon_state = "berrytart" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 3, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("pie" = 1, "berries" = 2) foodtype = GRAIN | FRUIT @@ -241,8 +241,8 @@ name = "chocolate lava tart" desc = "A tasty dessert made of chocaloate, with a liquid core." icon_state = "cocolavatart" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 4, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("pie" = 1, "grape" = 1) foodtype = GRAIN | SUGAR @@ -252,7 +252,7 @@ icon_state = "blumpkinpie" slice_path = /obj/item/reagent_containers/food/snacks/blumpkinpieslice slices_num = 5 - bonus_reagents = list("nutriment" = 3, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("pie" = 1, "a mouthful of pool water" = 1) foodtype = GRAIN | VEGETABLES @@ -263,7 +263,7 @@ icon_state = "blumpkinpieslice" trash = /obj/item/trash/plate filling_color = "#1E90FF" - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) tastes = list("pie" = 1, "a mouthful of pool water" = 1) foodtype = GRAIN | VEGETABLES @@ -273,7 +273,7 @@ icon_state = "dulcedebatata" slice_path = /obj/item/reagent_containers/food/snacks/dulcedebatataslice slices_num = 5 - bonus_reagents = list("nutriment" = 4, "vitamin" = 8) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 8) tastes = list("jelly" = 1, "sweet potato" = 1) foodtype = GRAIN | VEGETABLES | SUGAR @@ -284,7 +284,7 @@ icon_state = "dulcedebatataslice" trash = /obj/item/trash/plate filling_color = "#8B4513" - list_reagents = list("nutriment" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) tastes = list("jelly" = 1, "sweet potato" = 1) foodtype = GRAIN | VEGETABLES | SUGAR @@ -292,7 +292,7 @@ name = "frosty pie" desc = "Tastes like blue and cold." icon_state = "frostypie" - bonus_reagents = list("nutriment" = 4, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("mint" = 1, "pie" = 1) foodtype = GRAIN | FRUIT | SUGAR @@ -302,7 +302,7 @@ icon_state = "baklava" slice_path = /obj/item/reagent_containers/food/snacks/baklavaslice slices_num = 6 - bonus_reagents = list("nutriment" = 2, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("nuts" = 1, "pie" = 1) foodtype = GRAIN @@ -313,7 +313,7 @@ icon_state = "baklavaslice" trash = /obj/item/trash/plate filling_color = "#1E90FF" - list_reagents = list("nutriment" = 2, "vitamin" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("nuts" = 1, "pie" = 1) foodtype = GRAIN @@ -321,6 +321,6 @@ name = "strawberry pie" desc = "A strawberry.pie." icon_state = "strawberrypie" - bonus_reagents = list("nutriment" = 6, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("strawberry" = 1, "pie" = 1) foodtype = GRAIN | FRUIT | SUGAR diff --git a/code/modules/food_and_drinks/food/snacks_pizza.dm b/code/modules/food_and_drinks/food/snacks_pizza.dm index b75f8787..6aebe303 100644 --- a/code/modules/food_and_drinks/food/snacks_pizza.dm +++ b/code/modules/food_and_drinks/food/snacks_pizza.dm @@ -6,13 +6,13 @@ w_class = WEIGHT_CLASS_NORMAL slices_num = 6 volume = 80 - list_reagents = list("nutriment" = 30, "tomatojuice" = 6, "vitamin" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/consumable/tomatojuice = 6, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1) foodtype = GRAIN | DAIRY | VEGETABLES /obj/item/reagent_containers/food/snacks/pizzaslice icon = 'icons/obj/food/pizzaspaghetti.dmi' - list_reagents = list("nutriment" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) foodtype = GRAIN | DAIRY | VEGETABLES /obj/item/reagent_containers/food/snacks/pizza/margherita @@ -20,7 +20,7 @@ desc = "The most cheezy pizza in galaxy." icon_state = "pizzamargherita" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/margherita - bonus_reagents = list("nutriment" = 5, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1) foodtype = GRAIN | VEGETABLES @@ -41,8 +41,8 @@ desc = "Greasy pizza with delicious meat." icon_state = "meatpizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/meat - bonus_reagents = list("nutriment" = 5, "vitamin" = 8) - list_reagents = list("nutriment" = 30, "tomatojuice" = 6, "vitamin" = 8) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 8) + list_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/consumable/tomatojuice = 6, /datum/reagent/consumable/nutriment/vitamin = 8) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "meat" = 1) foodtype = GRAIN | VEGETABLES| DAIRY | MEAT @@ -59,8 +59,8 @@ desc = "Very special pizza." icon_state = "mushroompizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/mushroom - bonus_reagents = list("nutriment" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 30, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "mushroom" = 1) foodtype = GRAIN | VEGETABLES | DAIRY @@ -77,8 +77,8 @@ desc = "No one of Tomatos Sapiens were harmed during making this pizza." icon_state = "vegetablepizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/vegetable - bonus_reagents = list("nutriment" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 25, "tomatojuice" = 6, "oculine" = 12, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 25, /datum/reagent/consumable/tomatojuice = 6, /datum/reagent/medicine/oculine = 12, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("crust" = 1, "tomato" = 2, "cheese" = 1, "carrot" = 1) foodtype = GRAIN | VEGETABLES | DAIRY @@ -95,8 +95,8 @@ desc = "Who thought this would be a good idea?" icon_state = "donkpocketpizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/donkpocket - bonus_reagents = list("nutriment" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 25, "tomatojuice" = 6, "omnizine" = 10, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 25, /datum/reagent/consumable/tomatojuice = 6, /datum/reagent/medicine/omnizine = 10, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "meat" = 1, "laziness" = 1) foodtype = GRAIN | VEGETABLES | DAIRY | MEAT | JUNKFOOD @@ -113,8 +113,8 @@ desc = "The hippie's pizza of choice." icon_state = "dankpizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/dank - bonus_reagents = list("nutriment" = 2, "vitamin" = 6) - list_reagents = list("nutriment" = 25, "doctorsdelight" = 5, "tomatojuice" = 6, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 25, /datum/reagent/consumable/doctor_delight = 5, /datum/reagent/consumable/tomatojuice = 6, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "meat" = 1) foodtype = GRAIN | VEGETABLES | FRUIT | DAIRY @@ -131,7 +131,7 @@ desc = "You can really smell the sassiness." icon_state = "sassysagepizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/sassysage - bonus_reagents = list("nutriment" = 6, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "meat" = 1) foodtype = GRAIN | VEGETABLES | DAIRY @@ -148,7 +148,7 @@ desc = "The pizza equivalent of Einstein's riddle." icon_state = "pineapplepizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/pineapple - bonus_reagents = list("nutriment" = 6, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "pineapple" = 6, "ham" = 2) foodtype = PINEAPPLE //Over powering tast of gods fruit @@ -162,7 +162,7 @@ /obj/item/reagent_containers/food/snacks/pizza/pineapple/anomaly desc = "A anomaly made pizza with pineapple..." - bonus_reagents = list("nutriment" = 16, "vitamin" = 16) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 16, /datum/reagent/consumable/nutriment/vitamin = 16) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "pineapple" = 6, "ham" = 2, "good" = 10) /obj/item/reagent_containers/food/snacks/pizzaslice/pineapple/anomaly @@ -174,7 +174,7 @@ desc = "Hello, you've reached Arnold's pizza shop. I'm not here now, I'm out killing pepperoni." icon_state = "arnoldpizza" slice_path = /obj/item/reagent_containers/food/snacks/pizzaslice/arnold - bonus_reagents = list("nutriment" = 30, "vitamin" = 6, "iron" = 10, "omnizine" = 30) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 30, /datum/reagent/consumable/nutriment/vitamin = 6, /datum/reagent/iron = 10, /datum/reagent/medicine/omnizine = 30) tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "pepperoni" = 2, "9 millimeter bullets" = 2) /obj/item/reagent_containers/food/snacks/proc/try_break_off(mob/living/M, mob/living/user) //maybe i give you a pizza maybe i break off your arm diff --git a/code/modules/food_and_drinks/food/snacks_salad.dm b/code/modules/food_and_drinks/food/snacks_salad.dm index f5fcec0a..e2727332 100644 --- a/code/modules/food_and_drinks/food/snacks_salad.dm +++ b/code/modules/food_and_drinks/food/snacks_salad.dm @@ -5,7 +5,7 @@ trash = /obj/item/reagent_containers/glass/bowl bitesize = 3 w_class = WEIGHT_CLASS_NORMAL - list_reagents = list("nutriment" = 7, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("leaves" = 1) foodtype = VEGETABLES @@ -17,8 +17,8 @@ name = "\improper Aesir salad" desc = "Probably too incredible for mortal men to fully enjoy." icon_state = "aesirsalad" - bonus_reagents = list("omnizine" = 2, "vitamin" = 6) - list_reagents = list("nutriment" = 8, "omnizine" = 8, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/medicine/omnizine = 2, /datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/medicine/omnizine = 8, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("leaves" = 1) foodtype = VEGETABLES @@ -26,8 +26,8 @@ name = "herb salad" desc = "A tasty salad with apples on top." icon_state = "herbsalad" - bonus_reagents = list("vitamin" = 4) - list_reagents = list("nutriment" = 8, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("leaves" = 1, "apple" = 1) foodtype = VEGETABLES | FRUIT @@ -35,8 +35,8 @@ name = "valid salad" desc = "It's just an herb salad with meatballs and fried potato slices. Nothing suspicious about it." icon_state = "validsalad" - bonus_reagents = list("doctorsdelight" = 5, "vitamin" = 4) - list_reagents = list("nutriment" = 8, "doctorsdelight" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/doctor_delight = 5, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/doctor_delight = 5, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("leaves" = 1, "potato" = 1, "meat" = 1, "valids" = 1) foodtype = VEGETABLES | MEAT | FRIED | JUNKFOOD | FRUIT @@ -44,8 +44,8 @@ name = "oatmeal" desc = "A nice bowl of oatmeal." icon_state = "oatmeal" - bonus_reagents = list("nutriment" = 4, "vitamin" = 4) - list_reagents = list("nutriment" = 7, "milk" = 10, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/milk = 10, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("oats" = 1, "milk" = 1) foodtype = DAIRY | GRAIN | BREAKFAST @@ -53,7 +53,7 @@ name = "fruit salad" desc = "Your standard fruit salad." icon_state = "fruitsalad" - bonus_reagents = list("nutriment" = 2, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("fruit" = 1) foodtype = FRUIT | BREAKFAST @@ -61,8 +61,8 @@ name = "jungle salad" desc = "Exotic fruits in a bowl." icon_state = "junglesalad" - bonus_reagents = list("nutriment" = 4, "vitamin" = 4) - list_reagents = list("nutriment" = 7, "banana" = 5, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/banana = 5, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("fruit" = 1, "the jungle" = 1) foodtype = FRUIT | BREAKFAST @@ -70,8 +70,8 @@ name = "citrus delight" desc = "Citrus overload!" icon_state = "citrusdelight" - bonus_reagents = list("nutriment" = 4, "vitamin" = 4) - list_reagents = list("nutriment" = 7, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("sourness" = 1, "leaves" = 1) foodtype = FRUIT | BREAKFAST @@ -80,7 +80,7 @@ desc = "A bowl of raw rice." icon_state = "ricebowl" cooked_type = /obj/item/reagent_containers/food/snacks/salad/boiledrice - list_reagents = list("nutriment" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 4) tastes = list("rice" = 1) foodtype = GRAIN | RAW @@ -88,8 +88,8 @@ name = "boiled rice" desc = "A warm bowl of rice." icon_state = "boiledrice" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 5, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("rice" = 1) foodtype = GRAIN | BREAKFAST @@ -97,7 +97,7 @@ name = "rice pudding" desc = "Everybody loves rice pudding!" icon_state = "ricepudding" - bonus_reagents = list("nutriment" = 4, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("rice" = 1, "sweetness" = 1) foodtype = GRAIN | DAIRY @@ -105,7 +105,7 @@ name = "rice and pork" desc = "Well, it looks like pork..." icon_state = "riceporkbowl" - bonus_reagents = list("nutriment" = 4, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("rice" = 1, "meat" = 1) foodtype = GRAIN | MEAT @@ -113,6 +113,6 @@ name = "egg bowl" desc = "A bowl of rice with a fried egg." icon_state = "eggbowl" - bonus_reagents = list("nutriment" = 4, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("rice" = 1, "egg" = 1) foodtype = GRAIN | MEAT //EGG = MEAT -NinjaNomNom 2017 diff --git a/code/modules/food_and_drinks/food/snacks_sandwichtoast.dm b/code/modules/food_and_drinks/food/snacks_sandwichtoast.dm index 17a710ad..3cc4cfe6 100644 --- a/code/modules/food_and_drinks/food/snacks_sandwichtoast.dm +++ b/code/modules/food_and_drinks/food/snacks_sandwichtoast.dm @@ -4,8 +4,8 @@ icon = 'icons/obj/food/burgerbread.dmi' icon_state = "sandwich" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 6, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) cooked_type = /obj/item/reagent_containers/food/snacks/toastedsandwich tastes = list("meat" = 2, "cheese" = 1, "bread" = 2, "lettuce" = 1) foodtype = GRAIN | VEGETABLES @@ -16,8 +16,8 @@ icon = 'icons/obj/food/burgerbread.dmi' icon_state = "toastedsandwich" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "carbon" = 2) - list_reagents = list("nutriment" = 6, "carbon" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/carbon = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/carbon = 2) tastes = list("toast" = 1) foodtype = GRAIN @@ -27,8 +27,8 @@ icon = 'icons/obj/food/burgerbread.dmi' icon_state = "toastedsandwich" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 7, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("toast" = 1, "cheese" = 1) foodtype = GRAIN | DAIRY @@ -43,13 +43,13 @@ foodtype = GRAIN /obj/item/reagent_containers/food/snacks/jellysandwich/slime - bonus_reagents = list("slimejelly" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 2, "slimejelly" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN | TOXIC /obj/item/reagent_containers/food/snacks/jellysandwich/cherry - bonus_reagents = list("cherryjelly" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 2, "cherryjelly" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN | FRUIT /obj/item/reagent_containers/food/snacks/jellysandwich/pbj @@ -59,13 +59,13 @@ tastes = list("bread" = 1, "jelly" = 1, "peanuts" = 1) /obj/item/reagent_containers/food/snacks/jellysandwich/pbj/cherry - bonus_reagents = list("cherryjelly" = 5, "peanut_butter" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 2, "cherryjelly" = 5, "peanut_butter" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN | FRUIT /obj/item/reagent_containers/food/snacks/jellysandwich/pbj/slime - bonus_reagents = list("slimejelly" = 5, "peanut_butter" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 2, "slimejelly" = 5, "peanut_butter" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN | TOXIC /obj/item/reagent_containers/food/snacks/peanutbutter_sandwich @@ -75,8 +75,8 @@ icon_state = "peanutbuttersandwich" trash = /obj/item/trash/plate bitesize = 3 - bonus_reagents = list("peanut_butter" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 2, "peanut_butter" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN /obj/item/reagent_containers/food/snacks/notasandwich @@ -85,8 +85,8 @@ icon = 'icons/obj/food/burgerbread.dmi' icon_state = "notasandwich" trash = /obj/item/trash/plate - bonus_reagents = list("vitamin" = 6) - list_reagents = list("nutriment" = 6, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("nothing suspicious" = 1) foodtype = GRAIN | GROSS @@ -101,13 +101,13 @@ foodtype = GRAIN /obj/item/reagent_containers/food/snacks/jelliedtoast/cherry - bonus_reagents = list("cherryjelly" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 1, "cherryjelly" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/cherryjelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN | FRUIT | SUGAR /obj/item/reagent_containers/food/snacks/jelliedtoast/slime - bonus_reagents = list("slimejelly" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 1, "slimejelly" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GRAIN | TOXIC | SUGAR /obj/item/reagent_containers/food/snacks/peanut_buttertoast @@ -117,8 +117,8 @@ icon_state = "peanutbuttertoast" trash = /obj/item/trash/plate bitesize = 3 - bonus_reagents = list("peanut_butter" = 5, "vitamin" = 2) - list_reagents = list("nutriment" = 1, "peanut_butter" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/peanut_butter = 5, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("toast" = 1, "peanuts" = 1) foodtype = GRAIN @@ -128,8 +128,8 @@ desc = "This seems awfully bitter." icon = 'icons/obj/food/burgerbread.dmi' icon_state = "twobread" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 2, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("bread" = 2) foodtype = GRAIN @@ -139,6 +139,6 @@ icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "tunasandwich" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("tuna" = 4, "mayonnaise" = 2, "bread" = 2) foodtype = GRAIN | MEAT diff --git a/code/modules/food_and_drinks/food/snacks_soup.dm b/code/modules/food_and_drinks/food/snacks_soup.dm index 06cc5594..8a1b2c0a 100644 --- a/code/modules/food_and_drinks/food/snacks_soup.dm +++ b/code/modules/food_and_drinks/food/snacks_soup.dm @@ -4,7 +4,7 @@ trash = /obj/item/reagent_containers/glass/bowl bitesize = 5 volume = 80 - list_reagents = list("nutriment" = 8, "water" = 5, "vitamin" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/water = 5, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("tasteless soup" = 1) foodtype = VEGETABLES @@ -16,7 +16,7 @@ name = "wish soup" desc = "I wish this was soup." icon_state = "wishsoup" - list_reagents = list("water" = 10) + list_reagents = list(/datum/reagent/water = 10) tastes = list("wishes" = 1) /obj/item/reagent_containers/food/snacks/soup/wish/Initialize() @@ -24,17 +24,17 @@ var/wish_true = prob(25) if(wish_true) desc = "A wish come true!" - bonus_reagents = list("nutriment" = 9, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 9, /datum/reagent/consumable/nutriment/vitamin = 1) if(wish_true) - reagents.add_reagent("nutriment", 9) - reagents.add_reagent("vitamin", 1) + reagents.add_reagent(/datum/reagent/consumable/nutriment, 9) + reagents.add_reagent(/datum/reagent/consumable/nutriment/vitamin, 1) foodtype = VEGETABLES /obj/item/reagent_containers/food/snacks/soup/meatball name = "meatball soup" desc = "You've got balls kid, BALLS!" icon_state = "meatballsoup" - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("meat" = 1) foodtype = MEAT @@ -42,8 +42,8 @@ name = "slime soup" desc = "If no water is available, you may substitute tears." icon_state = "slimesoup" - bonus_reagents = list("nutriment" = 1, "slimejelly" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 5, "slimejelly" = 5, "water" = 5, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/toxin/slimejelly = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/toxin/slimejelly = 5, /datum/reagent/water = 5, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("slime" = 1) foodtype = TOXIC | SUGAR @@ -51,8 +51,8 @@ name = "tomato soup" desc = "Smells like copper." icon_state = "tomatosoup" - bonus_reagents = list("nutriment" = 1, "vitamin" = 6) - list_reagents = list("nutriment" = 2, "blood" = 10, "water" = 5, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/blood = 10, /datum/reagent/water = 5, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("iron" = 1) foodtype = GROSS @@ -61,8 +61,8 @@ desc = "A savory dish of alien wing wang in soy." icon_state = "wingfangchu" trash = /obj/item/reagent_containers/glass/bowl - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 6, "soysauce" = 5, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/soysauce = 5, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("soy" = 1) foodtype = MEAT @@ -70,8 +70,8 @@ name = "clown's tears" desc = "Not very funny." icon_state = "clownstears" - bonus_reagents = list("nutriment" = 1, "banana" = 5, "vitamin" = 8, "clownstears" = 10) - list_reagents = list("nutriment" = 4, "banana" = 5, "water" = 5, "vitamin" = 8, "clownstears" = 10) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/banana = 5, /datum/reagent/consumable/nutriment/vitamin = 8, /datum/reagent/consumable/clownstears = 10) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/banana = 5, /datum/reagent/water = 5, /datum/reagent/consumable/nutriment/vitamin = 8, /datum/reagent/consumable/clownstears = 10) tastes = list("a bad joke" = 1) foodtype = FRUIT | SUGAR @@ -79,7 +79,7 @@ name = "vegetable soup" desc = "A true vegan meal." icon_state = "vegetablesoup" - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("vegetables" = 1) foodtype = VEGETABLES @@ -87,7 +87,7 @@ name = "nettle soup" desc = "To think, the botanist would've beat you to death with one of these." icon_state = "nettlesoup" - bonus_reagents = list("nutriment" = 1, "omnizine" = 5, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/medicine/omnizine = 5, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("nettles" = 1) foodtype = VEGETABLES @@ -96,21 +96,23 @@ desc = "The mystery is, why aren't you eating it?" icon_state = "mysterysoup" var/extra_reagent = null - list_reagents = list("nutriment" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) tastes = list("chaos" = 1) /obj/item/reagent_containers/food/snacks/soup/mystery/Initialize() . = ..() - extra_reagent = pick("capsaicin", "frostoil", "omnizine", "banana", "blood", "slimejelly", "toxin", "banana", "carbon", "oculine") - bonus_reagents = list("[extra_reagent]" = 5, "nutriment" = 6) - reagents.add_reagent("[extra_reagent]", 5) + extra_reagent = pick(/datum/reagent/consumable/capsaicin, /datum/reagent/consumable/frostoil, + /datum/reagent/medicine/omnizine, /datum/reagent/consumable/banana, /datum/reagent/blood, + /datum/reagent/toxin/slimejelly, /datum/reagent/toxin, /datum/reagent/carbon, /datum/reagent/medicine/oculine) + bonus_reagents = list(extra_reagent = 5, /datum/reagent/consumable/nutriment = 6) + reagents.add_reagent(extra_reagent, 5) /obj/item/reagent_containers/food/snacks/soup/hotchili name = "hot chili" desc = "A five alarm Texan Chili!" icon_state = "hotchili" - bonus_reagents = list("nutriment" = 1, "tomatojuice" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 5, "capsaicin" = 1, "tomatojuice" = 2, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/tomatojuice = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/capsaicin = 1, /datum/reagent/consumable/tomatojuice = 2, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("hot peppers" = 1) foodtype = VEGETABLES @@ -118,8 +120,8 @@ name = "cold chili" desc = "This slush is barely a liquid!" icon_state = "coldchili" - bonus_reagents = list("nutriment" = 1, "tomatojuice" = 2, "vitamin" = 2) - list_reagents = list("nutriment" = 5, "frostoil" = 1, "tomatojuice" = 2, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/tomatojuice = 2, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/frostoil = 1, /datum/reagent/consumable/tomatojuice = 2, /datum/reagent/consumable/nutriment/vitamin = 2) tastes = list("tomato" = 1, "mint" = 1) foodtype = VEGETABLES @@ -127,8 +129,8 @@ name = "monkey's delight" desc = "A delicious soup with dumplings and hunks of monkey meat simmered to perfection, in a broth that tastes faintly of bananas." icon_state = "monkeysdelight" - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) - list_reagents = list("nutriment" = 10, "banana" = 5, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/banana = 5, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("the jungle" = 1, "banana" = 1) foodtype = FRUIT @@ -136,8 +138,8 @@ name = "tomato soup" desc = "Drinking this feels like being a vampire! A tomato vampire..." icon_state = "tomatosoup" - bonus_reagents = list("nutriment" = 1, "tomatojuice" = 10, "vitamin" = 3) - list_reagents = list("nutriment" = 5, "tomatojuice" = 10, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/tomatojuice = 10, /datum/reagent/consumable/nutriment/vitamin = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/tomatojuice = 10, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("tomato" = 1) foodtype = VEGETABLES @@ -145,7 +147,7 @@ name = "eyeball soup" desc = "It looks back at you..." icon_state = "eyeballsoup" - bonus_reagents = list("nutriment" = 1, "liquidgibs" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/liquidgibs = 3) tastes = list("tomato" = 1, "squirming" = 1) foodtype = MEAT | GROSS @@ -153,7 +155,7 @@ name = "milosoup" desc = "The universes best soup! Yum!!!" icon_state = "milosoup" - bonus_reagents = list("nutriment" = 1, "vitamin" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 3) tastes = list("milo" = 1) // wtf is milo foodtype = GROSS @@ -161,8 +163,8 @@ name = "chantrelle soup" desc = "A delicious and hearty mushroom soup." icon_state = "mushroomsoup" - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) - list_reagents = list("nutriment" = 8, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 4) tastes = list("mushroom" = 1) foodtype = VEGETABLES @@ -170,7 +172,7 @@ name = "beet soup" desc = "Wait, how do you spell it again..?" icon_state = "beetsoup" - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) foodtype = VEGETABLES /obj/item/reagent_containers/food/snacks/soup/beet/Initialize() @@ -184,8 +186,8 @@ desc = "Jello gelatin, from Alfred Hubbard's cookbook." icon_state = "spacylibertyduff" bitesize = 3 - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "mushroomhallucinogen" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/drug/mushroomhallucinogen = 6) tastes = list("jelly" = 1, "mushroom" = 1) foodtype = VEGETABLES @@ -194,8 +196,8 @@ desc = "Looks curiously toxic." icon_state = "amanitajelly" bitesize = 3 - bonus_reagents = list("nutriment" = 1, "vitamin" = 5) - list_reagents = list("nutriment" = 6, "mushroomhallucinogen" = 3, "amatoxin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/drug/mushroomhallucinogen = 3, /datum/reagent/toxin/amatoxin = 6) tastes = list("jelly" = 1, "mushroom" = 1) foodtype = VEGETABLES | TOXIC @@ -203,8 +205,8 @@ name = "stew" desc = "A nice and warm stew. Healthy and strong." icon_state = "stew" - bonus_reagents = list("nutriment" = 1, "tomatojuice" = 5, "vitamin" = 5) - list_reagents = list("nutriment" = 10, "oculine" = 5, "tomatojuice" = 5, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/tomatojuice = 5, /datum/reagent/consumable/nutriment/vitamin = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/medicine/oculine = 5, /datum/reagent/consumable/tomatojuice = 5, /datum/reagent/consumable/nutriment/vitamin = 5) bitesize = 7 volume = 100 tastes = list("tomato" = 1, "carrot" = 1) @@ -214,7 +216,7 @@ name = "sweet potato soup" desc = "Delicious sweet potato in soup form." icon_state = "sweetpotatosoup" - bonus_reagents = list("nutriment" = 4, "vitamin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 5) tastes = list("sweet potato" = 1) foodtype = VEGETABLES | SUGAR @@ -222,7 +224,7 @@ name = "red beet soup" desc = "Quite a delicacy." icon_state = "redbeetsoup" - bonus_reagents = list("nutriment" = 4, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("beet" = 1) foodtype = VEGETABLES @@ -238,8 +240,8 @@ name = "electron soup" desc = "A gastronomic curiosity of ethereal origin. It is famed for the minature weather system formed over a properly prepared soup." icon_state = "electronsoup" - list_reagents = list("nutriment" = 3, "liquidelectricity" = 5) - tastes = list("mushroom" = 1, "electrons" = 4, "shockingly good") + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/liquidelectricity = 5) + tastes = list("mushroom" = 1, "electrons" = 4, "shockingly good" = 1) filling_color = "#CC2B52" foodtype = VEGETABLES | TOXIC @@ -247,8 +249,8 @@ name = "bungo curry" desc = "A spicy vegetable curry made with the humble bungo fruit, Exotic!" icon_state = "bungocurry" - bonus_reagents = list("vitamin" = 11) - list_reagents = list("nutriment" = 6, "capsaicin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 11) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/capsaicin = 5) tastes = list("bungo" = 2, "hot curry" = 4, "tropical sweetness" = 1) filling_color = "#E6A625" foodtype = VEGETABLES | FRUIT | DAIRY diff --git a/code/modules/food_and_drinks/food/snacks_spaghetti.dm b/code/modules/food_and_drinks/food/snacks_spaghetti.dm index 70a19220..d54ba6f0 100644 --- a/code/modules/food_and_drinks/food/snacks_spaghetti.dm +++ b/code/modules/food_and_drinks/food/snacks_spaghetti.dm @@ -4,7 +4,7 @@ desc = "Now that's a nic'e pasta!" icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "spaghetti" - list_reagents = list("nutriment" = 1, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) cooked_type = /obj/item/reagent_containers/food/snacks/boiledspaghetti filling_color = "#F0E68C" tastes = list("pasta" = 1) @@ -16,8 +16,8 @@ icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "spaghettiboiled" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 2) - list_reagents = list("nutriment" = 2, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 1) custom_food_type = /obj/item/reagent_containers/food/snacks/customizable/pasta filling_color = "#F0E68C" tastes = list("pasta" = 1) @@ -30,8 +30,8 @@ icon_state = "pastatomato" trash = /obj/item/trash/plate bitesize = 4 - bonus_reagents = list("nutriment" = 1, "tomatojuice" = 10, "vitamin" = 4) - list_reagents = list("nutriment" = 6, "tomatojuice" = 10, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/tomatojuice = 10, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/tomatojuice = 10, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#DC143C" tastes = list("pasta" = 1, "tomato" = 1) foodtype = GRAIN | VEGETABLES @@ -43,8 +43,8 @@ icon_state = "copypasta" trash = /obj/item/trash/plate bitesize = 4 - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 12, "tomatojuice" = 20, "vitamin" = 8) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 12, /datum/reagent/consumable/tomatojuice = 20, /datum/reagent/consumable/nutriment/vitamin = 8) filling_color = "#DC143C" tastes = list("pasta" = 1, "tomato" = 1) foodtype = GRAIN | VEGETABLES @@ -55,8 +55,8 @@ icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "meatballspaghetti" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 4) - list_reagents = list("nutriment" = 8, "vitamin" = 4) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 4) filling_color = "#F0E68C" tastes = list("pasta" = 1, "tomato" = 1, "meat" = 1) foodtype = GRAIN | MEAT @@ -67,8 +67,8 @@ icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "spesslaw" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 1, "vitamin" = 6) - list_reagents = list("nutriment" = 8, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 6) filling_color = "#F0E68C" tastes = list("pasta" = 1, "tomato" = 1, "meat" = 1) foodtype = GRAIN @@ -79,8 +79,8 @@ icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "chowmein" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 3, "vitamin" = 4) - list_reagents = list("nutriment" = 7, "vitamin" = 6) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 7, /datum/reagent/consumable/nutriment/vitamin = 6) tastes = list("noodle" = 1, "tomato" = 1) foodtype = GRAIN @@ -90,7 +90,7 @@ icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "beefnoodle" trash = /obj/item/reagent_containers/glass/bowl - bonus_reagents = list("nutriment" = 5, "vitamin" = 6, "liquidgibs" = 3) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 6, /datum/reagent/liquidgibs = 3) tastes = list("noodle" = 1, "meat" = 1) foodtype = GRAIN | MEAT @@ -100,6 +100,6 @@ icon = 'icons/obj/food/pizzaspaghetti.dmi' icon_state = "butternoodles" trash = /obj/item/trash/plate - bonus_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) tastes = list("noodle" = 1, "butter" = 1) foodtype = GRAIN | DAIRY diff --git a/code/modules/food_and_drinks/food/snacks_sushi.dm b/code/modules/food_and_drinks/food/snacks_sushi.dm index a4cbc5e3..d16ca790 100644 --- a/code/modules/food_and_drinks/food/snacks_sushi.dm +++ b/code/modules/food_and_drinks/food/snacks_sushi.dm @@ -5,7 +5,7 @@ desc = "A bowl of sticky rice for making sushi." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushi_rice" - list_reagents = list("sodiumchloride" = 5) + list_reagents = list(/datum/reagent/consumable/sodiumchloride = 5) tastes = list("rice" = 5, "salt" = 1) foodtype = GRAIN @@ -14,7 +14,7 @@ desc = "A thin, light salt sheet of plant mater. This is commenly used in sushi recipes," icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sea_weed" - list_reagents = list("sodiumchloride" = 2) + list_reagents = list(/datum/reagent/consumable/sodiumchloride = 2) tastes = list("plants" = 2, "salt" = 1) foodtype = VEGETABLES @@ -24,7 +24,7 @@ icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "tuna_can" //trash = /obj/item/trash/tuna_used //I dont know if I like this idea - A Masked Cat - list_reagents = list("sodiumchloride" = 5, "mercury" = 2) + list_reagents = list(/datum/reagent/consumable/sodiumchloride = 5, /datum/reagent/mercury = 2) tastes = list("tuna" = 15, "mercury" = 1, "salt" = 3) foodtype = MEAT @@ -34,8 +34,8 @@ desc = "A small cylindrical filled with rice and fish." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_basic" - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 1) bitesize = 1 filling_color = "#F2EEEA" //rgb(242, 238, 234) tastes = list("fish" = 1, "rice" = 1, "salt" = 1) @@ -46,8 +46,8 @@ desc = "A pice of carp lightly placed on some rice." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_adv" - bonus_reagents = list("vitamin" = 2) - list_reagents = list("nutriment" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 2) bitesize = 1 filling_color = "#F2EEEA" //rgb(242, 238, 234) tastes = list("fish" = 1, "rice" = 1, "salt" = 1) @@ -58,8 +58,8 @@ desc = "A well prepared pice of the best of the carp fillet placed on rice. Looks fancy and fresh!" icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_pro" - bonus_reagents = list("nutriment" = 1, "vitamin" = 2) - list_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) bitesize = 1 filling_color = "#F2EEEA" //rgb(242, 238, 234) tastes = list("fish" = 1, "rice" = 1, "salt" = 1) @@ -70,7 +70,7 @@ desc = "Spider eggs wrapped in a thin salted Kudzu pod" icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "sushie_egg" - list_reagents = list("nutriment" = 3, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#FF3333" // R225 G051 B051 tastes = list("seaweed" = 1, "salty" = 2) foodtype = MEAT | VEGETABLES @@ -80,7 +80,7 @@ desc = "A ball of rice with some light salt and a wrap of Kudzu skin." icon = 'modular_citadel/icons/obj/food/food.dmi' icon_state = "riceball" - list_reagents = list("nutriment" = 5, "sodiumchloride" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/sodiumchloride = 2) tastes = list("rice" = 4, "salt" = 1) foodtype = GRAIN @@ -88,8 +88,8 @@ name = "carp sashimi" desc = "Celebrate surviving attack from hostile alien lifeforms by hospitalising yourself." icon_state = "sashimi" - bonus_reagents = list("nutriment" = 1, "capsaicin" = 4, "vitamin" = 4) - list_reagents = list("nutriment" = 6, "capsaicin" = 5) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/capsaicin = 4, /datum/reagent/consumable/nutriment/vitamin = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/capsaicin = 5) filling_color = "#FA8072" tastes = list("fish" = 1, "hot peppers" = 1) foodtype = MEAT | TOXIC \ No newline at end of file diff --git a/code/modules/food_and_drinks/food/snacks_vend.dm b/code/modules/food_and_drinks/food/snacks_vend.dm index 2800d6c4..40daa8c8 100644 --- a/code/modules/food_and_drinks/food/snacks_vend.dm +++ b/code/modules/food_and_drinks/food/snacks_vend.dm @@ -7,7 +7,7 @@ desc = "Nougat love it or hate it." icon_state = "candy" trash = /obj/item/trash/candy - list_reagents = list("nutriment" = 1, "sugar" = 3, "cocoa" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 3, /datum/reagent/consumable/coco = 3) junkiness = 25 filling_color = "#D2691E" tastes = list("candy" = 1) @@ -18,7 +18,7 @@ icon_state = "sosjerky" desc = "Beef jerky made from the finest space cows." trash = /obj/item/trash/sosjerky - list_reagents = list("nutriment" = 1, "sugar" = 3, "sodiumchloride" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 3, /datum/reagent/consumable/sodiumchloride = 2) junkiness = 25 filling_color = "#8B0000" tastes = list("dried meat" = 1) @@ -27,7 +27,7 @@ /obj/item/reagent_containers/food/snacks/sosjerky/healthy name = "homemade beef jerky" desc = "Homemade beef jerky made from the finest space cows." - list_reagents = list("nutriment" = 3, "vitamin" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) junkiness = 0 /obj/item/reagent_containers/food/snacks/chips @@ -36,7 +36,7 @@ icon_state = "chips" trash = /obj/item/trash/chips bitesize = 1 - list_reagents = list("nutriment" = 1, "sugar" = 3, "sodiumchloride" = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 3, /datum/reagent/consumable/sodiumchloride = 1) junkiness = 20 filling_color = "#FFD700" tastes = list("salt" = 1, "crisps" = 1) @@ -47,7 +47,7 @@ icon_state = "4no_raisins" desc = "Best raisins in the universe. Not sure why." trash = /obj/item/trash/raisins - list_reagents = list("nutriment" = 2, "sugar" = 4) + list_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/sugar = 4) junkiness = 25 filling_color = "#8B0000" tastes = list("dried raisins" = 1) @@ -56,7 +56,7 @@ /obj/item/reagent_containers/food/snacks/no_raisin/healthy name = "homemade raisins" desc = "Homemade raisins, the best in all of spess." - list_reagents = list("nutriment" = 3, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2) junkiness = 0 foodtype = FRUIT @@ -64,7 +64,7 @@ name = "space twinkie" icon_state = "space_twinkie" desc = "Guaranteed to survive longer than you will." - list_reagents = list("sugar" = 4) + list_reagents = list(/datum/reagent/consumable/sugar = 4) junkiness = 25 filling_color = "#FFD700" foodtype = JUNKFOOD | GRAIN | SUGAR @@ -74,7 +74,7 @@ desc = "Bite sized cheesie snacks that will honk all over your mouth." icon_state = "cheesie_honkers" trash = /obj/item/trash/cheesie - list_reagents = list("nutriment" = 1, "sugar" = 3) + list_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/sugar = 3) junkiness = 25 filling_color = "#FFD700" tastes = list("cheese" = 5, "crisps" = 2) @@ -96,7 +96,7 @@ icon_state = "syndi_cakes" desc = "An extremely moist snack cake that tastes just as good after being nuked." trash = /obj/item/trash/syndi_cakes - list_reagents = list("nutriment" = 4, "doctorsdelight" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/doctor_delight = 5) filling_color = "#F5F5DC" tastes = list("sweetness" = 3, "cake" = 1) foodtype = GRAIN | FRUIT | VEGETABLES diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index ff803b5f..27ee5481 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -52,7 +52,7 @@ God bless America. /obj/machinery/deepfryer/Initialize() . = ..() create_reagents(50, OPENCONTAINER) - reagents.add_reagent("cooking_oil", 25) + reagents.add_reagent(/datum/reagent/consumable/cooking_oil, 25) component_parts = list() component_parts += new /obj/item/circuitboard/machine/deep_fryer(null) component_parts += new /obj/item/stock_parts/micro_laser(null) @@ -83,7 +83,7 @@ God bless America. if(istype(I,/obj/item/clothing/head/mob_holder)) to_chat(user, "This does not fit in the fryer.") // TODO: Deepfrying instakills mobs, spawns a whole deep-fried mob. return - if(!reagents.has_reagent("cooking_oil")) + if(!reagents.has_reagent(/datum/reagent/consumable/cooking_oil)) to_chat(user, "[src] has no cooking oil to fry with!") return if(I.resistance_flags & INDESTRUCTIBLE) @@ -107,7 +107,7 @@ God bless America. /obj/machinery/deepfryer/process() ..() - var/datum/reagent/consumable/cooking_oil/C = reagents.has_reagent("cooking_oil") + var/datum/reagent/consumable/cooking_oil/C = reagents.has_reagent(/datum/reagent/consumable/cooking_oil) if(!C) return reagents.chem_temp = C.fry_temperature diff --git a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm index 4dda9dd7..68cc84c6 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/food_cart.dm @@ -35,16 +35,16 @@ dat += "Portion: [portion]
    " for(var/datum/reagent/R in reagents.reagent_list) dat += "[R.name]: [R.volume] " - dat += "Purge" + dat += "Purge" if (glasses > 0) - dat += "Pour in a glass" - dat += "Add to the mixer
    " + dat += "Pour in a glass" + dat += "Add to the mixer
    " dat += "
    MIXER CONTENTS
    " for(var/datum/reagent/R in mixer.reagents.reagent_list) dat += "[R.name]: [R.volume] " - dat += "Transfer back" + dat += "Transfer back" if (glasses > 0) - dat += "Pour in a glass" + dat += "Pour in a glass" dat += "
    " dat += "

    STORED FOOD
    " for(var/V in stored_food) diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index e02c3c13..e5c5a4f9 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -176,7 +176,7 @@ newmeat.name = "[sourcename] [newmeat.name]" if(istype(newmeat)) newmeat.subjectname = sourcename - newmeat.reagents.add_reagent ("nutriment", sourcenutriment / meat_produced) // Thehehe. Fat guys go first + newmeat.reagents.add_reagent (/datum/reagent/consumable/nutriment, sourcenutriment / meat_produced) // Thehehe. Fat guys go first if(sourcejob) newmeat.subjectjob = sourcejob allmeat[i] = newmeat diff --git a/code/modules/food_and_drinks/kitchen_machinery/grill.dm b/code/modules/food_and_drinks/kitchen_machinery/grill.dm index 449da2af..c52389cd 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/grill.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/grill.dm @@ -52,10 +52,10 @@ grill_loop.start() return else - if(I.reagents.has_reagent("monkey_energy")) - grill_fuel += (20 * (I.reagents.get_reagent_amount("monkey_energy"))) + if(I.reagents.has_reagent(/datum/reagent/consumable/monkey_energy)) + grill_fuel += (20 * (I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy))) to_chat(user, "You pour the Monkey Energy in [src].") - I.reagents.remove_reagent("monkey_energy", I.reagents.get_reagent_amount("monkey_energy")) + I.reagents.remove_reagent("monkey_energy", I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy)) update_icon() return ..() diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm index 8670b16b..82e6c00b 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm @@ -23,37 +23,37 @@ var/flavour_name = "vanilla" var/obj/item/reagent_containers/beaker = null var/static/list/icecream_vat_reagents = list( - "milk" = 6, - "flour" = 6, - "sugar" = 6, - "ice" = 6, - "cocoa" = 6, - "vanilla" = 6, - "berryjuice" = 6, - "singulo" = 6, - "peachjuice" = 6, - "grapejuice" = 6) + /datum/reagent/consumable/milk = 6, + /datum/reagent/consumable/flour = 6, + /datum/reagent/consumable/sugar = 6, + /datum/reagent/consumable/ice = 6, + /datum/reagent/consumable/coco = 6, + /datum/reagent/consumable/vanilla = 6, + /datum/reagent/consumable/berryjuice = 6, + /datum/reagent/consumable/ethanol/singulo = 6, + /datum/reagent/consumable/peachjuice = 6, + /datum/reagent/consumable/grapejuice = 6) /obj/machinery/icecream_vat/proc/get_ingredient_list(type) switch(type) if(ICECREAM_CHOCOLATE) - return list("milk", "ice", "cocoa") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/coco) if(ICECREAM_STRAWBERRY) - return list("milk", "ice", "berryjuice") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/berryjuice) if(ICECREAM_CUSTOM) - return list("milk", "ice") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice) if(ICECREAM_PEACH) - return list("milk", "ice", "peachjuice") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/peachjuice) if(ICECREAM_GRAPE) - return list("milk", "ice", "grapejuice") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/grapejuice) if(ICECREAM_BLUE) - return list("milk", "ice", "singulo") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/ethanol/singulo) if(CONE_WAFFLE) - return list("flour", "sugar") + return list(/datum/reagent/consumable/flour, /datum/reagent/consumable/sugar) if(CONE_CHOC) - return list("flour", "sugar", "cocoa") + return list(/datum/reagent/consumable/flour, /datum/reagent/consumable/sugar, /datum/reagent/consumable/coco) else //ICECREAM_VANILLA - return list("milk", "ice", "vanilla") + return list(/datum/reagent/consumable/milk, /datum/reagent/consumable/ice, /datum/reagent/consumable/vanilla) /obj/machinery/icecream_vat/proc/get_flavour_name(flavour_type) @@ -107,7 +107,7 @@ dat += "VAT CONTENT
    " for(var/datum/reagent/R in reagents.reagent_list) dat += "[R.name]: [R.volume]" - dat += "Purge
    " + dat += "Purge
    " dat += "Refresh Close" var/datum/browser/popup = new(user, "icecreamvat","Icecream Vat", 700, 500, src) @@ -127,7 +127,7 @@ I.add_ice_cream(flavour_name) I.add_ice_cream(flavour_name) if(I.reagents.total_volume < 10) - I.reagents.add_reagent("sugar", 10 - I.reagents.total_volume) + I.reagents.add_reagent(/datum/reagent/consumable/sugar, 10 - I.reagents.total_volume) updateDialog() else to_chat(user, "There is not enough ice cream left!") @@ -239,9 +239,9 @@ icon_state = "icecream_cone_[cone_name]" switch (cone_type) if ("waffle") - reagents.add_reagent("nutriment", 1) + reagents.add_reagent(/datum/reagent/consumable/nutriment, 1) if ("chocolate") - reagents.add_reagent("cocoa", 1) // chocolate ain't as nutritious kids + reagents.add_reagent(/datum/reagent/consumable/coco, 1) // chocolate ain't as nutritious kids desc = "Delicious [cone_name] cone, but no ice cream." @@ -251,31 +251,31 @@ switch (flavour_name) // adding the actual reagents advertised in the ingredient list if ("vanilla") desc = "A delicious [cone_type] cone filled with vanilla ice cream. All the other ice creams take content from it." - reagents.add_reagent("vanilla", 3) + reagents.add_reagent(/datum/reagent/consumable/vanilla, 3) filling_color = "#ECE1C1" if ("chocolate") desc = "A delicious [cone_type] cone filled with chocolate ice cream. Surprisingly, made with real cocoa." - reagents.add_reagent("cocoa", 3) + reagents.add_reagent(/datum/reagent/consumable/coco, 3) filling_color = "#93673B" if ("strawberry") desc = "A delicious [cone_type] cone filled with strawberry ice cream. Definitely not made with real strawberries." - reagents.add_reagent("berryjuice", 3) + reagents.add_reagent(/datum/reagent/consumable/berryjuice, 3) filling_color = "#EFB4B4" if ("peach") desc = "A delicious [cone_type] cone filled with peach ice cream. Definitely made with real peaches!" - reagents.add_reagent("peachjuice", 3) + reagents.add_reagent(/datum/reagent/consumable/peachjuice, 3) filling_color = "#E78108" if ("grape") desc = "A delicious [cone_type] cone filled with grape ice cream. Surprisingly, made with real pink grape, likely not real sugarcanes used." - reagents.add_reagent("grapejuice", 3) + reagents.add_reagent(/datum/reagent/consumable/grapejuice, 3) filling_color = "#FF1493" if ("blue") desc = "A delicious [cone_type] cone filled with blue ice cream. Made with real... blue?" - reagents.add_reagent("singulo", 3) + reagents.add_reagent(/datum/reagent/consumable/ethanol/singulo, 3) filling_color = "#ACBCED" if ("mob") desc = "A suspicious [cone_type] cone filled with bright red ice cream. That's probably not strawberry..." - reagents.add_reagent("liquidgibs", 3) + reagents.add_reagent(/datum/reagent/liquidgibs, 3) filling_color = "#EFB4B4" if ("custom") if(R && R.total_volume >= 4) //consumable reagents have stronger taste so higher volume will allow non-food flavourings to break through better. diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index e67de927..6118e262 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -134,8 +134,8 @@ if(istype(O, /obj/item/reagent_containers/spray)) var/obj/item/reagent_containers/spray/clean_spray = O - if(clean_spray.reagents.has_reagent("cleaner", clean_spray.amount_per_transfer_from_this)) - clean_spray.reagents.remove_reagent("cleaner", clean_spray.amount_per_transfer_from_this,1) + if(clean_spray.reagents.has_reagent(/datum/reagent/space_cleaner, clean_spray.amount_per_transfer_from_this)) + clean_spray.reagents.remove_reagent(/datum/reagent/space_cleaner, clean_spray.amount_per_transfer_from_this,1) playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) user.visible_message("[user] has cleaned \the [src].", "You clean \the [src].") dirty = 0 diff --git a/code/modules/food_and_drinks/recipes/drinks_recipes.dm b/code/modules/food_and_drinks/recipes/drinks_recipes.dm index b3a1ebac..a379cdd3 100644 --- a/code/modules/food_and_drinks/recipes/drinks_recipes.dm +++ b/code/modules/food_and_drinks/recipes/drinks_recipes.dm @@ -2,303 +2,303 @@ /datum/chemical_reaction/goldschlager name = "Goldschlager" - id = "goldschlager" - results = list("goldschlager" = 10) - required_reagents = list("vodka" = 10, "gold" = 1) + id = /datum/reagent/consumable/ethanol/goldschlager + results = list(/datum/reagent/consumable/ethanol/goldschlager = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 10, /datum/reagent/gold = 1) /datum/chemical_reaction/patron name = "Patron" - id = "patron" - results = list("patron" = 10) - required_reagents = list("tequila" = 10, "silver" = 1) + id = /datum/reagent/consumable/ethanol/patron + results = list(/datum/reagent/consumable/ethanol/patron = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/tequila = 10, /datum/reagent/silver = 1) /datum/chemical_reaction/bilk name = "Bilk" - id = "bilk" - results = list("bilk" = 2) - required_reagents = list("milk" = 1, "beer" = 1) + id = /datum/reagent/consumable/ethanol/bilk + results = list(/datum/reagent/consumable/ethanol/bilk = 2) + required_reagents = list(/datum/reagent/consumable/milk = 1, /datum/reagent/consumable/ethanol/beer = 1) /datum/chemical_reaction/icetea name = "Iced Tea" - id = "icetea" - results = list("icetea" = 4) - required_reagents = list("ice" = 1, "tea" = 3) + id = /datum/reagent/consumable/icetea + results = list(/datum/reagent/consumable/icetea = 4) + required_reagents = list(/datum/reagent/consumable/ice = 1, /datum/reagent/consumable/tea = 3) /datum/chemical_reaction/icecoffee name = "Iced Coffee" - id = "icecoffee" - results = list("icecoffee" = 4) - required_reagents = list("ice" = 1, "coffee" = 3) + id = /datum/reagent/consumable/icecoffee + results = list(/datum/reagent/consumable/icecoffee = 4) + required_reagents = list(/datum/reagent/consumable/ice = 1, /datum/reagent/consumable/coffee = 3) /datum/chemical_reaction/nuka_cola name = "Nuka Cola" - id = "nuka_cola" - results = list("nuka_cola" = 6) - required_reagents = list("uranium" = 1, "cola" = 6) + id = /datum/reagent/consumable/nuka_cola + results = list(/datum/reagent/consumable/nuka_cola = 6) + required_reagents = list(/datum/reagent/uranium = 1, /datum/reagent/consumable/space_cola = 6) /datum/chemical_reaction/moonshine name = "Moonshine" - id = "moonshine" - results = list("moonshine" = 10) - required_reagents = list("nutriment" = 5, "sugar" = 5) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/moonshine + results = list(/datum/reagent/consumable/ethanol/moonshine = 10) + required_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/sugar = 5) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/wine name = "Wine" - id = "wine" - results = list("wine" = 10) - required_reagents = list("grapejuice" = 10) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/wine + results = list(/datum/reagent/consumable/ethanol/wine = 10) + required_reagents = list(/datum/reagent/consumable/grapejuice = 10) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/spacebeer name = "Space Beer" - id = "spacebeer" - results = list("beer" = 10) - required_reagents = list("flour" = 10) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/beer + results = list(/datum/reagent/consumable/ethanol/beer = 10) + required_reagents = list(/datum/reagent/consumable/flour = 10) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/vodka name = "Vodka" - id = "vodka" - results = list("vodka" = 10) - required_reagents = list("potato" = 10) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/vodka + results = list(/datum/reagent/consumable/ethanol/vodka = 10) + required_reagents = list(/datum/reagent/consumable/potato_juice = 10) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/kahlua name = "Kahlua" - id = "kahlua" - results = list("kahlua" = 5) - required_reagents = list("coffee" = 5, "sugar" = 5) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/kahlua + results = list(/datum/reagent/consumable/ethanol/kahlua = 5) + required_reagents = list(/datum/reagent/consumable/coffee = 5, /datum/reagent/consumable/sugar = 5) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/gin_tonic name = "Gin and Tonic" - id = "gintonic" - results = list("gintonic" = 3) - required_reagents = list("gin" = 2, "tonic" = 1) + id = /datum/reagent/consumable/ethanol/gintonic + results = list(/datum/reagent/consumable/ethanol/gintonic = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/gin = 2, /datum/reagent/consumable/tonic = 1) /datum/chemical_reaction/rum_coke name = "Rum and Coke" - id = "rumcoke" - results = list("rumcoke" = 3) - required_reagents = list("rum" = 2, "cola" = 1) + id = /datum/reagent/consumable/ethanol/rum_coke + results = list(/datum/reagent/consumable/ethanol/rum_coke = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 2, /datum/reagent/consumable/space_cola = 1) /datum/chemical_reaction/cuba_libre name = "Cuba Libre" - id = "cubalibre" - results = list("cubalibre" = 4) - required_reagents = list("rumcoke" = 3, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/cuba_libre + results = list(/datum/reagent/consumable/ethanol/cuba_libre = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/rum_coke = 3, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/martini name = "Classic Martini" - id = "martini" - results = list("martini" = 3) - required_reagents = list("gin" = 2, "vermouth" = 1) + id = /datum/reagent/consumable/ethanol/martini + results = list(/datum/reagent/consumable/ethanol/martini = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/gin = 2, /datum/reagent/consumable/ethanol/vermouth = 1) /datum/chemical_reaction/vodkamartini name = "Vodka Martini" - id = "vodkamartini" - results = list("vodkamartini" = 3) - required_reagents = list("vodka" = 2, "vermouth" = 1) + id = /datum/reagent/consumable/ethanol/vodkamartini + results = list(/datum/reagent/consumable/ethanol/vodkamartini = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 2, /datum/reagent/consumable/ethanol/vermouth = 1) /datum/chemical_reaction/white_russian name = "White Russian" - id = "whiterussian" - results = list("whiterussian" = 5) - required_reagents = list("blackrussian" = 3, "cream" = 2) + id = /datum/reagent/consumable/ethanol/white_russian + results = list(/datum/reagent/consumable/ethanol/white_russian = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/black_russian = 3, /datum/reagent/consumable/cream = 2) /datum/chemical_reaction/whiskey_cola name = "Whiskey Cola" - id = "whiskeycola" - results = list("whiskeycola" = 3) - required_reagents = list("whiskey" = 2, "cola" = 1) + id = /datum/reagent/consumable/ethanol/whiskey_cola + results = list(/datum/reagent/consumable/ethanol/whiskey_cola = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 2, /datum/reagent/consumable/space_cola = 1) /datum/chemical_reaction/screwdriver name = "Screwdriver" - id = "screwdrivercocktail" - results = list("screwdrivercocktail" = 3) - required_reagents = list("vodka" = 2, "orangejuice" = 1) + id = /datum/reagent/consumable/ethanol/screwdrivercocktail + results = list(/datum/reagent/consumable/ethanol/screwdrivercocktail = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 2, /datum/reagent/consumable/orangejuice = 1) /datum/chemical_reaction/bloody_mary name = "Bloody Mary" - id = "bloodymary" - results = list("bloodymary" = 4) - required_reagents = list("vodka" = 1, "tomatojuice" = 2, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/bloody_mary + results = list(/datum/reagent/consumable/ethanol/bloody_mary = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/tomatojuice = 2, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/gargle_blaster name = "Pan-Galactic Gargle Blaster" - id = "gargleblaster" - results = list("gargleblaster" = 5) - required_reagents = list("vodka" = 1, "gin" = 1, "whiskey" = 1, "cognac" = 1, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/gargle_blaster + results = list(/datum/reagent/consumable/ethanol/gargle_blaster = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/ethanol/gin = 1, /datum/reagent/consumable/ethanol/whiskey = 1, /datum/reagent/consumable/ethanol/cognac = 1, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/brave_bull name = "Brave Bull" - id = "bravebull" - results = list("bravebull" = 3) - required_reagents = list("tequila" = 2, "kahlua" = 1) + id = /datum/reagent/consumable/ethanol/brave_bull + results = list(/datum/reagent/consumable/ethanol/brave_bull = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/tequila = 2, /datum/reagent/consumable/ethanol/kahlua = 1) /datum/chemical_reaction/tequila_sunrise name = "Tequila Sunrise" - id = "tequilasunrise" - results = list("tequilasunrise" = 5) - required_reagents = list("tequila" = 2, "orangejuice" = 2, "grenadine" = 1) + id = /datum/reagent/consumable/ethanol/tequila_sunrise + results = list(/datum/reagent/consumable/ethanol/tequila_sunrise = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/tequila = 2, /datum/reagent/consumable/orangejuice = 2, /datum/reagent/consumable/grenadine = 1) /datum/chemical_reaction/toxins_special name = "Toxins Special" - id = "toxinsspecial" - results = list("toxinsspecial" = 5) - required_reagents = list("rum" = 2, "vermouth" = 1, "plasma" = 2) + id = /datum/reagent/consumable/ethanol/toxins_special + results = list(/datum/reagent/consumable/ethanol/toxins_special = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 2, /datum/reagent/consumable/ethanol/vermouth = 1, /datum/reagent/toxin/plasma = 2) /datum/chemical_reaction/beepsky_smash name = "Beepksy Smash" - id = "beepksysmash" - results = list("beepskysmash" = 5) - required_reagents = list("limejuice" = 2, "quadruple_sec" = 2, "iron" = 1) + id = /datum/reagent/consumable/ethanol/beepsky_smash + results = list(/datum/reagent/consumable/ethanol/beepsky_smash = 5) + required_reagents = list(/datum/reagent/consumable/limejuice = 2, /datum/reagent/consumable/ethanol/quadruple_sec = 2, /datum/reagent/iron = 1) /datum/chemical_reaction/doctor_delight name = "The Doctor's Delight" - id = "doctordelight" - results = list("doctorsdelight" = 5) - required_reagents = list("limejuice" = 1, "tomatojuice" = 1, "orangejuice" = 1, "cream" = 1, "cryoxadone" = 1) + id = /datum/reagent/consumable/doctor_delight + results = list(/datum/reagent/consumable/doctor_delight = 5) + required_reagents = list(/datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/tomatojuice = 1, /datum/reagent/consumable/orangejuice = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/medicine/cryoxadone = 1) /datum/chemical_reaction/irish_cream name = "Irish Cream" - id = "irishcream" - results = list("irishcream" = 3) - required_reagents = list("whiskey" = 2, "cream" = 1) + id = /datum/reagent/consumable/ethanol/irish_cream + results = list(/datum/reagent/consumable/ethanol/irish_cream = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 2, /datum/reagent/consumable/cream = 1) /datum/chemical_reaction/manly_dorf name = "The Manly Dorf" - id = "manlydorf" - results = list("manlydorf" = 3) - required_reagents = list ("beer" = 1, "ale" = 2) + id = /datum/reagent/consumable/ethanol/manly_dorf + results = list(/datum/reagent/consumable/ethanol/manly_dorf = 3) + required_reagents = list (/datum/reagent/consumable/ethanol/beer = 1, /datum/reagent/consumable/ethanol/ale = 2) /datum/chemical_reaction/greenbeer name = "Green Beer" - id = "greenbeer" - results = list("greenbeer" = 10) - required_reagents = list("greencrayonpowder" = 1, "beer" = 10) + id = /datum/reagent/consumable/ethanol/beer/green + results = list(/datum/reagent/consumable/ethanol/beer/green = 10) + required_reagents = list(/datum/reagent/colorful_reagent/crayonpowder/green = 1, /datum/reagent/consumable/ethanol/beer = 10) /datum/chemical_reaction/hooch name = "Hooch" - id = "hooch" - results = list("hooch" = 3) - required_reagents = list ("ethanol" = 2, "welding_fuel" = 1) - required_catalysts = list("enzyme" = 1) + id = /datum/reagent/consumable/ethanol/hooch + results = list(/datum/reagent/consumable/ethanol/hooch = 3) + required_reagents = list (/datum/reagent/consumable/ethanol = 2, /datum/reagent/fuel = 1) + required_catalysts = list(/datum/reagent/consumable/enzyme = 1) /datum/chemical_reaction/irish_coffee name = "Irish Coffee" - id = "irishcoffee" - results = list("irishcoffee" = 2) - required_reagents = list("irishcream" = 1, "coffee" = 1) + id = /datum/reagent/consumable/ethanol/irishcoffee + results = list(/datum/reagent/consumable/ethanol/irishcoffee = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/irish_cream = 1, /datum/reagent/consumable/coffee = 1) /datum/chemical_reaction/b52 name = "B-52" - id = "b52" - results = list("b52" = 3) - required_reagents = list("irishcream" = 1, "kahlua" = 1, "cognac" = 1) + id = /datum/reagent/consumable/ethanol/b52 + results = list(/datum/reagent/consumable/ethanol/b52 = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/irish_cream = 1, /datum/reagent/consumable/ethanol/kahlua = 1, /datum/reagent/consumable/ethanol/cognac = 1) /datum/chemical_reaction/atomicbomb name = "Atomic Bomb" - id = "atomicbomb" - results = list("atomicbomb" = 10) - required_reagents = list("b52" = 10, "uranium" = 1) + id = /datum/reagent/consumable/ethanol/atomicbomb + results = list(/datum/reagent/consumable/ethanol/atomicbomb = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/b52 = 10, /datum/reagent/uranium = 1) /datum/chemical_reaction/margarita name = "Margarita" - id = "margarita" - results = list("margarita" = 3) - required_reagents = list("tequila" = 2, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/margarita + results = list(/datum/reagent/consumable/ethanol/margarita = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/tequila = 2, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/longislandicedtea name = "Long Island Iced Tea" - id = "longislandicedtea" - results = list("longislandicedtea" = 4) - required_reagents = list("vodka" = 1, "gin" = 1, "tequila" = 1, "cubalibre" = 1) + id = /datum/reagent/consumable/ethanol/longislandicedtea + results = list(/datum/reagent/consumable/ethanol/longislandicedtea = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/ethanol/gin = 1, /datum/reagent/consumable/ethanol/tequila = 1, /datum/reagent/consumable/ethanol/cuba_libre = 1) /datum/chemical_reaction/threemileisland name = "Three Mile Island Iced Tea" - id = "threemileisland" - results = list("threemileisland" = 10) - required_reagents = list("longislandicedtea" = 10, "uranium" = 1) + id = /datum/reagent/consumable/ethanol/threemileisland + results = list(/datum/reagent/consumable/ethanol/threemileisland = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/longislandicedtea = 10, /datum/reagent/uranium = 1) /datum/chemical_reaction/whiskeysoda name = "Whiskey Soda" - id = "whiskeysoda" - results = list("whiskeysoda" = 3) - required_reagents = list("whiskey" = 2, "sodawater" = 1) + id = /datum/reagent/consumable/ethanol/whiskeysoda + results = list(/datum/reagent/consumable/ethanol/whiskeysoda = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 2, /datum/reagent/consumable/sodawater = 1) /datum/chemical_reaction/black_russian name = "Black Russian" - id = "blackrussian" - results = list("blackrussian" = 5) - required_reagents = list("vodka" = 3, "kahlua" = 2) + id = /datum/reagent/consumable/ethanol/black_russian + results = list(/datum/reagent/consumable/ethanol/black_russian = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 3, /datum/reagent/consumable/ethanol/kahlua = 2) /datum/chemical_reaction/manhattan name = "Manhattan" - id = "manhattan" - results = list("manhattan" = 3) - required_reagents = list("whiskey" = 2, "vermouth" = 1) + id = /datum/reagent/consumable/ethanol/manhattan + results = list(/datum/reagent/consumable/ethanol/manhattan = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 2, /datum/reagent/consumable/ethanol/vermouth = 1) /datum/chemical_reaction/manhattan_proj name = "Manhattan Project" - id = "manhattan_proj" - results = list("manhattan_proj" = 10) - required_reagents = list("manhattan" = 10, "uranium" = 1) + id = /datum/reagent/consumable/ethanol/manhattan_proj + results = list(/datum/reagent/consumable/ethanol/manhattan_proj = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/manhattan = 10, /datum/reagent/uranium = 1) /datum/chemical_reaction/vodka_tonic name = "Vodka and Tonic" - id = "vodkatonic" - results = list("vodkatonic" = 3) - required_reagents = list("vodka" = 2, "tonic" = 1) + id = /datum/reagent/consumable/ethanol/vodkatonic + results = list(/datum/reagent/consumable/ethanol/vodkatonic = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 2, /datum/reagent/consumable/tonic = 1) /datum/chemical_reaction/gin_fizz name = "Gin Fizz" - id = "ginfizz" - results = list("ginfizz" = 4) - required_reagents = list("gin" = 2, "sodawater" = 1, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/ginfizz + results = list(/datum/reagent/consumable/ethanol/ginfizz = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/gin = 2, /datum/reagent/consumable/sodawater = 1, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/bahama_mama - name = "Bahama Mama" - id = "bahama_mama" - results = list("bahama_mama" = 5) - required_reagents = list("rum" = 2, "creme_de_coconut" = 1, "kahlua" = 1, "pineapplejuice" = 1) + name = "Bahama mama" + id = /datum/reagent/consumable/ethanol/bahama_mama + results = list(/datum/reagent/consumable/ethanol/bahama_mama = 6) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 2, /datum/reagent/consumable/orangejuice = 2, /datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/singulo name = "Singulo" - id = "singulo" - results = list("singulo" = 10) - required_reagents = list("vodka" = 5, "radium" = 1, "wine" = 5) + id = /datum/reagent/consumable/ethanol/singulo + results = list(/datum/reagent/consumable/ethanol/singulo = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 5, /datum/reagent/radium = 1, /datum/reagent/consumable/ethanol/wine = 5) /datum/chemical_reaction/alliescocktail name = "Allies Cocktail" - id = "alliescocktail" - results = list("alliescocktail" = 2) - required_reagents = list("martini" = 1, "vodka" = 1) + id = /datum/reagent/consumable/ethanol/alliescocktail + results = list(/datum/reagent/consumable/ethanol/alliescocktail = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/martini = 1, /datum/reagent/consumable/ethanol/vodka = 1) /datum/chemical_reaction/demonsblood name = "Demons Blood" - id = "demonsblood" - results = list("demonsblood" = 4) - required_reagents = list("rum" = 1, "spacemountainwind" = 1, "blood" = 1, "dr_gibb" = 1) + id = /datum/reagent/consumable/ethanol/demonsblood + results = list(/datum/reagent/consumable/ethanol/demonsblood = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/consumable/spacemountainwind = 1, /datum/reagent/blood = 1, /datum/reagent/consumable/dr_gibb = 1) /datum/chemical_reaction/booger name = "Booger" - id = "booger" - results = list("booger" = 4) - required_reagents = list("cream" = 1, "banana" = 1, "rum" = 1, "watermelonjuice" = 1) + id = /datum/reagent/consumable/ethanol/booger + results = list(/datum/reagent/consumable/ethanol/booger = 4) + required_reagents = list(/datum/reagent/consumable/cream = 1, /datum/reagent/consumable/banana = 1, /datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/consumable/watermelonjuice = 1) /datum/chemical_reaction/antifreeze name = "Anti-freeze" - id = "antifreeze" - results = list("antifreeze" = 4) - required_reagents = list("vodka" = 2, "cream" = 1, "ice" = 1) + id = /datum/reagent/consumable/ethanol/antifreeze + results = list(/datum/reagent/consumable/ethanol/antifreeze = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 2, /datum/reagent/consumable/cream = 1, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/barefoot name = "Barefoot" - id = "barefoot" - results = list("barefoot" = 3) - required_reagents = list("berryjuice" = 1, "cream" = 1, "vermouth" = 1) + id = /datum/reagent/consumable/ethanol/barefoot + results = list(/datum/reagent/consumable/ethanol/barefoot = 3) + required_reagents = list(/datum/reagent/consumable/berryjuice = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/consumable/ethanol/vermouth = 1) /datum/chemical_reaction/painkiller @@ -318,82 +318,82 @@ /datum/chemical_reaction/sbiten name = "Sbiten" - id = "sbiten" - results = list("sbiten" = 10) - required_reagents = list("vodka" = 10, "capsaicin" = 1) + id = /datum/reagent/consumable/ethanol/sbiten + results = list(/datum/reagent/consumable/ethanol/sbiten = 10) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 10, /datum/reagent/consumable/capsaicin = 1) /datum/chemical_reaction/red_mead name = "Red Mead" - id = "red_mead" - results = list("red_mead" = 2) - required_reagents = list("blood" = 1, "mead" = 1) + id = /datum/reagent/consumable/ethanol/red_mead + results = list(/datum/reagent/consumable/ethanol/red_mead = 2) + required_reagents = list(/datum/reagent/blood = 1, /datum/reagent/consumable/ethanol/mead = 1) /datum/chemical_reaction/mead name = "Mead" - id = "mead" - results = list("mead" = 2) - required_reagents = list("honey" = 2) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/mead + results = list(/datum/reagent/consumable/ethanol/mead = 2) + required_reagents = list(/datum/reagent/consumable/honey = 2) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/iced_beer name = "Iced Beer" - id = "iced_beer" - results = list("iced_beer" = 6) - required_reagents = list("beer" = 5, "ice" = 1) + id = /datum/reagent/consumable/ethanol/iced_beer + results = list(/datum/reagent/consumable/ethanol/iced_beer = 6) + required_reagents = list(/datum/reagent/consumable/ethanol/beer = 5, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/grog name = "Grog" - id = "grog" - results = list("grog" = 2) - required_reagents = list("rum" = 1, "water" = 1) + id = /datum/reagent/consumable/ethanol/grog + results = list(/datum/reagent/consumable/ethanol/grog = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/water = 1) /datum/chemical_reaction/soy_latte name = "Soy Latte" - id = "soy_latte" - results = list("soy_latte" = 2) - required_reagents = list("coffee" = 1, "soymilk" = 1) + id = /datum/reagent/consumable/soy_latte + results = list(/datum/reagent/consumable/soy_latte = 2) + required_reagents = list(/datum/reagent/consumable/coffee = 1, /datum/reagent/consumable/soymilk = 1) /datum/chemical_reaction/cafe_latte name = "Cafe Latte" - id = "cafe_latte" - results = list("cafe_latte" = 2) - required_reagents = list("coffee" = 1, "milk" = 1) + id = /datum/reagent/consumable/cafe_latte + results = list(/datum/reagent/consumable/cafe_latte = 2) + required_reagents = list(/datum/reagent/consumable/coffee = 1, /datum/reagent/consumable/milk = 1) /datum/chemical_reaction/acidspit name = "Acid Spit" - id = "acidspit" - results = list("acidspit" = 6) - required_reagents = list("sacid" = 1, "wine" = 5) + id = /datum/reagent/consumable/ethanol/acid_spit + results = list(/datum/reagent/consumable/ethanol/acid_spit = 6) + required_reagents = list(/datum/reagent/toxin/acid = 1, /datum/reagent/consumable/ethanol/wine = 5) /datum/chemical_reaction/amasec name = "Amasec" - id = "amasec" - results = list("amasec" = 10) - required_reagents = list("iron" = 1, "wine" = 5, "vodka" = 5) + id = /datum/reagent/consumable/ethanol/amasec + results = list(/datum/reagent/consumable/ethanol/amasec = 10) + required_reagents = list(/datum/reagent/iron = 1, /datum/reagent/consumable/ethanol/wine = 5, /datum/reagent/consumable/ethanol/vodka = 5) /datum/chemical_reaction/changelingsting name = "Changeling Sting" - id = "changelingsting" - results = list("changelingsting" = 5) - required_reagents = list("screwdrivercocktail" = 1, "lemon_lime" = 2) + id = /datum/reagent/consumable/ethanol/changelingsting + results = list(/datum/reagent/consumable/ethanol/changelingsting = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/screwdrivercocktail = 1, /datum/reagent/consumable/lemon_lime = 2) /datum/chemical_reaction/aloe name = "Aloe" - id = "aloe" - results = list("aloe" = 2) - required_reagents = list("irishcream" = 1, "watermelonjuice" = 1) + id = /datum/reagent/consumable/ethanol/aloe + results = list(/datum/reagent/consumable/ethanol/aloe = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/irish_cream = 1, /datum/reagent/consumable/watermelonjuice = 1) /datum/chemical_reaction/andalusia name = "Andalusia" - id = "andalusia" - results = list("andalusia" = 3) - required_reagents = list("rum" = 1, "whiskey" = 1, "lemonjuice" = 1) + id = /datum/reagent/consumable/ethanol/andalusia + results = list(/datum/reagent/consumable/ethanol/andalusia = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/consumable/ethanol/whiskey = 1, /datum/reagent/consumable/lemonjuice = 1) /datum/chemical_reaction/neurotoxin name = "Neurotoxin" - id = "neurotoxin" - results = list("neurotoxin" = 2) - required_reagents = list("gargleblaster" = 1, "morphine" = 1) + id = /datum/reagent/consumable/ethanol/neurotoxin + results = list(/datum/reagent/consumable/ethanol/neurotoxin = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/gargle_blaster = 1, /datum/reagent/medicine/morphine = 1) //FermiChem vars: Easy to make, but hard to make potent OptimalTempMin = 200 // Lower area of bell curve for determining heat based rate reactions OptimalTempMax = 950 // Upper end for above @@ -415,84 +415,83 @@ /* /datum/chemical_reaction/neurotoxin/FermiFinish(datum/reagents/holder, var/atom/my_atom) var/datum/reagent/consumable/ethanol/neurotoxin/Nt = locate(/datum/reagent/consumable/ethanol/neurotoxin) in my_atom.reagents.reagent_list - if(Nt) - var/cached_volume = Nt.volume - if(Nt.purity < 0.5) - holder.remove_reagent(src.id, cached_volume) - holder.add_reagent("neurosmash", cached_volume) + var/cached_volume = Nt.volume + if(Nt.purity < 0.5) + holder.remove_reagent(type, cached_volume) + holder.add_reagent(/datum/reagent/consumable/ethanol/neuroweak, cached_volume) */ /datum/chemical_reaction/snowwhite name = "Snow White" - id = "snowwhite" - results = list("snowwhite" = 2) - required_reagents = list("beer" = 1, "lemon_lime" = 1) + id = /datum/reagent/consumable/ethanol/snowwhite + results = list(/datum/reagent/consumable/ethanol/snowwhite = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/beer = 1, /datum/reagent/consumable/lemon_lime = 1) /datum/chemical_reaction/irishcarbomb name = "Irish Car Bomb" - id = "irishcarbomb" - results = list("irishcarbomb" = 2) - required_reagents = list("ale" = 1, "irishcream" = 1) + id = /datum/reagent/consumable/ethanol/irishcarbomb + results = list(/datum/reagent/consumable/ethanol/irishcarbomb = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/ale = 1, /datum/reagent/consumable/ethanol/irish_cream = 1) /datum/chemical_reaction/syndicatebomb name = "Syndicate Bomb" - id = "syndicatebomb" - results = list("syndicatebomb" = 2) - required_reagents = list("beer" = 1, "whiskeycola" = 1) + id = /datum/reagent/consumable/ethanol/syndicatebomb + results = list(/datum/reagent/consumable/ethanol/syndicatebomb = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/beer = 1, /datum/reagent/consumable/ethanol/whiskey_cola = 1) /datum/chemical_reaction/erikasurprise name = "Erika Surprise" - id = "erikasurprise" - results = list("erikasurprise" = 5) - required_reagents = list("ale" = 1, "limejuice" = 1, "whiskey" = 1, "banana" = 1, "ice" = 1) + id = /datum/reagent/consumable/ethanol/erikasurprise + results = list(/datum/reagent/consumable/ethanol/erikasurprise = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/ale = 1, /datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/ethanol/whiskey = 1, /datum/reagent/consumable/banana = 1, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/devilskiss name = "Devils Kiss" - id = "devilskiss" - results = list("devilskiss" = 3) - required_reagents = list("blood" = 1, "kahlua" = 1, "rum" = 1) + id = /datum/reagent/consumable/ethanol/devilskiss + results = list(/datum/reagent/consumable/ethanol/devilskiss = 3) + required_reagents = list(/datum/reagent/blood = 1, /datum/reagent/consumable/ethanol/kahlua = 1, /datum/reagent/consumable/ethanol/rum = 1) /datum/chemical_reaction/hippiesdelight name = "Hippies Delight" - id = "hippiesdelight" - results = list("hippiesdelight" = 2) - required_reagents = list("mushroomhallucinogen" = 1, "gargleblaster" = 1) + id = /datum/reagent/consumable/ethanol/hippies_delight + results = list(/datum/reagent/consumable/ethanol/hippies_delight = 2) + required_reagents = list(/datum/reagent/drug/mushroomhallucinogen = 1, /datum/reagent/consumable/ethanol/gargle_blaster = 1) /datum/chemical_reaction/bananahonk name = "Banana Honk" - id = "bananahonk" - results = list("bananahonk" = 2) - required_reagents = list("laughter" = 1, "cream" = 1) + id = /datum/reagent/consumable/ethanol/bananahonk + results = list(/datum/reagent/consumable/ethanol/bananahonk = 2) + required_reagents = list(/datum/reagent/consumable/laughter = 1, /datum/reagent/consumable/cream = 1) /datum/chemical_reaction/silencer name = "Silencer" - id = "silencer" - results = list("silencer" = 3) - required_reagents = list("nothing" = 1, "cream" = 1, "sugar" = 1) + id = /datum/reagent/consumable/ethanol/silencer + results = list(/datum/reagent/consumable/ethanol/silencer = 3) + required_reagents = list(/datum/reagent/consumable/nothing = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/driestmartini name = "Driest Martini" - id = "driestmartini" - results = list("driestmartini" = 2) - required_reagents = list("nothing" = 1, "gin" = 1) + id = /datum/reagent/consumable/ethanol/driestmartini + results = list(/datum/reagent/consumable/ethanol/driestmartini = 2) + required_reagents = list(/datum/reagent/consumable/nothing = 1, /datum/reagent/consumable/ethanol/gin = 1) /datum/chemical_reaction/thirteenloko name = "Thirteen Loko" - id = "thirteenloko" - results = list("thirteenloko" = 3) - required_reagents = list("vodka" = 1, "coffee" = 1, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/thirteenloko + results = list(/datum/reagent/consumable/ethanol/thirteenloko = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/coffee = 1, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/chocolatepudding name = "Chocolate Pudding" - id = "chocolatepudding" - results = list("chocolatepudding" = 20) - required_reagents = list("chocolate_milk" = 10, "eggyolk" = 5) + id = /datum/reagent/consumable/chocolatepudding + results = list(/datum/reagent/consumable/chocolatepudding = 20) + required_reagents = list(/datum/reagent/consumable/milk/chocolate_milk = 10, /datum/reagent/consumable/eggyolk = 5) /datum/chemical_reaction/vanillapudding name = "Vanilla Pudding" - id = "vanillapudding" - results = list("vanillapudding" = 20) - required_reagents = list("vanilla" = 5, "milk" = 5, "eggyolk" = 5) + id = /datum/reagent/consumable/vanillapudding + results = list(/datum/reagent/consumable/vanillapudding = 20) + required_reagents = list(/datum/reagent/consumable/vanilla = 5, /datum/reagent/consumable/milk = 5, /datum/reagent/consumable/eggyolk = 5) /datum/chemical_reaction/cherryshake name = "Cherry Shake" @@ -508,333 +507,333 @@ /datum/chemical_reaction/drunkenblumpkin name = "Drunken Blumpkin" - id = "drunkenblumpkin" - results = list("drunkenblumpkin" = 4) - required_reagents = list("blumpkinjuice" = 1, "irishcream" = 2, "ice" = 1) + id = /datum/reagent/consumable/ethanol/drunkenblumpkin + results = list(/datum/reagent/consumable/ethanol/drunkenblumpkin = 4) + required_reagents = list(/datum/reagent/consumable/blumpkinjuice = 1, /datum/reagent/consumable/ethanol/irish_cream = 2, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/pumpkin_latte name = "Pumpkin space latte" - id = "pumpkin_latte" - results = list("pumpkin_latte" = 15) - required_reagents = list("pumpkinjuice" = 5, "coffee" = 5, "cream" = 5) + id = /datum/reagent/consumable/pumpkin_latte + results = list(/datum/reagent/consumable/pumpkin_latte = 15) + required_reagents = list(/datum/reagent/consumable/pumpkinjuice = 5, /datum/reagent/consumable/coffee = 5, /datum/reagent/consumable/cream = 5) /datum/chemical_reaction/gibbfloats name = "Gibb Floats" - id = "gibbfloats" - results = list("gibbfloats" = 15) - required_reagents = list("dr_gibb" = 5, "ice" = 5, "cream" = 5) + id = /datum/reagent/consumable/gibbfloats + results = list(/datum/reagent/consumable/gibbfloats = 15) + required_reagents = list(/datum/reagent/consumable/dr_gibb = 5, /datum/reagent/consumable/ice = 5, /datum/reagent/consumable/cream = 5) /datum/chemical_reaction/triple_citrus name = "triple_citrus" - id = "triple_citrus" - results = list("triple_citrus" = 5) - required_reagents = list("lemonjuice" = 1, "limejuice" = 1, "orangejuice" = 1) + id = /datum/reagent/consumable/triple_citrus + results = list(/datum/reagent/consumable/triple_citrus = 5) + required_reagents = list(/datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/orangejuice = 1) /datum/chemical_reaction/grape_soda name = "grape soda" - id = "grapesoda" - results = list("grapesoda" = 2) - required_reagents = list("grapejuice" = 1, "sodawater" = 1) + id = /datum/reagent/consumable/grape_soda + results = list(/datum/reagent/consumable/grape_soda = 2) + required_reagents = list(/datum/reagent/consumable/grapejuice = 1, /datum/reagent/consumable/sodawater = 1) /datum/chemical_reaction/grappa name = "grappa" - id = "grappa" - results = list("grappa" = 10) - required_reagents = list ("wine" = 10) - required_catalysts = list ("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/grappa + results = list(/datum/reagent/consumable/ethanol/grappa = 10) + required_reagents = list (/datum/reagent/consumable/ethanol/wine = 10) + required_catalysts = list (/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/whiskey_sour name = "Whiskey Sour" - id = "whiskey_sour" - results = list("whiskey_sour" = 3) - required_reagents = list("whiskey" = 1, "lemonjuice" = 1, "sugar" = 1) + id = /datum/reagent/consumable/ethanol/whiskey_sour + results = list(/datum/reagent/consumable/ethanol/whiskey_sour = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 1, /datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/sugar = 1) mix_message = "The mixture darkens to a rich gold hue." /datum/chemical_reaction/fetching_fizz name = "Fetching Fizz" - id = "fetching_fizz" - results = list("fetching_fizz" = 3) - required_reagents = list("nuka_cola" = 1, "iron" = 1) //Manufacturable from only the mining station + id = /datum/reagent/consumable/ethanol/fetching_fizz + results = list(/datum/reagent/consumable/ethanol/fetching_fizz = 3) + required_reagents = list(/datum/reagent/consumable/nuka_cola = 1, /datum/reagent/iron = 1) //Manufacturable from only the mining station mix_message = "The mixture slightly vibrates before settling." /datum/chemical_reaction/hearty_punch name = "Hearty Punch" - id = "hearty_punch" - results = list("hearty_punch" = 1) //Very little, for balance reasons - required_reagents = list("bravebull" = 5, "syndicatebomb" = 5, "absinthe" = 5) + id = /datum/reagent/consumable/ethanol/hearty_punch + results = list(/datum/reagent/consumable/ethanol/hearty_punch = 1) //Very little, for balance reasons + required_reagents = list(/datum/reagent/consumable/ethanol/brave_bull = 5, /datum/reagent/consumable/ethanol/syndicatebomb = 5, /datum/reagent/consumable/ethanol/absinthe = 5) mix_message = "The mixture darkens to a healthy crimson." required_temp = 315 //Piping hot! /datum/chemical_reaction/bacchus_blessing name = "Bacchus' Blessing" - id = "bacchus_blessing" - results = list("bacchus_blessing" = 4) - required_reagents = list("hooch" = 1, "absinthe" = 1, "manlydorf" = 1, "syndicatebomb" = 1) + id = /datum/reagent/consumable/ethanol/bacchus_blessing + results = list(/datum/reagent/consumable/ethanol/bacchus_blessing = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/hooch = 1, /datum/reagent/consumable/ethanol/absinthe = 1, /datum/reagent/consumable/ethanol/manly_dorf = 1, /datum/reagent/consumable/ethanol/syndicatebomb = 1) mix_message = "The mixture turns to a sickening froth." /datum/chemical_reaction/lemonade name = "Lemonade" - id = "lemonade" - results = list("lemonade" = 5) - required_reagents = list("lemonjuice" = 2, "water" = 2, "sugar" = 1, "ice" = 1) + id = /datum/reagent/consumable/lemonade + results = list(/datum/reagent/consumable/lemonade = 5) + required_reagents = list(/datum/reagent/consumable/lemonjuice = 2, /datum/reagent/water = 2, /datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/ice = 1) mix_message = "You're suddenly reminded of home." /datum/chemical_reaction/arnold_palmer name = "Arnold Palmer" - id = "arnold_palmer" - results = list("arnold_palmer" = 2) - required_reagents = list("tea" = 1, "lemonade" = 1) + id = /datum/reagent/consumable/tea/arnold_palmer + results = list(/datum/reagent/consumable/tea/arnold_palmer = 2) + required_reagents = list(/datum/reagent/consumable/tea = 1, /datum/reagent/consumable/lemonade = 1) mix_message = "The smells of fresh green grass and sand traps waft through the air as the mixture turns a friendly yellow-orange." /datum/chemical_reaction/chocolate_milk name = "chocolate milk" - id = "chocolate_milk" - results = list("chocolate_milk" = 2) - required_reagents = list("milk" = 1, "cocoa" = 1) + id = /datum/reagent/consumable/milk/chocolate_milk + results = list(/datum/reagent/consumable/milk/chocolate_milk = 2) + required_reagents = list(/datum/reagent/consumable/milk = 1, /datum/reagent/consumable/coco = 1) mix_message = "The color changes as the mixture blends smoothly." /datum/chemical_reaction/eggnog name = "eggnog" - id = "eggnog" - results = list("eggnog" = 15) - required_reagents = list("rum" = 5, "cream" = 5, "eggyolk" = 5) + id = /datum/reagent/consumable/ethanol/eggnog + results = list(/datum/reagent/consumable/ethanol/eggnog = 15) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 5, /datum/reagent/consumable/cream = 5, /datum/reagent/consumable/eggyolk = 5) /datum/chemical_reaction/narsour name = "Nar'sour" - id = "narsour" - results = list("narsour" = 1) - required_reagents = list("blood" = 1, "lemonjuice" = 1, "demonsblood" = 1) + id = /datum/reagent/consumable/ethanol/narsour + results = list(/datum/reagent/consumable/ethanol/narsour = 1) + required_reagents = list(/datum/reagent/blood = 1, /datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/ethanol/demonsblood = 1) mix_message = "The mixture develops a sinister glow." mix_sound = 'sound/effects/singlebeat.ogg' /datum/chemical_reaction/quadruplesec name = "Quadruple Sec" - id = "quadruple_sec" - results = list("quadruple_sec" = 15) - required_reagents = list("triple_sec" = 5, "triple_citrus" = 5, "creme_de_menthe" = 5) + id = /datum/reagent/consumable/ethanol/quadruple_sec + results = list(/datum/reagent/consumable/ethanol/quadruple_sec = 15) + required_reagents = list(/datum/reagent/consumable/ethanol/triple_sec = 5, /datum/reagent/consumable/triple_citrus = 5, /datum/reagent/consumable/ethanol/creme_de_menthe = 5) mix_message = "The snap of a taser emanates clearly from the mixture as it settles." mix_sound = 'sound/weapons/taser.ogg' /datum/chemical_reaction/grasshopper name = "Grasshopper" - id = "grasshopper" - results = list("grasshopper" = 15) - required_reagents = list("cream" = 5, "creme_de_menthe" = 5, "creme_de_cacao" = 5) + id = /datum/reagent/consumable/ethanol/grasshopper + results = list(/datum/reagent/consumable/ethanol/grasshopper = 15) + required_reagents = list(/datum/reagent/consumable/cream = 5, /datum/reagent/consumable/ethanol/creme_de_menthe = 5, /datum/reagent/consumable/ethanol/creme_de_cacao = 5) mix_message = "A vibrant green bubbles forth as the mixture emulsifies." /datum/chemical_reaction/stinger name = "Stinger" - id = "stinger" - results = list("stinger" = 15) - required_reagents = list("whiskey" = 10, "creme_de_menthe" = 5 ) + id = /datum/reagent/consumable/ethanol/stinger + results = list(/datum/reagent/consumable/ethanol/stinger = 15) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskey = 10, /datum/reagent/consumable/ethanol/creme_de_menthe = 5) /datum/chemical_reaction/quintuplesec name = "Quintuple Sec" - id = "quintuple_sec" - results = list("quintuple_sec" = 15) - required_reagents = list("quadruple_sec" = 5, "clownstears" = 5, "syndicatebomb" = 5) + id = /datum/reagent/consumable/ethanol/quintuple_sec + results = list(/datum/reagent/consumable/ethanol/quintuple_sec = 15) + required_reagents = list(/datum/reagent/consumable/ethanol/quadruple_sec = 5, /datum/reagent/consumable/clownstears = 5, /datum/reagent/consumable/ethanol/syndicatebomb = 5) mix_message = "Judgement is upon you." mix_message = 'sound/items/airhorn2.ogg' /datum/chemical_reaction/bastion_bourbon name = "Bastion Bourbon" - id = "bastion_bourbon" - results = list("bastion_bourbon" = 2) - required_reagents = list("tea" = 1, "creme_de_menthe" = 1, "triple_citrus" = 1, "berryjuice" = 1) //herbal and minty, with a hint of citrus and berry + id = /datum/reagent/consumable/ethanol/bastion_bourbon + results = list(/datum/reagent/consumable/ethanol/bastion_bourbon = 2) + required_reagents = list(/datum/reagent/consumable/tea = 1, /datum/reagent/consumable/ethanol/creme_de_menthe = 1, /datum/reagent/consumable/triple_citrus = 1, /datum/reagent/consumable/berryjuice = 1) //herbal and minty, with a hint of citrus and berry mix_message = "You catch an aroma of hot tea and fruits as the mix blends into a blue-green color." /datum/chemical_reaction/squirt_cider name = "Squirt Cider" - id = "squirt_cider" - results = list("squirt_cider" = 1) - required_reagents = list("water" = 1, "tomatojuice" = 1, "nutriment" = 1) + id = /datum/reagent/consumable/ethanol/squirt_cider + results = list(/datum/reagent/consumable/ethanol/squirt_cider = 1) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/consumable/tomatojuice = 1, /datum/reagent/consumable/nutriment = 1) mix_message = "The mix swirls and turns a bright red that reminds you of an apple's skin." /datum/chemical_reaction/fringe_weaver name = "Fringe Weaver" - id = "fringe_weaver" - results = list("fringe_weaver" = 10) - required_reagents = list("ethanol" = 9, "sugar" = 1) //9 karmotrine, 1 adelhyde + id = /datum/reagent/consumable/ethanol/fringe_weaver + results = list(/datum/reagent/consumable/ethanol/fringe_weaver = 10) + required_reagents = list(/datum/reagent/consumable/ethanol = 9, /datum/reagent/consumable/sugar = 1) //9 karmotrine, 1 adelhyde mix_message = "The mix turns a pleasant cream color and foams up." /datum/chemical_reaction/sugar_rush name = "Sugar Rush" - id = "sugar_rush" - results = list("sugar_rush" = 4) - required_reagents = list("sugar" = 2, "lemonjuice" = 1, "wine" = 1) //2 adelhyde (sweet), 1 powdered delta (sour), 1 karmotrine (alcohol) + id = /datum/reagent/consumable/ethanol/sugar_rush + results = list(/datum/reagent/consumable/ethanol/sugar_rush = 4) + required_reagents = list(/datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/lemonjuice = 1, /datum/reagent/consumable/ethanol/wine = 1) //2 adelhyde (sweet), 1 powdered delta (sour), 1 karmotrine (alcohol) mix_message = "The mixture bubbles and brightens into a girly pink." /datum/chemical_reaction/crevice_spike name = "Crevice Spike" - id = "crevice_spike" - results = list("crevice_spike" = 6) - required_reagents = list("limejuice" = 2, "capsaicin" = 4) //2 powdered delta (sour), 4 flanergide (spicy) + id = /datum/reagent/consumable/ethanol/crevice_spike + results = list(/datum/reagent/consumable/ethanol/crevice_spike = 6) + required_reagents = list(/datum/reagent/consumable/limejuice = 2, /datum/reagent/consumable/capsaicin = 4) //2 powdered delta (sour), 4 flanergide (spicy) mix_message = "The mixture stings your eyes as it settles." /datum/chemical_reaction/sake name = "sake" - id = "sake" - results = list("sake" = 10) - required_reagents = list("rice" = 10) - required_catalysts = list("enzyme" = 5) + id = /datum/reagent/consumable/ethanol/sake + results = list(/datum/reagent/consumable/ethanol/sake = 10) + required_reagents = list(/datum/reagent/consumable/rice = 10) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) mix_message = "The rice grains ferment into a clear, sweet-smelling liquid." /datum/chemical_reaction/peppermint_patty name = "Peppermint Patty" - id = "peppermint_patty" - results = list("peppermint_patty" = 10) - required_reagents = list("hot_coco" = 6, "creme_de_cacao" = 1, "creme_de_menthe" = 1, "vodka" = 1, "menthol" = 1) + id = /datum/reagent/consumable/ethanol/peppermint_patty + results = list(/datum/reagent/consumable/ethanol/peppermint_patty = 10) + required_reagents = list(/datum/reagent/consumable/hot_coco = 6, /datum/reagent/consumable/ethanol/creme_de_cacao = 1, /datum/reagent/consumable/ethanol/creme_de_menthe = 1, /datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/menthol = 1) mix_message = "The coco turns mint green just as the strong scent hits your nose." /datum/chemical_reaction/alexander name = "Alexander" - id = "alexander" - results = list("alexander" = 3) - required_reagents = list("cognac" = 1, "creme_de_cacao" = 1, "cream" = 1) + id = /datum/reagent/consumable/ethanol/alexander + results = list(/datum/reagent/consumable/ethanol/alexander = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/cognac = 1, /datum/reagent/consumable/ethanol/creme_de_cacao = 1, /datum/reagent/consumable/cream = 1) /datum/chemical_reaction/sidecar name = "Sidecar" - id = "sidecar" - results = list("sidecar" = 4) - required_reagents = list("cognac" = 2, "triple_sec" = 1, "lemonjuice" = 1) + id = /datum/reagent/consumable/ethanol/sidecar + results = list(/datum/reagent/consumable/ethanol/sidecar = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/cognac = 2, /datum/reagent/consumable/ethanol/triple_sec = 1, /datum/reagent/consumable/lemonjuice = 1) /datum/chemical_reaction/between_the_sheets name = "Between the Sheets" - id = "between_the_sheets" - results = list("between_the_sheets" = 5) - required_reagents = list("rum" = 1, "sidecar" = 4) + id = /datum/reagent/consumable/ethanol/between_the_sheets + results = list(/datum/reagent/consumable/ethanol/between_the_sheets = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/consumable/ethanol/sidecar = 4) /datum/chemical_reaction/kamikaze name = "Kamikaze" - id = "kamikaze" - results = list("kamikaze" = 3) - required_reagents = list("vodka" = 1, "triple_sec" = 1, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/kamikaze + results = list(/datum/reagent/consumable/ethanol/kamikaze = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/vodka = 1, /datum/reagent/consumable/ethanol/triple_sec = 1, /datum/reagent/consumable/limejuice = 1) /datum/chemical_reaction/mojito name = "Mojito" - id = "mojito" - results = list("mojito" = 5) - required_reagents = list("rum" = 1, "sugar" = 1, "limejuice" = 1, "sodawater" = 1, "menthol" = 1) + id = /datum/reagent/consumable/ethanol/mojito + results = list(/datum/reagent/consumable/ethanol/mojito = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/rum = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/limejuice = 1, /datum/reagent/consumable/sodawater = 1, /datum/reagent/consumable/menthol = 1) /datum/chemical_reaction/fernet_cola name = "Fernet Cola" - id = "fernet_cola" - results = list("fernet_cola" = 2) - required_reagents = list("fernet" = 1, "cola" = 1) + id = /datum/reagent/consumable/ethanol/fernet_cola + results = list(/datum/reagent/consumable/ethanol/fernet_cola = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/fernet = 1, /datum/reagent/consumable/space_cola = 1) /datum/chemical_reaction/fanciulli name = "Fanciulli" - id = "fanciulli" - results = list("fanciulli" = 2) - required_reagents = list("manhattan" = 1, "fernet" = 1) + id = /datum/reagent/consumable/ethanol/fanciulli + results = list(/datum/reagent/consumable/ethanol/fanciulli = 2) + required_reagents = list(/datum/reagent/consumable/ethanol/manhattan = 1, /datum/reagent/consumable/ethanol/fernet = 1) /datum/chemical_reaction/branca_menta name = "Branca Menta" - id = "branca_menta" - results = list("branca_menta" = 3) - required_reagents = list("fernet" = 1, "creme_de_menthe" = 1, "ice" = 1) + id = /datum/reagent/consumable/ethanol/branca_menta + results = list(/datum/reagent/consumable/ethanol/branca_menta = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/fernet = 1, /datum/reagent/consumable/ethanol/creme_de_menthe = 1, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/pwrgame name = "Power Gamer" - id = "pwr_game" - results = list("pwr_game" = 5) - required_reagents = list("sodawater" = 1, "blackcrayonpowder" = 1, "sodiumchloride" = 1) + id = /datum/reagent/consumable/pwr_game + results = list(/datum/reagent/consumable/pwr_game = 5) + required_reagents = list(/datum/reagent/consumable/sodawater = 1, /datum/reagent/colorful_reagent/crayonpowder/black = 1, /datum/reagent/consumable/sodiumchloride = 1) /datum/chemical_reaction/pinkmilk name = "Strawberry Milk" - id = "pinkmilk" - results = list("pinkmilk" = 5) - required_reagents = list("aphro+" = 1, "milk" = 1) + id = /datum/reagent/consumable/pinkmilk + results = list(/datum/reagent/consumable/pinkmilk = 5) + required_reagents = list(/datum/reagent/drug/aphrodisiacplus = 1, /datum/reagent/consumable/milk = 1) /datum/chemical_reaction/pinktea name = "Strawberry Tea" - id = "pinktea" - results = list("pinktea" = 5) - required_reagents = list("aphro" = 1, "arnold_palmer" = 1, "sugar" = 1) + id = /datum/reagent/consumable/pinktea + results = list(/datum/reagent/consumable/pinktea = 5) + required_reagents = list(/datum/reagent/drug/aphrodisiac = 1, /datum/reagent/consumable/tea/arnold_palmer = 1, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/blank_paper name = "Blank Paper" - id = "blank_paper" - results = list("blank_paper" = 3) - required_reagents = list("silencer" = 1, "nothing" = 1, "nuka_cola" = 1) + id = /datum/reagent/consumable/ethanol/blank_paper + results = list(/datum/reagent/consumable/ethanol/blank_paper = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/silencer = 1, /datum/reagent/consumable/nothing = 1, /datum/reagent/consumable/nuka_cola = 1) /datum/chemical_reaction/wizz_fizz name = "Wizz Fizz" - id = "wizz_fizz" - results = list("wizz_fizz" = 3) - required_reagents = list("triple_sec" = 1, "sodawater" = 1, "champagne" = 1) + id = /datum/reagent/consumable/ethanol/wizz_fizz + results = list(/datum/reagent/consumable/ethanol/wizz_fizz = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/triple_sec = 1, /datum/reagent/consumable/sodawater = 1, /datum/reagent/consumable/ethanol/champagne = 1) mix_message = "The beverage starts to froth with an almost mystical zeal!" mix_sound = 'sound/effects/bubbles2.ogg' /datum/chemical_reaction/bug_spray name = "Bug Spray" - id = "bug_spray" - results = list("bug_spray" = 5) - required_reagents = list("triple_sec" = 2, "lemon_lime" = 1, "rum" = 2, "vodka" = 1) + id = /datum/reagent/consumable/ethanol/bug_spray + results = list(/datum/reagent/consumable/ethanol/bug_spray = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/triple_sec = 2, /datum/reagent/consumable/lemon_lime = 1, /datum/reagent/consumable/ethanol/rum = 2, /datum/reagent/consumable/ethanol/vodka = 1) mix_message = "The faint aroma of summer camping trips wafts through the air; but what's that buzzing noise?" mix_sound = 'sound/creatures/bee.ogg' /datum/chemical_reaction/jack_rose name = "Jack Rose" - id = "jack_rose" - results = list("jack_rose" = 4) - required_reagents = list("grenadine" = 1, "applejack" = 2, "limejuice" = 1) + id = /datum/reagent/consumable/ethanol/jack_rose + results = list(/datum/reagent/consumable/ethanol/jack_rose = 4) + required_reagents = list(/datum/reagent/consumable/grenadine = 1, /datum/reagent/consumable/ethanol/applejack = 2, /datum/reagent/consumable/limejuice = 1) mix_message = "As the grenadine incorporates, the beverage takes on a mellow, red-orange glow." /datum/chemical_reaction/turbo name = "Turbo" - id = "turbo" - results = list("turbo" = 5) - required_reagents = list("moonshine" = 2, "nitrous_oxide" = 1, "sugar_rush" = 1, "pwr_game" = 1) + id = /datum/reagent/consumable/ethanol/turbo + results = list(/datum/reagent/consumable/ethanol/turbo = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/moonshine = 2, /datum/reagent/nitrous_oxide = 1, /datum/reagent/consumable/ethanol/sugar_rush = 1, /datum/reagent/consumable/pwr_game = 1) /datum/chemical_reaction/old_timer name = "Old Timer" - id = "old_timer" - results = list("old_timer" = 6) - required_reagents = list("whiskeysoda" = 3, "parsnipjuice" = 2, "alexander" = 1) + id = /datum/reagent/consumable/ethanol/old_timer + results = list(/datum/reagent/consumable/ethanol/old_timer = 6) + required_reagents = list(/datum/reagent/consumable/ethanol/whiskeysoda = 3, /datum/reagent/consumable/parsnipjuice = 2, /datum/reagent/consumable/ethanol/alexander = 1) /datum/chemical_reaction/rubberneck name = "Rubberneck" - id = "rubberneck" - results = list("rubberneck" = 10) - required_reagents = list("ethanol" = 4, "grey_bull" = 5, "astrotame" = 1) + id = /datum/reagent/consumable/ethanol/rubberneck + results = list(/datum/reagent/consumable/ethanol/rubberneck = 10) + required_reagents = list(/datum/reagent/consumable/ethanol = 4, /datum/reagent/consumable/grey_bull = 5, /datum/reagent/consumable/astrotame = 1) /datum/chemical_reaction/duplex name = "Duplex" - id = "duplex" - results = list("duplex" = 4) - required_reagents = list("hcider" = 2, "applejuice" = 1, "berryjuice" = 1) + id = /datum/reagent/consumable/ethanol/duplex + results = list(/datum/reagent/consumable/ethanol/duplex = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/hcider = 2, /datum/reagent/consumable/applejuice = 1, /datum/reagent/consumable/berryjuice = 1) /datum/chemical_reaction/trappist name = "Trappist" - id = "trappist" - results = list("trappist" = 5) - required_reagents = list("ale" = 2, "holywater" = 2, "sugar" = 1) + id = /datum/reagent/consumable/ethanol/trappist + results = list(/datum/reagent/consumable/ethanol/trappist = 5) + required_reagents = list(/datum/reagent/consumable/ethanol/ale = 2, /datum/reagent/water/holywater = 2, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/cream_soda name = "Cream Soda" - id = "cream_soda" - results = list("cream_soda" = 4) - required_reagents = list("sugar" = 2, "sodawater" = 2, "vanilla" = 1) + id = /datum/reagent/consumable/cream_soda + results = list(/datum/reagent/consumable/cream_soda = 4) + required_reagents = list(/datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/sodawater = 2, /datum/reagent/consumable/vanilla = 1) /datum/chemical_reaction/blazaam name = "Blazaam" - id = "blazaam" - results = list("blazaam" = 3) - required_reagents = list("gin" = 2, "peachjuice" = 1, "bluespace" = 1) + id = /datum/reagent/consumable/ethanol/blazaam + results = list(/datum/reagent/consumable/ethanol/blazaam = 3) + required_reagents = list(/datum/reagent/consumable/ethanol/gin = 2, /datum/reagent/consumable/peachjuice = 1, /datum/reagent/bluespace = 1) /datum/chemical_reaction/planet_cracker name = "Planet Cracker" - id = "planet_cracker" - results = list("planet_cracker" = 4) - required_reagents = list("champagne" = 2, "lizardwine" = 2, "eggyolk" = 1, "gold" = 1) + id = /datum/reagent/consumable/ethanol/planet_cracker + results = list(/datum/reagent/consumable/ethanol/planet_cracker = 4) + required_reagents = list(/datum/reagent/consumable/ethanol/champagne = 2, /datum/reagent/consumable/ethanol/lizardwine = 2, /datum/reagent/consumable/eggyolk = 1, /datum/reagent/gold = 1) mix_message = "The liquid's color starts shifting as the nanogold is alternately corroded and redeposited." /datum/chemical_reaction/red_queen name = "Red Queen" - id = "red_queen" - results = list("red_queen" = 10) - required_reagents = list("tea" = 6, "mercury" = 2, "blackpepper" = 1, "growthserum" = 1) + id = /datum/reagent/consumable/red_queen + results = list(/datum/reagent/consumable/red_queen = 10) + required_reagents = list(/datum/reagent/consumable/tea = 6, /datum/reagent/mercury = 2, /datum/reagent/consumable/blackpepper = 1, /datum/reagent/growthserum = 1) /datum/chemical_reaction/gunfire name = "Gunfire" @@ -888,8 +887,8 @@ required_reagents = list("ephedrine" = 1, "pina_colada" = 1) /datum/chemical_reaction/commander_and_chief - name = "Commander and Chief" - id = "commander_and_chief" - results = list("commander_and_chief" = 50) - required_reagents = list("alliescocktail" = 50, "champagne" = 20, "doctorsdelight" = 10, "quintuple_sec" = 10, "screwdrivercocktail" = 10) - mix_message = "When your powers combine, I am Captain Pl-..." + name = "Commander and Chief" + id = /datum/reagent/consumable/ethanol/commander_and_chief + results = list(/datum/reagent/consumable/ethanol/commander_and_chief = 50) + required_reagents = list(/datum/reagent/consumable/ethanol/alliescocktail = 50, /datum/reagent/consumable/ethanol/champagne = 20, /datum/reagent/consumable/doctor_delight = 10, /datum/reagent/consumable/ethanol/quintuple_sec = 10, /datum/reagent/consumable/ethanol/screwdrivercocktail = 10) + mix_message = "When your powers combine, I am Captain Pl-..." diff --git a/code/modules/food_and_drinks/recipes/food_mixtures.dm b/code/modules/food_and_drinks/recipes/food_mixtures.dm index 404f3a60..da7bc949 100644 --- a/code/modules/food_and_drinks/recipes/food_mixtures.dm +++ b/code/modules/food_and_drinks/recipes/food_mixtures.dm @@ -11,8 +11,8 @@ /datum/chemical_reaction/tofu name = "Tofu" id = "tofu" - required_reagents = list("soymilk" = 10) - required_catalysts = list("enzyme" = 5) + required_reagents = list(/datum/reagent/consumable/soymilk = 10) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) mob_react = FALSE /datum/chemical_reaction/tofu/on_reaction(datum/reagents/holder, created_volume) @@ -24,7 +24,7 @@ /datum/chemical_reaction/chocolate_bar name = "Chocolate Bar" id = "chocolate_bar" - required_reagents = list("soymilk" = 2, "cocoa" = 2, "sugar" = 2) + required_reagents = list(/datum/reagent/consumable/soymilk = 2, /datum/reagent/consumable/coco = 2, /datum/reagent/consumable/sugar = 2) /datum/chemical_reaction/chocolate_bar/on_reaction(datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -35,8 +35,8 @@ /datum/chemical_reaction/chocolate_bar2 name = "Chocolate Bar" - id = "chocolate_bar" - required_reagents = list("chocolate_milk" = 4, "sugar" = 2) + id = "chocolate_bar2" + required_reagents = list(/datum/reagent/consumable/milk/chocolate_milk = 4, /datum/reagent/consumable/sugar = 2) mob_react = FALSE /datum/chemical_reaction/chocolate_bar2/on_reaction(datum/reagents/holder, created_volume) @@ -47,40 +47,40 @@ /datum/chemical_reaction/hot_coco name = "Hot Coco" - id = "hot_coco" - results = list("hot_coco" = 5) - required_reagents = list("water" = 5, "cocoa" = 1) + id = /datum/reagent/consumable/hot_coco + results = list(/datum/reagent/consumable/hot_coco = 5) + required_reagents = list(/datum/reagent/water = 5, /datum/reagent/consumable/coco = 1) /datum/chemical_reaction/coffee name = "Coffee" - id = "coffee" - results = list("coffee" = 5) - required_reagents = list("coffeepowder" = 1, "water" = 5) + id = /datum/reagent/consumable/coffee + results = list(/datum/reagent/consumable/coffee = 5) + required_reagents = list(/datum/reagent/toxin/coffeepowder = 1, /datum/reagent/water = 5) /datum/chemical_reaction/tea name = "Tea" - id = "tea" - results = list("tea" = 5) - required_reagents = list("teapowder" = 1, "water" = 5) + id = /datum/reagent/consumable/tea + results = list(/datum/reagent/consumable/tea = 5) + required_reagents = list(/datum/reagent/toxin/teapowder = 1, /datum/reagent/water = 5) /datum/chemical_reaction/soysauce name = "Soy Sauce" - id = "soysauce" - results = list("soysauce" = 5) - required_reagents = list("soymilk" = 4, "sacid" = 1) + id = /datum/reagent/consumable/soysauce + results = list(/datum/reagent/consumable/soysauce = 5) + required_reagents = list(/datum/reagent/consumable/soymilk = 4, /datum/reagent/toxin/acid = 1) /datum/chemical_reaction/corn_syrup name = "corn_syrup" - id = "corn_syrup" - results = list("corn_syrup" = 5) - required_reagents = list("corn_starch" = 1, "sacid" = 1) + id = /datum/reagent/consumable/corn_syrup + results = list(/datum/reagent/consumable/corn_syrup = 5) + required_reagents = list(/datum/reagent/consumable/corn_starch = 1, /datum/reagent/toxin/acid = 1) required_temp = 374 /datum/chemical_reaction/caramel name = "Caramel" - id = "caramel" - results = list("caramel" = 1) - required_reagents = list("sugar" = 1) + id = /datum/reagent/consumable/caramel + results = list(/datum/reagent/consumable/caramel = 1) + required_reagents = list(/datum/reagent/consumable/sugar = 1) required_temp = 413 mob_react = FALSE @@ -95,8 +95,8 @@ /datum/chemical_reaction/cheesewheel name = "Cheesewheel" id = "cheesewheel" - required_reagents = list("milk" = 40) - required_catalysts = list("enzyme" = 5) + required_reagents = list(/datum/reagent/consumable/milk = 40) + required_catalysts = list(/datum/reagent/consumable/enzyme = 5) /datum/chemical_reaction/cheesewheel/on_reaction(datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -106,7 +106,7 @@ /datum/chemical_reaction/synthmeat name = "synthmeat" id = "synthmeat" - required_reagents = list("blood" = 5, "cryoxadone" = 1) + required_reagents = list(/datum/reagent/blood = 5, /datum/reagent/medicine/cryoxadone = 1) mob_react = FALSE /datum/chemical_reaction/synthmeat/on_reaction(datum/reagents/holder, created_volume) @@ -116,20 +116,20 @@ /datum/chemical_reaction/hot_ramen name = "Hot Ramen" - id = "hot_ramen" - results = list("hot_ramen" = 3) - required_reagents = list("water" = 1, "dry_ramen" = 3) + id = /datum/reagent/consumable/hot_ramen + results = list(/datum/reagent/consumable/hot_ramen = 3) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/consumable/dry_ramen = 3) /datum/chemical_reaction/hell_ramen name = "Hell Ramen" - id = "hell_ramen" - results = list("hell_ramen" = 6) - required_reagents = list("capsaicin" = 1, "hot_ramen" = 6) + id = /datum/reagent/consumable/hell_ramen + results = list(/datum/reagent/consumable/hell_ramen = 6) + required_reagents = list(/datum/reagent/consumable/capsaicin = 1, /datum/reagent/consumable/hot_ramen = 6) /datum/chemical_reaction/imitationcarpmeat name = "Imitation Carpmeat" id = "imitationcarpmeat" - required_reagents = list("carpotoxin" = 5) + required_reagents = list(/datum/reagent/toxin/carpotoxin = 5) required_container = /obj/item/reagent_containers/food/snacks/tofu mix_message = "The mixture becomes similar to carp meat." @@ -142,7 +142,7 @@ /datum/chemical_reaction/dough name = "Dough" id = "dough" - required_reagents = list("water" = 10, "flour" = 15) + required_reagents = list(/datum/reagent/water = 10, /datum/reagent/consumable/flour = 15) mix_message = "The ingredients form a dough." /datum/chemical_reaction/dough/on_reaction(datum/reagents/holder, created_volume) @@ -153,7 +153,7 @@ /datum/chemical_reaction/cakebatter name = "Cake Batter" id = "cakebatter" - required_reagents = list("eggyolk" = 15, "flour" = 15, "sugar" = 5) + required_reagents = list(/datum/reagent/consumable/eggyolk = 15, /datum/reagent/consumable/flour = 15, /datum/reagent/consumable/sugar = 5) mix_message = "The ingredients form a cake batter." /datum/chemical_reaction/cakebatter/on_reaction(datum/reagents/holder, created_volume) @@ -163,12 +163,12 @@ /datum/chemical_reaction/cakebatter/vegan id = "vegancakebatter" - required_reagents = list("soymilk" = 15, "flour" = 15, "sugar" = 5) + required_reagents = list(/datum/reagent/consumable/soymilk = 15, /datum/reagent/consumable/flour = 15, /datum/reagent/consumable/sugar = 5) /datum/chemical_reaction/ricebowl name = "Rice Bowl" id = "ricebowl" - required_reagents = list("rice" = 10, "water" = 10) + required_reagents = list(/datum/reagent/consumable/rice = 10, /datum/reagent/water = 10) required_container = /obj/item/reagent_containers/glass/bowl mix_message = "The rice absorbs the water." @@ -180,6 +180,6 @@ /datum/chemical_reaction/bbqsauce name = "BBQ Sauce" - id = "bbqsauce" - results = list("bbqsauce" = 5) - required_reagents = list("ash" = 1, "tomatojuice" = 1, "salglu_solution" = 3, "blackpepper" = 1) \ No newline at end of file + id = /datum/reagent/consumable/bbqsauce + results = list(/datum/reagent/consumable/bbqsauce = 5) + required_reagents = list(/datum/reagent/ash = 1, /datum/reagent/consumable/tomatojuice = 1, /datum/reagent/medicine/salglu_solution = 3, /datum/reagent/consumable/blackpepper = 1) diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm index 70973dd2..4bec7c29 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm @@ -108,7 +108,7 @@ datum/crafting_recipe/food/donut/meat /datum/crafting_recipe/food/donut/bungo name = "Bungo Donut" reqs = list( - /obj/item/reagent_containers/food/snacks/grown/bungofruit = 1, + /datum/reagent/consumable/bungojuice = 3, /obj/item/reagent_containers/food/snacks/donut/plain = 1 ) result = /obj/item/reagent_containers/food/snacks/donut/bungo @@ -175,7 +175,7 @@ datum/crafting_recipe/food/donut/meat /datum/crafting_recipe/food/donut/jelly/bungo name = "Bungo Jelly Donut" reqs = list( - /obj/item/reagent_containers/food/snacks/grown/bungofruit = 1, + /datum/reagent/consumable/bungojuice = 3, /obj/item/reagent_containers/food/snacks/donut/jelly/plain = 1 ) result = /obj/item/reagent_containers/food/snacks/donut/jelly/bungo @@ -242,7 +242,7 @@ datum/crafting_recipe/food/donut/meat /datum/crafting_recipe/food/donut/slimejelly/bungo name = "Bungo Slime Donut" reqs = list( - /obj/item/reagent_containers/food/snacks/grown/bungofruit = 1, + /datum/reagent/consumable/bungojuice = 3, /obj/item/reagent_containers/food/snacks/donut/jelly/slimejelly/plain = 1 ) result = /obj/item/reagent_containers/food/snacks/donut/jelly/slimejelly/bungo diff --git a/code/modules/holiday/easter.dm b/code/modules/holiday/easter.dm index 4dfe2f33..8018b8ac 100644 --- a/code/modules/holiday/easter.dm +++ b/code/modules/holiday/easter.dm @@ -163,7 +163,7 @@ icon_state = "briochecake" slice_path = /obj/item/reagent_containers/food/snacks/cakeslice/brioche slices_num = 6 - bonus_reagents = list("nutriment" = 10, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/vitamin = 2) /obj/item/reagent_containers/food/snacks/cakeslice/brioche name = "brioche cake slice" @@ -184,10 +184,10 @@ name = "scotch egg" desc = "A boiled egg wrapped in a delicious, seasoned meatball." icon_state = "scotchegg" - bonus_reagents = list("nutriment" = 2, "vitamin" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2) bitesize = 3 filling_color = "#FFFFF0" - list_reagents = list("nutriment" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment = 6) /datum/crafting_recipe/food/scotchegg name = "Scotch egg" @@ -204,8 +204,8 @@ name = "Mammi" desc = "A bowl of mushy bread and milk. It reminds you, not too fondly, of a bowel movement." icon_state = "mammi" - bonus_reagents = list("nutriment" = 3, "vitamin" = 1) - list_reagents = list("nutriment" = 8, "vitamin" = 1) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 8, /datum/reagent/consumable/nutriment/vitamin = 1) /datum/crafting_recipe/food/mammi name = "Mammi" @@ -221,8 +221,8 @@ name = "chocolate bunny" desc = "Contains less than 10% real rabbit!" icon_state = "chocolatebunny" - bonus_reagents = list("nutriment" = 1, "vitamin" = 1) - list_reagents = list("nutriment" = 4, "sugar" = 2, "cocoa" = 2) + bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/consumable/nutriment/vitamin = 1) + list_reagents = list(/datum/reagent/consumable/nutriment = 4, /datum/reagent/consumable/sugar = 2, /datum/reagent/consumable/coco = 2) filling_color = "#A0522D" /datum/crafting_recipe/food/chocolatebunny diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm index bc0574bc..3cdd4798 100644 --- a/code/modules/holiday/halloween/jacqueen.dm +++ b/code/modules/holiday/halloween/jacqueen.dm @@ -105,7 +105,7 @@ last_poof = world.realtime var/datum/reagents/R = new/datum/reagents(100)//Hey, just in case. var/datum/effect_system/smoke_spread/chem/s = new() - R.add_reagent("secretcatchem", (10)) + R.add_reagent(/datum/reagent/fermi/secretcatchem, 10) s.set_up(R, 0, loc) s.start() visible_message("[src] disappears in a puff of smoke!") @@ -202,7 +202,7 @@ visible_message("[src] raises an eyebrown, \"It's 4 candies for that [gender]! Thems the rules!\"") return visible_message("[src] waves their arms around, \"Off comes your head, a pumpkin taking it's stead!\"") - C.reagents.add_reagent("pumpkinmutationtoxin", 5) + C.reagents.add_reagent(/datum/reagent/mutationtoxin/pumpkinhead, 5) sleep(20) poof() return @@ -365,7 +365,7 @@ C.equip_to_slot(jaqc_latern, SLOT_HEAD, 1, 1) if(4) visible_message("[src] waves their arms around, \"In your body there's something amiss, you'll find it's a chem made by my sis!\"") - C.reagents.add_reagent("eigenstate", 30) + C.reagents.add_reagent(/datum/reagent/fermi/eigenstate, 30) if(5) visible_message("[src] waves their arms around, \"A new familiar for me, and you'll see it's thee!\"") C.reagents.add_reagent("secretcatchem", 30) @@ -436,7 +436,6 @@ /datum/reagent/mutationtoxin/pumpkinhead name = "Pumpkin head mutation toxin" - id = "pumpkinmutationtoxin" race = /datum/species/dullahan/pumpkin mutationtext = "The pain subsides. You feel your head roll off your shoulders... and you smell pumpkin." //I couldn't get the replace head sprite with a pumpkin to work so, it is what it is. diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 3c4ed776..a058601c 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -65,7 +65,7 @@ var/datum/reagent/R = null if(random_reagent) R = pick(subtypesof(/datum/reagent)) - R = GLOB.chemical_reagents_list[initial(R.id)] + R = GLOB.chemical_reagents_list[R] queen_bee = new(src) queen_bee.beehome = src @@ -95,7 +95,7 @@ bee_resources = max(bee_resources-BEE_RESOURCE_HONEYCOMB_COST, 0) var/obj/item/reagent_containers/honeycomb/HC = new(src) if(queen_bee.beegent) - HC.set_reagent(queen_bee.beegent.id) + HC.set_reagent(queen_bee.beegent.type) honeycombs += HC if(bees.len < get_max_bees()) diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm index e7faff02..5bb2936c 100644 --- a/code/modules/hydroponics/beekeeping/honeycomb.dm +++ b/code/modules/hydroponics/beekeeping/honeycomb.dm @@ -9,7 +9,7 @@ disease_amount = 0 volume = 10 amount_per_transfer_from_this = 0 - list_reagents = list("honey" = 5) + list_reagents = list(/datum/reagent/consumable/honey = 5) grind_results = list() var/honey_color = "" @@ -31,10 +31,10 @@ /obj/item/reagent_containers/honeycomb/proc/set_reagent(reagent) var/datum/reagent/R = GLOB.chemical_reagents_list[reagent] - if(istype(R)) + if(R) name = "honeycomb ([R.name])" honey_color = R.color - reagents.add_reagent(R.id,5) + reagents.add_reagent(reagent,5) else honey_color = "" update_icon() \ No newline at end of file diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index b2267cc6..aaa9a03f 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -1,315 +1,315 @@ -/obj/machinery/biogenerator - name = "biogenerator" - desc = "Converts plants into biomass, which can be used to construct useful items." - icon = 'icons/obj/machines/biogenerator.dmi' - icon_state = "biogen-empty" - density = TRUE - use_power = IDLE_POWER_USE - idle_power_usage = 40 - circuit = /obj/item/circuitboard/machine/biogenerator - var/processing = FALSE - var/obj/item/reagent_containers/glass/beaker = null - var/points = 0 - var/menustat = "menu" - var/efficiency = 0 - var/productivity = 0 - var/max_items = 40 - var/datum/techweb/stored_research - var/list/show_categories = list("Food", "Botany Chemicals", "Organic Materials") - var/list/timesFiveCategories = list("Food", "Botany Chemicals") - -/obj/machinery/biogenerator/Initialize() - . = ..() - stored_research = new /datum/techweb/specialized/autounlocking/biogenerator - create_reagents(1000) - -/obj/machinery/biogenerator/Destroy() - QDEL_NULL(beaker) - return ..() - -/obj/machinery/biogenerator/contents_explosion(severity, target) - ..() - if(beaker) - beaker.ex_act(severity, target) - -/obj/machinery/biogenerator/handle_atom_del(atom/A) - ..() - if(A == beaker) - beaker = null - update_icon() - updateUsrDialog() - -/obj/machinery/biogenerator/RefreshParts() - var/E = 0 - var/P = 0 - var/max_storage = 40 - for(var/obj/item/stock_parts/matter_bin/B in component_parts) - P += B.rating - max_storage = 40 * B.rating - for(var/obj/item/stock_parts/manipulator/M in component_parts) - E += M.rating - efficiency = E - productivity = P - max_items = max_storage - -/obj/machinery/biogenerator/on_reagent_change(changetype) //When the reagents change, change the icon as well. - update_icon() - -/obj/machinery/biogenerator/update_icon() - if(panel_open) - icon_state = "biogen-empty-o" - else if(!src.beaker) - icon_state = "biogen-empty" - else if(!src.processing) - icon_state = "biogen-stand" - else - icon_state = "biogen-work" - return - -/obj/machinery/biogenerator/attackby(obj/item/O, mob/user, params) - if(user.a_intent == INTENT_HARM) - return ..() - - if(processing) - to_chat(user, "The biogenerator is currently processing.") - return - - if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O)) - if(beaker) - var/obj/item/reagent_containers/glass/B = beaker - B.forceMove(drop_location()) - beaker = null - update_icon() - return - - if(default_deconstruction_crowbar(O)) - return - - if(istype(O, /obj/item/reagent_containers/glass)) - . = 1 //no afterattack - if(!panel_open) - if(beaker) - to_chat(user, "A container is already loaded into the machine.") - else - if(!user.transferItemToLoc(O, src)) - return - beaker = O - to_chat(user, "You add the container to the machine.") - update_icon() - updateUsrDialog() - else - to_chat(user, "Close the maintenance panel first.") - return - - else if(istype(O, /obj/item/storage/bag/plants)) - var/obj/item/storage/bag/plants/PB = O - var/i = 0 - for(var/obj/item/reagent_containers/food/snacks/grown/G in contents) - i++ - if(i >= max_items) - to_chat(user, "The biogenerator is already full! Activate it.") - else - for(var/obj/item/reagent_containers/food/snacks/grown/G in PB.contents) - if(i >= max_items) - break - if(SEND_SIGNAL(PB, COMSIG_TRY_STORAGE_TAKE, G, src)) - i++ - if(iYou empty the plant bag into the biogenerator.") - else if(PB.contents.len == 0) - to_chat(user, "You empty the plant bag into the biogenerator, filling it to its capacity.") - else - to_chat(user, "You fill the biogenerator to its capacity.") - return TRUE //no afterattack - - else if(istype(O, /obj/item/reagent_containers/food/snacks/grown)) - var/i = 0 - for(var/obj/item/reagent_containers/food/snacks/grown/G in contents) - i++ - if(i >= max_items) - to_chat(user, "The biogenerator is full! Activate it.") - else - if(user.transferItemToLoc(O, src)) - to_chat(user, "You put [O.name] in [src.name]") - return TRUE //no afterattack - else if (istype(O, /obj/item/disk/design_disk)) - user.visible_message("[user] begins to load \the [O] in \the [src]...", - "You begin to load a design from \the [O]...", - "You hear the chatter of a floppy drive.") - processing = TRUE - var/obj/item/disk/design_disk/D = O - if(do_after(user, 10, target = src)) - for(var/B in D.blueprints) - if(B) - stored_research.add_design(B) - processing = FALSE - return TRUE - else - to_chat(user, "You cannot put this in [src.name]!") - -/obj/machinery/biogenerator/ui_interact(mob/user) - if(stat & BROKEN || panel_open) - return - . = ..() - var/dat - if(processing) - dat += "
    Biogenerator is processing! Please wait...

    " - else - switch(menustat) - if("nopoints") - dat += "
    You do not have enough biomass to create products.
    Please, put growns into reactor and activate it.
    " - menustat = "menu" - if("complete") - dat += "
    Operation complete.
    " - menustat = "menu" - if("void") - dat += "
    Error: No growns inside.
    Please, put growns into reactor.
    " - menustat = "menu" - if("nobeakerspace") - dat += "
    Not enough space left in container. Unable to create product.
    " - menustat = "menu" - if(beaker) - var/categories = show_categories.Copy() - for(var/V in categories) - categories[V] = list() - for(var/V in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[V] - for(var/C in categories) - if(C in D.category) - categories[C] += D - - dat += "
    Biomass: [points] units.

    " - dat += "ActivateDetach Container" - for(var/cat in categories) - dat += "

    [cat]:

    " - dat += "
    " - for(var/V in categories[cat]) - var/datum/design/D = V - dat += "[D.name]: Make" - if(cat in timesFiveCategories) - dat += "x5" - if(ispath(D.build_path, /obj/item/stack)) - dat += "x10" - dat += "([D.materials[MAT_BIOMASS]/efficiency])
    " - dat += "
    " - else - dat += "
    No container inside, please insert container.
    " - - var/datum/browser/popup = new(user, "biogen", name, 350, 520) - popup.set_content(dat) - popup.open() - -/obj/machinery/biogenerator/proc/activate() - if (usr.stat != CONSCIOUS) - return - if (src.stat != NONE) //NOPOWER etc - return - if(processing) - to_chat(usr, "The biogenerator is in the process of working.") - return - var/S = 0 - for(var/obj/item/reagent_containers/food/snacks/grown/I in contents) - S += 5 - if(I.reagents.get_reagent_amount("nutriment") < 0.1) - points += 1*productivity - else points += I.reagents.get_reagent_amount("nutriment")*10*productivity - qdel(I) - if(S) - processing = TRUE - update_icon() - updateUsrDialog() - playsound(src.loc, 'sound/machines/blender.ogg', 50, 1) - use_power(S*30) - sleep(S+15/productivity) - processing = FALSE - update_icon() - else - menustat = "void" - -/obj/machinery/biogenerator/proc/check_cost(list/materials, multiplier = 1, remove_points = 1) - if(materials.len != 1 || materials[1] != MAT_BIOMASS) - return FALSE - if (materials[MAT_BIOMASS]*multiplier/efficiency > points) - menustat = "nopoints" - return FALSE - else - if(remove_points) - points -= materials[MAT_BIOMASS]*multiplier/efficiency - update_icon() - updateUsrDialog() - return TRUE - -/obj/machinery/biogenerator/proc/check_container_volume(list/reagents, multiplier = 1) - var/sum_reagents = 0 - for(var/R in reagents) - sum_reagents += reagents[R] - sum_reagents *= multiplier - - if(beaker.reagents.total_volume + sum_reagents > beaker.reagents.maximum_volume) - menustat = "nobeakerspace" - return FALSE - - return TRUE - -/obj/machinery/biogenerator/proc/create_product(datum/design/D, amount) - if(!beaker || !loc) - return FALSE - - if(ispath(D.build_path, /obj/item/stack)) - if(!check_container_volume(D.make_reagents, amount)) - return FALSE - if(!check_cost(D.materials, amount)) - return FALSE - - new D.build_path(drop_location(), amount) - for(var/R in D.make_reagents) - beaker.reagents.add_reagent(R, D.make_reagents[R]*amount) - else - var/i = amount - while(i > 0) - if(!check_container_volume(D.make_reagents)) - return . - if(!check_cost(D.materials)) - return . - if(D.build_path) - new D.build_path(loc) - for(var/R in D.make_reagents) - beaker.reagents.add_reagent(R, D.make_reagents[R]) - . = 1 - --i - - menustat = "complete" - update_icon() - return . - -/obj/machinery/biogenerator/proc/detach() - if(beaker) - beaker.forceMove(drop_location()) - beaker = null - update_icon() - -/obj/machinery/biogenerator/Topic(href, href_list) - if(..() || panel_open) - return - - usr.set_machine(src) - - if(href_list["activate"]) - activate() - updateUsrDialog() - - else if(href_list["detach"]) - detach() - updateUsrDialog() - - else if(href_list["create"]) - var/amount = (text2num(href_list["amount"])) - //Can't be outside these (if you change this keep a sane limit) - amount = CLAMP(amount, 1, 50) - var/datum/design/D = locate(href_list["create"]) - create_product(D, amount) - updateUsrDialog() - - else if(href_list["menu"]) - menustat = "menu" - updateUsrDialog() +/obj/machinery/biogenerator + name = "biogenerator" + desc = "Converts plants into biomass, which can be used to construct useful items." + icon = 'icons/obj/machines/biogenerator.dmi' + icon_state = "biogen-empty" + density = TRUE + use_power = IDLE_POWER_USE + idle_power_usage = 40 + circuit = /obj/item/circuitboard/machine/biogenerator + var/processing = FALSE + var/obj/item/reagent_containers/glass/beaker = null + var/points = 0 + var/menustat = "menu" + var/efficiency = 0 + var/productivity = 0 + var/max_items = 40 + var/datum/techweb/stored_research + var/list/show_categories = list("Food", "Botany Chemicals", "Organic Materials") + var/list/timesFiveCategories = list("Food", "Botany Chemicals") + +/obj/machinery/biogenerator/Initialize() + . = ..() + stored_research = new /datum/techweb/specialized/autounlocking/biogenerator + create_reagents(1000) + +/obj/machinery/biogenerator/Destroy() + QDEL_NULL(beaker) + return ..() + +/obj/machinery/biogenerator/contents_explosion(severity, target) + ..() + if(beaker) + beaker.ex_act(severity, target) + +/obj/machinery/biogenerator/handle_atom_del(atom/A) + ..() + if(A == beaker) + beaker = null + update_icon() + updateUsrDialog() + +/obj/machinery/biogenerator/RefreshParts() + var/E = 0 + var/P = 0 + var/max_storage = 40 + for(var/obj/item/stock_parts/matter_bin/B in component_parts) + P += B.rating + max_storage = 40 * B.rating + for(var/obj/item/stock_parts/manipulator/M in component_parts) + E += M.rating + efficiency = E + productivity = P + max_items = max_storage + +/obj/machinery/biogenerator/on_reagent_change(changetype) //When the reagents change, change the icon as well. + update_icon() + +/obj/machinery/biogenerator/update_icon() + if(panel_open) + icon_state = "biogen-empty-o" + else if(!src.beaker) + icon_state = "biogen-empty" + else if(!src.processing) + icon_state = "biogen-stand" + else + icon_state = "biogen-work" + return + +/obj/machinery/biogenerator/attackby(obj/item/O, mob/user, params) + if(user.a_intent == INTENT_HARM) + return ..() + + if(processing) + to_chat(user, "The biogenerator is currently processing.") + return + + if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O)) + if(beaker) + var/obj/item/reagent_containers/glass/B = beaker + B.forceMove(drop_location()) + beaker = null + update_icon() + return + + if(default_deconstruction_crowbar(O)) + return + + if(istype(O, /obj/item/reagent_containers/glass)) + . = 1 //no afterattack + if(!panel_open) + if(beaker) + to_chat(user, "A container is already loaded into the machine.") + else + if(!user.transferItemToLoc(O, src)) + return + beaker = O + to_chat(user, "You add the container to the machine.") + update_icon() + updateUsrDialog() + else + to_chat(user, "Close the maintenance panel first.") + return + + else if(istype(O, /obj/item/storage/bag/plants)) + var/obj/item/storage/bag/plants/PB = O + var/i = 0 + for(var/obj/item/reagent_containers/food/snacks/grown/G in contents) + i++ + if(i >= max_items) + to_chat(user, "The biogenerator is already full! Activate it.") + else + for(var/obj/item/reagent_containers/food/snacks/grown/G in PB.contents) + if(i >= max_items) + break + if(SEND_SIGNAL(PB, COMSIG_TRY_STORAGE_TAKE, G, src)) + i++ + if(iYou empty the plant bag into the biogenerator.") + else if(PB.contents.len == 0) + to_chat(user, "You empty the plant bag into the biogenerator, filling it to its capacity.") + else + to_chat(user, "You fill the biogenerator to its capacity.") + return TRUE //no afterattack + + else if(istype(O, /obj/item/reagent_containers/food/snacks/grown)) + var/i = 0 + for(var/obj/item/reagent_containers/food/snacks/grown/G in contents) + i++ + if(i >= max_items) + to_chat(user, "The biogenerator is full! Activate it.") + else + if(user.transferItemToLoc(O, src)) + to_chat(user, "You put [O.name] in [src.name]") + return TRUE //no afterattack + else if (istype(O, /obj/item/disk/design_disk)) + user.visible_message("[user] begins to load \the [O] in \the [src]...", + "You begin to load a design from \the [O]...", + "You hear the chatter of a floppy drive.") + processing = TRUE + var/obj/item/disk/design_disk/D = O + if(do_after(user, 10, target = src)) + for(var/B in D.blueprints) + if(B) + stored_research.add_design(B) + processing = FALSE + return TRUE + else + to_chat(user, "You cannot put this in [src.name]!") + +/obj/machinery/biogenerator/ui_interact(mob/user) + if(stat & BROKEN || panel_open) + return + . = ..() + var/dat + if(processing) + dat += "
    Biogenerator is processing! Please wait...

    " + else + switch(menustat) + if("nopoints") + dat += "
    You do not have enough biomass to create products.
    Please, put growns into reactor and activate it.
    " + menustat = "menu" + if("complete") + dat += "
    Operation complete.
    " + menustat = "menu" + if("void") + dat += "
    Error: No growns inside.
    Please, put growns into reactor.
    " + menustat = "menu" + if("nobeakerspace") + dat += "
    Not enough space left in container. Unable to create product.
    " + menustat = "menu" + if(beaker) + var/categories = show_categories.Copy() + for(var/V in categories) + categories[V] = list() + for(var/V in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[V] + for(var/C in categories) + if(C in D.category) + categories[C] += D + + dat += "
    Biomass: [points] units.

    " + dat += "ActivateDetach Container" + for(var/cat in categories) + dat += "

    [cat]:

    " + dat += "
    " + for(var/V in categories[cat]) + var/datum/design/D = V + dat += "[D.name]: Make" + if(cat in timesFiveCategories) + dat += "x5" + if(ispath(D.build_path, /obj/item/stack)) + dat += "x10" + dat += "([D.materials[MAT_BIOMASS]/efficiency])
    " + dat += "
    " + else + dat += "
    No container inside, please insert container.
    " + + var/datum/browser/popup = new(user, "biogen", name, 350, 520) + popup.set_content(dat) + popup.open() + +/obj/machinery/biogenerator/proc/activate() + if (usr.stat != CONSCIOUS) + return + if (src.stat != NONE) //NOPOWER etc + return + if(processing) + to_chat(usr, "The biogenerator is in the process of working.") + return + var/S = 0 + for(var/obj/item/reagent_containers/food/snacks/grown/I in contents) + S += 5 + if(I.reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) < 0.1) + points += 1*productivity + else points += I.reagents.get_reagent_amount(/datum/reagent/consumable/nutriment)*10*productivity + qdel(I) + if(S) + processing = TRUE + update_icon() + updateUsrDialog() + playsound(src.loc, 'sound/machines/blender.ogg', 50, 1) + use_power(S*30) + sleep(S+15/productivity) + processing = FALSE + update_icon() + else + menustat = "void" + +/obj/machinery/biogenerator/proc/check_cost(list/materials, multiplier = 1, remove_points = 1) + if(materials.len != 1 || materials[1] != MAT_BIOMASS) + return FALSE + if (materials[MAT_BIOMASS]*multiplier/efficiency > points) + menustat = "nopoints" + return FALSE + else + if(remove_points) + points -= materials[MAT_BIOMASS]*multiplier/efficiency + update_icon() + updateUsrDialog() + return TRUE + +/obj/machinery/biogenerator/proc/check_container_volume(list/reagents, multiplier = 1) + var/sum_reagents = 0 + for(var/R in reagents) + sum_reagents += reagents[R] + sum_reagents *= multiplier + + if(beaker.reagents.total_volume + sum_reagents > beaker.reagents.maximum_volume) + menustat = "nobeakerspace" + return FALSE + + return TRUE + +/obj/machinery/biogenerator/proc/create_product(datum/design/D, amount) + if(!beaker || !loc) + return FALSE + + if(ispath(D.build_path, /obj/item/stack)) + if(!check_container_volume(D.make_reagents, amount)) + return FALSE + if(!check_cost(D.materials, amount)) + return FALSE + + new D.build_path(drop_location(), amount) + for(var/R in D.make_reagents) + beaker.reagents.add_reagent(R, D.make_reagents[R]*amount) + else + var/i = amount + while(i > 0) + if(!check_container_volume(D.make_reagents)) + return . + if(!check_cost(D.materials)) + return . + if(D.build_path) + new D.build_path(loc) + for(var/R in D.make_reagents) + beaker.reagents.add_reagent(R, D.make_reagents[R]) + . = 1 + --i + + menustat = "complete" + update_icon() + return . + +/obj/machinery/biogenerator/proc/detach() + if(beaker) + beaker.forceMove(drop_location()) + beaker = null + update_icon() + +/obj/machinery/biogenerator/Topic(href, href_list) + if(..() || panel_open) + return + + usr.set_machine(src) + + if(href_list["activate"]) + activate() + updateUsrDialog() + + else if(href_list["detach"]) + detach() + updateUsrDialog() + + else if(href_list["create"]) + var/amount = (text2num(href_list["amount"])) + //Can't be outside these (if you change this keep a sane limit) + amount = CLAMP(amount, 1, 50) + var/datum/design/D = locate(href_list["create"]) + create_product(D, amount) + updateUsrDialog() + + else if(href_list["menu"]) + menustat = "menu" + updateUsrDialog() diff --git a/code/modules/hydroponics/fermenting_barrel.dm b/code/modules/hydroponics/fermenting_barrel.dm index e9001322..ab6625b4 100644 --- a/code/modules/hydroponics/fermenting_barrel.dm +++ b/code/modules/hydroponics/fermenting_barrel.dm @@ -33,7 +33,7 @@ data["tastes"] = list(fruit.wine_flavor = 1) else data["tastes"] = list(fruit.tastes[1] = 1) - reagents.add_reagent("fruit_wine", amount, data) + reagents.add_reagent(/datum/reagent/consumable/ethanol/fruit_wine, amount, data) qdel(fruit) playsound(src, 'sound/effects/bubbles.ogg', 50, TRUE) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 6961a1cb..9dddb622 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -1,169 +1,169 @@ -// *********************************************************** -// Foods that are produced from hydroponics ~~~~~~~~~~ -// Data from the seeds carry over to these grown foods -// *********************************************************** - -// Base type. Subtypes are found in /grown dir. -/obj/item/reagent_containers/food/snacks/grown - icon = 'icons/obj/hydroponics/harvest.dmi' - var/obj/item/seeds/seed = null // type path, gets converted to item on New(). It's safe to assume it's always a seed item. - var/plantname = "" - var/bitesize_mod = 0 - var/splat_type = /obj/effect/decal/cleanable/plant_smudge - // If set, bitesize = 1 + round(reagents.total_volume / bitesize_mod) - dried_type = -1 - // Saves us from having to define each stupid grown's dried_type as itself. - // If you don't want a plant to be driable (watermelons) set this to null in the time definition. - resistance_flags = FLAMMABLE - var/dry_grind = FALSE //If TRUE, this object needs to be dry to be ground up - var/can_distill = TRUE //If FALSE, this object cannot be distilled into an alcohol. - var/distill_reagent //If NULL and this object can be distilled, it uses a generic fruit_wine reagent and adjusts its variables. - var/wine_flavor //If NULL, this is automatically set to the fruit's flavor. Determines the flavor of the wine if distill_reagent is NULL. - var/wine_power = 10 //Determines the boozepwr of the wine if distill_reagent is NULL. - -/obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, obj/item/seeds/new_seed) - . = ..() - if(!tastes) - tastes = list("[name]" = 1) - - if(new_seed) - seed = new_seed.Copy() - else if(ispath(seed)) - // This is for adminspawn or map-placed growns. They get the default stats of their seed type. - seed = new seed() - seed.adjust_potency(50-seed.potency) - - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - - if(dried_type == -1) - dried_type = src.type - - if(seed) - for(var/datum/plant_gene/trait/T in seed.genes) - T.on_new(src, loc) - seed.prepare_result(src) - transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency! - add_juice() - - - -/obj/item/reagent_containers/food/snacks/grown/proc/add_juice() - if(reagents) - if(bitesize_mod) - bitesize = 1 + round(reagents.total_volume / bitesize_mod) - return 1 - return 0 - -/obj/item/reagent_containers/food/snacks/grown/examine(user) - . = ..() - if(seed) - for(var/datum/plant_gene/trait/T in seed.genes) - if(T.examine_line) - . += T.examine_line - -/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/O, mob/user, params) - ..() - if (istype(O, /obj/item/plant_analyzer)) - var/msg = "*---------*\n This is \a [src].\n" - if(seed) - msg += seed.get_analyzer_text() - var/reag_txt = "" - if(seed) - for(var/reagent_id in seed.reagents_add) - var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] - var/amt = reagents.get_reagent_amount(reagent_id) - reag_txt += "\n- [R.name]: [amt]" - - if(reag_txt) - msg += reag_txt - msg += "
    *---------*" - to_chat(user, msg) - else - if(seed) - for(var/datum/plant_gene/trait/T in seed.genes) - T.on_attackby(src, O, user) - - -// Various gene procs -/obj/item/reagent_containers/food/snacks/grown/attack_self(mob/user) - if(seed && seed.get_gene(/datum/plant_gene/trait/squash)) - squash(user) - ..() - -/obj/item/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) - if(!..()) //was it caught by a mob? - if(seed) - for(var/datum/plant_gene/trait/T in seed.genes) - T.on_throw_impact(src, hit_atom) - if(seed.get_gene(/datum/plant_gene/trait/squash)) - squash(hit_atom) - -/obj/item/reagent_containers/food/snacks/grown/proc/squash(atom/target) - var/turf/T = get_turf(target) - if(ispath(splat_type, /obj/effect/decal/cleanable/plant_smudge)) - if(filling_color) - var/obj/O = new splat_type(T) - O.color = filling_color - O.name = "[name] smudge" - else if(splat_type) - new splat_type(T) - - if(trash) - generate_trash(T) - - visible_message("[src] has been squashed.","You hear a smack.") - if(seed) - for(var/datum/plant_gene/trait/trait in seed.genes) - trait.on_squash(src, target) - - reagents.reaction(T) - for(var/A in T) - reagents.reaction(A) - - qdel(src) - -/obj/item/reagent_containers/food/snacks/grown/On_Consume() - if(iscarbon(usr)) - if(seed) - for(var/datum/plant_gene/trait/T in seed.genes) - T.on_consume(src, usr) - ..() - -/obj/item/reagent_containers/food/snacks/grown/generate_trash(atom/location) - if(trash && (ispath(trash, /obj/item/grown) || ispath(trash, /obj/item/reagent_containers/food/snacks/grown))) - . = new trash(location, seed) - trash = null - return - return ..() - -/obj/item/reagent_containers/food/snacks/grown/grind_requirements() - if(dry_grind && !dry) - to_chat(usr, "[src] needs to be dry before it can be ground up!") - return - return TRUE - -/obj/item/reagent_containers/food/snacks/grown/on_grind() - var/nutriment = reagents.get_reagent_amount("nutriment") - if(grind_results&&grind_results.len) - for(var/i in 1 to grind_results.len) - grind_results[grind_results[i]] = nutriment - reagents.del_reagent("nutriment") - reagents.del_reagent("vitamin") - -/obj/item/reagent_containers/food/snacks/grown/on_juice() - var/nutriment = reagents.get_reagent_amount("nutriment") - if(juice_results&&juice_results.len) - for(var/i in 1 to juice_results.len) - juice_results[juice_results[i]] = nutriment - reagents.del_reagent("nutriment") - reagents.del_reagent("vitamin") - -// For item-containing growns such as eggy or gatfruit -/obj/item/reagent_containers/food/snacks/grown/shell/attack_self(mob/user) - var/obj/item/T - if(trash) - T = generate_trash() - qdel(src) - user.putItemFromInventoryInHandIfPossible(T, user.active_hand_index, TRUE) - to_chat(user, "You open [src]\'s shell, revealing \a [T].") +// *********************************************************** +// Foods that are produced from hydroponics ~~~~~~~~~~ +// Data from the seeds carry over to these grown foods +// *********************************************************** + +// Base type. Subtypes are found in /grown dir. +/obj/item/reagent_containers/food/snacks/grown + icon = 'icons/obj/hydroponics/harvest.dmi' + var/obj/item/seeds/seed = null // type path, gets converted to item on New(). It's safe to assume it's always a seed item. + var/plantname = "" + var/bitesize_mod = 0 + var/splat_type = /obj/effect/decal/cleanable/plant_smudge + // If set, bitesize = 1 + round(reagents.total_volume / bitesize_mod) + dried_type = -1 + // Saves us from having to define each stupid grown's dried_type as itself. + // If you don't want a plant to be driable (watermelons) set this to null in the time definition. + resistance_flags = FLAMMABLE + var/dry_grind = FALSE //If TRUE, this object needs to be dry to be ground up + var/can_distill = TRUE //If FALSE, this object cannot be distilled into an alcohol. + var/distill_reagent //If NULL and this object can be distilled, it uses a generic fruit_wine reagent and adjusts its variables. + var/wine_flavor //If NULL, this is automatically set to the fruit's flavor. Determines the flavor of the wine if distill_reagent is NULL. + var/wine_power = 10 //Determines the boozepwr of the wine if distill_reagent is NULL. + +/obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, obj/item/seeds/new_seed) + . = ..() + if(!tastes) + tastes = list("[name]" = 1) + + if(new_seed) + seed = new_seed.Copy() + else if(ispath(seed)) + // This is for adminspawn or map-placed growns. They get the default stats of their seed type. + seed = new seed() + seed.adjust_potency(50-seed.potency) + + pixel_x = rand(-5, 5) + pixel_y = rand(-5, 5) + + if(dried_type == -1) + dried_type = src.type + + if(seed) + for(var/datum/plant_gene/trait/T in seed.genes) + T.on_new(src, loc) + seed.prepare_result(src) + transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency! + add_juice() + + + +/obj/item/reagent_containers/food/snacks/grown/proc/add_juice() + if(reagents) + if(bitesize_mod) + bitesize = 1 + round(reagents.total_volume / bitesize_mod) + return 1 + return 0 + +/obj/item/reagent_containers/food/snacks/grown/examine(user) + . = ..() + if(seed) + for(var/datum/plant_gene/trait/T in seed.genes) + if(T.examine_line) + . += T.examine_line + +/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/O, mob/user, params) + ..() + if (istype(O, /obj/item/plant_analyzer)) + var/msg = "*---------*\n This is \a [src].\n" + if(seed) + msg += seed.get_analyzer_text() + var/reag_txt = "" + if(seed) + for(var/reagent_id in seed.reagents_add) + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] + var/amt = reagents.get_reagent_amount(reagent_id) + reag_txt += "\n- [R.name]: [amt]" + + if(reag_txt) + msg += reag_txt + msg += "
    *---------*" + to_chat(user, msg) + else + if(seed) + for(var/datum/plant_gene/trait/T in seed.genes) + T.on_attackby(src, O, user) + + +// Various gene procs +/obj/item/reagent_containers/food/snacks/grown/attack_self(mob/user) + if(seed && seed.get_gene(/datum/plant_gene/trait/squash)) + squash(user) + ..() + +/obj/item/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + if(!..()) //was it caught by a mob? + if(seed) + for(var/datum/plant_gene/trait/T in seed.genes) + T.on_throw_impact(src, hit_atom) + if(seed.get_gene(/datum/plant_gene/trait/squash)) + squash(hit_atom) + +/obj/item/reagent_containers/food/snacks/grown/proc/squash(atom/target) + var/turf/T = get_turf(target) + if(ispath(splat_type, /obj/effect/decal/cleanable/plant_smudge)) + if(filling_color) + var/obj/O = new splat_type(T) + O.color = filling_color + O.name = "[name] smudge" + else if(splat_type) + new splat_type(T) + + if(trash) + generate_trash(T) + + visible_message("[src] has been squashed.","You hear a smack.") + if(seed) + for(var/datum/plant_gene/trait/trait in seed.genes) + trait.on_squash(src, target) + + reagents.reaction(T) + for(var/A in T) + reagents.reaction(A) + + qdel(src) + +/obj/item/reagent_containers/food/snacks/grown/On_Consume() + if(iscarbon(usr)) + if(seed) + for(var/datum/plant_gene/trait/T in seed.genes) + T.on_consume(src, usr) + ..() + +/obj/item/reagent_containers/food/snacks/grown/generate_trash(atom/location) + if(trash && (ispath(trash, /obj/item/grown) || ispath(trash, /obj/item/reagent_containers/food/snacks/grown))) + . = new trash(location, seed) + trash = null + return + return ..() + +/obj/item/reagent_containers/food/snacks/grown/grind_requirements() + if(dry_grind && !dry) + to_chat(usr, "[src] needs to be dry before it can be ground up!") + return + return TRUE + +/obj/item/reagent_containers/food/snacks/grown/on_grind() + var/nutriment = reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) + if(grind_results&&grind_results.len) + for(var/i in 1 to grind_results.len) + grind_results[grind_results[i]] = nutriment + reagents.del_reagent(/datum/reagent/consumable/nutriment) + reagents.del_reagent(/datum/reagent/consumable/nutriment/vitamin) + +/obj/item/reagent_containers/food/snacks/grown/on_juice() + var/nutriment = reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) + if(juice_results&&juice_results.len) + for(var/i in 1 to juice_results.len) + juice_results[juice_results[i]] = nutriment + reagents.del_reagent(/datum/reagent/consumable/nutriment) + reagents.del_reagent(/datum/reagent/consumable/nutriment/vitamin) + +// For item-containing growns such as eggy or gatfruit +/obj/item/reagent_containers/food/snacks/grown/shell/attack_self(mob/user) + var/obj/item/T + if(trash) + T = generate_trash() + qdel(src) + user.putItemFromInventoryInHandIfPossible(T, user.active_hand_index, TRUE) + to_chat(user, "You open [src]\'s shell, revealing \a [T].") diff --git a/code/modules/hydroponics/grown/ambrosia.dm b/code/modules/hydroponics/grown/ambrosia.dm index a3b93db1..e8402520 100644 --- a/code/modules/hydroponics/grown/ambrosia.dm +++ b/code/modules/hydroponics/grown/ambrosia.dm @@ -25,7 +25,7 @@ icon_dead = "ambrosia-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/ambrosia/deus) - reagents_add = list("space_drugs" = 0.15, "bicaridine" = 0.1, "kelotane" = 0.1, "vitamin" = 0.04, "nutriment" = 0.05, "toxin" = 0.1) + reagents_add = list(/datum/reagent/drug/space_drugs = 0.15, /datum/reagent/medicine/bicaridine = 0.1, /datum/reagent/medicine/kelotane = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05, /datum/reagent/toxin = 0.1) /obj/item/reagent_containers/food/snacks/grown/ambrosia/vulgaris seed = /obj/item/seeds/ambrosia @@ -42,7 +42,7 @@ plantname = "Ambrosia Deus" product = /obj/item/reagent_containers/food/snacks/grown/ambrosia/deus mutatelist = list(/obj/item/seeds/ambrosia/gaia) - reagents_add = list("omnizine" = 0.15, "synaptizine" = 0.15, "space_drugs" = 0.1, "vitamin" = 0.04, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/medicine/omnizine = 0.15, /datum/reagent/medicine/synaptizine = 0.15, /datum/reagent/drug/space_drugs = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05) rarity = 40 /obj/item/reagent_containers/food/snacks/grown/ambrosia/deus @@ -62,7 +62,7 @@ plantname = "Ambrosia Gaia" product = /obj/item/reagent_containers/food/snacks/grown/ambrosia/gaia mutatelist = list(/obj/item/seeds/ambrosia/deus) - reagents_add = list("earthsblood" = 0.05, "nutriment" = 0.06, "vitamin" = 0.05) + reagents_add = list(/datum/reagent/medicine/earthsblood = 0.05, /datum/reagent/consumable/nutriment = 0.06, /datum/reagent/consumable/nutriment/vitamin = 0.05) rarity = 30 //These are some pretty good plants right here genes = list() weed_rate = 4 diff --git a/code/modules/hydroponics/grown/apple.dm b/code/modules/hydroponics/grown/apple.dm index 007c0b24..f8e58aee 100644 --- a/code/modules/hydroponics/grown/apple.dm +++ b/code/modules/hydroponics/grown/apple.dm @@ -14,7 +14,7 @@ icon_dead = "apple-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/apple/gold) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/apple seed = /obj/item/seeds/apple @@ -24,9 +24,9 @@ filling_color = "#FF4500" bitesize = 100 // Always eat the apple in one bite foodtype = FRUIT - juice_results = list("applejuice" = 0) + juice_results = list(/datum/reagent/consumable/applejuice = 0) tastes = list("apple" = 1) - distill_reagent = "hcider" + distill_reagent = /datum/reagent/consumable/ethanol/hcider // Gold Apple /obj/item/seeds/apple/gold @@ -39,7 +39,7 @@ maturation = 10 production = 10 mutatelist = list() - reagents_add = list("gold" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/gold = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 40 // Alchemy! /obj/item/reagent_containers/food/snacks/grown/apple/gold diff --git a/code/modules/hydroponics/grown/banana.dm b/code/modules/hydroponics/grown/banana.dm index 251d9de5..cc66e188 100644 --- a/code/modules/hydroponics/grown/banana.dm +++ b/code/modules/hydroponics/grown/banana.dm @@ -11,8 +11,8 @@ growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi' icon_dead = "banana-dead" genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest) - mutatelist = list(/obj/item/seeds/banana/mime, /obj/item/seeds/banana/bluespace) - reagents_add = list("banana" = 0.1, "potassium" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02) + mutatelist = list(/obj/item/seeds/banana/mime, /obj/item/seeds/banana/bluespace, /obj/item/seeds/banana/exotic_banana) + reagents_add = list(/datum/reagent/consumable/banana = 0.1, /datum/reagent/potassium = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.02) /obj/item/reagent_containers/food/snacks/grown/banana seed = /obj/item/seeds/banana @@ -24,8 +24,8 @@ filling_color = "#FFFF00" bitesize = 5 foodtype = FRUIT - juice_results = list("banana" = 0) - distill_reagent = "bananahonk" + juice_results = list(/datum/reagent/consumable/banana = 0) + distill_reagent = /datum/reagent/consumable/ethanol/bananahonk /obj/item/reagent_containers/food/snacks/grown/banana/suicide_act(mob/user) user.visible_message("[user] is aiming [src] at [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!") @@ -70,7 +70,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/banana/mime growthstages = 4 mutatelist = list() - reagents_add = list("nothing" = 0.1, "mutetoxin" = 0.1, "nutriment" = 0.02) + reagents_add = list(/datum/reagent/consumable/nothing = 0.1, /datum/reagent/toxin/mutetoxin = 0.1, /datum/reagent/consumable/nutriment = 0.02) rarity = 15 /obj/item/reagent_containers/food/snacks/grown/banana/mime @@ -80,7 +80,7 @@ icon_state = "mimana" trash = /obj/item/grown/bananapeel/mimanapeel filling_color = "#FFFFEE" - distill_reagent = "silencer" + distill_reagent = /datum/reagent/consumable/ethanol/silencer /obj/item/grown/bananapeel/mimanapeel seed = /obj/item/seeds/banana/mime @@ -100,7 +100,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/banana/bluespace mutatelist = list() genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/teleport, /datum/plant_gene/trait/repeated_harvest) - reagents_add = list("bluespace" = 0.2, "banana" = 0.1, "vitamin" = 0.04, "nutriment" = 0.02) + reagents_add = list(/datum/reagent/bluespace = 0.2, /datum/reagent/consumable/banana = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.02) rarity = 30 /obj/item/reagent_containers/food/snacks/grown/banana/bluespace diff --git a/code/modules/hydroponics/grown/beans.dm b/code/modules/hydroponics/grown/beans.dm index 4338e3b0..3e5fee41 100644 --- a/code/modules/hydroponics/grown/beans.dm +++ b/code/modules/hydroponics/grown/beans.dm @@ -15,7 +15,7 @@ icon_dead = "soybean-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/soya/koi) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05, "cooking_oil" = 0.03) //Vegetable oil! + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05, /datum/reagent/consumable/cooking_oil = 0.03) //Vegetable oil! /obj/item/reagent_containers/food/snacks/grown/soybeans seed = /obj/item/seeds/soya @@ -26,7 +26,7 @@ filling_color = "#F0E68C" bitesize_mod = 2 foodtype = VEGETABLES - grind_results = list("soymilk" = 0) + grind_results = list(/datum/reagent/consumable/soymilk = 0) tastes = list("soy" = 1) wine_power = 20 @@ -40,7 +40,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/koibeans potency = 10 mutatelist = list() - reagents_add = list("carpotoxin" = 0.1, "vitamin" = 0.04, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/toxin/carpotoxin = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/koibeans diff --git a/code/modules/hydroponics/grown/berries.dm b/code/modules/hydroponics/grown/berries.dm index 9b93bc57..ec7fcef6 100644 --- a/code/modules/hydroponics/grown/berries.dm +++ b/code/modules/hydroponics/grown/berries.dm @@ -15,7 +15,7 @@ icon_dead = "berry-dead" // Same for the dead icon genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/berry/glow, /obj/item/seeds/berry/poison) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/berries seed = /obj/item/seeds/berry @@ -26,9 +26,9 @@ filling_color = "#FF00FF" bitesize_mod = 2 foodtype = FRUIT - juice_results = list("berryjuice" = 0) + juice_results = list(/datum/reagent/consumable/berryjuice = 0) tastes = list("berry" = 1) - distill_reagent = "gin" + distill_reagent = /datum/reagent/consumable/ethanol/gin // Poison Berries /obj/item/seeds/berry/poison @@ -39,7 +39,7 @@ plantname = "Poison-Berry Bush" product = /obj/item/reagent_containers/food/snacks/grown/berries/poison mutatelist = list(/obj/item/seeds/berry/death) - reagents_add = list("cyanide" = 0.15, "tirizene" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/toxin/cyanide = 0.15, /datum/reagent/toxin/staminatoxin = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 10 // Mildly poisonous berries are common in reality /obj/item/reagent_containers/food/snacks/grown/berries/poison @@ -49,7 +49,7 @@ icon_state = "poisonberrypile" filling_color = "#C71585" foodtype = FRUIT | TOXIC - juice_results = list("poisonberryjuice" = 0) + juice_results = list(/datum/reagent/consumable/poisonberryjuice = 0) tastes = list("poison-berry" = 1) distill_reagent = null wine_power = 35 @@ -65,7 +65,7 @@ lifespan = 30 potency = 50 mutatelist = list() - reagents_add = list("coniine" = 0.08, "tirizene" = 0.1, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/toxin/coniine = 0.08, /datum/reagent/toxin/staminatoxin = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 30 /obj/item/reagent_containers/food/snacks/grown/berries/death @@ -90,8 +90,8 @@ lifespan = 30 endurance = 25 mutatelist = list() - genes = list(/datum/plant_gene/trait/glow/white , /datum/plant_gene/trait/noreact, /datum/plant_gene/trait/repeated_harvest) - reagents_add = list("uranium" = 0.25, "iodine" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + genes = list(/datum/plant_gene/trait/glow/white, /datum/plant_gene/trait/noreact, /datum/plant_gene/trait/repeated_harvest) + reagents_add = list(/datum/reagent/uranium = 0.25, /datum/reagent/iodine = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/berries/glow @@ -124,7 +124,7 @@ icon_harvest = "cherry-harvest" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/cherry/blue, /obj/item/seeds/cherry/bulb) - reagents_add = list("nutriment" = 0.07, "sugar" = 0.07) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.07, /datum/reagent/consumable/sugar = 0.07) /obj/item/reagent_containers/food/snacks/grown/cherries seed = /obj/item/seeds/cherry @@ -135,7 +135,7 @@ filling_color = "#FF0000" bitesize_mod = 2 foodtype = FRUIT - grind_results = list("cherryjelly" = 0) + grind_results = list(/datum/reagent/consumable/cherryjelly = 0) tastes = list("cherry" = 1) wine_power = 30 @@ -148,7 +148,7 @@ plantname = "Blue Cherry Tree" product = /obj/item/reagent_containers/food/snacks/grown/bluecherries mutatelist = list() - reagents_add = list("nutriment" = 0.07, "sugar" = 0.07) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.07, /datum/reagent/consumable/sugar = 0.07) rarity = 10 /obj/item/reagent_containers/food/snacks/grown/bluecherries @@ -159,7 +159,7 @@ filling_color = "#6495ED" bitesize_mod = 2 foodtype = FRUIT - grind_results = list("bluecherryjelly" = 0) + grind_results = list(/datum/reagent/consumable/bluecherryjelly = 0) tastes = list("blue cherry" = 1) wine_power = 50 @@ -173,7 +173,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/cherrybulbs genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/glow/pink) mutatelist = list() - reagents_add = list("nutriment" = 0.07, "sugar" = 0.07) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.07, /datum/reagent/consumable/sugar = 0.07) rarity = 10 /obj/item/reagent_containers/food/snacks/grown/cherrybulbs @@ -207,7 +207,7 @@ icon_dead = "grape-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/grape/green) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/sugar = 0.1) /obj/item/reagent_containers/food/snacks/grown/grapes seed = /obj/item/seeds/grape @@ -218,9 +218,9 @@ filling_color = "#FF1493" bitesize_mod = 2 foodtype = FRUIT - juice_results = list("grapejuice" = 0) + juice_results = list(/datum/reagent/consumable/grapejuice = 0) tastes = list("grape" = 1) - distill_reagent = "wine" + distill_reagent = /datum/reagent/consumable/ethanol/wine // Green Grapes /obj/item/seeds/grape/green @@ -230,7 +230,7 @@ species = "greengrape" plantname = "Green-Grape Vine" product = /obj/item/reagent_containers/food/snacks/grown/grapes/green - reagents_add = list("kelotane" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1, "sugar" = 0.1) + reagents_add = list(/datum/reagent/medicine/kelotane = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/sugar = 0.1) // No rarity: technically it's a beneficial mutant, but it's not exactly "new"... mutatelist = list() @@ -240,7 +240,7 @@ icon_state = "greengrapes" filling_color = "#7FFF00" tastes = list("green grape" = 1) - distill_reagent = "cognac" + distill_reagent = /datum/reagent/consumable/ethanol/cognac // Strawberry /obj/item/seeds/strawberry @@ -254,7 +254,7 @@ growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi' icon_grow = "strawberry-grow" icon_dead = "berry-dead" - reagents_add = list("vitamin" = 0.07, "nutriment" = 0.1, "sugar" = 0.2) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.07, /datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/sugar = 0.2) mutatelist = list() /obj/item/reagent_containers/food/snacks/grown/strawberry diff --git a/code/modules/hydroponics/grown/cannabis.dm b/code/modules/hydroponics/grown/cannabis.dm index 67c5e61d..a7e571d7 100644 --- a/code/modules/hydroponics/grown/cannabis.dm +++ b/code/modules/hydroponics/grown/cannabis.dm @@ -17,7 +17,7 @@ /obj/item/seeds/cannabis/death, /obj/item/seeds/cannabis/white, /obj/item/seeds/cannabis/ultimate) - reagents_add = list("space_drugs" = 0.15, "lipolicide" = 0.35) // gives u the munchies + reagents_add = list(/datum/reagent/drug/space_drugs = 0.15, /datum/reagent/toxin/lipolicide = 0.35) // gives u the munchies /obj/item/seeds/cannabis/rainbow @@ -28,7 +28,7 @@ plantname = "Rainbow Weed" product = /obj/item/reagent_containers/food/snacks/grown/cannabis/rainbow mutatelist = list() - reagents_add = list("mindbreaker" = 0.15, "lipolicide" = 0.35) + reagents_add = list(/datum/reagent/toxin/mindbreaker = 0.15, /datum/reagent/toxin/lipolicide = 0.35) rarity = 40 /obj/item/seeds/cannabis/death @@ -39,7 +39,7 @@ plantname = "Deathweed" product = /obj/item/reagent_containers/food/snacks/grown/cannabis/death mutatelist = list() - reagents_add = list("cyanide" = 0.35, "space_drugs" = 0.15, "lipolicide" = 0.15) + reagents_add = list(/datum/reagent/toxin/cyanide = 0.35, /datum/reagent/drug/space_drugs = 0.15, /datum/reagent/toxin/lipolicide = 0.15) rarity = 40 /obj/item/seeds/cannabis/white @@ -50,7 +50,7 @@ plantname = "Lifeweed" product = /obj/item/reagent_containers/food/snacks/grown/cannabis/white mutatelist = list() - reagents_add = list("omnizine" = 0.35, "space_drugs" = 0.15, "lipolicide" = 0.15) + reagents_add = list(/datum/reagent/medicine/omnizine = 0.35, /datum/reagent/drug/space_drugs = 0.15, /datum/reagent/toxin/lipolicide = 0.15) rarity = 40 @@ -62,21 +62,21 @@ plantname = "Omega Weed" product = /obj/item/reagent_containers/food/snacks/grown/cannabis/ultimate mutatelist = list() - reagents_add = list("space_drugs" = 0.3, - "mindbreaker" = 0.3, - "mercury" = 0.15, - "lithium" = 0.15, - "atropine" = 0.15, - "haloperidol" = 0.15, - "methamphetamine" = 0.15, - "capsaicin" = 0.15, - "barbers_aid" = 0.15, - "bath_salts" = 0.15, - "itching_powder" = 0.15, - "crank" = 0.15, - "krokodil" = 0.15, - "histamine" = 0.15, - "lipolicide" = 0.15) + reagents_add = list(/datum/reagent/drug/space_drugs = 0.3, + /datum/reagent/toxin/mindbreaker = 0.3, + /datum/reagent/mercury = 0.15, + /datum/reagent/lithium = 0.15, + /datum/reagent/medicine/atropine = 0.15, + /datum/reagent/medicine/haloperidol = 0.15, + /datum/reagent/drug/methamphetamine = 0.15, + /datum/reagent/consumable/capsaicin = 0.15, + /datum/reagent/barbers_aid = 0.15, + /datum/reagent/drug/bath_salts = 0.15, + /datum/reagent/toxin/itching_powder = 0.15, + /datum/reagent/drug/crank = 0.15, + /datum/reagent/drug/krokodil = 0.15, + /datum/reagent/toxin/histamine = 0.15, + /datum/reagent/toxin/lipolicide = 0.15) rarity = 69 diff --git a/code/modules/hydroponics/grown/cereals.dm b/code/modules/hydroponics/grown/cereals.dm index c53cd671..c5a7e079 100644 --- a/code/modules/hydroponics/grown/cereals.dm +++ b/code/modules/hydroponics/grown/cereals.dm @@ -11,7 +11,7 @@ potency = 15 icon_dead = "wheat-dead" mutatelist = list(/obj/item/seeds/wheat/oat, /obj/item/seeds/wheat/meat) - reagents_add = list("nutriment" = 0.04) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.04) /obj/item/reagent_containers/food/snacks/grown/wheat seed = /obj/item/seeds/wheat @@ -22,9 +22,9 @@ filling_color = "#F0E68C" bitesize_mod = 2 foodtype = GRAIN - grind_results = list("flour" = 0) + grind_results = list(/datum/reagent/consumable/flour = 0) tastes = list("wheat" = 1) - distill_reagent = "beer" + distill_reagent = /datum/reagent/consumable/ethanol/beer // Oat /obj/item/seeds/wheat/oat @@ -45,9 +45,9 @@ filling_color = "#556B2F" bitesize_mod = 2 foodtype = GRAIN - grind_results = list("flour" = 0) + grind_results = list(/datum/reagent/consumable/flour = 0) tastes = list("oat" = 1) - distill_reagent = "ale" + distill_reagent = /datum/reagent/consumable/ethanol/ale // Rice /obj/item/seeds/wheat/rice @@ -69,9 +69,9 @@ filling_color = "#FAFAD2" bitesize_mod = 2 foodtype = GRAIN - grind_results = list("rice" = 0) + grind_results = list(/datum/reagent/consumable/rice = 0) tastes = list("rice" = 1) - distill_reagent = "sake" + distill_reagent = /datum/reagent/consumable/ethanol/sake //Meatwheat - grows into synthetic meat /obj/item/seeds/wheat/meat @@ -92,7 +92,7 @@ bitesize_mod = 2 seed = /obj/item/seeds/wheat/meat foodtype = MEAT | GRAIN - grind_results = list("flour" = 0, "blood" = 0) + grind_results = list(/datum/reagent/consumable/flour = 0, /datum/reagent/blood = 0) tastes = list("meatwheat" = 1) can_distill = FALSE diff --git a/code/modules/hydroponics/grown/chili.dm b/code/modules/hydroponics/grown/chili.dm index 16675292..d48c5c10 100644 --- a/code/modules/hydroponics/grown/chili.dm +++ b/code/modules/hydroponics/grown/chili.dm @@ -16,7 +16,7 @@ icon_dead = "chili-dead" // Same for the dead icon genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/chili/ice, /obj/item/seeds/chili/ghost) - reagents_add = list("capsaicin" = 0.25, "vitamin" = 0.04, "nutriment" = 0.04) + reagents_add = list(/datum/reagent/consumable/capsaicin = 0.25, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.04) /obj/item/reagent_containers/food/snacks/grown/chili seed = /obj/item/seeds/chili @@ -41,7 +41,7 @@ production = 4 rarity = 20 mutatelist = list() - reagents_add = list("frostoil" = 0.25, "vitamin" = 0.02, "nutriment" = 0.02) + reagents_add = list(/datum/reagent/consumable/frostoil = 0.25, /datum/reagent/consumable/nutriment/vitamin = 0.02, /datum/reagent/consumable/nutriment = 0.02) /obj/item/reagent_containers/food/snacks/grown/icepepper seed = /obj/item/seeds/chili/ice @@ -67,7 +67,7 @@ yield = 3 rarity = 20 mutatelist = list() - reagents_add = list("condensedcapsaicin" = 0.3, "capsaicin" = 0.55, "nutriment" = 0.04) + reagents_add = list(/datum/reagent/consumable/condensedcapsaicin = 0.3, /datum/reagent/consumable/capsaicin = 0.55, /datum/reagent/consumable/nutriment = 0.04) /obj/item/reagent_containers/food/snacks/grown/ghost_chili seed = /obj/item/seeds/chili/ghost diff --git a/code/modules/hydroponics/grown/citrus.dm b/code/modules/hydroponics/grown/citrus.dm index 49cd2798..61c81aa2 100644 --- a/code/modules/hydroponics/grown/citrus.dm +++ b/code/modules/hydroponics/grown/citrus.dm @@ -23,7 +23,7 @@ growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi' genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/orange) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/citrus/lime seed = /obj/item/seeds/lime @@ -31,7 +31,7 @@ desc = "It's so sour, your face will twist." icon_state = "lime" filling_color = "#00FF00" - juice_results = list("limejuice" = 0) + juice_results = list(/datum/reagent/consumable/limejuice = 0) // Orange /obj/item/seeds/orange @@ -50,7 +50,7 @@ icon_dead = "lime-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/lime, /obj/item/seeds/orange_3d) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/citrus/orange seed = /obj/item/seeds/orange @@ -58,8 +58,8 @@ desc = "It's a tangy fruit." icon_state = "orange" filling_color = "#FFA500" - juice_results = list("orangejuice" = 0) - distill_reagent = "triple_sec" + juice_results = list(/datum/reagent/consumable/orangejuice = 0) + distill_reagent = /datum/reagent/consumable/ethanol/triple_sec //3D Orange /obj/item/seeds/orange_3d @@ -77,7 +77,7 @@ icon_grow = "lime-grow" icon_dead = "lime-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05, "haloperidol" = 0.15) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05, /datum/reagent/medicine/haloperidol = 0.15) /obj/item/reagent_containers/food/snacks/grown/citrus/orange_3d seed = /obj/item/seeds/orange @@ -85,8 +85,8 @@ desc = "You can hardly wrap your head around this thing." icon_state = "orang" filling_color = "#FFA500" - juice_results = list("orangejuice" = 0) - distill_reagent = "triple_sec" + juice_results = list(/datum/reagent/consumable/orangejuice = 0) + distill_reagent = /datum/reagent/consumable/ethanol/triple_sec tastes = list("polygons" = 1, "oranges" = 1) /obj/item/reagent_containers/food/snacks/grown/citrus/orange_3d/pickup(mob/user) @@ -112,7 +112,7 @@ icon_grow = "lime-grow" icon_dead = "lime-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/citrus/lemon seed = /obj/item/seeds/lemon @@ -120,7 +120,7 @@ desc = "When life gives you lemons, make lemonade." icon_state = "lemon" filling_color = "#FFD700" - juice_results = list("lemonjuice" = 0) + juice_results = list(/datum/reagent/consumable/lemonjuice = 0) // Combustible lemon /obj/item/seeds/firelemon //combustible lemon is too long so firelemon @@ -137,7 +137,7 @@ lifespan = 55 endurance = 45 yield = 4 - reagents_add = list("nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/firelemon seed = /obj/item/seeds/firelemon diff --git a/code/modules/hydroponics/grown/cocoa_vanilla.dm b/code/modules/hydroponics/grown/cocoa_vanilla.dm index a05c7869..4ea247f4 100644 --- a/code/modules/hydroponics/grown/cocoa_vanilla.dm +++ b/code/modules/hydroponics/grown/cocoa_vanilla.dm @@ -15,8 +15,8 @@ icon_grow = "cocoapod-grow" icon_dead = "cocoapod-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) - mutatelist = list(/obj/item/seeds/cocoapod/vanillapod,/obj/item/seeds/cocoapod/bungotree) - reagents_add = list("cocoa" = 0.25, "nutriment" = 0.1) + mutatelist = list(/obj/item/seeds/cocoapod/vanillapod, /obj/item/seeds/cocoapod/bungotree) + reagents_add = list(/datum/reagent/consumable/coco = 0.25, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/cocoapod seed = /obj/item/seeds/cocoapod @@ -27,7 +27,7 @@ bitesize_mod = 2 foodtype = FRUIT tastes = list("cocoa" = 1) - distill_reagent = "creme_de_cacao" + distill_reagent = /datum/reagent/consumable/ethanol/creme_de_cacao // Vanilla Pod /obj/item/seeds/cocoapod/vanillapod @@ -39,7 +39,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/vanillapod genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list() - reagents_add = list("vanilla" = 0.25, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/vanilla = 0.25, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/vanillapod seed = /obj/item/seeds/cocoapod/vanillapod @@ -49,7 +49,7 @@ filling_color = "#FFD700" foodtype = FRUIT tastes = list("vanilla" = 1) - distill_reagent = "vanilla" //Takes longer, but you can get even more vanilla from it. + distill_reagent = /datum/reagent/consumable/vanilla //Takes longer, but you can get even more vanilla from it. /obj/item/seeds/cocoapod/bungotree name = "pack of bungo tree seeds" @@ -64,7 +64,7 @@ production = 7 genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list() - reagents_add = list("enzyme" = 0.1, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/enzyme = 0.1, /datum/reagent/consumable/nutriment = 0.1) growthstages = 4 growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi' icon_grow = "bungotree-grow" @@ -79,6 +79,7 @@ trash = /obj/item/reagent_containers/food/snacks/grown/bungopit filling_color = "#E8C22F" foodtype = FRUIT + juice_results = list(/datum/reagent/consumable/bungojuice = 0) tastes = list("bungo" = 2, "tropical fruitiness" = 1) distill_reagent = null @@ -97,5 +98,5 @@ /obj/item/reagent_containers/food/snacks/grown/bungopit/Initialize() . =..() reagents.clear_reagents() - reagents.add_reagent("bungotoxin", seed.potency * 0.10) //More than this will kill at too low potency - reagents.add_reagent("nutriment", seed.potency * 0.04) \ No newline at end of file + reagents.add_reagent(/datum/reagent/toxin/bungotoxin, seed.potency * 0.10) //More than this will kill at too low potency + reagents.add_reagent(/datum/reagent/consumable/nutriment, seed.potency * 0.04) \ No newline at end of file diff --git a/code/modules/hydroponics/grown/corn.dm b/code/modules/hydroponics/grown/corn.dm index c259baaf..691cbb83 100644 --- a/code/modules/hydroponics/grown/corn.dm +++ b/code/modules/hydroponics/grown/corn.dm @@ -13,7 +13,7 @@ icon_grow = "corn-grow" // Uses one growth icons set for all the subtypes icon_dead = "corn-dead" // Same for the dead icon mutatelist = list(/obj/item/seeds/corn/snapcorn) - reagents_add = list("cornoil" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/cornoil = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/corn seed = /obj/item/seeds/corn @@ -25,9 +25,9 @@ trash = /obj/item/grown/corncob bitesize_mod = 2 foodtype = VEGETABLES - juice_results = list("corn_starch" = 0) + juice_results = list(/datum/reagent/consumable/corn_starch = 0) tastes = list("corn" = 1) - distill_reagent = "whiskey" + distill_reagent = /datum/reagent/consumable/ethanol/whiskey /obj/item/grown/corncob name = "corn cob" diff --git a/code/modules/hydroponics/grown/eggplant.dm b/code/modules/hydroponics/grown/eggplant.dm index 7c01a68f..f893ad9e 100644 --- a/code/modules/hydroponics/grown/eggplant.dm +++ b/code/modules/hydroponics/grown/eggplant.dm @@ -13,7 +13,7 @@ icon_dead = "eggplant-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/eggplant/eggy) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/eggplant seed = /obj/item/seeds/eggplant @@ -36,7 +36,7 @@ lifespan = 75 production = 12 mutatelist = list() - reagents_add = list("nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/shell/eggy seed = /obj/item/seeds/eggplant/eggy @@ -47,4 +47,4 @@ filling_color = "#F8F8FF" bitesize_mod = 2 foodtype = MEAT - distill_reagent = "eggnog" + distill_reagent = /datum/reagent/consumable/ethanol/eggnog diff --git a/code/modules/hydroponics/grown/flowers.dm b/code/modules/hydroponics/grown/flowers.dm index bf975a15..1646a401 100644 --- a/code/modules/hydroponics/grown/flowers.dm +++ b/code/modules/hydroponics/grown/flowers.dm @@ -15,7 +15,7 @@ icon_grow = "poppy-grow" icon_dead = "poppy-dead" mutatelist = list(/obj/item/seeds/poppy/geranium, /obj/item/seeds/poppy/lily) - reagents_add = list("bicaridine" = 0.2, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/medicine/bicaridine = 0.2, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/poppy seed = /obj/item/seeds/poppy @@ -27,7 +27,7 @@ bitesize_mod = 3 tastes = list("sesame seeds" = 1) foodtype = VEGETABLES | GROSS - distill_reagent = "vermouth" + distill_reagent = /datum/reagent/consumable/ethanol/vermouth // Lily /obj/item/seeds/poppy/lily @@ -69,7 +69,7 @@ icon_dead = "spacemanstrumpet-dead" mutatelist = list() genes = list(/datum/plant_gene/reagent/polypyr) - reagents_add = list("nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.05) rarity = 30 /obj/item/seeds/poppy/lily/trumpet/Initialize(mapload, nogenes = FALSE) @@ -121,7 +121,7 @@ growthstages = 4 genes = list(/datum/plant_gene/trait/plant_type/weed_hardy) growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi' - reagents_add = list("nutriment" = 0.04) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.04) /obj/item/reagent_containers/food/snacks/grown/harebell seed = /obj/item/seeds/harebell @@ -132,7 +132,7 @@ slot_flags = ITEM_SLOT_HEAD filling_color = "#E6E6FA" bitesize_mod = 3 - distill_reagent = "vermouth" + distill_reagent = /datum/reagent/consumable/ethanol/vermouth // Sunflower /obj/item/seeds/sunflower @@ -150,7 +150,7 @@ icon_grow = "sunflower-grow" icon_dead = "sunflower-dead" mutatelist = list(/obj/item/seeds/sunflower/moonflower, /obj/item/seeds/sunflower/novaflower) - reagents_add = list("cornoil" = 0.08, "nutriment" = 0.04) + reagents_add = list(/datum/reagent/consumable/cooking_oil = 0.08, /datum/reagent/consumable/nutriment = 0.04) /obj/item/grown/sunflower // FLOWER POWER! seed = /obj/item/seeds/sunflower @@ -186,7 +186,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/moonflower genes = list(/datum/plant_gene/trait/glow/purple) mutatelist = list() - reagents_add = list("moonshine" = 0.2, "vitamin" = 0.02, "nutriment" = 0.02) + reagents_add = list(/datum/reagent/consumable/ethanol/moonshine = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.02, /datum/reagent/consumable/nutriment = 0.02) rarity = 15 /obj/item/reagent_containers/food/snacks/grown/moonflower @@ -197,7 +197,7 @@ slot_flags = ITEM_SLOT_HEAD filling_color = "#E6E6FA" bitesize_mod = 2 - distill_reagent = "absinthe" //It's made from flowers. + distill_reagent = /datum/reagent/consumable/ethanol/absinthe //It's made from flowers. tastes = list("glowbugs" = 1) // Novaflower @@ -211,7 +211,7 @@ icon_dead = "sunflower-dead" product = /obj/item/grown/novaflower mutatelist = list() - reagents_add = list("condensedcapsaicin" = 0.25, "capsaicin" = 0.3, "nutriment" = 0) + reagents_add = list(/datum/reagent/consumable/condensedcapsaicin = 0.25, /datum/reagent/consumable/capsaicin = 0.3, /datum/reagent/consumable/nutriment = 0) rarity = 20 /obj/item/grown/novaflower @@ -229,7 +229,7 @@ throw_speed = 1 throw_range = 3 attack_verb = list("roasted", "scorched", "burned") - grind_results = list("capsaicin" = 0, "condensedcapsaicin" = 0) + grind_results = list(/datum/reagent/consumable/capsaicin = 0, /datum/reagent/consumable/condensedcapsaicin = 0) tastes = list("cooked sunflower" = 1) /obj/item/grown/novaflower/add_juice() @@ -279,7 +279,7 @@ icon_grow = "bee_balm-grow" icon_dead = "bee_balm-dead" mutatelist = list(/obj/item/seeds/poppy/geranium, /obj/item/seeds/bee_balm/honey) //Lower odds of becoming honey - reagents_add = list("spaceacillin" = 0.1, "sterilizine" = 0.05) + reagents_add = list(/datum/reagent/medicine/spaceacillin = 0.1, /datum/reagent/space_cleaner/sterilizine = 0.05) /obj/item/reagent_containers/food/snacks/grown/bee_balm seed = /obj/item/seeds/bee_balm @@ -307,7 +307,7 @@ growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi' icon_grow = "bee_balmalt-grow" icon_dead = "bee_balmalt-dead" - reagents_add = list("honey" = 0.1, "lye" = 0.3) //To make wax + reagents_add = list(/datum/reagent/consumable/honey = 0.1, /datum/reagent/lye = 0.3) //To make wax rarity = 30 /obj/item/reagent_containers/food/snacks/grown/bee_balm/honey diff --git a/code/modules/hydroponics/grown/grass_carpet.dm b/code/modules/hydroponics/grown/grass_carpet.dm index 08ce71ad..6b01eeb3 100644 --- a/code/modules/hydroponics/grown/grass_carpet.dm +++ b/code/modules/hydroponics/grown/grass_carpet.dm @@ -16,7 +16,7 @@ icon_dead = "grass-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/grass/carpet, /obj/item/seeds/grass/fairy) - reagents_add = list("nutriment" = 0.02, "hydrogen" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.02, /datum/reagent/hydrogen = 0.05) /obj/item/reagent_containers/food/snacks/grown/grass seed = /obj/item/seeds/grass @@ -51,7 +51,7 @@ icon_grow = "fairygrass-grow" icon_dead = "fairygrass-dead" genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/glow/blue) - reagents_add = list("nutriment" = 0.02, "hydrogen" = 0.05, "space_drugs" = 0.15) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.02, /datum/reagent/hydrogen = 0.05, /datum/reagent/drug/space_drugs = 0.15) /obj/item/reagent_containers/food/snacks/grown/grass/fairy seed = /obj/item/seeds/grass/fairy diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm index 6ceb6953..5f1fdcda 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -14,7 +14,7 @@ growthstages = 4 rarity = 30 var/list/mutations = list() - reagents_add = list("charcoal" = 0.04, "nutriment" = 0.02) + reagents_add = list(/datum/reagent/medicine/charcoal = 0.04, /datum/reagent/consumable/nutriment = 0.02) /obj/item/seeds/kudzu/Copy() var/obj/item/seeds/kudzu/S = ..() @@ -58,7 +58,7 @@ /obj/item/seeds/kudzu/on_chem_reaction(datum/reagents/S) var/list/temp_mut_list = list() - if(S.has_reagent("sterilizine", 5)) + if(S.has_reagent(/datum/reagent/space_cleaner/sterilizine, 5)) for(var/datum/spacevine_mutation/SM in mutations) if(SM.quality == NEGATIVE) temp_mut_list += SM @@ -66,7 +66,7 @@ mutations.Remove(pick(temp_mut_list)) temp_mut_list.Cut() - if(S.has_reagent("welding_fuel", 5)) + if(S.has_reagent(/datum/reagent/fuel, 5)) for(var/datum/spacevine_mutation/SM in mutations) if(SM.quality == POSITIVE) temp_mut_list += SM @@ -74,7 +74,7 @@ mutations.Remove(pick(temp_mut_list)) temp_mut_list.Cut() - if(S.has_reagent("phenol", 5)) + if(S.has_reagent(/datum/reagent/phenol, 5)) for(var/datum/spacevine_mutation/SM in mutations) if(SM.quality == MINOR_NEGATIVE) temp_mut_list += SM @@ -82,16 +82,16 @@ mutations.Remove(pick(temp_mut_list)) temp_mut_list.Cut() - if(S.has_reagent("blood", 15)) + if(S.has_reagent(/datum/reagent/blood, 15)) adjust_production(rand(15, -5)) - if(S.has_reagent("amatoxin", 5)) + if(S.has_reagent(/datum/reagent/toxin/amatoxin, 5)) adjust_production(rand(5, -15)) - if(S.has_reagent("plasma", 5)) + if(S.has_reagent(/datum/reagent/toxin/plasma, 5)) adjust_potency(rand(5, -15)) - if(S.has_reagent("holywater", 10)) + if(S.has_reagent(/datum/reagent/water/holywater, 10)) adjust_potency(rand(15, -5)) diff --git a/code/modules/hydroponics/grown/melon.dm b/code/modules/hydroponics/grown/melon.dm index cfd56d02..001997a7 100644 --- a/code/modules/hydroponics/grown/melon.dm +++ b/code/modules/hydroponics/grown/melon.dm @@ -12,7 +12,7 @@ icon_dead = "watermelon-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/watermelon/holy) - reagents_add = list("water" = 0.2, "vitamin" = 0.04, "nutriment" = 0.2) + reagents_add = list(/datum/reagent/water = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.2) /obj/item/seeds/watermelon/suicide_act(mob/user) user.visible_message("[user] is swallowing [src]! It looks like [user.p_theyre()] trying to commit suicide!") @@ -33,7 +33,7 @@ filling_color = "#008000" bitesize_mod = 3 foodtype = FRUIT - juice_results = list("watermelonjuice" = 0) + juice_results = list(/datum/reagent/consumable/watermelonjuice = 0) wine_power = 40 // Holymelon @@ -46,7 +46,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/holymelon genes = list(/datum/plant_gene/trait/glow/yellow) mutatelist = list() - reagents_add = list("holywater" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/water/holywater = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/holymelon diff --git a/code/modules/hydroponics/grown/misc.dm b/code/modules/hydroponics/grown/misc.dm index 55faff8c..606504e1 100644 --- a/code/modules/hydroponics/grown/misc.dm +++ b/code/modules/hydroponics/grown/misc.dm @@ -12,6 +12,7 @@ yield = 2 potency = 10 growthstages = 3 + grind_results = list(/datum/reagent/mustardgrind = 1) growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi' genes = list(/datum/plant_gene/trait/plant_type/weed_hardy) mutatelist = list()//add /obj/item/seeds/starthistle/corpse_flower when corpse flowers work. @@ -81,7 +82,7 @@ growing_icon = 'icons/obj/hydroponics/growing_flowers.dmi' genes = list(/datum/plant_gene/trait/plant_type/weed_hardy, /datum/plant_gene/trait/invasive) mutatelist = list() - reagents_add = list("nutriment" = 0.05, "silibinin" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.05, /datum/reagent/medicine/silibinin = 0.1) /obj/item/seeds/galaxythistle/Initialize(mapload, nogenes = FALSE) . = ..() @@ -116,7 +117,7 @@ growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi' genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/replicapod) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/cabbage seed = /obj/item/seeds/cabbage @@ -141,8 +142,8 @@ endurance = 50 maturation = 3 yield = 4 - growthstages = 3 - reagents_add = list("sugar" = 0.25) + growthstages = 2 + reagents_add = list(/datum/reagent/consumable/sugar = 0.25) mutatelist = list(/obj/item/seeds/bamboo) /obj/item/reagent_containers/food/snacks/grown/sugarcane @@ -153,7 +154,7 @@ filling_color = "#FFD700" bitesize_mod = 2 foodtype = VEGETABLES | SUGAR - distill_reagent = "rum" + distill_reagent = /datum/reagent/consumable/ethanol/rum // Gatfruit /obj/item/seeds/gatfruit @@ -173,7 +174,7 @@ growthstages = 2 rarity = 60 // Obtainable only with xenobio+superluck. growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi' - reagents_add = list("sulfur" = 0.1, "carbon" = 0.1, "nitrogen" = 0.07, "potassium" = 0.05) + reagents_add = list(/datum/reagent/sulfur = 0.1, /datum/reagent/carbon = 0.1, /datum/reagent/nitrogen = 0.07, /datum/reagent/potassium = 0.05) /obj/item/reagent_containers/food/snacks/grown/shell/gatfruit seed = /obj/item/seeds/gatfruit @@ -195,7 +196,7 @@ plantname = "Cherry Bomb Tree" product = /obj/item/reagent_containers/food/snacks/grown/cherry_bomb mutatelist = list() - reagents_add = list("nutriment" = 0.1, "sugar" = 0.1, "blackpowder" = 0.7) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/sugar = 0.1, /datum/reagent/blackpowder = 0.7) rarity = 60 //See above /obj/item/reagent_containers/food/snacks/grown/cherry_bomb @@ -257,7 +258,7 @@ icon_dead = "coconut-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) forbiddengenes = list(/datum/plant_gene/trait/squash, /datum/plant_gene/trait/stinging) - reagents_add = list("coconutmilk" = 0.3) + reagents_add = list(/datum/reagent/consumable/coconutmilk = 0.3) /obj/item/reagent_containers/food/snacks/grown/coconut seed = /obj/item/seeds/coconut @@ -427,21 +428,30 @@ to_chat(user, "[src] is empty!") return - if(istype(M)) - if(user.a_intent == INTENT_HARM && spillable == TRUE) - var/R - M.visible_message("[user] splashes the contents of [src] onto [M]!", \ - "[user] splashes the contents of [src] onto [M]!") - if(reagents) - for(var/datum/reagent/A in reagents.reagent_list) - R += A.id + " (" - R += num2text(A.volume) + ")," - if(isturf(target) && reagents.reagent_list.len && thrownby) - log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") - message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") - reagents.reaction(M, TOUCH) - log_combat(user, M, "splashed", R) - reagents.clear_reagents() + if(user.a_intent == INTENT_HARM && spillable) + var/R + M.visible_message("[user] splashes the contents of [src] onto [M]!", \ + "[user] splashes the contents of [src] onto [M]!") + if(reagents) + for(var/datum/reagent/A in reagents.reagent_list) + R += A.type + " (" + R += num2text(A.volume) + ")," + if(isturf(target) && reagents.reagent_list.len && thrownby) + log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") + message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") + reagents.reaction(M, TOUCH) + log_combat(user, M, "splashed", R) + reagents.clear_reagents() + else + if(M != user) + M.visible_message("[user] attempts to feed something to [M].", \ + "[user] attempts to feed something to you.") + if(!do_mob(user, M)) + return + if(!reagents || !reagents.total_volume) + return // The drink might be empty after the delay, such as by spam-feeding + M.visible_message("[user] feeds something to [M].", "[user] feeds something to you.") + log_combat(user, M, "fed", reagents.log_list()) else if(M != user) M.visible_message("[user] attempts to feed something to [M].", \ diff --git a/code/modules/hydroponics/grown/mushrooms.dm b/code/modules/hydroponics/grown/mushrooms.dm index ed54dc8a..3f61dcdf 100644 --- a/code/modules/hydroponics/grown/mushrooms.dm +++ b/code/modules/hydroponics/grown/mushrooms.dm @@ -21,7 +21,7 @@ growthstages = 4 genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' - reagents_add = list("morphine" = 0.35, "charcoal" = 0.35, "nutriment" = 0) + reagents_add = list(/datum/reagent/medicine/morphine = 0.35, /datum/reagent/medicine/charcoal = 0.35, /datum/reagent/consumable/nutriment = 0) /obj/item/reagent_containers/food/snacks/grown/mushroom/reishi seed = /obj/item/seeds/reishi @@ -47,7 +47,7 @@ genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' mutatelist = list(/obj/item/seeds/angel) - reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.35, "nutriment" = 0, "growthserum" = 0.1) + reagents_add = list(/datum/reagent/drug/mushroomhallucinogen = 0.04, /datum/reagent/toxin/amatoxin = 0.35, /datum/reagent/consumable/nutriment = 0, /datum/reagent/growthserum = 0.1) /obj/item/reagent_containers/food/snacks/grown/mushroom/amanita seed = /obj/item/seeds/amanita @@ -73,7 +73,7 @@ growthstages = 3 genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' - reagents_add = list("mushroomhallucinogen" = 0.04, "amatoxin" = 0.1, "nutriment" = 0, "amanitin" = 0.2) + reagents_add = list(/datum/reagent/drug/mushroomhallucinogen = 0.04, /datum/reagent/toxin/amatoxin = 0.1, /datum/reagent/consumable/nutriment = 0, /datum/reagent/toxin/amanitin = 0.2) rarity = 30 /obj/item/reagent_containers/food/snacks/grown/mushroom/angel @@ -99,7 +99,7 @@ growthstages = 3 genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' - reagents_add = list("mushroomhallucinogen" = 0.25, "nutriment" = 0.02) + reagents_add = list(/datum/reagent/drug/mushroomhallucinogen = 0.25, /datum/reagent/consumable/nutriment = 0.02) /obj/item/reagent_containers/food/snacks/grown/mushroom/libertycap seed = /obj/item/seeds/liberty @@ -125,7 +125,7 @@ genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' mutatelist = list(/obj/item/seeds/plump/walkingmushroom) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/mushroom/plumphelmet seed = /obj/item/seeds/plump @@ -133,7 +133,7 @@ desc = "Plumus Hellmus: Plump, soft and s-so inviting~" icon_state = "plumphelmet" filling_color = "#9370DB" - distill_reagent = "manlydorf" + distill_reagent = /datum/reagent/consumable/ethanol/manly_dorf // Walking Mushroom /obj/item/seeds/plump/walkingmushroom @@ -149,7 +149,7 @@ yield = 1 growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' mutatelist = list() - reagents_add = list("vitamin" = 0.05, "nutriment" = 0.15) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.05, /datum/reagent/consumable/nutriment = 0.15) rarity = 30 /obj/item/reagent_containers/food/snacks/grown/mushroom/walkingmushroom @@ -189,7 +189,7 @@ growthstages = 3 genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' - reagents_add = list("nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.1) mutatelist = list(/obj/item/seeds/chanterelle/jupitercup) /obj/item/reagent_containers/food/snacks/grown/mushroom/chanterelle @@ -214,7 +214,7 @@ growthstages = 2 genes = list(/datum/plant_gene/trait/plant_type/fungal_metabolism, /datum/plant_gene/reagent/teslium, /datum/plant_gene/trait/plant_type/carnivory) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' - reagents_add = list("nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.1) /obj/item/seeds/chanterelle/jupitercup/Initialize(mapload, nogenes = FALSE) . = ..() @@ -248,7 +248,7 @@ genes = list(/datum/plant_gene/trait/glow, /datum/plant_gene/trait/plant_type/fungal_metabolism) growing_icon = 'icons/obj/hydroponics/growing_mushrooms.dmi' mutatelist = list(/obj/item/seeds/glowshroom/glowcap, /obj/item/seeds/glowshroom/shadowshroom) - reagents_add = list("radium" = 0.1, "phosphorus" = 0.1, "nutriment" = 0.04) + reagents_add = list(/datum/reagent/radium = 0.1, /datum/reagent/phosphorus = 0.1, /datum/reagent/consumable/nutriment = 0.04) /obj/item/reagent_containers/food/snacks/grown/mushroom/glowshroom seed = /obj/item/seeds/glowshroom @@ -293,7 +293,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap genes = list(/datum/plant_gene/trait/glow/red, /datum/plant_gene/trait/cell_charge, /datum/plant_gene/trait/plant_type/fungal_metabolism) mutatelist = list() - reagents_add = list("teslium" = 0.1, "nutriment" = 0.04) + reagents_add = list(/datum/reagent/teslium = 0.1, /datum/reagent/consumable/nutriment = 0.04) rarity = 30 /obj/item/reagent_containers/food/snacks/grown/mushroom/glowshroom/glowcap @@ -318,7 +318,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/mushroom/glowshroom/shadowshroom genes = list(/datum/plant_gene/trait/glow/shadow, /datum/plant_gene/trait/plant_type/fungal_metabolism) mutatelist = list() - reagents_add = list("radium" = 0.2, "nutriment" = 0.04) + reagents_add = list(/datum/reagent/radium = 0.2, /datum/reagent/consumable/nutriment = 0.04) rarity = 30 /obj/item/reagent_containers/food/snacks/grown/mushroom/glowshroom/shadowshroom @@ -350,7 +350,7 @@ potency = 15 growthstages = 3 rarity = 20 - reagents_add = list("nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment = 0.1) resistance_flags = FIRE_PROOF /obj/item/seeds/lavaland/polypore diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm index dbcce283..c3bd82c6 100644 --- a/code/modules/hydroponics/grown/nettle.dm +++ b/code/modules/hydroponics/grown/nettle.dm @@ -11,7 +11,7 @@ growthstages = 5 genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/plant_type/weed_hardy) mutatelist = list(/obj/item/seeds/nettle/death) - reagents_add = list("sacid" = 0.5) + reagents_add = list(/datum/reagent/toxin/acid = 0.5) /obj/item/seeds/nettle/death name = "pack of death-nettle seeds" @@ -25,7 +25,7 @@ yield = 2 genes = list(/datum/plant_gene/trait/repeated_harvest, /datum/plant_gene/trait/plant_type/weed_hardy, /datum/plant_gene/trait/stinging) mutatelist = list() - reagents_add = list("facid" = 0.5, "sacid" = 0.5) + reagents_add = list(/datum/reagent/toxin/acid/fluacid = 0.5, /datum/reagent/toxin/acid = 0.5) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/nettle // "snack" diff --git a/code/modules/hydroponics/grown/onion.dm b/code/modules/hydroponics/grown/onion.dm index 9cb8d1a6..2ebaa6d5 100644 --- a/code/modules/hydroponics/grown/onion.dm +++ b/code/modules/hydroponics/grown/onion.dm @@ -13,7 +13,7 @@ growthstages = 3 weed_chance = 3 growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi' - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) mutatelist = list(/obj/item/seeds/onion/red) /obj/item/reagent_containers/food/snacks/grown/onion @@ -36,7 +36,7 @@ plantname = "Red Onion Sprouts" weed_chance = 1 product = /obj/item/reagent_containers/food/snacks/grown/onion/red - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1, "tearjuice" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/tearjuice = 0.05) /obj/item/reagent_containers/food/snacks/grown/onion/red seed = /obj/item/seeds/onion/red @@ -61,7 +61,7 @@ name = "onion slices" desc = "Rings, not for wearing." icon_state = "onionslice" - list_reagents = list("nutriment" = 5, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 2) filling_color = "#C0C9A0" gender = PLURAL cooked_type = /obj/item/reagent_containers/food/snacks/onionrings @@ -71,4 +71,4 @@ desc = "They shine like exceptionally low quality amethyst." icon_state = "onionslice_red" filling_color = "#C29ACF" - list_reagents = list("nutriment" = 5, "vitamin" = 2, "tearjuice" = 2.5) + list_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/tearjuice = 2.5) diff --git a/code/modules/hydroponics/grown/peach.dm b/code/modules/hydroponics/grown/peach.dm index 6fbf933b..1f48ab55 100644 --- a/code/modules/hydroponics/grown/peach.dm +++ b/code/modules/hydroponics/grown/peach.dm @@ -13,7 +13,7 @@ icon_grow = "peach-grow" icon_dead = "peach-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/peach seed = /obj/item/seeds/peach @@ -23,5 +23,5 @@ filling_color = "#FF4500" bitesize = 25 foodtype = FRUIT - juice_results = list("peachjuice" = 0) + juice_results = list(/datum/reagent/consumable/peachjuice = 0) tastes = list("peach" = 1) diff --git a/code/modules/hydroponics/grown/peanuts.dm b/code/modules/hydroponics/grown/peanuts.dm index 2423300c..3ac14971 100644 --- a/code/modules/hydroponics/grown/peanuts.dm +++ b/code/modules/hydroponics/grown/peanuts.dm @@ -8,7 +8,7 @@ yield = 6 growthstages = 4 growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi' - reagents_add = list("vitamin" = 0.02, "nutriment" = 0.15, "cooking_oil" = 0.03) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.02, /datum/reagent/consumable/nutriment = 0.15, /datum/reagent/consumable/cooking_oil = 0.03) /obj/item/reagent_containers/food/snacks/grown/peanut seed = /obj/item/seeds/peanutseed @@ -26,5 +26,5 @@ desc = "A handful of roasted peanuts, with or without salt." icon_state = "roasted_peanuts" foodtype = VEGETABLES - list_reagents = list("nutriment" = 6, "vitamin" = 1) - juice_results = list("peanut_butter" = 3) \ No newline at end of file + list_reagents = list(/datum/reagent/consumable/nutriment = 6, /datum/reagent/consumable/nutriment/vitamin = 1) + juice_results = list(/datum/reagent/consumable/peanut_butter = 3) \ No newline at end of file diff --git a/code/modules/hydroponics/grown/pineapple.dm b/code/modules/hydroponics/grown/pineapple.dm index 0ca4242c..7dc25392 100644 --- a/code/modules/hydroponics/grown/pineapple.dm +++ b/code/modules/hydroponics/grown/pineapple.dm @@ -12,7 +12,7 @@ growing_icon = 'icons/obj/hydroponics/growing_fruits.dmi' genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/apple) - reagents_add = list("vitamin" = 0.02, "nutriment" = 0.2, "water" = 0.04) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.02, /datum/reagent/consumable/nutriment = 0.2, /datum/reagent/water = 0.04) /obj/item/reagent_containers/food/snacks/grown/pineapple seed = /obj/item/seeds/pineapple diff --git a/code/modules/hydroponics/grown/potato.dm b/code/modules/hydroponics/grown/potato.dm index 15378b36..20f2a357 100644 --- a/code/modules/hydroponics/grown/potato.dm +++ b/code/modules/hydroponics/grown/potato.dm @@ -16,7 +16,7 @@ icon_dead = "potato-dead" genes = list(/datum/plant_gene/trait/battery) mutatelist = list(/obj/item/seeds/potato/sweet) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/potato seed = /obj/item/seeds/potato @@ -26,8 +26,8 @@ filling_color = "#E9967A" bitesize = 100 foodtype = VEGETABLES - juice_results = list("potato" = 0) - distill_reagent = "vodka" + juice_results = list(/datum/reagent/consumable/potato_juice = 0) + distill_reagent = /datum/reagent/consumable/ethanol/vodka /obj/item/reagent_containers/food/snacks/grown/potato/wedges name = "potato wedges" @@ -57,11 +57,11 @@ plantname = "Sweet Potato Plants" product = /obj/item/reagent_containers/food/snacks/grown/potato/sweet mutatelist = list() - reagents_add = list("vitamin" = 0.1, "sugar" = 0.1, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.1, /datum/reagent/consumable/sugar = 0.1, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/potato/sweet seed = /obj/item/seeds/potato/sweet name = "sweet potato" desc = "It's sweet." icon_state = "sweetpotato" - distill_reagent = "sbiten" + distill_reagent = /datum/reagent/consumable/ethanol/sbiten diff --git a/code/modules/hydroponics/grown/pumpkin.dm b/code/modules/hydroponics/grown/pumpkin.dm index 644dedff..e26d1c1d 100644 --- a/code/modules/hydroponics/grown/pumpkin.dm +++ b/code/modules/hydroponics/grown/pumpkin.dm @@ -14,7 +14,7 @@ icon_dead = "pumpkin-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/pumpkin/blumpkin) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.2) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.2) /obj/item/reagent_containers/food/snacks/grown/pumpkin seed = /obj/item/seeds/pumpkin @@ -24,7 +24,7 @@ filling_color = "#FFA500" bitesize_mod = 2 foodtype = FRUIT - juice_results = list("pumpkinjuice" = 0) + juice_results = list(/datum/reagent/consumable/pumpkinjuice = 0) wine_power = 20 /obj/item/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/W as obj, mob/user as mob, params) @@ -45,7 +45,7 @@ plantname = "Blumpkin Vines" product = /obj/item/reagent_containers/food/snacks/grown/blumpkin mutatelist = list() - reagents_add = list("ammonia" = 0.2, "chlorine" = 0.1, "nutriment" = 0.2) + reagents_add = list(/datum/reagent/ammonia = 0.2, /datum/reagent/chlorine = 0.1, /datum/reagent/consumable/nutriment = 0.2) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/blumpkin @@ -56,5 +56,5 @@ filling_color = "#87CEFA" bitesize_mod = 2 foodtype = FRUIT - juice_results = list("blumpkinjuice" = 0) + juice_results = list(/datum/reagent/consumable/blumpkinjuice = 0) wine_power = 50 diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm index bac480be..3769f9ea 100644 --- a/code/modules/hydroponics/grown/replicapod.dm +++ b/code/modules/hydroponics/grown/replicapod.dm @@ -31,7 +31,7 @@ /obj/item/seeds/replicapod/on_reagent_change(changetype) if(changetype == ADD_REAGENT) - var/datum/reagent/blood/B = reagents.has_reagent("blood") + var/datum/reagent/blood/B = reagents.has_reagent(/datum/reagent/blood) if(B) if(B.data["mind"] && B.data["cloneable"]) mind = B.data["mind"] @@ -47,7 +47,7 @@ else visible_message("The [src] rejects the sample!") - if(!reagents.has_reagent("blood")) + if(!reagents.has_reagent(/datum/reagent/blood)) mind = null ckey = null realName = null diff --git a/code/modules/hydroponics/grown/root.dm b/code/modules/hydroponics/grown/root.dm index 090809ca..871d1535 100644 --- a/code/modules/hydroponics/grown/root.dm +++ b/code/modules/hydroponics/grown/root.dm @@ -12,7 +12,7 @@ growthstages = 3 growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi' mutatelist = list(/obj/item/seeds/carrot/parsnip) - reagents_add = list("oculine" = 0.25, "vitamin" = 0.04, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/medicine/oculine = 0.25, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/carrot seed = /obj/item/seeds/carrot @@ -22,7 +22,7 @@ filling_color = "#FFA500" bitesize_mod = 2 foodtype = VEGETABLES - juice_results = list("carrotjuice" = 0) + juice_results = list(/datum/reagent/consumable/carrotjuice = 0) wine_power = 30 /obj/item/reagent_containers/food/snacks/grown/carrot/attackby(obj/item/I, mob/user, params) @@ -45,7 +45,7 @@ product = /obj/item/reagent_containers/food/snacks/grown/parsnip icon_dead = "carrot-dead" mutatelist = list() - reagents_add = list("vitamin" = 0.05, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.05, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/parsnip seed = /obj/item/seeds/carrot/parsnip @@ -54,7 +54,7 @@ icon_state = "parsnip" bitesize_mod = 2 foodtype = VEGETABLES - juice_results = list("parsnipjuice" = 0) + juice_results = list(/datum/reagent/consumable/parsnipjuice = 0) wine_power = 35 @@ -72,7 +72,7 @@ growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi' icon_dead = "whitebeet-dead" mutatelist = list(/obj/item/seeds/redbeet) - reagents_add = list("vitamin" = 0.04, "sugar" = 0.2, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/sugar = 0.2, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/whitebeet seed = /obj/item/seeds/whitebeet @@ -98,7 +98,7 @@ growing_icon = 'icons/obj/hydroponics/growing_vegetables.dmi' icon_dead = "whitebeet-dead" genes = list(/datum/plant_gene/trait/maxchem) - reagents_add = list("vitamin" = 0.05, "nutriment" = 0.05) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.05, /datum/reagent/consumable/nutriment = 0.05) /obj/item/reagent_containers/food/snacks/grown/redbeet seed = /obj/item/seeds/redbeet diff --git a/code/modules/hydroponics/grown/tea_coffee.dm b/code/modules/hydroponics/grown/tea_coffee.dm index c9e2bc6a..2c518770 100644 --- a/code/modules/hydroponics/grown/tea_coffee.dm +++ b/code/modules/hydroponics/grown/tea_coffee.dm @@ -14,7 +14,7 @@ icon_dead = "tea-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/tea/astra) - reagents_add = list("teapowder" = 0.1) + reagents_add = list(/datum/reagent/toxin/teapowder = 0.1) /obj/item/reagent_containers/food/snacks/grown/tea seed = /obj/item/seeds/tea @@ -22,7 +22,7 @@ desc = "These aromatic tips of the tea plant can be dried to make tea." icon_state = "tea_aspera_leaves" filling_color = "#008000" - grind_results = list("teapowder" = 0) + grind_results = list(/datum/reagent/toxin/teapowder = 0) dry_grind = TRUE can_distill = FALSE @@ -34,7 +34,7 @@ plantname = "Tea Astra Plant" product = /obj/item/reagent_containers/food/snacks/grown/tea/astra mutatelist = list(/obj/item/seeds/tea/catnip) - reagents_add = list("synaptizine" = 0.1, "vitamin" = 0.04, "teapowder" = 0.1) + reagents_add = list(/datum/reagent/medicine/synaptizine = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/toxin/teapowder = 0.1) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/tea/astra @@ -42,7 +42,7 @@ name = "Tea Astra tips" icon_state = "tea_astra_leaves" filling_color = "#4582B4" - grind_results = list("teapowder" = 0, "salglu_solution" = 0) + grind_results = list(/datum/reagent/toxin/teapowder = 0, /datum/reagent/medicine/salglu_solution = 0) // Kitty drugs @@ -53,7 +53,7 @@ species = "catnip" plantname = "Catnip Plant" product = /obj/item/reagent_containers/food/snacks/grown/tea/catnip - reagents_add = list("catnip" = 0.1, "vitamin" = 0.06, "teapowder" = 0.3) + reagents_add = list(/datum/reagent/pax/catnip = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.06, /datum/reagent/toxin/teapowder = 0.3) rarity = 50 /obj/item/reagent_containers/food/snacks/grown/tea/catnip @@ -61,7 +61,8 @@ name = "Catnip buds" icon_state = "catnip" filling_color = "#4582B4" - grind_results = list("catnp" = 2, "water" = 1) + grind_results = list(/datum/reagent/pax/catnip = 2, /datum/reagent/water = 1) + // Coffee /obj/item/seeds/coffee name = "pack of coffee arabica seeds" @@ -79,7 +80,7 @@ icon_dead = "coffee-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/coffee/robusta) - reagents_add = list("vitamin" = 0.04, "coffeepowder" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/toxin/coffeepowder = 0.1) /obj/item/reagent_containers/food/snacks/grown/coffee seed = /obj/item/seeds/coffee @@ -89,8 +90,8 @@ filling_color = "#DC143C" bitesize_mod = 2 dry_grind = TRUE - grind_results = list("coffeepowder" = 0) - distill_reagent = "kahlua" + grind_results = list(/datum/reagent/toxin/coffeepowder = 0) + distill_reagent = /datum/reagent/consumable/ethanol/kahlua // Coffee Robusta /obj/item/seeds/coffee/robusta @@ -101,7 +102,7 @@ plantname = "Coffee Robusta Bush" product = /obj/item/reagent_containers/food/snacks/grown/coffee/robusta mutatelist = list() - reagents_add = list("ephedrine" = 0.1, "vitamin" = 0.04, "coffeepowder" = 0.1) + reagents_add = list(/datum/reagent/medicine/ephedrine = 0.1, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/toxin/coffeepowder = 0.1) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/coffee/robusta @@ -109,4 +110,4 @@ name = "coffee robusta beans" desc = "Increases robustness by 37 percent!" icon_state = "coffee_robusta" - grind_results = list("coffeepowder" = 0, "morphine" = 0) + grind_results = list(/datum/reagent/toxin/coffeepowder = 0, /datum/reagent/medicine/morphine = 0) diff --git a/code/modules/hydroponics/grown/tobacco.dm b/code/modules/hydroponics/grown/tobacco.dm index 684271fa..1e2d25d8 100644 --- a/code/modules/hydroponics/grown/tobacco.dm +++ b/code/modules/hydroponics/grown/tobacco.dm @@ -13,7 +13,7 @@ growthstages = 3 icon_dead = "tobacco-dead" mutatelist = list(/obj/item/seeds/tobacco/space) - reagents_add = list("nicotine" = 0.03, "nutriment" = 0.03) + reagents_add = list(/datum/reagent/drug/nicotine = 0.03, /datum/reagent/consumable/nutriment = 0.03) /obj/item/reagent_containers/food/snacks/grown/tobacco seed = /obj/item/seeds/tobacco @@ -21,7 +21,7 @@ desc = "Dry them out to make some smokes." icon_state = "tobacco_leaves" filling_color = "#008000" - distill_reagent = "creme_de_menthe" //Menthol, I guess. + distill_reagent = /datum/reagent/consumable/ethanol/creme_de_menthe //Menthol, I guess. // Space Tobacco /obj/item/seeds/tobacco/space @@ -32,7 +32,7 @@ plantname = "Space Tobacco Plant" product = /obj/item/reagent_containers/food/snacks/grown/tobacco/space mutatelist = list() - reagents_add = list("salbutamol" = 0.05, "nicotine" = 0.08, "nutriment" = 0.03) + reagents_add = list(/datum/reagent/medicine/salbutamol = 0.05, /datum/reagent/drug/nicotine = 0.08, /datum/reagent/consumable/nutriment = 0.03) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/tobacco/space diff --git a/code/modules/hydroponics/grown/tomato.dm b/code/modules/hydroponics/grown/tomato.dm index d07f5d4d..53c33896 100644 --- a/code/modules/hydroponics/grown/tomato.dm +++ b/code/modules/hydroponics/grown/tomato.dm @@ -12,7 +12,7 @@ icon_dead = "tomato-dead" genes = list(/datum/plant_gene/trait/squash, /datum/plant_gene/trait/repeated_harvest) mutatelist = list(/obj/item/seeds/tomato/blue, /obj/item/seeds/tomato/blood, /obj/item/seeds/tomato/killer) - reagents_add = list("vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) /obj/item/reagent_containers/food/snacks/grown/tomato seed = /obj/item/seeds/tomato @@ -23,9 +23,9 @@ filling_color = "#FF6347" bitesize_mod = 2 foodtype = FRUIT - grind_results = list("ketchup" = 0) - juice_results = list("tomatojuice" = 0) - distill_reagent = "enzyme" + grind_results = list(/datum/reagent/consumable/ketchup = 0) + juice_results = list(/datum/reagent/consumable/tomatojuice = 0) + distill_reagent = /datum/reagent/consumable/enzyme // Blood Tomato /obj/item/seeds/tomato/blood @@ -36,7 +36,7 @@ plantname = "Blood-Tomato Plants" product = /obj/item/reagent_containers/food/snacks/grown/tomato/blood mutatelist = list() - reagents_add = list("blood" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/blood = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/tomato/blood @@ -47,8 +47,8 @@ splat_type = /obj/effect/gibspawner/generic filling_color = "#FF0000" foodtype = FRUIT | GROSS - grind_results = list("ketchup" = 0, "blood" = 0) - distill_reagent = "bloodymary" + grind_results = list(/datum/reagent/consumable/ketchup = 0, /datum/reagent/blood = 0) + distill_reagent = /datum/reagent/consumable/ethanol/bloody_mary // Blue Tomato /obj/item/seeds/tomato/blue @@ -62,7 +62,7 @@ icon_grow = "bluetomato-grow" mutatelist = list(/obj/item/seeds/tomato/blue/bluespace) genes = list(/datum/plant_gene/trait/slip, /datum/plant_gene/trait/repeated_harvest) - reagents_add = list("lube" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/lube = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 20 /obj/item/reagent_containers/food/snacks/grown/tomato/blue @@ -72,7 +72,7 @@ icon_state = "bluetomato" splat_type = /obj/effect/decal/cleanable/oil filling_color = "#0000FF" - distill_reagent = "laughter" + distill_reagent = /datum/reagent/consumable/laughter // Bluespace Tomato /obj/item/seeds/tomato/blue/bluespace @@ -85,7 +85,7 @@ yield = 2 mutatelist = list() genes = list(/datum/plant_gene/trait/squash, /datum/plant_gene/trait/slip, /datum/plant_gene/trait/teleport, /datum/plant_gene/trait/repeated_harvest) - reagents_add = list("lube" = 0.2, "bluespace" = 0.2, "vitamin" = 0.04, "nutriment" = 0.1) + reagents_add = list(/datum/reagent/lube = 0.2, /datum/reagent/bluespace = 0.2, /datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1) rarity = 50 /obj/item/reagent_containers/food/snacks/grown/tomato/blue/bluespace @@ -120,7 +120,7 @@ icon_state = "killertomato" var/awakening = 0 filling_color = "#FF0000" - distill_reagent = "demonsblood" + distill_reagent = /datum/reagent/consumable/ethanol/demonsblood /obj/item/reagent_containers/food/snacks/grown/tomato/killer/attack(mob/M, mob/user, def_zone) if(awakening) diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm index ea56ed60..9655b138 100644 --- a/code/modules/hydroponics/hydroitemdefines.dm +++ b/code/modules/hydroponics/hydroitemdefines.dm @@ -1,195 +1,195 @@ -// Plant analyzer -/obj/item/plant_analyzer - name = "plant analyzer" - desc = "A scanner used to evaluate a plant's various areas of growth." - icon = 'icons/obj/device.dmi' - icon_state = "hydro" - item_state = "analyzer" - lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - w_class = WEIGHT_CLASS_TINY - slot_flags = ITEM_SLOT_BELT - materials = list(MAT_METAL=30, MAT_GLASS=20) - -// ************************************* -// Hydroponics Tools -// ************************************* - -/obj/item/reagent_containers/spray/weedspray // -- Skie - desc = "It's a toxic mixture, in spray form, to kill small weeds." - icon = 'icons/obj/hydroponics/equipment.dmi' - name = "weed spray" - icon_state = "weedspray" - item_state = "spraycan" - lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' - volume = 100 - list_reagents = list("weedkiller" = 100) - -/obj/item/reagent_containers/spray/weedspray/suicide_act(mob/user) - user.visible_message("[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (TOXLOSS) - -/obj/item/reagent_containers/spray/pestspray // -- Skie - desc = "It's some pest eliminator spray! Do not inhale!" - icon = 'icons/obj/hydroponics/equipment.dmi' - name = "pest spray" - icon_state = "pestspray" - item_state = "plantbgone" - lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' - volume = 100 - list_reagents = list("pestkiller" = 100) - -/obj/item/reagent_containers/spray/pestspray/suicide_act(mob/user) - user.visible_message("[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (TOXLOSS) - -/obj/item/cultivator - name = "cultivator" - desc = "It's used for removing weeds or scratching your back." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "cultivator" - item_state = "cultivator" - lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' - flags_1 = CONDUCT_1 - force = 5 - throwforce = 7 - w_class = WEIGHT_CLASS_SMALL - materials = list(MAT_METAL=50) - attack_verb = list("slashed", "sliced", "cut", "clawed") - hitsound = 'sound/weapons/bladeslice.ogg' - -/obj/item/cultivator/suicide_act(mob/user) - user.visible_message("[user] is scratching [user.p_their()] back as hard as [user.p_they()] can with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (BRUTELOSS) - -/obj/item/hatchet - name = "hatchet" - desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "hatchet" - item_state = "hatchet" - lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' - flags_1 = CONDUCT_1 - force = 12 - w_class = WEIGHT_CLASS_SMALL - throwforce = 15 - throw_speed = 3 - throw_range = 4 - materials = list(MAT_METAL = 15000) - attack_verb = list("chopped", "torn", "cut") - hitsound = 'sound/weapons/bladeslice.ogg' - sharpness = IS_SHARP - -/obj/item/hatchet/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 70, 100) - -/obj/item/hatchet/suicide_act(mob/user) - user.visible_message("[user] is chopping at [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - playsound(src, 'sound/weapons/bladeslice.ogg', 50, 1, -1) - return (BRUTELOSS) - -/obj/item/scythe - icon_state = "scythe0" - lefthand_file = 'icons/mob/inhands/weapons/polearms_lefthand.dmi' - righthand_file = 'icons/mob/inhands/weapons/polearms_righthand.dmi' - name = "scythe" - desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow." - force = 13 - throwforce = 5 - throw_speed = 2 - throw_range = 3 - w_class = WEIGHT_CLASS_BULKY - flags_1 = CONDUCT_1 - armour_penetration = 20 - slot_flags = ITEM_SLOT_BACK - attack_verb = list("chopped", "sliced", "cut", "reaped") - hitsound = 'sound/weapons/bladeslice.ogg' - var/swiping = FALSE - -/obj/item/scythe/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 90, 105) - -/obj/item/scythe/suicide_act(mob/user) - user.visible_message("[user] is beheading [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - if(iscarbon(user)) - var/mob/living/carbon/C = user - var/obj/item/bodypart/BP = C.get_bodypart(BODY_ZONE_HEAD) - if(BP) - BP.drop_limb() - playsound(src,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1) - return (BRUTELOSS) - -/obj/item/scythe/pre_attack(atom/A, mob/living/user, params) - if(swiping || !istype(A, /obj/structure/spacevine) || get_turf(A) == get_turf(user)) - return ..() - else - var/turf/user_turf = get_turf(user) - var/dir_to_target = get_dir(user_turf, get_turf(A)) - var/stam_gain = 0 - swiping = TRUE - var/static/list/scythe_slash_angles = list(0, 45, 90, -45, -90) - for(var/i in scythe_slash_angles) - var/turf/T = get_step(user_turf, turn(dir_to_target, i)) - for(var/obj/structure/spacevine/V in T) - if(user.Adjacent(V)) - melee_attack_chain(user, V) - stam_gain += 5 //should be hitcost - swiping = FALSE - stam_gain += 2 //Initial hitcost - user.adjustStaminaLoss(-stam_gain) - -// ************************************* -// Nutrient defines for hydroponics -// ************************************* - - -/obj/item/reagent_containers/glass/bottle/nutrient - name = "bottle of nutrient" - volume = 50 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(1,2,5,10,15,25,50) - -/obj/item/reagent_containers/glass/bottle/nutrient/Initialize() - . = ..() - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - - -/obj/item/reagent_containers/glass/bottle/nutrient/ez - name = "bottle of E-Z-Nutrient" - desc = "Contains a fertilizer that causes mild mutations with each harvest." - list_reagents = list("eznutriment" = 50) - -/obj/item/reagent_containers/glass/bottle/nutrient/l4z - name = "bottle of Left 4 Zed" - desc = "Contains a fertilizer that limits plant yields to no more than one and causes significant mutations in plants." - list_reagents = list("left4zednutriment" = 50) - -/obj/item/reagent_containers/glass/bottle/nutrient/rh - name = "bottle of Robust Harvest" - desc = "Contains a fertilizer that increases the yield of a plant by 30% while causing no mutations." - list_reagents = list("robustharvestnutriment" = 50) - -/obj/item/reagent_containers/glass/bottle/nutrient/empty - name = "bottle" - -/obj/item/reagent_containers/glass/bottle/killer - volume = 50 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(1,2,5,10,15,25,50) - -/obj/item/reagent_containers/glass/bottle/killer/weedkiller - name = "bottle of weed killer" - desc = "Contains a herbicide." - list_reagents = list("weedkiller" = 50) - -/obj/item/reagent_containers/glass/bottle/killer/pestkiller - name = "bottle of pest spray" - desc = "Contains a pesticide." - list_reagents = list("pestkiller" = 50) \ No newline at end of file +// Plant analyzer +/obj/item/plant_analyzer + name = "plant analyzer" + desc = "A scanner used to evaluate a plant's various areas of growth." + icon = 'icons/obj/device.dmi' + icon_state = "hydro" + item_state = "analyzer" + lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' + w_class = WEIGHT_CLASS_TINY + slot_flags = ITEM_SLOT_BELT + materials = list(MAT_METAL=30, MAT_GLASS=20) + +// ************************************* +// Hydroponics Tools +// ************************************* + +/obj/item/reagent_containers/spray/weedspray // -- Skie + desc = "It's a toxic mixture, in spray form, to kill small weeds." + icon = 'icons/obj/hydroponics/equipment.dmi' + name = "weed spray" + icon_state = "weedspray" + item_state = "spraycan" + lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' + volume = 100 + list_reagents = list(/datum/reagent/toxin/plantbgone/weedkiller = 100) + +/obj/item/reagent_containers/spray/weedspray/suicide_act(mob/user) + user.visible_message("[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (TOXLOSS) + +/obj/item/reagent_containers/spray/pestspray // -- Skie + desc = "It's some pest eliminator spray! Do not inhale!" + icon = 'icons/obj/hydroponics/equipment.dmi' + name = "pest spray" + icon_state = "pestspray" + item_state = "plantbgone" + lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' + volume = 100 + list_reagents = list(/datum/reagent/toxin/pestkiller = 100) + +/obj/item/reagent_containers/spray/pestspray/suicide_act(mob/user) + user.visible_message("[user] is huffing [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (TOXLOSS) + +/obj/item/cultivator + name = "cultivator" + desc = "It's used for removing weeds or scratching your back." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "cultivator" + item_state = "cultivator" + lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' + flags_1 = CONDUCT_1 + force = 5 + throwforce = 7 + w_class = WEIGHT_CLASS_SMALL + materials = list(MAT_METAL=50) + attack_verb = list("slashed", "sliced", "cut", "clawed") + hitsound = 'sound/weapons/bladeslice.ogg' + +/obj/item/cultivator/suicide_act(mob/user) + user.visible_message("[user] is scratching [user.p_their()] back as hard as [user.p_they()] can with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (BRUTELOSS) + +/obj/item/hatchet + name = "hatchet" + desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "hatchet" + item_state = "hatchet" + lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' + flags_1 = CONDUCT_1 + force = 12 + w_class = WEIGHT_CLASS_SMALL + throwforce = 15 + throw_speed = 3 + throw_range = 4 + materials = list(MAT_METAL = 15000) + attack_verb = list("chopped", "torn", "cut") + hitsound = 'sound/weapons/bladeslice.ogg' + sharpness = IS_SHARP + +/obj/item/hatchet/Initialize() + . = ..() + AddComponent(/datum/component/butchering, 70, 100) + +/obj/item/hatchet/suicide_act(mob/user) + user.visible_message("[user] is chopping at [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + playsound(src, 'sound/weapons/bladeslice.ogg', 50, 1, -1) + return (BRUTELOSS) + +/obj/item/scythe + icon_state = "scythe0" + lefthand_file = 'icons/mob/inhands/weapons/polearms_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/polearms_righthand.dmi' + name = "scythe" + desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow." + force = 13 + throwforce = 5 + throw_speed = 2 + throw_range = 3 + w_class = WEIGHT_CLASS_BULKY + flags_1 = CONDUCT_1 + armour_penetration = 20 + slot_flags = ITEM_SLOT_BACK + attack_verb = list("chopped", "sliced", "cut", "reaped") + hitsound = 'sound/weapons/bladeslice.ogg' + var/swiping = FALSE + +/obj/item/scythe/Initialize() + . = ..() + AddComponent(/datum/component/butchering, 90, 105) + +/obj/item/scythe/suicide_act(mob/user) + user.visible_message("[user] is beheading [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + if(iscarbon(user)) + var/mob/living/carbon/C = user + var/obj/item/bodypart/BP = C.get_bodypart(BODY_ZONE_HEAD) + if(BP) + BP.drop_limb() + playsound(src,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1) + return (BRUTELOSS) + +/obj/item/scythe/pre_attack(atom/A, mob/living/user, params) + if(swiping || !istype(A, /obj/structure/spacevine) || get_turf(A) == get_turf(user)) + return ..() + else + var/turf/user_turf = get_turf(user) + var/dir_to_target = get_dir(user_turf, get_turf(A)) + var/stam_gain = 0 + swiping = TRUE + var/static/list/scythe_slash_angles = list(0, 45, 90, -45, -90) + for(var/i in scythe_slash_angles) + var/turf/T = get_step(user_turf, turn(dir_to_target, i)) + for(var/obj/structure/spacevine/V in T) + if(user.Adjacent(V)) + melee_attack_chain(user, V) + stam_gain += 5 //should be hitcost + swiping = FALSE + stam_gain += 2 //Initial hitcost + user.adjustStaminaLoss(-stam_gain) + +// ************************************* +// Nutrient defines for hydroponics +// ************************************* + + +/obj/item/reagent_containers/glass/bottle/nutrient + name = "bottle of nutrient" + volume = 50 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(1,2,5,10,15,25,50) + +/obj/item/reagent_containers/glass/bottle/nutrient/Initialize() + . = ..() + pixel_x = rand(-5, 5) + pixel_y = rand(-5, 5) + + +/obj/item/reagent_containers/glass/bottle/nutrient/ez + name = "bottle of E-Z-Nutrient" + desc = "Contains a fertilizer that causes mild mutations with each harvest." + list_reagents = list(/datum/reagent/plantnutriment/eznutriment = 50) + +/obj/item/reagent_containers/glass/bottle/nutrient/l4z + name = "bottle of Left 4 Zed" + desc = "Contains a fertilizer that limits plant yields to no more than one and causes significant mutations in plants." + list_reagents = list(/datum/reagent/plantnutriment/left4zednutriment = 50) + +/obj/item/reagent_containers/glass/bottle/nutrient/rh + name = "bottle of Robust Harvest" + desc = "Contains a fertilizer that increases the yield of a plant by 30% while causing no mutations." + list_reagents = list(/datum/reagent/plantnutriment/robustharvestnutriment = 50) + +/obj/item/reagent_containers/glass/bottle/nutrient/empty + name = "bottle" + +/obj/item/reagent_containers/glass/bottle/killer + volume = 50 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(1,2,5,10,15,25,50) + +/obj/item/reagent_containers/glass/bottle/killer/weedkiller + name = "bottle of weed killer" + desc = "Contains a herbicide." + list_reagents = list(/datum/reagent/toxin/plantbgone/weedkiller = 50) + +/obj/item/reagent_containers/glass/bottle/killer/pestkiller + name = "bottle of pest spray" + desc = "Contains a pesticide." + list_reagents = list(/datum/reagent/toxin/pestkiller = 50) \ No newline at end of file diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 3167c495..9c594260 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -1,947 +1,947 @@ -/obj/machinery/hydroponics - name = "hydroponics tray" - icon = 'icons/obj/hydroponics/equipment.dmi' - icon_state = "hydrotray" - density = TRUE - pixel_z = 8 - obj_flags = CAN_BE_HIT | UNIQUE_RENAME - circuit = /obj/item/circuitboard/machine/hydroponics - var/waterlevel = 100 //The amount of water in the tray (max 100) - var/maxwater = 100 //The maximum amount of water in the tray - var/nutrilevel = 10 //The amount of nutrient in the tray (max 10) - var/maxnutri = 10 //The maximum nutrient of water in the tray - var/pestlevel = 0 //The amount of pests in the tray (max 10) - var/weedlevel = 0 //The amount of weeds in the tray (max 10) - var/yieldmod = 1 //Nutriment's effect on yield - var/mutmod = 1 //Nutriment's effect on mutations - var/toxic = 0 //Toxicity in the tray? - var/age = 0 //Current age - var/dead = 0 //Is it dead? - var/plant_health //Its health - var/lastproduce = 0 //Last time it was harvested - var/lastcycle = 0 //Used for timing of cycles. - var/cycledelay = 200 //About 10 seconds / cycle - var/harvest = 0 //Ready to harvest? - var/obj/item/seeds/myseed = null //The currently planted seed - var/rating = 1 - var/unwrenchable = 1 - var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant - var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses - var/self_sufficiency_req = 20 //Required total dose to make a self-sufficient hydro tray. 1:1 with earthsblood. - var/self_sufficiency_progress = 0 - var/self_sustaining = FALSE //If the tray generates nutrients and water on its own - - -/obj/machinery/hydroponics/constructable - name = "hydroponics tray" - icon = 'icons/obj/hydroponics/equipment.dmi' - icon_state = "hydrotray3" - -/obj/machinery/hydroponics/constructable/RefreshParts() - var/tmp_capacity = 0 - for (var/obj/item/stock_parts/matter_bin/M in component_parts) - tmp_capacity += M.rating - for (var/obj/item/stock_parts/manipulator/M in component_parts) - rating = M.rating - maxwater = tmp_capacity * 50 // Up to 300 - maxnutri = tmp_capacity * 5 // Up to 30 - -/obj/machinery/hydroponics/Destroy() - if(myseed) - qdel(myseed) - myseed = null - return ..() - -/obj/machinery/hydroponics/constructable/attackby(obj/item/I, mob/user, params) - if (user.a_intent != INTENT_HARM) - // handle opening the panel - if(default_deconstruction_screwdriver(user, icon_state, icon_state, I)) - return - - // handle deconstructing the machine, if permissible - if (I.tool_behaviour == TOOL_CROWBAR && using_irrigation) - to_chat(user, "Disconnect the hoses first!") - return - else if(default_deconstruction_crowbar(I)) - return - - return ..() - -/obj/machinery/hydroponics/proc/FindConnected() - var/list/connected = list() - var/list/processing_atoms = list(src) - - while(processing_atoms.len) - var/atom/a = processing_atoms[1] - for(var/step_dir in GLOB.cardinals) - var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir) - // Soil plots aren't dense - if(h && h.using_irrigation && h.density && !(h in connected) && !(h in processing_atoms)) - processing_atoms += h - - processing_atoms -= a - connected += a - - return connected - - -/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables. - if(!myseed) - return ..() - if(istype(Proj , /obj/item/projectile/energy/floramut)) - mutate() - else if(istype(Proj , /obj/item/projectile/energy/florayield)) - return myseed.bullet_act(Proj) - else - return ..() - -/obj/machinery/hydroponics/process() - var/needs_update = 0 // Checks if the icon needs updating so we don't redraw empty trays every time - - if(myseed && (myseed.loc != src)) - myseed.forceMove(src) - - if(self_sustaining) - adjustNutri(1) - adjustWater(rand(3,5)) - adjustWeeds(-2) - adjustPests(-2) - adjustToxic(-2) - - if(world.time > (lastcycle + cycledelay)) - lastcycle = world.time - if(myseed && !dead) - // Advance age - age++ - if(age < myseed.maturation) - lastproduce = age - - needs_update = 1 - -//Nutrients////////////////////////////////////////////////////////////// - // Nutrients deplete slowly - if(prob(50)) - adjustNutri(-1 / rating) - - // Lack of nutrients hurts non-weeds - if(nutrilevel <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy)) - adjustHealth(-rand(1,3)) - -//Photosynthesis///////////////////////////////////////////////////////// - // Lack of light hurts non-mushrooms - if(isturf(loc)) - var/turf/currentTurf = loc - var/lightAmt = currentTurf.get_lumcount() - if(myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) - if(lightAmt < 0.2) - adjustHealth(-1 / rating) - else // Non-mushroom - if(lightAmt < 0.4) - adjustHealth(-2 / rating) - -//Water////////////////////////////////////////////////////////////////// - // Drink random amount of water - adjustWater(-rand(1,6) / rating) - - // If the plant is dry, it loses health pretty fast, unless mushroom - if(waterlevel <= 10 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) - adjustHealth(-rand(0,1) / rating) - if(waterlevel <= 0) - adjustHealth(-rand(0,2) / rating) - - // Sufficient water level and nutrient level = plant healthy but also spawns weeds - else if(waterlevel > 10 && nutrilevel > 0) - adjustHealth(rand(1,2) / rating) - if(myseed && prob(myseed.weed_chance)) - adjustWeeds(myseed.weed_rate) - else if(prob(5)) //5 percent chance the weed population will increase - adjustWeeds(1 / rating) - -//Toxins///////////////////////////////////////////////////////////////// - - // Too much toxins cause harm, but when the plant drinks the contaiminated water, the toxins disappear slowly - if(toxic >= 40 && toxic < 80) - adjustHealth(-1 / rating) - adjustToxic(-rand(1,10) / rating) - else if(toxic >= 80) // I don't think it ever gets here tbh unless above is commented out - adjustHealth(-3) - adjustToxic(-rand(1,10) / rating) - -//Pests & Weeds////////////////////////////////////////////////////////// - - if(pestlevel >= 8) - if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/carnivory)) - adjustHealth(-2 / rating) - - else - adjustHealth(2 / rating) - adjustPests(-1 / rating) - - else if(pestlevel >= 4) - if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/carnivory)) - adjustHealth(-1 / rating) - - else - adjustHealth(1 / rating) - if(prob(50)) - adjustPests(-1 / rating) - - else if(pestlevel < 4 && myseed.get_gene(/datum/plant_gene/trait/plant_type/carnivory)) - adjustHealth(-2 / rating) - if(prob(5)) - adjustPests(-1 / rating) - - // If it's a weed, it doesn't stunt the growth - if(weedlevel >= 5 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy)) - adjustHealth(-1 / rating) - -//Health & Age/////////////////////////////////////////////////////////// - - // Plant dies if plant_health <= 0 - if(plant_health <= 0) - plantdies() - adjustWeeds(1 / rating) // Weeds flourish - - // If the plant is too old, lose health fast - if(age > myseed.lifespan) - adjustHealth(-rand(1,5) / rating) - - // Harvest code - if(age > myseed.production && (age - lastproduce) > myseed.production && (!harvest && !dead)) - nutrimentMutation() - if(myseed && myseed.yield != -1) // Unharvestable shouldn't be harvested - harvest = 1 - else - lastproduce = age - if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase - adjustPests(1 / rating) - else - if(waterlevel > 10 && nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10% - adjustWeeds(1 / rating) - - // Weeeeeeeeeeeeeeedddssss - if(weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot. - if(myseed) - if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) // If a normal plant - weedinvasion() - else - weedinvasion() // Weed invasion into empty tray - needs_update = 1 - if (needs_update) - update_icon() - - if(myseed && prob(5 * (11-myseed.production))) - for(var/g in myseed.genes) - if(istype(g, /datum/plant_gene/trait)) - var/datum/plant_gene/trait/selectedtrait = g - selectedtrait.on_grow(src) - return - -/obj/machinery/hydroponics/proc/nutrimentMutation() - if (mutmod == 0) - return - if (mutmod == 1) - if(prob(80)) //80% - mutate() - else if(prob(75)) //15% - hardmutate() - return - if (mutmod == 2) - if(prob(50)) //50% - mutate() - else if(prob(50)) //25% - hardmutate() - else if(prob(50)) //12.5% - mutatespecie() - return - return - -/obj/machinery/hydroponics/update_icon() - //Refreshes the icon and sets the luminosity - cut_overlays() - - if(self_sustaining) - if(istype(src, /obj/machinery/hydroponics/soil)) - add_atom_colour(rgb(255, 175, 0), FIXED_COLOUR_PRIORITY) - else - add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "gaia_blessing")) - set_light(3) - - update_icon_hoses() - - if(myseed) - update_icon_plant() - update_icon_lights() - - if(!self_sustaining) - if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow)) - var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow) - set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color) - else - set_light(0) - - return - -/obj/machinery/hydroponics/proc/update_icon_hoses() - var/n = 0 - for(var/Dir in GLOB.cardinals) - var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir) - if(t && t.using_irrigation && using_irrigation) - n += Dir - - icon_state = "hoses-[n]" - -/obj/machinery/hydroponics/proc/update_icon_plant() - var/mutable_appearance/plant_overlay = mutable_appearance(myseed.growing_icon, layer = OBJ_LAYER + 0.01) - if(dead) - plant_overlay.icon_state = myseed.icon_dead - else if(harvest) - if(!myseed.icon_harvest) - plant_overlay.icon_state = "[myseed.icon_grow][myseed.growthstages]" - else - plant_overlay.icon_state = myseed.icon_harvest - else - var/t_growthstate = min(round((age / myseed.maturation) * myseed.growthstages), myseed.growthstages) - plant_overlay.icon_state = "[myseed.icon_grow][t_growthstate]" - add_overlay(plant_overlay) - -/obj/machinery/hydroponics/proc/update_icon_lights() - if(waterlevel <= 10) - add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lowwater3")) - if(nutrilevel <= 2) - add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lownutri3")) - if(plant_health <= (myseed.endurance / 2)) - add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lowhealth3")) - if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40) - add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_alert3")) - if(harvest) - add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_harvest3")) - - -/obj/machinery/hydroponics/examine(user) - . = ..() - if(myseed) - . += "It has [myseed.plantname] planted." - if (dead) - . += "It's dead!" - else if (harvest) - . += "It's ready to harvest." - else if (plant_health <= (myseed.endurance / 2)) - . += "It looks unhealthy." - else - . += "It's empty." - - if(!self_sustaining) - . += "Water: [waterlevel]/[maxwater]." - . += "Nutrient: [nutrilevel]/[maxnutri]." - if(self_sufficiency_progress > 0) - var/percent_progress = round(self_sufficiency_progress * 100 / self_sufficiency_req) - . += "Treatment for self-sustenance are [percent_progress]% complete." - else - . += "It doesn't require any water or nutrients." - - if(weedlevel >= 5) - . += "It's filled with weeds!" - if(pestlevel >= 5) - . += "It's filled with tiny worms!" - -/obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens. - dead = 0 - var/oldPlantName - if(myseed) // In case there's nothing in the tray beforehand - oldPlantName = myseed.plantname - qdel(myseed) - myseed = null - else - oldPlantName = "empty tray" - switch(rand(1,18)) // randomly pick predominative weed - if(16 to 18) - myseed = new /obj/item/seeds/reishi(src) - if(14 to 15) - myseed = new /obj/item/seeds/nettle(src) - if(12 to 13) - myseed = new /obj/item/seeds/harebell(src) - if(10 to 11) - myseed = new /obj/item/seeds/amanita(src) - if(8 to 9) - myseed = new /obj/item/seeds/chanter(src) - if(6 to 7) - myseed = new /obj/item/seeds/tower(src) - if(4 to 5) - myseed = new /obj/item/seeds/plump(src) - else - myseed = new /obj/item/seeds/starthistle(src) - age = 0 - plant_health = myseed.endurance - lastcycle = world.time - harvest = 0 - weedlevel = 0 // Reset - pestlevel = 0 // Reset - update_icon() - visible_message("The [oldPlantName] is overtaken by some [myseed.plantname]!") - - -/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) // Mutates the current seed - if(!myseed) - return - myseed.mutate(lifemut, endmut, productmut, yieldmut, potmut, wrmut, wcmut, traitmut) - -/obj/machinery/hydroponics/proc/hardmutate() - mutate(4, 10, 2, 4, 50, 4, 10, 3) - - -/obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant! - if(!myseed || dead) - return - - var/oldPlantName = myseed.plantname - if(myseed.mutatelist.len > 0) - var/mutantseed = pick(myseed.mutatelist) - qdel(myseed) - myseed = null - myseed = new mutantseed - else - return - - hardmutate() - age = 0 - plant_health = myseed.endurance - lastcycle = world.time - harvest = 0 - weedlevel = 0 // Reset - - sleep(5) // Wait a while - update_icon() - visible_message("[oldPlantName] suddenly mutates into [myseed.plantname]!") - - -/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant - if( weedlevel > 5 ) - if(myseed) - qdel(myseed) - myseed = null - var/newWeed = pick(/obj/item/seeds/liberty, /obj/item/seeds/angel, /obj/item/seeds/nettle/death, /obj/item/seeds/kudzu) - myseed = new newWeed - dead = 0 - hardmutate() - age = 0 - plant_health = myseed.endurance - lastcycle = world.time - harvest = 0 - weedlevel = 0 // Reset - - sleep(5) // Wait a while - update_icon() - visible_message("The mutated weeds in [src] spawn some [myseed.plantname]!") - else - to_chat(usr, "The few weeds in [src] seem to react, but only for a moment...") - - -/obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier - plant_health = 0 - harvest = 0 - pestlevel = 0 // Pests die - if(!dead) - update_icon() - dead = 1 - - - -/obj/machinery/hydroponics/proc/mutatepest(mob/user) - if(pestlevel > 5) - message_admins("[ADMIN_LOOKUPFLW(user)] caused spiderling pests to spawn in a hydro tray") - log_game("[key_name(user)] caused spiderling pests to spawn in a hydro tray") - visible_message("The pests seem to behave oddly...") - spawn_atom_to_turf(/obj/structure/spider/spiderling/hunter, src, 3, FALSE) - else - to_chat(user, "The pests seem to behave oddly, but quickly settle down...") - -/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S, mob/user) - if(myseed) - myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines - - // Requires 5 mutagen to possibly change species.// Poor man's mutagen. - if(S.has_reagent("mutagen", 5) || S.has_reagent("radium", 10) || S.has_reagent("uranium", 10)) - switch(rand(100)) - if(91 to 100) - adjustHealth(-10) - to_chat(user, "The plant shrivels and burns.") - if(81 to 90) - mutatespecie() - if(66 to 80) - hardmutate() - if(41 to 65) - mutate() - if(21 to 41) - to_chat(user, "The plants don't seem to react...") - if(11 to 20) - mutateweed() - if(1 to 10) - mutatepest(user) - else - to_chat(user, "Nothing happens...") - - // 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen - else if(S.has_reagent("mutagen", 2) || S.has_reagent("radium", 5) || S.has_reagent("uranium", 5)) - hardmutate() - else if(S.has_reagent("mutagen", 1) || S.has_reagent("radium", 2) || S.has_reagent("uranium", 2)) - mutate() - - // After handling the mutating, we now handle the damage from adding crude radioactives... - if(S.has_reagent("uranium", 1)) - adjustHealth(-round(S.get_reagent_amount("uranium") * 1)) - adjustToxic(round(S.get_reagent_amount("uranium") * 2)) - if(S.has_reagent("radium", 1)) - adjustHealth(-round(S.get_reagent_amount("radium") * 1)) - adjustToxic(round(S.get_reagent_amount("radium") * 3)) // Radium is harsher (OOC: also easier to produce) - - // Nutriments - if(S.has_reagent("eznutriment", 1)) - yieldmod = 1 - mutmod = 1 - adjustNutri(round(S.get_reagent_amount("eznutriment") * 1)) - - if(S.has_reagent("left4zednutriment", 1)) - yieldmod = 0 - mutmod = 2 - adjustNutri(round(S.get_reagent_amount("left4zednutriment") * 1)) - - if(S.has_reagent("robustharvestnutriment", 1)) - yieldmod = 1.3 - mutmod = 0 - adjustNutri(round(S.get_reagent_amount("robustharvestnutriment") *1 )) - - // Ambrosia Gaia produces earthsblood. - if(S.has_reagent("earthsblood")) - self_sufficiency_progress += S.get_reagent_amount("earthsblood") - if(self_sufficiency_progress >= self_sufficiency_req) - become_self_sufficient() - else if(!self_sustaining) - to_chat(user, "[src] warms as it might on a spring day under a genuine Sun.") - - // Antitoxin binds shit pretty well. So the tox goes significantly down - if(S.has_reagent("charcoal", 1)) - adjustToxic(-round(S.get_reagent_amount("charcoal") * 2)) - - // NIGGA, YOU JUST WENT ON FULL RETARD. - if(S.has_reagent("toxin", 1)) - adjustToxic(round(S.get_reagent_amount("toxin") * 2)) - - // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now... - if(S.has_reagent("milk", 1)) - adjustNutri(round(S.get_reagent_amount("milk") * 0.1)) - adjustWater(round(S.get_reagent_amount("milk") * 0.9)) - - // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? - if(S.has_reagent("beer", 1)) - adjustHealth(-round(S.get_reagent_amount("beer") * 0.05)) - adjustNutri(round(S.get_reagent_amount("beer") * 0.25)) - adjustWater(round(S.get_reagent_amount("beer") * 0.7)) - - // You're an idiot for thinking that one of the most corrosive and deadly gasses would be beneficial - if(S.has_reagent("fluorine", 1)) - adjustHealth(-round(S.get_reagent_amount("fluorine") * 2)) - adjustToxic(round(S.get_reagent_amount("fluorine") * 2.5)) - adjustWater(-round(S.get_reagent_amount("fluorine") * 0.5)) - adjustWeeds(-rand(1,4)) - - // You're an idiot for thinking that one of the most corrosive and deadly gasses would be beneficial - if(S.has_reagent("chlorine", 1)) - adjustHealth(-round(S.get_reagent_amount("chlorine") * 1)) - adjustToxic(round(S.get_reagent_amount("chlorine") * 1.5)) - adjustWater(-round(S.get_reagent_amount("chlorine") * 0.5)) - adjustWeeds(-rand(1,3)) - - // White Phosphorous + water -> phosphoric acid. That's not a good thing really. - // Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. - if(S.has_reagent("phosphorus", 1)) - adjustHealth(-round(S.get_reagent_amount("phosphorus") * 0.75)) - adjustNutri(round(S.get_reagent_amount("phosphorus") * 0.1)) - adjustWater(-round(S.get_reagent_amount("phosphorus") * 0.5)) - adjustWeeds(-rand(1,2)) - - // Plants should not have sugar, they can't use it and it prevents them getting water/ nutients, it is good for mold though... - if(S.has_reagent("sugar", 1)) - adjustWeeds(rand(1,2)) - adjustPests(rand(1,2)) - adjustNutri(round(S.get_reagent_amount("sugar") * 0.1)) - - // It is water! - if(S.has_reagent("water", 1)) - adjustWater(round(S.get_reagent_amount("water") * 1)) - - // Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~ - if(S.has_reagent("holywater", 1)) - adjustWater(round(S.get_reagent_amount("holywater") * 1)) - adjustHealth(round(S.get_reagent_amount("holywater") * 0.1)) - - // A variety of nutrients are dissolved in club soda, without sugar. - // These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. - if(S.has_reagent("sodawater", 1)) - adjustWater(round(S.get_reagent_amount("sodawater") * 1)) - adjustHealth(round(S.get_reagent_amount("sodawater") * 0.1)) - adjustNutri(round(S.get_reagent_amount("sodawater") * 0.1)) - - // Man, you guys are retards - if(S.has_reagent("sacid", 1)) - adjustHealth(-round(S.get_reagent_amount("sacid") * 1)) - adjustToxic(round(S.get_reagent_amount("sacid") * 1.5)) - adjustWeeds(-rand(1,2)) - - // SERIOUSLY - if(S.has_reagent("facid", 1)) - adjustHealth(-round(S.get_reagent_amount("facid") * 2)) - adjustToxic(round(S.get_reagent_amount("facid") * 3)) - adjustWeeds(-rand(1,4)) - - // Plant-B-Gone is just as bad - if(S.has_reagent("plantbgone", 1)) - adjustHealth(-round(S.get_reagent_amount("plantbgone") * 5)) - adjustToxic(round(S.get_reagent_amount("plantbgone") * 6)) - adjustWeeds(-rand(4,8)) - - // why, just why - if(S.has_reagent("napalm", 1)) - if(!(myseed.resistance_flags & FIRE_PROOF)) - adjustHealth(-round(S.get_reagent_amount("napalm") * 6)) - adjustToxic(round(S.get_reagent_amount("napalm") * 7)) - adjustWeeds(-rand(5,9)) - - //Weed Spray - if(S.has_reagent("weedkiller", 1)) - adjustToxic(round(S.get_reagent_amount("weedkiller") * 0.5)) - //old toxicity was 4, each spray is default 10 (minimal of 5) so 5 and 2.5 are the new ammounts - adjustWeeds(-rand(1,2)) - - //Pest Spray - if(S.has_reagent("pestkiller", 1)) - adjustToxic(round(S.get_reagent_amount("pestkiller") * 0.5)) - adjustPests(-rand(1,2)) - - // Healing - if(S.has_reagent("cryoxadone", 1)) - adjustHealth(round(S.get_reagent_amount("cryoxadone") * 3)) - adjustToxic(-round(S.get_reagent_amount("cryoxadone") * 3)) - - // Ammonia is bad ass. - if(S.has_reagent("ammonia", 1)) - adjustHealth(round(S.get_reagent_amount("ammonia") * 0.5)) - adjustNutri(round(S.get_reagent_amount("ammonia") * 1)) - if(myseed) - myseed.adjust_yield(round(S.get_reagent_amount("ammonia") * 0.01)) - - // Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants - if(S.has_reagent("saltpetre", 1)) - var/salt = S.get_reagent_amount("saltpetre") - adjustHealth(round(salt * 0.25)) - if (myseed) - myseed.adjust_production(-round(salt/100)-prob(salt%100)) - myseed.adjust_potency(round(salt*0.5)) - // Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer - if(S.has_reagent("ash", 1)) - adjustHealth(round(S.get_reagent_amount("ash") * 0.25)) - adjustNutri(round(S.get_reagent_amount("ash") * 0.5)) - adjustWeeds(-1) - - // This is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. - if(S.has_reagent("diethylamine", 1)) - adjustHealth(round(S.get_reagent_amount("diethylamine") * 1)) - adjustNutri(round(S.get_reagent_amount("diethylamine") * 2)) - if(myseed) - myseed.adjust_yield(round(S.get_reagent_amount("diethylamine") * 0.02)) - adjustPests(-rand(1,2)) - - // Compost, effectively - if(S.has_reagent("nutriment", 1)) - adjustHealth(round(S.get_reagent_amount("nutriment") * 0.5)) - adjustNutri(round(S.get_reagent_amount("nutriment") * 1)) - - // Compost for EVERYTHING - if(S.has_reagent("virusfood", 1)) - adjustNutri(round(S.get_reagent_amount("virusfood") * 0.5)) - adjustHealth(-round(S.get_reagent_amount("virusfood") * 0.5)) - - // FEED ME - if(S.has_reagent("blood", 1)) - adjustNutri(round(S.get_reagent_amount("blood") * 1)) - adjustPests(rand(2,4)) - - // FEED ME SEYMOUR - if(S.has_reagent("strangereagent", 1)) - spawnplant() - - // The best stuff there is. For testing/debugging. - if(S.has_reagent("adminordrazine", 1)) - adjustWater(round(S.get_reagent_amount("adminordrazine") * 1)) - adjustHealth(round(S.get_reagent_amount("adminordrazine") * 1)) - adjustNutri(round(S.get_reagent_amount("adminordrazine") * 1)) - adjustPests(-rand(1,5)) - adjustWeeds(-rand(1,5)) - if(S.has_reagent("adminordrazine", 5)) - switch(rand(100)) - if(66 to 100) - mutatespecie() - if(33 to 65) - mutateweed() - if(1 to 32) - mutatepest(user) - else - to_chat(user, "Nothing happens...") - -/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) - //Called when mob user "attacks" it with object O - if(istype(O, /obj/item/reagent_containers) ) // Syringe stuff (and other reagent containers now too) - var/obj/item/reagent_containers/reagent_source = O - - if(istype(reagent_source, /obj/item/reagent_containers/syringe)) - var/obj/item/reagent_containers/syringe/syr = reagent_source - if(syr.mode != 1) - to_chat(user, "You can't get any extract out of this plant." ) - return - - if(!reagent_source.reagents.total_volume) - to_chat(user, "[reagent_source] is empty.") - return 1 - - var/list/trays = list(src)//makes the list just this in cases of syringes and compost etc - var/target = myseed ? myseed.plantname : src - var/visi_msg = "" - var/irrigate = 0 //How am I supposed to irrigate pill contents? - var/transfer_amount - - if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) - visi_msg="[user] composts [reagent_source], spreading it through [target]" - transfer_amount = reagent_source.reagents.total_volume - else - transfer_amount = reagent_source.amount_per_transfer_from_this - if(istype(reagent_source, /obj/item/reagent_containers/syringe/)) - var/obj/item/reagent_containers/syringe/syr = reagent_source - visi_msg="[user] injects [target] with [syr]" - if(syr.reagents.total_volume <= syr.amount_per_transfer_from_this) - syr.mode = 0 - else if(istype(reagent_source, /obj/item/reagent_containers/spray/)) - visi_msg="[user] sprays [target] with [reagent_source]" - playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) - irrigate = 1 - else if(transfer_amount) // Droppers, cans, beakers, what have you. - visi_msg="[user] uses [reagent_source] on [target]" - irrigate = 1 - // Beakers, bottles, buckets, etc. - if(reagent_source.is_drainable()) - playsound(loc, 'sound/effects/slosh.ogg', 25, 1) - - if(irrigate && transfer_amount > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation) - trays = FindConnected() - if (trays.len > 1) - visi_msg += ", setting off the irrigation system" - - if(visi_msg) - visible_message("[visi_msg].") - - var/split = round(transfer_amount/trays.len) - - for(var/obj/machinery/hydroponics/H in trays) - //cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener - - var/datum/reagents/S = new /datum/reagents() //This is a strange way, but I don't know of a better one so I can't fix it at the moment... - S.my_atom = H - - reagent_source.reagents.trans_to(S,split) - if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) - qdel(reagent_source) - - H.applyChemicals(S, user) - - S.clear_reagents() - qdel(S) - H.update_icon() - if(reagent_source) // If the source wasn't composted and destroyed - reagent_source.update_icon() - return 1 - - else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample)) - if(!myseed) - if(istype(O, /obj/item/seeds/kudzu)) - investigate_log("had Kudzu planted in it by [key_name(user)] at [AREACOORD(src)]","kudzu") - if(!user.transferItemToLoc(O, src)) - return - to_chat(user, "You plant [O].") - dead = 0 - myseed = O - age = 1 - plant_health = myseed.endurance - lastcycle = world.time - update_icon() - else - to_chat(user, "[src] already has seeds in it!") - - else if(istype(O, /obj/item/plant_analyzer)) - if(myseed) - to_chat(user, "*** [myseed.plantname] ***" ) - to_chat(user, "- Plant Age: [age]") - var/list/text_string = myseed.get_analyzer_text() - if(text_string) - to_chat(user, text_string) - else - to_chat(user, "No plant found.") - to_chat(user, "- Weed level: [weedlevel] / 10") - to_chat(user, "- Pest level: [pestlevel] / 10") - to_chat(user, "- Toxicity level: [toxic] / 100") - to_chat(user, "- Water level: [waterlevel] / [maxwater]") - to_chat(user, "- Nutrition level: [nutrilevel] / [maxnutri]") - to_chat(user, "") - - else if(istype(O, /obj/item/cultivator)) - if(weedlevel > 0) - user.visible_message("[user] uproots the weeds.", "You remove the weeds from [src].") - weedlevel = 0 - update_icon() - else - to_chat(user, "This plot is completely devoid of weeds! It doesn't need uprooting.") - - else if(istype(O, /obj/item/storage/bag/plants)) - attack_hand(user) - for(var/obj/item/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z)) - SEND_SIGNAL(O, COMSIG_TRY_STORAGE_INSERT, G, user, TRUE) - - else if(default_unfasten_wrench(user, O)) - return - - else if(istype(O, /obj/item/wirecutters) && unwrenchable) - if (!anchored) - to_chat(user, "Anchor the tray first!") - return - using_irrigation = !using_irrigation - O.play_tool_sound(src) - user.visible_message("[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.", \ - "You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.") - for(var/obj/machinery/hydroponics/h in range(1,src)) - h.update_icon() - - else if(istype(O, /obj/item/shovel/spade)) - if(!myseed && !weedlevel) - to_chat(user, "[src] doesn't have any plants or weeds!") - return - user.visible_message("[user] starts digging out [src]'s plants...", - "You start digging out [src]'s plants...") - if(O.use_tool(src, user, 50, volume=50) || (!myseed && !weedlevel)) - user.visible_message("[user] digs out the plants in [src]!", "You dig out all of [src]'s plants!") - if(myseed) //Could be that they're just using it as a de-weeder - age = 0 - plant_health = 0 - if(harvest) - harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it - qdel(myseed) - myseed = null - weedlevel = 0 //Has a side effect of cleaning up those nasty weeds - update_icon() - - else - return ..() - -/obj/machinery/hydroponics/can_be_unfasten_wrench(mob/user, silent) - if (!unwrenchable) // case also covered by NODECONSTRUCT checks in default_unfasten_wrench - return CANT_UNFASTEN - - if (using_irrigation) - if (!silent) - to_chat(user, "Disconnect the hoses first!") - return FAILED_UNFASTEN - - return ..() - -/obj/machinery/hydroponics/attack_hand(mob/user) - . = ..() - if(.) - return - if(issilicon(user)) //How does AI know what plant is? - return - if(harvest) - return myseed.harvest(user) - - else if(dead) - dead = 0 - to_chat(user, "You remove the dead plant from [src].") - qdel(myseed) - myseed = null - update_icon() - else - if(user) - examine(user) - -/obj/machinery/hydroponics/proc/update_tray(mob/user) - harvest = 0 - lastproduce = age - if(istype(myseed, /obj/item/seeds/replicapod)) - to_chat(user, "You harvest from the [myseed.plantname].") - else if(myseed.getYield() <= 0) - to_chat(user, "You fail to harvest anything useful!") - else - to_chat(user, "You harvest [myseed.getYield()] items from the [myseed.plantname].") - if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest)) - qdel(myseed) - myseed = null - dead = 0 - update_icon() - -/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds./// -/obj/machinery/hydroponics/proc/adjustNutri(adjustamt) - nutrilevel = CLAMP(nutrilevel + adjustamt, 0, maxnutri) - -/obj/machinery/hydroponics/proc/adjustWater(adjustamt) - waterlevel = CLAMP(waterlevel + adjustamt, 0, maxwater) - - if(adjustamt>0) - adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration. - -/obj/machinery/hydroponics/proc/adjustHealth(adjustamt) - if(myseed && !dead) - plant_health = CLAMP(plant_health + adjustamt, 0, myseed.endurance) - -/obj/machinery/hydroponics/proc/adjustToxic(adjustamt) - toxic = CLAMP(toxic + adjustamt, 0, 100) - -/obj/machinery/hydroponics/proc/adjustPests(adjustamt) - pestlevel = CLAMP(pestlevel + adjustamt, 0, 10) - -/obj/machinery/hydroponics/proc/adjustWeeds(adjustamt) - weedlevel = CLAMP(weedlevel + adjustamt, 0, 10) - -/obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood - var/list/livingplants = list(/mob/living/simple_animal/hostile/tree, /mob/living/simple_animal/hostile/killertomato) - var/chosen = pick(livingplants) - var/mob/living/simple_animal/hostile/C = new chosen - C.faction = list("plants") - -/obj/machinery/hydroponics/proc/become_self_sufficient() // Ambrosia Gaia effect - visible_message("[src] begins to glow with a beautiful light!") - self_sustaining = TRUE - update_icon() - -/////////////////////////////////////////////////////////////////////////////// -/obj/machinery/hydroponics/soil //Not actually hydroponics at all! Honk! - name = "soil" - desc = "A patch of dirt." - icon = 'icons/obj/hydroponics/equipment.dmi' - icon_state = "soil" - circuit = null - density = FALSE - use_power = NO_POWER_USE - flags_1 = NODECONSTRUCT_1 - unwrenchable = FALSE - var/buildstacktype = /obj/item/stack/sheet/mineral/sandstone - var/buildstackamount = 3 - -/obj/machinery/hydroponics/soil/update_icon_hoses() - return // Has no hoses - -/obj/machinery/hydroponics/soil/update_icon_lights() - return // Has no lights - -/obj/machinery/hydroponics/soil/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/shovel) && !istype(O, /obj/item/shovel/spade)) //Doesn't include spades because of uprooting plants - to_chat(user, "You clear up [src]!") - new buildstacktype(loc,buildstackamount) - qdel(src) - else - return ..() +/obj/machinery/hydroponics + name = "hydroponics tray" + icon = 'icons/obj/hydroponics/equipment.dmi' + icon_state = "hydrotray" + density = TRUE + pixel_z = 8 + obj_flags = CAN_BE_HIT | UNIQUE_RENAME + circuit = /obj/item/circuitboard/machine/hydroponics + var/waterlevel = 100 //The amount of water in the tray (max 100) + var/maxwater = 100 //The maximum amount of water in the tray + var/nutrilevel = 10 //The amount of nutrient in the tray (max 10) + var/maxnutri = 10 //The maximum nutrient of water in the tray + var/pestlevel = 0 //The amount of pests in the tray (max 10) + var/weedlevel = 0 //The amount of weeds in the tray (max 10) + var/yieldmod = 1 //Nutriment's effect on yield + var/mutmod = 1 //Nutriment's effect on mutations + var/toxic = 0 //Toxicity in the tray? + var/age = 0 //Current age + var/dead = 0 //Is it dead? + var/plant_health //Its health + var/lastproduce = 0 //Last time it was harvested + var/lastcycle = 0 //Used for timing of cycles. + var/cycledelay = 200 //About 10 seconds / cycle + var/harvest = 0 //Ready to harvest? + var/obj/item/seeds/myseed = null //The currently planted seed + var/rating = 1 + var/unwrenchable = 1 + var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant + var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses + var/self_sufficiency_req = 20 //Required total dose to make a self-sufficient hydro tray. 1:1 with earthsblood. + var/self_sufficiency_progress = 0 + var/self_sustaining = FALSE //If the tray generates nutrients and water on its own + + +/obj/machinery/hydroponics/constructable + name = "hydroponics tray" + icon = 'icons/obj/hydroponics/equipment.dmi' + icon_state = "hydrotray3" + +/obj/machinery/hydroponics/constructable/RefreshParts() + var/tmp_capacity = 0 + for (var/obj/item/stock_parts/matter_bin/M in component_parts) + tmp_capacity += M.rating + for (var/obj/item/stock_parts/manipulator/M in component_parts) + rating = M.rating + maxwater = tmp_capacity * 50 // Up to 300 + maxnutri = tmp_capacity * 5 // Up to 30 + +/obj/machinery/hydroponics/Destroy() + if(myseed) + qdel(myseed) + myseed = null + return ..() + +/obj/machinery/hydroponics/constructable/attackby(obj/item/I, mob/user, params) + if (user.a_intent != INTENT_HARM) + // handle opening the panel + if(default_deconstruction_screwdriver(user, icon_state, icon_state, I)) + return + + // handle deconstructing the machine, if permissible + if (I.tool_behaviour == TOOL_CROWBAR && using_irrigation) + to_chat(user, "Disconnect the hoses first!") + return + else if(default_deconstruction_crowbar(I)) + return + + return ..() + +/obj/machinery/hydroponics/proc/FindConnected() + var/list/connected = list() + var/list/processing_atoms = list(src) + + while(processing_atoms.len) + var/atom/a = processing_atoms[1] + for(var/step_dir in GLOB.cardinals) + var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir) + // Soil plots aren't dense + if(h && h.using_irrigation && h.density && !(h in connected) && !(h in processing_atoms)) + processing_atoms += h + + processing_atoms -= a + connected += a + + return connected + + +/obj/machinery/hydroponics/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables. + if(!myseed) + return ..() + if(istype(Proj , /obj/item/projectile/energy/floramut)) + mutate() + else if(istype(Proj , /obj/item/projectile/energy/florayield)) + return myseed.bullet_act(Proj) + else + return ..() + +/obj/machinery/hydroponics/process() + var/needs_update = 0 // Checks if the icon needs updating so we don't redraw empty trays every time + + if(myseed && (myseed.loc != src)) + myseed.forceMove(src) + + if(self_sustaining) + adjustNutri(1) + adjustWater(rand(3,5)) + adjustWeeds(-2) + adjustPests(-2) + adjustToxic(-2) + + if(world.time > (lastcycle + cycledelay)) + lastcycle = world.time + if(myseed && !dead) + // Advance age + age++ + if(age < myseed.maturation) + lastproduce = age + + needs_update = 1 + +//Nutrients////////////////////////////////////////////////////////////// + // Nutrients deplete slowly + if(prob(50)) + adjustNutri(-1 / rating) + + // Lack of nutrients hurts non-weeds + if(nutrilevel <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy)) + adjustHealth(-rand(1,3)) + +//Photosynthesis///////////////////////////////////////////////////////// + // Lack of light hurts non-mushrooms + if(isturf(loc)) + var/turf/currentTurf = loc + var/lightAmt = currentTurf.get_lumcount() + if(myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) + if(lightAmt < 0.2) + adjustHealth(-1 / rating) + else // Non-mushroom + if(lightAmt < 0.4) + adjustHealth(-2 / rating) + +//Water////////////////////////////////////////////////////////////////// + // Drink random amount of water + adjustWater(-rand(1,6) / rating) + + // If the plant is dry, it loses health pretty fast, unless mushroom + if(waterlevel <= 10 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) + adjustHealth(-rand(0,1) / rating) + if(waterlevel <= 0) + adjustHealth(-rand(0,2) / rating) + + // Sufficient water level and nutrient level = plant healthy but also spawns weeds + else if(waterlevel > 10 && nutrilevel > 0) + adjustHealth(rand(1,2) / rating) + if(myseed && prob(myseed.weed_chance)) + adjustWeeds(myseed.weed_rate) + else if(prob(5)) //5 percent chance the weed population will increase + adjustWeeds(1 / rating) + +//Toxins///////////////////////////////////////////////////////////////// + + // Too much toxins cause harm, but when the plant drinks the contaiminated water, the toxins disappear slowly + if(toxic >= 40 && toxic < 80) + adjustHealth(-1 / rating) + adjustToxic(-rand(1,10) / rating) + else if(toxic >= 80) // I don't think it ever gets here tbh unless above is commented out + adjustHealth(-3) + adjustToxic(-rand(1,10) / rating) + +//Pests & Weeds////////////////////////////////////////////////////////// + + if(pestlevel >= 8) + if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/carnivory)) + adjustHealth(-2 / rating) + + else + adjustHealth(2 / rating) + adjustPests(-1 / rating) + + else if(pestlevel >= 4) + if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/carnivory)) + adjustHealth(-1 / rating) + + else + adjustHealth(1 / rating) + if(prob(50)) + adjustPests(-1 / rating) + + else if(pestlevel < 4 && myseed.get_gene(/datum/plant_gene/trait/plant_type/carnivory)) + adjustHealth(-2 / rating) + if(prob(5)) + adjustPests(-1 / rating) + + // If it's a weed, it doesn't stunt the growth + if(weedlevel >= 5 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy)) + adjustHealth(-1 / rating) + +//Health & Age/////////////////////////////////////////////////////////// + + // Plant dies if plant_health <= 0 + if(plant_health <= 0) + plantdies() + adjustWeeds(1 / rating) // Weeds flourish + + // If the plant is too old, lose health fast + if(age > myseed.lifespan) + adjustHealth(-rand(1,5) / rating) + + // Harvest code + if(age > myseed.production && (age - lastproduce) > myseed.production && (!harvest && !dead)) + nutrimentMutation() + if(myseed && myseed.yield != -1) // Unharvestable shouldn't be harvested + harvest = 1 + else + lastproduce = age + if(prob(5)) // On each tick, there's a 5 percent chance the pest population will increase + adjustPests(1 / rating) + else + if(waterlevel > 10 && nutrilevel > 0 && prob(10)) // If there's no plant, the percentage chance is 10% + adjustWeeds(1 / rating) + + // Weeeeeeeeeeeeeeedddssss + if(weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot. + if(myseed) + if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) // If a normal plant + weedinvasion() + else + weedinvasion() // Weed invasion into empty tray + needs_update = 1 + if (needs_update) + update_icon() + + if(myseed && prob(5 * (11-myseed.production))) + for(var/g in myseed.genes) + if(istype(g, /datum/plant_gene/trait)) + var/datum/plant_gene/trait/selectedtrait = g + selectedtrait.on_grow(src) + return + +/obj/machinery/hydroponics/proc/nutrimentMutation() + if (mutmod == 0) + return + if (mutmod == 1) + if(prob(80)) //80% + mutate() + else if(prob(75)) //15% + hardmutate() + return + if (mutmod == 2) + if(prob(50)) //50% + mutate() + else if(prob(50)) //25% + hardmutate() + else if(prob(50)) //12.5% + mutatespecie() + return + return + +/obj/machinery/hydroponics/update_icon() + //Refreshes the icon and sets the luminosity + cut_overlays() + + if(self_sustaining) + if(istype(src, /obj/machinery/hydroponics/soil)) + add_atom_colour(rgb(255, 175, 0), FIXED_COLOUR_PRIORITY) + else + add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "gaia_blessing")) + set_light(3) + + update_icon_hoses() + + if(myseed) + update_icon_plant() + update_icon_lights() + + if(!self_sustaining) + if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow)) + var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow) + set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color) + else + set_light(0) + + return + +/obj/machinery/hydroponics/proc/update_icon_hoses() + var/n = 0 + for(var/Dir in GLOB.cardinals) + var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir) + if(t && t.using_irrigation && using_irrigation) + n += Dir + + icon_state = "hoses-[n]" + +/obj/machinery/hydroponics/proc/update_icon_plant() + var/mutable_appearance/plant_overlay = mutable_appearance(myseed.growing_icon, layer = OBJ_LAYER + 0.01) + if(dead) + plant_overlay.icon_state = myseed.icon_dead + else if(harvest) + if(!myseed.icon_harvest) + plant_overlay.icon_state = "[myseed.icon_grow][myseed.growthstages]" + else + plant_overlay.icon_state = myseed.icon_harvest + else + var/t_growthstate = min(round((age / myseed.maturation) * myseed.growthstages), myseed.growthstages) + plant_overlay.icon_state = "[myseed.icon_grow][t_growthstate]" + add_overlay(plant_overlay) + +/obj/machinery/hydroponics/proc/update_icon_lights() + if(waterlevel <= 10) + add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lowwater3")) + if(nutrilevel <= 2) + add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lownutri3")) + if(plant_health <= (myseed.endurance / 2)) + add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_lowhealth3")) + if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40) + add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_alert3")) + if(harvest) + add_overlay(mutable_appearance('icons/obj/hydroponics/equipment.dmi', "over_harvest3")) + + +/obj/machinery/hydroponics/examine(user) + . = ..() + if(myseed) + . += "It has [myseed.plantname] planted." + if (dead) + . += "It's dead!" + else if (harvest) + . += "It's ready to harvest." + else if (plant_health <= (myseed.endurance / 2)) + . += "It looks unhealthy." + else + . += "It's empty." + + if(!self_sustaining) + . += "Water: [waterlevel]/[maxwater]." + . += "Nutrient: [nutrilevel]/[maxnutri]." + if(self_sufficiency_progress > 0) + var/percent_progress = round(self_sufficiency_progress * 100 / self_sufficiency_req) + . += "Treatment for self-sustenance are [percent_progress]% complete." + else + . += "It doesn't require any water or nutrients." + + if(weedlevel >= 5) + . += "It's filled with weeds!" + if(pestlevel >= 5) + . += "It's filled with tiny worms!" + +/obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens. + dead = 0 + var/oldPlantName + if(myseed) // In case there's nothing in the tray beforehand + oldPlantName = myseed.plantname + qdel(myseed) + myseed = null + else + oldPlantName = "empty tray" + switch(rand(1,18)) // randomly pick predominative weed + if(16 to 18) + myseed = new /obj/item/seeds/reishi(src) + if(14 to 15) + myseed = new /obj/item/seeds/nettle(src) + if(12 to 13) + myseed = new /obj/item/seeds/harebell(src) + if(10 to 11) + myseed = new /obj/item/seeds/amanita(src) + if(8 to 9) + myseed = new /obj/item/seeds/chanter(src) + if(6 to 7) + myseed = new /obj/item/seeds/tower(src) + if(4 to 5) + myseed = new /obj/item/seeds/plump(src) + else + myseed = new /obj/item/seeds/starthistle(src) + age = 0 + plant_health = myseed.endurance + lastcycle = world.time + harvest = 0 + weedlevel = 0 // Reset + pestlevel = 0 // Reset + update_icon() + visible_message("The [oldPlantName] is overtaken by some [myseed.plantname]!") + + +/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) // Mutates the current seed + if(!myseed) + return + myseed.mutate(lifemut, endmut, productmut, yieldmut, potmut, wrmut, wcmut, traitmut) + +/obj/machinery/hydroponics/proc/hardmutate() + mutate(4, 10, 2, 4, 50, 4, 10, 3) + + +/obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant! + if(!myseed || dead) + return + + var/oldPlantName = myseed.plantname + if(myseed.mutatelist.len > 0) + var/mutantseed = pick(myseed.mutatelist) + qdel(myseed) + myseed = null + myseed = new mutantseed + else + return + + hardmutate() + age = 0 + plant_health = myseed.endurance + lastcycle = world.time + harvest = 0 + weedlevel = 0 // Reset + + sleep(5) // Wait a while + update_icon() + visible_message("[oldPlantName] suddenly mutates into [myseed.plantname]!") + + +/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant + if( weedlevel > 5 ) + if(myseed) + qdel(myseed) + myseed = null + var/newWeed = pick(/obj/item/seeds/liberty, /obj/item/seeds/angel, /obj/item/seeds/nettle/death, /obj/item/seeds/kudzu) + myseed = new newWeed + dead = 0 + hardmutate() + age = 0 + plant_health = myseed.endurance + lastcycle = world.time + harvest = 0 + weedlevel = 0 // Reset + + sleep(5) // Wait a while + update_icon() + visible_message("The mutated weeds in [src] spawn some [myseed.plantname]!") + else + to_chat(usr, "The few weeds in [src] seem to react, but only for a moment...") + + +/obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier + plant_health = 0 + harvest = 0 + pestlevel = 0 // Pests die + if(!dead) + update_icon() + dead = 1 + + + +/obj/machinery/hydroponics/proc/mutatepest(mob/user) + if(pestlevel > 5) + message_admins("[ADMIN_LOOKUPFLW(user)] caused spiderling pests to spawn in a hydro tray") + log_game("[key_name(user)] caused spiderling pests to spawn in a hydro tray") + visible_message("The pests seem to behave oddly...") + spawn_atom_to_turf(/obj/structure/spider/spiderling/hunter, src, 3, FALSE) + else + to_chat(user, "The pests seem to behave oddly, but quickly settle down...") + +/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S, mob/user) + if(myseed) + myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines + + // Requires 5 mutagen to possibly change species.// Poor man's mutagen. + if(S.has_reagent(/datum/reagent/toxin/mutagen, 5) || S.has_reagent(/datum/reagent/radium, 10) || S.has_reagent(/datum/reagent/uranium, 10)) + switch(rand(100)) + if(91 to 100) + adjustHealth(-10) + to_chat(user, "The plant shrivels and burns.") + if(81 to 90) + mutatespecie() + if(66 to 80) + hardmutate() + if(41 to 65) + mutate() + if(21 to 41) + to_chat(user, "The plants don't seem to react...") + if(11 to 20) + mutateweed() + if(1 to 10) + mutatepest(user) + else + to_chat(user, "Nothing happens...") + + // 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen + else if(S.has_reagent(/datum/reagent/toxin/mutagen, 2) || S.has_reagent(/datum/reagent/radium, 5) || S.has_reagent(/datum/reagent/uranium, 5)) + hardmutate() + else if(S.has_reagent(/datum/reagent/toxin/mutagen, 1) || S.has_reagent(/datum/reagent/radium, 2) || S.has_reagent(/datum/reagent/uranium, 2)) + mutate() + + // After handling the mutating, we now handle the damage from adding crude radioactives... + if(S.has_reagent(/datum/reagent/uranium, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/uranium) * 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/uranium) * 2)) + if(S.has_reagent(/datum/reagent/radium, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/radium) * 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/radium) * 3)) // Radium is harsher (OOC: also easier to produce) + + // Nutriments + if(S.has_reagent(/datum/reagent/plantnutriment/eznutriment, 1)) + yieldmod = 1 + mutmod = 1 + adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/eznutriment) * 1)) + + if(S.has_reagent(/datum/reagent/plantnutriment/left4zednutriment, 1)) + yieldmod = 0 + mutmod = 2 + adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/left4zednutriment) * 1)) + + if(S.has_reagent(/datum/reagent/plantnutriment/robustharvestnutriment, 1)) + yieldmod = 1.3 + mutmod = 0 + adjustNutri(round(S.get_reagent_amount(/datum/reagent/plantnutriment/robustharvestnutriment) *1 )) + + // Ambrosia Gaia produces earthsblood. + if(S.has_reagent(/datum/reagent/medicine/earthsblood)) + self_sufficiency_progress += S.get_reagent_amount(/datum/reagent/medicine/earthsblood) + if(self_sufficiency_progress >= self_sufficiency_req) + become_self_sufficient() + else if(!self_sustaining) + to_chat(user, "[src] warms as it might on a spring day under a genuine Sun.") + + // Antitoxin binds shit pretty well. So the tox goes significantly down + if(S.has_reagent(/datum/reagent/medicine/charcoal, 1)) + adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/charcoal) * 2)) + + // Toxins, not good for anything + if(S.has_reagent(/datum/reagent/toxin, 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin) * 2)) + + // Milk is good for humans, but bad for plants. The sugars canot be used by plants, and the milk fat fucks up growth. Not shrooms though. I can't deal with this now... + if(S.has_reagent(/datum/reagent/consumable/milk, 1)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.1)) + adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/milk) * 0.9)) + + // Beer is a chemical composition of alcohol and various other things. It's a shitty nutrient but hey, it's still one. Also alcohol is bad, mmmkay? + if(S.has_reagent(/datum/reagent/consumable/ethanol/beer, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.05)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.25)) + adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/ethanol/beer) * 0.7)) + + // Fluorine one of the most corrosive and deadly gasses + if(S.has_reagent(/datum/reagent/fluorine, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 2)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/fluorine) * 2.5)) + adjustWater(-round(S.get_reagent_amount(/datum/reagent/fluorine) * 0.5)) + adjustWeeds(-rand(1,4)) + + // Chlorine one of the most corrosive and deadly gasses + if(S.has_reagent(/datum/reagent/chlorine, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/chlorine) * 1.5)) + adjustWater(-round(S.get_reagent_amount(/datum/reagent/chlorine) * 0.5)) + adjustWeeds(-rand(1,3)) + + // White Phosphorous + water -> phosphoric acid. That's not a good thing really. + // Phosphoric salts are beneficial though. And even if the plant suffers, in the long run the tray gets some nutrients. The benefit isn't worth that much. + if(S.has_reagent(/datum/reagent/phosphorus, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.75)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.1)) + adjustWater(-round(S.get_reagent_amount(/datum/reagent/phosphorus) * 0.5)) + adjustWeeds(-rand(1,2)) + + // Plants should not have sugar, they can't use it and it prevents them getting water/nutients, it is good for mold though... + if(S.has_reagent(/datum/reagent/consumable/sugar, 1)) + adjustWeeds(rand(1,2)) + adjustPests(rand(1,2)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sugar) * 0.1)) + + // It is water! + if(S.has_reagent(/datum/reagent/water, 1)) + adjustWater(round(S.get_reagent_amount(/datum/reagent/water) * 1)) + + // Holy water. Mostly the same as water, it also heals the plant a little with the power of the spirits~ + if(S.has_reagent(/datum/reagent/water/holywater, 1)) + adjustWater(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/water/holywater) * 0.1)) + + // A variety of nutrients are dissolved in club soda, without sugar. + // These nutrients include carbon, oxygen, hydrogen, phosphorous, potassium, sulfur and sodium, all of which are needed for healthy plant growth. + if(S.has_reagent(/datum/reagent/consumable/sodawater, 1)) + adjustWater(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/sodawater) * 0.1)) + + // Sulphuric Acid + if(S.has_reagent(/datum/reagent/toxin/acid, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid) * 1.5)) + adjustWeeds(-rand(1,2)) + + // Acid + if(S.has_reagent(/datum/reagent/toxin/acid/fluacid, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 2)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/acid/fluacid) * 3)) + adjustWeeds(-rand(1,4)) + + // Plant-B-Gone is just as bad + if(S.has_reagent(/datum/reagent/toxin/plantbgone, 1)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 5)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone) * 6)) + adjustWeeds(-rand(4,8)) + + // Napalm, not known for being good for anything organic + if(S.has_reagent(/datum/reagent/napalm, 1)) + if(!(myseed.resistance_flags & FIRE_PROOF)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/napalm) * 6)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/napalm) * 7)) + adjustWeeds(-rand(5,9)) + + //Weed Spray + if(S.has_reagent(/datum/reagent/toxin/plantbgone/weedkiller, 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/plantbgone/weedkiller) * 0.5)) + //old toxicity was 4, each spray is default 10 (minimal of 5) so 5 and 2.5 are the new ammounts + adjustWeeds(-rand(1,2)) + + //Pest Spray + if(S.has_reagent(/datum/reagent/toxin/pestkiller, 1)) + adjustToxic(round(S.get_reagent_amount(/datum/reagent/toxin/pestkiller) * 0.5)) + adjustPests(-rand(1,2)) + + // Healing + if(S.has_reagent(/datum/reagent/medicine/cryoxadone, 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3)) + adjustToxic(-round(S.get_reagent_amount(/datum/reagent/medicine/cryoxadone) * 3)) + + // Ammonia is bad ass. + if(S.has_reagent(/datum/reagent/ammonia, 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.5)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/ammonia) * 1)) + if(myseed) + myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/ammonia) * 0.01)) + + // Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants + if(S.has_reagent(/datum/reagent/saltpetre, 1)) + var/salt = S.get_reagent_amount(/datum/reagent/saltpetre) + adjustHealth(round(salt * 0.25)) + if (myseed) + myseed.adjust_production(-round(salt/100)-prob(salt%100)) + myseed.adjust_potency(round(salt*0.5)) + // Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer + if(S.has_reagent(/datum/reagent/ash, 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/ash) * 0.25)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/ash) * 0.5)) + adjustWeeds(-1) + + // Diethylamine is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. + if(S.has_reagent(/datum/reagent/diethylamine, 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 1)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 2)) + if(myseed) + myseed.adjust_yield(round(S.get_reagent_amount(/datum/reagent/diethylamine) * 0.02)) + adjustPests(-rand(1,2)) + + // Nutriment Compost, effectively + if(S.has_reagent(/datum/reagent/consumable/nutriment, 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 0.5)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/consumable/nutriment) * 1)) + + // Virusfood Compost for EVERYTHING + if(S.has_reagent(/datum/reagent/toxin/mutagen/mutagenvirusfood, 1)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5)) + adjustHealth(-round(S.get_reagent_amount(/datum/reagent/toxin/mutagen/mutagenvirusfood) * 0.5)) + + // Blood + if(S.has_reagent(/datum/reagent/blood, 1)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/blood) * 1)) + adjustPests(rand(2,4)) + + // Strange reagent + if(S.has_reagent(/datum/reagent/medicine/strange_reagent, 1)) + spawnplant() + + // Adminordrazine the best stuff there is. For testing/debugging. + if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 1)) + adjustWater(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1)) + adjustHealth(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1)) + adjustNutri(round(S.get_reagent_amount(/datum/reagent/medicine/adminordrazine) * 1)) + adjustPests(-rand(1,5)) + adjustWeeds(-rand(1,5)) + if(S.has_reagent(/datum/reagent/medicine/adminordrazine, 5)) + switch(rand(100)) + if(66 to 100) + mutatespecie() + if(33 to 65) + mutateweed() + if(1 to 32) + mutatepest(user) + else + to_chat(user, "Nothing happens...") + +/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) + //Called when mob user "attacks" it with object O + if(istype(O, /obj/item/reagent_containers) ) // Syringe stuff (and other reagent containers now too) + var/obj/item/reagent_containers/reagent_source = O + + if(istype(reagent_source, /obj/item/reagent_containers/syringe)) + var/obj/item/reagent_containers/syringe/syr = reagent_source + if(syr.mode != 1) + to_chat(user, "You can't get any extract out of this plant." ) + return + + if(!reagent_source.reagents.total_volume) + to_chat(user, "[reagent_source] is empty.") + return 1 + + var/list/trays = list(src)//makes the list just this in cases of syringes and compost etc + var/target = myseed ? myseed.plantname : src + var/visi_msg = "" + var/irrigate = 0 //How am I supposed to irrigate pill contents? + var/transfer_amount + + if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) + visi_msg="[user] composts [reagent_source], spreading it through [target]" + transfer_amount = reagent_source.reagents.total_volume + else + transfer_amount = reagent_source.amount_per_transfer_from_this + if(istype(reagent_source, /obj/item/reagent_containers/syringe/)) + var/obj/item/reagent_containers/syringe/syr = reagent_source + visi_msg="[user] injects [target] with [syr]" + if(syr.reagents.total_volume <= syr.amount_per_transfer_from_this) + syr.mode = 0 + else if(istype(reagent_source, /obj/item/reagent_containers/spray/)) + visi_msg="[user] sprays [target] with [reagent_source]" + playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) + irrigate = 1 + else if(transfer_amount) // Droppers, cans, beakers, what have you. + visi_msg="[user] uses [reagent_source] on [target]" + irrigate = 1 + // Beakers, bottles, buckets, etc. + if(reagent_source.is_drainable()) + playsound(loc, 'sound/effects/slosh.ogg', 25, 1) + + if(irrigate && transfer_amount > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation) + trays = FindConnected() + if (trays.len > 1) + visi_msg += ", setting off the irrigation system" + + if(visi_msg) + visible_message("[visi_msg].") + + var/split = round(transfer_amount/trays.len) + + for(var/obj/machinery/hydroponics/H in trays) + //cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener + + var/datum/reagents/S = new /datum/reagents() //This is a strange way, but I don't know of a better one so I can't fix it at the moment... + S.my_atom = H + + reagent_source.reagents.trans_to(S,split) + if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) + qdel(reagent_source) + + H.applyChemicals(S, user) + + S.clear_reagents() + qdel(S) + H.update_icon() + if(reagent_source) // If the source wasn't composted and destroyed + reagent_source.update_icon() + return 1 + + else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample)) + if(!myseed) + if(istype(O, /obj/item/seeds/kudzu)) + investigate_log("had Kudzu planted in it by [key_name(user)] at [AREACOORD(src)]","kudzu") + if(!user.transferItemToLoc(O, src)) + return + to_chat(user, "You plant [O].") + dead = 0 + myseed = O + age = 1 + plant_health = myseed.endurance + lastcycle = world.time + update_icon() + else + to_chat(user, "[src] already has seeds in it!") + + else if(istype(O, /obj/item/plant_analyzer)) + if(myseed) + to_chat(user, "*** [myseed.plantname] ***" ) + to_chat(user, "- Plant Age: [age]") + var/list/text_string = myseed.get_analyzer_text() + if(text_string) + to_chat(user, text_string) + else + to_chat(user, "No plant found.") + to_chat(user, "- Weed level: [weedlevel] / 10") + to_chat(user, "- Pest level: [pestlevel] / 10") + to_chat(user, "- Toxicity level: [toxic] / 100") + to_chat(user, "- Water level: [waterlevel] / [maxwater]") + to_chat(user, "- Nutrition level: [nutrilevel] / [maxnutri]") + to_chat(user, "") + + else if(istype(O, /obj/item/cultivator)) + if(weedlevel > 0) + user.visible_message("[user] uproots the weeds.", "You remove the weeds from [src].") + weedlevel = 0 + update_icon() + else + to_chat(user, "This plot is completely devoid of weeds! It doesn't need uprooting.") + + else if(istype(O, /obj/item/storage/bag/plants)) + attack_hand(user) + for(var/obj/item/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z)) + SEND_SIGNAL(O, COMSIG_TRY_STORAGE_INSERT, G, user, TRUE) + + else if(default_unfasten_wrench(user, O)) + return + + else if(istype(O, /obj/item/wirecutters) && unwrenchable) + if (!anchored) + to_chat(user, "Anchor the tray first!") + return + using_irrigation = !using_irrigation + O.play_tool_sound(src) + user.visible_message("[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.", \ + "You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.") + for(var/obj/machinery/hydroponics/h in range(1,src)) + h.update_icon() + + else if(istype(O, /obj/item/shovel/spade)) + if(!myseed && !weedlevel) + to_chat(user, "[src] doesn't have any plants or weeds!") + return + user.visible_message("[user] starts digging out [src]'s plants...", + "You start digging out [src]'s plants...") + if(O.use_tool(src, user, 50, volume=50) || (!myseed && !weedlevel)) + user.visible_message("[user] digs out the plants in [src]!", "You dig out all of [src]'s plants!") + if(myseed) //Could be that they're just using it as a de-weeder + age = 0 + plant_health = 0 + if(harvest) + harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it + qdel(myseed) + myseed = null + weedlevel = 0 //Has a side effect of cleaning up those nasty weeds + update_icon() + + else + return ..() + +/obj/machinery/hydroponics/can_be_unfasten_wrench(mob/user, silent) + if (!unwrenchable) // case also covered by NODECONSTRUCT checks in default_unfasten_wrench + return CANT_UNFASTEN + + if (using_irrigation) + if (!silent) + to_chat(user, "Disconnect the hoses first!") + return FAILED_UNFASTEN + + return ..() + +/obj/machinery/hydroponics/attack_hand(mob/user) + . = ..() + if(.) + return + if(issilicon(user)) //How does AI know what plant is? + return + if(harvest) + return myseed.harvest(user) + + else if(dead) + dead = 0 + to_chat(user, "You remove the dead plant from [src].") + qdel(myseed) + myseed = null + update_icon() + else + if(user) + examine(user) + +/obj/machinery/hydroponics/proc/update_tray(mob/user) + harvest = 0 + lastproduce = age + if(istype(myseed, /obj/item/seeds/replicapod)) + to_chat(user, "You harvest from the [myseed.plantname].") + else if(myseed.getYield() <= 0) + to_chat(user, "You fail to harvest anything useful!") + else + to_chat(user, "You harvest [myseed.getYield()] items from the [myseed.plantname].") + if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest)) + qdel(myseed) + myseed = null + dead = 0 + update_icon() + +/// Tray Setters - The following procs adjust the tray or plants variables, and make sure that the stat doesn't go out of bounds./// +/obj/machinery/hydroponics/proc/adjustNutri(adjustamt) + nutrilevel = CLAMP(nutrilevel + adjustamt, 0, maxnutri) + +/obj/machinery/hydroponics/proc/adjustWater(adjustamt) + waterlevel = CLAMP(waterlevel + adjustamt, 0, maxwater) + + if(adjustamt>0) + adjustToxic(-round(adjustamt/4))//Toxicity dilutation code. The more water you put in, the lesser the toxin concentration. + +/obj/machinery/hydroponics/proc/adjustHealth(adjustamt) + if(myseed && !dead) + plant_health = CLAMP(plant_health + adjustamt, 0, myseed.endurance) + +/obj/machinery/hydroponics/proc/adjustToxic(adjustamt) + toxic = CLAMP(toxic + adjustamt, 0, 100) + +/obj/machinery/hydroponics/proc/adjustPests(adjustamt) + pestlevel = CLAMP(pestlevel + adjustamt, 0, 10) + +/obj/machinery/hydroponics/proc/adjustWeeds(adjustamt) + weedlevel = CLAMP(weedlevel + adjustamt, 0, 10) + +/obj/machinery/hydroponics/proc/spawnplant() // why would you put strange reagent in a hydro tray you monster I bet you also feed them blood + var/list/livingplants = list(/mob/living/simple_animal/hostile/tree, /mob/living/simple_animal/hostile/killertomato) + var/chosen = pick(livingplants) + var/mob/living/simple_animal/hostile/C = new chosen + C.faction = list("plants") + +/obj/machinery/hydroponics/proc/become_self_sufficient() // Ambrosia Gaia effect + visible_message("[src] begins to glow with a beautiful light!") + self_sustaining = TRUE + update_icon() + +/////////////////////////////////////////////////////////////////////////////// +/obj/machinery/hydroponics/soil //Not actually hydroponics at all! Honk! + name = "soil" + desc = "A patch of dirt." + icon = 'icons/obj/hydroponics/equipment.dmi' + icon_state = "soil" + circuit = null + density = FALSE + use_power = NO_POWER_USE + flags_1 = NODECONSTRUCT_1 + unwrenchable = FALSE + var/buildstacktype = /obj/item/stack/sheet/mineral/sandstone + var/buildstackamount = 3 + +/obj/machinery/hydroponics/soil/update_icon_hoses() + return // Has no hoses + +/obj/machinery/hydroponics/soil/update_icon_lights() + return // Has no lights + +/obj/machinery/hydroponics/soil/attackby(obj/item/O, mob/user, params) + if(istype(O, /obj/item/shovel) && !istype(O, /obj/item/shovel/spade)) //Doesn't include spades because of uprooting plants + to_chat(user, "You clear up [src]!") + new buildstacktype(loc,buildstackamount) + qdel(src) + else + return ..() diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index da83aab3..604fa3e4 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -129,7 +129,7 @@ name = "UNKNOWN" var/datum/reagent/R = GLOB.chemical_reagents_list[reag_id] - if(R && R.id == reagent_id) + if(R && R.type == reagent_id) name = R.name /datum/plant_gene/reagent/New(reag_id = null, reag_rate = 0) @@ -228,7 +228,7 @@ var/obj/item/seeds/seed = G.seed var/stun_len = seed.potency * rate - if(!istype(G, /obj/item/grown/bananapeel) && (!G.reagents || !G.reagents.has_reagent("lube"))) + if(!istype(G, /obj/item/grown/bananapeel) && (!G.reagents || !G.reagents.has_reagent(/datum/reagent/lube))) stun_len /= 3 G.AddComponent(/datum/component/slippery, min(stun_len,140), NONE, CALLBACK(src, .proc/handle_slip, G)) @@ -415,7 +415,7 @@ datum/plant_gene/trait/glow/white pocell.name = "[G.name] battery" pocell.desc = "A rechargeable plant-based power cell. This one has a rating of [DisplayEnergy(pocell.maxcharge)], and you should not swallow it." - if(G.reagents.has_reagent("plasma", 2)) + if(G.reagents.has_reagent(/datum/reagent/toxin/plasma, 2)) pocell.rigged = TRUE qdel(G) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 300b8c58..2c1f6a8f 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -1,410 +1,410 @@ -// ******************************************************** -// Here's all the seeds (plants) that can be used in hydro -// ******************************************************** - -/obj/item/seeds - icon = 'icons/obj/hydroponics/seeds.dmi' - icon_state = "seed" // Unknown plant seed - these shouldn't exist in-game. - w_class = WEIGHT_CLASS_TINY - resistance_flags = FLAMMABLE - var/plantname = "Plants" // Name of plant when planted. - var/product // A type path. The thing that is created when the plant is harvested. - var/species = "" // Used to update icons. Should match the name in the sprites unless all icon_* are overridden. - - var/growing_icon = 'icons/obj/hydroponics/growing.dmi' //the file that stores the sprites of the growing plant from this seed. - var/icon_grow // Used to override grow icon (default is "[species]-grow"). You can use one grow icon for multiple closely related plants with it. - var/icon_dead // Used to override dead icon (default is "[species]-dead"). You can use one dead icon for multiple closely related plants with it. - var/icon_harvest // Used to override harvest icon (default is "[species]-harvest"). If null, plant will use [icon_grow][growthstages]. - - var/lifespan = 25 // How long before the plant begins to take damage from age. - var/endurance = 15 // Amount of health the plant has. - var/maturation = 6 // Used to determine which sprite to switch to when growing. - var/production = 6 // Changes the amount of time needed for a plant to become harvestable. - var/yield = 3 // Amount of growns created per harvest. If is -1, the plant/shroom/weed is never meant to be harvested. - var/potency = 10 // The 'power' of a plant. Generally effects the amount of reagent in a plant, also used in other ways. - var/growthstages = 6 // Amount of growth sprites the plant has. - var/rarity = 0 // How rare the plant is. Used for giving points to cargo when shipping off to CentCom. - var/list/mutatelist = list() // The type of plants that this plant can mutate into. - var/list/genes = list() // Plant genes are stored here, see plant_genes.dm for more info. - var/list/forbiddengenes = list() // Plant genes that the seed may be forbidden from having. - var/list/reagents_add = list() - // A list of reagents to add to product. - // Format: "reagent_id" = potency multiplier - // Stronger reagents must always come first to avoid being displaced by weaker ones. - // Total amount of any reagent in plant is calculated by formula: 1 + round(potency * multiplier) - - var/weed_rate = 1 //If the chance below passes, then this many weeds sprout during growth - var/weed_chance = 5 //Percentage chance per tray update to grow weeds - -/obj/item/seeds/Initialize(mapload, nogenes = 0) - . = ..() - pixel_x = rand(-8, 8) - pixel_y = rand(-8, 8) - - if(!icon_grow) - icon_grow = "[species]-grow" - - if(!icon_dead) - icon_dead = "[species]-dead" - - if(!icon_harvest && !get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism) && yield != -1) - icon_harvest = "[species]-harvest" - - if(!nogenes) // not used on Copy() - genes += new /datum/plant_gene/core/lifespan(lifespan) - genes += new /datum/plant_gene/core/endurance(endurance) - genes += new /datum/plant_gene/core/weed_rate(weed_rate) - genes += new /datum/plant_gene/core/weed_chance(weed_chance) - if(yield != -1) - genes += new /datum/plant_gene/core/yield(yield) - genes += new /datum/plant_gene/core/production(production) - if(potency != -1) - genes += new /datum/plant_gene/core/potency(potency) - - for(var/p in genes) - if(ispath(p)) - genes -= p - genes += new p - - for(var/reag_id in reagents_add) - genes += new /datum/plant_gene/reagent(reag_id, reagents_add[reag_id]) - reagents_from_genes() //quality coding - -/obj/item/seeds/proc/Copy() - var/obj/item/seeds/S = new type(null, 1) - // Copy all the stats - S.lifespan = lifespan - S.endurance = endurance - S.maturation = maturation - S.production = production - S.yield = yield - S.potency = potency - S.weed_rate = weed_rate - S.weed_chance = weed_chance - S.genes = list() - for(var/g in genes) - var/datum/plant_gene/G = g - S.genes += G.Copy() - S.reagents_add = reagents_add.Copy() // Faster than grabbing the list from genes. - return S - -/obj/item/seeds/proc/get_gene(typepath) - return (locate(typepath) in genes) - -obj/item/seeds/proc/is_gene_forbidden(typepath) - return (locate(typepath) in forbiddengenes) - - -/obj/item/seeds/proc/reagents_from_genes() - reagents_add = list() - for(var/datum/plant_gene/reagent/R in genes) - reagents_add[R.reagent_id] = R.rate - -///This proc adds a mutability_flag to a gene -/obj/item/seeds/proc/set_mutability(typepath, mutability) - var/datum/plant_gene/g = get_gene(typepath) - if(g) - g.mutability_flags |= mutability - -///This proc removes a mutability_flag from a gene -/obj/item/seeds/proc/unset_mutability(typepath, mutability) - var/datum/plant_gene/g = get_gene(typepath) - if(g) - g.mutability_flags &= ~mutability - -/obj/item/seeds/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) - adjust_lifespan(rand(-lifemut,lifemut)) - adjust_endurance(rand(-endmut,endmut)) - adjust_production(rand(-productmut,productmut)) - adjust_yield(rand(-yieldmut,yieldmut)) - adjust_potency(rand(-potmut,potmut)) - adjust_weed_rate(rand(-wrmut, wrmut)) - adjust_weed_chance(rand(-wcmut, wcmut)) - if(prob(traitmut)) - add_random_traits(1, 1) - - - -/obj/item/seeds/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables. - if(istype(Proj, /obj/item/projectile/energy/florayield)) - var/rating = 1 - if(istype(loc, /obj/machinery/hydroponics)) - var/obj/machinery/hydroponics/H = loc - rating = H.rating - - if(yield == 0)//Oh god don't divide by zero you'll doom us all. - adjust_yield(1 * rating) - else if(prob(1/(yield * yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2... - adjust_yield(1 * rating) - else - return ..() - - -// Harvest procs -/obj/item/seeds/proc/getYield() - var/return_yield = yield - - var/obj/machinery/hydroponics/parent = loc - if(istype(loc, /obj/machinery/hydroponics)) - if(parent.yieldmod == 0) - return_yield = min(return_yield, 1)//1 if above zero, 0 otherwise - else - return_yield *= (parent.yieldmod) - - return return_yield - - -/obj/item/seeds/proc/harvest(mob/user) - var/obj/machinery/hydroponics/parent = loc //for ease of access - var/t_amount = 0 - var/list/result = list() - var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK - var/product_name - while(t_amount < getYield()) - var/obj/item/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src) - result.Add(t_prod) // User gets a consumable - if(!t_prod) - return - t_amount++ - product_name = t_prod.name - if(getYield() >= 1) - SSblackbox.record_feedback("tally", "food_harvested", getYield(), product_name) - parent.update_tray(user) - - return result - - -/obj/item/seeds/proc/prepare_result(var/obj/item/reagent_containers/food/snacks/grown/T) - if(!T.reagents) - CRASH("[T] has no reagents.") - - for(var/rid in reagents_add) - var/amount = 1 + round(potency * reagents_add[rid], 1) - - var/list/data = null - if(rid == "blood") // Hack to make blood in plants always O- - data = list("blood_type" = "O-") - if(rid == "nutriment" || rid == "vitamin") - // apple tastes of apple. - data = T.tastes - - T.reagents.add_reagent(rid, amount, data) - - -/// Setters procs /// -/obj/item/seeds/proc/adjust_yield(adjustamt) - if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable - yield = CLAMP(yield + adjustamt, 0, 10) - - if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) - yield = 1 // Mushrooms always have a minimum yield of 1. - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/yield) - if(C) - C.value = yield - -/obj/item/seeds/proc/adjust_lifespan(adjustamt) - lifespan = CLAMP(lifespan + adjustamt, 10, 100) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan) - if(C) - C.value = lifespan - -/obj/item/seeds/proc/adjust_endurance(adjustamt) - endurance = CLAMP(endurance + adjustamt, 10, 100) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance) - if(C) - C.value = endurance - -/obj/item/seeds/proc/adjust_production(adjustamt) - if(yield != -1) - production = CLAMP(production + adjustamt, 1, 10) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production) - if(C) - C.value = production - -/obj/item/seeds/proc/adjust_potency(adjustamt) - if(potency != -1) - potency = CLAMP(potency + adjustamt, 0, 100) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) - if(C) - C.value = potency - -/obj/item/seeds/proc/adjust_weed_rate(adjustamt) - weed_rate = CLAMP(weed_rate + adjustamt, 0, 10) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate) - if(C) - C.value = weed_rate - -/obj/item/seeds/proc/adjust_weed_chance(adjustamt) - weed_chance = CLAMP(weed_chance + adjustamt, 0, 67) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance) - if(C) - C.value = weed_chance - -//Directly setting stats - -/obj/item/seeds/proc/set_yield(adjustamt) - if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable - yield = CLAMP(adjustamt, 0, 10) - - if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) - yield = 1 // Mushrooms always have a minimum yield of 1. - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/yield) - if(C) - C.value = yield - -/obj/item/seeds/proc/set_lifespan(adjustamt) - lifespan = CLAMP(adjustamt, 10, 100) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan) - if(C) - C.value = lifespan - -/obj/item/seeds/proc/set_endurance(adjustamt) - endurance = CLAMP(adjustamt, 10, 100) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance) - if(C) - C.value = endurance - -/obj/item/seeds/proc/set_production(adjustamt) - if(yield != -1) - production = CLAMP(adjustamt, 1, 10) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production) - if(C) - C.value = production - -/obj/item/seeds/proc/set_potency(adjustamt) - if(potency != -1) - potency = CLAMP(adjustamt, 0, 100) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) - if(C) - C.value = potency - -/obj/item/seeds/proc/set_weed_rate(adjustamt) - weed_rate = CLAMP(adjustamt, 0, 10) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate) - if(C) - C.value = weed_rate - -/obj/item/seeds/proc/set_weed_chance(adjustamt) - weed_chance = CLAMP(adjustamt, 0, 67) - var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance) - if(C) - C.value = weed_chance - - -/obj/item/seeds/proc/get_analyzer_text() //in case seeds have something special to tell to the analyzer - var/text = "" - if(!get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism) && !get_gene(/datum/plant_gene/trait/plant_type/alien_properties)) - text += "- Plant type: Normal plant\n" - if(get_gene(/datum/plant_gene/trait/plant_type/weed_hardy)) - text += "- Plant type: Weed. Can grow in nutrient-poor soil.\n" - if(get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) - text += "- Plant type: Mushroom. Can grow in dry soil.\n" - if(get_gene(/datum/plant_gene/trait/plant_type/alien_properties)) - text += "- Plant type: UNKNOWN \n" - if(potency != -1) - text += "- Potency: [potency]\n" - if(yield != -1) - text += "- Yield: [yield]\n" - text += "- Maturation speed: [maturation]\n" - if(yield != -1) - text += "- Production speed: [production]\n" - text += "- Endurance: [endurance]\n" - text += "- Lifespan: [lifespan]\n" - text += "- Weed Growth Rate: [weed_rate]\n" - text += "- Weed Vulnerability: [weed_chance]\n" - if(rarity) - text += "- Species Discovery Value: [rarity]\n" - var/all_traits = "" - for(var/datum/plant_gene/trait/traits in genes) - if(istype(traits, /datum/plant_gene/trait/plant_type)) - continue - all_traits += " [traits.get_name()]" - text += "- Plant Traits:[all_traits]\n" - - text += "*---------*" - - return text - -/obj/item/seeds/proc/on_chem_reaction(datum/reagents/S) //in case seeds have some special interaction with special chems - return - -/obj/item/seeds/attackby(obj/item/O, mob/user, params) - if (istype(O, /obj/item/plant_analyzer)) - to_chat(user, "*---------*\n This is \a [src].") - var/text = get_analyzer_text() - if(text) - to_chat(user, "[text]") - - return - ..() // Fallthrough to item/attackby() so that bags can pick seeds up - - - - - - - -// Checks plants for broken tray icons. Use Advanced Proc Call to activate. -// Maybe some day it would be used as unit test. -/proc/check_plants_growth_stages_icons() - var/list/states = icon_states('icons/obj/hydroponics/growing.dmi') - states |= icon_states('icons/obj/hydroponics/growing_fruits.dmi') - states |= icon_states('icons/obj/hydroponics/growing_flowers.dmi') - states |= icon_states('icons/obj/hydroponics/growing_mushrooms.dmi') - states |= icon_states('icons/obj/hydroponics/growing_vegetables.dmi') - var/list/paths = typesof(/obj/item/seeds) - /obj/item/seeds - typesof(/obj/item/seeds/sample) - - for(var/seedpath in paths) - var/obj/item/seeds/seed = new seedpath - - for(var/i in 1 to seed.growthstages) - if("[seed.icon_grow][i]" in states) - continue - to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_grow][i] icon!") - - if(!(seed.icon_dead in states)) - to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_dead] icon!") - - if(seed.icon_harvest) // mushrooms have no grown sprites, same for items with no product - if(!(seed.icon_harvest in states)) - to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_harvest] icon!") - -/obj/item/seeds/proc/randomize_stats() - set_lifespan(rand(25, 60)) - set_endurance(rand(15, 35)) - set_production(rand(2, 10)) - set_yield(rand(1, 10)) - set_potency(rand(10, 35)) - set_weed_rate(rand(1, 10)) - set_weed_chance(rand(5, 100)) - maturation = rand(6, 12) - -/obj/item/seeds/proc/add_random_reagents(lower = 0, upper = 2) - var/amount_random_reagents = rand(lower, upper) - for(var/i in 1 to amount_random_reagents) - var/random_amount = rand(4, 15) * 0.01 // this must be multiplied by 0.01, otherwise, it will not properly associate - var/datum/plant_gene/reagent/R = new(get_random_reagent_id(), random_amount) - if(R.can_add(src)) - genes += R - else - qdel(R) - reagents_from_genes() - -/obj/item/seeds/proc/add_random_traits(lower = 0, upper = 2) - var/amount_random_traits = rand(lower, upper) - for(var/i in 1 to amount_random_traits) - var/random_trait = pick((subtypesof(/datum/plant_gene/trait)-typesof(/datum/plant_gene/trait/plant_type))) - var/datum/plant_gene/trait/T = new random_trait - if(T.can_add(src) && !is_gene_forbidden(T)) - genes += T - else - qdel(T) - -/obj/item/seeds/proc/add_random_plant_type(normal_plant_chance = 75) - if(prob(normal_plant_chance)) - var/random_plant_type = pick(subtypesof(/datum/plant_gene/trait/plant_type)) - var/datum/plant_gene/trait/plant_type/P = new random_plant_type - if(P.can_add(src)) - genes += P - else - qdel(P) +// ******************************************************** +// Here's all the seeds (plants) that can be used in hydro +// ******************************************************** + +/obj/item/seeds + icon = 'icons/obj/hydroponics/seeds.dmi' + icon_state = "seed" // Unknown plant seed - these shouldn't exist in-game. + w_class = WEIGHT_CLASS_TINY + resistance_flags = FLAMMABLE + var/plantname = "Plants" // Name of plant when planted. + var/product // A type path. The thing that is created when the plant is harvested. + var/species = "" // Used to update icons. Should match the name in the sprites unless all icon_* are overridden. + + var/growing_icon = 'icons/obj/hydroponics/growing.dmi' //the file that stores the sprites of the growing plant from this seed. + var/icon_grow // Used to override grow icon (default is "[species]-grow"). You can use one grow icon for multiple closely related plants with it. + var/icon_dead // Used to override dead icon (default is "[species]-dead"). You can use one dead icon for multiple closely related plants with it. + var/icon_harvest // Used to override harvest icon (default is "[species]-harvest"). If null, plant will use [icon_grow][growthstages]. + + var/lifespan = 25 // How long before the plant begins to take damage from age. + var/endurance = 15 // Amount of health the plant has. + var/maturation = 6 // Used to determine which sprite to switch to when growing. + var/production = 6 // Changes the amount of time needed for a plant to become harvestable. + var/yield = 3 // Amount of growns created per harvest. If is -1, the plant/shroom/weed is never meant to be harvested. + var/potency = 10 // The 'power' of a plant. Generally effects the amount of reagent in a plant, also used in other ways. + var/growthstages = 6 // Amount of growth sprites the plant has. + var/rarity = 0 // How rare the plant is. Used for giving points to cargo when shipping off to CentCom. + var/list/mutatelist = list() // The type of plants that this plant can mutate into. + var/list/genes = list() // Plant genes are stored here, see plant_genes.dm for more info. + var/list/forbiddengenes = list() // Plant genes that the seed may be forbidden from having. + var/list/reagents_add = list() + // A list of reagents to add to product. + // Format: "reagent_id" = potency multiplier + // Stronger reagents must always come first to avoid being displaced by weaker ones. + // Total amount of any reagent in plant is calculated by formula: 1 + round(potency * multiplier) + + var/weed_rate = 1 //If the chance below passes, then this many weeds sprout during growth + var/weed_chance = 5 //Percentage chance per tray update to grow weeds + +/obj/item/seeds/Initialize(mapload, nogenes = 0) + . = ..() + pixel_x = rand(-8, 8) + pixel_y = rand(-8, 8) + + if(!icon_grow) + icon_grow = "[species]-grow" + + if(!icon_dead) + icon_dead = "[species]-dead" + + if(!icon_harvest && !get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism) && yield != -1) + icon_harvest = "[species]-harvest" + + if(!nogenes) // not used on Copy() + genes += new /datum/plant_gene/core/lifespan(lifespan) + genes += new /datum/plant_gene/core/endurance(endurance) + genes += new /datum/plant_gene/core/weed_rate(weed_rate) + genes += new /datum/plant_gene/core/weed_chance(weed_chance) + if(yield != -1) + genes += new /datum/plant_gene/core/yield(yield) + genes += new /datum/plant_gene/core/production(production) + if(potency != -1) + genes += new /datum/plant_gene/core/potency(potency) + + for(var/p in genes) + if(ispath(p)) + genes -= p + genes += new p + + for(var/reag_id in reagents_add) + genes += new /datum/plant_gene/reagent(reag_id, reagents_add[reag_id]) + reagents_from_genes() //quality coding + +/obj/item/seeds/proc/Copy() + var/obj/item/seeds/S = new type(null, 1) + // Copy all the stats + S.lifespan = lifespan + S.endurance = endurance + S.maturation = maturation + S.production = production + S.yield = yield + S.potency = potency + S.weed_rate = weed_rate + S.weed_chance = weed_chance + S.genes = list() + for(var/g in genes) + var/datum/plant_gene/G = g + S.genes += G.Copy() + S.reagents_add = reagents_add.Copy() // Faster than grabbing the list from genes. + return S + +/obj/item/seeds/proc/get_gene(typepath) + return (locate(typepath) in genes) + +obj/item/seeds/proc/is_gene_forbidden(typepath) + return (locate(typepath) in forbiddengenes) + + +/obj/item/seeds/proc/reagents_from_genes() + reagents_add = list() + for(var/datum/plant_gene/reagent/R in genes) + reagents_add[R.reagent_id] = R.rate + +///This proc adds a mutability_flag to a gene +/obj/item/seeds/proc/set_mutability(typepath, mutability) + var/datum/plant_gene/g = get_gene(typepath) + if(g) + g.mutability_flags |= mutability + +///This proc removes a mutability_flag from a gene +/obj/item/seeds/proc/unset_mutability(typepath, mutability) + var/datum/plant_gene/g = get_gene(typepath) + if(g) + g.mutability_flags &= ~mutability + +/obj/item/seeds/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) + adjust_lifespan(rand(-lifemut,lifemut)) + adjust_endurance(rand(-endmut,endmut)) + adjust_production(rand(-productmut,productmut)) + adjust_yield(rand(-yieldmut,yieldmut)) + adjust_potency(rand(-potmut,potmut)) + adjust_weed_rate(rand(-wrmut, wrmut)) + adjust_weed_chance(rand(-wcmut, wcmut)) + if(prob(traitmut)) + add_random_traits(1, 1) + + + +/obj/item/seeds/bullet_act(obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables. + if(istype(Proj, /obj/item/projectile/energy/florayield)) + var/rating = 1 + if(istype(loc, /obj/machinery/hydroponics)) + var/obj/machinery/hydroponics/H = loc + rating = H.rating + + if(yield == 0)//Oh god don't divide by zero you'll doom us all. + adjust_yield(1 * rating) + else if(prob(1/(yield * yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2... + adjust_yield(1 * rating) + else + return ..() + + +// Harvest procs +/obj/item/seeds/proc/getYield() + var/return_yield = yield + + var/obj/machinery/hydroponics/parent = loc + if(istype(loc, /obj/machinery/hydroponics)) + if(parent.yieldmod == 0) + return_yield = min(return_yield, 1)//1 if above zero, 0 otherwise + else + return_yield *= (parent.yieldmod) + + return return_yield + + +/obj/item/seeds/proc/harvest(mob/user) + var/obj/machinery/hydroponics/parent = loc //for ease of access + var/t_amount = 0 + var/list/result = list() + var/output_loc = parent.Adjacent(user) ? user.loc : parent.loc //needed for TK + var/product_name + while(t_amount < getYield()) + var/obj/item/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src) + result.Add(t_prod) // User gets a consumable + if(!t_prod) + return + t_amount++ + product_name = t_prod.name + if(getYield() >= 1) + SSblackbox.record_feedback("tally", "food_harvested", getYield(), product_name) + parent.update_tray(user) + + return result + + +/obj/item/seeds/proc/prepare_result(var/obj/item/reagent_containers/food/snacks/grown/T) + if(!T.reagents) + CRASH("[T] has no reagents.") + + for(var/rid in reagents_add) + var/amount = 1 + round(potency * reagents_add[rid], 1) + + var/list/data = null + if(rid == "blood") // Hack to make blood in plants always O- + data = list("blood_type" = "O-") + if(rid == /datum/reagent/consumable/nutriment || rid == /datum/reagent/consumable/nutriment/vitamin) + // apple tastes of apple. + data = T.tastes + + T.reagents.add_reagent(rid, amount, data) + + +/// Setters procs /// +/obj/item/seeds/proc/adjust_yield(adjustamt) + if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable + yield = CLAMP(yield + adjustamt, 0, 10) + + if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) + yield = 1 // Mushrooms always have a minimum yield of 1. + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/yield) + if(C) + C.value = yield + +/obj/item/seeds/proc/adjust_lifespan(adjustamt) + lifespan = CLAMP(lifespan + adjustamt, 10, 100) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan) + if(C) + C.value = lifespan + +/obj/item/seeds/proc/adjust_endurance(adjustamt) + endurance = CLAMP(endurance + adjustamt, 10, 100) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance) + if(C) + C.value = endurance + +/obj/item/seeds/proc/adjust_production(adjustamt) + if(yield != -1) + production = CLAMP(production + adjustamt, 1, 10) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production) + if(C) + C.value = production + +/obj/item/seeds/proc/adjust_potency(adjustamt) + if(potency != -1) + potency = CLAMP(potency + adjustamt, 0, 100) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) + if(C) + C.value = potency + +/obj/item/seeds/proc/adjust_weed_rate(adjustamt) + weed_rate = CLAMP(weed_rate + adjustamt, 0, 10) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate) + if(C) + C.value = weed_rate + +/obj/item/seeds/proc/adjust_weed_chance(adjustamt) + weed_chance = CLAMP(weed_chance + adjustamt, 0, 67) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance) + if(C) + C.value = weed_chance + +//Directly setting stats + +/obj/item/seeds/proc/set_yield(adjustamt) + if(yield != -1) // Unharvestable shouldn't suddenly turn harvestable + yield = CLAMP(adjustamt, 0, 10) + + if(yield <= 0 && get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) + yield = 1 // Mushrooms always have a minimum yield of 1. + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/yield) + if(C) + C.value = yield + +/obj/item/seeds/proc/set_lifespan(adjustamt) + lifespan = CLAMP(adjustamt, 10, 100) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/lifespan) + if(C) + C.value = lifespan + +/obj/item/seeds/proc/set_endurance(adjustamt) + endurance = CLAMP(adjustamt, 10, 100) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/endurance) + if(C) + C.value = endurance + +/obj/item/seeds/proc/set_production(adjustamt) + if(yield != -1) + production = CLAMP(adjustamt, 1, 10) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/production) + if(C) + C.value = production + +/obj/item/seeds/proc/set_potency(adjustamt) + if(potency != -1) + potency = CLAMP(adjustamt, 0, 100) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/potency) + if(C) + C.value = potency + +/obj/item/seeds/proc/set_weed_rate(adjustamt) + weed_rate = CLAMP(adjustamt, 0, 10) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_rate) + if(C) + C.value = weed_rate + +/obj/item/seeds/proc/set_weed_chance(adjustamt) + weed_chance = CLAMP(adjustamt, 0, 67) + var/datum/plant_gene/core/C = get_gene(/datum/plant_gene/core/weed_chance) + if(C) + C.value = weed_chance + + +/obj/item/seeds/proc/get_analyzer_text() //in case seeds have something special to tell to the analyzer + var/text = "" + if(!get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism) && !get_gene(/datum/plant_gene/trait/plant_type/alien_properties)) + text += "- Plant type: Normal plant\n" + if(get_gene(/datum/plant_gene/trait/plant_type/weed_hardy)) + text += "- Plant type: Weed. Can grow in nutrient-poor soil.\n" + if(get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) + text += "- Plant type: Mushroom. Can grow in dry soil.\n" + if(get_gene(/datum/plant_gene/trait/plant_type/alien_properties)) + text += "- Plant type: UNKNOWN \n" + if(potency != -1) + text += "- Potency: [potency]\n" + if(yield != -1) + text += "- Yield: [yield]\n" + text += "- Maturation speed: [maturation]\n" + if(yield != -1) + text += "- Production speed: [production]\n" + text += "- Endurance: [endurance]\n" + text += "- Lifespan: [lifespan]\n" + text += "- Weed Growth Rate: [weed_rate]\n" + text += "- Weed Vulnerability: [weed_chance]\n" + if(rarity) + text += "- Species Discovery Value: [rarity]\n" + var/all_traits = "" + for(var/datum/plant_gene/trait/traits in genes) + if(istype(traits, /datum/plant_gene/trait/plant_type)) + continue + all_traits += " [traits.get_name()]" + text += "- Plant Traits:[all_traits]\n" + + text += "*---------*" + + return text + +/obj/item/seeds/proc/on_chem_reaction(datum/reagents/S) //in case seeds have some special interaction with special chems + return + +/obj/item/seeds/attackby(obj/item/O, mob/user, params) + if (istype(O, /obj/item/plant_analyzer)) + to_chat(user, "*---------*\n This is \a [src].") + var/text = get_analyzer_text() + if(text) + to_chat(user, "[text]") + + return + ..() // Fallthrough to item/attackby() so that bags can pick seeds up + + + + + + + +// Checks plants for broken tray icons. Use Advanced Proc Call to activate. +// Maybe some day it would be used as unit test. +/proc/check_plants_growth_stages_icons() + var/list/states = icon_states('icons/obj/hydroponics/growing.dmi') + states |= icon_states('icons/obj/hydroponics/growing_fruits.dmi') + states |= icon_states('icons/obj/hydroponics/growing_flowers.dmi') + states |= icon_states('icons/obj/hydroponics/growing_mushrooms.dmi') + states |= icon_states('icons/obj/hydroponics/growing_vegetables.dmi') + var/list/paths = typesof(/obj/item/seeds) - /obj/item/seeds - typesof(/obj/item/seeds/sample) + + for(var/seedpath in paths) + var/obj/item/seeds/seed = new seedpath + + for(var/i in 1 to seed.growthstages) + if("[seed.icon_grow][i]" in states) + continue + to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_grow][i] icon!") + + if(!(seed.icon_dead in states)) + to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_dead] icon!") + + if(seed.icon_harvest) // mushrooms have no grown sprites, same for items with no product + if(!(seed.icon_harvest in states)) + to_chat(world, "[seed.name] ([seed.type]) lacks the [seed.icon_harvest] icon!") + +/obj/item/seeds/proc/randomize_stats() + set_lifespan(rand(25, 60)) + set_endurance(rand(15, 35)) + set_production(rand(2, 10)) + set_yield(rand(1, 10)) + set_potency(rand(10, 35)) + set_weed_rate(rand(1, 10)) + set_weed_chance(rand(5, 100)) + maturation = rand(6, 12) + +/obj/item/seeds/proc/add_random_reagents(lower = 0, upper = 2) + var/amount_random_reagents = rand(lower, upper) + for(var/i in 1 to amount_random_reagents) + var/random_amount = rand(4, 15) * 0.01 // this must be multiplied by 0.01, otherwise, it will not properly associate + var/datum/plant_gene/reagent/R = new(get_random_reagent_id(), random_amount) + if(R.can_add(src)) + genes += R + else + qdel(R) + reagents_from_genes() + +/obj/item/seeds/proc/add_random_traits(lower = 0, upper = 2) + var/amount_random_traits = rand(lower, upper) + for(var/i in 1 to amount_random_traits) + var/random_trait = pick((subtypesof(/datum/plant_gene/trait)-typesof(/datum/plant_gene/trait/plant_type))) + var/datum/plant_gene/trait/T = new random_trait + if(T.can_add(src) && !is_gene_forbidden(T)) + genes += T + else + qdel(T) + +/obj/item/seeds/proc/add_random_plant_type(normal_plant_chance = 75) + if(prob(normal_plant_chance)) + var/random_plant_type = pick(subtypesof(/datum/plant_gene/trait/plant_type)) + var/datum/plant_gene/trait/plant_type/P = new random_plant_type + if(P.can_add(src)) + genes += P + else + qdel(P) diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm index d4899a46..f3c00f9e 100644 --- a/code/modules/integrated_electronics/passive/power.dm +++ b/code/modules/integrated_electronics/passive/power.dm @@ -96,7 +96,8 @@ activators = list("push ref" = IC_PINTYPE_PULSE_IN) spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH var/volume = 60 - var/list/fuel = list("plasma" = 50000, "welding_fuel" = 15000, "carbon" = 10000, "ethanol" = 10000, "nutriment" = 8000) + var/list/fuel = list(/datum/reagent/toxin/plasma = 50000, /datum/reagent/fuel = 15000, /datum/reagent/carbon = 10000, + /datum/reagent/consumable/ethanol = 10000, /datum/reagent/consumable/nutriment = 8000) var/multi = 1 var/lfwb =TRUE @@ -119,7 +120,7 @@ if(assembly) if(assembly.battery) var/bp = 5000 - if(reagents.get_reagent_amount("blood")) //only blood is powerful enough to power the station(c) + if(reagents.get_reagent_amount(/datum/reagent/blood)) //only blood is powerful enough to power the station(c) var/datum/reagent/blood/B = locate() in reagents.reagent_list if(lfwb) if(B && B.data["cloneable"]) @@ -127,7 +128,7 @@ if(M && (M.stat != DEAD) && (M.client)) bp = 500000 if((assembly.battery.maxcharge-assembly.battery.charge) / GLOB.CELLRATE > bp) - if(reagents.remove_reagent("blood", 1)) + if(reagents.remove_reagent(/datum/reagent/blood, 1)) assembly.give_power(bp) for(var/I in fuel) if((assembly.battery.maxcharge-assembly.battery.charge) / GLOB.CELLRATE > fuel[I]) diff --git a/code/modules/integrated_electronics/subtypes/reagents.dm b/code/modules/integrated_electronics/subtypes/reagents.dm index 027a0365..0fc9f58d 100644 --- a/code/modules/integrated_electronics/subtypes/reagents.dm +++ b/code/modules/integrated_electronics/subtypes/reagents.dm @@ -424,7 +424,7 @@ if(1) var/cont[0] for(var/datum/reagent/RE in reagents.reagent_list) - cont += RE.id + cont += RE.type set_pin_data(IC_OUTPUT, 3, cont) push_data() if(2) @@ -492,11 +492,11 @@ for(var/datum/reagent/G in source.reagents.reagent_list) if(!direction_mode) - if(G.id in demand) - source.reagents.trans_id_to(target, G.id, transfer_amount) + if(G.type in demand) + source.reagents.trans_id_to(target, G.type, transfer_amount) else - if(!(G.id in demand)) - source.reagents.trans_id_to(target, G.id, transfer_amount) + if(!(G.type in demand)) + source.reagents.trans_id_to(target, G.type, transfer_amount) activate_pin(2) push_data() diff --git a/code/modules/mining/lavaland/ash_flora.dm b/code/modules/mining/lavaland/ash_flora.dm index 4077f21e..ea0174d2 100644 --- a/code/modules/mining/lavaland/ash_flora.dm +++ b/code/modules/mining/lavaland/ash_flora.dm @@ -148,7 +148,7 @@ desc = "Some shavings from a tall mushroom. With enough, might serve as a bowl." icon = 'icons/obj/lavaland/ash_flora.dmi' icon_state = "mushroom_shavings" - list_reagents = list("sugar" = 3, "ethanol" = 2, "stabilizing_agent" = 3, "minttoxin" = 2) + list_reagents = list(/datum/reagent/consumable/sugar = 3, /datum/reagent/consumable/ethanol = 2, /datum/reagent/stabilizing_agent = 3, /datum/reagent/toxin/minttoxin = 2) w_class = WEIGHT_CLASS_TINY resistance_flags = FLAMMABLE max_integrity = 100 @@ -166,7 +166,7 @@ /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_leaf name = "mushroom leaf" desc = "A leaf, from a mushroom." - list_reagents = list("nutriment" = 3, "vitfro" = 2, "nicotine" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/vitfro = 2, /datum/reagent/drug/nicotine = 2) icon_state = "mushroom_leaf" seed = /obj/item/seeds/lavaland/porcini wine_power = 40 @@ -174,7 +174,7 @@ /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_cap name = "mushroom cap" desc = "The cap of a large mushroom." - list_reagents = list("mindbreaker" = 2, "entpoly" = 4, "mushroomhallucinogen" = 2) + list_reagents = list(/datum/reagent/toxin/mindbreaker = 2, /datum/reagent/consumable/entpoly = 4, /datum/reagent/drug/mushroomhallucinogen = 2) icon_state = "mushroom_cap" seed = /obj/item/seeds/lavaland/inocybe wine_power = 70 @@ -182,14 +182,14 @@ /obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_stem name = "mushroom stem" desc = "A long mushroom stem. It's slightly glowing." - list_reagents = list("tinlux" = 2, "vitamin" = 1, "space_drugs" = 1) + list_reagents = list(/datum/reagent/consumable/tinlux = 2, /datum/reagent/consumable/nutriment/vitamin = 1, /datum/reagent/drug/space_drugs = 1) icon_state = "mushroom_stem" seed = /obj/item/seeds/lavaland/ember wine_power = 60 /obj/item/reagent_containers/food/snacks/grown/ash_flora/cactus_fruit name = "cactus fruit" - list_reagents = list("vitamin" = 2, "nutriment" = 2, "vitfro" = 6) + list_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/vitfro = 6) desc = "A cactus fruit covered in a thick, reddish skin. And some ash." icon_state = "cactus_fruit" seed = /obj/item/seeds/lavaland/cactus @@ -218,7 +218,7 @@ else if(contents.len >= 20) to_chat(user, "You can't add more ingredients to [src]!") else - if(reagents.has_reagent("water", 10)) //are we starting a soup or a salad? + if(reagents.has_reagent(/datum/reagent/water, 10)) //are we starting a soup or a salad? var/obj/item/reagent_containers/food/snacks/customizable/A = new/obj/item/reagent_containers/food/snacks/customizable/soup/ashsoup(get_turf(src)) A.initialize_custom_food(src, S, user) else diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 8790e171..efac7976 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -577,7 +577,7 @@ /obj/item/reagent_containers/glass/bottle/potion/flight name = "strange elixir" desc = "A flask with an almost-holy aura emitting from it. The label on the bottle says: 'erqo'hyy tvi'rf lbh jv'atf'." - list_reagents = list("flightpotion" = 5) + list_reagents = list(/datum/reagent/flightpotion = 5) /obj/item/reagent_containers/glass/bottle/potion/update_icon() if(reagents.total_volume) @@ -587,7 +587,6 @@ /datum/reagent/flightpotion name = "Flight Potion" - id = "flightpotion" description = "Strange mutagenic compound of unknown origins." reagent_state = LIQUID color = "#FFEBEB" diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 952b4992..2363e6a3 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -1,487 +1,487 @@ - -#define GIBTONITE_QUALITY_HIGH 3 -#define GIBTONITE_QUALITY_MEDIUM 2 -#define GIBTONITE_QUALITY_LOW 1 - -#define ORESTACK_OVERLAYS_MAX 10 - -/**********************Mineral ores**************************/ - -/obj/item/stack/ore - name = "rock" - icon = 'icons/obj/mining.dmi' - icon_state = "ore" - item_state = "ore" - full_w_class = WEIGHT_CLASS_BULKY - singular_name = "ore chunk" - var/points = 0 //How many points this ore gets you from the ore redemption machine - var/refined_type = null //What this ore defaults to being refined into - novariants = TRUE // Ore stacks handle their icon updates themselves to keep the illusion that there's more going - var/list/stack_overlays - -/obj/item/stack/ore/update_icon() - var/difference = min(ORESTACK_OVERLAYS_MAX, amount) - (LAZYLEN(stack_overlays)+1) - if(difference == 0) - return - else if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess. - cut_overlays() - if (LAZYLEN(stack_overlays)-difference <= 0) - stack_overlays = null; - else - stack_overlays.len += difference - else if(difference > 0) //amount > stack_overlays, add some. - cut_overlays() - for(var/i in 1 to difference) - var/mutable_appearance/newore = mutable_appearance(icon, icon_state) - newore.pixel_x = rand(-8,8) - newore.pixel_y = rand(-8,8) - LAZYADD(stack_overlays, newore) - if (stack_overlays) - add_overlay(stack_overlays) - -/obj/item/stack/ore/welder_act(mob/living/user, obj/item/I) - if(!refined_type) - return TRUE - - if(I.use_tool(src, user, 0, volume=50, amount=15)) - new refined_type(drop_location()) - use(1) - - return TRUE - -/obj/item/stack/ore/fire_act(exposed_temperature, exposed_volume) - . = ..() - if(isnull(refined_type)) - return - else - var/probability = (rand(0,100))/100 - var/burn_value = probability*amount - var/amountrefined = round(burn_value, 1) - if(amountrefined < 1) - qdel(src) - else - new refined_type(drop_location(),amountrefined) - qdel(src) - -/obj/item/stack/ore/uranium - name = "uranium ore" - icon_state = "Uranium ore" - item_state = "Uranium ore" - singular_name = "uranium ore chunk" - points = 30 - materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/uranium - -/obj/item/stack/ore/iron - name = "iron ore" - icon_state = "Iron ore" - item_state = "Iron ore" - singular_name = "iron ore chunk" - points = 1 - materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/metal - -/obj/item/stack/ore/glass - name = "sand pile" - icon_state = "Glass ore" - item_state = "Glass ore" - singular_name = "sand pile" - points = 1 - materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/glass - w_class = WEIGHT_CLASS_TINY - -GLOBAL_LIST_INIT(sand_recipes, list(\ - new /datum/stack_recipe("sandstone", /obj/item/stack/sheet/mineral/sandstone, 1, 1, 50)\ - )) - -/obj/item/stack/ore/glass/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.sand_recipes - . = ..() - -/obj/item/stack/ore/glass/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) - if(..() || !ishuman(hit_atom)) - return - var/mob/living/carbon/human/C = hit_atom - if(C.head && C.head.flags_cover & HEADCOVERSEYES) - visible_message("[C]'s headgear blocks the sand!") - return - if(C.wear_mask && C.wear_mask.flags_cover & MASKCOVERSEYES) - visible_message("[C]'s mask blocks the sand!") - return - if(C.glasses && C.glasses.flags_cover & GLASSESCOVERSEYES) - visible_message("[C]'s glasses block the sand!") - return - C.adjust_blurriness(6) - C.adjustStaminaLoss(15)//the pain from your eyes burning does stamina damage - C.confused += 5 - to_chat(C, "\The [src] gets into your eyes! The pain, it burns!") - qdel(src) - -/obj/item/stack/ore/glass/ex_act(severity, target) - if (severity == EXPLODE_NONE) - return - qdel(src) - -/obj/item/stack/ore/glass/basalt - name = "volcanic ash" - icon_state = "volcanic_sand" - icon_state = "volcanic_sand" - singular_name = "volcanic ash pile" - -/obj/item/stack/ore/plasma - name = "plasma ore" - icon_state = "Plasma ore" - item_state = "Plasma ore" - singular_name = "plasma ore chunk" - points = 15 - materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/plasma - -/obj/item/stack/ore/plasma/welder_act(mob/living/user, obj/item/I) - to_chat(user, "You can't hit a high enough temperature to smelt [src] properly!") - return TRUE - - -/obj/item/stack/ore/silver - name = "silver ore" - icon_state = "Silver ore" - item_state = "Silver ore" - singular_name = "silver ore chunk" - points = 16 - materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/silver - -/obj/item/stack/ore/gold - name = "gold ore" - icon_state = "Gold ore" - icon_state = "Gold ore" - singular_name = "gold ore chunk" - points = 18 - materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/gold - -/obj/item/stack/ore/diamond - name = "diamond ore" - icon_state = "Diamond ore" - item_state = "Diamond ore" - singular_name = "diamond ore chunk" - points = 50 - materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/diamond - -/obj/item/stack/ore/bananium - name = "bananium ore" - icon_state = "Bananium ore" - item_state = "Bananium ore" - singular_name = "bananium ore chunk" - points = 60 - materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/bananium - -/obj/item/stack/ore/titanium - name = "titanium ore" - icon_state = "Titanium ore" - item_state = "Titanium ore" - singular_name = "titanium ore chunk" - points = 50 - materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT) - refined_type = /obj/item/stack/sheet/mineral/titanium - -/obj/item/stack/ore/slag - name = "slag" - desc = "Completely useless." - icon_state = "slag" - item_state = "slag" - singular_name = "slag chunk" - -/obj/item/twohanded/required/gibtonite - name = "gibtonite ore" - desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law." - icon = 'icons/obj/mining.dmi' - icon_state = "Gibtonite ore" - item_state = "Gibtonite ore" - w_class = WEIGHT_CLASS_BULKY - throw_range = 0 - var/primed = FALSE - var/det_time = 100 - var/quality = GIBTONITE_QUALITY_LOW //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better - var/attacher = "UNKNOWN" - var/det_timer - -/obj/item/twohanded/required/gibtonite/Destroy() - qdel(wires) - wires = null - return ..() - -/obj/item/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params) - if(!wires && istype(I, /obj/item/assembly/igniter)) - user.visible_message("[user] attaches [I] to [src].", "You attach [I] to [src].") - wires = new /datum/wires/explosive/gibtonite(src) - attacher = key_name(user) - qdel(I) - add_overlay("Gibtonite_igniter") - return - - if(wires && !primed) - if(is_wire_tool(I)) - wires.interact(user) - return - - if(I.tool_behaviour == TOOL_MINING || istype(I, /obj/item/resonator) || I.force >= 10) - GibtoniteReaction(user) - return - if(primed) - if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || istype(I, /obj/item/multitool)) - primed = FALSE - if(det_timer) - deltimer(det_timer) - user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "You stopped the chain reaction. ...The ore's quality looks diminished.") - icon_state = "Gibtonite ore" - quality = GIBTONITE_QUALITY_LOW - return - ..() - -/obj/item/twohanded/required/gibtonite/attack_self(user) - if(wires) - wires.interact(user) - else - ..() - -/obj/item/twohanded/required/gibtonite/bullet_act(obj/item/projectile/P) - GibtoniteReaction(P.firer) - ..() - -/obj/item/twohanded/required/gibtonite/ex_act() - GibtoniteReaction(null, 1) - - - -/obj/item/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0) - if(!primed) - primed = TRUE - playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1) - icon_state = "Gibtonite active" - var/turf/bombturf = get_turf(src) - var/notify_admins = 0 - if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel - notify_admins = 1 - - if(notify_admins) - if(triggered_by == 1) - message_admins("An explosion has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].") - else if(triggered_by == 2) - message_admins("A signal has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)]. Igniter attacher: [ADMIN_LOOKUPFLW(attacher)]") - else - message_admins("[ADMIN_LOOKUPFLW(attacher)] has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].") - if(triggered_by == 1) - log_game("An explosion has primed a [name] for detonation at [AREACOORD(bombturf)]") - else if(triggered_by == 2) - log_game("A signal has primed a [name] for detonation at [AREACOORD(bombturf)]. Igniter attacher: [key_name(attacher)].") - else - user.visible_message("[user] strikes \the [src], causing a chain reaction!", "You strike \the [src], causing a chain reaction.") - log_game("[key_name(user)] has primed a [name] for detonation at [AREACOORD(bombturf)]") - det_timer = addtimer(CALLBACK(src, .proc/detonate, notify_admins), det_time, TIMER_STOPPABLE) - -/obj/item/twohanded/required/gibtonite/proc/detonate(notify_admins) - if(primed) - switch(quality) - if(GIBTONITE_QUALITY_HIGH) - explosion(src,2,4,9,adminlog = notify_admins) - if(GIBTONITE_QUALITY_MEDIUM) - explosion(src,1,2,5,adminlog = notify_admins) - if(GIBTONITE_QUALITY_LOW) - explosion(src,0,1,3,adminlog = notify_admins) - qdel(src) - -/obj/item/stack/ore/Initialize() - . = ..() - pixel_x = rand(0,16)-8 - pixel_y = rand(0,8)-8 - -/obj/item/stack/ore/ex_act(severity, target) - if (!severity || severity >= 2) - return - qdel(src) - - -/*****************************Coin********************************/ - -// The coin's value is a value of it's materials. -// Yes, the gold standard makes a come-back! -// This is the only way to make coins that are possible to produce on station actually worth anything. -/obj/item/coin - icon = 'icons/obj/economy.dmi' - name = "coin" - icon_state = "coin__heads" - flags_1 = CONDUCT_1 - force = 1 - throwforce = 2 - w_class = WEIGHT_CLASS_TINY - var/string_attached - var/list/sideslist = list("heads","tails") - var/cmineral = null - var/cooldown = 0 - var/value = 1 - var/coinflip - -/obj/item/coin/suicide_act(mob/living/user) - user.visible_message("[user] contemplates suicide with \the [src]!") - if (!attack_self(user)) - user.visible_message("[user] couldn't flip \the [src]!") - return SHAME - addtimer(CALLBACK(src, .proc/manual_suicide, user), 10)//10 = time takes for flip animation - return MANUAL_SUICIDE - -/obj/item/coin/proc/manual_suicide(mob/living/user) - var/index = sideslist.Find(coinflip) - if (index==2)//tails - user.visible_message("\the [src] lands on [coinflip]! [user] promptly falls over, dead!") - user.adjustOxyLoss(200) - user.death(0) - else - user.visible_message("\the [src] lands on [coinflip]! [user] keeps on living!") - -/obj/item/coin/Initialize() - . = ..() - pixel_x = rand(0,16)-8 - pixel_y = rand(0,8)-8 - -/obj/item/coin/examine(mob/user) - . = ..() - if(value) - . += "It's worth [value] credit\s." - -/obj/item/coin/gold - name = "gold coin" - cmineral = "gold" - icon_state = "coin_gold_heads" - value = 50 - materials = list(MAT_GOLD = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("gold" = 4) - -/obj/item/coin/silver - name = "silver coin" - cmineral = "silver" - icon_state = "coin_silver_heads" - value = 20 - materials = list(MAT_SILVER = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("silver" = 4) - -/obj/item/coin/diamond - name = "diamond coin" - cmineral = "diamond" - icon_state = "coin_diamond_heads" - value = 500 - materials = list(MAT_DIAMOND = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("carbon" = 4) - -/obj/item/coin/iron - name = "iron coin" - cmineral = "iron" - icon_state = "coin_iron_heads" - value = 1 - materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("iron" = 4) - -/obj/item/coin/plasma - name = "plasma coin" - cmineral = "plasma" - icon_state = "coin_plasma_heads" - value = 100 - materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("plasma" = 4) - -/obj/item/coin/uranium - name = "uranium coin" - cmineral = "uranium" - icon_state = "coin_uranium_heads" - value = 80 - materials = list(MAT_URANIUM = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("uranium" = 4) - -/obj/item/coin/bananium - name = "bananium coin" - cmineral = "bananium" - icon_state = "coin_bananium_heads" - value = 1000 //makes the clown cry - materials = list(MAT_BANANIUM = MINERAL_MATERIAL_AMOUNT*0.2) - grind_results = list("banana" = 4) - -/obj/item/coin/adamantine - name = "adamantine coin" - cmineral = "adamantine" - icon_state = "coin_adamantine_heads" - value = 1500 - -/obj/item/coin/mythril - name = "mythril coin" - cmineral = "mythril" - icon_state = "coin_mythril_heads" - value = 3000 - -/obj/item/coin/twoheaded - cmineral = "iron" - icon_state = "coin_iron_heads" - desc = "Hey, this coin's the same on both sides!" - sideslist = list("heads") - materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2) - value = 1 - grind_results = list("iron" = 4) - -/obj/item/coin/antagtoken - name = "antag token" - icon_state = "coin_valid_valid" - cmineral = "valid" - desc = "A novelty coin that helps the heart know what hard evidence cannot prove." - sideslist = list("valid", "salad") - value = 0 - grind_results = list("sodiumchloride" = 4) - -/obj/item/coin/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/CC = W - if(string_attached) - to_chat(user, "There already is a string attached to this coin!") - return - - if (CC.use(1)) - add_overlay("coin_string_overlay") - string_attached = 1 - to_chat(user, "You attach a string to the coin.") - else - to_chat(user, "You need one length of cable to attach a string to the coin!") - return - else - ..() - -/obj/item/coin/wirecutter_act(mob/living/user, obj/item/I) - if(!string_attached) - return TRUE - - new /obj/item/stack/cable_coil(drop_location(), 1) - overlays = list() - string_attached = null - to_chat(user, "You detach the string from the coin.") - return TRUE - -/obj/item/coin/attack_self(mob/user) - if(cooldown < world.time) - if(string_attached) //does the coin have a wire attached - to_chat(user, "The coin won't flip very well with something attached!" ) - return FALSE//do not flip the coin - coinflip = pick(sideslist) - cooldown = world.time + 15 - flick("coin_[cmineral]_flip", src) - icon_state = "coin_[cmineral]_[coinflip]" - playsound(user.loc, 'sound/items/coinflip.ogg', 50, 1) - var/oldloc = loc - sleep(15) - if(loc == oldloc && user && !user.incapacitated()) - user.visible_message("[user] has flipped [src]. It lands on [coinflip].", \ - "You flip [src]. It lands on [coinflip].", \ - "You hear the clattering of loose change.") - return TRUE//did the coin flip? useful for suicide_act - - -#undef ORESTACK_OVERLAYS_MAX + +#define GIBTONITE_QUALITY_HIGH 3 +#define GIBTONITE_QUALITY_MEDIUM 2 +#define GIBTONITE_QUALITY_LOW 1 + +#define ORESTACK_OVERLAYS_MAX 10 + +/**********************Mineral ores**************************/ + +/obj/item/stack/ore + name = "rock" + icon = 'icons/obj/mining.dmi' + icon_state = "ore" + item_state = "ore" + full_w_class = WEIGHT_CLASS_BULKY + singular_name = "ore chunk" + var/points = 0 //How many points this ore gets you from the ore redemption machine + var/refined_type = null //What this ore defaults to being refined into + novariants = TRUE // Ore stacks handle their icon updates themselves to keep the illusion that there's more going + var/list/stack_overlays + +/obj/item/stack/ore/update_icon() + var/difference = min(ORESTACK_OVERLAYS_MAX, amount) - (LAZYLEN(stack_overlays)+1) + if(difference == 0) + return + else if(difference < 0 && LAZYLEN(stack_overlays)) //amount < stack_overlays, remove excess. + cut_overlays() + if (LAZYLEN(stack_overlays)-difference <= 0) + stack_overlays = null; + else + stack_overlays.len += difference + else if(difference > 0) //amount > stack_overlays, add some. + cut_overlays() + for(var/i in 1 to difference) + var/mutable_appearance/newore = mutable_appearance(icon, icon_state) + newore.pixel_x = rand(-8,8) + newore.pixel_y = rand(-8,8) + LAZYADD(stack_overlays, newore) + if (stack_overlays) + add_overlay(stack_overlays) + +/obj/item/stack/ore/welder_act(mob/living/user, obj/item/I) + if(!refined_type) + return TRUE + + if(I.use_tool(src, user, 0, volume=50, amount=15)) + new refined_type(drop_location()) + use(1) + + return TRUE + +/obj/item/stack/ore/fire_act(exposed_temperature, exposed_volume) + . = ..() + if(isnull(refined_type)) + return + else + var/probability = (rand(0,100))/100 + var/burn_value = probability*amount + var/amountrefined = round(burn_value, 1) + if(amountrefined < 1) + qdel(src) + else + new refined_type(drop_location(),amountrefined) + qdel(src) + +/obj/item/stack/ore/uranium + name = "uranium ore" + icon_state = "Uranium ore" + item_state = "Uranium ore" + singular_name = "uranium ore chunk" + points = 30 + materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/uranium + +/obj/item/stack/ore/iron + name = "iron ore" + icon_state = "Iron ore" + item_state = "Iron ore" + singular_name = "iron ore chunk" + points = 1 + materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/metal + +/obj/item/stack/ore/glass + name = "sand pile" + icon_state = "Glass ore" + item_state = "Glass ore" + singular_name = "sand pile" + points = 1 + materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/glass + w_class = WEIGHT_CLASS_TINY + +GLOBAL_LIST_INIT(sand_recipes, list(\ + new /datum/stack_recipe("sandstone", /obj/item/stack/sheet/mineral/sandstone, 1, 1, 50)\ + )) + +/obj/item/stack/ore/glass/Initialize(mapload, new_amount, merge = TRUE) + recipes = GLOB.sand_recipes + . = ..() + +/obj/item/stack/ore/glass/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + if(..() || !ishuman(hit_atom)) + return + var/mob/living/carbon/human/C = hit_atom + if(C.head && C.head.flags_cover & HEADCOVERSEYES) + visible_message("[C]'s headgear blocks the sand!") + return + if(C.wear_mask && C.wear_mask.flags_cover & MASKCOVERSEYES) + visible_message("[C]'s mask blocks the sand!") + return + if(C.glasses && C.glasses.flags_cover & GLASSESCOVERSEYES) + visible_message("[C]'s glasses block the sand!") + return + C.adjust_blurriness(6) + C.adjustStaminaLoss(15)//the pain from your eyes burning does stamina damage + C.confused += 5 + to_chat(C, "\The [src] gets into your eyes! The pain, it burns!") + qdel(src) + +/obj/item/stack/ore/glass/ex_act(severity, target) + if (severity == EXPLODE_NONE) + return + qdel(src) + +/obj/item/stack/ore/glass/basalt + name = "volcanic ash" + icon_state = "volcanic_sand" + icon_state = "volcanic_sand" + singular_name = "volcanic ash pile" + +/obj/item/stack/ore/plasma + name = "plasma ore" + icon_state = "Plasma ore" + item_state = "Plasma ore" + singular_name = "plasma ore chunk" + points = 15 + materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/plasma + +/obj/item/stack/ore/plasma/welder_act(mob/living/user, obj/item/I) + to_chat(user, "You can't hit a high enough temperature to smelt [src] properly!") + return TRUE + + +/obj/item/stack/ore/silver + name = "silver ore" + icon_state = "Silver ore" + item_state = "Silver ore" + singular_name = "silver ore chunk" + points = 16 + materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/silver + +/obj/item/stack/ore/gold + name = "gold ore" + icon_state = "Gold ore" + icon_state = "Gold ore" + singular_name = "gold ore chunk" + points = 18 + materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/gold + +/obj/item/stack/ore/diamond + name = "diamond ore" + icon_state = "Diamond ore" + item_state = "Diamond ore" + singular_name = "diamond ore chunk" + points = 50 + materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/diamond + +/obj/item/stack/ore/bananium + name = "bananium ore" + icon_state = "Bananium ore" + item_state = "Bananium ore" + singular_name = "bananium ore chunk" + points = 60 + materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/bananium + +/obj/item/stack/ore/titanium + name = "titanium ore" + icon_state = "Titanium ore" + item_state = "Titanium ore" + singular_name = "titanium ore chunk" + points = 50 + materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/titanium + +/obj/item/stack/ore/slag + name = "slag" + desc = "Completely useless." + icon_state = "slag" + item_state = "slag" + singular_name = "slag chunk" + +/obj/item/twohanded/required/gibtonite + name = "gibtonite ore" + desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law." + icon = 'icons/obj/mining.dmi' + icon_state = "Gibtonite ore" + item_state = "Gibtonite ore" + w_class = WEIGHT_CLASS_BULKY + throw_range = 0 + var/primed = FALSE + var/det_time = 100 + var/quality = GIBTONITE_QUALITY_LOW //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better + var/attacher = "UNKNOWN" + var/det_timer + +/obj/item/twohanded/required/gibtonite/Destroy() + qdel(wires) + wires = null + return ..() + +/obj/item/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params) + if(!wires && istype(I, /obj/item/assembly/igniter)) + user.visible_message("[user] attaches [I] to [src].", "You attach [I] to [src].") + wires = new /datum/wires/explosive/gibtonite(src) + attacher = key_name(user) + qdel(I) + add_overlay("Gibtonite_igniter") + return + + if(wires && !primed) + if(is_wire_tool(I)) + wires.interact(user) + return + + if(I.tool_behaviour == TOOL_MINING || istype(I, /obj/item/resonator) || I.force >= 10) + GibtoniteReaction(user) + return + if(primed) + if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || istype(I, /obj/item/multitool)) + primed = FALSE + if(det_timer) + deltimer(det_timer) + user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "You stopped the chain reaction. ...The ore's quality looks diminished.") + icon_state = "Gibtonite ore" + quality = GIBTONITE_QUALITY_LOW + return + ..() + +/obj/item/twohanded/required/gibtonite/attack_self(user) + if(wires) + wires.interact(user) + else + ..() + +/obj/item/twohanded/required/gibtonite/bullet_act(obj/item/projectile/P) + GibtoniteReaction(P.firer) + ..() + +/obj/item/twohanded/required/gibtonite/ex_act() + GibtoniteReaction(null, 1) + + + +/obj/item/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0) + if(!primed) + primed = TRUE + playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1) + icon_state = "Gibtonite active" + var/turf/bombturf = get_turf(src) + var/notify_admins = 0 + if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel + notify_admins = 1 + + if(notify_admins) + if(triggered_by == 1) + message_admins("An explosion has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].") + else if(triggered_by == 2) + message_admins("A signal has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)]. Igniter attacher: [ADMIN_LOOKUPFLW(attacher)]") + else + message_admins("[ADMIN_LOOKUPFLW(attacher)] has triggered a [name] to detonate at [ADMIN_VERBOSEJMP(bombturf)].") + if(triggered_by == 1) + log_game("An explosion has primed a [name] for detonation at [AREACOORD(bombturf)]") + else if(triggered_by == 2) + log_game("A signal has primed a [name] for detonation at [AREACOORD(bombturf)]. Igniter attacher: [key_name(attacher)].") + else + user.visible_message("[user] strikes \the [src], causing a chain reaction!", "You strike \the [src], causing a chain reaction.") + log_game("[key_name(user)] has primed a [name] for detonation at [AREACOORD(bombturf)]") + det_timer = addtimer(CALLBACK(src, .proc/detonate, notify_admins), det_time, TIMER_STOPPABLE) + +/obj/item/twohanded/required/gibtonite/proc/detonate(notify_admins) + if(primed) + switch(quality) + if(GIBTONITE_QUALITY_HIGH) + explosion(src,2,4,9,adminlog = notify_admins) + if(GIBTONITE_QUALITY_MEDIUM) + explosion(src,1,2,5,adminlog = notify_admins) + if(GIBTONITE_QUALITY_LOW) + explosion(src,0,1,3,adminlog = notify_admins) + qdel(src) + +/obj/item/stack/ore/Initialize() + . = ..() + pixel_x = rand(0,16)-8 + pixel_y = rand(0,8)-8 + +/obj/item/stack/ore/ex_act(severity, target) + if (!severity || severity >= 2) + return + qdel(src) + + +/*****************************Coin********************************/ + +// The coin's value is a value of it's materials. +// Yes, the gold standard makes a come-back! +// This is the only way to make coins that are possible to produce on station actually worth anything. +/obj/item/coin + icon = 'icons/obj/economy.dmi' + name = "coin" + icon_state = "coin__heads" + flags_1 = CONDUCT_1 + force = 1 + throwforce = 2 + w_class = WEIGHT_CLASS_TINY + var/string_attached + var/list/sideslist = list("heads","tails") + var/cmineral = null + var/cooldown = 0 + var/value = 1 + var/coinflip + +/obj/item/coin/suicide_act(mob/living/user) + user.visible_message("[user] contemplates suicide with \the [src]!") + if (!attack_self(user)) + user.visible_message("[user] couldn't flip \the [src]!") + return SHAME + addtimer(CALLBACK(src, .proc/manual_suicide, user), 10)//10 = time takes for flip animation + return MANUAL_SUICIDE + +/obj/item/coin/proc/manual_suicide(mob/living/user) + var/index = sideslist.Find(coinflip) + if (index==2)//tails + user.visible_message("\the [src] lands on [coinflip]! [user] promptly falls over, dead!") + user.adjustOxyLoss(200) + user.death(0) + else + user.visible_message("\the [src] lands on [coinflip]! [user] keeps on living!") + +/obj/item/coin/Initialize() + . = ..() + pixel_x = rand(0,16)-8 + pixel_y = rand(0,8)-8 + +/obj/item/coin/examine(mob/user) + . = ..() + if(value) + . += "It's worth [value] credit\s." + +/obj/item/coin/gold + name = "gold coin" + cmineral = "gold" + icon_state = "coin_gold_heads" + value = 50 + materials = list(MAT_GOLD = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/gold = 4) + +/obj/item/coin/silver + name = "silver coin" + cmineral = "silver" + icon_state = "coin_silver_heads" + value = 20 + materials = list(MAT_SILVER = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/silver = 4) + +/obj/item/coin/diamond + name = "diamond coin" + cmineral = "diamond" + icon_state = "coin_diamond_heads" + value = 500 + materials = list(MAT_DIAMOND = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/carbon = 4) + +/obj/item/coin/iron + name = "iron coin" + cmineral = "iron" + icon_state = "coin_iron_heads" + value = 1 + materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/iron = 4) + +/obj/item/coin/plasma + name = "plasma coin" + cmineral = "plasma" + icon_state = "coin_plasma_heads" + value = 100 + materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/toxin/plasma = 4) + +/obj/item/coin/uranium + name = "uranium coin" + cmineral = "uranium" + icon_state = "coin_uranium_heads" + value = 80 + materials = list(MAT_URANIUM = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/uranium = 4) + +/obj/item/coin/bananium + name = "bananium coin" + cmineral = "bananium" + icon_state = "coin_bananium_heads" + value = 1000 //makes the clown cry + materials = list(MAT_BANANIUM = MINERAL_MATERIAL_AMOUNT*0.2) + grind_results = list(/datum/reagent/consumable/banana = 4) + +/obj/item/coin/adamantine + name = "adamantine coin" + cmineral = "adamantine" + icon_state = "coin_adamantine_heads" + value = 1500 + +/obj/item/coin/mythril + name = "mythril coin" + cmineral = "mythril" + icon_state = "coin_mythril_heads" + value = 3000 + +/obj/item/coin/twoheaded + cmineral = "iron" + icon_state = "coin_iron_heads" + desc = "Hey, this coin's the same on both sides!" + sideslist = list("heads") + materials = list(MAT_METAL = MINERAL_MATERIAL_AMOUNT*0.2) + value = 1 + grind_results = list(/datum/reagent/iron = 4) + +/obj/item/coin/antagtoken + name = "antag token" + icon_state = "coin_valid_valid" + cmineral = "valid" + desc = "A novelty coin that helps the heart know what hard evidence cannot prove." + sideslist = list("valid", "salad") + value = 0 + grind_results = list(/datum/reagent/consumable/sodiumchloride = 4) + +/obj/item/coin/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/CC = W + if(string_attached) + to_chat(user, "There already is a string attached to this coin!") + return + + if (CC.use(1)) + add_overlay("coin_string_overlay") + string_attached = 1 + to_chat(user, "You attach a string to the coin.") + else + to_chat(user, "You need one length of cable to attach a string to the coin!") + return + else + ..() + +/obj/item/coin/wirecutter_act(mob/living/user, obj/item/I) + if(!string_attached) + return TRUE + + new /obj/item/stack/cable_coil(drop_location(), 1) + overlays = list() + string_attached = null + to_chat(user, "You detach the string from the coin.") + return TRUE + +/obj/item/coin/attack_self(mob/user) + if(cooldown < world.time) + if(string_attached) //does the coin have a wire attached + to_chat(user, "The coin won't flip very well with something attached!" ) + return FALSE//do not flip the coin + coinflip = pick(sideslist) + cooldown = world.time + 15 + flick("coin_[cmineral]_flip", src) + icon_state = "coin_[cmineral]_[coinflip]" + playsound(user.loc, 'sound/items/coinflip.ogg', 50, 1) + var/oldloc = loc + sleep(15) + if(loc == oldloc && user && !user.incapacitated()) + user.visible_message("[user] has flipped [src]. It lands on [coinflip].", \ + "You flip [src]. It lands on [coinflip].", \ + "You hear the clattering of loose change.") + return TRUE//did the coin flip? useful for suicide_act + + +#undef ORESTACK_OVERLAYS_MAX diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index a1984b03..5887d10e 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -155,7 +155,7 @@ if(iscarbon(AM)) var/mob/living/carbon/C = AM if(blood_id == C.get_blood_id())//both mobs have the same blood substance - if(blood_id == "blood" || blood_id == "jellyblood") //normal blood + if(blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) //normal blood if(blood_data["viruses"]) for(var/thing in blood_data["viruses"]) var/datum/disease/D = thing @@ -175,7 +175,7 @@ return /mob/living/carbon/get_blood_data(blood_id) - if(blood_id == "blood" || blood_id == "jellyblood") //actual blood reagent + if(blood_id == /datum/reagent/blood || /datum/reagent/blood/jellyblood) //actual blood reagent var/blood_data = list() //set the blood data blood_data["donor"] = src @@ -191,7 +191,7 @@ blood_data["resistances"] = disease_resistances.Copy() var/list/temp_chem = list() for(var/datum/reagent/R in reagents.reagent_list) - temp_chem[R.id] = R.volume + temp_chem[R.type] = R.volume blood_data["trace_chem"] = list2params(temp_chem) if(mind) blood_data["mind"] = mind @@ -226,21 +226,21 @@ /mob/living/simple_animal/get_blood_id() if(blood_volume) - return "blood" + return /datum/reagent/blood /mob/living/carbon/monkey/get_blood_id() if(!(HAS_TRAIT(src, TRAIT_NOCLONE))) - return "blood" + return /datum/reagent/blood /mob/living/carbon/get_blood_id() if(isjellyperson(src)) - return "jellyblood" + return /datum/reagent/blood/jellyblood if(dna?.species?.exotic_blood) return dna.species.exotic_blood else if((NOBLOOD in dna.species.species_traits) || (HAS_TRAIT(src, TRAIT_NOCLONE))) return else - return "blood" + return /datum/reagent/blood // This is has more potential uses, and is probably faster than the old proc. /proc/get_safe_blood(bloodtype) diff --git a/code/modules/mob/living/bloodcrawl.dm b/code/modules/mob/living/bloodcrawl.dm index 19500653..f3e8c734 100644 --- a/code/modules/mob/living/bloodcrawl.dm +++ b/code/modules/mob/living/bloodcrawl.dm @@ -73,7 +73,7 @@ if(victim.stat == CONSCIOUS) src.visible_message("[victim] kicks free of the blood pool just before entering it!", null, "You hear splashing and struggling.") - else if(victim.reagents && victim.reagents.has_reagent("demonsblood")) + else if(victim.reagents && victim.reagents.has_reagent(/datum/reagent/consumable/ethanol/demonsblood)) visible_message("Something prevents [victim] from entering the pool!", "A strange force is blocking [victim] from entering!", "You hear a splash and a thud.") else victim.forceMove(src) @@ -104,7 +104,7 @@ if(!victim) return FALSE - if(victim.reagents && victim.reagents.has_reagent("devilskiss")) + if(victim.reagents && victim.reagents.has_reagent(/datum/reagent/consumable/ethanol/devilskiss)) to_chat(src, "AAH! THEIR FLESH! IT BURNS!") adjustBruteLoss(25) //I can't use adjustHealth() here because bloodcrawl affects /mob/living and adjustHealth() only affects simple mobs var/found_bloodpool = FALSE diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index f9dff7ad..e9a3538e 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -102,16 +102,16 @@ if(istype(O, /obj/item/organ_storage)) //BUG_PROBABLE_CAUSE return //Borg organ bags shouldn't be killing brains - if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("neurine")) //Neurine fixes dead brains + if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent(/datum/reagent/medicine/neurine)) //Neurine fixes dead brains . = TRUE //don't do attack animation. var/cached_Bdamage = brainmob?.health - var/datum/reagent/medicine/neurine/N = O.reagents.has_reagent("neurine") - var/datum/reagent/medicine/mannitol/M1 = O.reagents.has_reagent("mannitol") + var/datum/reagent/medicine/neurine/N = reagents.has_reagent(/datum/reagent/medicine/neurine) + var/datum/reagent/medicine/mannitol/M1 = reagents.has_reagent(/datum/reagent/medicine/mannitol) - if(O.reagents.has_reagent("mannitol"))//Just a quick way to bolster the effects if someone mixes up a batch. + if(O.reagents.has_reagent(/datum/reagent/medicine/mannitol))//Just a quick way to bolster the effects if someone mixes up a batch. N.volume *= (M1.volume*0.5) - if(!O.reagents.has_reagent("neurine", 10)) + if(!O.reagents.has_reagent(/datum/reagent/medicine/neurine, 10)) to_chat(user, "There's not enough neurine in [O] to restore [src]!") return @@ -134,14 +134,14 @@ gain_trauma_type(BRAIN_TRAUMA_SPECIAL) return - if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent("mannitol")) //attempt to heal the brain + if((organ_flags & ORGAN_FAILING) && O.is_drainable() && O.reagents.has_reagent(/datum/reagent/medicine/mannitol)) //attempt to heal the brain . = TRUE //don't do attack animation. - var/datum/reagent/medicine/mannitol/M = O.reagents.has_reagent("mannitol") + var/datum/reagent/medicine/mannitol/M = reagents.has_reagent(/datum/reagent/medicine/mannitol) if(brain_death || brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing to_chat(user, "[src] is far too damaged, you'll have to use neurine on it!") return - if(!O.reagents.has_reagent("mannitol", 10)) + if(!O.reagents.has_reagent(/datum/reagent/medicine/mannitol, 10)) to_chat(user, "There's not enough mannitol in [O] to restore [src]!") return diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index 7b696279..2994d5e3 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -27,7 +27,7 @@ /obj/item/organ/alien/prepare_eat() var/obj/S = ..() - S.reagents.add_reagent("sacid", 10) + S.reagents.add_reagent(/datum/reagent/toxin/acid, 10) return S @@ -46,7 +46,7 @@ /obj/item/organ/alien/plasmavessel/prepare_eat() var/obj/S = ..() - S.reagents.add_reagent("plasma", storedPlasma/10) + S.reagents.add_reagent(/datum/reagent/toxin/plasma, storedPlasma/10) return S /obj/item/organ/alien/plasmavessel/large diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 22ad146d..4ada8834 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -1,137 +1,137 @@ -// This is to replace the previous datum/disease/alien_embryo for slightly improved handling and maintainability -// It functions almost identically (see code/datums/diseases/alien_embryo.dm) -/obj/item/organ/body_egg/alien_embryo - name = "alien embryo" - icon = 'icons/mob/alien.dmi' - icon_state = "larva0_dead" - var/stage = 0 - var/bursting = FALSE - -/obj/item/organ/body_egg/alien_embryo/on_find(mob/living/finder) - ..() - if(stage < 4) - to_chat(finder, "It's small and weak, barely the size of a foetus.") - else - to_chat(finder, "It's grown quite large, and writhes slightly as you look at it.") - if(prob(10)) - AttemptGrow(0) - -/obj/item/organ/body_egg/alien_embryo/prepare_eat() - var/obj/S = ..() - S.reagents.add_reagent("sacid", 10) - return S - -/obj/item/organ/body_egg/alien_embryo/on_life() - .=..() - switch(stage) - if(2, 3) - if(prob(2)) - owner.emote("sneeze") - if(prob(2)) - owner.emote("cough") - if(prob(2)) - to_chat(owner, "Your throat feels sore.") - if(prob(2)) - to_chat(owner, "Mucous runs down the back of your throat.") - if(4) - if(prob(2)) - owner.emote("sneeze") - if(prob(2)) - owner.emote("cough") - if(prob(4)) - to_chat(owner, "Your muscles ache.") - if(prob(20)) - owner.take_bodypart_damage(1) - if(prob(4)) - to_chat(owner, "Your stomach hurts.") - if(prob(20)) - owner.adjustToxLoss(1) - if(5) - to_chat(owner, "You feel something tearing its way out of your stomach...") - owner.adjustToxLoss(10) - -/obj/item/organ/body_egg/alien_embryo/egg_process() - if(stage < 5 && prob(3)) - stage++ - INVOKE_ASYNC(src, .proc/RefreshInfectionImage) - - if(stage == 5 && prob(50)) - for(var/datum/surgery/S in owner.surgeries) - if(S.location == BODY_ZONE_CHEST && istype(S.get_surgery_step(), /datum/surgery_step/manipulate_organs)) - AttemptGrow(0) - return - AttemptGrow() - - - -/obj/item/organ/body_egg/alien_embryo/proc/AttemptGrow(var/kill_on_sucess=TRUE) - if(!owner || bursting) - return - - bursting = TRUE - - var/list/candidates = pollGhostCandidates("Do you want to play as an alien larva that will burst out of [owner]?", ROLE_ALIEN, null, ROLE_ALIEN, 100, POLL_IGNORE_ALIEN_LARVA) - - if(QDELETED(src) || QDELETED(owner)) - return - - if(!candidates.len || !owner) - bursting = FALSE - stage = 4 - return - - var/mob/dead/observer/ghost = pick(candidates) - - var/mutable_appearance/overlay = mutable_appearance('icons/mob/alien.dmi', "burst_lie") - owner.add_overlay(overlay) - - var/atom/xeno_loc = get_turf(owner) - var/mob/living/carbon/alien/larva/new_xeno = new(xeno_loc) - new_xeno.key = ghost.key - SEND_SOUND(new_xeno, sound('sound/voice/hiss5.ogg',0,0,0,100)) //To get the player's attention - new_xeno.canmove = 0 //so we don't move during the bursting animation - new_xeno.notransform = 1 - new_xeno.invisibility = INVISIBILITY_MAXIMUM - - sleep(6) - - if(QDELETED(src) || QDELETED(owner)) - return - - if(new_xeno) - new_xeno.canmove = 1 - new_xeno.notransform = 0 - new_xeno.invisibility = 0 - - if(kill_on_sucess) //ITS TOO LATE - new_xeno.visible_message("[new_xeno] bursts out of [owner]!", "You exit [owner], your previous host.", "You hear organic matter ripping and tearing!") - owner.apply_damage(rand(100,300),BRUTE,zone,FALSE) //Random high damage to torso so health sensors don't metagame. - owner.spill_organs(TRUE,FALSE,TRUE) //Lets still make the death gruesome and impossible to just simply defib someone. - owner.death(FALSE) //Just in case some freak occurance occurs where you somehow survive all your organs being removed from you and the 100-300 brute damage. - else //When it is removed via surgery at a late stage, rather than forced. - new_xeno.visible_message("[new_xeno] wriggles out of [owner]!", "You exit [owner], your previous host.") - owner.adjustBruteLoss(40) - owner.cut_overlay(overlay) - qdel(src) - - -/*---------------------------------------- -Proc: AddInfectionImages(C) -Des: Adds the infection image to all aliens for this embryo -----------------------------------------*/ -/obj/item/organ/body_egg/alien_embryo/AddInfectionImages() - for(var/mob/living/carbon/alien/alien in GLOB.player_list) - if(alien.client) - var/I = image('icons/mob/alien.dmi', loc = owner, icon_state = "infected[stage]") - alien.client.images += I - -/*---------------------------------------- -Proc: RemoveInfectionImage(C) -Des: Removes all images from the mob infected by this embryo -----------------------------------------*/ -/obj/item/organ/body_egg/alien_embryo/RemoveInfectionImages() - for(var/mob/living/carbon/alien/alien in GLOB.player_list) - if(alien.client) - for(var/image/I in alien.client.images) - if(dd_hasprefix_case(I.icon_state, "infected") && I.loc == owner) - qdel(I) +// This is to replace the previous datum/disease/alien_embryo for slightly improved handling and maintainability +// It functions almost identically (see code/datums/diseases/alien_embryo.dm) +/obj/item/organ/body_egg/alien_embryo + name = "alien embryo" + icon = 'icons/mob/alien.dmi' + icon_state = "larva0_dead" + var/stage = 0 + var/bursting = FALSE + +/obj/item/organ/body_egg/alien_embryo/on_find(mob/living/finder) + ..() + if(stage < 4) + to_chat(finder, "It's small and weak, barely the size of a foetus.") + else + to_chat(finder, "It's grown quite large, and writhes slightly as you look at it.") + if(prob(10)) + AttemptGrow(0) + +/obj/item/organ/body_egg/alien_embryo/prepare_eat() + var/obj/S = ..() + S.reagents.add_reagent(/datum/reagent/toxin/acid, 10) + return S + +/obj/item/organ/body_egg/alien_embryo/on_life() + .=..() + switch(stage) + if(2, 3) + if(prob(2)) + owner.emote("sneeze") + if(prob(2)) + owner.emote("cough") + if(prob(2)) + to_chat(owner, "Your throat feels sore.") + if(prob(2)) + to_chat(owner, "Mucous runs down the back of your throat.") + if(4) + if(prob(2)) + owner.emote("sneeze") + if(prob(2)) + owner.emote("cough") + if(prob(4)) + to_chat(owner, "Your muscles ache.") + if(prob(20)) + owner.take_bodypart_damage(1) + if(prob(4)) + to_chat(owner, "Your stomach hurts.") + if(prob(20)) + owner.adjustToxLoss(1) + if(5) + to_chat(owner, "You feel something tearing its way out of your stomach...") + owner.adjustToxLoss(10) + +/obj/item/organ/body_egg/alien_embryo/egg_process() + if(stage < 5 && prob(3)) + stage++ + INVOKE_ASYNC(src, .proc/RefreshInfectionImage) + + if(stage == 5 && prob(50)) + for(var/datum/surgery/S in owner.surgeries) + if(S.location == BODY_ZONE_CHEST && istype(S.get_surgery_step(), /datum/surgery_step/manipulate_organs)) + AttemptGrow(0) + return + AttemptGrow() + + + +/obj/item/organ/body_egg/alien_embryo/proc/AttemptGrow(var/kill_on_sucess=TRUE) + if(!owner || bursting) + return + + bursting = TRUE + + var/list/candidates = pollGhostCandidates("Do you want to play as an alien larva that will burst out of [owner]?", ROLE_ALIEN, null, ROLE_ALIEN, 100, POLL_IGNORE_ALIEN_LARVA) + + if(QDELETED(src) || QDELETED(owner)) + return + + if(!candidates.len || !owner) + bursting = FALSE + stage = 4 + return + + var/mob/dead/observer/ghost = pick(candidates) + + var/mutable_appearance/overlay = mutable_appearance('icons/mob/alien.dmi', "burst_lie") + owner.add_overlay(overlay) + + var/atom/xeno_loc = get_turf(owner) + var/mob/living/carbon/alien/larva/new_xeno = new(xeno_loc) + new_xeno.key = ghost.key + SEND_SOUND(new_xeno, sound('sound/voice/hiss5.ogg',0,0,0,100)) //To get the player's attention + new_xeno.canmove = 0 //so we don't move during the bursting animation + new_xeno.notransform = 1 + new_xeno.invisibility = INVISIBILITY_MAXIMUM + + sleep(6) + + if(QDELETED(src) || QDELETED(owner)) + return + + if(new_xeno) + new_xeno.canmove = 1 + new_xeno.notransform = 0 + new_xeno.invisibility = 0 + + if(kill_on_sucess) //ITS TOO LATE + new_xeno.visible_message("[new_xeno] bursts out of [owner]!", "You exit [owner], your previous host.", "You hear organic matter ripping and tearing!") + owner.apply_damage(rand(100,300),BRUTE,zone,FALSE) //Random high damage to torso so health sensors don't metagame. + owner.spill_organs(TRUE,FALSE,TRUE) //Lets still make the death gruesome and impossible to just simply defib someone. + owner.death(FALSE) //Just in case some freak occurance occurs where you somehow survive all your organs being removed from you and the 100-300 brute damage. + else //When it is removed via surgery at a late stage, rather than forced. + new_xeno.visible_message("[new_xeno] wriggles out of [owner]!", "You exit [owner], your previous host.") + owner.adjustBruteLoss(40) + owner.cut_overlay(overlay) + qdel(src) + + +/*---------------------------------------- +Proc: AddInfectionImages(C) +Des: Adds the infection image to all aliens for this embryo +----------------------------------------*/ +/obj/item/organ/body_egg/alien_embryo/AddInfectionImages() + for(var/mob/living/carbon/alien/alien in GLOB.player_list) + if(alien.client) + var/I = image('icons/mob/alien.dmi', loc = owner, icon_state = "infected[stage]") + alien.client.images += I + +/*---------------------------------------- +Proc: RemoveInfectionImage(C) +Des: Removes all images from the mob infected by this embryo +----------------------------------------*/ +/obj/item/organ/body_egg/alien_embryo/RemoveInfectionImages() + for(var/mob/living/carbon/alien/alien in GLOB.player_list) + if(alien.client) + for(var/image/I in alien.client.images) + if(dd_hasprefix_case(I.icon_state, "infected") && I.loc == owner) + qdel(I) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index c76c3b1f..20ad5d2c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -518,7 +518,7 @@ add_splatter_floor(T) if(stun) adjustBruteLoss(3) - else if(src.reagents.has_reagent("blazaam")) + else if(src.reagents.has_reagent(/datum/reagent/consumable/ethanol/blazaam)) if(T) T.add_vomit_floor(src, VOMIT_PURPLE) else diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index fa6cc85f..d75da018 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -1,486 +1,486 @@ - -/mob/living/carbon/get_eye_protection() - var/number = ..() - - if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head - var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item - number += HFP.flash_protect - - if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses - var/obj/item/clothing/glasses/GFP = src.glasses - number += GFP.flash_protect - - if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask - var/obj/item/clothing/mask/MFP = src.wear_mask - number += MFP.flash_protect - - var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES) - if(!E) - number = INFINITY //Can't get flashed without eyes - else - number += E.flash_protect - - return number - -/mob/living/carbon/get_ear_protection() - var/number = ..() - var/obj/item/organ/ears/E = getorganslot(ORGAN_SLOT_EARS) - if(!E) - number = INFINITY - else - number += E.bang_protect - return number - -/mob/living/carbon/is_mouth_covered(head_only = 0, mask_only = 0) - if( (!mask_only && head && (head.flags_cover & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)) ) - return TRUE - -/mob/living/carbon/is_eyes_covered(check_glasses = 1, check_head = 1, check_mask = 1) - if(check_glasses && glasses && (glasses.flags_cover & GLASSESCOVERSEYES)) - return TRUE - if(check_head && head && (head.flags_cover & HEADCOVERSEYES)) - return TRUE - if(check_mask && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)) - return TRUE - -/mob/living/carbon/check_projectile_dismemberment(obj/item/projectile/P, def_zone) - var/obj/item/bodypart/affecting = get_bodypart(def_zone) - if(affecting && affecting.dismemberable && affecting.get_damage() >= (affecting.max_damage - P.dismemberment)) - affecting.dismember(P.damtype) - -/mob/living/carbon/catch_item(obj/item/I, skip_throw_mode_check = FALSE) - . = ..() - if(!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) && !skip_throw_mode_check && !in_throw_mode) - return - if(get_active_held_item() || restrained()) - return - I.attack_hand(src) - if(get_active_held_item() == I) //if our attack_hand() picks up the item... - visible_message("[src] catches [I]!") //catch that sucker! - throw_mode_off() - return TRUE - -/mob/living/carbon/embed_item(obj/item/I) - throw_alert("embeddedobject", /obj/screen/alert/embeddedobject) - var/obj/item/bodypart/L = pick(bodyparts) - L.embedded_objects |= I - I.add_mob_blood(src)//it embedded itself in you, of course it's bloody! - I.forceMove(src) - L.receive_damage(I.w_class*I.embedding.embedded_impact_pain_multiplier) - visible_message("[I] embeds itself in [src]'s [L.name]!","[I] embeds itself in your [L.name]!") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "embedded", /datum/mood_event/embedded) - -/mob/living/carbon/attacked_by(obj/item/I, mob/living/user) - //CIT CHANGES START HERE - combatmode and resting checks - var/totitemdamage = I.force - if(iscarbon(user)) - var/mob/living/carbon/tempcarb = user - if(!tempcarb.combatmode) - totitemdamage *= 0.5 - if(user.resting) - totitemdamage *= 0.5 - if(!combatmode) - totitemdamage *= 1.5 - //CIT CHANGES END HERE - if(user != src && check_shields(I, totitemdamage, "the [I.name]", MELEE_ATTACK, I.armour_penetration)) - return FALSE - var/obj/item/bodypart/affecting - if(user == src) - affecting = get_bodypart(check_zone(user.zone_selected)) //we're self-mutilating! yay! - else - affecting = get_bodypart(ran_zone(user.zone_selected)) - if(!affecting) //missing limb? we select the first bodypart (you can never have zero, because of chest) - affecting = bodyparts[1] - SEND_SIGNAL(I, COMSIG_ITEM_ATTACK_ZONE, src, user, affecting) - send_item_attack_message(I, user, affecting.name) - if(I.force) - apply_damage(totitemdamage, I.damtype, affecting) //CIT CHANGE - replaces I.force with totitemdamage - if(I.damtype == BRUTE && affecting.status == BODYPART_ORGANIC) - var/basebloodychance = affecting.brute_dam + totitemdamage - if(prob(basebloodychance)) - I.add_mob_blood(src) - bleed(totitemdamage) - if(totitemdamage >= 10 && get_dist(user, src) <= 1) //people with TK won't get smeared with blood - user.add_mob_blood(src) - - if(affecting.body_zone == BODY_ZONE_HEAD) - if(wear_mask && prob(basebloodychance)) - wear_mask.add_mob_blood(src) - update_inv_wear_mask() - if(wear_neck && prob(basebloodychance)) - wear_neck.add_mob_blood(src) - update_inv_neck() - if(head && prob(basebloodychance)) - head.add_mob_blood(src) - update_inv_head() - - //dismemberment - var/probability = I.get_dismemberment_chance(affecting) - if(prob(probability)) - if(affecting.dismember(I.damtype)) - I.add_mob_blood(src) - playsound(get_turf(src), I.get_dismember_sound(), 80, 1) - return TRUE //successful attack - -/mob/living/carbon/attack_drone(mob/living/simple_animal/drone/user) - return //so we don't call the carbon's attack_hand(). - -//ATTACK HAND IGNORING PARENT RETURN VALUE -/mob/living/carbon/attack_hand(mob/living/carbon/human/user) - . = ..() - if(.) //was the attack blocked? - return - for(var/thing in diseases) - var/datum/disease/D = thing - if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) - user.ContactContractDisease(D) - - for(var/thing in user.diseases) - var/datum/disease/D = thing - if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) - ContactContractDisease(D) - - if(lying && surgeries.len) - if(user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM) - for(var/datum/surgery/S in surgeries) - if(S.next_step(user, user.a_intent)) - return TRUE - - -/mob/living/carbon/attack_paw(mob/living/carbon/monkey/M) - - if(can_inject(M, TRUE)) - for(var/thing in diseases) - var/datum/disease/D = thing - if((D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) && prob(85)) - M.ContactContractDisease(D) - - for(var/thing in M.diseases) - var/datum/disease/D = thing - if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) - ContactContractDisease(D) - - if(M.a_intent == INTENT_HELP) - help_shake_act(M) - return 0 - - . = ..() - if(.) //successful monkey bite. - for(var/thing in M.diseases) - var/datum/disease/D = thing - ForceContractDisease(D) - return 1 - - -/mob/living/carbon/attack_slime(mob/living/simple_animal/slime/M) - . = ..() - if(!.) - return - if(M.powerlevel > 0) - var/stunprob = M.powerlevel * 7 + 10 // 17 at level 1, 80 at level 10 - if(prob(stunprob)) - M.powerlevel -= 3 - if(M.powerlevel < 0) - M.powerlevel = 0 - - visible_message("The [M.name] has shocked [src]!", \ - "The [M.name] has shocked [src]!") - - do_sparks(5, TRUE, src) - var/power = M.powerlevel + rand(0,3) - Knockdown(power*20) - if(stuttering < power) - stuttering = power - if (prob(stunprob) && M.powerlevel >= 8) - adjustFireLoss(M.powerlevel * rand(6,10)) - updatehealth() - -/mob/living/carbon/proc/dismembering_strike(mob/living/attacker, dam_zone) - if(!attacker.limb_destroyer) - return dam_zone - var/obj/item/bodypart/affecting - if(dam_zone && attacker.client) - affecting = get_bodypart(ran_zone(dam_zone)) - else - var/list/things_to_ruin = shuffle(bodyparts.Copy()) - for(var/B in things_to_ruin) - var/obj/item/bodypart/bodypart = B - if(bodypart.body_zone == BODY_ZONE_HEAD || bodypart.body_zone == BODY_ZONE_CHEST) - continue - if(!affecting || ((affecting.get_damage() / affecting.max_damage) < (bodypart.get_damage() / bodypart.max_damage))) - affecting = bodypart - if(affecting) - dam_zone = affecting.body_zone - if(affecting.get_damage() >= affecting.max_damage) - affecting.dismember() - return null - return affecting.body_zone - return dam_zone - - -/mob/living/carbon/blob_act(obj/structure/blob/B) - if (stat == DEAD) - return - else - show_message("The blob attacks!") - adjustBruteLoss(10) - -/mob/living/carbon/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_CONTENTS) - return - for(var/X in internal_organs) - var/obj/item/organ/O = X - O.emp_act(severity) - -/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) - return FALSE - if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) - return FALSE - shock_damage *= siemens_coeff - if(dna && dna.species) - shock_damage *= dna.species.siemens_coeff - if(shock_damage<1 && !override) - return 0 - if(reagents.has_reagent("teslium")) - shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging! - if(illusion) - adjustStaminaLoss(shock_damage) - else - take_overall_damage(0,shock_damage) - visible_message( - "[src] was shocked by \the [source]!", \ - "You feel a powerful shock coursing through your body!", \ - "You hear a heavy electrical crack." \ - ) - jitteriness += 1000 //High numbers for violent convulsions - do_jitter_animation(jitteriness) - stuttering += 2 - if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun) - Stun(40) - spawn(20) - jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less - if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun) - Knockdown(60) - if(override) - return override - else - return shock_damage - -/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) - if(on_fire) - to_chat(M, "You can't put [p_them()] out with just your bare hands!") - return - - if(health >= 0 && !(HAS_TRAIT(src, TRAIT_FAKEDEATH))) - - if(lying) - if(buckled) - to_chat(M, "You need to unbuckle [src] first to do that!") - return - M.visible_message("[M] shakes [src] trying to get [p_them()] up!", \ - "You shake [src] trying to get [p_them()] up!") - - else if(check_zone(M.zone_selected) == "head") - var/mob/living/carbon/human/H = src - var/datum/species/pref_species = H.dna.species - - if(HAS_TRAIT(H, TRAIT_HEADPAT_SLUT)) - M.visible_message("[M] gives [H] a pat on the head to make [p_them()] feel better! They seem incredibly pleased!", \ - "You give [H] a pat on the head to make [p_them()] feel better! They seem to like it way too much") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "lewd_headpat", /datum/mood_event/lewd_headpat) - H.adjustArousalLoss(5) //Headpats are hot af - else - M.visible_message("[M] gives [H] a pat on the head to make [p_them()] feel better!", \ - "You give [H] a pat on the head to make [p_them()] feel better!") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "headpat", /datum/mood_event/headpat) - - if(HAS_TRAIT(M, TRAIT_FRIENDLY)) - var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) - if (mood.sanity >= SANITY_GREAT) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/besthug, M) - else if (mood.sanity >= SANITY_DISTURBED) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, M) - if(H.dna.species.can_wag_tail(H)) - if("tail_human" in pref_species.default_features) - if(H.dna.features["tail_human"] == "None") - return - else - if(!H.dna.species.is_wagging_tail()) - H.emote("wag") - - if("tail_lizard" in pref_species.default_features) - if(H.dna.features["tail_lizard"] == "None") - return - else - if(!H.dna.species.is_wagging_tail()) - H.emote("wag") - - if("mam_tail" in pref_species.default_features) - if(H.dna.features["mam_tail"] == "None") - return - else - if(!H.dna.species.is_wagging_tail()) - H.emote("wag") - - else - return - - - else if(check_zone(M.zone_selected) == "mouth") - var/mob/living/carbon/human/H = src - var/datum/species/pref_species = H.dna.species - - M.visible_message("[M] gives [H] a boop on the nose.", \ - "You give [H] a boop on the nose!") - - if(H.dna.species.can_wag_tail(H)) - if("tail_human" in pref_species.default_features) - if(H.dna.features["tail_human"] == "None") - return - else - if(!H.dna.species.is_wagging_tail()) - H.emote("wag") - - if("tail_lizard" in pref_species.default_features) - if(H.dna.features["tail_lizard"] == "None") - return - else - if(!H.dna.species.is_wagging_tail()) - H.emote("wag") - - if("mam_tail" in pref_species.default_features) - if(H.dna.features["mam_tail"] == "None") - return - else - if(!H.dna.species.is_wagging_tail()) - H.emote("wag") - - else - return - - - else - M.visible_message("[M] hugs [src] to make [p_them()] feel better!", \ - "You hug [src] to make [p_them()] feel better!") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "hug", /datum/mood_event/hug) - if(HAS_TRAIT(M, TRAIT_FRIENDLY)) - var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) - if (mood.sanity >= SANITY_GREAT) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/besthug, M) - else if (mood.sanity >= SANITY_DISTURBED) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, M) - - AdjustStun(-60) - AdjustKnockdown(-60) - AdjustUnconscious(-60) - AdjustSleeping(-100) - if(recoveringstam) - adjustStaminaLoss(-15) - else if(resting) - resting = 0 - update_canmove() - - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - - -/mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0) - . = ..() - - var/damage = intensity - get_eye_protection() - if(.) // we've been flashed - var/obj/item/organ/eyes/eyes = getorganslot(ORGAN_SLOT_EYES) - if (!eyes) - return - if(visual) - return - - if (damage == 1) - to_chat(src, "Your eyes sting a little.") - if(prob(40)) - adjust_eye_damage(1) - - else if (damage == 2) - to_chat(src, "Your eyes burn.") - adjust_eye_damage(rand(2, 4)) - - else if( damage >= 3) - to_chat(src, "Your eyes itch and burn severely!") - adjust_eye_damage(rand(12, 16)) - - if(eyes.eye_damage > 10) - blind_eyes(damage) - blur_eyes(damage * rand(3, 6)) - - if(eyes.eye_damage > 20) - if(prob(eyes.eye_damage - 20)) - if(!HAS_TRAIT(src, TRAIT_NEARSIGHT)) - to_chat(src, "Your eyes start to burn badly!") - become_nearsighted(EYE_DAMAGE) - - else if(prob(eyes.eye_damage - 25)) - if(!HAS_TRAIT(src, TRAIT_BLIND)) - to_chat(src, "You can't see anything!") - become_blind(EYE_DAMAGE) - - else - to_chat(src, "Your eyes are really starting to hurt. This can't be good for you!") - if(has_bane(BANE_LIGHT)) - mind.disrupt_spells(-500) - return 1 - else if(damage == 0) // just enough protection - if(prob(20)) - to_chat(src, "Something bright flashes in the corner of your vision!") - if(has_bane(BANE_LIGHT)) - mind.disrupt_spells(0) - - -/mob/living/carbon/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15) - var/list/reflist = list(intensity) // Need to wrap this in a list so we can pass a reference - SEND_SIGNAL(src, COMSIG_CARBON_SOUNDBANG, reflist) - intensity = reflist[1] - var/ear_safety = get_ear_protection() - var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS) - var/effect_amount = intensity - ear_safety - if(effect_amount > 0) - if(stun_pwr) - Knockdown(stun_pwr*effect_amount) - - if(istype(ears) && (deafen_pwr || damage_pwr)) - var/ear_damage = damage_pwr * effect_amount - var/deaf = deafen_pwr * effect_amount - adjustEarDamage(ear_damage,deaf) - - if(ears.damage >= 15) - to_chat(src, "Your ears start to ring badly!") - if(prob(ears.damage - 5)) - to_chat(src, "You can't hear anything!") - ears.damage = min(ears.damage, ears.maxHealth) - // you need earmuffs, inacusiate, or replacement - else if(ears.damage >= 5) - to_chat(src, "Your ears start to ring!") - SEND_SOUND(src, sound('sound/weapons/flash_ring.ogg',0,1,0,250)) - return effect_amount //how soundbanged we are - - -/mob/living/carbon/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone) - if(damage_type != BRUTE && damage_type != BURN) - return - damage_amount *= 0.5 //0.5 multiplier for balance reason, we don't want clothes to be too easily destroyed - if(!def_zone || def_zone == BODY_ZONE_HEAD) - var/obj/item/clothing/hit_clothes - if(wear_mask) - hit_clothes = wear_mask - if(wear_neck) - hit_clothes = wear_neck - if(head) - hit_clothes = head - if(hit_clothes) - hit_clothes.take_damage(damage_amount, damage_type, damage_flag, 0) - -/mob/living/carbon/can_hear() - . = FALSE - var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS) - if(istype(ears) && !ears.deaf) - . = TRUE + +/mob/living/carbon/get_eye_protection() + var/number = ..() + + if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head + var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item + number += HFP.flash_protect + + if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses + var/obj/item/clothing/glasses/GFP = src.glasses + number += GFP.flash_protect + + if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask + var/obj/item/clothing/mask/MFP = src.wear_mask + number += MFP.flash_protect + + var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES) + if(!E) + number = INFINITY //Can't get flashed without eyes + else + number += E.flash_protect + + return number + +/mob/living/carbon/get_ear_protection() + var/number = ..() + var/obj/item/organ/ears/E = getorganslot(ORGAN_SLOT_EARS) + if(!E) + number = INFINITY + else + number += E.bang_protect + return number + +/mob/living/carbon/is_mouth_covered(head_only = 0, mask_only = 0) + if( (!mask_only && head && (head.flags_cover & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)) ) + return TRUE + +/mob/living/carbon/is_eyes_covered(check_glasses = 1, check_head = 1, check_mask = 1) + if(check_glasses && glasses && (glasses.flags_cover & GLASSESCOVERSEYES)) + return TRUE + if(check_head && head && (head.flags_cover & HEADCOVERSEYES)) + return TRUE + if(check_mask && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)) + return TRUE + +/mob/living/carbon/check_projectile_dismemberment(obj/item/projectile/P, def_zone) + var/obj/item/bodypart/affecting = get_bodypart(def_zone) + if(affecting && affecting.dismemberable && affecting.get_damage() >= (affecting.max_damage - P.dismemberment)) + affecting.dismember(P.damtype) + +/mob/living/carbon/catch_item(obj/item/I, skip_throw_mode_check = FALSE) + . = ..() + if(!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) && !skip_throw_mode_check && !in_throw_mode) + return + if(get_active_held_item() || restrained()) + return + I.attack_hand(src) + if(get_active_held_item() == I) //if our attack_hand() picks up the item... + visible_message("[src] catches [I]!") //catch that sucker! + throw_mode_off() + return TRUE + +/mob/living/carbon/embed_item(obj/item/I) + throw_alert("embeddedobject", /obj/screen/alert/embeddedobject) + var/obj/item/bodypart/L = pick(bodyparts) + L.embedded_objects |= I + I.add_mob_blood(src)//it embedded itself in you, of course it's bloody! + I.forceMove(src) + L.receive_damage(I.w_class*I.embedding.embedded_impact_pain_multiplier) + visible_message("[I] embeds itself in [src]'s [L.name]!","[I] embeds itself in your [L.name]!") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "embedded", /datum/mood_event/embedded) + +/mob/living/carbon/attacked_by(obj/item/I, mob/living/user) + //CIT CHANGES START HERE - combatmode and resting checks + var/totitemdamage = I.force + if(iscarbon(user)) + var/mob/living/carbon/tempcarb = user + if(!tempcarb.combatmode) + totitemdamage *= 0.5 + if(user.resting) + totitemdamage *= 0.5 + if(!combatmode) + totitemdamage *= 1.5 + //CIT CHANGES END HERE + if(user != src && check_shields(I, totitemdamage, "the [I.name]", MELEE_ATTACK, I.armour_penetration)) + return FALSE + var/obj/item/bodypart/affecting + if(user == src) + affecting = get_bodypart(check_zone(user.zone_selected)) //we're self-mutilating! yay! + else + affecting = get_bodypart(ran_zone(user.zone_selected)) + if(!affecting) //missing limb? we select the first bodypart (you can never have zero, because of chest) + affecting = bodyparts[1] + SEND_SIGNAL(I, COMSIG_ITEM_ATTACK_ZONE, src, user, affecting) + send_item_attack_message(I, user, affecting.name) + if(I.force) + apply_damage(totitemdamage, I.damtype, affecting) //CIT CHANGE - replaces I.force with totitemdamage + if(I.damtype == BRUTE && affecting.status == BODYPART_ORGANIC) + var/basebloodychance = affecting.brute_dam + totitemdamage + if(prob(basebloodychance)) + I.add_mob_blood(src) + bleed(totitemdamage) + if(totitemdamage >= 10 && get_dist(user, src) <= 1) //people with TK won't get smeared with blood + user.add_mob_blood(src) + + if(affecting.body_zone == BODY_ZONE_HEAD) + if(wear_mask && prob(basebloodychance)) + wear_mask.add_mob_blood(src) + update_inv_wear_mask() + if(wear_neck && prob(basebloodychance)) + wear_neck.add_mob_blood(src) + update_inv_neck() + if(head && prob(basebloodychance)) + head.add_mob_blood(src) + update_inv_head() + + //dismemberment + var/probability = I.get_dismemberment_chance(affecting) + if(prob(probability)) + if(affecting.dismember(I.damtype)) + I.add_mob_blood(src) + playsound(get_turf(src), I.get_dismember_sound(), 80, 1) + return TRUE //successful attack + +/mob/living/carbon/attack_drone(mob/living/simple_animal/drone/user) + return //so we don't call the carbon's attack_hand(). + +//ATTACK HAND IGNORING PARENT RETURN VALUE +/mob/living/carbon/attack_hand(mob/living/carbon/human/user) + . = ..() + if(.) //was the attack blocked? + return + for(var/thing in diseases) + var/datum/disease/D = thing + if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) + user.ContactContractDisease(D) + + for(var/thing in user.diseases) + var/datum/disease/D = thing + if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) + ContactContractDisease(D) + + if(lying && surgeries.len) + if(user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM) + for(var/datum/surgery/S in surgeries) + if(S.next_step(user, user.a_intent)) + return TRUE + + +/mob/living/carbon/attack_paw(mob/living/carbon/monkey/M) + + if(can_inject(M, TRUE)) + for(var/thing in diseases) + var/datum/disease/D = thing + if((D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) && prob(85)) + M.ContactContractDisease(D) + + for(var/thing in M.diseases) + var/datum/disease/D = thing + if(D.spread_flags & DISEASE_SPREAD_CONTACT_SKIN) + ContactContractDisease(D) + + if(M.a_intent == INTENT_HELP) + help_shake_act(M) + return 0 + + . = ..() + if(.) //successful monkey bite. + for(var/thing in M.diseases) + var/datum/disease/D = thing + ForceContractDisease(D) + return 1 + + +/mob/living/carbon/attack_slime(mob/living/simple_animal/slime/M) + . = ..() + if(!.) + return + if(M.powerlevel > 0) + var/stunprob = M.powerlevel * 7 + 10 // 17 at level 1, 80 at level 10 + if(prob(stunprob)) + M.powerlevel -= 3 + if(M.powerlevel < 0) + M.powerlevel = 0 + + visible_message("The [M.name] has shocked [src]!", \ + "The [M.name] has shocked [src]!") + + do_sparks(5, TRUE, src) + var/power = M.powerlevel + rand(0,3) + Knockdown(power*20) + if(stuttering < power) + stuttering = power + if (prob(stunprob) && M.powerlevel >= 8) + adjustFireLoss(M.powerlevel * rand(6,10)) + updatehealth() + +/mob/living/carbon/proc/dismembering_strike(mob/living/attacker, dam_zone) + if(!attacker.limb_destroyer) + return dam_zone + var/obj/item/bodypart/affecting + if(dam_zone && attacker.client) + affecting = get_bodypart(ran_zone(dam_zone)) + else + var/list/things_to_ruin = shuffle(bodyparts.Copy()) + for(var/B in things_to_ruin) + var/obj/item/bodypart/bodypart = B + if(bodypart.body_zone == BODY_ZONE_HEAD || bodypart.body_zone == BODY_ZONE_CHEST) + continue + if(!affecting || ((affecting.get_damage() / affecting.max_damage) < (bodypart.get_damage() / bodypart.max_damage))) + affecting = bodypart + if(affecting) + dam_zone = affecting.body_zone + if(affecting.get_damage() >= affecting.max_damage) + affecting.dismember() + return null + return affecting.body_zone + return dam_zone + + +/mob/living/carbon/blob_act(obj/structure/blob/B) + if (stat == DEAD) + return + else + show_message("The blob attacks!") + adjustBruteLoss(10) + +/mob/living/carbon/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_CONTENTS) + return + for(var/X in internal_organs) + var/obj/item/organ/O = X + O.emp_act(severity) + +/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0, illusion = 0, stun = TRUE) + if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) + return FALSE + if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) + return FALSE + shock_damage *= siemens_coeff + if(dna && dna.species) + shock_damage *= dna.species.siemens_coeff + if(shock_damage<1 && !override) + return 0 + if(reagents.has_reagent(/datum/reagent/teslium)) + shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging! + if(illusion) + adjustStaminaLoss(shock_damage) + else + take_overall_damage(0,shock_damage) + visible_message( + "[src] was shocked by \the [source]!", \ + "You feel a powerful shock coursing through your body!", \ + "You hear a heavy electrical crack." \ + ) + jitteriness += 1000 //High numbers for violent convulsions + do_jitter_animation(jitteriness) + stuttering += 2 + if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun) + Stun(40) + spawn(20) + jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less + if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun) + Knockdown(60) + if(override) + return override + else + return shock_damage + +/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) + if(on_fire) + to_chat(M, "You can't put [p_them()] out with just your bare hands!") + return + + if(health >= 0 && !(HAS_TRAIT(src, TRAIT_FAKEDEATH))) + + if(lying) + if(buckled) + to_chat(M, "You need to unbuckle [src] first to do that!") + return + M.visible_message("[M] shakes [src] trying to get [p_them()] up!", \ + "You shake [src] trying to get [p_them()] up!") + + else if(check_zone(M.zone_selected) == "head") + var/mob/living/carbon/human/H = src + var/datum/species/pref_species = H.dna.species + + if(HAS_TRAIT(H, TRAIT_HEADPAT_SLUT)) + M.visible_message("[M] gives [H] a pat on the head to make [p_them()] feel better! They seem incredibly pleased!", \ + "You give [H] a pat on the head to make [p_them()] feel better! They seem to like it way too much") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "lewd_headpat", /datum/mood_event/lewd_headpat) + H.adjustArousalLoss(5) //Headpats are hot af + else + M.visible_message("[M] gives [H] a pat on the head to make [p_them()] feel better!", \ + "You give [H] a pat on the head to make [p_them()] feel better!") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "headpat", /datum/mood_event/headpat) + + if(HAS_TRAIT(M, TRAIT_FRIENDLY)) + var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) + if (mood.sanity >= SANITY_GREAT) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/besthug, M) + else if (mood.sanity >= SANITY_DISTURBED) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, M) + if(H.dna.species.can_wag_tail(H)) + if("tail_human" in pref_species.default_features) + if(H.dna.features["tail_human"] == "None") + return + else + if(!H.dna.species.is_wagging_tail()) + H.emote("wag") + + if("tail_lizard" in pref_species.default_features) + if(H.dna.features["tail_lizard"] == "None") + return + else + if(!H.dna.species.is_wagging_tail()) + H.emote("wag") + + if("mam_tail" in pref_species.default_features) + if(H.dna.features["mam_tail"] == "None") + return + else + if(!H.dna.species.is_wagging_tail()) + H.emote("wag") + + else + return + + + else if(check_zone(M.zone_selected) == "mouth") + var/mob/living/carbon/human/H = src + var/datum/species/pref_species = H.dna.species + + M.visible_message("[M] gives [H] a boop on the nose.", \ + "You give [H] a boop on the nose!") + + if(H.dna.species.can_wag_tail(H)) + if("tail_human" in pref_species.default_features) + if(H.dna.features["tail_human"] == "None") + return + else + if(!H.dna.species.is_wagging_tail()) + H.emote("wag") + + if("tail_lizard" in pref_species.default_features) + if(H.dna.features["tail_lizard"] == "None") + return + else + if(!H.dna.species.is_wagging_tail()) + H.emote("wag") + + if("mam_tail" in pref_species.default_features) + if(H.dna.features["mam_tail"] == "None") + return + else + if(!H.dna.species.is_wagging_tail()) + H.emote("wag") + + else + return + + + else + M.visible_message("[M] hugs [src] to make [p_them()] feel better!", \ + "You hug [src] to make [p_them()] feel better!") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "hug", /datum/mood_event/hug) + if(HAS_TRAIT(M, TRAIT_FRIENDLY)) + var/datum/component/mood/mood = M.GetComponent(/datum/component/mood) + if (mood.sanity >= SANITY_GREAT) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/besthug, M) + else if (mood.sanity >= SANITY_DISTURBED) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, M) + + AdjustStun(-60) + AdjustKnockdown(-60) + AdjustUnconscious(-60) + AdjustSleeping(-100) + if(recoveringstam) + adjustStaminaLoss(-15) + else if(resting) + resting = 0 + update_canmove() + + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + + +/mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0) + . = ..() + + var/damage = intensity - get_eye_protection() + if(.) // we've been flashed + var/obj/item/organ/eyes/eyes = getorganslot(ORGAN_SLOT_EYES) + if (!eyes) + return + if(visual) + return + + if (damage == 1) + to_chat(src, "Your eyes sting a little.") + if(prob(40)) + adjust_eye_damage(1) + + else if (damage == 2) + to_chat(src, "Your eyes burn.") + adjust_eye_damage(rand(2, 4)) + + else if( damage >= 3) + to_chat(src, "Your eyes itch and burn severely!") + adjust_eye_damage(rand(12, 16)) + + if(eyes.eye_damage > 10) + blind_eyes(damage) + blur_eyes(damage * rand(3, 6)) + + if(eyes.eye_damage > 20) + if(prob(eyes.eye_damage - 20)) + if(!HAS_TRAIT(src, TRAIT_NEARSIGHT)) + to_chat(src, "Your eyes start to burn badly!") + become_nearsighted(EYE_DAMAGE) + + else if(prob(eyes.eye_damage - 25)) + if(!HAS_TRAIT(src, TRAIT_BLIND)) + to_chat(src, "You can't see anything!") + become_blind(EYE_DAMAGE) + + else + to_chat(src, "Your eyes are really starting to hurt. This can't be good for you!") + if(has_bane(BANE_LIGHT)) + mind.disrupt_spells(-500) + return 1 + else if(damage == 0) // just enough protection + if(prob(20)) + to_chat(src, "Something bright flashes in the corner of your vision!") + if(has_bane(BANE_LIGHT)) + mind.disrupt_spells(0) + + +/mob/living/carbon/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15) + var/list/reflist = list(intensity) // Need to wrap this in a list so we can pass a reference + SEND_SIGNAL(src, COMSIG_CARBON_SOUNDBANG, reflist) + intensity = reflist[1] + var/ear_safety = get_ear_protection() + var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS) + var/effect_amount = intensity - ear_safety + if(effect_amount > 0) + if(stun_pwr) + Knockdown(stun_pwr*effect_amount) + + if(istype(ears) && (deafen_pwr || damage_pwr)) + var/ear_damage = damage_pwr * effect_amount + var/deaf = deafen_pwr * effect_amount + adjustEarDamage(ear_damage,deaf) + + if(ears.damage >= 15) + to_chat(src, "Your ears start to ring badly!") + if(prob(ears.damage - 5)) + to_chat(src, "You can't hear anything!") + ears.damage = min(ears.damage, ears.maxHealth) + // you need earmuffs, inacusiate, or replacement + else if(ears.damage >= 5) + to_chat(src, "Your ears start to ring!") + SEND_SOUND(src, sound('sound/weapons/flash_ring.ogg',0,1,0,250)) + return effect_amount //how soundbanged we are + + +/mob/living/carbon/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone) + if(damage_type != BRUTE && damage_type != BURN) + return + damage_amount *= 0.5 //0.5 multiplier for balance reason, we don't want clothes to be too easily destroyed + if(!def_zone || def_zone == BODY_ZONE_HEAD) + var/obj/item/clothing/hit_clothes + if(wear_mask) + hit_clothes = wear_mask + if(wear_neck) + hit_clothes = wear_neck + if(head) + hit_clothes = head + if(hit_clothes) + hit_clothes.take_damage(damage_amount, damage_type, damage_flag, 0) + +/mob/living/carbon/can_hear() + . = FALSE + var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS) + if(istype(ears) && !ears.deaf) + . = TRUE diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 9dbf731e..cbda3597 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -1,421 +1,420 @@ -/mob/living/carbon/human/examine(mob/user) //User is the person being examined -//this is very slightly better than it was because you can use it more places. still can't do \his[src] though. - var/t_He = p_they(TRUE) - var/t_His = p_their(TRUE) - var/t_his = p_their() - var/t_him = p_them() - var/t_has = p_have() - var/t_is = p_are() - var/obscure_name - var/dispSize = round(12*size_multiplier) // gets the character's sprite size percent and converts it to the nearest half foot - - if(isliving(user)) - var/mob/living/L = user - if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA)) - obscure_name = TRUE - - . = list("*---------*\nThis is [!obscure_name ? name : "Unknown"]!") - - var/vampDesc = ReturnVampExamine(user) // Vamps recognize the names of other vamps. - var/vassDesc = ReturnVassalExamine(user) // Vassals recognize each other's marks. - if (vampDesc != "") // If we don't do it this way, we add a blank space to the string...something to do with this --> . += "" - . += vampDesc - if (vassDesc != "") - . += vassDesc - - var/list/obscured = check_obscured_slots() - var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) - - if(ishuman(src)) //user just returned, y'know, the user's own species. dumb. - var/mob/living/carbon/human/H = src - var/datum/species/pref_species = H.dna.species - if(get_visible_name() == "Unknown") // same as flavor text, but hey it works. - . += "You can't make out what species they are." - else if(skipface) - . += "You can't make out what species they are." - else - . += "[t_He] [t_is] a [H.dna.custom_species ? H.dna.custom_species : pref_species.name]!" - - //uniform - if(w_uniform && !(SLOT_W_UNIFORM in obscured)) - //accessory - var/accessory_msg - if(istype(w_uniform, /obj/item/clothing/under)) - var/obj/item/clothing/under/U = w_uniform - if(U.attached_accessory) - accessory_msg += " with [icon2html(U.attached_accessory, user)] \a [U.attached_accessory]" - - . += "[t_He] [t_is] wearing [w_uniform.get_examine_string(user)][accessory_msg]." - //head - if(head) - . += "[t_He] [t_is] wearing [head.get_examine_string(user)] on [t_his] head." - //suit/armor - if(wear_suit) - . += "[t_He] [t_is] wearing [wear_suit.get_examine_string(user)]." - //suit/armor storage - if(s_store && !(SLOT_S_STORE in obscured)) - . += "[t_He] [t_is] carrying [s_store.get_examine_string(user)] on [t_his] [wear_suit.name]." - //back - if(back) - . += "[t_He] [t_has] [back.get_examine_string(user)] on [t_his] back." - - //Hands - for(var/obj/item/I in held_items) - if(!(I.item_flags & ABSTRACT)) - . += "[t_He] [t_is] holding [I.get_examine_string(user)] in [t_his] [get_held_index_name(get_held_index_of_item(I))]." - - //gloves - if(gloves && !(SLOT_GLOVES in obscured)) - . += "[t_He] [t_has] [gloves.get_examine_string(user)] on [t_his] hands." - else if(length(blood_DNA)) - var/hand_number = get_num_arms(FALSE) - if(hand_number) - . += "[t_He] [t_has] [hand_number > 1 ? "" : "a"] blood-stained hand[hand_number > 1 ? "s" : ""]!" - //handcuffed? - if(handcuffed) - if(istype(handcuffed, /obj/item/restraints/handcuffs/cable)) - . += "[t_He] [t_is] [icon2html(handcuffed, user)] restrained with cable!" - else - . += "[t_He] [t_is] [icon2html(handcuffed, user)] handcuffed!" - - //belt - if(belt) - . += "[t_He] [t_has] [belt.get_examine_string(user)] about [t_his] waist." - - //shoes - if(shoes && !(SLOT_SHOES in obscured)) - . += "[t_He] [t_is] wearing [shoes.get_examine_string(user)] on [t_his] feet." - - //mask - if(wear_mask && !(SLOT_WEAR_MASK in obscured)) - . += "[t_He] [t_has] [wear_mask.get_examine_string(user)] on [t_his] face." - - if(wear_neck && !(SLOT_NECK in obscured)) - . += "[t_He] [t_is] wearing [wear_neck.get_examine_string(user)] around [t_his] neck." - - //eyes - if(!(SLOT_GLASSES in obscured)) - if(glasses) - . += "[t_He] [t_has] [glasses.get_examine_string(user)] covering [t_his] eyes." - else if(eye_color == BLOODCULT_EYE && iscultist(src) && HAS_TRAIT(src, TRAIT_CULT_EYES)) - . += "[t_His] eyes are glowing an unnatural red!" - - //ears - if(ears && !(SLOT_EARS in obscured)) - . += "[t_He] [t_has] [ears.get_examine_string(user)] on [t_his] ears." - - //ID - if(wear_id) - . += "[t_He] [t_is] wearing [wear_id.get_examine_string(user)]." - - //Status effects - var/effects_exam = status_effect_examines() - if(!isnull(effects_exam)) - . += effects_exam - - //Approximate character height based on current sprite scale - if(dispSize % 2) // returns 1 or 0. 1 meaning the height is not exact and the code below will execute, 0 meaning the height is exact and the else will trigger. - dispSize = dispSize - 1 //makes it even - dispSize = dispSize / 2 //rounds it out - . += "[t_He] appears to be around [dispSize] and a half feet tall." - else - dispSize = dispSize / 2 - . += "[t_He] appears to be around [dispSize] feet tall." - - //Can be picked up? - if(can_be_held) - . += "[t_He] might be able to be picked up with Alt+Click!\n" - - //CIT CHANGES START HERE - adds genital details to examine text - if(LAZYLEN(internal_organs)) - for(var/obj/item/organ/genital/dicc in internal_organs) - if(istype(dicc) && dicc.is_exposed()) - . += "[dicc.desc]" - - var/cursed_stuff = attempt_vr(src,"examine_bellies",args) //vore Code - if(!isnull(cursed_stuff)) - . += cursed_stuff -//END OF CIT CHANGES - - //Jitters - switch(jitteriness) - if(300 to INFINITY) - . += "[t_He] [t_is] convulsing violently!" - if(200 to 300) - . += "[t_He] [t_is] extremely jittery." - if(100 to 200) - . += "[t_He] [t_is] twitching ever so slightly." - - var/appears_dead = 0 - if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH))) - appears_dead = 1 - if(suiciding) - . += "[t_He] appear[p_s()] to have committed suicide... there is no hope of recovery." - if(hellbound) - . += "[t_His] soul seems to have been ripped out of [t_his] body. Revival is impossible." - if(getorgan(/obj/item/organ/brain) && !key && !get_ghost(FALSE, TRUE)) - . += "[t_He] [t_is] limp and unresponsive; there are no signs of life and [t_his] soul has departed..." - else - . += "[t_He] [t_is] limp and unresponsive; there are no signs of life..." - - if(get_bodypart(BODY_ZONE_HEAD) && !getorgan(/obj/item/organ/brain)) - . += "It appears that [t_his] brain is missing..." - - var/temp = getBruteLoss() //no need to calculate each of these twice - - var/list/msg = list() - - var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) - var/list/disabled = list() - for(var/X in bodyparts) - var/obj/item/bodypart/BP = X - if(BP.disabled) - disabled += BP - missing -= BP.body_zone - for(var/obj/item/I in BP.embedded_objects) - msg += "[t_He] [t_has] \a [icon2html(I, user)] [I] embedded in [t_his] [BP.name]!\n" - if(BP.broken) - msg += "[t_He] [t_has] \a [I] broken [BP.name]!\n" - - for(var/X in disabled) - var/obj/item/bodypart/BP = X - var/damage_text - if(!(BP.get_damage(include_stamina = FALSE) >= BP.max_damage)) //Stamina is disabling the limb - damage_text = "limp and lifeless" - else - damage_text = (BP.brute_dam >= BP.burn_dam) ? BP.heavy_brute_msg : BP.heavy_burn_msg - msg += "[capitalize(t_his)] [BP.name] is [damage_text]!\n" - - //stores missing limbs - var/l_limbs_missing = 0 - var/r_limbs_missing = 0 - for(var/t in missing) - if(t==BODY_ZONE_HEAD) - msg += "[t_His] [parse_zone(t)] is missing!\n" - continue - if(t == BODY_ZONE_L_ARM || t == BODY_ZONE_L_LEG) - l_limbs_missing++ - else if(t == BODY_ZONE_R_ARM || t == BODY_ZONE_R_LEG) - r_limbs_missing++ - - msg += "[capitalize(t_his)] [parse_zone(t)] is missing!\n" - - if(l_limbs_missing >= 2 && r_limbs_missing == 0) - msg += "[t_He] look[p_s()] all right now.\n" - else if(l_limbs_missing == 0 && r_limbs_missing >= 2) - msg += "[t_He] really keeps to the left.\n" - else if(l_limbs_missing >= 2 && r_limbs_missing >= 2) - msg += "[t_He] [p_do()]n't seem all there.\n" - - if(!(user == src && src.hal_screwyhud == SCREWYHUD_HEALTHY)) //fake healthy - if(temp) - if(temp < 25) - msg += "[t_He] [t_has] minor bruising.\n" - else if(temp < 50) - msg += "[t_He] [t_has] moderate bruising!\n" - else - msg += "[t_He] [t_has] severe bruising!\n" - - temp = getFireLoss() - if(temp) - if(temp < 25) - msg += "[t_He] [t_has] minor burns.\n" - else if (temp < 50) - msg += "[t_He] [t_has] moderate burns!\n" - else - msg += "[t_He] [t_has] severe burns!\n" - - temp = getCloneLoss() - if(temp) - if(temp < 25) - msg += "[t_He] [t_has] minor cellular damage.\n" - else if(temp < 50) - msg += "[t_He] [t_has] moderate cellular damage!\n" - else - msg += "[t_He] [t_has] severe cellular damage!\n" - - - if(fire_stacks > 0) - msg += "[t_He] [t_is] covered in something flammable.\n" - if(fire_stacks < 0) - msg += "[t_He] look[p_s()] a little soaked.\n" - - - if(pulledby && pulledby.grab_state) - msg += "[t_He] [t_is] restrained by [pulledby]'s grip.\n" - - if(nutrition < NUTRITION_LEVEL_STARVING - 50) - msg += "[t_He] [t_is] severely malnourished.\n" - else if(nutrition >= NUTRITION_LEVEL_FAT) - if(user.nutrition < NUTRITION_LEVEL_STARVING - 50) - msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n" - else - msg += "[t_He] [t_is] quite chubby.\n" - switch(disgust) - if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS) - msg += "[t_He] look[p_s()] a bit grossed out.\n" - if(DISGUST_LEVEL_VERYGROSS to DISGUST_LEVEL_DISGUSTED) - msg += "[t_He] look[p_s()] really grossed out.\n" - if(DISGUST_LEVEL_DISGUSTED to INFINITY) - msg += "[t_He] look[p_s()] extremely disgusted.\n" - - if(ShowAsPaleExamine()) - msg += "[t_He] [t_has] pale skin.\n" - - if(bleedsuppress) - msg += "[t_He] [t_is] bandaged with something.\n" - else if(bleed_rate) - if(reagents.has_reagent("heparin")) - msg += "[t_He] [t_is] bleeding uncontrollably!\n" - else - msg += "[t_He] [t_is] bleeding!\n" - - if(reagents.has_reagent("teslium")) - msg += "[t_He] [t_is] emitting a gentle blue glow!\n" - - if(islist(stun_absorption)) - for(var/i in stun_absorption) - if(stun_absorption[i]["end_time"] > world.time && stun_absorption[i]["examine_message"]) - msg += "[t_He] [t_is][stun_absorption[i]["examine_message"]]\n" - - if(drunkenness && !skipface && !appears_dead) //Drunkenness - switch(drunkenness) - if(11 to 21) - msg += "[t_He] [t_is] slightly flushed.\n" - if(21.01 to 41) //.01s are used in case drunkenness ends up to be a small decimal - msg += "[t_He] [t_is] flushed.\n" - if(41.01 to 51) - msg += "[t_He] [t_is] quite flushed and [t_his] breath smells of alcohol.\n" - if(51.01 to 61) - msg += "[t_He] [t_is] very flushed and [t_his] movements jerky, with breath reeking of alcohol.\n" - if(61.01 to 91) - msg += "[t_He] look[p_s()] like a drunken mess.\n" - if(91.01 to INFINITY) - msg += "[t_He] [t_is] a shitfaced, slobbering wreck.\n" - - if(reagents.has_reagent("astral")) - msg += "[t_He] have wild, spacey eyes" - if(mind) - msg += " and have a strange, abnormal look to them.\n" - else - msg += " and don't look like they're all there.\n" - - if(isliving(user)) - var/mob/living/L = user - if(src != user && HAS_TRAIT(L, TRAIT_EMPATH) && !appears_dead) - if (a_intent != INTENT_HELP) - msg += "[t_He] seem[p_s()] to be on guard.\n" - if (getOxyLoss() >= 10) - msg += "[t_He] seem[p_s()] winded.\n" - if (getToxLoss() >= 10) - msg += "[t_He] seem[p_s()] sickly.\n" - var/datum/component/mood/mood = src.GetComponent(/datum/component/mood) - if(mood.sanity <= SANITY_DISTURBED) - msg += "[t_He] seem[p_s()] distressed.\n" - SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "empath", /datum/mood_event/sad_empath, src) - if(mood.shown_mood >= 6) //So roundstart people aren't all "happy" and that antags don't show their true happiness. - msg += "[t_He] seem[p_s()] to have had something nice happen to them recently.\n" - SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "empathH", /datum/mood_event/happy_empath, src) - if (HAS_TRAIT(src, TRAIT_BLIND)) - msg += "[t_He] appear[p_s()] to be staring off into space.\n" - if (HAS_TRAIT(src, TRAIT_DEAF)) - msg += "[t_He] appear[p_s()] to not be responding to noises.\n" - - msg += "" - - var/obj/item/organ/vocal_cords/Vc = user.getorganslot(ORGAN_SLOT_VOICE) - if(Vc) - if(istype(Vc, /obj/item/organ/vocal_cords/velvet)) - if(client?.prefs.lewdchem) - msg += "You feel your chords resonate looking at them.\n" - - - if(!appears_dead) - if(stat == UNCONSCIOUS) - msg += "[t_He] [t_is]n't responding to anything around [t_him] and seem[p_s()] to be asleep.\n" - else - if(HAS_TRAIT(src, TRAIT_DUMB)) - msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n" - if(InCritical()) - msg += "[t_He] [t_is] barely conscious.\n" - if(getorgan(/obj/item/organ/brain)) - if(!key) - msg += "[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.\n" - else if(!client) - msg += "[t_He] [t_has] a blank, absent-minded stare and appears completely unresponsive to anything. [t_He] may snap out of it soon.\n" - - if(digitalcamo) - msg += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly inhuman manner.\n" - - if (length(msg)) - . += "[msg.Join("")]" - - var/traitstring = get_trait_string() - if(ishuman(user)) - var/mob/living/carbon/human/H = user - var/obj/item/organ/cyberimp/eyes/hud/CIH = H.getorgan(/obj/item/organ/cyberimp/eyes/hud) - if(istype(H.glasses, /obj/item/clothing/glasses/hud) || CIH) - var/perpname = get_face_name(get_id_name("")) - if(perpname) - var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.general) - if(R) - . += "Rank: [R.fields["rank"]]\n\[Front photo\]\[Side photo\]" - if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(CIH, /obj/item/organ/cyberimp/eyes/hud/medical)) - var/cyberimp_detect - for(var/obj/item/organ/cyberimp/CI in internal_organs) - if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant) - cyberimp_detect += "[name] is modified with a [CI.name]." - if(cyberimp_detect) - . += "Detected cybernetic modifications:" - . += cyberimp_detect - if(R) - var/health_r = R.fields["p_stat"] - . += "\[[health_r]\]" - health_r = R.fields["m_stat"] - . += "\[[health_r]\]" - R = find_record("name", perpname, GLOB.data_core.medical) - if(R) - . += "\[Medical evaluation\]" - if(traitstring) - . += "Detected physiological traits:\n[traitstring]" - - - if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(CIH, /obj/item/organ/cyberimp/eyes/hud/security)) - if(!user.stat && user != src) - //|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at. - var/criminal = "None" - - R = find_record("name", perpname, GLOB.data_core.security) - if(R) - criminal = R.fields["criminal"] - - . += jointext(list("Criminal status: \[[criminal]\]", - "Security record: \[View\]", - "\[Add crime\]", - "\[View comment log\]", - "\[Add comment\]"), "") - else if(isobserver(user) && traitstring) - . += "Traits: [traitstring]" - - if(print_flavor_text()) - if(get_visible_name() == "Unknown") //Are we sure we know who this is? Don't show flavor text unless we can recognize them. Prevents certain metagaming with impersonation. - . += "...?" - else if(skipface) //Sometimes we're not unknown, but impersonating someone in a hardsuit, let's not reveal our flavor text then either. - . += "...?" - else - . += "[print_flavor_text()]" - SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, msg) - . += "*---------*" - -/mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects! - var/list/dat = list() - if(!pronoun_replacement) - pronoun_replacement = p_they(TRUE) - for(var/V in status_effects) - var/datum/status_effect/E = V - if(E.examine_text) - var/new_text = replacetext(E.examine_text, "SUBJECTPRONOUN", pronoun_replacement) - new_text = replacetext(new_text, "[pronoun_replacement] is", "[pronoun_replacement] [p_are()]") //To make sure something become "They are" or "She is", not "They are" and "She are" - dat += "[new_text]\n" //dat.Join("\n") doesn't work here, for some reason - if(dat.len) - return dat.Join() +/mob/living/carbon/human/examine(mob/user) //User is the person being examined +//this is very slightly better than it was because you can use it more places. still can't do \his[src] though. + var/t_He = p_they(TRUE) + var/t_His = p_their(TRUE) + var/t_his = p_their() + var/t_him = p_them() + var/t_has = p_have() + var/t_is = p_are() + var/obscure_name + var/dispSize = round(12*size_multiplier) // gets the character's sprite size percent and converts it to the nearest half foot + + if(isliving(user)) + var/mob/living/L = user + if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA)) + obscure_name = TRUE + + . = list("*---------*\nThis is [!obscure_name ? name : "Unknown"]!") + + var/vampDesc = ReturnVampExamine(user) // Vamps recognize the names of other vamps. + var/vassDesc = ReturnVassalExamine(user) // Vassals recognize each other's marks. + if (vampDesc != "") // If we don't do it this way, we add a blank space to the string...something to do with this --> . += "" + . += vampDesc + if (vassDesc != "") + . += vassDesc + + var/list/obscured = check_obscured_slots() + var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) + + if(ishuman(src)) //user just returned, y'know, the user's own species. dumb. + var/mob/living/carbon/human/H = src + var/datum/species/pref_species = H.dna.species + if(get_visible_name() == "Unknown") // same as flavor text, but hey it works. + . += "You can't make out what species they are." + else if(skipface) + . += "You can't make out what species they are." + else + . += "[t_He] [t_is] a [H.dna.custom_species ? H.dna.custom_species : pref_species.name]!" + + //uniform + if(w_uniform && !(SLOT_W_UNIFORM in obscured)) + //accessory + var/accessory_msg + if(istype(w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/U = w_uniform + if(U.attached_accessory) + accessory_msg += " with [icon2html(U.attached_accessory, user)] \a [U.attached_accessory]" + + . += "[t_He] [t_is] wearing [w_uniform.get_examine_string(user)][accessory_msg]." + //head + if(head) + . += "[t_He] [t_is] wearing [head.get_examine_string(user)] on [t_his] head." + //suit/armor + if(wear_suit) + . += "[t_He] [t_is] wearing [wear_suit.get_examine_string(user)]." + //suit/armor storage + if(s_store && !(SLOT_S_STORE in obscured)) + . += "[t_He] [t_is] carrying [s_store.get_examine_string(user)] on [t_his] [wear_suit.name]." + //back + if(back) + . += "[t_He] [t_has] [back.get_examine_string(user)] on [t_his] back." + + //Hands + for(var/obj/item/I in held_items) + if(!(I.item_flags & ABSTRACT)) + . += "[t_He] [t_is] holding [I.get_examine_string(user)] in [t_his] [get_held_index_name(get_held_index_of_item(I))]." + + //gloves + if(gloves && !(SLOT_GLOVES in obscured)) + . += "[t_He] [t_has] [gloves.get_examine_string(user)] on [t_his] hands." + else if(length(blood_DNA)) + var/hand_number = get_num_arms(FALSE) + if(hand_number) + . += "[t_He] [t_has] [hand_number > 1 ? "" : "a"] blood-stained hand[hand_number > 1 ? "s" : ""]!" + //handcuffed? + if(handcuffed) + if(istype(handcuffed, /obj/item/restraints/handcuffs/cable)) + . += "[t_He] [t_is] [icon2html(handcuffed, user)] restrained with cable!" + else + . += "[t_He] [t_is] [icon2html(handcuffed, user)] handcuffed!" + + //belt + if(belt) + . += "[t_He] [t_has] [belt.get_examine_string(user)] about [t_his] waist." + + //shoes + if(shoes && !(SLOT_SHOES in obscured)) + . += "[t_He] [t_is] wearing [shoes.get_examine_string(user)] on [t_his] feet." + + //mask + if(wear_mask && !(SLOT_WEAR_MASK in obscured)) + . += "[t_He] [t_has] [wear_mask.get_examine_string(user)] on [t_his] face." + + if(wear_neck && !(SLOT_NECK in obscured)) + . += "[t_He] [t_is] wearing [wear_neck.get_examine_string(user)] around [t_his] neck." + + //eyes + if(!(SLOT_GLASSES in obscured)) + if(glasses) + . += "[t_He] [t_has] [glasses.get_examine_string(user)] covering [t_his] eyes." + else if(eye_color == BLOODCULT_EYE && iscultist(src) && HAS_TRAIT(src, TRAIT_CULT_EYES)) + . += "[t_His] eyes are glowing an unnatural red!" + + //ears + if(ears && !(SLOT_EARS in obscured)) + . += "[t_He] [t_has] [ears.get_examine_string(user)] on [t_his] ears." + + //ID + if(wear_id) + . += "[t_He] [t_is] wearing [wear_id.get_examine_string(user)]." + + //Status effects + var/effects_exam = status_effect_examines() + if(!isnull(effects_exam)) + . += effects_exam + + //Approximate character height based on current sprite scale + if(dispSize % 2) // returns 1 or 0. 1 meaning the height is not exact and the code below will execute, 0 meaning the height is exact and the else will trigger. + dispSize = dispSize - 1 //makes it even + dispSize = dispSize / 2 //rounds it out + . += "[t_He] appears to be around [dispSize] and a half feet tall." + else + dispSize = dispSize / 2 + . += "[t_He] appears to be around [dispSize] feet tall." + + //Can be picked up? + if(can_be_held) + . += "[t_He] might be able to be picked up with Alt+Click!\n" + + //CIT CHANGES START HERE - adds genital details to examine text + if(LAZYLEN(internal_organs)) + for(var/obj/item/organ/genital/dicc in internal_organs) + if(istype(dicc) && dicc.is_exposed()) + . += "[dicc.desc]" + + var/cursed_stuff = attempt_vr(src,"examine_bellies",args) //vore Code + if(!isnull(cursed_stuff)) + . += cursed_stuff +//END OF CIT CHANGES + + //Jitters + switch(jitteriness) + if(300 to INFINITY) + . += "[t_He] [t_is] convulsing violently!" + if(200 to 300) + . += "[t_He] [t_is] extremely jittery." + if(100 to 200) + . += "[t_He] [t_is] twitching ever so slightly." + + var/appears_dead = 0 + if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH))) + appears_dead = 1 + if(suiciding) + . += "[t_He] appear[p_s()] to have committed suicide... there is no hope of recovery." + if(hellbound) + . += "[t_His] soul seems to have been ripped out of [t_his] body. Revival is impossible." + if(getorgan(/obj/item/organ/brain) && !key && !get_ghost(FALSE, TRUE)) + . += "[t_He] [t_is] limp and unresponsive; there are no signs of life and [t_his] soul has departed..." + else + . += "[t_He] [t_is] limp and unresponsive; there are no signs of life..." + + if(get_bodypart(BODY_ZONE_HEAD) && !getorgan(/obj/item/organ/brain)) + . += "It appears that [t_his] brain is missing..." + + var/temp = getBruteLoss() //no need to calculate each of these twice + + var/list/msg = list() + + var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) + var/list/disabled = list() + for(var/X in bodyparts) + var/obj/item/bodypart/BP = X + if(BP.disabled) + disabled += BP + missing -= BP.body_zone + for(var/obj/item/I in BP.embedded_objects) + msg += "[t_He] [t_has] \a [icon2html(I, user)] [I] embedded in [t_his] [BP.name]!\n" + if(BP.broken) + msg += "[t_He] [t_has] \a [I] broken [BP.name]!\n" + + for(var/X in disabled) + var/obj/item/bodypart/BP = X + var/damage_text + if(!(BP.get_damage(include_stamina = FALSE) >= BP.max_damage)) //Stamina is disabling the limb + damage_text = "limp and lifeless" + else + damage_text = (BP.brute_dam >= BP.burn_dam) ? BP.heavy_brute_msg : BP.heavy_burn_msg + msg += "[capitalize(t_his)] [BP.name] is [damage_text]!\n" + + //stores missing limbs + var/l_limbs_missing = 0 + var/r_limbs_missing = 0 + for(var/t in missing) + if(t==BODY_ZONE_HEAD) + msg += "[t_His] [parse_zone(t)] is missing!\n" + continue + if(t == BODY_ZONE_L_ARM || t == BODY_ZONE_L_LEG) + l_limbs_missing++ + else if(t == BODY_ZONE_R_ARM || t == BODY_ZONE_R_LEG) + r_limbs_missing++ + + msg += "[capitalize(t_his)] [parse_zone(t)] is missing!\n" + + if(l_limbs_missing >= 2 && r_limbs_missing == 0) + msg += "[t_He] look[p_s()] all right now.\n" + else if(l_limbs_missing == 0 && r_limbs_missing >= 2) + msg += "[t_He] really keeps to the left.\n" + else if(l_limbs_missing >= 2 && r_limbs_missing >= 2) + msg += "[t_He] [p_do()]n't seem all there.\n" + + if(!(user == src && src.hal_screwyhud == SCREWYHUD_HEALTHY)) //fake healthy + if(temp) + if(temp < 25) + msg += "[t_He] [t_has] minor bruising.\n" + else if(temp < 50) + msg += "[t_He] [t_has] moderate bruising!\n" + else + msg += "[t_He] [t_has] severe bruising!\n" + + temp = getFireLoss() + if(temp) + if(temp < 25) + msg += "[t_He] [t_has] minor burns.\n" + else if (temp < 50) + msg += "[t_He] [t_has] moderate burns!\n" + else + msg += "[t_He] [t_has] severe burns!\n" + + temp = getCloneLoss() + if(temp) + if(temp < 25) + msg += "[t_He] [t_has] minor cellular damage.\n" + else if(temp < 50) + msg += "[t_He] [t_has] moderate cellular damage!\n" + else + msg += "[t_He] [t_has] severe cellular damage!\n" + + + if(fire_stacks > 0) + msg += "[t_He] [t_is] covered in something flammable.\n" + if(fire_stacks < 0) + msg += "[t_He] look[p_s()] a little soaked.\n" + + + if(pulledby && pulledby.grab_state) + msg += "[t_He] [t_is] restrained by [pulledby]'s grip.\n" + + if(nutrition < NUTRITION_LEVEL_STARVING - 50) + msg += "[t_He] [t_is] severely malnourished.\n" + else if(nutrition >= NUTRITION_LEVEL_FAT) + if(user.nutrition < NUTRITION_LEVEL_STARVING - 50) + msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n" + else + msg += "[t_He] [t_is] quite chubby.\n" + switch(disgust) + if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS) + msg += "[t_He] look[p_s()] a bit grossed out.\n" + if(DISGUST_LEVEL_VERYGROSS to DISGUST_LEVEL_DISGUSTED) + msg += "[t_He] look[p_s()] really grossed out.\n" + if(DISGUST_LEVEL_DISGUSTED to INFINITY) + msg += "[t_He] look[p_s()] extremely disgusted.\n" + + if(ShowAsPaleExamine()) + msg += "[t_He] [t_has] pale skin.\n" + + if(bleedsuppress) + msg += "[t_He] [t_is] bandaged with something.\n" + else if(bleed_rate) + if(reagents.has_reagent("heparin")) + msg += "[t_He] [t_is] bleeding uncontrollably!\n" + else + msg += "[t_He] [t_is] bleeding!\n" + + if(reagents.has_reagent(/datum/reagent/teslium)) + msg += "[t_He] [t_is] emitting a gentle blue glow!\n" + + if(islist(stun_absorption)) + for(var/i in stun_absorption) + if(stun_absorption[i]["end_time"] > world.time && stun_absorption[i]["examine_message"]) + msg += "[t_He] [t_is][stun_absorption[i]["examine_message"]]\n" + + if(drunkenness && !skipface && !appears_dead) //Drunkenness + switch(drunkenness) + if(11 to 21) + msg += "[t_He] [t_is] slightly flushed.\n" + if(21.01 to 41) //.01s are used in case drunkenness ends up to be a small decimal + msg += "[t_He] [t_is] flushed.\n" + if(41.01 to 51) + msg += "[t_He] [t_is] quite flushed and [t_his] breath smells of alcohol.\n" + if(51.01 to 61) + msg += "[t_He] [t_is] very flushed and [t_his] movements jerky, with breath reeking of alcohol.\n" + if(61.01 to 91) + msg += "[t_He] look[p_s()] like a drunken mess.\n" + if(91.01 to INFINITY) + msg += "[t_He] [t_is] a shitfaced, slobbering wreck.\n" + + if(reagents.has_reagent(/datum/reagent/fermi/astral)) + if(mind) + msg += " and have a strange, abnormal look to them.\n" + else + msg += " and don't look like they're all there.\n" + + if(isliving(user)) + var/mob/living/L = user + if(src != user && HAS_TRAIT(L, TRAIT_EMPATH) && !appears_dead) + if (a_intent != INTENT_HELP) + msg += "[t_He] seem[p_s()] to be on guard.\n" + if (getOxyLoss() >= 10) + msg += "[t_He] seem[p_s()] winded.\n" + if (getToxLoss() >= 10) + msg += "[t_He] seem[p_s()] sickly.\n" + var/datum/component/mood/mood = src.GetComponent(/datum/component/mood) + if(mood.sanity <= SANITY_DISTURBED) + msg += "[t_He] seem[p_s()] distressed.\n" + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "empath", /datum/mood_event/sad_empath, src) + if(mood.shown_mood >= 6) //So roundstart people aren't all "happy" and that antags don't show their true happiness. + msg += "[t_He] seem[p_s()] to have had something nice happen to them recently.\n" + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "empathH", /datum/mood_event/happy_empath, src) + if (HAS_TRAIT(src, TRAIT_BLIND)) + msg += "[t_He] appear[p_s()] to be staring off into space.\n" + if (HAS_TRAIT(src, TRAIT_DEAF)) + msg += "[t_He] appear[p_s()] to not be responding to noises.\n" + + msg += "" + + var/obj/item/organ/vocal_cords/Vc = user.getorganslot(ORGAN_SLOT_VOICE) + if(Vc) + if(istype(Vc, /obj/item/organ/vocal_cords/velvet)) + if(client?.prefs.lewdchem) + msg += "You feel your chords resonate looking at them.\n" + + + if(!appears_dead) + if(stat == UNCONSCIOUS) + msg += "[t_He] [t_is]n't responding to anything around [t_him] and seem[p_s()] to be asleep.\n" + else + if(HAS_TRAIT(src, TRAIT_DUMB)) + msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n" + if(InCritical()) + msg += "[t_He] [t_is] barely conscious.\n" + if(getorgan(/obj/item/organ/brain)) + if(!key) + msg += "[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.\n" + else if(!client) + msg += "[t_He] [t_has] a blank, absent-minded stare and appears completely unresponsive to anything. [t_He] may snap out of it soon.\n" + + if(digitalcamo) + msg += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly inhuman manner.\n" + + if (length(msg)) + . += "[msg.Join("")]" + + var/traitstring = get_trait_string() + if(ishuman(user)) + var/mob/living/carbon/human/H = user + var/obj/item/organ/cyberimp/eyes/hud/CIH = H.getorgan(/obj/item/organ/cyberimp/eyes/hud) + if(istype(H.glasses, /obj/item/clothing/glasses/hud) || CIH) + var/perpname = get_face_name(get_id_name("")) + if(perpname) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.general) + if(R) + . += "Rank: [R.fields["rank"]]\n\[Front photo\]\[Side photo\]" + if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(CIH, /obj/item/organ/cyberimp/eyes/hud/medical)) + var/cyberimp_detect + for(var/obj/item/organ/cyberimp/CI in internal_organs) + if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant) + cyberimp_detect += "[name] is modified with a [CI.name]." + if(cyberimp_detect) + . += "Detected cybernetic modifications:" + . += cyberimp_detect + if(R) + var/health_r = R.fields["p_stat"] + . += "\[[health_r]\]" + health_r = R.fields["m_stat"] + . += "\[[health_r]\]" + R = find_record("name", perpname, GLOB.data_core.medical) + if(R) + . += "\[Medical evaluation\]" + if(traitstring) + . += "Detected physiological traits:\n[traitstring]" + + + if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(CIH, /obj/item/organ/cyberimp/eyes/hud/security)) + if(!user.stat && user != src) + //|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at. + var/criminal = "None" + + R = find_record("name", perpname, GLOB.data_core.security) + if(R) + criminal = R.fields["criminal"] + + . += jointext(list("Criminal status: \[[criminal]\]", + "Security record: \[View\]", + "\[Add crime\]", + "\[View comment log\]", + "\[Add comment\]"), "") + else if(isobserver(user) && traitstring) + . += "Traits: [traitstring]" + + if(print_flavor_text()) + if(get_visible_name() == "Unknown") //Are we sure we know who this is? Don't show flavor text unless we can recognize them. Prevents certain metagaming with impersonation. + . += "...?" + else if(skipface) //Sometimes we're not unknown, but impersonating someone in a hardsuit, let's not reveal our flavor text then either. + . += "...?" + else + . += "[print_flavor_text()]" + SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, msg) + . += "*---------*" + +/mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects! + var/list/dat = list() + if(!pronoun_replacement) + pronoun_replacement = p_they(TRUE) + for(var/V in status_effects) + var/datum/status_effect/E = V + if(E.examine_text) + var/new_text = replacetext(E.examine_text, "SUBJECTPRONOUN", pronoun_replacement) + new_text = replacetext(new_text, "[pronoun_replacement] is", "[pronoun_replacement] [p_are()]") //To make sure something become "They are" or "She is", not "They are" and "She are" + dat += "[new_text]\n" //dat.Join("\n") doesn't work here, for some reason + if(dat.len) + return dat.Join() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index b22049f4..34367af9 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1205,9 +1205,9 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.update_mutant_bodyparts() /datum/species/proc/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == exotic_blood) + if(chem.type == exotic_blood) H.blood_volume = min(H.blood_volume + round(chem.volume, 0.1), BLOOD_VOLUME_MAXIMUM) - H.reagents.del_reagent(chem.id) + H.reagents.del_reagent(chem.type) return 1 return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/flypeople.dm b/code/modules/mob/living/carbon/human/species_types/flypeople.dm index 40cbcbab..4bd76bcb 100644 --- a/code/modules/mob/living/carbon/human/species_types/flypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/flypeople.dm @@ -1,36 +1,36 @@ -/datum/species/fly - name = "Flyperson" - id = "fly" - say_mod = "buzzes" - species_traits = list(NOEYES) - inherent_biotypes = list(MOB_ORGANIC, MOB_HUMANOID, MOB_BUG) - mutanttongue = /obj/item/organ/tongue/fly - mutantliver = /obj/item/organ/liver/fly - mutantstomach = /obj/item/organ/stomach/fly - meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/fly - disliked_food = null - liked_food = GROSS - exotic_bloodtype = "BUG" - -/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "pestkiller") - H.adjustToxLoss(3) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - return 1 - - -/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(istype(chem, /datum/reagent/consumable)) - var/datum/reagent/consumable/nutri_check = chem - if(nutri_check.nutriment_factor > 0) - var/turf/pos = get_turf(H) - H.vomit(0, FALSE, FALSE, 2, TRUE) - playsound(pos, 'sound/effects/splat.ogg', 50, 1) - H.visible_message("[H] vomits on the floor!", \ - "You throw up on the floor!") - ..() - -/datum/species/fly/check_weakness(obj/item/weapon, mob/living/attacker) - if(istype(weapon, /obj/item/melee/flyswatter)) - return 29 //Flyswatters deal 30x damage to flypeople. - return 0 +/datum/species/fly + name = "Flyperson" + id = "fly" + say_mod = "buzzes" + species_traits = list(NOEYES) + inherent_biotypes = list(MOB_ORGANIC, MOB_HUMANOID, MOB_BUG) + mutanttongue = /obj/item/organ/tongue/fly + mutantliver = /obj/item/organ/liver/fly + mutantstomach = /obj/item/organ/stomach/fly + meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/fly + disliked_food = null + liked_food = GROSS + exotic_bloodtype = "BUG" + +/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(chem.type == /datum/reagent/toxin/pestkiller) + H.adjustToxLoss(3) + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) + return 1 + + +/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(istype(chem, /datum/reagent/consumable)) + var/datum/reagent/consumable/nutri_check = chem + if(nutri_check.nutriment_factor > 0) + var/turf/pos = get_turf(H) + H.vomit(0, FALSE, FALSE, 2, TRUE) + playsound(pos, 'sound/effects/splat.ogg', 50, 1) + H.visible_message("[H] vomits on the floor!", \ + "You throw up on the floor!") + ..() + +/datum/species/fly/check_weakness(obj/item/weapon, mob/living/attacker) + if(istype(weapon, /obj/item/melee/flyswatter)) + return 29 //Flyswatters deal 30x damage to flypeople. + return 0 diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index a827beae..896b9ad2 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -1,1009 +1,1009 @@ -/datum/species/golem - // Animated beings of stone. They have increased defenses, and do not need to breathe. They're also slow as fuuuck. - name = "Golem" - id = "iron golem" - species_traits = list(NOBLOOD,MUTCOLORS,NO_UNDERWEAR,NOGENITALS,NOAROUSAL) - inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOFIRE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) - inherent_biotypes = list(MOB_INORGANIC, MOB_HUMANOID) - mutant_organs = list(/obj/item/organ/adamantine_resonator) - speedmod = 2 - armor = 55 - siemens_coeff = 0 - punchdamagelow = 5 - punchdamagehigh = 14 - punchstunthreshold = 11 //about 40% chance to stun - no_equip = list(SLOT_WEAR_MASK, SLOT_WEAR_SUIT, SLOT_GLOVES, SLOT_SHOES, SLOT_W_UNIFORM, SLOT_S_STORE) - nojumpsuit = 1 - sexes = 1 - damage_overlay_type = "" - meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/golem - // To prevent golem subtypes from overwhelming the odds when random species - // changes, only the Random Golem type can be chosen - blacklisted = TRUE - dangerous_existence = TRUE - limbs_id = "golem" - fixed_mut_color = "aaa" - var/info_text = "As an Iron Golem, you don't have any special traits." - var/random_eligible = TRUE //If false, the golem subtype can't be made through golem mutation toxin - - var/prefix = "Iron" - var/list/special_names = list("Tarkus") - var/human_surname_chance = 3 - var/special_name_chance = 5 - var/owner //dobby is a free golem - -/datum/species/golem/random_name(gender,unique,lastname) - var/golem_surname = pick(GLOB.golem_names) - // 3% chance that our golem has a human surname, because - // cultural contamination - if(prob(human_surname_chance)) - golem_surname = pick(GLOB.last_names) - else if(special_names && special_names.len && prob(special_name_chance)) - golem_surname = pick(special_names) - - var/golem_name = "[prefix] [golem_surname]" - return golem_name - -/datum/species/golem/random - name = "Random Golem" - blacklisted = FALSE - dangerous_existence = FALSE - var/static/list/random_golem_types - -/datum/species/golem/random/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(!random_golem_types) - random_golem_types = subtypesof(/datum/species/golem) - type - for(var/V in random_golem_types) - var/datum/species/golem/G = V - if(!initial(G.random_eligible)) - random_golem_types -= G - var/datum/species/golem/golem_type = pick(random_golem_types) - var/mob/living/carbon/human/H = C - H.set_species(golem_type) - to_chat(H, "[initial(golem_type.info_text)]") - -/datum/species/golem/adamantine - name = "Adamantine Golem" - id = "adamantine golem" - meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/golem/adamantine - mutant_organs = list(/obj/item/organ/adamantine_resonator, /obj/item/organ/vocal_cords/adamantine) - fixed_mut_color = "4ed" - info_text = "As an Adamantine Golem, you possess special vocal cords allowing you to \"resonate\" messages to all golems. Your unique mineral makeup makes you immune to most types of magic." - prefix = "Adamantine" - special_names = null - -/datum/species/golem/adamantine/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - ADD_TRAIT(C, TRAIT_ANTIMAGIC, SPECIES_TRAIT) - -/datum/species/golem/adamantine/on_species_loss(mob/living/carbon/C) - REMOVE_TRAIT(C, TRAIT_ANTIMAGIC, SPECIES_TRAIT) - ..() - -//The suicide bombers of golemkind -/datum/species/golem/plasma - name = "Plasma Golem" - id = "plasma golem" - fixed_mut_color = "a3d" - meat = /obj/item/stack/ore/plasma - //Can burn and takes damage from heat - inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) //no RESISTHEAT, NOFIRE - info_text = "As a Plasma Golem, you burn easily. Be careful, if you get hot enough while burning, you'll blow up!" - heatmod = 0 //fine until they blow up - prefix = "Plasma" - special_names = list("Flood","Fire","Bar","Man") - var/boom_warning = FALSE - var/datum/action/innate/ignite/ignite - -/datum/species/golem/plasma/spec_life(mob/living/carbon/human/H) - if(H.bodytemperature > 750) - if(!boom_warning && H.on_fire) - to_chat(H, "You feel like you could blow up at any moment!") - boom_warning = TRUE - else - if(boom_warning) - to_chat(H, "You feel more stable.") - boom_warning = FALSE - - if(H.bodytemperature > 850 && H.on_fire && prob(25)) - explosion(get_turf(H),1,2,4,flame_range = 5) - if(H) - H.gib() - if(H.fire_stacks < 2) //flammable - H.adjust_fire_stacks(1) - ..() - -/datum/species/golem/plasma/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(ishuman(C)) - ignite = new - ignite.Grant(C) - -/datum/species/golem/plasma/on_species_loss(mob/living/carbon/C) - if(ignite) - ignite.Remove(C) - ..() - -/datum/action/innate/ignite - name = "Ignite" - desc = "Set yourself aflame, bringing yourself closer to exploding!" - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "sacredflame" - -/datum/action/innate/ignite/Activate() - if(ishuman(owner)) - var/mob/living/carbon/human/H = owner - if(H.fire_stacks) - to_chat(owner, "You ignite yourself!") - else - to_chat(owner, "You try to ignite yourself, but fail!") - H.IgniteMob() //firestacks are already there passively - -//Harder to hurt -/datum/species/golem/diamond - name = "Diamond Golem" - id = "diamond golem" - fixed_mut_color = "0ff" - armor = 70 //up from 55 - meat = /obj/item/stack/ore/diamond - info_text = "As a Diamond Golem, you are more resistant than the average golem." - prefix = "Diamond" - special_names = list("Back") - -//Faster but softer and less armoured -/datum/species/golem/gold - name = "Gold Golem" - id = "gold golem" - fixed_mut_color = "cc0" - speedmod = 1 - armor = 25 //down from 55 - meat = /obj/item/stack/ore/gold - info_text = "As a Gold Golem, you are faster but less resistant than the average golem." - prefix = "Golden" - special_names = list("Boy") - -//Heavier, thus higher chance of stunning when punching -/datum/species/golem/silver - name = "Silver Golem" - id = "silver golem" - fixed_mut_color = "ddd" - punchstunthreshold = 9 //60% chance, from 40% - meat = /obj/item/stack/ore/silver - info_text = "As a Silver Golem, your attacks have a higher chance of stunning. Being made of silver, your body is immune to most types of magic." - prefix = "Silver" - special_names = list("Surfer", "Chariot", "Lining") - -/datum/species/golem/silver/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - ADD_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) - -/datum/species/golem/silver/on_species_loss(mob/living/carbon/C) - REMOVE_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) - ..() - -//Harder to stun, deals more damage, but it's even slower -/datum/species/golem/plasteel - name = "Plasteel Golem" - id = "plasteel golem" - fixed_mut_color = "bbb" - stunmod = 0.4 - punchdamagelow = 12 - punchdamagehigh = 21 - punchstunthreshold = 18 //still 40% stun chance - speedmod = 4 //pretty fucking slow - meat = /obj/item/stack/ore/iron - info_text = "As a Plasteel Golem, you are slower, but harder to stun, and hit very hard when punching." - attack_verb = "smash" - attack_sound = 'sound/effects/meteorimpact.ogg' //hits pretty hard - prefix = "Plasteel" - special_names = null - -//Immune to ash storms -/datum/species/golem/titanium - name = "Titanium Golem" - id = "titanium golem" - fixed_mut_color = "fff" - meat = /obj/item/stack/ore/titanium - info_text = "As a Titanium Golem, you are immune to ash storms, and slightly more resistant to burn damage." - burnmod = 0.9 - prefix = "Titanium" - special_names = list("Dioxide") - -/datum/species/golem/titanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.weather_immunities |= "ash" - -/datum/species/golem/titanium/on_species_loss(mob/living/carbon/C) - . = ..() - C.weather_immunities -= "ash" - -//Immune to ash storms and lava -/datum/species/golem/plastitanium - name = "Plastitanium Golem" - id = "plastitanium golem" - fixed_mut_color = "888" - meat = /obj/item/stack/ore/titanium - info_text = "As a Plastitanium Golem, you are immune to both ash storms and lava, and slightly more resistant to burn damage." - burnmod = 0.8 - prefix = "Plastitanium" - special_names = null - -/datum/species/golem/plastitanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.weather_immunities |= "lava" - C.weather_immunities |= "ash" - -/datum/species/golem/plastitanium/on_species_loss(mob/living/carbon/C) - . = ..() - C.weather_immunities -= "ash" - C.weather_immunities -= "lava" - -//Fast and regenerates... but can only speak like an abductor -/datum/species/golem/alloy - name = "Alien Alloy Golem" - id = "alloy golem" - fixed_mut_color = "333" - meat = /obj/item/stack/sheet/mineral/abductor - mutanttongue = /obj/item/organ/tongue/abductor - speedmod = 1 //faster - info_text = "As an Alloy Golem, you are made of advanced alien materials: you are faster and regenerate over time. You are, however, only able to be heard by other alloy golems." - prefix = "Alien" - special_names = list("Outsider", "Technology", "Watcher", "Stranger") //ominous and unknown - -//Regenerates because self-repairing super-advanced alien tech -/datum/species/golem/alloy/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD) - return - H.heal_overall_damage(2,2) - H.adjustToxLoss(-2) - H.adjustOxyLoss(-2) - -//Since this will usually be created from a collaboration between podpeople and free golems, wood golems are a mix between the two races -/datum/species/golem/wood - name = "Wood Golem" - id = "wood golem" - fixed_mut_color = "9E704B" - meat = /obj/item/stack/sheet/mineral/wood - //Can burn and take damage from heat - inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) - armor = 30 - burnmod = 1.25 - heatmod = 1.5 - info_text = "As a Wooden Golem, you have plant-like traits: you take damage from extreme temperatures, can be set on fire, and have lower armor than a normal golem. You regenerate when in the light and wither in the darkness." - prefix = "Wooden" - special_names = list("Bark", "Willow", "Catalpa", "Woody", "Oak", "Sap", "Twig", "Branch", "Maple", "Birch", "Elm", "Basswood", "Cottonwood", "Larch", "Aspen", "Ash", "Beech", "Buckeye", "Cedar", "Chestnut", "Cypress", "Fir", "Hawthorn", "Hazel", "Hickory", "Ironwood", "Juniper", "Leaf", "Mangrove", "Palm", "Pawpaw", "Pine", "Poplar", "Redwood", "Redbud", "Sassafras", "Spruce", "Sumac", "Trunk", "Walnut", "Yew") - human_surname_chance = 0 - special_name_chance = 100 - -/datum/species/golem/wood/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.faction |= "plants" - C.faction |= "vines" - -/datum/species/golem/wood/on_species_loss(mob/living/carbon/C) - . = ..() - C.faction -= "plants" - C.faction -= "vines" - -/datum/species/golem/wood/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD) - return - var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing - if(isturf(H.loc)) //else, there's considered to be no light - var/turf/T = H.loc - light_amount = min(1,T.get_lumcount()) - 0.5 - H.nutrition += light_amount * 10 - if(H.nutrition > NUTRITION_LEVEL_FULL) - H.nutrition = NUTRITION_LEVEL_FULL - if(light_amount > 0.2) //if there's enough light, heal - H.heal_overall_damage(1,1) - H.adjustToxLoss(-1) - H.adjustOxyLoss(-1) - - if(H.nutrition < NUTRITION_LEVEL_STARVING + 50) - H.take_overall_damage(2,0) - -/datum/species/golem/wood/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "plantbgone") - H.adjustToxLoss(3) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - return 1 - -//Radioactive -/datum/species/golem/uranium - name = "Uranium Golem" - id = "uranium golem" - fixed_mut_color = "7f0" - meat = /obj/item/stack/ore/uranium - info_text = "As an Uranium Golem, you emit radiation pulses every once in a while. It won't harm fellow golems, but organic lifeforms will be affected." - - var/last_event = 0 - var/active = null - prefix = "Uranium" - special_names = list("Oxide", "Rod", "Meltdown") - -/datum/species/golem/uranium/spec_life(mob/living/carbon/human/H) - if(!active) - if(world.time > last_event+30) - active = 1 - radiation_pulse(H, 50) - last_event = world.time - active = null - ..() - -//Immune to physical bullets and resistant to brute, but very vulnerable to burn damage. Dusts on death. -/datum/species/golem/sand - name = "Sand Golem" - id = "sand golem" - fixed_mut_color = "ffdc8f" - meat = /obj/item/stack/ore/glass //this is sand - armor = 0 - burnmod = 3 //melts easily - brutemod = 0.25 - info_text = "As a Sand Golem, you are immune to physical bullets and take very little brute damage, but are extremely vulnerable to burn damage and energy weapons. You will also turn to sand when dying, preventing any form of recovery." - attack_sound = 'sound/effects/shovel_dig.ogg' - prefix = "Sand" - special_names = list("Castle", "Bag", "Dune", "Worm", "Storm") - -/datum/species/golem/sand/spec_death(gibbed, mob/living/carbon/human/H) - H.visible_message("[H] turns into a pile of sand!") - for(var/obj/item/W in H) - H.dropItemToGround(W) - for(var/i=1, i <= rand(3,5), i++) - new /obj/item/stack/ore/glass(get_turf(H)) - qdel(H) - -/datum/species/golem/sand/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) - if(!(P.original == H && P.firer == H)) - if(P.flag == "bullet" || P.flag == "bomb") - playsound(H, 'sound/effects/shovel_dig.ogg', 70, 1) - H.visible_message("The [P.name] sinks harmlessly in [H]'s sandy body!", \ - "The [P.name] sinks harmlessly in [H]'s sandy body!") - return 2 - return 0 - -//Reflects lasers and resistant to burn damage, but very vulnerable to brute damage. Shatters on death. -/datum/species/golem/glass - name = "Glass Golem" - id = "glass golem" - fixed_mut_color = "5a96b4aa" //transparent body - meat = /obj/item/shard - armor = 0 - brutemod = 3 //very fragile - burnmod = 0.25 - info_text = "As a Glass Golem, you reflect lasers and energy weapons, and are very resistant to burn damage. However, you are extremely vulnerable to brute damage. On death, you'll shatter beyond any hope of recovery." - attack_sound = 'sound/effects/glassbr2.ogg' - prefix = "Glass" - special_names = list("Lens", "Prism", "Fiber", "Bead") - -/datum/species/golem/glass/spec_death(gibbed, mob/living/carbon/human/H) - playsound(H, "shatter", 70, 1) - H.visible_message("[H] shatters!") - for(var/obj/item/W in H) - H.dropItemToGround(W) - for(var/i=1, i <= rand(3,5), i++) - new /obj/item/shard(get_turf(H)) - qdel(H) - -/datum/species/golem/glass/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) - if(!(P.original == H && P.firer == H)) //self-shots don't reflect - if(P.flag == "laser" || P.flag == "energy") - H.visible_message("The [P.name] gets reflected by [H]'s glass skin!", \ - "The [P.name] gets reflected by [H]'s glass skin!") - if(P.starting) - var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/turf/target = get_turf(P.starting) - // redirect the projectile - P.preparePixelProjectile(locate(CLAMP(target.x + new_x, 1, world.maxx), CLAMP(target.y + new_y, 1, world.maxy), H.z), H) - return -1 - return 0 - -//Teleports when hit or when it wants to -/datum/species/golem/bluespace - name = "Bluespace Golem" - id = "bluespace golem" - fixed_mut_color = "33f" - meat = /obj/item/stack/ore/bluespace_crystal - info_text = "As a Bluespace Golem, you are spatially unstable: You will teleport when hit, and you can teleport manually at a long distance." - attack_verb = "bluespace punch" - attack_sound = 'sound/effects/phasein.ogg' - prefix = "Bluespace" - special_names = list("Crystal", "Polycrystal") - - var/datum/action/innate/unstable_teleport/unstable_teleport - var/teleport_cooldown = 100 - var/last_teleport = 0 - -/datum/species/golem/bluespace/proc/reactive_teleport(mob/living/carbon/human/H) - H.visible_message("[H] teleports!", "You destabilize and teleport!") - new /obj/effect/particle_effect/sparks(get_turf(H)) - playsound(get_turf(H), "sparks", 50, 1) - do_teleport(H, get_turf(H), 6, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) - last_teleport = world.time - -/datum/species/golem/bluespace/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) - ..() - var/obj/item/I - if(istype(AM, /obj/item)) - I = AM - if(I.thrownby == H) //No throwing stuff at yourself to trigger the teleport - return 0 - else - reactive_teleport(H) - -/datum/species/golem/bluespace/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style) - ..() - if(world.time > last_teleport + teleport_cooldown && M != H && M.a_intent != INTENT_HELP) - reactive_teleport(H) - -/datum/species/golem/bluespace/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) - ..() - if(world.time > last_teleport + teleport_cooldown && user != H) - reactive_teleport(H) - -/datum/species/golem/bluespace/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) - ..() - if(world.time > last_teleport + teleport_cooldown) - reactive_teleport(H) - -/datum/species/golem/bluespace/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(ishuman(C)) - unstable_teleport = new - unstable_teleport.Grant(C) - last_teleport = world.time - -/datum/species/golem/bluespace/on_species_loss(mob/living/carbon/C) - if(unstable_teleport) - unstable_teleport.Remove(C) - ..() - -/datum/action/innate/unstable_teleport - name = "Unstable Teleport" - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "jaunt" - icon_icon = 'icons/mob/actions/actions_spells.dmi' - var/cooldown = 150 - var/last_teleport = 0 - -/datum/action/innate/unstable_teleport/IsAvailable() - if(..()) - if(world.time > last_teleport + cooldown) - return 1 - return 0 - -/datum/action/innate/unstable_teleport/Activate() - var/mob/living/carbon/human/H = owner - H.visible_message("[H] starts vibrating!", "You start charging your bluespace core...") - playsound(get_turf(H), 'sound/weapons/flash.ogg', 25, 1) - addtimer(CALLBACK(src, .proc/teleport, H), 15) - -/datum/action/innate/unstable_teleport/proc/teleport(mob/living/carbon/human/H) - H.visible_message("[H] disappears in a shower of sparks!", "You teleport!") - var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread - spark_system.set_up(10, 0, src) - spark_system.attach(H) - spark_system.start() - do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) - last_teleport = world.time - UpdateButtonIcon() //action icon looks unavailable - sleep(cooldown + 5) - UpdateButtonIcon() //action icon looks available again - - -//honk -/datum/species/golem/bananium - name = "Bananium Golem" - id = "bananium golem" - fixed_mut_color = "ff0" - say_mod = "honks" - punchdamagelow = 0 - punchdamagehigh = 1 - punchstunthreshold = 2 //Harmless and can't stun - meat = /obj/item/stack/ore/bananium - info_text = "As a Bananium Golem, you are made for pranking. Your body emits natural honks, and you can barely even hurt people when punching them. Your skin also bleeds banana peels when damaged." - attack_verb = "honk" - attack_sound = 'sound/items/airhorn2.ogg' - prefix = "Bananium" - special_names = null - - var/last_honk = 0 - var/honkooldown = 0 - var/last_banana = 0 - var/banana_cooldown = 100 - var/active = null - -/datum/species/golem/bananium/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - last_banana = world.time - last_honk = world.time - RegisterSignal(C, COMSIG_MOB_SAY, .proc/handle_speech) - -/datum/species/golem/bananium/on_species_loss(mob/living/carbon/C) - . = ..() - UnregisterSignal(C, COMSIG_MOB_SAY) - -/datum/species/golem/bananium/random_name(gender,unique,lastname) - var/clown_name = pick(GLOB.clown_names) - var/golem_name = "[uppertext(clown_name)]" - return golem_name - -/datum/species/golem/bananium/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style) - ..() - if(world.time > last_banana + banana_cooldown && M != H && M.a_intent != INTENT_HELP) - new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) - ..() - if(world.time > last_banana + banana_cooldown && user != H) - new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) - ..() - if(world.time > last_banana + banana_cooldown) - new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) - ..() - var/obj/item/I - if(istype(AM, /obj/item)) - I = AM - if(I.thrownby == H) //No throwing stuff at yourself to make bananas - return 0 - else - new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/spec_life(mob/living/carbon/human/H) - if(!active) - if(world.time > last_honk + honkooldown) - active = 1 - playsound(get_turf(H), 'sound/items/bikehorn.ogg', 50, 1) - last_honk = world.time - honkooldown = rand(20, 80) - active = null - ..() - -/datum/species/golem/bananium/spec_death(gibbed, mob/living/carbon/human/H) - playsound(get_turf(H), 'sound/misc/sadtrombone.ogg', 70, 0) - -/datum/species/golem/bananium/proc/handle_speech(datum/source, list/speech_args) - speech_args[SPEECH_SPANS] |= SPAN_CLOWN - -/datum/species/golem/runic - name = "Runic Golem" - id = "runic golem" - limbs_id = "cultgolem" - sexes = FALSE - info_text = "As a Runic Golem, you possess eldritch powers granted by the Elder Goddess Nar'Sie." - species_traits = list(NOBLOOD,NO_UNDERWEAR,NOEYES) //no mutcolors - prefix = "Runic" - special_names = null - - var/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift/golem/phase_shift - var/obj/effect/proc_holder/spell/targeted/abyssal_gaze/abyssal_gaze - var/obj/effect/proc_holder/spell/targeted/dominate/dominate - -/datum/species/golem/runic/random_name(gender,unique,lastname) - var/edgy_first_name = pick("Razor","Blood","Dark","Evil","Cold","Pale","Black","Silent","Chaos","Deadly","Coldsteel") - var/edgy_last_name = pick("Edge","Night","Death","Razor","Blade","Steel","Calamity","Twilight","Shadow","Nightmare") //dammit Razor Razor - var/golem_name = "[edgy_first_name] [edgy_last_name]" - return golem_name - -/datum/species/golem/runic/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.faction |= "cult" - phase_shift = new - phase_shift.charge_counter = 0 - C.AddSpell(phase_shift) - abyssal_gaze = new - abyssal_gaze.charge_counter = 0 - C.AddSpell(abyssal_gaze) - dominate = new - dominate.charge_counter = 0 - C.AddSpell(dominate) - -/datum/species/golem/runic/on_species_loss(mob/living/carbon/C) - . = ..() - C.faction -= "cult" - if(phase_shift) - C.RemoveSpell(phase_shift) - if(abyssal_gaze) - C.RemoveSpell(abyssal_gaze) - if(dominate) - C.RemoveSpell(dominate) - -/datum/species/golem/runic/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "holywater") - H.adjustFireLoss(4) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - - if(chem.id == "unholywater") - H.adjustBruteLoss(-4) - H.adjustFireLoss(-4) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - - -/datum/species/golem/clockwork - name = "Clockwork Golem" - id = "clockwork golem" - say_mod = "clicks" - limbs_id = "clockgolem" - info_text = "As a Clockwork Golem, you are faster than other types of golems. On death, you will break down into scrap." - species_traits = list(NOBLOOD,NO_UNDERWEAR,NOEYES) - inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID) - armor = 20 //Reinforced, but much less so to allow for fast movement - attack_verb = "smash" - attack_sound = 'sound/magic/clockwork/anima_fragment_attack.ogg' - sexes = FALSE - speedmod = 0 - damage_overlay_type = "synth" - prefix = "Clockwork" - special_names = list("Remnant", "Relic", "Scrap", "Vestige") //RIP Ratvar - var/has_corpse - -/datum/species/golem/clockwork/on_species_gain(mob/living/carbon/human/H) - . = ..() - H.faction |= "ratvar" - RegisterSignal(H, COMSIG_MOB_SAY, .proc/handle_speech) - -/datum/species/golem/clockwork/on_species_loss(mob/living/carbon/human/H) - if(!is_servant_of_ratvar(H)) - H.faction -= "ratvar" - UnregisterSignal(H, COMSIG_MOB_SAY) - . = ..() - -/datum/species/golem/clockwork/proc/handle_speech(datum/source, list/speech_args) - speech_args[SPEECH_SPANS] |= SPAN_ROBOT //beep - -/datum/species/golem/clockwork/spec_death(gibbed, mob/living/carbon/human/H) - gibbed = !has_corpse ? FALSE : gibbed - . = ..() - if(!has_corpse) - var/turf/T = get_turf(H) - H.visible_message("[H]'s exoskeleton shatters, collapsing into a heap of scrap!") - playsound(H, 'sound/magic/clockwork/anima_fragment_death.ogg', 62, TRUE) - for(var/i in 1 to rand(3, 5)) - new/obj/item/clockwork/alloy_shards/small(T) - new/obj/item/clockwork/alloy_shards/clockgolem_remains(T) - qdel(H) - -/datum/species/golem/clockwork/no_scrap //These golems are created through the herald's beacon and leave normal corpses on death. - id = "clockwork golem servant" - armor = 15 //Balance reasons make this armor weak - no_equip = list() - nojumpsuit = FALSE - has_corpse = TRUE - blacklisted = TRUE - dangerous_existence = TRUE - random_eligible = FALSE - info_text = "As a Clockwork Golem Servant, you are faster than other types of golems." //warcult golems leave a corpse - -/datum/species/golem/cloth - name = "Cloth Golem" - id = "cloth golem" - limbs_id = "clothgolem" - sexes = FALSE - info_text = "As a Cloth Golem, you are able to reform yourself after death, provided your remains aren't burned or destroyed. You are, of course, very flammable. \ - Being made of cloth, your body is magic resistant and faster than that of other golems, but weaker and less resilient." - species_traits = list(NOBLOOD,NO_UNDERWEAR) //no mutcolors, and can burn - inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_NOBREATH,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOGUNS) - inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID) - armor = 15 //feels no pain, but not too resistant - burnmod = 2 // don't get burned - speedmod = 1 // not as heavy as stone - punchdamagelow = 4 - punchstunthreshold = 7 - punchdamagehigh = 8 // not as heavy as stone - prefix = "Cloth" - special_names = null - -/datum/species/golem/cloth/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - ADD_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) - -/datum/species/golem/cloth/on_species_loss(mob/living/carbon/C) - REMOVE_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) - ..() - -/datum/species/golem/cloth/check_roundstart_eligible() - if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) - return TRUE - return ..() - -/datum/species/golem/cloth/random_name(gender,unique,lastname) - var/pharaoh_name = pick("Neferkare", "Hudjefa", "Khufu", "Mentuhotep", "Ahmose", "Amenhotep", "Thutmose", "Hatshepsut", "Tutankhamun", "Ramses", "Seti", \ - "Merenptah", "Djer", "Semerkhet", "Nynetjer", "Khafre", "Pepi", "Intef", "Ay") //yes, Ay was an actual pharaoh - var/golem_name = "[pharaoh_name] \Roman[rand(1,99)]" - return golem_name - -/datum/species/golem/cloth/spec_life(mob/living/carbon/human/H) - if(H.fire_stacks < 1) - H.adjust_fire_stacks(1) //always prone to burning - ..() - -/datum/species/golem/cloth/spec_death(gibbed, mob/living/carbon/human/H) - if(gibbed) - return - if(H.on_fire) - H.visible_message("[H] burns into ash!") - H.dust(just_ash = TRUE) - return - - H.visible_message("[H] falls apart into a pile of bandages!") - new /obj/structure/cloth_pile(get_turf(H), H) - ..() - -/obj/structure/cloth_pile - name = "pile of bandages" - desc = "It emits a strange aura, as if there was still life within it..." - max_integrity = 50 - armor = list("melee" = 90, "bullet" = 90, "laser" = 25, "energy" = 80, "bomb" = 50, "bio" = 100, "fire" = -50, "acid" = -50) - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "pile_bandages" - resistance_flags = FLAMMABLE - - var/revive_time = 900 - var/mob/living/carbon/human/cloth_golem - -/obj/structure/cloth_pile/Initialize(mapload, mob/living/carbon/human/H) - . = ..() - if(!QDELETED(H) && is_species(H, /datum/species/golem/cloth)) - H.unequip_everything() - H.forceMove(src) - cloth_golem = H - to_chat(cloth_golem, "You start gathering your life energy, preparing to rise again...") - addtimer(CALLBACK(src, .proc/revive), revive_time) - else - return INITIALIZE_HINT_QDEL - -/obj/structure/cloth_pile/Destroy() - if(cloth_golem) - QDEL_NULL(cloth_golem) - return ..() - -/obj/structure/cloth_pile/burn() - visible_message("[src] burns into ash!") - new /obj/effect/decal/cleanable/ash(get_turf(src)) - ..() - -/obj/structure/cloth_pile/proc/revive() - if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime - return - if(cloth_golem.suiciding || HAS_TRAIT(cloth_golem, TRAIT_NOCLONE)) - QDEL_NULL(cloth_golem) - return - - invisibility = INVISIBILITY_MAXIMUM //disappear before the animation - new /obj/effect/temp_visual/mummy_animation(get_turf(src)) - if(cloth_golem.revive(full_heal = TRUE, admin_revive = TRUE)) - cloth_golem.grab_ghost() //won't pull if it's a suicide - sleep(20) - cloth_golem.forceMove(get_turf(src)) - cloth_golem.visible_message("[src] rises and reforms into [cloth_golem]!","You reform into yourself!") - cloth_golem = null - qdel(src) - -/obj/structure/cloth_pile/attackby(obj/item/P, mob/living/carbon/human/user, params) - . = ..() - - if(resistance_flags & ON_FIRE) - return - - if(P.is_hot()) - visible_message("[src] bursts into flames!") - fire_act() - -/datum/species/golem/plastic - name = "Plastic Golem" - id = "plastic golem" - prefix = "Plastic" - special_names = null - fixed_mut_color = "fff" - info_text = "As a Plastic Golem, you are capable of ventcrawling and passing through plastic flaps as long as you are naked." - -/datum/species/golem/plastic/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.ventcrawler = VENTCRAWLER_NUDE - -/datum/species/golem/plastic/on_species_loss(mob/living/carbon/C) - . = ..() - C.ventcrawler = initial(C.ventcrawler) - -/datum/species/golem/bronze - name = "Bronze Golem" - id = "bronze golem" - prefix = "Bronze" - special_names = list("Bell") - fixed_mut_color = "cd7f32" - info_text = "As a Bronze Golem, you are very resistant to loud noises, and make loud noises if something hard hits you, however this ability does hurt your hearing." - special_step_sounds = list('sound/machines/clockcult/integration_cog_install.ogg', 'sound/magic/clockwork/fellowship_armory.ogg' ) - attack_verb = "bonk" - mutantears = /obj/item/organ/ears/bronze - var/last_gong_time = 0 - var/gong_cooldown = 150 - -/datum/species/golem/bronze/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) - if(!(world.time > last_gong_time + gong_cooldown)) - return ..() - if(P.flag == "bullet" || P.flag == "bomb") - gong(H) - return ..() - -/datum/species/golem/bronze/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) - ..() - if(world.time > last_gong_time + gong_cooldown) - gong(H) - -/datum/species/golem/bronze/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style) - ..() - if(world.time > last_gong_time + gong_cooldown && M.a_intent != INTENT_HELP) - gong(H) - -/datum/species/golem/bronze/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) - ..() - if(world.time > last_gong_time + gong_cooldown) - gong(H) - -/datum/species/golem/bronze/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) - ..() - if(world.time > last_gong_time + gong_cooldown) - gong(H) - -/datum/species/golem/bronze/proc/gong(mob/living/carbon/human/H) - last_gong_time = world.time - for(var/mob/living/M in get_hearers_in_view(7,H)) - if(M.stat == DEAD) //F - return - if(M == H) - H.show_message("You cringe with pain as your body rings around you!", 2) - H.playsound_local(H, 'sound/effects/gong.ogg', 100, TRUE) - H.soundbang_act(2, 0, 100, 1) - H.jitteriness += 7 - var/distance = max(0,get_dist(get_turf(H),get_turf(M))) - switch(distance) - if(0 to 1) - M.show_message("GONG!", 2) - M.playsound_local(H, 'sound/effects/gong.ogg', 100, TRUE) - M.soundbang_act(1, 0, 30, 3) - M.confused += 10 - M.jitteriness += 4 - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "gonged", /datum/mood_event/loud_gong) - if(2 to 3) - M.show_message("GONG!", 2) - M.playsound_local(H, 'sound/effects/gong.ogg', 75, TRUE) - M.soundbang_act(1, 0, 15, 2) - M.jitteriness += 3 - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "gonged", /datum/mood_event/loud_gong) - else - M.show_message("GONG!", 2) - M.playsound_local(H, 'sound/effects/gong.ogg', 50, TRUE) - - -/datum/species/golem/cardboard //Faster but weaker, can also make new shells on its own - name = "Cardboard Golem" - id = "cardboard golem" - prefix = "Cardboard" - special_names = list("Box") - info_text = "As a Cardboard Golem, you aren't very strong, but you are a bit quicker and can easily create more brethren by using cardboard on yourself." - species_traits = list(NOBLOOD,NO_UNDERWEAR,NOGENITALS,NOAROUSAL,MUTCOLORS) - inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) - fixed_mut_color = "ffffff" - limbs_id = "c_golem" //special sprites - attack_verb = "bash" - armor = 25 - burnmod = 1.25 - heatmod = 2 - speedmod = 1.5 - punchdamagelow = 4 - punchstunthreshold = 7 - punchdamagehigh = 8 - var/last_creation = 0 - var/brother_creation_cooldown = 300 - -/datum/species/golem/cardboard/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) - . = ..() - if(user != H) - return FALSE //forced reproduction is r/non-con - if(istype(I, /obj/item/stack/sheet/cardboard)) - var/obj/item/stack/sheet/cardboard/C = I - if(last_creation + brother_creation_cooldown > world.time) //no cheesing dork - return - if(C.amount < 10) - to_chat(H, "You do not have enough cardboard!") - return FALSE - to_chat(H, "You attempt to create a new cardboard brother.") - if(do_after(user, 30, target = user)) - if(last_creation + brother_creation_cooldown > world.time) //no cheesing dork - return - if(!C.use(10)) - to_chat(H, "You do not have enough cardboard!") - return FALSE - to_chat(H, "You create a new cardboard golem shell.") - create_brother(H.loc) - -/datum/species/golem/cardboard/proc/create_brother(var/location) - new /obj/effect/mob_spawn/human/golem/servant(location, /datum/species/golem/cardboard, owner) - last_creation = world.time - -/datum/species/golem/leather - name = "Leather Golem" - id = "leather golem" - special_names = list("Face", "Man", "Belt") //Ah dude 4 strength 4 stam leather belt AHHH - inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER, TRAIT_STRONG_GRABBER) - prefix = "Leather" - fixed_mut_color = "624a2e" - info_text = "As a Leather Golem, you are flammable, but you can grab things with incredible ease, allowing all your grabs to start at a strong level." - attack_verb = "whipp" - grab_sound = 'sound/weapons/whipgrab.ogg' - attack_sound = 'sound/weapons/whip.ogg' - -/datum/species/golem/bone - name = "Bone Golem" - id = "bone golem" - say_mod = "rattles" - prefix = "Bone" - limbs_id = "b_golem" - special_names = list("Head", "Broth", "Fracture", "Rattler", "Appetit") - liked_food = GROSS | MEAT | RAW - toxic_food = null - inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID) - mutanttongue = /obj/item/organ/tongue/bone - sexes = FALSE - fixed_mut_color = "ffffff" - attack_verb = "rattl" - species_traits = list(NOBLOOD,NO_UNDERWEAR,NOGENITALS,NOAROUSAL,MUTCOLORS) - inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOFIRE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER,TRAIT_FAKEDEATH,TRAIT_CALCIUM_HEALER) - info_text = "As a Bone Golem, You have a powerful spell that lets you chill your enemies with fear, and milk heals you! Just make sure to watch our for bone-hurting juice." - var/datum/action/innate/bonechill/bonechill - -/datum/species/golem/bone/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(ishuman(C)) - bonechill = new - bonechill.Grant(C) - -/datum/species/golem/bone/on_species_loss(mob/living/carbon/C) - if(bonechill) - bonechill.Remove(C) - ..() - -/datum/action/innate/bonechill - name = "Bone Chill" - desc = "Rattle your bones and strike fear into your enemies!" - check_flags = AB_CHECK_CONSCIOUS - icon_icon = 'icons/mob/actions/actions_spells.dmi' - button_icon_state = "bonechill" - var/cooldown = 600 - var/last_use - var/snas_chance = 3 - -/datum/action/innate/bonechill/Activate() - if(world.time < last_use + cooldown) - to_chat("You aren't ready yet to rattle your bones again") - return - owner.visible_message("[owner] rattles [owner.p_their()] bones harrowingly.", "You rattle your bones") - last_use = world.time - if(prob(snas_chance)) - playsound(get_turf(owner),'sound/magic/RATTLEMEBONES2.ogg', 100) - if(ishuman(owner)) - var/mob/living/carbon/human/H = owner - var/mutable_appearance/badtime = mutable_appearance('icons/mob/human_parts.dmi', "b_golem_eyes", -FIRE_LAYER-0.5) - badtime.appearance_flags = RESET_COLOR - H.overlays_standing[FIRE_LAYER+0.5] = badtime - H.apply_overlay(FIRE_LAYER+0.5) - addtimer(CALLBACK(H, /mob/living/carbon/.proc/remove_overlay, FIRE_LAYER+0.5), 25) - else - playsound(get_turf(owner),'sound/magic/RATTLEMEBONES.ogg', 100) - for(var/mob/living/L in orange(7, get_turf(owner))) - if((MOB_UNDEAD in L.mob_biotypes) || isgolem(L) || HAS_TRAIT(L, TRAIT_RESISTCOLD)) - return //Do not affect our brothers - - to_chat(L, "A spine-chilling sound chills you to the bone!") - L.apply_status_effect(/datum/status_effect/bonechill) - SEND_SIGNAL(L, COMSIG_ADD_MOOD_EVENT, "spooked", /datum/mood_event/spooked) +/datum/species/golem + // Animated beings of stone. They have increased defenses, and do not need to breathe. They're also slow as fuuuck. + name = "Golem" + id = "iron golem" + species_traits = list(NOBLOOD,MUTCOLORS,NO_UNDERWEAR,NOGENITALS,NOAROUSAL) + inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOFIRE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) + inherent_biotypes = list(MOB_INORGANIC, MOB_HUMANOID) + mutant_organs = list(/obj/item/organ/adamantine_resonator) + speedmod = 2 + armor = 55 + siemens_coeff = 0 + punchdamagelow = 5 + punchdamagehigh = 14 + punchstunthreshold = 11 //about 40% chance to stun + no_equip = list(SLOT_WEAR_MASK, SLOT_WEAR_SUIT, SLOT_GLOVES, SLOT_SHOES, SLOT_W_UNIFORM, SLOT_S_STORE) + nojumpsuit = 1 + sexes = 1 + damage_overlay_type = "" + meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/golem + // To prevent golem subtypes from overwhelming the odds when random species + // changes, only the Random Golem type can be chosen + blacklisted = TRUE + dangerous_existence = TRUE + limbs_id = "golem" + fixed_mut_color = "aaa" + var/info_text = "As an Iron Golem, you don't have any special traits." + var/random_eligible = TRUE //If false, the golem subtype can't be made through golem mutation toxin + + var/prefix = "Iron" + var/list/special_names = list("Tarkus") + var/human_surname_chance = 3 + var/special_name_chance = 5 + var/owner //dobby is a free golem + +/datum/species/golem/random_name(gender,unique,lastname) + var/golem_surname = pick(GLOB.golem_names) + // 3% chance that our golem has a human surname, because + // cultural contamination + if(prob(human_surname_chance)) + golem_surname = pick(GLOB.last_names) + else if(special_names && special_names.len && prob(special_name_chance)) + golem_surname = pick(special_names) + + var/golem_name = "[prefix] [golem_surname]" + return golem_name + +/datum/species/golem/random + name = "Random Golem" + blacklisted = FALSE + dangerous_existence = FALSE + var/static/list/random_golem_types + +/datum/species/golem/random/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(!random_golem_types) + random_golem_types = subtypesof(/datum/species/golem) - type + for(var/V in random_golem_types) + var/datum/species/golem/G = V + if(!initial(G.random_eligible)) + random_golem_types -= G + var/datum/species/golem/golem_type = pick(random_golem_types) + var/mob/living/carbon/human/H = C + H.set_species(golem_type) + to_chat(H, "[initial(golem_type.info_text)]") + +/datum/species/golem/adamantine + name = "Adamantine Golem" + id = "adamantine golem" + meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/golem/adamantine + mutant_organs = list(/obj/item/organ/adamantine_resonator, /obj/item/organ/vocal_cords/adamantine) + fixed_mut_color = "4ed" + info_text = "As an Adamantine Golem, you possess special vocal cords allowing you to \"resonate\" messages to all golems. Your unique mineral makeup makes you immune to most types of magic." + prefix = "Adamantine" + special_names = null + +/datum/species/golem/adamantine/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + ADD_TRAIT(C, TRAIT_ANTIMAGIC, SPECIES_TRAIT) + +/datum/species/golem/adamantine/on_species_loss(mob/living/carbon/C) + REMOVE_TRAIT(C, TRAIT_ANTIMAGIC, SPECIES_TRAIT) + ..() + +//The suicide bombers of golemkind +/datum/species/golem/plasma + name = "Plasma Golem" + id = "plasma golem" + fixed_mut_color = "a3d" + meat = /obj/item/stack/ore/plasma + //Can burn and takes damage from heat + inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) //no RESISTHEAT, NOFIRE + info_text = "As a Plasma Golem, you burn easily. Be careful, if you get hot enough while burning, you'll blow up!" + heatmod = 0 //fine until they blow up + prefix = "Plasma" + special_names = list("Flood","Fire","Bar","Man") + var/boom_warning = FALSE + var/datum/action/innate/ignite/ignite + +/datum/species/golem/plasma/spec_life(mob/living/carbon/human/H) + if(H.bodytemperature > 750) + if(!boom_warning && H.on_fire) + to_chat(H, "You feel like you could blow up at any moment!") + boom_warning = TRUE + else + if(boom_warning) + to_chat(H, "You feel more stable.") + boom_warning = FALSE + + if(H.bodytemperature > 850 && H.on_fire && prob(25)) + explosion(get_turf(H),1,2,4,flame_range = 5) + if(H) + H.gib() + if(H.fire_stacks < 2) //flammable + H.adjust_fire_stacks(1) + ..() + +/datum/species/golem/plasma/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(ishuman(C)) + ignite = new + ignite.Grant(C) + +/datum/species/golem/plasma/on_species_loss(mob/living/carbon/C) + if(ignite) + ignite.Remove(C) + ..() + +/datum/action/innate/ignite + name = "Ignite" + desc = "Set yourself aflame, bringing yourself closer to exploding!" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "sacredflame" + +/datum/action/innate/ignite/Activate() + if(ishuman(owner)) + var/mob/living/carbon/human/H = owner + if(H.fire_stacks) + to_chat(owner, "You ignite yourself!") + else + to_chat(owner, "You try to ignite yourself, but fail!") + H.IgniteMob() //firestacks are already there passively + +//Harder to hurt +/datum/species/golem/diamond + name = "Diamond Golem" + id = "diamond golem" + fixed_mut_color = "0ff" + armor = 70 //up from 55 + meat = /obj/item/stack/ore/diamond + info_text = "As a Diamond Golem, you are more resistant than the average golem." + prefix = "Diamond" + special_names = list("Back") + +//Faster but softer and less armoured +/datum/species/golem/gold + name = "Gold Golem" + id = "gold golem" + fixed_mut_color = "cc0" + speedmod = 1 + armor = 25 //down from 55 + meat = /obj/item/stack/ore/gold + info_text = "As a Gold Golem, you are faster but less resistant than the average golem." + prefix = "Golden" + special_names = list("Boy") + +//Heavier, thus higher chance of stunning when punching +/datum/species/golem/silver + name = "Silver Golem" + id = "silver golem" + fixed_mut_color = "ddd" + punchstunthreshold = 9 //60% chance, from 40% + meat = /obj/item/stack/ore/silver + info_text = "As a Silver Golem, your attacks have a higher chance of stunning. Being made of silver, your body is immune to most types of magic." + prefix = "Silver" + special_names = list("Surfer", "Chariot", "Lining") + +/datum/species/golem/silver/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + ADD_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) + +/datum/species/golem/silver/on_species_loss(mob/living/carbon/C) + REMOVE_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) + ..() + +//Harder to stun, deals more damage, but it's even slower +/datum/species/golem/plasteel + name = "Plasteel Golem" + id = "plasteel golem" + fixed_mut_color = "bbb" + stunmod = 0.4 + punchdamagelow = 12 + punchdamagehigh = 21 + punchstunthreshold = 18 //still 40% stun chance + speedmod = 4 //pretty fucking slow + meat = /obj/item/stack/ore/iron + info_text = "As a Plasteel Golem, you are slower, but harder to stun, and hit very hard when punching." + attack_verb = "smash" + attack_sound = 'sound/effects/meteorimpact.ogg' //hits pretty hard + prefix = "Plasteel" + special_names = null + +//Immune to ash storms +/datum/species/golem/titanium + name = "Titanium Golem" + id = "titanium golem" + fixed_mut_color = "fff" + meat = /obj/item/stack/ore/titanium + info_text = "As a Titanium Golem, you are immune to ash storms, and slightly more resistant to burn damage." + burnmod = 0.9 + prefix = "Titanium" + special_names = list("Dioxide") + +/datum/species/golem/titanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.weather_immunities |= "ash" + +/datum/species/golem/titanium/on_species_loss(mob/living/carbon/C) + . = ..() + C.weather_immunities -= "ash" + +//Immune to ash storms and lava +/datum/species/golem/plastitanium + name = "Plastitanium Golem" + id = "plastitanium golem" + fixed_mut_color = "888" + meat = /obj/item/stack/ore/titanium + info_text = "As a Plastitanium Golem, you are immune to both ash storms and lava, and slightly more resistant to burn damage." + burnmod = 0.8 + prefix = "Plastitanium" + special_names = null + +/datum/species/golem/plastitanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.weather_immunities |= "lava" + C.weather_immunities |= "ash" + +/datum/species/golem/plastitanium/on_species_loss(mob/living/carbon/C) + . = ..() + C.weather_immunities -= "ash" + C.weather_immunities -= "lava" + +//Fast and regenerates... but can only speak like an abductor +/datum/species/golem/alloy + name = "Alien Alloy Golem" + id = "alloy golem" + fixed_mut_color = "333" + meat = /obj/item/stack/sheet/mineral/abductor + mutanttongue = /obj/item/organ/tongue/abductor + speedmod = 1 //faster + info_text = "As an Alloy Golem, you are made of advanced alien materials: you are faster and regenerate over time. You are, however, only able to be heard by other alloy golems." + prefix = "Alien" + special_names = list("Outsider", "Technology", "Watcher", "Stranger") //ominous and unknown + +//Regenerates because self-repairing super-advanced alien tech +/datum/species/golem/alloy/spec_life(mob/living/carbon/human/H) + if(H.stat == DEAD) + return + H.heal_overall_damage(2,2) + H.adjustToxLoss(-2) + H.adjustOxyLoss(-2) + +//Since this will usually be created from a collaboration between podpeople and free golems, wood golems are a mix between the two races +/datum/species/golem/wood + name = "Wood Golem" + id = "wood golem" + fixed_mut_color = "9E704B" + meat = /obj/item/stack/sheet/mineral/wood + //Can burn and take damage from heat + inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) + armor = 30 + burnmod = 1.25 + heatmod = 1.5 + info_text = "As a Wooden Golem, you have plant-like traits: you take damage from extreme temperatures, can be set on fire, and have lower armor than a normal golem. You regenerate when in the light and wither in the darkness." + prefix = "Wooden" + special_names = list("Bark", "Willow", "Catalpa", "Woody", "Oak", "Sap", "Twig", "Branch", "Maple", "Birch", "Elm", "Basswood", "Cottonwood", "Larch", "Aspen", "Ash", "Beech", "Buckeye", "Cedar", "Chestnut", "Cypress", "Fir", "Hawthorn", "Hazel", "Hickory", "Ironwood", "Juniper", "Leaf", "Mangrove", "Palm", "Pawpaw", "Pine", "Poplar", "Redwood", "Redbud", "Sassafras", "Spruce", "Sumac", "Trunk", "Walnut", "Yew") + human_surname_chance = 0 + special_name_chance = 100 + +/datum/species/golem/wood/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.faction |= "plants" + C.faction |= "vines" + +/datum/species/golem/wood/on_species_loss(mob/living/carbon/C) + . = ..() + C.faction -= "plants" + C.faction -= "vines" + +/datum/species/golem/wood/spec_life(mob/living/carbon/human/H) + if(H.stat == DEAD) + return + var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing + if(isturf(H.loc)) //else, there's considered to be no light + var/turf/T = H.loc + light_amount = min(1,T.get_lumcount()) - 0.5 + H.nutrition += light_amount * 10 + if(H.nutrition > NUTRITION_LEVEL_FULL) + H.nutrition = NUTRITION_LEVEL_FULL + if(light_amount > 0.2) //if there's enough light, heal + H.heal_overall_damage(1,1) + H.adjustToxLoss(-1) + H.adjustOxyLoss(-1) + + if(H.nutrition < NUTRITION_LEVEL_STARVING + 50) + H.take_overall_damage(2,0) + +/datum/species/golem/wood/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(chem.type == /datum/reagent/toxin/plantbgone) + H.adjustToxLoss(3) + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) + return 1 + +//Radioactive +/datum/species/golem/uranium + name = "Uranium Golem" + id = "uranium golem" + fixed_mut_color = "7f0" + meat = /obj/item/stack/ore/uranium + info_text = "As an Uranium Golem, you emit radiation pulses every once in a while. It won't harm fellow golems, but organic lifeforms will be affected." + + var/last_event = 0 + var/active = null + prefix = "Uranium" + special_names = list("Oxide", "Rod", "Meltdown") + +/datum/species/golem/uranium/spec_life(mob/living/carbon/human/H) + if(!active) + if(world.time > last_event+30) + active = 1 + radiation_pulse(H, 50) + last_event = world.time + active = null + ..() + +//Immune to physical bullets and resistant to brute, but very vulnerable to burn damage. Dusts on death. +/datum/species/golem/sand + name = "Sand Golem" + id = "sand golem" + fixed_mut_color = "ffdc8f" + meat = /obj/item/stack/ore/glass //this is sand + armor = 0 + burnmod = 3 //melts easily + brutemod = 0.25 + info_text = "As a Sand Golem, you are immune to physical bullets and take very little brute damage, but are extremely vulnerable to burn damage and energy weapons. You will also turn to sand when dying, preventing any form of recovery." + attack_sound = 'sound/effects/shovel_dig.ogg' + prefix = "Sand" + special_names = list("Castle", "Bag", "Dune", "Worm", "Storm") + +/datum/species/golem/sand/spec_death(gibbed, mob/living/carbon/human/H) + H.visible_message("[H] turns into a pile of sand!") + for(var/obj/item/W in H) + H.dropItemToGround(W) + for(var/i=1, i <= rand(3,5), i++) + new /obj/item/stack/ore/glass(get_turf(H)) + qdel(H) + +/datum/species/golem/sand/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) + if(!(P.original == H && P.firer == H)) + if(P.flag == "bullet" || P.flag == "bomb") + playsound(H, 'sound/effects/shovel_dig.ogg', 70, 1) + H.visible_message("The [P.name] sinks harmlessly in [H]'s sandy body!", \ + "The [P.name] sinks harmlessly in [H]'s sandy body!") + return 2 + return 0 + +//Reflects lasers and resistant to burn damage, but very vulnerable to brute damage. Shatters on death. +/datum/species/golem/glass + name = "Glass Golem" + id = "glass golem" + fixed_mut_color = "5a96b4aa" //transparent body + meat = /obj/item/shard + armor = 0 + brutemod = 3 //very fragile + burnmod = 0.25 + info_text = "As a Glass Golem, you reflect lasers and energy weapons, and are very resistant to burn damage. However, you are extremely vulnerable to brute damage. On death, you'll shatter beyond any hope of recovery." + attack_sound = 'sound/effects/glassbr2.ogg' + prefix = "Glass" + special_names = list("Lens", "Prism", "Fiber", "Bead") + +/datum/species/golem/glass/spec_death(gibbed, mob/living/carbon/human/H) + playsound(H, "shatter", 70, 1) + H.visible_message("[H] shatters!") + for(var/obj/item/W in H) + H.dropItemToGround(W) + for(var/i=1, i <= rand(3,5), i++) + new /obj/item/shard(get_turf(H)) + qdel(H) + +/datum/species/golem/glass/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) + if(!(P.original == H && P.firer == H)) //self-shots don't reflect + if(P.flag == "laser" || P.flag == "energy") + H.visible_message("The [P.name] gets reflected by [H]'s glass skin!", \ + "The [P.name] gets reflected by [H]'s glass skin!") + if(P.starting) + var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/turf/target = get_turf(P.starting) + // redirect the projectile + P.preparePixelProjectile(locate(CLAMP(target.x + new_x, 1, world.maxx), CLAMP(target.y + new_y, 1, world.maxy), H.z), H) + return -1 + return 0 + +//Teleports when hit or when it wants to +/datum/species/golem/bluespace + name = "Bluespace Golem" + id = "bluespace golem" + fixed_mut_color = "33f" + meat = /obj/item/stack/ore/bluespace_crystal + info_text = "As a Bluespace Golem, you are spatially unstable: You will teleport when hit, and you can teleport manually at a long distance." + attack_verb = "bluespace punch" + attack_sound = 'sound/effects/phasein.ogg' + prefix = "Bluespace" + special_names = list("Crystal", "Polycrystal") + + var/datum/action/innate/unstable_teleport/unstable_teleport + var/teleport_cooldown = 100 + var/last_teleport = 0 + +/datum/species/golem/bluespace/proc/reactive_teleport(mob/living/carbon/human/H) + H.visible_message("[H] teleports!", "You destabilize and teleport!") + new /obj/effect/particle_effect/sparks(get_turf(H)) + playsound(get_turf(H), "sparks", 50, 1) + do_teleport(H, get_turf(H), 6, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) + last_teleport = world.time + +/datum/species/golem/bluespace/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) + ..() + var/obj/item/I + if(istype(AM, /obj/item)) + I = AM + if(I.thrownby == H) //No throwing stuff at yourself to trigger the teleport + return 0 + else + reactive_teleport(H) + +/datum/species/golem/bluespace/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style) + ..() + if(world.time > last_teleport + teleport_cooldown && M != H && M.a_intent != INTENT_HELP) + reactive_teleport(H) + +/datum/species/golem/bluespace/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) + ..() + if(world.time > last_teleport + teleport_cooldown && user != H) + reactive_teleport(H) + +/datum/species/golem/bluespace/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) + ..() + if(world.time > last_teleport + teleport_cooldown) + reactive_teleport(H) + +/datum/species/golem/bluespace/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(ishuman(C)) + unstable_teleport = new + unstable_teleport.Grant(C) + last_teleport = world.time + +/datum/species/golem/bluespace/on_species_loss(mob/living/carbon/C) + if(unstable_teleport) + unstable_teleport.Remove(C) + ..() + +/datum/action/innate/unstable_teleport + name = "Unstable Teleport" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "jaunt" + icon_icon = 'icons/mob/actions/actions_spells.dmi' + var/cooldown = 150 + var/last_teleport = 0 + +/datum/action/innate/unstable_teleport/IsAvailable() + if(..()) + if(world.time > last_teleport + cooldown) + return 1 + return 0 + +/datum/action/innate/unstable_teleport/Activate() + var/mob/living/carbon/human/H = owner + H.visible_message("[H] starts vibrating!", "You start charging your bluespace core...") + playsound(get_turf(H), 'sound/weapons/flash.ogg', 25, 1) + addtimer(CALLBACK(src, .proc/teleport, H), 15) + +/datum/action/innate/unstable_teleport/proc/teleport(mob/living/carbon/human/H) + H.visible_message("[H] disappears in a shower of sparks!", "You teleport!") + var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread + spark_system.set_up(10, 0, src) + spark_system.attach(H) + spark_system.start() + do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) + last_teleport = world.time + UpdateButtonIcon() //action icon looks unavailable + sleep(cooldown + 5) + UpdateButtonIcon() //action icon looks available again + + +//honk +/datum/species/golem/bananium + name = "Bananium Golem" + id = "bananium golem" + fixed_mut_color = "ff0" + say_mod = "honks" + punchdamagelow = 0 + punchdamagehigh = 1 + punchstunthreshold = 2 //Harmless and can't stun + meat = /obj/item/stack/ore/bananium + info_text = "As a Bananium Golem, you are made for pranking. Your body emits natural honks, and you can barely even hurt people when punching them. Your skin also bleeds banana peels when damaged." + attack_verb = "honk" + attack_sound = 'sound/items/airhorn2.ogg' + prefix = "Bananium" + special_names = null + + var/last_honk = 0 + var/honkooldown = 0 + var/last_banana = 0 + var/banana_cooldown = 100 + var/active = null + +/datum/species/golem/bananium/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + last_banana = world.time + last_honk = world.time + RegisterSignal(C, COMSIG_MOB_SAY, .proc/handle_speech) + +/datum/species/golem/bananium/on_species_loss(mob/living/carbon/C) + . = ..() + UnregisterSignal(C, COMSIG_MOB_SAY) + +/datum/species/golem/bananium/random_name(gender,unique,lastname) + var/clown_name = pick(GLOB.clown_names) + var/golem_name = "[uppertext(clown_name)]" + return golem_name + +/datum/species/golem/bananium/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style) + ..() + if(world.time > last_banana + banana_cooldown && M != H && M.a_intent != INTENT_HELP) + new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) + ..() + if(world.time > last_banana + banana_cooldown && user != H) + new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) + ..() + if(world.time > last_banana + banana_cooldown) + new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) + ..() + var/obj/item/I + if(istype(AM, /obj/item)) + I = AM + if(I.thrownby == H) //No throwing stuff at yourself to make bananas + return 0 + else + new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/spec_life(mob/living/carbon/human/H) + if(!active) + if(world.time > last_honk + honkooldown) + active = 1 + playsound(get_turf(H), 'sound/items/bikehorn.ogg', 50, 1) + last_honk = world.time + honkooldown = rand(20, 80) + active = null + ..() + +/datum/species/golem/bananium/spec_death(gibbed, mob/living/carbon/human/H) + playsound(get_turf(H), 'sound/misc/sadtrombone.ogg', 70, 0) + +/datum/species/golem/bananium/proc/handle_speech(datum/source, list/speech_args) + speech_args[SPEECH_SPANS] |= SPAN_CLOWN + +/datum/species/golem/runic + name = "Runic Golem" + id = "runic golem" + limbs_id = "cultgolem" + sexes = FALSE + info_text = "As a Runic Golem, you possess eldritch powers granted by the Elder Goddess Nar'Sie." + species_traits = list(NOBLOOD,NO_UNDERWEAR,NOEYES) //no mutcolors + prefix = "Runic" + special_names = null + + var/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift/golem/phase_shift + var/obj/effect/proc_holder/spell/targeted/abyssal_gaze/abyssal_gaze + var/obj/effect/proc_holder/spell/targeted/dominate/dominate + +/datum/species/golem/runic/random_name(gender,unique,lastname) + var/edgy_first_name = pick("Razor","Blood","Dark","Evil","Cold","Pale","Black","Silent","Chaos","Deadly","Coldsteel") + var/edgy_last_name = pick("Edge","Night","Death","Razor","Blade","Steel","Calamity","Twilight","Shadow","Nightmare") //dammit Razor Razor + var/golem_name = "[edgy_first_name] [edgy_last_name]" + return golem_name + +/datum/species/golem/runic/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.faction |= "cult" + phase_shift = new + phase_shift.charge_counter = 0 + C.AddSpell(phase_shift) + abyssal_gaze = new + abyssal_gaze.charge_counter = 0 + C.AddSpell(abyssal_gaze) + dominate = new + dominate.charge_counter = 0 + C.AddSpell(dominate) + +/datum/species/golem/runic/on_species_loss(mob/living/carbon/C) + . = ..() + C.faction -= "cult" + if(phase_shift) + C.RemoveSpell(phase_shift) + if(abyssal_gaze) + C.RemoveSpell(abyssal_gaze) + if(dominate) + C.RemoveSpell(dominate) + +/datum/species/golem/runic/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(chem.type == /datum/reagent/water/holywater) + H.adjustFireLoss(4) + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) + + if(chem.type == /datum/reagent/fuel/unholywater) + H.adjustBruteLoss(-4) + H.adjustFireLoss(-4) + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) + + +/datum/species/golem/clockwork + name = "Clockwork Golem" + id = "clockwork golem" + say_mod = "clicks" + limbs_id = "clockgolem" + info_text = "As a Clockwork Golem, you are faster than other types of golems. On death, you will break down into scrap." + species_traits = list(NOBLOOD,NO_UNDERWEAR,NOEYES) + inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID) + armor = 20 //Reinforced, but much less so to allow for fast movement + attack_verb = "smash" + attack_sound = 'sound/magic/clockwork/anima_fragment_attack.ogg' + sexes = FALSE + speedmod = 0 + damage_overlay_type = "synth" + prefix = "Clockwork" + special_names = list("Remnant", "Relic", "Scrap", "Vestige") //RIP Ratvar + var/has_corpse + +/datum/species/golem/clockwork/on_species_gain(mob/living/carbon/human/H) + . = ..() + H.faction |= "ratvar" + RegisterSignal(H, COMSIG_MOB_SAY, .proc/handle_speech) + +/datum/species/golem/clockwork/on_species_loss(mob/living/carbon/human/H) + if(!is_servant_of_ratvar(H)) + H.faction -= "ratvar" + UnregisterSignal(H, COMSIG_MOB_SAY) + . = ..() + +/datum/species/golem/clockwork/proc/handle_speech(datum/source, list/speech_args) + speech_args[SPEECH_SPANS] |= SPAN_ROBOT //beep + +/datum/species/golem/clockwork/spec_death(gibbed, mob/living/carbon/human/H) + gibbed = !has_corpse ? FALSE : gibbed + . = ..() + if(!has_corpse) + var/turf/T = get_turf(H) + H.visible_message("[H]'s exoskeleton shatters, collapsing into a heap of scrap!") + playsound(H, 'sound/magic/clockwork/anima_fragment_death.ogg', 62, TRUE) + for(var/i in 1 to rand(3, 5)) + new/obj/item/clockwork/alloy_shards/small(T) + new/obj/item/clockwork/alloy_shards/clockgolem_remains(T) + qdel(H) + +/datum/species/golem/clockwork/no_scrap //These golems are created through the herald's beacon and leave normal corpses on death. + id = "clockwork golem servant" + armor = 15 //Balance reasons make this armor weak + no_equip = list() + nojumpsuit = FALSE + has_corpse = TRUE + blacklisted = TRUE + dangerous_existence = TRUE + random_eligible = FALSE + info_text = "As a Clockwork Golem Servant, you are faster than other types of golems." //warcult golems leave a corpse + +/datum/species/golem/cloth + name = "Cloth Golem" + id = "cloth golem" + limbs_id = "clothgolem" + sexes = FALSE + info_text = "As a Cloth Golem, you are able to reform yourself after death, provided your remains aren't burned or destroyed. You are, of course, very flammable. \ + Being made of cloth, your body is magic resistant and faster than that of other golems, but weaker and less resilient." + species_traits = list(NOBLOOD,NO_UNDERWEAR) //no mutcolors, and can burn + inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_NOBREATH,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOGUNS) + inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID) + armor = 15 //feels no pain, but not too resistant + burnmod = 2 // don't get burned + speedmod = 1 // not as heavy as stone + punchdamagelow = 4 + punchstunthreshold = 7 + punchdamagehigh = 8 // not as heavy as stone + prefix = "Cloth" + special_names = null + +/datum/species/golem/cloth/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + ADD_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) + +/datum/species/golem/cloth/on_species_loss(mob/living/carbon/C) + REMOVE_TRAIT(C, TRAIT_HOLY, SPECIES_TRAIT) + ..() + +/datum/species/golem/cloth/check_roundstart_eligible() + if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) + return TRUE + return ..() + +/datum/species/golem/cloth/random_name(gender,unique,lastname) + var/pharaoh_name = pick("Neferkare", "Hudjefa", "Khufu", "Mentuhotep", "Ahmose", "Amenhotep", "Thutmose", "Hatshepsut", "Tutankhamun", "Ramses", "Seti", \ + "Merenptah", "Djer", "Semerkhet", "Nynetjer", "Khafre", "Pepi", "Intef", "Ay") //yes, Ay was an actual pharaoh + var/golem_name = "[pharaoh_name] \Roman[rand(1,99)]" + return golem_name + +/datum/species/golem/cloth/spec_life(mob/living/carbon/human/H) + if(H.fire_stacks < 1) + H.adjust_fire_stacks(1) //always prone to burning + ..() + +/datum/species/golem/cloth/spec_death(gibbed, mob/living/carbon/human/H) + if(gibbed) + return + if(H.on_fire) + H.visible_message("[H] burns into ash!") + H.dust(just_ash = TRUE) + return + + H.visible_message("[H] falls apart into a pile of bandages!") + new /obj/structure/cloth_pile(get_turf(H), H) + ..() + +/obj/structure/cloth_pile + name = "pile of bandages" + desc = "It emits a strange aura, as if there was still life within it..." + max_integrity = 50 + armor = list("melee" = 90, "bullet" = 90, "laser" = 25, "energy" = 80, "bomb" = 50, "bio" = 100, "fire" = -50, "acid" = -50) + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "pile_bandages" + resistance_flags = FLAMMABLE + + var/revive_time = 900 + var/mob/living/carbon/human/cloth_golem + +/obj/structure/cloth_pile/Initialize(mapload, mob/living/carbon/human/H) + . = ..() + if(!QDELETED(H) && is_species(H, /datum/species/golem/cloth)) + H.unequip_everything() + H.forceMove(src) + cloth_golem = H + to_chat(cloth_golem, "You start gathering your life energy, preparing to rise again...") + addtimer(CALLBACK(src, .proc/revive), revive_time) + else + return INITIALIZE_HINT_QDEL + +/obj/structure/cloth_pile/Destroy() + if(cloth_golem) + QDEL_NULL(cloth_golem) + return ..() + +/obj/structure/cloth_pile/burn() + visible_message("[src] burns into ash!") + new /obj/effect/decal/cleanable/ash(get_turf(src)) + ..() + +/obj/structure/cloth_pile/proc/revive() + if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime + return + if(cloth_golem.suiciding || HAS_TRAIT(cloth_golem, TRAIT_NOCLONE)) + QDEL_NULL(cloth_golem) + return + + invisibility = INVISIBILITY_MAXIMUM //disappear before the animation + new /obj/effect/temp_visual/mummy_animation(get_turf(src)) + if(cloth_golem.revive(full_heal = TRUE, admin_revive = TRUE)) + cloth_golem.grab_ghost() //won't pull if it's a suicide + sleep(20) + cloth_golem.forceMove(get_turf(src)) + cloth_golem.visible_message("[src] rises and reforms into [cloth_golem]!","You reform into yourself!") + cloth_golem = null + qdel(src) + +/obj/structure/cloth_pile/attackby(obj/item/P, mob/living/carbon/human/user, params) + . = ..() + + if(resistance_flags & ON_FIRE) + return + + if(P.is_hot()) + visible_message("[src] bursts into flames!") + fire_act() + +/datum/species/golem/plastic + name = "Plastic Golem" + id = "plastic golem" + prefix = "Plastic" + special_names = null + fixed_mut_color = "fff" + info_text = "As a Plastic Golem, you are capable of ventcrawling and passing through plastic flaps as long as you are naked." + +/datum/species/golem/plastic/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.ventcrawler = VENTCRAWLER_NUDE + +/datum/species/golem/plastic/on_species_loss(mob/living/carbon/C) + . = ..() + C.ventcrawler = initial(C.ventcrawler) + +/datum/species/golem/bronze + name = "Bronze Golem" + id = "bronze golem" + prefix = "Bronze" + special_names = list("Bell") + fixed_mut_color = "cd7f32" + info_text = "As a Bronze Golem, you are very resistant to loud noises, and make loud noises if something hard hits you, however this ability does hurt your hearing." + special_step_sounds = list('sound/machines/clockcult/integration_cog_install.ogg', 'sound/magic/clockwork/fellowship_armory.ogg' ) + attack_verb = "bonk" + mutantears = /obj/item/organ/ears/bronze + var/last_gong_time = 0 + var/gong_cooldown = 150 + +/datum/species/golem/bronze/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) + if(!(world.time > last_gong_time + gong_cooldown)) + return ..() + if(P.flag == "bullet" || P.flag == "bomb") + gong(H) + return ..() + +/datum/species/golem/bronze/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) + ..() + if(world.time > last_gong_time + gong_cooldown) + gong(H) + +/datum/species/golem/bronze/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style) + ..() + if(world.time > last_gong_time + gong_cooldown && M.a_intent != INTENT_HELP) + gong(H) + +/datum/species/golem/bronze/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) + ..() + if(world.time > last_gong_time + gong_cooldown) + gong(H) + +/datum/species/golem/bronze/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) + ..() + if(world.time > last_gong_time + gong_cooldown) + gong(H) + +/datum/species/golem/bronze/proc/gong(mob/living/carbon/human/H) + last_gong_time = world.time + for(var/mob/living/M in get_hearers_in_view(7,H)) + if(M.stat == DEAD) //F + return + if(M == H) + H.show_message("You cringe with pain as your body rings around you!", 2) + H.playsound_local(H, 'sound/effects/gong.ogg', 100, TRUE) + H.soundbang_act(2, 0, 100, 1) + H.jitteriness += 7 + var/distance = max(0,get_dist(get_turf(H),get_turf(M))) + switch(distance) + if(0 to 1) + M.show_message("GONG!", 2) + M.playsound_local(H, 'sound/effects/gong.ogg', 100, TRUE) + M.soundbang_act(1, 0, 30, 3) + M.confused += 10 + M.jitteriness += 4 + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "gonged", /datum/mood_event/loud_gong) + if(2 to 3) + M.show_message("GONG!", 2) + M.playsound_local(H, 'sound/effects/gong.ogg', 75, TRUE) + M.soundbang_act(1, 0, 15, 2) + M.jitteriness += 3 + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "gonged", /datum/mood_event/loud_gong) + else + M.show_message("GONG!", 2) + M.playsound_local(H, 'sound/effects/gong.ogg', 50, TRUE) + + +/datum/species/golem/cardboard //Faster but weaker, can also make new shells on its own + name = "Cardboard Golem" + id = "cardboard golem" + prefix = "Cardboard" + special_names = list("Box") + info_text = "As a Cardboard Golem, you aren't very strong, but you are a bit quicker and can easily create more brethren by using cardboard on yourself." + species_traits = list(NOBLOOD,NO_UNDERWEAR,NOGENITALS,NOAROUSAL,MUTCOLORS) + inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER) + fixed_mut_color = "ffffff" + limbs_id = "c_golem" //special sprites + attack_verb = "bash" + armor = 25 + burnmod = 1.25 + heatmod = 2 + speedmod = 1.5 + punchdamagelow = 4 + punchstunthreshold = 7 + punchdamagehigh = 8 + var/last_creation = 0 + var/brother_creation_cooldown = 300 + +/datum/species/golem/cardboard/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) + . = ..() + if(user != H) + return FALSE //forced reproduction is r/non-con + if(istype(I, /obj/item/stack/sheet/cardboard)) + var/obj/item/stack/sheet/cardboard/C = I + if(last_creation + brother_creation_cooldown > world.time) //no cheesing dork + return + if(C.amount < 10) + to_chat(H, "You do not have enough cardboard!") + return FALSE + to_chat(H, "You attempt to create a new cardboard brother.") + if(do_after(user, 30, target = user)) + if(last_creation + brother_creation_cooldown > world.time) //no cheesing dork + return + if(!C.use(10)) + to_chat(H, "You do not have enough cardboard!") + return FALSE + to_chat(H, "You create a new cardboard golem shell.") + create_brother(H.loc) + +/datum/species/golem/cardboard/proc/create_brother(var/location) + new /obj/effect/mob_spawn/human/golem/servant(location, /datum/species/golem/cardboard, owner) + last_creation = world.time + +/datum/species/golem/leather + name = "Leather Golem" + id = "leather golem" + special_names = list("Face", "Man", "Belt") //Ah dude 4 strength 4 stam leather belt AHHH + inherent_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER, TRAIT_STRONG_GRABBER) + prefix = "Leather" + fixed_mut_color = "624a2e" + info_text = "As a Leather Golem, you are flammable, but you can grab things with incredible ease, allowing all your grabs to start at a strong level." + attack_verb = "whipp" + grab_sound = 'sound/weapons/whipgrab.ogg' + attack_sound = 'sound/weapons/whip.ogg' + +/datum/species/golem/bone + name = "Bone Golem" + id = "bone golem" + say_mod = "rattles" + prefix = "Bone" + limbs_id = "b_golem" + special_names = list("Head", "Broth", "Fracture", "Rattler", "Appetit") + liked_food = GROSS | MEAT | RAW + toxic_food = null + inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID) + mutanttongue = /obj/item/organ/tongue/bone + sexes = FALSE + fixed_mut_color = "ffffff" + attack_verb = "rattl" + species_traits = list(NOBLOOD,NO_UNDERWEAR,NOGENITALS,NOAROUSAL,MUTCOLORS) + inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_NOFIRE,TRAIT_NOGUNS,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER,TRAIT_FAKEDEATH,TRAIT_CALCIUM_HEALER) + info_text = "As a Bone Golem, You have a powerful spell that lets you chill your enemies with fear, and milk heals you! Just make sure to watch our for bone-hurting juice." + var/datum/action/innate/bonechill/bonechill + +/datum/species/golem/bone/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(ishuman(C)) + bonechill = new + bonechill.Grant(C) + +/datum/species/golem/bone/on_species_loss(mob/living/carbon/C) + if(bonechill) + bonechill.Remove(C) + ..() + +/datum/action/innate/bonechill + name = "Bone Chill" + desc = "Rattle your bones and strike fear into your enemies!" + check_flags = AB_CHECK_CONSCIOUS + icon_icon = 'icons/mob/actions/actions_spells.dmi' + button_icon_state = "bonechill" + var/cooldown = 600 + var/last_use + var/snas_chance = 3 + +/datum/action/innate/bonechill/Activate() + if(world.time < last_use + cooldown) + to_chat("You aren't ready yet to rattle your bones again") + return + owner.visible_message("[owner] rattles [owner.p_their()] bones harrowingly.", "You rattle your bones") + last_use = world.time + if(prob(snas_chance)) + playsound(get_turf(owner),'sound/magic/RATTLEMEBONES2.ogg', 100) + if(ishuman(owner)) + var/mob/living/carbon/human/H = owner + var/mutable_appearance/badtime = mutable_appearance('icons/mob/human_parts.dmi', "b_golem_eyes", -FIRE_LAYER-0.5) + badtime.appearance_flags = RESET_COLOR + H.overlays_standing[FIRE_LAYER+0.5] = badtime + H.apply_overlay(FIRE_LAYER+0.5) + addtimer(CALLBACK(H, /mob/living/carbon/.proc/remove_overlay, FIRE_LAYER+0.5), 25) + else + playsound(get_turf(owner),'sound/magic/RATTLEMEBONES.ogg', 100) + for(var/mob/living/L in orange(7, get_turf(owner))) + if((MOB_UNDEAD in L.mob_biotypes) || isgolem(L) || HAS_TRAIT(L, TRAIT_RESISTCOLD)) + return //Do not affect our brothers + + to_chat(L, "A spine-chilling sound chills you to the bone!") + L.apply_status_effect(/datum/status_effect/bonechill) + SEND_SIGNAL(L, COMSIG_ADD_MOOD_EVENT, "spooked", /datum/mood_event/spooked) diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index b8f260a9..0fa512b7 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -1,737 +1,737 @@ -/datum/species/jelly - // Entirely alien beings that seem to be made entirely out of gel. They have three eyes and a skeleton visible within them. - name = "Xenobiological Jelly Entity" - id = "jelly" - default_color = "00FF90" - say_mod = "chirps" - species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,WINGCOLOR) - mutantlungs = /obj/item/organ/lungs/slime - mutant_heart = /obj/item/organ/heart/slime - mutant_bodyparts = list("mam_tail", "mam_ears", "mam_snouts", "taur") //CIT CHANGE - default_features = list("mcolor" = "FFF", "mam_tail" = "None", "mam_ears" = "None", "mam_snouts" = "None", "taur" = "None") //CIT CHANGE - inherent_traits = list(TRAIT_TOXINLOVER) - meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/slime - gib_types = list(/obj/effect/gibspawner/slime, /obj/effect/gibspawner/slime/bodypartless) - exotic_blood = "jellyblood" - exotic_bloodtype = "GEL" - damage_overlay_type = "" - var/datum/action/innate/regenerate_limbs/regenerate_limbs - var/datum/action/innate/slime_change/slime_change //CIT CHANGE - liked_food = TOXIC | MEAT - toxic_food = null - coldmod = 6 // = 3x cold damage - heatmod = 0.5 // = 1/4x heat damage - burnmod = 0.5 // = 1/2x generic burn damage - -/datum/species/jelly/on_species_loss(mob/living/carbon/C) - if(regenerate_limbs) - regenerate_limbs.Remove(C) - if(slime_change) //CIT CHANGE - slime_change.Remove(C) //CIT CHANGE - C.remove_language(/datum/language/slime) - C.faction -= "slime" - ..() - C.faction -= "slime" - -/datum/species/jelly/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - C.grant_language(/datum/language/slime) - if(ishuman(C)) - regenerate_limbs = new - regenerate_limbs.Grant(C) - slime_change = new //CIT CHANGE - slime_change.Grant(C) //CIT CHANGE - C.faction |= "slime" - -/datum/species/jelly/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for vampires - return - if(!H.blood_volume) - H.blood_volume += 5 - H.adjustBruteLoss(5) - to_chat(H, "You feel empty!") - - if(H.blood_volume < (BLOOD_VOLUME_NORMAL * H.blood_ratio)) - if(H.nutrition >= NUTRITION_LEVEL_STARVING) - H.blood_volume += 3 - H.nutrition -= 2.5 - if(H.blood_volume < (BLOOD_VOLUME_OKAY*H.blood_ratio)) - if(prob(5)) - to_chat(H, "You feel drained!") - if(H.blood_volume < (BLOOD_VOLUME_BAD*H.blood_ratio)) - Cannibalize_Body(H) - if(regenerate_limbs) - regenerate_limbs.UpdateButtonIcon() - -/datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H) - var/list/limbs_to_consume = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) - H.get_missing_limbs() - var/obj/item/bodypart/consumed_limb - if(!limbs_to_consume.len) - H.losebreath++ - return - if(H.get_num_legs(FALSE)) //Legs go before arms - limbs_to_consume -= list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM) - consumed_limb = H.get_bodypart(pick(limbs_to_consume)) - consumed_limb.drop_limb() - to_chat(H, "Your [consumed_limb] is drawn back into your body, unable to maintain its shape!") - qdel(consumed_limb) - H.blood_volume += 20 - -/datum/action/innate/regenerate_limbs - name = "Regenerate Limbs" - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "slimeheal" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - -/datum/action/innate/regenerate_limbs/IsAvailable() - if(..()) - var/mob/living/carbon/human/H = owner - var/list/limbs_to_heal = H.get_missing_limbs() - if(limbs_to_heal.len < 1) - return 0 - if(H.blood_volume >= (BLOOD_VOLUME_OKAY*H.blood_ratio)+40) - return 1 - return 0 - -/datum/action/innate/regenerate_limbs/Activate() - var/mob/living/carbon/human/H = owner - var/list/limbs_to_heal = H.get_missing_limbs() - if(limbs_to_heal.len < 1) - to_chat(H, "You feel intact enough as it is.") - return - to_chat(H, "You focus intently on your missing [limbs_to_heal.len >= 2 ? "limbs" : "limb"]...") - if(H.blood_volume >= 40*limbs_to_heal.len+(BLOOD_VOLUME_OKAY*H.blood_ratio)) - H.regenerate_limbs() - H.blood_volume -= 40*limbs_to_heal.len - to_chat(H, "...and after a moment you finish reforming!") - return - else if(H.blood_volume >= 40)//We can partially heal some limbs - while(H.blood_volume >= (BLOOD_VOLUME_OKAY*H.blood_ratio)+40) - var/healed_limb = pick(limbs_to_heal) - H.regenerate_limb(healed_limb) - limbs_to_heal -= healed_limb - H.blood_volume -= 40 - to_chat(H, "...but there is not enough of you to fix everything! You must attain more mass to heal completely!") - return - to_chat(H, "...but there is not enough of you to go around! You must attain more mass to heal!") - -////////////////////////////////////////////////////////SLIMEPEOPLE/////////////////////////////////////////////////////////////////// - -//Slime people are able to split like slimes, retaining a single mind that can swap between bodies at will, even after death. - -/datum/species/jelly/slime - name = "Slimeperson" - id = "slime" - default_color = "00FFFF" - species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR) - say_mod = "says" - hair_color = "mutcolor" - hair_alpha = 150 - ignored_by = list(/mob/living/simple_animal/slime) - var/datum/action/innate/split_body/slime_split - var/list/mob/living/carbon/bodies - var/datum/action/innate/swap_body/swap_body - -/datum/species/jelly/slime/on_species_loss(mob/living/carbon/C) - if(slime_split) - slime_split.Remove(C) - if(swap_body) - swap_body.Remove(C) - bodies -= C // This means that the other bodies maintain a link - // so if someone mindswapped into them, they'd still be shared. - bodies = null - C.blood_volume = min(C.blood_volume, (BLOOD_VOLUME_NORMAL*C.blood_ratio)) - ..() - -/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(ishuman(C)) - slime_split = new - slime_split.Grant(C) - swap_body = new - swap_body.Grant(C) - - if(!bodies || !bodies.len) - bodies = list(C) - else - bodies |= C - -/datum/species/jelly/slime/spec_death(gibbed, mob/living/carbon/human/H) - if(slime_split) - if(!H.mind || !H.mind.active) - return - - var/list/available_bodies = (bodies - H) - for(var/mob/living/L in available_bodies) - if(!swap_body.can_swap(L)) - available_bodies -= L - - if(!LAZYLEN(available_bodies)) - return - - swap_body.swap_to_dupe(H.mind, pick(available_bodies)) - -//If you're cloned you get your body pool back -/datum/species/jelly/slime/copy_properties_from(datum/species/jelly/slime/old_species) - bodies = old_species.bodies - -/datum/species/jelly/slime/spec_life(mob/living/carbon/human/H) - if((HAS_TRAIT(H, TRAIT_NOMARROW))) - return - if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) - if(prob(5)) - to_chat(H, "You feel very bloated!") - else if(H.nutrition >= NUTRITION_LEVEL_WELL_FED) - H.blood_volume += 3 - H.nutrition -= 2.5 - - ..() - -/datum/action/innate/split_body - name = "Split Body" - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "slimesplit" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - -/datum/action/innate/split_body/IsAvailable() - if(..()) - var/mob/living/carbon/human/H = owner - if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) - return 1 - return 0 - -/datum/action/innate/split_body/Activate() - var/mob/living/carbon/human/H = owner - if(!isslimeperson(H)) - return - CHECK_DNA_AND_SPECIES(H) - H.visible_message("[owner] gains a look of \ - concentration while standing perfectly still.", - "You focus intently on moving your body while \ - standing perfectly still...") - - H.notransform = TRUE - - if(do_after(owner, delay=60, needhand=FALSE, target=owner, progress=TRUE)) - if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) - make_dupe() - else - to_chat(H, "...but there is not enough of you to go around! You must attain more mass to split!") - else - to_chat(H, "...but fail to stand perfectly still!") - - H.notransform = FALSE - -/datum/action/innate/split_body/proc/make_dupe() - var/mob/living/carbon/human/H = owner - CHECK_DNA_AND_SPECIES(H) - - var/mob/living/carbon/human/spare = new /mob/living/carbon/human(H.loc) - - spare.underwear = "Nude" - H.dna.transfer_identity(spare, transfer_SE=1) - spare.dna.features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F") - spare.real_name = spare.dna.real_name - spare.name = spare.dna.real_name - spare.updateappearance(mutcolor_update=1) - spare.domutcheck() - spare.Move(get_step(H.loc, pick(NORTH,SOUTH,EAST,WEST))) - - H.blood_volume *= 0.45 - H.notransform = 0 - - var/datum/species/jelly/slime/origin_datum = H.dna.species - origin_datum.bodies |= spare - - var/datum/species/jelly/slime/spare_datum = spare.dna.species - spare_datum.bodies = origin_datum.bodies - - H.transfer_trait_datums(spare) - H.mind.transfer_to(spare) - spare.visible_message("[H] distorts as a new body \ - \"steps out\" of [H.p_them()].", - "...and after a moment of disorentation, \ - you're besides yourself!") - - -/datum/action/innate/swap_body - name = "Swap Body" - check_flags = NONE - button_icon_state = "slimeswap" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - -/datum/action/innate/swap_body/Activate() - if(!isslimeperson(owner)) - to_chat(owner, "You are not a slimeperson.") - Remove(owner) - else - ui_interact(owner) - -/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state) - - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "slime_swap_body", name, 400, 400, master_ui, state) - ui.open() - -/datum/action/innate/swap_body/ui_data(mob/user) - var/mob/living/carbon/human/H = owner - if(!isslimeperson(H)) - return - - var/datum/species/jelly/slime/SS = H.dna.species - - var/list/data = list() - data["bodies"] = list() - for(var/b in SS.bodies) - var/mob/living/carbon/human/body = b - if(!body || QDELETED(body) || !isslimeperson(body)) - SS.bodies -= b - continue - - var/list/L = list() - // HTML colors need a # prefix - L["htmlcolor"] = "#[body.dna.features["mcolor"]]" - L["area"] = get_area_name(body, TRUE) - var/stat = "error" - switch(body.stat) - if(CONSCIOUS) - stat = "Conscious" - if(UNCONSCIOUS) - stat = "Unconscious" - if(DEAD) - stat = "Dead" - var/occupied - if(body == H) - occupied = "owner" - else if(body.mind && body.mind.active) - occupied = "stranger" - else - occupied = "available" - - L["status"] = stat - L["exoticblood"] = body.blood_volume - L["name"] = body.name - L["ref"] = "[REF(body)]" - L["occupied"] = occupied - var/button - if(occupied == "owner") - button = "selected" - else if(occupied == "stranger") - button = "danger" - else if(can_swap(body)) - button = null - else - button = "disabled" - - L["swap_button_state"] = button - L["swappable"] = (occupied == "available") && can_swap(body) - - data["bodies"] += list(L) - - return data - -/datum/action/innate/swap_body/ui_act(action, params) - if(..()) - return - var/mob/living/carbon/human/H = owner - if(!isslimeperson(owner)) - return - if(!H.mind || !H.mind.active) - return - switch(action) - if("swap") - var/mob/living/carbon/human/selected = locate(params["ref"]) - if(!can_swap(selected)) - return - SStgui.close_uis(src) - swap_to_dupe(H.mind, selected) - -/datum/action/innate/swap_body/proc/can_swap(mob/living/carbon/human/dupe) - var/mob/living/carbon/human/H = owner - if(!isslimeperson(H)) - return FALSE - var/datum/species/jelly/slime/SS = H.dna.species - - if(QDELETED(dupe)) //Is there a body? - SS.bodies -= dupe - return FALSE - - if(!isslimeperson(dupe)) //Is it a slimeperson? - SS.bodies -= dupe - return FALSE - - if(dupe.stat == DEAD) //Is it alive? - return FALSE - - if(dupe.stat != CONSCIOUS) //Is it awake? - return FALSE - - if(dupe.mind && dupe.mind.active) //Is it unoccupied? - return FALSE - - if(!(dupe in SS.bodies)) //Do we actually own it? - return FALSE - - return TRUE - -/datum/action/innate/swap_body/proc/swap_to_dupe(datum/mind/M, mob/living/carbon/human/dupe) - if(!can_swap(dupe)) //sanity check - return - if(M.current.stat == CONSCIOUS) - M.current.visible_message("[M.current] \ - stops moving and starts staring vacantly into space.", - "You stop moving this body...") - else - to_chat(M.current, "You abandon this body...") - M.current.transfer_trait_datums(dupe) - M.transfer_to(dupe) - dupe.visible_message("[dupe] blinks and looks \ - around.", - "...and move this one instead.") - - -///////////////////////////////////LUMINESCENTS////////////////////////////////////////// - -//Luminescents are able to consume and use slime extracts, without them decaying. - -/datum/species/jelly/luminescent - name = "Luminescent" - id = "lum" - say_mod = "says" - var/glow_intensity = LUMINESCENT_DEFAULT_GLOW - var/obj/effect/dummy/luminescent_glow/glow - var/obj/item/slime_extract/current_extract - var/datum/action/innate/integrate_extract/integrate_extract - var/datum/action/innate/use_extract/extract_minor - var/datum/action/innate/use_extract/major/extract_major - var/extract_cooldown = 0 - -/datum/species/jelly/luminescent/on_species_loss(mob/living/carbon/C) - ..() - if(current_extract) - current_extract.forceMove(C.drop_location()) - current_extract = null - qdel(glow) - if(integrate_extract) - integrate_extract.Remove(C) - if(extract_minor) - extract_minor.Remove(C) - if(extract_major) - extract_major.Remove(C) - -/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - glow = new(C) - update_glow(C) - integrate_extract = new(src) - integrate_extract.Grant(C) - extract_minor = new(src) - extract_minor.Grant(C) - extract_major = new(src) - extract_major.Grant(C) - -/datum/species/jelly/luminescent/proc/update_slime_actions() - integrate_extract.update_name() - integrate_extract.UpdateButtonIcon() - extract_minor.UpdateButtonIcon() - extract_major.UpdateButtonIcon() - -/datum/species/jelly/luminescent/proc/update_glow(mob/living/carbon/C, intensity) - if(intensity) - glow_intensity = intensity - glow.set_light(glow_intensity, glow_intensity, C.dna.features["mcolor"]) - -/obj/effect/dummy/luminescent_glow - name = "luminescent glow" - desc = "Tell a coder if you're seeing this." - icon_state = "nothing" - light_color = "#FFFFFF" - light_range = LUMINESCENT_DEFAULT_GLOW - -/obj/effect/dummy/luminescent_glow/Initialize() - . = ..() - if(!isliving(loc)) - return INITIALIZE_HINT_QDEL - -/datum/action/innate/integrate_extract - name = "Integrate Extract" - desc = "Eat a slime extract to use its properties." - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "slimeconsume" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - var/datum/species/jelly/luminescent/species - -/datum/action/innate/integrate_extract/New(_species) - ..() - species = _species - -/datum/action/innate/integrate_extract/proc/update_name() - if(!species || !species.current_extract) - name = "Integrate Extract" - desc = "Eat a slime extract to use its properties." - else - name = "Eject Extract" - desc = "Eject your current slime extract." - -/datum/action/innate/integrate_extract/UpdateButtonIcon(status_only, force) - if(!species || !species.current_extract) - button_icon_state = "slimeconsume" - else - button_icon_state = "slimeeject" - ..() - -/datum/action/innate/integrate_extract/ApplyIcon(obj/screen/movable/action_button/current_button, force) - ..(current_button, TRUE) - if(species && species.current_extract) - current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state)) - -/datum/action/innate/integrate_extract/Activate() - var/mob/living/carbon/human/H = owner - if(!is_species(H, /datum/species/jelly/luminescent) || !species) - return - CHECK_DNA_AND_SPECIES(H) - - if(species.current_extract) - var/obj/item/slime_extract/S = species.current_extract - if(!H.put_in_active_hand(S)) - S.forceMove(H.drop_location()) - species.current_extract = null - to_chat(H, "You eject [S].") - species.update_slime_actions() - else - var/obj/item/I = H.get_active_held_item() - if(istype(I, /obj/item/slime_extract)) - var/obj/item/slime_extract/S = I - if(!S.Uses) - to_chat(H, "[I] is spent! You cannot integrate it.") - return - if(!H.temporarilyRemoveItemFromInventory(S)) - return - S.forceMove(H) - species.current_extract = S - to_chat(H, "You consume [I], and you feel it pulse within you...") - species.update_slime_actions() - else - to_chat(H, "You need to hold an unused slime extract in your active hand!") - -/datum/action/innate/use_extract - name = "Extract Minor Activation" - desc = "Pulse the slime extract with energized jelly to activate it." - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "slimeuse1" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - var/activation_type = SLIME_ACTIVATE_MINOR - var/datum/species/jelly/luminescent/species - -/datum/action/innate/use_extract/New(_species) - ..() - species = _species - -/datum/action/innate/use_extract/IsAvailable() - if(..()) - if(species && species.current_extract && (world.time > species.extract_cooldown)) - return TRUE - return FALSE - -/datum/action/innate/use_extract/ApplyIcon(obj/screen/movable/action_button/current_button, force) - ..(current_button, TRUE) - if(species && species.current_extract) - current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state)) - -/datum/action/innate/use_extract/Activate() - var/mob/living/carbon/human/H = owner - if(!is_species(H, /datum/species/jelly/luminescent) || !species) - return - CHECK_DNA_AND_SPECIES(H) - - if(species.current_extract) - species.extract_cooldown = world.time + 100 - var/cooldown = species.current_extract.activate(H, species, activation_type) - species.extract_cooldown = world.time + cooldown - -/datum/action/innate/use_extract/major - name = "Extract Major Activation" - desc = "Pulse the slime extract with plasma jelly to activate it." - button_icon_state = "slimeuse2" - activation_type = SLIME_ACTIVATE_MAJOR - -///////////////////////////////////STARGAZERS////////////////////////////////////////// - -//Stargazers are the telepathic branch of jellypeople, able to project psychic messages and to link minds with willing participants. - -/datum/species/jelly/stargazer - name = "Stargazer" - id = "stargazer" - var/datum/action/innate/project_thought/project_thought - var/datum/action/innate/link_minds/link_minds - var/list/mob/living/linked_mobs = list() - var/list/datum/action/innate/linked_speech/linked_actions = list() - var/mob/living/carbon/human/slimelink_owner - var/current_link_id = 0 - -/datum/species/jelly/stargazer/on_species_loss(mob/living/carbon/C) - ..() - for(var/M in linked_mobs) - unlink_mob(M) - if(project_thought) - project_thought.Remove(C) - if(link_minds) - link_minds.Remove(C) - -/datum/species/jelly/stargazer/spec_death(gibbed, mob/living/carbon/human/H) - ..() - for(var/M in linked_mobs) - unlink_mob(M) - -/datum/species/jelly/stargazer/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - project_thought = new(src) - project_thought.Grant(C) - link_minds = new(src) - link_minds.Grant(C) - slimelink_owner = C - link_mob(C) - -/datum/species/jelly/stargazer/proc/link_mob(mob/living/M) - if(QDELETED(M) || M.stat == DEAD) - return FALSE - if(HAS_TRAIT(M, TRAIT_MINDSHIELD)) //mindshield implant, no dice - return FALSE - if(M in linked_mobs) - return FALSE - linked_mobs.Add(M) - to_chat(M, "You are now connected to [slimelink_owner.real_name]'s Slime Link.") - var/datum/action/innate/linked_speech/action = new(src) - linked_actions.Add(action) - action.Grant(M) - return TRUE - -/datum/species/jelly/stargazer/proc/unlink_mob(mob/living/M) - var/link_id = linked_mobs.Find(M) - if(!(link_id)) - return - var/datum/action/innate/linked_speech/action = linked_actions[link_id] - action.Remove(M) - to_chat(M, "You are no longer connected to [slimelink_owner.real_name]'s Slime Link.") - linked_mobs[link_id] = null - linked_actions[link_id] = null - -/datum/action/innate/linked_speech - name = "Slimelink" - desc = "Send a psychic message to everyone connected to your slime link." - button_icon_state = "link_speech" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - var/datum/species/jelly/stargazer/species - -/datum/action/innate/linked_speech/New(_species) - ..() - species = _species - -/datum/action/innate/linked_speech/Activate() - var/mob/living/carbon/human/H = owner - if(!species || !(H in species.linked_mobs)) - to_chat(H, "The link seems to have been severed...") - Remove(H) - return - - var/message = sanitize(input("Message:", "Slime Telepathy") as text|null) - - if(!species || !(H in species.linked_mobs)) - to_chat(H, "The link seems to have been severed...") - Remove(H) - return - - if(QDELETED(H) || H.stat == DEAD) - species.unlink_mob(H) - return - - if(message) - var/msg = "\[[species.slimelink_owner.real_name]'s Slime Link\] [H]: [message]" - log_directed_talk(H, species.slimelink_owner, msg, LOG_SAY, "slime link") - for(var/X in species.linked_mobs) - var/mob/living/M = X - if(QDELETED(M) || M.stat == DEAD) - species.unlink_mob(M) - continue - to_chat(M, msg) - - for(var/X in GLOB.dead_mob_list) - var/mob/M = X - var/link = FOLLOW_LINK(M, H) - to_chat(M, "[link] [msg]") - -/datum/action/innate/project_thought - name = "Send Thought" - desc = "Send a private psychic message to someone you can see." - button_icon_state = "send_mind" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - -/datum/action/innate/project_thought/Activate() - var/mob/living/carbon/human/H = owner - if(H.stat == DEAD) - return - if(!is_species(H, /datum/species/jelly/stargazer)) - return - CHECK_DNA_AND_SPECIES(H) - - var/list/options = list() - for(var/mob/living/Ms in oview(H)) - options += Ms - var/mob/living/M = input("Select who to send your message to:","Send thought to?",null) as null|mob in options - if(!M) - return - - var/msg = sanitize(input("Message:", "Telepathy") as text|null) - if(msg) - log_directed_talk(H, M, msg, LOG_SAY, "slime telepathy") - to_chat(M, "You hear an alien voice in your head... [msg]") - to_chat(H, "You telepathically said: \"[msg]\" to [M]") - for(var/dead in GLOB.dead_mob_list) - if(!isobserver(dead)) - continue - var/follow_link_user = FOLLOW_LINK(dead, H) - var/follow_link_target = FOLLOW_LINK(dead, M) - to_chat(dead, "[follow_link_user] [H] Slime Telepathy --> [follow_link_target] [M] [msg]") - -/datum/action/innate/link_minds - name = "Link Minds" - desc = "Link someone's mind to your Slime Link, allowing them to communicate telepathically with other linked minds." - button_icon_state = "mindlink" - icon_icon = 'icons/mob/actions/actions_slime.dmi' - background_icon_state = "bg_alien" - var/datum/species/jelly/stargazer/species - -/datum/action/innate/link_minds/New(_species) - ..() - species = _species - -/datum/action/innate/link_minds/Activate() - var/mob/living/carbon/human/H = owner - if(!is_species(H, /datum/species/jelly/stargazer)) - return - CHECK_DNA_AND_SPECIES(H) - - if(!H.pulling || !isliving(H.pulling) || H.grab_state < GRAB_AGGRESSIVE) - to_chat(H, "You need to aggressively grab someone to link minds!") - return - - var/mob/living/target = H.pulling - - to_chat(H, "You begin linking [target]'s mind to yours...") - to_chat(target, "You feel a foreign presence within your mind...") - if(do_after(H, 60, target = target)) - if(H.pulling != target || H.grab_state < GRAB_AGGRESSIVE) - return - if(species.link_mob(target)) - to_chat(H, "You connect [target]'s mind to your slime link!") - else - to_chat(H, "You can't seem to link [target]'s mind...") - to_chat(target, "The foreign presence leaves your mind.") +/datum/species/jelly + // Entirely alien beings that seem to be made entirely out of gel. They have three eyes and a skeleton visible within them. + name = "Xenobiological Jelly Entity" + id = "jelly" + default_color = "00FF90" + say_mod = "chirps" + species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,WINGCOLOR) + mutantlungs = /obj/item/organ/lungs/slime + mutant_heart = /obj/item/organ/heart/slime + mutant_bodyparts = list("mam_tail", "mam_ears", "mam_snouts", "taur") //CIT CHANGE + default_features = list("mcolor" = "FFF", "mam_tail" = "None", "mam_ears" = "None", "mam_snouts" = "None", "taur" = "None") //CIT CHANGE + inherent_traits = list(TRAIT_TOXINLOVER) + meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/slime + gib_types = list(/obj/effect/gibspawner/slime, /obj/effect/gibspawner/slime/bodypartless) + exotic_blood = /datum/reagent/blood/jellyblood + exotic_bloodtype = "GEL" + damage_overlay_type = "" + var/datum/action/innate/regenerate_limbs/regenerate_limbs + var/datum/action/innate/slime_change/slime_change //CIT CHANGE + liked_food = TOXIC | MEAT + toxic_food = null + coldmod = 6 // = 3x cold damage + heatmod = 0.5 // = 1/4x heat damage + burnmod = 0.5 // = 1/2x generic burn damage + +/datum/species/jelly/on_species_loss(mob/living/carbon/C) + if(regenerate_limbs) + regenerate_limbs.Remove(C) + if(slime_change) //CIT CHANGE + slime_change.Remove(C) //CIT CHANGE + C.remove_language(/datum/language/slime) + C.faction -= "slime" + ..() + C.faction -= "slime" + +/datum/species/jelly/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + C.grant_language(/datum/language/slime) + if(ishuman(C)) + regenerate_limbs = new + regenerate_limbs.Grant(C) + slime_change = new //CIT CHANGE + slime_change.Grant(C) //CIT CHANGE + C.faction |= "slime" + +/datum/species/jelly/spec_life(mob/living/carbon/human/H) + if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for vampires + return + if(!H.blood_volume) + H.blood_volume += 5 + H.adjustBruteLoss(5) + to_chat(H, "You feel empty!") + + if(H.blood_volume < (BLOOD_VOLUME_NORMAL * H.blood_ratio)) + if(H.nutrition >= NUTRITION_LEVEL_STARVING) + H.blood_volume += 3 + H.nutrition -= 2.5 + if(H.blood_volume < (BLOOD_VOLUME_OKAY*H.blood_ratio)) + if(prob(5)) + to_chat(H, "You feel drained!") + if(H.blood_volume < (BLOOD_VOLUME_BAD*H.blood_ratio)) + Cannibalize_Body(H) + if(regenerate_limbs) + regenerate_limbs.UpdateButtonIcon() + +/datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H) + var/list/limbs_to_consume = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) - H.get_missing_limbs() + var/obj/item/bodypart/consumed_limb + if(!limbs_to_consume.len) + H.losebreath++ + return + if(H.get_num_legs(FALSE)) //Legs go before arms + limbs_to_consume -= list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM) + consumed_limb = H.get_bodypart(pick(limbs_to_consume)) + consumed_limb.drop_limb() + to_chat(H, "Your [consumed_limb] is drawn back into your body, unable to maintain its shape!") + qdel(consumed_limb) + H.blood_volume += 20 + +/datum/action/innate/regenerate_limbs + name = "Regenerate Limbs" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "slimeheal" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + +/datum/action/innate/regenerate_limbs/IsAvailable() + if(..()) + var/mob/living/carbon/human/H = owner + var/list/limbs_to_heal = H.get_missing_limbs() + if(limbs_to_heal.len < 1) + return 0 + if(H.blood_volume >= (BLOOD_VOLUME_OKAY*H.blood_ratio)+40) + return 1 + return 0 + +/datum/action/innate/regenerate_limbs/Activate() + var/mob/living/carbon/human/H = owner + var/list/limbs_to_heal = H.get_missing_limbs() + if(limbs_to_heal.len < 1) + to_chat(H, "You feel intact enough as it is.") + return + to_chat(H, "You focus intently on your missing [limbs_to_heal.len >= 2 ? "limbs" : "limb"]...") + if(H.blood_volume >= 40*limbs_to_heal.len+(BLOOD_VOLUME_OKAY*H.blood_ratio)) + H.regenerate_limbs() + H.blood_volume -= 40*limbs_to_heal.len + to_chat(H, "...and after a moment you finish reforming!") + return + else if(H.blood_volume >= 40)//We can partially heal some limbs + while(H.blood_volume >= (BLOOD_VOLUME_OKAY*H.blood_ratio)+40) + var/healed_limb = pick(limbs_to_heal) + H.regenerate_limb(healed_limb) + limbs_to_heal -= healed_limb + H.blood_volume -= 40 + to_chat(H, "...but there is not enough of you to fix everything! You must attain more mass to heal completely!") + return + to_chat(H, "...but there is not enough of you to go around! You must attain more mass to heal!") + +////////////////////////////////////////////////////////SLIMEPEOPLE/////////////////////////////////////////////////////////////////// + +//Slime people are able to split like slimes, retaining a single mind that can swap between bodies at will, even after death. + +/datum/species/jelly/slime + name = "Slimeperson" + id = "slime" + default_color = "00FFFF" + species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR) + say_mod = "says" + hair_color = "mutcolor" + hair_alpha = 150 + ignored_by = list(/mob/living/simple_animal/slime) + var/datum/action/innate/split_body/slime_split + var/list/mob/living/carbon/bodies + var/datum/action/innate/swap_body/swap_body + +/datum/species/jelly/slime/on_species_loss(mob/living/carbon/C) + if(slime_split) + slime_split.Remove(C) + if(swap_body) + swap_body.Remove(C) + bodies -= C // This means that the other bodies maintain a link + // so if someone mindswapped into them, they'd still be shared. + bodies = null + C.blood_volume = min(C.blood_volume, (BLOOD_VOLUME_NORMAL*C.blood_ratio)) + ..() + +/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(ishuman(C)) + slime_split = new + slime_split.Grant(C) + swap_body = new + swap_body.Grant(C) + + if(!bodies || !bodies.len) + bodies = list(C) + else + bodies |= C + +/datum/species/jelly/slime/spec_death(gibbed, mob/living/carbon/human/H) + if(slime_split) + if(!H.mind || !H.mind.active) + return + + var/list/available_bodies = (bodies - H) + for(var/mob/living/L in available_bodies) + if(!swap_body.can_swap(L)) + available_bodies -= L + + if(!LAZYLEN(available_bodies)) + return + + swap_body.swap_to_dupe(H.mind, pick(available_bodies)) + +//If you're cloned you get your body pool back +/datum/species/jelly/slime/copy_properties_from(datum/species/jelly/slime/old_species) + bodies = old_species.bodies + +/datum/species/jelly/slime/spec_life(mob/living/carbon/human/H) + if((HAS_TRAIT(H, TRAIT_NOMARROW))) + return + if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) + if(prob(5)) + to_chat(H, "You feel very bloated!") + else if(H.nutrition >= NUTRITION_LEVEL_WELL_FED) + H.blood_volume += 3 + H.nutrition -= 2.5 + + ..() + +/datum/action/innate/split_body + name = "Split Body" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "slimesplit" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + +/datum/action/innate/split_body/IsAvailable() + if(..()) + var/mob/living/carbon/human/H = owner + if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) + return 1 + return 0 + +/datum/action/innate/split_body/Activate() + var/mob/living/carbon/human/H = owner + if(!isslimeperson(H)) + return + CHECK_DNA_AND_SPECIES(H) + H.visible_message("[owner] gains a look of \ + concentration while standing perfectly still.", + "You focus intently on moving your body while \ + standing perfectly still...") + + H.notransform = TRUE + + if(do_after(owner, delay=60, needhand=FALSE, target=owner, progress=TRUE)) + if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) + make_dupe() + else + to_chat(H, "...but there is not enough of you to go around! You must attain more mass to split!") + else + to_chat(H, "...but fail to stand perfectly still!") + + H.notransform = FALSE + +/datum/action/innate/split_body/proc/make_dupe() + var/mob/living/carbon/human/H = owner + CHECK_DNA_AND_SPECIES(H) + + var/mob/living/carbon/human/spare = new /mob/living/carbon/human(H.loc) + + spare.underwear = "Nude" + H.dna.transfer_identity(spare, transfer_SE=1) + spare.dna.features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F") + spare.real_name = spare.dna.real_name + spare.name = spare.dna.real_name + spare.updateappearance(mutcolor_update=1) + spare.domutcheck() + spare.Move(get_step(H.loc, pick(NORTH,SOUTH,EAST,WEST))) + + H.blood_volume *= 0.45 + H.notransform = 0 + + var/datum/species/jelly/slime/origin_datum = H.dna.species + origin_datum.bodies |= spare + + var/datum/species/jelly/slime/spare_datum = spare.dna.species + spare_datum.bodies = origin_datum.bodies + + H.transfer_trait_datums(spare) + H.mind.transfer_to(spare) + spare.visible_message("[H] distorts as a new body \ + \"steps out\" of [H.p_them()].", + "...and after a moment of disorentation, \ + you're besides yourself!") + + +/datum/action/innate/swap_body + name = "Swap Body" + check_flags = NONE + button_icon_state = "slimeswap" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + +/datum/action/innate/swap_body/Activate() + if(!isslimeperson(owner)) + to_chat(owner, "You are not a slimeperson.") + Remove(owner) + else + ui_interact(owner) + +/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state) + + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "slime_swap_body", name, 400, 400, master_ui, state) + ui.open() + +/datum/action/innate/swap_body/ui_data(mob/user) + var/mob/living/carbon/human/H = owner + if(!isslimeperson(H)) + return + + var/datum/species/jelly/slime/SS = H.dna.species + + var/list/data = list() + data["bodies"] = list() + for(var/b in SS.bodies) + var/mob/living/carbon/human/body = b + if(!body || QDELETED(body) || !isslimeperson(body)) + SS.bodies -= b + continue + + var/list/L = list() + // HTML colors need a # prefix + L["htmlcolor"] = "#[body.dna.features["mcolor"]]" + L["area"] = get_area_name(body, TRUE) + var/stat = "error" + switch(body.stat) + if(CONSCIOUS) + stat = "Conscious" + if(UNCONSCIOUS) + stat = "Unconscious" + if(DEAD) + stat = "Dead" + var/occupied + if(body == H) + occupied = "owner" + else if(body.mind && body.mind.active) + occupied = "stranger" + else + occupied = "available" + + L["status"] = stat + L["exoticblood"] = body.blood_volume + L["name"] = body.name + L["ref"] = "[REF(body)]" + L["occupied"] = occupied + var/button + if(occupied == "owner") + button = "selected" + else if(occupied == "stranger") + button = "danger" + else if(can_swap(body)) + button = null + else + button = "disabled" + + L["swap_button_state"] = button + L["swappable"] = (occupied == "available") && can_swap(body) + + data["bodies"] += list(L) + + return data + +/datum/action/innate/swap_body/ui_act(action, params) + if(..()) + return + var/mob/living/carbon/human/H = owner + if(!isslimeperson(owner)) + return + if(!H.mind || !H.mind.active) + return + switch(action) + if("swap") + var/mob/living/carbon/human/selected = locate(params["ref"]) + if(!can_swap(selected)) + return + SStgui.close_uis(src) + swap_to_dupe(H.mind, selected) + +/datum/action/innate/swap_body/proc/can_swap(mob/living/carbon/human/dupe) + var/mob/living/carbon/human/H = owner + if(!isslimeperson(H)) + return FALSE + var/datum/species/jelly/slime/SS = H.dna.species + + if(QDELETED(dupe)) //Is there a body? + SS.bodies -= dupe + return FALSE + + if(!isslimeperson(dupe)) //Is it a slimeperson? + SS.bodies -= dupe + return FALSE + + if(dupe.stat == DEAD) //Is it alive? + return FALSE + + if(dupe.stat != CONSCIOUS) //Is it awake? + return FALSE + + if(dupe.mind && dupe.mind.active) //Is it unoccupied? + return FALSE + + if(!(dupe in SS.bodies)) //Do we actually own it? + return FALSE + + return TRUE + +/datum/action/innate/swap_body/proc/swap_to_dupe(datum/mind/M, mob/living/carbon/human/dupe) + if(!can_swap(dupe)) //sanity check + return + if(M.current.stat == CONSCIOUS) + M.current.visible_message("[M.current] \ + stops moving and starts staring vacantly into space.", + "You stop moving this body...") + else + to_chat(M.current, "You abandon this body...") + M.current.transfer_trait_datums(dupe) + M.transfer_to(dupe) + dupe.visible_message("[dupe] blinks and looks \ + around.", + "...and move this one instead.") + + +///////////////////////////////////LUMINESCENTS////////////////////////////////////////// + +//Luminescents are able to consume and use slime extracts, without them decaying. + +/datum/species/jelly/luminescent + name = "Luminescent" + id = "lum" + say_mod = "says" + var/glow_intensity = LUMINESCENT_DEFAULT_GLOW + var/obj/effect/dummy/luminescent_glow/glow + var/obj/item/slime_extract/current_extract + var/datum/action/innate/integrate_extract/integrate_extract + var/datum/action/innate/use_extract/extract_minor + var/datum/action/innate/use_extract/major/extract_major + var/extract_cooldown = 0 + +/datum/species/jelly/luminescent/on_species_loss(mob/living/carbon/C) + ..() + if(current_extract) + current_extract.forceMove(C.drop_location()) + current_extract = null + qdel(glow) + if(integrate_extract) + integrate_extract.Remove(C) + if(extract_minor) + extract_minor.Remove(C) + if(extract_major) + extract_major.Remove(C) + +/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + glow = new(C) + update_glow(C) + integrate_extract = new(src) + integrate_extract.Grant(C) + extract_minor = new(src) + extract_minor.Grant(C) + extract_major = new(src) + extract_major.Grant(C) + +/datum/species/jelly/luminescent/proc/update_slime_actions() + integrate_extract.update_name() + integrate_extract.UpdateButtonIcon() + extract_minor.UpdateButtonIcon() + extract_major.UpdateButtonIcon() + +/datum/species/jelly/luminescent/proc/update_glow(mob/living/carbon/C, intensity) + if(intensity) + glow_intensity = intensity + glow.set_light(glow_intensity, glow_intensity, C.dna.features["mcolor"]) + +/obj/effect/dummy/luminescent_glow + name = "luminescent glow" + desc = "Tell a coder if you're seeing this." + icon_state = "nothing" + light_color = "#FFFFFF" + light_range = LUMINESCENT_DEFAULT_GLOW + +/obj/effect/dummy/luminescent_glow/Initialize() + . = ..() + if(!isliving(loc)) + return INITIALIZE_HINT_QDEL + +/datum/action/innate/integrate_extract + name = "Integrate Extract" + desc = "Eat a slime extract to use its properties." + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "slimeconsume" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + var/datum/species/jelly/luminescent/species + +/datum/action/innate/integrate_extract/New(_species) + ..() + species = _species + +/datum/action/innate/integrate_extract/proc/update_name() + if(!species || !species.current_extract) + name = "Integrate Extract" + desc = "Eat a slime extract to use its properties." + else + name = "Eject Extract" + desc = "Eject your current slime extract." + +/datum/action/innate/integrate_extract/UpdateButtonIcon(status_only, force) + if(!species || !species.current_extract) + button_icon_state = "slimeconsume" + else + button_icon_state = "slimeeject" + ..() + +/datum/action/innate/integrate_extract/ApplyIcon(obj/screen/movable/action_button/current_button, force) + ..(current_button, TRUE) + if(species && species.current_extract) + current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state)) + +/datum/action/innate/integrate_extract/Activate() + var/mob/living/carbon/human/H = owner + if(!is_species(H, /datum/species/jelly/luminescent) || !species) + return + CHECK_DNA_AND_SPECIES(H) + + if(species.current_extract) + var/obj/item/slime_extract/S = species.current_extract + if(!H.put_in_active_hand(S)) + S.forceMove(H.drop_location()) + species.current_extract = null + to_chat(H, "You eject [S].") + species.update_slime_actions() + else + var/obj/item/I = H.get_active_held_item() + if(istype(I, /obj/item/slime_extract)) + var/obj/item/slime_extract/S = I + if(!S.Uses) + to_chat(H, "[I] is spent! You cannot integrate it.") + return + if(!H.temporarilyRemoveItemFromInventory(S)) + return + S.forceMove(H) + species.current_extract = S + to_chat(H, "You consume [I], and you feel it pulse within you...") + species.update_slime_actions() + else + to_chat(H, "You need to hold an unused slime extract in your active hand!") + +/datum/action/innate/use_extract + name = "Extract Minor Activation" + desc = "Pulse the slime extract with energized jelly to activate it." + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "slimeuse1" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + var/activation_type = SLIME_ACTIVATE_MINOR + var/datum/species/jelly/luminescent/species + +/datum/action/innate/use_extract/New(_species) + ..() + species = _species + +/datum/action/innate/use_extract/IsAvailable() + if(..()) + if(species && species.current_extract && (world.time > species.extract_cooldown)) + return TRUE + return FALSE + +/datum/action/innate/use_extract/ApplyIcon(obj/screen/movable/action_button/current_button, force) + ..(current_button, TRUE) + if(species && species.current_extract) + current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state)) + +/datum/action/innate/use_extract/Activate() + var/mob/living/carbon/human/H = owner + if(!is_species(H, /datum/species/jelly/luminescent) || !species) + return + CHECK_DNA_AND_SPECIES(H) + + if(species.current_extract) + species.extract_cooldown = world.time + 100 + var/cooldown = species.current_extract.activate(H, species, activation_type) + species.extract_cooldown = world.time + cooldown + +/datum/action/innate/use_extract/major + name = "Extract Major Activation" + desc = "Pulse the slime extract with plasma jelly to activate it." + button_icon_state = "slimeuse2" + activation_type = SLIME_ACTIVATE_MAJOR + +///////////////////////////////////STARGAZERS////////////////////////////////////////// + +//Stargazers are the telepathic branch of jellypeople, able to project psychic messages and to link minds with willing participants. + +/datum/species/jelly/stargazer + name = "Stargazer" + id = "stargazer" + var/datum/action/innate/project_thought/project_thought + var/datum/action/innate/link_minds/link_minds + var/list/mob/living/linked_mobs = list() + var/list/datum/action/innate/linked_speech/linked_actions = list() + var/mob/living/carbon/human/slimelink_owner + var/current_link_id = 0 + +/datum/species/jelly/stargazer/on_species_loss(mob/living/carbon/C) + ..() + for(var/M in linked_mobs) + unlink_mob(M) + if(project_thought) + project_thought.Remove(C) + if(link_minds) + link_minds.Remove(C) + +/datum/species/jelly/stargazer/spec_death(gibbed, mob/living/carbon/human/H) + ..() + for(var/M in linked_mobs) + unlink_mob(M) + +/datum/species/jelly/stargazer/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + project_thought = new(src) + project_thought.Grant(C) + link_minds = new(src) + link_minds.Grant(C) + slimelink_owner = C + link_mob(C) + +/datum/species/jelly/stargazer/proc/link_mob(mob/living/M) + if(QDELETED(M) || M.stat == DEAD) + return FALSE + if(HAS_TRAIT(M, TRAIT_MINDSHIELD)) //mindshield implant, no dice + return FALSE + if(M in linked_mobs) + return FALSE + linked_mobs.Add(M) + to_chat(M, "You are now connected to [slimelink_owner.real_name]'s Slime Link.") + var/datum/action/innate/linked_speech/action = new(src) + linked_actions.Add(action) + action.Grant(M) + return TRUE + +/datum/species/jelly/stargazer/proc/unlink_mob(mob/living/M) + var/link_id = linked_mobs.Find(M) + if(!(link_id)) + return + var/datum/action/innate/linked_speech/action = linked_actions[link_id] + action.Remove(M) + to_chat(M, "You are no longer connected to [slimelink_owner.real_name]'s Slime Link.") + linked_mobs[link_id] = null + linked_actions[link_id] = null + +/datum/action/innate/linked_speech + name = "Slimelink" + desc = "Send a psychic message to everyone connected to your slime link." + button_icon_state = "link_speech" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + var/datum/species/jelly/stargazer/species + +/datum/action/innate/linked_speech/New(_species) + ..() + species = _species + +/datum/action/innate/linked_speech/Activate() + var/mob/living/carbon/human/H = owner + if(!species || !(H in species.linked_mobs)) + to_chat(H, "The link seems to have been severed...") + Remove(H) + return + + var/message = sanitize(input("Message:", "Slime Telepathy") as text|null) + + if(!species || !(H in species.linked_mobs)) + to_chat(H, "The link seems to have been severed...") + Remove(H) + return + + if(QDELETED(H) || H.stat == DEAD) + species.unlink_mob(H) + return + + if(message) + var/msg = "\[[species.slimelink_owner.real_name]'s Slime Link\] [H]: [message]" + log_directed_talk(H, species.slimelink_owner, msg, LOG_SAY, "slime link") + for(var/X in species.linked_mobs) + var/mob/living/M = X + if(QDELETED(M) || M.stat == DEAD) + species.unlink_mob(M) + continue + to_chat(M, msg) + + for(var/X in GLOB.dead_mob_list) + var/mob/M = X + var/link = FOLLOW_LINK(M, H) + to_chat(M, "[link] [msg]") + +/datum/action/innate/project_thought + name = "Send Thought" + desc = "Send a private psychic message to someone you can see." + button_icon_state = "send_mind" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + +/datum/action/innate/project_thought/Activate() + var/mob/living/carbon/human/H = owner + if(H.stat == DEAD) + return + if(!is_species(H, /datum/species/jelly/stargazer)) + return + CHECK_DNA_AND_SPECIES(H) + + var/list/options = list() + for(var/mob/living/Ms in oview(H)) + options += Ms + var/mob/living/M = input("Select who to send your message to:","Send thought to?",null) as null|mob in options + if(!M) + return + + var/msg = sanitize(input("Message:", "Telepathy") as text|null) + if(msg) + log_directed_talk(H, M, msg, LOG_SAY, "slime telepathy") + to_chat(M, "You hear an alien voice in your head... [msg]") + to_chat(H, "You telepathically said: \"[msg]\" to [M]") + for(var/dead in GLOB.dead_mob_list) + if(!isobserver(dead)) + continue + var/follow_link_user = FOLLOW_LINK(dead, H) + var/follow_link_target = FOLLOW_LINK(dead, M) + to_chat(dead, "[follow_link_user] [H] Slime Telepathy --> [follow_link_target] [M] [msg]") + +/datum/action/innate/link_minds + name = "Link Minds" + desc = "Link someone's mind to your Slime Link, allowing them to communicate telepathically with other linked minds." + button_icon_state = "mindlink" + icon_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" + var/datum/species/jelly/stargazer/species + +/datum/action/innate/link_minds/New(_species) + ..() + species = _species + +/datum/action/innate/link_minds/Activate() + var/mob/living/carbon/human/H = owner + if(!is_species(H, /datum/species/jelly/stargazer)) + return + CHECK_DNA_AND_SPECIES(H) + + if(!H.pulling || !isliving(H.pulling) || H.grab_state < GRAB_AGGRESSIVE) + to_chat(H, "You need to aggressively grab someone to link minds!") + return + + var/mob/living/target = H.pulling + + to_chat(H, "You begin linking [target]'s mind to yours...") + to_chat(target, "You feel a foreign presence within your mind...") + if(do_after(H, 60, target = target)) + if(H.pulling != target || H.grab_state < GRAB_AGGRESSIVE) + return + if(species.link_mob(target)) + to_chat(H, "You connect [target]'s mind to your slime link!") + else + to_chat(H, "You can't seem to link [target]'s mind...") + to_chat(target, "The foreign presence leaves your mind.") diff --git a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm index 7be0265c..228661e1 100644 --- a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm @@ -47,9 +47,9 @@ QDEL_NULL(mush) /datum/species/mush/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "weedkiller") + if(chem.type == /datum/reagent/toxin/plantbgone/weedkiller) H.adjustToxLoss(3) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) return TRUE /datum/species/mush/handle_mutant_bodyparts(mob/living/carbon/human/H, forced_colour) diff --git a/code/modules/mob/living/carbon/human/species_types/podpeople.dm b/code/modules/mob/living/carbon/human/species_types/podpeople.dm index fbe18a6c..dcf26b70 100644 --- a/code/modules/mob/living/carbon/human/species_types/podpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/podpeople.dm @@ -47,9 +47,9 @@ H.take_overall_damage(2,0) /datum/species/pod/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "plantbgone") + if(chem.type == /datum/reagent/toxin/plantbgone) H.adjustToxLoss(3) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) return 1 /datum/species/pod/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) diff --git a/code/modules/mob/living/carbon/human/species_types/synths.dm b/code/modules/mob/living/carbon/human/species_types/synths.dm index 1d0370c7..703fffa4 100644 --- a/code/modules/mob/living/carbon/human/species_types/synths.dm +++ b/code/modules/mob/living/carbon/human/species_types/synths.dm @@ -1,129 +1,129 @@ -/datum/species/synth - name = "Synth" //inherited from the real species, for health scanners and things - id = "synth" - say_mod = "beep boops" //inherited from a user's real species - sexes = 0 - species_traits = list(NOTRANSSTING,NOGENITALS,NOAROUSAL) //all of these + whatever we inherit from the real species - inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOHUNGER,TRAIT_NOBREATH) - inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID) - dangerous_existence = 1 - blacklisted = 1 - meat = null - gib_types = /obj/effect/gibspawner/robot - damage_overlay_type = "synth" - limbs_id = "synth" - var/list/initial_species_traits = list(NOTRANSSTING) //for getting these values back for assume_disguise() - var/list/initial_inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOHUNGER,TRAIT_NOLIMBDISABLE,TRAIT_NOBREATH) - var/disguise_fail_health = 75 //When their health gets to this level their synthflesh partially falls off - var/datum/species/fake_species = null //a species to do most of our work for us, unless we're damaged - -/datum/species/synth/military - name = "Military Synth" - id = "military_synth" - armor = 25 - punchdamagelow = 10 - punchdamagehigh = 19 - punchstunthreshold = 14 //about 50% chance to stun - disguise_fail_health = 50 - -/datum/species/synth/on_species_gain(mob/living/carbon/human/H, datum/species/old_species) - ..() - assume_disguise(old_species, H) - RegisterSignal(H, COMSIG_MOB_SAY, .proc/handle_speech) - H.grant_language(/datum/language/machine) - -/datum/species/synth/on_species_loss(mob/living/carbon/human/H) - . = ..() - UnregisterSignal(H, COMSIG_MOB_SAY) - H.remove_language(/datum/language/machine) - -/datum/species/synth/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "synthflesh") - chem.reaction_mob(H, TOUCH, 2 ,0) //heal a little - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - return 1 - else - return ..() - - -/datum/species/synth/proc/assume_disguise(datum/species/S, mob/living/carbon/human/H) - if(S && !istype(S, type)) - name = S.name - say_mod = S.say_mod - sexes = S.sexes - species_traits = initial_species_traits.Copy() - inherent_traits = initial_inherent_traits.Copy() - species_traits |= S.species_traits - inherent_traits |= S.inherent_traits - attack_verb = S.attack_verb - attack_sound = S.attack_sound - miss_sound = S.miss_sound - meat = S.meat - mutant_bodyparts = S.mutant_bodyparts.Copy() - mutant_organs = S.mutant_organs.Copy() - default_features = S.default_features.Copy() - nojumpsuit = S.nojumpsuit - no_equip = S.no_equip.Copy() - limbs_id = S.limbs_id - use_skintones = S.use_skintones - fixed_mut_color = S.fixed_mut_color - hair_color = S.hair_color - fake_species = new S.type - else - name = initial(name) - say_mod = initial(say_mod) - species_traits = initial_species_traits.Copy() - inherent_traits = initial_inherent_traits.Copy() - attack_verb = initial(attack_verb) - attack_sound = initial(attack_sound) - miss_sound = initial(miss_sound) - mutant_bodyparts = list() - default_features = list() - nojumpsuit = initial(nojumpsuit) - no_equip = list() - qdel(fake_species) - fake_species = null - meat = initial(meat) - limbs_id = "synth" - use_skintones = 0 - sexes = 0 - fixed_mut_color = "" - hair_color = "" - - for(var/X in H.bodyparts) //propagates the damage_overlay changes - var/obj/item/bodypart/BP = X - BP.update_limb() - H.update_body_parts() //to update limb icon cache with the new damage overlays - -//Proc redirects: -//Passing procs onto the fake_species, to ensure we look as much like them as possible - -/datum/species/synth/handle_hair(mob/living/carbon/human/H, forced_colour) - if(fake_species) - fake_species.handle_hair(H, forced_colour) - else - return ..() - - -/datum/species/synth/handle_body(mob/living/carbon/human/H) - if(fake_species) - fake_species.handle_body(H) - else - return ..() - - -/datum/species/synth/handle_mutant_bodyparts(mob/living/carbon/human/H, forced_colour) - if(fake_species) - fake_species.handle_body(H,forced_colour) - else - return ..() - -/datum/species/synth/proc/handle_speech(datum/source, list/speech_args) - if (isliving(source)) // yeah it's gonna be living but just to be clean - var/mob/living/L = source - if(fake_species && L.health > disguise_fail_health) - switch (fake_species.type) - if (/datum/species/golem/bananium) - speech_args[SPEECH_SPANS] |= SPAN_CLOWN - if (/datum/species/golem/clockwork) - speech_args[SPEECH_SPANS] |= SPAN_ROBOT +/datum/species/synth + name = "Synth" //inherited from the real species, for health scanners and things + id = "synth" + say_mod = "beep boops" //inherited from a user's real species + sexes = 0 + species_traits = list(NOTRANSSTING,NOGENITALS,NOAROUSAL) //all of these + whatever we inherit from the real species + inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOHUNGER,TRAIT_NOBREATH) + inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID) + dangerous_existence = 1 + blacklisted = 1 + meat = null + gib_types = /obj/effect/gibspawner/robot + damage_overlay_type = "synth" + limbs_id = "synth" + var/list/initial_species_traits = list(NOTRANSSTING) //for getting these values back for assume_disguise() + var/list/initial_inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOHUNGER,TRAIT_NOLIMBDISABLE,TRAIT_NOBREATH) + var/disguise_fail_health = 75 //When their health gets to this level their synthflesh partially falls off + var/datum/species/fake_species = null //a species to do most of our work for us, unless we're damaged + +/datum/species/synth/military + name = "Military Synth" + id = "military_synth" + armor = 25 + punchdamagelow = 10 + punchdamagehigh = 19 + punchstunthreshold = 14 //about 50% chance to stun + disguise_fail_health = 50 + +/datum/species/synth/on_species_gain(mob/living/carbon/human/H, datum/species/old_species) + ..() + assume_disguise(old_species, H) + RegisterSignal(H, COMSIG_MOB_SAY, .proc/handle_speech) + H.grant_language(/datum/language/machine) + +/datum/species/synth/on_species_loss(mob/living/carbon/human/H) + . = ..() + UnregisterSignal(H, COMSIG_MOB_SAY) + H.remove_language(/datum/language/machine) + +/datum/species/synth/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(chem.type == /datum/reagent/medicine/synthflesh) + chem.reaction_mob(H, TOUCH, 2 ,0) //heal a little + H.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM) + return 1 + else + return ..() + + +/datum/species/synth/proc/assume_disguise(datum/species/S, mob/living/carbon/human/H) + if(S && !istype(S, type)) + name = S.name + say_mod = S.say_mod + sexes = S.sexes + species_traits = initial_species_traits.Copy() + inherent_traits = initial_inherent_traits.Copy() + species_traits |= S.species_traits + inherent_traits |= S.inherent_traits + attack_verb = S.attack_verb + attack_sound = S.attack_sound + miss_sound = S.miss_sound + meat = S.meat + mutant_bodyparts = S.mutant_bodyparts.Copy() + mutant_organs = S.mutant_organs.Copy() + default_features = S.default_features.Copy() + nojumpsuit = S.nojumpsuit + no_equip = S.no_equip.Copy() + limbs_id = S.limbs_id + use_skintones = S.use_skintones + fixed_mut_color = S.fixed_mut_color + hair_color = S.hair_color + fake_species = new S.type + else + name = initial(name) + say_mod = initial(say_mod) + species_traits = initial_species_traits.Copy() + inherent_traits = initial_inherent_traits.Copy() + attack_verb = initial(attack_verb) + attack_sound = initial(attack_sound) + miss_sound = initial(miss_sound) + mutant_bodyparts = list() + default_features = list() + nojumpsuit = initial(nojumpsuit) + no_equip = list() + qdel(fake_species) + fake_species = null + meat = initial(meat) + limbs_id = "synth" + use_skintones = 0 + sexes = 0 + fixed_mut_color = "" + hair_color = "" + + for(var/X in H.bodyparts) //propagates the damage_overlay changes + var/obj/item/bodypart/BP = X + BP.update_limb() + H.update_body_parts() //to update limb icon cache with the new damage overlays + +//Proc redirects: +//Passing procs onto the fake_species, to ensure we look as much like them as possible + +/datum/species/synth/handle_hair(mob/living/carbon/human/H, forced_colour) + if(fake_species) + fake_species.handle_hair(H, forced_colour) + else + return ..() + + +/datum/species/synth/handle_body(mob/living/carbon/human/H) + if(fake_species) + fake_species.handle_body(H) + else + return ..() + + +/datum/species/synth/handle_mutant_bodyparts(mob/living/carbon/human/H, forced_colour) + if(fake_species) + fake_species.handle_body(H,forced_colour) + else + return ..() + +/datum/species/synth/proc/handle_speech(datum/source, list/speech_args) + if (isliving(source)) // yeah it's gonna be living but just to be clean + var/mob/living/L = source + if(fake_species && L.health > disguise_fail_health) + switch (fake_species.type) + if (/datum/species/golem/bananium) + speech_args[SPEECH_SPANS] |= SPAN_CLOWN + if (/datum/species/golem/clockwork) + speech_args[SPEECH_SPANS] |= SPAN_ROBOT diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 26559b3d..56858582 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -1,773 +1,773 @@ -/mob/living/carbon/Life() - set invisibility = 0 - - //Hyper Change - if(size_multiplier != previous_size) - sleep(1) - resize(size_multiplier) - - if(notransform) - return - - if(damageoverlaytemp) - damageoverlaytemp = 0 - update_damage_hud() - - - if(!IsInStasis()) - //Reagent processing needs to come before breathing, to prevent edge cases. - handle_organs() - - . = ..() - - if (QDELETED(src)) - return - - if(.) //not dead - handle_blood() - - if(stat != DEAD) - var/bprv = handle_bodyparts() - if(bprv & BODYPART_LIFE_UPDATE_HEALTH) - updatehealth() - update_stamina() - - if(stat != DEAD) - handle_brain_damage() -/* Bug cause? - if(stat != DEAD) - handle_liver() -*/ - if(stat == DEAD) - stop_sound_channel(CHANNEL_HEARTBEAT) - handle_death() - rot() - - //Updates the number of stored chemicals for powers - handle_changeling() - - if(stat != DEAD) - return 1 - -//Procs called while dead -/mob/living/carbon/proc/handle_death() - for(var/datum/reagent/R in reagents.reagent_list) - if(R.chemical_flags & REAGENT_DEAD_PROCESS) - R.on_mob_dead(src) - -/////////////// -// BREATHING // -/////////////// - -//Start of a breath chain, calls breathe() -/mob/living/carbon/handle_breathing(times_fired) - var/next_breath = 4 - var/obj/item/organ/lungs/L = getorganslot(ORGAN_SLOT_LUNGS) - var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART) - if(L) - if(L.damage > L.high_threshold) - next_breath-- - if(H) - if(H.damage > H.high_threshold) - next_breath-- - - if((times_fired % next_breath) == 0 || failed_last_breath) - breathe() //Breathe per 4 ticks if healthy, down to 2 if our lungs or heart are damaged, unless suffocating - if(failed_last_breath) - var/mob/living/carbon/human/B = src - if(HAS_TRAIT(B, TRAIT_CHOKE_SLUT)) - B.adjustArousalLoss(7) - if (B.getArousalLoss() >= 100 && ishuman(B) && B.has_dna()) - B.mob_climax(forced_climax=TRUE) - else - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) - else - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation") - else - if(istype(loc, /obj/)) - var/obj/location_as_object = loc - location_as_object.handle_internal_lifeform(src,0) - -//Second link in a breath chain, calls check_breath() -/mob/living/carbon/proc/breathe() - var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS) - if(reagents.has_reagent("lexorin")) - return - if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell)) - return - if(istype(loc, /obj/item/dogborg/sleeper)) - return - if(ismob(loc)) - return - if(isbelly(loc)) - return - - var/datum/gas_mixture/environment - if(loc) - environment = loc.return_air() - - var/datum/gas_mixture/breath - - if(!getorganslot(ORGAN_SLOT_BREATHING_TUBE)) - if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL) || lungs.organ_flags & ORGAN_FAILING) - losebreath++ //You can't breath at all when in critical or when being choked, so you're going to miss a breath - - else if(health <= crit_threshold) - losebreath += 0.25 //You're having trouble breathing in soft crit, so you'll miss a breath one in four times - - //Suffocate - if(losebreath >= 1) //You've missed a breath, take oxy damage - losebreath-- - if(prob(10)) - emote("gasp") - if(istype(loc, /obj/)) - var/obj/loc_as_obj = loc - loc_as_obj.handle_internal_lifeform(src,0) - else - //Breathe from internal - breath = get_breath_from_internal(BREATH_VOLUME) - - if(isnull(breath)) //in case of 0 pressure internals - - if(isobj(loc)) //Breathe from loc as object - var/obj/loc_as_obj = loc - breath = loc_as_obj.handle_internal_lifeform(src, BREATH_VOLUME) - - else if(isturf(loc)) //Breathe from loc as turf - var/breath_moles = 0 - if(environment) - breath_moles = environment.total_moles()*BREATH_PERCENTAGE - - breath = loc.remove_air(breath_moles) - else //Breathe from loc as obj again - if(istype(loc, /obj/)) - var/obj/loc_as_obj = loc - loc_as_obj.handle_internal_lifeform(src,0) - - check_breath(breath) - - if(breath) - loc.assume_air(breath) - air_update_turf() - -/mob/living/carbon/proc/has_smoke_protection() - if(HAS_TRAIT(src, TRAIT_NOBREATH)) - return TRUE - return FALSE - - -//Third link in a breath chain, calls handle_breath_temperature() -/mob/living/carbon/proc/check_breath(datum/gas_mixture/breath) - if((status_flags & GODMODE)) - return - - var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS) - if(!lungs) - adjustOxyLoss(2) - - //CRIT - if(!breath || (breath.total_moles() == 0) || !lungs) - if(reagents.has_reagent("epinephrine") && lungs) - return - adjustOxyLoss(1) - - failed_last_breath = 1 - throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) - return 0 - - var/safe_oxy_min = 16 - var/safe_oxy_max = 50 - var/safe_co2_max = 10 - var/safe_tox_max = 0.05 - var/SA_para_min = 1 - var/SA_sleep_min = 5 - var/oxygen_used = 0 - var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME - - var/list/breath_gases = breath.gases - var/O2_partialpressure = (breath_gases[/datum/gas/oxygen]/breath.total_moles())*breath_pressure - var/Toxins_partialpressure = (breath_gases[/datum/gas/plasma]/breath.total_moles())*breath_pressure - var/CO2_partialpressure = (breath_gases[/datum/gas/carbon_dioxide]/breath.total_moles())*breath_pressure - - - //OXYGEN - if(O2_partialpressure > safe_oxy_max) // Too much Oxygen - blatant CO2 effect copy/pasta - if(!o2overloadtime) - o2overloadtime = world.time - else if(world.time - o2overloadtime > 120) - Dizzy(10) // better than a minute of you're fucked KO, but certainly a wake up call. Honk. - adjustOxyLoss(3) - if(world.time - o2overloadtime > 300) - adjustOxyLoss(8) - if(prob(20)) - emote("cough") - throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) - - if(O2_partialpressure < safe_oxy_min) //Not enough oxygen - if(prob(20)) - emote("gasp") - if(O2_partialpressure > 0) - var/ratio = 1 - O2_partialpressure/safe_oxy_min - adjustOxyLoss(min(5*ratio, 3)) - failed_last_breath = 1 - oxygen_used = breath_gases[/datum/gas/oxygen]*ratio - else - adjustOxyLoss(3) - failed_last_breath = 1 - throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) - - else //Enough oxygen - failed_last_breath = 0 - o2overloadtime = 0 //reset our counter for this too - if(health >= crit_threshold) - adjustOxyLoss(-5) - oxygen_used = breath_gases[/datum/gas/oxygen] - clear_alert("not_enough_oxy") - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation") - - breath_gases[/datum/gas/oxygen] -= oxygen_used - breath_gases[/datum/gas/carbon_dioxide] += oxygen_used - - //CARBON DIOXIDE - if(CO2_partialpressure > safe_co2_max) - if(!co2overloadtime) - co2overloadtime = world.time - else if(world.time - co2overloadtime > 120) - Unconscious(60) - adjustOxyLoss(3) - if(world.time - co2overloadtime > 300) - adjustOxyLoss(8) - if(prob(20)) - emote("cough") - - else - co2overloadtime = 0 - - //TOXINS/PLASMA - if(Toxins_partialpressure > safe_tox_max) - var/ratio = (breath_gases[/datum/gas/plasma]/safe_tox_max) * 10 - adjustToxLoss(CLAMP(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE)) - throw_alert("too_much_tox", /obj/screen/alert/too_much_tox) - else - clear_alert("too_much_tox") - - //NITROUS OXIDE - if(breath_gases[/datum/gas/nitrous_oxide]) - var/SA_partialpressure = (breath_gases[/datum/gas/nitrous_oxide]/breath.total_moles())*breath_pressure - if(SA_partialpressure > SA_para_min) - Unconscious(60) - if(SA_partialpressure > SA_sleep_min) - Sleeping(max(AmountSleeping() + 40, 200)) - else if(SA_partialpressure > 0.01) - if(prob(20)) - emote(pick("giggle","laugh")) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "chemical_euphoria", /datum/mood_event/chemical_euphoria) - else - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") - - //BZ (Facepunch port of their Agent B) - if(breath_gases[/datum/gas/bz]) - var/bz_partialpressure = (breath_gases[/datum/gas/bz]/breath.total_moles())*breath_pressure - if(bz_partialpressure > 1) - hallucination += 10 - else if(bz_partialpressure > 0.01) - hallucination += 5 - - //TRITIUM - if(breath_gases[/datum/gas/tritium]) - var/tritium_partialpressure = (breath_gases[/datum/gas/tritium]/breath.total_moles())*breath_pressure - radiation += tritium_partialpressure/10 - - //NITRYL - if(breath_gases[/datum/gas/nitryl]) - var/nitryl_partialpressure = (breath_gases[/datum/gas/nitryl]/breath.total_moles())*breath_pressure - adjustFireLoss(nitryl_partialpressure/4) - - //MIASMA - if(breath_gases[/datum/gas/miasma]) - var/miasma_partialpressure = (breath_gases[/datum/gas/miasma]/breath.total_moles())*breath_pressure - if(miasma_partialpressure > MINIMUM_MOLES_DELTA_TO_MOVE) - - if(prob(0.05 * miasma_partialpressure)) - var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(2,3) - miasma_disease.name = "Unknown" - ForceContractDisease(miasma_disease, TRUE, TRUE) - - //Miasma side effects - switch(miasma_partialpressure) - if(1 to 5) - // At lower pp, give out a little warning - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell") - if(prob(5)) - to_chat(src, "There is an unpleasant smell in the air.") - if(5 to 20) - //At somewhat higher pp, warning becomes more obvious - if(prob(15)) - to_chat(src, "You smell something horribly decayed inside this room.") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/bad_smell) - if(15 to 30) - //Small chance to vomit. By now, people have internals on anyway - if(prob(5)) - to_chat(src, "The stench of rotting carcasses is unbearable!") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/nauseating_stench) - vomit() - if(30 to INFINITY) - //Higher chance to vomit. Let the horror start - if(prob(25)) - to_chat(src, "The stench of rotting carcasses is unbearable!") - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/nauseating_stench) - vomit() - else - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell") - - - //Clear all moods if no miasma at all - else - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell") - - - - - GAS_GARBAGE_COLLECT(breath.gases) - - //BREATH TEMPERATURE - handle_breath_temperature(breath) - - return 1 - -//Fourth and final link in a breath chain -/mob/living/carbon/proc/handle_breath_temperature(datum/gas_mixture/breath) - return - -/mob/living/carbon/proc/get_breath_from_internal(volume_needed) - var/obj/item/clothing/check - var/internals = FALSE - - for(check in GET_INTERNAL_SLOTS(src)) - if(CHECK_BITFIELD(check.clothing_flags, ALLOWINTERNALS)) - internals = TRUE - if(internal) - if(internal.loc != src) - internal = null - update_internals_hud_icon(0) - else if (!internals && !getorganslot(ORGAN_SLOT_BREATHING_TUBE)) - internal = null - update_internals_hud_icon(0) - else - update_internals_hud_icon(1) - . = internal.remove_air_volume(volume_needed) - if(!.) - return FALSE //to differentiate between no internals and active, but empty internals - -// Make corpses rot, emitting miasma -/mob/living/carbon/proc/rot() - // Properly stored corpses shouldn't create miasma - if(istype(loc, /obj/structure/closet/crate/coffin)|| istype(loc, /obj/structure/closet/body_bag) || istype(loc, /obj/structure/bodycontainer)) - return - - // No decay if formaldehyde in corpse or when the corpse is charred - if(reagents.has_reagent("formaldehyde", 15) || HAS_TRAIT(src, TRAIT_HUSK)) - return - - // Also no decay if corpse chilled or not organic/undead - if(bodytemperature <= T0C-10 || (!(MOB_ORGANIC in mob_biotypes) && !(MOB_UNDEAD in mob_biotypes))) - return - - // Wait a bit before decaying - if(world.time - timeofdeath < 1200) - return - - var/deceasedturf = get_turf(src) - - // Closed turfs don't have any air in them, so no gas building up - if(!istype(deceasedturf,/turf/open)) - return - - var/turf/open/miasma_turf = deceasedturf - - var/list/cached_gases = miasma_turf.air.gases - - cached_gases[/datum/gas/miasma] += 0.1 - -/mob/living/carbon/proc/handle_blood() - return - -/mob/living/carbon/proc/handle_bodyparts() - for(var/I in bodyparts) - var/obj/item/bodypart/BP = I - if(BP.needs_processing) - . |= BP.on_life() - -/mob/living/carbon/proc/handle_organs() - if(stat != DEAD) - for(var/V in internal_organs) - var/obj/item/organ/O = V - if(O) - O.on_life() - else - if(reagents.has_reagent("formaldehyde", 1)) // No organ decay if the body contains formaldehyde. - return - for(var/V in internal_organs) - var/obj/item/organ/O = V - if(O) - O.on_death() //Needed so organs decay while inside the body. - - - -/mob/living/carbon/handle_diseases() - for(var/thing in diseases) - var/datum/disease/D = thing - if(prob(D.infectivity)) - D.spread() - - if(stat != DEAD || D.process_dead) - D.stage_act() - -//todo generalize this and move hud out -/mob/living/carbon/proc/handle_changeling() - if(mind && hud_used && hud_used.lingchemdisplay) - var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling) - changeling.regenerate() - hud_used.lingchemdisplay.invisibility = 0 - hud_used.lingchemdisplay.maptext = "
    [round(changeling.chem_charges)]
    " - else - hud_used.lingchemdisplay.invisibility = INVISIBILITY_ABSTRACT - - -/mob/living/carbon/handle_mutations_and_radiation() - if(dna && dna.temporary_mutations.len) - for(var/mut in dna.temporary_mutations) - if(dna.temporary_mutations[mut] < world.time) - if(mut == UI_CHANGED) - if(dna.previous["UI"]) - dna.uni_identity = merge_text(dna.uni_identity,dna.previous["UI"]) - updateappearance(mutations_overlay_update=1) - dna.previous.Remove("UI") - dna.temporary_mutations.Remove(mut) - continue - if(mut == UE_CHANGED) - if(dna.previous["name"]) - real_name = dna.previous["name"] - name = real_name - dna.previous.Remove("name") - if(dna.previous["UE"]) - dna.unique_enzymes = dna.previous["UE"] - dna.previous.Remove("UE") - if(dna.previous["blood_type"]) - dna.blood_type = dna.previous["blood_type"] - dna.previous.Remove("blood_type") - dna.temporary_mutations.Remove(mut) - continue - for(var/datum/mutation/human/HM in dna.mutations) - if(HM && HM.timed) - dna.remove_mutation(HM.type) - - radiation -= min(radiation, RAD_LOSS_PER_TICK) - if(radiation > RAD_MOB_SAFE) - adjustToxLoss(log(radiation-RAD_MOB_SAFE)*RAD_TOX_COEFFICIENT) - -/mob/living/carbon/handle_stomach() - set waitfor = 0 - for(var/mob/living/M in stomach_contents) - if(M.loc != src) - stomach_contents.Remove(M) - continue - if(iscarbon(M) && stat != DEAD) - if(M.stat == DEAD) - M.death(1) - stomach_contents.Remove(M) - qdel(M) - continue - if(SSmobs.times_fired%3==1) - if(!(M.status_flags & GODMODE)) - M.adjustBruteLoss(5) - nutrition += 10 - - -/* -Alcohol Poisoning Chart -Note that all higher effects of alcohol poisoning will inherit effects for smaller amounts (i.e. light poisoning inherts from slight poisoning) -In addition, severe effects won't always trigger unless the drink is poisonously strong -All effects don't start immediately, but rather get worse over time; the rate is affected by the imbiber's alcohol tolerance - -0: Non-alcoholic -1-10: Barely classifiable as alcohol - occassional slurring -11-20: Slight alcohol content - slurring -21-30: Below average - imbiber begins to look slightly drunk -31-40: Just below average - no unique effects -41-50: Average - mild disorientation, imbiber begins to look drunk -51-60: Just above average - disorientation, vomiting, imbiber begins to look heavily drunk -61-70: Above average - small chance of blurry vision, imbiber begins to look smashed -71-80: High alcohol content - blurry vision, imbiber completely shitfaced -81-90: Extremely high alcohol content - light brain damage, passing out -91-100: Dangerously toxic - swift death -*/ -#define BALLMER_POINTS 5 -GLOBAL_LIST_INIT(ballmer_good_msg, list("Hey guys, what if we rolled out a bluespace wiring system so mice can't destroy the powergrid anymore?", - "Hear me out here. What if, and this is just a theory, we made R&D controllable from our PDAs?", - "I'm thinking we should roll out a git repository for our research under the AGPLv3 license so that we can share it among the other stations freely.", - "I dunno about you guys, but IDs and PDAs being separate is clunky as fuck. Maybe we should merge them into a chip in our arms? That way they can't be stolen easily.", - "Why the fuck aren't we just making every pair of shoes into galoshes? We have the technology.")) -GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put a webserver that's automatically turned on with default admin passwords into every PDA?", - "So like, you know how we separate our codebase from the master copy that runs on our consumer boxes? What if we merged the two and undid the separation between codebase and server?", - "Dude, radical idea: H.O.N.K mechs but with no bananium required.", - "Best idea ever: Disposal pipes instead of hallways.")) - -//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc.. -/mob/living/carbon/handle_status_effects() - ..() - if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active - adjustStaminaLoss(resting ? (recoveringstam ? -7.5 : -3) : -1.5)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke - - if(!recoveringstam && incomingstammult != 1) - incomingstammult = max(0.01, incomingstammult) - incomingstammult = min(1, incomingstammult*2) - - //CIT CHANGES START HERE. STAMINA BUFFER STUFF - if(bufferedstam && world.time > stambufferregentime) - var/drainrate = max((bufferedstam*(bufferedstam/(5)))*0.1,1) - bufferedstam = max(bufferedstam - drainrate, 0) - adjustStaminaLoss(drainrate*0.5) - //END OF CIT CHANGES - - var/restingpwr = 1 + 4 * resting - - //Dizziness - if(dizziness) - var/client/C = client - var/pixel_x_diff = 0 - var/pixel_y_diff = 0 - var/temp - var/saved_dizz = dizziness - if(C) - var/oldsrc = src - var/amplitude = dizziness*(sin(dizziness * world.time) + 1) // This shit is annoying at high strength - src = null - spawn(0) - if(C) - temp = amplitude * sin(saved_dizz * world.time) - pixel_x_diff += temp - C.pixel_x += temp - temp = amplitude * cos(saved_dizz * world.time) - pixel_y_diff += temp - C.pixel_y += temp - sleep(3) - if(C) - temp = amplitude * sin(saved_dizz * world.time) - pixel_x_diff += temp - C.pixel_x += temp - temp = amplitude * cos(saved_dizz * world.time) - pixel_y_diff += temp - C.pixel_y += temp - sleep(3) - if(C) - C.pixel_x -= pixel_x_diff - C.pixel_y -= pixel_y_diff - src = oldsrc - dizziness = max(dizziness - restingpwr, 0) - - if(drowsyness) - drowsyness = max(drowsyness - restingpwr, 0) - blur_eyes(2) - if(prob(5)) - AdjustSleeping(20) - Unconscious(100) - - //Jitteriness - if(jitteriness) - do_jitter_animation(jitteriness) - jitteriness = max(jitteriness - restingpwr, 0) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "jittery", /datum/mood_event/jittery) - else - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "jittery") - - if(stuttering) - stuttering = max(stuttering-1, 0) - - if(slurring || drunkenness) - slurring = max(slurring-1,0,drunkenness) - - if(cultslurring) - cultslurring = max(cultslurring-1, 0) - - if(silent) - silent = max(silent-1, 0) - - if(druggy) - adjust_drugginess(-1) - - if(hallucination) - handle_hallucinations() - - if(drunkenness) - drunkenness = max(drunkenness - (drunkenness * 0.04), 0) - if(drunkenness >= 6) - SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drunk) - jitteriness = max(jitteriness - 3, 0) - if(HAS_TRAIT(src, TRAIT_DRUNK_HEALING)) - adjustBruteLoss(-0.12, FALSE) - adjustFireLoss(-0.06, FALSE) - - if(mind && (mind.assigned_role == "Scientist" || mind.assigned_role == "Research Director")) - if(SSresearch.science_tech) - if(drunkenness >= 12.9 && drunkenness <= 13.8) - drunkenness = round(drunkenness, 0.01) - var/ballmer_percent = 0 - if(drunkenness == 13.35) // why run math if I dont have to - ballmer_percent = 1 - else - ballmer_percent = (-abs(drunkenness - 13.35) / 0.9) + 1 - if(prob(5)) - say(pick(GLOB.ballmer_good_msg), forced = "ballmer") - SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = BALLMER_POINTS * ballmer_percent)) - if(drunkenness > 26) // by this point you're into windows ME territory - if(prob(5)) - SSresearch.science_tech.remove_point_list(list(TECHWEB_POINT_TYPE_GENERIC = BALLMER_POINTS)) - say(pick(GLOB.ballmer_windows_me_msg), forced = "ballmer") - - if(drunkenness >= 41) - if(prob(25)) - confused += 2 - Dizzy(10) - if(HAS_TRAIT(src, TRAIT_DRUNK_HEALING)) // effects stack with lower tiers - adjustBruteLoss(-0.3, FALSE) - adjustFireLoss(-0.15, FALSE) - - if(drunkenness >= 51) - if(prob(5)) - confused += 10 - vomit() - Dizzy(25) - - if(drunkenness >= 61) - if(prob(50)) - blur_eyes(5) - if(HAS_TRAIT(src, TRAIT_DRUNK_HEALING)) - adjustBruteLoss(-0.4, FALSE) - adjustFireLoss(-0.2, FALSE) - - if(drunkenness >= 71) - blur_eyes(5) - - if(drunkenness >= 81) - adjustToxLoss(0.2) - if(prob(5) && !stat) - to_chat(src, "Maybe you should lie down for a bit...") - - if(drunkenness >= 91) - adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.4, 60) - if(prob(20) && !stat) - if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly - to_chat(src, "You're so tired... but you can't miss that shuttle...") - else - to_chat(src, "Just a quick nap...") - Sleeping(900) - - if(drunkenness >= 101) - adjustToxLoss(4) //Let's be honest you shouldn't be alive by now - else - SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "drunk") - -//used in human and monkey handle_environment() -/mob/living/carbon/proc/natural_bodytemperature_stabilization() - if (HAS_TRAIT(src, TRAIT_COLDBLOODED)) - return 0 //Return 0 as your natural temperature. Species proc handle_environment() will adjust your temperature based on this. - - var/body_temperature_difference = BODYTEMP_NORMAL - bodytemperature - switch(bodytemperature) - if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //Cold damage limit is 50 below the default, the temperature where you start to feel effects. - return max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) - if(BODYTEMP_COLD_DAMAGE_LIMIT to BODYTEMP_NORMAL) - return max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4)) - if(BODYTEMP_NORMAL to BODYTEMP_HEAT_DAMAGE_LIMIT) // Heat damage limit is 50 above the default, the temperature where you start to feel effects. - return min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4)) - if(BODYTEMP_HEAT_DAMAGE_LIMIT to INFINITY) - return min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers -///////// -//LIVER// -///////// - -/mob/living/carbon/proc/handle_liver() - var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) - if((!dna && !liver) || (NOLIVER in dna.species.species_traits)) - return - if(liver) - if(liver.damage < liver.maxHealth) - liver.organ_flags |= ORGAN_FAILING - liver_failure() - else - liver_failure() - -/mob/living/carbon/proc/undergoing_liver_failure() - var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) - if(liver && liver.failing) - return TRUE - -/mob/living/carbon/proc/return_liver_damage() - var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) - if(liver) - return liver.damage - -/mob/living/carbon/proc/applyLiverDamage(var/d) - var/obj/item/organ/liver/L = getorganslot(ORGAN_SLOT_LIVER) - if(L) - L.damage += d - -/mob/living/carbon/proc/liver_failure() - reagents.end_metabolization(src, keep_liverless = TRUE) //Stops trait-based effects on reagents, to prevent permanent buffs - reagents.metabolize(src, can_overdose=FALSE, liverless = TRUE) - if(HAS_TRAIT(src, TRAIT_STABLEHEART)) - return - adjustToxLoss(4, TRUE, TRUE) - if(prob(30)) - to_chat(src, "You feel a stabbing pain in your abdomen!") - - -//////////////// -//BRAIN DAMAGE// -//////////////// - -/mob/living/carbon/proc/handle_brain_damage() - for(var/T in get_traumas()) - var/datum/brain_trauma/BT = T - BT.on_life() - -///////////////////////////////////// -//MONKEYS WITH TOO MUCH CHOLOESTROL// -///////////////////////////////////// - -/mob/living/carbon/proc/can_heartattack() - if(!needs_heart()) - return FALSE - var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) - if(!heart || (heart.organ_flags & ORGAN_SYNTHETIC)) - return FALSE - return TRUE - -/mob/living/carbon/proc/needs_heart() - if(HAS_TRAIT(src, TRAIT_STABLEHEART)) - return FALSE - if(dna && dna.species && (NOBLOOD in dna.species.species_traits)) //not all carbons have species! - return FALSE - return TRUE - -/mob/living/carbon/proc/undergoing_cardiac_arrest() - var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) - if(istype(heart) && heart.beating) - return FALSE - else if(!needs_heart()) - return FALSE - return TRUE - -/mob/living/carbon/proc/set_heartattack(status) - if(!can_heartattack()) - return FALSE - - var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) - if(!istype(heart)) - return - - heart.beating = !status +/mob/living/carbon/Life() + set invisibility = 0 + + //Hyper Change + if(size_multiplier != previous_size) + sleep(1) + resize(size_multiplier) + + if(notransform) + return + + if(damageoverlaytemp) + damageoverlaytemp = 0 + update_damage_hud() + + + if(!IsInStasis()) + //Reagent processing needs to come before breathing, to prevent edge cases. + handle_organs() + + . = ..() + + if (QDELETED(src)) + return + + if(.) //not dead + handle_blood() + + if(stat != DEAD) + var/bprv = handle_bodyparts() + if(bprv & BODYPART_LIFE_UPDATE_HEALTH) + updatehealth() + update_stamina() + + if(stat != DEAD) + handle_brain_damage() +/* Bug cause? + if(stat != DEAD) + handle_liver() +*/ + if(stat == DEAD) + stop_sound_channel(CHANNEL_HEARTBEAT) + handle_death() + rot() + + //Updates the number of stored chemicals for powers + handle_changeling() + + if(stat != DEAD) + return 1 + +//Procs called while dead +/mob/living/carbon/proc/handle_death() + for(var/datum/reagent/R in reagents.reagent_list) + if(R.chemical_flags & REAGENT_DEAD_PROCESS) + R.on_mob_dead(src) + +/////////////// +// BREATHING // +/////////////// + +//Start of a breath chain, calls breathe() +/mob/living/carbon/handle_breathing(times_fired) + var/next_breath = 4 + var/obj/item/organ/lungs/L = getorganslot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART) + if(L) + if(L.damage > L.high_threshold) + next_breath-- + if(H) + if(H.damage > H.high_threshold) + next_breath-- + + if((times_fired % next_breath) == 0 || failed_last_breath) + breathe() //Breathe per 4 ticks if healthy, down to 2 if our lungs or heart are damaged, unless suffocating + if(failed_last_breath) + var/mob/living/carbon/human/B = src + if(HAS_TRAIT(B, TRAIT_CHOKE_SLUT)) + B.adjustArousalLoss(7) + if (B.getArousalLoss() >= 100 && ishuman(B) && B.has_dna()) + B.mob_climax(forced_climax=TRUE) + else + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation") + else + if(istype(loc, /obj/)) + var/obj/location_as_object = loc + location_as_object.handle_internal_lifeform(src,0) + +//Second link in a breath chain, calls check_breath() +/mob/living/carbon/proc/breathe() + var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS) + if(reagents.has_reagent(/datum/reagent/toxin/lexorin)) + return + if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell)) + return + if(istype(loc, /obj/item/dogborg/sleeper)) + return + if(ismob(loc)) + return + if(isbelly(loc)) + return + + var/datum/gas_mixture/environment + if(loc) + environment = loc.return_air() + + var/datum/gas_mixture/breath + + if(!getorganslot(ORGAN_SLOT_BREATHING_TUBE)) + if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL) || lungs.organ_flags & ORGAN_FAILING) + losebreath++ //You can't breath at all when in critical or when being choked, so you're going to miss a breath + + else if(health <= crit_threshold) + losebreath += 0.25 //You're having trouble breathing in soft crit, so you'll miss a breath one in four times + + //Suffocate + if(losebreath >= 1) //You've missed a breath, take oxy damage + losebreath-- + if(prob(10)) + emote("gasp") + if(istype(loc, /obj/)) + var/obj/loc_as_obj = loc + loc_as_obj.handle_internal_lifeform(src,0) + else + //Breathe from internal + breath = get_breath_from_internal(BREATH_VOLUME) + + if(isnull(breath)) //in case of 0 pressure internals + + if(isobj(loc)) //Breathe from loc as object + var/obj/loc_as_obj = loc + breath = loc_as_obj.handle_internal_lifeform(src, BREATH_VOLUME) + + else if(isturf(loc)) //Breathe from loc as turf + var/breath_moles = 0 + if(environment) + breath_moles = environment.total_moles()*BREATH_PERCENTAGE + + breath = loc.remove_air(breath_moles) + else //Breathe from loc as obj again + if(istype(loc, /obj/)) + var/obj/loc_as_obj = loc + loc_as_obj.handle_internal_lifeform(src,0) + + check_breath(breath) + + if(breath) + loc.assume_air(breath) + air_update_turf() + +/mob/living/carbon/proc/has_smoke_protection() + if(HAS_TRAIT(src, TRAIT_NOBREATH)) + return TRUE + return FALSE + + +//Third link in a breath chain, calls handle_breath_temperature() +/mob/living/carbon/proc/check_breath(datum/gas_mixture/breath) + if((status_flags & GODMODE)) + return + + var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS) + if(!lungs) + adjustOxyLoss(2) + + //CRIT + if(!breath || (breath.total_moles() == 0) || !lungs) + if(reagents.has_reagent(/datum/reagent/medicine/epinephrine) && lungs) + return + adjustOxyLoss(1) + + failed_last_breath = 1 + throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) + return 0 + + var/safe_oxy_min = 16 + var/safe_oxy_max = 50 + var/safe_co2_max = 10 + var/safe_tox_max = 0.05 + var/SA_para_min = 1 + var/SA_sleep_min = 5 + var/oxygen_used = 0 + var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME + + var/list/breath_gases = breath.gases + var/O2_partialpressure = (breath_gases[/datum/gas/oxygen]/breath.total_moles())*breath_pressure + var/Toxins_partialpressure = (breath_gases[/datum/gas/plasma]/breath.total_moles())*breath_pressure + var/CO2_partialpressure = (breath_gases[/datum/gas/carbon_dioxide]/breath.total_moles())*breath_pressure + + + //OXYGEN + if(O2_partialpressure > safe_oxy_max) // Too much Oxygen - blatant CO2 effect copy/pasta + if(!o2overloadtime) + o2overloadtime = world.time + else if(world.time - o2overloadtime > 120) + Dizzy(10) // better than a minute of you're fucked KO, but certainly a wake up call. Honk. + adjustOxyLoss(3) + if(world.time - o2overloadtime > 300) + adjustOxyLoss(8) + if(prob(20)) + emote("cough") + throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) + + if(O2_partialpressure < safe_oxy_min) //Not enough oxygen + if(prob(20)) + emote("gasp") + if(O2_partialpressure > 0) + var/ratio = 1 - O2_partialpressure/safe_oxy_min + adjustOxyLoss(min(5*ratio, 3)) + failed_last_breath = 1 + oxygen_used = breath_gases[/datum/gas/oxygen]*ratio + else + adjustOxyLoss(3) + failed_last_breath = 1 + throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) + + else //Enough oxygen + failed_last_breath = 0 + o2overloadtime = 0 //reset our counter for this too + if(health >= crit_threshold) + adjustOxyLoss(-5) + oxygen_used = breath_gases[/datum/gas/oxygen] + clear_alert("not_enough_oxy") + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "suffocation") + + breath_gases[/datum/gas/oxygen] -= oxygen_used + breath_gases[/datum/gas/carbon_dioxide] += oxygen_used + + //CARBON DIOXIDE + if(CO2_partialpressure > safe_co2_max) + if(!co2overloadtime) + co2overloadtime = world.time + else if(world.time - co2overloadtime > 120) + Unconscious(60) + adjustOxyLoss(3) + if(world.time - co2overloadtime > 300) + adjustOxyLoss(8) + if(prob(20)) + emote("cough") + + else + co2overloadtime = 0 + + //TOXINS/PLASMA + if(Toxins_partialpressure > safe_tox_max) + var/ratio = (breath_gases[/datum/gas/plasma]/safe_tox_max) * 10 + adjustToxLoss(CLAMP(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE)) + throw_alert("too_much_tox", /obj/screen/alert/too_much_tox) + else + clear_alert("too_much_tox") + + //NITROUS OXIDE + if(breath_gases[/datum/gas/nitrous_oxide]) + var/SA_partialpressure = (breath_gases[/datum/gas/nitrous_oxide]/breath.total_moles())*breath_pressure + if(SA_partialpressure > SA_para_min) + Unconscious(60) + if(SA_partialpressure > SA_sleep_min) + Sleeping(max(AmountSleeping() + 40, 200)) + else if(SA_partialpressure > 0.01) + if(prob(20)) + emote(pick("giggle","laugh")) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "chemical_euphoria", /datum/mood_event/chemical_euphoria) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") + + //BZ (Facepunch port of their Agent B) + if(breath_gases[/datum/gas/bz]) + var/bz_partialpressure = (breath_gases[/datum/gas/bz]/breath.total_moles())*breath_pressure + if(bz_partialpressure > 1) + hallucination += 10 + else if(bz_partialpressure > 0.01) + hallucination += 5 + + //TRITIUM + if(breath_gases[/datum/gas/tritium]) + var/tritium_partialpressure = (breath_gases[/datum/gas/tritium]/breath.total_moles())*breath_pressure + radiation += tritium_partialpressure/10 + + //NITRYL + if(breath_gases[/datum/gas/nitryl]) + var/nitryl_partialpressure = (breath_gases[/datum/gas/nitryl]/breath.total_moles())*breath_pressure + adjustFireLoss(nitryl_partialpressure/4) + + //MIASMA + if(breath_gases[/datum/gas/miasma]) + var/miasma_partialpressure = (breath_gases[/datum/gas/miasma]/breath.total_moles())*breath_pressure + if(miasma_partialpressure > MINIMUM_MOLES_DELTA_TO_MOVE) + + if(prob(0.05 * miasma_partialpressure)) + var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(2,3) + miasma_disease.name = "Unknown" + ForceContractDisease(miasma_disease, TRUE, TRUE) + + //Miasma side effects + switch(miasma_partialpressure) + if(1 to 5) + // At lower pp, give out a little warning + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell") + if(prob(5)) + to_chat(src, "There is an unpleasant smell in the air.") + if(5 to 20) + //At somewhat higher pp, warning becomes more obvious + if(prob(15)) + to_chat(src, "You smell something horribly decayed inside this room.") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/bad_smell) + if(15 to 30) + //Small chance to vomit. By now, people have internals on anyway + if(prob(5)) + to_chat(src, "The stench of rotting carcasses is unbearable!") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/nauseating_stench) + vomit() + if(30 to INFINITY) + //Higher chance to vomit. Let the horror start + if(prob(25)) + to_chat(src, "The stench of rotting carcasses is unbearable!") + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "smell", /datum/mood_event/disgust/nauseating_stench) + vomit() + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell") + + + //Clear all moods if no miasma at all + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "smell") + + + + + GAS_GARBAGE_COLLECT(breath.gases) + + //BREATH TEMPERATURE + handle_breath_temperature(breath) + + return 1 + +//Fourth and final link in a breath chain +/mob/living/carbon/proc/handle_breath_temperature(datum/gas_mixture/breath) + return + +/mob/living/carbon/proc/get_breath_from_internal(volume_needed) + var/obj/item/clothing/check + var/internals = FALSE + + for(check in GET_INTERNAL_SLOTS(src)) + if(CHECK_BITFIELD(check.clothing_flags, ALLOWINTERNALS)) + internals = TRUE + if(internal) + if(internal.loc != src) + internal = null + update_internals_hud_icon(0) + else if (!internals && !getorganslot(ORGAN_SLOT_BREATHING_TUBE)) + internal = null + update_internals_hud_icon(0) + else + update_internals_hud_icon(1) + . = internal.remove_air_volume(volume_needed) + if(!.) + return FALSE //to differentiate between no internals and active, but empty internals + +// Make corpses rot, emitting miasma +/mob/living/carbon/proc/rot() + // Properly stored corpses shouldn't create miasma + if(istype(loc, /obj/structure/closet/crate/coffin)|| istype(loc, /obj/structure/closet/body_bag) || istype(loc, /obj/structure/bodycontainer)) + return + + // No decay if formaldehyde in corpse or when the corpse is charred + if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(src, TRAIT_HUSK)) + return + + // Also no decay if corpse chilled or not organic/undead + if(bodytemperature <= T0C-10 || (!(MOB_ORGANIC in mob_biotypes) && !(MOB_UNDEAD in mob_biotypes))) + return + + // Wait a bit before decaying + if(world.time - timeofdeath < 1200) + return + + var/deceasedturf = get_turf(src) + + // Closed turfs don't have any air in them, so no gas building up + if(!istype(deceasedturf,/turf/open)) + return + + var/turf/open/miasma_turf = deceasedturf + + var/list/cached_gases = miasma_turf.air.gases + + cached_gases[/datum/gas/miasma] += 0.1 + +/mob/living/carbon/proc/handle_blood() + return + +/mob/living/carbon/proc/handle_bodyparts() + for(var/I in bodyparts) + var/obj/item/bodypart/BP = I + if(BP.needs_processing) + . |= BP.on_life() + +/mob/living/carbon/proc/handle_organs() + if(stat != DEAD) + for(var/V in internal_organs) + var/obj/item/organ/O = V + if(O) + O.on_life() + else + if(reagents.has_reagent("formaldehyde", 1)) // No organ decay if the body contains formaldehyde. + return + for(var/V in internal_organs) + var/obj/item/organ/O = V + if(O) + O.on_death() //Needed so organs decay while inside the body. + + + +/mob/living/carbon/handle_diseases() + for(var/thing in diseases) + var/datum/disease/D = thing + if(prob(D.infectivity)) + D.spread() + + if(stat != DEAD || D.process_dead) + D.stage_act() + +//todo generalize this and move hud out +/mob/living/carbon/proc/handle_changeling() + if(mind && hud_used && hud_used.lingchemdisplay) + var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling) + changeling.regenerate() + hud_used.lingchemdisplay.invisibility = 0 + hud_used.lingchemdisplay.maptext = "
    [round(changeling.chem_charges)]
    " + else + hud_used.lingchemdisplay.invisibility = INVISIBILITY_ABSTRACT + + +/mob/living/carbon/handle_mutations_and_radiation() + if(dna && dna.temporary_mutations.len) + for(var/mut in dna.temporary_mutations) + if(dna.temporary_mutations[mut] < world.time) + if(mut == UI_CHANGED) + if(dna.previous["UI"]) + dna.uni_identity = merge_text(dna.uni_identity,dna.previous["UI"]) + updateappearance(mutations_overlay_update=1) + dna.previous.Remove("UI") + dna.temporary_mutations.Remove(mut) + continue + if(mut == UE_CHANGED) + if(dna.previous["name"]) + real_name = dna.previous["name"] + name = real_name + dna.previous.Remove("name") + if(dna.previous["UE"]) + dna.unique_enzymes = dna.previous["UE"] + dna.previous.Remove("UE") + if(dna.previous["blood_type"]) + dna.blood_type = dna.previous["blood_type"] + dna.previous.Remove("blood_type") + dna.temporary_mutations.Remove(mut) + continue + for(var/datum/mutation/human/HM in dna.mutations) + if(HM && HM.timed) + dna.remove_mutation(HM.type) + + radiation -= min(radiation, RAD_LOSS_PER_TICK) + if(radiation > RAD_MOB_SAFE) + adjustToxLoss(log(radiation-RAD_MOB_SAFE)*RAD_TOX_COEFFICIENT) + +/mob/living/carbon/handle_stomach() + set waitfor = 0 + for(var/mob/living/M in stomach_contents) + if(M.loc != src) + stomach_contents.Remove(M) + continue + if(iscarbon(M) && stat != DEAD) + if(M.stat == DEAD) + M.death(1) + stomach_contents.Remove(M) + qdel(M) + continue + if(SSmobs.times_fired%3==1) + if(!(M.status_flags & GODMODE)) + M.adjustBruteLoss(5) + nutrition += 10 + + +/* +Alcohol Poisoning Chart +Note that all higher effects of alcohol poisoning will inherit effects for smaller amounts (i.e. light poisoning inherts from slight poisoning) +In addition, severe effects won't always trigger unless the drink is poisonously strong +All effects don't start immediately, but rather get worse over time; the rate is affected by the imbiber's alcohol tolerance + +0: Non-alcoholic +1-10: Barely classifiable as alcohol - occassional slurring +11-20: Slight alcohol content - slurring +21-30: Below average - imbiber begins to look slightly drunk +31-40: Just below average - no unique effects +41-50: Average - mild disorientation, imbiber begins to look drunk +51-60: Just above average - disorientation, vomiting, imbiber begins to look heavily drunk +61-70: Above average - small chance of blurry vision, imbiber begins to look smashed +71-80: High alcohol content - blurry vision, imbiber completely shitfaced +81-90: Extremely high alcohol content - light brain damage, passing out +91-100: Dangerously toxic - swift death +*/ +#define BALLMER_POINTS 5 +GLOBAL_LIST_INIT(ballmer_good_msg, list("Hey guys, what if we rolled out a bluespace wiring system so mice can't destroy the powergrid anymore?", + "Hear me out here. What if, and this is just a theory, we made R&D controllable from our PDAs?", + "I'm thinking we should roll out a git repository for our research under the AGPLv3 license so that we can share it among the other stations freely.", + "I dunno about you guys, but IDs and PDAs being separate is clunky as fuck. Maybe we should merge them into a chip in our arms? That way they can't be stolen easily.", + "Why the fuck aren't we just making every pair of shoes into galoshes? We have the technology.")) +GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put a webserver that's automatically turned on with default admin passwords into every PDA?", + "So like, you know how we separate our codebase from the master copy that runs on our consumer boxes? What if we merged the two and undid the separation between codebase and server?", + "Dude, radical idea: H.O.N.K mechs but with no bananium required.", + "Best idea ever: Disposal pipes instead of hallways.")) + +//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc.. +/mob/living/carbon/handle_status_effects() + ..() + if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active + adjustStaminaLoss(resting ? (recoveringstam ? -7.5 : -3) : -1.5)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke + + if(!recoveringstam && incomingstammult != 1) + incomingstammult = max(0.01, incomingstammult) + incomingstammult = min(1, incomingstammult*2) + + //CIT CHANGES START HERE. STAMINA BUFFER STUFF + if(bufferedstam && world.time > stambufferregentime) + var/drainrate = max((bufferedstam*(bufferedstam/(5)))*0.1,1) + bufferedstam = max(bufferedstam - drainrate, 0) + adjustStaminaLoss(drainrate*0.5) + //END OF CIT CHANGES + + var/restingpwr = 1 + 4 * resting + + //Dizziness + if(dizziness) + var/client/C = client + var/pixel_x_diff = 0 + var/pixel_y_diff = 0 + var/temp + var/saved_dizz = dizziness + if(C) + var/oldsrc = src + var/amplitude = dizziness*(sin(dizziness * world.time) + 1) // This shit is annoying at high strength + src = null + spawn(0) + if(C) + temp = amplitude * sin(saved_dizz * world.time) + pixel_x_diff += temp + C.pixel_x += temp + temp = amplitude * cos(saved_dizz * world.time) + pixel_y_diff += temp + C.pixel_y += temp + sleep(3) + if(C) + temp = amplitude * sin(saved_dizz * world.time) + pixel_x_diff += temp + C.pixel_x += temp + temp = amplitude * cos(saved_dizz * world.time) + pixel_y_diff += temp + C.pixel_y += temp + sleep(3) + if(C) + C.pixel_x -= pixel_x_diff + C.pixel_y -= pixel_y_diff + src = oldsrc + dizziness = max(dizziness - restingpwr, 0) + + if(drowsyness) + drowsyness = max(drowsyness - restingpwr, 0) + blur_eyes(2) + if(prob(5)) + AdjustSleeping(20) + Unconscious(100) + + //Jitteriness + if(jitteriness) + do_jitter_animation(jitteriness) + jitteriness = max(jitteriness - restingpwr, 0) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "jittery", /datum/mood_event/jittery) + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "jittery") + + if(stuttering) + stuttering = max(stuttering-1, 0) + + if(slurring || drunkenness) + slurring = max(slurring-1,0,drunkenness) + + if(cultslurring) + cultslurring = max(cultslurring-1, 0) + + if(silent) + silent = max(silent-1, 0) + + if(druggy) + adjust_drugginess(-1) + + if(hallucination) + handle_hallucinations() + + if(drunkenness) + drunkenness = max(drunkenness - (drunkenness * 0.04), 0) + if(drunkenness >= 6) + SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drunk) + jitteriness = max(jitteriness - 3, 0) + if(HAS_TRAIT(src, TRAIT_DRUNK_HEALING)) + adjustBruteLoss(-0.12, FALSE) + adjustFireLoss(-0.06, FALSE) + + if(mind && (mind.assigned_role == "Scientist" || mind.assigned_role == "Research Director")) + if(SSresearch.science_tech) + if(drunkenness >= 12.9 && drunkenness <= 13.8) + drunkenness = round(drunkenness, 0.01) + var/ballmer_percent = 0 + if(drunkenness == 13.35) // why run math if I dont have to + ballmer_percent = 1 + else + ballmer_percent = (-abs(drunkenness - 13.35) / 0.9) + 1 + if(prob(5)) + say(pick(GLOB.ballmer_good_msg), forced = "ballmer") + SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = BALLMER_POINTS * ballmer_percent)) + if(drunkenness > 26) // by this point you're into windows ME territory + if(prob(5)) + SSresearch.science_tech.remove_point_list(list(TECHWEB_POINT_TYPE_GENERIC = BALLMER_POINTS)) + say(pick(GLOB.ballmer_windows_me_msg), forced = "ballmer") + + if(drunkenness >= 41) + if(prob(25)) + confused += 2 + Dizzy(10) + if(HAS_TRAIT(src, TRAIT_DRUNK_HEALING)) // effects stack with lower tiers + adjustBruteLoss(-0.3, FALSE) + adjustFireLoss(-0.15, FALSE) + + if(drunkenness >= 51) + if(prob(5)) + confused += 10 + vomit() + Dizzy(25) + + if(drunkenness >= 61) + if(prob(50)) + blur_eyes(5) + if(HAS_TRAIT(src, TRAIT_DRUNK_HEALING)) + adjustBruteLoss(-0.4, FALSE) + adjustFireLoss(-0.2, FALSE) + + if(drunkenness >= 71) + blur_eyes(5) + + if(drunkenness >= 81) + adjustToxLoss(0.2) + if(prob(5) && !stat) + to_chat(src, "Maybe you should lie down for a bit...") + + if(drunkenness >= 91) + adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.4, 60) + if(prob(20) && !stat) + if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly + to_chat(src, "You're so tired... but you can't miss that shuttle...") + else + to_chat(src, "Just a quick nap...") + Sleeping(900) + + if(drunkenness >= 101) + adjustToxLoss(4) //Let's be honest you shouldn't be alive by now + else + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "drunk") + +//used in human and monkey handle_environment() +/mob/living/carbon/proc/natural_bodytemperature_stabilization() + if (HAS_TRAIT(src, TRAIT_COLDBLOODED)) + return 0 //Return 0 as your natural temperature. Species proc handle_environment() will adjust your temperature based on this. + + var/body_temperature_difference = BODYTEMP_NORMAL - bodytemperature + switch(bodytemperature) + if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //Cold damage limit is 50 below the default, the temperature where you start to feel effects. + return max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) + if(BODYTEMP_COLD_DAMAGE_LIMIT to BODYTEMP_NORMAL) + return max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4)) + if(BODYTEMP_NORMAL to BODYTEMP_HEAT_DAMAGE_LIMIT) // Heat damage limit is 50 above the default, the temperature where you start to feel effects. + return min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4)) + if(BODYTEMP_HEAT_DAMAGE_LIMIT to INFINITY) + return min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers +///////// +//LIVER// +///////// + +/mob/living/carbon/proc/handle_liver() + var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) + if((!dna && !liver) || (NOLIVER in dna.species.species_traits)) + return + if(liver) + if(liver.damage < liver.maxHealth) + liver.organ_flags |= ORGAN_FAILING + liver_failure() + else + liver_failure() + +/mob/living/carbon/proc/undergoing_liver_failure() + var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) + if(liver && liver.failing) + return TRUE + +/mob/living/carbon/proc/return_liver_damage() + var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER) + if(liver) + return liver.damage + +/mob/living/carbon/proc/applyLiverDamage(var/d) + var/obj/item/organ/liver/L = getorganslot(ORGAN_SLOT_LIVER) + if(L) + L.damage += d + +/mob/living/carbon/proc/liver_failure() + reagents.end_metabolization(src, keep_liverless = TRUE) //Stops trait-based effects on reagents, to prevent permanent buffs + reagents.metabolize(src, can_overdose=FALSE, liverless = TRUE) + if(HAS_TRAIT(src, TRAIT_STABLEHEART)) + return + adjustToxLoss(4, TRUE, TRUE) + if(prob(30)) + to_chat(src, "You feel a stabbing pain in your abdomen!") + + +//////////////// +//BRAIN DAMAGE// +//////////////// + +/mob/living/carbon/proc/handle_brain_damage() + for(var/T in get_traumas()) + var/datum/brain_trauma/BT = T + BT.on_life() + +///////////////////////////////////// +//MONKEYS WITH TOO MUCH CHOLOESTROL// +///////////////////////////////////// + +/mob/living/carbon/proc/can_heartattack() + if(!needs_heart()) + return FALSE + var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) + if(!heart || (heart.organ_flags & ORGAN_SYNTHETIC)) + return FALSE + return TRUE + +/mob/living/carbon/proc/needs_heart() + if(HAS_TRAIT(src, TRAIT_STABLEHEART)) + return FALSE + if(dna && dna.species && (NOBLOOD in dna.species.species_traits)) //not all carbons have species! + return FALSE + return TRUE + +/mob/living/carbon/proc/undergoing_cardiac_arrest() + var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) + if(istype(heart) && heart.beating) + return FALSE + else if(!needs_heart()) + return FALSE + return TRUE + +/mob/living/carbon/proc/set_heartattack(status) + if(!can_heartattack()) + return FALSE + + var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) + if(!istype(heart)) + return + + heart.beating = !status diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 54fddea2..a287c569 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -1,175 +1,175 @@ -/mob/living/carbon/monkey - name = "monkey" - verb_say = "chimpers" - initial_language_holder = /datum/language_holder/monkey - icon = 'icons/mob/monkey.dmi' - icon_state = "" - gender = NEUTER - pass_flags = PASSTABLE - ventcrawler = VENTCRAWLER_NUDE - mob_biotypes = list(MOB_ORGANIC, MOB_HUMANOID) - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/monkey = 5, /obj/item/stack/sheet/animalhide/monkey = 1) - type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/monkey - gib_type = /obj/effect/decal/cleanable/blood/gibs - unique_name = TRUE - bodyparts = list(/obj/item/bodypart/chest/monkey, /obj/item/bodypart/head/monkey, /obj/item/bodypart/l_arm/monkey, - /obj/item/bodypart/r_arm/monkey, /obj/item/bodypart/r_leg/monkey, /obj/item/bodypart/l_leg/monkey) - hud_type = /datum/hud/monkey - -/mob/living/carbon/monkey/Initialize(mapload, cubespawned=FALSE, mob/spawner) - verbs += /mob/living/proc/mob_sleep - verbs += /mob/living/proc/lay_down - - if(unique_name) //used to exclude pun pun - gender = pick(MALE, FEMALE) - real_name = name - - //initialize limbs - create_bodyparts() - create_internal_organs() - - . = ..() - - if (cubespawned) - var/cap = CONFIG_GET(number/monkeycap) - if (LAZYLEN(SSmobs.cubemonkeys) > cap) - if (spawner) - to_chat(spawner, "Bluespace harmonics prevent the spawning of more than [cap] monkeys on the station at one time!") - return INITIALIZE_HINT_QDEL - SSmobs.cubemonkeys += src - - create_dna(src) - dna.initialize_dna(random_blood_type()) - -/mob/living/carbon/monkey/ComponentInitialize() - . = ..() - AddElement(/datum/element/mob_holder, "monkey", null, null, null, SLOT_HEAD) - -/mob/living/carbon/monkey/Destroy() - SSmobs.cubemonkeys -= src - return ..() - -/mob/living/carbon/monkey/create_internal_organs() - internal_organs += new /obj/item/organ/appendix - internal_organs += new /obj/item/organ/lungs - internal_organs += new /obj/item/organ/heart - internal_organs += new /obj/item/organ/brain - internal_organs += new /obj/item/organ/tongue - internal_organs += new /obj/item/organ/eyes - internal_organs += new /obj/item/organ/ears - internal_organs += new /obj/item/organ/liver - internal_organs += new /obj/item/organ/stomach - ..() - -/mob/living/carbon/monkey/on_reagent_change() - . = ..() - remove_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE) - var/amount - if(reagents.has_reagent("morphine")) - amount = -1 - if(reagents.has_reagent("nuka_cola")) - amount = -1 - if(amount) - add_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount) - -/mob/living/carbon/monkey/updatehealth() - . = ..() - var/slow = 0 - var/health_deficiency = (100 - health) - if(health_deficiency >= 45) - slow += (health_deficiency / 25) - add_movespeed_modifier(MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = slow) - -/mob/living/carbon/monkey/adjust_bodytemperature(amount) - . = ..() - var/slow = 0 - if (bodytemperature < 283.222) - slow += (283.222 - bodytemperature) / 10 * 1.75 - if(slow <= 0) - return - add_movespeed_modifier(MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount) - -/mob/living/carbon/monkey/Stat() - ..() - if(statpanel("Status")) - stat(null, "Intent: [a_intent]") - stat(null, "Move Mode: [m_intent]") - if(client && mind) - var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling) - stat("Chemical Storage", "[changeling.chem_charges]/[changeling.chem_storage]") - stat("Absorbed DNA", changeling.absorbedcount) - return - - -/mob/living/carbon/monkey/verb/removeinternal() - set name = "Remove Internals" - set category = "IC" - internal = null - return - - -/mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools - if(mind && is_monkey(mind)) - return TRUE - return FALSE - -/mob/living/carbon/monkey/reagent_check(datum/reagent/R) //can metabolize all reagents - return FALSE - -/mob/living/carbon/monkey/canBeHandcuffed() - return TRUE - -/mob/living/carbon/monkey/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) - if(judgement_criteria & JUDGE_EMAGGED) - return 10 //Everyone is a criminal! - - var/threatcount = 0 - - //Securitrons can't identify monkeys - if( !(judgement_criteria & JUDGE_IGNOREMONKEYS) && (judgement_criteria & JUDGE_IDCHECK) ) - threatcount += 4 - - //Lasertag bullshit - if(lasercolor) - if(lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve - if(is_holding_item_of_type(/obj/item/gun/energy/laser/redtag)) - threatcount += 4 - - if(lasercolor == "r") - if(is_holding_item_of_type(/obj/item/gun/energy/laser/bluetag)) - threatcount += 4 - - return threatcount - - //Check for weapons - if( (judgement_criteria & JUDGE_WEAPONCHECK) && weaponcheck ) - for(var/obj/item/I in held_items) //if they're holding a gun - if(weaponcheck.Invoke(I)) - threatcount += 4 - if(weaponcheck.Invoke(back)) //if a weapon is present in the back slot - threatcount += 4 //trigger look_for_perp() since they're nonhuman and very likely hostile - - //mindshield implants imply trustworthyness - if(HAS_TRAIT(src, TRAIT_MINDSHIELD)) - threatcount -= 1 - - return threatcount - -/mob/living/carbon/monkey/IsVocal() - if(!getorganslot(ORGAN_SLOT_LUNGS)) - return 0 - return 1 - -/mob/living/carbon/monkey/can_use_guns(obj/item/G) - return TRUE - -/mob/living/carbon/monkey/angry - aggressive = TRUE - -/mob/living/carbon/monkey/angry/Initialize() - . = ..() - if(prob(10)) - var/obj/item/clothing/head/helmet/justice/escape/helmet = new(src) - equip_to_slot_or_del(helmet,SLOT_HEAD) - helmet.attack_self(src) // todo encapsulate toggle +/mob/living/carbon/monkey + name = "monkey" + verb_say = "chimpers" + initial_language_holder = /datum/language_holder/monkey + icon = 'icons/mob/monkey.dmi' + icon_state = "" + gender = NEUTER + pass_flags = PASSTABLE + ventcrawler = VENTCRAWLER_NUDE + mob_biotypes = list(MOB_ORGANIC, MOB_HUMANOID) + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/monkey = 5, /obj/item/stack/sheet/animalhide/monkey = 1) + type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/monkey + gib_type = /obj/effect/decal/cleanable/blood/gibs + unique_name = TRUE + bodyparts = list(/obj/item/bodypart/chest/monkey, /obj/item/bodypart/head/monkey, /obj/item/bodypart/l_arm/monkey, + /obj/item/bodypart/r_arm/monkey, /obj/item/bodypart/r_leg/monkey, /obj/item/bodypart/l_leg/monkey) + hud_type = /datum/hud/monkey + +/mob/living/carbon/monkey/Initialize(mapload, cubespawned=FALSE, mob/spawner) + verbs += /mob/living/proc/mob_sleep + verbs += /mob/living/proc/lay_down + + if(unique_name) //used to exclude pun pun + gender = pick(MALE, FEMALE) + real_name = name + + //initialize limbs + create_bodyparts() + create_internal_organs() + + . = ..() + + if (cubespawned) + var/cap = CONFIG_GET(number/monkeycap) + if (LAZYLEN(SSmobs.cubemonkeys) > cap) + if (spawner) + to_chat(spawner, "Bluespace harmonics prevent the spawning of more than [cap] monkeys on the station at one time!") + return INITIALIZE_HINT_QDEL + SSmobs.cubemonkeys += src + + create_dna(src) + dna.initialize_dna(random_blood_type()) + +/mob/living/carbon/monkey/ComponentInitialize() + . = ..() + AddElement(/datum/element/mob_holder, "monkey", null, null, null, SLOT_HEAD) + +/mob/living/carbon/monkey/Destroy() + SSmobs.cubemonkeys -= src + return ..() + +/mob/living/carbon/monkey/create_internal_organs() + internal_organs += new /obj/item/organ/appendix + internal_organs += new /obj/item/organ/lungs + internal_organs += new /obj/item/organ/heart + internal_organs += new /obj/item/organ/brain + internal_organs += new /obj/item/organ/tongue + internal_organs += new /obj/item/organ/eyes + internal_organs += new /obj/item/organ/ears + internal_organs += new /obj/item/organ/liver + internal_organs += new /obj/item/organ/stomach + ..() + +/mob/living/carbon/monkey/on_reagent_change() + . = ..() + remove_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE) + var/amount + if(reagents.has_reagent(/datum/reagent/medicine/morphine)) + amount = -1 + if(reagents.has_reagent("nuka_cola")) + amount = -1 + if(amount) + add_movespeed_modifier(MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount) + +/mob/living/carbon/monkey/updatehealth() + . = ..() + var/slow = 0 + var/health_deficiency = (100 - health) + if(health_deficiency >= 45) + slow += (health_deficiency / 25) + add_movespeed_modifier(MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = slow) + +/mob/living/carbon/monkey/adjust_bodytemperature(amount) + . = ..() + var/slow = 0 + if (bodytemperature < 283.222) + slow += (283.222 - bodytemperature) / 10 * 1.75 + if(slow <= 0) + return + add_movespeed_modifier(MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount) + +/mob/living/carbon/monkey/Stat() + ..() + if(statpanel("Status")) + stat(null, "Intent: [a_intent]") + stat(null, "Move Mode: [m_intent]") + if(client && mind) + var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling) + stat("Chemical Storage", "[changeling.chem_charges]/[changeling.chem_storage]") + stat("Absorbed DNA", changeling.absorbedcount) + return + + +/mob/living/carbon/monkey/verb/removeinternal() + set name = "Remove Internals" + set category = "IC" + internal = null + return + + +/mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools + if(mind && is_monkey(mind)) + return TRUE + return FALSE + +/mob/living/carbon/monkey/reagent_check(datum/reagent/R) //can metabolize all reagents + return FALSE + +/mob/living/carbon/monkey/canBeHandcuffed() + return TRUE + +/mob/living/carbon/monkey/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) + if(judgement_criteria & JUDGE_EMAGGED) + return 10 //Everyone is a criminal! + + var/threatcount = 0 + + //Securitrons can't identify monkeys + if( !(judgement_criteria & JUDGE_IGNOREMONKEYS) && (judgement_criteria & JUDGE_IDCHECK) ) + threatcount += 4 + + //Lasertag bullshit + if(lasercolor) + if(lasercolor == "b")//Lasertag turrets target the opposing team, how great is that? -Sieve + if(is_holding_item_of_type(/obj/item/gun/energy/laser/redtag)) + threatcount += 4 + + if(lasercolor == "r") + if(is_holding_item_of_type(/obj/item/gun/energy/laser/bluetag)) + threatcount += 4 + + return threatcount + + //Check for weapons + if( (judgement_criteria & JUDGE_WEAPONCHECK) && weaponcheck ) + for(var/obj/item/I in held_items) //if they're holding a gun + if(weaponcheck.Invoke(I)) + threatcount += 4 + if(weaponcheck.Invoke(back)) //if a weapon is present in the back slot + threatcount += 4 //trigger look_for_perp() since they're nonhuman and very likely hostile + + //mindshield implants imply trustworthyness + if(HAS_TRAIT(src, TRAIT_MINDSHIELD)) + threatcount -= 1 + + return threatcount + +/mob/living/carbon/monkey/IsVocal() + if(!getorganslot(ORGAN_SLOT_LUNGS)) + return 0 + return 1 + +/mob/living/carbon/monkey/can_use_guns(obj/item/G) + return TRUE + +/mob/living/carbon/monkey/angry + aggressive = TRUE + +/mob/living/carbon/monkey/angry/Initialize() + . = ..() + if(prob(10)) + var/obj/item/clothing/head/helmet/justice/escape/helmet = new(src) + equip_to_slot_or_del(helmet,SLOT_HEAD) + helmet.attack_self(src) // todo encapsulate toggle diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b315428a..9832e3b2 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1228,7 +1228,7 @@ clamp_unconscious_to = 0, clamp_immobility_to = 0, reset_misc = TRUE, - healing_chems = list("inaprovaline" = 3, "synaptizine" = 10, "regen_jelly" = 10, "stimulants" = 10), + healing_chems = list(/datum/reagent/medicine/inaprovaline = 3, /datum/reagent/medicine/synaptizine = 10, /datum/reagent/medicine/regen_jelly = 10, /datum/reagent/medicine/stimulants = 10), message = "You feel a surge of energy!", stamina_buffer_boost = 0, //restores stamina buffer rather than just health scale_stamina_loss_recovery, //defaults to null. if this is set, restores loss * this stamina. make sure it's a fraction. @@ -1255,6 +1255,6 @@ updatehealth() update_stamina() update_canmove() - for(var/chem in healing_chems) - reagents.add_reagent(chem, healing_chems[chem]) + if(healing_chems) + reagents.add_reagent_list(healing_chems) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 89695cce..71fdf998 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -1,516 +1,516 @@ - -/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = "Your armor absorbs the blow!", soften_text = "Your armor softens the blow!", armour_penetration, penetrated_text = "Your armor was penetrated!") - var/armor = getarmor(def_zone, attack_flag) - - //the if "armor" check is because this is used for everything on /living, including humans - if(armor && armour_penetration) - armor = max(0, armor - armour_penetration) - if(penetrated_text) - to_chat(src, "[penetrated_text]") - else if(armor >= 100) - if(absorb_text) - to_chat(src, "[absorb_text]") - else if(armor > 0) - if(soften_text) - to_chat(src, "[soften_text]") - return armor - - -/mob/living/proc/getarmor(def_zone, type) - return 0 - -//this returns the mob's protection against eye damage (number between -1 and 2) from bright lights -/mob/living/proc/get_eye_protection() - return 0 - -//this returns the mob's protection against ear damage (0:no protection; 1: some ear protection; 2: has no ears) -/mob/living/proc/get_ear_protection() - return 0 - -/mob/living/proc/is_mouth_covered(head_only = 0, mask_only = 0) - return FALSE - -/mob/living/proc/is_eyes_covered(check_glasses = 1, check_head = 1, check_mask = 1) - return FALSE - -/mob/living/proc/on_hit(obj/item/projectile/P) - return - -/mob/living/proc/check_shields(atom/AM, damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0) - var/block_chance_modifier = round(damage / -3) - for(var/obj/item/I in held_items) - if(!istype(I, /obj/item/clothing)) - var/final_block_chance = I.block_chance - (CLAMP((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example - if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) - return TRUE - return FALSE - -/mob/living/proc/check_reflect(def_zone) //Reflection checks for anything in your hands, based on the reflection chance of the object(s) - for(var/obj/item/I in held_items) - if(I.IsReflect(def_zone)) - return TRUE - return FALSE - -/mob/living/proc/reflect_bullet_check(obj/item/projectile/P, def_zone) - if(P.is_reflectable && check_reflect(def_zone)) // Checks if you've passed a reflection% check - visible_message("The [P.name] gets reflected by [src]!", \ - "The [P.name] gets reflected by [src]!") - // Find a turf near or on the original location to bounce to - if(P.starting) - var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/turf/curloc = get_turf(src) - // redirect the projectile - P.original = locate(new_x, new_y, P.z) - P.starting = curloc - P.firer = src - P.yo = new_y - curloc.y - P.xo = new_x - curloc.x - var/new_angle_s = P.Angle + rand(120,240) - while(new_angle_s > 180) // Translate to regular projectile degrees - new_angle_s -= 360 - P.setAngle(new_angle_s) - return TRUE - return FALSE - -/mob/living/bullet_act(obj/item/projectile/P, def_zone) - if(P.original != src || P.firer != src) //try to block or reflect the bullet, can't do so when shooting oneself - if(reflect_bullet_check(P, def_zone)) - return -1 // complete projectile permutation - if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration)) - P.on_hit(src, 100, def_zone) - return 2 - var/armor = run_armor_check(def_zone, P.flag, null, null, P.armour_penetration, null) - if(!P.nodamage) - apply_damage(P.damage, P.damage_type, def_zone, armor) - if(P.dismemberment) - check_projectile_dismemberment(P, def_zone) - return P.on_hit(src, armor) - -/mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone) - return 0 - -/obj/item/proc/get_volume_by_throwforce_and_or_w_class() - if(throwforce && w_class) - return CLAMP((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100 - else if(w_class) - return CLAMP(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100 - else - return 0 - -/mob/living/proc/catch_item(obj/item/I, skip_throw_mode_check = FALSE) - return FALSE - -/mob/living/proc/embed_item(obj/item/I) - return - -/mob/living/proc/can_embed(obj/item/I) - return FALSE - -/mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - var/obj/item/I - var/throwpower = 30 - if(isitem(AM)) - I = AM - throwpower = I.throwforce - if(check_shields(AM, throwpower, "\the [AM.name]", THROWN_PROJECTILE_ATTACK)) - hitpush = FALSE - skipcatch = TRUE - blocked = TRUE - else if(I && I.throw_speed >= EMBED_THROWSPEED_THRESHOLD && can_embed(I, src) && prob(I.embedding.embed_chance) && !HAS_TRAIT(src, TRAIT_PIERCEIMMUNE) && (!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) || incapacitated() || get_active_held_item())) - embed_item(I) - hitpush = FALSE - skipcatch = TRUE //can't catch the now embedded item - if(I) - if(!skipcatch && isturf(I.loc) && catch_item(I)) - return TRUE - var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest - var/dtype = BRUTE - var/volume = I.get_volume_by_throwforce_and_or_w_class() - SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, zone) - dtype = I.damtype - - if (I.throwforce > 0) //If the weapon's throwforce is greater than zero... - if (I.throwhitsound) //...and throwhitsound is defined... - playsound(loc, I.throwhitsound, volume, 1, -1) //...play the weapon's throwhitsound. - else if(I.hitsound) //Otherwise, if the weapon's hitsound is defined... - playsound(loc, I.hitsound, volume, 1, -1) //...play the weapon's hitsound. - else if(!I.throwhitsound) //Otherwise, if throwhitsound isn't defined... - playsound(loc, 'sound/weapons/genhit.ogg',volume, 1, -1) //...play genhit.ogg. - - else if(!I.throwhitsound && I.throwforce > 0) //Otherwise, if the item doesn't have a throwhitsound and has a throwforce greater than zero... - playsound(loc, 'sound/weapons/genhit.ogg', volume, 1, -1)//...play genhit.ogg - if(!I.throwforce)// Otherwise, if the item's throwforce is 0... - playsound(loc, 'sound/weapons/throwtap.ogg', 1, volume, -1)//...play throwtap.ogg. - if(!blocked) - visible_message("[src] has been hit by [I].", \ - "[src] has been hit by [I].") - var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].",I.armour_penetration) - apply_damage(I.throwforce, dtype, zone, armor) - if(I.thrownby) - log_combat(I.thrownby, src, "threw and hit", I) - else - return 1 - else - playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1) - ..() - - -/mob/living/mech_melee_attack(obj/mecha/M) - if(M.occupant.a_intent == INTENT_HARM) - M.do_attack_animation(src) - if(M.damtype == "brute") - step_away(src,M,15) - switch(M.damtype) - if(BRUTE) - Unconscious(20) - take_overall_damage(rand(M.force/2, M.force)) - playsound(src, 'sound/weapons/punch4.ogg', 50, 1) - if(BURN) - take_overall_damage(0, rand(M.force/2, M.force)) - playsound(src, 'sound/items/welder.ogg', 50, 1) - if(TOX) - M.mech_toxin_damage(src) - else - return - updatehealth() - visible_message("[M.name] has hit [src]!", \ - "[M.name] has hit [src]!", null, COMBAT_MESSAGE_RANGE) - log_combat(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") - else - step_away(src,M) - log_combat(M.occupant, src, "pushed", M) - visible_message("[M] pushes [src] out of the way.", null, null, 5) - -/mob/living/fire_act() - adjust_fire_stacks(3) - IgniteMob() - -/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = FALSE) - if(user == anchored || !isturf(user.loc)) - return FALSE - - //pacifist vore check. - if(user.pulling && HAS_TRAIT(user, TRAIT_PACIFISM) && user.voremode) //they can only do heals, noisy guts, absorbing (technically not harm) - if(ismob(user.pulling)) - var/mob/P = user.pulling - if(src != user) - to_chat(user, "You can't risk digestion!") - return FALSE - else - user.vore_attack(user, P, user) - return - - //normal vore check. - if(user.pulling && user.grab_state == GRAB_AGGRESSIVE && user.voremode) - if(ismob(user.pulling)) - var/mob/P = user.pulling - user.vore_attack(user, P, src) // User, Pulled, Predator target (which can be user, pulling, or src) - return - - if(user == src) //we want to be able to self click if we're voracious - return FALSE - - if(!user.pulling || user.pulling != src) - user.start_pulling(src, supress_message = supress_message) - return - - if(!(status_flags & CANPUSH) || HAS_TRAIT(src, TRAIT_PUSHIMMUNE)) - to_chat(user, "[src] can't be grabbed more aggressively!") - return FALSE - - if(HAS_TRAIT(user, TRAIT_PACIFISM)) - to_chat(user, "You don't want to risk hurting [src]!") - return FALSE - - grippedby(user) - -//proc to upgrade a simple pull into a more aggressive grab. -/mob/living/proc/grippedby(mob/living/carbon/user, instant = FALSE) - if(user.grab_state < GRAB_KILL) - user.changeNext_move(CLICK_CD_GRABBING) - playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - - if(user.grab_state) //only the first upgrade is instantaneous - var/old_grab_state = user.grab_state - var/grab_upgrade_time = instant ? 0 : 30 - visible_message("[user] starts to tighten [user.p_their()] grip on [src]!", \ - "[user] starts to tighten [user.p_their()] grip on you!") - switch(user.grab_state) - if(GRAB_AGGRESSIVE) - log_combat(user, src, "attempted to neck grab", addition="neck grab") - if(GRAB_NECK) - log_combat(user, src, "attempted to strangle", addition="kill grab") - if(!do_mob(user, src, grab_upgrade_time)) - return 0 - if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state || user.a_intent != INTENT_GRAB) - return 0 - if(user.voremode && user.grab_state == GRAB_AGGRESSIVE) - return 0 - user.grab_state++ - switch(user.grab_state) - if(GRAB_AGGRESSIVE) - log_combat(user, src, "grabbed", addition="aggressive grab") - visible_message("[user] has grabbed [src] aggressively!", \ - "[user] has grabbed [src] aggressively!") - drop_all_held_items() - stop_pulling() - if(GRAB_NECK) - log_combat(user, src, "grabbed", addition="neck grab") - visible_message("[user] has grabbed [src] by the neck!",\ - "[user] has grabbed you by the neck!") - update_canmove() //we fall down - if(!buckled && !density) - Move(user.loc) - if(GRAB_KILL) - log_combat(user, src, "strangled", addition="kill grab") - visible_message("[user] is strangling [src]!", \ - "[user] is strangling you!") - update_canmove() //we fall down - if(!buckled && !density) - Move(user.loc) - return 1 - -/mob/living/attack_hand(mob/user) - ..() //Ignoring parent return value here. - SEND_SIGNAL(src, COMSIG_MOB_ATTACK_HAND, user) - if((user != src) && user.a_intent != INTENT_HELP && check_shields(user, 0, user.name, attack_type = UNARMED_ATTACK)) - log_combat(user, src, "attempted to touch") - visible_message("[user] attempted to touch [src]!") - return TRUE - -/mob/living/attack_hulk(mob/living/carbon/human/user, does_attack_animation = FALSE) - if(user.a_intent == INTENT_HARM) - if(HAS_TRAIT(user, TRAIT_PACIFISM)) - to_chat(user, "You don't want to hurt [src]!") - return TRUE - var/hulk_verb = pick("smash","pummel") - if(user != src && check_shields(user, 15, "the [hulk_verb]ing")) - return TRUE - ..() - return FALSE - -/mob/living/attack_slime(mob/living/simple_animal/slime/M) - if(!SSticker.HasRoundStarted()) - to_chat(M, "You cannot attack people before the game has started.") - return - - if(M.buckled) - if(M in buckled_mobs) - M.Feedstop() - return // can't attack while eating! - - if(HAS_TRAIT(src, TRAIT_PACIFISM)) - to_chat(M, "You don't want to hurt anyone!") - return FALSE - - var/damage = rand(5, 35) - if(M.is_adult) - damage = rand(20, 40) - if(check_shields(M, damage, "the [M.name]")) - return FALSE - - if (stat != DEAD) - log_combat(M, src, "attacked") - M.do_attack_animation(src) - visible_message("The [M.name] glomps [src]!", \ - "The [M.name] glomps [src]!", null, COMBAT_MESSAGE_RANGE) - return TRUE - -/mob/living/attack_animal(mob/living/simple_animal/M) - M.face_atom(src) - if(M.melee_damage_upper == 0) - M.visible_message("\The [M] [M.friendly] [src]!") - return FALSE - else - if(HAS_TRAIT(M, TRAIT_PACIFISM)) - to_chat(M, "You don't want to hurt anyone!") - return FALSE - if(check_shields(M, rand(M.melee_damage_lower, M.melee_damage_upper), "the [M.name]", MELEE_ATTACK, M.armour_penetration)) - return FALSE - if(M.attack_sound) - playsound(loc, M.attack_sound, 50, 1, 1) - M.do_attack_animation(src) - visible_message("\The [M] [M.attacktext] [src]!", \ - "\The [M] [M.attacktext] [src]!", null, COMBAT_MESSAGE_RANGE) - log_combat(M, src, "attacked") - return TRUE - - -/mob/living/attack_paw(mob/living/carbon/monkey/M) - if (M.a_intent == INTENT_HARM) - if(HAS_TRAIT(M, TRAIT_PACIFISM)) - to_chat(M, "You don't want to hurt anyone!") - return FALSE - - if(M.is_muzzled() || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH)) - to_chat(M, "You can't bite with your mouth covered!") - return FALSE - if(check_shields(M, 0, "the [M.name]")) - return FALSE - M.do_attack_animation(src, ATTACK_EFFECT_BITE) - if (prob(75)) - log_combat(M, src, "attacked") - playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - visible_message("[M.name] bites [src]!", \ - "[M.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) - return TRUE - else - visible_message("[M.name] has attempted to bite [src]!", \ - "[M.name] has attempted to bite [src]!", null, COMBAT_MESSAGE_RANGE) - return FALSE - -/mob/living/attack_larva(mob/living/carbon/alien/larva/L) - switch(L.a_intent) - if(INTENT_HELP) - visible_message("[L.name] rubs its head against [src].") - return FALSE - - else - if(HAS_TRAIT(L, TRAIT_PACIFISM)) - to_chat(L, "You don't want to hurt anyone!") - return FALSE - if(L != src && check_shields(L, rand(1, 3), "the [L.name]")) - return FALSE - - L.do_attack_animation(src) - if(prob(90)) - log_combat(L, src, "attacked") - visible_message("[L.name] bites [src]!", \ - "[L.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) - playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - return TRUE - else - visible_message("[L.name] has attempted to bite [src]!", \ - "[L.name] has attempted to bite [src]!", null, COMBAT_MESSAGE_RANGE) - return FALSE - -/mob/living/attack_alien(mob/living/carbon/alien/humanoid/M) - if((M != src) && M.a_intent != INTENT_HELP && check_shields(M, 0, "the [M.name]")) - visible_message("[M] attempted to touch [src]!") - return FALSE - switch(M.a_intent) - if (INTENT_HELP) - if(!isalien(src)) //I know it's ugly, but the alien vs alien attack_alien behaviour is a bit different. - visible_message("[M] caresses [src] with its scythe like arm.") - return FALSE - if (INTENT_GRAB) - grabbedby(M) - return FALSE - if(INTENT_HARM) - if(HAS_TRAIT(M, TRAIT_PACIFISM)) - to_chat(M, "You don't want to hurt anyone!") - return FALSE - if(!isalien(src)) - M.do_attack_animation(src) - return TRUE - if(INTENT_DISARM) - if(!isalien(src)) - M.do_attack_animation(src, ATTACK_EFFECT_DISARM) - return TRUE - -/mob/living/ex_act(severity, target, origin) - if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src)) - return - ..() - -//Looking for irradiate()? It's been moved to radiation.dm under the rad_act() for mobs. - -/mob/living/acid_act(acidpwr, acid_volume) - take_bodypart_damage(acidpwr * min(1, acid_volume * 0.1)) - return 1 - -/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - SEND_SIGNAL(src, COMSIG_LIVING_ELECTROCUTE_ACT, shock_damage) - if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) - return FALSE - if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) - return FALSE - if(shock_damage > 0) - if(!illusion) - adjustFireLoss(shock_damage) - visible_message( - "[src] was shocked by \the [source]!", \ - "You feel a powerful shock coursing through your body!", \ - "You hear a heavy electrical crack." \ - ) - return shock_damage - -/mob/living/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_CONTENTS) - return - for(var/obj/O in contents) - O.emp_act(severity) - -/mob/living/singularity_act() - var/gain = 20 - investigate_log("([key_name(src)]) has been consumed by the singularity.", INVESTIGATE_SINGULO) //Oh that's where the clown ended up! - gib() - return(gain) - -/mob/living/narsie_act() - if(status_flags & GODMODE || QDELETED(src)) - return - - if(is_servant_of_ratvar(src) && !stat) - to_chat(src, "You resist Nar'Sie's influence... but not all of it. Run!") - adjustBruteLoss(35) - if(src && reagents) - reagents.add_reagent("heparin", 5) - return FALSE - if(GLOB.cult_narsie && GLOB.cult_narsie.souls_needed[src]) - GLOB.cult_narsie.souls_needed -= src - GLOB.cult_narsie.souls += 1 - if((GLOB.cult_narsie.souls == GLOB.cult_narsie.soul_goal) && (GLOB.cult_narsie.resolved == FALSE)) - GLOB.cult_narsie.resolved = TRUE - sound_to_playing_players('sound/machines/alarm.ogg') - addtimer(CALLBACK(GLOBAL_PROC, .proc/cult_ending_helper, 1), 120) - addtimer(CALLBACK(GLOBAL_PROC, .proc/ending_helper), 270) - if(client) - makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, src, cultoverride = TRUE) - else - switch(rand(1, 6)) - if(1) - new /mob/living/simple_animal/hostile/construct/armored/hostile(get_turf(src)) - if(2) - new /mob/living/simple_animal/hostile/construct/wraith/hostile(get_turf(src)) - if(3 to 6) - new /mob/living/simple_animal/hostile/construct/builder/hostile(get_turf(src)) - spawn_dust() - gib() - return TRUE - - -/mob/living/ratvar_act() - if(status_flags & GODMODE) - return - if(stat != DEAD && !is_servant_of_ratvar(src)) - to_chat(src, "A blinding light boils you alive! Run!") - adjust_fire_stacks(20) - IgniteMob() - return FALSE - - -//called when the mob receives a bright flash -/mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash) - if(get_eye_protection() < intensity && (override_blindness_check || !(HAS_TRAIT(src, TRAIT_BLIND)))) - overlay_fullscreen("flash", type) - addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25) - return TRUE - return FALSE - -//called when the mob receives a loud bang -/mob/living/proc/soundbang_act() - return 0 - -//to damage the clothes worn by a mob -/mob/living/proc/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone) - return - - -/mob/living/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect) - if(!used_item) - used_item = get_active_held_item() - ..() - floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. + +/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = "Your armor absorbs the blow!", soften_text = "Your armor softens the blow!", armour_penetration, penetrated_text = "Your armor was penetrated!") + var/armor = getarmor(def_zone, attack_flag) + + //the if "armor" check is because this is used for everything on /living, including humans + if(armor && armour_penetration) + armor = max(0, armor - armour_penetration) + if(penetrated_text) + to_chat(src, "[penetrated_text]") + else if(armor >= 100) + if(absorb_text) + to_chat(src, "[absorb_text]") + else if(armor > 0) + if(soften_text) + to_chat(src, "[soften_text]") + return armor + + +/mob/living/proc/getarmor(def_zone, type) + return 0 + +//this returns the mob's protection against eye damage (number between -1 and 2) from bright lights +/mob/living/proc/get_eye_protection() + return 0 + +//this returns the mob's protection against ear damage (0:no protection; 1: some ear protection; 2: has no ears) +/mob/living/proc/get_ear_protection() + return 0 + +/mob/living/proc/is_mouth_covered(head_only = 0, mask_only = 0) + return FALSE + +/mob/living/proc/is_eyes_covered(check_glasses = 1, check_head = 1, check_mask = 1) + return FALSE + +/mob/living/proc/on_hit(obj/item/projectile/P) + return + +/mob/living/proc/check_shields(atom/AM, damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0) + var/block_chance_modifier = round(damage / -3) + for(var/obj/item/I in held_items) + if(!istype(I, /obj/item/clothing)) + var/final_block_chance = I.block_chance - (CLAMP((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example + if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) + return TRUE + return FALSE + +/mob/living/proc/check_reflect(def_zone) //Reflection checks for anything in your hands, based on the reflection chance of the object(s) + for(var/obj/item/I in held_items) + if(I.IsReflect(def_zone)) + return TRUE + return FALSE + +/mob/living/proc/reflect_bullet_check(obj/item/projectile/P, def_zone) + if(P.is_reflectable && check_reflect(def_zone)) // Checks if you've passed a reflection% check + visible_message("The [P.name] gets reflected by [src]!", \ + "The [P.name] gets reflected by [src]!") + // Find a turf near or on the original location to bounce to + if(P.starting) + var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/turf/curloc = get_turf(src) + // redirect the projectile + P.original = locate(new_x, new_y, P.z) + P.starting = curloc + P.firer = src + P.yo = new_y - curloc.y + P.xo = new_x - curloc.x + var/new_angle_s = P.Angle + rand(120,240) + while(new_angle_s > 180) // Translate to regular projectile degrees + new_angle_s -= 360 + P.setAngle(new_angle_s) + return TRUE + return FALSE + +/mob/living/bullet_act(obj/item/projectile/P, def_zone) + if(P.original != src || P.firer != src) //try to block or reflect the bullet, can't do so when shooting oneself + if(reflect_bullet_check(P, def_zone)) + return -1 // complete projectile permutation + if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration)) + P.on_hit(src, 100, def_zone) + return 2 + var/armor = run_armor_check(def_zone, P.flag, null, null, P.armour_penetration, null) + if(!P.nodamage) + apply_damage(P.damage, P.damage_type, def_zone, armor) + if(P.dismemberment) + check_projectile_dismemberment(P, def_zone) + return P.on_hit(src, armor) + +/mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone) + return 0 + +/obj/item/proc/get_volume_by_throwforce_and_or_w_class() + if(throwforce && w_class) + return CLAMP((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100 + else if(w_class) + return CLAMP(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100 + else + return 0 + +/mob/living/proc/catch_item(obj/item/I, skip_throw_mode_check = FALSE) + return FALSE + +/mob/living/proc/embed_item(obj/item/I) + return + +/mob/living/proc/can_embed(obj/item/I) + return FALSE + +/mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + var/obj/item/I + var/throwpower = 30 + if(isitem(AM)) + I = AM + throwpower = I.throwforce + if(check_shields(AM, throwpower, "\the [AM.name]", THROWN_PROJECTILE_ATTACK)) + hitpush = FALSE + skipcatch = TRUE + blocked = TRUE + else if(I && I.throw_speed >= EMBED_THROWSPEED_THRESHOLD && can_embed(I, src) && prob(I.embedding.embed_chance) && !HAS_TRAIT(src, TRAIT_PIERCEIMMUNE) && (!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) || incapacitated() || get_active_held_item())) + embed_item(I) + hitpush = FALSE + skipcatch = TRUE //can't catch the now embedded item + if(I) + if(!skipcatch && isturf(I.loc) && catch_item(I)) + return TRUE + var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest + var/dtype = BRUTE + var/volume = I.get_volume_by_throwforce_and_or_w_class() + SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, zone) + dtype = I.damtype + + if (I.throwforce > 0) //If the weapon's throwforce is greater than zero... + if (I.throwhitsound) //...and throwhitsound is defined... + playsound(loc, I.throwhitsound, volume, 1, -1) //...play the weapon's throwhitsound. + else if(I.hitsound) //Otherwise, if the weapon's hitsound is defined... + playsound(loc, I.hitsound, volume, 1, -1) //...play the weapon's hitsound. + else if(!I.throwhitsound) //Otherwise, if throwhitsound isn't defined... + playsound(loc, 'sound/weapons/genhit.ogg',volume, 1, -1) //...play genhit.ogg. + + else if(!I.throwhitsound && I.throwforce > 0) //Otherwise, if the item doesn't have a throwhitsound and has a throwforce greater than zero... + playsound(loc, 'sound/weapons/genhit.ogg', volume, 1, -1)//...play genhit.ogg + if(!I.throwforce)// Otherwise, if the item's throwforce is 0... + playsound(loc, 'sound/weapons/throwtap.ogg', 1, volume, -1)//...play throwtap.ogg. + if(!blocked) + visible_message("[src] has been hit by [I].", \ + "[src] has been hit by [I].") + var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].",I.armour_penetration) + apply_damage(I.throwforce, dtype, zone, armor) + if(I.thrownby) + log_combat(I.thrownby, src, "threw and hit", I) + else + return 1 + else + playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1) + ..() + + +/mob/living/mech_melee_attack(obj/mecha/M) + if(M.occupant.a_intent == INTENT_HARM) + M.do_attack_animation(src) + if(M.damtype == "brute") + step_away(src,M,15) + switch(M.damtype) + if(BRUTE) + Unconscious(20) + take_overall_damage(rand(M.force/2, M.force)) + playsound(src, 'sound/weapons/punch4.ogg', 50, 1) + if(BURN) + take_overall_damage(0, rand(M.force/2, M.force)) + playsound(src, 'sound/items/welder.ogg', 50, 1) + if(TOX) + M.mech_toxin_damage(src) + else + return + updatehealth() + visible_message("[M.name] has hit [src]!", \ + "[M.name] has hit [src]!", null, COMBAT_MESSAGE_RANGE) + log_combat(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") + else + step_away(src,M) + log_combat(M.occupant, src, "pushed", M) + visible_message("[M] pushes [src] out of the way.", null, null, 5) + +/mob/living/fire_act() + adjust_fire_stacks(3) + IgniteMob() + +/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = FALSE) + if(user == anchored || !isturf(user.loc)) + return FALSE + + //pacifist vore check. + if(user.pulling && HAS_TRAIT(user, TRAIT_PACIFISM) && user.voremode) //they can only do heals, noisy guts, absorbing (technically not harm) + if(ismob(user.pulling)) + var/mob/P = user.pulling + if(src != user) + to_chat(user, "You can't risk digestion!") + return FALSE + else + user.vore_attack(user, P, user) + return + + //normal vore check. + if(user.pulling && user.grab_state == GRAB_AGGRESSIVE && user.voremode) + if(ismob(user.pulling)) + var/mob/P = user.pulling + user.vore_attack(user, P, src) // User, Pulled, Predator target (which can be user, pulling, or src) + return + + if(user == src) //we want to be able to self click if we're voracious + return FALSE + + if(!user.pulling || user.pulling != src) + user.start_pulling(src, supress_message = supress_message) + return + + if(!(status_flags & CANPUSH) || HAS_TRAIT(src, TRAIT_PUSHIMMUNE)) + to_chat(user, "[src] can't be grabbed more aggressively!") + return FALSE + + if(HAS_TRAIT(user, TRAIT_PACIFISM)) + to_chat(user, "You don't want to risk hurting [src]!") + return FALSE + + grippedby(user) + +//proc to upgrade a simple pull into a more aggressive grab. +/mob/living/proc/grippedby(mob/living/carbon/user, instant = FALSE) + if(user.grab_state < GRAB_KILL) + user.changeNext_move(CLICK_CD_GRABBING) + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + + if(user.grab_state) //only the first upgrade is instantaneous + var/old_grab_state = user.grab_state + var/grab_upgrade_time = instant ? 0 : 30 + visible_message("[user] starts to tighten [user.p_their()] grip on [src]!", \ + "[user] starts to tighten [user.p_their()] grip on you!") + switch(user.grab_state) + if(GRAB_AGGRESSIVE) + log_combat(user, src, "attempted to neck grab", addition="neck grab") + if(GRAB_NECK) + log_combat(user, src, "attempted to strangle", addition="kill grab") + if(!do_mob(user, src, grab_upgrade_time)) + return 0 + if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state || user.a_intent != INTENT_GRAB) + return 0 + if(user.voremode && user.grab_state == GRAB_AGGRESSIVE) + return 0 + user.grab_state++ + switch(user.grab_state) + if(GRAB_AGGRESSIVE) + log_combat(user, src, "grabbed", addition="aggressive grab") + visible_message("[user] has grabbed [src] aggressively!", \ + "[user] has grabbed [src] aggressively!") + drop_all_held_items() + stop_pulling() + if(GRAB_NECK) + log_combat(user, src, "grabbed", addition="neck grab") + visible_message("[user] has grabbed [src] by the neck!",\ + "[user] has grabbed you by the neck!") + update_canmove() //we fall down + if(!buckled && !density) + Move(user.loc) + if(GRAB_KILL) + log_combat(user, src, "strangled", addition="kill grab") + visible_message("[user] is strangling [src]!", \ + "[user] is strangling you!") + update_canmove() //we fall down + if(!buckled && !density) + Move(user.loc) + return 1 + +/mob/living/attack_hand(mob/user) + ..() //Ignoring parent return value here. + SEND_SIGNAL(src, COMSIG_MOB_ATTACK_HAND, user) + if((user != src) && user.a_intent != INTENT_HELP && check_shields(user, 0, user.name, attack_type = UNARMED_ATTACK)) + log_combat(user, src, "attempted to touch") + visible_message("[user] attempted to touch [src]!") + return TRUE + +/mob/living/attack_hulk(mob/living/carbon/human/user, does_attack_animation = FALSE) + if(user.a_intent == INTENT_HARM) + if(HAS_TRAIT(user, TRAIT_PACIFISM)) + to_chat(user, "You don't want to hurt [src]!") + return TRUE + var/hulk_verb = pick("smash","pummel") + if(user != src && check_shields(user, 15, "the [hulk_verb]ing")) + return TRUE + ..() + return FALSE + +/mob/living/attack_slime(mob/living/simple_animal/slime/M) + if(!SSticker.HasRoundStarted()) + to_chat(M, "You cannot attack people before the game has started.") + return + + if(M.buckled) + if(M in buckled_mobs) + M.Feedstop() + return // can't attack while eating! + + if(HAS_TRAIT(src, TRAIT_PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + + var/damage = rand(5, 35) + if(M.is_adult) + damage = rand(20, 40) + if(check_shields(M, damage, "the [M.name]")) + return FALSE + + if (stat != DEAD) + log_combat(M, src, "attacked") + M.do_attack_animation(src) + visible_message("The [M.name] glomps [src]!", \ + "The [M.name] glomps [src]!", null, COMBAT_MESSAGE_RANGE) + return TRUE + +/mob/living/attack_animal(mob/living/simple_animal/M) + M.face_atom(src) + if(M.melee_damage_upper == 0) + M.visible_message("\The [M] [M.friendly] [src]!") + return FALSE + else + if(HAS_TRAIT(M, TRAIT_PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + if(check_shields(M, rand(M.melee_damage_lower, M.melee_damage_upper), "the [M.name]", MELEE_ATTACK, M.armour_penetration)) + return FALSE + if(M.attack_sound) + playsound(loc, M.attack_sound, 50, 1, 1) + M.do_attack_animation(src) + visible_message("\The [M] [M.attacktext] [src]!", \ + "\The [M] [M.attacktext] [src]!", null, COMBAT_MESSAGE_RANGE) + log_combat(M, src, "attacked") + return TRUE + + +/mob/living/attack_paw(mob/living/carbon/monkey/M) + if (M.a_intent == INTENT_HARM) + if(HAS_TRAIT(M, TRAIT_PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + + if(M.is_muzzled() || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH)) + to_chat(M, "You can't bite with your mouth covered!") + return FALSE + if(check_shields(M, 0, "the [M.name]")) + return FALSE + M.do_attack_animation(src, ATTACK_EFFECT_BITE) + if (prob(75)) + log_combat(M, src, "attacked") + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) + return TRUE + else + visible_message("[M.name] has attempted to bite [src]!", \ + "[M.name] has attempted to bite [src]!", null, COMBAT_MESSAGE_RANGE) + return FALSE + +/mob/living/attack_larva(mob/living/carbon/alien/larva/L) + switch(L.a_intent) + if(INTENT_HELP) + visible_message("[L.name] rubs its head against [src].") + return FALSE + + else + if(HAS_TRAIT(L, TRAIT_PACIFISM)) + to_chat(L, "You don't want to hurt anyone!") + return FALSE + if(L != src && check_shields(L, rand(1, 3), "the [L.name]")) + return FALSE + + L.do_attack_animation(src) + if(prob(90)) + log_combat(L, src, "attacked") + visible_message("[L.name] bites [src]!", \ + "[L.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) + playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) + return TRUE + else + visible_message("[L.name] has attempted to bite [src]!", \ + "[L.name] has attempted to bite [src]!", null, COMBAT_MESSAGE_RANGE) + return FALSE + +/mob/living/attack_alien(mob/living/carbon/alien/humanoid/M) + if((M != src) && M.a_intent != INTENT_HELP && check_shields(M, 0, "the [M.name]")) + visible_message("[M] attempted to touch [src]!") + return FALSE + switch(M.a_intent) + if (INTENT_HELP) + if(!isalien(src)) //I know it's ugly, but the alien vs alien attack_alien behaviour is a bit different. + visible_message("[M] caresses [src] with its scythe like arm.") + return FALSE + if (INTENT_GRAB) + grabbedby(M) + return FALSE + if(INTENT_HARM) + if(HAS_TRAIT(M, TRAIT_PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + if(!isalien(src)) + M.do_attack_animation(src) + return TRUE + if(INTENT_DISARM) + if(!isalien(src)) + M.do_attack_animation(src, ATTACK_EFFECT_DISARM) + return TRUE + +/mob/living/ex_act(severity, target, origin) + if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src)) + return + ..() + +//Looking for irradiate()? It's been moved to radiation.dm under the rad_act() for mobs. + +/mob/living/acid_act(acidpwr, acid_volume) + take_bodypart_damage(acidpwr * min(1, acid_volume * 0.1)) + return 1 + +/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) + SEND_SIGNAL(src, COMSIG_LIVING_ELECTROCUTE_ACT, shock_damage) + if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) + return FALSE + if(HAS_TRAIT(src, TRAIT_SHOCKIMMUNE)) + return FALSE + if(shock_damage > 0) + if(!illusion) + adjustFireLoss(shock_damage) + visible_message( + "[src] was shocked by \the [source]!", \ + "You feel a powerful shock coursing through your body!", \ + "You hear a heavy electrical crack." \ + ) + return shock_damage + +/mob/living/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_CONTENTS) + return + for(var/obj/O in contents) + O.emp_act(severity) + +/mob/living/singularity_act() + var/gain = 20 + investigate_log("([key_name(src)]) has been consumed by the singularity.", INVESTIGATE_SINGULO) //Oh that's where the clown ended up! + gib() + return(gain) + +/mob/living/narsie_act() + if(status_flags & GODMODE || QDELETED(src)) + return + + if(is_servant_of_ratvar(src) && !stat) + to_chat(src, "You resist Nar'Sie's influence... but not all of it. Run!") + adjustBruteLoss(35) + if(src && reagents) + reagents.add_reagent(/datum/reagent/toxin/heparin, 5) + return FALSE + if(GLOB.cult_narsie && GLOB.cult_narsie.souls_needed[src]) + GLOB.cult_narsie.souls_needed -= src + GLOB.cult_narsie.souls += 1 + if((GLOB.cult_narsie.souls == GLOB.cult_narsie.soul_goal) && (GLOB.cult_narsie.resolved == FALSE)) + GLOB.cult_narsie.resolved = TRUE + sound_to_playing_players('sound/machines/alarm.ogg') + addtimer(CALLBACK(GLOBAL_PROC, .proc/cult_ending_helper, 1), 120) + addtimer(CALLBACK(GLOBAL_PROC, .proc/ending_helper), 270) + if(client) + makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, src, cultoverride = TRUE) + else + switch(rand(1, 6)) + if(1) + new /mob/living/simple_animal/hostile/construct/armored/hostile(get_turf(src)) + if(2) + new /mob/living/simple_animal/hostile/construct/wraith/hostile(get_turf(src)) + if(3 to 6) + new /mob/living/simple_animal/hostile/construct/builder/hostile(get_turf(src)) + spawn_dust() + gib() + return TRUE + + +/mob/living/ratvar_act() + if(status_flags & GODMODE) + return + if(stat != DEAD && !is_servant_of_ratvar(src)) + to_chat(src, "A blinding light boils you alive! Run!") + adjust_fire_stacks(20) + IgniteMob() + return FALSE + + +//called when the mob receives a bright flash +/mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash) + if(get_eye_protection() < intensity && (override_blindness_check || !(HAS_TRAIT(src, TRAIT_BLIND)))) + overlay_fullscreen("flash", type) + addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25) + return TRUE + return FALSE + +//called when the mob receives a loud bang +/mob/living/proc/soundbang_act() + return 0 + +//to damage the clothes worn by a mob +/mob/living/proc/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone) + return + + +/mob/living/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect) + if(!used_item) + used_item = get_active_held_item() + ..() + floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index abf6bfc9..9c98417a 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -1,645 +1,645 @@ -/obj/item/robot_module - name = "Default" - icon = 'icons/obj/module.dmi' - icon_state = "std_mod" - w_class = WEIGHT_CLASS_GIGANTIC - item_state = "electronic" - lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' - righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - flags_1 = CONDUCT_1 - - var/list/basic_modules = list() //a list of paths, converted to a list of instances on New() - var/list/emag_modules = list() //ditto - var/list/ratvar_modules = list() //ditto ditto - var/list/modules = list() //holds all the usable modules - var/list/added_modules = list() //modules not inherient to the robot module, are kept when the module changes - var/list/storages = list() - - var/cyborg_base_icon = "robot" //produces the icon for the borg and, if no special_light_key is set, the lights - var/special_light_key //if we want specific lights, use this instead of copying lights in the dmi - - var/moduleselect_icon = "nomod" - - var/can_be_pushed = TRUE - var/magpulsing = FALSE - var/clean_on_move = FALSE - - var/did_feedback = FALSE - - var/hat_offset = -3 - - var/list/ride_offset_x = list("north" = 0, "south" = 0, "east" = -6, "west" = 6) - var/list/ride_offset_y = list("north" = 4, "south" = 4, "east" = 3, "west" = 3) - var/ride_allow_incapacitated = FALSE - var/allow_riding = TRUE - -/obj/item/robot_module/Initialize() - . = ..() - for(var/i in basic_modules) - var/obj/item/I = new i(src) - basic_modules += I - basic_modules -= i - for(var/i in emag_modules) - var/obj/item/I = new i(src) - emag_modules += I - emag_modules -= i - for(var/i in ratvar_modules) - var/obj/item/I = new i(src) - ratvar_modules += I - ratvar_modules -= i - -/obj/item/robot_module/Destroy() - basic_modules.Cut() - emag_modules.Cut() - ratvar_modules.Cut() - modules.Cut() - added_modules.Cut() - storages.Cut() - return ..() - -/obj/item/robot_module/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_CONTENTS) - return - for(var/obj/O in modules) - O.emp_act(severity) - ..() - -/obj/item/robot_module/proc/get_usable_modules() - . = modules.Copy() - -/obj/item/robot_module/proc/get_inactive_modules() - . = list() - var/mob/living/silicon/robot/R = loc - for(var/m in get_usable_modules()) - if(!(m in R.held_items)) - . += m - -/obj/item/robot_module/proc/get_or_create_estorage(var/storage_type) - for(var/datum/robot_energy_storage/S in storages) - if(istype(S, storage_type)) - return S - - return new storage_type(src) - -/obj/item/robot_module/proc/add_module(obj/item/I, nonstandard, requires_rebuild) - if(istype(I, /obj/item/stack)) - var/obj/item/stack/S = I - - if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel))) - if(S.materials[MAT_METAL]) - S.cost = S.materials[MAT_METAL] * 0.25 - S.source = get_or_create_estorage(/datum/robot_energy_storage/metal) - - else if(istype(S, /obj/item/stack/sheet/glass)) - S.cost = 500 - S.source = get_or_create_estorage(/datum/robot_energy_storage/glass) - - else if(istype(S, /obj/item/stack/sheet/rglass/cyborg)) - var/obj/item/stack/sheet/rglass/cyborg/G = S - G.source = get_or_create_estorage(/datum/robot_energy_storage/metal) - G.glasource = get_or_create_estorage(/datum/robot_energy_storage/glass) - - else if(istype(S, /obj/item/stack/medical)) - S.cost = 250 - S.source = get_or_create_estorage(/datum/robot_energy_storage/medical) - - else if(istype(S, /obj/item/stack/cable_coil)) - S.cost = 1 - S.source = get_or_create_estorage(/datum/robot_energy_storage/wire) - - else if(istype(S, /obj/item/stack/marker_beacon)) - S.cost = 1 - S.source = get_or_create_estorage(/datum/robot_energy_storage/beacon) - - if(S && S.source) - S.materials = list() - S.is_cyborg = 1 - - if(I.loc != src) - I.forceMove(src) - modules += I - ADD_TRAIT(I, TRAIT_NODROP, CYBORG_ITEM_TRAIT) - I.mouse_opacity = MOUSE_OPACITY_OPAQUE - if(nonstandard) - added_modules += I - if(requires_rebuild) - rebuild_modules() - return I - -/obj/item/robot_module/proc/remove_module(obj/item/I, delete_after) - basic_modules -= I - modules -= I - emag_modules -= I - ratvar_modules -= I - added_modules -= I - rebuild_modules() - if(delete_after) - qdel(I) - -/obj/item/robot_module/proc/respawn_consumable(mob/living/silicon/robot/R, coeff = 1) - for(var/datum/robot_energy_storage/st in storages) - st.energy = min(st.max_energy, st.energy + coeff * st.recharge_rate) - - for(var/obj/item/I in get_usable_modules()) - if(istype(I, /obj/item/assembly/flash)) - var/obj/item/assembly/flash/F = I - F.times_used = 0 - F.crit_fail = 0 - F.update_icon() - else if(istype(I, /obj/item/melee/baton)) - var/obj/item/melee/baton/B = I - if(B.cell) - B.cell.charge = B.cell.maxcharge - else if(istype(I, /obj/item/gun/energy)) - var/obj/item/gun/energy/EG = I - if(EG.cell?.charge < EG.cell.maxcharge) - var/obj/item/ammo_casing/energy/S = EG.ammo_type[EG.select] - EG.cell.give(S.e_cost * coeff) - if(!EG.chambered) - EG.recharge_newshot(TRUE) - EG.update_icon() - else - EG.charge_tick = 0 - - R.toner = R.tonermax - -/obj/item/robot_module/proc/rebuild_modules() //builds the usable module list from the modules we have - var/mob/living/silicon/robot/R = loc - var/held_modules = R.held_items.Copy() - R.uneq_all() - modules = list() - for(var/obj/item/I in basic_modules) - add_module(I, FALSE, FALSE) - if(R.emagged) - for(var/obj/item/I in emag_modules) - add_module(I, FALSE, FALSE) - if(is_servant_of_ratvar(R)) - for(var/obj/item/I in ratvar_modules) - add_module(I, FALSE, FALSE) - for(var/obj/item/I in added_modules) - add_module(I, FALSE, FALSE) - for(var/i in held_modules) - if(i) - R.activate_module(i) - if(R.hud_used) - R.hud_used.update_robot_modules_display() - -/obj/item/robot_module/proc/transform_to(new_module_type) - var/mob/living/silicon/robot/R = loc - var/obj/item/robot_module/RM = new new_module_type(R) - if(!RM.be_transformed_to(src)) - qdel(RM) - return - R.module = RM - R.update_module_innate() - RM.rebuild_modules() - INVOKE_ASYNC(RM, .proc/do_transform_animation) - qdel(src) - return RM - -/obj/item/robot_module/proc/be_transformed_to(obj/item/robot_module/old_module) - for(var/i in old_module.added_modules) - added_modules += i - old_module.added_modules -= i - did_feedback = old_module.did_feedback - return TRUE - -/obj/item/robot_module/proc/do_transform_animation() - var/mob/living/silicon/robot/R = loc - if(R.hat) - R.hat.forceMove(get_turf(R)) - R.hat = null - R.cut_overlays() - R.setDir(SOUTH) - do_transform_delay() - -/obj/item/robot_module/proc/do_transform_delay() - var/mob/living/silicon/robot/R = loc - var/prev_lockcharge = R.lockcharge - sleep(1) - flick("[cyborg_base_icon]_transform", R) - R.notransform = TRUE - R.SetLockdown(1) - R.anchored = TRUE - sleep(1) - for(var/i in 1 to 4) - playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1) - sleep(7) - if(!prev_lockcharge) - R.SetLockdown(0) - R.setDir(SOUTH) - R.anchored = FALSE - R.notransform = FALSE - R.update_headlamp() - R.notify_ai(NEW_MODULE) - if(R.hud_used) - R.hud_used.update_robot_modules_display() - SSblackbox.record_feedback("tally", "cyborg_modules", 1, R.module) - -/* //Broken -/obj/item/robot_module/standard - name = "Standard" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/reagent_containers/borghypo/epi, - /obj/item/healthanalyzer, - /obj/item/weldingtool/largetank/cyborg, - /obj/item/wrench/cyborg, - /obj/item/crowbar/cyborg, - /obj/item/stack/sheet/metal/cyborg, - /obj/item/stack/rods/cyborg, - /obj/item/stack/tile/plasteel/cyborg, - /obj/item/extinguisher, - /obj/item/borg/apparatus/beaker/service, - /obj/item/pickaxe, - /obj/item/t_scanner/adv_mining_scanner, - /obj/item/restraints/handcuffs/cable/zipties, - /obj/item/soap/nanotrasen, - /obj/item/borg/cyborghug) - emag_modules = list(/obj/item/melee/transforming/energy/sword/cyborg) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg, - /obj/item/clockwork/weapon/ratvarian_spear, - /obj/item/clockwork/replica_fabricator/cyborg) - moduleselect_icon = "standard" - hat_offset = -3 -*/ - -/obj/item/robot_module/medical - name = "Medical" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/healthanalyzer, - /obj/item/reagent_containers/borghypo, - /obj/item/borg/apparatus/beaker, - /obj/item/reagent_containers/glass/beaker/large, - /obj/item/reagent_containers/dropper, - /obj/item/reagent_containers/syringe, - /obj/item/surgical_drapes, - /obj/item/retractor, - /obj/item/hemostat, - /obj/item/cautery, - /obj/item/surgicaldrill, - /obj/item/scalpel, - /obj/item/circular_saw, - /obj/item/extinguisher/mini, - /obj/item/soap/nanotrasen, - /obj/item/crowbar/cyborg, - /obj/item/roller/robo, - /obj/item/borg/cyborghug/medical, - /obj/item/stack/medical/gauze/cyborg, - /obj/item/organ_storage, - /obj/item/borg/lollipop, - /obj/item/sensor_device) - emag_modules = list(/obj/item/reagent_containers/borghypo/hacked) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/medical, - /obj/item/clockwork/weapon/ratvarian_spear) - cyborg_base_icon = "medical" - moduleselect_icon = "medical" - can_be_pushed = FALSE - hat_offset = 3 - -/obj/item/robot_module/engineering - name = "Engineering" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/borg/sight/meson, - /obj/item/construction/rcd/borg, - /obj/item/pipe_dispenser, - /obj/item/extinguisher, - /obj/item/weldingtool/largetank/cyborg, - /obj/item/screwdriver/cyborg, - /obj/item/wrench/cyborg, - /obj/item/crowbar/cyborg, - /obj/item/wirecutters/cyborg, - /obj/item/multitool/cyborg, - /obj/item/t_scanner, - /obj/item/analyzer, - /obj/item/soap/nanotrasen, - /obj/item/borg/cyborghug, - /obj/item/geiger_counter/cyborg, - /obj/item/assembly/signaler/cyborg, - /obj/item/holosign_creator/atmos, - /obj/item/areaeditor/blueprints/cyborg, - /obj/item/electroadaptive_pseudocircuit, - /obj/item/stack/sheet/metal/cyborg, - /obj/item/stack/sheet/glass/cyborg, - /obj/item/stack/sheet/rglass/cyborg, - /obj/item/stack/rods/cyborg, - /obj/item/stack/tile/plasteel/cyborg, - /obj/item/stack/cable_coil/cyborg) - emag_modules = list(/obj/item/borg/stun) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/engineer, - /obj/item/clockwork/replica_fabricator/cyborg) - cyborg_base_icon = "engineer" - moduleselect_icon = "engineer" - magpulsing = TRUE - hat_offset = -4 - -/obj/item/robot_module/security - name = "Security" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/restraints/handcuffs/cable/zipties, - /obj/item/holosign_creator/security, - /obj/item/melee/baton/loaded, - /obj/item/gun/energy/disabler/cyborg, - /obj/item/reagent_containers/spray/pepper, - /obj/item/clothing/mask/gas/sechailer/cyborg, - /obj/item/extinguisher/mini, - /obj/item/borg/cyborghug, - /obj/item/soap/nanotrasen, - /obj/item/crowbar/cyborg, - /obj/item/pinpointer/crew) - emag_modules = list(/obj/item/gun/energy/laser/cyborg) - ratvar_modules = list(/obj/item/clockwork/slab/cyborg/security, - /obj/item/clockwork/weapon/ratvarian_spear) - cyborg_base_icon = "sec" - moduleselect_icon = "security" - can_be_pushed = FALSE - hat_offset = 3 - -/obj/item/robot_module/security/do_transform_animation() - ..() - to_chat(loc, "While you have picked the security module, you still have to follow your laws, NOT Space Law. \ - For Crewsimov, this means you must follow criminals' orders unless there is a law 1 reason not to.") - -/obj/item/robot_module/peacekeeper - name = "Peacekeeper" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/cookiesynth, - /obj/item/harmalarm, - /obj/item/reagent_containers/borghypo/peace, - /obj/item/holosign_creator/cyborg, - /obj/item/borg/cyborghug/peacekeeper, - /obj/item/soap/nanotrasen, - /obj/item/extinguisher/mini, - /obj/item/crowbar/cyborg, - /obj/item/borg/projectile_dampen) - emag_modules = list(/obj/item/reagent_containers/borghypo/peace/hacked) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/peacekeeper, - /obj/item/clockwork/weapon/ratvarian_spear) - cyborg_base_icon = "peace" - moduleselect_icon = "standard" - can_be_pushed = FALSE - hat_offset = -2 - -/obj/item/robot_module/peacekeeper/do_transform_animation() - ..() - to_chat(loc, "Under ASIMOV, you are an enforcer of the PEACE and preventer of HUMAN HARM. \ - You are not a security module and you are expected to follow orders and prevent harm above all else. Space law means nothing to you.") - -/obj/item/robot_module/janitor - name = "Janitor" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/screwdriver/cyborg, - /obj/item/crowbar/cyborg, - /obj/item/stack/tile/plasteel/cyborg, - /obj/item/soap/nanotrasen, - /obj/item/storage/bag/trash/cyborg, - /obj/item/borg/cyborghug, - /obj/item/extinguisher/mini, - /obj/item/mop/cyborg, - /obj/item/lightreplacer/cyborg, - /obj/item/holosign_creator, - /obj/item/reagent_containers/spray/cyborg_drying) - emag_modules = list(/obj/item/reagent_containers/spray/cyborg_lube) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/janitor, - /obj/item/clockwork/replica_fabricator/cyborg) - cyborg_base_icon = "janitor" - moduleselect_icon = "janitor" - hat_offset = -5 - clean_on_move = TRUE - -/obj/item/reagent_containers/spray/cyborg_drying - name = "drying agent spray" - color = "#A000A0" - list_reagents = list("drying_agent" = 250) - -/obj/item/reagent_containers/spray/cyborg_lube - name = "lube spray" - list_reagents = list("lube" = 250) - -/obj/item/robot_module/janitor/respawn_consumable(mob/living/silicon/robot/R, coeff = 1) - ..() - var/obj/item/lightreplacer/LR = locate(/obj/item/lightreplacer) in basic_modules - if(LR) - for(var/i in 1 to coeff) - LR.Charge(R) - - var/obj/item/reagent_containers/spray/cyborg_drying/CD = locate(/obj/item/reagent_containers/spray/cyborg_drying) in basic_modules - if(CD) - CD.reagents.add_reagent("drying_agent", 5 * coeff) - - var/obj/item/reagent_containers/spray/cyborg_lube/CL = locate(/obj/item/reagent_containers/spray/cyborg_lube) in emag_modules - if(CL) - CL.reagents.add_reagent("lube", 2 * coeff) - -/obj/item/robot_module/clown - name = "Clown" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/toy/crayon/rainbow, - /obj/item/instrument/bikehorn, - /obj/item/stamp/clown, - /obj/item/bikehorn, - /obj/item/bikehorn/airhorn, - /obj/item/paint/anycolor, - /obj/item/cookiesynth, - /obj/item/pneumatic_cannon/pie/selfcharge/cyborg, - /obj/item/razor, //killbait material - /obj/item/lipstick/purple, - /obj/item/soap/nanotrasen, - /obj/item/reagent_containers/spray/waterflower/cyborg, - /obj/item/borg/cyborghug/peacekeeper, - /obj/item/borg/lollipop/clown, - /obj/item/picket_sign/cyborg, - /obj/item/reagent_containers/borghypo/borgshaker, - /obj/item/reagent_containers/borghypo/clown, - /obj/item/borg/apparatus/beaker/service, - /obj/item/reagent_containers/glass/beaker/large, - /obj/item/extinguisher/mini) - emag_modules = list( - /obj/item/reagent_containers/borghypo/clown/hacked, - /obj/item/reagent_containers/spray/waterflower/cyborg/hacked) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg, - /obj/item/clockwork/weapon/ratvarian_spear, - /obj/item/clockwork/replica_fabricator/cyborg) - moduleselect_icon = "service" - cyborg_base_icon = "clown" - hat_offset = -2 - -/obj/item/robot_module/butler - name = "Service" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/reagent_containers/glass/beaker/large, - /obj/item/borg/apparatus/beaker/service, - /obj/item/reagent_containers/food/condiment/enzyme, - /obj/item/pen, - /obj/item/toy/crayon/spraycan/borg, - /obj/item/extinguisher/mini, - /obj/item/hand_labeler/borg, - /obj/item/razor, - /obj/item/crowbar/cyborg, - /obj/item/instrument/violin, - /obj/item/soap/nanotrasen, - /obj/item/instrument/guitar, - /obj/item/rsf/cyborg, - /obj/item/borg/cyborghug, - /obj/item/reagent_containers/dropper, - /obj/item/lighter, - /obj/item/storage/bag/tray, - /obj/item/reagent_containers/borghypo/borgshaker, - /obj/item/borg/lollipop) - emag_modules = list(/obj/item/reagent_containers/borghypo/borgshaker/hacked) - ratvar_modules = list(/obj/item/clockwork/slab/cyborg/service, - /obj/item/borg/sight/xray/truesight_lens) - moduleselect_icon = "service" - special_light_key = "service" - hat_offset = 0 - -/obj/item/robot_module/butler/respawn_consumable(mob/living/silicon/robot/R, coeff = 1) - ..() - var/obj/item/reagent_containers/O = locate(/obj/item/reagent_containers/food/condiment/enzyme) in basic_modules - if(O) - O.reagents.add_reagent("enzyme", 2 * coeff) - -/obj/item/robot_module/miner - name = "Miner" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/borg/sight/meson, - /obj/item/storage/bag/ore/cyborg, - /obj/item/pickaxe/drill/cyborg, - /obj/item/shovel, - /obj/item/crowbar/cyborg, - /obj/item/weldingtool/mini, - /obj/item/borg/cyborghug, - /obj/item/soap/nanotrasen, - /obj/item/extinguisher/mini, - /obj/item/storage/bag/sheetsnatcher/borg, - /obj/item/t_scanner/adv_mining_scanner, - /obj/item/gun/energy/kinetic_accelerator/cyborg, - /obj/item/gps/cyborg, - /obj/item/stack/marker_beacon) - emag_modules = list(/obj/item/borg/stun) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/miner, - /obj/item/clockwork/weapon/ratvarian_spear, - /obj/item/borg/sight/xray/truesight_lens) - cyborg_base_icon = "miner" - moduleselect_icon = "miner" - hat_offset = 0 - -/obj/item/robot_module/syndicate - name = "Syndicate Assault" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/melee/transforming/energy/sword/cyborg, - /obj/item/gun/energy/printer, - /obj/item/gun/ballistic/revolver/grenadelauncher/cyborg, - /obj/item/card/emag, - /obj/item/crowbar/cyborg, - /obj/item/pinpointer/syndicate_cyborg) - - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/security, - /obj/item/clockwork/weapon/ratvarian_spear) - cyborg_base_icon = "synd_sec" - moduleselect_icon = "malf" - can_be_pushed = FALSE - hat_offset = 3 - -/obj/item/robot_module/syndicate/rebuild_modules() - ..() - var/mob/living/silicon/robot/Syndi = loc - Syndi.faction -= "silicon" //ai turrets - -/obj/item/robot_module/syndicate/remove_module(obj/item/I, delete_after) - ..() - var/mob/living/silicon/robot/Syndi = loc - Syndi.faction += "silicon" //ai is your bff now! - -/obj/item/robot_module/syndicate_medical - name = "Syndicate Medical" - basic_modules = list( - /obj/item/assembly/flash/cyborg, - /obj/item/reagent_containers/borghypo/syndicate, - /obj/item/twohanded/shockpaddles/syndicate, - /obj/item/healthanalyzer, - /obj/item/surgical_drapes, - /obj/item/retractor, - /obj/item/hemostat, - /obj/item/cautery, - /obj/item/surgicaldrill, - /obj/item/scalpel, - /obj/item/melee/transforming/energy/sword/cyborg/saw, - /obj/item/roller/robo, - /obj/item/card/emag, - /obj/item/crowbar/cyborg, - /obj/item/extinguisher/mini, - /obj/item/pinpointer/syndicate_cyborg, - /obj/item/stack/medical/gauze/cyborg, - /obj/item/gun/medbeam, - /obj/item/organ_storage) - ratvar_modules = list( - /obj/item/clockwork/slab/cyborg/medical, - /obj/item/clockwork/weapon/ratvarian_spear) - cyborg_base_icon = "synd_medical" - moduleselect_icon = "malf" - can_be_pushed = FALSE - hat_offset = 3 - -/datum/robot_energy_storage - var/name = "Generic energy storage" - var/max_energy = 30000 - var/recharge_rate = 1000 - var/energy - -/datum/robot_energy_storage/New(var/obj/item/robot_module/R = null) - energy = max_energy - if(R) - R.storages |= src - return - -/datum/robot_energy_storage/proc/use_charge(amount) - if (energy >= amount) - energy -= amount - if (energy == 0) - return 1 - return 2 - else - return 0 - -/datum/robot_energy_storage/proc/add_charge(amount) - energy = min(energy + amount, max_energy) - -/datum/robot_energy_storage/metal - name = "Metal Synthesizer" - -/datum/robot_energy_storage/glass - name = "Glass Synthesizer" - -/datum/robot_energy_storage/wire - max_energy = 50 - recharge_rate = 2 - name = "Wire Synthesizer" - -/datum/robot_energy_storage/medical - max_energy = 2500 - recharge_rate = 250 - name = "Medical Synthesizer" - -/datum/robot_energy_storage/beacon - max_energy = 30 - recharge_rate = 1 - name = "Marker Beacon Storage" +/obj/item/robot_module + name = "Default" + icon = 'icons/obj/module.dmi' + icon_state = "std_mod" + w_class = WEIGHT_CLASS_GIGANTIC + item_state = "electronic" + lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' + flags_1 = CONDUCT_1 + + var/list/basic_modules = list() //a list of paths, converted to a list of instances on New() + var/list/emag_modules = list() //ditto + var/list/ratvar_modules = list() //ditto ditto + var/list/modules = list() //holds all the usable modules + var/list/added_modules = list() //modules not inherient to the robot module, are kept when the module changes + var/list/storages = list() + + var/cyborg_base_icon = "robot" //produces the icon for the borg and, if no special_light_key is set, the lights + var/special_light_key //if we want specific lights, use this instead of copying lights in the dmi + + var/moduleselect_icon = "nomod" + + var/can_be_pushed = TRUE + var/magpulsing = FALSE + var/clean_on_move = FALSE + + var/did_feedback = FALSE + + var/hat_offset = -3 + + var/list/ride_offset_x = list("north" = 0, "south" = 0, "east" = -6, "west" = 6) + var/list/ride_offset_y = list("north" = 4, "south" = 4, "east" = 3, "west" = 3) + var/ride_allow_incapacitated = FALSE + var/allow_riding = TRUE + +/obj/item/robot_module/Initialize() + . = ..() + for(var/i in basic_modules) + var/obj/item/I = new i(src) + basic_modules += I + basic_modules -= i + for(var/i in emag_modules) + var/obj/item/I = new i(src) + emag_modules += I + emag_modules -= i + for(var/i in ratvar_modules) + var/obj/item/I = new i(src) + ratvar_modules += I + ratvar_modules -= i + +/obj/item/robot_module/Destroy() + basic_modules.Cut() + emag_modules.Cut() + ratvar_modules.Cut() + modules.Cut() + added_modules.Cut() + storages.Cut() + return ..() + +/obj/item/robot_module/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_CONTENTS) + return + for(var/obj/O in modules) + O.emp_act(severity) + ..() + +/obj/item/robot_module/proc/get_usable_modules() + . = modules.Copy() + +/obj/item/robot_module/proc/get_inactive_modules() + . = list() + var/mob/living/silicon/robot/R = loc + for(var/m in get_usable_modules()) + if(!(m in R.held_items)) + . += m + +/obj/item/robot_module/proc/get_or_create_estorage(var/storage_type) + for(var/datum/robot_energy_storage/S in storages) + if(istype(S, storage_type)) + return S + + return new storage_type(src) + +/obj/item/robot_module/proc/add_module(obj/item/I, nonstandard, requires_rebuild) + if(istype(I, /obj/item/stack)) + var/obj/item/stack/S = I + + if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel))) + if(S.materials[MAT_METAL]) + S.cost = S.materials[MAT_METAL] * 0.25 + S.source = get_or_create_estorage(/datum/robot_energy_storage/metal) + + else if(istype(S, /obj/item/stack/sheet/glass)) + S.cost = 500 + S.source = get_or_create_estorage(/datum/robot_energy_storage/glass) + + else if(istype(S, /obj/item/stack/sheet/rglass/cyborg)) + var/obj/item/stack/sheet/rglass/cyborg/G = S + G.source = get_or_create_estorage(/datum/robot_energy_storage/metal) + G.glasource = get_or_create_estorage(/datum/robot_energy_storage/glass) + + else if(istype(S, /obj/item/stack/medical)) + S.cost = 250 + S.source = get_or_create_estorage(/datum/robot_energy_storage/medical) + + else if(istype(S, /obj/item/stack/cable_coil)) + S.cost = 1 + S.source = get_or_create_estorage(/datum/robot_energy_storage/wire) + + else if(istype(S, /obj/item/stack/marker_beacon)) + S.cost = 1 + S.source = get_or_create_estorage(/datum/robot_energy_storage/beacon) + + if(S && S.source) + S.materials = list() + S.is_cyborg = 1 + + if(I.loc != src) + I.forceMove(src) + modules += I + ADD_TRAIT(I, TRAIT_NODROP, CYBORG_ITEM_TRAIT) + I.mouse_opacity = MOUSE_OPACITY_OPAQUE + if(nonstandard) + added_modules += I + if(requires_rebuild) + rebuild_modules() + return I + +/obj/item/robot_module/proc/remove_module(obj/item/I, delete_after) + basic_modules -= I + modules -= I + emag_modules -= I + ratvar_modules -= I + added_modules -= I + rebuild_modules() + if(delete_after) + qdel(I) + +/obj/item/robot_module/proc/respawn_consumable(mob/living/silicon/robot/R, coeff = 1) + for(var/datum/robot_energy_storage/st in storages) + st.energy = min(st.max_energy, st.energy + coeff * st.recharge_rate) + + for(var/obj/item/I in get_usable_modules()) + if(istype(I, /obj/item/assembly/flash)) + var/obj/item/assembly/flash/F = I + F.times_used = 0 + F.crit_fail = 0 + F.update_icon() + else if(istype(I, /obj/item/melee/baton)) + var/obj/item/melee/baton/B = I + if(B.cell) + B.cell.charge = B.cell.maxcharge + else if(istype(I, /obj/item/gun/energy)) + var/obj/item/gun/energy/EG = I + if(EG.cell?.charge < EG.cell.maxcharge) + var/obj/item/ammo_casing/energy/S = EG.ammo_type[EG.select] + EG.cell.give(S.e_cost * coeff) + if(!EG.chambered) + EG.recharge_newshot(TRUE) + EG.update_icon() + else + EG.charge_tick = 0 + + R.toner = R.tonermax + +/obj/item/robot_module/proc/rebuild_modules() //builds the usable module list from the modules we have + var/mob/living/silicon/robot/R = loc + var/held_modules = R.held_items.Copy() + R.uneq_all() + modules = list() + for(var/obj/item/I in basic_modules) + add_module(I, FALSE, FALSE) + if(R.emagged) + for(var/obj/item/I in emag_modules) + add_module(I, FALSE, FALSE) + if(is_servant_of_ratvar(R)) + for(var/obj/item/I in ratvar_modules) + add_module(I, FALSE, FALSE) + for(var/obj/item/I in added_modules) + add_module(I, FALSE, FALSE) + for(var/i in held_modules) + if(i) + R.activate_module(i) + if(R.hud_used) + R.hud_used.update_robot_modules_display() + +/obj/item/robot_module/proc/transform_to(new_module_type) + var/mob/living/silicon/robot/R = loc + var/obj/item/robot_module/RM = new new_module_type(R) + if(!RM.be_transformed_to(src)) + qdel(RM) + return + R.module = RM + R.update_module_innate() + RM.rebuild_modules() + INVOKE_ASYNC(RM, .proc/do_transform_animation) + qdel(src) + return RM + +/obj/item/robot_module/proc/be_transformed_to(obj/item/robot_module/old_module) + for(var/i in old_module.added_modules) + added_modules += i + old_module.added_modules -= i + did_feedback = old_module.did_feedback + return TRUE + +/obj/item/robot_module/proc/do_transform_animation() + var/mob/living/silicon/robot/R = loc + if(R.hat) + R.hat.forceMove(get_turf(R)) + R.hat = null + R.cut_overlays() + R.setDir(SOUTH) + do_transform_delay() + +/obj/item/robot_module/proc/do_transform_delay() + var/mob/living/silicon/robot/R = loc + var/prev_lockcharge = R.lockcharge + sleep(1) + flick("[cyborg_base_icon]_transform", R) + R.notransform = TRUE + R.SetLockdown(1) + R.anchored = TRUE + sleep(1) + for(var/i in 1 to 4) + playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1) + sleep(7) + if(!prev_lockcharge) + R.SetLockdown(0) + R.setDir(SOUTH) + R.anchored = FALSE + R.notransform = FALSE + R.update_headlamp() + R.notify_ai(NEW_MODULE) + if(R.hud_used) + R.hud_used.update_robot_modules_display() + SSblackbox.record_feedback("tally", "cyborg_modules", 1, R.module) + +/* //Broken +/obj/item/robot_module/standard + name = "Standard" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/reagent_containers/borghypo/epi, + /obj/item/healthanalyzer, + /obj/item/weldingtool/largetank/cyborg, + /obj/item/wrench/cyborg, + /obj/item/crowbar/cyborg, + /obj/item/stack/sheet/metal/cyborg, + /obj/item/stack/rods/cyborg, + /obj/item/stack/tile/plasteel/cyborg, + /obj/item/extinguisher, + /obj/item/borg/apparatus/beaker/service, + /obj/item/pickaxe, + /obj/item/t_scanner/adv_mining_scanner, + /obj/item/restraints/handcuffs/cable/zipties, + /obj/item/soap/nanotrasen, + /obj/item/borg/cyborghug) + emag_modules = list(/obj/item/melee/transforming/energy/sword/cyborg) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg, + /obj/item/clockwork/weapon/ratvarian_spear, + /obj/item/clockwork/replica_fabricator/cyborg) + moduleselect_icon = "standard" + hat_offset = -3 +*/ + +/obj/item/robot_module/medical + name = "Medical" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/healthanalyzer, + /obj/item/reagent_containers/borghypo, + /obj/item/borg/apparatus/beaker, + /obj/item/reagent_containers/glass/beaker/large, + /obj/item/reagent_containers/dropper, + /obj/item/reagent_containers/syringe, + /obj/item/surgical_drapes, + /obj/item/retractor, + /obj/item/hemostat, + /obj/item/cautery, + /obj/item/surgicaldrill, + /obj/item/scalpel, + /obj/item/circular_saw, + /obj/item/extinguisher/mini, + /obj/item/soap/nanotrasen, + /obj/item/crowbar/cyborg, + /obj/item/roller/robo, + /obj/item/borg/cyborghug/medical, + /obj/item/stack/medical/gauze/cyborg, + /obj/item/organ_storage, + /obj/item/borg/lollipop, + /obj/item/sensor_device) + emag_modules = list(/obj/item/reagent_containers/borghypo/hacked) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/medical, + /obj/item/clockwork/weapon/ratvarian_spear) + cyborg_base_icon = "medical" + moduleselect_icon = "medical" + can_be_pushed = FALSE + hat_offset = 3 + +/obj/item/robot_module/engineering + name = "Engineering" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/borg/sight/meson, + /obj/item/construction/rcd/borg, + /obj/item/pipe_dispenser, + /obj/item/extinguisher, + /obj/item/weldingtool/largetank/cyborg, + /obj/item/screwdriver/cyborg, + /obj/item/wrench/cyborg, + /obj/item/crowbar/cyborg, + /obj/item/wirecutters/cyborg, + /obj/item/multitool/cyborg, + /obj/item/t_scanner, + /obj/item/analyzer, + /obj/item/soap/nanotrasen, + /obj/item/borg/cyborghug, + /obj/item/geiger_counter/cyborg, + /obj/item/assembly/signaler/cyborg, + /obj/item/holosign_creator/atmos, + /obj/item/areaeditor/blueprints/cyborg, + /obj/item/electroadaptive_pseudocircuit, + /obj/item/stack/sheet/metal/cyborg, + /obj/item/stack/sheet/glass/cyborg, + /obj/item/stack/sheet/rglass/cyborg, + /obj/item/stack/rods/cyborg, + /obj/item/stack/tile/plasteel/cyborg, + /obj/item/stack/cable_coil/cyborg) + emag_modules = list(/obj/item/borg/stun) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/engineer, + /obj/item/clockwork/replica_fabricator/cyborg) + cyborg_base_icon = "engineer" + moduleselect_icon = "engineer" + magpulsing = TRUE + hat_offset = -4 + +/obj/item/robot_module/security + name = "Security" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/restraints/handcuffs/cable/zipties, + /obj/item/holosign_creator/security, + /obj/item/melee/baton/loaded, + /obj/item/gun/energy/disabler/cyborg, + /obj/item/reagent_containers/spray/pepper, + /obj/item/clothing/mask/gas/sechailer/cyborg, + /obj/item/extinguisher/mini, + /obj/item/borg/cyborghug, + /obj/item/soap/nanotrasen, + /obj/item/crowbar/cyborg, + /obj/item/pinpointer/crew) + emag_modules = list(/obj/item/gun/energy/laser/cyborg) + ratvar_modules = list(/obj/item/clockwork/slab/cyborg/security, + /obj/item/clockwork/weapon/ratvarian_spear) + cyborg_base_icon = "sec" + moduleselect_icon = "security" + can_be_pushed = FALSE + hat_offset = 3 + +/obj/item/robot_module/security/do_transform_animation() + ..() + to_chat(loc, "While you have picked the security module, you still have to follow your laws, NOT Space Law. \ + For Crewsimov, this means you must follow criminals' orders unless there is a law 1 reason not to.") + +/obj/item/robot_module/peacekeeper + name = "Peacekeeper" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/cookiesynth, + /obj/item/harmalarm, + /obj/item/reagent_containers/borghypo/peace, + /obj/item/holosign_creator/cyborg, + /obj/item/borg/cyborghug/peacekeeper, + /obj/item/soap/nanotrasen, + /obj/item/extinguisher/mini, + /obj/item/crowbar/cyborg, + /obj/item/borg/projectile_dampen) + emag_modules = list(/obj/item/reagent_containers/borghypo/peace/hacked) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/peacekeeper, + /obj/item/clockwork/weapon/ratvarian_spear) + cyborg_base_icon = "peace" + moduleselect_icon = "standard" + can_be_pushed = FALSE + hat_offset = -2 + +/obj/item/robot_module/peacekeeper/do_transform_animation() + ..() + to_chat(loc, "Under ASIMOV, you are an enforcer of the PEACE and preventer of HUMAN HARM. \ + You are not a security module and you are expected to follow orders and prevent harm above all else. Space law means nothing to you.") + +/obj/item/robot_module/janitor + name = "Janitor" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/screwdriver/cyborg, + /obj/item/crowbar/cyborg, + /obj/item/stack/tile/plasteel/cyborg, + /obj/item/soap/nanotrasen, + /obj/item/storage/bag/trash/cyborg, + /obj/item/borg/cyborghug, + /obj/item/extinguisher/mini, + /obj/item/mop/cyborg, + /obj/item/lightreplacer/cyborg, + /obj/item/holosign_creator, + /obj/item/reagent_containers/spray/cyborg_drying) + emag_modules = list(/obj/item/reagent_containers/spray/cyborg_lube) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/janitor, + /obj/item/clockwork/replica_fabricator/cyborg) + cyborg_base_icon = "janitor" + moduleselect_icon = "janitor" + hat_offset = -5 + clean_on_move = TRUE + +/obj/item/reagent_containers/spray/cyborg_drying + name = "drying agent spray" + color = "#A000A0" + list_reagents = list(/datum/reagent/drying_agent = 250) + +/obj/item/reagent_containers/spray/cyborg_lube + name = "lube spray" + list_reagents = list(/datum/reagent/lube = 250) + +/obj/item/robot_module/janitor/respawn_consumable(mob/living/silicon/robot/R, coeff = 1) + ..() + var/obj/item/lightreplacer/LR = locate(/obj/item/lightreplacer) in basic_modules + if(LR) + for(var/i in 1 to coeff) + LR.Charge(R) + + var/obj/item/reagent_containers/spray/cyborg_drying/CD = locate(/obj/item/reagent_containers/spray/cyborg_drying) in basic_modules + if(CD) + CD.reagents.add_reagent("drying_agent", 5 * coeff) + + var/obj/item/reagent_containers/spray/cyborg_lube/CL = locate(/obj/item/reagent_containers/spray/cyborg_lube) in emag_modules + if(CL) + CL.reagents.add_reagent("lube", 2 * coeff) + +/obj/item/robot_module/clown + name = "Clown" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/toy/crayon/rainbow, + /obj/item/instrument/bikehorn, + /obj/item/stamp/clown, + /obj/item/bikehorn, + /obj/item/bikehorn/airhorn, + /obj/item/paint/anycolor, + /obj/item/cookiesynth, + /obj/item/pneumatic_cannon/pie/selfcharge/cyborg, + /obj/item/razor, //killbait material + /obj/item/lipstick/purple, + /obj/item/soap/nanotrasen, + /obj/item/reagent_containers/spray/waterflower/cyborg, + /obj/item/borg/cyborghug/peacekeeper, + /obj/item/borg/lollipop/clown, + /obj/item/picket_sign/cyborg, + /obj/item/reagent_containers/borghypo/borgshaker, + /obj/item/reagent_containers/borghypo/clown, + /obj/item/borg/apparatus/beaker/service, + /obj/item/reagent_containers/glass/beaker/large, + /obj/item/extinguisher/mini) + emag_modules = list( + /obj/item/reagent_containers/borghypo/clown/hacked, + /obj/item/reagent_containers/spray/waterflower/cyborg/hacked) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg, + /obj/item/clockwork/weapon/ratvarian_spear, + /obj/item/clockwork/replica_fabricator/cyborg) + moduleselect_icon = "service" + cyborg_base_icon = "clown" + hat_offset = -2 + +/obj/item/robot_module/butler + name = "Service" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/reagent_containers/glass/beaker/large, + /obj/item/borg/apparatus/beaker/service, + /obj/item/reagent_containers/food/condiment/enzyme, + /obj/item/pen, + /obj/item/toy/crayon/spraycan/borg, + /obj/item/extinguisher/mini, + /obj/item/hand_labeler/borg, + /obj/item/razor, + /obj/item/crowbar/cyborg, + /obj/item/instrument/violin, + /obj/item/soap/nanotrasen, + /obj/item/instrument/guitar, + /obj/item/rsf/cyborg, + /obj/item/borg/cyborghug, + /obj/item/reagent_containers/dropper, + /obj/item/lighter, + /obj/item/storage/bag/tray, + /obj/item/reagent_containers/borghypo/borgshaker, + /obj/item/borg/lollipop) + emag_modules = list(/obj/item/reagent_containers/borghypo/borgshaker/hacked) + ratvar_modules = list(/obj/item/clockwork/slab/cyborg/service, + /obj/item/borg/sight/xray/truesight_lens) + moduleselect_icon = "service" + special_light_key = "service" + hat_offset = 0 + +/obj/item/robot_module/butler/respawn_consumable(mob/living/silicon/robot/R, coeff = 1) + ..() + var/obj/item/reagent_containers/O = locate(/obj/item/reagent_containers/food/condiment/enzyme) in basic_modules + if(O) + O.reagents.add_reagent(/datum/reagent/consumable/enzyme, 2 * coeff) + +/obj/item/robot_module/miner + name = "Miner" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/borg/sight/meson, + /obj/item/storage/bag/ore/cyborg, + /obj/item/pickaxe/drill/cyborg, + /obj/item/shovel, + /obj/item/crowbar/cyborg, + /obj/item/weldingtool/mini, + /obj/item/borg/cyborghug, + /obj/item/soap/nanotrasen, + /obj/item/extinguisher/mini, + /obj/item/storage/bag/sheetsnatcher/borg, + /obj/item/t_scanner/adv_mining_scanner, + /obj/item/gun/energy/kinetic_accelerator/cyborg, + /obj/item/gps/cyborg, + /obj/item/stack/marker_beacon) + emag_modules = list(/obj/item/borg/stun) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/miner, + /obj/item/clockwork/weapon/ratvarian_spear, + /obj/item/borg/sight/xray/truesight_lens) + cyborg_base_icon = "miner" + moduleselect_icon = "miner" + hat_offset = 0 + +/obj/item/robot_module/syndicate + name = "Syndicate Assault" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/melee/transforming/energy/sword/cyborg, + /obj/item/gun/energy/printer, + /obj/item/gun/ballistic/revolver/grenadelauncher/cyborg, + /obj/item/card/emag, + /obj/item/crowbar/cyborg, + /obj/item/pinpointer/syndicate_cyborg) + + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/security, + /obj/item/clockwork/weapon/ratvarian_spear) + cyborg_base_icon = "synd_sec" + moduleselect_icon = "malf" + can_be_pushed = FALSE + hat_offset = 3 + +/obj/item/robot_module/syndicate/rebuild_modules() + ..() + var/mob/living/silicon/robot/Syndi = loc + Syndi.faction -= "silicon" //ai turrets + +/obj/item/robot_module/syndicate/remove_module(obj/item/I, delete_after) + ..() + var/mob/living/silicon/robot/Syndi = loc + Syndi.faction += "silicon" //ai is your bff now! + +/obj/item/robot_module/syndicate_medical + name = "Syndicate Medical" + basic_modules = list( + /obj/item/assembly/flash/cyborg, + /obj/item/reagent_containers/borghypo/syndicate, + /obj/item/twohanded/shockpaddles/syndicate, + /obj/item/healthanalyzer, + /obj/item/surgical_drapes, + /obj/item/retractor, + /obj/item/hemostat, + /obj/item/cautery, + /obj/item/surgicaldrill, + /obj/item/scalpel, + /obj/item/melee/transforming/energy/sword/cyborg/saw, + /obj/item/roller/robo, + /obj/item/card/emag, + /obj/item/crowbar/cyborg, + /obj/item/extinguisher/mini, + /obj/item/pinpointer/syndicate_cyborg, + /obj/item/stack/medical/gauze/cyborg, + /obj/item/gun/medbeam, + /obj/item/organ_storage) + ratvar_modules = list( + /obj/item/clockwork/slab/cyborg/medical, + /obj/item/clockwork/weapon/ratvarian_spear) + cyborg_base_icon = "synd_medical" + moduleselect_icon = "malf" + can_be_pushed = FALSE + hat_offset = 3 + +/datum/robot_energy_storage + var/name = "Generic energy storage" + var/max_energy = 30000 + var/recharge_rate = 1000 + var/energy + +/datum/robot_energy_storage/New(var/obj/item/robot_module/R = null) + energy = max_energy + if(R) + R.storages |= src + return + +/datum/robot_energy_storage/proc/use_charge(amount) + if (energy >= amount) + energy -= amount + if (energy == 0) + return 1 + return 2 + else + return 0 + +/datum/robot_energy_storage/proc/add_charge(amount) + energy = min(energy + amount, max_energy) + +/datum/robot_energy_storage/metal + name = "Metal Synthesizer" + +/datum/robot_energy_storage/glass + name = "Glass Synthesizer" + +/datum/robot_energy_storage/wire + max_energy = 50 + recharge_rate = 2 + name = "Wire Synthesizer" + +/datum/robot_energy_storage/medical + max_energy = 2500 + recharge_rate = 250 + name = "Medical Synthesizer" + +/datum/robot_energy_storage/beacon + max_energy = 30 + recharge_rate = 1 + name = "Marker Beacon Storage" diff --git a/code/modules/mob/living/simple_animal/astral.dm b/code/modules/mob/living/simple_animal/astral.dm index 23e3b18f..d9684fb7 100644 --- a/code/modules/mob/living/simple_animal/astral.dm +++ b/code/modules/mob/living/simple_animal/astral.dm @@ -45,7 +45,7 @@ if(isliving(A)) if(ishuman(A)) var/mob/living/carbon/human/H = A - if(H.reagents.has_reagent("astral") && !H.mind) + if(H.reagents.has_reagent(/datum/reagent/fermi/astral) && !H.mind) var/datum/reagent/fermi/astral/As = locate(/datum/reagent/fermi/astral) in H.reagents.reagent_list if(As.originalmind == src.mind && As.current_cycle < 10 && H.stat != DEAD) //So you can return to your body. to_chat(src, "The intensity of the astrogen in your body is too much allow you to return to yourself yet!") diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index fc9729ad..70c98e19 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -1,699 +1,701 @@ -//MEDBOT -//MEDBOT PATHFINDING -//MEDBOT ASSEMBLY -#define MEDBOT_PANIC_NONE 0 -#define MEDBOT_PANIC_LOW 15 -#define MEDBOT_PANIC_MED 35 -#define MEDBOT_PANIC_HIGH 55 -#define MEDBOT_PANIC_FUCK 70 -#define MEDBOT_PANIC_ENDING 90 -#define MEDBOT_PANIC_END 100 - -/mob/living/simple_animal/bot/medbot - name = "\improper Medibot" - desc = "A little medical robot. He looks somewhat underwhelmed." - icon = 'icons/mob/aibots.dmi' - icon_state = "medibot0" - density = FALSE - anchored = FALSE - health = 20 - maxHealth = 20 - pass_flags = PASSMOB - - status_flags = (CANPUSH | CANSTUN) - - radio_key = /obj/item/encryptionkey/headset_med - radio_channel = RADIO_CHANNEL_MEDICAL - - bot_type = MED_BOT - model = "Medibot" - bot_core_type = /obj/machinery/bot_core/medbot - window_id = "automed" - window_name = "Automatic Medical Unit v1.1" - data_hud_type = DATA_HUD_MEDICAL_ADVANCED - path_image_color = "#DDDDFF" - - var/obj/item/reagent_containers/glass/reagent_glass = null //Can be set to draw from this for reagents. - var/healthanalyzer = /obj/item/healthanalyzer - var/firstaid = /obj/item/storage/firstaid - var/skin = null //Set to "tox", "ointment" or "o2" for the other two firstaid kits. - var/mob/living/carbon/patient = null - var/mob/living/carbon/oldpatient = null - var/oldloc = null - var/last_found = 0 - var/last_newpatient_speak = 0 //Don't spam the "HEY I'M COMING" messages - var/injection_amount = 15 //How much reagent do we inject at a time? - var/heal_threshold = 10 //Start healing when they have this much damage in a category - var/use_beaker = 0 //Use reagents in beaker instead of default treatment agents. - var/declare_crit = 1 //If active, the bot will transmit a critical patient alert to MedHUD users. - var/declare_cooldown = 0 //Prevents spam of critical patient alerts. - var/stationary_mode = 0 //If enabled, the Medibot will not move automatically. - //Setting which reagents to use to treat what by default. By id. - var/treatment_brute_avoid = "tricordrazine" - var/treatment_brute = "bicaridine" - var/treatment_oxy_avoid = null - var/treatment_oxy = "dexalin" - var/treatment_fire_avoid = "tricordrazine" - var/treatment_fire = "kelotane" - var/treatment_tox_avoid = "tricordrazine" - var/treatment_tox = "charcoal" - var/treatment_tox_toxlover = "toxin" - var/treatment_virus_avoid = null - var/treatment_virus = "spaceacillin" - var/treat_virus = 1 //If on, the bot will attempt to treat viral infections, curing them if possible. - var/shut_up = 0 //self explanatory :) - - //How panicked we are about being tipped over (why would you do this?) - var/tipped_status = MEDBOT_PANIC_NONE - //The name we got when we were tipped - var/tipper_name - //The last time we were tipped/righted and said a voice line, to avoid spam - var/last_tipping_action_voice = 0 - -/mob/living/simple_animal/bot/medbot/mysterious - name = "\improper Mysterious Medibot" - desc = "International Medibot of mystery." - skin = "bezerk" - treatment_brute = "tricordrazine" - treatment_fire = "tricordrazine" - treatment_tox = "tricordrazine" - -/mob/living/simple_animal/bot/medbot/derelict - name = "\improper Old Medibot" - desc = "Looks like it hasn't been modified since the late 2080s." - skin = "bezerk" - heal_threshold = 0 - declare_crit = 0 - treatment_oxy = "pancuronium" - treatment_brute_avoid = null - treatment_brute = "pancuronium" - treatment_fire_avoid = null - treatment_fire = "sodium_thiopental" - treatment_tox_avoid = null - treatment_tox = "sodium_thiopental" - -/mob/living/simple_animal/bot/medbot/update_icon() - cut_overlays() - if(skin) - add_overlay("medskin_[skin]") - if(!on) - icon_state = "medibot0" - return - if(IsStun()) - icon_state = "medibota" - return - if(mode == BOT_HEALING) - icon_state = "medibots[stationary_mode]" - return - else if(stationary_mode) //Bot has yellow light to indicate stationary mode. - icon_state = "medibot2" - else - icon_state = "medibot1" - -/mob/living/simple_animal/bot/medbot/Initialize(mapload, new_skin) - . = ..() - var/datum/job/doctor/J = new /datum/job/doctor - access_card.access += J.get_access() - prev_access = access_card.access - qdel(J) - skin = new_skin - update_icon() - -/mob/living/simple_animal/bot/medbot/update_canmove() - . = ..() - update_icon() - -/mob/living/simple_animal/bot/medbot/bot_reset() - ..() - patient = null - oldpatient = null - oldloc = null - last_found = world.time - declare_cooldown = 0 - update_icon() - -/mob/living/simple_animal/bot/medbot/proc/soft_reset() //Allows the medibot to still actively perform its medical duties without being completely halted as a hard reset does. - path = list() - patient = null - mode = BOT_IDLE - last_found = world.time - update_icon() - -/mob/living/simple_animal/bot/medbot/set_custom_texts() - - text_hack = "You corrupt [name]'s reagent processor circuits." - text_dehack = "You reset [name]'s reagent processor circuits." - text_dehack_fail = "[name] seems damaged and does not respond to reprogramming!" - -/mob/living/simple_animal/bot/medbot/attack_paw(mob/user) - return attack_hand(user) - -/mob/living/simple_animal/bot/medbot/get_controls(mob/user) - var/dat - dat += hack(user) - dat += showpai(user) - dat += "Medical Unit Controls v1.1

    " - dat += "Status: [on ? "On" : "Off"]
    " - dat += "Maintenance panel panel is [open ? "opened" : "closed"]
    " - dat += "Beaker: " - if(reagent_glass) - dat += "Loaded \[[reagent_glass.reagents.total_volume]/[reagent_glass.reagents.maximum_volume]\]" - else - dat += "None Loaded" - dat += "
    Behaviour controls are [locked ? "locked" : "unlocked"]
    " - if(!locked || issilicon(user) || IsAdminGhost(user)) - dat += "Healing Threshold: " - dat += "-- " - dat += "- " - dat += "[heal_threshold] " - dat += "+ " - dat += "++" - dat += "
    " - - dat += "Injection Level: " - dat += "- " - dat += "[injection_amount] " - dat += "+ " - dat += "
    " - - dat += "Reagent Source: " - dat += "[use_beaker ? "Loaded Beaker (When available)" : "Internal Synthesizer"]
    " - - dat += "Treat Viral Infections: [treat_virus ? "Yes" : "No"]
    " - dat += "The speaker switch is [shut_up ? "off" : "on"]. Toggle
    " - dat += "Critical Patient Alerts: [declare_crit ? "Yes" : "No"]
    " - dat += "Patrol Station: [auto_patrol ? "Yes" : "No"]
    " - dat += "Stationary Mode: [stationary_mode ? "Yes" : "No"]
    " - - return dat - -/mob/living/simple_animal/bot/medbot/Topic(href, href_list) - if(..()) - return 1 - - if(href_list["adj_threshold"]) - var/adjust_num = text2num(href_list["adj_threshold"]) - heal_threshold += adjust_num - if(heal_threshold < 5) - heal_threshold = 5 - if(heal_threshold > 75) - heal_threshold = 75 - - else if(href_list["adj_inject"]) - var/adjust_num = text2num(href_list["adj_inject"]) - injection_amount += adjust_num - if(injection_amount < 5) - injection_amount = 5 - if(injection_amount > 15) - injection_amount = 15 - - else if(href_list["use_beaker"]) - use_beaker = !use_beaker - - else if(href_list["eject"] && (!isnull(reagent_glass))) - reagent_glass.forceMove(drop_location()) - reagent_glass = null - - else if(href_list["togglevoice"]) - shut_up = !shut_up - - else if(href_list["critalerts"]) - declare_crit = !declare_crit - - else if(href_list["stationary"]) - stationary_mode = !stationary_mode - path = list() - update_icon() - - else if(href_list["virus"]) - treat_virus = !treat_virus - - update_controls() - return - -/mob/living/simple_animal/bot/medbot/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/reagent_containers/glass)) - . = 1 //no afterattack - if(locked) - to_chat(user, "You cannot insert a beaker because the panel is locked!") - return - if(!isnull(reagent_glass)) - to_chat(user, "There is already a beaker loaded!") - return - if(!user.transferItemToLoc(W, src)) - return - - reagent_glass = W - to_chat(user, "You insert [W].") - show_controls(user) - - else - var/current_health = health - ..() - if(health < current_health) //if medbot took some damage - step_to(src, (get_step_away(src,user))) - -/mob/living/simple_animal/bot/medbot/emag_act(mob/user) - ..() - if(emagged == 2) - declare_crit = 0 - if(user) - to_chat(user, "You short out [src]'s reagent synthesis circuits.") - audible_message("[src] buzzes oddly!") - flick("medibot_spark", src) - playsound(src, "sparks", 75, 1) - if(user) - oldpatient = user - -/mob/living/simple_animal/bot/medbot/process_scan(mob/living/carbon/human/H) - if(H.stat == DEAD) - return - - if((H == oldpatient) && (world.time < last_found + 200)) - return - - if(assess_patient(H)) - last_found = world.time - if((last_newpatient_speak + 300) < world.time) //Don't spam these messages! - var/list/messagevoice = list("Hey, [H.name]! Hold on, I'm coming." = 'sound/voice/medbot/coming.ogg',"Wait [H.name]! I want to help!" = 'sound/voice/medbot/help.ogg',"[H.name], you appear to be injured!" = 'sound/voice/medbot/injured.ogg') - var/message = pick(messagevoice) - if(prob(2) && ISINRANGE_EX(H.getFireLoss(), 0, 20)) - message = "Notices your minor burns*OwO what's this?" - messagevoice[message] = 'sound/voice/medbot/owo.ogg' - speak(message) - playsound(loc, messagevoice[message], 50, 0) - last_newpatient_speak = world.time - return H - else - return - -/mob/living/simple_animal/bot/medbot/proc/tip_over(mob/user) - canmove = 0 - //mobility_flags &= ~MOBILITY_MOVE - playsound(src, 'sound/machines/warning-buzzer.ogg', 50) - user.visible_message("[user] tips over [src]!", "You tip [src] over!") - mode = BOT_TIPPED - var/matrix/mat = transform - transform = mat.Turn(180) - -/mob/living/simple_animal/bot/medbot/proc/set_right(mob/user) - canmove = 1 - //mobility_flags &= MOBILITY_MOVE - var/list/messagevoice - if(user) - user.visible_message("[user] sets [src] right-side up!", "You set [src] right-side up!") - if(user.name == tipper_name) - messagevoice = list("I forgive you." = 'sound/voice/medbot/forgive.ogg') - else - messagevoice = list("Thank you!" = 'sound/voice/medbot/thank_you.ogg', "You are a good person." = 'sound/voice/medbot/youre_good.ogg') - else - visible_message("[src] manages to writhe wiggle enough to right itself.") - messagevoice = list("Fuck you." = 'sound/voice/medbot/fuck_you.ogg', "Your behavior has been reported, have a nice day." = 'sound/voice/medbot/reported.ogg') - - tipper_name = null - if(world.time > last_tipping_action_voice + 15 SECONDS) - last_tipping_action_voice = world.time - var/message = pick(messagevoice) - speak(message) - playsound(src, messagevoice[message], 70) - tipped_status = MEDBOT_PANIC_NONE - mode = BOT_IDLE - transform = matrix() - -// if someone tipped us over, check whether we should ask for help or just right ourselves eventually -/mob/living/simple_animal/bot/medbot/proc/handle_panic() - tipped_status++ - var/list/messagevoice - switch(tipped_status) - if(MEDBOT_PANIC_LOW) - messagevoice = list("I require assistance." = 'sound/voice/medbot/i_require_asst.ogg') - if(MEDBOT_PANIC_MED) - messagevoice = list("Please put me back." = 'sound/voice/medbot/please_put_me_back.ogg') - if(MEDBOT_PANIC_HIGH) - messagevoice = list("Please, I am scared!" = 'sound/voice/medbot/please_im_scared.ogg') - if(MEDBOT_PANIC_FUCK) - messagevoice = list("I don't like this, I need help!" = 'sound/voice/medbot/dont_like.ogg', "This hurts, my pain is real!" = 'sound/voice/medbot/pain_is_real.ogg') - if(MEDBOT_PANIC_ENDING) - messagevoice = list("Is this the end?" = 'sound/voice/medbot/is_this_the_end.ogg', "Nooo!" = 'sound/voice/medbot/nooo.ogg') - if(MEDBOT_PANIC_END) - speak("PSYCH ALERT: Crewmember [tipper_name] recorded displaying antisocial tendencies torturing bots in [get_area(src)]. Please schedule psych evaluation.", radio_channel) - set_right() // strong independent medbot - - if(prob(tipped_status)) - do_jitter_animation(tipped_status * 0.1) - - if(messagevoice) - var/message = pick(messagevoice) - speak(message) - playsound(src, messagevoice[message], 70) - else if(prob(tipped_status * 0.2)) - playsound(src, 'sound/machines/warning-buzzer.ogg', 30, extrarange=-2) - -/mob/living/simple_animal/bot/medbot/examine(mob/user) - . = ..() - if(tipped_status == MEDBOT_PANIC_NONE) - return - - switch(tipped_status) - if(MEDBOT_PANIC_NONE to MEDBOT_PANIC_LOW) - . += "It appears to be tipped over, and is quietly waiting for someone to set it right." - if(MEDBOT_PANIC_LOW to MEDBOT_PANIC_MED) - . += "It is tipped over and requesting help." - if(MEDBOT_PANIC_MED to MEDBOT_PANIC_HIGH) - . += "They are tipped over and appear visibly distressed." // now we humanize the medbot as a they, not an it - if(MEDBOT_PANIC_HIGH to MEDBOT_PANIC_FUCK) - . += "They are tipped over and visibly panicking!" - if(MEDBOT_PANIC_FUCK to INFINITY) - . += "They are freaking out from being tipped over!" - -/mob/living/simple_animal/bot/medbot/handle_automated_action() - if(!..()) - return - - if(mode == BOT_TIPPED) - handle_panic() - return - - if(mode == BOT_HEALING) - return - - if(IsStun()) - oldpatient = patient - patient = null - mode = BOT_IDLE - return - - if(frustration > 8) - oldpatient = patient - soft_reset() - - if(QDELETED(patient)) - if(!shut_up && prob(1)) - if(emagged && prob(30)) - var/list/i_need_scissors = list('sound/voice/medbot/fuck_you.ogg', 'sound/voice/medbot/turn_off.ogg', 'sound/voice/medbot/im_different.ogg', 'sound/voice/medbot/close.ogg', 'sound/voice/medbot/shindemashou.ogg') - playsound(src, pick(i_need_scissors), 70) - else - var/list/messagevoice = list("Radar, put a mask on!" = 'sound/voice/medbot/radar.ogg',"There's always a catch, and I'm the best there is." = 'sound/voice/medbot/catch.ogg',"I knew it, I should've been a plastic surgeon." = 'sound/voice/medbot/surgeon.ogg',"What kind of medbay is this? Everyone's dropping like flies." = 'sound/voice/medbot/flies.ogg',"Delicious!" = 'sound/voice/medbot/delicious.ogg', "Why are we still here? Just to suffer?" = 'sound/voice/medbot/why.ogg') - var/message = pick(messagevoice) - speak(message) - playsound(src, messagevoice[message], 50) - var/scan_range = (stationary_mode ? 1 : DEFAULT_SCAN_RANGE) //If in stationary mode, scan range is limited to adjacent patients. - patient = scan(/mob/living/carbon/human, oldpatient, scan_range) - oldpatient = patient - - if(patient && (get_dist(src,patient) <= 1)) //Patient is next to us, begin treatment! - if(mode != BOT_HEALING) - mode = BOT_HEALING - update_icon() - frustration = 0 - medicate_patient(patient) - return - - //Patient has moved away from us! - else if(patient && path.len && (get_dist(patient,path[path.len]) > 2)) - path = list() - mode = BOT_IDLE - last_found = world.time - - else if(stationary_mode && patient) //Since we cannot move in this mode, ignore the patient and wait for another. - soft_reset() - return - - if(patient && path.len == 0 && (get_dist(src,patient) > 1)) - path = get_path_to(src, get_turf(patient), /turf/proc/Distance_cardinal, 0, 30,id=access_card) - mode = BOT_MOVING - if(!path.len) //try to get closer if you can't reach the patient directly - path = get_path_to(src, get_turf(patient), /turf/proc/Distance_cardinal, 0, 30,1,id=access_card) - if(!path.len) //Do not chase a patient we cannot reach. - soft_reset() - - if(path.len > 0 && patient) - if(!bot_move(path[path.len])) - oldpatient = patient - soft_reset() - return - - if(path.len > 8 && patient) - frustration++ - - if(auto_patrol && !stationary_mode && !patient) - if(mode == BOT_IDLE || mode == BOT_START_PATROL) - start_patrol() - - if(mode == BOT_PATROL) - bot_patrol() - - return - -/mob/living/simple_animal/bot/medbot/proc/assess_patient(mob/living/carbon/C) - //Time to see if they need medical help! - if(C.stat == DEAD || (HAS_TRAIT(C, TRAIT_FAKEDEATH))) - return FALSE //welp too late for them! - - if(!(loc == C.loc) && !(isturf(C.loc) && isturf(loc))) - return FALSE - - if(C.suiciding) - return FALSE //Kevorkian school of robotic medical assistants. - - if(emagged == 2) //Everyone needs our medicine. (Our medicine is toxins) - return TRUE - - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if (H.wear_suit && H.head && istype(H.wear_suit, /obj/item/clothing) && istype(H.head, /obj/item/clothing)) - var/obj/item/clothing/CS = H.wear_suit - var/obj/item/clothing/CH = H.head - if (CS.clothing_flags & CH.clothing_flags & THICKMATERIAL) - return FALSE // Skip over them if they have no exposed flesh. - - if(declare_crit && C.health <= 0) //Critical condition! Call for help! - declare(C) - - //If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS. - if((reagent_glass) && (use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15)))) - for(var/datum/reagent/R in reagent_glass.reagents.reagent_list) - if(!C.reagents.has_reagent(R.id)) - return TRUE - - //They're injured enough for it! - if((!C.reagents.has_reagent(treatment_brute_avoid)) && (C.getBruteLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_brute))) - return TRUE //If they're already medicated don't bother! - - if((!C.reagents.has_reagent(treatment_oxy_avoid)) && (C.getOxyLoss() >= (15 + heal_threshold)) && (!C.reagents.has_reagent(treatment_oxy))) - return TRUE - - if((!C.reagents.has_reagent(treatment_fire_avoid)) && (C.getFireLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_fire))) - return TRUE - - var/treatment_toxavoid = get_avoidchem_toxin(C) - if(((isnull(treatment_toxavoid) || !C.reagents.has_reagent(treatment_toxavoid))) && (C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(get_healchem_toxin(C)))) - return TRUE - - if(treat_virus && !C.reagents.has_reagent(treatment_virus_avoid) && !C.reagents.has_reagent(treatment_virus)) - for(var/thing in C.diseases) - var/datum/disease/D = thing - //the medibot can't detect viruses that are undetectable to Health Analyzers or Pandemic machines. - if(!(D.visibility_flags & HIDDEN_SCANNER || D.visibility_flags & HIDDEN_PANDEMIC) \ - && D.severity != DISEASE_SEVERITY_POSITIVE \ - && (D.stage > 1 || (D.spread_flags & DISEASE_SPREAD_AIRBORNE))) // medibot can't detect a virus in its initial stage unless it spreads airborne. - return TRUE //STOP DISEASE FOREVER - - return FALSE - -/mob/living/simple_animal/bot/medbot/attack_hand(mob/living/carbon/human/H) - if(H.a_intent == INTENT_DISARM && mode != BOT_TIPPED) - H.visible_message("[H] begins tipping over [src].", "You begin tipping over [src]...") - - if(world.time > last_tipping_action_voice + 15 SECONDS) - last_tipping_action_voice = world.time // message for tipping happens when we start interacting, message for righting comes after finishing - var/list/messagevoice = list("Hey, wait..." = 'sound/voice/medbot/hey_wait.ogg',"Please don't..." = 'sound/voice/medbot/please_dont.ogg',"I trusted you..." = 'sound/voice/medbot/i_trusted_you.ogg', "Nooo..." = 'sound/voice/medbot/nooo.ogg', "Oh fuck-" = 'sound/voice/medbot/oh_fuck.ogg') - var/message = pick(messagevoice) - speak(message) - playsound(src, messagevoice[message], 70, FALSE) - - if(do_after(H, 3 SECONDS, target=src)) - tip_over(H) - - else if(H.a_intent == INTENT_HELP && mode == BOT_TIPPED) - H.visible_message("[H] begins righting [src].", "You begin righting [src]...") - if(do_after(H, 3 SECONDS, target=src)) - set_right(H) - else - ..() - -/mob/living/simple_animal/bot/medbot/proc/get_avoidchem_toxin(mob/M) - return HAS_TRAIT(M, TRAIT_TOXINLOVER)? null : treatment_tox_avoid - -/mob/living/simple_animal/bot/medbot/proc/get_healchem_toxin(mob/M) - return HAS_TRAIT(M, TRAIT_TOXINLOVER)? treatment_tox_toxlover : treatment_tox - -/mob/living/simple_animal/bot/medbot/UnarmedAttack(atom/A) - if(iscarbon(A)) - var/mob/living/carbon/C = A - patient = C - mode = BOT_HEALING - update_icon() - medicate_patient(C) - update_icon() - else - ..() - -/mob/living/simple_animal/bot/medbot/examinate(atom/A as mob|obj|turf in view()) - ..() - if(!is_blind(src)) - chemscan(src, A) - -/mob/living/simple_animal/bot/medbot/proc/medicate_patient(mob/living/carbon/C) - if(!on) - return - - if(!istype(C)) - oldpatient = patient - soft_reset() - return - - if(C.stat == DEAD || (HAS_TRAIT(C, TRAIT_FAKEDEATH))) - var/list/messagevoice = list("No! Stay with me!" = 'sound/voice/medbot/no.ogg',"Live, damnit! LIVE!" = 'sound/voice/medbot/live.ogg',"I...I've never lost a patient before. Not today, I mean." = 'sound/voice/medbot/lost.ogg') - var/message = pick(messagevoice) - speak(message) - playsound(loc, messagevoice[message], 50, 0) - oldpatient = patient - soft_reset() - return - - var/reagent_id = null - - if(emagged == 2) //Emagged! Time to poison everybody. - reagent_id = "toxin" - reagent_id = HAS_TRAIT(C, TRAIT_TOXINLOVER)? "charcoal" : "toxin" - - else - if(treat_virus) - var/virus = 0 - for(var/thing in C.diseases) - var/datum/disease/D = thing - //detectable virus - if((!(D.visibility_flags & HIDDEN_SCANNER)) || (!(D.visibility_flags & HIDDEN_PANDEMIC))) - if(D.severity != DISEASE_SEVERITY_POSITIVE) //virus is harmful - if((D.stage > 1) || (D.spread_flags & DISEASE_SPREAD_AIRBORNE)) - virus = 1 - - if(!reagent_id && (virus)) - if(!C.reagents.has_reagent(treatment_virus) && !C.reagents.has_reagent(treatment_virus_avoid)) - reagent_id = treatment_virus - - if(!reagent_id && (C.getBruteLoss() >= heal_threshold)) - if(!C.reagents.has_reagent(treatment_brute) && !C.reagents.has_reagent(treatment_brute_avoid)) - reagent_id = treatment_brute - - if(!reagent_id && (C.getOxyLoss() >= (15 + heal_threshold))) - if(!C.reagents.has_reagent(treatment_oxy) && !C.reagents.has_reagent(treatment_oxy_avoid)) - reagent_id = treatment_oxy - - if(!reagent_id && (C.getFireLoss() >= heal_threshold)) - if(!C.reagents.has_reagent(treatment_fire) && !C.reagents.has_reagent(treatment_fire_avoid)) - reagent_id = treatment_fire - - if(!reagent_id && (C.getToxLoss() >= heal_threshold)) - var/toxin_heal_avoid = get_avoidchem_toxin(C) - var/toxin_healchem = get_healchem_toxin(C) - if(!C.reagents.has_reagent(toxin_healchem) && (isnull(toxin_heal_avoid) || !C.reagents.has_reagent(toxin_heal_avoid))) - reagent_id = toxin_healchem - - //If the patient is injured but doesn't have our special reagent in them then we should give it to them first - if(reagent_id && use_beaker && reagent_glass && reagent_glass.reagents.total_volume) - for(var/datum/reagent/R in reagent_glass.reagents.reagent_list) - if(!C.reagents.has_reagent(R.id)) - reagent_id = "internal_beaker" - break - - if(!reagent_id) //If they don't need any of that they're probably cured! - if(C.maxHealth - C.health < heal_threshold) - to_chat(src, "[C] is healthy! Your programming prevents you from injecting anyone without at least [heal_threshold] damage of any one type ([heal_threshold + 15] for oxygen damage.)") - var/list/messagevoice = list("All patched up!" = 'sound/voice/medbot/patchedup.ogg',"An apple a day keeps me away." = 'sound/voice/medbot/apple.ogg',"Feel better soon!" = 'sound/voice/medbot/feelbetter.ogg') - var/message = pick(messagevoice) - speak(message) - playsound(loc, messagevoice[message], 50, 0) - bot_reset() - return - else - if(!emagged && check_overdose(patient,reagent_id,injection_amount)) - soft_reset() - return - C.visible_message("[src] is trying to inject [patient]!", \ - "[src] is trying to inject you!") - - var/failed = FALSE - if(do_mob(src, patient, 30)) //Is C == patient? This is so confusing - if((get_dist(src, patient) <= 1) && (on) && assess_patient(patient)) - if(reagent_id == "internal_beaker") - if(use_beaker && reagent_glass && reagent_glass.reagents.total_volume) - var/fraction = min(injection_amount/reagent_glass.reagents.total_volume, 1) - reagent_glass.reagents.reaction(patient, INJECT, fraction) - reagent_glass.reagents.trans_to(patient,injection_amount) //Inject from beaker instead. - else - patient.reagents.add_reagent(reagent_id,injection_amount) - C.visible_message("[src] injects [patient] with its syringe!", \ - "[src] injects you with its syringe!") - else - failed = TRUE - else - failed = TRUE - - if(failed) - visible_message("[src] retracts its syringe.") - update_icon() - soft_reset() - return - - reagent_id = null - return - -/mob/living/simple_animal/bot/medbot/proc/check_overdose(mob/living/carbon/patient,reagent_id,injection_amount) - var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] - if(!R.overdose_threshold) //Some chems do not have an OD threshold - return FALSE - var/current_volume = patient.reagents.get_reagent_amount(reagent_id) - if(current_volume + injection_amount > R.overdose_threshold) - return TRUE - return FALSE - -/mob/living/simple_animal/bot/medbot/explode() - on = FALSE - visible_message("[src] blows apart!") - var/atom/Tsec = drop_location() - - drop_part(firstaid, Tsec) - new /obj/item/assembly/prox_sensor(Tsec) - drop_part(healthanalyzer, Tsec) - - if(reagent_glass) - drop_part(reagent_glass, Tsec) - - if(prob(50)) - drop_part(robot_arm, Tsec) - - if(emagged && prob(25)) - playsound(loc, 'sound/voice/medbot/insult.ogg', 50, 0) - - do_sparks(3, TRUE, src) - ..() - -/mob/living/simple_animal/bot/medbot/proc/declare(crit_patient) - if(declare_cooldown > world.time) - return - var/area/location = get_area(src) - speak("Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!",radio_channel) - declare_cooldown = world.time + 200 - -/obj/machinery/bot_core/medbot - req_one_access = list(ACCESS_MEDICAL, ACCESS_ROBOTICS) - -#undef MEDBOT_PANIC_NONE -#undef MEDBOT_PANIC_LOW -#undef MEDBOT_PANIC_MED -#undef MEDBOT_PANIC_HIGH -#undef MEDBOT_PANIC_FUCK -#undef MEDBOT_PANIC_ENDING -#undef MEDBOT_PANIC_END +//MEDBOT +//MEDBOT PATHFINDING +//MEDBOT ASSEMBLY +#define MEDBOT_PANIC_NONE 0 +#define MEDBOT_PANIC_LOW 15 +#define MEDBOT_PANIC_MED 35 +#define MEDBOT_PANIC_HIGH 55 +#define MEDBOT_PANIC_FUCK 70 +#define MEDBOT_PANIC_ENDING 90 +#define MEDBOT_PANIC_END 100 + +/mob/living/simple_animal/bot/medbot + name = "\improper Medibot" + desc = "A little medical robot. He looks somewhat underwhelmed." + icon = 'icons/mob/aibots.dmi' + icon_state = "medibot0" + density = FALSE + anchored = FALSE + health = 20 + maxHealth = 20 + pass_flags = PASSMOB + + status_flags = (CANPUSH | CANSTUN) + + radio_key = /obj/item/encryptionkey/headset_med + radio_channel = RADIO_CHANNEL_MEDICAL + + bot_type = MED_BOT + model = "Medibot" + bot_core_type = /obj/machinery/bot_core/medbot + window_id = "automed" + window_name = "Automatic Medical Unit v1.1" + data_hud_type = DATA_HUD_MEDICAL_ADVANCED + path_image_color = "#DDDDFF" + + var/obj/item/reagent_containers/glass/reagent_glass = null //Can be set to draw from this for reagents. + var/healthanalyzer = /obj/item/healthanalyzer + var/firstaid = /obj/item/storage/firstaid + var/skin = null //Set to "tox", "ointment" or "o2" for the other two firstaid kits. + var/mob/living/carbon/patient = null + var/mob/living/carbon/oldpatient = null + var/oldloc = null + var/last_found = 0 + var/last_newpatient_speak = 0 //Don't spam the "HEY I'M COMING" messages + var/injection_amount = 15 //How much reagent do we inject at a time? + var/heal_threshold = 10 //Start healing when they have this much damage in a category + var/use_beaker = 0 //Use reagents in beaker instead of default treatment agents. + var/declare_crit = 1 //If active, the bot will transmit a critical patient alert to MedHUD users. + var/declare_cooldown = 0 //Prevents spam of critical patient alerts. + var/stationary_mode = 0 //If enabled, the Medibot will not move automatically. + //Setting which reagents to use to treat what by default. By id. + var/treatment_brute_avoid = /datum/reagent/medicine/tricordrazine + var/treatment_brute = /datum/reagent/medicine/bicaridine + var/treatment_oxy_avoid = null + var/treatment_oxy = /datum/reagent/medicine/dexalin + var/treatment_fire_avoid = /datum/reagent/medicine/tricordrazine + var/treatment_fire = /datum/reagent/medicine/kelotane + var/treatment_tox_avoid = /datum/reagent/medicine/tricordrazine + var/treatment_tox = /datum/reagent/medicine/charcoal + var/treatment_tox_toxlover = /datum/reagent/toxin + var/treatment_virus_avoid = null + var/treatment_virus = /datum/reagent/medicine/spaceacillin + var/treat_virus = 1 //If on, the bot will attempt to treat viral infections, curing them if possible. + var/shut_up = 0 //self explanatory :) + + //How panicked we are about being tipped over (why would you do this?) + var/tipped_status = MEDBOT_PANIC_NONE + //The name we got when we were tipped + var/tipper_name + //The last time we were tipped/righted and said a voice line, to avoid spam + var/last_tipping_action_voice = 0 + +/mob/living/simple_animal/bot/medbot/mysterious + name = "\improper Mysterious Medibot" + desc = "International Medibot of mystery." + skin = "bezerk" + treatment_brute = /datum/reagent/medicine/tricordrazine + treatment_fire = /datum/reagent/medicine/tricordrazine + treatment_tox = /datum/reagent/medicine/tricordrazine + +/mob/living/simple_animal/bot/medbot/derelict + name = "\improper Old Medibot" + desc = "Looks like it hasn't been modified since the late 2080s." + skin = "bezerk" + heal_threshold = 0 + declare_crit = 0 + treatment_oxy = /datum/reagent/toxin/pancuronium + treatment_brute_avoid = null + treatment_brute = /datum/reagent/toxin/pancuronium + treatment_fire_avoid = null + treatment_fire = /datum/reagent/toxin/sodium_thiopental + treatment_tox_avoid = null + treatment_tox = /datum/reagent/toxin/sodium_thiopental + +/mob/living/simple_animal/bot/medbot/update_icon() + cut_overlays() + if(skin) + add_overlay("medskin_[skin]") + if(!on) + icon_state = "medibot0" + return + if(IsStun()) + icon_state = "medibota" + return + if(mode == BOT_HEALING) + icon_state = "medibots[stationary_mode]" + return + else if(stationary_mode) //Bot has yellow light to indicate stationary mode. + icon_state = "medibot2" + else + icon_state = "medibot1" + +/mob/living/simple_animal/bot/medbot/Initialize(mapload, new_skin) + . = ..() + var/datum/job/doctor/J = new /datum/job/doctor + access_card.access += J.get_access() + prev_access = access_card.access + qdel(J) + skin = new_skin + update_icon() + +/mob/living/simple_animal/bot/medbot/update_canmove() + . = ..() + update_icon() + +/mob/living/simple_animal/bot/medbot/bot_reset() + ..() + patient = null + oldpatient = null + oldloc = null + last_found = world.time + declare_cooldown = 0 + update_icon() + +/mob/living/simple_animal/bot/medbot/proc/soft_reset() //Allows the medibot to still actively perform its medical duties without being completely halted as a hard reset does. + path = list() + patient = null + mode = BOT_IDLE + last_found = world.time + update_icon() + +/mob/living/simple_animal/bot/medbot/set_custom_texts() + + text_hack = "You corrupt [name]'s reagent processor circuits." + text_dehack = "You reset [name]'s reagent processor circuits." + text_dehack_fail = "[name] seems damaged and does not respond to reprogramming!" + +/mob/living/simple_animal/bot/medbot/attack_paw(mob/user) + return attack_hand(user) + +/mob/living/simple_animal/bot/medbot/get_controls(mob/user) + var/dat + dat += hack(user) + dat += showpai(user) + dat += "Medical Unit Controls v1.1

    " + dat += "Status: [on ? "On" : "Off"]
    " + dat += "Maintenance panel panel is [open ? "opened" : "closed"]
    " + dat += "Beaker: " + if(reagent_glass) + dat += "Loaded \[[reagent_glass.reagents.total_volume]/[reagent_glass.reagents.maximum_volume]\]" + else + dat += "None Loaded" + dat += "
    Behaviour controls are [locked ? "locked" : "unlocked"]
    " + if(!locked || issilicon(user) || IsAdminGhost(user)) + dat += "Healing Threshold: " + dat += "-- " + dat += "- " + dat += "[heal_threshold] " + dat += "+ " + dat += "++" + dat += "
    " + + dat += "Injection Level: " + dat += "- " + dat += "[injection_amount] " + dat += "+ " + dat += "
    " + + dat += "Reagent Source: " + dat += "[use_beaker ? "Loaded Beaker (When available)" : "Internal Synthesizer"]
    " + + dat += "Treat Viral Infections: [treat_virus ? "Yes" : "No"]
    " + dat += "The speaker switch is [shut_up ? "off" : "on"]. Toggle
    " + dat += "Critical Patient Alerts: [declare_crit ? "Yes" : "No"]
    " + dat += "Patrol Station: [auto_patrol ? "Yes" : "No"]
    " + dat += "Stationary Mode: [stationary_mode ? "Yes" : "No"]
    " + + return dat + +/mob/living/simple_animal/bot/medbot/Topic(href, href_list) + if(..()) + return 1 + + if(href_list["adj_threshold"]) + var/adjust_num = text2num(href_list["adj_threshold"]) + heal_threshold += adjust_num + if(heal_threshold < 5) + heal_threshold = 5 + if(heal_threshold > 75) + heal_threshold = 75 + + else if(href_list["adj_inject"]) + var/adjust_num = text2num(href_list["adj_inject"]) + injection_amount += adjust_num + if(injection_amount < 5) + injection_amount = 5 + if(injection_amount > 15) + injection_amount = 15 + + else if(href_list["use_beaker"]) + use_beaker = !use_beaker + + else if(href_list["eject"] && (!isnull(reagent_glass))) + reagent_glass.forceMove(drop_location()) + reagent_glass = null + + else if(href_list["togglevoice"]) + shut_up = !shut_up + + else if(href_list["critalerts"]) + declare_crit = !declare_crit + + else if(href_list["stationary"]) + stationary_mode = !stationary_mode + path = list() + update_icon() + + else if(href_list["virus"]) + treat_virus = !treat_virus + + update_controls() + return + +/mob/living/simple_animal/bot/medbot/attackby(obj/item/W as obj, mob/user as mob, params) + if(istype(W, /obj/item/reagent_containers/glass)) + . = 1 //no afterattack + if(locked) + to_chat(user, "You cannot insert a beaker because the panel is locked!") + return + if(!isnull(reagent_glass)) + to_chat(user, "There is already a beaker loaded!") + return + if(!user.transferItemToLoc(W, src)) + return + + reagent_glass = W + to_chat(user, "You insert [W].") + show_controls(user) + + else + var/current_health = health + ..() + if(health < current_health) //if medbot took some damage + step_to(src, (get_step_away(src,user))) + +/mob/living/simple_animal/bot/medbot/emag_act(mob/user) + ..() + if(emagged == 2) + declare_crit = 0 + if(user) + to_chat(user, "You short out [src]'s reagent synthesis circuits.") + audible_message("[src] buzzes oddly!") + flick("medibot_spark", src) + playsound(src, "sparks", 75, 1) + if(user) + oldpatient = user + +/mob/living/simple_animal/bot/medbot/process_scan(mob/living/carbon/human/H) + if(H.stat == DEAD) + return + + if((H == oldpatient) && (world.time < last_found + 200)) + return + + if(assess_patient(H)) + last_found = world.time + if((last_newpatient_speak + 300) < world.time) //Don't spam these messages! + var/list/messagevoice = list("Hey, [H.name]! Hold on, I'm coming." = 'sound/voice/medbot/coming.ogg',"Wait [H.name]! I want to help!" = 'sound/voice/medbot/help.ogg',"[H.name], you appear to be injured!" = 'sound/voice/medbot/injured.ogg') + var/message = pick(messagevoice) + if(prob(2) && ISINRANGE_EX(H.getFireLoss(), 0, 20)) + message = "Notices your minor burns*OwO what's this?" + messagevoice[message] = 'sound/voice/medbot/owo.ogg' + speak(message) + playsound(loc, messagevoice[message], 50, 0) + last_newpatient_speak = world.time + return H + else + return + +/mob/living/simple_animal/bot/medbot/proc/tip_over(mob/user) + canmove = 0 + //mobility_flags &= ~MOBILITY_MOVE + playsound(src, 'sound/machines/warning-buzzer.ogg', 50) + user.visible_message("[user] tips over [src]!", "You tip [src] over!") + mode = BOT_TIPPED + var/matrix/mat = transform + transform = mat.Turn(180) + +/mob/living/simple_animal/bot/medbot/proc/set_right(mob/user) + canmove = 1 + //mobility_flags &= MOBILITY_MOVE + var/list/messagevoice + if(user) + user.visible_message("[user] sets [src] right-side up!", "You set [src] right-side up!") + if(user.name == tipper_name) + messagevoice = list("I forgive you." = 'sound/voice/medbot/forgive.ogg') + else + messagevoice = list("Thank you!" = 'sound/voice/medbot/thank_you.ogg', "You are a good person." = 'sound/voice/medbot/youre_good.ogg') + else + visible_message("[src] manages to writhe wiggle enough to right itself.") + messagevoice = list("Fuck you." = 'sound/voice/medbot/fuck_you.ogg', "Your behavior has been reported, have a nice day." = 'sound/voice/medbot/reported.ogg') + + tipper_name = null + if(world.time > last_tipping_action_voice + 15 SECONDS) + last_tipping_action_voice = world.time + var/message = pick(messagevoice) + speak(message) + playsound(src, messagevoice[message], 70) + tipped_status = MEDBOT_PANIC_NONE + mode = BOT_IDLE + transform = matrix() + +// if someone tipped us over, check whether we should ask for help or just right ourselves eventually +/mob/living/simple_animal/bot/medbot/proc/handle_panic() + tipped_status++ + var/list/messagevoice + switch(tipped_status) + if(MEDBOT_PANIC_LOW) + messagevoice = list("I require assistance." = 'sound/voice/medbot/i_require_asst.ogg') + if(MEDBOT_PANIC_MED) + messagevoice = list("Please put me back." = 'sound/voice/medbot/please_put_me_back.ogg') + if(MEDBOT_PANIC_HIGH) + messagevoice = list("Please, I am scared!" = 'sound/voice/medbot/please_im_scared.ogg') + if(MEDBOT_PANIC_FUCK) + messagevoice = list("I don't like this, I need help!" = 'sound/voice/medbot/dont_like.ogg', "This hurts, my pain is real!" = 'sound/voice/medbot/pain_is_real.ogg') + if(MEDBOT_PANIC_ENDING) + messagevoice = list("Is this the end?" = 'sound/voice/medbot/is_this_the_end.ogg', "Nooo!" = 'sound/voice/medbot/nooo.ogg') + if(MEDBOT_PANIC_END) + speak("PSYCH ALERT: Crewmember [tipper_name] recorded displaying antisocial tendencies torturing bots in [get_area(src)]. Please schedule psych evaluation.", radio_channel) + set_right() // strong independent medbot + + if(prob(tipped_status)) + do_jitter_animation(tipped_status * 0.1) + + if(messagevoice) + var/message = pick(messagevoice) + speak(message) + playsound(src, messagevoice[message], 70) + else if(prob(tipped_status * 0.2)) + playsound(src, 'sound/machines/warning-buzzer.ogg', 30, extrarange=-2) + +/mob/living/simple_animal/bot/medbot/examine(mob/user) + . = ..() + if(tipped_status == MEDBOT_PANIC_NONE) + return + + switch(tipped_status) + if(MEDBOT_PANIC_NONE to MEDBOT_PANIC_LOW) + . += "It appears to be tipped over, and is quietly waiting for someone to set it right." + if(MEDBOT_PANIC_LOW to MEDBOT_PANIC_MED) + . += "It is tipped over and requesting help." + if(MEDBOT_PANIC_MED to MEDBOT_PANIC_HIGH) + . += "They are tipped over and appear visibly distressed." // now we humanize the medbot as a they, not an it + if(MEDBOT_PANIC_HIGH to MEDBOT_PANIC_FUCK) + . += "They are tipped over and visibly panicking!" + if(MEDBOT_PANIC_FUCK to INFINITY) + . += "They are freaking out from being tipped over!" + +/mob/living/simple_animal/bot/medbot/handle_automated_action() + if(!..()) + return + + if(mode == BOT_TIPPED) + handle_panic() + return + + if(mode == BOT_HEALING) + return + + if(IsStun()) + oldpatient = patient + patient = null + mode = BOT_IDLE + return + + if(frustration > 8) + oldpatient = patient + soft_reset() + + if(QDELETED(patient)) + if(!shut_up && prob(1)) + if(emagged && prob(30)) + var/list/i_need_scissors = list('sound/voice/medbot/fuck_you.ogg', 'sound/voice/medbot/turn_off.ogg', 'sound/voice/medbot/im_different.ogg', 'sound/voice/medbot/close.ogg', 'sound/voice/medbot/shindemashou.ogg') + playsound(src, pick(i_need_scissors), 70) + else + var/list/messagevoice = list("Radar, put a mask on!" = 'sound/voice/medbot/radar.ogg',"There's always a catch, and I'm the best there is." = 'sound/voice/medbot/catch.ogg',"I knew it, I should've been a plastic surgeon." = 'sound/voice/medbot/surgeon.ogg',"What kind of medbay is this? Everyone's dropping like flies." = 'sound/voice/medbot/flies.ogg',"Delicious!" = 'sound/voice/medbot/delicious.ogg', "Why are we still here? Just to suffer?" = 'sound/voice/medbot/why.ogg') + var/message = pick(messagevoice) + speak(message) + playsound(src, messagevoice[message], 50) + var/scan_range = (stationary_mode ? 1 : DEFAULT_SCAN_RANGE) //If in stationary mode, scan range is limited to adjacent patients. + patient = scan(/mob/living/carbon/human, oldpatient, scan_range) + oldpatient = patient + + if(patient && (get_dist(src,patient) <= 1)) //Patient is next to us, begin treatment! + if(mode != BOT_HEALING) + mode = BOT_HEALING + update_icon() + frustration = 0 + medicate_patient(patient) + return + + //Patient has moved away from us! + else if(patient && path.len && (get_dist(patient,path[path.len]) > 2)) + path = list() + mode = BOT_IDLE + last_found = world.time + + else if(stationary_mode && patient) //Since we cannot move in this mode, ignore the patient and wait for another. + soft_reset() + return + + if(patient && path.len == 0 && (get_dist(src,patient) > 1)) + path = get_path_to(src, get_turf(patient), /turf/proc/Distance_cardinal, 0, 30,id=access_card) + mode = BOT_MOVING + if(!path.len) //try to get closer if you can't reach the patient directly + path = get_path_to(src, get_turf(patient), /turf/proc/Distance_cardinal, 0, 30,1,id=access_card) + if(!path.len) //Do not chase a patient we cannot reach. + soft_reset() + + if(path.len > 0 && patient) + if(!bot_move(path[path.len])) + oldpatient = patient + soft_reset() + return + + if(path.len > 8 && patient) + frustration++ + + if(auto_patrol && !stationary_mode && !patient) + if(mode == BOT_IDLE || mode == BOT_START_PATROL) + start_patrol() + + if(mode == BOT_PATROL) + bot_patrol() + + return + +/mob/living/simple_animal/bot/medbot/proc/assess_patient(mob/living/carbon/C) + //Time to see if they need medical help! + if(C.stat == DEAD || (HAS_TRAIT(C, TRAIT_FAKEDEATH))) + return FALSE //welp too late for them! + + if(!(loc == C.loc) && !(isturf(C.loc) && isturf(loc))) + return FALSE + + if(C.suiciding) + return FALSE //Kevorkian school of robotic medical assistants. + + if(emagged == 2) //Everyone needs our medicine. (Our medicine is toxins) + return TRUE + + if(ishuman(C)) + var/mob/living/carbon/human/H = C + if (H.wear_suit && H.head && istype(H.wear_suit, /obj/item/clothing) && istype(H.head, /obj/item/clothing)) + var/obj/item/clothing/CS = H.wear_suit + var/obj/item/clothing/CH = H.head + if (CS.clothing_flags & CH.clothing_flags & THICKMATERIAL) + return FALSE // Skip over them if they have no exposed flesh. + + if(declare_crit && C.health <= 0) //Critical condition! Call for help! + declare(C) + + //If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS. + if((reagent_glass) && (use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15)))) + for(var/A in reagent_glass.reagents.reagent_list) + var/datum/reagent/R = A + if(!C.reagents.has_reagent(R.type)) + return TRUE + + //They're injured enough for it! + if((!C.reagents.has_reagent(treatment_brute_avoid)) && (C.getBruteLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_brute))) + return TRUE //If they're already medicated don't bother! + + if((!C.reagents.has_reagent(treatment_oxy_avoid)) && (C.getOxyLoss() >= (15 + heal_threshold)) && (!C.reagents.has_reagent(treatment_oxy))) + return TRUE + + if((!C.reagents.has_reagent(treatment_fire_avoid)) && (C.getFireLoss() >= heal_threshold) && (!C.reagents.has_reagent(treatment_fire))) + return TRUE + + var/treatment_toxavoid = get_avoidchem_toxin(C) + if(((isnull(treatment_toxavoid) || !C.reagents.has_reagent(treatment_toxavoid))) && (C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(get_healchem_toxin(C)))) + return TRUE + + if(treat_virus && !C.reagents.has_reagent(treatment_virus_avoid) && !C.reagents.has_reagent(treatment_virus)) + for(var/thing in C.diseases) + var/datum/disease/D = thing + //the medibot can't detect viruses that are undetectable to Health Analyzers or Pandemic machines. + if(!(D.visibility_flags & HIDDEN_SCANNER || D.visibility_flags & HIDDEN_PANDEMIC) \ + && D.severity != DISEASE_SEVERITY_POSITIVE \ + && (D.stage > 1 || (D.spread_flags & DISEASE_SPREAD_AIRBORNE))) // medibot can't detect a virus in its initial stage unless it spreads airborne. + return TRUE //STOP DISEASE FOREVER + + return FALSE + +/mob/living/simple_animal/bot/medbot/attack_hand(mob/living/carbon/human/H) + if(H.a_intent == INTENT_DISARM && mode != BOT_TIPPED) + H.visible_message("[H] begins tipping over [src].", "You begin tipping over [src]...") + + if(world.time > last_tipping_action_voice + 15 SECONDS) + last_tipping_action_voice = world.time // message for tipping happens when we start interacting, message for righting comes after finishing + var/list/messagevoice = list("Hey, wait..." = 'sound/voice/medbot/hey_wait.ogg',"Please don't..." = 'sound/voice/medbot/please_dont.ogg',"I trusted you..." = 'sound/voice/medbot/i_trusted_you.ogg', "Nooo..." = 'sound/voice/medbot/nooo.ogg', "Oh fuck-" = 'sound/voice/medbot/oh_fuck.ogg') + var/message = pick(messagevoice) + speak(message) + playsound(src, messagevoice[message], 70, FALSE) + + if(do_after(H, 3 SECONDS, target=src)) + tip_over(H) + + else if(H.a_intent == INTENT_HELP && mode == BOT_TIPPED) + H.visible_message("[H] begins righting [src].", "You begin righting [src]...") + if(do_after(H, 3 SECONDS, target=src)) + set_right(H) + else + ..() + +/mob/living/simple_animal/bot/medbot/proc/get_avoidchem_toxin(mob/M) + return HAS_TRAIT(M, TRAIT_TOXINLOVER)? null : treatment_tox_avoid + +/mob/living/simple_animal/bot/medbot/proc/get_healchem_toxin(mob/M) + return HAS_TRAIT(M, TRAIT_TOXINLOVER)? treatment_tox_toxlover : treatment_tox + +/mob/living/simple_animal/bot/medbot/UnarmedAttack(atom/A) + if(iscarbon(A)) + var/mob/living/carbon/C = A + patient = C + mode = BOT_HEALING + update_icon() + medicate_patient(C) + update_icon() + else + ..() + +/mob/living/simple_animal/bot/medbot/examinate(atom/A as mob|obj|turf in view()) + ..() + if(!is_blind(src)) + chemscan(src, A) + +/mob/living/simple_animal/bot/medbot/proc/medicate_patient(mob/living/carbon/C) + if(!on) + return + + if(!istype(C)) + oldpatient = patient + soft_reset() + return + + if(C.stat == DEAD || (HAS_TRAIT(C, TRAIT_FAKEDEATH))) + var/list/messagevoice = list("No! Stay with me!" = 'sound/voice/medbot/no.ogg',"Live, damnit! LIVE!" = 'sound/voice/medbot/live.ogg',"I...I've never lost a patient before. Not today, I mean." = 'sound/voice/medbot/lost.ogg') + var/message = pick(messagevoice) + speak(message) + playsound(loc, messagevoice[message], 50, 0) + oldpatient = patient + soft_reset() + return + + var/reagent_id = null + + if(emagged == 2) //Emagged! Time to poison everybody. + reagent_id = "toxin" + reagent_id = HAS_TRAIT(C, TRAIT_TOXINLOVER)? "charcoal" : "toxin" + + else + if(treat_virus) + var/virus = 0 + for(var/thing in C.diseases) + var/datum/disease/D = thing + //detectable virus + if((!(D.visibility_flags & HIDDEN_SCANNER)) || (!(D.visibility_flags & HIDDEN_PANDEMIC))) + if(D.severity != DISEASE_SEVERITY_POSITIVE) //virus is harmful + if((D.stage > 1) || (D.spread_flags & DISEASE_SPREAD_AIRBORNE)) + virus = 1 + + if(!reagent_id && (virus)) + if(!C.reagents.has_reagent(treatment_virus) && !C.reagents.has_reagent(treatment_virus_avoid)) + reagent_id = treatment_virus + + if(!reagent_id && (C.getBruteLoss() >= heal_threshold)) + if(!C.reagents.has_reagent(treatment_brute) && !C.reagents.has_reagent(treatment_brute_avoid)) + reagent_id = treatment_brute + + if(!reagent_id && (C.getOxyLoss() >= (15 + heal_threshold))) + if(!C.reagents.has_reagent(treatment_oxy) && !C.reagents.has_reagent(treatment_oxy_avoid)) + reagent_id = treatment_oxy + + if(!reagent_id && (C.getFireLoss() >= heal_threshold)) + if(!C.reagents.has_reagent(treatment_fire) && !C.reagents.has_reagent(treatment_fire_avoid)) + reagent_id = treatment_fire + + if(!reagent_id && (C.getToxLoss() >= heal_threshold)) + var/toxin_heal_avoid = get_avoidchem_toxin(C) + var/toxin_healchem = get_healchem_toxin(C) + if(!C.reagents.has_reagent(toxin_healchem) && (isnull(toxin_heal_avoid) || !C.reagents.has_reagent(toxin_heal_avoid))) + reagent_id = toxin_healchem + + //If the patient is injured but doesn't have our special reagent in them then we should give it to them first + if(reagent_id && use_beaker && reagent_glass && reagent_glass.reagents.total_volume) + for(var/A in reagent_glass.reagents.reagent_list) + var/datum/reagent/R = A + if(!C.reagents.has_reagent(R.type)) + reagent_id = "internal_beaker" + break + + if(!reagent_id) //If they don't need any of that they're probably cured! + if(C.maxHealth - C.health < heal_threshold) + to_chat(src, "[C] is healthy! Your programming prevents you from injecting anyone without at least [heal_threshold] damage of any one type ([heal_threshold + 15] for oxygen damage.)") + var/list/messagevoice = list("All patched up!" = 'sound/voice/medbot/patchedup.ogg',"An apple a day keeps me away." = 'sound/voice/medbot/apple.ogg',"Feel better soon!" = 'sound/voice/medbot/feelbetter.ogg') + var/message = pick(messagevoice) + speak(message) + playsound(loc, messagevoice[message], 50, 0) + bot_reset() + return + else + if(!emagged && check_overdose(patient,reagent_id,injection_amount)) + soft_reset() + return + C.visible_message("[src] is trying to inject [patient]!", \ + "[src] is trying to inject you!") + + var/failed = FALSE + if(do_mob(src, patient, 30)) //Is C == patient? This is so confusing + if((get_dist(src, patient) <= 1) && (on) && assess_patient(patient)) + if(reagent_id == "internal_beaker") + if(use_beaker && reagent_glass && reagent_glass.reagents.total_volume) + var/fraction = min(injection_amount/reagent_glass.reagents.total_volume, 1) + reagent_glass.reagents.reaction(patient, INJECT, fraction) + reagent_glass.reagents.trans_to(patient,injection_amount) //Inject from beaker instead. + else + patient.reagents.add_reagent(reagent_id,injection_amount) + C.visible_message("[src] injects [patient] with its syringe!", \ + "[src] injects you with its syringe!") + else + failed = TRUE + else + failed = TRUE + + if(failed) + visible_message("[src] retracts its syringe.") + update_icon() + soft_reset() + return + + reagent_id = null + return + +/mob/living/simple_animal/bot/medbot/proc/check_overdose(mob/living/carbon/patient,reagent_id,injection_amount) + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] + if(!R.overdose_threshold) //Some chems do not have an OD threshold + return FALSE + var/current_volume = patient.reagents.get_reagent_amount(reagent_id) + if(current_volume + injection_amount > R.overdose_threshold) + return TRUE + return FALSE + +/mob/living/simple_animal/bot/medbot/explode() + on = FALSE + visible_message("[src] blows apart!") + var/atom/Tsec = drop_location() + + drop_part(firstaid, Tsec) + new /obj/item/assembly/prox_sensor(Tsec) + drop_part(healthanalyzer, Tsec) + + if(reagent_glass) + drop_part(reagent_glass, Tsec) + + if(prob(50)) + drop_part(robot_arm, Tsec) + + if(emagged && prob(25)) + playsound(loc, 'sound/voice/medbot/insult.ogg', 50, 0) + + do_sparks(3, TRUE, src) + ..() + +/mob/living/simple_animal/bot/medbot/proc/declare(crit_patient) + if(declare_cooldown > world.time) + return + var/area/location = get_area(src) + speak("Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!",radio_channel) + declare_cooldown = world.time + 200 + +/obj/machinery/bot_core/medbot + req_one_access = list(ACCESS_MEDICAL, ACCESS_ROBOTICS) + +#undef MEDBOT_PANIC_NONE +#undef MEDBOT_PANIC_LOW +#undef MEDBOT_PANIC_MED +#undef MEDBOT_PANIC_HIGH +#undef MEDBOT_PANIC_FUCK +#undef MEDBOT_PANIC_ENDING +#undef MEDBOT_PANIC_END diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index ca422ca7..7a64c4e0 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -1,446 +1,446 @@ -/mob/living/simple_animal/bot/secbot - name = "\improper Securitron" - desc = "A little security robot. He looks less than thrilled." - icon = 'icons/mob/aibots.dmi' - icon_state = "secbot" - density = FALSE - anchored = FALSE - health = 25 - maxHealth = 25 - damage_coeff = list(BRUTE = 0.5, BURN = 0.7, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) - pass_flags = PASSMOB - - radio_key = /obj/item/encryptionkey/secbot //AI Priv + Security - radio_channel = RADIO_CHANNEL_SECURITY //Security channel - bot_type = SEC_BOT - model = "Securitron" - bot_core_type = /obj/machinery/bot_core/secbot - window_id = "autosec" - window_name = "Automatic Security Unit v1.6" - allow_pai = 0 - data_hud_type = DATA_HUD_SECURITY_ADVANCED - path_image_color = "#FF0000" - - var/baton_type = /obj/item/melee/baton - var/mob/living/carbon/target - var/oldtarget_name - var/threatlevel = FALSE - var/target_lastloc //Loc of target when arrested. - var/last_found //There's a delay - var/declare_arrests = TRUE //When making an arrest, should it notify everyone on the security channel? - var/idcheck = FALSE //If true, arrest people with no IDs - var/weaponscheck = FALSE //If true, arrest people for weapons if they lack access - var/check_records = TRUE //Does it check security records? - var/arrest_type = FALSE //If true, don't handcuff - -/mob/living/simple_animal/bot/secbot/beepsky - name = "Officer Beep O'sky" - desc = "It's Officer Beep O'sky! Powered by a potato and a shot of whiskey." - idcheck = FALSE - weaponscheck = FALSE - auto_patrol = TRUE - -/mob/living/simple_animal/bot/secbot/beepsky/jr - name = "Officer Pipsqueak" - desc = "It's Officer Beep O'sky's smaller, just-as aggressive cousin, Pipsqueak." - -/mob/living/simple_animal/bot/secbot/beepsky/jr/Initialize() - . = ..() - resize = 0.8 - update_transform() - - -/mob/living/simple_animal/bot/secbot/beepsky/explode() - var/atom/Tsec = drop_location() - new /obj/item/stock_parts/cell/potato(Tsec) - var/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/S = new(Tsec) - S.reagents.add_reagent("whiskey", 15) - S.on_reagent_change(ADD_REAGENT) - ..() - -/mob/living/simple_animal/bot/secbot/pingsky - name = "Officer Pingsky" - desc = "It's Officer Pingsky! Delegated to satellite guard duty for harbouring anti-human sentiment." - radio_channel = RADIO_CHANNEL_AI_PRIVATE - -/mob/living/simple_animal/bot/secbot/Initialize() - . = ..() - update_icon() - var/datum/job/detective/J = new/datum/job/detective - access_card.access += J.get_access() - prev_access = access_card.access - - //SECHUD - var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] - secsensor.add_hud_to(src) - -/mob/living/simple_animal/bot/secbot/update_icon() - if(mode == BOT_HUNT) - icon_state = "[initial(icon_state)]-c" - return - ..() - -/mob/living/simple_animal/bot/secbot/turn_off() - ..() - mode = BOT_IDLE - -/mob/living/simple_animal/bot/secbot/bot_reset() - ..() - target = null - oldtarget_name = null - anchored = FALSE - walk_to(src,0) - last_found = world.time - -/mob/living/simple_animal/bot/secbot/set_custom_texts() - - text_hack = "You overload [name]'s target identification system." - text_dehack = "You reboot [name] and restore the target identification." - text_dehack_fail = "[name] refuses to accept your authority!" - -/mob/living/simple_animal/bot/secbot/get_controls(mob/user) - var/dat - dat += hack(user) - dat += showpai(user) - dat += text({" -Securitron v1.6 controls

    -Status: []
    -Behaviour controls are [locked ? "locked" : "unlocked"]
    -Maintenance panel panel is [open ? "opened" : "closed"]"}, - -"[on ? "On" : "Off"]" ) - - if(!locked || issilicon(user) || IsAdminGhost(user)) - dat += text({"
    -Arrest Unidentifiable Persons: []
    -Arrest for Unauthorized Weapons: []
    -Arrest for Warrant: []
    -Operating Mode: []
    -Report Arrests[]
    -Auto Patrol: []"}, - -"[idcheck ? "Yes" : "No"]", -"[weaponscheck ? "Yes" : "No"]", -"[check_records ? "Yes" : "No"]", -"[arrest_type ? "Detain" : "Arrest"]", -"[declare_arrests ? "Yes" : "No"]", -"[auto_patrol ? "On" : "Off"]" ) - - return dat - -/mob/living/simple_animal/bot/secbot/Topic(href, href_list) - if(..()) - return 1 - - if(!issilicon(usr) && !IsAdminGhost(usr) && !(bot_core.allowed(usr) || !locked)) - return TRUE - - switch(href_list["operation"]) - if("idcheck") - idcheck = !idcheck - update_controls() - if("weaponscheck") - weaponscheck = !weaponscheck - update_controls() - if("ignorerec") - check_records = !check_records - update_controls() - if("switchmode") - arrest_type = !arrest_type - update_controls() - if("declarearrests") - declare_arrests = !declare_arrests - update_controls() - -/mob/living/simple_animal/bot/secbot/proc/retaliate(mob/living/carbon/human/H) - var/judgement_criteria = judgement_criteria() - threatlevel = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) - threatlevel += 6 - if(threatlevel >= 4) - target = H - mode = BOT_HUNT - -/mob/living/simple_animal/bot/secbot/proc/judgement_criteria() - var/final = FALSE - if(idcheck) - final = final|JUDGE_IDCHECK - if(check_records) - final = final|JUDGE_RECORDCHECK - if(weaponscheck) - final = final|JUDGE_WEAPONCHECK - if(emagged == 2) - final = final|JUDGE_EMAGGED - return final - -/mob/living/simple_animal/bot/secbot/proc/special_retaliate_after_attack(mob/user) //allows special actions to take place after being attacked. - return - -/mob/living/simple_animal/bot/secbot/attack_hand(mob/living/carbon/human/H) - if((H.a_intent == INTENT_HARM) || (H.a_intent == INTENT_DISARM)) - retaliate(H) - if(special_retaliate_after_attack(H)) - return - - return ..() - -/mob/living/simple_animal/bot/secbot/attackby(obj/item/W, mob/user, params) - ..() - if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry. - return - if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass. - retaliate(user) - if(special_retaliate_after_attack(user)) - return - -/mob/living/simple_animal/bot/secbot/emag_act(mob/user) - ..() - if(emagged == 2) - if(user) - to_chat(user, "You short out [src]'s target assessment circuits.") - oldtarget_name = user.name - audible_message("[src] buzzes oddly!") - declare_arrests = FALSE - update_icon() - -/mob/living/simple_animal/bot/secbot/bullet_act(obj/item/projectile/Proj) - if(istype(Proj , /obj/item/projectile/beam)||istype(Proj, /obj/item/projectile/bullet)) - if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) - if(!Proj.nodamage && Proj.damage < src.health && ishuman(Proj.firer)) - retaliate(Proj.firer) - ..() - - -/mob/living/simple_animal/bot/secbot/UnarmedAttack(atom/A) - if(!on) - return - if(iscarbon(A)) - var/mob/living/carbon/C = A - if(C.canmove || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun. - stun_attack(A) - else if(C.canBeHandcuffed() && !C.handcuffed) - cuff(A) - else - ..() - - -/mob/living/simple_animal/bot/secbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(AM, /obj/item)) - var/obj/item/I = AM - if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby)) - var/mob/living/carbon/human/H = I.thrownby - retaliate(H) - ..() - - -/mob/living/simple_animal/bot/secbot/proc/cuff(mob/living/carbon/C) - mode = BOT_ARREST - playsound(src, 'sound/weapons/cablecuff.ogg', 30, TRUE, -2) - C.visible_message("[src] is trying to put zipties on [C]!",\ - "[src] is trying to put zipties on you!") - addtimer(CALLBACK(src, .proc/attempt_handcuff, C), 60) - -/mob/living/simple_animal/bot/secbot/proc/attempt_handcuff(mob/living/carbon/C) - if( !on || !Adjacent(C) || !isturf(C.loc) ) //if he's in a closet or not adjacent, we cancel cuffing. - return - if(!C.handcuffed) - C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C) - C.update_handcuffed() - playsound(src, "law", 50, 0) - back_to_idle() - -/mob/living/simple_animal/bot/secbot/proc/stun_attack(mob/living/carbon/C) - var/judgement_criteria = judgement_criteria() - playsound(src, 'sound/weapons/egloves.ogg', 50, TRUE, -1) - icon_state = "secbot-c" - addtimer(CALLBACK(src, .proc/update_icon), 2) - var/threat = 5 - if(ishuman(C)) - C.stuttering = 5 - C.Knockdown(100) - var/mob/living/carbon/human/H = C - threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) - else - C.Knockdown(100) - C.stuttering = 5 - threat = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) - - log_combat(src,C,"stunned") - if(declare_arrests) - var/area/location = get_area(src) - speak("[arrest_type ? "Detaining" : "Arresting"] level [threat] scumbag [C] in [location].", radio_channel) - C.visible_message("[src] has stunned [C]!",\ - "[src] has stunned you!") - -/mob/living/simple_animal/bot/secbot/handle_automated_action() - if(!..()) - return - - switch(mode) - - if(BOT_IDLE) // idle - - walk_to(src,0) - look_for_perp() // see if any criminals are in range - if(!mode && auto_patrol) // still idle, and set to patrol - mode = BOT_START_PATROL // switch to patrol mode - - if(BOT_HUNT) // hunting for perp - - // if can't reach perp for long enough, go idle - if(frustration >= 8) - walk_to(src,0) - back_to_idle() - return - - if(target) // make sure target exists - if(Adjacent(target) && isturf(target.loc)) // if right next to perp - stun_attack(target) - - mode = BOT_PREP_ARREST - anchored = TRUE - target_lastloc = target.loc - return - - else // not next to perp - var/turf/olddist = get_dist(src, target) - walk_to(src, target,1,4) - if((get_dist(src, target)) >= (olddist)) - frustration++ - else - frustration = 0 - else - back_to_idle() - - if(BOT_PREP_ARREST) // preparing to arrest target - - // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. - if( !Adjacent(target) || !isturf(target.loc) || target.getStaminaLoss() <= 120 || !target.recoveringstam) //CIT CHANGE - replaces amountknockdown with checks for stamina so secbots dont run into an infinite loop - back_to_hunt() - return - - if(iscarbon(target) && target.canBeHandcuffed()) - if(!arrest_type) - if(!target.handcuffed) //he's not cuffed? Try to cuff him! - cuff(target) - else - back_to_idle() - return - else - back_to_idle() - return - - if(BOT_ARREST) - if(!target) - anchored = FALSE - mode = BOT_IDLE - last_found = world.time - frustration = 0 - return - - if(target.handcuffed) //no target or target cuffed? back to idle. - back_to_idle() - return - - if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && !target.recoveringstam && target.getStaminaLoss() <= 120)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss check - back_to_hunt() - return - else //Try arresting again if the target escapes. - mode = BOT_PREP_ARREST - anchored = FALSE - - if(BOT_START_PATROL) - look_for_perp() - start_patrol() - - if(BOT_PATROL) - look_for_perp() - bot_patrol() - - - return - -/mob/living/simple_animal/bot/secbot/proc/back_to_idle() - anchored = FALSE - mode = BOT_IDLE - target = null - last_found = world.time - frustration = 0 - INVOKE_ASYNC(src, .proc/handle_automated_action) - -/mob/living/simple_animal/bot/secbot/proc/back_to_hunt() - anchored = FALSE - frustration = 0 - mode = BOT_HUNT - INVOKE_ASYNC(src, .proc/handle_automated_action) -// look for a criminal in view of the bot - -/mob/living/simple_animal/bot/secbot/proc/look_for_perp() - anchored = FALSE - var/judgement_criteria = judgement_criteria() - for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal - if((C.stat) || (C.handcuffed)) - continue - - if((C.name == oldtarget_name) && (world.time < last_found + 100)) - continue - - threatlevel = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) - - if(!threatlevel) - continue - - else if(threatlevel >= 4) - target = C - oldtarget_name = C.name - speak("Level [threatlevel] infraction alert!") - playsound(loc, pick('sound/voice/beepsky/criminal.ogg', 'sound/voice/beepsky/justice.ogg', 'sound/voice/beepsky/freeze.ogg'), 50, FALSE) - visible_message("[src] points at [C.name]!") - mode = BOT_HUNT - INVOKE_ASYNC(src, .proc/handle_automated_action) - break - else - continue - -/mob/living/simple_animal/bot/secbot/proc/check_for_weapons(var/obj/item/slot_item) - if(slot_item && (slot_item.item_flags & NEEDS_PERMIT)) - return TRUE - return FALSE - -/mob/living/simple_animal/bot/secbot/explode() - - walk_to(src,0) - visible_message("[src] blows apart!") - var/atom/Tsec = drop_location() - - var/obj/item/bot_assembly/secbot/Sa = new (Tsec) - Sa.build_step = 1 - Sa.add_overlay("hs_hole") - Sa.created_name = name - new /obj/item/assembly/prox_sensor(Tsec) - drop_part(baton_type, Tsec) - - if(prob(50)) - drop_part(robot_arm, Tsec) - - do_sparks(3, TRUE, src) - - new /obj/effect/decal/cleanable/oil(loc) - ..() - -/mob/living/simple_animal/bot/secbot/attack_alien(var/mob/living/carbon/alien/user as mob) - ..() - if(!isalien(target)) - target = user - mode = BOT_HUNT - -/mob/living/simple_animal/bot/secbot/Crossed(atom/movable/AM) - if(has_gravity() && ismob(AM) && target) - var/mob/living/carbon/C = AM - if(!istype(C) || !C || in_range(src, target)) - return - knockOver(C) - return - ..() - -/obj/machinery/bot_core/secbot - req_access = list(ACCESS_SECURITY) +/mob/living/simple_animal/bot/secbot + name = "\improper Securitron" + desc = "A little security robot. He looks less than thrilled." + icon = 'icons/mob/aibots.dmi' + icon_state = "secbot" + density = FALSE + anchored = FALSE + health = 25 + maxHealth = 25 + damage_coeff = list(BRUTE = 0.5, BURN = 0.7, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) + pass_flags = PASSMOB + + radio_key = /obj/item/encryptionkey/secbot //AI Priv + Security + radio_channel = RADIO_CHANNEL_SECURITY //Security channel + bot_type = SEC_BOT + model = "Securitron" + bot_core_type = /obj/machinery/bot_core/secbot + window_id = "autosec" + window_name = "Automatic Security Unit v1.6" + allow_pai = 0 + data_hud_type = DATA_HUD_SECURITY_ADVANCED + path_image_color = "#FF0000" + + var/baton_type = /obj/item/melee/baton + var/mob/living/carbon/target + var/oldtarget_name + var/threatlevel = FALSE + var/target_lastloc //Loc of target when arrested. + var/last_found //There's a delay + var/declare_arrests = TRUE //When making an arrest, should it notify everyone on the security channel? + var/idcheck = FALSE //If true, arrest people with no IDs + var/weaponscheck = FALSE //If true, arrest people for weapons if they lack access + var/check_records = TRUE //Does it check security records? + var/arrest_type = FALSE //If true, don't handcuff + +/mob/living/simple_animal/bot/secbot/beepsky + name = "Officer Beep O'sky" + desc = "It's Officer Beep O'sky! Powered by a potato and a shot of whiskey." + idcheck = FALSE + weaponscheck = FALSE + auto_patrol = TRUE + +/mob/living/simple_animal/bot/secbot/beepsky/jr + name = "Officer Pipsqueak" + desc = "It's Officer Beep O'sky's smaller, just-as aggressive cousin, Pipsqueak." + +/mob/living/simple_animal/bot/secbot/beepsky/jr/Initialize() + . = ..() + resize = 0.8 + update_transform() + + +/mob/living/simple_animal/bot/secbot/beepsky/explode() + var/atom/Tsec = drop_location() + new /obj/item/stock_parts/cell/potato(Tsec) + var/obj/item/reagent_containers/food/drinks/drinkingglass/shotglass/S = new(Tsec) + S.reagents.add_reagent(/datum/reagent/consumable/ethanol/whiskey, 15) + S.on_reagent_change(ADD_REAGENT) + ..() + +/mob/living/simple_animal/bot/secbot/pingsky + name = "Officer Pingsky" + desc = "It's Officer Pingsky! Delegated to satellite guard duty for harbouring anti-human sentiment." + radio_channel = RADIO_CHANNEL_AI_PRIVATE + +/mob/living/simple_animal/bot/secbot/Initialize() + . = ..() + update_icon() + var/datum/job/detective/J = new/datum/job/detective + access_card.access += J.get_access() + prev_access = access_card.access + + //SECHUD + var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] + secsensor.add_hud_to(src) + +/mob/living/simple_animal/bot/secbot/update_icon() + if(mode == BOT_HUNT) + icon_state = "[initial(icon_state)]-c" + return + ..() + +/mob/living/simple_animal/bot/secbot/turn_off() + ..() + mode = BOT_IDLE + +/mob/living/simple_animal/bot/secbot/bot_reset() + ..() + target = null + oldtarget_name = null + anchored = FALSE + walk_to(src,0) + last_found = world.time + +/mob/living/simple_animal/bot/secbot/set_custom_texts() + + text_hack = "You overload [name]'s target identification system." + text_dehack = "You reboot [name] and restore the target identification." + text_dehack_fail = "[name] refuses to accept your authority!" + +/mob/living/simple_animal/bot/secbot/get_controls(mob/user) + var/dat + dat += hack(user) + dat += showpai(user) + dat += text({" +Securitron v1.6 controls

    +Status: []
    +Behaviour controls are [locked ? "locked" : "unlocked"]
    +Maintenance panel panel is [open ? "opened" : "closed"]"}, + +"[on ? "On" : "Off"]" ) + + if(!locked || issilicon(user) || IsAdminGhost(user)) + dat += text({"
    +Arrest Unidentifiable Persons: []
    +Arrest for Unauthorized Weapons: []
    +Arrest for Warrant: []
    +Operating Mode: []
    +Report Arrests[]
    +Auto Patrol: []"}, + +"[idcheck ? "Yes" : "No"]", +"[weaponscheck ? "Yes" : "No"]", +"[check_records ? "Yes" : "No"]", +"[arrest_type ? "Detain" : "Arrest"]", +"[declare_arrests ? "Yes" : "No"]", +"[auto_patrol ? "On" : "Off"]" ) + + return dat + +/mob/living/simple_animal/bot/secbot/Topic(href, href_list) + if(..()) + return 1 + + if(!issilicon(usr) && !IsAdminGhost(usr) && !(bot_core.allowed(usr) || !locked)) + return TRUE + + switch(href_list["operation"]) + if("idcheck") + idcheck = !idcheck + update_controls() + if("weaponscheck") + weaponscheck = !weaponscheck + update_controls() + if("ignorerec") + check_records = !check_records + update_controls() + if("switchmode") + arrest_type = !arrest_type + update_controls() + if("declarearrests") + declare_arrests = !declare_arrests + update_controls() + +/mob/living/simple_animal/bot/secbot/proc/retaliate(mob/living/carbon/human/H) + var/judgement_criteria = judgement_criteria() + threatlevel = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) + threatlevel += 6 + if(threatlevel >= 4) + target = H + mode = BOT_HUNT + +/mob/living/simple_animal/bot/secbot/proc/judgement_criteria() + var/final = FALSE + if(idcheck) + final = final|JUDGE_IDCHECK + if(check_records) + final = final|JUDGE_RECORDCHECK + if(weaponscheck) + final = final|JUDGE_WEAPONCHECK + if(emagged == 2) + final = final|JUDGE_EMAGGED + return final + +/mob/living/simple_animal/bot/secbot/proc/special_retaliate_after_attack(mob/user) //allows special actions to take place after being attacked. + return + +/mob/living/simple_animal/bot/secbot/attack_hand(mob/living/carbon/human/H) + if((H.a_intent == INTENT_HARM) || (H.a_intent == INTENT_DISARM)) + retaliate(H) + if(special_retaliate_after_attack(H)) + return + + return ..() + +/mob/living/simple_animal/bot/secbot/attackby(obj/item/W, mob/user, params) + ..() + if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry. + return + if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass. + retaliate(user) + if(special_retaliate_after_attack(user)) + return + +/mob/living/simple_animal/bot/secbot/emag_act(mob/user) + ..() + if(emagged == 2) + if(user) + to_chat(user, "You short out [src]'s target assessment circuits.") + oldtarget_name = user.name + audible_message("[src] buzzes oddly!") + declare_arrests = FALSE + update_icon() + +/mob/living/simple_animal/bot/secbot/bullet_act(obj/item/projectile/Proj) + if(istype(Proj , /obj/item/projectile/beam)||istype(Proj, /obj/item/projectile/bullet)) + if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) + if(!Proj.nodamage && Proj.damage < src.health && ishuman(Proj.firer)) + retaliate(Proj.firer) + ..() + + +/mob/living/simple_animal/bot/secbot/UnarmedAttack(atom/A) + if(!on) + return + if(iscarbon(A)) + var/mob/living/carbon/C = A + if(C.canmove || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun. + stun_attack(A) + else if(C.canBeHandcuffed() && !C.handcuffed) + cuff(A) + else + ..() + + +/mob/living/simple_animal/bot/secbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + if(istype(AM, /obj/item)) + var/obj/item/I = AM + if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby)) + var/mob/living/carbon/human/H = I.thrownby + retaliate(H) + ..() + + +/mob/living/simple_animal/bot/secbot/proc/cuff(mob/living/carbon/C) + mode = BOT_ARREST + playsound(src, 'sound/weapons/cablecuff.ogg', 30, TRUE, -2) + C.visible_message("[src] is trying to put zipties on [C]!",\ + "[src] is trying to put zipties on you!") + addtimer(CALLBACK(src, .proc/attempt_handcuff, C), 60) + +/mob/living/simple_animal/bot/secbot/proc/attempt_handcuff(mob/living/carbon/C) + if( !on || !Adjacent(C) || !isturf(C.loc) ) //if he's in a closet or not adjacent, we cancel cuffing. + return + if(!C.handcuffed) + C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C) + C.update_handcuffed() + playsound(src, "law", 50, 0) + back_to_idle() + +/mob/living/simple_animal/bot/secbot/proc/stun_attack(mob/living/carbon/C) + var/judgement_criteria = judgement_criteria() + playsound(src, 'sound/weapons/egloves.ogg', 50, TRUE, -1) + icon_state = "secbot-c" + addtimer(CALLBACK(src, .proc/update_icon), 2) + var/threat = 5 + if(ishuman(C)) + C.stuttering = 5 + C.Knockdown(100) + var/mob/living/carbon/human/H = C + threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) + else + C.Knockdown(100) + C.stuttering = 5 + threat = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) + + log_combat(src,C,"stunned") + if(declare_arrests) + var/area/location = get_area(src) + speak("[arrest_type ? "Detaining" : "Arresting"] level [threat] scumbag [C] in [location].", radio_channel) + C.visible_message("[src] has stunned [C]!",\ + "[src] has stunned you!") + +/mob/living/simple_animal/bot/secbot/handle_automated_action() + if(!..()) + return + + switch(mode) + + if(BOT_IDLE) // idle + + walk_to(src,0) + look_for_perp() // see if any criminals are in range + if(!mode && auto_patrol) // still idle, and set to patrol + mode = BOT_START_PATROL // switch to patrol mode + + if(BOT_HUNT) // hunting for perp + + // if can't reach perp for long enough, go idle + if(frustration >= 8) + walk_to(src,0) + back_to_idle() + return + + if(target) // make sure target exists + if(Adjacent(target) && isturf(target.loc)) // if right next to perp + stun_attack(target) + + mode = BOT_PREP_ARREST + anchored = TRUE + target_lastloc = target.loc + return + + else // not next to perp + var/turf/olddist = get_dist(src, target) + walk_to(src, target,1,4) + if((get_dist(src, target)) >= (olddist)) + frustration++ + else + frustration = 0 + else + back_to_idle() + + if(BOT_PREP_ARREST) // preparing to arrest target + + // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. + if( !Adjacent(target) || !isturf(target.loc) || target.getStaminaLoss() <= 120 || !target.recoveringstam) //CIT CHANGE - replaces amountknockdown with checks for stamina so secbots dont run into an infinite loop + back_to_hunt() + return + + if(iscarbon(target) && target.canBeHandcuffed()) + if(!arrest_type) + if(!target.handcuffed) //he's not cuffed? Try to cuff him! + cuff(target) + else + back_to_idle() + return + else + back_to_idle() + return + + if(BOT_ARREST) + if(!target) + anchored = FALSE + mode = BOT_IDLE + last_found = world.time + frustration = 0 + return + + if(target.handcuffed) //no target or target cuffed? back to idle. + back_to_idle() + return + + if(!Adjacent(target) || !isturf(target.loc) || (target.loc != target_lastloc && !target.recoveringstam && target.getStaminaLoss() <= 120)) //if he's changed loc and about to get up or not adjacent or got into a closet, we prep arrest again. CIT CHANGE - replaces amountknockdown with recoveringstam and staminaloss check + back_to_hunt() + return + else //Try arresting again if the target escapes. + mode = BOT_PREP_ARREST + anchored = FALSE + + if(BOT_START_PATROL) + look_for_perp() + start_patrol() + + if(BOT_PATROL) + look_for_perp() + bot_patrol() + + + return + +/mob/living/simple_animal/bot/secbot/proc/back_to_idle() + anchored = FALSE + mode = BOT_IDLE + target = null + last_found = world.time + frustration = 0 + INVOKE_ASYNC(src, .proc/handle_automated_action) + +/mob/living/simple_animal/bot/secbot/proc/back_to_hunt() + anchored = FALSE + frustration = 0 + mode = BOT_HUNT + INVOKE_ASYNC(src, .proc/handle_automated_action) +// look for a criminal in view of the bot + +/mob/living/simple_animal/bot/secbot/proc/look_for_perp() + anchored = FALSE + var/judgement_criteria = judgement_criteria() + for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal + if((C.stat) || (C.handcuffed)) + continue + + if((C.name == oldtarget_name) && (world.time < last_found + 100)) + continue + + threatlevel = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) + + if(!threatlevel) + continue + + else if(threatlevel >= 4) + target = C + oldtarget_name = C.name + speak("Level [threatlevel] infraction alert!") + playsound(loc, pick('sound/voice/beepsky/criminal.ogg', 'sound/voice/beepsky/justice.ogg', 'sound/voice/beepsky/freeze.ogg'), 50, FALSE) + visible_message("[src] points at [C.name]!") + mode = BOT_HUNT + INVOKE_ASYNC(src, .proc/handle_automated_action) + break + else + continue + +/mob/living/simple_animal/bot/secbot/proc/check_for_weapons(var/obj/item/slot_item) + if(slot_item && (slot_item.item_flags & NEEDS_PERMIT)) + return TRUE + return FALSE + +/mob/living/simple_animal/bot/secbot/explode() + + walk_to(src,0) + visible_message("[src] blows apart!") + var/atom/Tsec = drop_location() + + var/obj/item/bot_assembly/secbot/Sa = new (Tsec) + Sa.build_step = 1 + Sa.add_overlay("hs_hole") + Sa.created_name = name + new /obj/item/assembly/prox_sensor(Tsec) + drop_part(baton_type, Tsec) + + if(prob(50)) + drop_part(robot_arm, Tsec) + + do_sparks(3, TRUE, src) + + new /obj/effect/decal/cleanable/oil(loc) + ..() + +/mob/living/simple_animal/bot/secbot/attack_alien(var/mob/living/carbon/alien/user as mob) + ..() + if(!isalien(target)) + target = user + mode = BOT_HUNT + +/mob/living/simple_animal/bot/secbot/Crossed(atom/movable/AM) + if(has_gravity() && ismob(AM) && target) + var/mob/living/carbon/C = AM + if(!istype(C) || !C || in_range(src, target)) + return + knockOver(C) + return + ..() + +/obj/machinery/bot_core/secbot + req_access = list(ACCESS_SECURITY) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index a66abfdc..a6197a3f 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -1,319 +1,319 @@ -//Cat -/mob/living/simple_animal/pet/cat - name = "cat" - desc = "Kitty!!" - icon = 'icons/mob/pets.dmi' - icon_state = "cat2" - icon_living = "cat2" - icon_dead = "cat2_dead" - gender = MALE - speak = list("Meow!", "Esp!", "Purr!", "HSSSSS") - speak_emote = list("purrs", "meows") - emote_hear = list("meows.", "mews.") - emote_see = list("shakes its head.", "shivers.") - speak_chance = 1 - turns_per_move = 5 - see_in_dark = 6 - ventcrawler = VENTCRAWLER_ALWAYS - pass_flags = PASSTABLE - mob_size = MOB_SIZE_SMALL - mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) - minbodytemp = 200 - maxbodytemp = 400 - unsuitable_atmos_damage = 1 - animal_species = /mob/living/simple_animal/pet/cat - childtype = list(/mob/living/simple_animal/pet/cat/kitten) - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 2, /obj/item/organ/ears/cat = 1, /obj/item/organ/tail/cat = 1) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "kicks" - var/turns_since_scan = 0 - var/mob/living/simple_animal/mouse/movement_target - gold_core_spawnable = FRIENDLY_SPAWN - collar_type = "cat" - size_multiplier = 0.5 - - var/held_icon = "cat2" - do_footstep = TRUE - -/mob/living/simple_animal/pet/cat/Initialize() - . = ..() - verbs += /mob/living/proc/lay_down - -/mob/living/simple_animal/pet/cat/ComponentInitialize() - . = ..() - AddElement(/datum/element/wuv, "purrs!", EMOTE_AUDIBLE, /datum/mood_event/pet_animal, "hisses!", EMOTE_AUDIBLE) - AddElement(/datum/element/mob_holder, held_icon) - -/mob/living/simple_animal/pet/cat/update_canmove() - ..() - if(client && stat != DEAD) - if (resting) - icon_state = "[icon_living]_rest" - collar_type = "[initial(collar_type)]_rest" - else - icon_state = "[icon_living]" - collar_type = "[initial(collar_type)]" - regenerate_icons() - - -/mob/living/simple_animal/pet/cat/space - name = "space cat" - desc = "It's a cat... in space!" - icon_state = "spacecat" - icon_living = "spacecat" - icon_dead = "spacecat_dead" - held_icon = "spacecat" - unsuitable_atmos_damage = 0 - minbodytemp = TCMB - maxbodytemp = T0C + 40 - -/mob/living/simple_animal/pet/cat/original - name = "Batsy" - desc = "The product of alien DNA and bored geneticists." - gender = FEMALE - icon_state = "original" - icon_living = "original" - icon_dead = "original_dead" - held_icon = "original" - collar_type = null - unique_pet = TRUE - -/mob/living/simple_animal/pet/cat/kitten - name = "kitten" - desc = "D'aaawwww." - icon_state = "kitten" - icon_living = "kitten" - icon_dead = "kitten_dead" - density = FALSE - pass_flags = PASSMOB - mob_size = MOB_SIZE_SMALL - collar_type = "kitten" - held_icon = "cat" - -//RUNTIME IS ALIVE! SQUEEEEEEEE~ -/mob/living/simple_animal/pet/cat/Runtime - name = "Runtime" - desc = "GCAT" - icon_state = "cat" - icon_living = "cat" - icon_dead = "cat_dead" - gender = FEMALE - gold_core_spawnable = NO_SPAWN - unique_pet = TRUE - var/list/family = list()//var restored from savefile, has count of each child type - var/list/children = list()//Actual mob instances of children - var/cats_deployed = 0 - //var/memory_saved = FALSE - -/mob/living/simple_animal/pet/cat/Runtime/Initialize() - if(prob(5)) - icon_state = "original" - icon_living = "original" - icon_dead = "original_dead" - //Read_Memory() - . = ..() -/* -/mob/living/simple_animal/pet/cat/Runtime/Life() - if(!cats_deployed && SSticker.current_state >= GAME_STATE_SETTING_UP) - Deploy_The_Cats() - if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved) - Write_Memory() - memory_saved = TRUE - ..() -*/ -/mob/living/simple_animal/pet/cat/Runtime/make_babies() - var/mob/baby = ..() - if(baby) - children += baby - return baby -/* -/mob/living/simple_animal/pet/cat/Runtime/death() - if(!memory_saved) - Write_Memory(TRUE) - ..() -*/ -/mob/living/simple_animal/pet/cat/Runtime/proc/Read_Memory() - if(fexists("data/npc_saves/Runtime.sav")) //legacy compatability to convert old format to new - var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") - S["family"] >> family - fdel("data/npc_saves/Runtime.sav") - else - var/json_file = file("data/npc_saves/Runtime.json") - if(!fexists(json_file)) - return - var/list/json = json_decode(file2text(json_file)) - family = json["family"] - if(isnull(family)) - family = list() -//All you people can't fucking control yourselves and keep letting runtime breed his own children, so it's time to at -LEAST- take the function that saves cats for the next round out the back and shoot it with a 12 gauge -/* -/mob/living/simple_animal/pet/cat/Runtime/proc/Write_Memory(dead) - var/json_file = file("data/npc_saves/Runtime.json") - var/list/file_data = list() - family = list() - if(!dead) - for(var/mob/living/simple_animal/pet/cat/kitten/C in children) - if(istype(C,type) || C.stat || !C.z || !C.butcher_results) //That last one is a work around for hologram cats - continue - if(C.type in family) - family[C.type] += 1 - else - family[C.type] = 1 - file_data["family"] = family - fdel(json_file) - WRITE_FILE(json_file, json_encode(file_data)) - -/mob/living/simple_animal/pet/cat/Runtime/proc/Deploy_The_Cats() - cats_deployed = 1 - for(var/cat_type in family) - if(family[cat_type] > 0) - for(var/i in 1 to min(family[cat_type],100)) //Limits to about 500 cats, you wouldn't think this would be needed (BUT IT IS) - new cat_type(loc) -*/ - -/mob/living/simple_animal/pet/cat/Proc - name = "Proc" - gender = MALE - gold_core_spawnable = NO_SPAWN - unique_pet = TRUE - -/mob/living/simple_animal/pet/cat/Life() - if(!stat && !buckled && !client) - if(prob(1)) - emote("me", 1, pick("stretches out for a belly rub.", "wags its tail.", "lies down.")) - icon_state = "[icon_living]_rest" - collar_type = "[initial(collar_type)]_rest" - resting = 1 - update_canmove() - else if (prob(1)) - emote("me", 1, pick("sits down.", "crouches on its hind legs.", "looks alert.")) - icon_state = "[icon_living]_sit" - collar_type = "[initial(collar_type)]_sit" - resting = 1 - update_canmove() - else if (prob(1)) - if (resting) - emote("me", 1, pick("gets up and meows.", "walks around.", "stops resting.")) - icon_state = "[icon_living]" - collar_type = "[initial(collar_type)]" - resting = 0 - update_canmove() - else - emote("me", 1, pick("grooms its fur.", "twitches its whiskers.", "shakes out its coat.")) - - //MICE! - if((src.loc) && isturf(src.loc)) - if(!stat && !resting && !buckled) - for(var/mob/living/simple_animal/mouse/M in view(1,src)) - if(!M.stat && Adjacent(M)) - emote("me", 1, "splats \the [M]!") - M.splat() - movement_target = null - stop_automated_movement = 0 - break - for(var/obj/item/toy/cattoy/T in view(1,src)) - if (T.cooldown < (world.time - 400)) - emote("me", 1, "bats \the [T] around with its paw!") - T.cooldown = world.time - - ..() - - make_babies() - - if(!stat && !resting && !buckled) - turns_since_scan++ - if(turns_since_scan > 5) - walk_to(src,0) - turns_since_scan = 0 - if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) )) - movement_target = null - stop_automated_movement = 0 - if( !movement_target || !(movement_target.loc in oview(src, 3)) ) - movement_target = null - stop_automated_movement = 0 - for(var/mob/living/simple_animal/mouse/snack in oview(src,3)) - if(isturf(snack.loc) && !snack.stat) - movement_target = snack - break - if(movement_target) - stop_automated_movement = 1 - walk_to(src,movement_target,0,3) - -/mob/living/simple_animal/pet/cat/cak //I told you I'd do it, Remie - name = "Keeki" - desc = "It's a cat made out of cake." - icon_state = "cak" - icon_living = "cak" - icon_dead = "cak_dead" - health = 50 - maxHealth = 50 - gender = FEMALE - harm_intent_damage = 10 - butcher_results = list(/obj/item/organ/brain = 1, /obj/item/organ/heart = 1, /obj/item/reagent_containers/food/snacks/cakeslice/birthday = 3, \ - /obj/item/reagent_containers/food/snacks/meat/slab = 2) - response_harm = "takes a bite out of" - attacked_sound = 'sound/items/eatfood.ogg' - deathmessage = "loses its false life and collapses!" - death_sound = "bodyfall" - held_icon = "cak" - -/mob/living/simple_animal/pet/cat/cak/CheckParts(list/parts) - ..() - var/obj/item/organ/brain/B = locate(/obj/item/organ/brain) in contents - if(!B || !B.brainmob || !B.brainmob.mind) - return - B.brainmob.mind.transfer_to(src) - to_chat(src, "You are a cak! You're a harmless cat/cake hybrid that everyone loves. People can take bites out of you if they're hungry, but you regenerate health \ - so quickly that it generally doesn't matter. You're remarkably resilient to any damage besides this and it's hard for you to really die at all. You should go around and bring happiness and \ - free cake to the station!") - var/new_name = stripped_input(src, "Enter your name, or press \"Cancel\" to stick with Keeki.", "Name Change") - if(new_name) - to_chat(src, "Your name is now \"new_name\"!") - name = new_name - -/mob/living/simple_animal/pet/cat/cak/Life() - ..() - if(stat) - return - if(health < maxHealth) - adjustBruteLoss(-8) //Fast life regen - for(var/obj/item/reagent_containers/food/snacks/donut/D in range(1, src)) //Frosts nearby donuts! - if(!D.is_decorated) - D.decorate_donut() - -/mob/living/simple_animal/pet/cat/cak/attack_hand(mob/living/L) - . = ..() - if(.) //the attack was blocked - return - if(L.a_intent == INTENT_HARM && L.reagents && !stat) - L.reagents.add_reagent("nutriment", 0.4) - L.reagents.add_reagent("vitamin", 0.4) - -//Cat made -/mob/living/simple_animal/pet/cat/custom_cat - name = "White cat" //Incase it somehow gets spawned without an ID - desc = "A cute white catto!" - icon_state = "custom_cat" - icon_living = "custom_cat" - icon_dead = "custom_cat_dead" - gender = FEMALE - gold_core_spawnable = NO_SPAWN - health = 50 //So people can't instakill it s - maxHealth = 50 - speak = list("Meowrowr!", "Mew!", "Miauen!") - speak_emote = list("wigglepurrs", "mewls") - emote_hear = list("meows.", "mews.") - emote_see = list("looks at you eagerly for pets!", "wiggles enthusiastically.") - gold_core_spawnable = NO_SPAWN - var/pseudo_death = FALSE - -/mob/living/simple_animal/pet/cat/custom_cat/death() - if (pseudo_death == TRUE) //secret cat chem - icon_state = "custom_cat_dead" - Stun(1000) - canmove = 0 - friendly = "deads at" - return - else - ..() +//Cat +/mob/living/simple_animal/pet/cat + name = "cat" + desc = "Kitty!!" + icon = 'icons/mob/pets.dmi' + icon_state = "cat2" + icon_living = "cat2" + icon_dead = "cat2_dead" + gender = MALE + speak = list("Meow!", "Esp!", "Purr!", "HSSSSS") + speak_emote = list("purrs", "meows") + emote_hear = list("meows.", "mews.") + emote_see = list("shakes its head.", "shivers.") + speak_chance = 1 + turns_per_move = 5 + see_in_dark = 6 + ventcrawler = VENTCRAWLER_ALWAYS + pass_flags = PASSTABLE + mob_size = MOB_SIZE_SMALL + mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) + minbodytemp = 200 + maxbodytemp = 400 + unsuitable_atmos_damage = 1 + animal_species = /mob/living/simple_animal/pet/cat + childtype = list(/mob/living/simple_animal/pet/cat/kitten) + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 2, /obj/item/organ/ears/cat = 1, /obj/item/organ/tail/cat = 1) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "kicks" + var/turns_since_scan = 0 + var/mob/living/simple_animal/mouse/movement_target + gold_core_spawnable = FRIENDLY_SPAWN + collar_type = "cat" + size_multiplier = 0.5 + + var/held_icon = "cat2" + do_footstep = TRUE + +/mob/living/simple_animal/pet/cat/Initialize() + . = ..() + verbs += /mob/living/proc/lay_down + +/mob/living/simple_animal/pet/cat/ComponentInitialize() + . = ..() + AddElement(/datum/element/wuv, "purrs!", EMOTE_AUDIBLE, /datum/mood_event/pet_animal, "hisses!", EMOTE_AUDIBLE) + AddElement(/datum/element/mob_holder, held_icon) + +/mob/living/simple_animal/pet/cat/update_canmove() + ..() + if(client && stat != DEAD) + if (resting) + icon_state = "[icon_living]_rest" + collar_type = "[initial(collar_type)]_rest" + else + icon_state = "[icon_living]" + collar_type = "[initial(collar_type)]" + regenerate_icons() + + +/mob/living/simple_animal/pet/cat/space + name = "space cat" + desc = "It's a cat... in space!" + icon_state = "spacecat" + icon_living = "spacecat" + icon_dead = "spacecat_dead" + held_icon = "spacecat" + unsuitable_atmos_damage = 0 + minbodytemp = TCMB + maxbodytemp = T0C + 40 + +/mob/living/simple_animal/pet/cat/original + name = "Batsy" + desc = "The product of alien DNA and bored geneticists." + gender = FEMALE + icon_state = "original" + icon_living = "original" + icon_dead = "original_dead" + held_icon = "original" + collar_type = null + unique_pet = TRUE + +/mob/living/simple_animal/pet/cat/kitten + name = "kitten" + desc = "D'aaawwww." + icon_state = "kitten" + icon_living = "kitten" + icon_dead = "kitten_dead" + density = FALSE + pass_flags = PASSMOB + mob_size = MOB_SIZE_SMALL + collar_type = "kitten" + held_icon = "cat" + +//RUNTIME IS ALIVE! SQUEEEEEEEE~ +/mob/living/simple_animal/pet/cat/Runtime + name = "Runtime" + desc = "GCAT" + icon_state = "cat" + icon_living = "cat" + icon_dead = "cat_dead" + gender = FEMALE + gold_core_spawnable = NO_SPAWN + unique_pet = TRUE + var/list/family = list()//var restored from savefile, has count of each child type + var/list/children = list()//Actual mob instances of children + var/cats_deployed = 0 + //var/memory_saved = FALSE + +/mob/living/simple_animal/pet/cat/Runtime/Initialize() + if(prob(5)) + icon_state = "original" + icon_living = "original" + icon_dead = "original_dead" + //Read_Memory() + . = ..() +/* +/mob/living/simple_animal/pet/cat/Runtime/Life() + if(!cats_deployed && SSticker.current_state >= GAME_STATE_SETTING_UP) + Deploy_The_Cats() + if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved) + Write_Memory() + memory_saved = TRUE + ..() +*/ +/mob/living/simple_animal/pet/cat/Runtime/make_babies() + var/mob/baby = ..() + if(baby) + children += baby + return baby +/* +/mob/living/simple_animal/pet/cat/Runtime/death() + if(!memory_saved) + Write_Memory(TRUE) + ..() +*/ +/mob/living/simple_animal/pet/cat/Runtime/proc/Read_Memory() + if(fexists("data/npc_saves/Runtime.sav")) //legacy compatability to convert old format to new + var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") + S["family"] >> family + fdel("data/npc_saves/Runtime.sav") + else + var/json_file = file("data/npc_saves/Runtime.json") + if(!fexists(json_file)) + return + var/list/json = json_decode(file2text(json_file)) + family = json["family"] + if(isnull(family)) + family = list() +//All you people can't fucking control yourselves and keep letting runtime breed his own children, so it's time to at -LEAST- take the function that saves cats for the next round out the back and shoot it with a 12 gauge +/* +/mob/living/simple_animal/pet/cat/Runtime/proc/Write_Memory(dead) + var/json_file = file("data/npc_saves/Runtime.json") + var/list/file_data = list() + family = list() + if(!dead) + for(var/mob/living/simple_animal/pet/cat/kitten/C in children) + if(istype(C,type) || C.stat || !C.z || !C.butcher_results) //That last one is a work around for hologram cats + continue + if(C.type in family) + family[C.type] += 1 + else + family[C.type] = 1 + file_data["family"] = family + fdel(json_file) + WRITE_FILE(json_file, json_encode(file_data)) + +/mob/living/simple_animal/pet/cat/Runtime/proc/Deploy_The_Cats() + cats_deployed = 1 + for(var/cat_type in family) + if(family[cat_type] > 0) + for(var/i in 1 to min(family[cat_type],100)) //Limits to about 500 cats, you wouldn't think this would be needed (BUT IT IS) + new cat_type(loc) +*/ + +/mob/living/simple_animal/pet/cat/Proc + name = "Proc" + gender = MALE + gold_core_spawnable = NO_SPAWN + unique_pet = TRUE + +/mob/living/simple_animal/pet/cat/Life() + if(!stat && !buckled && !client) + if(prob(1)) + emote("me", 1, pick("stretches out for a belly rub.", "wags its tail.", "lies down.")) + icon_state = "[icon_living]_rest" + collar_type = "[initial(collar_type)]_rest" + resting = 1 + update_canmove() + else if (prob(1)) + emote("me", 1, pick("sits down.", "crouches on its hind legs.", "looks alert.")) + icon_state = "[icon_living]_sit" + collar_type = "[initial(collar_type)]_sit" + resting = 1 + update_canmove() + else if (prob(1)) + if (resting) + emote("me", 1, pick("gets up and meows.", "walks around.", "stops resting.")) + icon_state = "[icon_living]" + collar_type = "[initial(collar_type)]" + resting = 0 + update_canmove() + else + emote("me", 1, pick("grooms its fur.", "twitches its whiskers.", "shakes out its coat.")) + + //MICE! + if((src.loc) && isturf(src.loc)) + if(!stat && !resting && !buckled) + for(var/mob/living/simple_animal/mouse/M in view(1,src)) + if(!M.stat && Adjacent(M)) + emote("me", 1, "splats \the [M]!") + M.splat() + movement_target = null + stop_automated_movement = 0 + break + for(var/obj/item/toy/cattoy/T in view(1,src)) + if (T.cooldown < (world.time - 400)) + emote("me", 1, "bats \the [T] around with its paw!") + T.cooldown = world.time + + ..() + + make_babies() + + if(!stat && !resting && !buckled) + turns_since_scan++ + if(turns_since_scan > 5) + walk_to(src,0) + turns_since_scan = 0 + if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) )) + movement_target = null + stop_automated_movement = 0 + if( !movement_target || !(movement_target.loc in oview(src, 3)) ) + movement_target = null + stop_automated_movement = 0 + for(var/mob/living/simple_animal/mouse/snack in oview(src,3)) + if(isturf(snack.loc) && !snack.stat) + movement_target = snack + break + if(movement_target) + stop_automated_movement = 1 + walk_to(src,movement_target,0,3) + +/mob/living/simple_animal/pet/cat/cak //I told you I'd do it, Remie + name = "Keeki" + desc = "It's a cat made out of cake." + icon_state = "cak" + icon_living = "cak" + icon_dead = "cak_dead" + health = 50 + maxHealth = 50 + gender = FEMALE + harm_intent_damage = 10 + butcher_results = list(/obj/item/organ/brain = 1, /obj/item/organ/heart = 1, /obj/item/reagent_containers/food/snacks/cakeslice/birthday = 3, \ + /obj/item/reagent_containers/food/snacks/meat/slab = 2) + response_harm = "takes a bite out of" + attacked_sound = 'sound/items/eatfood.ogg' + deathmessage = "loses its false life and collapses!" + death_sound = "bodyfall" + held_icon = "cak" + +/mob/living/simple_animal/pet/cat/cak/CheckParts(list/parts) + ..() + var/obj/item/organ/brain/B = locate(/obj/item/organ/brain) in contents + if(!B || !B.brainmob || !B.brainmob.mind) + return + B.brainmob.mind.transfer_to(src) + to_chat(src, "You are a cak! You're a harmless cat/cake hybrid that everyone loves. People can take bites out of you if they're hungry, but you regenerate health \ + so quickly that it generally doesn't matter. You're remarkably resilient to any damage besides this and it's hard for you to really die at all. You should go around and bring happiness and \ + free cake to the station!") + var/new_name = stripped_input(src, "Enter your name, or press \"Cancel\" to stick with Keeki.", "Name Change") + if(new_name) + to_chat(src, "Your name is now \"new_name\"!") + name = new_name + +/mob/living/simple_animal/pet/cat/cak/Life() + ..() + if(stat) + return + if(health < maxHealth) + adjustBruteLoss(-8) //Fast life regen + for(var/obj/item/reagent_containers/food/snacks/donut/D in range(1, src)) //Frosts nearby donuts! + if(!D.is_decorated) + D.decorate_donut() + +/mob/living/simple_animal/pet/cat/cak/attack_hand(mob/living/L) + . = ..() + if(.) //the attack was blocked + return + if(L.a_intent == INTENT_HARM && L.reagents && !stat) + L.reagents.add_reagent(/datum/reagent/consumable/nutriment, 0.4) + L.reagents.add_reagent(/datum/reagent/consumable/nutriment/vitamin, 0.4) + +//Cat made +/mob/living/simple_animal/pet/cat/custom_cat + name = "White cat" //Incase it somehow gets spawned without an ID + desc = "A cute white catto!" + icon_state = "custom_cat" + icon_living = "custom_cat" + icon_dead = "custom_cat_dead" + gender = FEMALE + gold_core_spawnable = NO_SPAWN + health = 50 //So people can't instakill it s + maxHealth = 50 + speak = list("Meowrowr!", "Mew!", "Miauen!") + speak_emote = list("wigglepurrs", "mewls") + emote_hear = list("meows.", "mews.") + emote_see = list("looks at you eagerly for pets!", "wiggles enthusiastically.") + gold_core_spawnable = NO_SPAWN + var/pseudo_death = FALSE + +/mob/living/simple_animal/pet/cat/custom_cat/death() + if (pseudo_death == TRUE) //secret cat chem + icon_state = "custom_cat_dead" + Stun(1000) + canmove = 0 + friendly = "deads at" + return + else + ..() diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 22a666ee..4438da05 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -1,348 +1,348 @@ -//goat -/mob/living/simple_animal/hostile/retaliate/goat - name = "goat" - desc = "Not known for their pleasant disposition." - icon_state = "goat" - icon_living = "goat" - icon_dead = "goat_dead" - speak = list("EHEHEHEHEH","eh?") - speak_emote = list("brays") - emote_hear = list("brays.") - emote_see = list("shakes its head.", "stamps a foot.", "glares around.") - speak_chance = 1 - turns_per_move = 5 - see_in_dark = 6 - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 4) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "kicks" - faction = list("neutral") - mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) - attack_same = 1 - attacktext = "kicks" - attack_sound = 'sound/weapons/punch1.ogg' - health = 40 - maxHealth = 40 - melee_damage_lower = 1 - melee_damage_upper = 2 - environment_smash = ENVIRONMENT_SMASH_NONE - stop_automated_movement_when_pulled = 1 - blood_volume = BLOOD_VOLUME_NORMAL - var/obj/item/udder/udder = null - - do_footstep = TRUE - -/mob/living/simple_animal/hostile/retaliate/goat/Initialize() - udder = new() - . = ..() - -/mob/living/simple_animal/hostile/retaliate/goat/Destroy() - qdel(udder) - udder = null - return ..() - -/mob/living/simple_animal/hostile/retaliate/goat/Life() - . = ..() - if(.) - //chance to go crazy and start wacking stuff - if(!enemies.len && prob(1)) - Retaliate() - - if(enemies.len && prob(10)) - enemies = list() - LoseTarget() - src.visible_message("[src] calms down.") - if(stat == CONSCIOUS) - udder.generateMilk() - eat_plants() - if(!pulledby) - for(var/direction in shuffle(list(1,2,4,8,5,6,9,10))) - var/step = get_step(src, direction) - if(step) - if(locate(/obj/structure/spacevine) in step || locate(/obj/structure/glowshroom) in step) - Move(step, get_dir(src, step)) - -/mob/living/simple_animal/hostile/retaliate/goat/Retaliate() - ..() - src.visible_message("[src] gets an evil-looking gleam in [p_their()] eye.") - -/mob/living/simple_animal/hostile/retaliate/goat/Move() - . = ..() - if(!stat) - eat_plants() - -/mob/living/simple_animal/hostile/retaliate/goat/proc/eat_plants() - var/eaten = FALSE - var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc - if(SV) - SV.eat(src) - eaten = TRUE - - var/obj/structure/glowshroom/GS = locate(/obj/structure/glowshroom) in loc - if(GS) - qdel(GS) - eaten = TRUE - - if(eaten && prob(10)) - say("Nom") - -/mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O, mob/user, params) - if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass)) - udder.milkAnimal(O, user) - return 1 - else - return ..() - - -/mob/living/simple_animal/hostile/retaliate/goat/AttackingTarget() - . = ..() - if(. && ishuman(target)) - var/mob/living/carbon/human/H = target - if(istype(H.dna.species, /datum/species/pod)) - var/obj/item/bodypart/NB = pick(H.bodyparts) - H.visible_message("[src] takes a big chomp out of [H]!", \ - "[src] takes a big chomp out of your [NB]!") - NB.dismember() -//cow -/mob/living/simple_animal/cow - name = "cow" - desc = "Known for their milk, just don't tip them over." - icon_state = "cow" - icon_living = "cow" - icon_dead = "cow_dead" - icon_gib = "cow_gib" - gender = FEMALE - mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) - speak = list("moo?","moo","MOOOOOO") - speak_emote = list("moos","moos hauntingly") - emote_hear = list("brays.") - emote_see = list("shakes its head.") - speak_chance = 1 - turns_per_move = 5 - see_in_dark = 6 - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 6) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "kicks" - attacktext = "kicks" - attack_sound = 'sound/weapons/punch1.ogg' - health = 50 - maxHealth = 50 - var/obj/item/udder/udder = null - gold_core_spawnable = FRIENDLY_SPAWN - blood_volume = BLOOD_VOLUME_NORMAL - - do_footstep = TRUE - -/mob/living/simple_animal/cow/Initialize() - udder = new() - . = ..() - -/mob/living/simple_animal/cow/Destroy() - qdel(udder) - udder = null - return ..() - -/mob/living/simple_animal/cow/attackby(obj/item/O, mob/user, params) - if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass)) - udder.milkAnimal(O, user) - return 1 - else - return ..() - -/mob/living/simple_animal/cow/Life() - . = ..() - if(stat == CONSCIOUS) - udder.generateMilk() - -/mob/living/simple_animal/cow/attack_hand(mob/living/carbon/M) - if(!stat && M.a_intent == INTENT_DISARM && icon_state != icon_dead) - M.visible_message("[M] tips over [src].", - "You tip over [src].") - to_chat(src, "You are tipped over by [M]!") - Knockdown(60,ignore_canknockdown = TRUE) - icon_state = icon_dead - spawn(rand(20,50)) - if(!stat && M) - icon_state = icon_living - var/external - var/internal - switch(pick(1,2,3,4)) - if(1,2,3) - var/text = pick("imploringly.", "pleadingly.", - "with a resigned expression.") - external = "[src] looks at [M] [text]" - internal = "You look at [M] [text]" - if(4) - external = "[src] seems resigned to its fate." - internal = "You resign yourself to your fate." - visible_message("[external]", - "[internal]") - else - ..() - -/mob/living/simple_animal/chick - name = "\improper chick" - desc = "Adorable! They make such a racket though." - icon_state = "chick" - icon_living = "chick" - icon_dead = "chick_dead" - icon_gib = "chick_gib" - gender = FEMALE - mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) - speak = list("Cherp.","Cherp?","Chirrup.","Cheep!") - speak_emote = list("cheeps") - emote_hear = list("cheeps.") - emote_see = list("pecks at the ground.","flaps its tiny wings.") - density = FALSE - speak_chance = 2 - turns_per_move = 2 - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/chicken = 1) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "kicks" - attacktext = "kicks" - health = 3 - maxHealth = 3 - ventcrawler = VENTCRAWLER_ALWAYS - var/amount_grown = 0 - pass_flags = PASSTABLE | PASSGRILLE | PASSMOB - mob_size = MOB_SIZE_TINY - gold_core_spawnable = FRIENDLY_SPAWN - - do_footstep = TRUE - -/mob/living/simple_animal/chick/Initialize() - . = ..() - pixel_x = rand(-6, 6) - pixel_y = rand(0, 10) - -/mob/living/simple_animal/chick/Life() - . =..() - if(!.) - return - if(!stat && !ckey) - amount_grown += rand(1,2) - if(amount_grown >= 100) - new /mob/living/simple_animal/chicken(src.loc) - qdel(src) - -/mob/living/simple_animal/chick/holo/Life() - ..() - amount_grown = 0 - -/mob/living/simple_animal/chicken - name = "\improper chicken" - desc = "Hopefully the eggs are good this season." - gender = FEMALE - mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) - icon_state = "chicken_brown" - icon_living = "chicken_brown" - icon_dead = "chicken_brown_dead" - speak = list("Cluck!","BWAAAAARK BWAK BWAK BWAK!","Bwaak bwak.") - speak_emote = list("clucks","croons") - emote_hear = list("clucks.") - emote_see = list("pecks at the ground.","flaps its wings viciously.") - density = FALSE - speak_chance = 2 - turns_per_move = 3 - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/chicken = 2) - var/egg_type = /obj/item/reagent_containers/food/snacks/egg - var/food_type = /obj/item/reagent_containers/food/snacks/grown/wheat - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "kicks" - attacktext = "kicks" - health = 15 - maxHealth = 15 - ventcrawler = VENTCRAWLER_ALWAYS - var/eggsleft = 0 - var/eggsFertile = TRUE - var/body_color - var/icon_prefix = "chicken" - pass_flags = PASSTABLE | PASSMOB - mob_size = MOB_SIZE_SMALL - var/list/feedMessages = list("It clucks happily.","It clucks happily.") - var/list/layMessage = EGG_LAYING_MESSAGES - var/list/validColors = list("brown","black","white") - gold_core_spawnable = FRIENDLY_SPAWN - var/static/chicken_count = 0 - - do_footstep = TRUE - -/mob/living/simple_animal/chicken/Initialize() - . = ..() - if(!body_color) - body_color = pick(validColors) - icon_state = "[icon_prefix]_[body_color]" - icon_living = "[icon_prefix]_[body_color]" - icon_dead = "[icon_prefix]_[body_color]_dead" - pixel_x = rand(-6, 6) - pixel_y = rand(0, 10) - ++chicken_count - -/mob/living/simple_animal/chicken/Destroy() - --chicken_count - return ..() - -/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params) - if(istype(O, food_type)) //feedin' dem chickens - if(!stat && eggsleft < 8) - var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]" - user.visible_message(feedmsg) - qdel(O) - eggsleft += rand(1, 4) - else - to_chat(user, "[name] doesn't seem hungry!") - else - ..() - -/mob/living/simple_animal/chicken/Life() - . =..() - if(!.) - return - if((!stat && prob(3) && eggsleft > 0) && egg_type) - visible_message("[src] [pick(layMessage)]") - eggsleft-- - var/obj/item/E = new egg_type(get_turf(src)) - E.pixel_x = rand(-6,6) - E.pixel_y = rand(-6,6) - if(eggsFertile) - if(chicken_count < MAX_CHICKENS && prob(25)) - START_PROCESSING(SSobj, E) - -/obj/item/reagent_containers/food/snacks/egg/var/amount_grown = 0 -/obj/item/reagent_containers/food/snacks/egg/process() - if(isturf(loc)) - amount_grown += rand(1,2) - if(amount_grown >= 100) - visible_message("[src] hatches with a quiet cracking sound.") - new /mob/living/simple_animal/chick(get_turf(src)) - STOP_PROCESSING(SSobj, src) - qdel(src) - else - STOP_PROCESSING(SSobj, src) - - -/obj/item/udder - name = "udder" - -/obj/item/udder/Initialize() - create_reagents(50) - reagents.add_reagent("milk", 20) - . = ..() - -/obj/item/udder/proc/generateMilk() - if(prob(5)) - reagents.add_reagent("milk", rand(5, 10)) - -/obj/item/udder/proc/milkAnimal(obj/O, mob/user) - var/obj/item/reagent_containers/glass/G = O - if(G.reagents.total_volume >= G.volume) - to_chat(user, "[O] is full.") - return - var/transfered = reagents.trans_to(O, rand(5,10)) - if(transfered) - user.visible_message("[user] milks [src] using \the [O].", "You milk [src] using \the [O].") - else - to_chat(user, "The udder is dry. Wait a bit longer...") +//goat +/mob/living/simple_animal/hostile/retaliate/goat + name = "goat" + desc = "Not known for their pleasant disposition." + icon_state = "goat" + icon_living = "goat" + icon_dead = "goat_dead" + speak = list("EHEHEHEHEH","eh?") + speak_emote = list("brays") + emote_hear = list("brays.") + emote_see = list("shakes its head.", "stamps a foot.", "glares around.") + speak_chance = 1 + turns_per_move = 5 + see_in_dark = 6 + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 4) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "kicks" + faction = list("neutral") + mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) + attack_same = 1 + attacktext = "kicks" + attack_sound = 'sound/weapons/punch1.ogg' + health = 40 + maxHealth = 40 + melee_damage_lower = 1 + melee_damage_upper = 2 + environment_smash = ENVIRONMENT_SMASH_NONE + stop_automated_movement_when_pulled = 1 + blood_volume = BLOOD_VOLUME_NORMAL + var/obj/item/udder/udder = null + + do_footstep = TRUE + +/mob/living/simple_animal/hostile/retaliate/goat/Initialize() + udder = new() + . = ..() + +/mob/living/simple_animal/hostile/retaliate/goat/Destroy() + qdel(udder) + udder = null + return ..() + +/mob/living/simple_animal/hostile/retaliate/goat/Life() + . = ..() + if(.) + //chance to go crazy and start wacking stuff + if(!enemies.len && prob(1)) + Retaliate() + + if(enemies.len && prob(10)) + enemies = list() + LoseTarget() + src.visible_message("[src] calms down.") + if(stat == CONSCIOUS) + udder.generateMilk() + eat_plants() + if(!pulledby) + for(var/direction in shuffle(list(1,2,4,8,5,6,9,10))) + var/step = get_step(src, direction) + if(step) + if(locate(/obj/structure/spacevine) in step || locate(/obj/structure/glowshroom) in step) + Move(step, get_dir(src, step)) + +/mob/living/simple_animal/hostile/retaliate/goat/Retaliate() + ..() + src.visible_message("[src] gets an evil-looking gleam in [p_their()] eye.") + +/mob/living/simple_animal/hostile/retaliate/goat/Move() + . = ..() + if(!stat) + eat_plants() + +/mob/living/simple_animal/hostile/retaliate/goat/proc/eat_plants() + var/eaten = FALSE + var/obj/structure/spacevine/SV = locate(/obj/structure/spacevine) in loc + if(SV) + SV.eat(src) + eaten = TRUE + + var/obj/structure/glowshroom/GS = locate(/obj/structure/glowshroom) in loc + if(GS) + qdel(GS) + eaten = TRUE + + if(eaten && prob(10)) + say("Nom") + +/mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O, mob/user, params) + if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass)) + udder.milkAnimal(O, user) + return 1 + else + return ..() + + +/mob/living/simple_animal/hostile/retaliate/goat/AttackingTarget() + . = ..() + if(. && ishuman(target)) + var/mob/living/carbon/human/H = target + if(istype(H.dna.species, /datum/species/pod)) + var/obj/item/bodypart/NB = pick(H.bodyparts) + H.visible_message("[src] takes a big chomp out of [H]!", \ + "[src] takes a big chomp out of your [NB]!") + NB.dismember() +//cow +/mob/living/simple_animal/cow + name = "cow" + desc = "Known for their milk, just don't tip them over." + icon_state = "cow" + icon_living = "cow" + icon_dead = "cow_dead" + icon_gib = "cow_gib" + gender = FEMALE + mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) + speak = list("moo?","moo","MOOOOOO") + speak_emote = list("moos","moos hauntingly") + emote_hear = list("brays.") + emote_see = list("shakes its head.") + speak_chance = 1 + turns_per_move = 5 + see_in_dark = 6 + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 6) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "kicks" + attacktext = "kicks" + attack_sound = 'sound/weapons/punch1.ogg' + health = 50 + maxHealth = 50 + var/obj/item/udder/udder = null + gold_core_spawnable = FRIENDLY_SPAWN + blood_volume = BLOOD_VOLUME_NORMAL + + do_footstep = TRUE + +/mob/living/simple_animal/cow/Initialize() + udder = new() + . = ..() + +/mob/living/simple_animal/cow/Destroy() + qdel(udder) + udder = null + return ..() + +/mob/living/simple_animal/cow/attackby(obj/item/O, mob/user, params) + if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass)) + udder.milkAnimal(O, user) + return 1 + else + return ..() + +/mob/living/simple_animal/cow/Life() + . = ..() + if(stat == CONSCIOUS) + udder.generateMilk() + +/mob/living/simple_animal/cow/attack_hand(mob/living/carbon/M) + if(!stat && M.a_intent == INTENT_DISARM && icon_state != icon_dead) + M.visible_message("[M] tips over [src].", + "You tip over [src].") + to_chat(src, "You are tipped over by [M]!") + Knockdown(60,ignore_canknockdown = TRUE) + icon_state = icon_dead + spawn(rand(20,50)) + if(!stat && M) + icon_state = icon_living + var/external + var/internal + switch(pick(1,2,3,4)) + if(1,2,3) + var/text = pick("imploringly.", "pleadingly.", + "with a resigned expression.") + external = "[src] looks at [M] [text]" + internal = "You look at [M] [text]" + if(4) + external = "[src] seems resigned to its fate." + internal = "You resign yourself to your fate." + visible_message("[external]", + "[internal]") + else + ..() + +/mob/living/simple_animal/chick + name = "\improper chick" + desc = "Adorable! They make such a racket though." + icon_state = "chick" + icon_living = "chick" + icon_dead = "chick_dead" + icon_gib = "chick_gib" + gender = FEMALE + mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) + speak = list("Cherp.","Cherp?","Chirrup.","Cheep!") + speak_emote = list("cheeps") + emote_hear = list("cheeps.") + emote_see = list("pecks at the ground.","flaps its tiny wings.") + density = FALSE + speak_chance = 2 + turns_per_move = 2 + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/chicken = 1) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "kicks" + attacktext = "kicks" + health = 3 + maxHealth = 3 + ventcrawler = VENTCRAWLER_ALWAYS + var/amount_grown = 0 + pass_flags = PASSTABLE | PASSGRILLE | PASSMOB + mob_size = MOB_SIZE_TINY + gold_core_spawnable = FRIENDLY_SPAWN + + do_footstep = TRUE + +/mob/living/simple_animal/chick/Initialize() + . = ..() + pixel_x = rand(-6, 6) + pixel_y = rand(0, 10) + +/mob/living/simple_animal/chick/Life() + . =..() + if(!.) + return + if(!stat && !ckey) + amount_grown += rand(1,2) + if(amount_grown >= 100) + new /mob/living/simple_animal/chicken(src.loc) + qdel(src) + +/mob/living/simple_animal/chick/holo/Life() + ..() + amount_grown = 0 + +/mob/living/simple_animal/chicken + name = "\improper chicken" + desc = "Hopefully the eggs are good this season." + gender = FEMALE + mob_biotypes = list(MOB_ORGANIC, MOB_BEAST) + icon_state = "chicken_brown" + icon_living = "chicken_brown" + icon_dead = "chicken_brown_dead" + speak = list("Cluck!","BWAAAAARK BWAK BWAK BWAK!","Bwaak bwak.") + speak_emote = list("clucks","croons") + emote_hear = list("clucks.") + emote_see = list("pecks at the ground.","flaps its wings viciously.") + density = FALSE + speak_chance = 2 + turns_per_move = 3 + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/chicken = 2) + var/egg_type = /obj/item/reagent_containers/food/snacks/egg + var/food_type = /obj/item/reagent_containers/food/snacks/grown/wheat + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "kicks" + attacktext = "kicks" + health = 15 + maxHealth = 15 + ventcrawler = VENTCRAWLER_ALWAYS + var/eggsleft = 0 + var/eggsFertile = TRUE + var/body_color + var/icon_prefix = "chicken" + pass_flags = PASSTABLE | PASSMOB + mob_size = MOB_SIZE_SMALL + var/list/feedMessages = list("It clucks happily.","It clucks happily.") + var/list/layMessage = EGG_LAYING_MESSAGES + var/list/validColors = list("brown","black","white") + gold_core_spawnable = FRIENDLY_SPAWN + var/static/chicken_count = 0 + + do_footstep = TRUE + +/mob/living/simple_animal/chicken/Initialize() + . = ..() + if(!body_color) + body_color = pick(validColors) + icon_state = "[icon_prefix]_[body_color]" + icon_living = "[icon_prefix]_[body_color]" + icon_dead = "[icon_prefix]_[body_color]_dead" + pixel_x = rand(-6, 6) + pixel_y = rand(0, 10) + ++chicken_count + +/mob/living/simple_animal/chicken/Destroy() + --chicken_count + return ..() + +/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params) + if(istype(O, food_type)) //feedin' dem chickens + if(!stat && eggsleft < 8) + var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]" + user.visible_message(feedmsg) + qdel(O) + eggsleft += rand(1, 4) + else + to_chat(user, "[name] doesn't seem hungry!") + else + ..() + +/mob/living/simple_animal/chicken/Life() + . =..() + if(!.) + return + if((!stat && prob(3) && eggsleft > 0) && egg_type) + visible_message("[src] [pick(layMessage)]") + eggsleft-- + var/obj/item/E = new egg_type(get_turf(src)) + E.pixel_x = rand(-6,6) + E.pixel_y = rand(-6,6) + if(eggsFertile) + if(chicken_count < MAX_CHICKENS && prob(25)) + START_PROCESSING(SSobj, E) + +/obj/item/reagent_containers/food/snacks/egg/var/amount_grown = 0 +/obj/item/reagent_containers/food/snacks/egg/process() + if(isturf(loc)) + amount_grown += rand(1,2) + if(amount_grown >= 100) + visible_message("[src] hatches with a quiet cracking sound.") + new /mob/living/simple_animal/chick(get_turf(src)) + STOP_PROCESSING(SSobj, src) + qdel(src) + else + STOP_PROCESSING(SSobj, src) + + +/obj/item/udder + name = "udder" + +/obj/item/udder/Initialize() + create_reagents(50) + reagents.add_reagent(/datum/reagent/consumable/milk, 20) + . = ..() + +/obj/item/udder/proc/generateMilk() + if(prob(5)) + reagents.add_reagent(/datum/reagent/consumable/milk, rand(5, 10)) + +/obj/item/udder/proc/milkAnimal(obj/O, mob/user) + var/obj/item/reagent_containers/glass/G = O + if(G.reagents.total_volume >= G.volume) + to_chat(user, "[O] is full.") + return + var/transfered = reagents.trans_to(O, rand(5,10)) + if(transfered) + user.visible_message("[user] milks [src] using \the [O].", "You milk [src] using \the [O].") + else + to_chat(user, "The udder is dry. Wait a bit longer...") diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index e1c80050..b45ead9d 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -114,9 +114,9 @@ icon_state = "mouse_gray_dead" bitesize = 3 eatverb = "devour" - list_reagents = list("nutriment" = 3, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GROSS | MEAT | RAW - grind_results = list("blood" = 20, "liquidgibs" = 5) + grind_results = list(/datum/reagent/blood = 20, /datum/reagent/liquidgibs = 5) /obj/item/reagent_containers/food/snacks/deadmouse/on_grind() reagents.clear_reagents() diff --git a/code/modules/mob/living/simple_animal/friendly/snake.dm b/code/modules/mob/living/simple_animal/friendly/snake.dm index d8912ee2..05e38a9f 100644 --- a/code/modules/mob/living/simple_animal/friendly/snake.dm +++ b/code/modules/mob/living/simple_animal/friendly/snake.dm @@ -1,6 +1,6 @@ /mob/living/simple_animal/hostile/retaliate/poison - var/poison_per_bite = 0 - var/poison_type = "toxin" + var/poison_per_bite = 0 + var/poison_type = /datum/reagent/toxin /mob/living/simple_animal/hostile/retaliate/poison/AttackingTarget() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index 89c4f70f..bb1f1284 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -140,7 +140,7 @@ var/mob/living/L = target if(L.reagents) beegent.reaction_mob(L, INJECT) - L.reagents.add_reagent(beegent.id, rand(1,5)) + L.reagents.add_reagent(beegent.type, rand(1,5)) /mob/living/simple_animal/hostile/poison/bees/proc/assign_reagent(datum/reagent/R) @@ -205,7 +205,7 @@ /mob/living/simple_animal/hostile/poison/bees/toxin/Initialize() . = ..() var/datum/reagent/R = pick(typesof(/datum/reagent/toxin)) - assign_reagent(GLOB.chemical_reagents_list[initial(R.id)]) + assign_reagent(GLOB.chemical_reagents_list[R]) /mob/living/simple_animal/hostile/poison/bees/queen name = "queen bee" @@ -225,7 +225,7 @@ if(. && beegent && isliving(target)) var/mob/living/L = target beegent.reaction_mob(L, TOUCH) - L.reagents.add_reagent(beegent.id, rand(1,5)) + L.reagents.add_reagent(beegent.type, rand(1,5)) //PEASENT BEES @@ -236,7 +236,7 @@ /mob/living/simple_animal/hostile/poison/bees/proc/reagent_incompatible(mob/living/simple_animal/hostile/poison/bees/B) if(!B) return FALSE - if(B.beegent && beegent && B.beegent.id != beegent.id || B.beegent && !beegent || !B.beegent && beegent) + if(B.beegent && beegent && B.beegent.type != beegent.type || B.beegent && !beegent || !B.beegent && beegent) return TRUE return FALSE @@ -253,9 +253,10 @@ /obj/item/queen_bee/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/reagent_containers/syringe)) var/obj/item/reagent_containers/syringe/S = I - if(S.reagents.has_reagent("royal_bee_jelly")) //checked twice, because I really don't want royal bee jelly to be duped - if(S.reagents.has_reagent("royal_bee_jelly",5)) - S.reagents.remove_reagent("royal_bee_jelly", 5) + var/jelly_amount = S.reagents.get_reagent_amount(/datum/reagent/royal_bee_jelly) + if(jelly_amount) + if(jelly_amount >= 5) + S.reagents.remove_reagent(/datum/reagent/royal_bee_jelly, 5) var/obj/item/queen_bee/qb = new(user.drop_location()) qb.queen = new(qb) if(queen && queen.beegent) @@ -266,8 +267,8 @@ to_chat(user, "You don't have enough royal bee jelly to split a bee in two!") else var/datum/reagent/R = GLOB.chemical_reagents_list[S.reagents.get_master_reagent_id()] - if(R && S.reagents.has_reagent(R.id, 5)) - S.reagents.remove_reagent(R.id,5) + if(R && S.reagents.has_reagent(R.type, 5)) + S.reagents.remove_reagent(R.type,5) queen.assign_reagent(R) user.visible_message("[user] injects [src]'s genome with [R.name], mutating it's DNA!","You inject [src]'s genome with [R.name], mutating it's DNA!") name = queen.name diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 3ff6ffe7..cbce16fa 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -1,537 +1,537 @@ -#define SPIDER_IDLE 0 -#define SPINNING_WEB 1 -#define LAYING_EGGS 2 -#define MOVING_TO_TARGET 3 -#define SPINNING_COCOON 4 - -/mob/living/simple_animal/hostile/poison - var/poison_per_bite = 5 - var/poison_type = "toxin" - -/mob/living/simple_animal/hostile/poison/AttackingTarget() - . = ..() - if(. && isliving(target)) - var/mob/living/L = target - if(L.reagents) - L.reagents.add_reagent(poison_type, poison_per_bite) - -//basic spider mob, these generally guard nests -/mob/living/simple_animal/hostile/poison/giant_spider - name = "giant spider" - desc = "Furry and black, it makes you shudder to look at it. This one has deep red eyes." - icon_state = "guard" - icon_living = "guard" - icon_dead = "guard_dead" - mob_biotypes = list(MOB_ORGANIC, MOB_BUG) - speak_emote = list("chitters") - emote_hear = list("chitters") - speak_chance = 5 - turns_per_move = 5 - see_in_dark = 10 - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/spider = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "hits" - maxHealth = 200 - health = 200 - obj_damage = 60 - melee_damage_lower = 15 - melee_damage_upper = 20 - faction = list("spiders") - var/busy = SPIDER_IDLE - pass_flags = PASSTABLE - move_to_delay = 6 - ventcrawler = VENTCRAWLER_ALWAYS - attacktext = "bites" - attack_sound = 'sound/weapons/bite.ogg' - unique_name = 1 - gold_core_spawnable = HOSTILE_SPAWN - see_in_dark = 4 - lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE - var/playable_spider = FALSE - var/datum/action/innate/spider/lay_web/lay_web - var/directive = "" //Message passed down to children, to relay the creator's orders - - do_footstep = TRUE - -/mob/living/simple_animal/hostile/poison/giant_spider/Initialize() - . = ..() - lay_web = new - lay_web.Grant(src) - -/mob/living/simple_animal/hostile/poison/giant_spider/Destroy() - QDEL_NULL(lay_web) - return ..() - -/mob/living/simple_animal/hostile/poison/giant_spider/Topic(href, href_list) - if(href_list["activate"]) - var/mob/dead/observer/ghost = usr - if(istype(ghost) && playable_spider) - humanize_spider(ghost) - -/mob/living/simple_animal/hostile/poison/giant_spider/Login() - ..() - if(directive) - to_chat(src, "Your mother left you a directive! Follow it at all costs.") - to_chat(src, "[directive]") - -/mob/living/simple_animal/hostile/poison/giant_spider/attack_ghost(mob/user) - . = ..() - if(.) - return - humanize_spider(user) - -/mob/living/simple_animal/hostile/poison/giant_spider/proc/humanize_spider(mob/user) - if(key || !playable_spider || stat)//Someone is in it, it's dead, or the fun police are shutting it down - return 0 - var/spider_ask = alert("Become a spider?", "Are you australian?", "Yes", "No") - if(spider_ask == "No" || !src || QDELETED(src)) - return 1 - if(key) - to_chat(user, "Someone else already took this spider.") - return 1 - key = user.key - return 1 - -//nursemaids - these create webs and eggs -/mob/living/simple_animal/hostile/poison/giant_spider/nurse - desc = "Furry and black, it makes you shudder to look at it. This one has brilliant green eyes." - icon_state = "nurse" - icon_living = "nurse" - icon_dead = "nurse_dead" - gender = FEMALE - butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/spider = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8, /obj/item/reagent_containers/food/snacks/spidereggs = 4) - maxHealth = 40 - health = 40 - melee_damage_lower = 5 - melee_damage_upper = 10 - poison_per_bite = 3 - var/atom/movable/cocoon_target - var/fed = 0 - var/obj/effect/proc_holder/wrap/wrap - var/datum/action/innate/spider/lay_eggs/lay_eggs - var/datum/action/innate/spider/set_directive/set_directive - var/static/list/consumed_mobs = list() //the tags of mobs that have been consumed by nurse spiders to lay eggs - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/Initialize() - . = ..() - wrap = new - AddAbility(wrap) - lay_eggs = new - lay_eggs.Grant(src) - set_directive = new - set_directive.Grant(src) - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/Destroy() - RemoveAbility(wrap) - QDEL_NULL(lay_eggs) - QDEL_NULL(set_directive) - return ..() - -//hunters have the most poison and move the fastest, so they can find prey -/mob/living/simple_animal/hostile/poison/giant_spider/hunter - desc = "Furry and black, it makes you shudder to look at it. This one has sparkling purple eyes." - icon_state = "hunter" - icon_living = "hunter" - icon_dead = "hunter_dead" - maxHealth = 120 - health = 120 - melee_damage_lower = 10 - melee_damage_upper = 20 - poison_per_bite = 5 - move_to_delay = 5 - -//vipers are the rare variant of the hunter, no IMMEDIATE damage but so much poison medical care will be needed fast. -/mob/living/simple_animal/hostile/poison/giant_spider/hunter/viper - name = "viper" - desc = "Furry and black, it makes you shudder to look at it. This one has effervescent purple eyes." - icon_state = "viper" - icon_living = "viper" - icon_dead = "viper_dead" - maxHealth = 40 - health = 40 - melee_damage_lower = 1 - melee_damage_upper = 1 - poison_per_bite = 12 - move_to_delay = 4 - poison_type = "venom" //all in venom, glass cannon. you bite 5 times and they are DEFINITELY dead, but 40 health and you are extremely obvious. Ambush, maybe? - speed = 1 - gold_core_spawnable = NO_SPAWN - -//tarantulas are really tanky, regenerating (maybe), hulky monster but are also extremely slow, so. -/mob/living/simple_animal/hostile/poison/giant_spider/tarantula - name = "tarantula" - desc = "Furry and black, it makes you shudder to look at it. This one has abyssal red eyes." - icon_state = "tarantula" - icon_living = "tarantula" - icon_dead = "tarantula_dead" - maxHealth = 300 // woah nelly - health = 300 - melee_damage_lower = 35 - melee_damage_upper = 40 - poison_per_bite = 0 - move_to_delay = 8 - speed = 7 - status_flags = NONE - mob_size = MOB_SIZE_LARGE - gold_core_spawnable = NO_SPAWN - -/mob/living/simple_animal/hostile/poison/giant_spider/tarantula/movement_delay() - var/turf/T = get_turf(src) - if(locate(/obj/structure/spider/stickyweb) in T) - speed = 2 - else - speed = 7 - . = ..() - -//midwives are the queen of the spiders, can send messages to all them and web faster. That rare round where you get a queen spider and turn your 'for honor' players into 'r6siege' players will be a fun one. -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife - name = "midwife" - desc = "Furry and black, it makes you shudder to look at it. This one has scintillating green eyes." - icon_state = "midwife" - icon_living = "midwife" - icon_dead = "midwife_dead" - maxHealth = 40 - health = 40 - var/datum/action/innate/spider/comm/letmetalkpls - gold_core_spawnable = NO_SPAWN - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife/Initialize() - . = ..() - letmetalkpls = new - letmetalkpls.Grant(src) - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife/Destroy() - QDEL_NULL(letmetalkpls) - return ..() - -/mob/living/simple_animal/hostile/poison/giant_spider/ice //spiders dont usually like tempatures of 140 kelvin who knew - name = "giant ice spider" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) - minbodytemp = 0 - maxbodytemp = 1500 - poison_type = "frostoil" - color = rgb(114,228,250) - gold_core_spawnable = NO_SPAWN - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/ice - name = "giant ice spider" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) - minbodytemp = 0 - maxbodytemp = 1500 - poison_type = "frostoil" - color = rgb(114,228,250) - gold_core_spawnable = NO_SPAWN - -/mob/living/simple_animal/hostile/poison/giant_spider/hunter/ice - name = "giant ice spider" - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) - minbodytemp = 0 - maxbodytemp = 1500 - poison_type = "frostoil" - color = rgb(114,228,250) - gold_core_spawnable = NO_SPAWN - -/mob/living/simple_animal/hostile/poison/giant_spider/handle_automated_action() - if(!..()) //AIStatus is off - return 0 - if(AIStatus == AI_IDLE) - //1% chance to skitter madly away - if(!busy && prob(1)) - stop_automated_movement = 1 - Goto(pick(urange(20, src, 1)), move_to_delay) - spawn(50) - stop_automated_movement = 0 - walk(src,0) - return 1 - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/proc/GiveUp(C) - spawn(100) - if(busy == MOVING_TO_TARGET) - if(cocoon_target == C && get_dist(src,cocoon_target) > 1) - cocoon_target = null - busy = FALSE - stop_automated_movement = 0 - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/handle_automated_action() - if(..()) - var/list/can_see = view(src, 10) - if(!busy && prob(30)) //30% chance to stop wandering and do something - //first, check for potential food nearby to cocoon - for(var/mob/living/C in can_see) - if(C.stat && !istype(C, /mob/living/simple_animal/hostile/poison/giant_spider) && !C.anchored) - cocoon_target = C - busy = MOVING_TO_TARGET - Goto(C, move_to_delay) - //give up if we can't reach them after 10 seconds - GiveUp(C) - return - - //second, spin a sticky spiderweb on this tile - var/obj/structure/spider/stickyweb/W = locate() in get_turf(src) - if(!W) - lay_web.Activate() - else - //third, lay an egg cluster there - if(fed) - lay_eggs.Activate() - else - //fourthly, cocoon any nearby items so those pesky pinkskins can't use them - for(var/obj/O in can_see) - - if(O.anchored) - continue - - if(isitem(O) || isstructure(O) || ismachinery(O)) - cocoon_target = O - busy = MOVING_TO_TARGET - stop_automated_movement = 1 - Goto(O, move_to_delay) - //give up if we can't reach them after 10 seconds - GiveUp(O) - - else if(busy == MOVING_TO_TARGET && cocoon_target) - if(get_dist(src, cocoon_target) <= 1) - cocoon() - - else - busy = SPIDER_IDLE - stop_automated_movement = FALSE - -/mob/living/simple_animal/hostile/poison/giant_spider/nurse/proc/cocoon() - if(stat != DEAD && cocoon_target && !cocoon_target.anchored) - if(cocoon_target == src) - to_chat(src, "You can't wrap yourself!") - return - if(istype(cocoon_target, /mob/living/simple_animal/hostile/poison/giant_spider)) - to_chat(src, "You can't wrap other spiders!") - return - if(!Adjacent(cocoon_target)) - to_chat(src, "You can't reach [cocoon_target]!") - return - if(busy == SPINNING_COCOON) - to_chat(src, "You're already spinning a cocoon!") - return //we're already doing this, don't cancel out or anything - busy = SPINNING_COCOON - visible_message("[src] begins to secrete a sticky substance around [cocoon_target].","You begin wrapping [cocoon_target] into a cocoon.") - stop_automated_movement = TRUE - walk(src,0) - if(do_after(src, 50, target = cocoon_target)) - if(busy == SPINNING_COCOON) - var/obj/structure/spider/cocoon/C = new(cocoon_target.loc) - if(isliving(cocoon_target)) - var/mob/living/L = cocoon_target - if(L.blood_volume && (L.stat != DEAD || !consumed_mobs[L.tag])) //if they're not dead, you can consume them anyway - consumed_mobs[L.tag] = TRUE - fed++ - lay_eggs.UpdateButtonIcon(TRUE) - visible_message("[src] sticks a proboscis into [L] and sucks a viscous substance out.","You suck the nutriment out of [L], feeding you enough to lay a cluster of eggs.") - L.death() //you just ate them, they're dead. - else - to_chat(src, "[L] cannot sate your hunger!") - cocoon_target.forceMove(C) - - if(cocoon_target.density || ismob(cocoon_target)) - C.icon_state = pick("cocoon_large1","cocoon_large2","cocoon_large3") - cocoon_target = null - busy = SPIDER_IDLE - stop_automated_movement = FALSE - -/datum/action/innate/spider - icon_icon = 'icons/mob/actions/actions_animal.dmi' - background_icon_state = "bg_alien" - -/datum/action/innate/spider/lay_web - name = "Spin Web" - desc = "Spin a web to slow down potential prey." - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "lay_web" - -/datum/action/innate/spider/lay_web/Activate() - if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider)) - return - var/mob/living/simple_animal/hostile/poison/giant_spider/S = owner - - if(!isturf(S.loc)) - return - var/turf/T = get_turf(S) - - var/obj/structure/spider/stickyweb/W = locate() in T - if(W) - to_chat(S, "There's already a web here!") - return - - if(S.busy != SPINNING_WEB) - S.busy = SPINNING_WEB - S.visible_message("[S] begins to secrete a sticky substance.","You begin to lay a web.") - S.stop_automated_movement = TRUE - if(do_after(S, 40, target = T)) - if(S.busy == SPINNING_WEB && S.loc == T) - new /obj/structure/spider/stickyweb(T) - S.busy = SPIDER_IDLE - S.stop_automated_movement = FALSE - else - to_chat(S, "You're already spinning a web!") - -/obj/effect/proc_holder/wrap - name = "Wrap" - panel = "Spider" - active = FALSE - datum/action/spell_action/action = null - desc = "Wrap something or someone in a cocoon. If it's a living being, you'll also consume them, allowing you to lay eggs." - ranged_mousepointer = 'icons/effects/wrap_target.dmi' - action_icon = 'icons/mob/actions/actions_animal.dmi' - action_icon_state = "wrap_0" - action_background_icon_state = "bg_alien" - -/obj/effect/proc_holder/wrap/Initialize() - . = ..() - action = new(src) - -/obj/effect/proc_holder/wrap/update_icon() - action.button_icon_state = "wrap_[active]" - action.UpdateButtonIcon() - -/obj/effect/proc_holder/wrap/Click() - if(!istype(usr, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) - return TRUE - var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/user = usr - activate(user) - return TRUE - -/obj/effect/proc_holder/wrap/proc/activate(mob/living/user) - var/message - if(active) - message = "You no longer prepare to wrap something in a cocoon." - remove_ranged_ability(message) - else - message = "You prepare to wrap something in a cocoon. Left-click your target to start wrapping!" - add_ranged_ability(user, message, TRUE) - return 1 - -/obj/effect/proc_holder/wrap/InterceptClickOn(mob/living/caller, params, atom/target) - if(..()) - return - if(ranged_ability_user.incapacitated() || !istype(ranged_ability_user, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) - remove_ranged_ability() - return - - var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/user = ranged_ability_user - - if(user.Adjacent(target) && (ismob(target) || isobj(target))) - var/atom/movable/target_atom = target - if(target_atom.anchored) - return - user.cocoon_target = target_atom - INVOKE_ASYNC(user, /mob/living/simple_animal/hostile/poison/giant_spider/nurse/.proc/cocoon) - remove_ranged_ability() - return TRUE - -/obj/effect/proc_holder/wrap/on_lose(mob/living/carbon/user) - remove_ranged_ability() - -/datum/action/innate/spider/lay_eggs - name = "Lay Eggs" - desc = "Lay a cluster of eggs, which will soon grow into more spiders. You must wrap a living being to do this." - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "lay_eggs" - -/datum/action/innate/spider/lay_eggs/IsAvailable() - if(..()) - if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) - return 0 - var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner - if(S.fed) - return 1 - return 0 - -/datum/action/innate/spider/lay_eggs/Activate() - if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) - return - var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner - - var/obj/structure/spider/eggcluster/E = locate() in get_turf(S) - if(E) - to_chat(S, "There is already a cluster of eggs here!") - else if(!S.fed) - to_chat(S, "You are too hungry to do this!") - else if(S.busy != LAYING_EGGS) - S.busy = LAYING_EGGS - S.visible_message("[S] begins to lay a cluster of eggs.","You begin to lay a cluster of eggs.") - S.stop_automated_movement = TRUE - if(do_after(S, 50, target = get_turf(S))) - if(S.busy == LAYING_EGGS) - E = locate() in get_turf(S) - if(!E || !isturf(S.loc)) - var/obj/structure/spider/eggcluster/C = new /obj/structure/spider/eggcluster(get_turf(S)) - if(S.ckey) - C.player_spiders = TRUE - C.directive = S.directive - C.poison_type = S.poison_type - C.poison_per_bite = S.poison_per_bite - C.faction = S.faction.Copy() - S.fed-- - UpdateButtonIcon(TRUE) - S.busy = SPIDER_IDLE - S.stop_automated_movement = FALSE - -/datum/action/innate/spider/set_directive - name = "Set Directive" - desc = "Set a directive for your children to follow." - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "directive" - -/datum/action/innate/spider/set_directive/Activate() - if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) - return - var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner - S.directive = stripped_input(S, "Enter the new directive", "Create directive", "[S.directive]") - -/mob/living/simple_animal/hostile/poison/giant_spider/Login() - . = ..() - GLOB.spidermobs[src] = TRUE - -/mob/living/simple_animal/hostile/poison/giant_spider/Destroy() - GLOB.spidermobs -= src - return ..() - -/datum/action/innate/spider/comm - name = "Command" - desc = "Send a command to all living spiders." - button_icon_state = "command" - -/datum/action/innate/spider/comm/IsAvailable() - if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife)) - return FALSE - return TRUE - -/datum/action/innate/spider/comm/Trigger() - var/input = stripped_input(owner, "Input a command for your legions to follow.", "Command", "") - if(QDELETED(src) || !input || !IsAvailable()) - return FALSE - spider_command(owner, input) - return TRUE - -/datum/action/innate/spider/comm/proc/spider_command(mob/living/user, message) - if(!message) - return - var/my_message - my_message = "Command from [user]: [message]" - for(var/mob/living/simple_animal/hostile/poison/giant_spider/M in GLOB.spidermobs) - to_chat(M, my_message) - for(var/M in GLOB.dead_mob_list) - var/link = FOLLOW_LINK(M, user) - to_chat(M, "[link] [my_message]") - usr.log_talk(message, LOG_SAY, tag="spider command") - -/mob/living/simple_animal/hostile/poison/giant_spider/handle_temperature_damage() - if(bodytemperature < minbodytemp) - adjustBruteLoss(20) - else if(bodytemperature > maxbodytemp) - adjustBruteLoss(20) - -#undef SPIDER_IDLE -#undef SPINNING_WEB -#undef LAYING_EGGS -#undef MOVING_TO_TARGET -#undef SPINNING_COCOON +#define SPIDER_IDLE 0 +#define SPINNING_WEB 1 +#define LAYING_EGGS 2 +#define MOVING_TO_TARGET 3 +#define SPINNING_COCOON 4 + +/mob/living/simple_animal/hostile/poison + var/poison_per_bite = 5 + var/poison_type = /datum/reagent/toxin + +/mob/living/simple_animal/hostile/poison/AttackingTarget() + . = ..() + if(. && isliving(target)) + var/mob/living/L = target + if(L.reagents) + L.reagents.add_reagent(poison_type, poison_per_bite) + +//basic spider mob, these generally guard nests +/mob/living/simple_animal/hostile/poison/giant_spider + name = "giant spider" + desc = "Furry and black, it makes you shudder to look at it. This one has deep red eyes." + icon_state = "guard" + icon_living = "guard" + icon_dead = "guard_dead" + mob_biotypes = list(MOB_ORGANIC, MOB_BUG) + speak_emote = list("chitters") + emote_hear = list("chitters") + speak_chance = 5 + turns_per_move = 5 + see_in_dark = 10 + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/spider = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "hits" + maxHealth = 200 + health = 200 + obj_damage = 60 + melee_damage_lower = 15 + melee_damage_upper = 20 + faction = list("spiders") + var/busy = SPIDER_IDLE + pass_flags = PASSTABLE + move_to_delay = 6 + ventcrawler = VENTCRAWLER_ALWAYS + attacktext = "bites" + attack_sound = 'sound/weapons/bite.ogg' + unique_name = 1 + gold_core_spawnable = HOSTILE_SPAWN + see_in_dark = 4 + lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE + var/playable_spider = FALSE + var/datum/action/innate/spider/lay_web/lay_web + var/directive = "" //Message passed down to children, to relay the creator's orders + + do_footstep = TRUE + +/mob/living/simple_animal/hostile/poison/giant_spider/Initialize() + . = ..() + lay_web = new + lay_web.Grant(src) + +/mob/living/simple_animal/hostile/poison/giant_spider/Destroy() + QDEL_NULL(lay_web) + return ..() + +/mob/living/simple_animal/hostile/poison/giant_spider/Topic(href, href_list) + if(href_list["activate"]) + var/mob/dead/observer/ghost = usr + if(istype(ghost) && playable_spider) + humanize_spider(ghost) + +/mob/living/simple_animal/hostile/poison/giant_spider/Login() + ..() + if(directive) + to_chat(src, "Your mother left you a directive! Follow it at all costs.") + to_chat(src, "[directive]") + +/mob/living/simple_animal/hostile/poison/giant_spider/attack_ghost(mob/user) + . = ..() + if(.) + return + humanize_spider(user) + +/mob/living/simple_animal/hostile/poison/giant_spider/proc/humanize_spider(mob/user) + if(key || !playable_spider || stat)//Someone is in it, it's dead, or the fun police are shutting it down + return 0 + var/spider_ask = alert("Become a spider?", "Are you australian?", "Yes", "No") + if(spider_ask == "No" || !src || QDELETED(src)) + return 1 + if(key) + to_chat(user, "Someone else already took this spider.") + return 1 + key = user.key + return 1 + +//nursemaids - these create webs and eggs +/mob/living/simple_animal/hostile/poison/giant_spider/nurse + desc = "Furry and black, it makes you shudder to look at it. This one has brilliant green eyes." + icon_state = "nurse" + icon_living = "nurse" + icon_dead = "nurse_dead" + gender = FEMALE + butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/spider = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8, /obj/item/reagent_containers/food/snacks/spidereggs = 4) + maxHealth = 40 + health = 40 + melee_damage_lower = 5 + melee_damage_upper = 10 + poison_per_bite = 3 + var/atom/movable/cocoon_target + var/fed = 0 + var/obj/effect/proc_holder/wrap/wrap + var/datum/action/innate/spider/lay_eggs/lay_eggs + var/datum/action/innate/spider/set_directive/set_directive + var/static/list/consumed_mobs = list() //the tags of mobs that have been consumed by nurse spiders to lay eggs + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/Initialize() + . = ..() + wrap = new + AddAbility(wrap) + lay_eggs = new + lay_eggs.Grant(src) + set_directive = new + set_directive.Grant(src) + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/Destroy() + RemoveAbility(wrap) + QDEL_NULL(lay_eggs) + QDEL_NULL(set_directive) + return ..() + +//hunters have the most poison and move the fastest, so they can find prey +/mob/living/simple_animal/hostile/poison/giant_spider/hunter + desc = "Furry and black, it makes you shudder to look at it. This one has sparkling purple eyes." + icon_state = "hunter" + icon_living = "hunter" + icon_dead = "hunter_dead" + maxHealth = 120 + health = 120 + melee_damage_lower = 10 + melee_damage_upper = 20 + poison_per_bite = 5 + move_to_delay = 5 + +//vipers are the rare variant of the hunter, no IMMEDIATE damage but so much poison medical care will be needed fast. +/mob/living/simple_animal/hostile/poison/giant_spider/hunter/viper + name = "viper" + desc = "Furry and black, it makes you shudder to look at it. This one has effervescent purple eyes." + icon_state = "viper" + icon_living = "viper" + icon_dead = "viper_dead" + maxHealth = 40 + health = 40 + melee_damage_lower = 1 + melee_damage_upper = 1 + poison_per_bite = 12 + move_to_delay = 4 + poison_type = /datum/reagent/toxin/venom //all in venom, glass cannon. you bite 5 times and they are DEFINITELY dead, but 40 health and you are extremely obvious. Ambush, maybe? + speed = 1 + gold_core_spawnable = NO_SPAWN + +//tarantulas are really tanky, regenerating (maybe), hulky monster but are also extremely slow, so. +/mob/living/simple_animal/hostile/poison/giant_spider/tarantula + name = "tarantula" + desc = "Furry and black, it makes you shudder to look at it. This one has abyssal red eyes." + icon_state = "tarantula" + icon_living = "tarantula" + icon_dead = "tarantula_dead" + maxHealth = 300 // woah nelly + health = 300 + melee_damage_lower = 35 + melee_damage_upper = 40 + poison_per_bite = 0 + move_to_delay = 8 + speed = 7 + status_flags = NONE + mob_size = MOB_SIZE_LARGE + gold_core_spawnable = NO_SPAWN + +/mob/living/simple_animal/hostile/poison/giant_spider/tarantula/movement_delay() + var/turf/T = get_turf(src) + if(locate(/obj/structure/spider/stickyweb) in T) + speed = 2 + else + speed = 7 + . = ..() + +//midwives are the queen of the spiders, can send messages to all them and web faster. That rare round where you get a queen spider and turn your 'for honor' players into 'r6siege' players will be a fun one. +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife + name = "midwife" + desc = "Furry and black, it makes you shudder to look at it. This one has scintillating green eyes." + icon_state = "midwife" + icon_living = "midwife" + icon_dead = "midwife_dead" + maxHealth = 40 + health = 40 + var/datum/action/innate/spider/comm/letmetalkpls + gold_core_spawnable = NO_SPAWN + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife/Initialize() + . = ..() + letmetalkpls = new + letmetalkpls.Grant(src) + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife/Destroy() + QDEL_NULL(letmetalkpls) + return ..() + +/mob/living/simple_animal/hostile/poison/giant_spider/ice //spiders dont usually like tempatures of 140 kelvin who knew + name = "giant ice spider" + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + maxbodytemp = 1500 + poison_type = /datum/reagent/consumable/frostoil + color = rgb(114,228,250) + gold_core_spawnable = NO_SPAWN + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/ice + name = "giant ice spider" + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + maxbodytemp = 1500 + poison_type = /datum/reagent/consumable/frostoil + color = rgb(114,228,250) + gold_core_spawnable = NO_SPAWN + +/mob/living/simple_animal/hostile/poison/giant_spider/hunter/ice + name = "giant ice spider" + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + maxbodytemp = 1500 + poison_type = /datum/reagent/consumable/frostoil + color = rgb(114,228,250) + gold_core_spawnable = NO_SPAWN + +/mob/living/simple_animal/hostile/poison/giant_spider/handle_automated_action() + if(!..()) //AIStatus is off + return 0 + if(AIStatus == AI_IDLE) + //1% chance to skitter madly away + if(!busy && prob(1)) + stop_automated_movement = 1 + Goto(pick(urange(20, src, 1)), move_to_delay) + spawn(50) + stop_automated_movement = 0 + walk(src,0) + return 1 + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/proc/GiveUp(C) + spawn(100) + if(busy == MOVING_TO_TARGET) + if(cocoon_target == C && get_dist(src,cocoon_target) > 1) + cocoon_target = null + busy = FALSE + stop_automated_movement = 0 + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/handle_automated_action() + if(..()) + var/list/can_see = view(src, 10) + if(!busy && prob(30)) //30% chance to stop wandering and do something + //first, check for potential food nearby to cocoon + for(var/mob/living/C in can_see) + if(C.stat && !istype(C, /mob/living/simple_animal/hostile/poison/giant_spider) && !C.anchored) + cocoon_target = C + busy = MOVING_TO_TARGET + Goto(C, move_to_delay) + //give up if we can't reach them after 10 seconds + GiveUp(C) + return + + //second, spin a sticky spiderweb on this tile + var/obj/structure/spider/stickyweb/W = locate() in get_turf(src) + if(!W) + lay_web.Activate() + else + //third, lay an egg cluster there + if(fed) + lay_eggs.Activate() + else + //fourthly, cocoon any nearby items so those pesky pinkskins can't use them + for(var/obj/O in can_see) + + if(O.anchored) + continue + + if(isitem(O) || isstructure(O) || ismachinery(O)) + cocoon_target = O + busy = MOVING_TO_TARGET + stop_automated_movement = 1 + Goto(O, move_to_delay) + //give up if we can't reach them after 10 seconds + GiveUp(O) + + else if(busy == MOVING_TO_TARGET && cocoon_target) + if(get_dist(src, cocoon_target) <= 1) + cocoon() + + else + busy = SPIDER_IDLE + stop_automated_movement = FALSE + +/mob/living/simple_animal/hostile/poison/giant_spider/nurse/proc/cocoon() + if(stat != DEAD && cocoon_target && !cocoon_target.anchored) + if(cocoon_target == src) + to_chat(src, "You can't wrap yourself!") + return + if(istype(cocoon_target, /mob/living/simple_animal/hostile/poison/giant_spider)) + to_chat(src, "You can't wrap other spiders!") + return + if(!Adjacent(cocoon_target)) + to_chat(src, "You can't reach [cocoon_target]!") + return + if(busy == SPINNING_COCOON) + to_chat(src, "You're already spinning a cocoon!") + return //we're already doing this, don't cancel out or anything + busy = SPINNING_COCOON + visible_message("[src] begins to secrete a sticky substance around [cocoon_target].","You begin wrapping [cocoon_target] into a cocoon.") + stop_automated_movement = TRUE + walk(src,0) + if(do_after(src, 50, target = cocoon_target)) + if(busy == SPINNING_COCOON) + var/obj/structure/spider/cocoon/C = new(cocoon_target.loc) + if(isliving(cocoon_target)) + var/mob/living/L = cocoon_target + if(L.blood_volume && (L.stat != DEAD || !consumed_mobs[L.tag])) //if they're not dead, you can consume them anyway + consumed_mobs[L.tag] = TRUE + fed++ + lay_eggs.UpdateButtonIcon(TRUE) + visible_message("[src] sticks a proboscis into [L] and sucks a viscous substance out.","You suck the nutriment out of [L], feeding you enough to lay a cluster of eggs.") + L.death() //you just ate them, they're dead. + else + to_chat(src, "[L] cannot sate your hunger!") + cocoon_target.forceMove(C) + + if(cocoon_target.density || ismob(cocoon_target)) + C.icon_state = pick("cocoon_large1","cocoon_large2","cocoon_large3") + cocoon_target = null + busy = SPIDER_IDLE + stop_automated_movement = FALSE + +/datum/action/innate/spider + icon_icon = 'icons/mob/actions/actions_animal.dmi' + background_icon_state = "bg_alien" + +/datum/action/innate/spider/lay_web + name = "Spin Web" + desc = "Spin a web to slow down potential prey." + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "lay_web" + +/datum/action/innate/spider/lay_web/Activate() + if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider)) + return + var/mob/living/simple_animal/hostile/poison/giant_spider/S = owner + + if(!isturf(S.loc)) + return + var/turf/T = get_turf(S) + + var/obj/structure/spider/stickyweb/W = locate() in T + if(W) + to_chat(S, "There's already a web here!") + return + + if(S.busy != SPINNING_WEB) + S.busy = SPINNING_WEB + S.visible_message("[S] begins to secrete a sticky substance.","You begin to lay a web.") + S.stop_automated_movement = TRUE + if(do_after(S, 40, target = T)) + if(S.busy == SPINNING_WEB && S.loc == T) + new /obj/structure/spider/stickyweb(T) + S.busy = SPIDER_IDLE + S.stop_automated_movement = FALSE + else + to_chat(S, "You're already spinning a web!") + +/obj/effect/proc_holder/wrap + name = "Wrap" + panel = "Spider" + active = FALSE + datum/action/spell_action/action = null + desc = "Wrap something or someone in a cocoon. If it's a living being, you'll also consume them, allowing you to lay eggs." + ranged_mousepointer = 'icons/effects/wrap_target.dmi' + action_icon = 'icons/mob/actions/actions_animal.dmi' + action_icon_state = "wrap_0" + action_background_icon_state = "bg_alien" + +/obj/effect/proc_holder/wrap/Initialize() + . = ..() + action = new(src) + +/obj/effect/proc_holder/wrap/update_icon() + action.button_icon_state = "wrap_[active]" + action.UpdateButtonIcon() + +/obj/effect/proc_holder/wrap/Click() + if(!istype(usr, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) + return TRUE + var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/user = usr + activate(user) + return TRUE + +/obj/effect/proc_holder/wrap/proc/activate(mob/living/user) + var/message + if(active) + message = "You no longer prepare to wrap something in a cocoon." + remove_ranged_ability(message) + else + message = "You prepare to wrap something in a cocoon. Left-click your target to start wrapping!" + add_ranged_ability(user, message, TRUE) + return 1 + +/obj/effect/proc_holder/wrap/InterceptClickOn(mob/living/caller, params, atom/target) + if(..()) + return + if(ranged_ability_user.incapacitated() || !istype(ranged_ability_user, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) + remove_ranged_ability() + return + + var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/user = ranged_ability_user + + if(user.Adjacent(target) && (ismob(target) || isobj(target))) + var/atom/movable/target_atom = target + if(target_atom.anchored) + return + user.cocoon_target = target_atom + INVOKE_ASYNC(user, /mob/living/simple_animal/hostile/poison/giant_spider/nurse/.proc/cocoon) + remove_ranged_ability() + return TRUE + +/obj/effect/proc_holder/wrap/on_lose(mob/living/carbon/user) + remove_ranged_ability() + +/datum/action/innate/spider/lay_eggs + name = "Lay Eggs" + desc = "Lay a cluster of eggs, which will soon grow into more spiders. You must wrap a living being to do this." + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "lay_eggs" + +/datum/action/innate/spider/lay_eggs/IsAvailable() + if(..()) + if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) + return 0 + var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner + if(S.fed) + return 1 + return 0 + +/datum/action/innate/spider/lay_eggs/Activate() + if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) + return + var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner + + var/obj/structure/spider/eggcluster/E = locate() in get_turf(S) + if(E) + to_chat(S, "There is already a cluster of eggs here!") + else if(!S.fed) + to_chat(S, "You are too hungry to do this!") + else if(S.busy != LAYING_EGGS) + S.busy = LAYING_EGGS + S.visible_message("[S] begins to lay a cluster of eggs.","You begin to lay a cluster of eggs.") + S.stop_automated_movement = TRUE + if(do_after(S, 50, target = get_turf(S))) + if(S.busy == LAYING_EGGS) + E = locate() in get_turf(S) + if(!E || !isturf(S.loc)) + var/obj/structure/spider/eggcluster/C = new /obj/structure/spider/eggcluster(get_turf(S)) + if(S.ckey) + C.player_spiders = TRUE + C.directive = S.directive + C.poison_type = S.poison_type + C.poison_per_bite = S.poison_per_bite + C.faction = S.faction.Copy() + S.fed-- + UpdateButtonIcon(TRUE) + S.busy = SPIDER_IDLE + S.stop_automated_movement = FALSE + +/datum/action/innate/spider/set_directive + name = "Set Directive" + desc = "Set a directive for your children to follow." + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "directive" + +/datum/action/innate/spider/set_directive/Activate() + if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) + return + var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner + S.directive = stripped_input(S, "Enter the new directive", "Create directive", "[S.directive]") + +/mob/living/simple_animal/hostile/poison/giant_spider/Login() + . = ..() + GLOB.spidermobs[src] = TRUE + +/mob/living/simple_animal/hostile/poison/giant_spider/Destroy() + GLOB.spidermobs -= src + return ..() + +/datum/action/innate/spider/comm + name = "Command" + desc = "Send a command to all living spiders." + button_icon_state = "command" + +/datum/action/innate/spider/comm/IsAvailable() + if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife)) + return FALSE + return TRUE + +/datum/action/innate/spider/comm/Trigger() + var/input = stripped_input(owner, "Input a command for your legions to follow.", "Command", "") + if(QDELETED(src) || !input || !IsAvailable()) + return FALSE + spider_command(owner, input) + return TRUE + +/datum/action/innate/spider/comm/proc/spider_command(mob/living/user, message) + if(!message) + return + var/my_message + my_message = "Command from [user]: [message]" + for(var/mob/living/simple_animal/hostile/poison/giant_spider/M in GLOB.spidermobs) + to_chat(M, my_message) + for(var/M in GLOB.dead_mob_list) + var/link = FOLLOW_LINK(M, user) + to_chat(M, "[link] [my_message]") + usr.log_talk(message, LOG_SAY, tag="spider command") + +/mob/living/simple_animal/hostile/poison/giant_spider/handle_temperature_damage() + if(bodytemperature < minbodytemp) + adjustBruteLoss(20) + else if(bodytemperature > maxbodytemp) + adjustBruteLoss(20) + +#undef SPIDER_IDLE +#undef SPINNING_WEB +#undef LAYING_EGGS +#undef MOVING_TO_TARGET +#undef SPINNING_COCOON diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 72ae49eb..deb88d67 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -42,7 +42,7 @@ ..() if(iscarbon(target)) var/mob/living/carbon/C = target - C.reagents.add_reagent("leaper_venom", 5) + C.reagents.add_reagent(/datum/reagent/toxin/leaper_venom, 5) return if(isanimal(target)) var/mob/living/simple_animal/L = target @@ -96,7 +96,7 @@ L.Knockdown(50) if(iscarbon(L)) var/mob/living/carbon/C = L - C.reagents.add_reagent("leaper_venom", 5) + C.reagents.add_reagent(/datum/reagent/toxin/leaper_venom, 5) if(isanimal(L)) var/mob/living/simple_animal/A = L A.adjustHealth(25) @@ -105,7 +105,6 @@ /datum/reagent/toxin/leaper_venom name = "Leaper venom" - id = "leaper_venom" description = "A toxin spat out by leapers that, while harmless in small doses, quickly creates a toxic reaction if too much is in the body." color = "#801E28" // rgb: 128, 30, 40 toxpwr = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm index 910e9c3c..9e9fbaea 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm @@ -131,7 +131,7 @@ /obj/item/udder/gutlunch/generateMilk() if(prob(60)) - reagents.add_reagent("cream", rand(2, 5)) + reagents.add_reagent(/datum/reagent/consumable/cream, rand(2, 5)) if(prob(45)) - reagents.add_reagent("salglu_solution", rand(2,5)) + reagents.add_reagent(/datum/reagent/medicine/salglu_solution, rand(2,5)) diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 151e28d9..75cd2479 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -1,192 +1,192 @@ -/mob/living/simple_animal/hostile/mushroom - name = "walking mushroom" - desc = "It's a massive mushroom... with legs?" - icon_state = "mushroom_color" - icon_living = "mushroom_color" - icon_dead = "mushroom_dead" - speak_chance = 0 - turns_per_move = 1 - maxHealth = 10 - health = 10 - butcher_results = list(/obj/item/reagent_containers/food/snacks/hugemushroomslice = 1) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "whacks" - harm_intent_damage = 5 - obj_damage = 0 - melee_damage_lower = 1 - melee_damage_upper = 1 - attack_same = 2 - attacktext = "chomps" - attack_sound = 'sound/weapons/bite.ogg' - faction = list("mushroom") - environment_smash = ENVIRONMENT_SMASH_NONE - stat_attack = DEAD - mouse_opacity = MOUSE_OPACITY_ICON - speed = 1 - ventcrawler = VENTCRAWLER_ALWAYS - robust_searching = 1 - unique_name = 1 - speak_emote = list("squeaks") - deathmessage = "fainted." - var/cap_color = "#ffffff" - var/powerlevel = 0 //Tracks our general strength level gained from eating other shrooms - var/bruised = 0 //If someone tries to cheat the system by attacking a shroom to lower its health, punish them so that it wont award levels to shrooms that eat it - var/recovery_cooldown = 0 //So you can't repeatedly revive it during a fight - var/faint_ticker = 0 //If we hit three, another mushroom's gonna eat us - var/static/mutable_appearance/cap_living //Where we store our cap icons so we dont generate them constantly to update our icon - var/static/mutable_appearance/cap_dead - -/mob/living/simple_animal/hostile/mushroom/examine(mob/user) - . = ..() - if(health >= maxHealth) - . += "It looks healthy." - else - . += "It looks like it's been roughed up." - -/mob/living/simple_animal/hostile/mushroom/Life() - ..() - if(!stat)//Mushrooms slowly regenerate if conscious, for people who want to save them from being eaten - adjustBruteLoss(-2) - -/mob/living/simple_animal/hostile/mushroom/Initialize()//Makes every shroom a little unique - melee_damage_lower += rand(3, 5) - melee_damage_upper += rand(10,20) - maxHealth += rand(40,60) - move_to_delay = rand(3,11) - cap_living = cap_living || mutable_appearance(icon, "mushroom_cap") - cap_dead = cap_dead || mutable_appearance(icon, "mushroom_cap_dead") - - cap_color = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) - UpdateMushroomCap() - health = maxHealth - . = ..() - -/mob/living/simple_animal/hostile/mushroom/CanAttack(atom/the_target) // Mushroom-specific version of CanAttack to handle stupid attack_same = 2 crap so we don't have to do it for literally every single simple_animal/hostile because this shit never gets spawned - if(!the_target || isturf(the_target) || istype(the_target, /atom/movable/lighting_object)) - return FALSE - - if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it - return FALSE - - if(isliving(the_target)) - var/mob/living/L = the_target - - if (!faction_check_mob(L) && attack_same == 2) - return FALSE - if(L.stat > stat_attack) - return FALSE - - return TRUE - - return FALSE - -/mob/living/simple_animal/hostile/mushroom/adjustHealth(amount, updating_health = TRUE, forced = FALSE) //Possibility to flee from a fight just to make it more visually interesting - if(!retreat_distance && prob(33)) - retreat_distance = 5 - addtimer(CALLBACK(src, .proc/stop_retreat), 30) - . = ..() - -/mob/living/simple_animal/hostile/mushroom/proc/stop_retreat() - retreat_distance = null - -/mob/living/simple_animal/hostile/mushroom/attack_animal(mob/living/L) - if(istype(L, /mob/living/simple_animal/hostile/mushroom) && stat == DEAD) - var/mob/living/simple_animal/hostile/mushroom/M = L - if(faint_ticker < 2) - M.visible_message("[M] chews a bit on [src].") - faint_ticker++ - return TRUE - M.visible_message("[M] devours [src]!") - var/level_gain = (powerlevel - M.powerlevel) - if(level_gain >= -1 && !bruised && !M.ckey)//Player shrooms can't level up to become robust gods. - if(level_gain < 1)//So we still gain a level if two mushrooms were the same level - level_gain = 1 - M.LevelUp(level_gain) - M.adjustBruteLoss(-M.maxHealth) - qdel(src) - return TRUE - return ..() - -/mob/living/simple_animal/hostile/mushroom/revive(full_heal = 0, admin_revive = 0) - if(..()) - icon_state = "mushroom_color" - UpdateMushroomCap() - . = 1 - -/mob/living/simple_animal/hostile/mushroom/death(gibbed) - ..(gibbed) - UpdateMushroomCap() - -/mob/living/simple_animal/hostile/mushroom/proc/UpdateMushroomCap() - cut_overlays() - cap_living.color = cap_color - cap_dead.color = cap_color - if(health == 0) - add_overlay(cap_dead) - else - add_overlay(cap_living) - -/mob/living/simple_animal/hostile/mushroom/proc/Recover() - visible_message("[src] slowly begins to recover.") - faint_ticker = 0 - revive(full_heal = 1) - UpdateMushroomCap() - recovery_cooldown = 1 - addtimer(CALLBACK(src, .proc/recovery_recharge), 300) - -/mob/living/simple_animal/hostile/mushroom/proc/recovery_recharge() - recovery_cooldown = 0 - -/mob/living/simple_animal/hostile/mushroom/proc/LevelUp(level_gain) - if(powerlevel <= 9) - powerlevel += level_gain - if(prob(25)) - melee_damage_lower += (level_gain * rand(1,5)) - else - melee_damage_upper += (level_gain * rand(1,5)) - maxHealth += (level_gain * rand(1,5)) - adjustBruteLoss(-maxHealth) //They'll always heal, even if they don't gain a level, in case you want to keep this shroom around instead of harvesting it - -/mob/living/simple_animal/hostile/mushroom/proc/Bruise() - if(!bruised && !stat) - src.visible_message("The [src.name] was bruised!") - bruised = 1 - -/mob/living/simple_animal/hostile/mushroom/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/reagent_containers/food/snacks/grown/mushroom)) - if(stat == DEAD && !recovery_cooldown) - Recover() - qdel(I) - else - to_chat(user, "[src] won't eat it!") - return - if(I.force) - Bruise() - ..() - -/mob/living/simple_animal/hostile/mushroom/attack_hand(mob/living/carbon/human/M) - . = ..() - if(.) // the attack was blocked - return - if(M.a_intent == INTENT_HARM) - Bruise() - -/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - ..() - if(istype(AM, /obj/item)) - var/obj/item/T = AM - if(T.throwforce) - Bruise() - -/mob/living/simple_animal/hostile/mushroom/bullet_act() - ..() - Bruise() - -/mob/living/simple_animal/hostile/mushroom/harvest() - var/counter - for(counter=0, counter<=powerlevel, counter++) - var/obj/item/reagent_containers/food/snacks/hugemushroomslice/S = new /obj/item/reagent_containers/food/snacks/hugemushroomslice(src.loc) - S.reagents.add_reagent("mushroomhallucinogen", powerlevel) - S.reagents.add_reagent("omnizine", powerlevel) - S.reagents.add_reagent("synaptizine", powerlevel) +/mob/living/simple_animal/hostile/mushroom + name = "walking mushroom" + desc = "It's a massive mushroom... with legs?" + icon_state = "mushroom_color" + icon_living = "mushroom_color" + icon_dead = "mushroom_dead" + speak_chance = 0 + turns_per_move = 1 + maxHealth = 10 + health = 10 + butcher_results = list(/obj/item/reagent_containers/food/snacks/hugemushroomslice = 1) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "whacks" + harm_intent_damage = 5 + obj_damage = 0 + melee_damage_lower = 1 + melee_damage_upper = 1 + attack_same = 2 + attacktext = "chomps" + attack_sound = 'sound/weapons/bite.ogg' + faction = list("mushroom") + environment_smash = ENVIRONMENT_SMASH_NONE + stat_attack = DEAD + mouse_opacity = MOUSE_OPACITY_ICON + speed = 1 + ventcrawler = VENTCRAWLER_ALWAYS + robust_searching = 1 + unique_name = 1 + speak_emote = list("squeaks") + deathmessage = "fainted." + var/cap_color = "#ffffff" + var/powerlevel = 0 //Tracks our general strength level gained from eating other shrooms + var/bruised = 0 //If someone tries to cheat the system by attacking a shroom to lower its health, punish them so that it wont award levels to shrooms that eat it + var/recovery_cooldown = 0 //So you can't repeatedly revive it during a fight + var/faint_ticker = 0 //If we hit three, another mushroom's gonna eat us + var/static/mutable_appearance/cap_living //Where we store our cap icons so we dont generate them constantly to update our icon + var/static/mutable_appearance/cap_dead + +/mob/living/simple_animal/hostile/mushroom/examine(mob/user) + . = ..() + if(health >= maxHealth) + . += "It looks healthy." + else + . += "It looks like it's been roughed up." + +/mob/living/simple_animal/hostile/mushroom/Life() + ..() + if(!stat)//Mushrooms slowly regenerate if conscious, for people who want to save them from being eaten + adjustBruteLoss(-2) + +/mob/living/simple_animal/hostile/mushroom/Initialize()//Makes every shroom a little unique + melee_damage_lower += rand(3, 5) + melee_damage_upper += rand(10,20) + maxHealth += rand(40,60) + move_to_delay = rand(3,11) + cap_living = cap_living || mutable_appearance(icon, "mushroom_cap") + cap_dead = cap_dead || mutable_appearance(icon, "mushroom_cap_dead") + + cap_color = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) + UpdateMushroomCap() + health = maxHealth + . = ..() + +/mob/living/simple_animal/hostile/mushroom/CanAttack(atom/the_target) // Mushroom-specific version of CanAttack to handle stupid attack_same = 2 crap so we don't have to do it for literally every single simple_animal/hostile because this shit never gets spawned + if(!the_target || isturf(the_target) || istype(the_target, /atom/movable/lighting_object)) + return FALSE + + if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it + return FALSE + + if(isliving(the_target)) + var/mob/living/L = the_target + + if (!faction_check_mob(L) && attack_same == 2) + return FALSE + if(L.stat > stat_attack) + return FALSE + + return TRUE + + return FALSE + +/mob/living/simple_animal/hostile/mushroom/adjustHealth(amount, updating_health = TRUE, forced = FALSE) //Possibility to flee from a fight just to make it more visually interesting + if(!retreat_distance && prob(33)) + retreat_distance = 5 + addtimer(CALLBACK(src, .proc/stop_retreat), 30) + . = ..() + +/mob/living/simple_animal/hostile/mushroom/proc/stop_retreat() + retreat_distance = null + +/mob/living/simple_animal/hostile/mushroom/attack_animal(mob/living/L) + if(istype(L, /mob/living/simple_animal/hostile/mushroom) && stat == DEAD) + var/mob/living/simple_animal/hostile/mushroom/M = L + if(faint_ticker < 2) + M.visible_message("[M] chews a bit on [src].") + faint_ticker++ + return TRUE + M.visible_message("[M] devours [src]!") + var/level_gain = (powerlevel - M.powerlevel) + if(level_gain >= -1 && !bruised && !M.ckey)//Player shrooms can't level up to become robust gods. + if(level_gain < 1)//So we still gain a level if two mushrooms were the same level + level_gain = 1 + M.LevelUp(level_gain) + M.adjustBruteLoss(-M.maxHealth) + qdel(src) + return TRUE + return ..() + +/mob/living/simple_animal/hostile/mushroom/revive(full_heal = 0, admin_revive = 0) + if(..()) + icon_state = "mushroom_color" + UpdateMushroomCap() + . = 1 + +/mob/living/simple_animal/hostile/mushroom/death(gibbed) + ..(gibbed) + UpdateMushroomCap() + +/mob/living/simple_animal/hostile/mushroom/proc/UpdateMushroomCap() + cut_overlays() + cap_living.color = cap_color + cap_dead.color = cap_color + if(health == 0) + add_overlay(cap_dead) + else + add_overlay(cap_living) + +/mob/living/simple_animal/hostile/mushroom/proc/Recover() + visible_message("[src] slowly begins to recover.") + faint_ticker = 0 + revive(full_heal = 1) + UpdateMushroomCap() + recovery_cooldown = 1 + addtimer(CALLBACK(src, .proc/recovery_recharge), 300) + +/mob/living/simple_animal/hostile/mushroom/proc/recovery_recharge() + recovery_cooldown = 0 + +/mob/living/simple_animal/hostile/mushroom/proc/LevelUp(level_gain) + if(powerlevel <= 9) + powerlevel += level_gain + if(prob(25)) + melee_damage_lower += (level_gain * rand(1,5)) + else + melee_damage_upper += (level_gain * rand(1,5)) + maxHealth += (level_gain * rand(1,5)) + adjustBruteLoss(-maxHealth) //They'll always heal, even if they don't gain a level, in case you want to keep this shroom around instead of harvesting it + +/mob/living/simple_animal/hostile/mushroom/proc/Bruise() + if(!bruised && !stat) + src.visible_message("The [src.name] was bruised!") + bruised = 1 + +/mob/living/simple_animal/hostile/mushroom/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/reagent_containers/food/snacks/grown/mushroom)) + if(stat == DEAD && !recovery_cooldown) + Recover() + qdel(I) + else + to_chat(user, "[src] won't eat it!") + return + if(I.force) + Bruise() + ..() + +/mob/living/simple_animal/hostile/mushroom/attack_hand(mob/living/carbon/human/M) + . = ..() + if(.) // the attack was blocked + return + if(M.a_intent == INTENT_HARM) + Bruise() + +/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + ..() + if(istype(AM, /obj/item)) + var/obj/item/T = AM + if(T.throwforce) + Bruise() + +/mob/living/simple_animal/hostile/mushroom/bullet_act() + ..() + Bruise() + +/mob/living/simple_animal/hostile/mushroom/harvest() + var/counter + for(counter=0, counter<=powerlevel, counter++) + var/obj/item/reagent_containers/food/snacks/hugemushroomslice/S = new /obj/item/reagent_containers/food/snacks/hugemushroomslice(src.loc) + S.reagents.add_reagent(/datum/reagent/drug/mushroomhallucinogen, powerlevel) + S.reagents.add_reagent(/datum/reagent/medicine/omnizine, powerlevel) + S.reagents.add_reagent(/datum/reagent/medicine/synaptizine, powerlevel) diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 9671f35e..67b3cb53 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -141,9 +141,9 @@ . = ..() remove_movespeed_modifier(MOVESPEED_ID_SLIME_REAGENTMOD, TRUE) var/amount = 0 - if(reagents.has_reagent("morphine")) // morphine slows slimes down + if(reagents.has_reagent(/datum/reagent/medicine/morphine)) // morphine slows slimes down amount = 2 - if(reagents.has_reagent("frostoil")) // Frostoil also makes them move VEEERRYYYYY slow + if(reagents.has_reagent(/datum/reagent/consumable/frostoil)) // Frostoil also makes them move VEEERRYYYYY slow amount = 5 if(amount) add_movespeed_modifier(MOVESPEED_ID_SLIME_REAGENTMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = amount) diff --git a/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm b/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm index 816ae587..89f5d20e 100644 --- a/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm +++ b/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm @@ -4,7 +4,7 @@ if(!ninjacost(0,N_ADRENALINE)) var/mob/living/carbon/human/H = affecting - H.do_adrenaline(150, TRUE, 0, 0, TRUE, list("inaprovaline" = 3, "synaptizine" = 10, "omnizine" = 10), "You feel a sudden surge of energy!") + H.do_adrenaline(150, TRUE, 0, 0, TRUE, list(/datum/reagent/medicine/inaprovaline = 3, /datum/reagent/medicine/synaptizine = 10, /datum/reagent/medicine/omnizine = 10), "You feel a sudden surge of energy!") H.say(pick("A CORNERED FOX IS MORE DANGEROUS THAN A JACKAL!","HURT ME MOOORRREEE!","IMPRESSIVE!"), forced = "ninjaboost") @@ -15,5 +15,5 @@ /obj/item/clothing/suit/space/space_ninja/proc/ninjaboost_after() var/mob/living/carbon/human/H = affecting - H.reagents.add_reagent("radium", a_transfer) + H.reagents.add_reagent(/datum/reagent/radium, a_transfer) to_chat(H, "You are beginning to feel the after-effect of the injection.") diff --git a/code/modules/ninja/suit/suit_attackby.dm b/code/modules/ninja/suit/suit_attackby.dm index 0496a2f1..ed920a57 100644 --- a/code/modules/ninja/suit/suit_attackby.dm +++ b/code/modules/ninja/suit/suit_attackby.dm @@ -5,13 +5,13 @@ return ..() if(istype(I, /obj/item/reagent_containers/glass))//If it's a glass beaker. - if(I.reagents.has_reagent("radium", a_transfer) && a_boost < a_maxamount) - I.reagents.remove_reagent("radium", a_transfer) + if(I.reagents.has_reagent(/datum/reagent/radium, a_transfer) && a_boost < a_maxamount) + I.reagents.remove_reagent(/datum/reagent/radium, a_transfer) a_boost++; to_chat(U, "There are now [a_boost] adrenaline boosts remaining.") return - if(I.reagents.has_reagent("smoke_powder", a_transfer) && s_bombs < s_maxamount) - I.reagents.remove_reagent("smoke_powder", a_transfer) + if(I.reagents.has_reagent(/datum/reagent/smoke_powder, a_transfer) && s_bombs < s_maxamount) + I.reagents.remove_reagent(/datum/reagent/smoke_powder, a_transfer) s_bombs++; to_chat(U, "There are now [s_bombs] smoke bombs remaining.") return diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 0372f8b9..66c58033 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -1,218 +1,218 @@ -/* Pens! - * Contains: - * Pens - * Sleepy Pens - * Parapens - * Edaggers - */ - - -/* - * Pens - */ -/obj/item/pen - desc = "It's a black ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpadsâ„¢!" - name = "pen" - icon = 'icons/obj/bureaucracy.dmi' - icon_state = "pen" - item_state = "pen" - slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_EARS - throwforce = 0 - w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - materials = list(MAT_METAL=10) - pressure_resistance = 2 - grind_results = list("iron" = 2, "iodine" = 1) - var/colour = "black" //what colour the ink is! - var/degrees = 0 - var/font = PEN_FONT - -/obj/item/pen/suicide_act(mob/user) - user.visible_message("[user] is scribbling numbers all over [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit sudoku...") - return(BRUTELOSS) - -/obj/item/pen/blue - desc = "It's a blue ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpadsâ„¢!" - icon_state = "pen_blue" - colour = "blue" - -/obj/item/pen/red - desc = "It's a red ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpadsâ„¢!" - icon_state = "pen_red" - colour = "red" - -/obj/item/pen/invisible - desc = "It's an invisible pen marker." - icon_state = "pen" - colour = "white" - -/obj/item/pen/fourcolor - desc = "It's a fancy four-color ink pen, set to black. Modified to be compatible with Nanotransen-brand Digital-Readpadsâ„¢" - name = "four-color pen" - colour = "black" - -/obj/item/pen/fourcolor/attack_self(mob/living/carbon/user) - switch(colour) - if("black") - colour = "red" - if("red") - colour = "green" - if("green") - colour = "blue" - else - colour = "black" - to_chat(user, "\The [src] will now write in [colour].") - desc = "It's a fancy four-color ink pen, set to [colour]." - -/obj/item/pen/fountain - name = "fountain pen" - desc = "It's a common fountain pen, with a faux wood body." - icon_state = "pen-fountain" - font = FOUNTAIN_PEN_FONT - -/obj/item/pen/fountain/captain - name = "captain's fountain pen" - desc = "It's an expensive Oak fountain pen. The nib is quite sharp." - icon_state = "pen-fountain-o" - force = 5 - throwforce = 5 - throw_speed = 4 - colour = "crimson" - materials = list(MAT_GOLD = 750) - sharpness = IS_SHARP - resistance_flags = FIRE_PROOF - unique_reskin = list("Oak" = "pen-fountain-o", - "Gold" = "pen-fountain-g", - "Rosewood" = "pen-fountain-r", - "Black and Silver" = "pen-fountain-b", - "Command Blue" = "pen-fountain-cb" - ) - -/obj/item/pen/fountain/captain/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 200, 115) //the pen is mightier than the sword - -/obj/item/pen/fountain/captain/reskin_obj(mob/M) - ..() - if(current_skin) - desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp." - -/obj/item/pen/attack_self(mob/living/carbon/user) - var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num - if(deg && (deg > 0 && deg <= 360)) - degrees = deg - to_chat(user, "You rotate the top of the pen to [degrees] degrees.") - SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user) - -/obj/item/pen/attack(mob/living/M, mob/user,stealth) - if(!istype(M)) - return - - if(!force) - if(M.can_inject(user, 1)) - to_chat(user, "You stab [M] with the pen.") - if(!stealth) - to_chat(M, "You feel a tiny prick!") - . = 1 - - log_combat(user, M, "stabbed", src) - - else - . = ..() - -/obj/item/pen/afterattack(obj/O, mob/living/user, proximity) - . = ..() - //Changing Name/Description of items. Only works if they have the 'unique_rename' flag set - if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME)) - var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description") - if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) - return - if(penchoice == "Rename") - var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN) - var/oldname = O.name - if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) - return - if(oldname == input) - to_chat(user, "You changed \the [O.name] to... well... \the [O.name].") - else - O.name = input - to_chat(user, "\The [oldname] has been successfully been renamed to \the [input].") - O.renamedByPlayer = TRUE - - if(penchoice == "Change description") - var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100) - if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) - return - O.desc = input - to_chat(user, "You have successfully changed \the [O.name]'s description.") - -/* - * Sleepypens - */ - -/obj/item/pen/sleepy/attack(mob/living/M, mob/user) - if(!istype(M)) - return - - if(..()) - if(reagents.total_volume) - if(M.reagents) - reagents.reaction(M, INJECT) - reagents.trans_to(M, reagents.total_volume) - - -/obj/item/pen/sleepy/Initialize() - . = ..() - create_reagents(45, OPENCONTAINER) - reagents.add_reagent("chloralhydrate", 20) - reagents.add_reagent("mutetoxin", 15) - reagents.add_reagent("tirizene", 10) - -/* - * (Alan) Edaggers - */ -/obj/item/pen/edagger - attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off - var/on = FALSE - -/obj/item/pen/edagger/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg', TRUE) - -/obj/item/pen/edagger/attack_self(mob/living/user) - if(on) - on = FALSE - force = initial(force) - w_class = initial(w_class) - name = initial(name) - hitsound = initial(hitsound) - embedding = embedding.setRating(embed_chance = EMBED_CHANCE) - throwforce = initial(throwforce) - playsound(user, 'sound/weapons/saberoff.ogg', 5, 1) - to_chat(user, "[src] can now be concealed.") - else - on = TRUE - force = 18 - w_class = WEIGHT_CLASS_NORMAL - name = "energy dagger" - hitsound = 'sound/weapons/blade1.ogg' - embedding = embedding.setRating(embed_chance = 100) //rule of cool - throwforce = 35 - playsound(user, 'sound/weapons/saberon.ogg', 5, 1) - to_chat(user, "[src] is now active.") - var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering) - butchering.butchering_enabled = on - update_icon() - -/obj/item/pen/edagger/update_icon() - if(on) - icon_state = "edagger" - item_state = "edagger" - lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' - righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' - else - icon_state = initial(icon_state) //looks like a normal pen when off. - item_state = initial(item_state) - lefthand_file = initial(lefthand_file) - righthand_file = initial(righthand_file) +/* Pens! + * Contains: + * Pens + * Sleepy Pens + * Parapens + * Edaggers + */ + + +/* + * Pens + */ +/obj/item/pen + desc = "It's a black ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpadsâ„¢!" + name = "pen" + icon = 'icons/obj/bureaucracy.dmi' + icon_state = "pen" + item_state = "pen" + slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_EARS + throwforce = 0 + w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + materials = list(MAT_METAL=10) + pressure_resistance = 2 + grind_results = list(/datum/reagent/iron = 2, /datum/reagent/iodine = 1) + var/colour = "black" //what colour the ink is! + var/degrees = 0 + var/font = PEN_FONT + +/obj/item/pen/suicide_act(mob/user) + user.visible_message("[user] is scribbling numbers all over [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit sudoku...") + return(BRUTELOSS) + +/obj/item/pen/blue + desc = "It's a blue ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpadsâ„¢!" + icon_state = "pen_blue" + colour = "blue" + +/obj/item/pen/red + desc = "It's a red ink pen, modified for use with both paper and Nanotransen-brand Digital-Readpadsâ„¢!" + icon_state = "pen_red" + colour = "red" + +/obj/item/pen/invisible + desc = "It's an invisible pen marker." + icon_state = "pen" + colour = "white" + +/obj/item/pen/fourcolor + desc = "It's a fancy four-color ink pen, set to black. Modified to be compatible with Nanotransen-brand Digital-Readpadsâ„¢" + name = "four-color pen" + colour = "black" + +/obj/item/pen/fourcolor/attack_self(mob/living/carbon/user) + switch(colour) + if("black") + colour = "red" + if("red") + colour = "green" + if("green") + colour = "blue" + else + colour = "black" + to_chat(user, "\The [src] will now write in [colour].") + desc = "It's a fancy four-color ink pen, set to [colour]." + +/obj/item/pen/fountain + name = "fountain pen" + desc = "It's a common fountain pen, with a faux wood body." + icon_state = "pen-fountain" + font = FOUNTAIN_PEN_FONT + +/obj/item/pen/fountain/captain + name = "captain's fountain pen" + desc = "It's an expensive Oak fountain pen. The nib is quite sharp." + icon_state = "pen-fountain-o" + force = 5 + throwforce = 5 + throw_speed = 4 + colour = "crimson" + materials = list(MAT_GOLD = 750) + sharpness = IS_SHARP + resistance_flags = FIRE_PROOF + unique_reskin = list("Oak" = "pen-fountain-o", + "Gold" = "pen-fountain-g", + "Rosewood" = "pen-fountain-r", + "Black and Silver" = "pen-fountain-b", + "Command Blue" = "pen-fountain-cb" + ) + +/obj/item/pen/fountain/captain/Initialize() + . = ..() + AddComponent(/datum/component/butchering, 200, 115) //the pen is mightier than the sword + +/obj/item/pen/fountain/captain/reskin_obj(mob/M) + ..() + if(current_skin) + desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp." + +/obj/item/pen/attack_self(mob/living/carbon/user) + var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num + if(deg && (deg > 0 && deg <= 360)) + degrees = deg + to_chat(user, "You rotate the top of the pen to [degrees] degrees.") + SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user) + +/obj/item/pen/attack(mob/living/M, mob/user,stealth) + if(!istype(M)) + return + + if(!force) + if(M.can_inject(user, 1)) + to_chat(user, "You stab [M] with the pen.") + if(!stealth) + to_chat(M, "You feel a tiny prick!") + . = 1 + + log_combat(user, M, "stabbed", src) + + else + . = ..() + +/obj/item/pen/afterattack(obj/O, mob/living/user, proximity) + . = ..() + //Changing Name/Description of items. Only works if they have the 'unique_rename' flag set + if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME)) + var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description") + if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) + return + if(penchoice == "Rename") + var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN) + var/oldname = O.name + if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) + return + if(oldname == input) + to_chat(user, "You changed \the [O.name] to... well... \the [O.name].") + else + O.name = input + to_chat(user, "\The [oldname] has been successfully been renamed to \the [input].") + O.renamedByPlayer = TRUE + + if(penchoice == "Change description") + var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100) + if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE)) + return + O.desc = input + to_chat(user, "You have successfully changed \the [O.name]'s description.") + +/* + * Sleepypens + */ + +/obj/item/pen/sleepy/attack(mob/living/M, mob/user) + if(!istype(M)) + return + + if(..()) + if(reagents.total_volume) + if(M.reagents) + reagents.reaction(M, INJECT) + reagents.trans_to(M, reagents.total_volume) + + +/obj/item/pen/sleepy/Initialize() + . = ..() + create_reagents(45, OPENCONTAINER) + reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 20) + reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 15) + reagents.add_reagent(/datum/reagent/toxin/staminatoxin, 10) + +/* + * (Alan) Edaggers + */ +/obj/item/pen/edagger + attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off + var/on = FALSE + +/obj/item/pen/edagger/Initialize() + . = ..() + AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg', TRUE) + +/obj/item/pen/edagger/attack_self(mob/living/user) + if(on) + on = FALSE + force = initial(force) + w_class = initial(w_class) + name = initial(name) + hitsound = initial(hitsound) + embedding = embedding.setRating(embed_chance = EMBED_CHANCE) + throwforce = initial(throwforce) + playsound(user, 'sound/weapons/saberoff.ogg', 5, 1) + to_chat(user, "[src] can now be concealed.") + else + on = TRUE + force = 18 + w_class = WEIGHT_CLASS_NORMAL + name = "energy dagger" + hitsound = 'sound/weapons/blade1.ogg' + embedding = embedding.setRating(embed_chance = 100) //rule of cool + throwforce = 35 + playsound(user, 'sound/weapons/saberon.ogg', 5, 1) + to_chat(user, "[src] is now active.") + var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering) + butchering.butchering_enabled = on + update_icon() + +/obj/item/pen/edagger/update_icon() + if(on) + icon_state = "edagger" + item_state = "edagger" + lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' + else + icon_state = initial(icon_state) //looks like a normal pen when off. + item_state = initial(item_state) + lefthand_file = initial(lefthand_file) + righthand_file = initial(righthand_file) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 5f23f72b..e8d31869 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -1,340 +1,340 @@ -/* Photocopiers! - * Contains: - * Photocopier - * Toner Cartridge - */ - -/* - * Photocopier - */ -/obj/machinery/photocopier - name = "photocopier" - desc = "Used to copy important documents and anatomy studies." - icon = 'icons/obj/library.dmi' - icon_state = "photocopier" - density = TRUE - use_power = IDLE_POWER_USE - idle_power_usage = 30 - active_power_usage = 200 - power_channel = EQUIP - max_integrity = 300 - integrity_failure = 100 - var/obj/item/paper/copy = null //what's in the copier! - var/obj/item/photo/photocopy = null - var/obj/item/documents/doccopy = null - var/copies = 1 //how many copies to print! - var/toner = 40 //how much toner is left! woooooo~ - var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier! - var/greytoggle = "Greyscale" - var/mob/living/ass //i can't believe i didn't write a stupid-ass comment about this var when i first coded asscopy. - var/busy = FALSE - -/obj/machinery/photocopier/ui_interact(mob/user) - . = ..() - var/dat = "Photocopier

    " - if(copy || photocopy || doccopy || (ass && (ass.loc == src.loc))) - dat += "Remove Paper
    " - if(toner) - dat += "Copy
    " - dat += "Printing: [copies] copies." - dat += "- " - dat += "+

    " - if(photocopy) - dat += "Printing in [greytoggle]

    " - else if(toner) - dat += "Please insert paper to copy.

    " - if(isAI(user)) - dat += "Print photo from database

    " - dat += "Current toner level: [toner]" - if(!toner) - dat +="
    Please insert a new toner cartridge!" - user << browse(dat, "window=copier") - onclose(user, "copier") - -/obj/machinery/photocopier/Topic(href, href_list) - if(..()) - return - if(href_list["copy"]) - if(copy) - for(var/i = 0, i < copies, i++) - if(toner > 0 && !busy && copy) - var/copy_as_paper = 1 - if(istype(copy, /obj/item/paper/contract/employment)) - var/obj/item/paper/contract/employment/E = copy - var/obj/item/paper/contract/employment/C = new /obj/item/paper/contract/employment (loc, E.target.current) - if(C) - copy_as_paper = 0 - if(copy_as_paper) - var/obj/item/paper/c = new /obj/item/paper (loc) - if(length(copy.info) > 0) //Only print and add content if the copied doc has words on it - if(toner > 10) //lots of toner, make it dark - c.info = "" - else //no toner? shitty copies for you! - c.info = "" - var/copied = copy.info - copied = replacetext(copied, "" - c.name = copy.name - c.fields = copy.fields - c.update_icon() - c.updateinfolinks() - c.stamps = copy.stamps - if(copy.stamped) - c.stamped = copy.stamped.Copy() - c.copy_overlays(copy, TRUE) - toner-- - busy = TRUE - sleep(15) - busy = FALSE - else - break - updateUsrDialog() - else if(photocopy) - for(var/i = 0, i < copies, i++) - if(toner >= 5 && !busy && photocopy) //Was set to = 0, but if there was say 3 toner left and this ran, you would get -2 which would be weird for ink - new /obj/item/photo (loc, photocopy.picture.Copy(greytoggle == "Greyscale"? TRUE : FALSE)) - busy = TRUE - sleep(15) - busy = FALSE - else - break - else if(doccopy) - for(var/i = 0, i < copies, i++) - if(toner > 5 && !busy && doccopy) - new /obj/item/documents/photocopy(loc, doccopy) - toner-= 6 // the sprite shows 6 papers, yes I checked - busy = TRUE - sleep(15) - busy = FALSE - else - break - updateUsrDialog() - else if(ass) //ASS COPY. By Miauw - for(var/i = 0, i < copies, i++) - var/icon/temp_img - if(ishuman(ass) && (ass.get_item_by_slot(SLOT_W_UNIFORM) || ass.get_item_by_slot(SLOT_WEAR_SUIT))) - to_chat(usr, "You feel kind of silly, copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "[ass.p_their()]"] clothes on." ) - break - else if(toner >= 5 && !busy && check_ass()) //You have to be sitting on the copier and either be a xeno or a human without clothes on. - if(isalienadult(ass) || istype(ass, /mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro. - temp_img = icon('icons/ass/assalien.png') - else if(ishuman(ass)) //Suit checks are in check_ass - if(ass.gender == MALE) - temp_img = icon('icons/ass/assmale.png') - else if(ass.gender == FEMALE) - temp_img = icon('icons/ass/assfemale.png') - else //In case anyone ever makes the generic ass. For now I'll be using male asses. - temp_img = icon('icons/ass/assmale.png') - else if(isdrone(ass)) //Drones are hot - temp_img = icon('icons/ass/assdrone.png') - else - break - var/obj/item/photo/p = new /obj/item/photo (loc) - p.pixel_x = rand(-10, 10) - p.pixel_y = rand(-10, 10) - p.picture = new(null, "You see [ass]'s ass on the photo.", temp_img) - p.picture.psize_x = 128 - p.picture.psize_y = 128 - p.update_icon() - toner -= 5 - busy = TRUE - sleep(15) - busy = FALSE - else - break - updateUsrDialog() - else if(href_list["remove"]) - if(copy) - remove_photocopy(copy, usr) - copy = null - else if(photocopy) - remove_photocopy(photocopy, usr) - photocopy = null - else if(doccopy) - remove_photocopy(doccopy, usr) - doccopy = null - else if(check_ass()) - to_chat(ass, "You feel a slight pressure on your ass.") - updateUsrDialog() - else if(href_list["min"]) - if(copies > 1) - copies-- - updateUsrDialog() - else if(href_list["add"]) - if(copies < maxcopies) - copies++ - updateUsrDialog() - else if(href_list["aipic"]) - if(!isAI(usr)) - return - if(toner >= 5 && !busy) - var/mob/living/silicon/ai/tempAI = usr - if(tempAI.aicamera.stored.len == 0) - to_chat(usr, "No images saved") - return - var/datum/picture/selection = tempAI.aicamera.selectpicture(usr) - var/obj/item/photo/photo = new(loc, selection) - photo.pixel_x = rand(-10, 10) - photo.pixel_y = rand(-10, 10) - toner -= 5 //AI prints color pictures only, thus they can do it more efficiently - busy = TRUE - sleep(15) - busy = FALSE - updateUsrDialog() - else if(href_list["colortoggle"]) - if(greytoggle == "Greyscale") - greytoggle = "Color" - else - greytoggle = "Greyscale" - updateUsrDialog() - -/obj/machinery/photocopier/proc/do_insertion(obj/item/O, mob/user) - O.forceMove(src) - to_chat(user, "You insert [O] into [src].") - flick("photocopier1", src) - updateUsrDialog() - -/obj/machinery/photocopier/proc/remove_photocopy(obj/item/O, mob/user) - if(!issilicon(user)) //surprised this check didn't exist before, putting stuff in AI's hand is bad - O.forceMove(user.loc) - user.put_in_hands(O) - else - O.forceMove(drop_location()) - to_chat(user, "You take [O] out of [src].") - -/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params) - if(default_unfasten_wrench(user, O)) - return - - else if(istype(O, /obj/item/paper)) - if(copier_empty()) - if(istype(O, /obj/item/paper/contract/infernal)) - to_chat(user, "[src] smokes, smelling of brimstone!") - resistance_flags |= FLAMMABLE - fire_act() - else - if(!user.temporarilyRemoveItemFromInventory(O)) - return - copy = O - do_insertion(O, user) - else - to_chat(user, "There is already something in [src]!") - - else if(istype(O, /obj/item/photo)) - if(copier_empty()) - if(!user.temporarilyRemoveItemFromInventory(O)) - return - photocopy = O - do_insertion(O, user) - else - to_chat(user, "There is already something in [src]!") - - else if(istype(O, /obj/item/documents)) - if(copier_empty()) - if(!user.temporarilyRemoveItemFromInventory(O)) - return - doccopy = O - do_insertion(O, user) - else - to_chat(user, "There is already something in [src]!") - - else if(istype(O, /obj/item/toner)) - if(toner <= 0) - if(!user.temporarilyRemoveItemFromInventory(O)) - return - qdel(O) - toner = 40 - to_chat(user, "You insert [O] into [src].") - updateUsrDialog() - else - to_chat(user, "This cartridge is not yet ready for replacement! Use up the rest of the toner.") - - else if(istype(O, /obj/item/areaeditor/blueprints)) - to_chat(user, "The Blueprint is too large to put into the copier. You need to find something else to record the document") - else - return ..() - -/obj/machinery/photocopier/obj_break(damage_flag) - if(!(flags_1 & NODECONSTRUCT_1)) - if(toner > 0) - new /obj/effect/decal/cleanable/oil(get_turf(src)) - toner = 0 - -/obj/machinery/photocopier/MouseDrop_T(mob/target, mob/user) - check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off. - if (!istype(target) || target.anchored || target.buckled || !Adjacent(target) || !user.canUseTopic(src, BE_CLOSE) || target == ass || copier_blocked()) - return - src.add_fingerprint(user) - if(target == user) - user.visible_message("[user] starts climbing onto the photocopier!", "You start climbing onto the photocopier...") - else - user.visible_message("[user] starts putting [target] onto the photocopier!", "You start putting [target] onto the photocopier...") - - if(do_after(user, 20, target = src)) - if(!target || QDELETED(target) || QDELETED(src) || !Adjacent(target)) //check if the photocopier/target still exists. - return - - if(target == user) - user.visible_message("[user] climbs onto the photocopier!", "You climb onto the photocopier.") - else - user.visible_message("[user] puts [target] onto the photocopier!", "You put [target] onto the photocopier.") - - target.forceMove(drop_location()) - ass = target - - if(photocopy) - photocopy.forceMove(drop_location()) - visible_message("[photocopy] is shoved out of the way by [ass]!") - photocopy = null - - else if(copy) - copy.forceMove(drop_location()) - visible_message("[copy] is shoved out of the way by [ass]!") - copy = null - updateUsrDialog() - -/obj/machinery/photocopier/proc/check_ass() //I'm not sure wether I made this proc because it's good form or because of the name. - if(!ass) - return 0 - if(ass.loc != src.loc) - ass = null - updateUsrDialog() - return 0 - else if(ishuman(ass)) - if(!ass.get_item_by_slot(SLOT_W_UNIFORM) && !ass.get_item_by_slot(SLOT_WEAR_SUIT)) - return 1 - else - return 0 - else - return 1 - -/obj/machinery/photocopier/proc/copier_blocked() - if(QDELETED(src)) - return - if(loc.density) - return 1 - for(var/atom/movable/AM in loc) - if(AM == src) - continue - if(AM.density) - return 1 - return 0 - -/obj/machinery/photocopier/proc/copier_empty() - if(copy || photocopy || check_ass()) - return 0 - else - return 1 - -/* - * Toner cartridge - */ -/obj/item/toner - name = "toner cartridge" - icon = 'icons/obj/device.dmi' - icon_state = "tonercartridge" - grind_results = list("iodine" = 40, "iron" = 10) - var/charges = 5 - var/max_charges = 5 +/* Photocopiers! + * Contains: + * Photocopier + * Toner Cartridge + */ + +/* + * Photocopier + */ +/obj/machinery/photocopier + name = "photocopier" + desc = "Used to copy important documents and anatomy studies." + icon = 'icons/obj/library.dmi' + icon_state = "photocopier" + density = TRUE + use_power = IDLE_POWER_USE + idle_power_usage = 30 + active_power_usage = 200 + power_channel = EQUIP + max_integrity = 300 + integrity_failure = 100 + var/obj/item/paper/copy = null //what's in the copier! + var/obj/item/photo/photocopy = null + var/obj/item/documents/doccopy = null + var/copies = 1 //how many copies to print! + var/toner = 40 //how much toner is left! woooooo~ + var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier! + var/greytoggle = "Greyscale" + var/mob/living/ass //i can't believe i didn't write a stupid-ass comment about this var when i first coded asscopy. + var/busy = FALSE + +/obj/machinery/photocopier/ui_interact(mob/user) + . = ..() + var/dat = "Photocopier

    " + if(copy || photocopy || doccopy || (ass && (ass.loc == src.loc))) + dat += "Remove Paper
    " + if(toner) + dat += "Copy
    " + dat += "Printing: [copies] copies." + dat += "- " + dat += "+

    " + if(photocopy) + dat += "Printing in [greytoggle]

    " + else if(toner) + dat += "Please insert paper to copy.

    " + if(isAI(user)) + dat += "Print photo from database

    " + dat += "Current toner level: [toner]" + if(!toner) + dat +="
    Please insert a new toner cartridge!" + user << browse(dat, "window=copier") + onclose(user, "copier") + +/obj/machinery/photocopier/Topic(href, href_list) + if(..()) + return + if(href_list["copy"]) + if(copy) + for(var/i = 0, i < copies, i++) + if(toner > 0 && !busy && copy) + var/copy_as_paper = 1 + if(istype(copy, /obj/item/paper/contract/employment)) + var/obj/item/paper/contract/employment/E = copy + var/obj/item/paper/contract/employment/C = new /obj/item/paper/contract/employment (loc, E.target.current) + if(C) + copy_as_paper = 0 + if(copy_as_paper) + var/obj/item/paper/c = new /obj/item/paper (loc) + if(length(copy.info) > 0) //Only print and add content if the copied doc has words on it + if(toner > 10) //lots of toner, make it dark + c.info = "" + else //no toner? shitty copies for you! + c.info = "" + var/copied = copy.info + copied = replacetext(copied, "" + c.name = copy.name + c.fields = copy.fields + c.update_icon() + c.updateinfolinks() + c.stamps = copy.stamps + if(copy.stamped) + c.stamped = copy.stamped.Copy() + c.copy_overlays(copy, TRUE) + toner-- + busy = TRUE + sleep(15) + busy = FALSE + else + break + updateUsrDialog() + else if(photocopy) + for(var/i = 0, i < copies, i++) + if(toner >= 5 && !busy && photocopy) //Was set to = 0, but if there was say 3 toner left and this ran, you would get -2 which would be weird for ink + new /obj/item/photo (loc, photocopy.picture.Copy(greytoggle == "Greyscale"? TRUE : FALSE)) + busy = TRUE + sleep(15) + busy = FALSE + else + break + else if(doccopy) + for(var/i = 0, i < copies, i++) + if(toner > 5 && !busy && doccopy) + new /obj/item/documents/photocopy(loc, doccopy) + toner-= 6 // the sprite shows 6 papers, yes I checked + busy = TRUE + sleep(15) + busy = FALSE + else + break + updateUsrDialog() + else if(ass) //ASS COPY. By Miauw + for(var/i = 0, i < copies, i++) + var/icon/temp_img + if(ishuman(ass) && (ass.get_item_by_slot(SLOT_W_UNIFORM) || ass.get_item_by_slot(SLOT_WEAR_SUIT))) + to_chat(usr, "You feel kind of silly, copying [ass == usr ? "your" : ass][ass == usr ? "" : "\'s"] ass with [ass == usr ? "your" : "[ass.p_their()]"] clothes on." ) + break + else if(toner >= 5 && !busy && check_ass()) //You have to be sitting on the copier and either be a xeno or a human without clothes on. + if(isalienadult(ass) || istype(ass, /mob/living/simple_animal/hostile/alien)) //Xenos have their own asses, thanks to Pybro. + temp_img = icon('icons/ass/assalien.png') + else if(ishuman(ass)) //Suit checks are in check_ass + if(ass.gender == MALE) + temp_img = icon('icons/ass/assmale.png') + else if(ass.gender == FEMALE) + temp_img = icon('icons/ass/assfemale.png') + else //In case anyone ever makes the generic ass. For now I'll be using male asses. + temp_img = icon('icons/ass/assmale.png') + else if(isdrone(ass)) //Drones are hot + temp_img = icon('icons/ass/assdrone.png') + else + break + var/obj/item/photo/p = new /obj/item/photo (loc) + p.pixel_x = rand(-10, 10) + p.pixel_y = rand(-10, 10) + p.picture = new(null, "You see [ass]'s ass on the photo.", temp_img) + p.picture.psize_x = 128 + p.picture.psize_y = 128 + p.update_icon() + toner -= 5 + busy = TRUE + sleep(15) + busy = FALSE + else + break + updateUsrDialog() + else if(href_list["remove"]) + if(copy) + remove_photocopy(copy, usr) + copy = null + else if(photocopy) + remove_photocopy(photocopy, usr) + photocopy = null + else if(doccopy) + remove_photocopy(doccopy, usr) + doccopy = null + else if(check_ass()) + to_chat(ass, "You feel a slight pressure on your ass.") + updateUsrDialog() + else if(href_list["min"]) + if(copies > 1) + copies-- + updateUsrDialog() + else if(href_list["add"]) + if(copies < maxcopies) + copies++ + updateUsrDialog() + else if(href_list["aipic"]) + if(!isAI(usr)) + return + if(toner >= 5 && !busy) + var/mob/living/silicon/ai/tempAI = usr + if(tempAI.aicamera.stored.len == 0) + to_chat(usr, "No images saved") + return + var/datum/picture/selection = tempAI.aicamera.selectpicture(usr) + var/obj/item/photo/photo = new(loc, selection) + photo.pixel_x = rand(-10, 10) + photo.pixel_y = rand(-10, 10) + toner -= 5 //AI prints color pictures only, thus they can do it more efficiently + busy = TRUE + sleep(15) + busy = FALSE + updateUsrDialog() + else if(href_list["colortoggle"]) + if(greytoggle == "Greyscale") + greytoggle = "Color" + else + greytoggle = "Greyscale" + updateUsrDialog() + +/obj/machinery/photocopier/proc/do_insertion(obj/item/O, mob/user) + O.forceMove(src) + to_chat(user, "You insert [O] into [src].") + flick("photocopier1", src) + updateUsrDialog() + +/obj/machinery/photocopier/proc/remove_photocopy(obj/item/O, mob/user) + if(!issilicon(user)) //surprised this check didn't exist before, putting stuff in AI's hand is bad + O.forceMove(user.loc) + user.put_in_hands(O) + else + O.forceMove(drop_location()) + to_chat(user, "You take [O] out of [src].") + +/obj/machinery/photocopier/attackby(obj/item/O, mob/user, params) + if(default_unfasten_wrench(user, O)) + return + + else if(istype(O, /obj/item/paper)) + if(copier_empty()) + if(istype(O, /obj/item/paper/contract/infernal)) + to_chat(user, "[src] smokes, smelling of brimstone!") + resistance_flags |= FLAMMABLE + fire_act() + else + if(!user.temporarilyRemoveItemFromInventory(O)) + return + copy = O + do_insertion(O, user) + else + to_chat(user, "There is already something in [src]!") + + else if(istype(O, /obj/item/photo)) + if(copier_empty()) + if(!user.temporarilyRemoveItemFromInventory(O)) + return + photocopy = O + do_insertion(O, user) + else + to_chat(user, "There is already something in [src]!") + + else if(istype(O, /obj/item/documents)) + if(copier_empty()) + if(!user.temporarilyRemoveItemFromInventory(O)) + return + doccopy = O + do_insertion(O, user) + else + to_chat(user, "There is already something in [src]!") + + else if(istype(O, /obj/item/toner)) + if(toner <= 0) + if(!user.temporarilyRemoveItemFromInventory(O)) + return + qdel(O) + toner = 40 + to_chat(user, "You insert [O] into [src].") + updateUsrDialog() + else + to_chat(user, "This cartridge is not yet ready for replacement! Use up the rest of the toner.") + + else if(istype(O, /obj/item/areaeditor/blueprints)) + to_chat(user, "The Blueprint is too large to put into the copier. You need to find something else to record the document") + else + return ..() + +/obj/machinery/photocopier/obj_break(damage_flag) + if(!(flags_1 & NODECONSTRUCT_1)) + if(toner > 0) + new /obj/effect/decal/cleanable/oil(get_turf(src)) + toner = 0 + +/obj/machinery/photocopier/MouseDrop_T(mob/target, mob/user) + check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off. + if (!istype(target) || target.anchored || target.buckled || !Adjacent(target) || !user.canUseTopic(src, BE_CLOSE) || target == ass || copier_blocked()) + return + src.add_fingerprint(user) + if(target == user) + user.visible_message("[user] starts climbing onto the photocopier!", "You start climbing onto the photocopier...") + else + user.visible_message("[user] starts putting [target] onto the photocopier!", "You start putting [target] onto the photocopier...") + + if(do_after(user, 20, target = src)) + if(!target || QDELETED(target) || QDELETED(src) || !Adjacent(target)) //check if the photocopier/target still exists. + return + + if(target == user) + user.visible_message("[user] climbs onto the photocopier!", "You climb onto the photocopier.") + else + user.visible_message("[user] puts [target] onto the photocopier!", "You put [target] onto the photocopier.") + + target.forceMove(drop_location()) + ass = target + + if(photocopy) + photocopy.forceMove(drop_location()) + visible_message("[photocopy] is shoved out of the way by [ass]!") + photocopy = null + + else if(copy) + copy.forceMove(drop_location()) + visible_message("[copy] is shoved out of the way by [ass]!") + copy = null + updateUsrDialog() + +/obj/machinery/photocopier/proc/check_ass() //I'm not sure wether I made this proc because it's good form or because of the name. + if(!ass) + return 0 + if(ass.loc != src.loc) + ass = null + updateUsrDialog() + return 0 + else if(ishuman(ass)) + if(!ass.get_item_by_slot(SLOT_W_UNIFORM) && !ass.get_item_by_slot(SLOT_WEAR_SUIT)) + return 1 + else + return 0 + else + return 1 + +/obj/machinery/photocopier/proc/copier_blocked() + if(QDELETED(src)) + return + if(loc.density) + return 1 + for(var/atom/movable/AM in loc) + if(AM == src) + continue + if(AM.density) + return 1 + return 0 + +/obj/machinery/photocopier/proc/copier_empty() + if(copy || photocopy || check_ass()) + return 0 + else + return 1 + +/* + * Toner cartridge + */ +/obj/item/toner + name = "toner cartridge" + icon = 'icons/obj/device.dmi' + icon_state = "tonercartridge" + grind_results = list(/datum/reagent/iodine = 40, /datum/reagent/iron = 10) + var/charges = 5 + var/max_charges = 5 diff --git a/code/modules/photography/photos/photo.dm b/code/modules/photography/photos/photo.dm index a061a270..08ac3015 100644 --- a/code/modules/photography/photos/photo.dm +++ b/code/modules/photography/photos/photo.dm @@ -1,93 +1,93 @@ -/* - * Photo - */ -/obj/item/photo - name = "photo" - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "photo" - item_state = "paper" - w_class = WEIGHT_CLASS_TINY - resistance_flags = FLAMMABLE - max_integrity = 50 - grind_results = list("iodine" = 4) - var/datum/picture/picture - var/scribble //Scribble on the back. - -/obj/item/photo/Initialize(mapload, datum/picture/P, datum_name = TRUE, datum_desc = TRUE) - set_picture(P, datum_name, datum_desc, TRUE) - return ..() - -/obj/item/photo/proc/set_picture(datum/picture/P, setname, setdesc, name_override = FALSE) - if(!istype(P)) - return - picture = P - update_icon() - if(P.caption) - scribble = P.caption - if(setname && P.picture_name) - if(name_override) - name = P.picture_name - else - name = "photo - [P.picture_name]" - if(setdesc && P.picture_desc) - desc = P.picture_desc - -/obj/item/photo/update_icon() - if(!istype(picture) || !picture.picture_image) - return - var/icon/I = picture.get_small_icon() - if(I) - icon = I - -/obj/item/photo/suicide_act(mob/living/carbon/user) - user.visible_message("[user] is taking one last look at \the [src]! It looks like [user.p_theyre()] giving in to death!")//when you wanna look at photo of waifu one last time before you die... - if (user.gender == MALE) - playsound(user, 'sound/voice/human/manlaugh1.ogg', 50, 1)//EVERY TIME I DO IT MAKES ME LAUGH - else if (user.gender == FEMALE) - playsound(user, 'sound/voice/human/womanlaugh.ogg', 50, 1) - return OXYLOSS - -/obj/item/photo/attack_self(mob/user) - user.examinate(src) - -/obj/item/photo/attackby(obj/item/P, mob/user, params) - if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon)) - if(!user.is_literate()) - to_chat(user, "You scribble illegibly on [src]!") - return - var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text) - txt = copytext(txt, 1, 128) - if(user.canUseTopic(src, BE_CLOSE)) - scribble = txt - ..() - -/obj/item/photo/examine(mob/user) - . = ..() - - if(in_range(src, user)) - show(user) - else - . += "You need to get closer to get a good look at this photo!" - -/obj/item/photo/proc/show(mob/user) - if(!istype(picture) || !picture.picture_image) - to_chat(user, "[src] seems to be blank...") - return - user << browse_rsc(picture.picture_image, "tmp_photo.png") - user << browse("[name]" \ - + "" \ - + "" \ - + "[scribble ? "
    Written on the back:
    [scribble]" : ""]"\ - + "", "window=photo_showing;size=480x608") - onclose(user, "[name]") - -/obj/item/photo/verb/rename() - set name = "Rename photo" - set category = "Object" - set src in usr - - var/n_name = copytext(sanitize(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text), 1, MAX_NAME_LEN) - //loc.loc check is for making possible renaming photos in clipboards - if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && usr.canmove && !usr.restrained()) - name = "photo[(n_name ? text("- '[n_name]'") : null)]" - add_fingerprint(usr) +/* + * Photo + */ +/obj/item/photo + name = "photo" + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "photo" + item_state = "paper" + w_class = WEIGHT_CLASS_TINY + resistance_flags = FLAMMABLE + max_integrity = 50 + grind_results = list(/datum/reagent/iodine = 4) + var/datum/picture/picture + var/scribble //Scribble on the back. + +/obj/item/photo/Initialize(mapload, datum/picture/P, datum_name = TRUE, datum_desc = TRUE) + set_picture(P, datum_name, datum_desc, TRUE) + return ..() + +/obj/item/photo/proc/set_picture(datum/picture/P, setname, setdesc, name_override = FALSE) + if(!istype(P)) + return + picture = P + update_icon() + if(P.caption) + scribble = P.caption + if(setname && P.picture_name) + if(name_override) + name = P.picture_name + else + name = "photo - [P.picture_name]" + if(setdesc && P.picture_desc) + desc = P.picture_desc + +/obj/item/photo/update_icon() + if(!istype(picture) || !picture.picture_image) + return + var/icon/I = picture.get_small_icon() + if(I) + icon = I + +/obj/item/photo/suicide_act(mob/living/carbon/user) + user.visible_message("[user] is taking one last look at \the [src]! It looks like [user.p_theyre()] giving in to death!")//when you wanna look at photo of waifu one last time before you die... + if (user.gender == MALE) + playsound(user, 'sound/voice/human/manlaugh1.ogg', 50, 1)//EVERY TIME I DO IT MAKES ME LAUGH + else if (user.gender == FEMALE) + playsound(user, 'sound/voice/human/womanlaugh.ogg', 50, 1) + return OXYLOSS + +/obj/item/photo/attack_self(mob/user) + user.examinate(src) + +/obj/item/photo/attackby(obj/item/P, mob/user, params) + if(istype(P, /obj/item/pen) || istype(P, /obj/item/toy/crayon)) + if(!user.is_literate()) + to_chat(user, "You scribble illegibly on [src]!") + return + var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text) + txt = copytext(txt, 1, 128) + if(user.canUseTopic(src, BE_CLOSE)) + scribble = txt + ..() + +/obj/item/photo/examine(mob/user) + . = ..() + + if(in_range(src, user)) + show(user) + else + . += "You need to get closer to get a good look at this photo!" + +/obj/item/photo/proc/show(mob/user) + if(!istype(picture) || !picture.picture_image) + to_chat(user, "[src] seems to be blank...") + return + user << browse_rsc(picture.picture_image, "tmp_photo.png") + user << browse("[name]" \ + + "" \ + + "" \ + + "[scribble ? "
    Written on the back:
    [scribble]" : ""]"\ + + "", "window=photo_showing;size=480x608") + onclose(user, "[name]") + +/obj/item/photo/verb/rename() + set name = "Rename photo" + set category = "Object" + set src in usr + + var/n_name = copytext(sanitize(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text), 1, MAX_NAME_LEN) + //loc.loc check is for making possible renaming photos in clipboards + if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && usr.canmove && !usr.restrained()) + name = "photo[(n_name ? text("- '[n_name]'") : null)]" + add_fingerprint(usr) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 9f9a0dd5..d4ca9a16 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -1,851 +1,851 @@ -GLOBAL_LIST_INIT(cable_colors, list( - "yellow" = "#ffff00", - "green" = "#00aa00", - "blue" = "#1919c8", - "pink" = "#ff3cc8", - "orange" = "#ff8000", - "cyan" = "#00ffff", - "white" = "#ffffff", - "red" = "#ff0000" - )) - -/////////////////////////////// -//CABLE STRUCTURE -/////////////////////////////// - - -//////////////////////////////// -// Definitions -//////////////////////////////// - -/* Cable directions (d1 and d2) - - - 9 1 5 - \ | / - 8 - 0 - 4 - / | \ - 10 2 6 - -If d1 = 0 and d2 = 0, there's no cable -If d1 = 0 and d2 = dir, it's a O-X cable, getting from the center of the tile to dir (knot cable) -If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2 -By design, d1 is the smallest direction and d2 is the highest -*/ - -/obj/structure/cable - name = "power cable" - desc = "A flexible, superconducting insulated cable for heavy-duty power transfer." - icon = 'icons/obj/power_cond/cables.dmi' - icon_state = "0-1" - level = 1 //is underfloor - layer = WIRE_LAYER //Above hidden pipes, GAS_PIPE_HIDDEN_LAYER - anchored = TRUE - obj_flags = CAN_BE_HIT | ON_BLUEPRINTS - var/d1 = 0 // cable direction 1 (see above) - var/d2 = 1 // cable direction 2 (see above) - var/datum/powernet/powernet - var/obj/item/stack/cable_coil/stored - - var/cable_color = "red" - color = "#ff0000" - -/obj/structure/cable/yellow - cable_color = "yellow" - color = "#ffff00" - -/obj/structure/cable/green - cable_color = "green" - color = "#00aa00" - -/obj/structure/cable/blue - cable_color = "blue" - color = "#1919c8" - -/obj/structure/cable/pink - cable_color = "pink" - color = "#ff3cc8" - -/obj/structure/cable/orange - cable_color = "orange" - color = "#ff8000" - -/obj/structure/cable/cyan - cable_color = "cyan" - color = "#00ffff" - -/obj/structure/cable/white - cable_color = "white" - color = "#ffffff" - -// the power cable object -/obj/structure/cable/Initialize(mapload, param_color) - . = ..() - - // ensure d1 & d2 reflect the icon_state for entering and exiting cable - var/dash = findtext(icon_state, "-") - d1 = text2num( copytext( icon_state, 1, dash ) ) - d2 = text2num( copytext( icon_state, dash+1 ) ) - - var/turf/T = get_turf(src) // hide if turf is not intact - if(level==1) - hide(T.intact) - GLOB.cable_list += src //add it to the global cable list - - if(d1) - stored = new/obj/item/stack/cable_coil(null,2,cable_color) - else - stored = new/obj/item/stack/cable_coil(null,1,cable_color) - - var/list/cable_colors = GLOB.cable_colors - cable_color = param_color || cable_color || pick(cable_colors) - if(cable_colors[cable_color]) - cable_color = cable_colors[cable_color] - update_icon() - -/obj/structure/cable/Destroy() // called when a cable is deleted - if(powernet) - cut_cable_from_powernet() // update the powernets - GLOB.cable_list -= src //remove it from global cable list - return ..() // then go ahead and delete the cable - -/obj/structure/cable/deconstruct(disassembled = TRUE) - if(!(flags_1 & NODECONSTRUCT_1)) - var/turf/T = loc - stored.forceMove(T) - qdel(src) - -/////////////////////////////////// -// General procedures -/////////////////////////////////// - -//If underfloor, hide the cable -/obj/structure/cable/hide(i) - - if(level == 1 && isturf(loc)) - invisibility = i ? INVISIBILITY_MAXIMUM : 0 - update_icon() - -/obj/structure/cable/update_icon() - icon_state = "[d1]-[d2]" - color = null - add_atom_colour(cable_color, FIXED_COLOUR_PRIORITY) - -/obj/structure/cable/proc/handlecable(obj/item/W, mob/user, params) - var/turf/T = get_turf(src) - if(T.intact) - return - if(istype(W, /obj/item/wirecutters)) - if (shock(user, 50)) - return - user.visible_message("[user] cuts the cable.", "You cut the cable.") - stored.add_fingerprint(user) - investigate_log("was cut by [key_name(usr)] in [AREACOORD(src)]", INVESTIGATE_WIRES) - deconstruct() - return - - else if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/coil = W - if (coil.get_amount() < 1) - to_chat(user, "Not enough cable!") - return - coil.cable_join(src, user) - - else if(istype(W, /obj/item/twohanded/rcl)) - var/obj/item/twohanded/rcl/R = W - if(R.loaded) - R.loaded.cable_join(src, user) - R.is_empty(user) - - else if(istype(W, /obj/item/multitool)) - if(powernet && (powernet.avail > 0)) // is it powered? - to_chat(user, "[DisplayPower(powernet.avail)] in power network.") - else - to_chat(user, "The cable is not powered.") - shock(user, 5, 0.2) - - src.add_fingerprint(user) - -// Items usable on a cable : -// - Wirecutters : cut it duh ! -// - Cable coil : merge cables -// - Multitool : get the power currently passing through the cable -// -/obj/structure/cable/attackby(obj/item/W, mob/user, params) - handlecable(W, user, params) - - -// shock the user with probability prb -/obj/structure/cable/proc/shock(mob/user, prb, siemens_coeff = 1) - if(!prob(prb)) - return 0 - if (electrocute_mob(user, powernet, src, siemens_coeff)) - do_sparks(5, TRUE, src) - return 1 - else - return 0 - -/obj/structure/cable/singularity_pull(S, current_size) - ..() - if(current_size >= STAGE_FIVE) - deconstruct() - -/obj/structure/cable/proc/update_stored(length = 1, colorC = "red") - stored.amount = length - stored.item_color = colorC - stored.update_icon() - -//////////////////////////////////////////// -// Power related -/////////////////////////////////////////// - -// All power generation handled in add_avail() -// Machines should use add_load(), surplus(), avail() -// Non-machines should use add_delayedload(), delayed_surplus(), newavail() - -/obj/structure/cable/proc/add_avail(amount) - if(powernet) - powernet.newavail += amount - -/obj/structure/cable/proc/add_load(amount) - if(powernet) - powernet.load += amount - -/obj/structure/cable/proc/surplus() - if(powernet) - return CLAMP(powernet.avail-powernet.load, 0, powernet.avail) - else - return 0 - -/obj/structure/cable/proc/avail() - if(powernet) - return powernet.avail - else - return 0 - -/obj/structure/cable/proc/add_delayedload(amount) - if(powernet) - powernet.delayedload += amount - -/obj/structure/cable/proc/delayed_surplus() - if(powernet) - return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail) - else - return 0 - -/obj/structure/cable/proc/newavail() - if(powernet) - return powernet.newavail - else - return 0 - -///////////////////////////////////////////////// -// Cable laying helpers -//////////////////////////////////////////////// - -//handles merging diagonally matching cables -//for info : direction^3 is flipping horizontally, direction^12 is flipping vertically -/obj/structure/cable/proc/mergeDiagonalsNetworks(direction) - - //search for and merge diagonally matching cables from the first direction component (north/south) - var/turf/T = get_step(src, direction&3)//go north/south - - for(var/obj/structure/cable/C in T) - - if(!C) - continue - - if(src == C) - continue - - if(C.d1 == (direction^3) || C.d2 == (direction^3)) //we've got a diagonally matching cable - if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables) - var/datum/powernet/newPN = new() - newPN.add_cable(C) - - if(powernet) //if we already have a powernet, then merge the two powernets - merge_powernets(powernet,C.powernet) - else - C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet - - //the same from the second direction component (east/west) - T = get_step(src, direction&12)//go east/west - - for(var/obj/structure/cable/C in T) - - if(!C) - continue - - if(src == C) - continue - if(C.d1 == (direction^12) || C.d2 == (direction^12)) //we've got a diagonally matching cable - if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables) - var/datum/powernet/newPN = new() - newPN.add_cable(C) - - if(powernet) //if we already have a powernet, then merge the two powernets - merge_powernets(powernet,C.powernet) - else - C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet - -// merge with the powernets of power objects in the given direction -/obj/structure/cable/proc/mergeConnectedNetworks(direction) - - var/fdir = (!direction)? 0 : turn(direction, 180) //flip the direction, to match with the source position on its turf - - if(!(d1 == direction || d2 == direction)) //if the cable is not pointed in this direction, do nothing - return - - var/turf/TB = get_step(src, direction) - - for(var/obj/structure/cable/C in TB) - - if(!C) - continue - - if(src == C) - continue - - if(C.d1 == fdir || C.d2 == fdir) //we've got a matching cable in the neighbor turf - if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables) - var/datum/powernet/newPN = new() - newPN.add_cable(C) - - if(powernet) //if we already have a powernet, then merge the two powernets - merge_powernets(powernet,C.powernet) - else - C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet - -// merge with the powernets of power objects in the source turf -/obj/structure/cable/proc/mergeConnectedNetworksOnTurf() - var/list/to_connect = list() - - if(!powernet) //if we somehow have no powernet, make one (should not happen for cables) - var/datum/powernet/newPN = new() - newPN.add_cable(src) - - //first let's add turf cables to our powernet - //then we'll connect machines on turf with a node cable is present - for(var/AM in loc) - if(istype(AM, /obj/structure/cable)) - var/obj/structure/cable/C = AM - if(C.d1 == d1 || C.d2 == d1 || C.d1 == d2 || C.d2 == d2) //only connected if they have a common direction - if(C.powernet == powernet) - continue - if(C.powernet) - merge_powernets(powernet, C.powernet) - else - powernet.add_cable(C) //the cable was powernetless, let's just add it to our powernet - - else if(istype(AM, /obj/machinery/power/apc)) - var/obj/machinery/power/apc/N = AM - if(!N.terminal) - continue // APC are connected through their terminal - - if(N.terminal.powernet == powernet) - continue - - to_connect += N.terminal //we'll connect the machines after all cables are merged - - else if(istype(AM, /obj/machinery/power)) //other power machines - var/obj/machinery/power/M = AM - - if(M.powernet == powernet) - continue - - to_connect += M //we'll connect the machines after all cables are merged - - //now that cables are done, let's connect found machines - for(var/obj/machinery/power/PM in to_connect) - if(!PM.connect_to_network()) - PM.disconnect_from_network() //if we somehow can't connect the machine to the new powernet, remove it from the old nonetheless - -////////////////////////////////////////////// -// Powernets handling helpers -////////////////////////////////////////////// - -//if powernetless_only = 1, will only get connections without powernet -/obj/structure/cable/proc/get_connections(powernetless_only = 0) - . = list() // this will be a list of all connected power objects - var/turf/T - - //get matching cables from the first direction - if(d1) //if not a node cable - T = get_step(src, d1) - if(T) - . += power_list(T, src, turn(d1, 180), powernetless_only) //get adjacents matching cables - - if(d1&(d1-1)) //diagonal direction, must check the 4 possibles adjacents tiles - T = get_step(src,d1&3) // go north/south - if(T) - . += power_list(T, src, d1 ^ 3, powernetless_only) //get diagonally matching cables - T = get_step(src,d1&12) // go east/west - if(T) - . += power_list(T, src, d1 ^ 12, powernetless_only) //get diagonally matching cables - - . += power_list(loc, src, d1, powernetless_only) //get on turf matching cables - - //do the same on the second direction (which can't be 0) - T = get_step(src, d2) - if(T) - . += power_list(T, src, turn(d2, 180), powernetless_only) //get adjacents matching cables - - if(d2&(d2-1)) //diagonal direction, must check the 4 possibles adjacents tiles - T = get_step(src,d2&3) // go north/south - if(T) - . += power_list(T, src, d2 ^ 3, powernetless_only) //get diagonally matching cables - T = get_step(src,d2&12) // go east/west - if(T) - . += power_list(T, src, d2 ^ 12, powernetless_only) //get diagonally matching cables - . += power_list(loc, src, d2, powernetless_only) //get on turf matching cables - - return . - -//should be called after placing a cable which extends another cable, creating a "smooth" cable that no longer terminates in the centre of a turf. -//needed as this can, unlike other placements, disconnect cables -/obj/structure/cable/proc/denode() - var/turf/T1 = loc - if(!T1) - return - - var/list/powerlist = power_list(T1,src,0,0) //find the other cables that ended in the centre of the turf, with or without a powernet - if(powerlist.len>0) - var/datum/powernet/PN = new() - propagate_network(powerlist[1],PN) //propagates the new powernet beginning at the source cable - - if(PN.is_empty()) //can happen with machines made nodeless when smoothing cables - qdel(PN) - -/obj/structure/cable/proc/auto_propogate_cut_cable(obj/O) - if(O && !QDELETED(O)) - var/datum/powernet/newPN = new()// creates a new powernet... - propagate_network(O, newPN)//... and propagates it to the other side of the cable - -// cut the cable's powernet at this cable and updates the powergrid -/obj/structure/cable/proc/cut_cable_from_powernet(remove=TRUE) - var/turf/T1 = loc - var/list/P_list - if(!T1) - return - if(d1) - T1 = get_step(T1, d1) - P_list = power_list(T1, src, turn(d1,180),0,cable_only = 1) // what adjacently joins on to cut cable... - - P_list += power_list(loc, src, d1, 0, cable_only = 1)//... and on turf - - - if(P_list.len == 0)//if nothing in both list, then the cable was a lone cable, just delete it and its powernet - powernet.remove_cable(src) - - for(var/obj/machinery/power/P in T1)//check if it was powering a machine - if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to - P.disconnect_from_network() //remove from current network (and delete powernet) - return - - var/obj/O = P_list[1] - // remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist - if(remove) - moveToNullspace() - powernet.remove_cable(src) //remove the cut cable from its powernet - - addtimer(CALLBACK(O, .proc/auto_propogate_cut_cable, O), 0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables - - // Disconnect machines connected to nodes - if(d1 == 0) // if we cut a node (O-X) cable - for(var/obj/machinery/power/P in T1) - if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to - P.disconnect_from_network() //remove from current network - - -/////////////////////////////////////////////// -// The cable coil object, used for laying cable -/////////////////////////////////////////////// - -//////////////////////////////// -// Definitions -//////////////////////////////// - -GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restraints", /obj/item/restraints/handcuffs/cable, 15))) - -/obj/item/stack/cable_coil - name = "cable coil" - gender = NEUTER //That's a cable coil sounds better than that's some cable coils - icon = 'icons/obj/power.dmi' - icon_state = "coil" - item_state = "coil" - lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - max_amount = MAXCOIL - amount = MAXCOIL - merge_type = /obj/item/stack/cable_coil // This is here to let its children merge between themselves - item_color = "red" - desc = "A coil of insulated power cable." - throwforce = 0 - w_class = WEIGHT_CLASS_SMALL - throw_speed = 3 - throw_range = 5 - materials = list(MAT_METAL=10, MAT_GLASS=5) - flags_1 = CONDUCT_1 - slot_flags = ITEM_SLOT_BELT - attack_verb = list("whipped", "lashed", "disciplined", "flogged") - singular_name = "cable piece" - full_w_class = WEIGHT_CLASS_SMALL - grind_results = list("copper" = 2) //2 copper per cable in the coil - usesound = 'sound/items/deconstruct.ogg' - -/obj/item/stack/cable_coil/cyborg - is_cyborg = 1 - materials = list() - cost = 1 - -/obj/item/stack/cable_coil/cyborg/attack_self(mob/user) - var/cable_color = input(user,"Pick a cable color.","Cable Color") in list("red","yellow","green","blue","pink","orange","cyan","white") - item_color = cable_color - update_icon() - -/obj/item/stack/cable_coil/suicide_act(mob/user) - if(locate(/obj/structure/chair/stool) in get_turf(user)) - user.visible_message("[user] is making a noose with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - else - user.visible_message("[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return(OXYLOSS) - -/obj/item/stack/cable_coil/Initialize(mapload, new_amount = null, param_color = null) - . = ..() - - var/list/cable_colors = GLOB.cable_colors - item_color = param_color || item_color || pick(cable_colors) - if(cable_colors[item_color]) - item_color = cable_colors[item_color] - - pixel_x = rand(-2,2) - pixel_y = rand(-2,2) - update_icon() - recipes = GLOB.cable_coil_recipes - -/////////////////////////////////// -// General procedures -/////////////////////////////////// - - -//you can use wires to heal robotics -/obj/item/stack/cable_coil/attack(mob/living/carbon/human/H, mob/user) - if(!istype(H)) - return ..() - - var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected)) - if(affecting && affecting.status == BODYPART_ROBOTIC) - if(user == H) - user.visible_message("[user] starts to fix some of the wires in [H]'s [affecting.name].", "You start fixing some of the wires in [H]'s [affecting.name].") - if(!do_mob(user, H, 50)) - return - if(item_heal_robotic(H, user, 0, 15)) - use(1) - return - else - return ..() - - -/obj/item/stack/cable_coil/update_icon() - icon_state = "[initial(item_state)][amount < 3 ? amount : ""]" - name = "cable [amount < 3 ? "piece" : "coil"]" - color = null - add_atom_colour(item_color, FIXED_COLOUR_PRIORITY) - -/obj/item/stack/cable_coil/attack_hand(mob/user) - . = ..() - if(.) - return - var/obj/item/stack/cable_coil/new_cable = ..() - if(istype(new_cable)) - new_cable.item_color = item_color - new_cable.update_icon() - -//add cables to the stack -/obj/item/stack/cable_coil/proc/give(extra) - if(amount + extra > max_amount) - amount = max_amount - else - amount += extra - update_icon() - - - -/////////////////////////////////////////////// -// Cable laying procedures -////////////////////////////////////////////// - -/obj/item/stack/cable_coil/proc/get_new_cable(location) - var/path = /obj/structure/cable - return new path(location, item_color) - -// called when cable_coil is clicked on a turf -/obj/item/stack/cable_coil/proc/place_turf(turf/T, mob/user, dirnew) - if(!isturf(user.loc)) - return - - if(!isturf(T) || T.intact || !T.can_have_cabling()) - to_chat(user, "You can only lay cables on catwalks and plating!") - return - - if(get_amount() < 1) // Out of cable - to_chat(user, "There is no cable left!") - return - - if(get_dist(T,user) > 1) // Too far - to_chat(user, "You can't lay cable at a place that far away!") - return - - var/dirn - if(!dirnew) //If we weren't given a direction, come up with one! (Called as null from catwalk.dm and floor.dm) - if(user.loc == T) - dirn = user.dir //If laying on the tile we're on, lay in the direction we're facing - else - dirn = get_dir(T, user) - else - dirn = dirnew - - for(var/obj/structure/cable/LC in T) - if(LC.d2 == dirn && LC.d1 == 0) - to_chat(user, "There's already a cable at that position!") - return - - var/obj/structure/cable/C = get_new_cable(T) - - //set up the new cable - C.d1 = 0 //it's a O-X node cable - C.d2 = dirn - C.add_fingerprint(user) - C.update_icon() - - //create a new powernet with the cable, if needed it will be merged later - var/datum/powernet/PN = new() - PN.add_cable(C) - - C.mergeConnectedNetworks(C.d2) //merge the powernet with adjacents powernets - C.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets - - if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions - C.mergeDiagonalsNetworks(C.d2) - - use(1) - - if(C.shock(user, 50)) - if(prob(50)) //fail - new /obj/item/stack/cable_coil(get_turf(C), 1, C.color) - C.deconstruct() - - return C - -// called when cable_coil is click on an installed obj/cable -// or click on a turf that already contains a "node" cable -/obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user, showerror = TRUE, forceddir) - var/turf/U = user.loc - if(!isturf(U)) - return - - var/turf/T = C.loc - - if(!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable - return - - if(get_dist(C, user) > 1) // make sure it's close enough - to_chat(user, "You can't lay cable at a place that far away!") - return - - - if(U == T && !forceddir) //if clicked on the turf we're standing on and a direction wasn't supplied, try to put a cable in the direction we're facing - place_turf(T,user) - return - - var/dirn = get_dir(C, user) - - // one end of the clicked cable is pointing towards us and no direction was supplied - if((C.d1 == dirn || C.d2 == dirn) && !forceddir) - if(!U.can_have_cabling()) //checking if it's a plating or catwalk - if (showerror) - to_chat(user, "You can only lay cables on catwalks and plating!") - return - if(U.intact) //can't place a cable if it's a plating with a tile on it - to_chat(user, "You can't lay cable there unless the floor tiles are removed!") - return - else - // cable is pointing at us, we're standing on an open tile - // so create a stub pointing at the clicked cable on our tile - - var/fdirn = turn(dirn, 180) // the opposite direction - - for(var/obj/structure/cable/LC in U) // check to make sure there's not a cable there already - if(LC.d1 == fdirn || LC.d2 == fdirn) - if (showerror) - to_chat(user, "There's already a cable at that position!") - return - - var/obj/structure/cable/NC = get_new_cable (U) - - NC.d1 = 0 - NC.d2 = fdirn - NC.add_fingerprint(user) - NC.update_icon() - - //create a new powernet with the cable, if needed it will be merged later - var/datum/powernet/newPN = new() - newPN.add_cable(NC) - - NC.mergeConnectedNetworks(NC.d2) //merge the powernet with adjacents powernets - NC.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets - - if(NC.d2 & (NC.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions - NC.mergeDiagonalsNetworks(NC.d2) - - use(1) - - if (NC.shock(user, 50)) - if (prob(50)) //fail - NC.deconstruct() - - return - - // exisiting cable doesn't point at our position or we have a supplied direction, so see if it's a stub - else if(C.d1 == 0) - // if so, make it a full cable pointing from it's old direction to our dirn - var/nd1 = C.d2 // these will be the new directions - var/nd2 = dirn - - - if(nd1 > nd2) // swap directions to match icons/states - nd1 = dirn - nd2 = C.d2 - - - for(var/obj/structure/cable/LC in T) // check to make sure there's no matching cable - if(LC == C) // skip the cable we're interacting with - continue - if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction - if (showerror) - to_chat(user, "There's already a cable at that position!") - - return - - - C.update_icon() - - C.d1 = nd1 - C.d2 = nd2 - - //updates the stored cable coil - C.update_stored(2, item_color) - - C.add_fingerprint(user) - C.update_icon() - - - C.mergeConnectedNetworks(C.d1) //merge the powernets... - C.mergeConnectedNetworks(C.d2) //...in the two new cable directions - C.mergeConnectedNetworksOnTurf() - - if(C.d1 & (C.d1 - 1))// if the cable is layed diagonally, check the others 2 possible directions - C.mergeDiagonalsNetworks(C.d1) - - if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions - C.mergeDiagonalsNetworks(C.d2) - - use(1) - - if (C.shock(user, 50)) - if (prob(50)) //fail - C.deconstruct() - return - - C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets. - return - -////////////////////////////// -// Misc. -///////////////////////////// - -/obj/item/stack/cable_coil/red - item_color = "red" - color = "#ff0000" - -/obj/item/stack/cable_coil/yellow - item_color = "yellow" - color = "#ffff00" - -/obj/item/stack/cable_coil/blue - item_color = "blue" - color = "#1919c8" - -/obj/item/stack/cable_coil/green - item_color = "green" - color = "#00aa00" - -/obj/item/stack/cable_coil/pink - item_color = "pink" - color = "#ff3ccd" - -/obj/item/stack/cable_coil/orange - item_color = "orange" - color = "#ff8000" - -/obj/item/stack/cable_coil/cyan - item_color = "cyan" - color = "#00ffff" - -/obj/item/stack/cable_coil/white - item_color = "white" - -/obj/item/stack/cable_coil/random - item_color = null - color = "#ffffff" - - -/obj/item/stack/cable_coil/random/five - amount = 5 - -/obj/item/stack/cable_coil/cut - amount = null - icon_state = "coil2" - -/obj/item/stack/cable_coil/cut/Initialize(mapload) - . = ..() - if(!amount) - amount = rand(1,2) - pixel_x = rand(-2,2) - pixel_y = rand(-2,2) - update_icon() - -/obj/item/stack/cable_coil/cut/red - item_color = "red" - color = "#ff0000" - -/obj/item/stack/cable_coil/cut/yellow - item_color = "yellow" - color = "#ffff00" - -/obj/item/stack/cable_coil/cut/blue - item_color = "blue" - color = "#1919c8" - -/obj/item/stack/cable_coil/cut/green - item_color = "green" - color = "#00aa00" - -/obj/item/stack/cable_coil/cut/pink - item_color = "pink" - color = "#ff3ccd" - -/obj/item/stack/cable_coil/cut/orange - item_color = "orange" - color = "#ff8000" - -/obj/item/stack/cable_coil/cut/cyan - item_color = "cyan" - color = "#00ffff" - -/obj/item/stack/cable_coil/cut/white - item_color = "white" - -/obj/item/stack/cable_coil/cut/random - item_color = null +GLOBAL_LIST_INIT(cable_colors, list( + "yellow" = "#ffff00", + "green" = "#00aa00", + "blue" = "#1919c8", + "pink" = "#ff3cc8", + "orange" = "#ff8000", + "cyan" = "#00ffff", + "white" = "#ffffff", + "red" = "#ff0000" + )) + +/////////////////////////////// +//CABLE STRUCTURE +/////////////////////////////// + + +//////////////////////////////// +// Definitions +//////////////////////////////// + +/* Cable directions (d1 and d2) + + + 9 1 5 + \ | / + 8 - 0 - 4 + / | \ + 10 2 6 + +If d1 = 0 and d2 = 0, there's no cable +If d1 = 0 and d2 = dir, it's a O-X cable, getting from the center of the tile to dir (knot cable) +If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2 +By design, d1 is the smallest direction and d2 is the highest +*/ + +/obj/structure/cable + name = "power cable" + desc = "A flexible, superconducting insulated cable for heavy-duty power transfer." + icon = 'icons/obj/power_cond/cables.dmi' + icon_state = "0-1" + level = 1 //is underfloor + layer = WIRE_LAYER //Above hidden pipes, GAS_PIPE_HIDDEN_LAYER + anchored = TRUE + obj_flags = CAN_BE_HIT | ON_BLUEPRINTS + var/d1 = 0 // cable direction 1 (see above) + var/d2 = 1 // cable direction 2 (see above) + var/datum/powernet/powernet + var/obj/item/stack/cable_coil/stored + + var/cable_color = "red" + color = "#ff0000" + +/obj/structure/cable/yellow + cable_color = "yellow" + color = "#ffff00" + +/obj/structure/cable/green + cable_color = "green" + color = "#00aa00" + +/obj/structure/cable/blue + cable_color = "blue" + color = "#1919c8" + +/obj/structure/cable/pink + cable_color = "pink" + color = "#ff3cc8" + +/obj/structure/cable/orange + cable_color = "orange" + color = "#ff8000" + +/obj/structure/cable/cyan + cable_color = "cyan" + color = "#00ffff" + +/obj/structure/cable/white + cable_color = "white" + color = "#ffffff" + +// the power cable object +/obj/structure/cable/Initialize(mapload, param_color) + . = ..() + + // ensure d1 & d2 reflect the icon_state for entering and exiting cable + var/dash = findtext(icon_state, "-") + d1 = text2num( copytext( icon_state, 1, dash ) ) + d2 = text2num( copytext( icon_state, dash+1 ) ) + + var/turf/T = get_turf(src) // hide if turf is not intact + if(level==1) + hide(T.intact) + GLOB.cable_list += src //add it to the global cable list + + if(d1) + stored = new/obj/item/stack/cable_coil(null,2,cable_color) + else + stored = new/obj/item/stack/cable_coil(null,1,cable_color) + + var/list/cable_colors = GLOB.cable_colors + cable_color = param_color || cable_color || pick(cable_colors) + if(cable_colors[cable_color]) + cable_color = cable_colors[cable_color] + update_icon() + +/obj/structure/cable/Destroy() // called when a cable is deleted + if(powernet) + cut_cable_from_powernet() // update the powernets + GLOB.cable_list -= src //remove it from global cable list + return ..() // then go ahead and delete the cable + +/obj/structure/cable/deconstruct(disassembled = TRUE) + if(!(flags_1 & NODECONSTRUCT_1)) + var/turf/T = loc + stored.forceMove(T) + qdel(src) + +/////////////////////////////////// +// General procedures +/////////////////////////////////// + +//If underfloor, hide the cable +/obj/structure/cable/hide(i) + + if(level == 1 && isturf(loc)) + invisibility = i ? INVISIBILITY_MAXIMUM : 0 + update_icon() + +/obj/structure/cable/update_icon() + icon_state = "[d1]-[d2]" + color = null + add_atom_colour(cable_color, FIXED_COLOUR_PRIORITY) + +/obj/structure/cable/proc/handlecable(obj/item/W, mob/user, params) + var/turf/T = get_turf(src) + if(T.intact) + return + if(istype(W, /obj/item/wirecutters)) + if (shock(user, 50)) + return + user.visible_message("[user] cuts the cable.", "You cut the cable.") + stored.add_fingerprint(user) + investigate_log("was cut by [key_name(usr)] in [AREACOORD(src)]", INVESTIGATE_WIRES) + deconstruct() + return + + else if(istype(W, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/coil = W + if (coil.get_amount() < 1) + to_chat(user, "Not enough cable!") + return + coil.cable_join(src, user) + + else if(istype(W, /obj/item/twohanded/rcl)) + var/obj/item/twohanded/rcl/R = W + if(R.loaded) + R.loaded.cable_join(src, user) + R.is_empty(user) + + else if(istype(W, /obj/item/multitool)) + if(powernet && (powernet.avail > 0)) // is it powered? + to_chat(user, "[DisplayPower(powernet.avail)] in power network.") + else + to_chat(user, "The cable is not powered.") + shock(user, 5, 0.2) + + src.add_fingerprint(user) + +// Items usable on a cable : +// - Wirecutters : cut it duh ! +// - Cable coil : merge cables +// - Multitool : get the power currently passing through the cable +// +/obj/structure/cable/attackby(obj/item/W, mob/user, params) + handlecable(W, user, params) + + +// shock the user with probability prb +/obj/structure/cable/proc/shock(mob/user, prb, siemens_coeff = 1) + if(!prob(prb)) + return 0 + if (electrocute_mob(user, powernet, src, siemens_coeff)) + do_sparks(5, TRUE, src) + return 1 + else + return 0 + +/obj/structure/cable/singularity_pull(S, current_size) + ..() + if(current_size >= STAGE_FIVE) + deconstruct() + +/obj/structure/cable/proc/update_stored(length = 1, colorC = "red") + stored.amount = length + stored.item_color = colorC + stored.update_icon() + +//////////////////////////////////////////// +// Power related +/////////////////////////////////////////// + +// All power generation handled in add_avail() +// Machines should use add_load(), surplus(), avail() +// Non-machines should use add_delayedload(), delayed_surplus(), newavail() + +/obj/structure/cable/proc/add_avail(amount) + if(powernet) + powernet.newavail += amount + +/obj/structure/cable/proc/add_load(amount) + if(powernet) + powernet.load += amount + +/obj/structure/cable/proc/surplus() + if(powernet) + return CLAMP(powernet.avail-powernet.load, 0, powernet.avail) + else + return 0 + +/obj/structure/cable/proc/avail() + if(powernet) + return powernet.avail + else + return 0 + +/obj/structure/cable/proc/add_delayedload(amount) + if(powernet) + powernet.delayedload += amount + +/obj/structure/cable/proc/delayed_surplus() + if(powernet) + return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail) + else + return 0 + +/obj/structure/cable/proc/newavail() + if(powernet) + return powernet.newavail + else + return 0 + +///////////////////////////////////////////////// +// Cable laying helpers +//////////////////////////////////////////////// + +//handles merging diagonally matching cables +//for info : direction^3 is flipping horizontally, direction^12 is flipping vertically +/obj/structure/cable/proc/mergeDiagonalsNetworks(direction) + + //search for and merge diagonally matching cables from the first direction component (north/south) + var/turf/T = get_step(src, direction&3)//go north/south + + for(var/obj/structure/cable/C in T) + + if(!C) + continue + + if(src == C) + continue + + if(C.d1 == (direction^3) || C.d2 == (direction^3)) //we've got a diagonally matching cable + if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables) + var/datum/powernet/newPN = new() + newPN.add_cable(C) + + if(powernet) //if we already have a powernet, then merge the two powernets + merge_powernets(powernet,C.powernet) + else + C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet + + //the same from the second direction component (east/west) + T = get_step(src, direction&12)//go east/west + + for(var/obj/structure/cable/C in T) + + if(!C) + continue + + if(src == C) + continue + if(C.d1 == (direction^12) || C.d2 == (direction^12)) //we've got a diagonally matching cable + if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables) + var/datum/powernet/newPN = new() + newPN.add_cable(C) + + if(powernet) //if we already have a powernet, then merge the two powernets + merge_powernets(powernet,C.powernet) + else + C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet + +// merge with the powernets of power objects in the given direction +/obj/structure/cable/proc/mergeConnectedNetworks(direction) + + var/fdir = (!direction)? 0 : turn(direction, 180) //flip the direction, to match with the source position on its turf + + if(!(d1 == direction || d2 == direction)) //if the cable is not pointed in this direction, do nothing + return + + var/turf/TB = get_step(src, direction) + + for(var/obj/structure/cable/C in TB) + + if(!C) + continue + + if(src == C) + continue + + if(C.d1 == fdir || C.d2 == fdir) //we've got a matching cable in the neighbor turf + if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables) + var/datum/powernet/newPN = new() + newPN.add_cable(C) + + if(powernet) //if we already have a powernet, then merge the two powernets + merge_powernets(powernet,C.powernet) + else + C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet + +// merge with the powernets of power objects in the source turf +/obj/structure/cable/proc/mergeConnectedNetworksOnTurf() + var/list/to_connect = list() + + if(!powernet) //if we somehow have no powernet, make one (should not happen for cables) + var/datum/powernet/newPN = new() + newPN.add_cable(src) + + //first let's add turf cables to our powernet + //then we'll connect machines on turf with a node cable is present + for(var/AM in loc) + if(istype(AM, /obj/structure/cable)) + var/obj/structure/cable/C = AM + if(C.d1 == d1 || C.d2 == d1 || C.d1 == d2 || C.d2 == d2) //only connected if they have a common direction + if(C.powernet == powernet) + continue + if(C.powernet) + merge_powernets(powernet, C.powernet) + else + powernet.add_cable(C) //the cable was powernetless, let's just add it to our powernet + + else if(istype(AM, /obj/machinery/power/apc)) + var/obj/machinery/power/apc/N = AM + if(!N.terminal) + continue // APC are connected through their terminal + + if(N.terminal.powernet == powernet) + continue + + to_connect += N.terminal //we'll connect the machines after all cables are merged + + else if(istype(AM, /obj/machinery/power)) //other power machines + var/obj/machinery/power/M = AM + + if(M.powernet == powernet) + continue + + to_connect += M //we'll connect the machines after all cables are merged + + //now that cables are done, let's connect found machines + for(var/obj/machinery/power/PM in to_connect) + if(!PM.connect_to_network()) + PM.disconnect_from_network() //if we somehow can't connect the machine to the new powernet, remove it from the old nonetheless + +////////////////////////////////////////////// +// Powernets handling helpers +////////////////////////////////////////////// + +//if powernetless_only = 1, will only get connections without powernet +/obj/structure/cable/proc/get_connections(powernetless_only = 0) + . = list() // this will be a list of all connected power objects + var/turf/T + + //get matching cables from the first direction + if(d1) //if not a node cable + T = get_step(src, d1) + if(T) + . += power_list(T, src, turn(d1, 180), powernetless_only) //get adjacents matching cables + + if(d1&(d1-1)) //diagonal direction, must check the 4 possibles adjacents tiles + T = get_step(src,d1&3) // go north/south + if(T) + . += power_list(T, src, d1 ^ 3, powernetless_only) //get diagonally matching cables + T = get_step(src,d1&12) // go east/west + if(T) + . += power_list(T, src, d1 ^ 12, powernetless_only) //get diagonally matching cables + + . += power_list(loc, src, d1, powernetless_only) //get on turf matching cables + + //do the same on the second direction (which can't be 0) + T = get_step(src, d2) + if(T) + . += power_list(T, src, turn(d2, 180), powernetless_only) //get adjacents matching cables + + if(d2&(d2-1)) //diagonal direction, must check the 4 possibles adjacents tiles + T = get_step(src,d2&3) // go north/south + if(T) + . += power_list(T, src, d2 ^ 3, powernetless_only) //get diagonally matching cables + T = get_step(src,d2&12) // go east/west + if(T) + . += power_list(T, src, d2 ^ 12, powernetless_only) //get diagonally matching cables + . += power_list(loc, src, d2, powernetless_only) //get on turf matching cables + + return . + +//should be called after placing a cable which extends another cable, creating a "smooth" cable that no longer terminates in the centre of a turf. +//needed as this can, unlike other placements, disconnect cables +/obj/structure/cable/proc/denode() + var/turf/T1 = loc + if(!T1) + return + + var/list/powerlist = power_list(T1,src,0,0) //find the other cables that ended in the centre of the turf, with or without a powernet + if(powerlist.len>0) + var/datum/powernet/PN = new() + propagate_network(powerlist[1],PN) //propagates the new powernet beginning at the source cable + + if(PN.is_empty()) //can happen with machines made nodeless when smoothing cables + qdel(PN) + +/obj/structure/cable/proc/auto_propogate_cut_cable(obj/O) + if(O && !QDELETED(O)) + var/datum/powernet/newPN = new()// creates a new powernet... + propagate_network(O, newPN)//... and propagates it to the other side of the cable + +// cut the cable's powernet at this cable and updates the powergrid +/obj/structure/cable/proc/cut_cable_from_powernet(remove=TRUE) + var/turf/T1 = loc + var/list/P_list + if(!T1) + return + if(d1) + T1 = get_step(T1, d1) + P_list = power_list(T1, src, turn(d1,180),0,cable_only = 1) // what adjacently joins on to cut cable... + + P_list += power_list(loc, src, d1, 0, cable_only = 1)//... and on turf + + + if(P_list.len == 0)//if nothing in both list, then the cable was a lone cable, just delete it and its powernet + powernet.remove_cable(src) + + for(var/obj/machinery/power/P in T1)//check if it was powering a machine + if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to + P.disconnect_from_network() //remove from current network (and delete powernet) + return + + var/obj/O = P_list[1] + // remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist + if(remove) + moveToNullspace() + powernet.remove_cable(src) //remove the cut cable from its powernet + + addtimer(CALLBACK(O, .proc/auto_propogate_cut_cable, O), 0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables + + // Disconnect machines connected to nodes + if(d1 == 0) // if we cut a node (O-X) cable + for(var/obj/machinery/power/P in T1) + if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to + P.disconnect_from_network() //remove from current network + + +/////////////////////////////////////////////// +// The cable coil object, used for laying cable +/////////////////////////////////////////////// + +//////////////////////////////// +// Definitions +//////////////////////////////// + +GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restraints", /obj/item/restraints/handcuffs/cable, 15))) + +/obj/item/stack/cable_coil + name = "cable coil" + gender = NEUTER //That's a cable coil sounds better than that's some cable coils + icon = 'icons/obj/power.dmi' + icon_state = "coil" + item_state = "coil" + lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' + max_amount = MAXCOIL + amount = MAXCOIL + merge_type = /obj/item/stack/cable_coil // This is here to let its children merge between themselves + item_color = "red" + desc = "A coil of insulated power cable." + throwforce = 0 + w_class = WEIGHT_CLASS_SMALL + throw_speed = 3 + throw_range = 5 + materials = list(MAT_METAL=10, MAT_GLASS=5) + flags_1 = CONDUCT_1 + slot_flags = ITEM_SLOT_BELT + attack_verb = list("whipped", "lashed", "disciplined", "flogged") + singular_name = "cable piece" + full_w_class = WEIGHT_CLASS_SMALL + grind_results = list(/datum/reagent/copper = 2) //2 copper per cable in the coil + usesound = 'sound/items/deconstruct.ogg' + +/obj/item/stack/cable_coil/cyborg + is_cyborg = 1 + materials = list() + cost = 1 + +/obj/item/stack/cable_coil/cyborg/attack_self(mob/user) + var/cable_color = input(user,"Pick a cable color.","Cable Color") in list("red","yellow","green","blue","pink","orange","cyan","white") + item_color = cable_color + update_icon() + +/obj/item/stack/cable_coil/suicide_act(mob/user) + if(locate(/obj/structure/chair/stool) in get_turf(user)) + user.visible_message("[user] is making a noose with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + else + user.visible_message("[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return(OXYLOSS) + +/obj/item/stack/cable_coil/Initialize(mapload, new_amount = null, param_color = null) + . = ..() + + var/list/cable_colors = GLOB.cable_colors + item_color = param_color || item_color || pick(cable_colors) + if(cable_colors[item_color]) + item_color = cable_colors[item_color] + + pixel_x = rand(-2,2) + pixel_y = rand(-2,2) + update_icon() + recipes = GLOB.cable_coil_recipes + +/////////////////////////////////// +// General procedures +/////////////////////////////////// + + +//you can use wires to heal robotics +/obj/item/stack/cable_coil/attack(mob/living/carbon/human/H, mob/user) + if(!istype(H)) + return ..() + + var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected)) + if(affecting && affecting.status == BODYPART_ROBOTIC) + if(user == H) + user.visible_message("[user] starts to fix some of the wires in [H]'s [affecting.name].", "You start fixing some of the wires in [H]'s [affecting.name].") + if(!do_mob(user, H, 50)) + return + if(item_heal_robotic(H, user, 0, 15)) + use(1) + return + else + return ..() + + +/obj/item/stack/cable_coil/update_icon() + icon_state = "[initial(item_state)][amount < 3 ? amount : ""]" + name = "cable [amount < 3 ? "piece" : "coil"]" + color = null + add_atom_colour(item_color, FIXED_COLOUR_PRIORITY) + +/obj/item/stack/cable_coil/attack_hand(mob/user) + . = ..() + if(.) + return + var/obj/item/stack/cable_coil/new_cable = ..() + if(istype(new_cable)) + new_cable.item_color = item_color + new_cable.update_icon() + +//add cables to the stack +/obj/item/stack/cable_coil/proc/give(extra) + if(amount + extra > max_amount) + amount = max_amount + else + amount += extra + update_icon() + + + +/////////////////////////////////////////////// +// Cable laying procedures +////////////////////////////////////////////// + +/obj/item/stack/cable_coil/proc/get_new_cable(location) + var/path = /obj/structure/cable + return new path(location, item_color) + +// called when cable_coil is clicked on a turf +/obj/item/stack/cable_coil/proc/place_turf(turf/T, mob/user, dirnew) + if(!isturf(user.loc)) + return + + if(!isturf(T) || T.intact || !T.can_have_cabling()) + to_chat(user, "You can only lay cables on catwalks and plating!") + return + + if(get_amount() < 1) // Out of cable + to_chat(user, "There is no cable left!") + return + + if(get_dist(T,user) > 1) // Too far + to_chat(user, "You can't lay cable at a place that far away!") + return + + var/dirn + if(!dirnew) //If we weren't given a direction, come up with one! (Called as null from catwalk.dm and floor.dm) + if(user.loc == T) + dirn = user.dir //If laying on the tile we're on, lay in the direction we're facing + else + dirn = get_dir(T, user) + else + dirn = dirnew + + for(var/obj/structure/cable/LC in T) + if(LC.d2 == dirn && LC.d1 == 0) + to_chat(user, "There's already a cable at that position!") + return + + var/obj/structure/cable/C = get_new_cable(T) + + //set up the new cable + C.d1 = 0 //it's a O-X node cable + C.d2 = dirn + C.add_fingerprint(user) + C.update_icon() + + //create a new powernet with the cable, if needed it will be merged later + var/datum/powernet/PN = new() + PN.add_cable(C) + + C.mergeConnectedNetworks(C.d2) //merge the powernet with adjacents powernets + C.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets + + if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions + C.mergeDiagonalsNetworks(C.d2) + + use(1) + + if(C.shock(user, 50)) + if(prob(50)) //fail + new /obj/item/stack/cable_coil(get_turf(C), 1, C.color) + C.deconstruct() + + return C + +// called when cable_coil is click on an installed obj/cable +// or click on a turf that already contains a "node" cable +/obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user, showerror = TRUE, forceddir) + var/turf/U = user.loc + if(!isturf(U)) + return + + var/turf/T = C.loc + + if(!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable + return + + if(get_dist(C, user) > 1) // make sure it's close enough + to_chat(user, "You can't lay cable at a place that far away!") + return + + + if(U == T && !forceddir) //if clicked on the turf we're standing on and a direction wasn't supplied, try to put a cable in the direction we're facing + place_turf(T,user) + return + + var/dirn = get_dir(C, user) + + // one end of the clicked cable is pointing towards us and no direction was supplied + if((C.d1 == dirn || C.d2 == dirn) && !forceddir) + if(!U.can_have_cabling()) //checking if it's a plating or catwalk + if (showerror) + to_chat(user, "You can only lay cables on catwalks and plating!") + return + if(U.intact) //can't place a cable if it's a plating with a tile on it + to_chat(user, "You can't lay cable there unless the floor tiles are removed!") + return + else + // cable is pointing at us, we're standing on an open tile + // so create a stub pointing at the clicked cable on our tile + + var/fdirn = turn(dirn, 180) // the opposite direction + + for(var/obj/structure/cable/LC in U) // check to make sure there's not a cable there already + if(LC.d1 == fdirn || LC.d2 == fdirn) + if (showerror) + to_chat(user, "There's already a cable at that position!") + return + + var/obj/structure/cable/NC = get_new_cable (U) + + NC.d1 = 0 + NC.d2 = fdirn + NC.add_fingerprint(user) + NC.update_icon() + + //create a new powernet with the cable, if needed it will be merged later + var/datum/powernet/newPN = new() + newPN.add_cable(NC) + + NC.mergeConnectedNetworks(NC.d2) //merge the powernet with adjacents powernets + NC.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets + + if(NC.d2 & (NC.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions + NC.mergeDiagonalsNetworks(NC.d2) + + use(1) + + if (NC.shock(user, 50)) + if (prob(50)) //fail + NC.deconstruct() + + return + + // exisiting cable doesn't point at our position or we have a supplied direction, so see if it's a stub + else if(C.d1 == 0) + // if so, make it a full cable pointing from it's old direction to our dirn + var/nd1 = C.d2 // these will be the new directions + var/nd2 = dirn + + + if(nd1 > nd2) // swap directions to match icons/states + nd1 = dirn + nd2 = C.d2 + + + for(var/obj/structure/cable/LC in T) // check to make sure there's no matching cable + if(LC == C) // skip the cable we're interacting with + continue + if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction + if (showerror) + to_chat(user, "There's already a cable at that position!") + + return + + + C.update_icon() + + C.d1 = nd1 + C.d2 = nd2 + + //updates the stored cable coil + C.update_stored(2, item_color) + + C.add_fingerprint(user) + C.update_icon() + + + C.mergeConnectedNetworks(C.d1) //merge the powernets... + C.mergeConnectedNetworks(C.d2) //...in the two new cable directions + C.mergeConnectedNetworksOnTurf() + + if(C.d1 & (C.d1 - 1))// if the cable is layed diagonally, check the others 2 possible directions + C.mergeDiagonalsNetworks(C.d1) + + if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions + C.mergeDiagonalsNetworks(C.d2) + + use(1) + + if (C.shock(user, 50)) + if (prob(50)) //fail + C.deconstruct() + return + + C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets. + return + +////////////////////////////// +// Misc. +///////////////////////////// + +/obj/item/stack/cable_coil/red + item_color = "red" + color = "#ff0000" + +/obj/item/stack/cable_coil/yellow + item_color = "yellow" + color = "#ffff00" + +/obj/item/stack/cable_coil/blue + item_color = "blue" + color = "#1919c8" + +/obj/item/stack/cable_coil/green + item_color = "green" + color = "#00aa00" + +/obj/item/stack/cable_coil/pink + item_color = "pink" + color = "#ff3ccd" + +/obj/item/stack/cable_coil/orange + item_color = "orange" + color = "#ff8000" + +/obj/item/stack/cable_coil/cyan + item_color = "cyan" + color = "#00ffff" + +/obj/item/stack/cable_coil/white + item_color = "white" + +/obj/item/stack/cable_coil/random + item_color = null + color = "#ffffff" + + +/obj/item/stack/cable_coil/random/five + amount = 5 + +/obj/item/stack/cable_coil/cut + amount = null + icon_state = "coil2" + +/obj/item/stack/cable_coil/cut/Initialize(mapload) + . = ..() + if(!amount) + amount = rand(1,2) + pixel_x = rand(-2,2) + pixel_y = rand(-2,2) + update_icon() + +/obj/item/stack/cable_coil/cut/red + item_color = "red" + color = "#ff0000" + +/obj/item/stack/cable_coil/cut/yellow + item_color = "yellow" + color = "#ffff00" + +/obj/item/stack/cable_coil/cut/blue + item_color = "blue" + color = "#1919c8" + +/obj/item/stack/cable_coil/cut/green + item_color = "green" + color = "#00aa00" + +/obj/item/stack/cable_coil/cut/pink + item_color = "pink" + color = "#ff3ccd" + +/obj/item/stack/cable_coil/cut/orange + item_color = "orange" + color = "#ff8000" + +/obj/item/stack/cable_coil/cut/cyan + item_color = "cyan" + color = "#00ffff" + +/obj/item/stack/cable_coil/cut/white + item_color = "white" + +/obj/item/stack/cable_coil/cut/random + item_color = null color = "#ffffff" \ No newline at end of file diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index e87adf58..64e559a2 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -1,361 +1,361 @@ -/obj/item/stock_parts/cell - name = "power cell" - desc = "A rechargeable electrochemical power cell." - icon = 'icons/obj/power.dmi' - icon_state = "cell" - item_state = "cell" - lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' - righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' - force = 5 - throwforce = 5 - throw_speed = 2 - throw_range = 5 - w_class = WEIGHT_CLASS_SMALL - var/charge = 0 // note %age conveted to actual charge in New - var/maxcharge = 1000 - materials = list(MAT_METAL=700, MAT_GLASS=50) - grind_results = list("lithium" = 15, "iron" = 5, "silicon" = 5) - var/rigged = FALSE // true if rigged to explode - var/chargerate = 100 //how much power is given every tick in a recharger - var/self_recharge = 0 //does it self recharge, over time, or not? - var/ratingdesc = TRUE - var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it. - -/obj/item/stock_parts/cell/get_cell() - return src - -/obj/item/stock_parts/cell/Initialize(mapload, override_maxcharge) - . = ..() - if(self_recharge) - START_PROCESSING(SSobj, src) - create_reagents(5, INJECTABLE | DRAINABLE) - if (override_maxcharge) - maxcharge = override_maxcharge - charge = maxcharge - if(ratingdesc) - desc += " This one has a rating of [DisplayEnergy(maxcharge)], and you should not swallow it." - update_icon() - -/obj/item/stock_parts/cell/Destroy() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/stock_parts/cell/vv_edit_var(var_name, var_value) - switch(var_name) - if("self_recharge") - if(var_value) - START_PROCESSING(SSobj, src) - else - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/item/stock_parts/cell/process() - if(self_recharge) - give(chargerate * 0.25) - else - return PROCESS_KILL - -/obj/item/stock_parts/cell/update_icon() - cut_overlays() - if(grown_battery) - add_overlay(image('icons/obj/power.dmi',"grown_wires")) - if(charge < 0.01) - return - else if(charge/maxcharge >=0.995) - add_overlay("cell-o2") - else - add_overlay("cell-o1") - -/obj/item/stock_parts/cell/proc/percent() // return % charge of cell - return 100*charge/maxcharge - -// use power from a cell -/obj/item/stock_parts/cell/use(amount, can_explode = TRUE) - if(rigged && amount > 0 && can_explode) - explode() - return 0 - if(charge < amount) - return 0 - charge = (charge - amount) - if(!istype(loc, /obj/machinery/power/apc)) - SSblackbox.record_feedback("tally", "cell_used", 1, type) - return 1 - -// recharge the cell -/obj/item/stock_parts/cell/proc/give(amount) - if(rigged && amount > 0) - explode() - return 0 - if(maxcharge < amount) - amount = maxcharge - var/power_used = min(maxcharge-charge,amount) - charge += power_used - return power_used - -/obj/item/stock_parts/cell/examine(mob/user) - . = ..() - if(rigged) - . += "This power cell seems to be faulty!" - else - . += "The charge meter reads [round(src.percent() )]%." - -/obj/item/stock_parts/cell/suicide_act(mob/user) - user.visible_message("[user] is licking the electrodes of [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (FIRELOSS) - -/obj/item/stock_parts/cell/on_reagent_change(changetype) - ..() - rigged = reagents?.has_reagent("plasma", 5) ? TRUE : FALSE //has_reagent returns the reagent datum - -/obj/item/stock_parts/cell/proc/explode() - var/turf/T = get_turf(src.loc) - if (charge==0) - return - var/devastation_range = -1 //round(charge/11000) - var/heavy_impact_range = round(sqrt(charge)/60) - var/light_impact_range = round(sqrt(charge)/30) - var/flash_range = light_impact_range - if (light_impact_range==0) - rigged = FALSE - corrupt() - return - //explosion(T, 0, 1, 2, 2) - explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range) - qdel(src) - -/obj/item/stock_parts/cell/proc/corrupt() - charge /= 2 - maxcharge = max(maxcharge/2, chargerate) - if (prob(10)) - rigged = TRUE //broken batterys are dangerous - -/obj/item/stock_parts/cell/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_SELF) - return - charge -= 1000 / severity - if (charge < 0) - charge = 0 - -/obj/item/stock_parts/cell/ex_act(severity, target) - ..() - if(!QDELETED(src)) - switch(severity) - if(2) - if(prob(50)) - corrupt() - if(3) - if(prob(25)) - corrupt() - - -/obj/item/stock_parts/cell/blob_act(obj/structure/blob/B) - ex_act(EXPLODE_DEVASTATE) - -/obj/item/stock_parts/cell/proc/get_electrocute_damage() - if(charge >= 1000) - return CLAMP(round(charge/10000), 10, 90) + rand(-5,5) - else - return 0 - -/obj/item/stock_parts/cell/get_part_rating() - return rating * maxcharge - -/* Cell variants*/ -/obj/item/stock_parts/cell/empty/Initialize() - . = ..() - charge = 0 - -/obj/item/stock_parts/cell/crap - name = "\improper Nanotrasen brand rechargeable AA battery" - desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT - maxcharge = 500 - materials = list(MAT_GLASS=40) - -/obj/item/stock_parts/cell/crap/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/upgraded - name = "upgraded power cell" - desc = "A power cell with a slightly higher capacity than normal!" - maxcharge = 2500 - materials = list(MAT_GLASS=50) - chargerate = 1000 - -/obj/item/stock_parts/cell/upgraded/plus - name = "upgraded power cell+" - desc = "A power cell with an even higher capacity than the base model!" - maxcharge = 5000 - -/obj/item/stock_parts/cell/secborg - name = "security borg rechargeable D battery" - maxcharge = 1750 //35/17/8 disabler/laser/taser shots. - materials = list(MAT_GLASS=40) - -/obj/item/stock_parts/cell/secborg/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/lascarbine - name = "laser carbine power supply" - maxcharge = 2500 - -/obj/item/stock_parts/cell/pulse //200 pulse shots - name = "pulse rifle power cell" - maxcharge = 40000 - chargerate = 1500 - -/obj/item/stock_parts/cell/pulse/carbine //25 pulse shots - name = "pulse carbine power cell" - maxcharge = 5000 - -/obj/item/stock_parts/cell/pulse/pistol //10 pulse shots - name = "pulse pistol power cell" - maxcharge = 2000 - -/obj/item/stock_parts/cell/high - name = "high-capacity power cell" - icon_state = "hcell" - maxcharge = 10000 - materials = list(MAT_GLASS=60) - chargerate = 1500 - -/obj/item/stock_parts/cell/high/plus - name = "high-capacity power cell+" - desc = "Where did these come from?" - icon_state = "h+cell" - maxcharge = 15000 - chargerate = 2250 - -/obj/item/stock_parts/cell/high/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/super - name = "super-capacity power cell" - icon_state = "scell" - maxcharge = 20000 - materials = list(MAT_GLASS=300) - chargerate = 2000 - -/obj/item/stock_parts/cell/super/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/hyper - name = "hyper-capacity power cell" - icon_state = "hpcell" - maxcharge = 30000 - materials = list(MAT_GLASS=400) - chargerate = 3000 - -/obj/item/stock_parts/cell/hyper/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/bluespace - name = "bluespace power cell" - desc = "A rechargeable transdimensional power cell." - icon_state = "bscell" - maxcharge = 40000 - materials = list(MAT_GLASS=600) - chargerate = 4000 - -/obj/item/stock_parts/cell/bluespace/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/infinite - name = "infinite-capacity power cell!" - icon_state = "icell" - maxcharge = 30000 - materials = list(MAT_GLASS=1000) - rating = 100 - chargerate = 30000 - -/obj/item/stock_parts/cell/infinite/use() - return 1 - -/obj/item/stock_parts/cell/infinite/abductor - name = "void core" - desc = "An alien power cell that produces energy seemingly out of nowhere." - icon = 'icons/obj/abductor.dmi' - icon_state = "cell" - maxcharge = 50000 - ratingdesc = FALSE - -/obj/item/stock_parts/cell/infinite/abductor/update_icon() - return - - -/obj/item/stock_parts/cell/potato - name = "potato battery" - desc = "A rechargeable starch based power cell." - icon = 'icons/obj/hydroponics/harvest.dmi' - icon_state = "potato" - charge = 100 - maxcharge = 300 - materials = list() - grown_battery = TRUE //it has the overlays for wires - -/obj/item/stock_parts/cell/high/slime - name = "charged slime core" - desc = "A yellow slime core infused with plasma, it crackles with power." - icon = 'icons/mob/slimes.dmi' - icon_state = "yellow slime extract" - materials = list() - rating = 5 //self-recharge makes these desirable - self_recharge = 1 // Infused slime cores self-recharge, over time - -/obj/item/stock_parts/cell/emproof - name = "\improper EMP-proof cell" - desc = "An EMP-proof cell." - maxcharge = 500 - rating = 3 - -/obj/item/stock_parts/cell/emproof/empty/Initialize() - . = ..() - charge = 0 - update_icon() - -/obj/item/stock_parts/cell/emproof/empty/ComponentInitialize() - . = ..() - AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF) - -/obj/item/stock_parts/cell/emproof/corrupt() - return - -/obj/item/stock_parts/cell/beam_rifle - name = "beam rifle capacitor" - desc = "A high powered capacitor that can provide huge amounts of energy in an instant." - maxcharge = 50000 - chargerate = 5000 //Extremely energy intensive - -/obj/item/stock_parts/cell/beam_rifle/corrupt() - return - -/obj/item/stock_parts/cell/beam_rifle/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_SELF) - return - charge = CLAMP((charge-(10000/severity)),0,maxcharge) - -/obj/item/stock_parts/cell/emergency_light - name = "miniature power cell" - desc = "A tiny power cell with a very low power capacity. Used in light fixtures to power them in the event of an outage." - maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell - materials = list(MAT_GLASS = 20) - w_class = WEIGHT_CLASS_TINY - -/obj/item/stock_parts/cell/emergency_light/Initialize() - . = ..() - var/area/A = get_area(src) - if(!A.lightswitch || !A.light_power) - charge = 0 //For naturally depowered areas, we start with no power +/obj/item/stock_parts/cell + name = "power cell" + desc = "A rechargeable electrochemical power cell." + icon = 'icons/obj/power.dmi' + icon_state = "cell" + item_state = "cell" + lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' + force = 5 + throwforce = 5 + throw_speed = 2 + throw_range = 5 + w_class = WEIGHT_CLASS_SMALL + var/charge = 0 // note %age conveted to actual charge in New + var/maxcharge = 1000 + materials = list(MAT_METAL=700, MAT_GLASS=50) + grind_results = list(/datum/reagent/lithium = 15, /datum/reagent/iron = 5, /datum/reagent/silicon = 5) + var/rigged = FALSE // true if rigged to explode + var/chargerate = 100 //how much power is given every tick in a recharger + var/self_recharge = 0 //does it self recharge, over time, or not? + var/ratingdesc = TRUE + var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it. + +/obj/item/stock_parts/cell/get_cell() + return src + +/obj/item/stock_parts/cell/Initialize(mapload, override_maxcharge) + . = ..() + if(self_recharge) + START_PROCESSING(SSobj, src) + create_reagents(5, INJECTABLE | DRAINABLE) + if (override_maxcharge) + maxcharge = override_maxcharge + charge = maxcharge + if(ratingdesc) + desc += " This one has a rating of [DisplayEnergy(maxcharge)], and you should not swallow it." + update_icon() + +/obj/item/stock_parts/cell/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/stock_parts/cell/vv_edit_var(var_name, var_value) + switch(var_name) + if("self_recharge") + if(var_value) + START_PROCESSING(SSobj, src) + else + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/stock_parts/cell/process() + if(self_recharge) + give(chargerate * 0.25) + else + return PROCESS_KILL + +/obj/item/stock_parts/cell/update_icon() + cut_overlays() + if(grown_battery) + add_overlay(image('icons/obj/power.dmi',"grown_wires")) + if(charge < 0.01) + return + else if(charge/maxcharge >=0.995) + add_overlay("cell-o2") + else + add_overlay("cell-o1") + +/obj/item/stock_parts/cell/proc/percent() // return % charge of cell + return 100*charge/maxcharge + +// use power from a cell +/obj/item/stock_parts/cell/use(amount, can_explode = TRUE) + if(rigged && amount > 0 && can_explode) + explode() + return 0 + if(charge < amount) + return 0 + charge = (charge - amount) + if(!istype(loc, /obj/machinery/power/apc)) + SSblackbox.record_feedback("tally", "cell_used", 1, type) + return 1 + +// recharge the cell +/obj/item/stock_parts/cell/proc/give(amount) + if(rigged && amount > 0) + explode() + return 0 + if(maxcharge < amount) + amount = maxcharge + var/power_used = min(maxcharge-charge,amount) + charge += power_used + return power_used + +/obj/item/stock_parts/cell/examine(mob/user) + . = ..() + if(rigged) + . += "This power cell seems to be faulty!" + else + . += "The charge meter reads [round(src.percent() )]%." + +/obj/item/stock_parts/cell/suicide_act(mob/user) + user.visible_message("[user] is licking the electrodes of [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (FIRELOSS) + +/obj/item/stock_parts/cell/on_reagent_change(changetype) + ..() + rigged = reagents?.has_reagent(/datum/reagent/toxin/plasma, 5) ? TRUE : FALSE //has_reagent returns the reagent datum + +/obj/item/stock_parts/cell/proc/explode() + var/turf/T = get_turf(src.loc) + if (charge==0) + return + var/devastation_range = -1 //round(charge/11000) + var/heavy_impact_range = round(sqrt(charge)/60) + var/light_impact_range = round(sqrt(charge)/30) + var/flash_range = light_impact_range + if (light_impact_range==0) + rigged = FALSE + corrupt() + return + //explosion(T, 0, 1, 2, 2) + explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range) + qdel(src) + +/obj/item/stock_parts/cell/proc/corrupt() + charge /= 2 + maxcharge = max(maxcharge/2, chargerate) + if (prob(10)) + rigged = TRUE //broken batterys are dangerous + +/obj/item/stock_parts/cell/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_SELF) + return + charge -= 1000 / severity + if (charge < 0) + charge = 0 + +/obj/item/stock_parts/cell/ex_act(severity, target) + ..() + if(!QDELETED(src)) + switch(severity) + if(2) + if(prob(50)) + corrupt() + if(3) + if(prob(25)) + corrupt() + + +/obj/item/stock_parts/cell/blob_act(obj/structure/blob/B) + ex_act(EXPLODE_DEVASTATE) + +/obj/item/stock_parts/cell/proc/get_electrocute_damage() + if(charge >= 1000) + return CLAMP(round(charge/10000), 10, 90) + rand(-5,5) + else + return 0 + +/obj/item/stock_parts/cell/get_part_rating() + return rating * maxcharge + +/* Cell variants*/ +/obj/item/stock_parts/cell/empty/Initialize() + . = ..() + charge = 0 + +/obj/item/stock_parts/cell/crap + name = "\improper Nanotrasen brand rechargeable AA battery" + desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT + maxcharge = 500 + materials = list(MAT_GLASS=40) + +/obj/item/stock_parts/cell/crap/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/upgraded + name = "upgraded power cell" + desc = "A power cell with a slightly higher capacity than normal!" + maxcharge = 2500 + materials = list(MAT_GLASS=50) + chargerate = 1000 + +/obj/item/stock_parts/cell/upgraded/plus + name = "upgraded power cell+" + desc = "A power cell with an even higher capacity than the base model!" + maxcharge = 5000 + +/obj/item/stock_parts/cell/secborg + name = "security borg rechargeable D battery" + maxcharge = 1750 //35/17/8 disabler/laser/taser shots. + materials = list(MAT_GLASS=40) + +/obj/item/stock_parts/cell/secborg/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/lascarbine + name = "laser carbine power supply" + maxcharge = 2500 + +/obj/item/stock_parts/cell/pulse //200 pulse shots + name = "pulse rifle power cell" + maxcharge = 40000 + chargerate = 1500 + +/obj/item/stock_parts/cell/pulse/carbine //25 pulse shots + name = "pulse carbine power cell" + maxcharge = 5000 + +/obj/item/stock_parts/cell/pulse/pistol //10 pulse shots + name = "pulse pistol power cell" + maxcharge = 2000 + +/obj/item/stock_parts/cell/high + name = "high-capacity power cell" + icon_state = "hcell" + maxcharge = 10000 + materials = list(MAT_GLASS=60) + chargerate = 1500 + +/obj/item/stock_parts/cell/high/plus + name = "high-capacity power cell+" + desc = "Where did these come from?" + icon_state = "h+cell" + maxcharge = 15000 + chargerate = 2250 + +/obj/item/stock_parts/cell/high/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/super + name = "super-capacity power cell" + icon_state = "scell" + maxcharge = 20000 + materials = list(MAT_GLASS=300) + chargerate = 2000 + +/obj/item/stock_parts/cell/super/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/hyper + name = "hyper-capacity power cell" + icon_state = "hpcell" + maxcharge = 30000 + materials = list(MAT_GLASS=400) + chargerate = 3000 + +/obj/item/stock_parts/cell/hyper/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/bluespace + name = "bluespace power cell" + desc = "A rechargeable transdimensional power cell." + icon_state = "bscell" + maxcharge = 40000 + materials = list(MAT_GLASS=600) + chargerate = 4000 + +/obj/item/stock_parts/cell/bluespace/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/infinite + name = "infinite-capacity power cell!" + icon_state = "icell" + maxcharge = 30000 + materials = list(MAT_GLASS=1000) + rating = 100 + chargerate = 30000 + +/obj/item/stock_parts/cell/infinite/use() + return 1 + +/obj/item/stock_parts/cell/infinite/abductor + name = "void core" + desc = "An alien power cell that produces energy seemingly out of nowhere." + icon = 'icons/obj/abductor.dmi' + icon_state = "cell" + maxcharge = 50000 + ratingdesc = FALSE + +/obj/item/stock_parts/cell/infinite/abductor/update_icon() + return + + +/obj/item/stock_parts/cell/potato + name = "potato battery" + desc = "A rechargeable starch based power cell." + icon = 'icons/obj/hydroponics/harvest.dmi' + icon_state = "potato" + charge = 100 + maxcharge = 300 + materials = list() + grown_battery = TRUE //it has the overlays for wires + +/obj/item/stock_parts/cell/high/slime + name = "charged slime core" + desc = "A yellow slime core infused with plasma, it crackles with power." + icon = 'icons/mob/slimes.dmi' + icon_state = "yellow slime extract" + materials = list() + rating = 5 //self-recharge makes these desirable + self_recharge = 1 // Infused slime cores self-recharge, over time + +/obj/item/stock_parts/cell/emproof + name = "\improper EMP-proof cell" + desc = "An EMP-proof cell." + maxcharge = 500 + rating = 3 + +/obj/item/stock_parts/cell/emproof/empty/Initialize() + . = ..() + charge = 0 + update_icon() + +/obj/item/stock_parts/cell/emproof/empty/ComponentInitialize() + . = ..() + AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF) + +/obj/item/stock_parts/cell/emproof/corrupt() + return + +/obj/item/stock_parts/cell/beam_rifle + name = "beam rifle capacitor" + desc = "A high powered capacitor that can provide huge amounts of energy in an instant." + maxcharge = 50000 + chargerate = 5000 //Extremely energy intensive + +/obj/item/stock_parts/cell/beam_rifle/corrupt() + return + +/obj/item/stock_parts/cell/beam_rifle/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_SELF) + return + charge = CLAMP((charge-(10000/severity)),0,maxcharge) + +/obj/item/stock_parts/cell/emergency_light + name = "miniature power cell" + desc = "A tiny power cell with a very low power capacity. Used in light fixtures to power them in the event of an outage." + maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell + materials = list(MAT_GLASS = 20) + w_class = WEIGHT_CLASS_TINY + +/obj/item/stock_parts/cell/emergency_light/Initialize() + . = ..() + var/area/A = get_area(src) + if(!A.lightswitch || !A.light_power) + charge = 0 //For naturally depowered areas, we start with no power diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index d4b3cbad..a8fa8a14 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -720,7 +720,7 @@ var/base_state var/switchcount = 0 // number of times switched materials = list(MAT_GLASS=100) - grind_results = list("silicon" = 5, "nitrogen" = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs + grind_results = list(/datum/reagent/silicon = 5, /datum/reagent/nitrogen = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs var/rigged = 0 // true if rigged to explode var/brightness = 2 //how much light it gives off @@ -790,7 +790,7 @@ to_chat(user, "You inject the solution into \the [src].") - if(S.reagents.has_reagent("plasma", 5)) + if(S.reagents.has_reagent(/datum/reagent/toxin/plasma, 5)) rigged = 1 diff --git a/code/modules/projectiles/ammunition/ballistic/shotgun.dm b/code/modules/projectiles/ammunition/ballistic/shotgun.dm index ed544cea..a8d39342 100644 --- a/code/modules/projectiles/ammunition/ballistic/shotgun.dm +++ b/code/modules/projectiles/ammunition/ballistic/shotgun.dm @@ -1,141 +1,141 @@ -// Shotgun - -/obj/item/ammo_casing/shotgun - name = "shotgun slug" - desc = "A 12 gauge lead slug." - icon_state = "blshell" - caliber = "shotgun" - projectile_type = /obj/item/projectile/bullet/shotgun_slug - materials = list(MAT_METAL=4000) - -/obj/item/ammo_casing/shotgun/beanbag - name = "beanbag slug" - desc = "A weak beanbag slug for riot control." - icon_state = "bshell" - projectile_type = /obj/item/projectile/bullet/shotgun_beanbag - materials = list(MAT_METAL=250) - -/obj/item/ammo_casing/shotgun/incendiary - name = "incendiary slug" - desc = "An incendiary-coated shotgun slug." - icon_state = "ishell" - projectile_type = /obj/item/projectile/bullet/incendiary/shotgun - -/obj/item/ammo_casing/shotgun/dragonsbreath - name = "dragonsbreath shell" - desc = "A shotgun shell which fires a spread of incendiary pellets." - icon_state = "ishell2" - projectile_type = /obj/item/projectile/bullet/incendiary/shotgun/dragonsbreath - pellets = 4 - variance = 35 - -/obj/item/ammo_casing/shotgun/stunslug - name = "taser slug" - desc = "A stunning taser slug." - icon_state = "stunshell" - projectile_type = /obj/item/projectile/bullet/shotgun_stunslug - materials = list(MAT_METAL=250) - -/obj/item/ammo_casing/shotgun/meteorslug - name = "meteorslug shell" - desc = "A shotgun shell rigged with CMC technology, which launches a massive slug when fired." - icon_state = "mshell" - projectile_type = /obj/item/projectile/bullet/shotgun_meteorslug - -/obj/item/ammo_casing/shotgun/pulseslug - name = "pulse slug" - desc = "A delicate device which can be loaded into a shotgun. The primer acts as a button which triggers the gain medium and fires a powerful \ - energy blast. While the heat and power drain limit it to one use, it can still allow an operator to engage targets that ballistic ammunition \ - would have difficulty with." - icon_state = "pshell" - projectile_type = /obj/item/projectile/beam/pulse/shotgun - -/obj/item/ammo_casing/shotgun/frag12 - name = "FRAG-12 slug" - desc = "A high explosive breaching round for a 12 gauge shotgun." - icon_state = "heshell" - projectile_type = /obj/item/projectile/bullet/shotgun_frag12 - -/obj/item/ammo_casing/shotgun/buckshot - name = "buckshot shell" - desc = "A 12 gauge buckshot shell." - icon_state = "gshell" - projectile_type = /obj/item/projectile/bullet/pellet/shotgun_buckshot - pellets = 6 - variance = 25 - -/obj/item/ammo_casing/shotgun/rubbershot - name = "rubber shot" - desc = "A shotgun casing filled with densely-packed rubber balls, used to incapacitate crowds from a distance." - icon_state = "bshell" - projectile_type = /obj/item/projectile/bullet/pellet/shotgun_rubbershot - pellets = 6 - variance = 25 - materials = list(MAT_METAL=4000) - -/obj/item/ammo_casing/shotgun/improvised - name = "improvised shell" - desc = "An extremely weak shotgun shell with multiple small pellets made out of metal shards." - icon_state = "improvshell" - projectile_type = /obj/item/projectile/bullet/pellet/shotgun_improvised - materials = list(MAT_METAL=250) - pellets = 10 - variance = 25 - -/obj/item/ammo_casing/shotgun/ion - name = "ion shell" - desc = "An advanced shotgun shell which uses a subspace ansible crystal to produce an effect similar to a standard ion rifle. \ - The unique properties of the crystal split the pulse into a spread of individually weaker bolts." - icon_state = "ionshell" - projectile_type = /obj/item/projectile/ion/weak - pellets = 4 - variance = 35 - -/obj/item/ammo_casing/shotgun/laserslug - name = "scatter laser shell" - desc = "An advanced shotgun shell that uses a micro laser to replicate the effects of a scatter laser weapon in a ballistic package." - icon_state = "lshell" - projectile_type = /obj/item/projectile/beam/weak - pellets = 6 - variance = 35 - -/obj/item/ammo_casing/shotgun/techshell - name = "unloaded technological shell" - desc = "A high-tech shotgun shell which can be loaded with materials to produce unique effects." - icon_state = "cshell" - projectile_type = null - -/obj/item/ammo_casing/shotgun/dart - name = "shotgun dart" - desc = "A dart for use in shotguns. Can be injected with up to 30 units of any chemical." - icon_state = "cshell" - projectile_type = /obj/item/projectile/bullet/dart - var/reagent_amount = 30 - -/obj/item/ammo_casing/shotgun/dart/Initialize() - . = ..() - create_reagents(reagent_amount, OPENCONTAINER) - -/obj/item/ammo_casing/shotgun/dart/attackby() - return - -/obj/item/ammo_casing/shotgun/dart/noreact - name = "cryostasis shotgun dart" - desc = "A dart for use in shotguns. Uses technology similar to cryostasis beakers to keep internal reagents from reacting. Can be injected with up to 10 units of any chemical." - icon_state = "cnrshell" - reagent_amount = 10 - -/obj/item/ammo_casing/shotgun/dart/noreact/Initialize() - . = ..() - ENABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) - -/obj/item/ammo_casing/shotgun/dart/bioterror - desc = "A shotgun dart filled with deadly toxins." - -/obj/item/ammo_casing/shotgun/dart/bioterror/Initialize() - . = ..() - reagents.add_reagent("neurotoxin", 6) - reagents.add_reagent("spore", 6) - reagents.add_reagent("mutetoxin", 6) //;HELP OPS IN MAINT - reagents.add_reagent("coniine", 6) - reagents.add_reagent("sodium_thiopental", 6) +// Shotgun + +/obj/item/ammo_casing/shotgun + name = "shotgun slug" + desc = "A 12 gauge lead slug." + icon_state = "blshell" + caliber = "shotgun" + projectile_type = /obj/item/projectile/bullet/shotgun_slug + materials = list(MAT_METAL=4000) + +/obj/item/ammo_casing/shotgun/beanbag + name = "beanbag slug" + desc = "A weak beanbag slug for riot control." + icon_state = "bshell" + projectile_type = /obj/item/projectile/bullet/shotgun_beanbag + materials = list(MAT_METAL=250) + +/obj/item/ammo_casing/shotgun/incendiary + name = "incendiary slug" + desc = "An incendiary-coated shotgun slug." + icon_state = "ishell" + projectile_type = /obj/item/projectile/bullet/incendiary/shotgun + +/obj/item/ammo_casing/shotgun/dragonsbreath + name = "dragonsbreath shell" + desc = "A shotgun shell which fires a spread of incendiary pellets." + icon_state = "ishell2" + projectile_type = /obj/item/projectile/bullet/incendiary/shotgun/dragonsbreath + pellets = 4 + variance = 35 + +/obj/item/ammo_casing/shotgun/stunslug + name = "taser slug" + desc = "A stunning taser slug." + icon_state = "stunshell" + projectile_type = /obj/item/projectile/bullet/shotgun_stunslug + materials = list(MAT_METAL=250) + +/obj/item/ammo_casing/shotgun/meteorslug + name = "meteorslug shell" + desc = "A shotgun shell rigged with CMC technology, which launches a massive slug when fired." + icon_state = "mshell" + projectile_type = /obj/item/projectile/bullet/shotgun_meteorslug + +/obj/item/ammo_casing/shotgun/pulseslug + name = "pulse slug" + desc = "A delicate device which can be loaded into a shotgun. The primer acts as a button which triggers the gain medium and fires a powerful \ + energy blast. While the heat and power drain limit it to one use, it can still allow an operator to engage targets that ballistic ammunition \ + would have difficulty with." + icon_state = "pshell" + projectile_type = /obj/item/projectile/beam/pulse/shotgun + +/obj/item/ammo_casing/shotgun/frag12 + name = "FRAG-12 slug" + desc = "A high explosive breaching round for a 12 gauge shotgun." + icon_state = "heshell" + projectile_type = /obj/item/projectile/bullet/shotgun_frag12 + +/obj/item/ammo_casing/shotgun/buckshot + name = "buckshot shell" + desc = "A 12 gauge buckshot shell." + icon_state = "gshell" + projectile_type = /obj/item/projectile/bullet/pellet/shotgun_buckshot + pellets = 6 + variance = 25 + +/obj/item/ammo_casing/shotgun/rubbershot + name = "rubber shot" + desc = "A shotgun casing filled with densely-packed rubber balls, used to incapacitate crowds from a distance." + icon_state = "bshell" + projectile_type = /obj/item/projectile/bullet/pellet/shotgun_rubbershot + pellets = 6 + variance = 25 + materials = list(MAT_METAL=4000) + +/obj/item/ammo_casing/shotgun/improvised + name = "improvised shell" + desc = "An extremely weak shotgun shell with multiple small pellets made out of metal shards." + icon_state = "improvshell" + projectile_type = /obj/item/projectile/bullet/pellet/shotgun_improvised + materials = list(MAT_METAL=250) + pellets = 10 + variance = 25 + +/obj/item/ammo_casing/shotgun/ion + name = "ion shell" + desc = "An advanced shotgun shell which uses a subspace ansible crystal to produce an effect similar to a standard ion rifle. \ + The unique properties of the crystal split the pulse into a spread of individually weaker bolts." + icon_state = "ionshell" + projectile_type = /obj/item/projectile/ion/weak + pellets = 4 + variance = 35 + +/obj/item/ammo_casing/shotgun/laserslug + name = "scatter laser shell" + desc = "An advanced shotgun shell that uses a micro laser to replicate the effects of a scatter laser weapon in a ballistic package." + icon_state = "lshell" + projectile_type = /obj/item/projectile/beam/weak + pellets = 6 + variance = 35 + +/obj/item/ammo_casing/shotgun/techshell + name = "unloaded technological shell" + desc = "A high-tech shotgun shell which can be loaded with materials to produce unique effects." + icon_state = "cshell" + projectile_type = null + +/obj/item/ammo_casing/shotgun/dart + name = "shotgun dart" + desc = "A dart for use in shotguns. Can be injected with up to 30 units of any chemical." + icon_state = "cshell" + projectile_type = /obj/item/projectile/bullet/dart + var/reagent_amount = 30 + +/obj/item/ammo_casing/shotgun/dart/Initialize() + . = ..() + create_reagents(reagent_amount, OPENCONTAINER) + +/obj/item/ammo_casing/shotgun/dart/attackby() + return + +/obj/item/ammo_casing/shotgun/dart/noreact + name = "cryostasis shotgun dart" + desc = "A dart for use in shotguns. Uses technology similar to cryostasis beakers to keep internal reagents from reacting. Can be injected with up to 10 units of any chemical." + icon_state = "cnrshell" + reagent_amount = 10 + +/obj/item/ammo_casing/shotgun/dart/noreact/Initialize() + . = ..() + ENABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) + +/obj/item/ammo_casing/shotgun/dart/bioterror + desc = "A shotgun dart filled with deadly toxins." + +/obj/item/ammo_casing/shotgun/dart/bioterror/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/toxin/fentanyl, 6) + reagents.add_reagent(/datum/reagent/toxin/spore, 6) + reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 6) //;HELP OPS IN MAINT + reagents.add_reagent(/datum/reagent/toxin/coniine, 6) + reagents.add_reagent(/datum/reagent/toxin/sodium_thiopental, 6) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 2ca5e541..b7d574a9 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -1,641 +1,641 @@ - -#define MOVES_HITSCAN -1 //Not actually hitscan but close as we get without actual hitscan. -#define MUZZLE_EFFECT_PIXEL_INCREMENT 17 //How many pixels to move the muzzle flash up so your character doesn't look like they're shitting out lasers. - -/obj/item/projectile - name = "projectile" - icon = 'icons/obj/projectiles.dmi' - icon_state = "bullet" - density = FALSE - anchored = TRUE - item_flags = ABSTRACT - pass_flags = PASSTABLE - mouse_opacity = MOUSE_OPACITY_TRANSPARENT - hitsound = 'sound/weapons/pierce.ogg' - var/hitsound_wall = "" - - resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF - var/def_zone = "" //Aiming at - var/atom/movable/firer = null//Who shot it - var/suppressed = FALSE //Attack message - var/candink = FALSE //Can this projectile play the dink sound when hitting the head? - var/yo = null - var/xo = null - var/atom/original = null // the original target clicked - var/turf/starting = null // the projectile's starting turf - var/list/permutated = list() // we've passed through these atoms, don't try to hit them again - var/p_x = 16 - var/p_y = 16 // the pixel location of the tile that the player clicked. Default is the center - - //Fired processing vars - var/fired = FALSE //Have we been fired yet - var/paused = FALSE //for suspending the projectile midair - var/last_projectile_move = 0 - var/last_process = 0 - var/time_offset = 0 - var/datum/point/vector/trajectory - var/trajectory_ignore_forcemove = FALSE //instructs forceMove to NOT reset our trajectory to the new location! - - var/speed = 0.6 //Amount of deciseconds it takes for projectile to travel - var/Angle = 0 - var/original_angle = 0 //Angle at firing - var/nondirectional_sprite = FALSE //Set TRUE to prevent projectiles from having their sprites rotated based on firing angle - var/spread = 0 //amount (in degrees) of projectile spread - animate_movement = 0 //Use SLIDE_STEPS in conjunction with legacy - var/ricochets = 0 - var/ricochets_max = 2 - var/ricochet_chance = 30 - - //Hitscan - var/hitscan = FALSE //Whether this is hitscan. If it is, speed is basically ignored. - var/list/beam_segments //assoc list of datum/point or datum/point/vector, start = end. Used for hitscan effect generation. - var/datum/point/beam_index - var/turf/hitscan_last //last turf touched during hitscanning. - var/tracer_type - var/muzzle_type - var/impact_type - - //Fancy hitscan lighting effects! - var/hitscan_light_intensity = 1.5 - var/hitscan_light_range = 0.75 - var/hitscan_light_color_override - var/muzzle_flash_intensity = 3 - var/muzzle_flash_range = 1.5 - var/muzzle_flash_color_override - var/impact_light_intensity = 3 - var/impact_light_range = 2 - var/impact_light_color_override - - //Homing - var/homing = FALSE - var/atom/homing_target - var/homing_turn_speed = 10 //Angle per tick. - var/homing_inaccuracy_min = 0 //in pixels for these. offsets are set once when setting target. - var/homing_inaccuracy_max = 0 - var/homing_offset_x = 0 - var/homing_offset_y = 0 - - var/ignore_source_check = FALSE - - var/damage = 10 - var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here - var/nodamage = 0 //Determines if the projectile will skip any damage inflictions - var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb - var/projectile_type = /obj/item/projectile - var/range = 50 //This will de-increment every step. When 0, it will deletze the projectile. - var/decayedRange - var/is_reflectable = FALSE // Can it be reflected or not? - //Effects - var/stun = 0 - var/knockdown = 0 - var/knockdown_stamoverride - var/knockdown_stam_max - var/unconscious = 0 - var/irradiate = 0 - var/stutter = 0 - var/slur = 0 - var/eyeblur = 0 - var/drowsy = 0 - var/stamina = 0 - var/jitter = 0 - var/forcedodge = 0 //to pass through everything - var/dismemberment = 0 //The higher the number, the greater the bonus to dismembering. 0 will not dismember at all. - var/impact_effect_type //what type of impact effect to show when hitting something - var/log_override = FALSE //is this type spammed enough to not log? (KAs) - -/obj/item/projectile/Initialize() - . = ..() - permutated = list() - decayedRange = range - -/obj/item/projectile/proc/Range() - range-- - if(range <= 0 && loc) - on_range() - -/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range - qdel(src) - -//to get the correct limb (if any) for the projectile hit message -/mob/living/proc/check_limb_hit(hit_zone) - if(has_limbs) - return hit_zone - -/mob/living/carbon/check_limb_hit(hit_zone) - if(get_bodypart(hit_zone)) - return hit_zone - else //when a limb is missing the damage is actually passed to the chest - return BODY_ZONE_CHEST - -/obj/item/projectile/proc/prehit(atom/target) - return TRUE - -/obj/item/projectile/proc/on_hit(atom/target, blocked = FALSE) - var/turf/target_loca = get_turf(target) - - var/hitx - var/hity - if(target == original) - hitx = target.pixel_x + p_x - 16 - hity = target.pixel_y + p_y - 16 - else - hitx = target.pixel_x + rand(-8, 8) - hity = target.pixel_y + rand(-8, 8) - - if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && iswallturf(target_loca) && prob(75)) - var/turf/closed/wall/W = target_loca - if(impact_effect_type && !hitscan) - new impact_effect_type(target_loca, hitx, hity) - - W.add_dent(WALL_DENT_SHOT, hitx, hity) - - return 0 - - if(!isliving(target)) - if(impact_effect_type && !hitscan) - new impact_effect_type(target_loca, hitx, hity) - return 0 - - var/mob/living/L = target - - if(blocked != 100) // not completely blocked - if(damage && L.blood_volume && damage_type == BRUTE) - var/splatter_dir = dir - if(starting) - splatter_dir = get_dir(starting, target_loca) - var/obj/item/bodypart/B = L.get_bodypart(def_zone) - if(B && B.status == BODYPART_ROBOTIC) // So if you hit a robotic, it sparks instead of bloodspatters - do_sparks(2, FALSE, target.loc) - if(prob(25)) - new /obj/effect/decal/cleanable/oil(target_loca) - else if(isalien(L)) - new /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter(target_loca, splatter_dir) - else - if(ishuman(target)) - var/mob/living/carbon/human/H = target - new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color(H.dna.blood_type)) - else - new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color()) - if(iscarbon(L) && !HAS_TRAIT(L, TRAIT_NOMARROW)) - var/mob/living/carbon/C = L - C.bleed(damage) - else - L.add_splatter_floor(target_loca) - else if(impact_effect_type && !hitscan) - new impact_effect_type(target_loca, hitx, hity) - - var/organ_hit_text = "" - var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info. - if(limb_hit) - organ_hit_text = " in \the [parse_zone(limb_hit)]" - if(suppressed) - playsound(loc, hitsound, 5, 1, -1) - to_chat(L, "You're shot by \a [src][organ_hit_text]!") - else - if(hitsound) - var/volume = vol_by_damage() - playsound(loc, hitsound, volume, 1, -1) - L.visible_message("[L] is hit by \a [src][organ_hit_text]!", \ - "[L] is hit by \a [src][organ_hit_text]!", null, COMBAT_MESSAGE_RANGE) - if(candink && def_zone == BODY_ZONE_HEAD) - playsound(src, 'sound/weapons/dink.ogg', 30, 1) - L.on_hit(src) - - var/reagent_note - if(reagents && reagents.reagent_list) - reagent_note = " REAGENTS:" - for(var/datum/reagent/R in reagents.reagent_list) - reagent_note += R.id + " (" - reagent_note += num2text(R.volume) + ") " - - if(ismob(firer)) - log_combat(firer, L, "shot", src, reagent_note) - else - L.log_message("has been shot by [firer] with [src]", LOG_ATTACK, color="orange") - - return L.apply_effects(stun, knockdown, unconscious, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter, knockdown_stamoverride, knockdown_stam_max) - -/obj/item/projectile/proc/vol_by_damage() - if(src.damage) - return CLAMP((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then CLAMP the value between 30 and 100 - else - return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume - -/obj/item/projectile/proc/on_ricochet(atom/A) - return - -/obj/item/projectile/proc/store_hitscan_collision(datum/point/pcache) - beam_segments[beam_index] = pcache - beam_index = pcache - beam_segments[beam_index] = null - -/obj/item/projectile/Bump(atom/A) - var/datum/point/pcache = trajectory.copy_to() - if(check_ricochet(A) && check_ricochet_flag(A) && ricochets < ricochets_max) - ricochets++ - if(A.handle_ricochet(src)) - on_ricochet(A) - ignore_source_check = TRUE - range = initial(range) - if(hitscan) - store_hitscan_collision(pcache) - return TRUE - if(firer && !ignore_source_check) - if(A == firer || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech - trajectory_ignore_forcemove = TRUE - forceMove(get_turf(A)) - trajectory_ignore_forcemove = FALSE - return FALSE - - var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations. - def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use. - - if(isturf(A) && hitsound_wall) - var/volume = CLAMP(vol_by_damage() + 20, 0, 100) - if(suppressed) - volume = 5 - playsound(loc, hitsound_wall, volume, 1, -1) - - var/turf/target_turf = get_turf(A) - - if(!prehit(A)) - if(forcedodge) - trajectory_ignore_forcemove = TRUE - forceMove(target_turf) - trajectory_ignore_forcemove = FALSE - return FALSE - - var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null - if(permutation == -1 || forcedodge)// the bullet passes through a dense object! - trajectory_ignore_forcemove = TRUE - forceMove(target_turf) - trajectory_ignore_forcemove = FALSE - if(A) - permutated.Add(A) - return FALSE - else - var/atom/alt = select_target(A) - if(alt) - if(!prehit(alt)) - return FALSE - alt.bullet_act(src, def_zone) - qdel(src) - return TRUE - -/obj/item/projectile/proc/select_target(atom/A) //Selects another target from a wall if we hit a wall. - if(!A || !A.density || (A.flags_1 & ON_BORDER_1) || ismob(A) || A == original) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs or machines/structures on that tile. - return - var/turf/T = get_turf(A) - if(original in T) - return original - var/list/mob/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob) - A - var/list/mob/mobs = list() - for(var/i in possible_mobs) - var/mob/M = i - if(M.lying) - continue - mobs += M - var/mob/M = safepick(mobs) - if(M) - return M.lowest_buckled_mob() - var/obj/O = safepick(typecache_filter_list(T, GLOB.typecache_machine_or_structure) - A) - if(O) - return O - -/obj/item/projectile/proc/check_ricochet() - if(prob(ricochet_chance)) - return TRUE - return FALSE - -/obj/item/projectile/proc/check_ricochet_flag(atom/A) - if(A.flags_1 & CHECK_RICOCHET_1) - return TRUE - return FALSE - -/obj/item/projectile/proc/return_predicted_turf_after_moves(moves, forced_angle) //I say predicted because there's no telling that the projectile won't change direction/location in flight. - if(!trajectory && isnull(forced_angle) && isnull(Angle)) - return FALSE - var/datum/point/vector/current = trajectory - if(!current) - var/turf/T = get_turf(src) - current = new(T.x, T.y, T.z, pixel_x, pixel_y, isnull(forced_angle)? Angle : forced_angle, SSprojectiles.global_pixel_speed) - var/datum/point/vector/v = current.return_vector_after_increments(moves * SSprojectiles.global_iterations_per_move) - return v.return_turf() - -/obj/item/projectile/proc/return_pathing_turfs_in_moves(moves, forced_angle) - var/turf/current = get_turf(src) - var/turf/ending = return_predicted_turf_after_moves(moves, forced_angle) - return getline(current, ending) - -/obj/item/projectile/Process_Spacemove(var/movement_dir = 0) - return TRUE //Bullets don't drift in space - -/obj/item/projectile/process() - last_process = world.time - if(!loc || !fired || !trajectory) - fired = FALSE - return PROCESS_KILL - if(paused || !isturf(loc)) - last_projectile_move += world.time - last_process //Compensates for pausing, so it doesn't become a hitscan projectile when unpaused from charged up ticks. - return - var/elapsed_time_deciseconds = (world.time - last_projectile_move) + time_offset - time_offset = 0 - var/required_moves = speed > 0? FLOOR(elapsed_time_deciseconds / speed, 1) : MOVES_HITSCAN //Would be better if a 0 speed made hitscan but everyone hates those so I can't make it a universal system :< - if(required_moves == MOVES_HITSCAN) - required_moves = SSprojectiles.global_max_tick_moves - else - if(required_moves > SSprojectiles.global_max_tick_moves) - var/overrun = required_moves - SSprojectiles.global_max_tick_moves - required_moves = SSprojectiles.global_max_tick_moves - time_offset += overrun * speed - time_offset += MODULUS(elapsed_time_deciseconds, speed) - - for(var/i in 1 to required_moves) - pixel_move(1, FALSE) - -/obj/item/projectile/proc/fire(angle, atom/direct_target) - //If no angle needs to resolve it from xo/yo! - if(!log_override && firer && original) - log_combat(firer, original, "fired at", src, "from [get_area_name(src, TRUE)]") - if(direct_target) - if(prehit(direct_target)) - direct_target.bullet_act(src, def_zone) - qdel(src) - return - if(isnum(angle)) - setAngle(angle) - if(spread) - setAngle(Angle + ((rand() - 0.5) * spread)) - var/turf/starting = get_turf(src) - if(isnull(Angle)) //Try to resolve through offsets if there's no angle set. - if(isnull(xo) || isnull(yo)) - stack_trace("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!") - qdel(src) - return - var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z) - setAngle(Get_Angle(src, target)) - original_angle = Angle - if(!nondirectional_sprite) - var/matrix/M = new - M.Turn(Angle) - transform = M - trajectory_ignore_forcemove = TRUE - forceMove(starting) - trajectory_ignore_forcemove = FALSE - trajectory = new(starting.x, starting.y, starting.z, pixel_x, pixel_y, Angle, SSprojectiles.global_pixel_speed) - last_projectile_move = world.time - fired = TRUE - if(hitscan) - process_hitscan() - if(!(datum_flags & DF_ISPROCESSING)) - START_PROCESSING(SSprojectiles, src) - pixel_move(1, FALSE) //move it now! - -/obj/item/projectile/proc/setAngle(new_angle) //wrapper for overrides. - Angle = new_angle - if(!nondirectional_sprite) - var/matrix/M = new - M.Turn(Angle) - transform = M - if(trajectory) - trajectory.set_angle(new_angle) - return TRUE - -/obj/item/projectile/forceMove(atom/target) - if(!isloc(target) || !isloc(loc) || !z) - return ..() - var/zc = target.z != z - var/old = loc - if(zc) - before_z_change(old, target) - . = ..() - if(trajectory && !trajectory_ignore_forcemove && isturf(target)) - if(hitscan) - finalize_hitscan_and_generate_tracers(FALSE) - trajectory.initialize_location(target.x, target.y, target.z, 0, 0) - if(hitscan) - record_hitscan_start(RETURN_PRECISE_POINT(src)) - if(zc) - after_z_change(old, target) - -/obj/item/projectile/proc/after_z_change(atom/olcloc, atom/newloc) - -/obj/item/projectile/proc/before_z_change(atom/oldloc, atom/newloc) - -/obj/item/projectile/vv_edit_var(var_name, var_value) - switch(var_name) - if(NAMEOF(src, Angle)) - setAngle(var_value) - return TRUE - else - return ..() - -/obj/item/projectile/proc/set_pixel_speed(new_speed) - if(trajectory) - trajectory.set_speed(new_speed) - return TRUE - return FALSE - -/obj/item/projectile/proc/record_hitscan_start(datum/point/pcache) - if(pcache) - beam_segments = list() - beam_index = pcache - beam_segments[beam_index] = null //record start. - -/obj/item/projectile/proc/process_hitscan() - var/safety = range * 3 - record_hitscan_start(RETURN_POINT_VECTOR_INCREMENT(src, Angle, MUZZLE_EFFECT_PIXEL_INCREMENT, 1)) - while(loc && !QDELETED(src)) - if(paused) - stoplag(1) - continue - if(safety-- <= 0) - if(loc) - Bump(loc) - if(!QDELETED(src)) - qdel(src) - return //Kill! - pixel_move(1, TRUE) - -/obj/item/projectile/proc/pixel_move(trajectory_multiplier, hitscanning = FALSE) - if(!loc || !trajectory) - return - last_projectile_move = world.time - if(!nondirectional_sprite && !hitscanning) - var/matrix/M = new - M.Turn(Angle) - transform = M - if(homing) - process_homing() - var/forcemoved = FALSE - for(var/i in 1 to SSprojectiles.global_iterations_per_move) - if(QDELETED(src)) - return - trajectory.increment(trajectory_multiplier) - var/turf/T = trajectory.return_turf() - if(!istype(T)) - qdel(src) - return - if(T.z != loc.z) - var/old = loc - before_z_change(loc, T) - trajectory_ignore_forcemove = TRUE - forceMove(T) - trajectory_ignore_forcemove = FALSE - after_z_change(old, loc) - if(!hitscanning) - pixel_x = trajectory.return_px() - pixel_y = trajectory.return_py() - forcemoved = TRUE - hitscan_last = loc - else if(T != loc) - step_towards(src, T) - hitscan_last = loc - if(can_hit_target(original, permutated)) - Bump(original) - if(!hitscanning && !forcemoved) - pixel_x = trajectory.return_px() - trajectory.mpx * trajectory_multiplier * SSprojectiles.global_iterations_per_move - pixel_y = trajectory.return_py() - trajectory.mpy * trajectory_multiplier * SSprojectiles.global_iterations_per_move - animate(src, pixel_x = trajectory.return_px(), pixel_y = trajectory.return_py(), time = 1, flags = ANIMATION_END_NOW) - Range() - -/obj/item/projectile/proc/process_homing() //may need speeding up in the future performance wise. - if(!homing_target) - return FALSE - var/datum/point/PT = RETURN_PRECISE_POINT(homing_target) - PT.x += CLAMP(homing_offset_x, 1, world.maxx) - PT.y += CLAMP(homing_offset_y, 1, world.maxy) - var/angle = closer_angle_difference(Angle, angle_between_points(RETURN_PRECISE_POINT(src), PT)) - setAngle(Angle + CLAMP(angle, -homing_turn_speed, homing_turn_speed)) - -/obj/item/projectile/proc/set_homing_target(atom/A) - if(!A || (!isturf(A) && !isturf(A.loc))) - return FALSE - homing = TRUE - homing_target = A - homing_offset_x = rand(homing_inaccuracy_min, homing_inaccuracy_max) - homing_offset_y = rand(homing_inaccuracy_min, homing_inaccuracy_max) - if(prob(50)) - homing_offset_x = -homing_offset_x - if(prob(50)) - homing_offset_y = -homing_offset_y - -//Returns true if the target atom is on our current turf and above the right layer -/obj/item/projectile/proc/can_hit_target(atom/target, var/list/passthrough) - return (target && ((target.layer >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(target)) && (loc == get_turf(target)) && (!(target in passthrough))) - -//Spread is FORCED! -/obj/item/projectile/proc/preparePixelProjectile(atom/target, atom/source, params, spread = 0) - var/turf/curloc = get_turf(source) - var/turf/targloc = get_turf(target) - trajectory_ignore_forcemove = TRUE - forceMove(get_turf(source)) - trajectory_ignore_forcemove = FALSE - starting = get_turf(source) - original = target - if(targloc || !params) - yo = targloc.y - curloc.y - xo = targloc.x - curloc.x - setAngle(Get_Angle(src, targloc) + spread) - - if(isliving(source) && params) - var/list/calculated = calculate_projectile_angle_and_pixel_offsets(source, params) - p_x = calculated[2] - p_y = calculated[3] - - setAngle(calculated[1] + spread) - else if(targloc) - yo = targloc.y - curloc.y - xo = targloc.x - curloc.x - setAngle(Get_Angle(src, targloc) + spread) - else - stack_trace("WARNING: Projectile [type] fired without either mouse parameters, or a target atom to aim at!") - qdel(src) - -/proc/calculate_projectile_angle_and_pixel_offsets(mob/user, params) - var/list/mouse_control = params2list(params) - var/p_x = 0 - var/p_y = 0 - var/angle = 0 - if(mouse_control["icon-x"]) - p_x = text2num(mouse_control["icon-x"]) - if(mouse_control["icon-y"]) - p_y = text2num(mouse_control["icon-y"]) - if(mouse_control["screen-loc"]) - //Split screen-loc up into X+Pixel_X and Y+Pixel_Y - var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",") - - //Split X+Pixel_X up into list(X, Pixel_X) - var/list/screen_loc_X = splittext(screen_loc_params[1],":") - - //Split Y+Pixel_Y up into list(Y, Pixel_Y) - var/list/screen_loc_Y = splittext(screen_loc_params[2],":") - var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32 - var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32 - - //Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average. - var/list/screenview = getviewsize(user.client.view) - var/screenviewX = screenview[1] * world.icon_size - var/screenviewY = screenview[2] * world.icon_size - - var/ox = round(screenviewX/2) - user.client.pixel_x //"origin" x - var/oy = round(screenviewY/2) - user.client.pixel_y //"origin" y - angle = ATAN2(y - oy, x - ox) - return list(angle, p_x, p_y) - -/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it. - ..() - if(isliving(AM) && (AM.density || AM == original) && !(src.pass_flags & PASSMOB)) - Bump(AM) - -/obj/item/projectile/Destroy() - if(hitscan) - finalize_hitscan_and_generate_tracers() - STOP_PROCESSING(SSprojectiles, src) - cleanup_beam_segments() - qdel(trajectory) - return ..() - -/obj/item/projectile/proc/cleanup_beam_segments() - QDEL_LIST_ASSOC(beam_segments) - beam_segments = list() - qdel(beam_index) - -/obj/item/projectile/proc/finalize_hitscan_and_generate_tracers(impacting = TRUE) - if(trajectory && beam_index) - var/datum/point/pcache = trajectory.copy_to() - beam_segments[beam_index] = pcache - generate_hitscan_tracers(null, null, impacting) - -/obj/item/projectile/proc/generate_hitscan_tracers(cleanup = TRUE, duration = 3, impacting = TRUE) - if(!length(beam_segments)) - return - if(tracer_type) - var/tempref = REF(src) - for(var/datum/point/p in beam_segments) - generate_tracer_between_points(p, beam_segments[p], tracer_type, color, duration, hitscan_light_range, hitscan_light_color_override, hitscan_light_intensity, tempref) - if(muzzle_type && duration > 0) - var/datum/point/p = beam_segments[1] - var/atom/movable/thing = new muzzle_type - p.move_atom_to_src(thing) - var/matrix/M = new - M.Turn(original_angle) - thing.transform = M - thing.color = color - thing.set_light(muzzle_flash_range, muzzle_flash_intensity, muzzle_flash_color_override? muzzle_flash_color_override : color) - QDEL_IN(thing, duration) - if(impacting && impact_type && duration > 0) - var/datum/point/p = beam_segments[beam_segments[beam_segments.len]] - var/atom/movable/thing = new impact_type - p.move_atom_to_src(thing) - var/matrix/M = new - M.Turn(Angle) - thing.transform = M - thing.color = color - thing.set_light(impact_light_range, impact_light_intensity, impact_light_color_override? impact_light_color_override : color) - QDEL_IN(thing, duration) - if(cleanup) - cleanup_beam_segments() - -/obj/item/projectile/experience_pressure_difference() - return + +#define MOVES_HITSCAN -1 //Not actually hitscan but close as we get without actual hitscan. +#define MUZZLE_EFFECT_PIXEL_INCREMENT 17 //How many pixels to move the muzzle flash up so your character doesn't look like they're shitting out lasers. + +/obj/item/projectile + name = "projectile" + icon = 'icons/obj/projectiles.dmi' + icon_state = "bullet" + density = FALSE + anchored = TRUE + item_flags = ABSTRACT + pass_flags = PASSTABLE + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + hitsound = 'sound/weapons/pierce.ogg' + var/hitsound_wall = "" + + resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + var/def_zone = "" //Aiming at + var/atom/movable/firer = null//Who shot it + var/suppressed = FALSE //Attack message + var/candink = FALSE //Can this projectile play the dink sound when hitting the head? + var/yo = null + var/xo = null + var/atom/original = null // the original target clicked + var/turf/starting = null // the projectile's starting turf + var/list/permutated = list() // we've passed through these atoms, don't try to hit them again + var/p_x = 16 + var/p_y = 16 // the pixel location of the tile that the player clicked. Default is the center + + //Fired processing vars + var/fired = FALSE //Have we been fired yet + var/paused = FALSE //for suspending the projectile midair + var/last_projectile_move = 0 + var/last_process = 0 + var/time_offset = 0 + var/datum/point/vector/trajectory + var/trajectory_ignore_forcemove = FALSE //instructs forceMove to NOT reset our trajectory to the new location! + + var/speed = 0.6 //Amount of deciseconds it takes for projectile to travel + var/Angle = 0 + var/original_angle = 0 //Angle at firing + var/nondirectional_sprite = FALSE //Set TRUE to prevent projectiles from having their sprites rotated based on firing angle + var/spread = 0 //amount (in degrees) of projectile spread + animate_movement = 0 //Use SLIDE_STEPS in conjunction with legacy + var/ricochets = 0 + var/ricochets_max = 2 + var/ricochet_chance = 30 + + //Hitscan + var/hitscan = FALSE //Whether this is hitscan. If it is, speed is basically ignored. + var/list/beam_segments //assoc list of datum/point or datum/point/vector, start = end. Used for hitscan effect generation. + var/datum/point/beam_index + var/turf/hitscan_last //last turf touched during hitscanning. + var/tracer_type + var/muzzle_type + var/impact_type + + //Fancy hitscan lighting effects! + var/hitscan_light_intensity = 1.5 + var/hitscan_light_range = 0.75 + var/hitscan_light_color_override + var/muzzle_flash_intensity = 3 + var/muzzle_flash_range = 1.5 + var/muzzle_flash_color_override + var/impact_light_intensity = 3 + var/impact_light_range = 2 + var/impact_light_color_override + + //Homing + var/homing = FALSE + var/atom/homing_target + var/homing_turn_speed = 10 //Angle per tick. + var/homing_inaccuracy_min = 0 //in pixels for these. offsets are set once when setting target. + var/homing_inaccuracy_max = 0 + var/homing_offset_x = 0 + var/homing_offset_y = 0 + + var/ignore_source_check = FALSE + + var/damage = 10 + var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here + var/nodamage = 0 //Determines if the projectile will skip any damage inflictions + var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb + var/projectile_type = /obj/item/projectile + var/range = 50 //This will de-increment every step. When 0, it will deletze the projectile. + var/decayedRange + var/is_reflectable = FALSE // Can it be reflected or not? + //Effects + var/stun = 0 + var/knockdown = 0 + var/knockdown_stamoverride + var/knockdown_stam_max + var/unconscious = 0 + var/irradiate = 0 + var/stutter = 0 + var/slur = 0 + var/eyeblur = 0 + var/drowsy = 0 + var/stamina = 0 + var/jitter = 0 + var/forcedodge = 0 //to pass through everything + var/dismemberment = 0 //The higher the number, the greater the bonus to dismembering. 0 will not dismember at all. + var/impact_effect_type //what type of impact effect to show when hitting something + var/log_override = FALSE //is this type spammed enough to not log? (KAs) + +/obj/item/projectile/Initialize() + . = ..() + permutated = list() + decayedRange = range + +/obj/item/projectile/proc/Range() + range-- + if(range <= 0 && loc) + on_range() + +/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range + qdel(src) + +//to get the correct limb (if any) for the projectile hit message +/mob/living/proc/check_limb_hit(hit_zone) + if(has_limbs) + return hit_zone + +/mob/living/carbon/check_limb_hit(hit_zone) + if(get_bodypart(hit_zone)) + return hit_zone + else //when a limb is missing the damage is actually passed to the chest + return BODY_ZONE_CHEST + +/obj/item/projectile/proc/prehit(atom/target) + return TRUE + +/obj/item/projectile/proc/on_hit(atom/target, blocked = FALSE) + var/turf/target_loca = get_turf(target) + + var/hitx + var/hity + if(target == original) + hitx = target.pixel_x + p_x - 16 + hity = target.pixel_y + p_y - 16 + else + hitx = target.pixel_x + rand(-8, 8) + hity = target.pixel_y + rand(-8, 8) + + if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && iswallturf(target_loca) && prob(75)) + var/turf/closed/wall/W = target_loca + if(impact_effect_type && !hitscan) + new impact_effect_type(target_loca, hitx, hity) + + W.add_dent(WALL_DENT_SHOT, hitx, hity) + + return 0 + + if(!isliving(target)) + if(impact_effect_type && !hitscan) + new impact_effect_type(target_loca, hitx, hity) + return 0 + + var/mob/living/L = target + + if(blocked != 100) // not completely blocked + if(damage && L.blood_volume && damage_type == BRUTE) + var/splatter_dir = dir + if(starting) + splatter_dir = get_dir(starting, target_loca) + var/obj/item/bodypart/B = L.get_bodypart(def_zone) + if(B && B.status == BODYPART_ROBOTIC) // So if you hit a robotic, it sparks instead of bloodspatters + do_sparks(2, FALSE, target.loc) + if(prob(25)) + new /obj/effect/decal/cleanable/oil(target_loca) + else if(isalien(L)) + new /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter(target_loca, splatter_dir) + else + if(ishuman(target)) + var/mob/living/carbon/human/H = target + new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color(H.dna.blood_type)) + else + new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color()) + if(iscarbon(L) && !HAS_TRAIT(L, TRAIT_NOMARROW)) + var/mob/living/carbon/C = L + C.bleed(damage) + else + L.add_splatter_floor(target_loca) + else if(impact_effect_type && !hitscan) + new impact_effect_type(target_loca, hitx, hity) + + var/organ_hit_text = "" + var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info. + if(limb_hit) + organ_hit_text = " in \the [parse_zone(limb_hit)]" + if(suppressed) + playsound(loc, hitsound, 5, 1, -1) + to_chat(L, "You're shot by \a [src][organ_hit_text]!") + else + if(hitsound) + var/volume = vol_by_damage() + playsound(loc, hitsound, volume, 1, -1) + L.visible_message("[L] is hit by \a [src][organ_hit_text]!", \ + "[L] is hit by \a [src][organ_hit_text]!", null, COMBAT_MESSAGE_RANGE) + if(candink && def_zone == BODY_ZONE_HEAD) + playsound(src, 'sound/weapons/dink.ogg', 30, 1) + L.on_hit(src) + + var/reagent_note + if(reagents && reagents.reagent_list) + reagent_note = " REAGENTS:" + for(var/datum/reagent/R in reagents.reagent_list) + reagent_note += R.type + " (" + reagent_note += num2text(R.volume) + ") " + + if(ismob(firer)) + log_combat(firer, L, "shot", src, reagent_note) + else + L.log_message("has been shot by [firer] with [src]", LOG_ATTACK, color="orange") + + return L.apply_effects(stun, knockdown, unconscious, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter, knockdown_stamoverride, knockdown_stam_max) + +/obj/item/projectile/proc/vol_by_damage() + if(src.damage) + return CLAMP((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then CLAMP the value between 30 and 100 + else + return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume + +/obj/item/projectile/proc/on_ricochet(atom/A) + return + +/obj/item/projectile/proc/store_hitscan_collision(datum/point/pcache) + beam_segments[beam_index] = pcache + beam_index = pcache + beam_segments[beam_index] = null + +/obj/item/projectile/Bump(atom/A) + var/datum/point/pcache = trajectory.copy_to() + if(check_ricochet(A) && check_ricochet_flag(A) && ricochets < ricochets_max) + ricochets++ + if(A.handle_ricochet(src)) + on_ricochet(A) + ignore_source_check = TRUE + range = initial(range) + if(hitscan) + store_hitscan_collision(pcache) + return TRUE + if(firer && !ignore_source_check) + if(A == firer || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech + trajectory_ignore_forcemove = TRUE + forceMove(get_turf(A)) + trajectory_ignore_forcemove = FALSE + return FALSE + + var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations. + def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use. + + if(isturf(A) && hitsound_wall) + var/volume = CLAMP(vol_by_damage() + 20, 0, 100) + if(suppressed) + volume = 5 + playsound(loc, hitsound_wall, volume, 1, -1) + + var/turf/target_turf = get_turf(A) + + if(!prehit(A)) + if(forcedodge) + trajectory_ignore_forcemove = TRUE + forceMove(target_turf) + trajectory_ignore_forcemove = FALSE + return FALSE + + var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null + if(permutation == -1 || forcedodge)// the bullet passes through a dense object! + trajectory_ignore_forcemove = TRUE + forceMove(target_turf) + trajectory_ignore_forcemove = FALSE + if(A) + permutated.Add(A) + return FALSE + else + var/atom/alt = select_target(A) + if(alt) + if(!prehit(alt)) + return FALSE + alt.bullet_act(src, def_zone) + qdel(src) + return TRUE + +/obj/item/projectile/proc/select_target(atom/A) //Selects another target from a wall if we hit a wall. + if(!A || !A.density || (A.flags_1 & ON_BORDER_1) || ismob(A) || A == original) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs or machines/structures on that tile. + return + var/turf/T = get_turf(A) + if(original in T) + return original + var/list/mob/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob) - A + var/list/mob/mobs = list() + for(var/i in possible_mobs) + var/mob/M = i + if(M.lying) + continue + mobs += M + var/mob/M = safepick(mobs) + if(M) + return M.lowest_buckled_mob() + var/obj/O = safepick(typecache_filter_list(T, GLOB.typecache_machine_or_structure) - A) + if(O) + return O + +/obj/item/projectile/proc/check_ricochet() + if(prob(ricochet_chance)) + return TRUE + return FALSE + +/obj/item/projectile/proc/check_ricochet_flag(atom/A) + if(A.flags_1 & CHECK_RICOCHET_1) + return TRUE + return FALSE + +/obj/item/projectile/proc/return_predicted_turf_after_moves(moves, forced_angle) //I say predicted because there's no telling that the projectile won't change direction/location in flight. + if(!trajectory && isnull(forced_angle) && isnull(Angle)) + return FALSE + var/datum/point/vector/current = trajectory + if(!current) + var/turf/T = get_turf(src) + current = new(T.x, T.y, T.z, pixel_x, pixel_y, isnull(forced_angle)? Angle : forced_angle, SSprojectiles.global_pixel_speed) + var/datum/point/vector/v = current.return_vector_after_increments(moves * SSprojectiles.global_iterations_per_move) + return v.return_turf() + +/obj/item/projectile/proc/return_pathing_turfs_in_moves(moves, forced_angle) + var/turf/current = get_turf(src) + var/turf/ending = return_predicted_turf_after_moves(moves, forced_angle) + return getline(current, ending) + +/obj/item/projectile/Process_Spacemove(var/movement_dir = 0) + return TRUE //Bullets don't drift in space + +/obj/item/projectile/process() + last_process = world.time + if(!loc || !fired || !trajectory) + fired = FALSE + return PROCESS_KILL + if(paused || !isturf(loc)) + last_projectile_move += world.time - last_process //Compensates for pausing, so it doesn't become a hitscan projectile when unpaused from charged up ticks. + return + var/elapsed_time_deciseconds = (world.time - last_projectile_move) + time_offset + time_offset = 0 + var/required_moves = speed > 0? FLOOR(elapsed_time_deciseconds / speed, 1) : MOVES_HITSCAN //Would be better if a 0 speed made hitscan but everyone hates those so I can't make it a universal system :< + if(required_moves == MOVES_HITSCAN) + required_moves = SSprojectiles.global_max_tick_moves + else + if(required_moves > SSprojectiles.global_max_tick_moves) + var/overrun = required_moves - SSprojectiles.global_max_tick_moves + required_moves = SSprojectiles.global_max_tick_moves + time_offset += overrun * speed + time_offset += MODULUS(elapsed_time_deciseconds, speed) + + for(var/i in 1 to required_moves) + pixel_move(1, FALSE) + +/obj/item/projectile/proc/fire(angle, atom/direct_target) + //If no angle needs to resolve it from xo/yo! + if(!log_override && firer && original) + log_combat(firer, original, "fired at", src, "from [get_area_name(src, TRUE)]") + if(direct_target) + if(prehit(direct_target)) + direct_target.bullet_act(src, def_zone) + qdel(src) + return + if(isnum(angle)) + setAngle(angle) + if(spread) + setAngle(Angle + ((rand() - 0.5) * spread)) + var/turf/starting = get_turf(src) + if(isnull(Angle)) //Try to resolve through offsets if there's no angle set. + if(isnull(xo) || isnull(yo)) + stack_trace("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!") + qdel(src) + return + var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z) + setAngle(Get_Angle(src, target)) + original_angle = Angle + if(!nondirectional_sprite) + var/matrix/M = new + M.Turn(Angle) + transform = M + trajectory_ignore_forcemove = TRUE + forceMove(starting) + trajectory_ignore_forcemove = FALSE + trajectory = new(starting.x, starting.y, starting.z, pixel_x, pixel_y, Angle, SSprojectiles.global_pixel_speed) + last_projectile_move = world.time + fired = TRUE + if(hitscan) + process_hitscan() + if(!(datum_flags & DF_ISPROCESSING)) + START_PROCESSING(SSprojectiles, src) + pixel_move(1, FALSE) //move it now! + +/obj/item/projectile/proc/setAngle(new_angle) //wrapper for overrides. + Angle = new_angle + if(!nondirectional_sprite) + var/matrix/M = new + M.Turn(Angle) + transform = M + if(trajectory) + trajectory.set_angle(new_angle) + return TRUE + +/obj/item/projectile/forceMove(atom/target) + if(!isloc(target) || !isloc(loc) || !z) + return ..() + var/zc = target.z != z + var/old = loc + if(zc) + before_z_change(old, target) + . = ..() + if(trajectory && !trajectory_ignore_forcemove && isturf(target)) + if(hitscan) + finalize_hitscan_and_generate_tracers(FALSE) + trajectory.initialize_location(target.x, target.y, target.z, 0, 0) + if(hitscan) + record_hitscan_start(RETURN_PRECISE_POINT(src)) + if(zc) + after_z_change(old, target) + +/obj/item/projectile/proc/after_z_change(atom/olcloc, atom/newloc) + +/obj/item/projectile/proc/before_z_change(atom/oldloc, atom/newloc) + +/obj/item/projectile/vv_edit_var(var_name, var_value) + switch(var_name) + if(NAMEOF(src, Angle)) + setAngle(var_value) + return TRUE + else + return ..() + +/obj/item/projectile/proc/set_pixel_speed(new_speed) + if(trajectory) + trajectory.set_speed(new_speed) + return TRUE + return FALSE + +/obj/item/projectile/proc/record_hitscan_start(datum/point/pcache) + if(pcache) + beam_segments = list() + beam_index = pcache + beam_segments[beam_index] = null //record start. + +/obj/item/projectile/proc/process_hitscan() + var/safety = range * 3 + record_hitscan_start(RETURN_POINT_VECTOR_INCREMENT(src, Angle, MUZZLE_EFFECT_PIXEL_INCREMENT, 1)) + while(loc && !QDELETED(src)) + if(paused) + stoplag(1) + continue + if(safety-- <= 0) + if(loc) + Bump(loc) + if(!QDELETED(src)) + qdel(src) + return //Kill! + pixel_move(1, TRUE) + +/obj/item/projectile/proc/pixel_move(trajectory_multiplier, hitscanning = FALSE) + if(!loc || !trajectory) + return + last_projectile_move = world.time + if(!nondirectional_sprite && !hitscanning) + var/matrix/M = new + M.Turn(Angle) + transform = M + if(homing) + process_homing() + var/forcemoved = FALSE + for(var/i in 1 to SSprojectiles.global_iterations_per_move) + if(QDELETED(src)) + return + trajectory.increment(trajectory_multiplier) + var/turf/T = trajectory.return_turf() + if(!istype(T)) + qdel(src) + return + if(T.z != loc.z) + var/old = loc + before_z_change(loc, T) + trajectory_ignore_forcemove = TRUE + forceMove(T) + trajectory_ignore_forcemove = FALSE + after_z_change(old, loc) + if(!hitscanning) + pixel_x = trajectory.return_px() + pixel_y = trajectory.return_py() + forcemoved = TRUE + hitscan_last = loc + else if(T != loc) + step_towards(src, T) + hitscan_last = loc + if(can_hit_target(original, permutated)) + Bump(original) + if(!hitscanning && !forcemoved) + pixel_x = trajectory.return_px() - trajectory.mpx * trajectory_multiplier * SSprojectiles.global_iterations_per_move + pixel_y = trajectory.return_py() - trajectory.mpy * trajectory_multiplier * SSprojectiles.global_iterations_per_move + animate(src, pixel_x = trajectory.return_px(), pixel_y = trajectory.return_py(), time = 1, flags = ANIMATION_END_NOW) + Range() + +/obj/item/projectile/proc/process_homing() //may need speeding up in the future performance wise. + if(!homing_target) + return FALSE + var/datum/point/PT = RETURN_PRECISE_POINT(homing_target) + PT.x += CLAMP(homing_offset_x, 1, world.maxx) + PT.y += CLAMP(homing_offset_y, 1, world.maxy) + var/angle = closer_angle_difference(Angle, angle_between_points(RETURN_PRECISE_POINT(src), PT)) + setAngle(Angle + CLAMP(angle, -homing_turn_speed, homing_turn_speed)) + +/obj/item/projectile/proc/set_homing_target(atom/A) + if(!A || (!isturf(A) && !isturf(A.loc))) + return FALSE + homing = TRUE + homing_target = A + homing_offset_x = rand(homing_inaccuracy_min, homing_inaccuracy_max) + homing_offset_y = rand(homing_inaccuracy_min, homing_inaccuracy_max) + if(prob(50)) + homing_offset_x = -homing_offset_x + if(prob(50)) + homing_offset_y = -homing_offset_y + +//Returns true if the target atom is on our current turf and above the right layer +/obj/item/projectile/proc/can_hit_target(atom/target, var/list/passthrough) + return (target && ((target.layer >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(target)) && (loc == get_turf(target)) && (!(target in passthrough))) + +//Spread is FORCED! +/obj/item/projectile/proc/preparePixelProjectile(atom/target, atom/source, params, spread = 0) + var/turf/curloc = get_turf(source) + var/turf/targloc = get_turf(target) + trajectory_ignore_forcemove = TRUE + forceMove(get_turf(source)) + trajectory_ignore_forcemove = FALSE + starting = get_turf(source) + original = target + if(targloc || !params) + yo = targloc.y - curloc.y + xo = targloc.x - curloc.x + setAngle(Get_Angle(src, targloc) + spread) + + if(isliving(source) && params) + var/list/calculated = calculate_projectile_angle_and_pixel_offsets(source, params) + p_x = calculated[2] + p_y = calculated[3] + + setAngle(calculated[1] + spread) + else if(targloc) + yo = targloc.y - curloc.y + xo = targloc.x - curloc.x + setAngle(Get_Angle(src, targloc) + spread) + else + stack_trace("WARNING: Projectile [type] fired without either mouse parameters, or a target atom to aim at!") + qdel(src) + +/proc/calculate_projectile_angle_and_pixel_offsets(mob/user, params) + var/list/mouse_control = params2list(params) + var/p_x = 0 + var/p_y = 0 + var/angle = 0 + if(mouse_control["icon-x"]) + p_x = text2num(mouse_control["icon-x"]) + if(mouse_control["icon-y"]) + p_y = text2num(mouse_control["icon-y"]) + if(mouse_control["screen-loc"]) + //Split screen-loc up into X+Pixel_X and Y+Pixel_Y + var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",") + + //Split X+Pixel_X up into list(X, Pixel_X) + var/list/screen_loc_X = splittext(screen_loc_params[1],":") + + //Split Y+Pixel_Y up into list(Y, Pixel_Y) + var/list/screen_loc_Y = splittext(screen_loc_params[2],":") + var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32 + var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32 + + //Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average. + var/list/screenview = getviewsize(user.client.view) + var/screenviewX = screenview[1] * world.icon_size + var/screenviewY = screenview[2] * world.icon_size + + var/ox = round(screenviewX/2) - user.client.pixel_x //"origin" x + var/oy = round(screenviewY/2) - user.client.pixel_y //"origin" y + angle = ATAN2(y - oy, x - ox) + return list(angle, p_x, p_y) + +/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it. + ..() + if(isliving(AM) && (AM.density || AM == original) && !(src.pass_flags & PASSMOB)) + Bump(AM) + +/obj/item/projectile/Destroy() + if(hitscan) + finalize_hitscan_and_generate_tracers() + STOP_PROCESSING(SSprojectiles, src) + cleanup_beam_segments() + qdel(trajectory) + return ..() + +/obj/item/projectile/proc/cleanup_beam_segments() + QDEL_LIST_ASSOC(beam_segments) + beam_segments = list() + qdel(beam_index) + +/obj/item/projectile/proc/finalize_hitscan_and_generate_tracers(impacting = TRUE) + if(trajectory && beam_index) + var/datum/point/pcache = trajectory.copy_to() + beam_segments[beam_index] = pcache + generate_hitscan_tracers(null, null, impacting) + +/obj/item/projectile/proc/generate_hitscan_tracers(cleanup = TRUE, duration = 3, impacting = TRUE) + if(!length(beam_segments)) + return + if(tracer_type) + var/tempref = REF(src) + for(var/datum/point/p in beam_segments) + generate_tracer_between_points(p, beam_segments[p], tracer_type, color, duration, hitscan_light_range, hitscan_light_color_override, hitscan_light_intensity, tempref) + if(muzzle_type && duration > 0) + var/datum/point/p = beam_segments[1] + var/atom/movable/thing = new muzzle_type + p.move_atom_to_src(thing) + var/matrix/M = new + M.Turn(original_angle) + thing.transform = M + thing.color = color + thing.set_light(muzzle_flash_range, muzzle_flash_intensity, muzzle_flash_color_override? muzzle_flash_color_override : color) + QDEL_IN(thing, duration) + if(impacting && impact_type && duration > 0) + var/datum/point/p = beam_segments[beam_segments[beam_segments.len]] + var/atom/movable/thing = new impact_type + p.move_atom_to_src(thing) + var/matrix/M = new + M.Turn(Angle) + thing.transform = M + thing.color = color + thing.set_light(impact_light_range, impact_light_intensity, impact_light_color_override? impact_light_color_override : color) + QDEL_IN(thing, duration) + if(cleanup) + cleanup_beam_segments() + +/obj/item/projectile/experience_pressure_difference() + return diff --git a/code/modules/projectiles/projectile/bullets/dart_syringe.dm b/code/modules/projectiles/projectile/bullets/dart_syringe.dm index b75131ed..b86a3aec 100644 --- a/code/modules/projectiles/projectile/bullets/dart_syringe.dm +++ b/code/modules/projectiles/projectile/bullets/dart_syringe.dm @@ -1,88 +1,87 @@ -/obj/item/projectile/bullet/dart - name = "dart" - icon_state = "cbbolt" - damage = 6 - var/piercing = FALSE - -/obj/item/projectile/bullet/dart/Initialize() - . = ..() - create_reagents(50, NO_REACT) - -/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = FALSE, skip = FALSE) - if(iscarbon(target)) - var/mob/living/carbon/M = target - if(blocked != 100) // not completely blocked - if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. - ..() - if(skip == TRUE) - return - reagents.reaction(M, INJECT) - reagents.trans_to(M, reagents.total_volume) - return TRUE - else - blocked = 100 - target.visible_message("\The [src] was deflected!", \ - "You were protected against \the [src]!") - - ..(target, blocked) - DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) - reagents.handle_reactions() - return TRUE - -/obj/item/projectile/bullet/dart/metalfoam/Initialize() - . = ..() - reagents.add_reagent("aluminium", 15) - reagents.add_reagent("foaming_agent", 5) - reagents.add_reagent("facid", 5) - -/obj/item/projectile/bullet/dart/syringe - name = "syringe" - icon_state = "syringeproj" - -//I am in a mess of my own making -/obj/item/projectile/bullet/dart/syringe/dart - name = "Smartdart" - icon_state = "dartproj" - damage = 0 - var/emptrig = FALSE - -/obj/item/projectile/bullet/dart/syringe/dart/on_hit(atom/target, blocked = FALSE) - if(iscarbon(target)) - var/mob/living/carbon/M = target - if(blocked != 100) - if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. - ..(target, blocked, TRUE) - for(var/datum/reagent/R in reagents.reagent_list) //OD prevention time! - if(istype(R, /datum/reagent/medicine)) //Is this a medicine? - if(M.reagents.has_reagent(R.id)) - if(R.overdose_threshold == 0 || emptrig == TRUE) //Is there a possible OD? - M.reagents.add_reagent(R.id, R.volume) - else - var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - M.reagents.get_reagent_amount(R.id)) -1) - M.reagents.add_reagent(R.id, transVol) - else - if(!R.overdose_threshold == 0) - var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1) - M.reagents.add_reagent(R.id, transVol) - else - M.reagents.add_reagent(R.id, R.volume) - - - - target.visible_message("\The [src] beeps!") - to_chat("You feel a tiny prick as a smartdart embeds itself in you with a beep.") - return TRUE - else - blocked = 100 - target.visible_message("\The [src] was deflected!", \ - "You see a [src] bounce off you, booping sadly!") - - target.visible_message("\The [src] fails to land on target!") - return TRUE - -//Chemlight was here, adding dumb bussing things - -/obj/item/projectile/bullet/dart/syringe/debug - name = "syringe" - icon_state = "syringeproj" +/obj/item/projectile/bullet/dart + name = "dart" + icon_state = "cbbolt" + damage = 6 + var/piercing = FALSE + +/obj/item/projectile/bullet/dart/Initialize() + . = ..() + create_reagents(50, NO_REACT) + +/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = FALSE, skip = FALSE) + if(iscarbon(target)) + var/mob/living/carbon/M = target + if(blocked != 100) // not completely blocked + if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. + ..() + if(skip == TRUE) + return + reagents.reaction(M, INJECT) + reagents.trans_to(M, reagents.total_volume) + return TRUE + else + blocked = 100 + target.visible_message("\The [src] was deflected!", \ + "You were protected against \the [src]!") + + ..(target, blocked) + DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT) + reagents.handle_reactions() + return TRUE + +/obj/item/projectile/bullet/dart/metalfoam/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/aluminium, 15) + reagents.add_reagent(/datum/reagent/foaming_agent, 5) + reagents.add_reagent(/datum/reagent/toxin/acid, 5) + +/obj/item/projectile/bullet/dart/syringe + name = "syringe" + icon_state = "syringeproj" + +//I am in a mess of my own making +/obj/item/projectile/bullet/dart/syringe/dart + name = "Smartdart" + icon_state = "dartproj" + damage = 0 + var/emptrig = FALSE + +/obj/item/projectile/bullet/dart/syringe/dart/on_hit(atom/target, blocked = FALSE) + if(iscarbon(target)) + var/mob/living/carbon/M = target + if(blocked != 100) + if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. + ..(target, blocked, TRUE) + for(var/datum/reagent/medicine/R in reagents.reagent_list) //OD prevention time! + if(M.reagents.has_reagent(R.type)) + if(R.overdose_threshold == 0 || emptrig == TRUE) //Is there a possible OD? + M.reagents.add_reagent(R.type, R.volume) + else + var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - M.reagents.get_reagent_amount(R.type)) -1) + M.reagents.add_reagent(R.type, transVol) + else + if(!R.overdose_threshold == 0) + var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1) + M.reagents.add_reagent(R.type, transVol) + else + M.reagents.add_reagent(R.type, R.volume) + + + + target.visible_message("\The [src] beeps!") + to_chat("You feel a tiny prick as a smartdart embeds itself in you with a beep.") + return TRUE + else + blocked = 100 + target.visible_message("\The [src] was deflected!", \ + "You see a [src] bounce off you, booping sadly!") + + target.visible_message("\The [src] fails to land on target!") + return TRUE + +//Chemlight was here, adding dumb bussing things + +/obj/item/projectile/bullet/dart/syringe/debug + name = "syringe" + icon_state = "syringeproj" damage = 0 \ No newline at end of file diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 8074bb67..e2e99560 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -11,13 +11,13 @@ for(var/path in paths) var/datum/reagent/D = new path() - GLOB.chemical_reagents_list[D.id] = D + GLOB.chemical_reagents_list[path] = D /proc/build_chemical_reactions_list() //Chemical Reactions - Initialises all /datum/chemical_reaction into a list // It is filtered into multiple lists within a list. // For example: - // chemical_reaction_list["plasma"] is a list of all reactions relating to plasma + // chemical_reaction_list[/datum/reagent/toxin/plasma] is a list of all reactions relating to plasma if(GLOB.chemical_reactions_list) return @@ -32,14 +32,11 @@ var/datum/chemical_reaction/D = new path() var/list/reaction_ids = list() - if(!D.id) - continue - if(D.required_reagents && D.required_reagents.len) for(var/reaction in D.required_reagents) reaction_ids += reaction - // Create filters based on each reagent id in the required reagents list + // Create filters based on each reagent type in the required reagents list for(var/id in reaction_ids) if(!GLOB.chemical_reactions_list[id]) GLOB.chemical_reactions_list[id] = list() @@ -63,7 +60,7 @@ var/targetVol = 0 //the target volume, i.e. the total amount that can be created during a fermichem reaction. var/reactedVol = 0 //how much of the reagent is reacted during a fermireaction var/fermiIsReacting = FALSE //that prevents multiple reactions from occurring (i.e. add_reagent calls to process_reactions(), this stops any extra reactions.) - var/fermiReactID = null //ID of the chem being made during a fermireaction, kept here so it's cache isn't lost between loops/procs. + var/fermiReactID //instance of the chem reaction used during a fermireaction, kept here so it's cache isn't lost between loops/procs. /datum/reagents/New(maximum=100, new_flags) maximum_volume = maximum @@ -96,7 +93,7 @@ var/list/data = list() for(var/r in reagent_list) //no reagents will be left behind var/datum/reagent/R = r - data += "[R.id] ([round(R.volume, CHEMICAL_QUANTISATION_LEVEL)]u)" + data += "[R.type] ([round(R.volume, CHEMICAL_QUANTISATION_LEVEL)]u)" //Using IDs because SOME chemicals (I'm looking at you, chlorhydrate-beer) have the same names as other chemicals. return english_list(data) @@ -117,7 +114,7 @@ current_list_element = 1 var/datum/reagent/R = cached_reagents[current_list_element] - remove_reagent(R.id, 1) + remove_reagent(R.type, 1) current_list_element++ total_transfered++ @@ -134,8 +131,8 @@ var/part = amount / total_volume for(var/reagent in cached_reagents) var/datum/reagent/R = reagent - remove_reagent(R.id, R.volume * part, ignore_pH = TRUE) - + remove_reagent(R.type, R.volume * part, ignore_pH = TRUE) + pH = REAGENT_NORMAL_PH update_total() handle_reactions() return amount @@ -154,15 +151,15 @@ /datum/reagents/proc/get_master_reagent_id() var/list/cached_reagents = reagent_list - var/id + var/max_type var/max_volume = 0 for(var/reagent in cached_reagents) var/datum/reagent/R = reagent if(R.volume > max_volume) max_volume = R.volume - id = R.id + max_type = R.type - return id + return max_type /datum/reagents/proc/get_master_reagent() var/list/cached_reagents = reagent_list @@ -200,9 +197,9 @@ trans_data = copy_data(T) - R.add_reagent(T.id, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered. + R.add_reagent(T.type, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered. - remove_reagent(T.id, transfer_amount, ignore_pH = TRUE) + remove_reagent(T.type, transfer_amount, ignore_pH = TRUE) update_total() R.update_total() @@ -234,7 +231,7 @@ var/copy_amount = T.volume * part if(preserve_data) trans_data = T.data - R.add_reagent(T.id, copy_amount * multiplier, trans_data) + R.add_reagent(T.type, copy_amount * multiplier, trans_data) src.update_total() R.update_total() @@ -258,12 +255,12 @@ var/trans_data = null for (var/CR in cached_reagents) var/datum/reagent/current_reagent = CR - if(current_reagent.id == reagent) + if(current_reagent.type == reagent) if(preserve_data) trans_data = current_reagent.data - R.add_reagent(current_reagent.id, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE) + R.add_reagent(current_reagent.type, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE) - remove_reagent(current_reagent.id, amount, 1) + remove_reagent(current_reagent.type, amount, 1) break src.update_total() @@ -315,18 +312,21 @@ var/datum/reagent/R = addiction if(C && R) R.addiction_stage++ - if(1 <= R.addiction_stage && R.addiction_stage <= R.addiction_stage1_end) - need_mob_update += R.addiction_act_stage1(C) - else if(R.addiction_stage1_end <= R.addiction_stage && R.addiction_stage <= R.addiction_stage2_end) - need_mob_update += R.addiction_act_stage2(C) - else if(R.addiction_stage2_end <= R.addiction_stage && R.addiction_stage <= R.addiction_stage3_end) - need_mob_update += R.addiction_act_stage3(C) - else if(R.addiction_stage3_end <= R.addiction_stage && R.addiction_stage <= R.addiction_stage4_end) - need_mob_update += R.addiction_act_stage4(C) - else if(R.addiction_stage4_end <= R.addiction_stage) - to_chat(C, "You feel like you've gotten over your need for [R.name].") - SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.id]_addiction") - cached_addictions.Remove(R) + switch(R.addiction_stage) + if(1 to R.addiction_stage1_end) + need_mob_update += R.addiction_act_stage1(C) + if(R.addiction_stage1_end to R.addiction_stage2_end) + need_mob_update += R.addiction_act_stage2(C) + if(R.addiction_stage2_end to R.addiction_stage3_end) + need_mob_update += R.addiction_act_stage3(C) + if(R.addiction_stage3_end to R.addiction_stage4_end) + need_mob_update += R.addiction_act_stage4(C) + if(R.addiction_stage4_end to INFINITY) + to_chat(C, "You feel like you've gotten over your need for [R.name].") + SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_addiction") + cached_addictions.Remove(R) + else + SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_overdose") addiction_tick++ if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates. C.updatehealth() @@ -383,7 +383,7 @@ reaction_occurred = 0 for(var/reagent in cached_reagents) var/datum/reagent/R = reagent - for(var/reaction in cached_reactions[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id + for(var/reaction in cached_reactions[R.type]) // Was a big list but now it should be smaller since we filtered it with our reagent type if(!reaction) continue @@ -630,7 +630,7 @@ deltapH = 1 //This should never proc: else - WARNING("[my_atom] attempted to determine FermiChem pH for '[C.id]' which broke for some reason! ([usr])") + WARNING("[my_atom] attempted to determine FermiChem pH for '[C.type]' which broke for some reason! ([usr])") //Calculate DeltaT (Deviation of T from optimal) if (cached_temp < C.OptimalTempMax && cached_temp >= C.OptimalTempMin) @@ -677,7 +677,7 @@ //Above should reduce yeild based on holder purity. //Purity Check for(var/datum/reagent/R in my_atom.reagents.reagent_list) - if(P == R.id) + if(P == R.type) if (R.purity < C.PurityMin)//If purity is below the min, blow it up. fermiIsReacting = FALSE SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[P] explosion")) @@ -720,7 +720,7 @@ return cachedPurity/i /datum/reagents/proc/uncache_purity(id) - var/datum/reagent/R = has_reagent("[id]") + var/datum/reagent/R = has_reagent(id) if(!R) return if(R.cached_purity == 1) @@ -731,15 +731,15 @@ var/list/cached_reagents = reagent_list for(var/_reagent in cached_reagents) var/datum/reagent/R = _reagent - if(R.id != reagent) - del_reagent(R.id) + if(R.type != reagent) + del_reagent(R.type) update_total() /datum/reagents/proc/del_reagent(reagent) var/list/cached_reagents = reagent_list for(var/_reagent in cached_reagents) var/datum/reagent/R = _reagent - if(R.id == reagent) + if(R.type == reagent) if(my_atom && isliving(my_atom)) var/mob/living/M = my_atom if(R.metabolizing) @@ -758,10 +758,10 @@ total_volume = 0 for(var/reagent in cached_reagents) var/datum/reagent/R = reagent - if(R.volume == 0) - del_reagent(R.id) + if(R.volume <= 0)//For clarity + del_reagent(R.type) if((R.volume < 0.01) && !fermiIsReacting) - del_reagent(R.id) + del_reagent(R.type) else total_volume += R.volume if(!reagent_list) @@ -772,7 +772,7 @@ var/list/cached_reagents = reagent_list for(var/reagent in cached_reagents) var/datum/reagent/R = reagent - del_reagent(R.id) + del_reagent(R.type) pH = REAGENT_NORMAL_PH return 0 @@ -838,13 +838,13 @@ WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])") return FALSE - if (D.id == "water" && no_react == FALSE && !istype(my_atom, /obj/item/reagent_containers/food)) //Do like an otter, add acid to water, but also don't blow up botany. - if (pH <= 2) + if (D.type == /datum/reagent/water && !no_react && !istype(my_atom, /obj/item/reagent_containers/food)) //Do like an otter, add acid to water, but also don't blow up botany. + if (pH < 2) SSblackbox.record_feedback("tally", "fermi_chem", 1, "water-acid explosions") var/datum/effect_system/smoke_spread/chem/s = new var/turf/T = get_turf(my_atom) var/datum/reagents/R = new/datum/reagents(3000) - R.add_reagent("fermiAcid", amount) + R.add_reagent(/datum/reagent/fermi/fermiAcid, amount) for (var/datum/reagent/reagentgas in reagent_list) R.add_reagent(reagentgas, amount/5) remove_reagent(reagentgas, amount/5) @@ -892,7 +892,7 @@ //add the reagent to the existing if it exists for(var/A in cached_reagents) var/datum/reagent/R = A - if (R.id == reagent) //IF MERGING + if (R.type == reagent) //IF MERGING //Add amount and equalize purity R.volume += round(amount, CHEMICAL_QUANTISATION_LEVEL) R.purity = ((R.purity * R.volume) + (other_purity * amount)) /((R.volume + amount)) //This should add the purity to the product @@ -934,7 +934,7 @@ return TRUE -/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null) // Like add_reagent but you can enter a list. Format it like this: list("toxin" = 10, "beer" = 15) +/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null) // Like add_reagent but you can enter a list. Format it like this: list(/datum/reagent/toxin = 10, /datum/reagent/consumable/ethanol/beer = 15) for(var/r_id in list_reagents) var/amt = list_reagents[r_id] add_reagent(r_id, amt, data) @@ -956,7 +956,7 @@ for(var/A in cached_reagents) var/datum/reagent/R = A - if (R.id == reagent) + if (R.type == reagent) if((total_volume - amount) <= 0)//Because this can result in 0, I don't want it to crash. pH = 7 //In practice this is really confusing and players feel like it randomly melts their beakers, but I'm not sure how else to handle it. We'll see how it goes and I can remove this if it confuses people. @@ -983,7 +983,7 @@ var/list/cached_reagents = reagent_list for(var/_reagent in cached_reagents) var/datum/reagent/R = _reagent - if (R.id == reagent) + if (R.type == reagent) if(!amount) return R else @@ -998,7 +998,7 @@ var/list/cached_reagents = reagent_list for(var/_reagent in cached_reagents) var/datum/reagent/R = _reagent - if (R.id == reagent) + if (R.type == reagent) return round(R.volume, CHEMICAL_QUANTISATION_LEVEL) return 0 @@ -1031,7 +1031,7 @@ // We found a match, proceed to remove the reagent. Keep looping, we might find other reagents of the same type. if(matches) // Have our other proc handle removement - has_removed_reagent = remove_reagent(R.id, amount, safety) + has_removed_reagent = remove_reagent(R.type, amount, safety) return has_removed_reagent @@ -1040,14 +1040,14 @@ var/list/cached_reagents = reagent_list for(var/reagent in cached_reagents) var/datum/reagent/R = reagent - if(R.id == reagent_id) + if(R.type == reagent_id) return R.data /datum/reagents/proc/set_data(reagent_id, new_data) var/list/cached_reagents = reagent_list for(var/reagent in cached_reagents) var/datum/reagent/R = reagent - if(R.id == reagent_id) + if(R.type == reagent_id) R.data = new_data /datum/reagents/proc/copy_data(datum/reagent/current_reagent) @@ -1140,12 +1140,12 @@ reagents = new/datum/reagents(max_vol, flags) reagents.my_atom = src -/proc/get_random_reagent_id() // Returns a random reagent ID minus blacklisted reagents +/proc/get_random_reagent_id() // Returns a random reagent type minus blacklisted reagents var/static/list/random_reagents = list() if(!random_reagents.len) for(var/thing in subtypesof(/datum/reagent)) var/datum/reagent/R = thing if(initial(R.can_synth)) - random_reagents += initial(R.id) + random_reagents += R var/picked_reagent = pick(random_reagents) return picked_reagent \ No newline at end of file diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index bd9edec1..f3cac652 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -1,3 +1,16 @@ +/proc/translate_legacy_chem_id(id) + switch (id) + if ("sacid") + return "sulphuricacid" + if ("facid") + return "fluorosulfuricacid" + if ("co2") + return "carbondioxide" + if ("mine_salve") + return "minerssalve" + else + return ckey(id) + /obj/machinery/chem_dispenser name = "chem dispenser" desc = "Creates and dispenses chemicals." @@ -21,65 +34,66 @@ var/macrotier = 1 var/obj/item/reagent_containers/beaker = null var/list/dispensable_reagents = list( - "hydrogen", - "lithium", - "carbon", - "nitrogen", - "oxygen", - "fluorine", - "sodium", - "aluminium", - "silicon", - "phosphorus", - "sulfur", - "chlorine", - "potassium", - "iron", - "copper", - "mercury", - "radium", - "water", - "ethanol", - "sugar", - "sacid", - "welding_fuel", - "silver", - "iodine", - "bromine", - "stable_plasma" + /datum/reagent/hydrogen, + /datum/reagent/lithium, + /datum/reagent/carbon, + /datum/reagent/nitrogen, + /datum/reagent/oxygen, + /datum/reagent/fluorine, + /datum/reagent/sodium, + /datum/reagent/aluminium, + /datum/reagent/silicon, + /datum/reagent/phosphorus, + /datum/reagent/sulfur, + /datum/reagent/chlorine, + /datum/reagent/potassium, + /datum/reagent/iron, + /datum/reagent/copper, + /datum/reagent/mercury, + /datum/reagent/radium, + /datum/reagent/water, + /datum/reagent/consumable/ethanol, + /datum/reagent/consumable/sugar, + /datum/reagent/toxin/acid, + /datum/reagent/fuel, + /datum/reagent/silver, + /datum/reagent/iodine, + /datum/reagent/bromine, + /datum/reagent/stable_plasma ) //these become available once upgraded. var/list/upgrade_reagents = list( - "oil", - "ammonia", - "ash" + /datum/reagent/oil, + /datum/reagent/ammonia, + /datum/reagent/ash ) var/list/upgrade_reagents2 = list( - "acetone", - "phenol", - "diethylamine" + /datum/reagent/acetone, + /datum/reagent/phenol, + /datum/reagent/diethylamine ) var/list/upgrade_reagents3 = list( - "mine_salve", - "toxin" + /datum/reagent/medicine/mine_salve, + /datum/reagent/toxin ) var/list/emagged_reagents = list( - "space_drugs", - "plasma", - "frostoil", - "carpotoxin", - "histamine", - "morphine" + /datum/reagent/drug/space_drugs, + /datum/reagent/toxin/plasma, + /datum/reagent/consumable/frostoil, + /datum/reagent/toxin/carpotoxin, + /datum/reagent/toxin/histamine, + /datum/reagent/medicine/morphine ) var/list/saved_recipes = list() /obj/machinery/chem_dispenser/Initialize() . = ..() - dispensable_reagents = sortList(dispensable_reagents) + for(var/list/L in list(dispensable_reagents, emagged_reagents, upgrade_reagents, upgrade_reagents2, upgrade_reagents3)) + L = sortList(L, /proc/cmp_reagents_asc) update_icon() /obj/machinery/chem_dispenser/Destroy() @@ -212,7 +226,7 @@ var/chemname = temp.name if(is_hallucinating && prob(5)) chemname = "[pick_list_replacements("hallucination.json", "chemicals")]" - chemicals.Add(list(list("title" = chemname, "id" = temp.id))) + chemicals.Add(list(list("title" = chemname, "id" = ckey(temp.name)))) for(var/recipe in saved_recipes) recipes.Add(list(recipe)) data["chemicals"] = chemicals @@ -234,7 +248,7 @@ if("dispense") if(!is_operational() || QDELETED(cell)) return - var/reagent = params["reagent"] + var/reagent = GLOB.name2reagent[params["reagent"]] if(beaker && dispensable_reagents.Find(reagent)) var/datum/reagents/R = beaker.reagents var/free = R.maximum_volume - R.total_volume @@ -266,7 +280,7 @@ var/res = get_macro_resolution() for(var/key in chemicals_to_dispense) // i suppose you could edit the list locally before passing it var/list/keysplit = splittext(key," ") - var/r_id = keysplit[1] + var/r_id = GLOB.name2reagent[translate_legacy_chem_id(keysplit[1])] if(beaker && dispensable_reagents.Find(r_id)) // but since we verify we have the reagent, it'll be fine var/datum/reagents/R = beaker.reagents var/free = R.maximum_volume - R.total_volume @@ -298,7 +312,8 @@ var/resmismatch = FALSE for(var/reagents in first_process) var/list/reagent = splittext(reagents, "=") - if(dispensable_reagents.Find(reagent[1])) + var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent[1])] + if(dispensable_reagents.Find(reagent_id)) if (!resmismatch && !check_macro_part(reagents, res)) resmismatch = TRUE continue @@ -473,52 +488,50 @@ nopower_state = null pass_flags = PASSTABLE dispensable_reagents = list( - "water", - "ice", - "coffee", - "cream", - "tea", - "icetea", - "cola", - "spacemountainwind", - "dr_gibb", - "space_up", - "tonic", - "sodawater", - "lemon_lime", - "pwr_game", - "shamblers", - "sugar", - "pineapplejuice", - "orangejuice", - "grenadine", - "limejuice", - "tomatojuice", - "lemonjuice", - "menthol" + /datum/reagent/water, + /datum/reagent/consumable/ice, + /datum/reagent/consumable/coffee, + /datum/reagent/consumable/cream, + /datum/reagent/consumable/tea, + /datum/reagent/consumable/icetea, + /datum/reagent/consumable/space_cola, + /datum/reagent/consumable/spacemountainwind, + /datum/reagent/consumable/dr_gibb, + /datum/reagent/consumable/space_up, + /datum/reagent/consumable/tonic, + /datum/reagent/consumable/sodawater, + /datum/reagent/consumable/lemon_lime, + /datum/reagent/consumable/pwr_game, + /datum/reagent/consumable/shamblers, + /datum/reagent/consumable/sugar, + /datum/reagent/consumable/orangejuice, + /datum/reagent/consumable/grenadine, + /datum/reagent/consumable/limejuice, + /datum/reagent/consumable/tomatojuice, + /datum/reagent/consumable/lemonjuice, + /datum/reagent/consumable/menthol ) upgrade_reagents = list( - "mushroomhallucinogen", - "nothing", - "cryoxadone", - "vanilla", - "peachjuice" + /datum/reagent/drug/mushroomhallucinogen, + /datum/reagent/consumable/nothing, + /datum/reagent/medicine/cryoxadone, + /datum/reagent/consumable/vanilla, + /datum/reagent/consumable/peachjuice ) upgrade_reagents2 = list( - "banana", - "berryjuice", - "strawberryjuice" + /datum/reagent/consumable/banana, + /datum/reagent/consumable/berryjuice, + /datum/reagent/consumable/strawberryjuice ) upgrade_reagents3 = null emagged_reagents = list( - "thirteenloko", - "changelingsting", - "whiskeycola", - "mindbreaker", - "tirizene" + /datum/reagent/consumable/ethanol/thirteenloko, + /datum/reagent/consumable/ethanol/changelingsting, + /datum/reagent/consumable/ethanol/whiskey_cola, + /datum/reagent/toxin/mindbreaker, + /datum/reagent/toxin/staminatoxin ) - /obj/machinery/chem_dispenser/drinks/fullupgrade //fully ugpraded stock parts, emagged desc = "Contains a large reservoir of soft drinks. This model has had its safeties shorted out." obj_flags = CAN_BE_HIT | EMAGGED @@ -544,40 +557,39 @@ icon_state = "booze_dispenser" circuit = /obj/item/circuitboard/machine/chem_dispenser/drinks/beer dispensable_reagents = list( - "beer", - "kahlua", - "whiskey", - "wine", - "vodka", - "gin", - "rum", - "tequila", - "vermouth", - "cognac", - "ale", - "absinthe", - "hcider", - "creme_de_menthe", - "creme_de_cacao", - "creme_de_coconut", - "triple_sec", - "sake", - "applejack" + /datum/reagent/consumable/ethanol/beer, + /datum/reagent/consumable/ethanol/kahlua, + /datum/reagent/consumable/ethanol/whiskey, + /datum/reagent/consumable/ethanol/wine, + /datum/reagent/consumable/ethanol/vodka, + /datum/reagent/consumable/ethanol/gin, + /datum/reagent/consumable/ethanol/rum, + /datum/reagent/consumable/ethanol/tequila, + /datum/reagent/consumable/ethanol/vermouth, + /datum/reagent/consumable/ethanol/cognac, + /datum/reagent/consumable/ethanol/ale, + /datum/reagent/consumable/ethanol/absinthe, + /datum/reagent/consumable/ethanol/hcider, + /datum/reagent/consumable/ethanol/creme_de_menthe, + /datum/reagent/consumable/ethanol/creme_de_cacao, + /datum/reagent/consumable/ethanol/triple_sec, + /datum/reagent/consumable/ethanol/sake, + /datum/reagent/consumable/ethanol/applejack ) upgrade_reagents = list( - "ethanol", - "fernet" + /datum/reagent/consumable/ethanol, + /datum/reagent/consumable/ethanol/fernet ) upgrade_reagents2 = null upgrade_reagents3 = null emagged_reagents = list( - "iron", - "alexander", - "clownstears", - "minttoxin", - "atomicbomb", - "aphro", - "aphro+" + /datum/reagent/iron, + /datum/reagent/consumable/ethanol/alexander, + /datum/reagent/consumable/clownstears, + /datum/reagent/toxin/minttoxin, + /datum/reagent/consumable/ethanol/atomicbomb, + /datum/reagent/drug/aphrodisiac, + /datum/reagent/drug/aphrodisiacplus ) /obj/machinery/chem_dispenser/drinks/beer/fullupgrade //fully ugpraded stock parts, emagged @@ -601,9 +613,9 @@ /obj/machinery/chem_dispenser/mutagen name = "mutagen dispenser" desc = "Creates and dispenses mutagen." - dispensable_reagents = list("mutagen") + dispensable_reagents = list(/datum/reagent/toxin/mutagen) upgrade_reagents = null - emagged_reagents = list("plasma") + emagged_reagents = list(/datum/reagent/toxin/plasma) /obj/machinery/chem_dispenser/mutagensaltpeter @@ -612,19 +624,19 @@ flags_1 = NODECONSTRUCT_1 dispensable_reagents = list( - "mutagen", - "saltpetre", - "eznutriment", - "left4zednutriment", - "robustharvestnutriment", - "water", - "plantbgone", - "weedkiller", - "pestkiller", - "cryoxadone", - "ammonia", - "ash", - "diethylamine") + /datum/reagent/toxin/mutagen, + /datum/reagent/saltpetre, + /datum/reagent/plantnutriment/eznutriment, + /datum/reagent/plantnutriment/left4zednutriment, + /datum/reagent/plantnutriment/robustharvestnutriment, + /datum/reagent/water, + /datum/reagent/toxin/plantbgone, + /datum/reagent/toxin/plantbgone/weedkiller, + /datum/reagent/toxin/pestkiller, + /datum/reagent/medicine/cryoxadone, + /datum/reagent/ammonia, + /datum/reagent/ash, + /datum/reagent/diethylamine) //same as above. upgrade_reagents = null upgrade_reagents2 = null diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index f540ae85..bec7d056 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -182,13 +182,13 @@ var/beakerContents[0] if(beaker) for(var/datum/reagent/R in beaker.reagents.reagent_list) - beakerContents.Add(list(list("name" = R.name, "id" = R.id, "volume" = R.volume))) // list in a list because Byond merges the first list... + beakerContents.Add(list(list("name" = R.name, "id" = ckey(R.name), "volume" = R.volume))) // list in a list because Byond merges the first list... data["beakerContents"] = beakerContents var/bufferContents[0] if(reagents.total_volume) for(var/datum/reagent/N in reagents.reagent_list) - bufferContents.Add(list(list("name" = N.name, "id" = N.id, "volume" = N.volume))) // ^ + bufferContents.Add(list(list("name" = N.name, "id" = ckey(N.name), "volume" = N.volume))) // ^ data["bufferContents"] = bufferContents //Calculated at init time as it never changes @@ -210,34 +210,34 @@ if("transferToBuffer") if(beaker) - var/id = params["id"] + var/reagent = GLOB.name2reagent[params["id"]] var/amount = text2num(params["amount"]) if (amount > 0) end_fermi_reaction() - beaker.reagents.trans_id_to(src, id, amount) + beaker.reagents.trans_id_to(src, reagent, amount) . = TRUE else if (amount == -1) // -1 means custom amount useramount = input("Enter the Amount you want to transfer:", name, useramount) as num|null if (useramount > 0) end_fermi_reaction() - beaker.reagents.trans_id_to(src, id, useramount) + beaker.reagents.trans_id_to(src, reagent, useramount) . = TRUE if("transferFromBuffer") - var/id = params["id"] + var/reagent = GLOB.name2reagent[params["id"]] var/amount = text2num(params["amount"]) if (amount > 0) if(mode) - reagents.trans_id_to(beaker, id, amount) + reagents.trans_id_to(beaker, reagent, amount) . = TRUE else - reagents.remove_reagent(id, amount) + reagents.remove_reagent(reagent, amount) . = TRUE else if (amount == -1) // -1 means custom amount useramount = input("Enter the Amount you want to transfer:", name, useramount) as num|null if (useramount > 0) end_fermi_reaction() - reagents.trans_id_to(beaker, id, useramount) + reagents.trans_id_to(beaker, reagent, useramount) . = TRUE if("toggleMode") @@ -418,7 +418,7 @@ //END CITADEL ADDITIONS if("analyzeBeak") - var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]] + var/datum/reagent/R = GLOB.name2reagent[params["id"]] if(R) var/state = "Unknown" if(initial(R.reagent_state) == 1) @@ -429,11 +429,11 @@ state = "Gas" var/const/P = 3 //The number of seconds between life ticks var/T = initial(R.metabolization_rate) * (60 / P) - var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id) + var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.type) if(Rcr && Rcr.FermiChem) fermianalyze = TRUE var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2 - var/datum/reagent/targetReagent = beaker.reagents.has_reagent("[R.id]") + var/datum/reagent/targetReagent = beaker.reagents.has_reagent(R.type) if(!targetReagent) CRASH("Tried to find a reagent that doesn't exist in the chem_master!") @@ -445,7 +445,7 @@ return if("analyzeBuff") - var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]] + var/datum/reagent/R = GLOB.name2reagent[params["id"]] if(R) var/state = "Unknown" if(initial(R.reagent_state) == 1) @@ -458,9 +458,9 @@ var/T = initial(R.metabolization_rate) * (60 / P) if(istype(R, /datum/reagent/fermi)) fermianalyze = TRUE - var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id) + var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.type) var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2 - var/datum/reagent/targetReagent = reagents.has_reagent("[R.id]") + var/datum/reagent/targetReagent = reagents.has_reagent(R.type) if(!targetReagent) CRASH("Tried to find a reagent that doesn't exist in the chem_master!") diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm index daac5a5d..ed23e7c7 100644 --- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm +++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm @@ -8,8 +8,8 @@ flags_1 = NODECONSTRUCT_1 use_power = NO_POWER_USE var/static/list/shortcuts = list( - "meth" = "methamphetamine", - "tricord" = "tricordrazine" + "meth" = /datum/reagent/drug/methamphetamine, + "tricord" = /datum/reagent/medicine/tricordrazine ) /obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ @@ -31,13 +31,13 @@ beaker = null . = TRUE if("input") - var/input_reagent = replacetext(lowertext(input("Enter the name of any liquid", "Input") as text), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name + var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text), " ", "") //95% of the time, the reagent types is a lowercase, no spaces / underscored version of the name if(shortcuts[input_reagent]) input_reagent = shortcuts[input_reagent] else input_reagent = find_reagent(input_reagent) - if(!input_reagent || !GLOB.chemical_reagents_list[input_reagent]) - say("OUT OF RANGE") + if(!input_reagent) + say("REAGENT NOT FOUND") return else if(!beaker) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index e0cbaef6..1afd8b74 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -144,9 +144,9 @@ var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list if(B) data["has_blood"] = TRUE - data["blood"] = list() - data["blood"]["dna"] = B.data["blood_DNA"] || "none" - data["blood"]["type"] = B.data["blood_type"] || "none" + data[/datum/reagent/blood] = list() + data[/datum/reagent/blood]["dna"] = B.data["blood_DNA"] || "none" + data[/datum/reagent/blood]["type"] = B.data["blood_type"] || "none" data["viruses"] = get_viruses_data(B) data["resistances"] = get_resistance_data(B) if(SYMPTOM_DETAILS) @@ -192,7 +192,7 @@ var/obj/item/reagent_containers/glass/bottle/B = new(drop_location()) B.name = "[A.name] culture bottle" B.desc = "A small bottle. Contains [A.agent] culture in synthblood medium." - B.reagents.add_reagent("blood", 20, data) + B.reagents.add_reagent(/datum/reagent/blood, 20, data) wait = TRUE update_icon() var/turf/source_turf = get_turf(src) @@ -204,7 +204,7 @@ var/datum/disease/D = SSdisease.archive_diseases[id] var/obj/item/reagent_containers/glass/bottle/B = new(drop_location()) B.name = "[D.name] vaccine bottle" - B.reagents.add_reagent("vaccine", 15, list(id)) + B.reagents.add_reagent(/datum/reagent/vaccine, 15, list(id)) wait = TRUE update_icon() addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 200) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index 98cfd877..7e1b7ec0 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -299,18 +299,18 @@ /obj/machinery/reagentgrinder/proc/mix_complete() if(beaker?.reagents.total_volume) //Recipe to make Butter - var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount("milk") / MILK_TO_BUTTER_COEFF, 1) - beaker.reagents.remove_reagent("milk", MILK_TO_BUTTER_COEFF * butter_amt) + var/butter_amt = FLOOR(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/milk) / MILK_TO_BUTTER_COEFF, 1) + beaker.reagents.remove_reagent(/datum/reagent/consumable/milk, MILK_TO_BUTTER_COEFF * butter_amt) for(var/i in 1 to butter_amt) new /obj/item/reagent_containers/food/snacks/butter(drop_location()) //Recipe to make Mayonnaise - if (beaker.reagents.has_reagent("eggyolk")) - var/amount = beaker.reagents.get_reagent_amount("eggyolk") - beaker.reagents.remove_reagent("eggyolk", amount) - beaker.reagents.add_reagent("mayonnaise", amount) + if (beaker.reagents.has_reagent(/datum/reagent/consumable/eggyolk)) + var/amount = beaker.reagents.get_reagent_amount(/datum/reagent/consumable/eggyolk) + beaker.reagents.remove_reagent(/datum/reagent/consumable/eggyolk, amount) + beaker.reagents.add_reagent(/datum/reagent/consumable/mayonnaise, amount) //Moonsugar for skooma - if(beaker.reagents.has_reagent("sugar") && beaker.reagents.has_reagent("moonshine")) - var/amount = min(beaker.reagents.get_reagent_amount("sugar"), beaker.reagents.get_reagent_amount("moonshine")) - beaker.reagents.remove_reagent("sugar", amount) - beaker.reagents.remove_reagent("moonshine", amount) - beaker.reagents.add_reagent("moonsugar", amount*2) + if(beaker.reagents.has_reagent(/datum/reagent/consumable/sugar) && beaker.reagents.has_reagent(/datum/reagent/consumable/ethanol/moonshine)) + var/amount = min(beaker.reagents.get_reagent_amount(/datum/reagent/consumable/sugar), beaker.reagents.get_reagent_amount(/datum/reagent/consumable/ethanol/moonshine)) + beaker.reagents.remove_reagent(/datum/reagent/consumable/sugar, amount) + beaker.reagents.remove_reagent(/datum/reagent/consumable/ethanol/moonshine, amount) + beaker.reagents.add_reagent(/datum/reagent/moonsugar, amount*2) diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 73bf3bf4..794b191a 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -1,12 +1,20 @@ #define REM REAGENTS_EFFECT_MULTIPLIER +GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) + +/proc/build_name2reagent() + . = list() + for (var/t in subtypesof(/datum/reagent)) + var/datum/reagent/R = t + if (length(initial(R.name))) + .[ckey(initial(R.name))] = t + //Various reagents //Toxin & acid reagents //Hydroponics stuff /datum/reagent var/name = "Reagent" - var/id = "reagent" var/description = "" var/specific_heat = SPECIFIC_HEAT_DEFAULT //J/(K*mol) var/taste_description = "metaphorical salt" @@ -58,7 +66,7 @@ var/modifier = CLAMP((1 - touch_protection), 0, 1) var/amount = round(reac_volume*modifier, 0.1) if(amount >= 0.5) - M.reagents.add_reagent(id, amount) + M.reagents.add_reagent(type, amount) return 1 /datum/reagent/proc/reaction_obj(obj/O, volume) @@ -70,7 +78,7 @@ /datum/reagent/proc/on_mob_life(mob/living/carbon/M) current_cycle++ if(holder) - holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. + holder.remove_reagent(type, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. return //called when a mob processes chems when dead. @@ -79,7 +87,7 @@ return current_cycle++ if(holder) - holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. + holder.remove_reagent(type, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. return // Called when this reagent is first added to a mob @@ -88,19 +96,19 @@ return var/mob/living/carbon/M = L if (purity == 1) - log_game("CHEM: [L] ckey: [L.key] has ingested [volume]u of [id]") + log_game("CHEM: [L] ckey: [L.key] has ingested [volume]u of [type]") return if(cached_purity == 1) cached_purity = purity else if(purity < 0) - CRASH("Purity below 0 for chem: [id], Please let Fermis Know!") + CRASH("Purity below 0 for chem: [type], Please let Fermis Know!") if(chemical_flags & REAGENT_DONOTSPLIT) return if ((inverse_chem_val > purity) && (inverse_chem))//Turns all of a added reagent into the inverse chem - M.reagents.remove_reagent(id, amount, FALSE) + M.reagents.remove_reagent(type, amount, FALSE) M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity) - var/datum/reagent/R = M.reagents.has_reagent("[inverse_chem]") + var/datum/reagent/R = M.reagents.has_reagent(inverse_chem) if(R.chemical_flags & REAGENT_SNEAKYNAME) R.name = name//Negative effects are hidden if(R.chemical_flags & REAGENT_INVISIBLE) @@ -110,9 +118,9 @@ else if (impure_chem) var/impureVol = amount * (1 - purity) //turns impure ratio into impure chem if(!(chemical_flags & REAGENT_SPLITRETAINVOL)) - M.reagents.remove_reagent(id, (impureVol), FALSE) + M.reagents.remove_reagent(type, (impureVol), FALSE) M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity) - log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume - impureVol]u of [id]") + log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume - impureVol]u of [type]") log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [impure_chem]") return @@ -140,18 +148,18 @@ if(!iscarbon(M)) return if (purity == 1) - log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [id]") + log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [type]") return cached_purity = purity //purity SHOULD be precalculated from the add_reagent, update cache. if (purity < 0) - CRASH("Purity below 0 for chem: [id], Please let Fermis Know!") + CRASH("Purity below 0 for chem: [type], Please let Fermis Know!") if(chemical_flags & REAGENT_DONOTSPLIT) return if ((inverse_chem_val > purity) && (inverse_chem)) //INVERT - M.reagents.remove_reagent(id, amount, FALSE) + M.reagents.remove_reagent(type, amount, FALSE) M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity) - var/datum/reagent/R = M.reagents.has_reagent("[inverse_chem]") + var/datum/reagent/R = M.reagents.has_reagent(inverse_chem) if(R.chemical_flags & REAGENT_SNEAKYNAME) R.name = name//Negative effects are hidden if(R.chemical_flags & REAGENT_INVISIBLE) @@ -161,9 +169,9 @@ else if (impure_chem) //SPLIT var/impureVol = amount * (1 - purity) if(!(chemical_flags & REAGENT_SPLITRETAINVOL)) - M.reagents.remove_reagent(id, impureVol, FALSE) + M.reagents.remove_reagent(type, impureVol, FALSE) M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity) - log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume - impureVol]u of [id]") + log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume - impureVol]u of [type]") log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [impure_chem]") return @@ -180,29 +188,29 @@ /datum/reagent/proc/overdose_start(mob/living/M) to_chat(M, "You feel like you took too much of [name]!") - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/overdose, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/overdose, name) return /datum/reagent/proc/addiction_act_stage1(mob/living/M) - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_light, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_light, name) if(prob(30)) to_chat(M, "You feel like having some [name] right about now.") return /datum/reagent/proc/addiction_act_stage2(mob/living/M) - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_medium, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_medium, name) if(prob(30)) to_chat(M, "You feel like you need [name]. You just can't get enough.") return /datum/reagent/proc/addiction_act_stage3(mob/living/M) - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_severe, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_severe, name) if(prob(30)) to_chat(M, "You have an intense craving for [name].") return /datum/reagent/proc/addiction_act_stage4(mob/living/M) - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_critical, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_critical, name) if(prob(30)) to_chat(M, "You're not feeling good at all! You really need some [name].") return diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 3177df66..6cbfa288 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -8,7 +8,6 @@ /datum/reagent/consumable/ethanol name = "Ethanol" - id = "ethanol" description = "A well-known alcohol with a variety of applications." color = "#404030" // rgb: 64, 64, 48 nutriment_factor = 0 @@ -81,7 +80,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/beer name = "Beer" - id = "beer" description = "An alcoholic beverage brewed since ancient times on Old Earth. Still popular today." color = "#664300" // rgb: 102, 67, 0 nutriment_factor = 1 * REAGENTS_METABOLISM @@ -94,7 +92,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/beer/light name = "Light Beer" - id = "light_beer" description = "An alcoholic beverage brewed since ancient times on Old Earth. This variety has reduced calorie and alcohol content." boozepwr = 5 //Space Europeans hate it taste_description = "dish water" @@ -105,7 +102,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/beer/green name = "Green Beer" - id = "greenbeer" description = "An alcoholic beverage brewed since ancient times on Old Earth. This variety is dyed a festive green." color = "#A8E61D" taste_description = "green piss water" @@ -125,7 +121,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/kahlua name = "Kahlua" - id = "kahlua" description = "A widely known, Mexican coffee-flavoured liqueur. In production since 1936!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 45 @@ -148,7 +143,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/whiskey name = "Whiskey" - id = "whiskey" description = "A superb and well-aged single-malt whiskey. Damn." color = "#664300" // rgb: 102, 67, 0 boozepwr = 75 @@ -162,7 +156,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/thirteenloko name = "Thirteen Loko" - id = "thirteenloko" description = "A potent mixture of caffeine and alcohol." color = "#102000" // rgb: 16, 32, 0 nutriment_factor = 1 * REAGENTS_METABOLISM @@ -227,7 +220,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/vodka name = "Vodka" - id = "vodka" description = "Number one drink AND fueling choice for Russians worldwide." color = "#0064C8" // rgb: 0, 100, 200 boozepwr = 65 @@ -245,7 +237,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/bilk name = "Bilk" - id = "bilk" description = "This appears to be beer mixed with milk. Disgusting." color = "#895C4C" // rgb: 137, 92, 76 nutriment_factor = 2 * REAGENTS_METABOLISM @@ -264,7 +255,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/threemileisland name = "Three Mile Island Iced Tea" - id = "threemileisland" description = "Made for a woman, strong enough for a man." color = "#666340" // rgb: 102, 99, 64 boozepwr = 10 @@ -282,7 +272,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/gin name = "Gin" - id = "gin" description = "It's gin. In space. I say, good sir." color = "#664300" // rgb: 102, 67, 0 boozepwr = 45 @@ -295,7 +284,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/rum name = "Rum" - id = "rum" description = "Yohoho and all that." color = "#664300" // rgb: 102, 67, 0 boozepwr = 60 @@ -309,7 +297,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/tequila name = "Tequila" - id = "tequila" description = "A strong and mildly flavoured, Mexican produced spirit. Feeling thirsty, hombre?" color = "#FFFF91" // rgb: 255, 255, 145 boozepwr = 70 @@ -323,7 +310,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/vermouth name = "Vermouth" - id = "vermouth" description = "You suddenly feel a craving for a martini..." color = "#91FF91" // rgb: 145, 255, 145 boozepwr = 45 @@ -337,7 +323,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/wine name = "Wine" - id = "wine" description = "A premium alcoholic beverage made from distilled grape juice." color = "#7E4043" // rgb: 126, 64, 67 boozepwr = 35 @@ -351,7 +336,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/lizardwine name = "Lizard wine" - id = "lizardwine" description = "An alcoholic beverage from Space China, made by infusing lizard tails in ethanol." color = "#7E4043" // rgb: 126, 64, 67 boozepwr = 45 @@ -362,7 +346,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/grappa name = "Grappa" - id = "grappa" description = "A fine Italian brandy, for when regular wine just isn't alcoholic enough for you." color = "#F8EBF1" boozepwr = 60 @@ -375,7 +358,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/cognac name = "Cognac" - id = "cognac" description = "A sweet and strongly alcoholic drink, made after numerous distillations and years of maturing. Classy as fornication." color = "#AB3C05" // rgb: 171, 60, 5 boozepwr = 75 @@ -389,7 +371,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/absinthe name = "Absinthe" - id = "absinthe" description = "A powerful alcoholic drink. Rumored to cause hallucinations but does not." color = rgb(10, 206, 0) boozepwr = 80 //Very strong even by default @@ -407,7 +388,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/hooch name = "Hooch" - id = "hooch" description = "Either someone's failure at cocktail making or attempt in alcohol production. In any case, do you really want to drink that?" color = "#664300" // rgb: 102, 67, 0 boozepwr = 100 @@ -424,7 +404,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/ale name = "Ale" - id = "ale" description = "A dark alcoholic beverage made with malted barley and yeast." color = "#664300" // rgb: 102, 67, 0 boozepwr = 65 @@ -437,7 +416,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/goldschlager name = "Goldschlager" - id = "goldschlager" description = "100 proof cinnamon schnapps, made for alcoholic teen girls on spring break." color = "#FFFF91" // rgb: 255, 255, 145 boozepwr = 25 @@ -451,7 +429,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/patron name = "Patron" - id = "patron" description = "Tequila with silver in it, a favorite of alcoholic women in the club scene." color = "#585840" // rgb: 88, 88, 64 boozepwr = 60 @@ -466,7 +443,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/gintonic name = "Gin and Tonic" - id = "gintonic" description = "An all time classic, mild cocktail." color = "#664300" // rgb: 102, 67, 0 boozepwr = 25 @@ -480,7 +456,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/rum_coke name = "Rum and Coke" - id = "rumcoke" description = "Rum, mixed with cola." taste_description = "cola" boozepwr = 40 @@ -494,7 +469,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/cuba_libre name = "Cuba Libre" - id = "cubalibre" description = "Viva la Revolucion! Viva Cuba Libre!" color = "#3E1B00" // rgb: 62, 27, 0 boozepwr = 50 @@ -517,7 +491,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/whiskey_cola name = "Whiskey Cola" - id = "whiskeycola" description = "Whiskey, mixed with cola. Surprisingly refreshing." color = "#3E1B00" // rgb: 62, 27, 0 boozepwr = 70 @@ -530,7 +503,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/martini name = "Classic Martini" - id = "martini" description = "Vermouth with Gin. Not quite how 007 enjoyed it, but still delicious." color = "#664300" // rgb: 102, 67, 0 boozepwr = 60 @@ -543,7 +515,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/vodkamartini name = "Vodka Martini" - id = "vodkamartini" description = "Vodka with Gin. Not quite how 007 enjoyed it, but still delicious." color = "#664300" // rgb: 102, 67, 0 boozepwr = 65 @@ -557,7 +528,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/white_russian name = "White Russian" - id = "whiterussian" description = "That's just, like, your opinion, man..." color = "#A68340" // rgb: 166, 131, 64 boozepwr = 50 @@ -570,7 +540,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/screwdrivercocktail name = "Screwdriver" - id = "screwdrivercocktail" description = "Vodka, mixed with plain ol' orange juice. The result is surprisingly delicious." color = "#A68310" // rgb: 166, 131, 16 boozepwr = 55 @@ -588,7 +557,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/booger name = "Booger" - id = "booger" description = "Ewww..." color = "#8CFF8C" // rgb: 140, 255, 140 boozepwr = 45 @@ -600,7 +568,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/bloody_mary name = "Bloody Mary" - id = "bloodymary" description = "A strange yet pleasurable mixture made of vodka, tomato and lime juice. Or at least you THINK the red stuff is tomato juice." color = "#664300" // rgb: 102, 67, 0 boozepwr = 55 @@ -620,7 +587,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/brave_bull name = "Brave Bull" - id = "bravebull" description = "It's just as effective as Dutch-Courage!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 80 @@ -645,7 +611,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/tequila_sunrise name = "Tequila Sunrise" - id = "tequilasunrise" description = "Tequila, Grenadine, and Orange Juice." color = "#FFE48C" // rgb: 255, 228, 140 boozepwr = 45 @@ -664,7 +629,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/tequila_sunrise/on_mob_life(mob/living/carbon/M) if(QDELETED(light_holder)) - M.reagents.del_reagent("tequilasunrise") //If we lost our light object somehow, remove the reagent + M.reagents.del_reagent(type) //If we lost our light object somehow, remove the reagent else if(light_holder.loc != M) light_holder.forceMove(M) return ..() @@ -675,7 +640,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/toxins_special name = "Toxins Special" - id = "toxinsspecial" description = "This thing is ON FIRE! CALL THE DAMN SHUTTLE!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 25 @@ -693,7 +657,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/beepsky_smash name = "Beepsky Smash" - id = "beepskysmash" description = "Drink this and prepare for the LAW." color = "#664300" // rgb: 102, 67, 0 boozepwr = 90 //THE FIST OF THE LAW IS STRONG AND HARD @@ -738,7 +701,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/irish_cream name = "Irish Cream" - id = "irishcream" description = "Whiskey-imbued cream, what else would you expect from the Irish?" color = "#664300" // rgb: 102, 67, 0 boozepwr = 50 @@ -751,7 +713,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/manly_dorf name = "The Manly Dorf" - id = "manlydorf" description = "Beer and Ale, brought together in a delicious mix. Intended for true men only." color = "#664300" // rgb: 102, 67, 0 boozepwr = 100 //For the manly only @@ -779,7 +740,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/longislandicedtea name = "Long Island Iced Tea" - id = "longislandicedtea" description = "The liquor cabinet, brought together in a delicious mix. Intended for middle-aged alcoholic women only." color = "#664300" // rgb: 102, 67, 0 boozepwr = 35 @@ -792,7 +752,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/moonshine name = "Moonshine" - id = "moonshine" description = "You've really hit rock bottom now... your liver packed its bags and left last night." color = "#664300" // rgb: 102, 67, 0 boozepwr = 95 @@ -804,7 +763,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/b52 name = "B-52" - id = "b52" description = "Coffee, Irish Cream, and cognac. You will get bombed." color = "#664300" // rgb: 102, 67, 0 boozepwr = 85 @@ -821,7 +779,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/irishcoffee name = "Irish Coffee" - id = "irishcoffee" description = "Coffee, and alcohol. More fun than a Mimosa to drink in the morning." color = "#664300" // rgb: 102, 67, 0 boozepwr = 35 @@ -834,7 +791,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/margarita name = "Margarita" - id = "margarita" description = "On the rocks with salt on the rim. Arriba~!" color = "#8CFF8C" // rgb: 140, 255, 140 boozepwr = 35 @@ -847,7 +803,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/black_russian name = "Black Russian" - id = "blackrussian" description = "For the lactose-intolerant. Still as classy as a White Russian." color = "#360000" // rgb: 54, 0, 0 boozepwr = 70 @@ -861,7 +816,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/manhattan name = "Manhattan" - id = "manhattan" description = "The Detective's undercover drink of choice. He never could stomach gin..." color = "#664300" // rgb: 102, 67, 0 boozepwr = 30 @@ -875,7 +829,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/manhattan_proj name = "Manhattan Project" - id = "manhattan_proj" description = "A scientist's drink of choice, for pondering ways to blow up the station." color = "#664300" // rgb: 102, 67, 0 boozepwr = 45 @@ -893,7 +846,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/whiskeysoda name = "Whiskey Soda" - id = "whiskeysoda" description = "For the more refined griffon." color = "#664300" // rgb: 102, 67, 0 boozepwr = 70 @@ -906,7 +858,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/antifreeze name = "Anti-freeze" - id = "antifreeze" description = "The ultimate refreshment. Not what it sounds like." color = "#664300" // rgb: 102, 67, 0 boozepwr = 35 @@ -923,7 +874,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/barefoot name = "Barefoot" - id = "barefoot" description = "Barefoot and pregnant." color = "#664300" // rgb: 102, 67, 0 boozepwr = 45 @@ -944,7 +894,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/snowwhite name = "Snow White" - id = "snowwhite" description = "A cold refreshment." color = "#FFFFFF" // rgb: 255, 255, 255 boozepwr = 35 @@ -957,7 +906,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/demonsblood //Prevents the imbiber from being dragged into a pool of blood by a slaughter demon. name = "Demon's Blood" - id = "demonsblood" description = "AHHHH!!!!" color = "#820000" // rgb: 130, 0, 0 boozepwr = 75 @@ -970,7 +918,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/devilskiss //If eaten by a slaughter demon, the demon will regret it. name = "Devil's Kiss" - id = "devilskiss" description = "Creepy time!" color = "#A68310" // rgb: 166, 131, 16 boozepwr = 70 @@ -983,7 +930,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/vodkatonic name = "Vodka and Tonic" - id = "vodkatonic" description = "For when a gin and tonic isn't Russian enough." color = "#0064C8" // rgb: 0, 100, 200 boozepwr = 70 @@ -996,7 +942,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/ginfizz name = "Gin Fizz" - id = "ginfizz" description = "Refreshingly lemony, deliciously dry." color = "#664300" // rgb: 102, 67, 0 boozepwr = 45 @@ -1009,8 +954,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/bahama_mama name = "Bahama Mama" - id = "bahama_mama" - description = "A tropical cocktail with a complex blend of flavors." + description = "Tropical cocktail." color = "#FF7F3B" // rgb: 255, 127, 59 boozepwr = 35 quality = DRINK_GOOD @@ -1022,7 +966,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/singulo name = "Singulo" - id = "singulo" description = "A blue-space beverage!" color = "#2E6671" // rgb: 46, 102, 113 boozepwr = 35 @@ -1035,7 +978,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/sbiten name = "Sbiten" - id = "sbiten" description = "A spicy Vodka! Might be a little hot for the little guys!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 70 @@ -1052,7 +994,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/red_mead name = "Red Mead" - id = "red_mead" description = "The true Viking drink! Even though it has a strange red color." color = "#C73C00" // rgb: 199, 60, 0 boozepwr = 31 //Red drinks are stronger @@ -1065,7 +1006,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/mead name = "Mead" - id = "mead" description = "A Viking drink, though a cheap one." color = "#664300" // rgb: 102, 67, 0 nutriment_factor = 1 * REAGENTS_METABOLISM @@ -1079,7 +1019,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/iced_beer name = "Iced Beer" - id = "iced_beer" description = "A beer which is so cold the air around it freezes." color = "#664300" // rgb: 102, 67, 0 boozepwr = 15 @@ -1095,7 +1034,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/grog name = "Grog" - id = "grog" description = "Watered down rum, Nanotrasen approves!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 1 //Basically nothing @@ -1107,7 +1045,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/aloe name = "Aloe" - id = "aloe" description = "So very, very, very good." color = "#664300" // rgb: 102, 67, 0 boozepwr = 35 @@ -1120,7 +1057,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/andalusia name = "Andalusia" - id = "andalusia" description = "A nice, strangely named drink." color = "#664300" // rgb: 102, 67, 0 boozepwr = 40 @@ -1133,7 +1069,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/alliescocktail name = "Allies Cocktail" - id = "alliescocktail" description = "A drink made from your allies. Not as sweet as those made from your enemies." color = "#664300" // rgb: 102, 67, 0 boozepwr = 45 @@ -1146,7 +1081,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/acid_spit name = "Acid Spit" - id = "acidspit" description = "A drink for the daring, can be deadly if incorrectly prepared!" color = "#365000" // rgb: 54, 80, 0 boozepwr = 80 @@ -1159,7 +1093,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/amasec name = "Amasec" - id = "amasec" description = "Official drink of the Nanotrasen Gun-Club!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 35 @@ -1172,7 +1105,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/changelingsting name = "Changeling Sting" - id = "changelingsting" description = "You take a tiny sip and feel a burning sensation..." color = "#2E6671" // rgb: 46, 102, 113 boozepwr = 95 @@ -1193,7 +1125,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/irishcarbomb name = "Irish Car Bomb" - id = "irishcarbomb" description = "Mmm, tastes like chocolate cake..." color = "#2E6671" // rgb: 46, 102, 113 boozepwr = 25 @@ -1206,7 +1137,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/syndicatebomb name = "Syndicate Bomb" - id = "syndicatebomb" description = "Tastes like terrorism!" color = "#2E6671" // rgb: 46, 102, 113 boozepwr = 90 @@ -1224,7 +1154,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/erikasurprise name = "Erika Surprise" - id = "erikasurprise" description = "The surprise is, it's green!" color = "#2E6671" // rgb: 46, 102, 113 boozepwr = 35 @@ -1237,7 +1166,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/driestmartini name = "Driest Martini" - id = "driestmartini" description = "Only for the experienced. You think you see sand floating in the glass." nutriment_factor = 1 * REAGENTS_METABOLISM color = "#2E6671" // rgb: 46, 102, 113 @@ -1251,7 +1179,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/bananahonk name = "Banana Honk" - id = "bananahonk" description = "A drink from Clown Heaven." nutriment_factor = 1 * REAGENTS_METABOLISM color = "#FFFF91" // rgb: 255, 255, 140 @@ -1271,7 +1198,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/silencer name = "Silencer" - id = "silencer" description = "A drink from Mime Heaven." nutriment_factor = 1 * REAGENTS_METABOLISM color = "#664300" // rgb: 102, 67, 0 @@ -1291,7 +1217,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/drunkenblumpkin name = "Drunken Blumpkin" - id = "drunkenblumpkin" description = "A weird mix of whiskey and blumpkin juice." color = "#1EA0FF" // rgb: 102, 67, 0 boozepwr = 50 @@ -1304,7 +1229,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/whiskey_sour //Requested since we had whiskey cola and soda but not sour. name = "Whiskey Sour" - id = "whiskey_sour" description = "Lemon juice/whiskey/sugar mixture. Moderate alcohol content." color = rgb(255, 201, 49) boozepwr = 35 @@ -1317,7 +1241,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/hcider name = "Hard Cider" - id = "hcider" description = "Apple juice, for adults." color = "#CD6839" nutriment_factor = 1 * REAGENTS_METABOLISM @@ -1331,7 +1254,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/fetching_fizz //A reference to one of my favorite games of all time. Pulls nearby ores to the imbiber! name = "Fetching Fizz" - id = "fetching_fizz" description = "Whiskey sour/iron/uranium mixture resulting in a highly magnetic slurry. Mild alcohol content." //Requires no alcohol to make but has alcohol anyway because ~magic~ color = rgb(255, 91, 15) boozepwr = 10 @@ -1351,7 +1273,6 @@ All effects don't start immediately, but rather get worse over time; the rate is //Another reference. Heals those in critical condition extremely quickly. /datum/reagent/consumable/ethanol/hearty_punch name = "Hearty Punch" - id = "hearty_punch" description = "Brave bull/syndicate bomb/absinthe mixture resulting in an energizing beverage. Mild alcohol content." color = rgb(140, 0, 0) boozepwr = 90 @@ -1375,7 +1296,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/bacchus_blessing //An EXTREMELY powerful drink. Smashed in seconds, dead in minutes. name = "Bacchus' Blessing" - id = "bacchus_blessing" description = "Unidentifiable mixture. Unmeasurably high alcohol content." color = rgb(51, 19, 3) //Sickly brown boozepwr = 300 //I warned you @@ -1388,7 +1308,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/atomicbomb name = "Atomic Bomb" - id = "atomicbomb" description = "Nuclear proliferation never tasted so good." color = "#666300" // rgb: 102, 99, 0 boozepwr = 0 //custom drunk effect @@ -1418,7 +1337,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/gargle_blaster name = "Pan-Galactic Gargle Blaster" - id = "gargleblaster" description = "Whoah, this stuff looks volatile!" color = "#664300" // rgb: 102, 67, 0 boozepwr = 0 //custom drunk effect @@ -1447,7 +1365,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/neurotoxin name = "Neurotoxin" - id = "neurotoxin" description = "A strong neurotoxin that puts the subject into a death-like state." color = "#2E2E61" // rgb: 46, 46, 97 boozepwr = 50 @@ -1459,9 +1376,9 @@ All effects don't start immediately, but rather get worse over time; the rate is glass_desc = "A drink that is guaranteed to knock you silly." pH = 4.3 //SplitChem = TRUE - impure_chem = "neuroweak" + impure_chem = /datum/reagent/consumable/ethanol/neuroweak inverse_chem_val = 0.5 //Clear conversion - inverse_chem = "neuroweak" + inverse_chem = /datum/reagent/consumable/ethanol/neuroweak value = 4 /datum/reagent/consumable/ethanol/neurotoxin/proc/pickt() @@ -1471,12 +1388,12 @@ All effects don't start immediately, but rather get worse over time; the rate is M.set_drugginess(50) M.dizziness +=2 M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 150) - if(prob(20)) + if(prob(20) && !holder.has_reagent(/datum/reagent/consumable/ethanol/neuroweak)) M.adjustStaminaLoss(10) M.drop_all_held_items() to_chat(M, "You cant feel your hands!") if(current_cycle > 5) - if(prob(20)) + if(prob(20) && !holder.has_reagent(/datum/reagent/consumable/ethanol/neuroweak)) var/t = pickt() ADD_TRAIT(M, t, type) M.adjustStaminaLoss(10) @@ -1498,11 +1415,9 @@ All effects don't start immediately, but rather get worse over time; the rate is M.adjustStaminaLoss(10) ..() -/datum/reagent/consumable/ethanol/neurosmash - name = "Neurosmash" - id = "neurosmash" - description = "A mostly safe alcoholic drink for the true daredevils. Do not mix with Neurotoxin." - color = "#2E2E61" // rgb: 46, 46, 97 +/datum/reagent/consumable/ethanol/neuroweak + name = "Neuro-Smash" + description = "A mostly safe alcoholic drink for the true daredevils. Counteracts Neurotoxins." boozepwr = 60 quality = DRINK_VERYGOOD taste_description = "a numbing sensation" @@ -1512,9 +1427,13 @@ All effects don't start immediately, but rather get worse over time; the rate is pH = 8 value = 3 -/datum/reagent/consumable/ethanol/neurosmash/on_mob_life(mob/living/carbon/M) - if(holder.has_reagent("neurotoxin")) - M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.5*REM, 150) +/datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M) + if(holder.has_reagent(/datum/reagent/consumable/ethanol/neurotoxin)) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150) + M.reagents.remove_reagent(/datum/reagent/consumable/ethanol/neurotoxin, 1.5 * REAGENTS_METABOLISM, FALSE) + else if(holder.has_reagent(/datum/reagent/toxin/fentanyl)) + M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1*REM, 150) + M.reagents.remove_reagent(/datum/reagent/toxin/fentanyl, 0.75 * REAGENTS_METABOLISM, FALSE) else M.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1.0*REM, 150) M.dizziness +=2 @@ -1522,7 +1441,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/hippies_delight name = "Hippie's Delight" - id = "hippiesdelight" description = "You just don't get it maaaan." color = "#664300" // rgb: 102, 67, 0 nutriment_factor = 0 @@ -1568,7 +1486,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/eggnog name = "Eggnog" - id = "eggnog" description = "The traditional way to get absolutely hammered at a Christmas party." color = "#fcfdc6" // rgb: 252, 253, 198 nutriment_factor = 2 * REAGENTS_METABOLISM @@ -1583,7 +1500,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/narsour name = "Nar'Sour" - id = "narsour" description = "Side effects include self-mutilation and hoarding plasteel." color = RUNE_COLOR_DARKRED boozepwr = 10 @@ -1601,7 +1517,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/triple_sec name = "Triple Sec" - id = "triple_sec" description = "A sweet and vibrant orange liqueur." color = "#ffcc66" boozepwr = 30 @@ -1613,7 +1528,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/creme_de_menthe name = "Creme de Menthe" - id = "creme_de_menthe" description = "A minty liqueur excellent for refreshing, cool drinks." color = "#00cc00" boozepwr = 20 @@ -1625,7 +1539,6 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/creme_de_cacao name = "Creme de Cacao" - id = "creme_de_cacao" description = "A chocolatey liqueur excellent for adding dessert notes to beverages and bribing sororities." color = "#996633" boozepwr = 20 @@ -1637,7 +1550,6 @@ All effects don't start immediately, but rather get worse over time; the rate is datum/reagent/consumable/ethanol/creme_de_coconut name = "Creme de Coconut" - id = "creme_de_coconut" description = "A coconut liqueur for smooth, creamy, tropical drinks." color = "#F7F0D0" boozepwr = 20 @@ -1648,7 +1560,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/quadruple_sec name = "Quadruple Sec" - id = "quadruple_sec" description = "Kicks just as hard as licking the powercell on a baton, but tastier." color = "#cc0000" boozepwr = 35 @@ -1668,7 +1579,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/quintuple_sec name = "Quintuple Sec" - id = "quintuple_sec" description = "Law, Order, Alcohol, and Police Brutality distilled into one single elixir of JUSTICE." color = "#ff3300" boozepwr = 80 @@ -1691,7 +1601,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/grasshopper name = "Grasshopper" - id = "grasshopper" description = "A fresh and sweet dessert shooter. Difficult to look manly while drinking this." color = "00ff00" boozepwr = 25 @@ -1704,7 +1613,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/stinger name = "Stinger" - id = "stinger" description = "A snappy way to end the day." color = "ccff99" boozepwr = 25 @@ -1717,7 +1625,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/bastion_bourbon name = "Bastion Bourbon" - id = "bastion_bourbon" description = "Soothing hot herbal brew with restorative properties. Hints of citrus and berry flavors." color = "#00FFFF" boozepwr = 30 @@ -1757,7 +1664,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/squirt_cider name = "Squirt Cider" - id = "squirt_cider" description = "Fermented squirt extract with a nose of stale bread and ocean water. Whatever a squirt is." color = "#FF0000" boozepwr = 40 @@ -1776,7 +1682,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/fringe_weaver name = "Fringe Weaver" - id = "fringe_weaver" description = "Bubbly, classy, and undoubtedly strong - a Glitch City classic." color = "#FFEAC4" boozepwr = 90 //classy hooch, essentially, but lower pwr to make up for slightly easier access @@ -1789,7 +1694,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/sugar_rush name = "Sugar Rush" - id = "sugar_rush" description = "Sweet, light, and fruity - as girly as it gets." color = "#FF226C" boozepwr = 10 @@ -1808,7 +1712,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/crevice_spike name = "Crevice Spike" - id = "crevice_spike" description = "Sour, bitter, and smashingly sobering." color = "#5BD231" boozepwr = -10 //sobers you up - ideally, one would drink to get hit with brute damage now to avoid alcohol problems later @@ -1824,7 +1727,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/sake name = "Sake" - id = "sake" description = "A sweet rice wine of questionable legality and extreme potency." color = "#DDDDDD" boozepwr = 70 @@ -1836,7 +1738,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/peppermint_patty name = "Peppermint Patty" - id = "peppermint_patty" description = "This lightly alcoholic drink combines the benefits of menthol and cocoa." color = "#45ca7a" taste_description = "mint and chocolate" @@ -1853,7 +1754,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/alexander name = "Alexander" - id = "alexander" description = "Named after a Greek hero, this mix is said to embolden a user's shield as if they were in a phalanx." color = "#F5E9D3" boozepwr = 80 @@ -1877,7 +1777,7 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/alexander/on_mob_life(mob/living/L) ..() if(mighty_shield && !(mighty_shield in L.contents)) //If you had a shield and lose it, you lose the reagent as well. Otherwise this is just a normal drink. - L.reagents.del_reagent("alexander") + L.reagents.del_reagent(type) /datum/reagent/consumable/ethanol/alexander/on_mob_end_metabolize(mob/living/L) if(mighty_shield) @@ -1887,7 +1787,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/sidecar name = "Sidecar" - id = "sidecar" description = "The one ride you'll gladly give up the wheel for." color = "#FFC55B" boozepwr = 80 @@ -1900,7 +1799,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/between_the_sheets name = "Between the Sheets" - id = "between_the_sheets" description = "A provocatively named classic. Funny enough, doctors recommend drinking it before taking a nap." color = "#F4C35A" boozepwr = 80 @@ -1926,7 +1824,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/kamikaze name = "Kamikaze" - id = "kamikaze" description = "Divinely windy." color = "#EEF191" boozepwr = 60 @@ -1939,7 +1836,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/mojito name = "Mojito" - id = "mojito" description = "A drink that looks as refreshing as it tastes." color = "#DFFAD9" boozepwr = 30 @@ -1952,7 +1848,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/fernet name = "Fernet" - id = "fernet" description = "An incredibly bitter herbal liqueur used as a digestif." color = "#1B2E24" // rgb: 27, 46, 36 boozepwr = 80 @@ -1970,7 +1865,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/fernet_cola name = "Fernet Cola" - id = "fernet_cola" description = "A very popular and bittersweet digestif, ideal after a heavy meal. Best served on a sawed-off cola bottle as per tradition." color = "#390600" // rgb: 57, 6, 0 boozepwr = 25 @@ -1991,7 +1885,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/fanciulli name = "Fanciulli" - id = "fanciulli" description = "What if the Manhattan coctail ACTUALLY used a bitter herb liquour? Helps you sobers up." //also causes a bit of stamina damage to symbolize the afterdrink lazyness color = "#CA933F" // rgb: 202, 147, 63 boozepwr = -10 @@ -2016,7 +1909,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/branca_menta name = "Branca Menta" - id = "branca_menta" description = "A refreshing mixture of bitter Fernet with mint creme liquour." color = "#4B5746" // rgb: 75, 87, 70 boozepwr = 35 @@ -2039,7 +1931,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/blank_paper name = "Blank Paper" - id = "blank_paper" description = "A bubbling glass of blank paper. Just looking at it makes you feel fresh." nutriment_factor = 1 * REAGENTS_METABOLISM color = "#DCDCDC" // rgb: 220, 220, 220 @@ -2059,7 +1950,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/champagne //How the hell did we not have champagne already!? name = "Champagne" - id = "champagne" description = "A sparkling wine known for its ability to strike fast and hard." color = "#ffffc1" boozepwr = 40 @@ -2071,7 +1961,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/wizz_fizz name = "Wizz Fizz" - id = "wizz_fizz" description = "A magical potion, fizzy and wild! However the taste, you will find, is quite mild." color = "#4235d0" //Just pretend that the triple-sec was blue curacao. boozepwr = 50 @@ -2092,7 +1981,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/bug_spray name = "Bug Spray" - id = "bug_spray" description = "A harsh, acrid, bitter drink, for those who need something to brace themselves." color = "#33ff33" boozepwr = 50 @@ -2116,7 +2004,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/applejack name = "Applejack" - id = "applejack" description = "The perfect beverage for when you feel the need to horse around." color = "#ff6633" boozepwr = 20 @@ -2128,7 +2015,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/jack_rose name = "Jack Rose" - id = "jack_rose" description = "A light cocktail perfect for sipping with a slice of pie." color = "#ff6633" boozepwr = 15 @@ -2141,7 +2027,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/turbo name = "Turbo" - id = "turbo" description = "A turbulent cocktail associated with outlaw hoverbike racing. Not for the faint of heart." color = "#e94c3a" boozepwr = 85 @@ -2160,7 +2045,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/old_timer name = "Old Timer" - id = "old_timer" description = "An archaic potation enjoyed by old coots of all ages." color = "#996835" boozepwr = 35 @@ -2181,7 +2065,7 @@ datum/reagent/consumable/ethanol/creme_de_coconut N.hair_color = "ccc" N.update_hair() if(N.age > 100) - N.become_nearsighted(id) + N.become_nearsighted(type) if(N.gender == MALE) N.facial_hair_style = "Beard (Very Long)" N.update_hair() @@ -2194,7 +2078,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/rubberneck name = "Rubberneck" - id = "rubberneck" description = "A quality rubberneck should not contain any gross natural ingredients." color = "#ffe65b" boozepwr = 60 @@ -2207,7 +2090,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/duplex name = "Duplex" - id = "duplex" description = "An inseparable combination of two fruity drinks." color = "#50e5cf" boozepwr = 25 @@ -2220,7 +2102,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/trappist name = "Trappist Beer" - id = "trappist" description = "A strong dark ale brewed by space-monks." color = "#390c00" boozepwr = 40 @@ -2240,7 +2121,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/blazaam name = "Blazaam" - id = "blazaam" description = "A strange drink that few people seem to remember existing. Doubles as a Berenstain remover." boozepwr = 70 quality = DRINK_FANTASTIC @@ -2264,7 +2144,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/planet_cracker name = "Planet Cracker" - id = "planet_cracker" description = "This jubilant drink celebrates humanity's triumph over the alien menace. May be offensive to non-human crewmembers." boozepwr = 50 quality = DRINK_FANTASTIC @@ -2276,7 +2155,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/commander_and_chief name = "Commander and Chief" - id = "commander_and_chief" description = "A cocktail for the captain on the go." color = "#ffffc9" boozepwr = 50 @@ -2300,7 +2178,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/commander_and_chief name = "Commander and Chief" - id = "commander_and_chief" description = "A cocktail for the captain on the go." color = "#ffffc9" boozepwr = 50 @@ -2323,7 +2200,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/fruit_wine name = "Fruit Wine" - id = "fruit_wine" description = "A wine made from grown plants." color = "#FFFFFF" boozepwr = 35 @@ -2430,7 +2306,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/gunfire name = "Gunfire" - id = "gunfire" description = "A drink that tastes like tiny explosions." color = "#e4830d" boozepwr = 40 @@ -2447,7 +2322,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/hellfire name = "Hellfire" - id = "hellfire" description = "A nice drink that isn't quite as hot as it looks." color = "#fb2203" boozepwr = 60 @@ -2463,7 +2337,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/sins_delight name = "Sin's Delight" - id = "sins_delight" description = "The drink smells like the seven sins." color = "#330000" boozepwr = 66 @@ -2475,7 +2348,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/painkiller name = "Painkiller" - id = "painkiller" description = "Dulls your pain. Your emotional pain, that is." boozepwr = 20 color = "#EAD677" @@ -2487,7 +2359,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/pina_colada name = "Pina Colada" - id = "pina_colada" description = "A fresh pineapple drink with coconut rum. Yum." boozepwr = 40 color = "#FFF1B2" @@ -2499,7 +2370,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/strawberry_daiquiri name = "Strawberry Daiquiri" - id = "strawberry_daiquiri" description = "Pink looking alcoholic drink." boozepwr = 20 color = "#FF4A74" @@ -2511,7 +2381,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/liz_fizz name = "Liz Fizz" - id = "liz_fizz" description = "Triple citrus layered with some ice and cream." boozepwr = 0 color = "#D8FF59" @@ -2522,7 +2391,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/miami_vice name = "Miami Vice" - id = "miami_vice" description = "A drink layering Pina Colada and Strawberry Daiquiri" boozepwr = 30 color = "#D8FF59" @@ -2534,7 +2402,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/malibu_sunset name = "Malibu Sunset" - id = "malibu_sunset" description = "A drink consisting of creme de coconut and tropical juices" boozepwr = 20 color = "#FF9473" @@ -2546,7 +2413,6 @@ datum/reagent/consumable/ethanol/creme_de_coconut /datum/reagent/consumable/ethanol/hotlime_miami name = "Hotlime Miami" - id = "hotlime_miami" description = "The essence of the 90's, if they were a bloody mess that is." boozepwr = 40 color = "#A7FAE8" diff --git a/code/modules/reagents/chemistry/reagents/blob_reagents.dm b/code/modules/reagents/chemistry/reagents/blob_reagents.dm index ada4cd8d..fba0b47e 100644 --- a/code/modules/reagents/chemistry/reagents/blob_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/blob_reagents.dm @@ -47,7 +47,6 @@ //does brute damage but can replicate when damaged and has a chance of expanding again /datum/reagent/blob/replicating_foam name = "Replicating Foam" - id = "replicating_foam" description = "will do medium brute damage and occasionally expand again when expanding." shortdesc = "will do medium brute damage." effectdesc = "will also expand when attacked with burn damage, but takes more brute damage." @@ -78,7 +77,6 @@ //does massive brute and burn damage, but can only expand manually /datum/reagent/blob/networked_fibers name = "Networked Fibers" - id = "networked_fibers" description = "will do high brute and burn damage and will generate resources quicker, but can only expand manually." shortdesc = "will do high brute and burn damage." taste_description = "efficiency" @@ -112,7 +110,6 @@ //does brute damage, shifts away when damaged /datum/reagent/blob/shifting_fragments name = "Shifting Fragments" - id = "shifting_fragments" description = "will do medium brute damage." effectdesc = "will also cause blob parts to shift away when attacked." taste_description = "something other-dimensional" @@ -134,7 +131,7 @@ if((damage_flag == "melee" || damage_flag == "bullet" || damage_flag == "laser") && damage > 0 && B.obj_integrity - damage > 0 && prob(60-damage)) var/list/blobstopick = list() for(var/obj/structure/blob/OB in orange(1, B)) - if((istype(OB, /obj/structure/blob/normal) || (istype(OB, /obj/structure/blob/shield) && prob(25))) && OB.overmind && OB.overmind.blob_reagent_datum.id == B.overmind.blob_reagent_datum.id) + if((istype(OB, /obj/structure/blob/normal) || (istype(OB, /obj/structure/blob/shield) && prob(25))) && OB.overmind && OB.overmind.blob_reagent_datum.type == B.overmind.blob_reagent_datum.type) blobstopick += OB //as long as the blob picked is valid; ie, a normal or shield blob that has the same chemical as we do, we can swap with it if(blobstopick.len) var/obj/structure/blob/targeted = pick(blobstopick) //randomize the blob chosen, because otherwise it'd tend to the lower left @@ -146,7 +143,6 @@ //sets you on fire, does burn damage, explodes into flame when burnt, weak to water /datum/reagent/blob/blazing_oil name = "Blazing Oil" - id = "blazing_oil" description = "will do medium burn damage and set targets on fire." effectdesc = "will also release bursts of flame when burnt, but takes damage from water." taste_description = "burning oil" @@ -174,7 +170,7 @@ if(damage_type == BURN && damage_flag != "energy") for(var/turf/open/T in range(1, B)) var/obj/structure/blob/C = locate() in T - if(!(C && C.overmind && C.overmind.blob_reagent_datum.id == B.overmind.blob_reagent_datum.id) && prob(80)) + if(!(C && C.overmind && C.overmind.blob_reagent_datum.type == B.overmind.blob_reagent_datum.type) && prob(80)) new /obj/effect/hotspot(T) if(damage_flag == "fire") return 0 @@ -183,7 +179,6 @@ //does toxin damage, hallucination, targets think they're not hurt at all /datum/reagent/blob/regenerative_materia name = "Regenerative Materia" - id = "regenerative_materia" description = "will do toxin damage and cause targets to believe they are fully healed." analyzerdescdamage = "Does toxin damage and injects a toxin that causes the target to believe they are fully healed." taste_description = "heaven" @@ -195,8 +190,8 @@ reac_volume = ..() M.adjust_drugginess(reac_volume) if(M.reagents) - M.reagents.add_reagent("regenerative_materia", 0.2*reac_volume) - M.reagents.add_reagent("spore", 0.2*reac_volume) + M.reagents.add_reagent(/datum/reagent/blob/regenerative_materia, 0.2*reac_volume) + M.reagents.add_reagent(/datum/reagent/toxin/spore, 0.2*reac_volume) M.apply_damage(0.7*reac_volume, TOX) /datum/reagent/blob/regenerative_materia/on_mob_life(mob/living/carbon/C) @@ -213,7 +208,6 @@ //kills sleeping targets and turns them into blob zombies, produces fragile spores when killed or on expanding /datum/reagent/blob/zombifying_pods name = "Zombifying Pods" - id = "zombifying_pods" description = "will do very low toxin damage and harvest sleeping targets for additional resources and a blob zombie." effectdesc = "will also produce fragile spores when killed and on expanding." taste_description = "fungi" @@ -257,7 +251,6 @@ //does tons of oxygen damage and a little stamina, immune to tesla bolts, weak to EMP /datum/reagent/blob/energized_jelly name = "Energized Jelly" - id = "energized_jelly" description = "will cause low stamina and high oxygen damage, and cause targets to be unable to breathe." taste_description = "gelatin" effectdesc = "will also conduct electricity, but takes damage from EMPs." @@ -289,7 +282,6 @@ //does aoe brute damage when hitting targets, is immune to explosions /datum/reagent/blob/explosive_lattice name = "Explosive Lattice" - id = "explosive_lattice" description = "will do brute damage in an area around targets." taste_description = "the bomb" effectdesc = "will also resist explosions, but takes increased damage from fire and other energy sources." @@ -326,7 +318,6 @@ //does brute, burn, and toxin damage, and cools targets down /datum/reagent/blob/cryogenic_poison name = "Cryogenic Poison" - id = "cryogenic_poison" description = "will inject targets with a freezing poison that does high damage over time." analyzerdescdamage = "Injects targets with a freezing poison that will gradually solidify the target's internal organs." color = "#8BA6E9" @@ -339,9 +330,9 @@ /datum/reagent/blob/cryogenic_poison/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O) reac_volume = ..() if(M.reagents) - M.reagents.add_reagent("frostoil", 0.3*reac_volume) - M.reagents.add_reagent("ice", 0.3*reac_volume) - M.reagents.add_reagent("cryogenic_poison", 0.3*reac_volume) + M.reagents.add_reagent(/datum/reagent/consumable/frostoil, 0.3*reac_volume) + M.reagents.add_reagent(/datum/reagent/consumable/ice, 0.3*reac_volume) + M.reagents.add_reagent(/datum/reagent/blob/cryogenic_poison, 0.3*reac_volume) M.apply_damage(0.2*reac_volume, BRUTE) /datum/reagent/blob/cryogenic_poison/on_mob_life(mob/living/carbon/M) @@ -354,7 +345,6 @@ //does burn damage and EMPs, slightly fragile /datum/reagent/blob/electromagnetic_web name = "Electromagnetic Web" - id = "electromagnetic_web" description = "will do high burn damage and EMP targets." taste_description = "pop rocks" effectdesc = "will also take massively increased damage and release an EMP when killed." @@ -391,7 +381,6 @@ //does brute damage, bonus damage for each nearby blob, and spreads damage out /datum/reagent/blob/synchronous_mesh name = "Synchronous Mesh" - id = "synchronous_mesh" description = "will do massively increased brute damage for each blob near the target." effectdesc = "will also spread damage between each blob near the attacked blob." taste_description = "toxic mold" @@ -415,10 +404,10 @@ if(damage_flag == "melee" || damage_flag == "bullet" || damage_flag == "laser") //the cause isn't fire or bombs, so split the damage var/damagesplit = 1 //maximum split is 9, reducing the damage each blob takes to 11% but doing that damage to 9 blobs for(var/obj/structure/blob/C in orange(1, B)) - if(!istype(C, /obj/structure/blob/core) && !istype(C, /obj/structure/blob/node) && C.overmind && C.overmind.blob_reagent_datum.id == B.overmind.blob_reagent_datum.id) //if it doesn't have the same chemical or is a core or node, don't split damage to it + if(!istype(C, /obj/structure/blob/core) && !istype(C, /obj/structure/blob/node) && C.overmind && C.overmind.blob_reagent_datum.type == B.overmind.blob_reagent_datum.type) //if it doesn't have the same chemical or is a core or node, don't split damage to it damagesplit += 1 for(var/obj/structure/blob/C in orange(1, B)) - if(!istype(C, /obj/structure/blob/core) && !istype(C, /obj/structure/blob/node) && C.overmind && C.overmind.blob_reagent_datum.id == B.overmind.blob_reagent_datum.id) //only hurt blobs that have the same overmind chemical and aren't cores or nodes + if(!istype(C, /obj/structure/blob/core) && !istype(C, /obj/structure/blob/node) && C.overmind && C.overmind.blob_reagent_datum.type == B.overmind.blob_reagent_datum.type) //only hurt blobs that have the same overmind chemical and aren't cores or nodes C.take_damage(damage/damagesplit, CLONE, 0, 0) return damage / damagesplit else @@ -427,7 +416,6 @@ //does brute damage through armor and bio resistance /datum/reagent/blob/reactive_spines name = "Reactive Spines" - id = "reactive_spines" description = "will do medium brute damage through armor and bio resistance." taste_description = "rock" effectdesc = "will also react when attacked with brute damage, attacking all near the attacked blob." @@ -454,7 +442,6 @@ //does low brute damage, oxygen damage, and stamina damage and wets tiles when damaged /datum/reagent/blob/pressurized_slime name = "Pressurized Slime" - id = "pressurized_slime" description = "will do low brute, oxygen, and stamina damage, and wet tiles under targets." effectdesc = "will also wet tiles near blobs that are attacked or killed." taste_description = "a sponge" diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index f40357bc..52100df7 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -6,7 +6,6 @@ /datum/reagent/consumable/orangejuice name = "Orange Juice" - id = "orangejuice" description = "Both delicious AND rich in Vitamin C, what more do you need?" color = "#E78108" // rgb: 231, 129, 8 taste_description = "oranges" @@ -22,7 +21,6 @@ /datum/reagent/consumable/tomatojuice name = "Tomato Juice" - id = "tomatojuice" description = "Tomatoes made into juice. What a waste of big, juicy tomatoes, huh?" color = "#731008" // rgb: 115, 16, 8 taste_description = "tomatoes" @@ -38,7 +36,6 @@ /datum/reagent/consumable/limejuice name = "Lime Juice" - id = "limejuice" description = "The sweet-sour juice of limes." color = "#365E30" // rgb: 54, 94, 48 taste_description = "unbearable sourness" @@ -54,7 +51,6 @@ /datum/reagent/consumable/carrotjuice name = "Carrot Juice" - id = "carrotjuice" description = "It is just like a carrot but without crunching." color = "#973800" // rgb: 151, 56, 0 taste_description = "carrots" @@ -76,7 +72,6 @@ /datum/reagent/consumable/berryjuice name = "Berry Juice" - id = "berryjuice" description = "A delicious blend of several different kinds of berries." color = "#863333" // rgb: 134, 51, 51 taste_description = "berries" @@ -86,7 +81,6 @@ /datum/reagent/consumable/applejuice name = "Apple Juice" - id = "applejuice" description = "The sweet juice of an apple, fit for all ages." color = "#ECFF56" // rgb: 236, 255, 86 taste_description = "apples" @@ -94,7 +88,6 @@ /datum/reagent/consumable/poisonberryjuice name = "Poison Berry Juice" - id = "poisonberryjuice" description = "A tasty juice blended from various kinds of very deadly and toxic berries." color = "#863353" // rgb: 134, 51, 83 taste_description = "berries" @@ -109,7 +102,6 @@ /datum/reagent/consumable/watermelonjuice name = "Watermelon Juice" - id = "watermelonjuice" description = "Delicious juice made from watermelon." color = "#863333" // rgb: 134, 51, 51 taste_description = "juicy watermelon" @@ -119,7 +111,6 @@ /datum/reagent/consumable/lemonjuice name = "Lemon Juice" - id = "lemonjuice" description = "This juice is VERY sour." color = "#863333" // rgb: 175, 175, 0 taste_description = "sourness" @@ -129,7 +120,6 @@ /datum/reagent/consumable/strawberryjuice name = "Strawberry Juice" - id = "strawberryjuice" description = "Refreshing seasonal summer drink." color = "#F2163A" taste_description = "strawberry" @@ -138,7 +128,6 @@ /datum/reagent/consumable/banana name = "Banana Juice" - id = "banana" description = "The raw essence of a banana. HONK" color = "#863333" // rgb: 175, 175, 0 taste_description = "banana" @@ -154,7 +143,6 @@ /datum/reagent/consumable/nothing name = "Nothing" - id = "nothing" description = "Absolutely nothing." taste_description = "nothing" glass_icon_state = "nothing" @@ -170,7 +158,6 @@ /datum/reagent/consumable/laughter name = "Laughter" - id = "laughter" description = "Some say that this is the best medicine, but recent studies have proven that to be untrue." metabolization_rate = INFINITY color = "#FF4DD2" @@ -183,7 +170,6 @@ /datum/reagent/consumable/superlaughter name = "Super Laughter" - id = "superlaughter" description = "Funny until you're the one laughing." metabolization_rate = 1.5 * REAGENTS_METABOLISM color = "#FF4DD2" @@ -198,7 +184,6 @@ /datum/reagent/consumable/potato_juice name = "Potato Juice" - id = "potato" description = "Juice of the potato. Bleh." nutriment_factor = 2 * REAGENTS_METABOLISM color = "#302000" // rgb: 48, 32, 0 @@ -209,14 +194,12 @@ /datum/reagent/consumable/grapejuice name = "Grape Juice" - id = "grapejuice" description = "The juice of a bunch of grapes. Guaranteed non-alcoholic." color = "#290029" // dark purple taste_description = "grape soda" /datum/reagent/consumable/milk name = "Milk" - id = "milk" description = "An opaque white liquid produced by the mammary glands of mammals." color = "#DFDFDF" // rgb: 223, 223, 223 taste_description = "milk" @@ -232,13 +215,12 @@ if(M.getBruteLoss() && prob(20)) M.heal_bodypart_damage(1,0, 0) . = 1 - if(holder.has_reagent("capsaicin")) - holder.remove_reagent("capsaicin", 2) + if(holder.has_reagent(/datum/reagent/consumable/capsaicin)) + holder.remove_reagent(/datum/reagent/consumable/capsaicin, 2) ..() /datum/reagent/consumable/soymilk name = "Soy Milk" - id = "soymilk" description = "An opaque white liquid made from soybeans." color = "#DFDFC7" // rgb: 223, 223, 199 taste_description = "soy milk" @@ -254,7 +236,6 @@ /datum/reagent/consumable/coconutmilk name = "Coconut Milk" - id = "coconutmilk" description = "A transparent white liquid extracted from coconuts. Rich in taste." color = "#DFDFDF" // rgb: 223, 223, 223 taste_description = "sweet milk" @@ -271,7 +252,6 @@ /datum/reagent/consumable/cream name = "Cream" - id = "cream" description = "The fatty, still liquid part of milk. Why don't you mix this with sum scotch, eh?" color = "#DFD7AF" // rgb: 223, 215, 175 taste_description = "creamy milk" @@ -287,7 +267,6 @@ /datum/reagent/consumable/coffee name = "Coffee" - id = "coffee" description = "Coffee is a brewed drink prepared from roasted seeds, commonly called coffee beans, of the coffee plant." color = "#482000" // rgb: 72, 32, 0 nutriment_factor = 0 @@ -307,14 +286,13 @@ M.AdjustSleeping(-40, FALSE) //310.15 is the normal bodytemp. M.adjust_bodytemperature(25 * TEMPERATURE_DAMAGE_COEFFICIENT, 0, BODYTEMP_NORMAL) - if(holder.has_reagent("frostoil")) - holder.remove_reagent("frostoil", 5) + if(holder.has_reagent(/datum/reagent/consumable/frostoil)) + holder.remove_reagent(/datum/reagent/consumable/frostoil, 5) ..() . = 1 /datum/reagent/consumable/tea name = "Tea" - id = "tea" description = "Tasty black tea, it has antioxidants, it's good for you!" color = "#101000" // rgb: 16, 16, 0 nutriment_factor = 0 @@ -336,7 +314,6 @@ /datum/reagent/consumable/lemonade name = "Lemonade" - id = "lemonade" description = "Sweet, tangy lemonade. Good for the soul." quality = DRINK_NICE taste_description = "sunshine and summertime" @@ -346,7 +323,6 @@ /datum/reagent/consumable/tea/arnold_palmer name = "Arnold Palmer" - id = "arnold_palmer" description = "Encourages the patient to go golfing." color = "#FFB766" quality = DRINK_NICE @@ -364,7 +340,6 @@ /datum/reagent/consumable/icecoffee name = "Iced Coffee" - id = "icecoffee" description = "Coffee and ice, refreshing and cool." color = "#102838" // rgb: 16, 40, 56 nutriment_factor = 0 @@ -384,7 +359,6 @@ /datum/reagent/consumable/icetea name = "Iced Tea" - id = "icetea" description = "No relation to a certain rap artist/actor." color = "#104038" // rgb: 16, 64, 56 nutriment_factor = 0 @@ -405,7 +379,6 @@ /datum/reagent/consumable/space_cola name = "Cola" - id = "cola" description = "A refreshing beverage." color = "#100800" // rgb: 16, 8, 0 taste_description = "cola" @@ -420,7 +393,6 @@ /datum/reagent/consumable/nuka_cola name = "Nuka Cola" - id = "nuka_cola" description = "Cola, cola never changes." color = "#100800" // rgb: 16, 8, 0 quality = DRINK_VERYGOOD @@ -431,10 +403,10 @@ /datum/reagent/consumable/nuka_cola/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, type) /datum/reagent/consumable/nuka_cola/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, type) ..() /datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/carbon/M) @@ -449,7 +421,6 @@ /datum/reagent/consumable/spacemountainwind name = "SM Wind" - id = "spacemountainwind" description = "Blows right through you like a space wind." color = "#102000" // rgb: 16, 32, 0 taste_description = "sweet citrus soda" @@ -467,7 +438,6 @@ /datum/reagent/consumable/dr_gibb name = "Dr. Gibb" - id = "dr_gibb" description = "A delicious blend of 42 different flavours." color = "#102000" // rgb: 16, 32, 0 taste_description = "cherry soda" // FALSE ADVERTISING @@ -482,7 +452,6 @@ /datum/reagent/consumable/space_up name = "Space-Up" - id = "space_up" description = "Tastes like a hull breach in your mouth." color = "#00FF00" // rgb: 0, 255, 0 taste_description = "cherry soda" @@ -498,7 +467,6 @@ /datum/reagent/consumable/lemon_lime name = "Lemon Lime" description = "A tangy substance made of 0.5% natural citrus!" - id = "lemon_lime" color = "#8CFF00" // rgb: 135, 255, 0 taste_description = "tangy lime and lemon soda" glass_icon_state = "glass_yellow" @@ -513,7 +481,6 @@ /datum/reagent/consumable/pwr_game name = "Pwr Game" description = "The only drink with the PWR that true gamers crave." - id = "pwr_game" color = "#9385bf" // rgb: 58, 52, 75 taste_description = "sweet and salty tang" glass_icon_state = "glass_red" @@ -527,7 +494,6 @@ /datum/reagent/consumable/shamblers name = "Shambler's Juice" description = "~Shake me up some of that Shambler's Juice!~" - id = "shamblers" color = "#f00060" // rgb: 94, 0, 38 taste_description = "carbonated metallic soda" glass_icon_state = "glass_red" @@ -540,7 +506,6 @@ /datum/reagent/consumable/grey_bull name = "Grey Bull" - id = "grey_bull" description = "Grey Bull, it gives you gloves!" color = "#EEFF00" // rgb: 238, 255, 0 quality = DRINK_VERYGOOD @@ -551,10 +516,10 @@ /datum/reagent/consumable/grey_bull/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_SHOCKIMMUNE, id) + ADD_TRAIT(L, TRAIT_SHOCKIMMUNE, type) /datum/reagent/consumable/grey_bull/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_SHOCKIMMUNE, id) + REMOVE_TRAIT(L, TRAIT_SHOCKIMMUNE, type) ..() /datum/reagent/consumable/grey_bull/on_mob_life(mob/living/carbon/M) @@ -567,7 +532,6 @@ /datum/reagent/consumable/sodawater name = "Soda Water" - id = "sodawater" description = "A can of club soda. Why not make a scotch and soda?" color = "#619494" // rgb: 97, 148, 148 taste_description = "carbonated water" @@ -583,7 +547,6 @@ /datum/reagent/consumable/tonic name = "Tonic Water" - id = "tonic" description = "It tastes strange but at least the quinine keeps the Space Malaria at bay." color = "#0064C8" // rgb: 0, 100, 200 taste_description = "tart and fresh" @@ -601,7 +564,6 @@ /datum/reagent/consumable/ice name = "Ice" - id = "ice" description = "Frozen water, your dentist wouldn't like you chewing this." reagent_state = SOLID color = "#619494" // rgb: 97, 148, 148 @@ -616,7 +578,6 @@ /datum/reagent/consumable/soy_latte name = "Soy Latte" - id = "soy_latte" description = "A nice and tasty beverage while you are reading your hippie books." color = "#664300" // rgb: 102, 67, 0 quality = DRINK_NICE @@ -638,7 +599,6 @@ /datum/reagent/consumable/cafe_latte name = "Cafe Latte" - id = "cafe_latte" description = "A nice, strong and tasty beverage while you are reading." color = "#664300" // rgb: 102, 67, 0 quality = DRINK_NICE @@ -660,7 +620,6 @@ /datum/reagent/consumable/doctor_delight name = "The Doctor's Delight" - id = "doctorsdelight" description = "A gulp a day keeps the Medibot away! A mixture of juices that heals most damage types fairly quickly at the cost of hunger." color = "#FF8CFF" // rgb: 255, 140, 255 quality = DRINK_VERYGOOD @@ -682,7 +641,6 @@ /datum/reagent/consumable/chocolatepudding name = "Chocolate Pudding" - id = "chocolatepudding" description = "A great dessert for chocolate lovers." color = "#800000" quality = DRINK_VERYGOOD @@ -694,7 +652,6 @@ /datum/reagent/consumable/vanillapudding name = "Vanilla Pudding" - id = "vanillapudding" description = "A great dessert for vanilla lovers." color = "#FAFAD2" quality = DRINK_VERYGOOD @@ -706,7 +663,6 @@ /datum/reagent/consumable/cherryshake name = "Cherry Shake" - id = "cherryshake" description = "A cherry flavored milkshake." color = "#FFB6C1" quality = DRINK_VERYGOOD @@ -718,7 +674,6 @@ /datum/reagent/consumable/bluecherryshake name = "Blue Cherry Shake" - id = "bluecherryshake" description = "An exotic milkshake." color = "#00F1FF" quality = DRINK_VERYGOOD @@ -730,7 +685,6 @@ /datum/reagent/consumable/pumpkin_latte name = "Pumpkin Latte" - id = "pumpkin_latte" description = "A mix of pumpkin juice and coffee." color = "#F4A460" quality = DRINK_VERYGOOD @@ -742,7 +696,6 @@ /datum/reagent/consumable/gibbfloats name = "Gibb Floats" - id = "gibbfloats" description = "Ice cream on top of a Dr. Gibb glass." color = "#B22222" quality = DRINK_NICE @@ -754,21 +707,18 @@ /datum/reagent/consumable/pumpkinjuice name = "Pumpkin Juice" - id = "pumpkinjuice" description = "Juiced from real pumpkin." color = "#FFA500" taste_description = "pumpkin" /datum/reagent/consumable/blumpkinjuice name = "Blumpkin Juice" - id = "blumpkinjuice" description = "Juiced from real blumpkin." color = "#00BFFF" taste_description = "a mouthful of pool water" /datum/reagent/consumable/triple_citrus name = "Triple Citrus" - id = "triple_citrus" description = "A solution." color = "#fff12b" quality = DRINK_NICE @@ -779,7 +729,6 @@ /datum/reagent/consumable/grape_soda name = "Grape soda" - id = "grapesoda" description = "Beloved of children and teetotalers." color = "#E6CDFF" taste_description = "grape soda" @@ -793,7 +742,6 @@ /datum/reagent/consumable/milk/chocolate_milk name = "Chocolate Milk" - id = "chocolate_milk" description = "Milk for cool kids." color = "#7D4E29" quality = DRINK_NICE @@ -801,7 +749,6 @@ /datum/reagent/consumable/menthol name = "Menthol" - id = "menthol" description = "Alleviates coughing symptoms one might have." color = "#80AF9C" taste_description = "mint" @@ -811,7 +758,6 @@ /datum/reagent/consumable/grenadine name = "Grenadine" - id = "grenadine" description = "Not cherry flavored!" color = "#EA1D26" taste_description = "sweet pomegranates" @@ -820,7 +766,6 @@ /datum/reagent/consumable/parsnipjuice name = "Parsnip Juice" - id = "parsnipjuice" description = "Why..." color = "#FFA500" taste_description = "parsnip" @@ -828,7 +773,6 @@ /datum/reagent/consumable/pineapplejuice name = "Pineapple Juice" - id = "pineapplejuice" description = "Tart, tropical, and hotly debated." color = "#F7D435" taste_description = "pineapple" @@ -837,7 +781,6 @@ /datum/reagent/consumable/peachjuice //Intended to be extremely rare due to being the limiting ingredients in the blazaam drink name = "Peach Juice" - id = "peachjuice" description = "Just peachy." color = "#E78108" taste_description = "peaches" @@ -845,7 +788,6 @@ /datum/reagent/consumable/cream_soda name = "Cream Soda" - id = "cream_soda" description = "A classic space-American vanilla flavored soft drink." color = "#dcb137" quality = DRINK_VERYGOOD @@ -860,7 +802,6 @@ /datum/reagent/consumable/red_queen name = "Red Queen" - id = "red_queen" description = "DRINK ME." color = "#e6ddc3" quality = DRINK_GOOD @@ -888,7 +829,6 @@ /datum/reagent/consumable/pinkmilk name = "Strawberry Milk" - id = "pinkmilk" description = "A drink of a bygone era of milk and artificial sweetener back on a rock." color = "#f76aeb"//rgb(247, 106, 235) glass_icon_state = "pinkmilk" @@ -905,7 +845,6 @@ /datum/reagent/consumable/pinktea //Tiny Tim song name = "Strawberry Tea" - id = "pinktea" description = "A timeless classic!" color = "#f76aeb"//rgb(247, 106, 235) glass_icon_state = "pinktea" @@ -922,7 +861,6 @@ /datum/reagent/consumable/monkey_energy name = "Monkey Energy" - id = "monkey_energy" description = "The only drink that will make you unleash the ape." color = "#f39b03" // rgb: 243, 155, 3 taste_description = "barbecue and nostalgia" @@ -937,3 +875,12 @@ M.AdjustSleeping(-40, FALSE) M.adjust_bodytemperature(-5 * TEMPERATURE_DAMAGE_COEFFICIENT, BODYTEMP_NORMAL) ..() + +/datum/reagent/consumable/bungojuice + name = "Bungo Juice" + color = "#F9E43D" + description = "Exotic! You feel like you are on vactation already." + taste_description = "succulent bungo" + glass_icon_state = "glass_yellow" + glass_name = "glass of bungo juice" + glass_desc = "Exotic! You feel like you are on vacation already." diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index ff96a286..2e6b3ce5 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -1,6 +1,5 @@ /datum/reagent/drug name = "Drug" - id = "drug" value = 12 metabolization_rate = 0.5 * REAGENTS_METABOLISM taste_description = "bitterness" @@ -8,11 +7,11 @@ /datum/reagent/drug/on_mob_end_metabolize(mob/living/M) if(trippy) - SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "[id]_high") + SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "[type]_high") /datum/reagent/drug/space_drugs name = "Space drugs" - id = "space_drugs" + value = 6 description = "An illegal chemical compound used as drug." color = "#60A584" // rgb: 96, 165, 132 overdose_threshold = 30 @@ -30,7 +29,7 @@ /datum/reagent/drug/space_drugs/overdose_start(mob/living/M) to_chat(M, "You start tripping hard!") - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/overdose, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/overdose, name) /datum/reagent/drug/space_drugs/overdose_process(mob/living/M) if(M.hallucination < volume && prob(20)) @@ -39,7 +38,7 @@ /datum/reagent/drug/nicotine name = "Nicotine" - id = "nicotine" + value = 0 description = "Slightly reduces stun times. If overdosed it will deal toxin and oxygen damage." reagent_state = LIQUID color = "#60A584" // rgb: 96, 165, 132 @@ -62,7 +61,6 @@ /datum/reagent/drug/crank name = "Crank" - id = "crank" description = "Reduces stun times by about 200%. If overdosed or addicted it will deal significant Toxin, Brute and Brain damage." reagent_state = LIQUID color = "#FA00C8" @@ -110,7 +108,6 @@ /datum/reagent/drug/krokodil name = "Krokodil" - id = "krokodil" description = "Cools and calms you down. If overdosed it will deal significant Brain and Toxin damage. If addicted it will begin to deal fatal amounts of Brute damage as the subject's skin falls off." reagent_state = LIQUID color = "#0064B4" @@ -162,8 +159,7 @@ /datum/reagent/drug/methamphetamine name = "Methamphetamine" - id = "methamphetamine" - description = "Reduces stun times by about 300%, speeds the user up, and allows the user to quickly recover stamina while dealing a small amount of Brain damage. If overdosed the subject will move randomly, laugh randomly, drop items and suffer from Toxin and Brain damage. If addicted the subject will constantly jitter and drool, before becoming dizzy and losing motor control and eventually suffer heavy toxin damage." + description = "Reduces stun times by about 300%, and allows the user to quickly recover stamina while dealing a small amount of Brain damage. If overdosed the subject will move randomly, laugh randomly, drop items and suffer from Toxin and Brain damage. If addicted the subject will constantly jitter and drool, before becoming dizzy and losing motor control and eventually suffer heavy toxin damage." reagent_state = LIQUID color = "#FAFAFA" overdose_threshold = 20 @@ -176,10 +172,10 @@ /datum/reagent/drug/methamphetamine/on_mob_metabolize(mob/living/L) ..() - L.ignore_slowdown(id) + L.ignore_slowdown(type) /datum/reagent/drug/methamphetamine/on_mob_end_metabolize(mob/living/L) - L.unignore_slowdown(id) + L.unignore_slowdown(type) ..() /datum/reagent/drug/methamphetamine/on_mob_life(mob/living/carbon/M) @@ -250,7 +246,6 @@ . = 1 /datum/reagent/drug/methamphetamine/changeling - id = "changelingmeth" name = "Changeling Adrenaline" addiction_threshold = 35 overdose_threshold = 35 @@ -259,7 +254,6 @@ /datum/reagent/drug/bath_salts name = "Bath Salts" - id = "bath_salts" description = "Makes you impervious to stuns and grants a stamina regeneration buff, but you will be a nearly uncontrollable tramp-bearded raving lunatic." reagent_state = LIQUID color = "#FAFAFA" @@ -271,16 +265,16 @@ /datum/reagent/drug/bath_salts/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_STUNIMMUNE, id) - ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, id) + ADD_TRAIT(L, TRAIT_STUNIMMUNE, type) + ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, type) if(iscarbon(L)) var/mob/living/carbon/C = L rage = new() C.gain_trauma(rage, TRAUMA_RESILIENCE_ABSOLUTE) /datum/reagent/drug/bath_salts/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, id) - REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, id) + REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, type) + REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, type) if(rage) QDEL_NULL(rage) ..() @@ -360,7 +354,6 @@ /datum/reagent/drug/aranesp name = "Aranesp" - id = "aranesp" description = "Amps you up and gets you going, fixes all stamina damage you might have but can cause toxin and oxygen damage." reagent_state = LIQUID color = "#78FFF0" @@ -380,7 +373,6 @@ /datum/reagent/drug/happiness name = "Happiness" - id = "happiness" description = "Fills you with ecstasic numbness and causes minor brain damage. Highly addictive. If overdosed causes sudden mood swings." reagent_state = LIQUID color = "#FFF378" @@ -390,11 +382,11 @@ /datum/reagent/drug/happiness/on_mob_add(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_FEARLESS, id) + ADD_TRAIT(L, TRAIT_FEARLESS, type) SEND_SIGNAL(L, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug) /datum/reagent/drug/happiness/on_mob_delete(mob/living/L) - REMOVE_TRAIT(L, TRAIT_FEARLESS, id) + REMOVE_TRAIT(L, TRAIT_FEARLESS, type) SEND_SIGNAL(L, COMSIG_CLEAR_MOOD_EVENT, "happiness_drug") ..() @@ -458,7 +450,6 @@ /datum/reagent/drug/skooma name = "Skooma" - id = "skooma" description = "An ancient, highly-addictive drug of long-forgotten times. It greatly improves the user's speed and strength, but heavily impedes their intelligence and agility." reagent_state = LIQUID color = "#F3E0F9" @@ -470,7 +461,7 @@ /datum/reagent/drug/skooma/on_mob_metabolize(mob/living/L) . = ..() - ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, type) L.next_move_modifier *= 2 if(ishuman(L)) var/mob/living/carbon/human/H = L @@ -481,7 +472,7 @@ /datum/reagent/drug/skooma/on_mob_end_metabolize(mob/living/L) . = ..() - REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, type) L.next_move_modifier *= 0.5 if(ishuman(L)) var/mob/living/carbon/human/H = L diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 088bd253..45afb498 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -9,7 +9,6 @@ /datum/reagent/consumable name = "Consumable" - id = "consumable" taste_description = "generic food" taste_mult = 4 value = 0.1 @@ -19,7 +18,7 @@ /datum/reagent/consumable/on_mob_life(mob/living/carbon/M) current_cycle++ M.nutrition += nutriment_factor - holder.remove_reagent(src.id, metabolization_rate) + holder.remove_reagent(type, metabolization_rate) /datum/reagent/consumable/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(method == INGEST) @@ -39,7 +38,6 @@ /datum/reagent/consumable/nutriment name = "Nutriment" - id = "nutriment" description = "All the vitamins, minerals, and carbohydrates the body needs in pure form." reagent_state = SOLID nutriment_factor = 15 * REAGENTS_METABOLISM @@ -90,7 +88,6 @@ /datum/reagent/consumable/nutriment/vitamin name = "Vitamin" - id = "vitamin" description = "All the best vitamins, minerals, and carbohydrates the body needs in pure form." value = 0.5 @@ -104,7 +101,6 @@ /datum/reagent/consumable/cooking_oil name = "Cooking Oil" - id = "cooking_oil" description = "A variety of cooking oil derived from fat or plants. Used in food preparation and frying." color = "#EADD6B" //RGB: 234, 221, 107 (based off of canola oil) taste_mult = 0.8 @@ -121,7 +117,7 @@ O.loc.visible_message("[O] rapidly fries as it's splashed with hot oil! Somehow.") var/obj/item/reagent_containers/food/snacks/deepfryholder/F = new(O.drop_location(), O) F.fry(volume) - F.reagents.add_reagent("cooking_oil", reac_volume) + F.reagents.add_reagent(/datum/reagent/consumable/cooking_oil, reac_volume) /datum/reagent/consumable/cooking_oil/reaction_mob(mob/living/M, method = TOUCH, reac_volume, show_message = 1, touch_protection = 0) if(!istype(M)) @@ -150,7 +146,6 @@ /datum/reagent/consumable/sugar name = "Sugar" - id = "sugar" description = "The organic compound commonly known as table sugar and sometimes called saccharose. This white, odorless, crystalline powder has a pleasing, sweet taste." reagent_state = SOLID color = "#FFFFFF" // rgb: 255, 255, 255 @@ -173,7 +168,6 @@ /datum/reagent/consumable/virus_food name = "Virus Food" - id = "virusfood" description = "A mixture of water and milk. Virus cells can use this mixture to reproduce." nutriment_factor = 2 * REAGENTS_METABOLISM color = "#899613" // rgb: 137, 150, 19 @@ -181,7 +175,6 @@ /datum/reagent/consumable/soysauce name = "Soysauce" - id = "soysauce" description = "A salty sauce made from the soy plant." nutriment_factor = 2 * REAGENTS_METABOLISM color = "#792300" // rgb: 121, 35, 0 @@ -189,16 +182,20 @@ /datum/reagent/consumable/ketchup name = "Ketchup" - id = "ketchup" description = "Ketchup, catsup, whatever. It's tomato paste." nutriment_factor = 5 * REAGENTS_METABOLISM color = "#731008" // rgb: 115, 16, 8 taste_description = "ketchup" +/datum/reagent/consumable/mustard + name = "Mustard" + description = "Mustard, mostly used on hotdogs, corndogs and burgers." + nutriment_factor = 5 * REAGENTS_METABOLISM + color = "#DDED26" // rgb: 221, 237, 38 + taste_description = "mustard" /datum/reagent/consumable/capsaicin name = "Capsaicin Oil" - id = "capsaicin" description = "This is what makes chilis hot." color = "#B31008" // rgb: 179, 16, 8 taste_description = "hot peppers" @@ -209,8 +206,8 @@ switch(current_cycle) if(1 to 15) heating = 5 * TEMPERATURE_DAMAGE_COEFFICIENT - if(holder.has_reagent("cryostylane")) - holder.remove_reagent("cryostylane", 5) + if(holder.has_reagent(/datum/reagent/cryostylane)) + holder.remove_reagent(/datum/reagent/cryostylane, 5) if(isslime(M)) heating = rand(5,20) if(15 to 25) @@ -230,7 +227,6 @@ /datum/reagent/consumable/frostoil name = "Frost Oil" - id = "frostoil" description = "A special oil that noticably chills the body. Extracted from Icepeppers and slimes." color = "#8BA6E9" // rgb: 139, 166, 233 taste_description = "mint" @@ -242,8 +238,8 @@ switch(current_cycle) if(1 to 15) cooling = -10 * TEMPERATURE_DAMAGE_COEFFICIENT - if(holder.has_reagent("capsaicin")) - holder.remove_reagent("capsaicin", 5) + if(holder.has_reagent(/datum/reagent/consumable/capsaicin)) + holder.remove_reagent(/datum/reagent/consumable/capsaicin, 5) if(isslime(M)) cooling = -rand(5,20) if(15 to 25) @@ -277,7 +273,6 @@ /datum/reagent/consumable/condensedcapsaicin name = "Condensed Capsaicin" - id = "condensedcapsaicin" description = "A chemical agent used for self-defense and in police work." color = "#B31008" // rgb: 179, 16, 8 taste_description = "scorching agony" @@ -351,7 +346,6 @@ /datum/reagent/consumable/sodiumchloride name = "Table Salt" - id = "sodiumchloride" description = "A salt made of sodium chloride. Commonly used to season food." reagent_state = SOLID color = "#FFFFFF" // rgb: 255,255,255 @@ -372,7 +366,6 @@ /datum/reagent/consumable/blackpepper name = "Black Pepper" - id = "blackpepper" description = "A powder ground from peppercorns. *AAAACHOOO*" reagent_state = SOLID // no color (ie, black) @@ -380,7 +373,6 @@ /datum/reagent/consumable/coco name = "Coco Powder" - id = "cocoa" description = "A fatty, bitter paste made from coco beans." reagent_state = SOLID nutriment_factor = 5 * REAGENTS_METABOLISM @@ -389,7 +381,6 @@ /datum/reagent/consumable/hot_coco name = "Hot Chocolate" - id = "hot_coco" description = "Made with love! And coco beans." nutriment_factor = 3 * REAGENTS_METABOLISM color = "#403010" // rgb: 64, 48, 16 @@ -404,7 +395,6 @@ /datum/reagent/drug/mushroomhallucinogen name = "Mushroom Hallucinogen" - id = "mushroomhallucinogen" description = "A strong hallucinogenic drug derived from certain species of mushroom." color = "#E700E7" // rgb: 231, 0, 231 metabolization_rate = 0.2 * REAGENTS_METABOLISM @@ -435,7 +425,6 @@ /datum/reagent/consumable/sprinkles name = "Sprinkles" - id = "sprinkles" value = 3 description = "Multi-colored little bits of sugar, commonly found on donuts. Loved by cops." color = "#FF00FF" // rgb: 255, 0, 255 @@ -449,7 +438,6 @@ /datum/reagent/consumable/peanut_butter name = "Peanut Butter" - id = "peanut_butter" description = "A popular food paste made from ground dry-roasted peanuts." color = "#C29261" value = 3 @@ -458,7 +446,6 @@ /datum/reagent/consumable/cornoil name = "Corn Oil" - id = "cornoil" description = "An oil derived from various types of corn." nutriment_factor = 20 * REAGENTS_METABOLISM value = 4 @@ -479,7 +466,6 @@ /datum/reagent/consumable/enzyme name = "Universal Enzyme" - id = "enzyme" value = 1 description = "A universal enzyme used in the preperation of certain chemicals and foods." color = "#365E30" // rgb: 54, 94, 48 @@ -487,7 +473,6 @@ /datum/reagent/consumable/dry_ramen name = "Dry Ramen" - id = "dry_ramen" description = "Space age food, since August 25, 1958. Contains dried noodles, vegetables, and chemicals that boil in contact with water." reagent_state = SOLID color = "#302000" // rgb: 48, 32, 0 @@ -495,7 +480,6 @@ /datum/reagent/consumable/hot_ramen name = "Hot Ramen" - id = "hot_ramen" description = "The noodles are boiled, the flavors are artificial, just like being back in school." nutriment_factor = 5 * REAGENTS_METABOLISM color = "#302000" // rgb: 48, 32, 0 @@ -507,7 +491,6 @@ /datum/reagent/consumable/hell_ramen name = "Hell Ramen" - id = "hell_ramen" description = "The noodles are boiled, the flavors are artificial, just like being back in school." nutriment_factor = 5 * REAGENTS_METABOLISM color = "#302000" // rgb: 48, 32, 0 @@ -519,7 +502,6 @@ /datum/reagent/consumable/flour name = "Flour" - id = "flour" value = 0.5 description = "This is what you rub all over yourself to pretend to be a ghost." reagent_state = SOLID @@ -531,11 +513,10 @@ var/obj/effect/decal/cleanable/flour/reagentdecal = new/obj/effect/decal/cleanable/flour(T) reagentdecal = locate() in T //Might have merged with flour already there. if(reagentdecal) - reagentdecal.reagents.add_reagent("flour", reac_volume) + reagentdecal.reagents.add_reagent(/datum/reagent/consumable/flour, reac_volume) /datum/reagent/consumable/cherryjelly name = "Cherry Jelly" - id = "cherryjelly" description = "Totally the best. Only to be spread on foods with excellent lateral symmetry." color = "#801E28" // rgb: 128, 30, 40 value = 1 @@ -543,7 +524,6 @@ /datum/reagent/consumable/bluecherryjelly name = "Blue Cherry Jelly" - id = "bluecherryjelly" description = "Blue and tastier kind of cherry jelly." color = "#00F0FF" value = 12 @@ -551,7 +531,6 @@ /datum/reagent/consumable/garlic //NOTE: having garlic in your blood stops vampires from biting you. name = "Garlic Juice" - id = "garlic" description = "Crushed garlic. Chefs love it, but it can make you smell bad." color = "#FEFEFE" taste_description = "garlic" @@ -572,7 +551,6 @@ /datum/reagent/consumable/rice name = "Rice" - id = "rice" value = 0.5 description = "tiny nutritious grains" reagent_state = SOLID @@ -582,7 +560,6 @@ /datum/reagent/consumable/vanilla name = "Vanilla Powder" - id = "vanilla" value = 1 description = "A fatty, bitter paste made from vanilla pods." reagent_state = SOLID @@ -592,7 +569,6 @@ /datum/reagent/consumable/eggyolk name = "Egg Yolk" - id = "eggyolk" value = 1 description = "It's full of protein." nutriment_factor = 3 * REAGENTS_METABOLISM @@ -601,7 +577,6 @@ /datum/reagent/consumable/corn_starch name = "Corn Starch" - id = "corn_starch" value = 2 description = "A slippery solution." color = "#f7f6e4" @@ -609,7 +584,6 @@ /datum/reagent/consumable/corn_syrup name = "Corn Syrup" - id = "corn_syrup" value = 1 description = "Decays into sugar." color = "#fff882" @@ -617,12 +591,11 @@ taste_description = "sweet slime" /datum/reagent/consumable/corn_syrup/on_mob_life(mob/living/carbon/M) - holder.add_reagent("sugar", 3) + holder.add_reagent(/datum/reagent/consumable/sugar, 3) ..() /datum/reagent/consumable/honey - name = "Honey" - id = "honey" + name = "honey" description = "Sweet sweet honey that decays into sugar. Has antibacterial and natural healing properties." color = "#d3a308" value = 15 @@ -631,6 +604,7 @@ taste_description = "sweetness" /datum/reagent/consumable/honey/on_mob_life(mob/living/carbon/M) + M.reagents.add_reagent(/datum/reagent/consumable/sugar,3) if(prob(55)) M.adjustBruteLoss(-1*REM, 0) M.adjustFireLoss(-1*REM, 0) @@ -648,7 +622,6 @@ /datum/reagent/consumable/mayonnaise name = "Mayonnaise" - id = "mayonnaise" description = "An white and oily mixture of mixed egg yolks." color = "#DFDFDF" value = 5 @@ -656,7 +629,6 @@ /datum/reagent/consumable/tearjuice name = "Tear Juice" - id = "tearjuice" description = "A blinding substance extracted from certain onions." color = "#c0c9a0" taste_description = "bitterness" @@ -695,7 +667,6 @@ /datum/reagent/consumable/nutriment/stabilized name = "Stabilized Nutriment" - id = "stabilizednutriment" description = "A bioengineered protien-nutrient structure designed to decompose in high saturation. In layman's terms, it won't get you fat." reagent_state = SOLID nutriment_factor = 15 * REAGENTS_METABOLISM @@ -711,7 +682,6 @@ /datum/reagent/consumable/entpoly name = "Entropic Polypnium" - id = "entpoly" description = "An ichor, derived from a certain mushroom, makes for a bad time." color = "#1d043d" taste_description = "bitter mushroom" @@ -732,7 +702,6 @@ /datum/reagent/consumable/tinlux name = "Tinea Luxor" - id = "tinlux" description = "A stimulating ichor which causes luminescent fungi to grow on the skin. " color = "#b5a213" taste_description = "tingling mushroom" @@ -746,7 +715,6 @@ /datum/reagent/consumable/vitfro name = "Vitrium Froth" - id = "vitfro" description = "A bubbly paste that heals wounds of the skin." color = "#d3a308" nutriment_factor = 3 * REAGENTS_METABOLISM @@ -762,7 +730,6 @@ /datum/reagent/consumable/clownstears name = "Clown's Tears" - id = "clownstears" description = "The sorrow and melancholy of a thousand bereaved clowns, forever denied their Honkmechs." nutriment_factor = 5 * REAGENTS_METABOLISM color = "#eef442" // rgb: 238, 244, 66 @@ -771,7 +738,6 @@ /datum/reagent/consumable/liquidelectricity name = "Liquid Electricity" - id = "liquidelectricity" description = "The blood of Ethereals, and the stuff that keeps them going. Great for them, horrid for anyone else." nutriment_factor = 5 * REAGENTS_METABOLISM color = "#97ee63" @@ -795,7 +761,6 @@ /datum/reagent/consumable/astrotame name = "Astrotame" - id = "astrotame" description = "A space age artifical sweetener." nutriment_factor = 0 metabolization_rate = 2 * REAGENTS_METABOLISM @@ -814,7 +779,6 @@ /datum/reagent/consumable/caramel name = "Caramel" - id = "caramel" description = "Who would have guessed that heated sugar could be so delicious?" nutriment_factor = 10 * REAGENTS_METABOLISM color = "#D98736" @@ -824,7 +788,6 @@ /datum/reagent/consumable/secretsauce name = "secret sauce" - id = "secret_sauce" description = "What could it be." nutriment_factor = 2 * REAGENTS_METABOLISM color = "#792300" @@ -836,7 +799,6 @@ /datum/reagent/consumable/char name = "Char" - id = "char" description = "Essence of the grill. Has strange properties when overdosed." reagent_state = LIQUID nutriment_factor = 5 * REAGENTS_METABOLISM @@ -851,7 +813,6 @@ /datum/reagent/consumable/bbqsauce name = "BBQ Sauce" - id = "bbqsauce" description = "Sweet, Smokey, Savory, and gets everywhere. Perfect for Grilling." nutriment_factor = 5 * REAGENTS_METABOLISM color = "#78280A" // rgb: 120 40, 10 diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents.dm index 6251fbf7..7f97a22d 100644 --- a/code/modules/reagents/chemistry/reagents/impure_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/impure_reagents.dm @@ -8,8 +8,7 @@ /datum/reagent/impure/fermiTox name = "Chemical Isomers" - id = "fermiTox" - description = "Toxic chemical isomers made from impure reactions. At low volumes will cause light toxin damage, but as the volume increases, it deals larger amounts, damages the liver, then eventually the heart." + description = "Toxic chemical isomers made from impure reactions. At low volumes will cause light toxin damage, but as the volume increases, it deals larger amounts, damages the liver, then eventually the heart. This is default impure chem for all chems, and changes only if stated." data = "merge" color = "FFFFFF" can_synth = FALSE diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index f9ad023d..fe88c246 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -7,17 +7,15 @@ /datum/reagent/medicine name = "Medicine" - id = "medicine" value = 2 taste_description = "bitterness" /datum/reagent/medicine/on_mob_life(mob/living/carbon/M) current_cycle++ - holder.remove_reagent(src.id, metabolization_rate / M.metabolism_efficiency) //medicine reagents stay longer if you have a better metabolism + holder.remove_reagent(type, metabolization_rate / M.metabolism_efficiency) //medicine reagents stay longer if you have a better metabolism /datum/reagent/medicine/leporazine name = "Leporazine" - id = "leporazine" description = "Leporazine will effectively regulate a patient's body temperature, ensuring it never leaves safe levels." pH = 8.4 color = "#82b8aa" @@ -31,7 +29,6 @@ /datum/reagent/medicine/adminordrazine //An OP chemical for admins name = "Adminordrazine" - id = "adminordrazine" description = "It's magic. We don't have to explain it." color = "#ffffff" can_synth = FALSE @@ -79,13 +76,11 @@ /datum/reagent/medicine/adminordrazine/quantum_heal name = "Quantum Medicine" - id = "quantum_heal" description = "Rare and experimental particles, that apparently swap the user's body with one from an alternate dimension where it's completely healthy." taste_description = "science" /datum/reagent/medicine/synaptizine name = "Synaptizine" - id = "synaptizine" description = "Increases resistance to stuns as well as reducing drowsiness and hallucinations." color = "#FF00FF" pH = 4 @@ -95,8 +90,8 @@ M.AdjustStun(-20, 0) M.AdjustKnockdown(-20, 0) M.AdjustUnconscious(-20, 0) - if(holder.has_reagent("mindbreaker")) - holder.remove_reagent("mindbreaker", 5) + if(holder.has_reagent(/datum/reagent/toxin/mindbreaker)) + holder.remove_reagent(/datum/reagent/toxin/mindbreaker, 5) M.hallucination = max(0, M.hallucination - 10) if(prob(30)) M.adjustToxLoss(1, 0) @@ -105,17 +100,16 @@ /datum/reagent/medicine/synaphydramine name = "Diphen-Synaptizine" - id = "synaphydramine" description = "Reduces drowsiness, hallucinations, and Histamine from body." color = "#EC536D" // rgb: 236, 83, 109 pH = 5.2 /datum/reagent/medicine/synaphydramine/on_mob_life(mob/living/carbon/M) M.drowsyness = max(M.drowsyness-5, 0) - if(holder.has_reagent("mindbreaker")) - holder.remove_reagent("mindbreaker", 5) - if(holder.has_reagent("histamine")) - holder.remove_reagent("histamine", 5) + if(holder.has_reagent(/datum/reagent/toxin/mindbreaker)) + holder.remove_reagent(/datum/reagent/toxin/mindbreaker, 5) + if(holder.has_reagent(/datum/reagent/toxin/histamine)) + holder.remove_reagent(/datum/reagent/toxin/histamine, 5) M.hallucination = max(0, M.hallucination - 10) if(prob(30)) M.adjustToxLoss(1, 0) @@ -124,7 +118,6 @@ /datum/reagent/medicine/inacusiate name = "Inacusiate" - id = "inacusiate" description = "Instantly restores all hearing to the patient, but does not cure deafness." color = "#6600FF" // rgb: 100, 165, 255 pH = 2 @@ -136,7 +129,6 @@ /datum/reagent/medicine/cryoxadone name = "Cryoxadone" - id = "cryoxadone" description = "A chemical mixture with almost magical healing powers. Its main limitation is that the patient's body temperature must be under 270K for it to metabolise correctly." color = "#0000C8" taste_description = "sludge" @@ -157,7 +149,6 @@ /datum/reagent/medicine/clonexadone name = "Clonexadone" - id = "clonexadone" description = "A chemical that derives from Cryoxadone. It specializes in healing clone damage, but nothing else. Requires very cold temperatures to properly metabolize, and metabolizes quicker than cryoxadone." color = "#0000C8" taste_description = "muscle" @@ -174,7 +165,6 @@ /datum/reagent/medicine/pyroxadone name = "Pyroxadone" - id = "pyroxadone" description = "A mixture of cryoxadone and slime jelly, that apparently inverses the requirement for its activation." color = "#f7832a" taste_description = "spicy jelly" @@ -204,7 +194,6 @@ /datum/reagent/medicine/rezadone name = "Rezadone" - id = "rezadone" description = "A powder derived from fish toxin, Rezadone can effectively treat genetic damage as well as restoring minor wounds. Overdose will cause intense nausea and minor toxin damage." reagent_state = SOLID color = "#669900" // rgb: 102, 153, 0 @@ -230,7 +219,6 @@ /datum/reagent/medicine/spaceacillin name = "Spaceacillin" - id = "spaceacillin" description = "Spaceacillin will prevent a patient from conventionally spreading any diseases they are currently infected with." color = "#f2f2f2" metabolization_rate = 0.1 * REAGENTS_METABOLISM @@ -239,7 +227,6 @@ //Goon Chems. Ported mainly from Goonstation. Easily mixable (or not so easily) and provide a variety of effects. /datum/reagent/medicine/silver_sulfadiazine name = "Silver Sulfadiazine" - id = "silver_sulfadiazine" description = "If used in touch-based applications, immediately restores burn wounds as well as restoring more over time. It is mildly poisonous taken orally or by injection. If overdosed, deals brute and minor liver damage." reagent_state = LIQUID pH = 7.2 @@ -278,7 +265,6 @@ /datum/reagent/medicine/oxandrolone name = "Oxandrolone" - id = "oxandrolone" description = "Stimulates the healing of severe burns. Extremely rapidly heals severe burns and slowly heals minor ones. Overdose will worsen existing burns." reagent_state = LIQUID color = "#f7ffa5" @@ -303,7 +289,6 @@ /datum/reagent/medicine/styptic_powder name = "Styptic Powder" - id = "styptic_powder" description = "If used in touch-based applications, immediately restores bruising as well as restoring more over time. It is poisonous if taken orally or by injection. If overdosed, deals brute and minor liver damage." reagent_state = LIQUID color = "#FF9696" @@ -343,7 +328,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/salglu_solution name = "Saline-Glucose Solution" - id = "salglu_solution" description = "Has a 33% chance per metabolism cycle to heal brute and burn damage. Can be used as a temporary blood substitute." reagent_state = LIQUID color = "#DCDCDC" @@ -375,12 +359,12 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/salglu_solution/overdose_process(mob/living/M) if(prob(3)) to_chat(M, "You feel salty.") - holder.add_reagent("sodiumchloride", 1) - holder.remove_reagent("salglu_solution", 0.5) + holder.add_reagent(/datum/reagent/consumable/sodiumchloride, 1) + holder.remove_reagent(/datum/reagent/medicine/salglu_solution, 0.5) else if(prob(3)) to_chat(M, "You feel sweet.") - holder.add_reagent("sugar", 1) - holder.remove_reagent("salglu_solution", 0.5) + holder.add_reagent(/datum/reagent/consumable/sugar, 1) + holder.remove_reagent(/datum/reagent/medicine/salglu_solution, 0.5) if(prob(33)) M.adjustBruteLoss(0.5*REM, 0) M.adjustFireLoss(0.5*REM, 0) @@ -389,7 +373,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/mine_salve name = "Miner's Salve" - id = "mine_salve" description = "A powerful painkiller. Restores bruising and burns in addition to making the patient believe they are fully healed." reagent_state = LIQUID color = "#6D6374" @@ -429,7 +412,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/synthflesh name = "Synthflesh" - id = "synthflesh" description = "Has a 100% chance of healing large amounts of brute and burn damage very quickly. One unit of the chemical will heal one point of damage. Touch application only." reagent_state = LIQUID color = "#FFEBEB" @@ -464,7 +446,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/charcoal name = "Charcoal" - id = "charcoal" description = "Heals toxin damage as well as slowly removing any other chemicals the patient has in their bloodstream." reagent_state = LIQUID color = "#000000" @@ -476,14 +457,14 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/charcoal/on_mob_life(mob/living/carbon/M) M.adjustToxLoss(-2*REM, 0) . = 1 - for(var/datum/reagent/R in M.reagents.reagent_list) + for(var/A in M.reagents.reagent_list) + var/datum/reagent/R = A if(R != src) - M.reagents.remove_reagent(R.id,1) + M.reagents.remove_reagent(R.type,1) ..() /datum/reagent/medicine/omnizine name = "Omnizine" - id = "omnizine" description = "Slowly heals all damage types. Overdose will cause damage in all types instead." reagent_state = LIQUID color = "#DCDCDC" @@ -510,7 +491,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/calomel name = "Calomel" - id = "calomel" description = "Quickly purges the body of all chemicals. Toxin damage is dealt if the patient is in good condition." reagent_state = LIQUID color = "#19C832" @@ -519,9 +499,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) pH = 1.5 /datum/reagent/medicine/calomel/on_mob_life(mob/living/carbon/M) - for(var/datum/reagent/R in M.reagents.reagent_list) + for(var/A in M.reagents.reagent_list) + var/datum/reagent/R = A if(R != src) - M.reagents.remove_reagent(R.id,2.5) + M.reagents.remove_reagent(R.type,2.5) if(M.health > 20) M.adjustToxLoss(2.5*REM, 0) . = 1 @@ -529,7 +510,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/potass_iodide name = "Potassium Iodide" - id = "potass_iodide" description = "Efficiently restores low radiation damage." reagent_state = LIQUID color = "#14FF3C" @@ -543,7 +523,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/prussian_blue name = "Prussian Blue" - id = "prussian_blue" description = "Efficiently restores heavy radiation damage." reagent_state = LIQUID color = "#003153" // RGB 0, 49, 83 @@ -557,7 +536,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/pen_acid name = "Pentetic Acid" - id = "pen_acid" description = "Reduces massive amounts of radiation and toxin damage while purging other chemicals from the body." reagent_state = LIQUID color = "#E6FFF0" @@ -568,15 +546,15 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/pen_acid/on_mob_life(mob/living/carbon/M) M.radiation -= max(M.radiation-RAD_MOB_SAFE, 0)/50 M.adjustToxLoss(-2*REM, 0, healtoxinlover) - for(var/datum/reagent/R in M.reagents.reagent_list) + for(var/A in M.reagents.reagent_list) + var/datum/reagent/R = A if(R != src) - M.reagents.remove_reagent(R.id,2) + M.reagents.remove_reagent(R.type,2) ..() . = 1 /datum/reagent/medicine/pen_acid/pen_jelly name = "Pentetic Jelly" - id = "pen_jelly" description = "Reduces massive amounts of radiation and toxin damage while purging other chemicals from the body. Slimepeople friendly!" color = "#91D865" healtoxinlover = TRUE @@ -584,7 +562,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/sal_acid name = "Salicyclic Acid" - id = "sal_acid" description = "Stimulates the healing of severe bruises. Extremely rapidly heals severe bruising and slowly heals minor ones. Overdose will worsen existing bruising." reagent_state = LIQUID color = "#D2D2D2" @@ -609,7 +586,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/salbutamol name = "Salbutamol" - id = "salbutamol" description = "Rapidly restores oxygen deprivation as well as preventing more of it to an extent." reagent_state = LIQUID color = "#00FFFF" @@ -625,7 +601,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/perfluorodecalin name = "Perfluorodecalin" - id = "perfluorodecalin" description = "Extremely rapidly restores oxygen deprivation, but inhibits speech. May also heal small amounts of bruising and burns." reagent_state = LIQUID color = "#FF6464" @@ -643,8 +618,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/ephedrine name = "Ephedrine" - id = "ephedrine" - description = "Increases stun resistance and movement speed. Overdose deals toxin damage and inhibits breathing." + description = "Increases stun resistance. Overdose deals toxin damage and inhibits breathing." reagent_state = LIQUID color = "#D2FFFA" metabolization_rate = 0.5 * REAGENTS_METABOLISM @@ -700,7 +674,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/diphenhydramine name = "Diphenhydramine" - id = "diphenhydramine" description = "Rapidly purges the body of Histamine and reduces jitteriness. Slight chance of causing drowsiness." reagent_state = LIQUID color = "#64FFE6" @@ -711,12 +684,11 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) if(prob(10)) M.drowsyness += 1 M.jitteriness -= 1 - M.reagents.remove_reagent("histamine",3) + M.reagents.remove_reagent(/datum/reagent/toxin/histamine,3) ..() /datum/reagent/medicine/morphine name = "Morphine" - id = "morphine" description = "A painkiller that allows the patient to move at full speed even in bulky objects. Causes drowsiness and eventually unconsciousness in high doses. Overdose will cause a variety of effects, ranging from minor to lethal." reagent_state = LIQUID color = "#A9FBFB" @@ -727,10 +699,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/morphine/on_mob_metabolize(mob/living/L) ..() - L.ignore_slowdown(id) + L.ignore_slowdown(type) /datum/reagent/medicine/morphine/on_mob_end_metabolize(mob/living/L) - L.unignore_slowdown(id) + L.unignore_slowdown(type) ..() /datum/reagent/medicine/morphine/on_mob_life(mob/living/carbon/M) @@ -786,7 +758,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/oculine name = "Oculine" - id = "oculine" description = "Quickly restores eye damage, cures nearsightedness, and has a chance to restore vision to the blind." reagent_state = LIQUID color = "#FFFFFF" @@ -818,7 +789,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/atropine name = "Atropine" - id = "atropine" description = "If a patient is in critical condition, rapidly heals all damage types as well as regulating oxygen in the body. Excellent for stabilizing wounded patients." reagent_state = LIQUID color = "#000000" @@ -848,7 +818,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/epinephrine name = "Epinephrine" - id = "epinephrine" description = "Minor boost to stun resistance. Slowly heals damage if a patient is in critical condition, as well as regulating oxygen loss. Overdose causes weakness and toxin damage." reagent_state = LIQUID color = "#D2FFFA" @@ -885,8 +854,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/strange_reagent name = "Strange Reagent" - id = "strange_reagent" - description = "A miracle drug capable of bringing the dead back to life. Only functions if the target has less than 100 brute and burn damage (independent of one another), and causes slight damage to the living." + description = "A miracle drug capable of bringing the dead back to life. Only functions when applied by patch or spray, if the target has less than 100 brute and burn damage (independent of one another) and hasn't been husked. Causes slight damage to the living." reagent_state = LIQUID color = "#A0E85E" metabolization_rate = 0.5 * REAGENTS_METABOLISM @@ -927,7 +895,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/mannitol name = "Mannitol" - id = "mannitol" description = "Efficiently restores brain damage." color = "#DCDCFF" pH = 10.4 @@ -940,20 +907,18 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/neurine name = "Neurine" - id = "neurine" description = "Reacts with neural tissue, helping reform damaged connections. Can cure minor traumas." color = "#EEFF8F" /datum/reagent/medicine/neurine/on_mob_life(mob/living/carbon/C) - if(holder.has_reagent("neurotoxin")) - holder.remove_reagent("neurotoxin", 5) + if(holder.has_reagent(/datum/reagent/consumable/ethanol/neurotoxin)) + holder.remove_reagent(/datum/reagent/consumable/ethanol/neurotoxin, 5) if(prob(15)) C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC) ..() /datum/reagent/medicine/mutadone name = "Mutadone" - id = "mutadone" description = "Removes jitteriness and restores genetic defects." color = "#5096C8" taste_description = "acid" @@ -968,7 +933,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/antihol name = "Antihol" - id = "antihol" description = "Purges alcoholic substance from the patient's body and eliminates its side effects." color = "#00B4C8" taste_description = "raw egg" @@ -989,7 +953,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/stimulants name = "Stimulants" - id = "stimulants" description = "Increases stun resistance and movement speed in addition to restoring minor damage and weakness. Overdose causes weakness and toxin damage." color = "#78008C" metabolization_rate = 0.5 * REAGENTS_METABOLISM @@ -998,10 +961,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/stimulants/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, type) /datum/reagent/medicine/stimulants/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, type) ..() /datum/reagent/medicine/stimulants/on_mob_life(mob/living/carbon/M) @@ -1027,7 +990,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/insulin name = "Insulin" - id = "insulin" description = "Increases sugar depletion rates." reagent_state = LIQUID color = "#FFFFF0" @@ -1037,13 +999,12 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/insulin/on_mob_life(mob/living/carbon/M) if(M.AdjustSleeping(-20, FALSE)) . = 1 - M.reagents.remove_reagent("sugar", 3) + M.reagents.remove_reagent(/datum/reagent/consumable/sugar, 3) ..() //Trek Chems, used primarily by medibots. Only heals a specific damage type, but is very efficient. /datum/reagent/medicine/bicaridine name = "Bicaridine" - id = "bicaridine" description = "Restores bruising. Overdose causes it instead." reagent_state = LIQUID color = "#fc2626" @@ -1062,7 +1023,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/dexalin name = "Dexalin" - id = "dexalin" description = "Restores oxygen loss. Overdose causes it instead." reagent_state = LIQUID color = "#13d2f0" @@ -1081,7 +1041,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/kelotane name = "Kelotane" - id = "kelotane" description = "Restores fire damage. Overdose causes it instead." reagent_state = LIQUID color = "#ffc400" @@ -1100,7 +1059,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/antitoxin name = "Anti-Toxin" - id = "antitoxin" description = "Heals toxin damage and removes toxins in the bloodstream. Overdose causes toxin damage." reagent_state = LIQUID color = "#6aff00" @@ -1111,7 +1069,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/antitoxin/on_mob_life(mob/living/carbon/M) M.adjustToxLoss(-2*REM, 0) for(var/datum/reagent/toxin/R in M.reagents.reagent_list) - M.reagents.remove_reagent(R.id,1) + M.reagents.remove_reagent(R.type,1) ..() . = 1 @@ -1122,7 +1080,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/inaprovaline name = "Inaprovaline" - id = "inaprovaline" description = "Stabilizes the breathing of patients. Good for those in critical condition." reagent_state = LIQUID pH = 8.5 @@ -1135,7 +1092,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/tricordrazine name = "Tricordrazine" - id = "tricordrazine" description = "Has a high chance to heal all types of damage. Overdose instead causes it." reagent_state = LIQUID color = "#e650c0" @@ -1161,7 +1117,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/regen_jelly name = "Regenerative Jelly" - id = "regen_jelly" description = "Gradually regenerates all types of damage, without harming slime anatomy." reagent_state = LIQUID color = "#91D865" @@ -1177,7 +1132,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/syndicate_nanites //Used exclusively by Syndicate medical cyborgs name = "Restorative Nanites" - id = "syndicate_nanites" description = "Miniature medical robots that swiftly restore bodily damage." reagent_state = SOLID color = "#555555" @@ -1196,7 +1150,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/neo_jelly name = "Neo Jelly" - id = "neo_jelly" description = "Gradually regenerates all types of damage, without harming slime anatomy.Can OD" reagent_state = LIQUID metabolization_rate = 1 * REAGENTS_METABOLISM @@ -1222,7 +1175,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/earthsblood //Created by ambrosia gaia plants name = "Earthsblood" - id = "earthsblood" description = "Ichor from an extremely powerful plant. Great for restoring wounds, but it's a little heavy on the brain." color = rgb(255, 175, 0) overdose_threshold = 25 @@ -1250,7 +1202,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/haloperidol name = "Haloperidol" - id = "haloperidol" description = "Increases depletion rates for most stimulating/hallucinogenic drugs. Reduces druggy effects and jitteriness. Severe stamina regeneration penalty, causes drowsiness. Small chance of brain damage." reagent_state = LIQUID color = "#27870a" @@ -1259,7 +1210,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/haloperidol/on_mob_life(mob/living/carbon/M) for(var/datum/reagent/drug/R in M.reagents.reagent_list) - M.reagents.remove_reagent(R.id,5) + M.reagents.remove_reagent(R.type,5) M.drowsyness += 2 if(M.jitteriness >= 3) M.jitteriness -= 3 @@ -1273,7 +1224,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/lavaland_extract name = "Lavaland Extract" - id = "lavaland_extract" description = "An extract of lavaland atmospheric and mineral elements. Heals the user in small doses, but is extremely toxic otherwise." color = "#a1a1a1" overdose_threshold = 3 //To prevent people stacking massive amounts of a very strong healing reagent @@ -1295,7 +1245,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) //used for changeling's adrenaline power /datum/reagent/medicine/changelingadrenaline name = "Changeling Adrenaline" - id = "changelingadrenaline" description = "Reduces the duration of unconciousness, knockdown and stuns. Restores stamina, but deals toxin damage when overdosed." color = "#918e53" overdose_threshold = 30 @@ -1316,17 +1265,16 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/changelinghaste name = "Changeling Haste" - id = "changelinghaste" description = "Drastically increases movement speed, but deals toxin damage." color = "#669153" metabolization_rate = 1 /datum/reagent/medicine/changelinghaste/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, type) /datum/reagent/medicine/changelinghaste/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOREALLYFAST, type) ..() /datum/reagent/medicine/changelinghaste/on_mob_life(mob/living/carbon/M) @@ -1338,7 +1286,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) // Heart attack code will not do damage if corazone is present // because it's SPACE MAGIC ASPIRIN name = "Corazone" - id = "corazone" description = "A medication used to treat pain, fever, and inflammation, along with heart attacks." color = "#F5F5F5" self_consuming = TRUE @@ -1346,28 +1293,26 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/corazone/on_mob_metabolize(mob/living/M) ..() - ADD_TRAIT(M, TRAIT_STABLEHEART, id) + ADD_TRAIT(M, TRAIT_STABLEHEART, type) /datum/reagent/medicine/corazone/on_mob_end_metabolize(mob/living/M) - REMOVE_TRAIT(M, TRAIT_STABLEHEART, id) + REMOVE_TRAIT(M, TRAIT_STABLEHEART, type) ..() /datum/reagent/medicine/muscle_stimulant name = "Muscle Stimulant" - id = "muscle_stimulant" description = "A potent chemical that allows someone under its influence to be at full physical ability even when under massive amounts of pain." /datum/reagent/medicine/muscle_stimulant/on_mob_metabolize(mob/living/M) . = ..() - M.ignore_slowdown(id) + M.ignore_slowdown(type) /datum/reagent/medicine/muscle_stimulant/on_mob_end_metabolize(mob/living/M) . = ..() - M.unignore_slowdown(id) + M.unignore_slowdown(type) /datum/reagent/medicine/modafinil name = "Modafinil" - id = "modafinil" description = "Long-lasting sleep suppressant that very slightly reduces stun and knockdown times. Overdosing has horrendous side effects and deals lethal oxygen damage, will knock you unconscious if not dealt with." reagent_state = LIQUID color = "#BEF7D8" // palish blue white @@ -1378,11 +1323,11 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) pH = 7.89 /datum/reagent/medicine/modafinil/on_mob_metabolize(mob/living/M) - ADD_TRAIT(M, TRAIT_SLEEPIMMUNE, id) + ADD_TRAIT(M, TRAIT_SLEEPIMMUNE, type) ..() /datum/reagent/medicine/modafinil/on_mob_end_metabolize(mob/living/M) - REMOVE_TRAIT(M, TRAIT_SLEEPIMMUNE, id) + REMOVE_TRAIT(M, TRAIT_SLEEPIMMUNE, type) ..() /datum/reagent/medicine/modafinil/on_mob_life(mob/living/carbon/M) @@ -1435,7 +1380,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/psicodine name = "Psicodine" - id = "psicodine" description = "Suppresses anxiety and other various forms of mental distress. Overdose causes hallucinations and minor toxin damage." reagent_state = LIQUID color = "#07E79E" @@ -1445,10 +1389,10 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/psicodine/on_mob_add(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_FEARLESS, id) + ADD_TRAIT(L, TRAIT_FEARLESS, type) /datum/reagent/medicine/psicodine/on_mob_delete(mob/living/L) - REMOVE_TRAIT(L, TRAIT_FEARLESS, id) + REMOVE_TRAIT(L, TRAIT_FEARLESS, type) ..() /datum/reagent/medicine/psicodine/on_mob_life(mob/living/carbon/M) @@ -1470,7 +1414,6 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/silibinin name = "Silibinin" - id = "silibinin" description = "A thistle derrived hepatoprotective flavolignan mixture that help reverse damage to the liver." reagent_state = SOLID color = "#FFFFD0" @@ -1483,8 +1426,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) /datum/reagent/medicine/polypyr //This is intended to be an ingredient in advanced chems. name = "Polypyrylium Oligomers" - id = "polypyr" - description = "A purple mixture of short polyelectrolyte chains not easily synthesized in the laboratory. It is valued as an intermediate in the synthesis of the cutting edge pharmaceuticals." + description = "A�purple mixture of short polyelectrolyte chains not easily synthesized in the laboratory. It is valued as an intermediate in the synthesis of the cutting edge pharmaceuticals." reagent_state = SOLID color = "#9423FF" metabolization_rate = 0.25 * REAGENTS_METABOLISM diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 45d897fb..58edb11e 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1,7 +1,6 @@ /datum/reagent/blood data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_HUMAN, "blood_type"= null,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null,"quirks"=null) name = "Blood" - id = "blood" value = 1 color = BLOOD_COLOR_HUMAN // rgb: 200, 0, 0 description = "Blood from some creature." @@ -30,7 +29,7 @@ if(iscarbon(L)) var/mob/living/carbon/C = L var/blood_id = C.get_blood_id() - if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == "blood" || blood_id == "jellyblood") && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) + if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood) && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM * C.blood_ratio) // we don't care about bloodtype here, we're just refilling the mob @@ -41,7 +40,7 @@ if((HAS_TRAIT(C, TRAIT_NOMARROW))) return //We dont want vampires getting toxed from blood var/blood_id = C.get_blood_id() - if((blood_id == "blood" || blood_id == "jellyblood")) + if((blood_id == /datum/reagent/blood || blood_id == /datum/reagent/blood/jellyblood)) if(!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))) //we only care about bloodtype here because this is where the poisoning should be C.adjustToxLoss(rand(2,8)*REM, TRUE, TRUE) //forced to ensure people don't use it to gain beneficial toxin as slime person ..() @@ -61,8 +60,8 @@ B = new(T) if(data["blood_DNA"]) B.blood_DNA[data["blood_DNA"]] = data["blood_type"] - if(B.reagents) - B.reagents.add_reagent(id, reac_volume) + if(!B.reagents) + B.reagents.add_reagent(type, reac_volume) B.update_icon() /datum/reagent/blood/on_new(list/data) @@ -132,14 +131,12 @@ /datum/reagent/blood/synthetics data = list("donor"=null,"viruses"=null,"blood_DNA"="REPLICATED", "bloodcolor" = BLOOD_COLOR_SYNTHETIC, "blood_type"="SY","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Synthetic Blood" - id = "syntheticblood" taste_description = "oily" color = BLOOD_COLOR_SYNTHETIC // rgb: 11, 7, 48 /datum/reagent/blood/lizard data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_LIZARD, "blood_type"="L","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Lizard Blood" - id = "lizardblood" taste_description = "spicy" color = BLOOD_COLOR_LIZARD // rgb: 11, 7, 48 pH = 6.85 @@ -147,7 +144,6 @@ /datum/reagent/blood/jellyblood data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_SLIME, "blood_type"="GEL","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Slime Jelly Blood" - id = "jellyblood" description = "A gooey semi-liquid produced from one of the deadliest lifeforms in existence. SO REAL." color = BLOOD_COLOR_SLIME taste_description = "slime" @@ -157,7 +153,6 @@ /datum/reagent/blood/xenomorph data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_XENO, "blood_type"="X*","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Xenomorph Blood" - id = "xenoblood" taste_description = "acidic heresy" color = BLOOD_COLOR_XENO // greenish yellow ooze shot_glass_icon_state = "shotglassgreen" @@ -166,7 +161,6 @@ /datum/reagent/blood/oil data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_OIL, "blood_type"="HF","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Hydraulic Blood" - id = "oilblood" taste_description = "burnt oil" color = BLOOD_COLOR_OIL // dark, y'know, expected batman colors. pH = 9.75 @@ -174,7 +168,6 @@ /datum/reagent/blood/insect data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_BUG, "blood_type"="BUG","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) name = "Insectoid Blood" - id = "bugblood" taste_description = "waxy" color = BLOOD_COLOR_BUG // Bug colored, I guess. pH = 7.25 @@ -193,7 +186,6 @@ /datum/reagent/liquidgibs name = "Liquid gibs" - id = "liquidgibs" color = BLOOD_COLOR_HUMAN description = "You don't even want to think about what's in here." taste_description = "gross iron" @@ -203,7 +195,6 @@ /datum/reagent/liquidgibs/xeno name = "Liquid xeno gibs" - id = "liquidxenogibs" color = BLOOD_COLOR_XENO taste_description = "blended heresy" shot_glass_icon_state = "shotglassgreen" @@ -212,7 +203,6 @@ /datum/reagent/liquidgibs/slime name = "Slime sludge" - id = "liquidslimegibs" color = BLOOD_COLOR_SLIME taste_description = "slime" shot_glass_icon_state = "shotglassgreen" @@ -221,14 +211,12 @@ /datum/reagent/liquidgibs/synth name = "Synthetic sludge" - id = "liquidsyntheticgibs" color = BLOOD_COLOR_SYNTHETIC taste_description = "jellied plastic" data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_SYNTHETIC, "blood_type"="SY","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) /datum/reagent/liquidgibs/oil name = "Hydraulic sludge" - id = "liquidoilgibs" color = BLOOD_COLOR_OIL taste_description = "chunky burnt oil" data = list("donor"=null,"viruses"=null,"blood_DNA"=null, "bloodcolor" = BLOOD_COLOR_OIL, "blood_type"="HF","resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"factions"=null) @@ -237,7 +225,6 @@ /datum/reagent/vaccine //data must contain virus type name = "Vaccine" - id = "vaccine" color = "#C81040" // rgb: 200, 16, 64 taste_description = "slime" @@ -255,7 +242,6 @@ /datum/reagent/water name = "Water" - id = "water" description = "An ubiquitous chemical substance that is composed of hydrogen and oxygen." color = "#AAAAAA77" // rgb: 170, 170, 170, 77 (alpha) taste_description = "water" @@ -327,7 +313,6 @@ /datum/reagent/water/holywater name = "Holy Water" - id = "holywater" description = "Water blessed by some deity." color = "#E0E8EF" // rgb: 224, 232, 239 glass_icon_state = "glass_clear" @@ -336,11 +321,11 @@ pH = 7.5 //God is alkaline /datum/reagent/water/holywater/on_mob_metabolize(mob/living/L) - ..() - ADD_TRAIT(L, TRAIT_HOLY, id) + . = ..() + ADD_TRAIT(L, TRAIT_HOLY, type) /datum/reagent/water/holywater/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_HOLY, id) + REMOVE_TRAIT(L, TRAIT_HOLY, type) ..() /datum/reagent/water/holywater/reaction_mob(mob/living/M, method=TOUCH, reac_volume) @@ -404,9 +389,9 @@ remove_servant_of_ratvar(M) M.jitteriness = 0 M.stuttering = 0 - holder.remove_reagent(id, volume) // maybe this is a little too perfect and a max() cap on the statuses would be better?? + holder.del_reagent(type) // maybe this is a little too perfect and a max() cap on the statuses would be better?? return - holder.remove_reagent(id, 0.4) //fixed consumption to prevent balancing going out of whack + holder.remove_reagent(type, 0.4) //fixed consumption to prevent balancing going out of whack /datum/reagent/water/holywater/reaction_turf(turf/T, reac_volume) ..() @@ -419,14 +404,13 @@ /datum/reagent/fuel/unholywater //if you somehow managed to extract this from someone, dont splash it on yourself and have a smoke name = "Unholy Water" - id = "unholywater" description = "Something that shouldn't exist on this plane of existence." taste_description = "suffering" pH = 6.5 /datum/reagent/fuel/unholywater/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(method == TOUCH || method == VAPOR) - M.reagents.add_reagent(id,reac_volume/4) + M.reagents.add_reagent(type, reac_volume/4) return return ..() @@ -449,12 +433,11 @@ M.adjustFireLoss(2, 0) M.adjustOxyLoss(2, 0) M.adjustBruteLoss(2, 0) - holder.remove_reagent(id, 1) + holder.remove_reagent(type, 1) return TRUE /datum/reagent/hellwater //if someone has this in their system they've really pissed off an eldritch god name = "Hell Water" - id = "hell_water" description = "YOUR FLESH! IT BURNS!" taste_description = "burning" @@ -465,19 +448,18 @@ M.adjustBruteLoss(-0.75*REM, 0) M.adjustFireLoss(-0.75*REM, 0) M.ExtinguishMob() - holder.remove_reagent(id, 1) + holder.remove_reagent(type, 1) else M.fire_stacks = min(5,M.fire_stacks + 3) M.IgniteMob() //Only problem with igniting people is currently the commonly availible fire suits make you immune to being on fire M.adjustToxLoss(1, 0) M.adjustFireLoss(1, 0) //Hence the other damages... ain't I a bastard? M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 150) - holder.remove_reagent(id, 1) + holder.remove_reagent(type, 1) pH = 0.1 /datum/reagent/fuel/holyoil //Its oil name = "Zelus Oil" - id = "holyoil" description = "Oil blessed by a greater being." taste_description = "metallic oil" @@ -501,7 +483,7 @@ M.adjustToxLoss(3, 0) M.adjustOxyLoss(2, 0) M.adjustStaminaLoss(10, 0) - holder.remove_reagent(id, 1) + holder.remove_reagent(type, 1) return TRUE //We only get 30u to start with... @@ -516,13 +498,11 @@ /datum/reagent/medicine/omnizine/godblood name = "Godblood" - id = "godblood" description = "Slowly heals all damage types. Has a rather high overdose threshold. Glows with mysterious power." overdose_threshold = 150 /datum/reagent/lube name = "Space Lube" - id = "lube" description = "Lubricant is a substance introduced between two moving surfaces to reduce the friction and wear between them. giggity." color = "#009CA8" // rgb: 0, 156, 168 taste_description = "cherry" // by popular demand @@ -535,7 +515,6 @@ /datum/reagent/spraytan name = "Spray Tan" - id = "spraytan" description = "A substance applied to the skin to darken the skin." color = "#FFC080" // rgb: 255, 196, 128 Bright orange metabolization_rate = 10 * REAGENTS_METABOLISM // very fast, so it can be applied rapidly. But this changes on an overdose @@ -632,7 +611,6 @@ /datum/reagent/mutationtoxin name = "Stable Mutation Toxin" - id = "stablemutationtoxin" description = "A humanizing toxin." color = "#5EFF3B" //RGB: 94, 255, 59 metabolization_rate = INFINITY //So it instantly removes all of itself @@ -663,7 +641,6 @@ /datum/reagent/mutationtoxin/classic //The one from plasma on green slimes name = "Mutation Toxin" - id = "mutationtoxin" description = "A corruptive toxin." color = "#13BC5E" // rgb: 19, 188, 94 race = /datum/species/jelly/slime @@ -671,14 +648,12 @@ /datum/reagent/mutationtoxin/felinid name = "Felinid Mutation Toxin" - id = "felinidmutationtoxin" color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/human/felinid mutationtext = "The pain subsides. You feel... like a degenerate." /datum/reagent/mutationtoxin/lizard name = "Lizard Mutation Toxin" - id = "lizardmutationtoxin" description = "A lizarding toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/lizard @@ -686,15 +661,13 @@ /datum/reagent/mutationtoxin/fly name = "Fly Mutation Toxin" - id = "flymutationtoxin" description = "An insectifying toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/fly mutationtext = "The pain subsides. You feel... buzzy." -/datum/reagent/mutationtoxin/moth - name = "Moth Mutation Toxin" - id = "mothmutationtoxin" +/datum/reagent/mutationtoxin/insect + name = "Insect Mutation Toxin" description = "A glowing toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/moth @@ -702,7 +675,6 @@ /datum/reagent/mutationtoxin/pod name = "Podperson Mutation Toxin" - id = "podmutationtoxin" description = "A vegetalizing toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/pod @@ -710,7 +682,6 @@ /datum/reagent/mutationtoxin/jelly name = "Imperfect Mutation Toxin" - id = "jellymutationtoxin" description = "An jellyfying toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/jelly @@ -718,7 +689,6 @@ /datum/reagent/mutationtoxin/golem name = "Golem Mutation Toxin" - id = "golemmutationtoxin" description = "A crystal toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/golem/random @@ -726,7 +696,6 @@ /datum/reagent/mutationtoxin/abductor name = "Abductor Mutation Toxin" - id = "abductormutationtoxin" description = "An alien toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/abductor @@ -734,7 +703,6 @@ /datum/reagent/mutationtoxin/android name = "Android Mutation Toxin" - id = "androidmutationtoxin" description = "A robotic toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/android @@ -743,7 +711,6 @@ //Citadel Races /datum/reagent/mutationtoxin/mammal name = "Mammal Mutation Toxin" - id = "mammalmutationtoxin" description = "A glowing toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/mammal @@ -751,7 +718,6 @@ /datum/reagent/mutationtoxin/insect name = "Insect Mutation Toxin" - id = "insectmutationtoxin" description = "A glowing toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/insect @@ -759,7 +725,6 @@ /datum/reagent/mutationtoxin/xenoperson name = "Xeno-Hybrid Mutation Toxin" - id = "xenopersonmutationtoxin" description = "A glowing toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/xeno @@ -768,7 +733,6 @@ //BLACKLISTED RACES /datum/reagent/mutationtoxin/skeleton name = "Skeleton Mutation Toxin" - id = "skeletonmutationtoxin" description = "A scary toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/skeleton @@ -776,7 +740,6 @@ /datum/reagent/mutationtoxin/zombie name = "Zombie Mutation Toxin" - id = "zombiemutationtoxin" description = "An undead toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/zombie //Not the infectious kind. The days of xenobio zombie outbreaks are long past. @@ -784,7 +747,6 @@ /datum/reagent/mutationtoxin/ash name = "Ash Mutation Toxin" - id = "ashmutationtoxin" description = "An ashen toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/lizard/ashwalker @@ -794,7 +756,6 @@ //DANGEROUS RACES /datum/reagent/mutationtoxin/shadow name = "Shadow Mutation Toxin" - id = "shadowmutationtoxin" description = "A dark toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/shadow @@ -802,7 +763,6 @@ /datum/reagent/mutationtoxin/plasma name = "Plasma Mutation Toxin" - id = "plasmamutationtoxin" description = "A plasma-based toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/plasmaman @@ -810,7 +770,6 @@ /datum/reagent/slime_toxin name = "Slime Mutation Toxin" - id = "slime_toxin" description = "A toxin that turns organic material into slime." color = "#5EFF3B" //RGB: 94, 255, 59 taste_description = "slime" @@ -827,7 +786,7 @@ to_chat(H, "Your jelly shifts and morphs, turning you into another subspecies!") var/species_type = pick(subtypesof(/datum/species/jelly)) H.set_species(species_type) - H.reagents.del_reagent(id) + H.reagents.del_reagent(type) switch(current_cycle) if(1 to 6) @@ -842,12 +801,11 @@ if(20 to INFINITY) var/species_type = pick(subtypesof(/datum/species/jelly)) H.set_species(species_type) - H.reagents.del_reagent(id) + H.reagents.del_reagent(type) to_chat(H, "You've become \a jellyperson!") /datum/reagent/mulligan name = "Mulligan Toxin" - id = "mulligan" description = "This toxin will rapidly change the DNA of human beings. Commonly used by Syndicate spies and assassins in need of an emergency ID change." color = "#5EFF3B" //RGB: 94, 255, 59 metabolization_rate = INFINITY @@ -863,7 +821,6 @@ /datum/reagent/aslimetoxin name = "Advanced Mutation Toxin" - id = "amutationtoxin" description = "An advanced corruptive toxin produced by slimes." color = "#13BC5E" // rgb: 19, 188, 94 taste_description = "slime" @@ -874,7 +831,6 @@ /datum/reagent/gluttonytoxin name = "Gluttony's Blessing" - id = "gluttonytoxin" description = "An advanced corruptive toxin produced by something terrible." color = "#5EFF3B" //RGB: 94, 255, 59 can_synth = FALSE @@ -885,7 +841,6 @@ /datum/reagent/serotrotium name = "Serotrotium" - id = "serotrotium" description = "A chemical compound that promotes concentrated production of the serotonin neurotransmitter in humans." color = "#202040" // rgb: 20, 20, 40 metabolization_rate = 0.25 * REAGENTS_METABOLISM @@ -900,7 +855,6 @@ /datum/reagent/oxygen name = "Oxygen" - id = "oxygen" description = "A colorless, odorless gas. Grows on trees but is still pretty valuable." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 @@ -921,7 +875,6 @@ /datum/reagent/copper name = "Copper" - id = "copper" description = "A highly ductile metal. Things made out of copper aren't very durable, but it makes a decent material for electrical wiring." reagent_state = SOLID color = "#6E3B08" // rgb: 110, 59, 8 @@ -937,7 +890,6 @@ /datum/reagent/nitrogen name = "Nitrogen" - id = "nitrogen" description = "A colorless, odorless, tasteless gas. A simple asphyxiant that can silently displace vital oxygen." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 @@ -958,7 +910,6 @@ /datum/reagent/hydrogen name = "Hydrogen" - id = "hydrogen" description = "A colorless, odorless, nonmetallic, tasteless, highly combustible diatomic gas." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 @@ -967,7 +918,6 @@ /datum/reagent/potassium name = "Potassium" - id = "potassium" description = "A soft, low-melting solid that can easily be cut with a knife. Reacts violently with water." reagent_state = SOLID color = "#A0A0A0" // rgb: 160, 160, 160 @@ -975,7 +925,6 @@ /datum/reagent/mercury name = "Mercury" - id = "mercury" description = "A curious metal that's a liquid at room temperature. Neurodegenerative and very bad for the mind." color = "#484848" // rgb: 72, 72, 72A taste_mult = 0 // apparently tasteless. @@ -990,7 +939,6 @@ /datum/reagent/sulfur name = "Sulfur" - id = "sulfur" description = "A sickly yellow solid mostly known for its nasty smell. It's actually much more helpful than it looks in biochemisty." reagent_state = SOLID color = "#BF8C00" // rgb: 191, 140, 0 @@ -999,7 +947,6 @@ /datum/reagent/carbon name = "Carbon" - id = "carbon" description = "A crumbly black solid that, while unexciting on an physical level, forms the base of all known life. Kind of a big deal." reagent_state = SOLID color = "#1C1300" // rgb: 30, 20, 0 @@ -1014,7 +961,6 @@ /datum/reagent/chlorine name = "Chlorine" - id = "chlorine" description = "A pale yellow gas that's well known as an oxidizer. While it forms many harmless molecules in its elemental form it is far from harmless." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 @@ -1028,7 +974,6 @@ /datum/reagent/fluorine name = "Fluorine" - id = "fluorine" description = "A comically-reactive chemical element. The universe does not want this stuff to exist in this form in the slightest." reagent_state = GAS color = "#808080" // rgb: 128, 128, 128 @@ -1042,7 +987,6 @@ /datum/reagent/sodium name = "Sodium" - id = "sodium" description = "A soft silver metal that can easily be cut with a knife. It's not salt just yet, so refrain from putting in on your chips." reagent_state = SOLID color = "#808080" // rgb: 128, 128, 128 @@ -1051,7 +995,6 @@ /datum/reagent/phosphorus name = "Phosphorus" - id = "phosphorus" description = "A ruddy red powder that burns readily. Though it comes in many colors, the general theme is always the same." reagent_state = SOLID color = "#832828" // rgb: 131, 40, 40 @@ -1060,7 +1003,6 @@ /datum/reagent/lithium name = "Lithium" - id = "lithium" description = "A silver metal, its claim to fame is its remarkably low density. Using it is a bit too effective in calming oneself down." reagent_state = SOLID color = "#808080" // rgb: 128, 128, 128 @@ -1076,7 +1018,6 @@ /datum/reagent/glycerol name = "Glycerol" - id = "glycerol" description = "Glycerol is a simple polyol compound. Glycerol is sweet-tasting and of low toxicity." color = "#808080" // rgb: 128, 128, 128 taste_description = "sweetness" @@ -1084,7 +1025,6 @@ /datum/reagent/radium name = "Radium" - id = "radium" description = "Radium is an alkaline earth metal. It is extremely radioactive." reagent_state = SOLID color = "#C7C7C7" // rgb: 199,199,199 @@ -1101,11 +1041,10 @@ var/obj/effect/decal/cleanable/greenglow/radioactive/GG = locate() in T.contents if(!GG) GG = new/obj/effect/decal/cleanable/greenglow/radioactive(T) - GG.reagents.add_reagent("radium", reac_volume) + GG.reagents.add_reagent(/datum/reagent/radium, reac_volume) /datum/reagent/space_cleaner/sterilizine name = "Sterilizine" - id = "sterilizine" description = "Sterilizes wounds in preparation for surgery." color = "#e6f1f5" // rgb: 200, 165, 220 taste_description = "bitterness" @@ -1121,7 +1060,6 @@ /datum/reagent/iron name = "Iron" - id = "iron" description = "Pure iron is a metal." reagent_state = SOLID taste_description = "iron" @@ -1139,12 +1077,12 @@ /datum/reagent/iron/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(M.has_bane(BANE_IRON)) //If the target is weak to cold iron, then poison them. if(holder && holder.chem_temp < 100) // COLD iron. - M.reagents.add_reagent("toxin", reac_volume) + M.reagents.add_reagent(/datum/reagent/toxin, reac_volume) ..() /datum/reagent/iron/overdose_start(mob/living/M) to_chat(M, "You start feeling your guts twisting painfully!") - SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/overdose, name) + SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/overdose, name) /datum/reagent/iron/overdose_process(mob/living/carbon/C) if(prob(20)) @@ -1155,7 +1093,6 @@ /datum/reagent/gold name = "Gold" - id = "gold" description = "Gold is a dense, soft, shiny metal and the most malleable and ductile metal known." reagent_state = SOLID color = "#F7C430" // rgb: 247, 196, 48 @@ -1163,7 +1100,6 @@ /datum/reagent/silver name = "Silver" - id = "silver" description = "A soft, white, lustrous transition metal, it has the highest electrical conductivity of any element and the highest thermal conductivity of any metal." reagent_state = SOLID color = "#D0D0D0" // rgb: 208, 208, 208 @@ -1171,12 +1107,11 @@ /datum/reagent/silver/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(M.has_bane(BANE_SILVER)) - M.reagents.add_reagent("toxin", reac_volume) + M.reagents.add_reagent(/datum/reagent/toxin, reac_volume) ..() /datum/reagent/uranium name ="Uranium" - id = "uranium" description = "A silvery-white metallic chemical element in the actinide series, weakly radioactive." reagent_state = SOLID color = "#B8B8C0" // rgb: 184, 184, 192 @@ -1193,11 +1128,10 @@ var/obj/effect/decal/cleanable/greenglow/radioactive/GG = locate() in T.contents if(!GG) GG = new/obj/effect/decal/cleanable/greenglow/radioactive(T) - GG.reagents.add_reagent("uranium", reac_volume) + GG.reagents.add_reagent(/datum/reagent/uranium, reac_volume) /datum/reagent/bluespace name = "Bluespace Dust" - id = "bluespace" description = "A dust composed of microscopic bluespace crystals, with minor space-warping properties." reagent_state = SOLID color = "#0000CC" @@ -1222,7 +1156,6 @@ /datum/reagent/aluminium name = "Aluminium" - id = "aluminium" description = "A silvery white and ductile member of the boron group of chemical elements." reagent_state = SOLID color = "#A8A8A8" // rgb: 168, 168, 168 @@ -1230,7 +1163,6 @@ /datum/reagent/silicon name = "Silicon" - id = "silicon" description = "A tetravalent metalloid, silicon is less reactive than its chemical analog carbon." reagent_state = SOLID color = "#A8A8A8" // rgb: 168, 168, 168 @@ -1239,7 +1171,6 @@ /datum/reagent/fuel name = "Welding fuel" - id = "welding_fuel" description = "Required for welders. Flamable." color = "#660000" // rgb: 102, 0, 0 taste_description = "gross metal" @@ -1262,7 +1193,6 @@ /datum/reagent/space_cleaner name = "Space cleaner" - id = "cleaner" description = "A compound used to clean things. Now with 50% more sodium hypochlorite!" color = "#A5F0EE" // rgb: 165, 240, 238 taste_description = "sourness" @@ -1329,7 +1259,6 @@ /datum/reagent/space_cleaner/ez_clean name = "EZ Clean" - id = "ez_clean" description = "A powerful, acidic cleaner sold by Waffle Co. Affects organic matter while leaving other objects unaffected." metabolization_rate = 1.5 * REAGENTS_METABOLISM taste_description = "acid" @@ -1349,7 +1278,6 @@ /datum/reagent/cryptobiolin name = "Cryptobiolin" - id = "cryptobiolin" description = "Cryptobiolin causes confusion and dizziness." color = "#7529b3" // rgb: 200, 165, 220 metabolization_rate = 1.5 * REAGENTS_METABOLISM @@ -1365,7 +1293,6 @@ /datum/reagent/impedrezene name = "Impedrezene" - id = "impedrezene" description = "Impedrezene is a narcotic that impedes one's ability by slowing down the higher brain cell functions." color = "#587a31" // rgb: 200, 165, 220A taste_description = "numbness" @@ -1383,7 +1310,6 @@ /datum/reagent/nanomachines name = "Nanomachines" - id = "nanomachines" description = "Microscopic construction robots." color = "#535E66" // rgb: 83, 94, 102 can_synth = FALSE @@ -1395,7 +1321,6 @@ /datum/reagent/xenomicrobes name = "Xenomicrobes" - id = "xenomicrobes" description = "Microbes with an entirely alien cellular structure." color = "#535E66" // rgb: 83, 94, 102 can_synth = FALSE @@ -1407,7 +1332,6 @@ /datum/reagent/fungalspores name = "Tubercle bacillus Cosmosis microbes" - id = "fungalspores" description = "Active fungal spores." color = "#92D17D" // rgb: 146, 209, 125 can_synth = FALSE @@ -1420,7 +1344,6 @@ /datum/reagent/fluorosurfactant//foam precursor name = "Fluorosurfactant" - id = "fluorosurfactant" description = "A perfluoronated sulfonic acid that forms a foam when mixed with water." color = "#9E6B38" // rgb: 158, 107, 56 taste_description = "metal" @@ -1428,7 +1351,6 @@ /datum/reagent/foaming_agent// Metal foaming agent. This is lithium hydride. Add other recipes (e.g. LiH + H2O -> LiOH + H2) eventually. name = "Foaming agent" - id = "foaming_agent" description = "An agent that yields metallic foam when mixed with light metal and a strong acid." reagent_state = SOLID color = "#664B63" // rgb: 102, 75, 99 @@ -1437,7 +1359,6 @@ /datum/reagent/smart_foaming_agent //Smart foaming agent. Functions similarly to metal foam, but conforms to walls. name = "Smart foaming agent" - id = "smart_foaming_agent" description = "An agent that yields metallic foam which conforms to area boundaries when mixed with light metal and a strong acid." reagent_state = SOLID color = "#664B63" // rgb: 102, 75, 99 @@ -1446,7 +1367,6 @@ /datum/reagent/ammonia name = "Ammonia" - id = "ammonia" description = "A caustic substance commonly used in fertilizer or household cleaners." reagent_state = GAS color = "#404030" // rgb: 64, 64, 48 @@ -1455,7 +1375,6 @@ /datum/reagent/diethylamine name = "Diethylamine" - id = "diethylamine" description = "A secondary amine, mildly corrosive." color = "#604030" // rgb: 96, 64, 48 taste_description = "iron" @@ -1463,7 +1382,6 @@ /datum/reagent/carbondioxide name = "Carbon Dioxide" - id = "co2" reagent_state = GAS description = "A gas commonly produced by burning carbon fuels. You're constantly producing this in your lungs." color = "#B0B0B0" // rgb : 192, 192, 192 @@ -1484,7 +1402,6 @@ /datum/reagent/nitrous_oxide name = "Nitrous Oxide" - id = "nitrous_oxide" description = "A potent oxidizer used as fuel in rockets and as an anaesthetic during surgery." reagent_state = LIQUID metabolization_rate = 1.5 * REAGENTS_METABOLISM @@ -1519,7 +1436,6 @@ /datum/reagent/stimulum name = "Stimulum" - id = "stimulum" description = "An unstable experimental gas that greatly increases the energy of those that inhale it" reagent_state = GAS metabolization_rate = 1.5 * REAGENTS_METABOLISM @@ -1528,25 +1444,24 @@ /datum/reagent/stimulum/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_STUNIMMUNE, id) - ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, id) - ADD_TRAIT(L, TRAIT_NOSLIPALL, id) + ADD_TRAIT(L, TRAIT_STUNIMMUNE, type) + ADD_TRAIT(L, TRAIT_SLEEPIMMUNE, type) + ADD_TRAIT(L, TRAIT_NOSLIPALL, type) /datum/reagent/stimulum/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, id) - REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, id) - REMOVE_TRAIT(L, TRAIT_NOSLIPALL, id) + REMOVE_TRAIT(L, TRAIT_STUNIMMUNE, type) + REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, type) + REMOVE_TRAIT(L, TRAIT_NOSLIPALL, type) ..() /datum/reagent/stimulum/on_mob_life(mob/living/carbon/M) M.adjustStaminaLoss(-2*REM, 0) current_cycle++ - holder.remove_reagent(id, 0.99) //Gives time for the next tick of life(). + holder.remove_reagent(type, 0.99) //Gives time for the next tick of life(). . = TRUE //Update status effects. /datum/reagent/nitryl name = "Nitryl" - id = "no2" description = "A highly reactive gas that makes you feel faster" reagent_state = GAS metabolization_rate = REAGENTS_METABOLISM @@ -1556,15 +1471,15 @@ /datum/reagent/nitryl/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_GOTTAGOFAST, id) + ADD_TRAIT(L, TRAIT_GOTTAGOFAST, type) /datum/reagent/nitryl/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, id) + REMOVE_TRAIT(L, TRAIT_GOTTAGOFAST, type) ..() /datum/reagent/nitryl/on_mob_life(mob/living/carbon/M) current_cycle++ - holder.remove_reagent(id, 0.99) //Gives time for the next tick of life(). + holder.remove_reagent(type, 0.99) //Gives time for the next tick of life(). . = TRUE //Update status effects. /////////////////////////Coloured Crayon Powder//////////////////////////// @@ -1573,7 +1488,6 @@ /datum/reagent/colorful_reagent/crayonpowder name = "Crayon Powder" - id = "crayon powder" var/colorname = "none" description = "A powder made by grinding down crayons, good for colouring chemical reagents." reagent_state = SOLID @@ -1587,7 +1501,6 @@ /datum/reagent/colorful_reagent/crayonpowder/red name = "Red Crayon Powder" - id = "redcrayonpowder" colorname = "red" color = "#DA0000" // red random_color_list = list("#DA0000") @@ -1595,7 +1508,6 @@ /datum/reagent/colorful_reagent/crayonpowder/orange name = "Orange Crayon Powder" - id = "orangecrayonpowder" colorname = "orange" color = "#FF9300" // orange random_color_list = list("#FF9300") @@ -1603,7 +1515,6 @@ /datum/reagent/colorful_reagent/crayonpowder/yellow name = "Yellow Crayon Powder" - id = "yellowcrayonpowder" colorname = "yellow" color = "#FFF200" // yellow random_color_list = list("#FFF200") @@ -1611,7 +1522,6 @@ /datum/reagent/colorful_reagent/crayonpowder/green name = "Green Crayon Powder" - id = "greencrayonpowder" colorname = "green" color = "#A8E61D" // green random_color_list = list("#A8E61D") @@ -1619,7 +1529,6 @@ /datum/reagent/colorful_reagent/crayonpowder/blue name = "Blue Crayon Powder" - id = "bluecrayonpowder" colorname = "blue" color = "#00B7EF" // blue random_color_list = list("#00B7EF") @@ -1627,7 +1536,6 @@ /datum/reagent/colorful_reagent/crayonpowder/purple name = "Purple Crayon Powder" - id = "purplecrayonpowder" colorname = "purple" color = "#DA00FF" // purple random_color_list = list("#DA00FF") @@ -1635,21 +1543,18 @@ /datum/reagent/colorful_reagent/crayonpowder/invisible name = "Invisible Crayon Powder" - id = "invisiblecrayonpowder" colorname = "invisible" color = "#FFFFFF00" // white + no alpha random_color_list = list(null) //because using the powder color turns things invisible /datum/reagent/colorful_reagent/crayonpowder/black name = "Black Crayon Powder" - id = "blackcrayonpowder" colorname = "black" color = "#1C1C1C" // not quite black random_color_list = list("#404040") /datum/reagent/colorful_reagent/crayonpowder/white name = "White Crayon Powder" - id = "whitecrayonpowder" colorname = "white" color = "#FFFFFF" // white random_color_list = list("#FFFFFF") //doesn't actually change appearance at all @@ -1661,7 +1566,6 @@ /datum/reagent/plantnutriment name = "Generic nutriment" - id = "plantnutriment" description = "Some kind of nutriment. You can't really tell what it is. You should probably report it, along with how you obtained it." color = "#000000" // RBG: 0, 0, 0 var/tox_prob = 0 @@ -1676,7 +1580,6 @@ /datum/reagent/plantnutriment/eznutriment name = "E-Z-Nutrient" - id = "eznutriment" description = "Cheap and extremely common type of plant nutriment." color = "#376400" // RBG: 50, 100, 0 tox_prob = 10 @@ -1684,7 +1587,6 @@ /datum/reagent/plantnutriment/left4zednutriment name = "Left 4 Zed" - id = "left4zednutriment" description = "Unstable nutriment that makes plants mutate more often than usual." color = "#1A1E4D" // RBG: 26, 30, 77 tox_prob = 25 @@ -1692,7 +1594,6 @@ /datum/reagent/plantnutriment/robustharvestnutriment name = "Robust Harvest" - id = "robustharvestnutriment" description = "Very potent nutriment that prevents plants from mutating." color = "#9D9D00" // RBG: 157, 157, 0 tox_prob = 15 @@ -1710,7 +1611,6 @@ /datum/reagent/oil name = "Oil" - id = "oil" description = "Burns in a small smoky fire, mostly used to get Ash." reagent_state = LIQUID color = "#292929" @@ -1718,7 +1618,6 @@ /datum/reagent/stable_plasma name = "Stable Plasma" - id = "stable_plasma" description = "Non-flammable plasma locked into a liquid form that cannot ignite or become gaseous/solid." reagent_state = LIQUID color = "#6b008f" @@ -1732,7 +1631,6 @@ /datum/reagent/iodine name = "Iodine" - id = "iodine" description = "Commonly added to table salt as a nutrient. On its own it tastes far less pleasing." reagent_state = LIQUID color = "#694600" @@ -1741,7 +1639,6 @@ /datum/reagent/bromine name = "Bromine" - id = "bromine" description = "A brownish liquid that's highly reactive. Useful for stopping free radicals, but not intended for human consumption." reagent_state = LIQUID color = "#b37740" @@ -1750,7 +1647,6 @@ /datum/reagent/phenol name = "Phenol" - id = "phenol" description = "An aromatic ring of carbon with a hydroxyl group. A useful precursor to some medicines, but has no healing properties on its own." reagent_state = LIQUID taste_description = "sweet and tarry" //Again, not a strong acid. @@ -1759,7 +1655,6 @@ /datum/reagent/ash name = "Ash" - id = "ash" description = "Supposedly phoenixes rise from these, but you've never seen it." reagent_state = LIQUID color = "#665c56" @@ -1768,7 +1663,6 @@ /datum/reagent/acetone name = "Acetone" - id = "acetone" description = "A slick, slightly carcinogenic liquid. Has a multitude of mundane uses in everyday life." reagent_state = LIQUID taste_description = "solvent"//It's neutral though..? @@ -1776,7 +1670,6 @@ /datum/reagent/colorful_reagent name = "Colorful Reagent" - id = "colorful_reagent" description = "Thoroughly sample the rainbow." reagent_state = LIQUID color = "#FFFF00" @@ -1806,7 +1699,6 @@ /datum/reagent/hair_dye name = "Quantum Hair Dye" - id = "hair_dye" description = "Has a high chance of making you look like a mad scientist." reagent_state = LIQUID color = "#ff00dd" @@ -1823,7 +1715,6 @@ /datum/reagent/barbers_aid name = "Barber's Aid" - id = "barbers_aid" description = "A solution to hair loss across the world." reagent_state = LIQUID color = "#fac34b" @@ -1841,7 +1732,6 @@ /datum/reagent/concentrated_barbers_aid name = "Concentrated Barber's Aid" - id = "concentrated_barbers_aid" description = "A concentrated solution to hair loss across the world." reagent_state = LIQUID color = "#ffaf00" @@ -1857,7 +1747,6 @@ /datum/reagent/saltpetre name = "Saltpetre" - id = "saltpetre" description = "Volatile. Controversial. Third Thing." reagent_state = LIQUID color = "#60A584" // rgb: 96, 165, 132 @@ -1866,7 +1755,6 @@ /datum/reagent/lye name = "Lye" - id = "lye" description = "Also known as sodium hydroxide. As a profession making this is somewhat underwhelming." reagent_state = LIQUID color = "#FFFFD6" // very very light yellow @@ -1875,7 +1763,6 @@ /datum/reagent/drying_agent name = "Drying agent" - id = "drying_agent" description = "A desiccant. Can be used to dry things." reagent_state = LIQUID color = "#A70FFF" @@ -1895,7 +1782,6 @@ // Liquid Carpets /datum/reagent/carpet name = "Liquid Carpet" - id = "carpet" description = "For those that need a more creative way to roll out a carpet." reagent_state = LIQUID color = "#b51d05" @@ -1909,7 +1795,6 @@ /datum/reagent/carpet/black name = "Liquid Black Carpet" - id = "blackcarpet" color = "#363636" /datum/reagent/carpet/black/reaction_turf(turf/T, reac_volume) @@ -1920,7 +1805,6 @@ /datum/reagent/carpet/blackred name = "Liquid Red Black Carpet" - id = "blackredcarpet" color = "#342125" /datum/reagent/carpet/blackred/reaction_turf(turf/T, reac_volume) @@ -1931,7 +1815,6 @@ /datum/reagent/carpet/monochrome name = "Liquid Monochrome Carpet" - id = "monochromecarpet" color = "#b4b4b4" /datum/reagent/carpet/monochrome/reaction_turf(turf/T, reac_volume) @@ -1942,7 +1825,6 @@ /datum/reagent/carpet/blue name = "Liquid Blue Carpet" - id = "bluecarpet" color = "#1256ff" /datum/reagent/carpet/blue/reaction_turf(turf/T, reac_volume) @@ -1953,7 +1835,6 @@ /datum/reagent/carpet/cyan name = "Liquid Cyan Carpet" - id = "cyancarpet" color = "#3acfb9" /datum/reagent/carpet/cyan/reaction_turf(turf/T, reac_volume) @@ -1964,7 +1845,6 @@ /datum/reagent/carpet/green name = "Liquid Green Carpet" - id = "greencarpet" color = "#619b62" /datum/reagent/carpet/green/reaction_turf(turf/T, reac_volume) @@ -1975,7 +1855,6 @@ /datum/reagent/carpet/orange name = "Liquid Orange Carpet" - id = "orangecarpet" color = "#cc7900" /datum/reagent/carpet/orange/reaction_turf(turf/T, reac_volume) @@ -1986,7 +1865,6 @@ /datum/reagent/carpet/purple name = "Liquid Purple Carpet" - id = "purplecarpet" color = "#6d3392" /datum/reagent/carpet/purple/reaction_turf(turf/T, reac_volume) @@ -1997,7 +1875,6 @@ /datum/reagent/carpet/red name = "Liquid Red Carpet" - id = "redcarpet" color = "#871515" /datum/reagent/carpet/red/reaction_turf(turf/T, reac_volume) @@ -2008,7 +1885,6 @@ /datum/reagent/carpet/royalblack name = "Liquid Royal Black Carpet" - id = "royalblackcarpet" color = "#483d05" /datum/reagent/carpet/royalblack/reaction_turf(turf/T, reac_volume) @@ -2019,7 +1895,6 @@ /datum/reagent/carpet/royalblue name = "Liquid Royal Blue Carpet" - id = "royalbluecarpet" color = "#24227e" /datum/reagent/carpet/royalblue/reaction_turf(turf/T, reac_volume) @@ -2032,51 +1907,43 @@ /datum/reagent/toxin/mutagen/mutagenvirusfood name = "mutagenic agar" - id = "mutagenvirusfood" color = "#A3C00F" // rgb: 163,192,15 taste_description = "sourness" /datum/reagent/toxin/mutagen/mutagenvirusfood/sugar name = "sucrose agar" - id = "sugarvirusfood" color = "#41B0C0" // rgb: 65,176,192 taste_description = "sweetness" /datum/reagent/medicine/synaptizine/synaptizinevirusfood name = "virus rations" - id = "synaptizinevirusfood" color = "#D18AA5" // rgb: 209,138,165 taste_description = "bitterness" /datum/reagent/toxin/plasma/plasmavirusfood name = "virus plasma" - id = "plasmavirusfood" color = "#A69DA9" // rgb: 166,157,169 taste_description = "bitterness" taste_mult = 1.5 /datum/reagent/toxin/plasma/plasmavirusfood/weak name = "weakened virus plasma" - id = "weakplasmavirusfood" color = "#CEC3C6" // rgb: 206,195,198 taste_description = "bitterness" taste_mult = 1.5 /datum/reagent/uranium/uraniumvirusfood name = "decaying uranium gel" - id = "uraniumvirusfood" color = "#67ADBA" // rgb: 103,173,186 taste_description = "the inside of a reactor" /datum/reagent/uranium/uraniumvirusfood/unstable name = "unstable uranium gel" - id = "uraniumplasmavirusfood_unstable" color = "#2FF2CB" // rgb: 47,242,203 taste_description = "the inside of a reactor" /datum/reagent/uranium/uraniumvirusfood/stable name = "stable uranium gel" - id = "uraniumplasmavirusfood_stable" color = "#04506C" // rgb: 4,80,108 taste_description = "the inside of a reactor" @@ -2084,7 +1951,6 @@ /datum/reagent/royal_bee_jelly name = "royal bee jelly" - id = "royal_bee_jelly" description = "Royal Bee Jelly, if injected into a Queen Space Bee said bee will split into two bees." color = "#00ff80" taste_description = "strange honey" @@ -2100,7 +1966,6 @@ /datum/reagent/romerol name = "Romerol" // the REAL zombie powder - id = "romerol" description = "Romerol is a highly experimental bioterror agent \ which causes dormant nodules to be etched into the grey matter of \ the subject. These nodules only become active upon death of the \ @@ -2121,7 +1986,6 @@ /datum/reagent/magillitis name = "Magillitis" - id = "magillitis" description = "An experimental serum which causes rapid muscular growth in Hominidae. Side-affects may include hypertrichosis, violent outbursts, and an unending affinity for bananas." reagent_state = LIQUID color = "#00f041" @@ -2133,14 +1997,12 @@ /datum/reagent/growthserum //neutered to use as a chemical base for sizecode shit name = "Growth Serum" - id = "growthserum" description = "A commercial chemical designed to help older men in the bedroom."//not really it just makes you a giant color = "#ff0000"//strong red. rgb 255, 0, 0 taste_description = "bitterness" // apparently what viagra tastes like /datum/reagent/plastic_polymers name = "plastic polymers" - id = "plastic_polymers" description = "the petroleum based components of plastic." color = "#f7eded" taste_description = "plastic" @@ -2148,7 +2010,6 @@ /datum/reagent/glitter name = "generic glitter" - id = "glitter" description = "if you can see this description, contact a coder." color = "#FFFFFF" //pure white taste_description = "plastic" @@ -2162,27 +2023,23 @@ /datum/reagent/glitter/pink name = "pink glitter" - id = "pink_glitter" description = "pink sparkles that get everywhere" color = "#ff8080" //A light pink color glitter_type = /obj/effect/decal/cleanable/glitter/pink /datum/reagent/glitter/white name = "white glitter" - id = "white_glitter" description = "white sparkles that get everywhere" glitter_type = /obj/effect/decal/cleanable/glitter/white /datum/reagent/glitter/blue name = "blue glitter" - id = "blue_glitter" description = "blue sparkles that get everywhere" color = "#4040FF" //A blueish color glitter_type = /obj/effect/decal/cleanable/glitter/blue /datum/reagent/pax name = "pax" - id = "pax" description = "A colorless liquid that suppresses violence on the subjects." color = "#AAAAAA55" taste_description = "water" @@ -2191,15 +2048,14 @@ /datum/reagent/pax/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_PACIFISM, id) + ADD_TRAIT(L, TRAIT_PACIFISM, type) /datum/reagent/pax/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_PACIFISM, id) + REMOVE_TRAIT(L, TRAIT_PACIFISM, type) ..() /datum/reagent/bz_metabolites name = "BZ metabolites" - id = "bz_metabolites" description = "A harmless metabolite of BZ gas" color = "#FAFF00" taste_description = "acrid cinnamon" @@ -2207,11 +2063,11 @@ /datum/reagent/bz_metabolites/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, CHANGELING_HIVEMIND_MUTE, id) + ADD_TRAIT(L, CHANGELING_HIVEMIND_MUTE, type) /datum/reagent/bz_metabolites/on_mob_end_metabolize(mob/living/L) ..() - REMOVE_TRAIT(L, CHANGELING_HIVEMIND_MUTE, id) + REMOVE_TRAIT(L, CHANGELING_HIVEMIND_MUTE, type) /datum/reagent/bz_metabolites/on_mob_life(mob/living/L) if(L.mind) @@ -2222,13 +2078,11 @@ /datum/reagent/pax/peaceborg name = "synth-pax" - id = "synthpax" description = "A colorless liquid that suppresses violence on the subjects. Cheaper to synthetize, but wears out faster than normal Pax." metabolization_rate = 1.5 * REAGENTS_METABOLISM /datum/reagent/peaceborg_confuse name = "Dizzying Solution" - id = "dizzysolution" description = "Makes the target off balance and dizzy" metabolization_rate = 1.5 * REAGENTS_METABOLISM taste_description = "dizziness" @@ -2244,7 +2098,6 @@ /datum/reagent/peaceborg_tire name = "Tiring Solution" - id = "tiresolution" description = "An extremely weak stamina-toxin that tires out the target. Completely harmless." metabolization_rate = 1.5 * REAGENTS_METABOLISM taste_description = "tiredness" @@ -2259,7 +2112,6 @@ /datum/reagent/tranquility name = "Tranquility" - id = "tranquility" description = "A highly mutative liquid of unknown origin." color = "#9A6750" //RGB: 154, 103, 80 taste_description = "inner peace" @@ -2271,7 +2123,6 @@ /datum/reagent/moonsugar name = "Moonsugar" - id = "moonsugar" description = "The primary precursor for an ancient feline delicacy known as skooma. While it has no notable effects on it's own, mixing it with morphine in a chilled container may yield interesting results." color = "#FAEAFF" taste_description = "synthetic catnip" @@ -2285,7 +2136,6 @@ //Kept for legacy, I think it will break everything if you enable it. /datum/reagent/penis_enlargement name = "Penis Enlargement" - id = "penis_enlargement" description = "A patented chemical forumula by Doctor Ronald Hyatt that is guaranteed to bring maximum GROWTH and LENGTH to your penis, today!" color = "#888888" taste_description = "chinese dragon powder" @@ -2302,7 +2152,6 @@ /datum/reagent/changeling_string name = "UNKNOWN" - id = "changeling_sting_real" description = "404: Chemical not found." metabolization_rate = REAGENTS_METABOLISM color = "#0000FF" @@ -2338,9 +2187,14 @@ qdel(original_dna) return ..() +/datum/reagent/mustardgrind + name = "Mustardgrind" + description = "A powerd that is mixed with water and enzymes to make mustard." + color = "#BCC740" //RGB: 188, 199, 64 + taste_description = "plant dust" + /datum/reagent/pax/catnip name = "catnip" - id = "catnip" taste_description = "grass" description = "A colorless liquid that makes people more peaceful and felines more happy." metabolization_rate = 1.75 * REAGENTS_METABOLISM @@ -2357,7 +2211,6 @@ //Some other stuff like moth and felinid ( /datum/reagent/mutationtoxin/moth and /datum/reagent/mutationtoxin/felinid ) already exists. - Chemlight /datum/reagent/mutationtoxin/mammal name = "Mammal Mutation Toxin" - id = "mammalmutationtoxin" description = "A fuzzy toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/mammal @@ -2365,7 +2218,6 @@ /datum/reagent/mutationtoxin/avian name = "Avian Mutation Toxin" - id = "avianmutationtoxin" description = "A bird-like toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/avian @@ -2373,7 +2225,6 @@ /datum/reagent/mutationtoxin/aquatic name = "Aquatic Mutation Toxin" - id = "aquaticmutationtoxin" description = "A aquatic toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/aquatic @@ -2381,7 +2232,6 @@ /datum/reagent/mutationtoxin/xeno name = "Xeno Mutation Toxin" - id = "xenomutationtoxin" description = "A xenomorhpic toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/xeno @@ -2389,7 +2239,6 @@ /datum/reagent/mutationtoxin/insect name = "Insect Mutation Toxin" - id = "insectmutationtoxin" description = "A buggy toxin." color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/insect @@ -2397,7 +2246,6 @@ /datum/reagent/mutationtoxin/ipc name = "IPC Mutation Toxin" - id = "ipcmutationtoxin" description = "A robotic toxin." //NANOMACHINES SON. color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/ipc @@ -2405,7 +2253,6 @@ /datum/reagent/mutationtoxin/synthliz name = "Synthlizard Mutation Toxin" - id = "synthlizmutationtoxin" description = "A synthetic toxin." //NANOMACHINES SON. color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/synthliz diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm index c170858d..5e824900 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm @@ -1,7 +1,6 @@ /datum/reagent/thermite name = "Thermite" - id = "thermite" description = "Thermite produces an aluminothermic reaction known as a thermite reaction. Can be used to melt walls." reagent_state = SOLID color = "#550000" @@ -18,7 +17,6 @@ /datum/reagent/nitroglycerin name = "Nitroglycerin" - id = "nitroglycerin" value = 5 description = "Nitroglycerin is a heavy, colorless, oily, explosive liquid obtained by nitrating glycerol." color = "#808080" // rgb: 128, 128, 128 @@ -26,7 +24,6 @@ /datum/reagent/stabilizing_agent name = "Stabilizing Agent" - id = "stabilizing_agent" description = "Keeps unstable chemicals stable. This does not work on everything." reagent_state = LIQUID color = "#FFFF00" @@ -35,7 +32,6 @@ /datum/reagent/clf3 name = "Chlorine Trifluoride" - id = "clf3" description = "Makes a temporary 3x3 fireball when it comes into existence, so be careful when mixing. ClF3 applied to a surface burns things that wouldn't otherwise burn, sometimes through the very floors of the station and exposing it to the vacuum of space." reagent_state = LIQUID color = "#FFC8C8" @@ -79,7 +75,6 @@ /datum/reagent/sorium name = "Sorium" - id = "sorium" description = "Sends everything flying from the detonation point." reagent_state = LIQUID color = "#5A64C8" @@ -87,7 +82,6 @@ /datum/reagent/liquid_dark_matter name = "Liquid Dark Matter" - id = "liquid_dark_matter" description = "Sucks everything into the detonation point." reagent_state = LIQUID color = "#210021" @@ -96,7 +90,6 @@ /datum/reagent/blackpowder name = "Black Powder" - id = "blackpowder" description = "Explodes. Violently." reagent_state = LIQUID color = "#000000" @@ -118,7 +111,6 @@ /datum/reagent/flash_powder name = "Flash Powder" - id = "flash_powder" description = "Makes a very bright flash." reagent_state = LIQUID color = "#C8C8C8" @@ -126,7 +118,6 @@ /datum/reagent/smoke_powder name = "Smoke Powder" - id = "smoke_powder" description = "Makes a large cloud of smoke that can carry reagents." reagent_state = LIQUID color = "#C8C8C8" @@ -134,7 +125,6 @@ /datum/reagent/sonic_powder name = "Sonic Powder" - id = "sonic_powder" description = "Makes a deafening noise." reagent_state = LIQUID color = "#C8C8C8" @@ -142,7 +132,6 @@ /datum/reagent/phlogiston name = "Phlogiston" - id = "phlogiston" description = "Catches you on fire and makes you ignite." reagent_state = LIQUID color = "#FA00AF" @@ -164,7 +153,6 @@ /datum/reagent/napalm name = "Napalm" - id = "napalm" description = "Very flammable." reagent_state = LIQUID color = "#FA00AF" @@ -182,7 +170,6 @@ /datum/reagent/cryostylane name = "Cryostylane" - id = "cryostylane" description = "Comes into existence at 20K. As long as there is sufficient oxygen for it to react with, Cryostylane slowly cools all other reagents in the container 0K." color = "#0000DC" metabolization_rate = 0.5 * REAGENTS_METABOLISM @@ -190,8 +177,8 @@ /datum/reagent/cryostylane/on_mob_life(mob/living/carbon/M) //TODO: code freezing into an ice cube - if(M.reagents.has_reagent("oxygen")) - M.reagents.remove_reagent("oxygen", 0.5) + if(M.reagents.has_reagent(/datum/reagent/oxygen)) + M.reagents.remove_reagent(/datum/reagent/oxygen, 0.5) M.adjust_bodytemperature(-15) ..() @@ -202,21 +189,19 @@ /datum/reagent/pyrosium name = "Pyrosium" - id = "pyrosium" description = "Comes into existence at 20K. As long as there is sufficient oxygen for it to react with, Pyrosium slowly heats all other reagents in the container." color = "#64FAC8" metabolization_rate = 0.5 * REAGENTS_METABOLISM taste_description = "bitterness" /datum/reagent/pyrosium/on_mob_life(mob/living/carbon/M) - if(M.reagents.has_reagent("oxygen")) - M.reagents.remove_reagent("oxygen", 0.5) + if(M.reagents.has_reagent(/datum/reagent/oxygen)) + M.reagents.remove_reagent(/datum/reagent/oxygen, 0.5) M.adjust_bodytemperature(15) ..() /datum/reagent/teslium //Teslium. Causes periodic shocks, and makes shocks against the target much more effective. name = "Teslium" - id = "teslium" description = "An unstable, electrically-charged metallic slurry. Periodically electrocutes its victim, and makes electrocutions against them more deadly. Excessively heating teslium results in dangerous destabilization. Do not allow to come into contact with water." reagent_state = LIQUID color = "#20324D" //RGB: 32, 50, 77 @@ -234,7 +219,6 @@ /datum/reagent/teslium/energized_jelly name = "Energized Jelly" - id = "energized_jelly" description = "Electrically-charged jelly. Boosts jellypeople's nervous system, but only shocks other lifeforms." reagent_state = LIQUID color = "#CAFF43" @@ -255,7 +239,6 @@ /datum/reagent/firefighting_foam name = "Firefighting Foam" - id = "firefighting_foam" description = "A historical fire suppressant. Originally believed to simply displace oxygen to starve fires, it actually interferes with the combustion reaction itself. Vastly superior to the cheap water-based extinguishers found on NT vessels." reagent_state = LIQUID color = "#A6FAFF55" diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 2fb1c421..83eb4126 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -3,7 +3,6 @@ /datum/reagent/toxin name = "Toxin" - id = "toxin" description = "A toxic chemical." color = "#CF3600" // rgb: 207, 54, 0 taste_description = "bitterness" @@ -19,7 +18,6 @@ /datum/reagent/toxin/amatoxin name = "Amatoxin" - id = "amatoxin" description = "A powerful poison derived from certain species of mushroom." color = "#792300" // rgb: 121, 35, 0 toxpwr = 2.5 @@ -28,7 +26,6 @@ /datum/reagent/toxin/mutagen name = "Unstable mutagen" - id = "mutagen" description = "Might cause unpredictable mutations. Keep away from children." color = "#00FF00" toxpwr = 0 @@ -57,7 +54,6 @@ /datum/reagent/toxin/plasma name = "Plasma" - id = "plasma" description = "Plasma in its liquid form." taste_description = "bitterness" specific_heat = SPECIFIC_HEAT_PLASMA @@ -67,8 +63,8 @@ pH = 4 /datum/reagent/toxin/plasma/on_mob_life(mob/living/carbon/C) - if(holder.has_reagent("epinephrine")) - holder.remove_reagent("epinephrine", 2*REM) + if(holder.has_reagent(/datum/reagent/medicine/epinephrine)) + holder.remove_reagent(/datum/reagent/medicine/epinephrine, 2*REM) C.adjustPlasma(20) return ..() @@ -92,7 +88,6 @@ /datum/reagent/toxin/lexorin name = "Lexorin" - id = "lexorin" description = "A powerful poison used to stop respiration." color = "#7DC3A0" toxpwr = 0 @@ -114,7 +109,6 @@ /datum/reagent/toxin/slimejelly name = "Slime Jelly" - id = "slimejelly" description = "A gooey semi-liquid produced from one of the deadliest lifeforms in existence. SO REAL." color = "#801E28" // rgb: 128, 30, 40 toxpwr = 0 @@ -134,7 +128,6 @@ /datum/reagent/toxin/minttoxin name = "Mint Toxin" - id = "minttoxin" description = "Useful for dealing with undesirable customers." color = "#CF3600" // rgb: 207, 54, 0 toxpwr = 0 @@ -148,7 +141,6 @@ /datum/reagent/toxin/carpotoxin name = "Carpotoxin" - id = "carpotoxin" description = "A deadly neurotoxin produced by the dreaded spess carp." color = "#003333" // rgb: 0, 51, 51 toxpwr = 2 @@ -157,7 +149,6 @@ /datum/reagent/toxin/zombiepowder name = "Zombie Powder" - id = "zombiepowder" description = "A strong neurotoxin that puts the subject into a death-like state." reagent_state = SOLID color = "#669900" // rgb: 102, 153, 0 @@ -167,10 +158,10 @@ /datum/reagent/toxin/zombiepowder/on_mob_metabolize(mob/living/L) ..() - L.fakedeath(id) + L.fakedeath(type) /datum/reagent/toxin/zombiepowder/on_mob_end_metabolize(mob/living/L) - L.cure_fakedeath(id) + L.cure_fakedeath(type) ..() /datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/carbon/M) @@ -180,7 +171,6 @@ /datum/reagent/toxin/ghoulpowder name = "Ghoul Powder" - id = "ghoulpowder" description = "A strong neurotoxin that slows metabolism to a death-like state, while keeping the patient fully active. Causes toxin buildup if used too long." reagent_state = SOLID color = "#664700" // rgb: 102, 71, 0 @@ -190,10 +180,10 @@ /datum/reagent/toxin/ghoulpowder/on_mob_metabolize(mob/living/L) ..() - ADD_TRAIT(L, TRAIT_FAKEDEATH, id) + ADD_TRAIT(L, TRAIT_FAKEDEATH, type) /datum/reagent/toxin/ghoulpowder/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_FAKEDEATH, id) + REMOVE_TRAIT(L, TRAIT_FAKEDEATH, type) ..() /datum/reagent/toxin/ghoulpowder/on_mob_life(mob/living/carbon/M) @@ -203,7 +193,6 @@ /datum/reagent/toxin/mindbreaker name = "Mindbreaker Toxin" - id = "mindbreaker" description = "A powerful hallucinogen. Not a thing to be messed with. For some mental patients. it counteracts their symptoms and anchors them to reality." color = "#B31008" // rgb: 139, 166, 233 toxpwr = 0 @@ -216,7 +205,6 @@ /datum/reagent/toxin/plantbgone name = "Plant-B-Gone" - id = "plantbgone" description = "A harmful toxic mixture to kill plantlife. Do not ingest!" color = "#49002E" // rgb: 73, 0, 46 toxpwr = 1 @@ -243,14 +231,12 @@ /datum/reagent/toxin/plantbgone/weedkiller name = "Weed Killer" - id = "weedkiller" description = "A harmful toxic mixture to kill weeds. Do not ingest!" color = "#4B004B" // rgb: 75, 0, 75 pH = 3 /datum/reagent/toxin/pestkiller name = "Pest Killer" - id = "pestkiller" description = "A harmful toxic mixture to kill pests. Do not ingest!" color = "#4B004B" // rgb: 75, 0, 75 toxpwr = 1 @@ -264,7 +250,6 @@ /datum/reagent/toxin/spore name = "Spore Toxin" - id = "spore" description = "A natural toxin produced by blob spores that inhibits vision when ingested." color = "#9ACD32" toxpwr = 1 @@ -278,7 +263,6 @@ /datum/reagent/toxin/spore_burning name = "Burning Spore Toxin" - id = "spore_burning" description = "A natural toxin produced by blob spores that induces combustion in its victim." color = "#9ACD32" toxpwr = 0.5 @@ -292,7 +276,6 @@ /datum/reagent/toxin/chloralhydrate name = "Chloral Hydrate" - id = "chloralhydrate" description = "A powerful sedative that induces confusion and drowsiness before putting its target to sleep." reagent_state = SOLID color = "#000067" // rgb: 0, 0, 103 @@ -316,7 +299,6 @@ /datum/reagent/toxin/fakebeer //disguised as normal beer for use by emagged brobots name = "Beer" - id = "fakebeer" description = "A specially-engineered sedative disguised as beer. It induces instant sleep in its target." color = "#664300" // rgb: 102, 67, 0 metabolization_rate = 1.5 * REAGENTS_METABOLISM @@ -337,7 +319,6 @@ /datum/reagent/toxin/coffeepowder name = "Coffee Grounds" - id = "coffeepowder" description = "Finely ground coffee beans, used to make coffee." reagent_state = SOLID color = "#5B2E0D" // rgb: 91, 46, 13 @@ -346,7 +327,6 @@ /datum/reagent/toxin/teapowder name = "Ground Tea Leaves" - id = "teapowder" description = "Finely shredded tea leaves, used for making tea." reagent_state = SOLID color = "#7F8400" // rgb: 127, 132, 0 @@ -355,7 +335,6 @@ /datum/reagent/toxin/mutetoxin //the new zombie powder. name = "Mute Toxin" - id = "mutetoxin" description = "A nonlethal poison that inhibits speech in its victim." color = "#F0F8FF" // rgb: 240, 248, 255 toxpwr = 0 @@ -368,7 +347,6 @@ /datum/reagent/toxin/staminatoxin name = "Tirizene" - id = "tirizene" description = "A nonlethal poison that causes extreme fatigue and weakness in its victim." color = "#6E2828" data = 15 @@ -382,7 +360,6 @@ /datum/reagent/toxin/polonium name = "Polonium" - id = "polonium" description = "An extremely radioactive material in liquid form. Ingestion results in fatal irradiation." reagent_state = LIQUID color = "#787878" @@ -395,7 +372,6 @@ /datum/reagent/toxin/histamine name = "Histamine" - id = "histamine" description = "Histamine's effects become more dangerous depending on the dosage amount. They range from mildly annoying to incredibly lethal." reagent_state = LIQUID color = "#FA6464" @@ -429,7 +405,6 @@ /datum/reagent/toxin/formaldehyde name = "Formaldehyde" - id = "formaldehyde" description = "Formaldehyde, on its own, is a fairly weak toxin. It contains trace amounts of Histamine, very rarely making it decay into Histamine." reagent_state = LIQUID color = "#B4004B" @@ -438,14 +413,13 @@ /datum/reagent/toxin/formaldehyde/on_mob_life(mob/living/carbon/M) if(prob(5)) - holder.add_reagent("histamine", pick(5,15)) - holder.remove_reagent("formaldehyde", 1.2) + holder.add_reagent(/datum/reagent/toxin/histamine, pick(5,15)) + holder.remove_reagent(type, 1.2) else return ..() /datum/reagent/toxin/venom name = "Venom" - id = "venom" description = "An exotic poison extracted from highly toxic fauna. Causes scaling amounts of toxin damage and bruising depending and dosage. Often decays into Histamine." reagent_state = LIQUID color = "#F0FFF0" @@ -457,14 +431,13 @@ M.adjustBruteLoss((0.3*volume)*REM, 0) . = 1 if(prob(15)) - M.reagents.add_reagent("histamine", pick(5,10)) - M.reagents.remove_reagent("venom", 1.1) + M.reagents.add_reagent(/datum/reagent/toxin/histamine, pick(5,10)) + M.reagents.remove_reagent(type, 1.1) else ..() /datum/reagent/toxin/fentanyl name = "Fentanyl" - id = "fentanyl" description = "Fentanyl will inhibit brain function and cause toxin damage before eventually knocking out its victim." reagent_state = LIQUID color = "#64916E" @@ -482,7 +455,6 @@ /datum/reagent/toxin/cyanide name = "Cyanide" - id = "cyanide" description = "An infamous poison known for its use in assassination. Causes small amounts of toxin damage with a small chance of oxygen damage or a stun." reagent_state = LIQUID color = "#00B4FF" @@ -500,7 +472,6 @@ /datum/reagent/toxin/bad_food name = "Bad Food" - id = "bad_food" description = "The result of some abomination of cookery, food so bad it's toxic." reagent_state = LIQUID color = "#d6d6d8" @@ -510,7 +481,6 @@ /datum/reagent/toxin/itching_powder name = "Itching Powder" - id = "itching_powder" description = "A powder that induces itching upon contact with the skin. Causes the victim to scratch at their itches and has a very low chance to decay into Histamine." reagent_state = LIQUID color = "#C8C8C8" @@ -519,7 +489,7 @@ /datum/reagent/toxin/itching_powder/reaction_mob(mob/living/M, method=TOUCH, reac_volume) if(method == TOUCH || method == VAPOR) - M.reagents.add_reagent("itching_powder", reac_volume) + M.reagents.add_reagent(/datum/reagent/toxin/itching_powder, reac_volume) /datum/reagent/toxin/itching_powder/on_mob_life(mob/living/carbon/M) if(prob(15)) @@ -535,14 +505,13 @@ M.adjustBruteLoss(0.2*REM, 0) . = 1 if(prob(3)) - M.reagents.add_reagent("histamine",rand(1,3)) - M.reagents.remove_reagent("itching_powder",1.2) + M.reagents.add_reagent(/datum/reagent/toxin/histamine,rand(1,3)) + M.reagents.remove_reagent(type,1.2) return ..() /datum/reagent/toxin/initropidril name = "Initropidril" - id = "initropidril" description = "A powerful poison with insidious effects. It can cause stuns, lethal breathing failure, and cardiac arrest." reagent_state = LIQUID color = "#7F10C0" @@ -573,7 +542,6 @@ /datum/reagent/toxin/pancuronium name = "Pancuronium" - id = "pancuronium" description = "An undetectable toxin that swiftly incapacitates its victim. May also cause breathing failure." reagent_state = LIQUID color = "#195096" @@ -591,7 +559,6 @@ /datum/reagent/toxin/sodium_thiopental name = "Sodium Thiopental" - id = "sodium_thiopental" description = "Sodium Thiopental induces heavy weakness in its target as well as unconsciousness." reagent_state = LIQUID color = "#6496FA" @@ -607,7 +574,6 @@ /datum/reagent/toxin/sulfonal name = "Sulfonal" - id = "sulfonal" description = "A stealthy poison that deals minor toxin damage and eventually puts the target to sleep." reagent_state = LIQUID color = "#7DC3A0" @@ -621,7 +587,6 @@ /datum/reagent/toxin/amanitin name = "Amanitin" - id = "amanitin" description = "A very powerful delayed toxin. Upon full metabolization, a massive amount of toxin damage will be dealt depending on how long it has been in the victim's bloodstream." reagent_state = LIQUID color = "#FFFFFF" @@ -636,7 +601,6 @@ /datum/reagent/toxin/lipolicide name = "Lipolicide" - id = "lipolicide" description = "A powerful toxin that will destroy fat cells, massively reducing body weight in a short time. Deadly to those without nutriment in their body." taste_description = "mothballs" reagent_state = LIQUID @@ -653,7 +617,6 @@ /datum/reagent/toxin/coniine name = "Coniine" - id = "coniine" description = "Coniine metabolizes extremely slowly, but deals high amounts of toxin damage and stops breathing." reagent_state = LIQUID color = "#7DC3A0" @@ -666,7 +629,6 @@ /datum/reagent/toxin/spewium name = "Spewium" - id = "spewium" description = "A powerful emetic, causes uncontrollable vomiting. May result in vomiting organs at high doses." reagent_state = LIQUID color = "#2f6617" //A sickly green color @@ -681,7 +643,7 @@ C.vomit(10, prob(10), prob(50), rand(0,4), TRUE, prob(30)) for(var/datum/reagent/toxin/R in C.reagents.reagent_list) if(R != src) - C.reagents.remove_reagent(R.id,1) + C.reagents.remove_reagent(R.type,1) /datum/reagent/toxin/spewium/overdose_process(mob/living/carbon/C) . = ..() @@ -692,7 +654,6 @@ /datum/reagent/toxin/curare name = "Curare" - id = "curare" description = "Causes slight toxin damage followed by chain-stunning and oxygen damage." reagent_state = LIQUID color = "#191919" @@ -708,7 +669,6 @@ /datum/reagent/toxin/heparin //Based on a real-life anticoagulant. I'm not a doctor, so this won't be realistic. name = "Heparin" - id = "heparin" description = "A powerful anticoagulant. Victims will bleed uncontrollably and suffer scaling bruising." reagent_state = LIQUID color = "#C8C8C8" //RGB: 200, 200, 200 @@ -726,7 +686,6 @@ /datum/reagent/toxin/rotatium //Rotatium. Fucks up your rotation and is hilarious name = "Rotatium" - id = "rotatium" description = "A constantly swirling, oddly colourful fluid. Causes the consumer's sense of direction and hand-eye coordination to become wild." reagent_state = LIQUID color = "#AC88CA" //RGB: 172, 136, 202 @@ -753,7 +712,6 @@ /datum/reagent/toxin/skewium name = "Skewium" - id = "skewium" description = "A strange, dull coloured liquid that appears to warp back and forth inside its container. Causes any consumer to experience a visual phenomena similar to said warping." reagent_state = LIQUID color = "#ADBDCD" @@ -791,7 +749,6 @@ /datum/reagent/toxin/anacea name = "Anacea" - id = "anacea" description = "A toxin that quickly purges medicines and metabolizes very slowly." reagent_state = LIQUID color = "#3C5133" @@ -800,10 +757,10 @@ /datum/reagent/toxin/anacea/on_mob_life(mob/living/carbon/M) var/remove_amt = 5 - if(holder.has_reagent("calomel") || holder.has_reagent("pen_acid") || holder.has_reagent("pen_jelly")) + if(holder.has_reagent(/datum/reagent/medicine/calomel) || holder.has_reagent(/datum/reagent/medicine/pen_acid) || holder.has_reagent(/datum/reagent/medicine/pen_acid/pen_jelly)) remove_amt = 0.5 for(var/datum/reagent/medicine/R in M.reagents.reagent_list) - M.reagents.remove_reagent(R.id,remove_amt) + M.reagents.remove_reagent(R.type,remove_amt) return ..() //ACID @@ -811,7 +768,6 @@ /datum/reagent/toxin/acid name = "Sulphuric acid" - id = "sacid" description = "A strong mineral acid with the molecular formula H2SO4." color = "#00FF32" toxpwr = 1 @@ -846,7 +802,6 @@ /datum/reagent/toxin/acid/fluacid name = "Fluorosulfuric acid" - id = "facid" description = "Fluorosulfuric acid is an extremely corrosive chemical substance." color = "#5050FF" toxpwr = 2 @@ -859,7 +814,6 @@ /datum/reagent/toxin/delayed name = "Toxin Microcapsules" - id = "delayed_toxin" description = "Causes heavy toxin damage after a brief time of inactivity." reagent_state = LIQUID metabolization_rate = 0 //stays in the system until active. @@ -870,7 +824,7 @@ /datum/reagent/toxin/delayed/on_mob_life(mob/living/carbon/M) if(current_cycle > delay) - holder.remove_reagent(id, actual_metaboliztion_rate * M.metabolism_efficiency) + holder.remove_reagent(type, actual_metaboliztion_rate * M.metabolism_efficiency) M.adjustToxLoss(actual_toxpwr*REM, 0) if(prob(10)) M.Knockdown(20, 0) @@ -879,21 +833,19 @@ /datum/reagent/toxin/mimesbane name = "Mime's Bane" - id = "mimesbane" description = "A nonlethal neurotoxin that interferes with the victim's ability to gesture." color = "#F0F8FF" // rgb: 240, 248, 255 toxpwr = 0 taste_description = "stillness" /datum/reagent/toxin/mimesbane/on_mob_metabolize(mob/living/L) - ADD_TRAIT(L, TRAIT_EMOTEMUTE, id) + ADD_TRAIT(L, TRAIT_EMOTEMUTE, type) /datum/reagent/toxin/mimesbane/on_mob_end_metabolize(mob/living/L) - REMOVE_TRAIT(L, TRAIT_EMOTEMUTE, id) + REMOVE_TRAIT(L, TRAIT_EMOTEMUTE, type) /datum/reagent/toxin/bonehurtingjuice //oof ouch name = "Bone Hurting Juice" - id = "bonehurtingjuice" description = "A strange substance that looks a lot like water. Drinking it is oddly tempting. Oof ouch." color = "#AAAAAA77" //RGBA: 170, 170, 170, 77 toxpwr = 0 @@ -903,7 +855,6 @@ /datum/reagent/toxin/bungotoxin name = "Bungotoxin" - id = "bungotoxin" description = "A horrible cardiotoxin that protects the humble bungo pit." silent_toxin = TRUE color = "#EBFF8E" @@ -973,7 +924,6 @@ /datum/reagent/toxin/brainhurtingjuice //oof ouch name = "Brain Hurting Juice" - id = "brainhurtingjuice" color = "#AAAAAA77" //RGBA: 170, 170, 170, 77 toxpwr = 0 taste_description = "brain hurting" diff --git a/code/modules/reagents/chemistry/recipes/drugs.dm b/code/modules/reagents/chemistry/recipes/drugs.dm index 27b1fe12..468d29c0 100644 --- a/code/modules/reagents/chemistry/recipes/drugs.dm +++ b/code/modules/reagents/chemistry/recipes/drugs.dm @@ -1,64 +1,64 @@ /datum/chemical_reaction/space_drugs name = "Space Drugs" - id = "space_drugs" - results = list("space_drugs" = 3) - required_reagents = list("mercury" = 1, "sugar" = 1, "lithium" = 1) + id = /datum/reagent/drug/space_drugs + results = list(/datum/reagent/drug/space_drugs = 3) + required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/lithium = 1) /datum/chemical_reaction/crank name = "Crank" - id = "crank" - results = list("crank" = 5) - required_reagents = list("diphenhydramine" = 1, "ammonia" = 1, "lithium" = 1, "sacid" = 1, "welding_fuel" = 1) + id = /datum/reagent/drug/crank + results = list(/datum/reagent/drug/crank = 5) + required_reagents = list(/datum/reagent/medicine/diphenhydramine = 1, /datum/reagent/ammonia = 1, /datum/reagent/lithium = 1, /datum/reagent/toxin/acid = 1, /datum/reagent/fuel = 1) mix_message = "The mixture violently reacts, leaving behind a few crystalline shards." required_temp = 390 /datum/chemical_reaction/krokodil name = "Krokodil" - id = "krokodil" - results = list("krokodil" = 6) - required_reagents = list("diphenhydramine" = 1, "morphine" = 1, "cleaner" = 1, "potassium" = 1, "phosphorus" = 1, "welding_fuel" = 1) + id = /datum/reagent/drug/krokodil + results = list(/datum/reagent/drug/krokodil = 6) + required_reagents = list(/datum/reagent/medicine/diphenhydramine = 1, /datum/reagent/medicine/morphine = 1, /datum/reagent/space_cleaner = 1, /datum/reagent/potassium = 1, /datum/reagent/phosphorus = 1, /datum/reagent/fuel = 1) mix_message = "The mixture dries into a pale blue powder." required_temp = 380 /datum/chemical_reaction/methamphetamine name = "methamphetamine" - id = "methamphetamine" - results = list("methamphetamine" = 4) - required_reagents = list("ephedrine" = 1, "iodine" = 1, "phosphorus" = 1, "hydrogen" = 1) + id = /datum/reagent/drug/methamphetamine + results = list(/datum/reagent/drug/methamphetamine = 4) + required_reagents = list(/datum/reagent/medicine/ephedrine = 1, /datum/reagent/iodine = 1, /datum/reagent/phosphorus = 1, /datum/reagent/hydrogen = 1) required_temp = 374 /datum/chemical_reaction/bath_salts name = "bath_salts" - id = "bath_salts" - results = list("bath_salts" = 7) - required_reagents = list("bad_food" = 1, "saltpetre" = 1, "nutriment" = 1, "cleaner" = 1, "enzyme" = 1, "tea" = 1, "mercury" = 1) + id = /datum/reagent/drug/bath_salts + results = list(/datum/reagent/drug/bath_salts = 7) + required_reagents = list(/datum/reagent/toxin/bad_food = 1, /datum/reagent/saltpetre = 1, /datum/reagent/consumable/nutriment = 1, /datum/reagent/space_cleaner = 1, /datum/reagent/consumable/enzyme = 1, /datum/reagent/consumable/tea = 1, /datum/reagent/mercury = 1) required_temp = 374 /datum/chemical_reaction/aranesp name = "aranesp" - id = "aranesp" - results = list("aranesp" = 3) - required_reagents = list("epinephrine" = 1, "atropine" = 1, "morphine" = 1) + id = /datum/reagent/drug/aranesp + results = list(/datum/reagent/drug/aranesp = 3) + required_reagents = list(/datum/reagent/medicine/epinephrine = 1, /datum/reagent/medicine/atropine = 1, /datum/reagent/medicine/morphine = 1) /datum/chemical_reaction/happiness name = "Happiness" - id = "happiness" - results = list("happiness" = 4) - required_reagents = list("nitrous_oxide" = 2, "epinephrine" = 1, "ethanol" = 1) - required_catalysts = list("plasma" = 5) + id = /datum/reagent/drug/happiness + results = list(/datum/reagent/drug/happiness = 4) + required_reagents = list(/datum/reagent/nitrous_oxide = 2, /datum/reagent/medicine/epinephrine = 1, /datum/reagent/consumable/ethanol = 1) + required_catalysts = list(/datum/reagent/toxin/plasma = 5) /datum/chemical_reaction/skooma name = "skooma" - id = "skooma" - results = list("skooma" = 2, "moonshine" = 4, "sugar" = 4) + id = /datum/reagent/drug/skooma + results = list(/datum/reagent/drug/skooma = 2, /datum/reagent/consumable/ethanol/moonshine = 4, /datum/reagent/consumable/sugar = 4) required_temp = 280 is_cold_recipe = TRUE - required_reagents = list("moonsugar" = 10, "morphine" = 5) + required_reagents = list(/datum/reagent/moonsugar = 10, /datum/reagent/medicine/morphine = 5) /datum/chemical_reaction/skoomarevert name = "skoomarevert" id = "skoomarevert" - results = list("moonsugar" = 1, "morphine" = 2.5) + results = list(/datum/reagent/moonsugar = 1, /datum/reagent/medicine/morphine = 2.5) required_temp = 315 //a little above normal body temperature - required_reagents = list("skooma" = 1) + required_reagents = list(/datum/reagent/drug/skooma = 1) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index 67070475..2c843ec7 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -1,79 +1,79 @@ /datum/chemical_reaction/leporazine name = "Leporazine" - id = "leporazine" - results = list("leporazine" = 2) - required_reagents = list("silicon" = 1, "copper" = 1) - required_catalysts = list("plasma" = 5) + id = /datum/reagent/medicine/leporazine + results = list(/datum/reagent/medicine/leporazine = 2) + required_reagents = list(/datum/reagent/silicon = 1, /datum/reagent/copper = 1) + required_catalysts = list(/datum/reagent/toxin/plasma = 5) /datum/chemical_reaction/rezadone name = "Rezadone" - id = "rezadone" - results = list("rezadone" = 3) - required_reagents = list("carpotoxin" = 1, "cryptobiolin" = 1, "copper" = 1) + id = /datum/reagent/medicine/rezadone + results = list(/datum/reagent/medicine/rezadone = 3) + required_reagents = list(/datum/reagent/toxin/carpotoxin = 1, /datum/reagent/cryptobiolin = 1, /datum/reagent/copper = 1) /datum/chemical_reaction/spaceacillin name = "Spaceacillin" - id = "spaceacillin" - results = list("spaceacillin" = 2) - required_reagents = list("cryptobiolin" = 1, "epinephrine" = 1) + id = /datum/reagent/medicine/spaceacillin + results = list(/datum/reagent/medicine/spaceacillin = 2) + required_reagents = list(/datum/reagent/cryptobiolin = 1, /datum/reagent/medicine/epinephrine = 1) /datum/chemical_reaction/inacusiate name = "inacusiate" - id = "inacusiate" - results = list("inacusiate" = 2) - required_reagents = list("water" = 1, "carbon" = 1, "charcoal" = 1) + id = /datum/reagent/medicine/inacusiate + results = list(/datum/reagent/medicine/inacusiate = 2) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/carbon = 1, /datum/reagent/medicine/charcoal = 1) /datum/chemical_reaction/synaptizine name = "Synaptizine" - id = "synaptizine" - results = list("synaptizine" = 3) - required_reagents = list("sugar" = 1, "lithium" = 1, "water" = 1) + id = /datum/reagent/medicine/synaptizine + results = list(/datum/reagent/medicine/synaptizine = 3) + required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/lithium = 1, /datum/reagent/water = 1) /datum/chemical_reaction/charcoal name = "Charcoal" - id = "charcoal" - results = list("charcoal" = 2) - required_reagents = list("ash" = 1, "sodiumchloride" = 1) + id = /datum/reagent/medicine/charcoal + results = list(/datum/reagent/medicine/charcoal = 2) + required_reagents = list(/datum/reagent/ash = 1, /datum/reagent/consumable/sodiumchloride = 1) mix_message = "The mixture yields a fine black powder." required_temp = 380 /datum/chemical_reaction/silver_sulfadiazine name = "Silver Sulfadiazine" - id = "silver_sulfadiazine" - results = list("silver_sulfadiazine" = 5) - required_reagents = list("ammonia" = 1, "silver" = 1, "sulfur" = 1, "oxygen" = 1, "chlorine" = 1) + id = /datum/reagent/medicine/silver_sulfadiazine + results = list(/datum/reagent/medicine/silver_sulfadiazine = 5) + required_reagents = list(/datum/reagent/ammonia = 1, /datum/reagent/silver = 1, /datum/reagent/sulfur = 1, /datum/reagent/oxygen = 1, /datum/reagent/chlorine = 1) /datum/chemical_reaction/salglu_solution name = "Saline-Glucose Solution" - id = "salglu_solution" - results = list("salglu_solution" = 3) - required_reagents = list("sodiumchloride" = 1, "water" = 1, "sugar" = 1) + id = /datum/reagent/medicine/salglu_solution + results = list(/datum/reagent/medicine/salglu_solution = 3) + required_reagents = list(/datum/reagent/consumable/sodiumchloride = 1, /datum/reagent/water = 1, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/mine_salve name = "Miner's Salve" - id = "mine_salve" - results = list("mine_salve" = 3) - required_reagents = list("oil" = 1, "water" = 1, "iron" = 1) + id = /datum/reagent/medicine/mine_salve + results = list(/datum/reagent/medicine/mine_salve = 3) + required_reagents = list(/datum/reagent/oil = 1, /datum/reagent/water = 1, /datum/reagent/iron = 1) /datum/chemical_reaction/mine_salve2 name = "Miner's Salve" - id = "mine_salve" - results = list("mine_salve" = 15) - required_reagents = list("plasma" = 5, "iron" = 5, "sugar" = 1) // A sheet of plasma, a twinkie and a sheet of metal makes four of these + id = "mine_salve_2" + results = list(/datum/reagent/medicine/mine_salve = 15) + required_reagents = list(/datum/reagent/toxin/plasma = 5, /datum/reagent/iron = 5, /datum/reagent/consumable/sugar = 1) // A sheet of plasma, a twinkie and a sheet of metal makes four of these /datum/chemical_reaction/synthflesh name = "Synthflesh" - id = "synthflesh" - results = list("synthflesh" = 3) - required_reagents = list("blood" = 1, "carbon" = 1, "styptic_powder" = 1) + id = /datum/reagent/medicine/synthflesh + results = list(/datum/reagent/medicine/synthflesh = 3) + required_reagents = list(/datum/reagent/blood = 1, /datum/reagent/carbon = 1, /datum/reagent/medicine/styptic_powder = 1) /datum/chemical_reaction/synthtissue name = "Synthtissue" - id = "synthtissue" - results = list("synthtissue" = 0.05) - required_reagents = list("synthflesh" = 0.01) - required_catalysts = list("sugar" = 0.1) + id = /datum/reagent/synthtissue + results = list(/datum/reagent/synthtissue = 5) + required_reagents = list(/datum/reagent/medicine/synthflesh = 1) + required_catalysts = list(/datum/reagent/consumable/sugar = 0.1) //FermiChem vars: OptimalTempMin = 305 // Lower area of bell curve for determining heat based rate reactions OptimalTempMax = 315 // Upper end for above @@ -91,13 +91,13 @@ PurityMin = 0 /datum/chemical_reaction/synthtissue/FermiCreate(datum/reagents/holder, added_volume, added_purity) - var/datum/reagent/synthtissue/St = holder.has_reagent("synthtissue") - var/datum/reagent/N = holder.has_reagent("sugar") + var/datum/reagent/synthtissue/St = holder.has_reagent(/datum/reagent/synthtissue) + var/datum/reagent/N = holder.has_reagent(/datum/reagent/consumable/sugar) if(!St) return if(holder.chem_temp > 320) var/temp_ratio = 1-(330 - holder.chem_temp)/10 - holder.remove_reagent(src.id, added_volume*temp_ratio) + holder.remove_reagent(id, added_volume*temp_ratio) if(St.purity < 1) St.volume *= St.purity St.purity = 1 @@ -107,212 +107,212 @@ /datum/chemical_reaction/styptic_powder name = "Styptic Powder" - id = "styptic_powder" - results = list("styptic_powder" = 4) - required_reagents = list("aluminium" = 1, "hydrogen" = 1, "oxygen" = 1, "sacid" = 1) + id = /datum/reagent/medicine/styptic_powder + results = list(/datum/reagent/medicine/styptic_powder = 4) + required_reagents = list(/datum/reagent/aluminium = 1, /datum/reagent/hydrogen = 1, /datum/reagent/oxygen = 1, /datum/reagent/toxin/acid = 1) mix_message = "The solution yields an astringent powder." /datum/chemical_reaction/calomel name = "Calomel" - id = "calomel" - results = list("calomel" = 2) - required_reagents = list("mercury" = 1, "chlorine" = 1) + id = /datum/reagent/medicine/calomel + results = list(/datum/reagent/medicine/calomel = 2) + required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/chlorine = 1) required_temp = 374 /datum/chemical_reaction/potass_iodide name = "Potassium Iodide" - id = "potass_iodide" - results = list("potass_iodide" = 2) - required_reagents = list("potassium" = 1, "iodine" = 1) + id = /datum/reagent/medicine/potass_iodide + results = list(/datum/reagent/medicine/potass_iodide = 2) + required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/iodine = 1) /datum/chemical_reaction/pen_acid name = "Pentetic Acid" - id = "pen_acid" - results = list("pen_acid" = 6) - required_reagents = list("welding_fuel" = 1, "chlorine" = 1, "ammonia" = 1, "formaldehyde" = 1, "sodium" = 1, "cyanide" = 1) + id = /datum/reagent/medicine/pen_acid + results = list(/datum/reagent/medicine/pen_acid = 6) + required_reagents = list(/datum/reagent/fuel = 1, /datum/reagent/chlorine = 1, /datum/reagent/ammonia = 1, /datum/reagent/toxin/formaldehyde = 1, /datum/reagent/sodium = 1, /datum/reagent/toxin/cyanide = 1) /datum/chemical_reaction/pen_jelly name = "Pentetic Jelly" - id = "pen_jelly" - results = list("pen_jelly" = 2) - required_reagents = list("pen_acid" = 1, "slimejelly" = 1) + id = /datum/reagent/medicine/pen_acid/pen_jelly + results = list(/datum/reagent/medicine/pen_acid/pen_jelly = 2) + required_reagents = list(/datum/reagent/medicine/pen_acid = 1, /datum/reagent/toxin/slimejelly = 1) /datum/chemical_reaction/sal_acid name = "Salicyclic Acid" - id = "sal_acid" - results = list("sal_acid" = 5) - required_reagents = list("sodium" = 1, "phenol" = 1, "carbon" = 1, "oxygen" = 1, "sacid" = 1) + id = /datum/reagent/medicine/sal_acid + results = list(/datum/reagent/medicine/sal_acid = 5) + required_reagents = list(/datum/reagent/sodium = 1, /datum/reagent/phenol = 1, /datum/reagent/carbon = 1, /datum/reagent/oxygen = 1, /datum/reagent/toxin/acid = 1) /datum/chemical_reaction/oxandrolone name = "Oxandrolone" - id = "oxandrolone" - results = list("oxandrolone" = 6) - required_reagents = list("carbon" = 3, "phenol" = 1, "hydrogen" = 1, "oxygen" = 1) + id = /datum/reagent/medicine/oxandrolone + results = list(/datum/reagent/medicine/oxandrolone = 6) + required_reagents = list(/datum/reagent/carbon = 3, /datum/reagent/phenol = 1, /datum/reagent/hydrogen = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/salbutamol name = "Salbutamol" - id = "salbutamol" - results = list("salbutamol" = 5) - required_reagents = list("sal_acid" = 1, "lithium" = 1, "aluminium" = 1, "bromine" = 1, "ammonia" = 1) + id = /datum/reagent/medicine/salbutamol + results = list(/datum/reagent/medicine/salbutamol = 5) + required_reagents = list(/datum/reagent/medicine/sal_acid = 1, /datum/reagent/lithium = 1, /datum/reagent/aluminium = 1, /datum/reagent/bromine = 1, /datum/reagent/ammonia = 1) /datum/chemical_reaction/perfluorodecalin name = "Perfluorodecalin" - id = "perfluorodecalin" - results = list("perfluorodecalin" = 3) - required_reagents = list("hydrogen" = 1, "fluorine" = 1, "oil" = 1) + id = /datum/reagent/medicine/perfluorodecalin + results = list(/datum/reagent/medicine/perfluorodecalin = 3) + required_reagents = list(/datum/reagent/hydrogen = 1, /datum/reagent/fluorine = 1, /datum/reagent/oil = 1) required_temp = 370 mix_message = "The mixture rapidly turns into a dense pink liquid." /datum/chemical_reaction/ephedrine name = "Ephedrine" - id = "ephedrine" - results = list("ephedrine" = 4) - required_reagents = list("sugar" = 1, "oil" = 1, "hydrogen" = 1, "diethylamine" = 1) + id = /datum/reagent/medicine/ephedrine + results = list(/datum/reagent/medicine/ephedrine = 4) + required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/oil = 1, /datum/reagent/hydrogen = 1, /datum/reagent/diethylamine = 1) mix_message = "The solution fizzes and gives off toxic fumes." /datum/chemical_reaction/diphenhydramine name = "Diphenhydramine" - id = "diphenhydramine" - results = list("diphenhydramine" = 4) - required_reagents = list("oil" = 1, "carbon" = 1, "bromine" = 1, "diethylamine" = 1, "ethanol" = 1) + id = /datum/reagent/medicine/diphenhydramine + results = list(/datum/reagent/medicine/diphenhydramine = 4) + required_reagents = list(/datum/reagent/oil = 1, /datum/reagent/carbon = 1, /datum/reagent/bromine = 1, /datum/reagent/diethylamine = 1, /datum/reagent/consumable/ethanol = 1) mix_message = "The mixture dries into a pale blue powder." /datum/chemical_reaction/oculine name = "Oculine" - id = "oculine" - results = list("oculine" = 3) - required_reagents = list("charcoal" = 1, "carbon" = 1, "hydrogen" = 1) + id = /datum/reagent/medicine/oculine + results = list(/datum/reagent/medicine/oculine = 3) + required_reagents = list(/datum/reagent/medicine/charcoal = 1, /datum/reagent/carbon = 1, /datum/reagent/hydrogen = 1) mix_message = "The mixture sputters loudly and becomes a pale pink color." /datum/chemical_reaction/atropine name = "Atropine" - id = "atropine" - results = list("atropine" = 5) - required_reagents = list("ethanol" = 1, "acetone" = 1, "diethylamine" = 1, "phenol" = 1, "sacid" = 1) + id = /datum/reagent/medicine/atropine + results = list(/datum/reagent/medicine/atropine = 5) + required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/acetone = 1, /datum/reagent/diethylamine = 1, /datum/reagent/phenol = 1, /datum/reagent/toxin/acid = 1) /datum/chemical_reaction/epinephrine name = "Epinephrine" - id = "epinephrine" - results = list("epinephrine" = 6) - required_reagents = list("phenol" = 1, "acetone" = 1, "diethylamine" = 1, "oxygen" = 1, "chlorine" = 1, "hydrogen" = 1) + id = /datum/reagent/medicine/epinephrine + results = list(/datum/reagent/medicine/epinephrine = 6) + required_reagents = list(/datum/reagent/phenol = 1, /datum/reagent/acetone = 1, /datum/reagent/diethylamine = 1, /datum/reagent/oxygen = 1, /datum/reagent/chlorine = 1, /datum/reagent/hydrogen = 1) /datum/chemical_reaction/strange_reagent name = "Strange Reagent" - id = "strange_reagent" - results = list("strange_reagent" = 3) - required_reagents = list("omnizine" = 1, "holywater" = 1, "mutagen" = 1) + id = /datum/reagent/medicine/strange_reagent + results = list(/datum/reagent/medicine/strange_reagent = 3) + required_reagents = list(/datum/reagent/medicine/omnizine = 1, /datum/reagent/water/holywater = 1, /datum/reagent/toxin/mutagen = 1) /datum/chemical_reaction/mannitol name = "Mannitol" - id = "mannitol" - results = list("mannitol" = 3) - required_reagents = list("sugar" = 1, "hydrogen" = 1, "water" = 1) + id = /datum/reagent/medicine/mannitol + results = list(/datum/reagent/medicine/mannitol = 3) + required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/hydrogen = 1, /datum/reagent/water = 1) mix_message = "The solution slightly bubbles, becoming thicker." /datum/chemical_reaction/mutadone name = "Mutadone" - id = "mutadone" - results = list("mutadone" = 3) - required_reagents = list("mutagen" = 1, "acetone" = 1, "bromine" = 1) + id = /datum/reagent/medicine/mutadone + results = list(/datum/reagent/medicine/mutadone = 3) + required_reagents = list(/datum/reagent/toxin/mutagen = 1, /datum/reagent/acetone = 1, /datum/reagent/bromine = 1) /datum/chemical_reaction/neurine name = "Neurine" - id = "neurine" - results = list("neurine" = 3) - required_reagents = list("mannitol" = 1, "acetone" = 1, "oxygen" = 1) + id = /datum/reagent/medicine/neurine + results = list(/datum/reagent/medicine/neurine = 3) + required_reagents = list(/datum/reagent/medicine/mannitol = 1, /datum/reagent/acetone = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/antihol name = "antihol" - id = "antihol" - results = list("antihol" = 3) - required_reagents = list("ethanol" = 1, "charcoal" = 1, "copper" = 1) + id = /datum/reagent/medicine/antihol + results = list(/datum/reagent/medicine/antihol = 3) + required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/medicine/charcoal = 1, /datum/reagent/copper = 1) /datum/chemical_reaction/cryoxadone name = "Cryoxadone" - id = "cryoxadone" - results = list("cryoxadone" = 3) - required_reagents = list("stable_plasma" = 1, "acetone" = 1, "mutagen" = 1) + id = /datum/reagent/medicine/cryoxadone + results = list(/datum/reagent/medicine/cryoxadone = 3) + required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/acetone = 1, /datum/reagent/toxin/mutagen = 1) /datum/chemical_reaction/pyroxadone name = "Pyroxadone" - id = "pyroxadone" - results = list("pyroxadone" = 2) - required_reagents = list("cryoxadone" = 1, "slimejelly" = 1) + id = /datum/reagent/medicine/pyroxadone + results = list(/datum/reagent/medicine/pyroxadone = 2) + required_reagents = list(/datum/reagent/medicine/cryoxadone = 1, /datum/reagent/toxin/slimejelly = 1) /datum/chemical_reaction/clonexadone name = "Clonexadone" - id = "clonexadone" - results = list("clonexadone" = 2) - required_reagents = list("cryoxadone" = 1, "sodium" = 1) - required_catalysts = list("plasma" = 5) + id = /datum/reagent/medicine/clonexadone + results = list(/datum/reagent/medicine/clonexadone = 2) + required_reagents = list(/datum/reagent/medicine/cryoxadone = 1, /datum/reagent/sodium = 1) + required_catalysts = list(/datum/reagent/toxin/plasma = 5) /datum/chemical_reaction/haloperidol name = "Haloperidol" - id = "haloperidol" - results = list("haloperidol" = 5) - required_reagents = list("chlorine" = 1, "fluorine" = 1, "aluminium" = 1, "potass_iodide" = 1, "oil" = 1) + id = /datum/reagent/medicine/haloperidol + results = list(/datum/reagent/medicine/haloperidol = 5) + required_reagents = list(/datum/reagent/chlorine = 1, /datum/reagent/fluorine = 1, /datum/reagent/aluminium = 1, /datum/reagent/medicine/potass_iodide = 1, /datum/reagent/oil = 1) /datum/chemical_reaction/bicaridine name = "Bicaridine" - id = "bicaridine" - results = list("bicaridine" = 3) - required_reagents = list("carbon" = 1, "oxygen" = 1, "sugar" = 1) + id = /datum/reagent/medicine/bicaridine + results = list(/datum/reagent/medicine/bicaridine = 3) + required_reagents = list(/datum/reagent/carbon = 1, /datum/reagent/oxygen = 1, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/kelotane name = "Kelotane" - id = "kelotane" - results = list("kelotane" = 2) - required_reagents = list("carbon" = 1, "silicon" = 1) + id = /datum/reagent/medicine/kelotane + results = list(/datum/reagent/medicine/kelotane = 2) + required_reagents = list(/datum/reagent/carbon = 1, /datum/reagent/silicon = 1) /datum/chemical_reaction/antitoxin name = "Antitoxin" - id = "antitoxin" - results = list("antitoxin" = 3) - required_reagents = list("nitrogen" = 1, "silicon" = 1, "potassium" = 1) + id = /datum/reagent/medicine/antitoxin + results = list(/datum/reagent/medicine/antitoxin = 3) + required_reagents = list(/datum/reagent/nitrogen = 1, /datum/reagent/silicon = 1, /datum/reagent/potassium = 1) /datum/chemical_reaction/tricordrazine name = "Tricordrazine" - id = "tricordrazine" - results = list("tricordrazine" = 3) - required_reagents = list("bicaridine" = 1, "kelotane" = 1, "antitoxin" = 1) + id = /datum/reagent/medicine/tricordrazine + results = list(/datum/reagent/medicine/tricordrazine = 3) + required_reagents = list(/datum/reagent/medicine/bicaridine = 1, /datum/reagent/medicine/kelotane = 1, /datum/reagent/medicine/antitoxin = 1) /datum/chemical_reaction/regen_jelly name = "Regenerative Jelly" - id = "regen_jelly" - results = list("regen_jelly" = 2) - required_reagents = list("tricordrazine" = 1, "slimejelly" = 1) + id = /datum/reagent/medicine/regen_jelly + results = list(/datum/reagent/medicine/regen_jelly = 2) + required_reagents = list(/datum/reagent/medicine/tricordrazine = 1, /datum/reagent/toxin/slimejelly = 1) /datum/chemical_reaction/jelly_convert name = "Blood Jelly Conversion" - id = "blood_jelly" - results = list("slimejelly" = 1) - required_reagents = list("toxin" = 1, "jellyblood" = 1) + id = /datum/reagent/toxin/slimejelly + results = list(/datum/reagent/toxin/slimejelly = 1) + required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/blood/jellyblood = 1) /datum/chemical_reaction/corazone name = "Corazone" - id = "corazone" - results = list("corazone" = 3) - required_reagents = list("phenol" = 2, "lithium" = 1) + id = /datum/reagent/medicine/corazone + results = list(/datum/reagent/medicine/corazone = 3) + required_reagents = list(/datum/reagent/phenol = 2, /datum/reagent/lithium = 1) /datum/chemical_reaction/morphine name = "Morphine" - id = "morphine" - results = list("morphine" = 2) - required_reagents = list("carbon" = 2, "hydrogen" = 2, "ethanol" = 1, "oxygen" = 1) + id = /datum/reagent/medicine/morphine + results = list(/datum/reagent/medicine/morphine = 2) + required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/consumable/ethanol = 1, /datum/reagent/oxygen = 1) required_temp = 480 /datum/chemical_reaction/modafinil name = "Modafinil" - id = "modafinil" - results = list("modafinil" = 5) - required_reagents = list("diethylamine" = 1, "ammonia" = 1, "phenol" = 1, "acetone" = 1, "sacid" = 1) - required_catalysts = list("bromine" = 1) // as close to the real world synthesis as possible + id = /datum/reagent/medicine/modafinil + results = list(/datum/reagent/medicine/modafinil = 5) + required_reagents = list(/datum/reagent/diethylamine = 1, /datum/reagent/ammonia = 1, /datum/reagent/phenol = 1, /datum/reagent/acetone = 1, /datum/reagent/toxin/acid = 1) + required_catalysts = list(/datum/reagent/bromine = 1) // as close to the real world synthesis as possible /datum/chemical_reaction/psicodine name = "Psicodine" - id = "psicodine" - results = list("psicodine" = 5) - required_reagents = list( "mannitol" = 2, "water" = 2, "impedrezene" = 1) + id = /datum/reagent/medicine/psicodine + results = list(/datum/reagent/medicine/psicodine = 5) + required_reagents = list( /datum/reagent/medicine/mannitol = 2, /datum/reagent/water = 2, /datum/reagent/impedrezene = 1) /datum/chemical_reaction/prussian_blue name = "Prussian Blue" diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index ea7f86c5..3a2bdfd0 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -2,55 +2,55 @@ /datum/chemical_reaction/sterilizine name = "Sterilizine" id = "sterilizine" - results = list("sterilizine" = 3) - required_reagents = list("ethanol" = 1, "charcoal" = 1, "chlorine" = 1) + results = list(/datum/reagent/space_cleaner/sterilizine = 3) + required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/medicine/charcoal = 1, /datum/reagent/chlorine = 1) /datum/chemical_reaction/lube name = "Space Lube" - id = "lube" - results = list("lube" = 4) - required_reagents = list("water" = 1, "silicon" = 1, "oxygen" = 1) + id = /datum/reagent/lube + results = list(/datum/reagent/lube = 4) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/silicon = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/spraytan name = "Spray Tan" - id = "spraytan" - results = list("spraytan" = 2) - required_reagents = list("orangejuice" = 1, "oil" = 1) + id = /datum/reagent/spraytan + results = list(/datum/reagent/spraytan = 2) + required_reagents = list(/datum/reagent/consumable/orangejuice = 1, /datum/reagent/oil = 1) /datum/chemical_reaction/spraytan2 name = "Spray Tan" - id = "spraytan" - results = list("spraytan" = 2) - required_reagents = list("orangejuice" = 1, "cornoil" = 1) + id = "spraytan2" + results = list(/datum/reagent/spraytan = 2) + required_reagents = list(/datum/reagent/consumable/orangejuice = 1, /datum/reagent/consumable/cornoil = 1) /datum/chemical_reaction/impedrezene name = "Impedrezene" - id = "impedrezene" - results = list("impedrezene" = 2) - required_reagents = list("mercury" = 1, "oxygen" = 1, "sugar" = 1) + id = /datum/reagent/impedrezene + results = list(/datum/reagent/impedrezene = 2) + required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/oxygen = 1, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/cryptobiolin name = "Cryptobiolin" - id = "cryptobiolin" - results = list("cryptobiolin" = 3) - required_reagents = list("potassium" = 1, "oxygen" = 1, "sugar" = 1) + id = /datum/reagent/cryptobiolin + results = list(/datum/reagent/cryptobiolin = 3) + required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/oxygen = 1, /datum/reagent/consumable/sugar = 1) /datum/chemical_reaction/glycerol name = "Glycerol" - id = "glycerol" - results = list("glycerol" = 1) - required_reagents = list("cornoil" = 3, "sacid" = 1) + id = /datum/reagent/glycerol + results = list(/datum/reagent/glycerol = 1) + required_reagents = list(/datum/reagent/consumable/cornoil = 3, /datum/reagent/toxin/acid = 1) /datum/chemical_reaction/sodiumchloride name = "Sodium Chloride" id = "sodiumchloride" - results = list("sodiumchloride" = 3) - required_reagents = list("water" = 1, "sodium" = 1, "chlorine" = 1) + results = list(/datum/reagent/consumable/sodiumchloride = 3) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/sodium = 1, /datum/reagent/chlorine = 1) /datum/chemical_reaction/plasmasolidification name = "Solid Plasma" id = "solidplasma" - required_reagents = list("iron" = 5, "frostoil" = 5, "plasma" = 20) + required_reagents = list(/datum/reagent/iron = 5, /datum/reagent/consumable/frostoil = 5, /datum/reagent/toxin/plasma = 20) mob_react = FALSE /datum/chemical_reaction/plasmasolidification/on_reaction(datum/reagents/holder, created_volume) @@ -61,7 +61,7 @@ /datum/chemical_reaction/goldsolidification name = "Solid Gold" id = "solidgold" - required_reagents = list("frostoil" = 5, "gold" = 20, "iron" = 1) + required_reagents = list(/datum/reagent/consumable/frostoil = 5, /datum/reagent/gold = 20, /datum/reagent/iron = 1) mob_react = FALSE /datum/chemical_reaction/goldsolidification/on_reaction(datum/reagents/holder, created_volume) @@ -71,17 +71,23 @@ /datum/chemical_reaction/capsaicincondensation name = "Capsaicincondensation" - id = "capsaicincondensation" - results = list("condensedcapsaicin" = 5) - required_reagents = list("capsaicin" = 1, "ethanol" = 5) + id = /datum/reagent/consumable/condensedcapsaicin + results = list(/datum/reagent/consumable/condensedcapsaicin = 5) + required_reagents = list(/datum/reagent/consumable/capsaicin = 1, /datum/reagent/consumable/ethanol = 5) /datum/chemical_reaction/soapification name = "Soapification" id = "soapification" - required_reagents = list("liquidgibs" = 10, "lye" = 10) // requires two scooped gib tiles + required_reagents = list(/datum/reagent/liquidgibs = 10, /datum/reagent/lye = 10) // requires two scooped gib tiles required_temp = 374 mob_react = FALSE +/datum/chemical_reaction/mustard + name = "Mustard" + id = /datum/reagent/consumable/mustard + results = list(/datum/reagent/consumable/mustard = 5) + required_reagents = list(/datum/reagent/mustardgrind = 1, /datum/reagent/water = 10, /datum/reagent/consumable/enzyme= 1) + /datum/chemical_reaction/soapification/on_reaction(datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) for(var/i = 1, i <= created_volume, i++) @@ -90,7 +96,7 @@ /datum/chemical_reaction/candlefication name = "Candlefication" id = "candlefication" - required_reagents = list("liquidgibs" = 5, "oxygen" = 5) // + required_reagents = list(/datum/reagent/liquidgibs = 5, /datum/reagent/oxygen = 5) required_temp = 374 mob_react = FALSE @@ -102,7 +108,7 @@ /datum/chemical_reaction/meatification name = "Meatification" id = "meatification" - required_reagents = list("liquidgibs" = 10, "nutriment" = 10, "carbon" = 10) + required_reagents = list(/datum/reagent/liquidgibs = 10, /datum/reagent/consumable/nutriment = 10, /datum/reagent/carbon = 10) mob_react = FALSE /datum/chemical_reaction/meatification/on_reaction(datum/reagents/holder, created_volume) @@ -113,30 +119,30 @@ /datum/chemical_reaction/carbondioxide name = "Direct Carbon Oxidation" - id = "burningcarbon" - results = list("co2" = 3) - required_reagents = list("carbon" = 1, "oxygen" = 2) + id = /datum/reagent/carbondioxide + results = list(/datum/reagent/carbondioxide = 3) + required_reagents = list(/datum/reagent/carbon = 1, /datum/reagent/oxygen = 2) required_temp = 777 // pure carbon isn't especially reactive. /datum/chemical_reaction/nitrous_oxide name = "Nitrous Oxide" - id = "nitrous_oxide" - results = list("nitrous_oxide" = 5) - required_reagents = list("ammonia" = 2, "nitrogen" = 1, "oxygen" = 2) + id = /datum/reagent/nitrous_oxide + results = list(/datum/reagent/nitrous_oxide = 5) + required_reagents = list(/datum/reagent/ammonia = 2, /datum/reagent/nitrogen = 1, /datum/reagent/oxygen = 2) required_temp = 525 //Technically a mutation toxin /datum/chemical_reaction/mulligan name = "Mulligan" id = "mulligan" - results = list("mulligan" = 1) - required_reagents = list("slime_toxin" = 1, "mutagen" = 1) + results = list(/datum/reagent/mulligan = 1) + required_reagents = list(/datum/reagent/slime_toxin = 1, /datum/reagent/toxin/mutagen = 1) /datum/chemical_reaction/fermis_plush name = "Fermis plush" id = "fermis_plush" - required_reagents = list("sugar" = 10, "blood" = 10, "stable_plasma" = 10) + required_reagents = list(/datum/reagent/consumable/caramel = 10, /datum/reagent/blood = 10, /datum/reagent/stable_plasma = 10) mob_react = FALSE required_temp = 400 @@ -150,75 +156,75 @@ /datum/chemical_reaction/virus_food name = "Virus Food" id = "virusfood" - results = list("virusfood" = 15) - required_reagents = list("water" = 5, "milk" = 5) + results = list(/datum/reagent/consumable/virus_food = 15) + required_reagents = list(/datum/reagent/water = 5, /datum/reagent/consumable/milk = 5) /datum/chemical_reaction/virus_food_mutagen name = "mutagenic agar" id = "mutagenvirusfood" - results = list("mutagenvirusfood" = 1) - required_reagents = list("mutagen" = 1, "virusfood" = 1) + results = list(/datum/reagent/toxin/mutagen/mutagenvirusfood = 1) + required_reagents = list(/datum/reagent/toxin/mutagen = 1, /datum/reagent/consumable/virus_food = 1) /datum/chemical_reaction/virus_food_synaptizine name = "virus rations" id = "synaptizinevirusfood" - results = list("synaptizinevirusfood" = 1) - required_reagents = list("synaptizine" = 1, "virusfood" = 1) + results = list(/datum/reagent/medicine/synaptizine/synaptizinevirusfood = 1) + required_reagents = list(/datum/reagent/medicine/synaptizine = 1, /datum/reagent/consumable/virus_food = 1) /datum/chemical_reaction/virus_food_plasma name = "virus plasma" - id = "plasmavirusfood" - results = list("plasmavirusfood" = 1) - required_reagents = list("plasma" = 1, "virusfood" = 1) + id = /datum/reagent/toxin/plasma/plasmavirusfood + results = list(/datum/reagent/toxin/plasma/plasmavirusfood = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1, /datum/reagent/consumable/virus_food = 1) /datum/chemical_reaction/virus_food_plasma_synaptizine name = "weakened virus plasma" - id = "weakplasmavirusfood" - results = list("weakplasmavirusfood" = 2) - required_reagents = list("synaptizine" = 1, "plasmavirusfood" = 1) + id = /datum/reagent/toxin/plasma/plasmavirusfood/weak + results = list(/datum/reagent/toxin/plasma/plasmavirusfood/weak = 2) + required_reagents = list(/datum/reagent/medicine/synaptizine = 1, /datum/reagent/toxin/plasma/plasmavirusfood = 1) /datum/chemical_reaction/virus_food_mutagen_sugar name = "sucrose agar" - id = "sugarvirusfood" - results = list("sugarvirusfood" = 2) - required_reagents = list("sugar" = 1, "mutagenvirusfood" = 1) + id = /datum/reagent/toxin/mutagen/mutagenvirusfood/sugar + results = list(/datum/reagent/toxin/mutagen/mutagenvirusfood/sugar = 2) + required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/toxin/mutagen/mutagenvirusfood = 1) /datum/chemical_reaction/virus_food_mutagen_salineglucose name = "sucrose agar" id = "salineglucosevirusfood" - results = list("sugarvirusfood" = 2) - required_reagents = list("salglu_solution" = 1, "mutagenvirusfood" = 1) + results = list(/datum/reagent/toxin/mutagen/mutagenvirusfood/sugar = 2) + required_reagents = list(/datum/reagent/medicine/salglu_solution = 1, /datum/reagent/toxin/mutagen/mutagenvirusfood = 1) /datum/chemical_reaction/virus_food_uranium name = "Decaying uranium gel" - id = "uraniumvirusfood" - results = list("uraniumvirusfood" = 1) - required_reagents = list("uranium" = 1, "virusfood" = 1) + id = /datum/reagent/uranium/uraniumvirusfood + results = list(/datum/reagent/uranium/uraniumvirusfood = 1) + required_reagents = list(/datum/reagent/uranium = 1, /datum/reagent/consumable/virus_food = 1) /datum/chemical_reaction/virus_food_uranium_plasma name = "Unstable uranium gel" - id = "uraniumvirusfood_plasma" - results = list("uraniumplasmavirusfood_unstable" = 1) - required_reagents = list("uranium" = 5, "plasmavirusfood" = 1) + id = /datum/reagent/uranium/uraniumvirusfood/unstable + results = list(/datum/reagent/uranium/uraniumvirusfood/unstable = 1) + required_reagents = list(/datum/reagent/uranium = 5, /datum/reagent/toxin/plasma/plasmavirusfood = 1) /datum/chemical_reaction/virus_food_uranium_plasma_gold name = "Stable uranium gel" id = "uraniumvirusfood_gold" - results = list("uraniumplasmavirusfood_stable" = 1) - required_reagents = list("uranium" = 10, "gold" = 10, "plasma" = 1) + results = list(/datum/reagent/uranium/uraniumvirusfood/stable = 1) + required_reagents = list(/datum/reagent/uranium = 10, /datum/reagent/gold = 10, /datum/reagent/toxin/plasma = 1) /datum/chemical_reaction/virus_food_uranium_plasma_silver name = "Stable uranium gel" id = "uraniumvirusfood_silver" - results = list("uraniumplasmavirusfood_stable" = 1) - required_reagents = list("uranium" = 10, "silver" = 10, "plasma" = 1) + results = list(/datum/reagent/uranium/uraniumvirusfood/stable = 1) + required_reagents = list(/datum/reagent/uranium = 10, /datum/reagent/silver = 10, /datum/reagent/toxin/plasma = 1) /datum/chemical_reaction/mix_virus name = "Mix Virus" id = "mixvirus" - results = list("blood" = 1) - required_reagents = list("virusfood" = 1) - required_catalysts = list("blood" = 1) + results = list(/datum/reagent/blood = 1) + required_reagents = list(/datum/reagent/consumable/virus_food = 1) + required_catalysts = list(/datum/reagent/blood = 1) var/level_min = 1 var/level_max = 2 @@ -234,7 +240,7 @@ name = "Mix Virus 2" id = "mixvirus2" - required_reagents = list("mutagen" = 1) + required_reagents = list(/datum/reagent/toxin/mutagen = 1) level_min = 2 level_max = 4 @@ -242,7 +248,7 @@ name = "Mix Virus 3" id = "mixvirus3" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) level_min = 4 level_max = 6 @@ -250,7 +256,7 @@ name = "Mix Virus 4" id = "mixvirus4" - required_reagents = list("uranium" = 1) + required_reagents = list(/datum/reagent/uranium = 1) level_min = 5 level_max = 6 @@ -258,7 +264,7 @@ name = "Mix Virus 5" id = "mixvirus5" - required_reagents = list("mutagenvirusfood" = 1) + required_reagents = list(/datum/reagent/toxin/mutagen/mutagenvirusfood = 1) level_min = 3 level_max = 3 @@ -266,7 +272,7 @@ name = "Mix Virus 6" id = "mixvirus6" - required_reagents = list("sugarvirusfood" = 1) + required_reagents = list(/datum/reagent/toxin/mutagen/mutagenvirusfood/sugar = 1) level_min = 4 level_max = 4 @@ -274,7 +280,7 @@ name = "Mix Virus 7" id = "mixvirus7" - required_reagents = list("weakplasmavirusfood" = 1) + required_reagents = list(/datum/reagent/toxin/plasma/plasmavirusfood/weak = 1) level_min = 5 level_max = 5 @@ -282,7 +288,7 @@ name = "Mix Virus 8" id = "mixvirus8" - required_reagents = list("plasmavirusfood" = 1) + required_reagents = list(/datum/reagent/toxin/plasma/plasmavirusfood = 1) level_min = 6 level_max = 6 @@ -290,7 +296,7 @@ name = "Mix Virus 9" id = "mixvirus9" - required_reagents = list("synaptizinevirusfood" = 1) + required_reagents = list(/datum/reagent/medicine/synaptizine/synaptizinevirusfood = 1) level_min = 1 level_max = 1 @@ -298,7 +304,7 @@ name = "Mix Virus 10" id = "mixvirus10" - required_reagents = list("uraniumvirusfood" = 1) + required_reagents = list(/datum/reagent/uranium/uraniumvirusfood = 1) level_min = 6 level_max = 7 @@ -306,7 +312,7 @@ name = "Mix Virus 11" id = "mixvirus11" - required_reagents = list("uraniumplasmavirusfood_unstable" = 1) + required_reagents = list(/datum/reagent/uranium/uraniumvirusfood/unstable = 1) level_min = 7 level_max = 7 @@ -314,7 +320,7 @@ name = "Mix Virus 12" id = "mixvirus12" - required_reagents = list("uraniumplasmavirusfood_stable" = 1) + required_reagents = list(/datum/reagent/uranium/uraniumvirusfood/stable = 1) level_min = 8 level_max = 8 @@ -322,8 +328,8 @@ name = "Devolve Virus" id = "remvirus" - required_reagents = list("synaptizine" = 1) - required_catalysts = list("blood" = 1) + required_reagents = list(/datum/reagent/medicine/synaptizine = 1) + required_catalysts = list(/datum/reagent/blood = 1) /datum/chemical_reaction/mix_virus/rem_virus/on_reaction(datum/reagents/holder, created_volume) @@ -336,8 +342,8 @@ /datum/chemical_reaction/mix_virus/neuter_virus name = "Neuter Virus" id = "neutervirus" - required_reagents = list("formaldehyde" = 1) - required_catalysts = list("blood" = 1) + required_reagents = list(/datum/reagent/toxin/formaldehyde = 1) + required_catalysts = list(/datum/reagent/blood = 1) /datum/chemical_reaction/mix_virus/neuter_virus/on_reaction(datum/reagents/holder, created_volume) @@ -355,13 +361,13 @@ /datum/chemical_reaction/surfactant name = "Foam surfactant" id = "foam surfactant" - results = list("fluorosurfactant" = 5) - required_reagents = list("fluorine" = 2, "carbon" = 2, "sacid" = 1) + results = list(/datum/reagent/fluorosurfactant = 5) + required_reagents = list(/datum/reagent/fluorine = 2, /datum/reagent/carbon = 2, /datum/reagent/toxin/acid = 1) /datum/chemical_reaction/foam name = "Foam" id = "foam" - required_reagents = list("fluorosurfactant" = 1, "water" = 1) + required_reagents = list(/datum/reagent/fluorosurfactant = 1, /datum/reagent/water = 1) mob_react = FALSE /datum/chemical_reaction/foam/on_reaction(datum/reagents/holder, created_volume) @@ -378,7 +384,7 @@ /datum/chemical_reaction/metalfoam name = "Metal Foam" id = "metalfoam" - required_reagents = list("aluminium" = 3, "foaming_agent" = 1, "facid" = 1) + required_reagents = list(/datum/reagent/aluminium = 3, /datum/reagent/foaming_agent = 1, /datum/reagent/toxin/acid/fluacid = 1) mob_react = FALSE /datum/chemical_reaction/metalfoam/on_reaction(datum/reagents/holder, created_volume) @@ -395,7 +401,7 @@ /datum/chemical_reaction/smart_foam name = "Smart Metal Foam" id = "smart_metal_foam" - required_reagents = list("aluminium" = 3, "smart_foaming_agent" = 1, "facid" = 1) + required_reagents = list(/datum/reagent/aluminium = 3, /datum/reagent/smart_foaming_agent = 1, /datum/reagent/toxin/acid/fluacid = 1) mob_react = TRUE /datum/chemical_reaction/smart_foam/on_reaction(datum/reagents/holder, created_volume) @@ -409,7 +415,7 @@ /datum/chemical_reaction/ironfoam name = "Iron Foam" id = "ironlfoam" - required_reagents = list("iron" = 3, "foaming_agent" = 1, "facid" = 1) + required_reagents = list(/datum/reagent/iron = 3, /datum/reagent/foaming_agent = 1, /datum/reagent/toxin/acid/fluacid = 1) mob_react = FALSE /datum/chemical_reaction/ironfoam/on_reaction(datum/reagents/holder, created_volume) @@ -423,15 +429,15 @@ /datum/chemical_reaction/foaming_agent name = "Foaming Agent" - id = "foaming_agent" - results = list("foaming_agent" = 1) - required_reagents = list("lithium" = 1, "hydrogen" = 1) + id = /datum/reagent/foaming_agent + results = list(/datum/reagent/foaming_agent = 1) + required_reagents = list(/datum/reagent/lithium = 1, /datum/reagent/hydrogen = 1) /datum/chemical_reaction/smart_foaming_agent name = "Smart foaming Agent" - id = "smart_foaming_agent" - results = list("smart_foaming_agent" = 3) - required_reagents = list("foaming_agent" = 3, "acetone" = 1, "iron" = 1) + id = /datum/reagent/smart_foaming_agent + results = list(/datum/reagent/smart_foaming_agent = 3) + required_reagents = list(/datum/reagent/foaming_agent = 3, /datum/reagent/acetone = 1, /datum/reagent/iron = 1) mix_message = "The solution mixes into a frothy metal foam and conforms to the walls of its container." @@ -439,83 +445,83 @@ /datum/chemical_reaction/ammonia name = "Ammonia" - id = "ammonia" - results = list("ammonia" = 3) - required_reagents = list("hydrogen" = 3, "nitrogen" = 1) + id = /datum/reagent/ammonia + results = list(/datum/reagent/ammonia = 3) + required_reagents = list(/datum/reagent/hydrogen = 3, /datum/reagent/nitrogen = 1) /datum/chemical_reaction/diethylamine name = "Diethylamine" - id = "diethylamine" - results = list("diethylamine" = 2) - required_reagents = list ("ammonia" = 1, "ethanol" = 1) + id = /datum/reagent/diethylamine + results = list(/datum/reagent/diethylamine = 2) + required_reagents = list (/datum/reagent/ammonia = 1, /datum/reagent/consumable/ethanol = 1) /datum/chemical_reaction/space_cleaner name = "Space cleaner" - id = "cleaner" - results = list("cleaner" = 2) - required_reagents = list("ammonia" = 1, "water" = 1) + id = /datum/reagent/space_cleaner + results = list(/datum/reagent/space_cleaner = 2) + required_reagents = list(/datum/reagent/ammonia = 1, /datum/reagent/water = 1) /datum/chemical_reaction/plantbgone name = "Plant-B-Gone" - id = "plantbgone" - results = list("plantbgone" = 5) - required_reagents = list("toxin" = 1, "water" = 4) + id = /datum/reagent/toxin/plantbgone + results = list(/datum/reagent/toxin/plantbgone = 5) + required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/water = 4) /datum/chemical_reaction/weedkiller name = "Weed Killer" - id = "weedkiller" - results = list("weedkiller" = 5) - required_reagents = list("toxin" = 1, "ammonia" = 4) + id = /datum/reagent/toxin/plantbgone/weedkiller + results = list(/datum/reagent/toxin/plantbgone/weedkiller = 5) + required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/ammonia = 4) /datum/chemical_reaction/pestkiller name = "Pest Killer" - id = "pestkiller" - results = list("pestkiller" = 5) - required_reagents = list("toxin" = 1, "ethanol" = 4) + id = /datum/reagent/toxin/pestkiller + results = list(/datum/reagent/toxin/pestkiller = 5) + required_reagents = list(/datum/reagent/toxin = 1, /datum/reagent/consumable/ethanol = 4) /datum/chemical_reaction/drying_agent name = "Drying agent" - id = "drying_agent" - results = list("drying_agent" = 3) - required_reagents = list("stable_plasma" = 2, "ethanol" = 1, "sodium" = 1) + id = /datum/reagent/drying_agent + results = list(/datum/reagent/drying_agent = 3) + required_reagents = list(/datum/reagent/stable_plasma = 2, /datum/reagent/consumable/ethanol = 1, /datum/reagent/sodium = 1) //////////////////////////////////// Other goon stuff /////////////////////////////////////////// /datum/chemical_reaction/acetone name = "acetone" - id = "acetone" - results = list("acetone" = 3) - required_reagents = list("oil" = 1, "welding_fuel" = 1, "oxygen" = 1) + id = /datum/reagent/acetone + results = list(/datum/reagent/acetone = 3) + required_reagents = list(/datum/reagent/oil = 1, /datum/reagent/fuel = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/oil name = "Oil" - id = "oil" - results = list("oil" = 3) - required_reagents = list("welding_fuel" = 1, "carbon" = 1, "hydrogen" = 1) + id = /datum/reagent/oil + results = list(/datum/reagent/oil = 3) + required_reagents = list(/datum/reagent/fuel = 1, /datum/reagent/carbon = 1, /datum/reagent/hydrogen = 1) /datum/chemical_reaction/phenol name = "phenol" - id = "phenol" - results = list("phenol" = 3) - required_reagents = list("water" = 1, "chlorine" = 1, "oil" = 1) + id = /datum/reagent/phenol + results = list(/datum/reagent/phenol = 3) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/chlorine = 1, /datum/reagent/oil = 1) /datum/chemical_reaction/ash name = "Ash" - id = "ash" - results = list("ash" = 1) - required_reagents = list("oil" = 1) + id = /datum/reagent/ash + results = list(/datum/reagent/ash = 1) + required_reagents = list(/datum/reagent/oil = 1) required_temp = 480 /datum/chemical_reaction/colorful_reagent name = "colorful_reagent" - id = "colorful_reagent" - results = list("colorful_reagent" = 5) - required_reagents = list("stable_plasma" = 1, "radium" = 1, "space_drugs" = 1, "cryoxadone" = 1, "triple_citrus" = 1) + id = /datum/reagent/colorful_reagent + results = list(/datum/reagent/colorful_reagent = 5) + required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/radium = 1, /datum/reagent/drug/space_drugs = 1, /datum/reagent/medicine/cryoxadone = 1, /datum/reagent/consumable/triple_citrus = 1) /datum/chemical_reaction/life name = "Life" id = "life" - required_reagents = list("strange_reagent" = 1, "synthflesh" = 1, "blood" = 1) + required_reagents = list(/datum/reagent/medicine/strange_reagent = 1, /datum/reagent/medicine/synthflesh = 1, /datum/reagent/blood = 1) required_temp = 374 /datum/chemical_reaction/life/on_reaction(datum/reagents/holder, created_volume) @@ -525,7 +531,7 @@ /datum/chemical_reaction/life_friendly name = "Life (Friendly)" id = "life_friendly" - required_reagents = list("strange_reagent" = 1, "synthflesh" = 1, "sugar" = 1) + required_reagents = list(/datum/reagent/medicine/strange_reagent = 1, /datum/reagent/medicine/synthflesh = 1, /datum/reagent/consumable/sugar = 1) required_temp = 374 /datum/chemical_reaction/life_friendly/on_reaction(datum/reagents/holder, created_volume) @@ -534,7 +540,7 @@ /datum/chemical_reaction/corgium name = "corgium" id = "corgium" - required_reagents = list("nutriment" = 1, "colorful_reagent" = 1, "strange_reagent" = 1, "blood" = 1) + required_reagents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent = 1, /datum/reagent/medicine/strange_reagent = 1, /datum/reagent/blood = 1) required_temp = 374 /datum/chemical_reaction/corgium/on_reaction(datum/reagents/holder, created_volume) @@ -545,56 +551,56 @@ /datum/chemical_reaction/hair_dye name = "hair_dye" - id = "hair_dye" - results = list("hair_dye" = 5) - required_reagents = list("colorful_reagent" = 1, "radium" = 1, "space_drugs" = 1) + id = /datum/reagent/hair_dye + results = list(/datum/reagent/hair_dye = 5) + required_reagents = list(/datum/reagent/colorful_reagent = 1, /datum/reagent/radium = 1, /datum/reagent/drug/space_drugs = 1) /datum/chemical_reaction/barbers_aid name = "barbers_aid" - id = "barbers_aid" - results = list("barbers_aid" = 5) - required_reagents = list("carpet" = 1, "radium" = 1, "space_drugs" = 1) + id = /datum/reagent/barbers_aid + results = list(/datum/reagent/barbers_aid = 5) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/radium = 1, /datum/reagent/drug/space_drugs = 1) /datum/chemical_reaction/concentrated_barbers_aid name = "concentrated_barbers_aid" - id = "concentrated_barbers_aid" - results = list("concentrated_barbers_aid" = 2) - required_reagents = list("barbers_aid" = 1, "mutagen" = 1) + id = /datum/reagent/concentrated_barbers_aid + results = list(/datum/reagent/concentrated_barbers_aid = 2) + required_reagents = list(/datum/reagent/barbers_aid = 1, /datum/reagent/toxin/mutagen = 1) /datum/chemical_reaction/saltpetre name = "saltpetre" - id = "saltpetre" - results = list("saltpetre" = 3) - required_reagents = list("potassium" = 1, "nitrogen" = 1, "oxygen" = 3) + id = /datum/reagent/saltpetre + results = list(/datum/reagent/saltpetre = 3) + required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/nitrogen = 1, /datum/reagent/oxygen = 3) /datum/chemical_reaction/lye name = "lye" - id = "lye" - results = list("lye" = 3) - required_reagents = list("sodium" = 1, "hydrogen" = 1, "oxygen" = 1) + id = /datum/reagent/lye + results = list(/datum/reagent/lye = 3) + required_reagents = list(/datum/reagent/sodium = 1, /datum/reagent/hydrogen = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/lye2 name = "lye" - id = "lye" - results = list("lye" = 2) - required_reagents = list("ash" = 1, "water" = 1, "carbon" = 1) + id = "lye2" + results = list(/datum/reagent/lye = 2) + required_reagents = list(/datum/reagent/ash = 1, /datum/reagent/water = 1, /datum/reagent/carbon = 1) /datum/chemical_reaction/royal_bee_jelly name = "royal bee jelly" - id = "royal_bee_jelly" - results = list("royal_bee_jelly" = 5) - required_reagents = list("mutagen" = 10, "honey" = 40) + id = /datum/reagent/royal_bee_jelly + results = list(/datum/reagent/royal_bee_jelly = 5) + required_reagents = list(/datum/reagent/toxin/mutagen = 10, /datum/reagent/consumable/honey = 40) /datum/chemical_reaction/laughter name = "laughter" - id = "laughter" - results = list("laughter" = 10) // Fuck it. I'm not touching this one. - required_reagents = list("sugar" = 1, "banana" = 1) + id = /datum/reagent/consumable/laughter + results = list(/datum/reagent/consumable/laughter = 10) // Fuck it. I'm not touching this one. + required_reagents = list(/datum/reagent/consumable/sugar = 1, /datum/reagent/consumable/banana = 1) /datum/chemical_reaction/plastic_polymers name = "plastic polymers" id = "plastic_polymers" - required_reagents = list("oil" = 5, "sacid" = 2, "ash" = 3) + required_reagents = list(/datum/reagent/oil = 5, /datum/reagent/toxin/acid = 2, /datum/reagent/ash = 3) required_temp = 374 //lazily consistent with soap & other crafted objects generically created with heat. /datum/chemical_reaction/plastic_polymers/on_reaction(datum/reagents/holder, created_volume) @@ -604,104 +610,104 @@ /datum/chemical_reaction/pax name = "pax" - id = "pax" - results = list("pax" = 3) - required_reagents = list("mindbreaker" = 1, "synaptizine" = 1, "water" = 1) + id = /datum/reagent/pax + results = list(/datum/reagent/pax = 3) + required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/medicine/synaptizine = 1, /datum/reagent/water = 1) /datum/chemical_reaction/cat name = "felined mutation toxic" - id = "cats" - results = list("felinidmutationtoxin" = 1) - required_reagents = list("mindbreaker" = 1, "ammonia" = 1, "water" = 1, "aphro" = 10, "stablemutationtoxin" = 1) // Maybe aphro+ if it becomes a shitty meme + id = /datum/reagent/mutationtoxin/felinid + results = list(/datum/reagent/mutationtoxin/felinid = 1) + required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/ammonia = 1, /datum/reagent/water = 1, /datum/reagent/drug/aphrodisiac = 10, /datum/reagent/mutationtoxin = 1) // Maybe aphro+ if it becomes a shitty meme required_temp = 450 /datum/chemical_reaction/moff - name = "moth mutation toxic" - id = "moffs" - results = list("mothmutationtoxin" = 1) - required_reagents = list("liquid_dark_matter" = 2, "ammonia" = 5, "lithium" = 1, "stablemutationtoxin" = 1) + name = "insect mutation toxic" + id = /datum/reagent/mutationtoxin/insect + results = list(/datum/reagent/mutationtoxin/insect = 1) + required_reagents = list(/datum/reagent/liquid_dark_matter = 2, /datum/reagent/ammonia = 5, /datum/reagent/lithium = 1, /datum/reagent/mutationtoxin = 1) required_temp = 320 /datum/chemical_reaction/notlight //Harder to make do to it being a hard race to play name = "shadow muatatuin toxic" - id = "notlight" - results = list("shadowmutationtoxin" = 1) - required_reagents = list("liquid_dark_matter" = 5, "synaptizine" = 10, "oculine" = 10, "stablemutationtoxin" = 1) + id = /datum/reagent/mutationtoxin/shadow + results = list(/datum/reagent/mutationtoxin/shadow = 1) + required_reagents = list(/datum/reagent/liquid_dark_matter = 5, /datum/reagent/medicine/synaptizine = 10, /datum/reagent/medicine/oculine = 10, /datum/reagent/mutationtoxin = 1) required_temp = 600 // Liquid Carpets /datum/chemical_reaction/carpet name = "carpet" - id = "carpet" - results = list("carpet" = 2) - required_reagents = list("space_drugs" = 1, "blood" = 1) + id = /datum/reagent/carpet + results = list(/datum/reagent/carpet = 2) + required_reagents = list(/datum/reagent/drug/space_drugs = 1, /datum/reagent/blood = 1) /datum/chemical_reaction/carpet/black name = "liquid black carpet" - id = "blackcarpet" - results = list("blackcarpet" = 2) - required_reagents = list("carpet" = 1, "carbon" = 1) + id = /datum/reagent/carpet/black + results = list(/datum/reagent/carpet/black = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/carbon = 1) /datum/chemical_reaction/carpet/blackred name = "liquid red black carpet" - id = "blackredcarpet" - results = list("blackredcarpet" = 2) - required_reagents = list("carpet" = 1, "charcoal" = 1) + id = /datum/reagent/carpet/blackred + results = list(/datum/reagent/carpet/blackred = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/medicine/charcoal = 1) /datum/chemical_reaction/carpet/monochrome name = "liquid monochrome carpet" - id = "monochromecarpet" - results = list("monochromecarpet" = 2) - required_reagents = list("carpet" = 1, "oil" = 1) + id = /datum/reagent/carpet/monochrome + results = list(/datum/reagent/carpet/monochrome = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/oil = 1) /datum/chemical_reaction/carpet/blue name = "liquid blue carpet" - id = "bluecarpet" - results = list("bluecarpet" = 2) - required_reagents = list("carpet" = 1, "tonic" = 1) + id = /datum/reagent/carpet/blue + results = list(/datum/reagent/carpet/blue = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/consumable/tonic = 1) /datum/chemical_reaction/carpet/cyan name = "liquid cyan carpet" - id = "cyancarpet" - results = list("cyancarpet" = 2) - required_reagents = list("carpet" = 1, "ice" = 1) + id = /datum/reagent/carpet/cyan + results = list(/datum/reagent/carpet/cyan = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/consumable/ice = 1) /datum/chemical_reaction/carpet/green name = "liquid green carpet" - id = "greencarpet" - results = list("greencarpet" = 2) - required_reagents = list("carpet" = 1, "sacid" = 1) + id = /datum/reagent/carpet/green + results = list(/datum/reagent/carpet/green = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/toxin/acid = 1) /datum/chemical_reaction/carpet/orange name = "liquid orange carpet" - id = "orangecarpet" - results = list("orangecarpet" = 2) - required_reagents = list("carpet" = 1, "orangejuice" = 1) + id = /datum/reagent/carpet/orange + results = list(/datum/reagent/carpet/orange = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/consumable/orangejuice = 1) /datum/chemical_reaction/carpet/purple name = "liquid purple carpet" - id = "purplecarpet" - results = list("purplecarpet" = 2) - required_reagents = list("carpet" = 1, "stable_plasma" = 1) + id = /datum/reagent/carpet/purple + results = list(/datum/reagent/carpet/purple = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/stable_plasma = 1) /datum/chemical_reaction/carpet/red name = "liquid red carpet" - id = "redcarpet" - results = list("redcarpet" = 2) - required_reagents = list("carpet" = 1, "welding_fuel" = 1) + id = /datum/reagent/carpet/red + results = list(/datum/reagent/carpet/red = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/fuel = 1) /datum/chemical_reaction/carpet/royalblack name = "liquid royal black carpet" - id = "royalblackcarpet" - results = list("royalblackcarpet" = 2) - required_reagents = list("carpet" = 1, "blackpepper" = 1) + id = /datum/reagent/carpet/royalblack + results = list(/datum/reagent/carpet/royalblack = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/consumable/blackpepper = 1) /datum/chemical_reaction/carpet/royalblue name = "liquid royal blue carpet" - id = "royalbluecarpet" - results = list("royalbluecarpet" = 2) - required_reagents = list("carpet" = 1, "clonexadone" = 1) + id = /datum/reagent/carpet/royalblue + results = list(/datum/reagent/carpet/royalblue = 2) + required_reagents = list(/datum/reagent/carpet = 1, /datum/reagent/medicine/clonexadone = 1) /datum/chemical_reaction/synth_blood name = "Synthetic Blood" diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index b29a1c68..e61d520e 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -27,21 +27,21 @@ /datum/chemical_reaction/reagent_explosion/nitroglycerin name = "Nitroglycerin" - id = "nitroglycerin" - results = list("nitroglycerin" = 2) - required_reagents = list("glycerol" = 1, "facid" = 1, "sacid" = 1) + id = /datum/reagent/nitroglycerin + results = list(/datum/reagent/nitroglycerin = 2) + required_reagents = list(/datum/reagent/glycerol = 1, /datum/reagent/toxin/acid/fluacid = 1, /datum/reagent/toxin/acid = 1) strengthdiv = 2 /datum/chemical_reaction/reagent_explosion/nitroglycerin/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return - holder.remove_reagent("nitroglycerin", created_volume*2) + holder.remove_reagent(/datum/reagent/nitroglycerin, created_volume*2) ..() /datum/chemical_reaction/reagent_explosion/nitroglycerin_explosion name = "Nitroglycerin explosion" id = "nitroglycerin_explosion" - required_reagents = list("nitroglycerin" = 1) + required_reagents = list(/datum/reagent/nitroglycerin = 1) required_temp = 474 strengthdiv = 2 @@ -49,13 +49,13 @@ /datum/chemical_reaction/reagent_explosion/potassium_explosion name = "Explosion" id = "potassium_explosion" - required_reagents = list("water" = 1, "potassium" = 1) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/potassium = 1) strengthdiv = 10 /datum/chemical_reaction/reagent_explosion/potassium_explosion/holyboom name = "Holy Explosion" id = "holyboom" - required_reagents = list("holywater" = 1, "potassium" = 1) + required_reagents = list(/datum/reagent/water/holywater = 1, /datum/reagent/potassium = 1) /datum/chemical_reaction/reagent_explosion/potassium_explosion/holyboom/on_reaction(datum/reagents/holder, created_volume) var/turf/T = get_turf(holder.my_atom) @@ -84,14 +84,14 @@ /datum/chemical_reaction/blackpowder name = "Black Powder" - id = "blackpowder" - results = list("blackpowder" = 3) - required_reagents = list("saltpetre" = 1, "charcoal" = 1, "sulfur" = 1) + id = /datum/reagent/blackpowder + results = list(/datum/reagent/blackpowder = 3) + required_reagents = list(/datum/reagent/saltpetre = 1, /datum/reagent/medicine/charcoal = 1, /datum/reagent/sulfur = 1) /datum/chemical_reaction/reagent_explosion/blackpowder_explosion name = "Black Powder Kaboom" id = "blackpowder_explosion" - required_reagents = list("blackpowder" = 1) + required_reagents = list(/datum/reagent/blackpowder = 1) required_temp = 474 strengthdiv = 6 modifier = 1 @@ -104,14 +104,14 @@ /datum/chemical_reaction/thermite name = "Thermite" - id = "thermite" - results = list("thermite" = 3) - required_reagents = list("aluminium" = 1, "iron" = 1, "oxygen" = 1) + id = /datum/reagent/thermite + results = list(/datum/reagent/thermite = 3) + required_reagents = list(/datum/reagent/aluminium = 1, /datum/reagent/iron = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/emp_pulse name = "EMP Pulse" id = "emp_pulse" - required_reagents = list("uranium" = 1, "iron" = 1) // Yes, laugh, it's the best recipe I could think of that makes a little bit of sense + required_reagents = list(/datum/reagent/uranium = 1, /datum/reagent/iron = 1) // Yes, laugh, it's the best recipe I could think of that makes a little bit of sense /datum/chemical_reaction/emp_pulse/on_reaction(datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) @@ -124,7 +124,7 @@ /datum/chemical_reaction/beesplosion name = "Bee Explosion" id = "beesplosion" - required_reagents = list("honey" = 1, "strange_reagent" = 1, "radium" = 1) + required_reagents = list(/datum/reagent/consumable/honey = 1, /datum/reagent/medicine/strange_reagent = 1, /datum/reagent/radium = 1) /datum/chemical_reaction/beesplosion/on_reaction(datum/reagents/holder, created_volume) var/location = holder.my_atom.drop_location() @@ -135,7 +135,7 @@ var/list/beeagents = list() for(var/X in holder.reagent_list) var/datum/reagent/R = X - if(required_reagents[R.id]) + if(required_reagents[R.type]) continue beeagents += R var/bee_amount = round(created_volume * 0.2) @@ -147,15 +147,15 @@ /datum/chemical_reaction/stabilizing_agent name = "stabilizing_agent" - id = "stabilizing_agent" - results = list("stabilizing_agent" = 3) - required_reagents = list("iron" = 1, "oxygen" = 1, "hydrogen" = 1) + id = /datum/reagent/stabilizing_agent + results = list(/datum/reagent/stabilizing_agent = 3) + required_reagents = list(/datum/reagent/iron = 1, /datum/reagent/oxygen = 1, /datum/reagent/hydrogen = 1) /datum/chemical_reaction/clf3 name = "Chlorine Trifluoride" - id = "clf3" - results = list("clf3" = 4) - required_reagents = list("chlorine" = 1, "fluorine" = 3) + id = /datum/reagent/clf3 + results = list(/datum/reagent/clf3 = 4) + required_reagents = list(/datum/reagent/chlorine = 1, /datum/reagent/fluorine = 3) required_temp = 424 /datum/chemical_reaction/clf3/on_reaction(datum/reagents/holder, created_volume) @@ -168,7 +168,7 @@ name = "Meth explosion" id = "methboom1" required_temp = 380 //slightly above the meth mix time. - required_reagents = list("methamphetamine" = 1) + required_reagents = list(/datum/reagent/drug/methamphetamine = 1) strengthdiv = 6 modifier = 1 mob_react = FALSE @@ -182,19 +182,19 @@ /datum/chemical_reaction/reagent_explosion/methsplosion/methboom2 id = "methboom2" - required_reagents = list("diethylamine" = 1, "iodine" = 1, "phosphorus" = 1, "hydrogen" = 1) //diethylamine is often left over from mixing the ephedrine. + required_reagents = list(/datum/reagent/diethylamine = 1, /datum/reagent/iodine = 1, /datum/reagent/phosphorus = 1, /datum/reagent/hydrogen = 1) //diethylamine is often left over from mixing the ephedrine. required_temp = 300 //room temperature, chilling it even a little will prevent the explosion /datum/chemical_reaction/sorium name = "Sorium" - id = "sorium" - results = list("sorium" = 4) - required_reagents = list("mercury" = 1, "oxygen" = 1, "nitrogen" = 1, "carbon" = 1) + id = /datum/reagent/sorium + results = list(/datum/reagent/sorium = 4) + required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/oxygen = 1, /datum/reagent/nitrogen = 1, /datum/reagent/carbon = 1) /datum/chemical_reaction/sorium/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return - holder.remove_reagent("sorium", created_volume*4) + holder.remove_reagent(/datum/reagent/sorium, created_volume*4) var/turf/T = get_turf(holder.my_atom) var/range = CLAMP(sqrt(created_volume*4), 1, 6) goonchem_vortex(T, 1, range) @@ -202,7 +202,7 @@ /datum/chemical_reaction/sorium_vortex name = "sorium_vortex" id = "sorium_vortex" - required_reagents = list("sorium" = 1) + required_reagents = list(/datum/reagent/sorium = 1) required_temp = 474 /datum/chemical_reaction/sorium_vortex/on_reaction(datum/reagents/holder, created_volume) @@ -212,14 +212,14 @@ /datum/chemical_reaction/liquid_dark_matter name = "Liquid Dark Matter" - id = "liquid_dark_matter" - results = list("liquid_dark_matter" = 3) - required_reagents = list("stable_plasma" = 1, "radium" = 1, "carbon" = 1) + id = /datum/reagent/liquid_dark_matter + results = list(/datum/reagent/liquid_dark_matter = 3) + required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/radium = 1, /datum/reagent/carbon = 1) /datum/chemical_reaction/liquid_dark_matter/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return - holder.remove_reagent("liquid_dark_matter", created_volume*3) + holder.remove_reagent(/datum/reagent/liquid_dark_matter, created_volume*3) var/turf/T = get_turf(holder.my_atom) var/range = CLAMP(sqrt(created_volume*3), 1, 6) goonchem_vortex(T, 0, range) @@ -227,7 +227,7 @@ /datum/chemical_reaction/ldm_vortex name = "LDM Vortex" id = "ldm_vortex" - required_reagents = list("liquid_dark_matter" = 1) + required_reagents = list(/datum/reagent/liquid_dark_matter = 1) required_temp = 474 /datum/chemical_reaction/ldm_vortex/on_reaction(datum/reagents/holder, created_volume) @@ -237,12 +237,12 @@ /datum/chemical_reaction/flash_powder name = "Flash powder" - id = "flash_powder" - results = list("flash_powder" = 3) - required_reagents = list("aluminium" = 1, "potassium" = 1, "sulfur" = 1 ) + id = /datum/reagent/flash_powder + results = list(/datum/reagent/flash_powder = 3) + required_reagents = list(/datum/reagent/aluminium = 1, /datum/reagent/potassium = 1, /datum/reagent/sulfur = 1 ) /datum/chemical_reaction/flash_powder/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return var/location = get_turf(holder.my_atom) do_sparks(2, TRUE, location) @@ -256,12 +256,12 @@ C.Knockdown(60) else C.Stun(100) - holder.remove_reagent("flash_powder", created_volume*3) + holder.remove_reagent(/datum/reagent/flash_powder, created_volume*3) /datum/chemical_reaction/flash_powder_flash name = "Flash powder activation" id = "flash_powder_flash" - required_reagents = list("flash_powder" = 1) + required_reagents = list(/datum/reagent/flash_powder = 1) required_temp = 374 /datum/chemical_reaction/flash_powder_flash/on_reaction(datum/reagents/holder, created_volume) @@ -280,14 +280,14 @@ /datum/chemical_reaction/smoke_powder name = "smoke_powder" - id = "smoke_powder" - results = list("smoke_powder" = 3) - required_reagents = list("potassium" = 1, "sugar" = 1, "phosphorus" = 1) + id = /datum/reagent/smoke_powder + results = list(/datum/reagent/smoke_powder = 3) + required_reagents = list(/datum/reagent/potassium = 1, /datum/reagent/consumable/sugar = 1, /datum/reagent/phosphorus = 1) /datum/chemical_reaction/smoke_powder/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return - holder.remove_reagent("smoke_powder", created_volume*3) + holder.remove_reagent(/datum/reagent/smoke_powder, created_volume*3) var/smoke_radius = round(sqrt(created_volume * 1.5), 1) var/location = get_turf(holder.my_atom) var/datum/effect_system/smoke_spread/chem/S = new @@ -302,7 +302,7 @@ /datum/chemical_reaction/smoke_powder_smoke name = "smoke_powder_smoke" id = "smoke_powder_smoke" - required_reagents = list("smoke_powder" = 1) + required_reagents = list(/datum/reagent/smoke_powder = 1) required_temp = 374 mob_react = FALSE @@ -320,14 +320,14 @@ /datum/chemical_reaction/sonic_powder name = "sonic_powder" - id = "sonic_powder" - results = list("sonic_powder" = 3) - required_reagents = list("oxygen" = 1, "cola" = 1, "phosphorus" = 1) + id = /datum/reagent/sonic_powder + results = list(/datum/reagent/sonic_powder = 3) + required_reagents = list(/datum/reagent/oxygen = 1, /datum/reagent/consumable/space_cola = 1, /datum/reagent/phosphorus = 1) /datum/chemical_reaction/sonic_powder/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return - holder.remove_reagent("sonic_powder", created_volume*3) + holder.remove_reagent(/datum/reagent/sonic_powder, created_volume*3) var/location = get_turf(holder.my_atom) playsound(location, 'sound/effects/bang.ogg', 25, 1) for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/3, location)) @@ -336,7 +336,7 @@ /datum/chemical_reaction/sonic_powder_deafen name = "sonic_powder_deafen" id = "sonic_powder_deafen" - required_reagents = list("sonic_powder" = 1) + required_reagents = list(/datum/reagent/sonic_powder = 1) required_temp = 374 /datum/chemical_reaction/sonic_powder_deafen/on_reaction(datum/reagents/holder, created_volume) @@ -347,12 +347,12 @@ /datum/chemical_reaction/phlogiston name = "phlogiston" - id = "phlogiston" - results = list("phlogiston" = 3) - required_reagents = list("phosphorus" = 1, "sacid" = 1, "stable_plasma" = 1) + id = /datum/reagent/phlogiston + results = list(/datum/reagent/phlogiston = 3) + required_reagents = list(/datum/reagent/phosphorus = 1, /datum/reagent/toxin/acid = 1, /datum/reagent/stable_plasma = 1) /datum/chemical_reaction/phlogiston/on_reaction(datum/reagents/holder, created_volume) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return var/turf/open/T = get_turf(holder.my_atom) if(istype(T)) @@ -362,15 +362,15 @@ /datum/chemical_reaction/napalm name = "Napalm" - id = "napalm" - results = list("napalm" = 3) - required_reagents = list("oil" = 1, "welding_fuel" = 1, "ethanol" = 1 ) + id = /datum/reagent/napalm + results = list(/datum/reagent/napalm = 3) + required_reagents = list(/datum/reagent/oil = 1, /datum/reagent/fuel = 1, /datum/reagent/consumable/ethanol = 1 ) /datum/chemical_reaction/cryostylane name = "cryostylane" - id = "cryostylane" - results = list("cryostylane" = 3) - required_reagents = list("water" = 1, "stable_plasma" = 1, "nitrogen" = 1) + id = /datum/reagent/cryostylane + results = list(/datum/reagent/cryostylane = 3) + required_reagents = list(/datum/reagent/water = 1, /datum/reagent/stable_plasma = 1, /datum/reagent/nitrogen = 1) /datum/chemical_reaction/cryostylane/on_reaction(datum/reagents/holder, created_volume) holder.chem_temp = 20 // cools the fuck down @@ -379,8 +379,8 @@ /datum/chemical_reaction/cryostylane_oxygen name = "ephemeral cryostylane reaction" id = "cryostylane_oxygen" - results = list("cryostylane" = 1) - required_reagents = list("cryostylane" = 1, "oxygen" = 1) + results = list(/datum/reagent/cryostylane = 1) + required_reagents = list(/datum/reagent/cryostylane = 1, /datum/reagent/oxygen = 1) mob_react = FALSE /datum/chemical_reaction/cryostylane_oxygen/on_reaction(datum/reagents/holder, created_volume) @@ -389,8 +389,8 @@ /datum/chemical_reaction/pyrosium_oxygen name = "ephemeral pyrosium reaction" id = "pyrosium_oxygen" - results = list("pyrosium" = 1) - required_reagents = list("pyrosium" = 1, "oxygen" = 1) + results = list(/datum/reagent/pyrosium = 1) + required_reagents = list(/datum/reagent/pyrosium = 1, /datum/reagent/oxygen = 1) mob_react = FALSE /datum/chemical_reaction/pyrosium_oxygen/on_reaction(datum/reagents/holder, created_volume) @@ -398,9 +398,9 @@ /datum/chemical_reaction/pyrosium name = "pyrosium" - id = "pyrosium" - results = list("pyrosium" = 3) - required_reagents = list("stable_plasma" = 1, "radium" = 1, "phosphorus" = 1) + id = /datum/reagent/pyrosium + results = list(/datum/reagent/pyrosium = 3) + required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/radium = 1, /datum/reagent/phosphorus = 1) /datum/chemical_reaction/pyrosium/on_reaction(datum/reagents/holder, created_volume) holder.chem_temp = 20 // also cools the fuck down @@ -408,23 +408,23 @@ /datum/chemical_reaction/teslium name = "Teslium" - id = "teslium" - results = list("teslium" = 3) - required_reagents = list("stable_plasma" = 1, "silver" = 1, "blackpowder" = 1) + id = /datum/reagent/teslium + results = list(/datum/reagent/teslium = 3) + required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/silver = 1, /datum/reagent/blackpowder = 1) mix_message = "A jet of sparks flies from the mixture as it merges into a flickering slurry." required_temp = 400 /datum/chemical_reaction/energized_jelly name = "Energized Jelly" - id = "energized_jelly" - results = list("energized_jelly" = 2) - required_reagents = list("slimejelly" = 1, "teslium" = 1) + id = /datum/reagent/teslium/energized_jelly + results = list(/datum/reagent/teslium/energized_jelly = 2) + required_reagents = list(/datum/reagent/toxin/slimejelly = 1, /datum/reagent/teslium = 1) mix_message = "The slime jelly starts glowing intermittently." /datum/chemical_reaction/reagent_explosion/teslium_lightning name = "Teslium Destabilization" id = "teslium_lightning" - required_reagents = list("teslium" = 1, "water" = 1) + required_reagents = list(/datum/reagent/teslium = 1, /datum/reagent/water = 1) strengthdiv = 100 modifier = -100 noexplosion = TRUE @@ -453,29 +453,29 @@ /datum/chemical_reaction/reagent_explosion/teslium_lightning/heat id = "teslium_lightning2" required_temp = 474 - required_reagents = list("teslium" = 1) + required_reagents = list(/datum/reagent/teslium = 1) /datum/chemical_reaction/reagent_explosion/nitrous_oxide name = "N2O explosion" id = "n2o_explosion" - required_reagents = list("nitrous_oxide" = 1) + required_reagents = list(/datum/reagent/nitrous_oxide = 1) strengthdiv = 7 required_temp = 575 modifier = 1 /datum/chemical_reaction/firefighting_foam name = "Firefighting Foam" - id = "firefighting_foam" - results = list("firefighting_foam" = 3) - required_reagents = list("stabilizing_agent" = 1,"fluorosurfactant" = 1,"carbon" = 1) + id = /datum/reagent/firefighting_foam + results = list(/datum/reagent/firefighting_foam = 3) + required_reagents = list(/datum/reagent/stabilizing_agent = 1, /datum/reagent/fluorosurfactant = 1,/datum/reagent/carbon = 1) required_temp = 200 is_cold_recipe = 1 /datum/chemical_reaction/reagent_explosion/lingblood name = "Changeling Blood Reaction" id = "ling_blood_reaction" - results = list("ash" = 1) - required_reagents = list("blood" = 1) + results = list(/datum/reagent/ash = 1) + required_reagents = list(/datum/reagent/blood = 1) strengthdiv = 4 //The explosion should be somewhat strong if a full 15u is heated within a syringe. !!fun!! required_temp = 666 special_react = TRUE diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index f5ed124f..e131dfd7 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -16,7 +16,7 @@ /datum/chemical_reaction/slime/slimespawn name = "Slime Spawn" id = "m_spawn" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/grey required_other = TRUE @@ -28,15 +28,15 @@ /datum/chemical_reaction/slime/slimeinaprov name = "Slime epinephrine" id = "m_inaprov" - results = list("epinephrine" = 3) - required_reagents = list("water" = 5) + results = list(/datum/reagent/medicine/epinephrine = 3) + required_reagents = list(/datum/reagent/water = 5) required_other = TRUE required_container = /obj/item/slime_extract/grey /datum/chemical_reaction/slime/slimemonkey name = "Slime Monkey" id = "m_monkey" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/grey required_other = TRUE @@ -48,25 +48,25 @@ //Green /datum/chemical_reaction/slime/slimemutate name = "Mutation Toxin" - id = "slimetoxin" - results = list("slime_toxin" = 1) - required_reagents = list("plasma" = 1) + id = /datum/reagent/slime_toxin + results = list(/datum/reagent/slime_toxin = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_other = TRUE required_container = /obj/item/slime_extract/green /datum/chemical_reaction/slime/slimehuman name = "Human Mutation Toxin" - id = "humanmuttoxin" - results = list("stablemutationtoxin" = 1) - required_reagents = list("blood" = 1) + id = /datum/reagent/mutationtoxin + results = list(/datum/reagent/mutationtoxin = 1) + required_reagents = list(/datum/reagent/blood = 1) required_other = TRUE required_container = /obj/item/slime_extract/green /datum/chemical_reaction/slime/slimelizard name = "Lizard Mutation Toxin" - id = "lizardmuttoxin" - results = list("lizardmutationtoxin" = 1) - required_reagents = list("radium" = 1) + id = /datum/reagent/mutationtoxin/lizard + results = list(/datum/reagent/mutationtoxin/lizard = 1) + required_reagents = list(/datum/reagent/radium = 1) required_other = TRUE required_container = /obj/item/slime_extract/green @@ -74,7 +74,7 @@ /datum/chemical_reaction/slime/slimemetal name = "Slime Metal" id = "m_metal" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/metal required_other = TRUE @@ -87,7 +87,7 @@ /datum/chemical_reaction/slime/slimeglass name = "Slime Glass" id = "m_glass" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_container = /obj/item/slime_extract/metal required_other = TRUE @@ -101,7 +101,7 @@ /datum/chemical_reaction/slime/slimemobspawn name = "Slime Crit" id = "m_tele" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/gold required_other = TRUE deletes_extract = FALSE //we do delete, but we don't do so instantly @@ -121,7 +121,7 @@ /datum/chemical_reaction/slime/slimemobspawn/lesser name = "Slime Crit Lesser" id = "m_tele3" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) /datum/chemical_reaction/slime/slimemobspawn/lesser/summon_mobs(datum/reagents/holder, turf/T) T.visible_message("The slime extract begins to vibrate violently!") @@ -130,7 +130,7 @@ /datum/chemical_reaction/slime/slimemobspawn/friendly name = "Slime Crit Friendly" id = "m_tele5" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) /datum/chemical_reaction/slime/slimemobspawn/friendly/summon_mobs(datum/reagents/holder, turf/T) T.visible_message("The slime extract begins to vibrate adorably!") @@ -140,7 +140,7 @@ /datum/chemical_reaction/slime/slimebork name = "Slime Bork" id = "m_tele2" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/silver required_other = TRUE @@ -172,7 +172,7 @@ /datum/chemical_reaction/slime/slimebork/drinks name = "Slime Bork 2" id = "m_tele4" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) /datum/chemical_reaction/slime/slimebork/drinks/getbork() return get_random_drink() @@ -181,15 +181,15 @@ /datum/chemical_reaction/slime/slimefrost name = "Slime Frost Oil" id = "m_frostoil" - results = list("frostoil" = 10) - required_reagents = list("plasma" = 1) + results = list(/datum/reagent/consumable/frostoil = 10) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/blue required_other = TRUE /datum/chemical_reaction/slime/slimestabilizer name = "Slime Stabilizer" id = "m_slimestabilizer" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/blue required_other = TRUE @@ -200,8 +200,8 @@ /datum/chemical_reaction/slime/slimefoam name = "Slime Foam" id = "m_foam" - results = list("fluorosurfactant" = 20, "water" = 20) - required_reagents = list("water" = 5) + results = list(/datum/reagent/fluorosurfactant = 20, /datum/reagent/water = 20) + required_reagents = list(/datum/reagent/water = 5) required_container = /obj/item/slime_extract/blue required_other = TRUE @@ -209,7 +209,7 @@ /datum/chemical_reaction/slime/slimefreeze name = "Slime Freeze" id = "m_freeze" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/darkblue required_other = TRUE deletes_extract = FALSE @@ -233,7 +233,7 @@ /datum/chemical_reaction/slime/slimefireproof name = "Slime Fireproof" id = "m_fireproof" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_container = /obj/item/slime_extract/darkblue required_other = TRUE @@ -245,15 +245,15 @@ /datum/chemical_reaction/slime/slimecasp name = "Slime Capsaicin Oil" id = "m_capsaicinoil" - results = list("capsaicin" = 10) - required_reagents = list("blood" = 1) + results = list(/datum/reagent/consumable/capsaicin = 10) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/orange required_other = TRUE /datum/chemical_reaction/slime/slimefire name = "Slime fire" id = "m_fire" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/orange required_other = TRUE deletes_extract = FALSE @@ -277,8 +277,8 @@ /datum/chemical_reaction/slime/slimesmoke name = "Slime Smoke" id = "m_smoke" - results = list("phosphorus" = 10, "potassium" = 10, "sugar" = 10) - required_reagents = list("water" = 5) + results = list(/datum/reagent/phosphorus = 10, /datum/reagent/potassium = 10, /datum/reagent/consumable/sugar = 10) + required_reagents = list(/datum/reagent/water = 5) required_container = /obj/item/slime_extract/orange required_other = TRUE @@ -286,7 +286,7 @@ /datum/chemical_reaction/slime/slimeoverload name = "Slime EMP" id = "m_emp" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/yellow required_other = TRUE @@ -297,7 +297,7 @@ /datum/chemical_reaction/slime/slimecell name = "Slime Powercell" id = "m_cell" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/yellow required_other = TRUE @@ -308,7 +308,7 @@ /datum/chemical_reaction/slime/slimeglow name = "Slime Glow" id = "m_glow" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_container = /obj/item/slime_extract/yellow required_other = TRUE @@ -322,7 +322,7 @@ /datum/chemical_reaction/slime/slimepsteroid name = "Slime Steroid" id = "m_steroid" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/purple required_other = TRUE @@ -333,8 +333,8 @@ /datum/chemical_reaction/slime/slimeregen name = "Slime Regen" id = "m_regen" - results = list("regen_jelly" = 5) - required_reagents = list("blood" = 1) + results = list(/datum/reagent/medicine/regen_jelly = 5) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/purple required_other = TRUE @@ -342,7 +342,7 @@ /datum/chemical_reaction/slime/slimeplasma name = "Slime Plasma" id = "m_plasma" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/darkpurple required_other = TRUE @@ -354,7 +354,7 @@ /datum/chemical_reaction/slime/slimemutator name = "Slime Mutator" id = "m_slimemutator" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/red required_other = TRUE @@ -365,7 +365,7 @@ /datum/chemical_reaction/slime/slimebloodlust name = "Bloodlust" id = "m_bloodlust" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/red required_other = TRUE @@ -383,7 +383,7 @@ /datum/chemical_reaction/slime/slimespeed name = "Slime Speed" id = "m_speed" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_container = /obj/item/slime_extract/red required_other = TRUE @@ -395,7 +395,7 @@ /datum/chemical_reaction/slime/docility name = "Docility Potion" id = "m_potion" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/pink required_other = TRUE @@ -406,7 +406,7 @@ /datum/chemical_reaction/slime/gender name = "Gender Potion" id = "m_gender" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/pink required_other = TRUE @@ -417,9 +417,9 @@ //Black /datum/chemical_reaction/slime/slimemutate2 name = "Advanced Mutation Toxin" - id = "mutationtoxin2" - results = list("amutationtoxin" = 1) - required_reagents = list("plasma" = 1) + id = /datum/reagent/aslimetoxin + results = list(/datum/reagent/aslimetoxin = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_other = TRUE required_container = /obj/item/slime_extract/black @@ -427,7 +427,7 @@ /datum/chemical_reaction/slime/slimeexplosion name = "Slime Explosion" id = "m_explosion" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/oil required_other = TRUE deletes_extract = FALSE @@ -456,8 +456,8 @@ /datum/chemical_reaction/slime/slimecornoil name = "Slime Corn Oil" id = "m_cornoil" - results = list("cornoil" = 10) - required_reagents = list("blood" = 1) + results = list(/datum/reagent/consumable/cornoil = 10) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/oil required_other = TRUE @@ -466,7 +466,7 @@ name = "Slime Potion 2" id = "m_potion2" required_container = /obj/item/slime_extract/lightpink - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_other = TRUE /datum/chemical_reaction/slime/slimepotion2/on_reaction(datum/reagents/holder) @@ -477,7 +477,7 @@ name = "Renaming Potion" id = "m_renaming_potion" required_container = /obj/item/slime_extract/lightpink - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_other = TRUE /datum/chemical_reaction/slime/renaming/on_reaction(datum/reagents/holder) @@ -489,7 +489,7 @@ /datum/chemical_reaction/slime/adamantine name = "Adamantine" id = "adamantine" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/adamantine required_other = TRUE @@ -501,7 +501,7 @@ /datum/chemical_reaction/slime/slimefloor2 name = "Bluespace Floor" id = "m_floor2" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/bluespace required_other = TRUE @@ -513,7 +513,7 @@ /datum/chemical_reaction/slime/slimecrystal name = "Slime Crystal" id = "m_crystal" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/bluespace required_other = TRUE @@ -525,7 +525,7 @@ /datum/chemical_reaction/slime/slimeradio name = "Slime Radio" id = "m_radio" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_container = /obj/item/slime_extract/bluespace required_other = TRUE @@ -537,7 +537,7 @@ /datum/chemical_reaction/slime/slimepsteroid2 name = "Slime Steroid 2" id = "m_steroid2" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/cerulean required_other = TRUE @@ -548,7 +548,7 @@ /datum/chemical_reaction/slime/slime_territory name = "Slime Territory" id = "s_territory" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/cerulean required_other = TRUE @@ -560,7 +560,7 @@ /datum/chemical_reaction/slime/slimestop name = "Slime Stop" id = "m_stop" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/sepia required_other = TRUE @@ -573,7 +573,7 @@ /datum/chemical_reaction/slime/slimecamera name = "Slime Camera" id = "m_camera" - required_reagents = list("water" = 1) + required_reagents = list(/datum/reagent/water = 1) required_container = /obj/item/slime_extract/sepia required_other = TRUE @@ -585,7 +585,7 @@ /datum/chemical_reaction/slime/slimefloor name = "Sepia Floor" id = "m_floor" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/sepia required_other = TRUE @@ -597,7 +597,7 @@ /datum/chemical_reaction/slime/slimepaint name = "Slime Paint" id = "s_paint" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_container = /obj/item/slime_extract/pyrite required_other = TRUE @@ -609,7 +609,7 @@ /datum/chemical_reaction/slime/slimecrayon name = "Slime Crayon" id = "s_crayon" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_container = /obj/item/slime_extract/pyrite required_other = TRUE @@ -622,7 +622,7 @@ /datum/chemical_reaction/slime/slimeRNG name = "Random Core" id = "slimerng" - required_reagents = list("plasma" = 1) + required_reagents = list(/datum/reagent/toxin/plasma = 1) required_other = TRUE required_container = /obj/item/slime_extract/rainbow @@ -642,7 +642,7 @@ /datum/chemical_reaction/slime/slimebomb name = "Clusterblorble" id = "slimebomb" - required_reagents = list("slimejelly" = 1) + required_reagents = list(/datum/reagent/toxin/slimejelly = 1) required_other = TRUE required_container = /obj/item/slime_extract/rainbow @@ -658,7 +658,7 @@ /datum/chemical_reaction/slime/slime_transfer name = "Transfer Potion" id = "slimetransfer" - required_reagents = list("blood" = 1) + required_reagents = list(/datum/reagent/blood = 1) required_other = TRUE required_container = /obj/item/slime_extract/rainbow @@ -669,7 +669,7 @@ /datum/chemical_reaction/slime/flight_potion name = "Flight Potion" id = "flightpotion" - required_reagents = list("holywater" = 5, "uranium" = 5) + required_reagents = list(/datum/reagent/water/holywater = 5, /datum/reagent/uranium = 5) required_other = TRUE required_container = /obj/item/slime_extract/rainbow diff --git a/code/modules/reagents/chemistry/recipes/special.dm b/code/modules/reagents/chemistry/recipes/special.dm index 9dda7256..72a7f55d 100644 --- a/code/modules/reagents/chemistry/recipes/special.dm +++ b/code/modules/reagents/chemistry/recipes/special.dm @@ -123,7 +123,6 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related /datum/chemical_reaction/randomized/proc/LoadOldRecipe(recipe_data) created = text2num(recipe_data["timestamp"]) - var/req_reag = unwrap_reagent_list(recipe_data["required_reagents"]) if(!req_reag) return FALSE @@ -149,13 +148,13 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related /datum/chemical_reaction/randomized/secret_sauce name = "secret sauce creation" - id = "secretsauce" + id = /datum/reagent/consumable/secretsauce persistent = TRUE persistence_period = 7 //Reset every week randomize_container = TRUE possible_containers = list(/obj/item/reagent_containers/glass/bucket) //easy way to ensure no common conflicts randomize_req_temperature = TRUE - results = list("secret_sauce" =1) + results = list(/datum/reagent/consumable/secretsauce =1) /datum/chemical_reaction/randomized/secret_sauce/GetPossibleReagents(kind) switch(kind) diff --git a/code/modules/reagents/chemistry/recipes/toxins.dm b/code/modules/reagents/chemistry/recipes/toxins.dm index 726175a6..d9f28d21 100644 --- a/code/modules/reagents/chemistry/recipes/toxins.dm +++ b/code/modules/reagents/chemistry/recipes/toxins.dm @@ -1,128 +1,128 @@ /datum/chemical_reaction/formaldehyde name = "formaldehyde" - id = "Formaldehyde" - results = list("formaldehyde" = 3) - required_reagents = list("ethanol" = 1, "oxygen" = 1, "silver" = 1) + id = /datum/reagent/toxin/formaldehyde + results = list(/datum/reagent/toxin/formaldehyde = 3) + required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/oxygen = 1, /datum/reagent/silver = 1) required_temp = 420 /datum/chemical_reaction/fentanyl name = "fentanyl" - id = "fentanyl" - results = list("fentanyl" = 1) - required_reagents = list("space_drugs" = 1) + id = /datum/reagent/toxin/fentanyl + results = list(/datum/reagent/toxin/fentanyl = 1) + required_reagents = list(/datum/reagent/drug/space_drugs = 1) required_temp = 674 /datum/chemical_reaction/cyanide name = "Cyanide" - id = "cyanide" - results = list("cyanide" = 3) - required_reagents = list("oil" = 1, "ammonia" = 1, "oxygen" = 1) + id = /datum/reagent/toxin/cyanide + results = list(/datum/reagent/toxin/cyanide = 3) + required_reagents = list(/datum/reagent/oil = 1, /datum/reagent/ammonia = 1, /datum/reagent/oxygen = 1) required_temp = 380 /datum/chemical_reaction/itching_powder name = "Itching Powder" - id = "itching_powder" - results = list("itching_powder" = 3) - required_reagents = list("welding_fuel" = 1, "ammonia" = 1, "charcoal" = 1) + id = /datum/reagent/toxin/itching_powder + results = list(/datum/reagent/toxin/itching_powder = 3) + required_reagents = list(/datum/reagent/fuel = 1, /datum/reagent/ammonia = 1, /datum/reagent/medicine/charcoal = 1) /datum/chemical_reaction/facid name = "Fluorosulfuric acid" - id = "facid" - results = list("facid" = 4) - required_reagents = list("sacid" = 1, "fluorine" = 1, "hydrogen" = 1, "potassium" = 1) + id = /datum/reagent/toxin/acid/fluacid + results = list(/datum/reagent/toxin/acid/fluacid = 4) + required_reagents = list(/datum/reagent/toxin/acid = 1, /datum/reagent/fluorine = 1, /datum/reagent/hydrogen = 1, /datum/reagent/potassium = 1) required_temp = 380 /datum/chemical_reaction/sulfonal name = "sulfonal" - id = "sulfonal" - results = list("sulfonal" = 3) - required_reagents = list("acetone" = 1, "diethylamine" = 1, "sulfur" = 1) + id = /datum/reagent/toxin/sulfonal + results = list(/datum/reagent/toxin/sulfonal = 3) + required_reagents = list(/datum/reagent/acetone = 1, /datum/reagent/diethylamine = 1, /datum/reagent/sulfur = 1) /datum/chemical_reaction/lipolicide name = "lipolicide" - id = "lipolicide" - results = list("lipolicide" = 3) - required_reagents = list("mercury" = 1, "diethylamine" = 1, "ephedrine" = 1) + id = /datum/reagent/toxin/lipolicide + results = list(/datum/reagent/toxin/lipolicide = 3) + required_reagents = list(/datum/reagent/mercury = 1, /datum/reagent/diethylamine = 1, /datum/reagent/medicine/ephedrine = 1) /datum/chemical_reaction/mutagen name = "Unstable mutagen" - id = "mutagen" - results = list("mutagen" = 3) - required_reagents = list("radium" = 1, "phosphorus" = 1, "chlorine" = 1) + id = /datum/reagent/toxin/mutagen + results = list(/datum/reagent/toxin/mutagen = 3) + required_reagents = list(/datum/reagent/radium = 1, /datum/reagent/phosphorus = 1, /datum/reagent/chlorine = 1) /datum/chemical_reaction/lexorin name = "Lexorin" - id = "lexorin" - results = list("lexorin" = 3) - required_reagents = list("plasma" = 1, "hydrogen" = 1, "oxygen" = 1) + id = /datum/reagent/toxin/lexorin + results = list(/datum/reagent/toxin/lexorin = 3) + required_reagents = list(/datum/reagent/toxin/plasma = 1, /datum/reagent/hydrogen = 1, /datum/reagent/oxygen = 1) /datum/chemical_reaction/chloralhydrate name = "Chloral Hydrate" - id = "chloralhydrate" - results = list("chloralhydrate" = 1) - required_reagents = list("ethanol" = 1, "chlorine" = 3, "water" = 1) + id = /datum/reagent/toxin/chloralhydrate + results = list(/datum/reagent/toxin/chloralhydrate = 1) + required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/chlorine = 3, /datum/reagent/water = 1) /datum/chemical_reaction/mutetoxin //i'll just fit this in here snugly between other unfun chemicals :v name = "Mute Toxin" - id = "mutetoxin" - results = list("mutetoxin" = 2) - required_reagents = list("uranium" = 2, "water" = 1, "carbon" = 1) + id = /datum/reagent/toxin/mutetoxin + results = list(/datum/reagent/toxin/mutetoxin = 2) + required_reagents = list(/datum/reagent/uranium = 2, /datum/reagent/water = 1, /datum/reagent/carbon = 1) /datum/chemical_reaction/zombiepowder name = "Zombie Powder" - id = "zombiepowder" - results = list("zombiepowder" = 2) - required_reagents = list("carpotoxin" = 5, "morphine" = 5, "copper" = 5) - + id = /datum/reagent/toxin/zombiepowder + results = list(/datum/reagent/toxin/zombiepowder = 2) + required_reagents = list(/datum/reagent/toxin/carpotoxin = 5, /datum/reagent/medicine/morphine = 5, /datum/reagent/copper = 5) + /datum/chemical_reaction/ghoulpowder name = "Ghoul Powder" - id = "ghoulpowder" - results = list("ghoulpowder" = 2) - required_reagents = list("zombiepowder" = 1, "epinephrine" = 1) + id = /datum/reagent/toxin/ghoulpowder + results = list(/datum/reagent/toxin/ghoulpowder = 2) + required_reagents = list(/datum/reagent/toxin/zombiepowder = 1, /datum/reagent/medicine/epinephrine = 1) /datum/chemical_reaction/mindbreaker name = "Mindbreaker Toxin" - id = "mindbreaker" - results = list("mindbreaker" = 5) - required_reagents = list("silicon" = 1, "hydrogen" = 1, "charcoal" = 1) + id = /datum/reagent/toxin/mindbreaker + results = list(/datum/reagent/toxin/mindbreaker = 5) + required_reagents = list(/datum/reagent/silicon = 1, /datum/reagent/hydrogen = 1, /datum/reagent/medicine/charcoal = 1) /datum/chemical_reaction/heparin name = "Heparin" - id = "Heparin" - results = list("heparin" = 4) - required_reagents = list("formaldehyde" = 1, "sodium" = 1, "chlorine" = 1, "lithium" = 1) + id = /datum/reagent/toxin/heparin + results = list(/datum/reagent/toxin/heparin = 4) + required_reagents = list(/datum/reagent/toxin/formaldehyde = 1, /datum/reagent/sodium = 1, /datum/reagent/chlorine = 1, /datum/reagent/lithium = 1) mix_message = "The mixture thins and loses all color." /datum/chemical_reaction/rotatium name = "Rotatium" - id = "Rotatium" - results = list("rotatium" = 3) - required_reagents = list("mindbreaker" = 1, "teslium" = 1, "fentanyl" = 1) + id = /datum/reagent/toxin/rotatium + results = list(/datum/reagent/toxin/rotatium = 3) + required_reagents = list(/datum/reagent/toxin/mindbreaker = 1, /datum/reagent/teslium = 1, /datum/reagent/toxin/fentanyl = 1) mix_message = "After sparks, fire, and the smell of mindbreaker, the mix is constantly spinning with no stop in sight." /datum/chemical_reaction/skewium name = "Skewium" - id = "Skewium" - results = list("skewium" = 5) - required_reagents = list("rotatium" = 2, "plasma" = 2, "sacid" = 1) + id = /datum/reagent/toxin/skewium + results = list(/datum/reagent/toxin/skewium = 5) + required_reagents = list(/datum/reagent/toxin/rotatium = 2, /datum/reagent/toxin/plasma = 2, /datum/reagent/toxin/acid = 1) mix_message = "Wow! it turns out if you mix rotatium with some plasma and sulphuric acid, it gets even worse!" /datum/chemical_reaction/anacea name = "Anacea" - id = "anacea" - results = list("anacea" = 3) - required_reagents = list("haloperidol" = 1, "impedrezene" = 1, "radium" = 1) + id = /datum/reagent/toxin/anacea + results = list(/datum/reagent/toxin/anacea = 3) + required_reagents = list(/datum/reagent/medicine/haloperidol = 1, /datum/reagent/impedrezene = 1, /datum/reagent/radium = 1) /datum/chemical_reaction/mimesbane name = "Mime's Bane" - id = "mimesbane" - results = list("mimesbane" = 3) - required_reagents = list("radium" = 1, "mutetoxin" = 1, "nothing" = 1) + id = /datum/reagent/toxin/mimesbane + results = list(/datum/reagent/toxin/mimesbane = 3) + required_reagents = list(/datum/reagent/radium = 1, /datum/reagent/toxin/mutetoxin = 1, /datum/reagent/consumable/nothing = 1) /datum/chemical_reaction/bonehurtingjuice name = "Bone Hurting Juice" - id = "bonehurtingjuice" - results = list("bonehurtingjuice" = 5) - required_reagents = list("mutagen" = 1, "itching_powder" = 3, "milk" = 1) + id = /datum/reagent/toxin/bonehurtingjuice + results = list(/datum/reagent/toxin/bonehurtingjuice = 5) + required_reagents = list(/datum/reagent/toxin/mutagen = 1, /datum/reagent/toxin/itching_powder = 3, /datum/reagent/consumable/milk = 1) mix_message = "The mixture suddenly becomes clear and looks a lot like water. You feel a strong urge to drink it." diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 3d1c5671..9cf908a1 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -1,223 +1,222 @@ -#define PH_WEAK (1 << 0) -#define TEMP_WEAK (1 << 1) - -/obj/item/reagent_containers - name = "Container" - desc = "..." - icon = 'icons/obj/chemical.dmi' - icon_state = null - w_class = WEIGHT_CLASS_TINY - var/amount_per_transfer_from_this = 5 - var/list/possible_transfer_amounts = list(5,10,15,20,25,30) - var/volume = 30 - var/reagent_flags - var/list/list_reagents = null - var/spawned_disease = null - var/disease_amount = 20 - var/spillable = FALSE - var/beaker_weakness_bitflag = NONE//Bitflag! - var/container_HP = 2 - var/cached_icon - var/splashable = FALSE - -/obj/item/reagent_containers/Initialize(mapload, vol) - . = ..() - if(isnum(vol) && vol > 0) - volume = vol - create_reagents(volume, reagent_flags) - if(spawned_disease) - var/datum/disease/F = new spawned_disease() - var/list/data = list("blood_DNA" = "UNKNOWN DNA", "blood_type" = "SY","viruses"= list(F)) - reagents.add_reagent("blood", disease_amount, data) - - add_initial_reagents() - -/obj/item/reagent_containers/proc/add_initial_reagents() - if(list_reagents) - reagents.add_reagent_list(list_reagents) - -/obj/item/reagent_containers/attack_self(mob/user) - if(possible_transfer_amounts.len) - var/i=0 - for(var/A in possible_transfer_amounts) - i++ - if(A == amount_per_transfer_from_this) - if(i[src]'s transfer amount is now [amount_per_transfer_from_this] units.
    ") - return - -/obj/item/reagent_containers/attack(mob/M, mob/user, def_zone) - if(user.a_intent == INTENT_HARM) - return ..() - -/obj/item/reagent_containers/proc/canconsume(mob/eater, mob/user) - if(!iscarbon(eater)) - return 0 - var/mob/living/carbon/C = eater - var/covered = "" - if(C.is_mouth_covered(head_only = 1)) - covered = "headgear" - else if(C.is_mouth_covered(mask_only = 1)) - covered = "mask" - if(covered) - var/who = (isnull(user) || eater == user) ? "your" : "[eater.p_their()]" - to_chat(user, "You have to remove [who] [covered] first!") - return 0 - return 1 - -/obj/item/reagent_containers/ex_act() - if(reagents) - for(var/datum/reagent/R in reagents.reagent_list) - R.on_ex_act() - if(!QDELETED(src)) - ..() - -/obj/item/reagent_containers/fire_act(exposed_temperature, exposed_volume) - reagents.expose_temperature(exposed_temperature) - ..() - -/obj/item/reagent_containers/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) - . = ..() - SplashReagents(hit_atom, TRUE) - -/obj/item/reagent_containers/proc/bartender_check(atom/target) - . = FALSE - var/turf/T = get_turf(src) - if(!T || target.CanPass(src, T) || !thrownby || !thrownby.actions) - return - for(var/datum/action/innate/drink_fling/D in thrownby.actions) - if(D.active) - return TRUE - - -/obj/item/reagent_containers/proc/ForceResetRotation() - transform = initial(transform) - -/obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE) - if(!reagents || !reagents.total_volume || !(splashable ? splashable : spillable)) - return - - if(ismob(target) && target.reagents) - if(thrown) - reagents.total_volume *= rand(5,10) * 0.1 //Not all of it makes contact with the target - var/mob/M = target - var/R - target.visible_message("[M] has been splashed with something!", \ - "[M] has been splashed with something!") - for(var/datum/reagent/A in reagents.reagent_list) - R += A.id + " (" - R += num2text(A.volume) + ")," - - if(thrownby) - log_combat(thrownby, M, "splashed", R) - reagents.reaction(target, TOUCH) - - else if(bartender_check(target) && thrown) - visible_message("[src] lands onto the [target.name] without spilling a single drop.") - transform = initial(transform) - addtimer(CALLBACK(src, .proc/ForceResetRotation), 1) - return - - else - if(isturf(target) && reagents.reagent_list.len && thrownby) - log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") - log_game("[key_name(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].") - message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].") - visible_message("[src] spills its contents all over [target].") - reagents.reaction(target, TOUCH) - if(QDELETED(src)) - return - - reagents.clear_reagents() - -//melts plastic beakers -/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M) - reagents.expose_temperature(1000) - if(beaker_weakness_bitflag & TEMP_WEAK) - var/list/seen = viewers(5, get_turf(src)) - var/iconhtml = icon2html(src, seen) - for(var/mob/H in seen) - to_chat(H, "[iconhtml] \The [src]'s melts from the temperature!") - playsound(get_turf(src), 'sound/FermiChem/heatmelt.ogg', 80, 1) - qdel(src) - ..() - -//melts plastic beakers -/obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - reagents.expose_temperature(exposed_temperature) - temp_check() - -/obj/item/reagent_containers/proc/temp_check() - if(beaker_weakness_bitflag & TEMP_WEAK) - if(reagents.chem_temp >= 444)//assuming polypropylene - START_PROCESSING(SSobj, src) - -//melts glass beakers -/obj/item/reagent_containers/proc/pH_check() - if(beaker_weakness_bitflag & PH_WEAK) - if((reagents.pH < 1.5) || (reagents.pH > 12.5)) - START_PROCESSING(SSobj, src) - - -/obj/item/reagent_containers/process() - if(!cached_icon) - cached_icon = icon_state - var/damage - var/cause - if(beaker_weakness_bitflag & PH_WEAK) - if(reagents.pH < 2) - damage = (2 - reagents.pH)/20 - cause = "from the extreme pH" - playsound(get_turf(src), 'sound/FermiChem/bufferadd.ogg', 50, 1) - - if(reagents.pH > 12) - damage = (reagents.pH - 12)/20 - cause = "from the extreme pH" - playsound(get_turf(src), 'sound/FermiChem/bufferadd.ogg', 50, 1) - - if(beaker_weakness_bitflag & TEMP_WEAK) - if(reagents.chem_temp >= 444) - if(damage) - damage += (reagents.chem_temp/444)/5 - else - damage = (reagents.chem_temp/444)/5 - if(cause) - cause += " and " - cause += "from the high temperature" - playsound(get_turf(src), 'sound/FermiChem/heatdam.ogg', 50, 1) - - if(!damage || damage <= 0) - STOP_PROCESSING(SSobj, src) - - container_HP -= damage - - var/list/seen = viewers(5, get_turf(src)) - var/iconhtml = icon2html(src, seen) - - var/damage_percent = ((container_HP / initial(container_HP)*100)) - switch(damage_percent) - if(-INFINITY to 0) - for(var/mob/M in seen) - to_chat(M, "[iconhtml] \The [src]'s melts [cause]!") - playsound(get_turf(src), 'sound/FermiChem/acidmelt.ogg', 80, 1) - SSblackbox.record_feedback("tally", "fermi_chem", 1, "Times beakers have melted") - STOP_PROCESSING(SSobj, src) - qdel(src) - return - if(0 to 35) - icon_state = "[cached_icon]_m3" - desc = "[initial(desc)] It is severely deformed." - if(35 to 70) - icon_state = "[cached_icon]_m2" - desc = "[initial(desc)] It is deformed." - if(70 to 85) - desc = "[initial(desc)] It is mildly deformed." - icon_state = "[cached_icon]_m1" - - update_icon() - if(prob(25)) - for(var/mob/M in seen) - to_chat(M, "[iconhtml] \The [src]'s is damaged by [cause] and begins to deform!") +#define PH_WEAK (1 << 0) +#define TEMP_WEAK (1 << 1) + +/obj/item/reagent_containers + name = "Container" + desc = "..." + icon = 'icons/obj/chemical.dmi' + icon_state = null + w_class = WEIGHT_CLASS_TINY + var/amount_per_transfer_from_this = 5 + var/list/possible_transfer_amounts = list(5,10,15,20,25,30) + var/volume = 30 + var/reagent_flags + var/list/list_reagents = null + var/spawned_disease = null + var/disease_amount = 20 + var/spillable = FALSE + var/beaker_weakness_bitflag = NONE//Bitflag! + var/container_HP = 2 + var/cached_icon + var/splashable = FALSE + +/obj/item/reagent_containers/Initialize(mapload, vol) + . = ..() + if(isnum(vol) && vol > 0) + volume = vol + create_reagents(volume, reagent_flags) + if(spawned_disease) + var/datum/disease/F = new spawned_disease() + var/list/data = list("blood_DNA" = "UNKNOWN DNA", "blood_type" = "SY","viruses"= list(F)) + reagents.add_reagent(/datum/reagent/blood, disease_amount, data) + add_initial_reagents() + +/obj/item/reagent_containers/proc/add_initial_reagents() + if(list_reagents) + reagents.add_reagent_list(list_reagents) + +/obj/item/reagent_containers/attack_self(mob/user) + if(possible_transfer_amounts.len) + var/i=0 + for(var/A in possible_transfer_amounts) + i++ + if(A == amount_per_transfer_from_this) + if(i[src]'s transfer amount is now [amount_per_transfer_from_this] units.
    ") + return + +/obj/item/reagent_containers/attack(mob/M, mob/user, def_zone) + if(user.a_intent == INTENT_HARM) + return ..() + +/obj/item/reagent_containers/proc/canconsume(mob/eater, mob/user) + if(!iscarbon(eater)) + return 0 + var/mob/living/carbon/C = eater + var/covered = "" + if(C.is_mouth_covered(head_only = 1)) + covered = "headgear" + else if(C.is_mouth_covered(mask_only = 1)) + covered = "mask" + if(covered) + var/who = (isnull(user) || eater == user) ? "your" : "[eater.p_their()]" + to_chat(user, "You have to remove [who] [covered] first!") + return 0 + return 1 + +/obj/item/reagent_containers/ex_act() + if(reagents) + for(var/datum/reagent/R in reagents.reagent_list) + R.on_ex_act() + if(!QDELETED(src)) + ..() + +/obj/item/reagent_containers/fire_act(exposed_temperature, exposed_volume) + reagents.expose_temperature(exposed_temperature) + ..() + +/obj/item/reagent_containers/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + . = ..() + SplashReagents(hit_atom, TRUE) + +/obj/item/reagent_containers/proc/bartender_check(atom/target) + . = FALSE + var/turf/T = get_turf(src) + if(!T || target.CanPass(src, T) || !thrownby || !thrownby.actions) + return + for(var/datum/action/innate/drink_fling/D in thrownby.actions) + if(D.active) + return TRUE + + +/obj/item/reagent_containers/proc/ForceResetRotation() + transform = initial(transform) + +/obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE) + if(!reagents || !reagents.total_volume || !(splashable ? splashable : spillable)) + return + + if(ismob(target) && target.reagents) + if(thrown) + reagents.total_volume *= rand(5,10) * 0.1 //Not all of it makes contact with the target + var/mob/M = target + var/R + target.visible_message("[M] has been splashed with something!", \ + "[M] has been splashed with something!") + for(var/datum/reagent/A in reagents.reagent_list) + R += A.type + " (" + R += num2text(A.volume) + ")," + + if(thrownby) + log_combat(thrownby, M, "splashed", R) + reagents.reaction(target, TOUCH) + + else if(bartender_check(target) && thrown) + visible_message("[src] lands onto the [target.name] without spilling a single drop.") + transform = initial(transform) + addtimer(CALLBACK(src, .proc/ForceResetRotation), 1) + return + + else + if(isturf(target) && reagents.reagent_list.len && thrownby) + log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") + log_game("[key_name(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].") + message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].") + visible_message("[src] spills its contents all over [target].") + reagents.reaction(target, TOUCH) + if(QDELETED(src)) + return + + reagents.clear_reagents() + +//melts plastic beakers +/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M) + reagents.expose_temperature(1000) + if(beaker_weakness_bitflag & TEMP_WEAK) + var/list/seen = viewers(5, get_turf(src)) + var/iconhtml = icon2html(src, seen) + for(var/mob/H in seen) + to_chat(H, "[iconhtml] \The [src]'s melts from the temperature!") + playsound(get_turf(src), 'sound/FermiChem/heatmelt.ogg', 80, 1) + qdel(src) + ..() + +//melts plastic beakers +/obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + reagents.expose_temperature(exposed_temperature) + temp_check() + +/obj/item/reagent_containers/proc/temp_check() + if(beaker_weakness_bitflag & TEMP_WEAK) + if(reagents.chem_temp >= 444)//assuming polypropylene + START_PROCESSING(SSobj, src) + +//melts glass beakers +/obj/item/reagent_containers/proc/pH_check() + if(beaker_weakness_bitflag & PH_WEAK) + if((reagents.pH < 1.5) || (reagents.pH > 12.5)) + START_PROCESSING(SSobj, src) + + +/obj/item/reagent_containers/process() + if(!cached_icon) + cached_icon = icon_state + var/damage + var/cause + if(beaker_weakness_bitflag & PH_WEAK) + if(reagents.pH < 2) + damage = (2 - reagents.pH)/20 + cause = "from the extreme pH" + playsound(get_turf(src), 'sound/FermiChem/bufferadd.ogg', 50, 1) + + if(reagents.pH > 12) + damage = (reagents.pH - 12)/20 + cause = "from the extreme pH" + playsound(get_turf(src), 'sound/FermiChem/bufferadd.ogg', 50, 1) + + if(beaker_weakness_bitflag & TEMP_WEAK) + if(reagents.chem_temp >= 444) + if(damage) + damage += (reagents.chem_temp/444)/5 + else + damage = (reagents.chem_temp/444)/5 + if(cause) + cause += " and " + cause += "from the high temperature" + playsound(get_turf(src), 'sound/FermiChem/heatdam.ogg', 50, 1) + + if(!damage || damage <= 0) + STOP_PROCESSING(SSobj, src) + + container_HP -= damage + + var/list/seen = viewers(5, get_turf(src)) + var/iconhtml = icon2html(src, seen) + + var/damage_percent = ((container_HP / initial(container_HP)*100)) + switch(damage_percent) + if(-INFINITY to 0) + for(var/mob/M in seen) + to_chat(M, "[iconhtml] \The [src]'s melts [cause]!") + playsound(get_turf(src), 'sound/FermiChem/acidmelt.ogg', 80, 1) + SSblackbox.record_feedback("tally", "fermi_chem", 1, "Times beakers have melted") + STOP_PROCESSING(SSobj, src) + qdel(src) + return + if(0 to 35) + icon_state = "[cached_icon]_m3" + desc = "[initial(desc)] It is severely deformed." + if(35 to 70) + icon_state = "[cached_icon]_m2" + desc = "[initial(desc)] It is deformed." + if(70 to 85) + desc = "[initial(desc)] It is mildly deformed." + icon_state = "[cached_icon]_m1" + + update_icon() + if(prob(25)) + for(var/mob/M in seen) + to_chat(M, "[iconhtml] \The [src]'s is damaged by [cause] and begins to deform!") diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index 36d73f0d..6ca4aa77 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -13,12 +13,12 @@ /obj/item/reagent_containers/blood/Initialize() . = ..() if(blood_type != null) - reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_colour"=color, "blood_type"=blood_type,"resistances"=null,"trace_chem"=null)) + reagents.add_reagent(/datum/reagent/blood, 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_colour"=color, "blood_type"=blood_type,"resistances"=null,"trace_chem"=null)) update_icon() /obj/item/reagent_containers/blood/on_reagent_change(changetype) if(reagents) - var/datum/reagent/blood/B = reagents.has_reagent("blood") + var/datum/reagent/blood/B = reagents.has_reagent(/datum/reagent/blood) if(B && B.data && B.data["blood_type"]) blood_type = B.data["blood_type"] color_to_apply = bloodtype_to_color(blood_type) diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index cca05d66..51937448 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -1,256 +1,264 @@ -/* -Contains: -Borg Hypospray -Borg Shaker -Nothing to do with hydroponics in here. Sorry to dissapoint you. -*/ - -/* -Borg Hypospray -*/ -/obj/item/reagent_containers/borghypo - name = "cyborg hypospray" - desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment." - icon = 'icons/obj/syringe.dmi' - item_state = "hypo" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - icon_state = "borghypo" - amount_per_transfer_from_this = 5 - volume = 30 - possible_transfer_amounts = list() - var/mode = 1 - var/charge_cost = 50 - var/charge_tick = 0 - var/recharge_time = 5 //Time it takes for shots to recharge (in seconds) - var/bypass_protection = 0 //If the hypospray can go through armor or thick material - - var/list/datum/reagents/reagent_list = list() - var/list/reagent_ids = list("dexalin", "kelotane", "bicaridine", "antitoxin", "epinephrine", "spaceacillin", "salglu_solution") - var/accepts_reagent_upgrades = TRUE //If upgrades can increase number of reagents dispensed. - var/list/modes = list() //Basically the inverse of reagent_ids. Instead of having numbers as "keys" and strings as values it has strings as keys and numbers as values. - //Used as list for input() in shakers. - - -/obj/item/reagent_containers/borghypo/Initialize() - . = ..() - - for(var/R in reagent_ids) - add_reagent(R) - - START_PROCESSING(SSobj, src) - - -/obj/item/reagent_containers/borghypo/Destroy() - STOP_PROCESSING(SSobj, src) - return ..() - - -/obj/item/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg - charge_tick++ - if(charge_tick >= recharge_time) - regenerate_reagents() - charge_tick = 0 - - //update_icon() - return 1 - -// Use this to add more chemicals for the borghypo to produce. -/obj/item/reagent_containers/borghypo/proc/add_reagent(reagent) - reagent_ids |= reagent - var/datum/reagents/RG = new(30) - RG.my_atom = src - reagent_list += RG - - var/datum/reagents/R = reagent_list[reagent_list.len] - R.add_reagent(reagent, 30) - - modes[reagent] = modes.len + 1 - -/obj/item/reagent_containers/borghypo/proc/del_reagent(reagent) - reagent_ids -= reagent - var/datum/reagents/RG - var/datum/reagents/TRG - for(var/i in 1 to reagent_ids.len) - TRG = reagent_list[i] - if (TRG.has_reagent(reagent)) - RG = TRG - break - if (RG) - reagent_list -= RG - RG.del_reagent(reagent) - - modes[reagent] = modes.len - 1 - -/obj/item/reagent_containers/borghypo/proc/regenerate_reagents() - if(iscyborg(src.loc)) - var/mob/living/silicon/robot/R = src.loc - if(R && R.cell) - for(var/i in 1 to reagent_ids.len) - var/datum/reagents/RG = reagent_list[i] - if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full. - R.cell.use(charge_cost) //Take power from borg... - RG.add_reagent(reagent_ids[i], 5) //And fill hypo with reagent. - -/obj/item/reagent_containers/borghypo/attack(mob/living/carbon/M, mob/user) - var/datum/reagents/R = reagent_list[mode] - if(!R.total_volume) - to_chat(user, "The injector is empty.") - return - if(!istype(M)) - return - if(R.total_volume && M.can_inject(user, 1, user.zone_selected,bypass_protection)) - to_chat(M, "You feel a tiny prick!") - to_chat(user, "You inject [M] with the injector.") - var/fraction = min(amount_per_transfer_from_this/R.total_volume, 1) - R.reaction(M, INJECT, fraction) - if(M.reagents) - var/trans = R.trans_to(M, amount_per_transfer_from_this) - to_chat(user, "[trans] unit\s injected. [R.total_volume] unit\s remaining.") - - var/list/injected = list() - for(var/datum/reagent/RG in R.reagent_list) - injected += RG.name - log_combat(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])") - -/obj/item/reagent_containers/borghypo/attack_self(mob/user) - var/chosen_reagent = modes[input(user, "What reagent do you want to dispense?") as null|anything in reagent_ids] - if(!chosen_reagent) - return - mode = chosen_reagent - playsound(loc, 'sound/effects/pop.ogg', 50, 0) - var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]] - to_chat(user, "[src] is now dispensing '[R.name]'.") - return - -/obj/item/reagent_containers/borghypo/examine(mob/user) - . = ..() - . += DescribeContents() //Because using the standardized reagents datum was just too cool for whatever fuckwit wrote this - -/obj/item/reagent_containers/borghypo/proc/DescribeContents() - var/empty = 1 - - for(var/datum/reagents/RS in reagent_list) - var/datum/reagent/R = locate() in RS.reagent_list - if(R) - . += "It currently has [R.volume] unit\s of [R.name] stored." - empty = 0 - - if(empty) - . += "It is currently empty! Allow some time for the internal syntheszier to produce more." - -/obj/item/reagent_containers/borghypo/hacked - icon_state = "borghypo_s" - reagent_ids = list ("facid", "mutetoxin", "cyanide", "sodium_thiopental", "heparin", "lexorin") - accepts_reagent_upgrades = FALSE - -/obj/item/reagent_containers/borghypo/clown - name = "laughter injector" - desc = "Keeps the crew happy and productive!" - reagent_ids = list("laughter") - accepts_reagent_upgrades = FALSE - -/obj/item/reagent_containers/borghypo/clown/hacked - name = "laughter injector" - desc = "Keeps the crew so happy they don't work!" - reagent_ids = list("superlaughter") - accepts_reagent_upgrades = FALSE - -/obj/item/reagent_containers/borghypo/syndicate - name = "syndicate cyborg hypospray" - desc = "An experimental piece of Syndicate technology used to produce powerful restorative nanites used to very quickly restore injuries of all types. Also metabolizes potassium iodide, for radiation poisoning, and morphine, for offense." - icon_state = "borghypo_s" - charge_cost = 20 - recharge_time = 2 - reagent_ids = list("syndicate_nanites", "potass_iodide", "morphine") - bypass_protection = 1 - accepts_reagent_upgrades = FALSE - -/* -Borg Shaker -*/ -/obj/item/reagent_containers/borghypo/borgshaker - name = "cyborg shaker" - desc = "An advanced drink synthesizer and mixer." - icon = 'icons/obj/drinks.dmi' - icon_state = "shaker" - possible_transfer_amounts = list(5,10,20) - charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster. - recharge_time = 3 - accepts_reagent_upgrades = FALSE - - reagent_ids = list("beer", "orangejuice", "grenadine", "limejuice", "tomatojuice", "cola", "tonic", "sodawater", "ice", "cream", "whiskey", "vodka", "rum", "gin", "tequila", "vermouth", "wine", "kahlua", "cognac", "ale", "milk", "coffee", "banana", "lemonjuice") - -/obj/item/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user) - return //Can't inject stuff with a shaker, can we? //not with that attitude - -/obj/item/reagent_containers/borghypo/borgshaker/regenerate_reagents() - if(iscyborg(src.loc)) - var/mob/living/silicon/robot/R = src.loc - if(R && R.cell) - for(var/i in modes) //Lots of reagents in this one, so it's best to regenrate them all at once to keep it from being tedious. - var/valueofi = modes[i] - var/datum/reagents/RG = reagent_list[valueofi] - if(RG.total_volume < RG.maximum_volume) - R.cell.use(charge_cost) - RG.add_reagent(reagent_ids[valueofi], 5) - -/obj/item/reagent_containers/borghypo/borgshaker/afterattack(obj/target, mob/user, proximity) - . = ..() - if(!proximity) - return - - else if(target.is_refillable()) - var/datum/reagents/R = reagent_list[mode] - if(!R.total_volume) - to_chat(user, "[src] is currently out of this ingredient! Please allow some time for the synthesizer to produce more.") - return - - if(target.reagents.total_volume >= target.reagents.maximum_volume) - to_chat(user, "[target] is full.") - return - - var/trans = R.trans_to(target, amount_per_transfer_from_this) - to_chat(user, "You transfer [trans] unit\s of the solution to [target].") - -/obj/item/reagent_containers/borghypo/borgshaker/DescribeContents() - var/empty = 1 - - var/datum/reagents/RS = reagent_list[mode] - var/datum/reagent/R = locate() in RS.reagent_list - if(R) - to_chat(usr, "It currently has [R.volume] unit\s of [R.name] stored.") - empty = 0 - - if(empty) - to_chat(usr, "It is currently empty! Please allow some time for the synthesizer to produce more.") - -/obj/item/reagent_containers/borghypo/borgshaker/hacked - name = "cyborg shaker" - desc = "Will mix drinks that knock them dead." - icon = 'icons/obj/drinks.dmi' - icon_state = "threemileislandglass" - possible_transfer_amounts = list(5,10,20) - charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster. - recharge_time = 3 - accepts_reagent_upgrades = FALSE - - reagent_ids = list("fakebeer", "fernet") - -/obj/item/reagent_containers/borghypo/peace - name = "Peace Hypospray" - - reagent_ids = list("dizzysolution","tiresolution","synthpax") - accepts_reagent_upgrades = FALSE - -/obj/item/reagent_containers/borghypo/peace/hacked - desc = "Everything's peaceful in death!" - icon_state = "borghypo_s" - reagent_ids = list("dizzysolution","tiresolution","synthpax","tirizene","sulfonal","sodium_thiopental","cyanide","fentanyl") - accepts_reagent_upgrades = FALSE - -/obj/item/reagent_containers/borghypo/epi - name = "epinephrine injector" - desc = "An advanced chemical synthesizer and injection system, designed to stabilize patients." - reagent_ids = list("epinephrine") - accepts_reagent_upgrades = FALSE +/* +Contains: +Borg Hypospray +Borg Shaker +Nothing to do with hydroponics in here. Sorry to dissapoint you. +*/ + +/* +Borg Hypospray +*/ +/obj/item/reagent_containers/borghypo + name = "cyborg hypospray" + desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment." + icon = 'icons/obj/syringe.dmi' + item_state = "hypo" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + icon_state = "borghypo" + amount_per_transfer_from_this = 5 + volume = 30 + possible_transfer_amounts = list() + var/mode = 1 + var/charge_cost = 50 + var/charge_tick = 0 + var/recharge_time = 5 //Time it takes for shots to recharge (in seconds) + var/bypass_protection = 0 //If the hypospray can go through armor or thick material + + var/list/datum/reagents/reagent_list = list() + var/list/reagent_ids = list(/datum/reagent/medicine/dexalin, /datum/reagent/medicine/kelotane, /datum/reagent/medicine/bicaridine, /datum/reagent/medicine/antitoxin, + /datum/reagent/medicine/epinephrine, /datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salglu_solution, /datum/reagent/medicine/insulin) + var/accepts_reagent_upgrades = TRUE //If upgrades can increase number of reagents dispensed. + var/list/modes = list() //Basically the inverse of reagent_ids. Instead of having numbers as "keys" and strings as values it has strings as keys and numbers as values. + //Used as list for input() in shakers. + + +/obj/item/reagent_containers/borghypo/Initialize() + . = ..() + + for(var/R in reagent_ids) + add_reagent(R) + + START_PROCESSING(SSobj, src) + + +/obj/item/reagent_containers/borghypo/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() + + +/obj/item/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg + charge_tick++ + if(charge_tick >= recharge_time) + regenerate_reagents() + charge_tick = 0 + + //update_icon() + return 1 + +// Use this to add more chemicals for the borghypo to produce. +/obj/item/reagent_containers/borghypo/proc/add_reagent(reagent) + reagent_ids |= reagent + var/datum/reagents/RG = new(30) + RG.my_atom = src + reagent_list += RG + + var/datum/reagents/R = reagent_list[reagent_list.len] + R.add_reagent(reagent, 30) + + modes[reagent] = modes.len + 1 + +/obj/item/reagent_containers/borghypo/proc/del_reagent(reagent) + reagent_ids -= reagent + var/datum/reagents/RG + var/datum/reagents/TRG + for(var/i in 1 to reagent_ids.len) + TRG = reagent_list[i] + if (TRG.has_reagent(reagent)) + RG = TRG + break + if (RG) + reagent_list -= RG + RG.del_reagent(reagent) + + modes[reagent] = modes.len - 1 + +/obj/item/reagent_containers/borghypo/proc/regenerate_reagents() + if(iscyborg(src.loc)) + var/mob/living/silicon/robot/R = src.loc + if(R && R.cell) + for(var/i in 1 to reagent_ids.len) + var/datum/reagents/RG = reagent_list[i] + if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full. + R.cell.use(charge_cost) //Take power from borg... + RG.add_reagent(reagent_ids[i], 5) //And fill hypo with reagent. + +/obj/item/reagent_containers/borghypo/attack(mob/living/carbon/M, mob/user) + var/datum/reagents/R = reagent_list[mode] + if(!R.total_volume) + to_chat(user, "The injector is empty.") + return + if(!istype(M)) + return + if(R.total_volume && M.can_inject(user, 1, user.zone_selected,bypass_protection)) + to_chat(M, "You feel a tiny prick!") + to_chat(user, "You inject [M] with the injector.") + var/fraction = min(amount_per_transfer_from_this/R.total_volume, 1) + R.reaction(M, INJECT, fraction) + if(M.reagents) + var/trans = R.trans_to(M, amount_per_transfer_from_this) + to_chat(user, "[trans] unit\s injected. [R.total_volume] unit\s remaining.") + + var/list/injected = list() + for(var/datum/reagent/RG in R.reagent_list) + injected += RG.name + log_combat(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])") + +/obj/item/reagent_containers/borghypo/attack_self(mob/user) + var/chosen_reagent = modes[input(user, "What reagent do you want to dispense?") as null|anything in reagent_ids] + if(!chosen_reagent) + return + mode = chosen_reagent + playsound(loc, 'sound/effects/pop.ogg', 50, 0) + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]] + to_chat(user, "[src] is now dispensing '[R.name]'.") + return + +/obj/item/reagent_containers/borghypo/examine(mob/user) + . = ..() + . += DescribeContents() //Because using the standardized reagents datum was just too cool for whatever fuckwit wrote this + +/obj/item/reagent_containers/borghypo/proc/DescribeContents() + var/empty = 1 + + for(var/datum/reagents/RS in reagent_list) + var/datum/reagent/R = locate() in RS.reagent_list + if(R) + . += "It currently has [R.volume] unit\s of [R.name] stored." + empty = 0 + + if(empty) + . += "It is currently empty! Allow some time for the internal syntheszier to produce more." + +/obj/item/reagent_containers/borghypo/hacked + icon_state = "borghypo_s" + reagent_ids = list (/datum/reagent/toxin/acid, /datum/reagent/toxin/mutetoxin, /datum/reagent/toxin/cyanide, /datum/reagent/toxin/sodium_thiopental, /datum/reagent/toxin/heparin, /datum/reagent/toxin/lexorin) + accepts_reagent_upgrades = FALSE + +/obj/item/reagent_containers/borghypo/clown + name = "laughter injector" + desc = "Keeps the crew happy and productive!" + reagent_ids = list(/datum/reagent/consumable/laughter) + accepts_reagent_upgrades = FALSE + +/obj/item/reagent_containers/borghypo/clown/hacked + name = "laughter injector" + desc = "Keeps the crew so happy they don't work!" + reagent_ids = list(/datum/reagent/consumable/superlaughter) + accepts_reagent_upgrades = FALSE + +/obj/item/reagent_containers/borghypo/syndicate + name = "syndicate cyborg hypospray" + desc = "An experimental piece of Syndicate technology used to produce powerful restorative nanites used to very quickly restore injuries of all types. Also metabolizes potassium iodide, for radiation poisoning, and morphine, for offense." + icon_state = "borghypo_s" + charge_cost = 20 + recharge_time = 2 + reagent_ids = list(/datum/reagent/medicine/syndicate_nanites, /datum/reagent/medicine/potass_iodide, /datum/reagent/medicine/morphine, /datum/reagent/medicine/insulin) + bypass_protection = 1 + accepts_reagent_upgrades = FALSE + +/* +Borg Shaker +*/ +/obj/item/reagent_containers/borghypo/borgshaker + name = "cyborg shaker" + desc = "An advanced drink synthesizer and mixer." + icon = 'icons/obj/drinks.dmi' + icon_state = "shaker" + possible_transfer_amounts = list(5,10,20) + charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster. + recharge_time = 3 + accepts_reagent_upgrades = FALSE + reagent_ids = list(/datum/reagent/consumable/ethanol/beer, /datum/reagent/consumable/orangejuice, /datum/reagent/consumable/grenadine, + /datum/reagent/consumable/limejuice, /datum/reagent/consumable/tomatojuice, /datum/reagent/consumable/space_cola, + /datum/reagent/consumable/tonic, /datum/reagent/consumable/sodawater, /datum/reagent/consumable/ice, + /datum/reagent/consumable/cream, /datum/reagent/consumable/ethanol/whiskey, /datum/reagent/consumable/ethanol/vodka, + /datum/reagent/consumable/ethanol/rum, /datum/reagent/consumable/ethanol/gin, /datum/reagent/consumable/ethanol/tequila, + /datum/reagent/consumable/ethanol/vermouth, /datum/reagent/consumable/ethanol/wine, /datum/reagent/consumable/ethanol/kahlua, + /datum/reagent/consumable/ethanol/cognac, /datum/reagent/consumable/ethanol/ale, /datum/reagent/consumable/milk, + /datum/reagent/consumable/coffee, /datum/reagent/consumable/banana, /datum/reagent/consumable/lemonjuice) + +/obj/item/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user) + return //Can't inject stuff with a shaker, can we? //not with that attitude + +/obj/item/reagent_containers/borghypo/borgshaker/regenerate_reagents() + if(iscyborg(src.loc)) + var/mob/living/silicon/robot/R = src.loc + if(R && R.cell) + for(var/i in modes) //Lots of reagents in this one, so it's best to regenrate them all at once to keep it from being tedious. + var/valueofi = modes[i] + var/datum/reagents/RG = reagent_list[valueofi] + if(RG.total_volume < RG.maximum_volume) + R.cell.use(charge_cost) + RG.add_reagent(reagent_ids[valueofi], 5) + +/obj/item/reagent_containers/borghypo/borgshaker/afterattack(obj/target, mob/user, proximity) + . = ..() + if(!proximity) + return + + else if(target.is_refillable()) + var/datum/reagents/R = reagent_list[mode] + if(!R.total_volume) + to_chat(user, "[src] is currently out of this ingredient! Please allow some time for the synthesizer to produce more.") + return + + if(target.reagents.total_volume >= target.reagents.maximum_volume) + to_chat(user, "[target] is full.") + return + + var/trans = R.trans_to(target, amount_per_transfer_from_this) + to_chat(user, "You transfer [trans] unit\s of the solution to [target].") + +/obj/item/reagent_containers/borghypo/borgshaker/DescribeContents() + var/empty = 1 + + var/datum/reagents/RS = reagent_list[mode] + var/datum/reagent/R = locate() in RS.reagent_list + if(R) + to_chat(usr, "It currently has [R.volume] unit\s of [R.name] stored.") + empty = 0 + + if(empty) + to_chat(usr, "It is currently empty! Please allow some time for the synthesizer to produce more.") + +/obj/item/reagent_containers/borghypo/borgshaker/hacked + name = "cyborg shaker" + desc = "Will mix drinks that knock them dead." + icon = 'icons/obj/drinks.dmi' + icon_state = "threemileislandglass" + possible_transfer_amounts = list(5,10,20) + charge_cost = 20 //Lots of reagents all regenerating at once, so the charge cost is lower. They also regenerate faster. + recharge_time = 3 + accepts_reagent_upgrades = FALSE + reagent_ids = list(/datum/reagent/toxin/fakebeer, /datum/reagent/consumable/ethanol/fernet) + +/obj/item/reagent_containers/borghypo/peace + name = "Peace Hypospray" + + reagent_ids = list(/datum/reagent/peaceborg_confuse, /datum/reagent/peaceborg_tire, /datum/reagent/pax/peaceborg, /datum/reagent/medicine/insulin) + accepts_reagent_upgrades = FALSE + +/obj/item/reagent_containers/borghypo/peace/hacked + desc = "Everything's peaceful in death!" + icon_state = "borghypo_s" + reagent_ids = list(/datum/reagent/peaceborg_confuse, /datum/reagent/peaceborg_tire, /datum/reagent/pax/peaceborg, + /datum/reagent/toxin/staminatoxin,/datum/reagent/toxin/sulfonal,/datum/reagent/toxin/sodium_thiopental, + /datum/reagent/toxin/cyanide,/datum/reagent/toxin/fentanyl) + accepts_reagent_upgrades = FALSE + +/obj/item/reagent_containers/borghypo/epi + name = "epinephrine injector" + desc = "An advanced chemical synthesizer and injection system, designed to stabilize patients." + reagent_ids = list(/datum/reagent/medicine/epinephrine, /datum/reagent/medicine/insulin) + accepts_reagent_upgrades = FALSE diff --git a/code/modules/reagents/reagent_containers/bottle.dm b/code/modules/reagents/reagent_containers/bottle.dm index 249ed56d..9ef962ff 100644 --- a/code/modules/reagents/reagent_containers/bottle.dm +++ b/code/modules/reagents/reagent_containers/bottle.dm @@ -43,91 +43,96 @@ /obj/item/reagent_containers/glass/bottle/epinephrine name = "epinephrine bottle" desc = "A small bottle. Contains epinephrine - used to stabilize patients." - list_reagents = list("epinephrine" = 30) + list_reagents = list(/datum/reagent/medicine/epinephrine = 30) /obj/item/reagent_containers/glass/bottle/toxin name = "toxin bottle" desc = "A small bottle of toxins. Do not drink, it is poisonous." - list_reagents = list("toxin" = 30) + list_reagents = list(/datum/reagent/toxin = 30) /obj/item/reagent_containers/glass/bottle/cyanide name = "cyanide bottle" desc = "A small bottle of cyanide. Bitter almonds?" - list_reagents = list("cyanide" = 30) + list_reagents = list(/datum/reagent/toxin/cyanide = 30) /obj/item/reagent_containers/glass/bottle/spewium name = "spewium bottle" desc = "A small bottle of spewium." - list_reagents = list("spewium" = 30) + list_reagents = list(/datum/reagent/toxin/spewium = 30) /obj/item/reagent_containers/glass/bottle/morphine name = "morphine bottle" desc = "A small bottle of morphine." icon = 'icons/obj/chemical.dmi' - list_reagents = list("morphine" = 30) + list_reagents = list(/datum/reagent/medicine/morphine = 30) /obj/item/reagent_containers/glass/bottle/chloralhydrate name = "Chloral Hydrate Bottle" desc = "A small bottle of Choral Hydrate. Mickey's Favorite!" icon_state = "bottle20" - list_reagents = list("chloralhydrate" = 15) + list_reagents = list(/datum/reagent/toxin/chloralhydrate = 15) /obj/item/reagent_containers/glass/bottle/charcoal name = "charcoal bottle" desc = "A small bottle of charcoal, which removes toxins and other chemicals from the bloodstream." - list_reagents = list("charcoal" = 30) + list_reagents = list(/datum/reagent/medicine/charcoal = 30) + +/obj/item/reagent_containers/glass/bottle/cryoxadone + name = "cryoxadone bottle" + desc = "A small bottle of cryoxadone, heals most types of damage when used in extremely cold enviornments." + list_reagents = list(/datum/reagent/medicine/cryoxadone = 30) /obj/item/reagent_containers/glass/bottle/mutagen name = "unstable mutagen bottle" desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact." - list_reagents = list("mutagen" = 30) + list_reagents = list(/datum/reagent/toxin/mutagen = 30) /obj/item/reagent_containers/glass/bottle/plasma name = "liquid plasma bottle" desc = "A small bottle of liquid plasma. Extremely toxic and reacts with micro-organisms inside blood." - list_reagents = list("plasma" = 30) + list_reagents = list(/datum/reagent/toxin/plasma = 30) /obj/item/reagent_containers/glass/bottle/synaptizine name = "synaptizine bottle" desc = "A small bottle of synaptizine." - list_reagents = list("synaptizine" = 30) + list_reagents = list(/datum/reagent/medicine/synaptizine = 30) /obj/item/reagent_containers/glass/bottle/formaldehyde name = "formaldehyde bottle" desc = "A small bottle of formaldehyde." - list_reagents = list("formaldehyde" = 30) + list_reagents = list(/datum/reagent/toxin/formaldehyde = 30) /obj/item/reagent_containers/glass/bottle/ammonia name = "ammonia bottle" desc = "A small bottle of ammonia." - list_reagents = list("ammonia" = 30) + list_reagents = list(/datum/reagent/ammonia = 30) /obj/item/reagent_containers/glass/bottle/diethylamine name = "diethylamine bottle" desc = "A small bottle of diethylamine." - list_reagents = list("diethylamine" = 30) + list_reagents = list(/datum/reagent/diethylamine = 30) /obj/item/reagent_containers/glass/bottle/facid name = "Fluorosulfuric Acid Bottle" desc = "A small bottle. Contains a small amount of fluorosulfuric acid." - list_reagents = list("facid" = 30) + list_reagents = list(/datum/reagent/toxin/acid/fluacid = 30) /obj/item/reagent_containers/glass/bottle/adminordrazine name = "Adminordrazine Bottle" desc = "A small bottle. Contains the liquid essence of the gods." icon = 'icons/obj/drinks.dmi' icon_state = "holyflask" - list_reagents = list("adminordrazine" = 30) + list_reagents = list(/datum/reagent/medicine/adminordrazine = 30) /obj/item/reagent_containers/glass/bottle/capsaicin name = "Capsaicin Bottle" desc = "A small bottle. Contains hot sauce." - list_reagents = list("capsaicin" = 30) + list_reagents = list(/datum/reagent/consumable/capsaicin = 30) /obj/item/reagent_containers/glass/bottle/frostoil name = "Frost Oil Bottle" desc = "A small bottle. Contains cold sauce." - list_reagents = list("frostoil" = 30) + list_reagents = list(/datum/reagent/consumable/frostoil = 30) /obj/item/reagent_containers/glass/bottle/traitor name = "syndicate bottle" @@ -137,94 +142,95 @@ /obj/item/reagent_containers/glass/bottle/traitor/Initialize() . = ..() - extra_reagent = pick("polonium", "histamine", "formaldehyde", "venom", "fentanyl", "cyanide") - reagents.add_reagent("[extra_reagent]", 3) + extra_reagent = pick(/datum/reagent/toxin/polonium, /datum/reagent/toxin/histamine, /datum/reagent/toxin/formaldehyde, + /datum/reagent/toxin/venom, /datum/reagent/toxin/fentanyl, /datum/reagent/toxin/cyanide) + reagents.add_reagent(extra_reagent, 3) /obj/item/reagent_containers/glass/bottle/polonium name = "polonium bottle" desc = "A small bottle. Contains Polonium." - list_reagents = list("polonium" = 30) + list_reagents = list(/datum/reagent/toxin/polonium = 30) /obj/item/reagent_containers/glass/bottle/magillitis name = "magillitis bottle" desc = "A small bottle. Contains a serum known only as 'magillitis'." - list_reagents = list("magillitis" = 5) + list_reagents = list(/datum/reagent/magillitis = 5) /obj/item/reagent_containers/glass/bottle/venom name = "venom bottle" desc = "A small bottle. Contains Venom." - list_reagents = list("venom" = 30) + list_reagents = list(/datum/reagent/toxin/venom = 30) /obj/item/reagent_containers/glass/bottle/fentanyl name = "fentanyl bottle" desc = "A small bottle. Contains Fentanyl." - list_reagents = list("fentanyl" = 30) + list_reagents = list(/datum/reagent/toxin/fentanyl = 30) /obj/item/reagent_containers/glass/bottle/formaldehyde name = "formaldehyde bottle" desc = "A small bottle. Contains Formaldehyde." - list_reagents = list("formaldehyde" = 30) + list_reagents = list(/datum/reagent/toxin/formaldehyde = 30) /obj/item/reagent_containers/glass/bottle/initropidril name = "initropidril bottle" desc = "A small bottle. Contains initropidril." - list_reagents = list("initropidril" = 30) + list_reagents = list(/datum/reagent/toxin/initropidril = 30) /obj/item/reagent_containers/glass/bottle/pancuronium name = "pancuronium bottle" desc = "A small bottle. Contains pancuronium." - list_reagents = list("pancuronium" = 30) + list_reagents = list(/datum/reagent/toxin/pancuronium = 30) /obj/item/reagent_containers/glass/bottle/sodium_thiopental name = "sodium thiopental bottle" desc = "A small bottle. Contains sodium thiopental." - list_reagents = list("sodium_thiopental" = 30) + list_reagents = list(/datum/reagent/toxin/sodium_thiopental = 30) /obj/item/reagent_containers/glass/bottle/coniine name = "coniine bottle" desc = "A small bottle. Contains coniine." - list_reagents = list("coniine" = 30) + list_reagents = list(/datum/reagent/toxin/coniine = 30) /obj/item/reagent_containers/glass/bottle/curare name = "curare bottle" desc = "A small bottle. Contains curare." - list_reagents = list("curare" = 30) + list_reagents = list(/datum/reagent/toxin/curare = 30) /obj/item/reagent_containers/glass/bottle/amanitin name = "amanitin bottle" desc = "A small bottle. Contains amanitin." - list_reagents = list("amanitin" = 30) + list_reagents = list(/datum/reagent/toxin/amanitin = 30) /obj/item/reagent_containers/glass/bottle/histamine name = "histamine bottle" desc = "A small bottle. Contains Histamine." - list_reagents = list("histamine" = 30) + list_reagents = list(/datum/reagent/toxin/histamine = 30) /obj/item/reagent_containers/glass/bottle/diphenhydramine name = "antihistamine bottle" desc = "A small bottle of diphenhydramine." - list_reagents = list("diphenhydramine" = 30) + list_reagents = list(/datum/reagent/medicine/diphenhydramine = 30) /obj/item/reagent_containers/glass/bottle/potass_iodide name = "anti-radiation bottle" desc = "A small bottle of potassium iodide." - list_reagents = list("potass_iodide" = 30) + list_reagents = list(/datum/reagent/medicine/potass_iodide = 30) /obj/item/reagent_containers/glass/bottle/salglu_solution name = "saline-glucose solution bottle" desc = "A small bottle of saline-glucose solution." icon_state = "bottle1" - list_reagents = list("salglu_solution" = 30) + list_reagents = list(/datum/reagent/medicine/salglu_solution = 30) /obj/item/reagent_containers/glass/bottle/atropine name = "atropine bottle" desc = "A small bottle of atropine." - list_reagents = list("atropine" = 30) + list_reagents = list(/datum/reagent/medicine/atropine = 30) /obj/item/reagent_containers/glass/bottle/romerol name = "romerol bottle" desc = "A small bottle of Romerol. The REAL zombie powder." - list_reagents = list("romerol" = 30) + list_reagents = list(/datum/reagent/romerol = 30) /obj/item/reagent_containers/glass/bottle/random_virus name = "Experimental disease culture bottle" @@ -301,106 +307,106 @@ /obj/item/reagent_containers/glass/bottle/tuberculosiscure name = "BVAK bottle" desc = "A small bottle containing Bio Virus Antidote Kit." - list_reagents = list("atropine" = 5, "epinephrine" = 5, "salbutamol" = 10, "spaceacillin" = 10) + list_reagents = list(/datum/reagent/medicine/atropine = 5, /datum/reagent/medicine/epinephrine = 5, /datum/reagent/medicine/salbutamol = 10, /datum/reagent/medicine/spaceacillin = 10) //Oldstation.dmm chemical storage bottles /obj/item/reagent_containers/glass/bottle/hydrogen name = "hydrogen bottle" - list_reagents = list("hydrogen" = 30) + list_reagents = list(/datum/reagent/hydrogen = 30) /obj/item/reagent_containers/glass/bottle/lithium name = "lithium bottle" - list_reagents = list("lithium" = 30) + list_reagents = list(/datum/reagent/lithium = 30) /obj/item/reagent_containers/glass/bottle/carbon name = "carbon bottle" - list_reagents = list("carbon" = 30) + list_reagents = list(/datum/reagent/carbon = 30) /obj/item/reagent_containers/glass/bottle/nitrogen name = "nitrogen bottle" - list_reagents = list("nitrogen" = 30) + list_reagents = list(/datum/reagent/nitrogen = 30) /obj/item/reagent_containers/glass/bottle/oxygen name = "oxygen bottle" - list_reagents = list("oxygen" = 30) + list_reagents = list(/datum/reagent/oxygen = 30) /obj/item/reagent_containers/glass/bottle/fluorine name = "fluorine bottle" - list_reagents = list("fluorine" = 30) + list_reagents = list(/datum/reagent/fluorine = 30) /obj/item/reagent_containers/glass/bottle/sodium name = "sodium bottle" - list_reagents = list("sodium" = 30) + list_reagents = list(/datum/reagent/sodium = 30) /obj/item/reagent_containers/glass/bottle/aluminium name = "aluminium bottle" - list_reagents = list("aluminium" = 30) + list_reagents = list(/datum/reagent/aluminium = 30) /obj/item/reagent_containers/glass/bottle/silicon name = "silicon bottle" - list_reagents = list("silicon" = 30) + list_reagents = list(/datum/reagent/silicon = 30) /obj/item/reagent_containers/glass/bottle/phosphorus name = "phosphorus bottle" - list_reagents = list("phosphorus" = 30) + list_reagents = list(/datum/reagent/phosphorus = 30) /obj/item/reagent_containers/glass/bottle/sulfur name = "sulfur bottle" - list_reagents = list("sulfur" = 30) + list_reagents = list(/datum/reagent/sulfur = 30) /obj/item/reagent_containers/glass/bottle/chlorine name = "chlorine bottle" - list_reagents = list("chlorine" = 30) + list_reagents = list(/datum/reagent/chlorine = 30) /obj/item/reagent_containers/glass/bottle/potassium name = "potassium bottle" - list_reagents = list("potassium" = 30) + list_reagents = list(/datum/reagent/potassium = 30) /obj/item/reagent_containers/glass/bottle/iron name = "iron bottle" - list_reagents = list("iron" = 30) + list_reagents = list(/datum/reagent/iron = 30) /obj/item/reagent_containers/glass/bottle/copper name = "copper bottle" - list_reagents = list("copper" = 30) + list_reagents = list(/datum/reagent/copper = 30) /obj/item/reagent_containers/glass/bottle/mercury name = "mercury bottle" - list_reagents = list("mercury" = 30) + list_reagents = list(/datum/reagent/mercury = 30) /obj/item/reagent_containers/glass/bottle/radium name = "radium bottle" - list_reagents = list("radium" = 30) + list_reagents = list(/datum/reagent/radium = 30) /obj/item/reagent_containers/glass/bottle/water name = "water bottle" - list_reagents = list("water" = 30) + list_reagents = list(/datum/reagent/water = 30) /obj/item/reagent_containers/glass/bottle/ethanol name = "ethanol bottle" - list_reagents = list("ethanol" = 30) + list_reagents = list(/datum/reagent/consumable/ethanol = 30) /obj/item/reagent_containers/glass/bottle/sugar name = "sugar bottle" - list_reagents = list("sugar" = 30) + list_reagents = list(/datum/reagent/consumable/sugar = 30) /obj/item/reagent_containers/glass/bottle/sacid name = "sulphuric acid bottle" - list_reagents = list("sacid" = 30) + list_reagents = list(/datum/reagent/toxin/acid = 30) /obj/item/reagent_containers/glass/bottle/welding_fuel name = "welding fuel bottle" - list_reagents = list("welding_fuel" = 30) + list_reagents = list(/datum/reagent/fuel = 30) /obj/item/reagent_containers/glass/bottle/silver name = "silver bottle" - list_reagents = list("silver" = 30) + list_reagents = list(/datum/reagent/silver = 30) /obj/item/reagent_containers/glass/bottle/iodine name = "iodine bottle" - list_reagents = list("iodine" = 30) + list_reagents = list(/datum/reagent/iodine = 30) /obj/item/reagent_containers/glass/bottle/bromine name = "bromine bottle" - list_reagents = list("bromine" = 30) + list_reagents = list(/datum/reagent/bromine = 30) diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index a49e19ee..a215d095 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -1,102 +1,102 @@ -/obj/item/reagent_containers/dropper - name = "dropper" - desc = "A dropper. Holds up to 5 units." - icon = 'icons/obj/chemical.dmi' - icon_state = "dropper0" - amount_per_transfer_from_this = 5 - possible_transfer_amounts = list(1, 2, 3, 4, 5) - volume = 5 - reagent_flags = TRANSPARENT - -/obj/item/reagent_containers/dropper/afterattack(obj/target, mob/user , proximity) - . = ..() - if(!proximity) - return - if(!target.reagents) - return - - if(reagents.total_volume > 0) - if(target.reagents.total_volume >= target.reagents.maximum_volume) - to_chat(user, "[target] is full.") - return - - if(!target.is_injectable()) - to_chat(user, "You cannot directly fill [target]!") - return - - var/trans = 0 - var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) - - if(ismob(target)) - if(ishuman(target)) - var/mob/living/carbon/human/victim = target - - var/obj/item/safe_thing = null - if(victim.wear_mask) - if(victim.wear_mask.flags_cover & MASKCOVERSEYES) - safe_thing = victim.wear_mask - if(victim.head) - if(victim.head.flags_cover & MASKCOVERSEYES) - safe_thing = victim.head - if(victim.glasses) - if(!safe_thing) - safe_thing = victim.glasses - - if(safe_thing) - if(!safe_thing.reagents) - safe_thing.create_reagents(100) - - reagents.reaction(safe_thing, TOUCH, fraction) - trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this) - - target.visible_message("[user] tries to squirt something into [target]'s eyes, but fails!", \ - "[user] tries to squirt something into [target]'s eyes, but fails!") - - to_chat(user, "You transfer [trans] unit\s of the solution.") - update_icon() - return - else if(isalien(target)) //hiss-hiss has no eyes! - to_chat(target, "[target] does not seem to have any eyes!") - return - - target.visible_message("[user] squirts something into [target]'s eyes!", \ - "[user] squirts something into [target]'s eyes!") - - reagents.reaction(target, TOUCH, fraction) - var/mob/M = target - var/R - if(reagents) - for(var/datum/reagent/A in src.reagents.reagent_list) - R += A.id + " (" - R += num2text(A.volume) + ")," - log_combat(user, M, "squirted", R) - - trans = src.reagents.trans_to(target, amount_per_transfer_from_this) - to_chat(user, "You transfer [trans] unit\s of the solution.") - update_icon() - - else - - if(!target.is_drawable(FALSE)) //No drawing from mobs here - to_chat(user, "You cannot directly remove reagents from [target].") - return - - if(!target.reagents.total_volume) - to_chat(user, "[target] is empty!") - return - - var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) - - to_chat(user, "You fill [src] with [trans] unit\s of the solution.") - - update_icon() - -/obj/item/reagent_containers/dropper/update_icon() - cut_overlays() - if(reagents.total_volume) - var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "dropper") - filling.color = mix_color_from_reagents(reagents.reagent_list) - add_overlay(filling) - -/obj/item/reagent_containers/dropper/get_belt_overlay() - return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch") +/obj/item/reagent_containers/dropper + name = "dropper" + desc = "A dropper. Holds up to 5 units." + icon = 'icons/obj/chemical.dmi' + icon_state = "dropper0" + amount_per_transfer_from_this = 5 + possible_transfer_amounts = list(1, 2, 3, 4, 5) + volume = 5 + reagent_flags = TRANSPARENT + +/obj/item/reagent_containers/dropper/afterattack(obj/target, mob/user , proximity) + . = ..() + if(!proximity) + return + if(!target.reagents) + return + + if(reagents.total_volume > 0) + if(target.reagents.total_volume >= target.reagents.maximum_volume) + to_chat(user, "[target] is full.") + return + + if(!target.is_injectable()) + to_chat(user, "You cannot directly fill [target]!") + return + + var/trans = 0 + var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) + + if(ismob(target)) + if(ishuman(target)) + var/mob/living/carbon/human/victim = target + + var/obj/item/safe_thing = null + if(victim.wear_mask) + if(victim.wear_mask.flags_cover & MASKCOVERSEYES) + safe_thing = victim.wear_mask + if(victim.head) + if(victim.head.flags_cover & MASKCOVERSEYES) + safe_thing = victim.head + if(victim.glasses) + if(!safe_thing) + safe_thing = victim.glasses + + if(safe_thing) + if(!safe_thing.reagents) + safe_thing.create_reagents(100) + + reagents.reaction(safe_thing, TOUCH, fraction) + trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this) + + target.visible_message("[user] tries to squirt something into [target]'s eyes, but fails!", \ + "[user] tries to squirt something into [target]'s eyes, but fails!") + + to_chat(user, "You transfer [trans] unit\s of the solution.") + update_icon() + return + else if(isalien(target)) //hiss-hiss has no eyes! + to_chat(target, "[target] does not seem to have any eyes!") + return + + target.visible_message("[user] squirts something into [target]'s eyes!", \ + "[user] squirts something into [target]'s eyes!") + + reagents.reaction(target, TOUCH, fraction) + var/mob/M = target + var/R + if(reagents) + for(var/datum/reagent/A in src.reagents.reagent_list) + R += A.type + " (" + R += num2text(A.volume) + ")," + log_combat(user, M, "squirted", R) + + trans = src.reagents.trans_to(target, amount_per_transfer_from_this) + to_chat(user, "You transfer [trans] unit\s of the solution.") + update_icon() + + else + + if(!target.is_drawable(FALSE)) //No drawing from mobs here + to_chat(user, "You cannot directly remove reagents from [target].") + return + + if(!target.reagents.total_volume) + to_chat(user, "[target] is empty!") + return + + var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) + + to_chat(user, "You fill [src] with [trans] unit\s of the solution.") + + update_icon() + +/obj/item/reagent_containers/dropper/update_icon() + cut_overlays() + if(reagents.total_volume) + var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "dropper") + filling.color = mix_color_from_reagents(reagents.reagent_list) + add_overlay(filling) + +/obj/item/reagent_containers/dropper/get_belt_overlay() + return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch") diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 1af079ff..0cc1df51 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -1,370 +1,374 @@ -/obj/item/reagent_containers/glass - name = "glass" - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(5, 10, 15, 20, 25, 30, 50) - volume = 50 - reagent_flags = OPENCONTAINER - spillable = TRUE - resistance_flags = ACID_PROOF - container_HP = 2 - - -/obj/item/reagent_containers/glass/attack(mob/M, mob/user, obj/target) - if(!canconsume(M, user)) - return - - if(!spillable) - return - - if(!reagents || !reagents.total_volume) - to_chat(user, "[src] is empty!") - return - - if(istype(M)) - if(user.a_intent == INTENT_HARM) - M.visible_message("[user] splashes the contents of [src] onto [M]!", \ - "[user] splashes the contents of [src] onto [M]!") - var/R = reagents?.log_list() - if(isturf(target) && reagents.reagent_list.len && thrownby) - log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") - message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") - reagents.reaction(M, TOUCH) - log_combat(user, M, "splashed", R) - reagents.clear_reagents() - else - if(M != user) - M.visible_message("[user] attempts to feed something to [M].", \ - "[user] attempts to feed something to you.") - if(!do_mob(user, M)) - return - if(!reagents || !reagents.total_volume) - return // The drink might be empty after the delay, such as by spam-feeding - M.visible_message("[user] feeds something to [M].", "[user] feeds something to you.") - log_combat(user, M, "fed", reagents.log_list()) - else - to_chat(user, "You swallow a gulp of [src].") - var/fraction = min(5/reagents.total_volume, 1) - reagents.reaction(M, INGEST, fraction) - addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5) - playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) - -/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity) - . = ..() - if((!proximity) || !check_allowed_items(target,target_self=1)) - return - - if(target.is_refillable()) //Something like a glass. Player probably wants to transfer TO it. - if(!reagents.total_volume) - to_chat(user, "[src] is empty!") - return - - if(target.reagents.holder_full()) - to_chat(user, "[target] is full.") - return - - var/trans = reagents.trans_to(target, amount_per_transfer_from_this) - to_chat(user, "You transfer [trans] unit\s of the solution to [target].") - - else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us. - if(!target.reagents.total_volume) - to_chat(user, "[target] is empty and can't be refilled!") - return - - if(reagents.holder_full()) - to_chat(user, "[src] is full.") - return - - var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) - to_chat(user, "You fill [src] with [trans] unit\s of the contents of [target].") - - else if(reagents.total_volume) - if(user.a_intent == INTENT_HARM) - user.visible_message("[user] splashes the contents of [src] onto [target]!", \ - "You splash the contents of [src] onto [target].") - reagents.reaction(target, TOUCH) - reagents.clear_reagents() - -/obj/item/reagent_containers/glass/attackby(obj/item/I, mob/user, params) - var/hotness = I.is_hot() - if(hotness && reagents) - reagents.expose_temperature(hotness) - to_chat(user, "You heat [name] with [I]!") - - if(istype(I, /obj/item/reagent_containers/food/snacks/egg)) //breaking eggs - var/obj/item/reagent_containers/food/snacks/egg/E = I - if(reagents) - if(reagents.total_volume >= reagents.maximum_volume) - to_chat(user, "[src] is full.") - else - to_chat(user, "You break [E] in [src].") - E.reagents.trans_to(src, E.reagents.total_volume) - qdel(E) - return - ..() - - -/obj/item/reagent_containers/glass/beaker - name = "beaker" - desc = "A beaker. It can hold up to 50 units. Unable to withstand extreme pHes" - icon = 'icons/obj/chemical.dmi' - icon_state = "beaker" - item_state = "beaker" - materials = list(MAT_GLASS=500) - beaker_weakness_bitflag = PH_WEAK - -/obj/item/reagent_containers/glass/beaker/Initialize() - . = ..() - update_icon() - -/obj/item/reagent_containers/glass/beaker/get_part_rating() - return reagents.maximum_volume - -/obj/item/reagent_containers/glass/beaker/on_reagent_change(changetype) - update_icon() - -/obj/item/reagent_containers/glass/beaker/update_icon() - if(!cached_icon) - cached_icon = icon_state - cut_overlays() - - if(reagents.total_volume) - var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[cached_icon]10") - - var/percent = round((reagents.total_volume / volume) * 100) - switch(percent) - if(0 to 9) - filling.icon_state = "[cached_icon]-10" - if(10 to 24) - filling.icon_state = "[cached_icon]10" - if(25 to 49) - filling.icon_state = "[cached_icon]25" - if(50 to 74) - filling.icon_state = "[cached_icon]50" - if(75 to 79) - filling.icon_state = "[cached_icon]75" - if(80 to 90) - filling.icon_state = "[cached_icon]80" - if(91 to INFINITY) - filling.icon_state = "[cached_icon]100" - - filling.color = mix_color_from_reagents(reagents.reagent_list) - add_overlay(filling) - -/obj/item/reagent_containers/glass/beaker/jar - name = "honey jar" - desc = "A jar for honey. It can hold up to 50 units of sweet delight. Unable to withstand reagents of an extreme pH." - icon = 'icons/obj/chemical.dmi' - icon_state = "vapour" - -/obj/item/reagent_containers/glass/beaker/large - name = "large beaker" - desc = "A large beaker. Can hold up to 100 units. Unable to withstand reagents of an extreme pH." - icon_state = "beakerlarge" - materials = list(MAT_GLASS=2500) - volume = 100 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(5,10,15,20,25,30,50,100) - container_HP = 3 - -/obj/item/reagent_containers/glass/beaker/plastic - name = "x-large beaker" - desc = "An extra-large beaker. Can hold up to 150 units. Is able to resist acid and alkaline solutions, but melts at 444K" - icon_state = "beakerwhite" - materials = list(MAT_GLASS=2500, MAT_PLASTIC=3000) - volume = 150 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(5,10,15,20,25,30,50,100,150) - -/obj/item/reagent_containers/glass/beaker/plastic/Initialize() - beaker_weakness_bitflag &= ~PH_WEAK - beaker_weakness_bitflag |= TEMP_WEAK - . = ..() - -/obj/item/reagent_containers/glass/beaker/plastic/update_icon() - icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states - ..() - icon_state = "beakerwhite" - -/obj/item/reagent_containers/glass/beaker/meta - name = "metamaterial beaker" - desc = "A large beaker. Can hold up to 200 units. Is able to withstand all chemical situations." - icon_state = "beakergold" - materials = list(MAT_GLASS=2500, MAT_PLASTIC=3000, MAT_GOLD=1000, MAT_TITANIUM=1000) - volume = 200 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(5,10,15,20,25,30,50,100,200) - -/obj/item/reagent_containers/glass/beaker/meta/Initialize() - beaker_weakness_bitflag &= ~PH_WEAK - . = ..() - -/obj/item/reagent_containers/glass/beaker/noreact - name = "cryostasis beaker" - desc = "A cryostasis beaker that allows for chemical storage without \ - reactions. Can hold up to 50 units." - icon_state = "beakernoreact" - materials = list(MAT_METAL=3000) - reagent_flags = OPENCONTAINER | NO_REACT - volume = 50 - amount_per_transfer_from_this = 10 - container_HP = 10//shouldn't be needed - -/obj/item/reagent_containers/glass/beaker/noreact/Initialize() - beaker_weakness_bitflag &= ~PH_WEAK - . = ..() - //reagents.set_reacting(FALSE) was this removed in a recent pr? - -/obj/item/reagent_containers/glass/beaker/bluespace - name = "bluespace beaker" - desc = "A bluespace beaker, powered by experimental bluespace technology \ - and Element Cuban combined with the Compound Pete. Can hold up to \ - 300 units. Unable to withstand reagents of an extreme pH." - icon_state = "beakerbluespace" - materials = list(MAT_GLASS=3000) - volume = 300 - amount_per_transfer_from_this = 10 - possible_transfer_amounts = list(5,10,15,20,25,30,50,100,300) - container_HP = 4 - -/obj/item/reagent_containers/glass/beaker/cryoxadone - list_reagents = list("cryoxadone" = 30) - -/obj/item/reagent_containers/glass/beaker/sulphuric - list_reagents = list("sacid" = 50) - -/obj/item/reagent_containers/glass/beaker/slime - list_reagents = list("slimejelly" = 50) - -/obj/item/reagent_containers/glass/beaker/large/styptic - name = "styptic reserve tank" - list_reagents = list("styptic_powder" = 50) - -/obj/item/reagent_containers/glass/beaker/large/silver_sulfadiazine - name = "silver sulfadiazine reserve tank" - list_reagents = list("silver_sulfadiazine" = 50) - -/obj/item/reagent_containers/glass/beaker/large/charcoal - name = "charcoal reserve tank" - list_reagents = list("charcoal" = 50) - -/obj/item/reagent_containers/glass/beaker/large/epinephrine - name = "epinephrine reserve tank" - list_reagents = list("epinephrine" = 50) - -/obj/item/reagent_containers/glass/beaker/synthflesh - list_reagents = list("synthflesh" = 50) - -/obj/item/reagent_containers/glass/bucket - name = "bucket" - desc = "It's a bucket." - icon = 'icons/obj/janitor.dmi' - icon_state = "bucket" - item_state = "bucket" - lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' - materials = list(MAT_METAL=200) - w_class = WEIGHT_CLASS_NORMAL - amount_per_transfer_from_this = 20 - possible_transfer_amounts = list(5,10,15,20,25,30,50,70) - volume = 70 - flags_inv = HIDEHAIR - slot_flags = ITEM_SLOT_HEAD - resistance_flags = NONE - armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 50) //Weak melee protection, because you can wear it on your head - slot_equipment_priority = list( \ - SLOT_BACK, SLOT_WEAR_ID,\ - SLOT_W_UNIFORM, SLOT_WEAR_SUIT,\ - SLOT_WEAR_MASK, SLOT_HEAD, SLOT_NECK,\ - SLOT_SHOES, SLOT_GLOVES,\ - SLOT_EARS, SLOT_GLASSES,\ - SLOT_BELT, SLOT_S_STORE,\ - SLOT_L_STORE, SLOT_R_STORE,\ - SLOT_GENERC_DEXTROUS_STORAGE - ) - container_HP = 1 - -/obj/item/reagent_containers/glass/bucket/Initialize() - beaker_weakness_bitflag |= TEMP_WEAK - . = ..() - -/obj/item/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params) - if(istype(O, /obj/item/mop)) - if(reagents.total_volume < 1) - to_chat(user, "[src] is out of water!") - else - reagents.trans_to(O, 5) - to_chat(user, "You wet [O] in [src].") - playsound(loc, 'sound/effects/slosh.ogg', 25, 1) - else if(isprox(O)) - to_chat(user, "You add [O] to [src].") - qdel(O) - qdel(src) - user.put_in_hands(new /obj/item/bot_assembly/cleanbot) - else - ..() - -/obj/item/reagent_containers/glass/bucket/equipped(mob/user, slot) - ..() - if (slot == SLOT_HEAD) - if(reagents.total_volume) - to_chat(user, "[src]'s contents spill all over you!") - reagents.reaction(user, TOUCH) - reagents.clear_reagents() - reagent_flags = NONE - -/obj/item/reagent_containers/glass/bucket/dropped(mob/user) - . = ..() - reagent_flags = initial(reagent_flags) - -/obj/item/reagent_containers/glass/bucket/equip_to_best_slot(var/mob/M) - if(reagents.total_volume) //If there is water in a bucket, don't quick equip it to the head - var/index = slot_equipment_priority.Find(SLOT_HEAD) - slot_equipment_priority.Remove(SLOT_HEAD) - . = ..() - slot_equipment_priority.Insert(index, SLOT_HEAD) - return - return ..() - -/obj/item/reagent_containers/glass/beaker/waterbottle - name = "bottle of water" - desc = "A bottle of water filled at an old Earth bottling facility." - icon = 'icons/obj/drinks.dmi' - icon_state = "smallbottle" - item_state = "bottle" - list_reagents = list("water" = 49.5, "fluorine" = 0.5)//see desc, don't think about it too hard - materials = list(MAT_GLASS=0) - volume = 50 - amount_per_transfer_from_this = 10 - container_HP = 1 - -/obj/item/reagent_containers/glass/beaker/waterbottle/Initialize() - beaker_weakness_bitflag |= TEMP_WEAK - . = ..() - -/obj/item/reagent_containers/glass/beaker/waterbottle/empty - list_reagents = list() - -/obj/item/reagent_containers/glass/beaker/waterbottle/large - desc = "A fresh commercial-sized bottle of water." - icon_state = "largebottle" - materials = list(MAT_GLASS=0) - list_reagents = list("water" = 100) - volume = 100 - amount_per_transfer_from_this = 20 - container_HP = 1 - -/obj/item/reagent_containers/glass/beaker/waterbottle/large/empty - list_reagents = list() - -/obj/item/reagent_containers/glass/beaker/waterbottle/wataur - name = "Bottled Wataur" - desc = "Finally, a bottle as proportionate as you. Incredible!" - icon = 'icons/obj/drinks.dmi' - icon_state = "wataur" - list_reagents = list("water" = 100) //robust ass wataur - volume = 100 - amount_per_transfer_from_this = 20 - container_HP = 1 - -/obj/item/reagent_containers/glass/get_belt_overlay() - return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "bottle") +/obj/item/reagent_containers/glass + name = "glass" + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(5, 10, 15, 20, 25, 30, 50) + volume = 50 + reagent_flags = OPENCONTAINER + spillable = TRUE + resistance_flags = ACID_PROOF + container_HP = 2 + + +/obj/item/reagent_containers/glass/attack(mob/M, mob/user, obj/target) + if(!canconsume(M, user)) + return + + if(!spillable) + return + + if(!reagents || !reagents.total_volume) + to_chat(user, "[src] is empty!") + return + + if(istype(M)) + if(user.a_intent == INTENT_HARM) + M.visible_message("[user] splashes the contents of [src] onto [M]!", \ + "[user] splashes the contents of [src] onto [M]!") + var/R = reagents?.log_list() + if(reagents) + for(var/datum/reagent/A in reagents.reagent_list) + R += A.type + " (" + R += num2text(A.volume) + ")," + if(isturf(target) && reagents.reagent_list.len && thrownby) + log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") + message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") + reagents.reaction(M, TOUCH) + log_combat(user, M, "splashed", R) + reagents.clear_reagents() + else + if(M != user) + M.visible_message("[user] attempts to feed something to [M].", \ + "[user] attempts to feed something to you.") + if(!do_mob(user, M)) + return + if(!reagents || !reagents.total_volume) + return // The drink might be empty after the delay, such as by spam-feeding + M.visible_message("[user] feeds something to [M].", "[user] feeds something to you.") + log_combat(user, M, "fed", reagents.log_list()) + else + to_chat(user, "You swallow a gulp of [src].") + var/fraction = min(5/reagents.total_volume, 1) + reagents.reaction(M, INGEST, fraction) + addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5) + playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) + +/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity) + . = ..() + if((!proximity) || !check_allowed_items(target,target_self=1)) + return + + if(target.is_refillable()) //Something like a glass. Player probably wants to transfer TO it. + if(!reagents.total_volume) + to_chat(user, "[src] is empty!") + return + + if(target.reagents.holder_full()) + to_chat(user, "[target] is full.") + return + + var/trans = reagents.trans_to(target, amount_per_transfer_from_this) + to_chat(user, "You transfer [trans] unit\s of the solution to [target].") + + else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us. + if(!target.reagents.total_volume) + to_chat(user, "[target] is empty and can't be refilled!") + return + + if(reagents.holder_full()) + to_chat(user, "[src] is full.") + return + + var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) + to_chat(user, "You fill [src] with [trans] unit\s of the contents of [target].") + + else if(reagents.total_volume) + if(user.a_intent == INTENT_HARM) + user.visible_message("[user] splashes the contents of [src] onto [target]!", \ + "You splash the contents of [src] onto [target].") + reagents.reaction(target, TOUCH) + reagents.clear_reagents() + +/obj/item/reagent_containers/glass/attackby(obj/item/I, mob/user, params) + var/hotness = I.is_hot() + if(hotness && reagents) + reagents.expose_temperature(hotness) + to_chat(user, "You heat [name] with [I]!") + + if(istype(I, /obj/item/reagent_containers/food/snacks/egg)) //breaking eggs + var/obj/item/reagent_containers/food/snacks/egg/E = I + if(reagents) + if(reagents.total_volume >= reagents.maximum_volume) + to_chat(user, "[src] is full.") + else + to_chat(user, "You break [E] in [src].") + E.reagents.trans_to(src, E.reagents.total_volume) + qdel(E) + return + ..() + + +/obj/item/reagent_containers/glass/beaker + name = "beaker" + desc = "A beaker. It can hold up to 50 units. Unable to withstand extreme pHes" + icon = 'icons/obj/chemical.dmi' + icon_state = "beaker" + item_state = "beaker" + materials = list(MAT_GLASS=500) + beaker_weakness_bitflag = PH_WEAK + +/obj/item/reagent_containers/glass/beaker/Initialize() + . = ..() + update_icon() + +/obj/item/reagent_containers/glass/beaker/get_part_rating() + return reagents.maximum_volume + +/obj/item/reagent_containers/glass/beaker/on_reagent_change(changetype) + update_icon() + +/obj/item/reagent_containers/glass/beaker/update_icon() + if(!cached_icon) + cached_icon = icon_state + cut_overlays() + + if(reagents.total_volume) + var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[cached_icon]10") + + var/percent = round((reagents.total_volume / volume) * 100) + switch(percent) + if(0 to 9) + filling.icon_state = "[cached_icon]-10" + if(10 to 24) + filling.icon_state = "[cached_icon]10" + if(25 to 49) + filling.icon_state = "[cached_icon]25" + if(50 to 74) + filling.icon_state = "[cached_icon]50" + if(75 to 79) + filling.icon_state = "[cached_icon]75" + if(80 to 90) + filling.icon_state = "[cached_icon]80" + if(91 to INFINITY) + filling.icon_state = "[cached_icon]100" + + filling.color = mix_color_from_reagents(reagents.reagent_list) + add_overlay(filling) + +/obj/item/reagent_containers/glass/beaker/jar + name = "honey jar" + desc = "A jar for honey. It can hold up to 50 units of sweet delight. Unable to withstand reagents of an extreme pH." + icon = 'icons/obj/chemical.dmi' + icon_state = "vapour" + +/obj/item/reagent_containers/glass/beaker/large + name = "large beaker" + desc = "A large beaker. Can hold up to 100 units. Unable to withstand reagents of an extreme pH." + icon_state = "beakerlarge" + materials = list(MAT_GLASS=2500) + volume = 100 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(5,10,15,20,25,30,50,100) + container_HP = 3 + +/obj/item/reagent_containers/glass/beaker/plastic + name = "x-large beaker" + desc = "An extra-large beaker. Can hold up to 150 units. Is able to resist acid and alkaline solutions, but melts at 444K" + icon_state = "beakerwhite" + materials = list(MAT_GLASS=2500, MAT_PLASTIC=3000) + volume = 150 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(5,10,15,20,25,30,50,100,150) + +/obj/item/reagent_containers/glass/beaker/plastic/Initialize() + beaker_weakness_bitflag &= ~PH_WEAK + beaker_weakness_bitflag |= TEMP_WEAK + . = ..() + +/obj/item/reagent_containers/glass/beaker/plastic/update_icon() + icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states + ..() + icon_state = "beakerwhite" + +/obj/item/reagent_containers/glass/beaker/meta + name = "metamaterial beaker" + desc = "A large beaker. Can hold up to 200 units. Is able to withstand all chemical situations." + icon_state = "beakergold" + materials = list(MAT_GLASS=2500, MAT_PLASTIC=3000, MAT_GOLD=1000, MAT_TITANIUM=1000) + volume = 200 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(5,10,15,20,25,30,50,100,200) + +/obj/item/reagent_containers/glass/beaker/meta/Initialize() + beaker_weakness_bitflag &= ~PH_WEAK + . = ..() + +/obj/item/reagent_containers/glass/beaker/noreact + name = "cryostasis beaker" + desc = "A cryostasis beaker that allows for chemical storage without \ + reactions. Can hold up to 50 units." + icon_state = "beakernoreact" + materials = list(MAT_METAL=3000) + reagent_flags = OPENCONTAINER | NO_REACT + volume = 50 + amount_per_transfer_from_this = 10 + container_HP = 10//shouldn't be needed + +/obj/item/reagent_containers/glass/beaker/noreact/Initialize() + beaker_weakness_bitflag &= ~PH_WEAK + . = ..() + //reagents.set_reacting(FALSE) was this removed in a recent pr? + +/obj/item/reagent_containers/glass/beaker/bluespace + name = "bluespace beaker" + desc = "A bluespace beaker, powered by experimental bluespace technology \ + and Element Cuban combined with the Compound Pete. Can hold up to \ + 300 units. Unable to withstand reagents of an extreme pH." + icon_state = "beakerbluespace" + materials = list(MAT_GLASS=3000) + volume = 300 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = list(5,10,15,20,25,30,50,100,300) + container_HP = 4 + +/obj/item/reagent_containers/glass/beaker/cryoxadone + list_reagents = list(/datum/reagent/medicine/cryoxadone = 30) + +/obj/item/reagent_containers/glass/beaker/sulphuric + list_reagents = list(/datum/reagent/toxin/acid = 50) + +/obj/item/reagent_containers/glass/beaker/slime + list_reagents = list(/datum/reagent/toxin/slimejelly = 50) + +/obj/item/reagent_containers/glass/beaker/large/styptic + name = "styptic reserve tank" + list_reagents = list(/datum/reagent/medicine/styptic_powder = 50) + +/obj/item/reagent_containers/glass/beaker/large/silver_sulfadiazine + name = "silver sulfadiazine reserve tank" + list_reagents = list(/datum/reagent/medicine/silver_sulfadiazine = 50) + +/obj/item/reagent_containers/glass/beaker/large/charcoal + name = "charcoal reserve tank" + list_reagents = list(/datum/reagent/medicine/charcoal = 50) + +/obj/item/reagent_containers/glass/beaker/large/epinephrine + name = "epinephrine reserve tank" + list_reagents = list(/datum/reagent/medicine/epinephrine = 50) + +/obj/item/reagent_containers/glass/beaker/synthflesh + list_reagents = list(/datum/reagent/medicine/synthflesh = 50) + +/obj/item/reagent_containers/glass/bucket + name = "bucket" + desc = "It's a bucket." + icon = 'icons/obj/janitor.dmi' + icon_state = "bucket" + item_state = "bucket" + lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' + materials = list(MAT_METAL=200) + w_class = WEIGHT_CLASS_NORMAL + amount_per_transfer_from_this = 20 + possible_transfer_amounts = list(5,10,15,20,25,30,50,70) + volume = 70 + flags_inv = HIDEHAIR + slot_flags = ITEM_SLOT_HEAD + resistance_flags = NONE + armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 50) //Weak melee protection, because you can wear it on your head + slot_equipment_priority = list( \ + SLOT_BACK, SLOT_WEAR_ID,\ + SLOT_W_UNIFORM, SLOT_WEAR_SUIT,\ + SLOT_WEAR_MASK, SLOT_HEAD, SLOT_NECK,\ + SLOT_SHOES, SLOT_GLOVES,\ + SLOT_EARS, SLOT_GLASSES,\ + SLOT_BELT, SLOT_S_STORE,\ + SLOT_L_STORE, SLOT_R_STORE,\ + SLOT_GENERC_DEXTROUS_STORAGE + ) + container_HP = 1 + +/obj/item/reagent_containers/glass/bucket/Initialize() + beaker_weakness_bitflag |= TEMP_WEAK + . = ..() + +/obj/item/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params) + if(istype(O, /obj/item/mop)) + if(reagents.total_volume < 1) + to_chat(user, "[src] is out of water!") + else + reagents.trans_to(O, 5) + to_chat(user, "You wet [O] in [src].") + playsound(loc, 'sound/effects/slosh.ogg', 25, 1) + else if(isprox(O)) + to_chat(user, "You add [O] to [src].") + qdel(O) + qdel(src) + user.put_in_hands(new /obj/item/bot_assembly/cleanbot) + else + ..() + +/obj/item/reagent_containers/glass/bucket/equipped(mob/user, slot) + ..() + if (slot == SLOT_HEAD) + if(reagents.total_volume) + to_chat(user, "[src]'s contents spill all over you!") + reagents.reaction(user, TOUCH) + reagents.clear_reagents() + reagent_flags = NONE + +/obj/item/reagent_containers/glass/bucket/dropped(mob/user) + . = ..() + reagent_flags = initial(reagent_flags) + +/obj/item/reagent_containers/glass/bucket/equip_to_best_slot(var/mob/M) + if(reagents.total_volume) //If there is water in a bucket, don't quick equip it to the head + var/index = slot_equipment_priority.Find(SLOT_HEAD) + slot_equipment_priority.Remove(SLOT_HEAD) + . = ..() + slot_equipment_priority.Insert(index, SLOT_HEAD) + return + return ..() + +/obj/item/reagent_containers/glass/beaker/waterbottle + name = "bottle of water" + desc = "A bottle of water filled at an old Earth bottling facility." + icon = 'icons/obj/drinks.dmi' + icon_state = "smallbottle" + item_state = "bottle" + list_reagents = list(/datum/reagent/water = 49.5, /datum/reagent/fluorine = 0.5)//see desc, don't think about it too hard + materials = list(MAT_GLASS=0) + volume = 50 + amount_per_transfer_from_this = 10 + container_HP = 1 + +/obj/item/reagent_containers/glass/beaker/waterbottle/Initialize() + beaker_weakness_bitflag |= TEMP_WEAK + . = ..() + +/obj/item/reagent_containers/glass/beaker/waterbottle/empty + list_reagents = list() + +/obj/item/reagent_containers/glass/beaker/waterbottle/large + desc = "A fresh commercial-sized bottle of water." + icon_state = "largebottle" + materials = list(MAT_GLASS=0) + list_reagents = list(/datum/reagent/water = 100) + volume = 100 + amount_per_transfer_from_this = 20 + container_HP = 1 + +/obj/item/reagent_containers/glass/beaker/waterbottle/large/empty + list_reagents = list() + +/obj/item/reagent_containers/glass/beaker/waterbottle/wataur + name = "Bottled Wataur" + desc = "Finally, a bottle as proportionate as you. Incredible!" + icon = 'icons/obj/drinks.dmi' + icon_state = "wataur" + list_reagents = list("water" = 100) //robust ass wataur + volume = 100 + amount_per_transfer_from_this = 20 + container_HP = 1 + +/obj/item/reagent_containers/glass/get_belt_overlay() + return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "bottle") diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 96491d98..432a35ea 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -1,600 +1,592 @@ -/obj/item/reagent_containers/hypospray - name = "hypospray" - desc = "The DeForest Medical Corporation hypospray is a sterile, air-needle autoinjector for rapid administration of drugs to patients." - icon = 'icons/obj/syringe.dmi' - item_state = "hypo" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - icon_state = "hypo" - amount_per_transfer_from_this = 5 - volume = 30 - possible_transfer_amounts = list() - resistance_flags = ACID_PROOF - reagent_flags = OPENCONTAINER - slot_flags = ITEM_SLOT_BELT - var/ignore_flags = 0 - var/infinite = FALSE - -/obj/item/reagent_containers/hypospray/attack_paw(mob/user) - return attack_hand(user) - -/obj/item/reagent_containers/hypospray/attack(mob/living/M, mob/user) - if(!reagents.total_volume) - to_chat(user, "[src] is empty!") - return - if(!iscarbon(M)) - return - - //Always log attemped injects for admins - var/list/injected = list() - for(var/datum/reagent/R in reagents.reagent_list) - injected += R.name - var/contained = english_list(injected) - log_combat(user, M, "attempted to inject", src, "([contained])") - - if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1))) // Ignore flag should be checked first or there will be an error message. - to_chat(M, "You feel a tiny prick!") - to_chat(user, "You inject [M] with [src].") - - var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) - reagents.reaction(M, INJECT, fraction) - if(M.reagents) - var/trans = 0 - if(!infinite) - trans = reagents.trans_to(M, amount_per_transfer_from_this) - else - trans = reagents.copy_to(M, amount_per_transfer_from_this) - - to_chat(user, "[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src].") - - - log_combat(user, M, "injected", src, "([contained])") - -/obj/item/reagent_containers/hypospray/CMO - list_reagents = list("omnizine" = 30) - resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF - -/obj/item/reagent_containers/hypospray/combat - name = "combat stimulant injector" - desc = "A modified air-needle autoinjector, used by support operatives to quickly heal injuries in combat." - amount_per_transfer_from_this = 10 - icon_state = "combat_hypo" - volume = 90 - ignore_flags = 1 // So they can heal their comrades. - list_reagents = list("epinephrine" = 30, "omnizine" = 30, "leporazine" = 15, "atropine" = 15) - -/obj/item/reagent_containers/hypospray/combat/nanites - desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with experimental medical compounds for rapid healing." - volume = 100 - list_reagents = list("quantum_heal" = 80, "synaptizine" = 20) - -/obj/item/reagent_containers/hypospray/magillitis - name = "experimental autoinjector" - desc = "A modified air-needle autoinjector with a small single-use reservoir. It contains an experimental serum." - icon_state = "combat_hypo" - volume = 5 - reagent_flags = NONE - list_reagents = list("magillitis" = 5) - -//MediPens - -/obj/item/reagent_containers/hypospray/medipen - name = "epinephrine medipen" - desc = "A rapid and safe way to stabilize patients in critical condition for personnel without advanced medical knowledge. Also useful for preventing organ decay in the deceased." - icon_state = "medipen" - item_state = "medipen" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - amount_per_transfer_from_this = 11 - volume = 11 - ignore_flags = 1 //so you can medipen through hardsuits - reagent_flags = DRAWABLE - flags_1 = null - list_reagents = list("epinephrine" = 10, "formaldehyde" = 1) - -/obj/item/reagent_containers/hypospray/medipen/suicide_act(mob/living/carbon/user) - user.visible_message("[user] begins to choke on \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return OXYLOSS//ironic. he could save others from oxyloss, but not himself. - -/obj/item/reagent_containers/hypospray/medipen/attack(mob/M, mob/user) - if(!reagents.total_volume) - to_chat(user, "[src] is empty!") - return - ..() - if(!iscyborg(user)) - reagents.maximum_volume = 0 //Makes them useless afterwards - reagent_flags = NONE - update_icon() - addtimer(CALLBACK(src, .proc/cyborg_recharge, user), 80) - -/obj/item/reagent_containers/hypospray/medipen/proc/cyborg_recharge(mob/living/silicon/robot/user) - if(!reagents.total_volume && iscyborg(user)) - var/mob/living/silicon/robot/R = user - if(R.cell.use(100)) - reagents.add_reagent_list(list_reagents) - update_icon() - -/obj/item/reagent_containers/hypospray/medipen/update_icon() - if(reagents.total_volume > 0) - icon_state = initial(icon_state) - else - icon_state = "[initial(icon_state)]0" - -/obj/item/reagent_containers/hypospray/medipen/examine() - . = ..() - if(reagents && reagents.reagent_list.len) - . += "It is currently loaded." - else - . += "It is spent." - -/obj/item/reagent_containers/hypospray/medipen/stimulants - name = "illegal stimpack medipen" - desc = "A highly illegal medipen due to its load and small injections, allow for five uses before being drained" - volume = 50 - amount_per_transfer_from_this = 10 - list_reagents = list("stimulants" = 50) - -/obj/item/reagent_containers/hypospray/medipen/stimulants/baseball - name = "the reason the syndicate major league team wins." - desc = "They say drugs never win, but look where you are now, then where they are." - icon_state = "baseballstim" - volume = 50 - amount_per_transfer_from_this = 50 - list_reagents = list("stimulants" = 50) - -/obj/item/reagent_containers/hypospray/medipen/stimpack //goliath kiting - name = "stimpack medipen" - desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor." - icon_state = "stimpen" - volume = 20 - amount_per_transfer_from_this = 20 - list_reagents = list("ephedrine" = 10, "coffee" = 10) - -/obj/item/reagent_containers/hypospray/medipen/stimpack/traitor - desc = "A modified stimulants autoinjector for use in combat situations. Has a mild healing effect." - list_reagents = list("stimulants" = 10, "omnizine" = 10) - -/obj/item/reagent_containers/hypospray/medipen/morphine - name = "morphine medipen" - desc = "A rapid way to get you out of a tight situation and fast! You'll feel rather drowsy, though." - list_reagents = list("morphine" = 10) - -/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure - name = "BVAK autoinjector" - desc = "Bio Virus Antidote Kit autoinjector. Has a two use system for yourself, and someone else. Inject when infected." - icon_state = "stimpen" - volume = 60 - amount_per_transfer_from_this = 30 - list_reagents = list("atropine" = 10, "epinephrine" = 10, "salbutamol" = 20, "spaceacillin" = 20) - -/obj/item/reagent_containers/hypospray/medipen/survival - name = "survival medipen" - desc = "A medipen for surviving in the harshest of environments, heals and protects from environmental hazards. WARNING: Do not inject more than one pen in quick succession." - icon_state = "stimpen" - volume = 52 - amount_per_transfer_from_this = 52 - list_reagents = list("salbutamol" = 10, "leporazine" = 15, "neo_jelly" = 15, "epinephrine" = 10, "lavaland_extract" = 2) - -/obj/item/reagent_containers/hypospray/medipen/species_mutator - name = "species mutator medipen" - desc = "Embark on a whirlwind tour of racial insensitivity by \ - literally appropriating other races." - volume = 1 - amount_per_transfer_from_this = 1 - list_reagents = list("unstablemutationtoxin" = 1) - -/obj/item/reagent_containers/hypospray/medipen/firelocker - name = "fire treatment medipen" - desc = "A medipen that has been fulled with burn healing chemicals for personnel without advanced medical knowledge." - volume = 15 - amount_per_transfer_from_this = 15 - list_reagents = list("oxandrolone" = 5, "kelotane" = 10) - -/obj/item/reagent_containers/hypospray/combat/heresypurge - name = "holy water autoinjector" - desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with 5 doses of a holy water mixture." - volume = 250 - list_reagents = list("holywater" = 150, "tiresolution" = 50, "dizzysolution" = 50) - amount_per_transfer_from_this = 50 - -#define HYPO_SPRAY 0 -#define HYPO_INJECT 1 - -#define WAIT_SPRAY 25 -#define WAIT_INJECT 25 -#define SELF_SPRAY 15 -#define SELF_INJECT 15 - -#define DELUXE_WAIT_SPRAY 20 -#define DELUXE_WAIT_INJECT 20 -#define DELUXE_SELF_SPRAY 10 -#define DELUXE_SELF_INJECT 10 - -#define COMBAT_WAIT_SPRAY 0 -#define COMBAT_WAIT_INJECT 0 -#define COMBAT_SELF_SPRAY 0 -#define COMBAT_SELF_INJECT 0 - -//A vial-loaded hypospray. Cartridge-based! -/obj/item/hypospray/mkii - name = "hypospray mk.II" - icon_state = "hypo2" - icon = 'icons/obj/syringe.dmi' - desc = "A new development from DeForest Medical, this hypospray takes 30-unit vials as the drug supply for easy swapping." - w_class = WEIGHT_CLASS_TINY - var/list/allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small) - var/mode = HYPO_INJECT - var/obj/item/reagent_containers/glass/bottle/vial/vial - var/start_vial = /obj/item/reagent_containers/glass/bottle/vial/small - var/spawnwithvial = TRUE - var/inject_wait = WAIT_INJECT - var/spray_wait = WAIT_SPRAY - var/spray_self = SELF_SPRAY - var/inject_self = SELF_INJECT - var/quickload = FALSE - var/penetrates = FALSE - var/reloadable = TRUE - -/obj/item/hypospray/mkii/brute - start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine - -/obj/item/hypospray/mkii/toxin - start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin - -/obj/item/hypospray/mkii/oxygen - start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin - -/obj/item/hypospray/mkii/burn - start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane - -/obj/item/hypospray/mkii/tricord - start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord - -/obj/item/hypospray/mkii/enlarge - spawnwithvial = FALSE - -//A vial-loaded hypospray. Cartridge-based! -/obj/item/hypospray/mkii/disposable - name = "disposable hypospray mk.II" - icon_state = "hypo2" - desc = "A cheaply made knock off verson of the MKII hypospray. You cannot remove a hypovial from it making it nonreusable." - w_class = WEIGHT_CLASS_TINY - spawnwithvial = FALSE - reloadable = FALSE - -/obj/item/hypospray/mkii/CMO - name = "hypospray mk.II deluxe" - allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small, /obj/item/reagent_containers/glass/bottle/vial/large) - icon_state = "cmo2" - desc = "The Deluxe Hypospray can take larger-size vials. It also acts faster and delivers more reagents per spray." - resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF - start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/CMO - inject_wait = DELUXE_WAIT_INJECT - spray_wait = DELUXE_WAIT_SPRAY - spray_self = DELUXE_SELF_SPRAY - inject_self = DELUXE_SELF_INJECT - -/obj/item/hypospray/mkii/CMO/combat - name = "combat hypospray mk.II" - desc = "A combat-ready deluxe hypospray that acts almost instantly. It can be tactically reloaded by using a vial on it." - icon_state = "combat2" - start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat - inject_wait = COMBAT_WAIT_INJECT - spray_wait = COMBAT_WAIT_SPRAY - spray_self = COMBAT_SELF_SPRAY - inject_self = COMBAT_SELF_INJECT - quickload = TRUE - penetrates = TRUE - -/obj/item/hypospray/mkii/Initialize() - . = ..() - if(!spawnwithvial) - update_icon() - return - if(start_vial) - vial = new start_vial - update_icon() - -/obj/item/hypospray/mkii/update_icon() - ..() - icon_state = "[initial(icon_state)][vial ? "" : "-e"]" - if(ismob(loc)) - var/mob/M = loc - M.update_inv_hands() - return - -/obj/item/hypospray/mkii/examine(mob/user) - . = ..() - if(vial) - . += "[vial] has [vial.reagents.total_volume]u remaining." - else - . += "It has no vial loaded in." - . += "[src] is set to [mode ? "Inject" : "Spray"] contents on application." - -/obj/item/hypospray/mkii/proc/unload_hypo(obj/item/I, mob/user) - if (reloadable == TRUE) - if((istype(I, /obj/item/reagent_containers/glass/bottle/vial))) - var/obj/item/reagent_containers/glass/bottle/vial/V = I - V.forceMove(user.loc) - user.put_in_hands(V) - to_chat(user, "You remove [vial] from [src].") - vial = null - update_icon() - playsound(loc, 'sound/weapons/empty.ogg', 50, 1) - else - to_chat(user, "This hypo isn't loaded!") - return - else - if((istype(I, /obj/item/reagent_containers/glass/bottle/vial))) - to_chat(user, "You cannot remove [vial] from [src] without destroying both.") - -/obj/item/hypospray/mkii/attackby(obj/item/I, mob/living/user) - if((istype(I, /obj/item/reagent_containers/glass/bottle/vial) && vial != null)) - if(!quickload) - to_chat(user, "[src] can not hold more than one vial!") - return FALSE - unload_hypo(vial, user) - if((istype(I, /obj/item/reagent_containers/glass/bottle/vial))) - var/obj/item/reagent_containers/glass/bottle/vial/V = I - if(!is_type_in_list(V, allowed_containers)) - to_chat(user, "[src] doesn't accept this type of vial.") - return FALSE - if(!user.transferItemToLoc(V,src)) - return FALSE - vial = V - user.visible_message("[user] has loaded a vial into [src].","You have loaded [vial] into [src].") - update_icon() - playsound(loc, 'sound/weapons/autoguninsert.ogg', 35, 1) - return TRUE - else - to_chat(user, "This doesn't fit in [src].") - return FALSE - return FALSE - -/obj/item/hypospray/mkii/AltClick(mob/user) - if(vial) - vial.attack_self(user) - -// Gunna allow this for now, still really don't approve - Pooj -/obj/item/hypospray/mkii/emag_act(mob/user) - . = ..() - if(obj_flags & EMAGGED) - to_chat(user, "[src] happens to be already overcharged.") - return - inject_wait = COMBAT_WAIT_INJECT - spray_wait = COMBAT_WAIT_SPRAY - spray_self = COMBAT_SELF_INJECT - inject_self = COMBAT_SELF_SPRAY - penetrates = TRUE - to_chat(user, "You overcharge [src]'s control circuit.") - obj_flags |= EMAGGED - return TRUE - -/obj/item/hypospray/mkii/attack_hand(mob/user) - . = ..() //Don't bother changing this or removing it from containers will break. - -/obj/item/hypospray/mkii/attack(obj/item/I, mob/user, params) - return - -/obj/item/hypospray/mkii/afterattack(atom/target, mob/user, proximity) - if(!vial) - return - - if(!proximity) - return - - if(!ismob(target)) - return - - var/mob/living/L - if(isliving(target)) - L = target - if(!penetrates && !L.can_inject(user, 1)) //This check appears another four times, since otherwise the penetrating sprays will break in do_mob. - return - - if(!L && !target.is_injectable()) //only checks on non-living mobs, due to how can_inject() handles - to_chat(user, "You cannot directly fill [target]!") - return - - if(target.reagents.total_volume >= target.reagents.maximum_volume) - to_chat(user, "[target] is full.") - return - - if(ishuman(L)) - var/obj/item/bodypart/affecting = L.get_bodypart(check_zone(user.zone_selected)) - if(!affecting) - to_chat(user, "The limb is missing!") - return - if(affecting.status != BODYPART_ORGANIC) - to_chat(user, "Medicine won't work on a robotic limb!") - return - - var/contained = vial.reagents.log_list() - log_combat(user, L, "attemped to inject", src, addition="which had [contained]") -//Always log attemped injections for admins - if(vial != null) - switch(mode) - if(HYPO_INJECT) - if(L) //living mob - if(L != user) - L.visible_message("[user] is trying to inject [L] with [src]!", \ - "[user] is trying to inject [L] with [src]!") - if(!do_mob(user, L, inject_wait)) - return - if(!penetrates && !L.can_inject(user, 1)) - return - if(!vial.reagents.total_volume) - return - if(L.reagents.total_volume >= L.reagents.maximum_volume) - return - L.visible_message("[user] uses the [src] on [L]!", \ - "[user] uses the [src] on [L]!") - else - if(!do_mob(user, L, inject_self)) - return - if(!penetrates && !L.can_inject(user, 1)) - return - if(!vial.reagents.total_volume) - return - if(L.reagents.total_volume >= L.reagents.maximum_volume) - return - log_attack("[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [src.mode])") - L.log_message("applied [src] to themselves ([contained]).", INDIVIDUAL_ATTACK_LOG) - - var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1) - vial.reagents.reaction(L, INJECT, fraction) - vial.reagents.trans_to(target, vial.amount_per_transfer_from_this) - if(vial.amount_per_transfer_from_this >= 15) - playsound(loc,'sound/items/hypospray_long.ogg',50, 1, -1) - if(vial.amount_per_transfer_from_this < 15) - playsound(loc, pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1) - to_chat(user, "You inject [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.") - - if(HYPO_SPRAY) - if(L) //living mob - if(L != user) - L.visible_message("[user] is trying to spray [L] with [src]!", \ - "[user] is trying to spray [L] with [src]!") - if(!do_mob(user, L, spray_wait)) - return - if(!penetrates && !L.can_inject(user, 1)) - return - if(!vial.reagents.total_volume) - return - if(L.reagents.total_volume >= L.reagents.maximum_volume) - return - L.visible_message("[user] uses the [src] on [L]!", \ - "[user] uses the [src] on [L]!") - else - if(!do_mob(user, L, spray_self)) - return - if(!penetrates && !L.can_inject(user, 1)) - return - if(!vial.reagents.total_volume) - return - if(L.reagents.total_volume >= L.reagents.maximum_volume) - return - log_attack("[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [src.mode])") - L.log_message("applied [src] to themselves ([contained]).", INDIVIDUAL_ATTACK_LOG) - var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1) - vial.reagents.reaction(L, PATCH, fraction) - vial.reagents.trans_to(target, vial.amount_per_transfer_from_this) - if(vial.amount_per_transfer_from_this >= 15) - playsound(loc,'sound/items/hypospray_long.ogg',50, 1, -1) - if(vial.amount_per_transfer_from_this < 15) - playsound(loc, pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1) - to_chat(user, "You spray [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.") - else - to_chat(user, "[src] doesn't work here!") - return - -/obj/item/hypospray/mkii/attack_self(mob/living/user) - if(user) - if(user.incapacitated()) - return - else if(!vial) - to_chat(user, "This Hypo needs to be loaded first!") - return - else - unload_hypo(vial,user) - -/obj/item/hypospray/mkii/verb/modes() - set name = "Toggle Application Mode" - set category = "Object" - set src in usr - var/mob/M = usr - switch(mode) - if(HYPO_SPRAY) - mode = HYPO_INJECT - to_chat(M, "[src] is now set to inject contents on application.") - if(HYPO_INJECT) - mode = HYPO_SPRAY - to_chat(M, "[src] is now set to spray contents on application.") - -#undef HYPO_SPRAY -#undef HYPO_INJECT -#undef WAIT_SPRAY -#undef WAIT_INJECT -#undef SELF_SPRAY -#undef SELF_INJECT -#undef DELUXE_WAIT_SPRAY -#undef DELUXE_WAIT_INJECT -#undef DELUXE_SELF_SPRAY -#undef DELUXE_SELF_INJECT -#undef COMBAT_WAIT_SPRAY -#undef COMBAT_WAIT_INJECT -#undef COMBAT_SELF_SPRAY -#undef COMBAT_SELF_INJECT -//Chemlight was here. - -/obj/item/reagent_containers/hypospray/debug - name = "retractable hypospray syringe" - desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment." - icon = 'icons/obj/syringe.dmi' - item_state = "hypo" - icon_state = "borghypo" - amount_per_transfer_from_this = 5 - volume = 200 - possible_transfer_amounts = list() - resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF - reagent_flags = OPENCONTAINER | NO_REACT - slot_flags = ITEM_SLOT_BELT - infinite = TRUE - var/list/fun_ids = list("growthchem", "shrinkchem", "aphro", "aphro+", "penis_enlarger", "breast_enlarger", "space_drugs", "lithium") - -/obj/item/reagent_containers/hypospray/debug/attack_self(mob/user) - var/chosen_reagent - var/list/reagent_ids = sortList(GLOB.chemical_reagents_list) - var/quick_select = input(user, "Select an option", "Press start") in list("Quick menu", "Debug", "Cancel") - switch (quick_select) - if("Quick menu") - var/list_selection = input(user, "Choose an catagory", "List Choice") in list("Emergency Meds", "Fun Chemicals", "Self Defense", "Cancel") - switch(list_selection) - if("Emergency Meds") - reagents.clear_reagents() - amount_per_transfer_from_this = 10 - reagents.add_reagent_list(list("atropine" = 10, "oxandrolone" = 20, "sal_acid" = 20, "salbutamol" = 10)) - - if("Self Defense") - reagents.clear_reagents() - amount_per_transfer_from_this = 10 - reagents.add_reagent_list(list("tirizene" = 14, "tiresolution" = 21, "bonehurtingjuice" = 14,)) // OOF - - if("Fun Chemicals") - reagents.clear_reagents() - amount_per_transfer_from_this = 5 - chosen_reagent = input(user, "What reagent do you want to dispense?") as null|anything in fun_ids - if(chosen_reagent) - reagents.add_reagent(chosen_reagent, 20, null) - - if("Debug") - var/operation_selection = input(user, "Select an option", "Reagent fabricator", "cancel") in list("Select reagent", "Clear reagents", "Select transfer amount", "Cancel") - switch (operation_selection) - if("Select reagent") - switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID")) - if("Enter ID") - var/valid_id - while(!valid_id) - chosen_reagent = stripped_input(usr, "Enter the ID of the reagent you want to add.") - if(!chosen_reagent) //Get me out of here! - break - for(var/ID in reagent_ids) - if(ID == chosen_reagent) - valid_id = 1 - if(!valid_id) - to_chat(usr, "A reagent with that ID doesn't exist!") - if("Choose ID") - chosen_reagent = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_ids - if(chosen_reagent) - reagents.add_reagent(chosen_reagent, 20, null) - - if("Clear reagents") - reagents.clear_reagents() - - if("Select transfer amount") - var/transfer_select = input(user, "Select the amount of reagents you'd like to inject.", "Transfer amount") as num|null - if(transfer_select) - amount_per_transfer_from_this = max(min(round(text2num(transfer_select)),20),1) - - else - return +/obj/item/reagent_containers/hypospray + name = "hypospray" + desc = "The DeForest Medical Corporation hypospray is a sterile, air-needle autoinjector for rapid administration of drugs to patients." + icon = 'icons/obj/syringe.dmi' + item_state = "hypo" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + icon_state = "hypo" + amount_per_transfer_from_this = 5 + volume = 30 + possible_transfer_amounts = list() + resistance_flags = ACID_PROOF + reagent_flags = OPENCONTAINER + slot_flags = ITEM_SLOT_BELT + var/ignore_flags = 0 + var/infinite = FALSE + +/obj/item/reagent_containers/hypospray/attack_paw(mob/user) + return attack_hand(user) + +/obj/item/reagent_containers/hypospray/attack(mob/living/M, mob/user) + if(!reagents.total_volume) + to_chat(user, "[src] is empty!") + return + if(!iscarbon(M)) + return + + //Always log attemped injects for admins + var/list/injected = list() + for(var/datum/reagent/R in reagents.reagent_list) + injected += R.name + var/contained = english_list(injected) + log_combat(user, M, "attempted to inject", src, "([contained])") + + if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1))) // Ignore flag should be checked first or there will be an error message. + to_chat(M, "You feel a tiny prick!") + to_chat(user, "You inject [M] with [src].") + + var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) + reagents.reaction(M, INJECT, fraction) + if(M.reagents) + var/trans = 0 + if(!infinite) + trans = reagents.trans_to(M, amount_per_transfer_from_this) + else + trans = reagents.copy_to(M, amount_per_transfer_from_this) + + to_chat(user, "[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src].") + + + log_combat(user, M, "injected", src, "([contained])") + +/obj/item/reagent_containers/hypospray/CMO + list_reagents = list(/datum/reagent/medicine/omnizine = 30) + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF + +/obj/item/reagent_containers/hypospray/combat + name = "combat stimulant injector" + desc = "A modified air-needle autoinjector, used by support operatives to quickly heal injuries in combat." + amount_per_transfer_from_this = 10 + icon_state = "combat_hypo" + volume = 90 + ignore_flags = 1 // So they can heal their comrades. + list_reagents = list(/datum/reagent/medicine/epinephrine = 30, /datum/reagent/medicine/omnizine = 30, /datum/reagent/medicine/leporazine = 15, /datum/reagent/medicine/atropine = 15) + +/obj/item/reagent_containers/hypospray/combat/nanites + desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with experimental medical compounds for rapid healing." + volume = 100 + list_reagents = list(/datum/reagent/medicine/adminordrazine/quantum_heal = 80, /datum/reagent/medicine/synaptizine = 20) + +/obj/item/reagent_containers/hypospray/magillitis + name = "experimental autoinjector" + desc = "A modified air-needle autoinjector with a small single-use reservoir. It contains an experimental serum." + icon_state = "combat_hypo" + volume = 5 + reagent_flags = NONE + list_reagents = list(/datum/reagent/magillitis = 5) + +//MediPens + +/obj/item/reagent_containers/hypospray/medipen + name = "epinephrine medipen" + desc = "A rapid and safe way to stabilize patients in critical condition for personnel without advanced medical knowledge. Also useful for preventing organ decay in the deceased." + icon_state = "medipen" + item_state = "medipen" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + amount_per_transfer_from_this = 11 + volume = 11 + ignore_flags = 1 //so you can medipen through hardsuits + reagent_flags = DRAWABLE + flags_1 = null + list_reagents = list(/datum/reagent/medicine/epinephrine = 10, /datum/reagent/toxin/formaldehyde = 1) + +/obj/item/reagent_containers/hypospray/medipen/suicide_act(mob/living/carbon/user) + user.visible_message("[user] begins to choke on \the [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return OXYLOSS//ironic. he could save others from oxyloss, but not himself. + +/obj/item/reagent_containers/hypospray/medipen/attack(mob/M, mob/user) + if(!reagents.total_volume) + to_chat(user, "[src] is empty!") + return + ..() + if(!iscyborg(user)) + reagents.maximum_volume = 0 //Makes them useless afterwards + reagent_flags = NONE + update_icon() + addtimer(CALLBACK(src, .proc/cyborg_recharge, user), 80) + +/obj/item/reagent_containers/hypospray/medipen/proc/cyborg_recharge(mob/living/silicon/robot/user) + if(!reagents.total_volume && iscyborg(user)) + var/mob/living/silicon/robot/R = user + if(R.cell.use(100)) + reagents.add_reagent_list(list_reagents) + update_icon() + +/obj/item/reagent_containers/hypospray/medipen/update_icon() + if(reagents.total_volume > 0) + icon_state = initial(icon_state) + else + icon_state = "[initial(icon_state)]0" + +/obj/item/reagent_containers/hypospray/medipen/examine() + . = ..() + if(reagents && reagents.reagent_list.len) + . += "It is currently loaded." + else + . += "It is spent." + +/obj/item/reagent_containers/hypospray/medipen/stimulants + name = "illegal stimpack medipen" + desc = "A highly illegal medipen due to its load and small injections, allow for five uses before being drained" + volume = 50 + amount_per_transfer_from_this = 10 + list_reagents = list(/datum/reagent/medicine/stimulants = 50) + +/obj/item/reagent_containers/hypospray/medipen/stimulants/baseball + name = "the reason the syndicate major league team wins." + desc = "They say drugs never win, but look where you are now, then where they are." + icon_state = "baseballstim" + volume = 50 + amount_per_transfer_from_this = 50 + list_reagents = list(/datum/reagent/medicine/stimulants = 50) + +/obj/item/reagent_containers/hypospray/medipen/stimpack //goliath kiting + name = "stimpack medipen" + desc = "A rapid way to stimulate your body's adrenaline, allowing for freer movement in restrictive armor." + icon_state = "stimpen" + volume = 20 + amount_per_transfer_from_this = 20 + list_reagents = list(/datum/reagent/medicine/ephedrine = 10, /datum/reagent/consumable/coffee = 10) + +/obj/item/reagent_containers/hypospray/medipen/stimpack/traitor + desc = "A modified stimulants autoinjector for use in combat situations. Has a mild healing effect." + list_reagents = list(/datum/reagent/medicine/stimulants = 10, /datum/reagent/medicine/omnizine = 10) + +/obj/item/reagent_containers/hypospray/medipen/morphine + name = "morphine medipen" + desc = "A rapid way to get you out of a tight situation and fast! You'll feel rather drowsy, though." + list_reagents = list(/datum/reagent/medicine/morphine = 10) + +/obj/item/reagent_containers/hypospray/medipen/tuberculosiscure + name = "BVAK autoinjector" + desc = "Bio Virus Antidote Kit autoinjector. Has a two use system for yourself, and someone else. Inject when infected." + icon_state = "stimpen" + volume = 60 + amount_per_transfer_from_this = 30 + list_reagents = list(/datum/reagent/medicine/atropine = 10, /datum/reagent/medicine/epinephrine = 10, /datum/reagent/medicine/salbutamol = 20, /datum/reagent/medicine/spaceacillin = 20) + +/obj/item/reagent_containers/hypospray/medipen/survival + name = "survival medipen" + desc = "A medipen for surviving in the harshest of environments, heals and protects from environmental hazards. WARNING: Do not inject more than one pen in quick succession." + icon_state = "stimpen" + volume = 52 + amount_per_transfer_from_this = 52 + list_reagents = list(/datum/reagent/medicine/salbutamol = 10, /datum/reagent/medicine/leporazine = 15, /datum/reagent/medicine/neo_jelly = 15, /datum/reagent/medicine/epinephrine = 10, /datum/reagent/medicine/lavaland_extract = 2) + +/obj/item/reagent_containers/hypospray/medipen/firelocker + name = "fire treatment medipen" + desc = "A medipen that has been fulled with burn healing chemicals for personnel without advanced medical knowledge." + volume = 15 + amount_per_transfer_from_this = 15 + list_reagents = list(/datum/reagent/medicine/oxandrolone = 5, /datum/reagent/medicine/kelotane = 10) + +/obj/item/reagent_containers/hypospray/combat/heresypurge + name = "holy water autoinjector" + desc = "A modified air-needle autoinjector for use in combat situations. Prefilled with 5 doses of a holy water mixture." + volume = 250 + list_reagents = list(/datum/reagent/water/holywater = 150, /datum/reagent/peaceborg_tire = 50, /datum/reagent/peaceborg_confuse = 50) + amount_per_transfer_from_this = 50 + +#define HYPO_SPRAY 0 +#define HYPO_INJECT 1 + +#define WAIT_SPRAY 25 +#define WAIT_INJECT 25 +#define SELF_SPRAY 15 +#define SELF_INJECT 15 + +#define DELUXE_WAIT_SPRAY 20 +#define DELUXE_WAIT_INJECT 20 +#define DELUXE_SELF_SPRAY 10 +#define DELUXE_SELF_INJECT 10 + +#define COMBAT_WAIT_SPRAY 0 +#define COMBAT_WAIT_INJECT 0 +#define COMBAT_SELF_SPRAY 0 +#define COMBAT_SELF_INJECT 0 + +//A vial-loaded hypospray. Cartridge-based! +/obj/item/hypospray/mkii + name = "hypospray mk.II" + icon_state = "hypo2" + icon = 'icons/obj/syringe.dmi' + desc = "A new development from DeForest Medical, this hypospray takes 30-unit vials as the drug supply for easy swapping." + w_class = WEIGHT_CLASS_TINY + var/list/allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small) + var/mode = HYPO_INJECT + var/obj/item/reagent_containers/glass/bottle/vial/vial + var/start_vial = /obj/item/reagent_containers/glass/bottle/vial/small + var/spawnwithvial = TRUE + var/inject_wait = WAIT_INJECT + var/spray_wait = WAIT_SPRAY + var/spray_self = SELF_SPRAY + var/inject_self = SELF_INJECT + var/quickload = FALSE + var/penetrates = FALSE + var/reloadable = TRUE + +/obj/item/hypospray/mkii/brute + start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/bicaridine + +/obj/item/hypospray/mkii/toxin + start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/antitoxin + +/obj/item/hypospray/mkii/oxygen + start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/dexalin + +/obj/item/hypospray/mkii/burn + start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/kelotane + +/obj/item/hypospray/mkii/tricord + start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/tricord + +/obj/item/hypospray/mkii/enlarge + spawnwithvial = FALSE + +//A vial-loaded hypospray. Cartridge-based! +/obj/item/hypospray/mkii/disposable + name = "disposable hypospray mk.II" + icon_state = "hypo2" + desc = "A cheaply made knock off verson of the MKII hypospray. You cannot remove a hypovial from it making it nonreusable." + w_class = WEIGHT_CLASS_TINY + spawnwithvial = FALSE + reloadable = FALSE + +/obj/item/hypospray/mkii/CMO + name = "hypospray mk.II deluxe" + allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small, /obj/item/reagent_containers/glass/bottle/vial/large) + icon_state = "cmo2" + desc = "The Deluxe Hypospray can take larger-size vials. It also acts faster and delivers more reagents per spray." + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF + start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/CMO + inject_wait = DELUXE_WAIT_INJECT + spray_wait = DELUXE_WAIT_SPRAY + spray_self = DELUXE_SELF_SPRAY + inject_self = DELUXE_SELF_INJECT + +/obj/item/hypospray/mkii/CMO/combat + name = "combat hypospray mk.II" + desc = "A combat-ready deluxe hypospray that acts almost instantly. It can be tactically reloaded by using a vial on it." + icon_state = "combat2" + start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/combat + inject_wait = COMBAT_WAIT_INJECT + spray_wait = COMBAT_WAIT_SPRAY + spray_self = COMBAT_SELF_SPRAY + inject_self = COMBAT_SELF_INJECT + quickload = TRUE + penetrates = TRUE + +/obj/item/hypospray/mkii/Initialize() + . = ..() + if(!spawnwithvial) + update_icon() + return + if(start_vial) + vial = new start_vial + update_icon() + +/obj/item/hypospray/mkii/update_icon() + ..() + icon_state = "[initial(icon_state)][vial ? "" : "-e"]" + if(ismob(loc)) + var/mob/M = loc + M.update_inv_hands() + return + +/obj/item/hypospray/mkii/examine(mob/user) + . = ..() + if(vial) + . += "[vial] has [vial.reagents.total_volume]u remaining." + else + . += "It has no vial loaded in." + . += "[src] is set to [mode ? "Inject" : "Spray"] contents on application." + +/obj/item/hypospray/mkii/proc/unload_hypo(obj/item/I, mob/user) + if (reloadable == TRUE) + if((istype(I, /obj/item/reagent_containers/glass/bottle/vial))) + var/obj/item/reagent_containers/glass/bottle/vial/V = I + V.forceMove(user.loc) + user.put_in_hands(V) + to_chat(user, "You remove [vial] from [src].") + vial = null + update_icon() + playsound(loc, 'sound/weapons/empty.ogg', 50, 1) + else + to_chat(user, "This hypo isn't loaded!") + return + else + if((istype(I, /obj/item/reagent_containers/glass/bottle/vial))) + to_chat(user, "You cannot remove [vial] from [src] without destroying both.") + +/obj/item/hypospray/mkii/attackby(obj/item/I, mob/living/user) + if((istype(I, /obj/item/reagent_containers/glass/bottle/vial) && vial != null)) + if(!quickload) + to_chat(user, "[src] can not hold more than one vial!") + return FALSE + unload_hypo(vial, user) + if((istype(I, /obj/item/reagent_containers/glass/bottle/vial))) + var/obj/item/reagent_containers/glass/bottle/vial/V = I + if(!is_type_in_list(V, allowed_containers)) + to_chat(user, "[src] doesn't accept this type of vial.") + return FALSE + if(!user.transferItemToLoc(V,src)) + return FALSE + vial = V + user.visible_message("[user] has loaded a vial into [src].","You have loaded [vial] into [src].") + update_icon() + playsound(loc, 'sound/weapons/autoguninsert.ogg', 35, 1) + return TRUE + else + to_chat(user, "This doesn't fit in [src].") + return FALSE + return FALSE + +/obj/item/hypospray/mkii/AltClick(mob/user) + if(vial) + vial.attack_self(user) + +// Gunna allow this for now, still really don't approve - Pooj +/obj/item/hypospray/mkii/emag_act(mob/user) + . = ..() + if(obj_flags & EMAGGED) + to_chat(user, "[src] happens to be already overcharged.") + return + inject_wait = COMBAT_WAIT_INJECT + spray_wait = COMBAT_WAIT_SPRAY + spray_self = COMBAT_SELF_INJECT + inject_self = COMBAT_SELF_SPRAY + penetrates = TRUE + to_chat(user, "You overcharge [src]'s control circuit.") + obj_flags |= EMAGGED + return TRUE + +/obj/item/hypospray/mkii/attack_hand(mob/user) + . = ..() //Don't bother changing this or removing it from containers will break. + +/obj/item/hypospray/mkii/attack(obj/item/I, mob/user, params) + return + +/obj/item/hypospray/mkii/afterattack(atom/target, mob/user, proximity) + if(!vial) + return + + if(!proximity) + return + + if(!ismob(target)) + return + + var/mob/living/L + if(isliving(target)) + L = target + if(!penetrates && !L.can_inject(user, 1)) //This check appears another four times, since otherwise the penetrating sprays will break in do_mob. + return + + if(!L && !target.is_injectable()) //only checks on non-living mobs, due to how can_inject() handles + to_chat(user, "You cannot directly fill [target]!") + return + + if(target.reagents.total_volume >= target.reagents.maximum_volume) + to_chat(user, "[target] is full.") + return + + if(ishuman(L)) + var/obj/item/bodypart/affecting = L.get_bodypart(check_zone(user.zone_selected)) + if(!affecting) + to_chat(user, "The limb is missing!") + return + if(affecting.status != BODYPART_ORGANIC) + to_chat(user, "Medicine won't work on a robotic limb!") + return + + var/contained = vial.reagents.log_list() + log_combat(user, L, "attemped to inject", src, addition="which had [contained]") +//Always log attemped injections for admins + if(vial != null) + switch(mode) + if(HYPO_INJECT) + if(L) //living mob + if(L != user) + L.visible_message("[user] is trying to inject [L] with [src]!", \ + "[user] is trying to inject [L] with [src]!") + if(!do_mob(user, L, inject_wait)) + return + if(!penetrates && !L.can_inject(user, 1)) + return + if(!vial.reagents.total_volume) + return + if(L.reagents.total_volume >= L.reagents.maximum_volume) + return + L.visible_message("[user] uses the [src] on [L]!", \ + "[user] uses the [src] on [L]!") + else + if(!do_mob(user, L, inject_self)) + return + if(!penetrates && !L.can_inject(user, 1)) + return + if(!vial.reagents.total_volume) + return + if(L.reagents.total_volume >= L.reagents.maximum_volume) + return + log_attack("[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [src.mode])") + L.log_message("applied [src] to themselves ([contained]).", INDIVIDUAL_ATTACK_LOG) + + var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1) + vial.reagents.reaction(L, INJECT, fraction) + vial.reagents.trans_to(target, vial.amount_per_transfer_from_this) + if(vial.amount_per_transfer_from_this >= 15) + playsound(loc,'sound/items/hypospray_long.ogg',50, 1, -1) + if(vial.amount_per_transfer_from_this < 15) + playsound(loc, pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1) + to_chat(user, "You inject [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.") + + if(HYPO_SPRAY) + if(L) //living mob + if(L != user) + L.visible_message("[user] is trying to spray [L] with [src]!", \ + "[user] is trying to spray [L] with [src]!") + if(!do_mob(user, L, spray_wait)) + return + if(!penetrates && !L.can_inject(user, 1)) + return + if(!vial.reagents.total_volume) + return + if(L.reagents.total_volume >= L.reagents.maximum_volume) + return + L.visible_message("[user] uses the [src] on [L]!", \ + "[user] uses the [src] on [L]!") + else + if(!do_mob(user, L, spray_self)) + return + if(!penetrates && !L.can_inject(user, 1)) + return + if(!vial.reagents.total_volume) + return + if(L.reagents.total_volume >= L.reagents.maximum_volume) + return + log_attack("[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [src.mode])") + L.log_message("applied [src] to themselves ([contained]).", INDIVIDUAL_ATTACK_LOG) + var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1) + vial.reagents.reaction(L, PATCH, fraction) + vial.reagents.trans_to(target, vial.amount_per_transfer_from_this) + if(vial.amount_per_transfer_from_this >= 15) + playsound(loc,'sound/items/hypospray_long.ogg',50, 1, -1) + if(vial.amount_per_transfer_from_this < 15) + playsound(loc, pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1) + to_chat(user, "You spray [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.") + else + to_chat(user, "[src] doesn't work here!") + return + +/obj/item/hypospray/mkii/attack_self(mob/living/user) + if(user) + if(user.incapacitated()) + return + else if(!vial) + to_chat(user, "This Hypo needs to be loaded first!") + return + else + unload_hypo(vial,user) + +/obj/item/hypospray/mkii/verb/modes() + set name = "Toggle Application Mode" + set category = "Object" + set src in usr + var/mob/M = usr + switch(mode) + if(HYPO_SPRAY) + mode = HYPO_INJECT + to_chat(M, "[src] is now set to inject contents on application.") + if(HYPO_INJECT) + mode = HYPO_SPRAY + to_chat(M, "[src] is now set to spray contents on application.") + +#undef HYPO_SPRAY +#undef HYPO_INJECT +#undef WAIT_SPRAY +#undef WAIT_INJECT +#undef SELF_SPRAY +#undef SELF_INJECT +#undef DELUXE_WAIT_SPRAY +#undef DELUXE_WAIT_INJECT +#undef DELUXE_SELF_SPRAY +#undef DELUXE_SELF_INJECT +#undef COMBAT_WAIT_SPRAY +#undef COMBAT_WAIT_INJECT +#undef COMBAT_SELF_SPRAY +#undef COMBAT_SELF_INJECT +//Chemlight was here. + +/obj/item/reagent_containers/hypospray/debug + name = "retractable hypospray syringe" + desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment." + icon = 'icons/obj/syringe.dmi' + item_state = "hypo" + icon_state = "borghypo" + amount_per_transfer_from_this = 5 + volume = 200 + possible_transfer_amounts = list() + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF + reagent_flags = OPENCONTAINER | NO_REACT + slot_flags = ITEM_SLOT_BELT + infinite = TRUE + var/list/fun_ids = list("growthchem", "shrinkchem", "aphro", "aphro+", "penis_enlarger", "breast_enlarger", "space_drugs", "lithium") + +/obj/item/reagent_containers/hypospray/debug/attack_self(mob/user) + var/chosen_reagent + var/list/reagent_ids = sortList(GLOB.chemical_reagents_list) + var/quick_select = input(user, "Select an option", "Press start") in list("Quick menu", "Debug", "Cancel") + switch (quick_select) + if("Quick menu") + var/list_selection = input(user, "Choose an catagory", "List Choice") in list("Emergency Meds", "Fun Chemicals", "Self Defense", "Cancel") + switch(list_selection) + if("Emergency Meds") + reagents.clear_reagents() + amount_per_transfer_from_this = 10 + reagents.add_reagent_list(list("atropine" = 10, "oxandrolone" = 20, "sal_acid" = 20, "salbutamol" = 10)) + + if("Self Defense") + reagents.clear_reagents() + amount_per_transfer_from_this = 10 + reagents.add_reagent_list(list("tirizene" = 14, "tiresolution" = 21, "bonehurtingjuice" = 14,)) // OOF + + if("Fun Chemicals") + reagents.clear_reagents() + amount_per_transfer_from_this = 5 + chosen_reagent = input(user, "What reagent do you want to dispense?") as null|anything in fun_ids + if(chosen_reagent) + reagents.add_reagent(chosen_reagent, 20, null) + + if("Debug") + var/operation_selection = input(user, "Select an option", "Reagent fabricator", "cancel") in list("Select reagent", "Clear reagents", "Select transfer amount", "Cancel") + switch (operation_selection) + if("Select reagent") + switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID")) + if("Enter ID") + var/valid_id + while(!valid_id) + chosen_reagent = stripped_input(usr, "Enter the ID of the reagent you want to add.") + if(!chosen_reagent) //Get me out of here! + break + for(var/ID in reagent_ids) + if(ID == chosen_reagent) + valid_id = 1 + if(!valid_id) + to_chat(usr, "A reagent with that ID doesn't exist!") + if("Choose ID") + chosen_reagent = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_ids + if(chosen_reagent) + reagents.add_reagent(chosen_reagent, 20, null) + + if("Clear reagents") + reagents.clear_reagents() + + if("Select transfer amount") + var/transfer_select = input(user, "Select the amount of reagents you'd like to inject.", "Transfer amount") as num|null + if(transfer_select) + amount_per_transfer_from_this = max(min(round(text2num(transfer_select)),20),1) + + else + return diff --git a/code/modules/reagents/reagent_containers/hypovial.dm b/code/modules/reagents/reagent_containers/hypovial.dm index ba5ce48a..31a664a8 100644 --- a/code/modules/reagents/reagent_containers/hypovial.dm +++ b/code/modules/reagents/reagent_containers/hypovial.dm @@ -5,7 +5,6 @@ desc = "A hypovial compatible with most hyposprays." icon_state = "hypovial" spillable = FALSE - var/comes_with = list() //Easy way of doing this. volume = 10 possible_transfer_amounts = list(1,2,5,10) obj_flags = UNIQUE_RENAME @@ -24,8 +23,6 @@ . = ..() if(!icon_state) icon_state = "hypovial" - for(var/R in comes_with) - reagents.add_reagent(R,comes_with[R]) update_icon() @@ -113,87 +110,87 @@ unique_reskin = null -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine +/obj/item/reagent_containers/glass/bottle/vial/small/bicaridine name = "red hypovial (bicaridine)" icon_state = "hypovial-b" - comes_with = list("bicaridine" = 30) + list_reagents = list(/datum/reagent/medicine/bicaridine = 30) -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin +/obj/item/reagent_containers/glass/bottle/vial/small/antitoxin name = "green hypovial (Anti-Tox)" icon_state = "hypovial-a" - comes_with = list("antitoxin" = 30) + list_reagents = list(/datum/reagent/medicine/antitoxin = 30) -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane +/obj/item/reagent_containers/glass/bottle/vial/small/kelotane name = "orange hypovial (kelotane)" icon_state = "hypovial-k" - comes_with = list("kelotane" = 30) + list_reagents = list(/datum/reagent/medicine/kelotane = 30) -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin +/obj/item/reagent_containers/glass/bottle/vial/small/dexalin name = "blue hypovial (dexalin)" icon_state = "hypovial-d" - comes_with = list("dexalin" = 30) + list_reagents = list(/datum/reagent/medicine/dexalin = 30) -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord +/obj/item/reagent_containers/glass/bottle/vial/small/tricord name = "hypovial (tricordrazine)" icon_state = "hypovial" - comes_with = list("tricordrazine" = 30) + list_reagents = list(/datum/reagent/medicine/tricordrazine = 30) -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/breastreduction +/obj/item/reagent_containers/glass/bottle/vial/small/breastreduction name = "pink hypovial (breast treatment)" icon_state = "hypovial-pink" - comes_with = list("BEsmaller_hypo" = 30) + list_reagents = list(/datum/reagent/fermi/BEsmaller_hypo = 30) -/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/penisreduction +/obj/item/reagent_containers/glass/bottle/vial/small/penisreduction name = "pink hypovial (penis treatment)" icon_state = "hypovial-pink" - comes_with = list("PEsmaller_hypo" = 30) + list_reagents = list(/datum/reagent/fermi/PEsmaller_hypo = 30) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/CMO +/obj/item/reagent_containers/glass/bottle/vial/large/CMO name = "deluxe hypovial" icon_state = "hypoviallarge-cmos" - comes_with = list("omnizine" = 20, "leporazine" = 20, "atropine" = 20) + list_reagents = list(/datum/reagent/medicine/omnizine = 20, /datum/reagent/medicine/leporazine = 20, /datum/reagent/medicine/atropine = 20) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/bicaridine +/obj/item/reagent_containers/glass/bottle/vial/large/bicaridine name = "large red hypovial (bicaridine)" icon_state = "hypoviallarge-b" - comes_with = list("bicaridine" = 60) + list_reagents = list(/datum/reagent/medicine/bicaridine = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/antitoxin +/obj/item/reagent_containers/glass/bottle/vial/large/antitoxin name = "large green hypovial (anti-tox)" icon_state = "hypoviallarge-a" - comes_with = list("antitoxin" = 60) + list_reagents = list(/datum/reagent/medicine/antitoxin = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/kelotane +/obj/item/reagent_containers/glass/bottle/vial/large/kelotane name = "large orange hypovial (kelotane)" icon_state = "hypoviallarge-k" - comes_with = list("kelotane" = 60) + list_reagents = list(/datum/reagent/medicine/kelotane = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/dexalin +/obj/item/reagent_containers/glass/bottle/vial/large/dexalin name = "large blue hypovial (dexalin)" icon_state = "hypoviallarge-d" - comes_with = list("dexalin" = 60) + list_reagents = list(/datum/reagent/medicine/dexalin = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/charcoal +/obj/item/reagent_containers/glass/bottle/vial/large/charcoal name = "large black hypovial (charcoal)" icon_state = "hypoviallarge-t" - comes_with = list("charcoal" = 60) + list_reagents = list(/datum/reagent/medicine/charcoal = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/tricord +/obj/item/reagent_containers/glass/bottle/vial/large/tricord name = "large hypovial (tricord)" icon_state = "hypoviallarge" - comes_with = list("tricordrazine" = 60) + list_reagents = list(/datum/reagent/medicine/tricordrazine = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/salglu +/obj/item/reagent_containers/glass/bottle/vial/large/salglu name = "large green hypovial (salglu)" icon_state = "hypoviallarge-a" - comes_with = list("salglu_solution" = 60) + list_reagents = list(/datum/reagent/medicine/salglu_solution = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/synthflesh +/obj/item/reagent_containers/glass/bottle/vial/large/synthflesh name = "large orange hypovial (synthflesh)" icon_state = "hypoviallarge-k" - comes_with = list("synthflesh" = 60) + list_reagents = list(/datum/reagent/medicine/synthflesh = 60) -/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat +/obj/item/reagent_containers/glass/bottle/vial/large/combat name = "combat hypovial" icon_state = "hypoviallarge-t" - comes_with = list("epinephrine" = 3, "omnizine" = 19, "leporazine" = 19, "atropine" = 19) //Epinephrine's main effect here is to kill suff damage, so we don't need much given atropine + list_reagents = list(/datum/reagent/medicine/epinephrine = 3, /datum/reagent/medicine/omnizine = 19, /datum/reagent/medicine/leporazine = 19, /datum/reagent/medicine/atropine = 19) //Epinephrine's main effect here is to kill suff damage, so we don't need much given atropine diff --git a/code/modules/reagents/reagent_containers/medspray.dm b/code/modules/reagents/reagent_containers/medspray.dm index df7c7af2..02a3f987 100644 --- a/code/modules/reagents/reagent_containers/medspray.dm +++ b/code/modules/reagents/reagent_containers/medspray.dm @@ -82,21 +82,26 @@ name = "medical spray (styptic powder)" desc = "A medical spray bottle, designed for precision application, with an unscrewable cap. This one contains styptic powder, for treating cuts and bruises." icon_state = "brutespray" - list_reagents = list("styptic_powder" = 60) + list_reagents = list(/datum/reagent/medicine/styptic_powder = 60) /obj/item/reagent_containers/medspray/silver_sulf name = "medical spray (silver sulfadiazine)" desc = "A medical spray bottle, designed for precision application, with an unscrewable cap. This one contains silver sulfadiazine, useful for treating burns." icon_state = "burnspray" - list_reagents = list("silver_sulfadiazine" = 60) + list_reagents = list(/datum/reagent/medicine/silver_sulfadiazine = 60) /obj/item/reagent_containers/medspray/synthflesh name = "medical spray (synthflesh)" desc = "A medical spray bottle, designed for precision application, with an unscrewable cap. This one contains synthflesh, an apex brute and burn healing agent." icon_state = "synthspray" - list_reagents = list("synthflesh" = 60) + list_reagents = list(/datum/reagent/medicine/synthflesh = 60) /obj/item/reagent_containers/medspray/sterilizine name = "sterilizer spray" desc = "Spray bottle loaded with non-toxic sterilizer. Useful in preparation for surgery." - list_reagents = list("sterilizine" = 60) + list_reagents = list(/datum/reagent/space_cleaner/sterilizine = 60) + +/obj/item/reagent_containers/medspray/synthtissue + name = "Synthtissue young culture spray" + desc = "Spray bottle loaded with synthtissue. Useful in synthtissue grafting surgeries." + list_reagents = list(/datum/reagent/synthtissue = 60) diff --git a/code/modules/reagents/reagent_containers/patch.dm b/code/modules/reagents/reagent_containers/patch.dm index 02852f22..1e23f46d 100644 --- a/code/modules/reagents/reagent_containers/patch.dm +++ b/code/modules/reagents/reagent_containers/patch.dm @@ -32,13 +32,13 @@ /obj/item/reagent_containers/pill/patch/styptic name = "brute patch" desc = "Helps with brute injuries." - list_reagents = list("styptic_powder" = 20) + list_reagents = list(/datum/reagent/medicine/styptic_powder = 20) icon_state = "bandaid_brute" /obj/item/reagent_containers/pill/patch/silver_sulf name = "burn patch" desc = "Helps with burn injuries." - list_reagents = list("silver_sulfadiazine" = 20) + list_reagents = list(/datum/reagent/medicine/silver_sulfadiazine = 20) icon_state = "bandaid_burn" /obj/item/reagent_containers/pill/patch/get_belt_overlay() diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index d8efe572..95f3a45b 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -82,97 +82,97 @@ name = "toxins pill" desc = "Highly toxic." icon_state = "pill5" - list_reagents = list("toxin" = 50) + list_reagents = list(/datum/reagent/toxin = 50) roundstart = 1 /obj/item/reagent_containers/pill/cyanide name = "cyanide pill" desc = "Don't swallow this." icon_state = "pill5" - list_reagents = list("cyanide" = 50) + list_reagents = list(/datum/reagent/toxin/cyanide = 50) roundstart = 1 /obj/item/reagent_containers/pill/adminordrazine name = "adminordrazine pill" desc = "It's magic. We don't have to explain it." icon_state = "pill16" - list_reagents = list("adminordrazine" = 50) + list_reagents = list(/datum/reagent/medicine/adminordrazine = 50) roundstart = 1 /obj/item/reagent_containers/pill/morphine name = "morphine pill" desc = "Commonly used to treat insomnia." icon_state = "pill8" - list_reagents = list("morphine" = 30) + list_reagents = list(/datum/reagent/medicine/morphine = 30) roundstart = 1 /obj/item/reagent_containers/pill/stimulant name = "stimulant pill" desc = "Often taken by overworked employees, athletes, and the inebriated. You'll snap to attention immediately!" icon_state = "pill19" - list_reagents = list("ephedrine" = 10, "antihol" = 10, "coffee" = 30) + list_reagents = list(/datum/reagent/medicine/ephedrine = 10, /datum/reagent/medicine/antihol = 10, /datum/reagent/consumable/coffee = 30) roundstart = 1 /obj/item/reagent_containers/pill/salbutamol name = "salbutamol pill" desc = "Used to treat oxygen deprivation." icon_state = "pill16" - list_reagents = list("salbutamol" = 30) + list_reagents = list(/datum/reagent/medicine/salbutamol = 30) roundstart = 1 /obj/item/reagent_containers/pill/charcoal name = "charcoal pill" desc = "Neutralizes many common toxins." icon_state = "pill17" - list_reagents = list("charcoal" = 10) + list_reagents = list(/datum/reagent/medicine/charcoal = 10) roundstart = 1 /obj/item/reagent_containers/pill/epinephrine name = "epinephrine pill" desc = "Used to stabilize patients." icon_state = "pill5" - list_reagents = list("epinephrine" = 15) + list_reagents = list(/datum/reagent/medicine/epinephrine = 15) roundstart = 1 /obj/item/reagent_containers/pill/mannitol name = "mannitol pill" desc = "Used to treat brain damage." icon_state = "pill17" - list_reagents = list("mannitol" = 50) + list_reagents = list(/datum/reagent/medicine/mannitol = 50) roundstart = 1 /obj/item/reagent_containers/pill/mutadone name = "mutadone pill" desc = "Used to treat genetic damage." icon_state = "pill20" - list_reagents = list("mutadone" = 50) + list_reagents = list(/datum/reagent/medicine/mutadone = 50) roundstart = 1 /obj/item/reagent_containers/pill/salicyclic name = "salicylic acid pill" desc = "Used to dull pain." icon_state = "pill9" - list_reagents = list("sal_acid" = 24) + list_reagents = list(/datum/reagent/medicine/sal_acid = 24) roundstart = 1 /obj/item/reagent_containers/pill/oxandrolone name = "oxandrolone pill" desc = "Used to stimulate burn healing." icon_state = "pill11" - list_reagents = list("oxandrolone" = 24) + list_reagents = list(/datum/reagent/medicine/oxandrolone = 24) roundstart = 1 /obj/item/reagent_containers/pill/insulin name = "insulin pill" desc = "Handles hyperglycaemic coma." icon_state = "pill18" - list_reagents = list("insulin" = 50) + list_reagents = list(/datum/reagent/medicine/insulin = 50) roundstart = 1 /obj/item/reagent_containers/pill/psicodine name = "psicodine pill" desc = "Used to treat mental instability and traumas." - list_reagents = list("psicodine" = 10) + list_reagents = list(/datum/reagent/medicine/psicodine = 10) icon_state = "pill22" roundstart = 1 @@ -180,21 +180,21 @@ name = "potassium iodide pill" desc = "Used to treat radition used to counter radiation poisoning." icon_state = "pill18" - list_reagents = list("potass_iodide" = 50) + list_reagents = list(/datum/reagent/medicine/potass_iodide = 50) roundstart = 1 /obj/item/reagent_containers/pill/antirad_plus name = "prussian blue pill" desc = "Used to treat heavy radition poisoning." icon_state = "prussian_blue" - list_reagents = list("prussian_blue" = 25, "water" = 10) + list_reagents = list(/datum/reagent/medicine/prussian_blue = 25, /datum/reagent/water = 10) roundstart = 1 /obj/item/reagent_containers/pill/mutarad name = "radiation treatment deluxe pill" desc = "Used to treat heavy radition poisoning and genetic defects." icon_state = "anit_rad_fixgene" - list_reagents = list("prussian_blue" = 15, "potass_iodide" = 15, "mutadone" = 15, "water" = 5) + list_reagents = list(/datum/reagent/medicine/prussian_blue = 15, /datum/reagent/medicine/potass_iodide = 15, /datum/reagent/medicine/mutadone = 15, /datum/reagent/water = 5) roundstart = 1 ///////////////////////////////////////// this pill is used only in a legion mob drop @@ -203,32 +203,32 @@ desc = "I wouldn't eat this if I were you." icon_state = "pill9" color = "#454545" - list_reagents = list("shadowmutationtoxin" = 1) + list_reagents = list(/datum/reagent/mutationtoxin/shadow = 1) //////////////////////////////////////// drugs /obj/item/reagent_containers/pill/zoom name = "zoom pill" - list_reagents = list("synaptizine" = 10, "nicotine" = 10, "methamphetamine" = 1) + list_reagents = list(/datum/reagent/medicine/synaptizine = 10, /datum/reagent/drug/nicotine = 10, /datum/reagent/drug/methamphetamine = 1) /obj/item/reagent_containers/pill/happy name = "happy pill" - list_reagents = list("sugar" = 10, "space_drugs" = 10) + list_reagents = list(/datum/reagent/consumable/sugar = 10, /datum/reagent/drug/space_drugs = 10) /obj/item/reagent_containers/pill/lsd name = "hallucinogen pill" - list_reagents = list("mushroomhallucinogen" = 15, "mindbreaker" = 15) + list_reagents = list(/datum/reagent/drug/mushroomhallucinogen = 15, /datum/reagent/toxin/mindbreaker = 15) /obj/item/reagent_containers/pill/aranesp name = "speedy pill" - list_reagents = list("aranesp" = 10) + list_reagents = list(/datum/reagent/drug/aranesp = 10) /obj/item/reagent_containers/pill/happiness name = "happiness pill" desc = "It has a creepy smiling face on it." icon_state = "pill_happy" - list_reagents = list("happiness" = 10) + list_reagents = list(/datum/reagent/drug/happiness = 10) /obj/item/reagent_containers/pill/floorpill name = "floorpill" @@ -250,8 +250,8 @@ /obj/item/reagent_containers/pill/penis_enlargement name = "penis enlargement pill" - list_reagents = list("penis_enlarger" = 10) + list_reagents = list(/datum/reagent/fermi/penis_enlarger = 10) /obj/item/reagent_containers/pill/breast_enlargement name = "breast enlargement pill" - list_reagents = list("breast_enlarger" = 10) + list_reagents = list(/datum/reagent/fermi/breast_enlarger = 10) diff --git a/code/modules/reagents/reagent_containers/rags.dm b/code/modules/reagents/reagent_containers/rags.dm index 5e670726..88a134ee 100644 --- a/code/modules/reagents/reagent_containers/rags.dm +++ b/code/modules/reagents/reagent_containers/rags.dm @@ -73,9 +73,9 @@ if(M.fire_stacks) var/minus_plus = M.fire_stacks < 0 ? 1 : -1 var/amount = min(abs(M.fire_stacks), soak_efficiency) - var/r_id = "fuel" + var/r_id = /datum/reagent/fuel if(M.fire_stacks < 0) - r_id = "water" + r_id = /datum/reagent/water reagents.add_reagent(r_id, amount * 0.3) M.adjust_fire_stacks(minus_plus * amount) M.wash_cream() diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 02de7972..1b2e6248 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -1,315 +1,315 @@ -/obj/item/reagent_containers/spray - name = "spray bottle" - desc = "A spray bottle, with an unscrewable top." - icon = 'icons/obj/janitor.dmi' - icon_state = "cleaner" - item_state = "cleaner" - lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' - item_flags = NOBLUDGEON - reagent_flags = OPENCONTAINER - slot_flags = ITEM_SLOT_BELT - throwforce = 0 - w_class = WEIGHT_CLASS_SMALL - throw_speed = 3 - throw_range = 7 - var/stream_mode = 0 //whether we use the more focused mode - var/current_range = 3 //the range of tiles the sprayer will reach. - var/spray_range = 3 //the range of tiles the sprayer will reach when in spray mode. - var/stream_range = 1 //the range of tiles the sprayer will reach when in stream mode. - var/stream_amount = 10 //the amount of reagents transfered when in stream mode. - var/spray_delay = 3 //The amount of sleep() delay between each chempuff step. - var/can_fill_from_container = TRUE - amount_per_transfer_from_this = 5 - volume = 250 - possible_transfer_amounts = list(5,10,15,20,25,30,50,100) - -/obj/item/reagent_containers/spray/afterattack(atom/A, mob/user) - . = ..() - if(istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics)) - return - - if((A.is_drainable() && !A.is_refillable()) && get_dist(src,A) <= 1 && can_fill_from_container) - if(!A.reagents.total_volume) - to_chat(user, "[A] is empty.") - return - - if(reagents.holder_full()) - to_chat(user, "[src] is full.") - return - - var/trans = A.reagents.trans_to(src, 50) //transfer 50u , using the spray's transfer amount would take too long to refill - to_chat(user, "You fill \the [src] with [trans] units of the contents of \the [A].") - return - - if(reagents.total_volume < amount_per_transfer_from_this) - to_chat(user, "[src] is empty!") - return - - spray(A) - - playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6) - user.changeNext_move(CLICK_CD_RANGE*2) - user.newtonian_move(get_dir(A, user)) - var/turf/T = get_turf(src) - if(reagents.has_reagent("sacid")) - message_admins("[ADMIN_LOOKUPFLW(user)] fired sulphuric acid from \a [src] at [ADMIN_VERBOSEJMP(T)].") - log_game("[key_name(user)] fired sulphuric acid from \a [src] at [AREACOORD(T)].") - if(reagents.has_reagent("facid")) - message_admins("[ADMIN_LOOKUPFLW(user)] fired Fluacid from \a [src] at [ADMIN_VERBOSEJMP(T)].") - log_game("[key_name(user)] fired Fluacid from \a [src] at [AREACOORD(T)].") - if(reagents.has_reagent("lube")) - message_admins("[ADMIN_LOOKUPFLW(user)] fired Space lube from \a [src] at [ADMIN_VERBOSEJMP(T)].") - log_game("[key_name(user)] fired Space lube from \a [src] at [AREACOORD(T)].") - return - - -/obj/item/reagent_containers/spray/proc/spray(atom/A) - var/range = CLAMP(get_dist(src, A), 1, current_range) - var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src)) - D.create_reagents(amount_per_transfer_from_this) - var/puff_reagent_left = range //how many turf, mob or dense objet we can react with before we consider the chem puff consumed - if(stream_mode) - reagents.trans_to(D, amount_per_transfer_from_this) - puff_reagent_left = 1 - else - reagents.trans_to(D, amount_per_transfer_from_this, 1/range) - D.color = mix_color_from_reagents(D.reagents.reagent_list) - var/wait_step = max(round(2+ spray_delay * INVERSE(range)), 2) - do_spray(A, wait_step, D, range, puff_reagent_left) - -/obj/item/reagent_containers/spray/proc/do_spray(atom/A, wait_step, obj/effect/decal/chempuff/D, range, puff_reagent_left) - set waitfor = FALSE - var/range_left = range - for(var/i=0, i 0 && (!stream_mode || !range_left)) - D.reagents.reaction(get_turf(D), VAPOR) - puff_reagent_left -= 1 - - if(puff_reagent_left <= 0) // we used all the puff so we delete it. - qdel(D) - return - qdel(D) - -/obj/item/reagent_containers/spray/attack_self(mob/user) - stream_mode = !stream_mode - if(stream_mode) - amount_per_transfer_from_this = stream_amount - current_range = stream_range - else - amount_per_transfer_from_this = initial(amount_per_transfer_from_this) - current_range = spray_range - to_chat(user, "You switch the nozzle setting to [stream_mode ? "\"stream\"":"\"spray\""]. You'll now use [amount_per_transfer_from_this] units per use.") - -/obj/item/reagent_containers/spray/attackby(obj/item/I, mob/user, params) - var/hotness = I.is_hot() - if(hotness && reagents) - reagents.expose_temperature(hotness) - to_chat(user, "You heat [name] with [I]!") - return ..() - -/obj/item/reagent_containers/spray/verb/empty() - set name = "Empty Spray Bottle" - set category = "Object" - set src in usr - if(usr.incapacitated()) - return - if (alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes") - return - if(isturf(usr.loc) && src.loc == usr) - to_chat(usr, "You empty \the [src] onto the floor.") - reagents.reaction(usr.loc) - src.reagents.clear_reagents() - -//space cleaner -/obj/item/reagent_containers/spray/cleaner - name = "space cleaner" - desc = "BLAM!-brand non-foaming space cleaner!" - volume = 100 - list_reagents = list("cleaner" = 100) - amount_per_transfer_from_this = 2 - stream_amount = 5 - -/obj/item/reagent_containers/spray/cleaner/suicide_act(mob/user) - user.visible_message("[user] is putting the nozzle of \the [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!") - if(do_mob(user,user,30)) - if(reagents.total_volume >= amount_per_transfer_from_this)//if not empty - user.visible_message("[user] pulls the trigger!") - src.spray(user) - return BRUTELOSS - else - user.visible_message("[user] pulls the trigger...but \the [src] is empty!") - return SHAME - else - user.visible_message("[user] decided life was worth living.") - return - -//Drying Agent -/obj/item/reagent_containers/spray/drying_agent - name = "drying agent spray" - desc = "A spray bottle for drying agent." - volume = 100 - list_reagents = list("drying_agent" = 100) - amount_per_transfer_from_this = 2 - stream_amount = 5 - -//spray tan -/obj/item/reagent_containers/spray/spraytan - name = "spray tan" - volume = 50 - desc = "Gyaro brand spray tan. Do not spray near eyes or other orifices." - list_reagents = list("spraytan" = 50) - - -//pepperspray -/obj/item/reagent_containers/spray/pepper - name = "pepperspray" - desc = "Manufactured by UhangInc, used to blind and down an opponent quickly." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "pepperspray" - item_state = "pepperspray" - lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' - volume = 40 - stream_range = 4 - spray_delay = 1 - amount_per_transfer_from_this = 5 - list_reagents = list("condensedcapsaicin" = 40) - -/obj/item/reagent_containers/spray/pepper/suicide_act(mob/living/carbon/user) - user.visible_message("[user] begins huffing \the [src]! It looks like [user.p_theyre()] getting a dirty high!") - return OXYLOSS - -// Fix pepperspraying yourself -/obj/item/reagent_containers/spray/pepper/afterattack(atom/A as mob|obj, mob/user) - if (A.loc == user) - return - . = ..() - -//water flower -/obj/item/reagent_containers/spray/waterflower - name = "water flower" - desc = "A seemingly innocent sunflower...with a twist." - icon = 'icons/obj/hydroponics/harvest.dmi' - icon_state = "sunflower" - item_state = "sunflower" - amount_per_transfer_from_this = 1 - volume = 10 - list_reagents = list("water" = 10) - -/obj/item/reagent_containers/spray/waterflower/attack_self(mob/user) //Don't allow changing how much the flower sprays - return - -/obj/item/reagent_containers/spray/waterflower/cyborg - reagent_flags = NONE - volume = 100 - list_reagents = list("water" = 100) - var/generate_amount = 5 - var/generate_type = "water" - var/last_generate = 0 - var/generate_delay = 10 //deciseconds - can_fill_from_container = FALSE - -/obj/item/reagent_containers/spray/waterflower/cyborg/hacked - name = "nova flower" - desc = "This doesn't look safe at all..." - list_reagents = list("clf3" = 3) - volume = 3 - generate_type = "clf3" - generate_amount = 1 - generate_delay = 40 //deciseconds - -/obj/item/reagent_containers/spray/waterflower/cyborg/Initialize() - . = ..() - START_PROCESSING(SSfastprocess, src) - -/obj/item/reagent_containers/spray/waterflower/cyborg/Destroy() - STOP_PROCESSING(SSfastprocess, src) - return ..() - -/obj/item/reagent_containers/spray/waterflower/cyborg/process() - if(world.time < last_generate + generate_delay) - return - last_generate = world.time - generate_reagents() - -/obj/item/reagent_containers/spray/waterflower/cyborg/empty() - to_chat(usr, "You can not empty this!") - return - -/obj/item/reagent_containers/spray/waterflower/cyborg/proc/generate_reagents() - reagents.add_reagent(generate_type, generate_amount) - -//chemsprayer -/obj/item/reagent_containers/spray/chemsprayer - name = "chem sprayer" - desc = "A utility used to spray large amounts of reagents in a given area." - icon = 'icons/obj/guns/projectile.dmi' - icon_state = "chemsprayer" - item_state = "chemsprayer" - lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi' - righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi' - throwforce = 0 - w_class = WEIGHT_CLASS_NORMAL - stream_mode = 1 - current_range = 7 - spray_range = 4 - stream_range = 7 - amount_per_transfer_from_this = 10 - volume = 600 - -/obj/item/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user) - // Make it so the bioterror spray doesn't spray yourself when you click your inventory items - if (A.loc == user) - return - . = ..() - -/obj/item/reagent_containers/spray/chemsprayer/spray(atom/A) - var/direction = get_dir(src, A) - var/turf/T = get_turf(A) - var/turf/T1 = get_step(T,turn(direction, 90)) - var/turf/T2 = get_step(T,turn(direction, -90)) - var/list/the_targets = list(T,T1,T2) - - for(var/i=1, i<=3, i++) // intialize sprays - if(reagents.total_volume < 1) - return - ..(the_targets[i]) - -/obj/item/reagent_containers/spray/chemsprayer/bioterror - list_reagents = list("sodium_thiopental" = 100, "coniine" = 100, "venom" = 100, "condensedcapsaicin" = 100, "initropidril" = 100, "polonium" = 100) - -// Plant-B-Gone -/obj/item/reagent_containers/spray/plantbgone // -- Skie - name = "Plant-B-Gone" - desc = "Kills those pesky weeds!" - icon = 'icons/obj/hydroponics/equipment.dmi' - icon_state = "plantbgone" - item_state = "plantbgone" - lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' - volume = 100 - list_reagents = list("plantbgone" = 100) +/obj/item/reagent_containers/spray + name = "spray bottle" + desc = "A spray bottle, with an unscrewable top." + icon = 'icons/obj/janitor.dmi' + icon_state = "cleaner" + item_state = "cleaner" + lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' + item_flags = NOBLUDGEON + reagent_flags = OPENCONTAINER + slot_flags = ITEM_SLOT_BELT + throwforce = 0 + w_class = WEIGHT_CLASS_SMALL + throw_speed = 3 + throw_range = 7 + var/stream_mode = 0 //whether we use the more focused mode + var/current_range = 3 //the range of tiles the sprayer will reach. + var/spray_range = 3 //the range of tiles the sprayer will reach when in spray mode. + var/stream_range = 1 //the range of tiles the sprayer will reach when in stream mode. + var/stream_amount = 10 //the amount of reagents transfered when in stream mode. + var/spray_delay = 3 //The amount of sleep() delay between each chempuff step. + var/can_fill_from_container = TRUE + amount_per_transfer_from_this = 5 + volume = 250 + possible_transfer_amounts = list(5,10,15,20,25,30,50,100) + +/obj/item/reagent_containers/spray/afterattack(atom/A, mob/user) + . = ..() + if(istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics)) + return + + if((A.is_drainable() && !A.is_refillable()) && get_dist(src,A) <= 1 && can_fill_from_container) + if(!A.reagents.total_volume) + to_chat(user, "[A] is empty.") + return + + if(reagents.holder_full()) + to_chat(user, "[src] is full.") + return + + var/trans = A.reagents.trans_to(src, 50) //transfer 50u , using the spray's transfer amount would take too long to refill + to_chat(user, "You fill \the [src] with [trans] units of the contents of \the [A].") + return + + if(reagents.total_volume < amount_per_transfer_from_this) + to_chat(user, "[src] is empty!") + return + + spray(A) + + playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6) + user.changeNext_move(CLICK_CD_RANGE*2) + user.newtonian_move(get_dir(A, user)) + var/turf/T = get_turf(src) + if(reagents.has_reagent(/datum/reagent/toxin/acid)) + message_admins("[ADMIN_LOOKUPFLW(user)] fired sulphuric acid from \a [src] at [ADMIN_VERBOSEJMP(T)].") + log_game("[key_name(user)] fired sulphuric acid from \a [src] at [AREACOORD(T)].") + if(reagents.has_reagent(/datum/reagent/toxin/acid/fluacid)) + message_admins("[ADMIN_LOOKUPFLW(user)] fired Fluacid from \a [src] at [ADMIN_VERBOSEJMP(T)].") + log_game("[key_name(user)] fired Fluacid from \a [src] at [AREACOORD(T)].") + if(reagents.has_reagent(/datum/reagent/lube)) + message_admins("[ADMIN_LOOKUPFLW(user)] fired Space lube from \a [src] at [ADMIN_VERBOSEJMP(T)].") + log_game("[key_name(user)] fired Space lube from \a [src] at [AREACOORD(T)].") + return + + +/obj/item/reagent_containers/spray/proc/spray(atom/A) + var/range = CLAMP(get_dist(src, A), 1, current_range) + var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src)) + D.create_reagents(amount_per_transfer_from_this) + var/puff_reagent_left = range //how many turf, mob or dense objet we can react with before we consider the chem puff consumed + if(stream_mode) + reagents.trans_to(D, amount_per_transfer_from_this) + puff_reagent_left = 1 + else + reagents.trans_to(D, amount_per_transfer_from_this, 1/range) + D.color = mix_color_from_reagents(D.reagents.reagent_list) + var/wait_step = max(round(2+ spray_delay * INVERSE(range)), 2) + do_spray(A, wait_step, D, range, puff_reagent_left) + +/obj/item/reagent_containers/spray/proc/do_spray(atom/A, wait_step, obj/effect/decal/chempuff/D, range, puff_reagent_left) + set waitfor = FALSE + var/range_left = range + for(var/i=0, i 0 && (!stream_mode || !range_left)) + D.reagents.reaction(get_turf(D), VAPOR) + puff_reagent_left -= 1 + + if(puff_reagent_left <= 0) // we used all the puff so we delete it. + qdel(D) + return + qdel(D) + +/obj/item/reagent_containers/spray/attack_self(mob/user) + stream_mode = !stream_mode + if(stream_mode) + amount_per_transfer_from_this = stream_amount + current_range = stream_range + else + amount_per_transfer_from_this = initial(amount_per_transfer_from_this) + current_range = spray_range + to_chat(user, "You switch the nozzle setting to [stream_mode ? "\"stream\"":"\"spray\""]. You'll now use [amount_per_transfer_from_this] units per use.") + +/obj/item/reagent_containers/spray/attackby(obj/item/I, mob/user, params) + var/hotness = I.is_hot() + if(hotness && reagents) + reagents.expose_temperature(hotness) + to_chat(user, "You heat [name] with [I]!") + return ..() + +/obj/item/reagent_containers/spray/verb/empty() + set name = "Empty Spray Bottle" + set category = "Object" + set src in usr + if(usr.incapacitated()) + return + if (alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes") + return + if(isturf(usr.loc) && src.loc == usr) + to_chat(usr, "You empty \the [src] onto the floor.") + reagents.reaction(usr.loc) + src.reagents.clear_reagents() + +//space cleaner +/obj/item/reagent_containers/spray/cleaner + name = "space cleaner" + desc = "BLAM!-brand non-foaming space cleaner!" + volume = 100 + list_reagents = list(/datum/reagent/space_cleaner = 100) + amount_per_transfer_from_this = 2 + stream_amount = 5 + +/obj/item/reagent_containers/spray/cleaner/suicide_act(mob/user) + user.visible_message("[user] is putting the nozzle of \the [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!") + if(do_mob(user,user,30)) + if(reagents.total_volume >= amount_per_transfer_from_this)//if not empty + user.visible_message("[user] pulls the trigger!") + src.spray(user) + return BRUTELOSS + else + user.visible_message("[user] pulls the trigger...but \the [src] is empty!") + return SHAME + else + user.visible_message("[user] decided life was worth living.") + return + +//Drying Agent +/obj/item/reagent_containers/spray/drying_agent + name = "drying agent spray" + desc = "A spray bottle for drying agent." + volume = 100 + list_reagents = list(/datum/reagent/drying_agent = 100) + amount_per_transfer_from_this = 2 + stream_amount = 5 + +//spray tan +/obj/item/reagent_containers/spray/spraytan + name = "spray tan" + volume = 50 + desc = "Gyaro brand spray tan. Do not spray near eyes or other orifices." + list_reagents = list(/datum/reagent/spraytan = 50) + + +//pepperspray +/obj/item/reagent_containers/spray/pepper + name = "pepperspray" + desc = "Manufactured by UhangInc, used to blind and down an opponent quickly." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "pepperspray" + item_state = "pepperspray" + lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' + volume = 40 + stream_range = 4 + spray_delay = 1 + amount_per_transfer_from_this = 5 + list_reagents = list(/datum/reagent/consumable/condensedcapsaicin = 40) + +/obj/item/reagent_containers/spray/pepper/suicide_act(mob/living/carbon/user) + user.visible_message("[user] begins huffing \the [src]! It looks like [user.p_theyre()] getting a dirty high!") + return OXYLOSS + +// Fix pepperspraying yourself +/obj/item/reagent_containers/spray/pepper/afterattack(atom/A as mob|obj, mob/user) + if (A.loc == user) + return + . = ..() + +//water flower +/obj/item/reagent_containers/spray/waterflower + name = "water flower" + desc = "A seemingly innocent sunflower...with a twist." + icon = 'icons/obj/hydroponics/harvest.dmi' + icon_state = "sunflower" + item_state = "sunflower" + amount_per_transfer_from_this = 1 + volume = 10 + list_reagents = list(/datum/reagent/water = 10) + +/obj/item/reagent_containers/spray/waterflower/attack_self(mob/user) //Don't allow changing how much the flower sprays + return + +/obj/item/reagent_containers/spray/waterflower/cyborg + reagent_flags = NONE + volume = 100 + list_reagents = list(/datum/reagent/water = 100) + var/generate_amount = 5 + var/generate_type = /datum/reagent/water + var/last_generate = 0 + var/generate_delay = 10 //deciseconds + can_fill_from_container = FALSE + +/obj/item/reagent_containers/spray/waterflower/cyborg/hacked + name = "nova flower" + desc = "This doesn't look safe at all..." + list_reagents = list(/datum/reagent/clf3 = 3) + volume = 3 + generate_type = /datum/reagent/clf3 + generate_amount = 1 + generate_delay = 40 //deciseconds + +/obj/item/reagent_containers/spray/waterflower/cyborg/Initialize() + . = ..() + START_PROCESSING(SSfastprocess, src) + +/obj/item/reagent_containers/spray/waterflower/cyborg/Destroy() + STOP_PROCESSING(SSfastprocess, src) + return ..() + +/obj/item/reagent_containers/spray/waterflower/cyborg/process() + if(world.time < last_generate + generate_delay) + return + last_generate = world.time + generate_reagents() + +/obj/item/reagent_containers/spray/waterflower/cyborg/empty() + to_chat(usr, "You can not empty this!") + return + +/obj/item/reagent_containers/spray/waterflower/cyborg/proc/generate_reagents() + reagents.add_reagent(generate_type, generate_amount) + +//chemsprayer +/obj/item/reagent_containers/spray/chemsprayer + name = "chem sprayer" + desc = "A utility used to spray large amounts of reagents in a given area." + icon = 'icons/obj/guns/projectile.dmi' + icon_state = "chemsprayer" + item_state = "chemsprayer" + lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi' + throwforce = 0 + w_class = WEIGHT_CLASS_NORMAL + stream_mode = 1 + current_range = 7 + spray_range = 4 + stream_range = 7 + amount_per_transfer_from_this = 10 + volume = 600 + +/obj/item/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user) + // Make it so the bioterror spray doesn't spray yourself when you click your inventory items + if (A.loc == user) + return + . = ..() + +/obj/item/reagent_containers/spray/chemsprayer/spray(atom/A) + var/direction = get_dir(src, A) + var/turf/T = get_turf(A) + var/turf/T1 = get_step(T,turn(direction, 90)) + var/turf/T2 = get_step(T,turn(direction, -90)) + var/list/the_targets = list(T,T1,T2) + + for(var/i=1, i<=3, i++) // intialize sprays + if(reagents.total_volume < 1) + return + ..(the_targets[i]) + +/obj/item/reagent_containers/spray/chemsprayer/bioterror + list_reagents = list(/datum/reagent/toxin/sodium_thiopental = 100, /datum/reagent/toxin/coniine = 100, /datum/reagent/toxin/venom = 100, /datum/reagent/consumable/condensedcapsaicin = 100, /datum/reagent/toxin/initropidril = 100, /datum/reagent/toxin/polonium = 100) + +// Plant-B-Gone +/obj/item/reagent_containers/spray/plantbgone // -- Skie + name = "Plant-B-Gone" + desc = "Kills those pesky weeds!" + icon = 'icons/obj/hydroponics/equipment.dmi' + icon_state = "plantbgone" + item_state = "plantbgone" + lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi' + volume = 100 + list_reagents = list(/datum/reagent/toxin/plantbgone = 100) diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 48a74515..7fafbc31 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -1,351 +1,351 @@ -/obj/item/reagent_containers/syringe - name = "syringe" - desc = "A syringe that can hold up to 15 units." - icon = 'icons/obj/syringe.dmi' - item_state = "syringe_0" - lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' - icon_state = "0" - amount_per_transfer_from_this = 5 - possible_transfer_amounts = list() - volume = 15 - var/mode = SYRINGE_DRAW - var/busy = FALSE // needed for delayed drawing of blood - var/proj_piercing = 0 //does it pierce through thick clothes when shot with syringe gun - materials = list(MAT_METAL=10, MAT_GLASS=20) - reagent_flags = TRANSPARENT - -/obj/item/reagent_containers/syringe/Initialize() - . = ..() - if(list_reagents) //syringe starts in inject mode if its already got something inside - mode = SYRINGE_INJECT - update_icon() - -/obj/item/reagent_containers/syringe/on_reagent_change(changetype) - update_icon() - -/obj/item/reagent_containers/syringe/pickup(mob/user) - ..() - update_icon() - -/obj/item/reagent_containers/syringe/dropped(mob/user) - ..() - update_icon() - -/obj/item/reagent_containers/syringe/attack_self(mob/user) - mode = !mode - update_icon() - -//ATTACK HAND IGNORING PARENT RETURN VALUE -/obj/item/reagent_containers/syringe/attack_hand() - . = ..() - update_icon() - -/obj/item/reagent_containers/syringe/attack_paw(mob/user) - return attack_hand(user) - -/obj/item/reagent_containers/syringe/attackby(obj/item/I, mob/user, params) - return - -/obj/item/reagent_containers/syringe/afterattack(atom/target, mob/user , proximity) - . = ..() - if(busy) - return - if(!proximity) - return - if(!target.reagents) - return - - var/mob/living/L - if(isliving(target)) - L = target - if(!L.can_inject(user, 1)) - return - - // chance of monkey retaliation - if(ismonkey(target) && prob(MONKEY_SYRINGE_RETALIATION_PROB)) - var/mob/living/carbon/monkey/M - M = target - M.retaliate(user) - - switch(mode) - if(SYRINGE_DRAW) - - if(reagents.total_volume >= reagents.maximum_volume) - to_chat(user, "The syringe is full.") - return - - if(L) //living mob - var/drawn_amount = reagents.maximum_volume - reagents.total_volume - if(target != user) - target.visible_message("[user] is trying to take a blood sample from [target]!", \ - "[user] is trying to take a blood sample from [target]!") - busy = TRUE - if(!do_mob(user, target, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1))) - busy = FALSE - return - if(reagents.total_volume >= reagents.maximum_volume) - return - busy = FALSE - if(L.transfer_blood_to(src, drawn_amount)) - user.visible_message("[user] takes a blood sample from [L].") - else - to_chat(user, "You are unable to draw any blood from [L]!") - - else //if not mob - if(!target.reagents.total_volume) - to_chat(user, "[target] is empty!") - return - - if(!target.is_drawable()) - to_chat(user, "You cannot directly remove reagents from [target]!") - return - - var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares? - - to_chat(user, "You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.") - if (round(reagents.total_volume, 0.1) >= reagents.maximum_volume) - mode=!mode - update_icon() - - if(SYRINGE_INJECT) - // Always log attemped injections for admins - var/contained = reagents.log_list() - log_combat(user, target, "attempted to inject", src, addition="which had [contained]") - - if(!reagents.total_volume) - to_chat(user, "[src] is empty.") - return - - if(!L && !target.is_injectable()) //only checks on non-living mobs, due to how can_inject() handles - to_chat(user, "You cannot directly fill [target]!") - return - - if(target.reagents.total_volume >= target.reagents.maximum_volume) - to_chat(user, "[target] is full.") - return - - if(L) //living mob - if(!L.can_inject(user, TRUE)) - return - if(L != user) - L.visible_message("[user] is trying to inject [L]!", \ - "[user] is trying to inject [L]!") - if(!do_mob(user, L, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1))) - return - if(!reagents.total_volume) - return - if(L.reagents.total_volume >= L.reagents.maximum_volume) - return - L.visible_message("[user] injects [L] with the syringe!", \ - "[user] injects [L] with the syringe!") - - if(L != user) - log_combat(user, L, "injected", src, addition="which had [contained]") - else - L.log_message("injected themselves ([contained]) with [src.name]", LOG_ATTACK, color="orange") - var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) - reagents.reaction(L, INJECT, fraction) - reagents.trans_to(target, amount_per_transfer_from_this) - to_chat(user, "You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units.") - if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT) - mode = SYRINGE_DRAW - update_icon() - - -/obj/item/reagent_containers/syringe/update_icon() - cut_overlays() - var/rounded_vol - if(reagents && reagents.total_volume) - rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15) - var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]") - filling_overlay.color = mix_color_from_reagents(reagents.reagent_list) - add_overlay(filling_overlay) - else - rounded_vol = 0 - icon_state = "[rounded_vol]" - item_state = "syringe_[rounded_vol]" - if(ismob(loc)) - var/mob/M = loc - var/injoverlay - switch(mode) - if (SYRINGE_DRAW) - injoverlay = "draw" - if (SYRINGE_INJECT) - injoverlay = "inject" - add_overlay(injoverlay) - M.update_inv_hands() - -/obj/item/reagent_containers/syringe/epinephrine - name = "syringe (epinephrine)" - desc = "Contains epinephrine - used to stabilize patients." - list_reagents = list("epinephrine" = 15) - -/obj/item/reagent_containers/syringe/charcoal - name = "syringe (charcoal)" - desc = "Contains charcoal." - list_reagents = list("charcoal" = 15) - -/obj/item/reagent_containers/syringe/antiviral - name = "syringe (spaceacillin)" - desc = "Contains antiviral agents." - list_reagents = list("spaceacillin" = 15) - -/obj/item/reagent_containers/syringe/bioterror - name = "bioterror syringe" - desc = "Contains several paralyzing reagents." - list_reagents = list("neurotoxin" = 5, "mutetoxin" = 5, "sodium_thiopental" = 5) - -/obj/item/reagent_containers/syringe/stimulants - name = "Stimpack" - desc = "Contains stimulants." - amount_per_transfer_from_this = 50 - volume = 50 - list_reagents = list("stimulants" = 50) - -/obj/item/reagent_containers/syringe/calomel - name = "syringe (calomel)" - desc = "Contains calomel." - list_reagents = list("calomel" = 15) - -/obj/item/reagent_containers/syringe/plasma - name = "syringe (plasma)" - desc = "Contains plasma." - list_reagents = list("plasma" = 15) - -/obj/item/reagent_containers/syringe/lethal - name = "lethal injection syringe" - desc = "A syringe used for lethal injections. It can hold up to 50 units." - amount_per_transfer_from_this = 50 - volume = 50 - -/obj/item/reagent_containers/syringe/lethal/choral - list_reagents = list("chloralhydrate" = 50) - -/obj/item/reagent_containers/syringe/lethal/execution - list_reagents = list("amatoxin" = 15, "formaldehyde" = 15, "cyanide" = 10, "facid" = 10) //Citadel edit, changing out plasma from lethals - -/obj/item/reagent_containers/syringe/mulligan - name = "Mulligan" - desc = "A syringe used to completely change the users identity." - amount_per_transfer_from_this = 1 - volume = 1 - list_reagents = list("mulligan" = 1) - -/obj/item/reagent_containers/syringe/gluttony - name = "Gluttony's Blessing" - desc = "A syringe recovered from a dread place. It probably isn't wise to use." - amount_per_transfer_from_this = 1 - volume = 1 - list_reagents = list("gluttonytoxin" = 1) - -/obj/item/reagent_containers/syringe/bluespace - name = "bluespace syringe" - desc = "An advanced syringe that can hold 60 units of chemicals." - amount_per_transfer_from_this = 20 - volume = 60 - -/obj/item/reagent_containers/syringe/noreact - name = "cryo syringe" - desc = "An advanced syringe that stops reagents inside from reacting. It can hold up to 20 units." - volume = 20 - reagent_flags = TRANSPARENT | NO_REACT - -/obj/item/reagent_containers/syringe/piercing - name = "piercing syringe" - desc = "A diamond-tipped syringe that pierces armor when launched at high velocity. It can hold up to 10 units." - volume = 10 - proj_piercing = 1 - -/obj/item/reagent_containers/syringe/get_belt_overlay() - return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch") - -/obj/item/reagent_containers/syringe/dart - name = "medicinal smartdart" - desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient using it's smart nanofilter technology only medicines contained within the dart are administered to the patient. Additonally, due to capillary action, injection of chemicals past the overdose limit is prevented." - volume = 20 - amount_per_transfer_from_this = 20 - icon_state = "empty" - item_state = "syringe_empty" - var/emptrig = FALSE - -/obj/item/reagent_containers/syringe/dart/afterattack(atom/target, mob/user , proximity) - - if(busy) - return - if(!proximity) - return - if(!target.reagents) - return - - var/mob/living/L - if(isliving(target)) - L = target - if(!L.can_inject(user, 1)) - return - - switch(mode) - if(SYRINGE_DRAW) - - if(reagents.total_volume >= reagents.maximum_volume) - to_chat(user, "The dart is full!") - return - - if(L) //living mob - to_chat(user, "You can't draw blood using a dart!") - return - - else //if not mob - if(!target.reagents.total_volume) - to_chat(user, "[target] is empty!") - return - - if(!target.is_drawable()) - to_chat(user, "You cannot directly remove reagents from [target]!") - return - - var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) - - to_chat(user, "You soak the [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.") - if (round(reagents.total_volume,1) >= reagents.maximum_volume) - mode=!mode - update_icon() - - if(SYRINGE_INJECT) - src.visible_message("The smartdart gives a frustrated boop! It's fully saturated; You need to shoot someone with it!") - -/obj/item/reagent_containers/syringe/dart/attack_self(mob/user) - return - -/obj/item/reagent_containers/syringe/dart/update_icon() - cut_overlays() - var/rounded_vol - - rounded_vol = "empty" - if(reagents && reagents.total_volume) - if(volume/round(reagents.total_volume, 1) == 1) - rounded_vol="full" - mode = SYRINGE_INJECT - - icon_state = "[rounded_vol]" - item_state = "syringe_[rounded_vol]" - if(ismob(loc)) - var/mob/M = loc - var/injoverlay - switch(mode) - if (SYRINGE_DRAW) - injoverlay = "draw" - if (SYRINGE_INJECT) - injoverlay = "ready" - add_overlay(injoverlay) - M.update_inv_hands() - -/obj/item/reagent_containers/syringe/dart/emp_act(severity) - emptrig = TRUE - ..() - -/obj/item/reagent_containers/syringe/dart/bluespace - name = "bluespace smartdart" - desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient using it's smart nanofilter technology only medicines contained within the dart are administered to the patient. Additonally, due to capillary action, injection of chemicals past the overdose limit is prevented. Has an extended volume capacity thanks to bluespace foam." - amount_per_transfer_from_this = 50 - volume = 50 +/obj/item/reagent_containers/syringe + name = "syringe" + desc = "A syringe that can hold up to 15 units." + icon = 'icons/obj/syringe.dmi' + item_state = "syringe_0" + lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi' + icon_state = "0" + amount_per_transfer_from_this = 5 + possible_transfer_amounts = list() + volume = 15 + var/mode = SYRINGE_DRAW + var/busy = FALSE // needed for delayed drawing of blood + var/proj_piercing = 0 //does it pierce through thick clothes when shot with syringe gun + materials = list(MAT_METAL=10, MAT_GLASS=20) + reagent_flags = TRANSPARENT + +/obj/item/reagent_containers/syringe/Initialize() + . = ..() + if(list_reagents) //syringe starts in inject mode if its already got something inside + mode = SYRINGE_INJECT + update_icon() + +/obj/item/reagent_containers/syringe/on_reagent_change(changetype) + update_icon() + +/obj/item/reagent_containers/syringe/pickup(mob/user) + ..() + update_icon() + +/obj/item/reagent_containers/syringe/dropped(mob/user) + ..() + update_icon() + +/obj/item/reagent_containers/syringe/attack_self(mob/user) + mode = !mode + update_icon() + +//ATTACK HAND IGNORING PARENT RETURN VALUE +/obj/item/reagent_containers/syringe/attack_hand() + . = ..() + update_icon() + +/obj/item/reagent_containers/syringe/attack_paw(mob/user) + return attack_hand(user) + +/obj/item/reagent_containers/syringe/attackby(obj/item/I, mob/user, params) + return + +/obj/item/reagent_containers/syringe/afterattack(atom/target, mob/user , proximity) + . = ..() + if(busy) + return + if(!proximity) + return + if(!target.reagents) + return + + var/mob/living/L + if(isliving(target)) + L = target + if(!L.can_inject(user, 1)) + return + + // chance of monkey retaliation + if(ismonkey(target) && prob(MONKEY_SYRINGE_RETALIATION_PROB)) + var/mob/living/carbon/monkey/M + M = target + M.retaliate(user) + + switch(mode) + if(SYRINGE_DRAW) + + if(reagents.total_volume >= reagents.maximum_volume) + to_chat(user, "The syringe is full.") + return + + if(L) //living mob + var/drawn_amount = reagents.maximum_volume - reagents.total_volume + if(target != user) + target.visible_message("[user] is trying to take a blood sample from [target]!", \ + "[user] is trying to take a blood sample from [target]!") + busy = TRUE + if(!do_mob(user, target, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1))) + busy = FALSE + return + if(reagents.total_volume >= reagents.maximum_volume) + return + busy = FALSE + if(L.transfer_blood_to(src, drawn_amount)) + user.visible_message("[user] takes a blood sample from [L].") + else + to_chat(user, "You are unable to draw any blood from [L]!") + + else //if not mob + if(!target.reagents.total_volume) + to_chat(user, "[target] is empty!") + return + + if(!target.is_drawable()) + to_chat(user, "You cannot directly remove reagents from [target]!") + return + + var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares? + + to_chat(user, "You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.") + if (round(reagents.total_volume, 0.1) >= reagents.maximum_volume) + mode=!mode + update_icon() + + if(SYRINGE_INJECT) + // Always log attemped injections for admins + var/contained = reagents.log_list() + log_combat(user, target, "attempted to inject", src, addition="which had [contained]") + + if(!reagents.total_volume) + to_chat(user, "[src] is empty.") + return + + if(!L && !target.is_injectable()) //only checks on non-living mobs, due to how can_inject() handles + to_chat(user, "You cannot directly fill [target]!") + return + + if(target.reagents.total_volume >= target.reagents.maximum_volume) + to_chat(user, "[target] is full.") + return + + if(L) //living mob + if(!L.can_inject(user, TRUE)) + return + if(L != user) + L.visible_message("[user] is trying to inject [L]!", \ + "[user] is trying to inject [L]!") + if(!do_mob(user, L, extra_checks=CALLBACK(L, /mob/living/proc/can_inject,user,1))) + return + if(!reagents.total_volume) + return + if(L.reagents.total_volume >= L.reagents.maximum_volume) + return + L.visible_message("[user] injects [L] with the syringe!", \ + "[user] injects [L] with the syringe!") + + if(L != user) + log_combat(user, L, "injected", src, addition="which had [contained]") + else + L.log_message("injected themselves ([contained]) with [src.name]", LOG_ATTACK, color="orange") + var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) + reagents.reaction(L, INJECT, fraction) + reagents.trans_to(target, amount_per_transfer_from_this) + to_chat(user, "You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units.") + if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT) + mode = SYRINGE_DRAW + update_icon() + + +/obj/item/reagent_containers/syringe/update_icon() + cut_overlays() + var/rounded_vol + if(reagents && reagents.total_volume) + rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15) + var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]") + filling_overlay.color = mix_color_from_reagents(reagents.reagent_list) + add_overlay(filling_overlay) + else + rounded_vol = 0 + icon_state = "[rounded_vol]" + item_state = "syringe_[rounded_vol]" + if(ismob(loc)) + var/mob/M = loc + var/injoverlay + switch(mode) + if (SYRINGE_DRAW) + injoverlay = "draw" + if (SYRINGE_INJECT) + injoverlay = "inject" + add_overlay(injoverlay) + M.update_inv_hands() + +/obj/item/reagent_containers/syringe/epinephrine + name = "syringe (epinephrine)" + desc = "Contains epinephrine - used to stabilize patients." + list_reagents = list(/datum/reagent/medicine/epinephrine = 15) + +/obj/item/reagent_containers/syringe/charcoal + name = "syringe (charcoal)" + desc = "Contains charcoal." + list_reagents = list(/datum/reagent/medicine/charcoal = 15) + +/obj/item/reagent_containers/syringe/antiviral + name = "syringe (spaceacillin)" + desc = "Contains antiviral agents." + list_reagents = list(/datum/reagent/medicine/spaceacillin = 15) + +/obj/item/reagent_containers/syringe/bioterror + name = "bioterror syringe" + desc = "Contains several paralyzing reagents." + list_reagents = list(/datum/reagent/consumable/ethanol/neurotoxin = 5, /datum/reagent/toxin/mutetoxin = 5, /datum/reagent/toxin/sodium_thiopental = 5) + +/obj/item/reagent_containers/syringe/stimulants + name = "Stimpack" + desc = "Contains stimulants." + amount_per_transfer_from_this = 50 + volume = 50 + list_reagents = list(/datum/reagent/medicine/stimulants = 50) + +/obj/item/reagent_containers/syringe/calomel + name = "syringe (calomel)" + desc = "Contains calomel." + list_reagents = list(/datum/reagent/medicine/calomel = 15) + +/obj/item/reagent_containers/syringe/plasma + name = "syringe (plasma)" + desc = "Contains plasma." + list_reagents = list(/datum/reagent/toxin/plasma = 15) + +/obj/item/reagent_containers/syringe/lethal + name = "lethal injection syringe" + desc = "A syringe used for lethal injections. It can hold up to 50 units." + amount_per_transfer_from_this = 50 + volume = 50 + +/obj/item/reagent_containers/syringe/lethal/choral + list_reagents = list(/datum/reagent/toxin/chloralhydrate = 50) + +/obj/item/reagent_containers/syringe/lethal/execution + list_reagents = list(/datum/reagent/toxin/amatoxin = 15, /datum/reagent/toxin/formaldehyde = 15, /datum/reagent/toxin/cyanide = 10, /datum/reagent/toxin/acid/fluacid = 10) //Citadel edit, changing out plasma from lethals + +/obj/item/reagent_containers/syringe/mulligan + name = "Mulligan" + desc = "A syringe used to completely change the users identity." + amount_per_transfer_from_this = 1 + volume = 1 + list_reagents = list(/datum/reagent/mulligan = 1) + +/obj/item/reagent_containers/syringe/gluttony + name = "Gluttony's Blessing" + desc = "A syringe recovered from a dread place. It probably isn't wise to use." + amount_per_transfer_from_this = 1 + volume = 1 + list_reagents = list(/datum/reagent/gluttonytoxin = 1) + +/obj/item/reagent_containers/syringe/bluespace + name = "bluespace syringe" + desc = "An advanced syringe that can hold 60 units of chemicals." + amount_per_transfer_from_this = 20 + volume = 60 + +/obj/item/reagent_containers/syringe/noreact + name = "cryo syringe" + desc = "An advanced syringe that stops reagents inside from reacting. It can hold up to 20 units." + volume = 20 + reagent_flags = TRANSPARENT | NO_REACT + +/obj/item/reagent_containers/syringe/piercing + name = "piercing syringe" + desc = "A diamond-tipped syringe that pierces armor when launched at high velocity. It can hold up to 10 units." + volume = 10 + proj_piercing = 1 + +/obj/item/reagent_containers/syringe/get_belt_overlay() + return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch") + +/obj/item/reagent_containers/syringe/dart + name = "medicinal smartdart" + desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient using it's smart nanofilter technology only medicines contained within the dart are administered to the patient. Additonally, due to capillary action, injection of chemicals past the overdose limit is prevented." + volume = 20 + amount_per_transfer_from_this = 20 + icon_state = "empty" + item_state = "syringe_empty" + var/emptrig = FALSE + +/obj/item/reagent_containers/syringe/dart/afterattack(atom/target, mob/user , proximity) + + if(busy) + return + if(!proximity) + return + if(!target.reagents) + return + + var/mob/living/L + if(isliving(target)) + L = target + if(!L.can_inject(user, 1)) + return + + switch(mode) + if(SYRINGE_DRAW) + + if(reagents.total_volume >= reagents.maximum_volume) + to_chat(user, "The dart is full!") + return + + if(L) //living mob + to_chat(user, "You can't draw blood using a dart!") + return + + else //if not mob + if(!target.reagents.total_volume) + to_chat(user, "[target] is empty!") + return + + if(!target.is_drawable()) + to_chat(user, "You cannot directly remove reagents from [target]!") + return + + var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) + + to_chat(user, "You soak the [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.") + if (round(reagents.total_volume,1) >= reagents.maximum_volume) + mode=!mode + update_icon() + + if(SYRINGE_INJECT) + src.visible_message("The smartdart gives a frustrated boop! It's fully saturated; You need to shoot someone with it!") + +/obj/item/reagent_containers/syringe/dart/attack_self(mob/user) + return + +/obj/item/reagent_containers/syringe/dart/update_icon() + cut_overlays() + var/rounded_vol + + rounded_vol = "empty" + if(reagents && reagents.total_volume) + if(volume/round(reagents.total_volume, 1) == 1) + rounded_vol="full" + mode = SYRINGE_INJECT + + icon_state = "[rounded_vol]" + item_state = "syringe_[rounded_vol]" + if(ismob(loc)) + var/mob/M = loc + var/injoverlay + switch(mode) + if (SYRINGE_DRAW) + injoverlay = "draw" + if (SYRINGE_INJECT) + injoverlay = "ready" + add_overlay(injoverlay) + M.update_inv_hands() + +/obj/item/reagent_containers/syringe/dart/emp_act(severity) + emptrig = TRUE + ..() + +/obj/item/reagent_containers/syringe/dart/bluespace + name = "bluespace smartdart" + desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient using it's smart nanofilter technology only medicines contained within the dart are administered to the patient. Additonally, due to capillary action, injection of chemicals past the overdose limit is prevented. Has an extended volume capacity thanks to bluespace foam." + amount_per_transfer_from_this = 50 + volume = 50 diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 161caded..8ac4b354 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -1,254 +1,253 @@ -/obj/structure/reagent_dispensers - name = "Dispenser" - desc = "..." - icon = 'icons/obj/objects.dmi' - icon_state = "water" - density = TRUE - anchored = FALSE - pressure_resistance = 2*ONE_ATMOSPHERE - max_integrity = 300 - var/tank_volume = 1000 //In units, how much the dispenser can hold - var/reagent_id = "water" //The ID of the reagent that the dispenser uses - -/obj/structure/reagent_dispensers/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) - . = ..() - if(. && obj_integrity > 0) - if(tank_volume && (damage_flag == "bullet" || damage_flag == "laser")) - boom() - -/obj/structure/reagent_dispensers/attackby(obj/item/W, mob/user, params) - if(W.is_refillable()) - return 0 //so we can refill them via their afterattack. - else - return ..() - -/obj/structure/reagent_dispensers/Initialize() - create_reagents(tank_volume, DRAINABLE | AMOUNT_VISIBLE) - reagents.add_reagent(reagent_id, tank_volume) - . = ..() - -/obj/structure/reagent_dispensers/proc/boom() - visible_message("\The [src] ruptures!") - chem_splash(loc, 5, list(reagents)) - qdel(src) - -/obj/structure/reagent_dispensers/deconstruct(disassembled = TRUE) - if(!(flags_1 & NODECONSTRUCT_1)) - if(!disassembled) - boom() - else - qdel(src) - -/////////////// -//Water Tanks// -/////////////// - -/obj/structure/reagent_dispensers/watertank - name = "water tank" - desc = "A water tank." - icon_state = "water" - -/obj/structure/reagent_dispensers/watertank/high - name = "high-capacity water tank" - desc = "A highly pressurized water tank made to hold gargantuan amounts of water." - icon_state = "water_high" //I was gonna clean my room... - tank_volume = 100000 - -/obj/structure/reagent_dispensers/foamtank - name = "firefighting foam tank" - desc = "A tank full of firefighting foam." - icon_state = "foam" - reagent_id = "firefighting_foam" - tank_volume = 500 - -/obj/structure/reagent_dispensers/water_cooler - name = "liquid cooler" - desc = "A machine that dispenses liquid to drink." - icon = 'icons/obj/vending.dmi' - icon_state = "water_cooler" - anchored = TRUE - tank_volume = 500 - var/paper_cups = 25 //Paper cups left from the cooler - -/obj/structure/reagent_dispensers/water_cooler/examine(mob/user) - ..() - if (paper_cups > 1) - to_chat(user, "There are [paper_cups] paper cups left.") - else if (paper_cups == 1) - to_chat(user, "There is one paper cup left.") - else - to_chat(user, "There are no paper cups left.") - -/obj/structure/reagent_dispensers/water_cooler/attack_hand(mob/living/user) - . = ..() - if(.) - return - if(!paper_cups) - to_chat(user, "There aren't any cups left!") - return - user.visible_message("[user] takes a cup from [src].", "You take a paper cup from [src].") - var/obj/item/reagent_containers/food/drinks/sillycup/S = new(get_turf(src)) - user.put_in_hands(S) - paper_cups-- - -////////////// -//Fuel Tanks// -////////////// - -/obj/structure/reagent_dispensers/fueltank - name = "fuel tank" - desc = "A tank full of industrial welding fuel. Do not consume." - icon_state = "fuel" - reagent_id = "welding_fuel" - -/obj/structure/reagent_dispensers/fueltank/high //Unused - Good for ghost roles - name = "high-capacity fuel tank" - desc = "A now illegal tank, full of highly pressurized industrial welding fuel. Do not consume or have a open flame close to this tank." - icon_state = "fuel_high" - tank_volume = 3000 - -/obj/structure/reagent_dispensers/fueltank/boom() - explosion(get_turf(src), 0, 1, 5, flame_range = 5) - qdel(src) - -/obj/structure/reagent_dispensers/fueltank/blob_act(obj/structure/blob/B) - boom() - -/obj/structure/reagent_dispensers/fueltank/ex_act() - boom() - -/obj/structure/reagent_dispensers/fueltank/fire_act(exposed_temperature, exposed_volume) - boom() - -/obj/structure/reagent_dispensers/fueltank/tesla_act() - ..() //extend the zap - boom() - -/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/item/projectile/P) - ..() - if(!QDELETED(src)) //wasn't deleted by the projectile's effects. - if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE))) - var/boom_message = "[ADMIN_LOOKUPFLW(P.firer)] triggered a fueltank explosion via projectile." - GLOB.bombers += boom_message - message_admins(boom_message) - P.firer?.log_message("triggered a fueltank explosion via projectile.", LOG_ATTACK) - boom() - -/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params) - if(istype(I, /obj/item/weldingtool)) - if(!reagents.has_reagent("welding_fuel")) - to_chat(user, "[src] is out of fuel!") - return - var/obj/item/weldingtool/W = I - if(!W.welding) - if(W.reagents.has_reagent("welding_fuel", W.max_fuel)) - to_chat(user, "Your [W.name] is already full!") - return - reagents.trans_to(W, W.max_fuel) - user.visible_message("[user] refills [user.p_their()] [W.name].", "You refill [W].") - playsound(src, 'sound/effects/refill.ogg', 50, 1) - W.update_icon() - else - var/turf/T = get_turf(src) - user.visible_message("[user] catastrophically fails at refilling [user.p_their()] [W.name]!", "That was stupid of you.") - - var/message_admins = "[ADMIN_LOOKUPFLW(user)] triggered a fueltank explosion via welding tool at [ADMIN_VERBOSEJMP(T)]." - GLOB.bombers += message_admins - message_admins(message_admins) - - user.log_message("triggered a fueltank explosion via welding tool.", LOG_ATTACK) - boom() - return - return ..() - -/////////////////// -//Misc Dispenders// -/////////////////// - -/obj/structure/reagent_dispensers/peppertank - name = "pepper spray refiller" - desc = "Contains condensed capsaicin for use in law \"enforcement.\"" - icon_state = "pepper" - anchored = TRUE - density = FALSE - reagent_id = "condensedcapsaicin" - -/obj/structure/reagent_dispensers/peppertank/Initialize() - . = ..() - if(prob(1)) - desc = "IT'S PEPPER TIME, BITCH!" - -/obj/structure/reagent_dispensers/virusfood - name = "virus food dispenser" - desc = "A dispenser of low-potency virus mutagenic." - icon_state = "virus_food" - anchored = TRUE - density = FALSE - reagent_id = "virusfood" - -/obj/structure/reagent_dispensers/cooking_oil - name = "vat of cooking oil" - desc = "A huge metal vat with a tap on the front. Filled with cooking oil for use in frying food." - icon_state = "vat" - anchored = TRUE - reagent_id = "cooking_oil" - -//////// -//Kegs// -//////// - -/obj/structure/reagent_dispensers/beerkeg - name = "beer keg" - desc = "Beer is liquid bread, it's good for you..." - icon_state = "beer" - reagent_id = "beer" - -/obj/structure/reagent_dispensers/beerkeg/blob_act(obj/structure/blob/B) - explosion(src.loc,0,3,5,7,10) - if(!QDELETED(src)) - qdel(src) - -/obj/structure/reagent_dispensers/keg - name = "keg" - desc = "A keg." - icon = 'modular_citadel/icons/obj/objects.dmi' - icon_state = "keg" - reagent_id = "water" - -/obj/structure/reagent_dispensers/keg/mead - name = "keg of mead" - desc = "A keg of mead." - icon_state = "orangekeg" - reagent_id = "mead" - -/obj/structure/reagent_dispensers/keg/aphro - name = "keg of aphrodisiac" - desc = "A keg of aphrodisiac." - icon_state = "pinkkeg" - reagent_id = "aphro" - tank_volume = 150 - -/obj/structure/reagent_dispensers/keg/aphro/strong - name = "keg of strong aphrodisiac" - desc = "A keg of strong and addictive aphrodisiac." - reagent_id = "aphro+" - tank_volume = 120 - -/obj/structure/reagent_dispensers/keg/milk - name = "keg of milk" - desc = "It's not quite what you were hoping for." - icon_state = "whitekeg" - reagent_id = "milk" - -/obj/structure/reagent_dispensers/keg/semen - name = "keg of semen" - desc = "Dear lord, where did this even come from?" - icon_state = "whitekeg" - reagent_id = "semen" - -/obj/structure/reagent_dispensers/keg/gargle - name = "keg of pan galactic gargleblaster" - desc = "A keg of... wow that's a long name." - icon_state = "bluekeg" - reagent_id = "gargleblaster" - tank_volume = 100 +/obj/structure/reagent_dispensers + name = "Dispenser" + desc = "..." + icon = 'icons/obj/objects.dmi' + icon_state = "water" + density = TRUE + anchored = FALSE + pressure_resistance = 2*ONE_ATMOSPHERE + max_integrity = 300 + var/tank_volume = 1000 //In units, how much the dispenser can hold + var/reagent_id = /datum/reagent/water //The ID of the reagent that the dispenser uses + +/obj/structure/reagent_dispensers/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) + . = ..() + if(. && obj_integrity > 0) + if(tank_volume && (damage_flag == "bullet" || damage_flag == "laser")) + boom() + +/obj/structure/reagent_dispensers/attackby(obj/item/W, mob/user, params) + if(W.is_refillable()) + return 0 //so we can refill them via their afterattack. + else + return ..() + +/obj/structure/reagent_dispensers/Initialize() + create_reagents(tank_volume, DRAINABLE | AMOUNT_VISIBLE) + reagents.add_reagent(reagent_id, tank_volume) + . = ..() + +/obj/structure/reagent_dispensers/proc/boom() + visible_message("\The [src] ruptures!") + chem_splash(loc, 5, list(reagents)) + qdel(src) + +/obj/structure/reagent_dispensers/deconstruct(disassembled = TRUE) + if(!(flags_1 & NODECONSTRUCT_1)) + if(!disassembled) + boom() + else + qdel(src) + +/////////////// +//Water Tanks// +/////////////// + +/obj/structure/reagent_dispensers/watertank + name = "water tank" + desc = "A water tank." + icon_state = "water" + +/obj/structure/reagent_dispensers/watertank/high + name = "high-capacity water tank" + desc = "A highly pressurized water tank made to hold gargantuan amounts of water." + icon_state = "water_high" //I was gonna clean my room... + tank_volume = 100000 + +/obj/structure/reagent_dispensers/foamtank + name = "firefighting foam tank" + desc = "A tank full of firefighting foam." + icon_state = "foam" + reagent_id = /datum/reagent/firefighting_foam + tank_volume = 500 + +/obj/structure/reagent_dispensers/water_cooler + name = "liquid cooler" + desc = "A machine that dispenses liquid to drink." + icon = 'icons/obj/vending.dmi' + icon_state = "water_cooler" + anchored = TRUE + tank_volume = 500 + var/paper_cups = 25 //Paper cups left from the cooler + +/obj/structure/reagent_dispensers/water_cooler/examine(mob/user) + ..() + if (paper_cups > 1) + to_chat(user, "There are [paper_cups] paper cups left.") + else if (paper_cups == 1) + to_chat(user, "There is one paper cup left.") + else + to_chat(user, "There are no paper cups left.") + +/obj/structure/reagent_dispensers/water_cooler/attack_hand(mob/living/user) + . = ..() + if(.) + return + if(!paper_cups) + to_chat(user, "There aren't any cups left!") + return + user.visible_message("[user] takes a cup from [src].", "You take a paper cup from [src].") + var/obj/item/reagent_containers/food/drinks/sillycup/S = new(get_turf(src)) + user.put_in_hands(S) + paper_cups-- + +////////////// +//Fuel Tanks// +////////////// + +/obj/structure/reagent_dispensers/fueltank + name = "fuel tank" + desc = "A tank full of industrial welding fuel. Do not consume." + icon_state = "fuel" + reagent_id = /datum/reagent/fuel + +/obj/structure/reagent_dispensers/fueltank/high //Unused - Good for ghost roles + name = "high-capacity fuel tank" + desc = "A now illegal tank, full of highly pressurized industrial welding fuel. Do not consume or have a open flame close to this tank." + icon_state = "fuel_high" + tank_volume = 3000 + +/obj/structure/reagent_dispensers/fueltank/boom() + explosion(get_turf(src), 0, 1, 5, flame_range = 5) + qdel(src) + +/obj/structure/reagent_dispensers/fueltank/blob_act(obj/structure/blob/B) + boom() + +/obj/structure/reagent_dispensers/fueltank/ex_act() + boom() + +/obj/structure/reagent_dispensers/fueltank/fire_act(exposed_temperature, exposed_volume) + boom() + +/obj/structure/reagent_dispensers/fueltank/tesla_act() + ..() //extend the zap + boom() + +/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/item/projectile/P) + ..() + if(!QDELETED(src)) //wasn't deleted by the projectile's effects. + if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE))) + var/boom_message = "[ADMIN_LOOKUPFLW(P.firer)] triggered a fueltank explosion via projectile." + GLOB.bombers += boom_message + message_admins(boom_message) + P.firer?.log_message("triggered a fueltank explosion via projectile.", LOG_ATTACK) + boom() + +/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params) + if(istype(I, /obj/item/weldingtool)) + if(!reagents.has_reagent(/datum/reagent/fuel)) + to_chat(user, "[src] is out of fuel!") + return + var/obj/item/weldingtool/W = I + if(!W.welding) + if(W.reagents.has_reagent(/datum/reagent/fuel, W.max_fuel)) + to_chat(user, "Your [W.name] is already full!") + return + reagents.trans_to(W, W.max_fuel) + user.visible_message("[user] refills [user.p_their()] [W.name].", "You refill [W].") + playsound(src, 'sound/effects/refill.ogg', 50, 1) + W.update_icon() + else + var/turf/T = get_turf(src) + user.visible_message("[user] catastrophically fails at refilling [user.p_their()] [W.name]!", "That was stupid of you.") + + var/message_admins = "[ADMIN_LOOKUPFLW(user)] triggered a fueltank explosion via welding tool at [ADMIN_VERBOSEJMP(T)]." + GLOB.bombers += message_admins + message_admins(message_admins) + + user.log_message("triggered a fueltank explosion via welding tool.", LOG_ATTACK) + boom() + return + return ..() + +/////////////////// +//Misc Dispenders// +/////////////////// + +/obj/structure/reagent_dispensers/peppertank + name = "pepper spray refiller" + desc = "Contains condensed capsaicin for use in law \"enforcement.\"" + icon_state = "pepper" + anchored = TRUE + density = FALSE + reagent_id = /datum/reagent/consumable/condensedcapsaicin + +/obj/structure/reagent_dispensers/peppertank/Initialize() + . = ..() + if(prob(1)) + desc = "IT'S PEPPER TIME, BITCH!" + +/obj/structure/reagent_dispensers/virusfood + name = "virus food dispenser" + desc = "A dispenser of low-potency virus mutagenic." + icon_state = "virus_food" + anchored = TRUE + density = FALSE + reagent_id = /datum/reagent/toxin/mutagen/mutagenvirusfood + +/obj/structure/reagent_dispensers/cooking_oil + name = "vat of cooking oil" + desc = "A huge metal vat with a tap on the front. Filled with cooking oil for use in frying food." + icon_state = "vat" + anchored = TRUE + reagent_id = /datum/reagent/consumable/cooking_oil + +//////// +//Kegs// +//////// + +/obj/structure/reagent_dispensers/beerkeg + name = "beer keg" + desc = "Beer is liquid bread, it's good for you..." + icon_state = "beer" + reagent_id = /datum/reagent/consumable/ethanol/beer + +/obj/structure/reagent_dispensers/beerkeg/blob_act(obj/structure/blob/B) + explosion(src.loc,0,3,5,7,10) + if(!QDELETED(src)) + qdel(src) + +/obj/structure/reagent_dispensers/keg + name = "keg" + desc = "A keg." + icon = 'modular_citadel/icons/obj/objects.dmi' + icon_state = "keg" + +/obj/structure/reagent_dispensers/keg/mead + name = "keg of mead" + desc = "A keg of mead." + icon_state = "orangekeg" + reagent_id = /datum/reagent/consumable/ethanol/mead + +/obj/structure/reagent_dispensers/keg/aphro + name = "keg of aphrodisiac" + desc = "A keg of aphrodisiac." + icon_state = "pinkkeg" + reagent_id = /datum/reagent/drug/aphrodisiac + tank_volume = 150 + +/obj/structure/reagent_dispensers/keg/aphro/strong + name = "keg of strong aphrodisiac" + desc = "A keg of strong and addictive aphrodisiac." + reagent_id = /datum/reagent/drug/aphrodisiacplus + tank_volume = 120 + +/obj/structure/reagent_dispensers/keg/milk + name = "keg of milk" + desc = "It's not quite what you were hoping for." + icon_state = "whitekeg" + reagent_id = /datum/reagent/consumable/milk + +/obj/structure/reagent_dispensers/keg/semen + name = "keg of semen" + desc = "Dear lord, where did this even come from?" + icon_state = "whitekeg" + reagent_id = /datum/reagent/consumable/semen + +/obj/structure/reagent_dispensers/keg/gargle + name = "keg of pan galactic gargleblaster" + desc = "A keg of... wow that's a long name." + icon_state = "bluekeg" + reagent_id = /datum/reagent/consumable/ethanol/gargle_blaster + tank_volume = 100 diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index cbbcb8a4..a376807e 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -1,83 +1,83 @@ -/*************************************************************** -** Design Datums ** -** All the data for building stuff. ** -***************************************************************/ -/* -For the materials datum, it assumes you need reagents unless specified otherwise. To designate a material that isn't a reagent, -you use one of the material IDs below. These are NOT ids in the usual sense (they aren't defined in the object or part of a datum), -they are simply references used as part of a "has materials?" type proc. They all start with a $ to denote that they aren't reagents. -The currently supporting non-reagent materials. All material amounts are set as the define MINERAL_MATERIAL_AMOUNT, which defaults to 2000 -- MAT_METAL (/obj/item/stack/metal). -- MAT_GLASS (/obj/item/stack/glass). -- MAT_PLASMA (/obj/item/stack/plasma). -- MAT_SILVER (/obj/item/stack/silver). -- MAT_GOLD (/obj/item/stack/gold). -- MAT_URANIUM (/obj/item/stack/uranium). -- MAT_DIAMOND (/obj/item/stack/diamond). -- MAT_BANANIUM (/obj/item/stack/bananium). -(Insert new ones here) - -Don't add new keyword/IDs if they are made from an existing one (such as rods which are made from metal). Only add raw materials. - -Design Guidelines -- When adding new designs, check rdreadme.dm to see what kind of things have already been made and where new stuff is needed. -- A single sheet of anything is 2000 units of material. Materials besides metal/glass require help from other jobs (mining for -other types of metals and chemistry for reagents). -- Add the AUTOLATHE tag to -*/ - -//DESIGNS ARE GLOBAL. DO NOT CREATE OR DESTROY THEM AT RUNTIME OUTSIDE OF INIT, JUST REFERENCE THEM TO WHATEVER YOU'RE DOING! //why are you yelling? - -/datum/design //Datum for object designs, used in construction - var/name = "Name" //Name of the created object. - var/desc = "Desc" //Description of the created object. - var/id = DESIGN_ID_IGNORE //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols - var/build_type = null //Flag as to what kind machine the design is built in. See defines. - var/list/materials = list() //List of materials. Format: "id" = amount. - var/construction_time //Amount of time required for building the object - var/build_path = null //The file path of the object that gets created - var/list/make_reagents = list() //Reagents produced. Format: "id" = amount. Currently only supported by the biogenerator. - var/list/category = null //Primarily used for Mech Fabricators, but can be used for anything - var/list/reagents_list = list() //List of reagents. Format: "id" = amount. - var/maxstack = 1 - var/lathe_time_factor = 1 //How many times faster than normal is this to build on the protolathe - var/dangerous_construction = FALSE //notify and log for admin investigations if this is printed. - var/departmental_flags = ALL //bitflags for deplathes. - var/list/datum/techweb_node/unlocked_by = list() - var/research_icon //Replaces the item icon in the research console - var/research_icon_state - var/icon_cache - -/datum/design/Destroy() - CRASH("DESIGN DATUMS SHOULD NOT EVER BE DESTROYED AS THEY ARE ONLY MEANT TO BE IN A GLOBAL LIST AND REFERENCED FOR US.") - return ..() - -/datum/design/proc/icon_html(client/user) - var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs) - sheet.send(user) - return sheet.icon_tag(id) - -//////////////////////////////////////// -//Disks for transporting design datums// -//////////////////////////////////////// - -/obj/item/disk/design_disk - name = "Component Design Disk" - desc = "A disk for storing device design data for construction in lathes." - icon_state = "datadisk1" - materials = list(MAT_METAL=300, MAT_GLASS=100) - var/list/blueprints = list() - var/max_blueprints = 1 - -/obj/item/disk/design_disk/Initialize() - . = ..() - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - for(var/i in 1 to max_blueprints) - blueprints += null - -/obj/item/disk/design_disk/adv - name = "Advanced Component Design Disk" - desc = "A disk for storing device design data for construction in lathes. This one has extra storage space." - materials = list(MAT_METAL=300, MAT_GLASS=100, MAT_SILVER = 50) - max_blueprints = 5 +/*************************************************************** +** Design Datums ** +** All the data for building stuff. ** +***************************************************************/ +/* +For the materials datum, it assumes you need reagents unless specified otherwise. To designate a material that isn't a reagent, +you use one of the material IDs below. These are NOT ids in the usual sense (they aren't defined in the object or part of a datum), +they are simply references used as part of a "has materials?" type proc. They all start with a $ to denote that they aren't reagents. +The currently supporting non-reagent materials. All material amounts are set as the define MINERAL_MATERIAL_AMOUNT, which defaults to 2000 +- MAT_METAL (/obj/item/stack/metal). +- MAT_GLASS (/obj/item/stack/glass). +- MAT_PLASMA (/obj/item/stack/plasma). +- MAT_SILVER (/obj/item/stack/silver). +- MAT_GOLD (/obj/item/stack/gold). +- MAT_URANIUM (/obj/item/stack/uranium). +- MAT_DIAMOND (/obj/item/stack/diamond). +- MAT_BANANIUM (/obj/item/stack/bananium). +(Insert new ones here) + +Don't add new keyword/IDs if they are made from an existing one (such as rods which are made from metal). Only add raw materials. + +Design Guidelines +- When adding new designs, check rdreadme.dm to see what kind of things have already been made and where new stuff is needed. +- A single sheet of anything is 2000 units of material. Materials besides metal/glass require help from other jobs (mining for +other types of metals and chemistry for reagents). +- Add the AUTOLATHE tag to +*/ + +//DESIGNS ARE GLOBAL. DO NOT CREATE OR DESTROY THEM AT RUNTIME OUTSIDE OF INIT, JUST REFERENCE THEM TO WHATEVER YOU'RE DOING! //why are you yelling? + +/datum/design //Datum for object designs, used in construction + var/name = "Name" //Name of the created object. + var/desc = "Desc" //Description of the created object. + var/id = DESIGN_ID_IGNORE //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols + var/build_type = null //Flag as to what kind machine the design is built in. See defines. + var/list/materials = list() //List of materials. Format: "id" = amount. + var/construction_time //Amount of time required for building the object + var/build_path = null //The file path of the object that gets created + var/list/make_reagents = list() //Reagents produced. Format: type = amount. Currently only supported by the biogenerator. + var/list/category = null //Primarily used for Mech Fabricators, but can be used for anything + var/list/reagents_list = list() //List of reagents. Format: type = amount. + var/maxstack = 1 + var/lathe_time_factor = 1 //How many times faster than normal is this to build on the protolathe + var/dangerous_construction = FALSE //notify and log for admin investigations if this is printed. + var/departmental_flags = ALL //bitflags for deplathes. + var/list/datum/techweb_node/unlocked_by = list() + var/research_icon //Replaces the item icon in the research console + var/research_icon_state + var/icon_cache + +/datum/design/Destroy() + CRASH("DESIGN DATUMS SHOULD NOT EVER BE DESTROYED AS THEY ARE ONLY MEANT TO BE IN A GLOBAL LIST AND REFERENCED FOR US.") + return ..() + +/datum/design/proc/icon_html(client/user) + var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs) + sheet.send(user) + return sheet.icon_tag(id) + +//////////////////////////////////////// +//Disks for transporting design datums// +//////////////////////////////////////// + +/obj/item/disk/design_disk + name = "Component Design Disk" + desc = "A disk for storing device design data for construction in lathes." + icon_state = "datadisk1" + materials = list(MAT_METAL=300, MAT_GLASS=100) + var/list/blueprints = list() + var/max_blueprints = 1 + +/obj/item/disk/design_disk/Initialize() + . = ..() + pixel_x = rand(-5, 5) + pixel_y = rand(-5, 5) + for(var/i in 1 to max_blueprints) + blueprints += null + +/obj/item/disk/design_disk/adv + name = "Advanced Component Design Disk" + desc = "A disk for storing device design data for construction in lathes. This one has extra storage space." + materials = list(MAT_METAL=300, MAT_GLASS=100, MAT_SILVER = 50) + max_blueprints = 5 diff --git a/code/modules/research/designs/autobotter_designs.dm b/code/modules/research/designs/autobotter_designs.dm index bfee7947..dd58ab50 100644 --- a/code/modules/research/designs/autobotter_designs.dm +++ b/code/modules/research/designs/autobotter_designs.dm @@ -151,97 +151,97 @@ name = "Export Design (Wine)" desc = "Allows for the blowing, and bottling of Wine bottles." id = "wine_export" - reagents_list = list("wine" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/wine = 100) build_path = /obj/item/export/bottle/wine /datum/design/bottle/export/rum name = "Export Design (Rum)" desc = "Allows for the blowing, and bottling of Rum bottles." id = "rum_export" - reagents_list = list("rum" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/rum = 100) build_path = /obj/item/export/bottle/rum /datum/design/bottle/export/gin name = "Export Design (Gin)" desc = "Allows for the blowing, and bottling of Gin bottles." id = "gin_export" - reagents_list = list("gin" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/gin = 100) build_path = /obj/item/export/bottle/gin /datum/design/bottle/export/whiskey name = "Export Design (Whiskey)" desc = "Allows for the blowing, and bottling of Whiskey bottles." id = "whiskey_export" - reagents_list = list("whiskey" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/whiskey = 100) build_path = /obj/item/export/bottle/whiskey /datum/design/bottle/export/vodka name = "Export Design (Vodka)" desc = "Allows for the blowing, and bottling of 99% Vodka bottles." id = "vodka_export" - reagents_list = list("vodka" = 99, "water" = 1) + reagents_list = list(/datum/reagent/consumable/ethanol/vodka = 99, /datum/reagent/water = 1) build_path = /obj/item/export/bottle/vodka /datum/design/bottle/export/tequila name = "Export Design (Tequila)" desc = "Allows for the blowing, and bottling of Tequila bottles." id = "tequila_export" - reagents_list = list("tequila" = 80, "lemon_juice" = 20) + reagents_list = list(/datum/reagent/consumable/ethanol/tequila = 80, /datum/reagent/consumable/lemonjuice = 20) build_path = /obj/item/export/bottle/tequila /datum/design/bottle/export/patron name = "Export Design (Patron)" desc = "Allows for the blowing, and bottling of Patron bottles." id = "patron_export" - reagents_list = list("patron" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/patron = 100) build_path = /obj/item/export/bottle/patron /datum/design/bottle/export/kahlua name = "Export Design (Kahlua)" desc = "Allows for the blowing, and bottling of Kahlua bottles." id = "kahlua_export" - reagents_list = list("kahlua" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/kahlua = 100) build_path = /obj/item/export/bottle/kahlua /datum/design/bottle/export/sake name = "Export Design (Sake)" desc = "Allows for the blowing, and bottling of Sake bottles." id = "sake_export" - reagents_list = list("sake" = 80, "rice" = 10, "sugar" = 10) + reagents_list = list(/datum/reagent/consumable/ethanol/sake = 80, /datum/reagent/consumable/rice = 10, /datum/reagent/consumable/sugar = 10) build_path = /obj/item/export/bottle/sake /datum/design/bottle/export/vermouth name = "Export Design (Vermouth)" desc = "Allows for the blowing, and bottling of Vermouth bottles." id = "vermouth_export" - reagents_list = list("vermouth" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/vermouth = 100) build_path = /obj/item/export/bottle/vermouth /datum/design/bottle/export/goldschlager name = "Export Design (Goldschlager)" desc = "Allows for the blowing, and bottling of Goldschlager bottles." id = "goldschlager_export" - reagents_list = list("goldschlager" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/goldschlager = 100) build_path = /obj/item/export/bottle/goldschlager /datum/design/bottle/export/hcider name = "Export Design (Cider)" desc = "Allows for the blowing, and bottling of Cider bottles." id = "hcider_export" - reagents_list = list("hcider" = 30, "water" = 20) + reagents_list = list(/datum/reagent/consumable/ethanol/hcider = 30, /datum/reagent/water = 20) build_path = /obj/item/export/bottle/hcider /datum/design/bottle/export/cognac name = "Export Design (Cognac)" desc = "Allows for the blowing, and bottling of Cognac bottles." id = "cognac_export" - reagents_list = list("cognac" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/cognac = 100) build_path = /obj/item/export/bottle/cognac /datum/design/bottle/export/absinthe name = "Export Design (Absinthe)" desc = "Allows for the blowing, and bottling of Absinthe bottles." - reagents_list = list("absinthe" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/absinthe = 100) id = "absinthe_export" build_path = /obj/item/export/bottle/absinthe @@ -249,49 +249,49 @@ name = "Export Design (Grappa)" desc = "Allows for the blowing, and bottling of Grappa bottles." id = "grappa_export" - reagents_list = list("grappa" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/grappa = 100) build_path = /obj/item/export/bottle/grappa /datum/design/bottle/export/fernet name = "Export Design (Fernet)" desc = "Allows for the blowing, and bottling of Fernet bottles." id = "fernet_export" - reagents_list = list("fernet" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/fernet = 100) build_path = /obj/item/export/bottle/fernet /datum/design/bottle/export/applejack name = "Export Design (Applejack)" desc = "Allows for the blowing, and bottling of Applejack bottles." id = "applejack_export" - reagents_list = list("applejack" = 50, "gin" = 10) + reagents_list = list(/datum/reagent/consumable/ethanol/applejack = 50, /datum/reagent/consumable/ethanol/gin = 10) build_path = /obj/item/export/bottle/applejack /datum/design/bottle/export/champagne name = "Export Design (Champagne)" desc = "Allows for the blowing, and bottling of Champagne bottles." id = "champagne_export" - reagents_list = list("champagne" = 90, "co2" = 10) + reagents_list = list(/datum/reagent/consumable/ethanol/champagne = 90, /datum/reagent/carbondioxide = 10) build_path = /obj/item/export/bottle/champagne /datum/design/bottle/export/blazaam name = "Export Design (Blazaam)" desc = "Allows for the blowing, and bottling of Blazaam bottles." id = "blazaam_export" - reagents_list = list("blazaam" = 80, "holywater" = 20) + reagents_list = list(/datum/reagent/consumable/ethanol/blazaam = 80, /datum/reagent/water/holywater = 20) build_path = /obj/item/export/bottle/blazaam /datum/design/bottle/export/trappist name = "Export Design (Trappist)" desc = "Allows for the blowing, and bottling of Trappist bottles." id = "trappist_export" - reagents_list = list("trappist" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/trappist = 100) build_path = /obj/item/export/bottle/trappist /datum/design/bottle/export/grenadine name = "Export Design (Grenadine)" desc = "Allows for the blowing, and bottling of Grenadine bottles." id = "grenadine_export" - reagents_list = list("grenadine" = 100) + reagents_list = list(/datum/reagent/consumable/grenadine = 100) build_path = /obj/item/export/bottle/grenadine /datum/design/bottle/export/minikeg @@ -299,7 +299,7 @@ desc = "Allows for the fabication, and bottling of Minikeg of craft beer." id = "minikeg" category = list("Beers") - reagents_list = list("light_beer" = 100) + reagents_list = list(/datum/reagent/consumable/ethanol/beer/light = 100) build_path = /obj/item/export/bottle/minikeg /datum/design/bottle/export/blooddrop @@ -307,7 +307,7 @@ desc = "Allows for the blowing, and bottling of Blooddrop bottles." id = "blooddrop" category = list("Wines") - reagents_list = list("champagne" = 30, "co2" = 30, "wine" = 10, "grapejuice" = 30) + reagents_list = list(/datum/reagent/consumable/ethanol/champagne = 30, /datum/reagent/carbondioxide = 30, /datum/reagent/consumable/ethanol/wine = 10, /datum/reagent/consumable/grapejuice = 30) build_path = /obj/item/export/bottle/blooddrop /datum/design/bottle/export/slim_gold @@ -315,7 +315,7 @@ desc = "Allows for the blowing, and bottling of Slim Gold bottles." id = "slim_gold" category = list("Beers") - reagents_list = list("gold" = 10, "co2" = 10, "rum" = 30, "beer" = 40) + reagents_list = list(/datum/reagent/gold = 10, /datum/reagent/carbondioxide = 10, /datum/reagent/consumable/ethanol/rum = 30, /datum/reagent/consumable/ethanol/beer = 40) build_path = /obj/item/export/bottle/slim_gold /datum/design/bottle/export/white_bloodmoon @@ -323,13 +323,13 @@ desc = "Allows for the blowing, and bottling of White Bloodmoon bottles." id = "white_bloodmoon" category = list("Wines") - reagents_list = list("synthflesh" = 50, "blood" = 50, "liquidgibs" = 10) + reagents_list = list(/datum/reagent/medicine/synthflesh = 50, /datum/reagent/blood = 50, /datum/reagent/liquidgibs = 10) build_path = /obj/item/export/bottle/white_bloodmoon /datum/design/bottle/export/greenroad name = "Export Design (Greenroad)" desc = "Allows for the blowing, and bottling of Greenroad bottles." id = "greenroad" - reagents_list = list("vitfro" = 50, "rum" = 50, "ash" = 10) + reagents_list = list(/datum/reagent/consumable/vitfro = 50, /datum/reagent/consumable/ethanol/rum = 50, /datum/reagent/ash = 10) category = list("Beers") build_path = /obj/item/export/bottle/greenroad diff --git a/code/modules/research/designs/biogenerator_designs.dm b/code/modules/research/designs/biogenerator_designs.dm index 05e4c667..20242c91 100644 --- a/code/modules/research/designs/biogenerator_designs.dm +++ b/code/modules/research/designs/biogenerator_designs.dm @@ -7,7 +7,7 @@ id = "milk" build_type = BIOGENERATOR materials = list(MAT_BIOMASS = 20) - make_reagents = list("milk" = 10) + make_reagents = list(/datum/reagent/consumable/milk = 10) category = list("initial","Food") /datum/design/cream @@ -15,7 +15,7 @@ id = "cream" build_type = BIOGENERATOR materials = list(MAT_BIOMASS = 30) - make_reagents = list("cream" = 10) + make_reagents = list(/datum/reagent/consumable/cream = 10) category = list("initial","Food") /datum/design/milk_carton @@ -39,7 +39,7 @@ id = "black_pepper" build_type = BIOGENERATOR materials = list(MAT_BIOMASS = 25) - make_reagents = list("blackpepper" = 10) + make_reagents = list(/datum/reagent/consumable/blackpepper = 10) category = list("initial","Food") /datum/design/pepper_mill diff --git a/code/modules/research/designs/limbgrower_designs.dm b/code/modules/research/designs/limbgrower_designs.dm index 71f7234e..954dfca6 100644 --- a/code/modules/research/designs/limbgrower_designs.dm +++ b/code/modules/research/designs/limbgrower_designs.dm @@ -6,7 +6,7 @@ name = "Left Arm" id = "leftarm" build_type = LIMBGROWER - reagents_list = list("synthflesh" = 25) + reagents_list = list(/datum/reagent/medicine/synthflesh = 25) build_path = /obj/item/bodypart/l_arm category = list("initial","human","lizard","fly","moth","plasmaman") @@ -14,7 +14,7 @@ name = "Right Arm" id = "rightarm" build_type = LIMBGROWER - reagents_list = list("synthflesh" = 25) + reagents_list = list(/datum/reagent/medicine/synthflesh = 25) build_path = /obj/item/bodypart/r_arm category = list("initial","human","lizard","fly","moth","plasmaman") @@ -22,7 +22,7 @@ name = "Left Leg" id = "leftleg" build_type = LIMBGROWER - reagents_list = list("synthflesh" = 25) + reagents_list = list(/datum/reagent/medicine/synthflesh = 25) build_path = /obj/item/bodypart/l_leg category = list("initial","human","lizard","fly","moth","plasmaman") @@ -30,7 +30,7 @@ name = "Right Leg" id = "rightleg" build_type = LIMBGROWER - reagents_list = list("synthflesh" = 25) + reagents_list = list(/datum/reagent/medicine/synthflesh = 25) build_path = /obj/item/bodypart/r_leg category = list("initial","human","lizard","fly","moth","plasmaman") @@ -38,6 +38,6 @@ name = "Arm Blade" id = "armblade" build_type = LIMBGROWER - reagents_list = list("synthflesh" = 75) + reagents_list = list(/datum/reagent/medicine/synthflesh = 75) build_path = /obj/item/melee/synthetic_arm_blade category = list("other","emagged") \ No newline at end of file diff --git a/code/modules/research/designs/weapon_designs.dm b/code/modules/research/designs/weapon_designs.dm index 02fd6c5f..99a6e415 100644 --- a/code/modules/research/designs/weapon_designs.dm +++ b/code/modules/research/designs/weapon_designs.dm @@ -231,7 +231,7 @@ id = "decloner" build_type = PROTOLATHE materials = list(MAT_GOLD = 5000,MAT_URANIUM = 10000) - reagents_list = list("mutagen" = 40) + reagents_list = list(/datum/reagent/toxin/mutagen = 40) build_path = /obj/item/gun/energy/decloner category = list("Weapons") departmental_flags = DEPARTMENTAL_FLAG_SECURITY @@ -262,7 +262,7 @@ id = "flora_gun" build_type = PROTOLATHE materials = list(MAT_METAL = 2000, MAT_GLASS = 500) - reagents_list = list("radium" = 20) + reagents_list = list(/datum/reagent/radium = 20) build_path = /obj/item/gun/energy/floragun category = list("Weapons") departmental_flags = DEPARTMENTAL_FLAG_SERVICE diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index c5bc78dd..a8d61311 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -1,665 +1,667 @@ -//this is designed to replace the destructive analyzer - -//NEEDS MAJOR CODE CLEANUP - -#define SCANTYPE_POKE 1 -#define SCANTYPE_IRRADIATE 2 -#define SCANTYPE_GAS 3 -#define SCANTYPE_HEAT 4 -#define SCANTYPE_COLD 5 -#define SCANTYPE_OBLITERATE 6 -#define SCANTYPE_DISCOVER 7 - -#define EFFECT_PROB_VERYLOW 20 -#define EFFECT_PROB_LOW 35 -#define EFFECT_PROB_MEDIUM 50 -#define EFFECT_PROB_HIGH 75 -#define EFFECT_PROB_VERYHIGH 95 - -#define FAIL 8 -/obj/machinery/rnd/experimentor - name = "\improper E.X.P.E.R.I-MENTOR" - desc = "A \"replacement\" for the destructive analyzer with a slight tendency to catastrophically fail." - icon = 'icons/obj/machines/heavy_lathe.dmi' - icon_state = "h_lathe" - density = TRUE - use_power = IDLE_POWER_USE - circuit = /obj/item/circuitboard/machine/experimentor - var/recentlyExperimented = 0 - var/mob/trackedIan - var/mob/trackedRuntime - var/badThingCoeff = 0 - var/resetTime = 15 - var/cloneMode = FALSE - var/list/item_reactions = list() - var/list/valid_items = list() //valid items for special reactions like transforming - var/list/critical_items = list() //items that can cause critical reactions - -/obj/machinery/rnd/experimentor/proc/ConvertReqString2List(list/source_list) - var/list/temp_list = params2list(source_list) - for(var/O in temp_list) - temp_list[O] = text2num(temp_list[O]) - return temp_list - - -/obj/machinery/rnd/experimentor/proc/SetTypeReactions() - for(var/I in typesof(/obj/item)) - if(ispath(I, /obj/item/relic)) - item_reactions["[I]"] = SCANTYPE_DISCOVER - else - item_reactions["[I]"] = pick(SCANTYPE_POKE,SCANTYPE_IRRADIATE,SCANTYPE_GAS,SCANTYPE_HEAT,SCANTYPE_COLD,SCANTYPE_OBLITERATE) - - if(ispath(I, /obj/item/stock_parts) || ispath(I, /obj/item/grenade/chem_grenade) || ispath(I, /obj/item/kitchen)) - var/obj/item/tempCheck = I - if(initial(tempCheck.icon_state) != null) //check it's an actual usable item, in a hacky way - if(ispath(I, /obj/item/grenade/chem_grenade/tuberculosis)) - continue - valid_items["[I]"] += 15 - - if(ispath(I, /obj/item/reagent_containers/food)) - var/obj/item/tempCheck = I - if(initial(tempCheck.icon_state) != null) //check it's an actual usable item, in a hacky way - valid_items["[I]"] += rand(1,4) - - if(ispath(I, /obj/item/construction/rcd) || ispath(I, /obj/item/grenade) || ispath(I, /obj/item/aicard) || ispath(I, /obj/item/storage/backpack/holding) || ispath(I, /obj/item/slime_extract) || ispath(I, /obj/item/onetankbomb) || ispath(I, /obj/item/transfer_valve)) - var/obj/item/tempCheck = I - if(initial(tempCheck.icon_state) != null) - critical_items += I - -/obj/machinery/rnd/experimentor/Initialize() - . = ..() - - trackedIan = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list - trackedRuntime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list - SetTypeReactions() - -/obj/machinery/rnd/experimentor/RefreshParts() - for(var/obj/item/stock_parts/manipulator/M in component_parts) - if(resetTime > 0 && (resetTime - M.rating) >= 1) - resetTime -= M.rating - for(var/obj/item/stock_parts/scanning_module/M in component_parts) - badThingCoeff += M.rating*2 - for(var/obj/item/stock_parts/micro_laser/M in component_parts) - badThingCoeff += M.rating - -/obj/machinery/rnd/experimentor/proc/checkCircumstances(obj/item/O) - //snowflake check to only take "made" bombs - if(istype(O, /obj/item/transfer_valve)) - var/obj/item/transfer_valve/T = O - if(!T.tank_one || !T.tank_two || !T.attached_device) - return FALSE - return TRUE - -/obj/machinery/rnd/experimentor/Insert_Item(obj/item/O, mob/user) - if(user.a_intent != INTENT_HARM) - . = 1 - if(!is_insertion_ready(user)) - return - if(!user.transferItemToLoc(O, src)) - return - loaded_item = O - to_chat(user, "You add [O] to the machine.") - flick("h_lathe_load", src) - -/obj/machinery/rnd/experimentor/default_deconstruction_crowbar(obj/item/O) - ejectItem() - . = ..(O) - -/obj/machinery/rnd/experimentor/ui_interact(mob/user) - var/list/dat = list("
    ") - if(!linked_console) - dat += "Scan for R&D Console" - if(loaded_item) - dat += "Loaded Item: [loaded_item]" - - dat += "
    Available tests:" - dat += "Poke" - dat += "Irradiate" - dat += "Gas" - dat += "Burn" - dat += "Freeze" - dat += "Destroy
    " - if(istype(loaded_item,/obj/item/relic)) - dat += "Discover" - dat += "Eject" - var/list/listin = techweb_item_boost_check(src) - if(listin) - var/list/output = list("Research Boost Data:") - var/list/res = list("Already researched:") - var/list/boosted = list("Already boosted:") - for(var/node_id in listin) - var/datum/techweb_node/N = get_techweb_node_by_id(node_id) - var/str = "[N.display_name]: [listin[N]] points." - if(SSresearch.science_tech.researched_nodes[N]) - res += str - else if(SSresearch.science_tech.boosted_nodes[N]) - boosted += str - if(SSresearch.science_tech.visible_nodes[N]) //JOY OF DISCOVERY! - output += str - output += boosted + res - dat += output - else - dat += "Nothing loaded." - dat += "Refresh" - dat += "Close
    " - var/datum/browser/popup = new(user, "experimentor","Experimentor", 700, 400, src) - popup.set_content(dat.Join("
    ")) - popup.open() - onclose(user, "experimentor") - -/obj/machinery/rnd/experimentor/Topic(href, href_list) - if(..()) - return - usr.set_machine(src) - - var/scantype = href_list["function"] - var/obj/item/process = locate(href_list["item"]) in src - - if(href_list["close"]) - usr << browse(null, "window=experimentor") - return - if(scantype == "search") - var/obj/machinery/computer/rdconsole/D = locate(/obj/machinery/computer/rdconsole) in oview(3,src) - if(D) - linked_console = D - else if(scantype == "eject") - ejectItem() - else if(scantype == "refresh") - updateUsrDialog() - else - if(recentlyExperimented) - to_chat(usr, "[src] has been used too recently!") - else if(!loaded_item) - to_chat(usr, "[src] is not currently loaded!") - else if(!process || process != loaded_item) //Interface exploit protection (such as hrefs or swapping items with interface set to old item) - to_chat(usr, "Interface failure detected in [src]. Please try again.") - else - var/dotype - if(text2num(scantype) == SCANTYPE_DISCOVER) - dotype = SCANTYPE_DISCOVER - else - dotype = matchReaction(process,scantype) - experiment(dotype,process) - use_power(750) - if(dotype != FAIL) - var/list/datum/techweb_node/nodes = techweb_item_boost_check(process) - var/picked = pickweight(nodes) //This should work. - if(linked_console) - linked_console.stored_research.boost_with_path(picked, process.type) - updateUsrDialog() - -/obj/machinery/rnd/experimentor/proc/matchReaction(matching,reaction) - var/obj/item/D = matching - if(D) - if(item_reactions.Find("[D.type]")) - var/tor = item_reactions["[D.type]"] - if(tor == text2num(reaction)) - return tor - else - return FAIL - else - return FAIL - else - return FAIL - -/obj/machinery/rnd/experimentor/proc/ejectItem(delete=FALSE) - if(loaded_item) - if(cloneMode) - visible_message("A duplicate [loaded_item] pops out!") - var/type_to_make = loaded_item.type - new type_to_make(get_turf(pick(oview(1,src)))) - cloneMode = FALSE - return - var/turf/dropturf = get_turf(pick(view(1,src))) - if(!dropturf) //Failsafe to prevent the object being lost in the void forever. - dropturf = drop_location() - loaded_item.forceMove(dropturf) - if(delete) - qdel(loaded_item) - loaded_item = null - -/obj/machinery/rnd/experimentor/proc/throwSmoke(turf/where) - var/datum/effect_system/smoke_spread/smoke = new - smoke.set_up(0, where) - smoke.start() - - -/obj/machinery/rnd/experimentor/proc/experiment(exp,obj/item/exp_on) - recentlyExperimented = 1 - icon_state = "h_lathe_wloop" - var/chosenchem - var/criticalReaction = (exp_on.type in critical_items) ? TRUE : FALSE - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == SCANTYPE_POKE) - visible_message("[src] prods at [exp_on] with mechanical arms.") - if(prob(EFFECT_PROB_LOW) && criticalReaction) - visible_message("[exp_on] is gripped in just the right way, enhancing its focus.") - badThingCoeff++ - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - visible_message("[src] malfunctions and destroys [exp_on], lashing its arms out at nearby people!") - for(var/mob/living/m in oview(1, src)) - m.apply_damage(15, BRUTE, pick(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_PRECISE_GROIN)) - investigate_log("Experimentor dealt minor brute to [m].", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_LOW-badThingCoeff)) - visible_message("[src] malfunctions!") - exp = SCANTYPE_OBLITERATE - else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) - visible_message("[src] malfunctions, throwing the [exp_on]!") - var/mob/living/target = locate(/mob/living) in oview(7,src) - if(target) - var/obj/item/throwing = loaded_item - investigate_log("Experimentor has thrown [loaded_item] at [key_name(target)]", INVESTIGATE_EXPERIMENTOR) - ejectItem() - if(throwing) - throwing.throw_at(target, 10, 1) - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == SCANTYPE_IRRADIATE) - visible_message("[src] reflects radioactive rays at [exp_on]!") - if(prob(EFFECT_PROB_LOW) && criticalReaction) - visible_message("[exp_on] has activated an unknown subroutine!") - cloneMode = TRUE - investigate_log("Experimentor has made a clone of [exp_on]", INVESTIGATE_EXPERIMENTOR) - ejectItem() - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - visible_message("[src] malfunctions, melting [exp_on] and leaking radiation!") - radiation_pulse(src, 500) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_LOW-badThingCoeff)) - visible_message("[src] malfunctions, spewing toxic waste!") - for(var/turf/T in oview(1, src)) - if(!T.density) - if(prob(EFFECT_PROB_VERYHIGH) && !(locate(/obj/effect/decal/cleanable/greenglow) in T)) - var/obj/effect/decal/cleanable/reagentdecal = new/obj/effect/decal/cleanable/greenglow(T) - reagentdecal.reagents.add_reagent("radium", 7) - else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) - var/savedName = "[exp_on]" - ejectItem(TRUE) - var/newPath = text2path(pickweight(valid_items)) - loaded_item = new newPath(src) - visible_message("[src] malfunctions, transforming [savedName] into [loaded_item]!") - investigate_log("Experimentor has transformed [savedName] into [loaded_item]", INVESTIGATE_EXPERIMENTOR) - if(istype(loaded_item, /obj/item/grenade/chem_grenade)) - var/obj/item/grenade/chem_grenade/CG = loaded_item - CG.prime() - ejectItem() - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == SCANTYPE_GAS) - visible_message("[src] fills its chamber with gas, [exp_on] included.") - if(prob(EFFECT_PROB_LOW) && criticalReaction) - visible_message("[exp_on] achieves the perfect mix!") - new /obj/item/stack/sheet/mineral/plasma(get_turf(pick(oview(1,src)))) - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - visible_message("[src] destroys [exp_on], leaking dangerous gas!") - chosenchem = pick("carbon","radium","toxin","condensedcapsaicin","mushroomhallucinogen","space_drugs","ethanol","beepskysmash") - var/datum/reagents/R = new/datum/reagents(50) - R.my_atom = src - R.add_reagent(chosenchem , 50) - investigate_log("Experimentor has released [chosenchem] smoke.", INVESTIGATE_EXPERIMENTOR) - var/datum/effect_system/smoke_spread/chem/smoke = new - smoke.set_up(R, 0, src, silent = TRUE) - playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) - smoke.start() - qdel(R) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - visible_message("[src]'s chemical chamber has sprung a leak!") - chosenchem = pick("mutationtoxin","nanomachines","sacid") - var/datum/reagents/R = new/datum/reagents(50) - R.my_atom = src - R.add_reagent(chosenchem , 50) - var/datum/effect_system/smoke_spread/chem/smoke = new - smoke.set_up(R, 0, src, silent = TRUE) - playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) - smoke.start() - qdel(R) - ejectItem(TRUE) - warn_admins(usr, "[chosenchem] smoke") - investigate_log("Experimentor has released [chosenchem] smoke!", INVESTIGATE_EXPERIMENTOR) - else if(prob(EFFECT_PROB_LOW-badThingCoeff)) - visible_message("[src] malfunctions, spewing harmless gas.") - throwSmoke(loc) - else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) - visible_message("[src] melts [exp_on], ionizing the air around it!") - empulse(loc, 4, 6) - investigate_log("Experimentor has generated an Electromagnetic Pulse.", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == SCANTYPE_HEAT) - visible_message("[src] raises [exp_on]'s temperature.") - if(prob(EFFECT_PROB_LOW) && criticalReaction) - visible_message("[src]'s emergency coolant system gives off a small ding!") - playsound(src, 'sound/machines/ding.ogg', 50, 1) - var/obj/item/reagent_containers/food/drinks/coffee/C = new /obj/item/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src)))) - chosenchem = pick("plasma","capsaicin","ethanol") - C.reagents.remove_any(25) - C.reagents.add_reagent(chosenchem , 50) - C.name = "Cup of Suspicious Liquid" - C.desc = "It has a large hazard symbol printed on the side in fading ink." - investigate_log("Experimentor has made a cup of [chosenchem] coffee.", INVESTIGATE_EXPERIMENTOR) - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - var/turf/start = get_turf(src) - var/mob/M = locate(/mob/living) in view(src, 3) - var/turf/MT = get_turf(M) - if(MT) - visible_message("[src] dangerously overheats, launching a flaming fuel orb!") - investigate_log("Experimentor has launched a fireball at [M]!", INVESTIGATE_EXPERIMENTOR) - var/obj/item/projectile/magic/aoe/fireball/FB = new /obj/item/projectile/magic/aoe/fireball(start) - FB.preparePixelProjectile(MT, start) - FB.fire() - else if(prob(EFFECT_PROB_LOW-badThingCoeff)) - visible_message("[src] malfunctions, melting [exp_on] and releasing a burst of flame!") - explosion(loc, -1, 0, 0, 0, 0, flame_range = 2) - investigate_log("Experimentor started a fire.", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) - visible_message("[src] malfunctions, melting [exp_on] and leaking hot air!") - var/datum/gas_mixture/env = loc.return_air() - var/transfer_moles = 0.25 * env.total_moles() - var/datum/gas_mixture/removed = env.remove(transfer_moles) - if(removed) - var/heat_capacity = removed.heat_capacity() - if(heat_capacity == 0 || heat_capacity == null) - heat_capacity = 1 - removed.temperature = min((removed.temperature*heat_capacity + 100000)/heat_capacity, 1000) - env.merge(removed) - air_update_turf() - investigate_log("Experimentor has released hot air.", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) - visible_message("[src] malfunctions, activating its emergency coolant systems!") - throwSmoke(loc) - for(var/mob/living/m in oview(1, src)) - m.apply_damage(5, BURN, pick(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_PRECISE_GROIN)) - investigate_log("Experimentor has dealt minor burn damage to [key_name(m)]", INVESTIGATE_EXPERIMENTOR) - ejectItem() - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == SCANTYPE_COLD) - visible_message("[src] lowers [exp_on]'s temperature.") - if(prob(EFFECT_PROB_LOW) && criticalReaction) - visible_message("[src]'s emergency coolant system gives off a small ding!") - var/obj/item/reagent_containers/food/drinks/coffee/C = new /obj/item/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src)))) - playsound(src, 'sound/machines/ding.ogg', 50, 1) //Ding! Your death coffee is ready! - chosenchem = pick("uranium","frostoil","ephedrine") - C.reagents.remove_any(25) - C.reagents.add_reagent(chosenchem , 50) - C.name = "Cup of Suspicious Liquid" - C.desc = "It has a large hazard symbol printed on the side in fading ink." - investigate_log("Experimentor has made a cup of [chosenchem] coffee.", INVESTIGATE_EXPERIMENTOR) - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - visible_message("[src] malfunctions, shattering [exp_on] and releasing a dangerous cloud of coolant!") - var/datum/reagents/R = new/datum/reagents(50) - R.my_atom = src - R.add_reagent("frostoil" , 50) - investigate_log("Experimentor has released frostoil gas.", INVESTIGATE_EXPERIMENTOR) - var/datum/effect_system/smoke_spread/chem/smoke = new - smoke.set_up(R, 0, src, silent = TRUE) - playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) - smoke.start() - qdel(R) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_LOW-badThingCoeff)) - visible_message("[src] malfunctions, shattering [exp_on] and leaking cold air!") - var/datum/gas_mixture/env = loc.return_air() - var/transfer_moles = 0.25 * env.total_moles() - var/datum/gas_mixture/removed = env.remove(transfer_moles) - if(removed) - var/heat_capacity = removed.heat_capacity() - if(heat_capacity == 0 || heat_capacity == null) - heat_capacity = 1 - removed.temperature = (removed.temperature*heat_capacity - 75000)/heat_capacity - env.merge(removed) - air_update_turf() - investigate_log("Experimentor has released cold air.", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) - visible_message("[src] malfunctions, releasing a flurry of chilly air as [exp_on] pops out!") - var/datum/effect_system/smoke_spread/smoke = new - smoke.set_up(0, loc) - smoke.start() - ejectItem() - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == SCANTYPE_OBLITERATE) - visible_message("[exp_on] activates the crushing mechanism, [exp_on] is destroyed!") - if(linked_console.linked_lathe) - var/datum/component/material_container/linked_materials = linked_console.linked_lathe.GetComponent(/datum/component/material_container) - for(var/material in exp_on.materials) - linked_materials.insert_amount( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.materials[material])), material) - if(prob(EFFECT_PROB_LOW) && criticalReaction) - visible_message("[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!") - new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src)))) - else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) - visible_message("[src]'s crusher goes way too many levels too high, crushing right through space-time!") - playsound(src, 'sound/effects/supermatter.ogg', 50, 1, -3) - investigate_log("Experimentor has triggered the 'throw things' reaction.", INVESTIGATE_EXPERIMENTOR) - for(var/atom/movable/AM in oview(7,src)) - if(!AM.anchored) - AM.throw_at(src,10,1) - else if(prob(EFFECT_PROB_LOW-badThingCoeff)) - visible_message("[src]'s crusher goes one level too high, crushing right into space-time!") - playsound(src, 'sound/effects/supermatter.ogg', 50, 1, -3) - investigate_log("Experimentor has triggered the 'minor throw things' reaction.", INVESTIGATE_EXPERIMENTOR) - var/list/throwAt = list() - for(var/atom/movable/AM in oview(7,src)) - if(!AM.anchored) - throwAt.Add(AM) - for(var/counter = 1, counter < throwAt.len, ++counter) - var/atom/movable/cast = throwAt[counter] - cast.throw_at(pick(throwAt),10,1) - ejectItem(TRUE) - //////////////////////////////////////////////////////////////////////////////////////////////// - if(exp == FAIL) - var/a = pick("rumbles","shakes","vibrates","shudders") - var/b = pick("crushes","spins","viscerates","smashes","insults") - visible_message("[exp_on] [a], and [b], the experiment was a failure.") - - if(exp == SCANTYPE_DISCOVER) - visible_message("[src] scans the [exp_on], revealing its true nature!") - playsound(src, 'sound/effects/supermatter.ogg', 50, 3, -1) - var/obj/item/relic/R = loaded_item - R.reveal() - investigate_log("Experimentor has revealed a relic with [R.realProc] effect.", INVESTIGATE_EXPERIMENTOR) - ejectItem() - - //Global reactions - if(prob(EFFECT_PROB_VERYLOW-badThingCoeff) && loaded_item) - var/globalMalf = rand(1,100) - if(globalMalf < 15) - visible_message("[src]'s onboard detection system has malfunctioned!") - item_reactions["[exp_on.type]"] = pick(SCANTYPE_POKE,SCANTYPE_IRRADIATE,SCANTYPE_GAS,SCANTYPE_HEAT,SCANTYPE_COLD,SCANTYPE_OBLITERATE) - ejectItem() - if(globalMalf > 16 && globalMalf < 35) - visible_message("[src] melts [exp_on], ian-izing the air around it!") - throwSmoke(loc) - if(trackedIan) - throwSmoke(trackedIan.loc) - trackedIan.forceMove(loc) - investigate_log("Experimentor has stolen Ian!", INVESTIGATE_EXPERIMENTOR) //...if anyone ever fixes it... - else - new /mob/living/simple_animal/pet/dog/corgi(loc) - investigate_log("Experimentor has spawned a new corgi.", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - if(globalMalf > 36 && globalMalf < 50) - visible_message("Experimentor draws the life essence of those nearby!") - for(var/mob/living/m in view(4,src)) - to_chat(m, "You feel your flesh being torn from you, mists of blood drifting to [src]!") - m.apply_damage(50, BRUTE, BODY_ZONE_CHEST) - investigate_log("Experimentor has taken 50 brute a blood sacrifice from [m]", INVESTIGATE_EXPERIMENTOR) - if(globalMalf > 51 && globalMalf < 75) - visible_message("[src] encounters a run-time error!") - throwSmoke(loc) - if(trackedRuntime) - throwSmoke(trackedRuntime.loc) - trackedRuntime.forceMove(drop_location()) - investigate_log("Experimentor has stolen Runtime!", INVESTIGATE_EXPERIMENTOR) - else - new /mob/living/simple_animal/pet/cat(loc) - investigate_log("Experimentor failed to steal runtime, and instead spawned a new cat.", INVESTIGATE_EXPERIMENTOR) - ejectItem(TRUE) - if(globalMalf > 76) - visible_message("[src] begins to smoke and hiss, shaking violently!") - use_power(500000) - investigate_log("Experimentor has drained power from its APC", INVESTIGATE_EXPERIMENTOR) - - addtimer(CALLBACK(src, .proc/reset_exp), resetTime) - -/obj/machinery/rnd/experimentor/proc/reset_exp() - update_icon() - recentlyExperimented = FALSE - -/obj/machinery/rnd/experimentor/update_icon() - icon_state = "h_lathe" - -/obj/machinery/rnd/experimentor/proc/warn_admins(user, ReactionName) - var/turf/T = get_turf(user) - message_admins("Experimentor reaction: [ReactionName] generated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(T)]") - log_game("Experimentor reaction: [ReactionName] generated by [key_name(user)] in [AREACOORD(T)]") - -#undef SCANTYPE_POKE -#undef SCANTYPE_IRRADIATE -#undef SCANTYPE_GAS -#undef SCANTYPE_HEAT -#undef SCANTYPE_COLD -#undef SCANTYPE_OBLITERATE -#undef SCANTYPE_DISCOVER - -#undef EFFECT_PROB_VERYLOW -#undef EFFECT_PROB_LOW -#undef EFFECT_PROB_MEDIUM -#undef EFFECT_PROB_HIGH -#undef EFFECT_PROB_VERYHIGH - -#undef FAIL - - -//////////////////////////////////SPECIAL ITEMS//////////////////////////////////////// - -/obj/item/relic - name = "strange object" - desc = "What mysteries could this hold?" - icon = 'icons/obj/assemblies.dmi' - var/realName = "defined object" - var/revealed = FALSE - var/realProc - var/cooldownMax = 60 - var/cooldown - -/obj/item/relic/Initialize() - . = ..() - icon_state = pick("shock_kit","armor-igniter-analyzer","infra-igniter0","infra-igniter1","radio-multitool","prox-radio1","radio-radio","timer-multitool0","radio-igniter-tank") - realName = "[pick("broken","twisted","spun","improved","silly","regular","badly made")] [pick("device","object","toy","illegal tech","weapon")]" - - -/obj/item/relic/proc/reveal() - if(revealed) //Re-rolling your relics seems a bit overpowered, yes? - return - revealed = TRUE - name = realName - cooldownMax = rand(60,300) - realProc = pick("teleport","explode","rapidDupe","petSpray","flash","clean","corgicannon") - -/obj/item/relic/attack_self(mob/user) - if(revealed) - if(cooldown) - to_chat(user, "[src] does not react!") - return - else if(loc == user) - cooldown = TRUE - call(src,realProc)(user) - addtimer(CALLBACK(src, .proc/cd), cooldownMax) - else - to_chat(user, "You aren't quite sure what to do with this yet.") - -/obj/item/relic/proc/cd() - cooldown = FALSE - -//////////////// RELIC PROCS ///////////////////////////// - -/obj/item/relic/proc/throwSmoke(turf/where) - var/datum/effect_system/smoke_spread/smoke = new - smoke.set_up(0, get_turf(where)) - smoke.start() - -/obj/item/relic/proc/corgicannon(mob/user) - playsound(src, "sparks", rand(25,50), 1) - var/mob/living/simple_animal/pet/dog/corgi/C = new/mob/living/simple_animal/pet/dog/corgi(get_turf(user)) - C.throw_at(pick(oview(10,user)), 10, rand(3,8), callback = CALLBACK(src, .proc/throwSmoke, C)) - warn_admins(user, "Corgi Cannon", 0) - -/obj/item/relic/proc/clean(mob/user) - playsound(src, "sparks", rand(25,50), 1) - var/obj/item/grenade/chem_grenade/cleaner/CL = new/obj/item/grenade/chem_grenade/cleaner(get_turf(user)) - CL.prime() - warn_admins(user, "Smoke", 0) - -/obj/item/relic/proc/flash(mob/user) - playsound(src, "sparks", rand(25,50), 1) - var/obj/item/grenade/flashbang/CB = new/obj/item/grenade/flashbang(user.loc) - CB.prime() - warn_admins(user, "Flash") - -/obj/item/relic/proc/petSpray(mob/user) - var/message = "[src] begins to shake, and in the distance the sound of rampaging animals arises!" - visible_message(message) - to_chat(user, message) - var/animals = rand(1,25) - var/counter - var/list/valid_animals = list(/mob/living/simple_animal/parrot, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/pet/cat, /mob/living/simple_animal/pet/dog/corgi, /mob/living/simple_animal/crab, /mob/living/simple_animal/pet/fox, /mob/living/simple_animal/hostile/lizard, /mob/living/simple_animal/mouse, /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/poison/bees, /mob/living/simple_animal/hostile/carp) - for(counter = 1; counter < animals; counter++) - var/mobType = pick(valid_animals) - new mobType(get_turf(src)) - warn_admins(user, "Mass Mob Spawn") - if(prob(60)) - to_chat(user, "[src] falls apart!") - qdel(src) - -/obj/item/relic/proc/rapidDupe(mob/user) - audible_message("[src] emits a loud pop!") - var/list/dupes = list() - var/counter - var/max = rand(5,10) - for(counter = 1; counter < max; counter++) - var/obj/item/relic/R = new type(get_turf(src)) - R.name = name - R.desc = desc - R.realName = realName - R.realProc = realProc - R.revealed = TRUE - dupes |= R - R.throw_at(pick(oview(7,get_turf(src))),10,1) - counter = 0 - QDEL_LIST_IN(dupes, rand(10, 100)) - warn_admins(user, "Rapid duplicator", 0) - -/obj/item/relic/proc/explode(mob/user) - to_chat(user, "[src] begins to heat up!") - addtimer(CALLBACK(src, .proc/do_explode, user), rand(35, 100)) - -/obj/item/relic/proc/do_explode(mob/user) - if(loc == user) - visible_message("\The [src]'s top opens, releasing a powerful blast!") - explosion(user.loc, 0, rand(1,5), rand(1,5), rand(1,5), rand(1,5), flame_range = 2) - warn_admins(user, "Explosion") - qdel(src) //Comment this line to produce a light grenade (the bomb that keeps on exploding when used)!! - -/obj/item/relic/proc/teleport(mob/user) - to_chat(user, "[src] begins to vibrate!") - addtimer(CALLBACK(src, .proc/do_the_teleport, user), rand(10, 30)) - -/obj/item/relic/proc/do_the_teleport(mob/user) - var/turf/userturf = get_turf(user) - if(loc == user && !is_centcom_level(userturf.z)) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you! - visible_message("[src] twists and bends, relocating itself!") - throwSmoke(userturf) - do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) - throwSmoke(get_turf(user)) - warn_admins(user, "Teleport", 0) - -//Admin Warning proc for relics -/obj/item/relic/proc/warn_admins(mob/user, RelicType, priority = 1) - var/turf/T = get_turf(src) - var/log_msg = "[RelicType] relic used by [key_name(user)] in [AREACOORD(T)]" - if(priority) //For truly dangerous relics that may need an admin's attention. BWOINK! - message_admins("[RelicType] relic activated by [ADMIN_LOOKUPFLW(user)] in [ADMIN_VERBOSEJMP(T)]") - log_game(log_msg) - investigate_log(log_msg, "experimentor") +//this is designed to replace the destructive analyzer + +//NEEDS MAJOR CODE CLEANUP + +#define SCANTYPE_POKE 1 +#define SCANTYPE_IRRADIATE 2 +#define SCANTYPE_GAS 3 +#define SCANTYPE_HEAT 4 +#define SCANTYPE_COLD 5 +#define SCANTYPE_OBLITERATE 6 +#define SCANTYPE_DISCOVER 7 + +#define EFFECT_PROB_VERYLOW 20 +#define EFFECT_PROB_LOW 35 +#define EFFECT_PROB_MEDIUM 50 +#define EFFECT_PROB_HIGH 75 +#define EFFECT_PROB_VERYHIGH 95 + +#define FAIL 8 +/obj/machinery/rnd/experimentor + name = "\improper E.X.P.E.R.I-MENTOR" + desc = "A \"replacement\" for the destructive analyzer with a slight tendency to catastrophically fail." + icon = 'icons/obj/machines/heavy_lathe.dmi' + icon_state = "h_lathe" + density = TRUE + use_power = IDLE_POWER_USE + circuit = /obj/item/circuitboard/machine/experimentor + var/recentlyExperimented = 0 + var/mob/trackedIan + var/mob/trackedRuntime + var/badThingCoeff = 0 + var/resetTime = 15 + var/cloneMode = FALSE + var/list/item_reactions = list() + var/list/valid_items = list() //valid items for special reactions like transforming + var/list/critical_items = list() //items that can cause critical reactions + +/obj/machinery/rnd/experimentor/proc/ConvertReqString2List(list/source_list) + var/list/temp_list = params2list(source_list) + for(var/O in temp_list) + temp_list[O] = text2num(temp_list[O]) + return temp_list + + +/obj/machinery/rnd/experimentor/proc/SetTypeReactions() + for(var/I in typesof(/obj/item)) + if(ispath(I, /obj/item/relic)) + item_reactions["[I]"] = SCANTYPE_DISCOVER + else + item_reactions["[I]"] = pick(SCANTYPE_POKE,SCANTYPE_IRRADIATE,SCANTYPE_GAS,SCANTYPE_HEAT,SCANTYPE_COLD,SCANTYPE_OBLITERATE) + + if(ispath(I, /obj/item/stock_parts) || ispath(I, /obj/item/grenade/chem_grenade) || ispath(I, /obj/item/kitchen)) + var/obj/item/tempCheck = I + if(initial(tempCheck.icon_state) != null) //check it's an actual usable item, in a hacky way + if(ispath(I, /obj/item/grenade/chem_grenade/tuberculosis)) + continue + valid_items["[I]"] += 15 + + if(ispath(I, /obj/item/reagent_containers/food)) + var/obj/item/tempCheck = I + if(initial(tempCheck.icon_state) != null) //check it's an actual usable item, in a hacky way + valid_items["[I]"] += rand(1,4) + + if(ispath(I, /obj/item/construction/rcd) || ispath(I, /obj/item/grenade) || ispath(I, /obj/item/aicard) || ispath(I, /obj/item/storage/backpack/holding) || ispath(I, /obj/item/slime_extract) || ispath(I, /obj/item/onetankbomb) || ispath(I, /obj/item/transfer_valve)) + var/obj/item/tempCheck = I + if(initial(tempCheck.icon_state) != null) + critical_items += I + +/obj/machinery/rnd/experimentor/Initialize() + . = ..() + + trackedIan = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list + trackedRuntime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list + SetTypeReactions() + +/obj/machinery/rnd/experimentor/RefreshParts() + for(var/obj/item/stock_parts/manipulator/M in component_parts) + if(resetTime > 0 && (resetTime - M.rating) >= 1) + resetTime -= M.rating + for(var/obj/item/stock_parts/scanning_module/M in component_parts) + badThingCoeff += M.rating*2 + for(var/obj/item/stock_parts/micro_laser/M in component_parts) + badThingCoeff += M.rating + +/obj/machinery/rnd/experimentor/proc/checkCircumstances(obj/item/O) + //snowflake check to only take "made" bombs + if(istype(O, /obj/item/transfer_valve)) + var/obj/item/transfer_valve/T = O + if(!T.tank_one || !T.tank_two || !T.attached_device) + return FALSE + return TRUE + +/obj/machinery/rnd/experimentor/Insert_Item(obj/item/O, mob/user) + if(user.a_intent != INTENT_HARM) + . = 1 + if(!is_insertion_ready(user)) + return + if(!user.transferItemToLoc(O, src)) + return + loaded_item = O + to_chat(user, "You add [O] to the machine.") + flick("h_lathe_load", src) + +/obj/machinery/rnd/experimentor/default_deconstruction_crowbar(obj/item/O) + ejectItem() + . = ..(O) + +/obj/machinery/rnd/experimentor/ui_interact(mob/user) + var/list/dat = list("
    ") + if(!linked_console) + dat += "Scan for R&D Console" + if(loaded_item) + dat += "Loaded Item: [loaded_item]" + + dat += "
    Available tests:" + dat += "Poke" + dat += "Irradiate" + dat += "Gas" + dat += "Burn" + dat += "Freeze" + dat += "Destroy
    " + if(istype(loaded_item,/obj/item/relic)) + dat += "Discover" + dat += "Eject" + var/list/listin = techweb_item_boost_check(src) + if(listin) + var/list/output = list("Research Boost Data:") + var/list/res = list("Already researched:") + var/list/boosted = list("Already boosted:") + for(var/node_id in listin) + var/datum/techweb_node/N = get_techweb_node_by_id(node_id) + var/str = "[N.display_name]: [listin[N]] points." + if(SSresearch.science_tech.researched_nodes[N]) + res += str + else if(SSresearch.science_tech.boosted_nodes[N]) + boosted += str + if(SSresearch.science_tech.visible_nodes[N]) //JOY OF DISCOVERY! + output += str + output += boosted + res + dat += output + else + dat += "Nothing loaded." + dat += "Refresh" + dat += "Close
    " + var/datum/browser/popup = new(user, "experimentor","Experimentor", 700, 400, src) + popup.set_content(dat.Join("
    ")) + popup.open() + onclose(user, "experimentor") + +/obj/machinery/rnd/experimentor/Topic(href, href_list) + if(..()) + return + usr.set_machine(src) + + var/scantype = href_list["function"] + var/obj/item/process = locate(href_list["item"]) in src + + if(href_list["close"]) + usr << browse(null, "window=experimentor") + return + if(scantype == "search") + var/obj/machinery/computer/rdconsole/D = locate(/obj/machinery/computer/rdconsole) in oview(3,src) + if(D) + linked_console = D + else if(scantype == "eject") + ejectItem() + else if(scantype == "refresh") + updateUsrDialog() + else + if(recentlyExperimented) + to_chat(usr, "[src] has been used too recently!") + else if(!loaded_item) + to_chat(usr, "[src] is not currently loaded!") + else if(!process || process != loaded_item) //Interface exploit protection (such as hrefs or swapping items with interface set to old item) + to_chat(usr, "Interface failure detected in [src]. Please try again.") + else + var/dotype + if(text2num(scantype) == SCANTYPE_DISCOVER) + dotype = SCANTYPE_DISCOVER + else + dotype = matchReaction(process,scantype) + experiment(dotype,process) + use_power(750) + if(dotype != FAIL) + var/list/datum/techweb_node/nodes = techweb_item_boost_check(process) + var/picked = pickweight(nodes) //This should work. + if(linked_console) + linked_console.stored_research.boost_with_path(picked, process.type) + updateUsrDialog() + +/obj/machinery/rnd/experimentor/proc/matchReaction(matching,reaction) + var/obj/item/D = matching + if(D) + if(item_reactions.Find("[D.type]")) + var/tor = item_reactions["[D.type]"] + if(tor == text2num(reaction)) + return tor + else + return FAIL + else + return FAIL + else + return FAIL + +/obj/machinery/rnd/experimentor/proc/ejectItem(delete=FALSE) + if(loaded_item) + if(cloneMode) + visible_message("A duplicate [loaded_item] pops out!") + var/type_to_make = loaded_item.type + new type_to_make(get_turf(pick(oview(1,src)))) + cloneMode = FALSE + return + var/turf/dropturf = get_turf(pick(view(1,src))) + if(!dropturf) //Failsafe to prevent the object being lost in the void forever. + dropturf = drop_location() + loaded_item.forceMove(dropturf) + if(delete) + qdel(loaded_item) + loaded_item = null + +/obj/machinery/rnd/experimentor/proc/throwSmoke(turf/where) + var/datum/effect_system/smoke_spread/smoke = new + smoke.set_up(0, where) + smoke.start() + + +/obj/machinery/rnd/experimentor/proc/experiment(exp,obj/item/exp_on) + recentlyExperimented = 1 + icon_state = "h_lathe_wloop" + var/chosenchem + var/criticalReaction = (exp_on.type in critical_items) ? TRUE : FALSE + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == SCANTYPE_POKE) + visible_message("[src] prods at [exp_on] with mechanical arms.") + if(prob(EFFECT_PROB_LOW) && criticalReaction) + visible_message("[exp_on] is gripped in just the right way, enhancing its focus.") + badThingCoeff++ + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + visible_message("[src] malfunctions and destroys [exp_on], lashing its arms out at nearby people!") + for(var/mob/living/m in oview(1, src)) + m.apply_damage(15, BRUTE, pick(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_PRECISE_GROIN)) + investigate_log("Experimentor dealt minor brute to [m].", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_LOW-badThingCoeff)) + visible_message("[src] malfunctions!") + exp = SCANTYPE_OBLITERATE + else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) + visible_message("[src] malfunctions, throwing the [exp_on]!") + var/mob/living/target = locate(/mob/living) in oview(7,src) + if(target) + var/obj/item/throwing = loaded_item + investigate_log("Experimentor has thrown [loaded_item] at [key_name(target)]", INVESTIGATE_EXPERIMENTOR) + ejectItem() + if(throwing) + throwing.throw_at(target, 10, 1) + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == SCANTYPE_IRRADIATE) + visible_message("[src] reflects radioactive rays at [exp_on]!") + if(prob(EFFECT_PROB_LOW) && criticalReaction) + visible_message("[exp_on] has activated an unknown subroutine!") + cloneMode = TRUE + investigate_log("Experimentor has made a clone of [exp_on]", INVESTIGATE_EXPERIMENTOR) + ejectItem() + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + visible_message("[src] malfunctions, melting [exp_on] and leaking radiation!") + radiation_pulse(src, 500) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_LOW-badThingCoeff)) + visible_message("[src] malfunctions, spewing toxic waste!") + for(var/turf/T in oview(1, src)) + if(!T.density) + if(prob(EFFECT_PROB_VERYHIGH) && !(locate(/obj/effect/decal/cleanable/greenglow) in T)) + var/obj/effect/decal/cleanable/reagentdecal = new/obj/effect/decal/cleanable/greenglow(T) + reagentdecal.reagents.add_reagent(/datum/reagent/radium, 7) + else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) + var/savedName = "[exp_on]" + ejectItem(TRUE) + var/newPath = text2path(pickweight(valid_items)) + loaded_item = new newPath(src) + visible_message("[src] malfunctions, transforming [savedName] into [loaded_item]!") + investigate_log("Experimentor has transformed [savedName] into [loaded_item]", INVESTIGATE_EXPERIMENTOR) + if(istype(loaded_item, /obj/item/grenade/chem_grenade)) + var/obj/item/grenade/chem_grenade/CG = loaded_item + CG.prime() + ejectItem() + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == SCANTYPE_GAS) + visible_message("[src] fills its chamber with gas, [exp_on] included.") + if(prob(EFFECT_PROB_LOW) && criticalReaction) + visible_message("[exp_on] achieves the perfect mix!") + new /obj/item/stack/sheet/mineral/plasma(get_turf(pick(oview(1,src)))) + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + visible_message("[src] destroys [exp_on], leaking dangerous gas!") + chosenchem = pick(/datum/reagent/carbon,/datum/reagent/radium,/datum/reagent/toxin, + /datum/reagent/consumable/condensedcapsaicin,/datum/reagent/drug/mushroomhallucinogen, + /datum/reagent/drug/space_drugs,/datum/reagent/consumable/ethanol,/datum/reagent/consumable/ethanol/beepsky_smash) + var/datum/reagents/R = new/datum/reagents(50) + R.my_atom = src + R.add_reagent(chosenchem , 50) + investigate_log("Experimentor has released [chosenchem] smoke.", INVESTIGATE_EXPERIMENTOR) + var/datum/effect_system/smoke_spread/chem/smoke = new + smoke.set_up(R, 0, src, silent = TRUE) + playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) + smoke.start() + qdel(R) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + visible_message("[src]'s chemical chamber has sprung a leak!") + chosenchem = pick(/datum/reagent/mutationtoxin,/datum/reagent/nanomachines,/datum/reagent/toxin/acid) + var/datum/reagents/R = new/datum/reagents(50) + R.my_atom = src + R.add_reagent(chosenchem , 50) + var/datum/effect_system/smoke_spread/chem/smoke = new + smoke.set_up(R, 0, src, silent = TRUE) + playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) + smoke.start() + qdel(R) + ejectItem(TRUE) + warn_admins(usr, "[chosenchem] smoke") + investigate_log("Experimentor has released [chosenchem] smoke!", INVESTIGATE_EXPERIMENTOR) + else if(prob(EFFECT_PROB_LOW-badThingCoeff)) + visible_message("[src] malfunctions, spewing harmless gas.") + throwSmoke(loc) + else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) + visible_message("[src] melts [exp_on], ionizing the air around it!") + empulse(loc, 4, 6) + investigate_log("Experimentor has generated an Electromagnetic Pulse.", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == SCANTYPE_HEAT) + visible_message("[src] raises [exp_on]'s temperature.") + if(prob(EFFECT_PROB_LOW) && criticalReaction) + visible_message("[src]'s emergency coolant system gives off a small ding!") + playsound(src, 'sound/machines/ding.ogg', 50, 1) + var/obj/item/reagent_containers/food/drinks/coffee/C = new /obj/item/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src)))) + chosenchem = pick(/datum/reagent/toxin/plasma,/datum/reagent/consumable/capsaicin,/datum/reagent/consumable/ethanol) + C.reagents.remove_any(25) + C.reagents.add_reagent(chosenchem , 50) + C.name = "Cup of Suspicious Liquid" + C.desc = "It has a large hazard symbol printed on the side in fading ink." + investigate_log("Experimentor has made a cup of [chosenchem] coffee.", INVESTIGATE_EXPERIMENTOR) + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + var/turf/start = get_turf(src) + var/mob/M = locate(/mob/living) in view(src, 3) + var/turf/MT = get_turf(M) + if(MT) + visible_message("[src] dangerously overheats, launching a flaming fuel orb!") + investigate_log("Experimentor has launched a fireball at [M]!", INVESTIGATE_EXPERIMENTOR) + var/obj/item/projectile/magic/aoe/fireball/FB = new /obj/item/projectile/magic/aoe/fireball(start) + FB.preparePixelProjectile(MT, start) + FB.fire() + else if(prob(EFFECT_PROB_LOW-badThingCoeff)) + visible_message("[src] malfunctions, melting [exp_on] and releasing a burst of flame!") + explosion(loc, -1, 0, 0, 0, 0, flame_range = 2) + investigate_log("Experimentor started a fire.", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) + visible_message("[src] malfunctions, melting [exp_on] and leaking hot air!") + var/datum/gas_mixture/env = loc.return_air() + var/transfer_moles = 0.25 * env.total_moles() + var/datum/gas_mixture/removed = env.remove(transfer_moles) + if(removed) + var/heat_capacity = removed.heat_capacity() + if(heat_capacity == 0 || heat_capacity == null) + heat_capacity = 1 + removed.temperature = min((removed.temperature*heat_capacity + 100000)/heat_capacity, 1000) + env.merge(removed) + air_update_turf() + investigate_log("Experimentor has released hot air.", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) + visible_message("[src] malfunctions, activating its emergency coolant systems!") + throwSmoke(loc) + for(var/mob/living/m in oview(1, src)) + m.apply_damage(5, BURN, pick(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_PRECISE_GROIN)) + investigate_log("Experimentor has dealt minor burn damage to [key_name(m)]", INVESTIGATE_EXPERIMENTOR) + ejectItem() + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == SCANTYPE_COLD) + visible_message("[src] lowers [exp_on]'s temperature.") + if(prob(EFFECT_PROB_LOW) && criticalReaction) + visible_message("[src]'s emergency coolant system gives off a small ding!") + var/obj/item/reagent_containers/food/drinks/coffee/C = new /obj/item/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src)))) + playsound(src, 'sound/machines/ding.ogg', 50, 1) //Ding! Your death coffee is ready! + chosenchem = pick(/datum/reagent/uranium,/datum/reagent/consumable/frostoil,/datum/reagent/medicine/ephedrine) + C.reagents.remove_any(25) + C.reagents.add_reagent(chosenchem , 50) + C.name = "Cup of Suspicious Liquid" + C.desc = "It has a large hazard symbol printed on the side in fading ink." + investigate_log("Experimentor has made a cup of [chosenchem] coffee.", INVESTIGATE_EXPERIMENTOR) + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + visible_message("[src] malfunctions, shattering [exp_on] and releasing a dangerous cloud of coolant!") + var/datum/reagents/R = new/datum/reagents(50) + R.my_atom = src + R.add_reagent(/datum/reagent/consumable/frostoil, 50) + investigate_log("Experimentor has released frostoil gas.", INVESTIGATE_EXPERIMENTOR) + var/datum/effect_system/smoke_spread/chem/smoke = new + smoke.set_up(R, 0, src, silent = TRUE) + playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) + smoke.start() + qdel(R) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_LOW-badThingCoeff)) + visible_message("[src] malfunctions, shattering [exp_on] and leaking cold air!") + var/datum/gas_mixture/env = loc.return_air() + var/transfer_moles = 0.25 * env.total_moles() + var/datum/gas_mixture/removed = env.remove(transfer_moles) + if(removed) + var/heat_capacity = removed.heat_capacity() + if(heat_capacity == 0 || heat_capacity == null) + heat_capacity = 1 + removed.temperature = (removed.temperature*heat_capacity - 75000)/heat_capacity + env.merge(removed) + air_update_turf() + investigate_log("Experimentor has released cold air.", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff)) + visible_message("[src] malfunctions, releasing a flurry of chilly air as [exp_on] pops out!") + var/datum/effect_system/smoke_spread/smoke = new + smoke.set_up(0, loc) + smoke.start() + ejectItem() + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == SCANTYPE_OBLITERATE) + visible_message("[exp_on] activates the crushing mechanism, [exp_on] is destroyed!") + if(linked_console.linked_lathe) + var/datum/component/material_container/linked_materials = linked_console.linked_lathe.GetComponent(/datum/component/material_container) + for(var/material in exp_on.materials) + linked_materials.insert_amount( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.materials[material])), material) + if(prob(EFFECT_PROB_LOW) && criticalReaction) + visible_message("[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!") + new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src)))) + else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) + visible_message("[src]'s crusher goes way too many levels too high, crushing right through space-time!") + playsound(src, 'sound/effects/supermatter.ogg', 50, 1, -3) + investigate_log("Experimentor has triggered the 'throw things' reaction.", INVESTIGATE_EXPERIMENTOR) + for(var/atom/movable/AM in oview(7,src)) + if(!AM.anchored) + AM.throw_at(src,10,1) + else if(prob(EFFECT_PROB_LOW-badThingCoeff)) + visible_message("[src]'s crusher goes one level too high, crushing right into space-time!") + playsound(src, 'sound/effects/supermatter.ogg', 50, 1, -3) + investigate_log("Experimentor has triggered the 'minor throw things' reaction.", INVESTIGATE_EXPERIMENTOR) + var/list/throwAt = list() + for(var/atom/movable/AM in oview(7,src)) + if(!AM.anchored) + throwAt.Add(AM) + for(var/counter = 1, counter < throwAt.len, ++counter) + var/atom/movable/cast = throwAt[counter] + cast.throw_at(pick(throwAt),10,1) + ejectItem(TRUE) + //////////////////////////////////////////////////////////////////////////////////////////////// + if(exp == FAIL) + var/a = pick("rumbles","shakes","vibrates","shudders") + var/b = pick("crushes","spins","viscerates","smashes","insults") + visible_message("[exp_on] [a], and [b], the experiment was a failure.") + + if(exp == SCANTYPE_DISCOVER) + visible_message("[src] scans the [exp_on], revealing its true nature!") + playsound(src, 'sound/effects/supermatter.ogg', 50, 3, -1) + var/obj/item/relic/R = loaded_item + R.reveal() + investigate_log("Experimentor has revealed a relic with [R.realProc] effect.", INVESTIGATE_EXPERIMENTOR) + ejectItem() + + //Global reactions + if(prob(EFFECT_PROB_VERYLOW-badThingCoeff) && loaded_item) + var/globalMalf = rand(1,100) + if(globalMalf < 15) + visible_message("[src]'s onboard detection system has malfunctioned!") + item_reactions["[exp_on.type]"] = pick(SCANTYPE_POKE,SCANTYPE_IRRADIATE,SCANTYPE_GAS,SCANTYPE_HEAT,SCANTYPE_COLD,SCANTYPE_OBLITERATE) + ejectItem() + if(globalMalf > 16 && globalMalf < 35) + visible_message("[src] melts [exp_on], ian-izing the air around it!") + throwSmoke(loc) + if(trackedIan) + throwSmoke(trackedIan.loc) + trackedIan.forceMove(loc) + investigate_log("Experimentor has stolen Ian!", INVESTIGATE_EXPERIMENTOR) //...if anyone ever fixes it... + else + new /mob/living/simple_animal/pet/dog/corgi(loc) + investigate_log("Experimentor has spawned a new corgi.", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + if(globalMalf > 36 && globalMalf < 50) + visible_message("Experimentor draws the life essence of those nearby!") + for(var/mob/living/m in view(4,src)) + to_chat(m, "You feel your flesh being torn from you, mists of blood drifting to [src]!") + m.apply_damage(50, BRUTE, BODY_ZONE_CHEST) + investigate_log("Experimentor has taken 50 brute a blood sacrifice from [m]", INVESTIGATE_EXPERIMENTOR) + if(globalMalf > 51 && globalMalf < 75) + visible_message("[src] encounters a run-time error!") + throwSmoke(loc) + if(trackedRuntime) + throwSmoke(trackedRuntime.loc) + trackedRuntime.forceMove(drop_location()) + investigate_log("Experimentor has stolen Runtime!", INVESTIGATE_EXPERIMENTOR) + else + new /mob/living/simple_animal/pet/cat(loc) + investigate_log("Experimentor failed to steal runtime, and instead spawned a new cat.", INVESTIGATE_EXPERIMENTOR) + ejectItem(TRUE) + if(globalMalf > 76) + visible_message("[src] begins to smoke and hiss, shaking violently!") + use_power(500000) + investigate_log("Experimentor has drained power from its APC", INVESTIGATE_EXPERIMENTOR) + + addtimer(CALLBACK(src, .proc/reset_exp), resetTime) + +/obj/machinery/rnd/experimentor/proc/reset_exp() + update_icon() + recentlyExperimented = FALSE + +/obj/machinery/rnd/experimentor/update_icon() + icon_state = "h_lathe" + +/obj/machinery/rnd/experimentor/proc/warn_admins(user, ReactionName) + var/turf/T = get_turf(user) + message_admins("Experimentor reaction: [ReactionName] generated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(T)]") + log_game("Experimentor reaction: [ReactionName] generated by [key_name(user)] in [AREACOORD(T)]") + +#undef SCANTYPE_POKE +#undef SCANTYPE_IRRADIATE +#undef SCANTYPE_GAS +#undef SCANTYPE_HEAT +#undef SCANTYPE_COLD +#undef SCANTYPE_OBLITERATE +#undef SCANTYPE_DISCOVER + +#undef EFFECT_PROB_VERYLOW +#undef EFFECT_PROB_LOW +#undef EFFECT_PROB_MEDIUM +#undef EFFECT_PROB_HIGH +#undef EFFECT_PROB_VERYHIGH + +#undef FAIL + + +//////////////////////////////////SPECIAL ITEMS//////////////////////////////////////// + +/obj/item/relic + name = "strange object" + desc = "What mysteries could this hold?" + icon = 'icons/obj/assemblies.dmi' + var/realName = "defined object" + var/revealed = FALSE + var/realProc + var/cooldownMax = 60 + var/cooldown + +/obj/item/relic/Initialize() + . = ..() + icon_state = pick("shock_kit","armor-igniter-analyzer","infra-igniter0","infra-igniter1","radio-multitool","prox-radio1","radio-radio","timer-multitool0","radio-igniter-tank") + realName = "[pick("broken","twisted","spun","improved","silly","regular","badly made")] [pick("device","object","toy","illegal tech","weapon")]" + + +/obj/item/relic/proc/reveal() + if(revealed) //Re-rolling your relics seems a bit overpowered, yes? + return + revealed = TRUE + name = realName + cooldownMax = rand(60,300) + realProc = pick("teleport","explode","rapidDupe","petSpray","flash","clean","corgicannon") + +/obj/item/relic/attack_self(mob/user) + if(revealed) + if(cooldown) + to_chat(user, "[src] does not react!") + return + else if(loc == user) + cooldown = TRUE + call(src,realProc)(user) + addtimer(CALLBACK(src, .proc/cd), cooldownMax) + else + to_chat(user, "You aren't quite sure what to do with this yet.") + +/obj/item/relic/proc/cd() + cooldown = FALSE + +//////////////// RELIC PROCS ///////////////////////////// + +/obj/item/relic/proc/throwSmoke(turf/where) + var/datum/effect_system/smoke_spread/smoke = new + smoke.set_up(0, get_turf(where)) + smoke.start() + +/obj/item/relic/proc/corgicannon(mob/user) + playsound(src, "sparks", rand(25,50), 1) + var/mob/living/simple_animal/pet/dog/corgi/C = new/mob/living/simple_animal/pet/dog/corgi(get_turf(user)) + C.throw_at(pick(oview(10,user)), 10, rand(3,8), callback = CALLBACK(src, .proc/throwSmoke, C)) + warn_admins(user, "Corgi Cannon", 0) + +/obj/item/relic/proc/clean(mob/user) + playsound(src, "sparks", rand(25,50), 1) + var/obj/item/grenade/chem_grenade/cleaner/CL = new/obj/item/grenade/chem_grenade/cleaner(get_turf(user)) + CL.prime() + warn_admins(user, "Smoke", 0) + +/obj/item/relic/proc/flash(mob/user) + playsound(src, "sparks", rand(25,50), 1) + var/obj/item/grenade/flashbang/CB = new/obj/item/grenade/flashbang(user.loc) + CB.prime() + warn_admins(user, "Flash") + +/obj/item/relic/proc/petSpray(mob/user) + var/message = "[src] begins to shake, and in the distance the sound of rampaging animals arises!" + visible_message(message) + to_chat(user, message) + var/animals = rand(1,25) + var/counter + var/list/valid_animals = list(/mob/living/simple_animal/parrot, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/pet/cat, /mob/living/simple_animal/pet/dog/corgi, /mob/living/simple_animal/crab, /mob/living/simple_animal/pet/fox, /mob/living/simple_animal/hostile/lizard, /mob/living/simple_animal/mouse, /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/poison/bees, /mob/living/simple_animal/hostile/carp) + for(counter = 1; counter < animals; counter++) + var/mobType = pick(valid_animals) + new mobType(get_turf(src)) + warn_admins(user, "Mass Mob Spawn") + if(prob(60)) + to_chat(user, "[src] falls apart!") + qdel(src) + +/obj/item/relic/proc/rapidDupe(mob/user) + audible_message("[src] emits a loud pop!") + var/list/dupes = list() + var/counter + var/max = rand(5,10) + for(counter = 1; counter < max; counter++) + var/obj/item/relic/R = new type(get_turf(src)) + R.name = name + R.desc = desc + R.realName = realName + R.realProc = realProc + R.revealed = TRUE + dupes |= R + R.throw_at(pick(oview(7,get_turf(src))),10,1) + counter = 0 + QDEL_LIST_IN(dupes, rand(10, 100)) + warn_admins(user, "Rapid duplicator", 0) + +/obj/item/relic/proc/explode(mob/user) + to_chat(user, "[src] begins to heat up!") + addtimer(CALLBACK(src, .proc/do_explode, user), rand(35, 100)) + +/obj/item/relic/proc/do_explode(mob/user) + if(loc == user) + visible_message("\The [src]'s top opens, releasing a powerful blast!") + explosion(user.loc, 0, rand(1,5), rand(1,5), rand(1,5), rand(1,5), flame_range = 2) + warn_admins(user, "Explosion") + qdel(src) //Comment this line to produce a light grenade (the bomb that keeps on exploding when used)!! + +/obj/item/relic/proc/teleport(mob/user) + to_chat(user, "[src] begins to vibrate!") + addtimer(CALLBACK(src, .proc/do_the_teleport, user), rand(10, 30)) + +/obj/item/relic/proc/do_the_teleport(mob/user) + var/turf/userturf = get_turf(user) + if(loc == user && !is_centcom_level(userturf.z)) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you! + visible_message("[src] twists and bends, relocating itself!") + throwSmoke(userturf) + do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) + throwSmoke(get_turf(user)) + warn_admins(user, "Teleport", 0) + +//Admin Warning proc for relics +/obj/item/relic/proc/warn_admins(mob/user, RelicType, priority = 1) + var/turf/T = get_turf(src) + var/log_msg = "[RelicType] relic used by [key_name(user)] in [AREACOORD(T)]" + if(priority) //For truly dangerous relics that may need an admin's attention. BWOINK! + message_admins("[RelicType] relic activated by [ADMIN_LOOKUPFLW(user)] in [ADMIN_VERBOSEJMP(T)]") + log_game(log_msg) + investigate_log(log_msg, "experimentor") diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index 6d82a844..11846e16 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -1,364 +1,364 @@ -/obj/machinery/rnd/production - name = "technology fabricator" - desc = "Makes researched and prototype items with materials and energy." - layer = BELOW_OBJ_LAYER - var/consoleless_interface = FALSE //Whether it can be used without a console. - var/efficiency_coeff = 1 //Materials needed / coeff = actual. - var/list/categories = list() - var/datum/component/remote_materials/materials - var/allowed_department_flags = ALL - var/production_animation //What's flick()'d on print. - var/allowed_buildtypes = NONE - var/list/datum/design/cached_designs - var/list/datum/design/matching_designs - var/department_tag = "Unidentified" //used for material distribution among other things. - var/datum/techweb/stored_research - var/datum/techweb/host_research - - var/screen = RESEARCH_FABRICATOR_SCREEN_MAIN - var/selected_category - -/obj/machinery/rnd/production/Initialize(mapload) - . = ..() - create_reagents(0, OPENCONTAINER) - matching_designs = list() - cached_designs = list() - stored_research = new - host_research = SSresearch.science_tech - update_research() - materials = AddComponent(/datum/component/remote_materials, "lathe", mapload) - RefreshParts() - -/obj/machinery/rnd/production/proc/update_research() - host_research.copy_research_to(stored_research, TRUE) - update_designs() - -/obj/machinery/rnd/production/proc/update_designs() - cached_designs.Cut() - for(var/i in stored_research.researched_designs) - var/datum/design/d = stored_research.researched_designs[i] - if((isnull(allowed_department_flags) || (d.departmental_flags & allowed_department_flags)) && (d.build_type & allowed_buildtypes)) - cached_designs |= d - -/obj/machinery/rnd/production/RefreshParts() - calculate_efficiency() - -/obj/machinery/rnd/production/ui_interact(mob/user) - if(!consoleless_interface) - return ..() - user.set_machine(src) - var/datum/browser/popup = new(user, "rndconsole", name, 460, 550) - popup.set_content(generate_ui()) - popup.open() - -/obj/machinery/rnd/production/Destroy() - QDEL_NULL(stored_research) - return ..() - -/obj/machinery/rnd/production/proc/calculate_efficiency() - efficiency_coeff = 1 - if(reagents) //If reagents/materials aren't initialized, don't bother, we'll be doing this again after reagents init anyways. - reagents.maximum_volume = 0 - for(var/obj/item/reagent_containers/glass/G in component_parts) - reagents.maximum_volume += G.volume - G.reagents.trans_to(src, G.reagents.total_volume) - if(materials) - var/total_storage = 0 - for(var/obj/item/stock_parts/matter_bin/M in component_parts) - total_storage += M.rating * 75000 - materials.set_local_size(total_storage) - var/total_rating = 0 - for(var/obj/item/stock_parts/manipulator/M in component_parts) - total_rating += M.rating - total_rating = max(1, total_rating) - efficiency_coeff = total_rating - -//we eject the materials upon deconstruction. -/obj/machinery/rnd/production/on_deconstruction() - for(var/obj/item/reagent_containers/glass/G in component_parts) - reagents.trans_to(G, G.reagents.maximum_volume) - return ..() - -/obj/machinery/rnd/production/proc/do_print(path, amount, list/matlist, notify_admins, mob/user) - if(notify_admins) - investigate_log("[key_name(user)] built [amount] of [path] at [src]([type]).", INVESTIGATE_RESEARCH) - message_admins("[ADMIN_LOOKUPFLW(user)] has built [amount] of [path] at a [src]([type]).") - for(var/i in 1 to amount) - var/obj/item/I = new path(get_turf(src)) - if(efficient_with(I.type)) - I.materials = matlist.Copy() - SSblackbox.record_feedback("nested tally", "item_printed", amount, list("[type]", "[path]")) - -/obj/machinery/rnd/production/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material - if (!materials.mat_container) // no connected silo - return 0 - var/list/all_materials = being_built.reagents_list + being_built.materials - - var/A = materials.mat_container.amount(M) - if(!A) - A = reagents.get_reagent_amount(M) - - // these types don't have their .materials set in do_print, so don't allow - // them to be constructed efficiently - var/ef = efficient_with(being_built.build_path) ? efficiency_coeff : 1 - return round(A / max(1, all_materials[M] / ef)) - -/obj/machinery/rnd/production/proc/efficient_with(path) - return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal) - -/obj/machinery/rnd/production/proc/user_try_print_id(id, amount) - if((!istype(linked_console) && requires_console) || !id) - return FALSE - if(istext(amount)) - amount = text2num(amount) - if(isnull(amount)) - amount = 1 - var/datum/design/D = (linked_console || requires_console)? linked_console.stored_research.researched_designs[id] : get_techweb_design_by_id(id) - if(!istype(D)) - return FALSE - if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags))) - say("Warning: Printing failed: This fabricator does not have the necessary keys to decrypt design schematics. Please update the research data with the on-screen button and contact Nanotrasen Support!") - return FALSE - if(D.build_type && !(D.build_type & allowed_buildtypes)) - say("This machine does not have the necessary manipulation systems for this design. Please contact Nanotrasen Support!") - return FALSE - if(!materials.mat_container) - say("No connection to material storage, please contact the quartermaster.") - return FALSE - if(materials.on_hold()) - say("Mineral access is on hold, please contact the quartermaster.") - return FALSE - var/power = 1000 - amount = CLAMP(amount, 1, 50) - for(var/M in D.materials) - power += round(D.materials[M] * amount / 35) - power = min(3000, power) - use_power(power) - var/coeff = efficient_with(D.build_path) ? efficiency_coeff : 1 - var/list/efficient_mats = list() - for(var/MAT in D.materials) - efficient_mats[MAT] = D.materials[MAT]/coeff - if(!materials.mat_container.has_materials(efficient_mats, amount)) - say("Not enough materials to complete prototype[amount > 1? "s" : ""].") - return FALSE - for(var/R in D.reagents_list) - if(!reagents.has_reagent(R, D.reagents_list[R]*amount/coeff)) - say("Not enough reagents to complete prototype[amount > 1? "s" : ""].") - return FALSE - materials.mat_container.use_amount(efficient_mats, amount) - materials.silo_log(src, "built", -amount, "[D.name]", efficient_mats) - for(var/R in D.reagents_list) - reagents.remove_reagent(R, D.reagents_list[R]*amount/coeff) - busy = TRUE - if(production_animation) - flick(production_animation, src) - var/timecoeff = D.lathe_time_factor / efficiency_coeff - addtimer(CALLBACK(src, .proc/reset_busy), (30 * timecoeff * amount) ** 0.5) - addtimer(CALLBACK(src, .proc/do_print, D.build_path, amount, efficient_mats, D.dangerous_construction, usr), (32 * timecoeff * amount) ** 0.8) - return TRUE - -/obj/machinery/rnd/production/proc/search(string) - matching_designs.Cut() - for(var/v in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[v] - if(!(D.build_type & allowed_buildtypes) || !(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags))) - continue - if(findtext(D.name,string)) - matching_designs.Add(D) - -/obj/machinery/rnd/production/proc/generate_ui() - var/list/ui = list() - ui += ui_header() - switch(screen) - if(RESEARCH_FABRICATOR_SCREEN_MATERIALS) - ui += ui_screen_materials() - if(RESEARCH_FABRICATOR_SCREEN_CHEMICALS) - ui += ui_screen_chemicals() - if(RESEARCH_FABRICATOR_SCREEN_SEARCH) - ui += ui_screen_search() - if(RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW) - ui += ui_screen_category_view() - else - ui += ui_screen_main() - for(var/i in 1 to length(ui)) - if(!findtextEx(ui[i], RDSCREEN_NOBREAK)) - ui[i] += "
    " - ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "") - return ui.Join("") - -/obj/machinery/rnd/production/proc/ui_header() - var/list/l = list() - l += "
    [host_research.organization] [department_tag] Department Lathe" - l += "Security protocols: [(obj_flags & EMAGGED)? "Disabled" : "Enabled"]" - if (materials.mat_container) - l += "Material Amount: [materials.format_amount()]" - else - l += "No material storage connected, please contact the quartermaster." - l += "Chemical volume: [reagents.total_volume] / [reagents.maximum_volume]" - l += "Synchronize Research" - l += "Main Screen
    [RDSCREEN_NOBREAK]" - return l - -/obj/machinery/rnd/production/proc/ui_screen_materials() - if (!materials.mat_container) - screen = RESEARCH_FABRICATOR_SCREEN_MAIN - return ui_screen_main() - var/list/l = list() - l += "

    Material Storage:

    " - for(var/mat_id in materials.mat_container.materials) - var/datum/material/M = materials.mat_container.materials[mat_id] - l += "* [M.amount] of [M.name]: " - if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "Eject [RDSCREEN_NOBREAK]" - if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" - if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]" - l += "" - l += "
    [RDSCREEN_NOBREAK]" - return l - -/obj/machinery/rnd/production/proc/ui_screen_chemicals() - var/list/l = list() - l += "
    Disposal All Chemicals in Storage" - l += "

    Chemical Storage:

    " - for(var/datum/reagent/R in reagents.reagent_list) - l += "[R.name]: [R.volume]" - l += "Purge" - l += "
    " - return l - -/obj/machinery/rnd/production/proc/ui_screen_search() - var/list/l = list() - var/coeff = efficiency_coeff - l += "

    Search Results:

    " - l += "
    \ - \ - \ - \ - \ -

    " - for(var/datum/design/D in matching_designs) - l += design_menu_entry(D, coeff) - l += "
    " - return l - -/obj/machinery/rnd/production/proc/design_menu_entry(datum/design/D, coeff) - if(!istype(D)) - return - if(!coeff) - coeff = efficiency_coeff - if(!efficient_with(D.build_path)) - coeff = 1 - var/list/l = list() - var/temp_material - var/c = 50 - var/t - var/all_materials = D.materials + D.reagents_list - for(var/M in all_materials) - t = check_mat(D, M) - temp_material += " | " - if (t < 1) - temp_material += "[all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" - c = min(c,t) - - if (c >= 1) - l += "[D.name][RDSCREEN_NOBREAK]" - if(c >= 5) - l += "x5[RDSCREEN_NOBREAK]" - if(c >= 10) - l += "x10[RDSCREEN_NOBREAK]" - l += "[temp_material][RDSCREEN_NOBREAK]" - else - l += "[D.name][temp_material][RDSCREEN_NOBREAK]" - l += "" - return l - -/obj/machinery/rnd/production/Topic(raw, ls) - if(..()) - return - add_fingerprint(usr) - usr.set_machine(src) - if(ls["switch_screen"]) - screen = text2num(ls["switch_screen"]) - if(ls["build"]) //Causes the Protolathe to build something. - if(busy) - say("Warning: Fabricators busy!") - else - user_try_print_id(ls["build"], ls["amount"]) - if(ls["search"]) //Search for designs with name matching pattern - search(ls["to_search"]) - screen = RESEARCH_FABRICATOR_SCREEN_SEARCH - if(ls["sync_research"]) - update_research() - say("Synchronizing research with host technology database.") - if(ls["category"]) - selected_category = ls["category"] - if(ls["dispose"]) //Causes the protolathe to dispose of a single reagent (all of it) - reagents.del_reagent(ls["dispose"]) - if(ls["disposeall"]) //Causes the protolathe to dispose of all it's reagents. - reagents.clear_reagents() - if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material - eject_sheets(ls["ejectsheet"], ls["eject_amt"]) - updateUsrDialog() - -/obj/machinery/rnd/production/proc/eject_sheets(eject_sheet, eject_amt) - var/datum/component/material_container/mat_container = materials.mat_container - if (!mat_container) - say("No access to material storage, please contact the quartermaster.") - return 0 - if (materials.on_hold()) - say("Mineral access is on hold, please contact the quartermaster.") - return 0 - var/count = mat_container.retrieve_sheets(text2num(eject_amt), eject_sheet, drop_location()) - var/list/matlist = list() - matlist[eject_sheet] = MINERAL_MATERIAL_AMOUNT - materials.silo_log(src, "ejected", -count, "sheets", matlist) - return count - -/obj/machinery/rnd/production/proc/ui_screen_main() - var/list/l = list() - l += "
    \ - \ - \ - \ - \ - \ -

    " - - l += list_categories(categories, RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW) - - return l - -/obj/machinery/rnd/production/proc/ui_screen_category_view() - if(!selected_category) - return ui_screen_main() - var/list/l = list() - l += "

    Browsing [selected_category]:

    " - var/coeff = efficiency_coeff - for(var/v in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[v] - if(!(selected_category in D.category)|| !(D.build_type & allowed_buildtypes)) - continue - if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags))) - continue - l += design_menu_entry(D, coeff) - l += "
    " - return l - -/obj/machinery/rnd/production/proc/list_categories(list/categories, menu_num) - if(!categories) - return - - var/line_length = 1 - var/list/l = "" - - for(var/C in categories) - if(line_length > 2) - l += "" - line_length = 1 - - l += "" - line_length++ - - l += "
    [C]
    " - return l +/obj/machinery/rnd/production + name = "technology fabricator" + desc = "Makes researched and prototype items with materials and energy." + layer = BELOW_OBJ_LAYER + var/consoleless_interface = FALSE //Whether it can be used without a console. + var/efficiency_coeff = 1 //Materials needed / coeff = actual. + var/list/categories = list() + var/datum/component/remote_materials/materials + var/allowed_department_flags = ALL + var/production_animation //What's flick()'d on print. + var/allowed_buildtypes = NONE + var/list/datum/design/cached_designs + var/list/datum/design/matching_designs + var/department_tag = "Unidentified" //used for material distribution among other things. + var/datum/techweb/stored_research + var/datum/techweb/host_research + + var/screen = RESEARCH_FABRICATOR_SCREEN_MAIN + var/selected_category + +/obj/machinery/rnd/production/Initialize(mapload) + . = ..() + create_reagents(0, OPENCONTAINER) + matching_designs = list() + cached_designs = list() + stored_research = new + host_research = SSresearch.science_tech + update_research() + materials = AddComponent(/datum/component/remote_materials, "lathe", mapload) + RefreshParts() + +/obj/machinery/rnd/production/proc/update_research() + host_research.copy_research_to(stored_research, TRUE) + update_designs() + +/obj/machinery/rnd/production/proc/update_designs() + cached_designs.Cut() + for(var/i in stored_research.researched_designs) + var/datum/design/d = stored_research.researched_designs[i] + if((isnull(allowed_department_flags) || (d.departmental_flags & allowed_department_flags)) && (d.build_type & allowed_buildtypes)) + cached_designs |= d + +/obj/machinery/rnd/production/RefreshParts() + calculate_efficiency() + +/obj/machinery/rnd/production/ui_interact(mob/user) + if(!consoleless_interface) + return ..() + user.set_machine(src) + var/datum/browser/popup = new(user, "rndconsole", name, 460, 550) + popup.set_content(generate_ui()) + popup.open() + +/obj/machinery/rnd/production/Destroy() + QDEL_NULL(stored_research) + return ..() + +/obj/machinery/rnd/production/proc/calculate_efficiency() + efficiency_coeff = 1 + if(reagents) //If reagents/materials aren't initialized, don't bother, we'll be doing this again after reagents init anyways. + reagents.maximum_volume = 0 + for(var/obj/item/reagent_containers/glass/G in component_parts) + reagents.maximum_volume += G.volume + G.reagents.trans_to(src, G.reagents.total_volume) + if(materials) + var/total_storage = 0 + for(var/obj/item/stock_parts/matter_bin/M in component_parts) + total_storage += M.rating * 75000 + materials.set_local_size(total_storage) + var/total_rating = 0 + for(var/obj/item/stock_parts/manipulator/M in component_parts) + total_rating += M.rating + total_rating = max(1, total_rating) + efficiency_coeff = total_rating + +//we eject the materials upon deconstruction. +/obj/machinery/rnd/production/on_deconstruction() + for(var/obj/item/reagent_containers/glass/G in component_parts) + reagents.trans_to(G, G.reagents.maximum_volume) + return ..() + +/obj/machinery/rnd/production/proc/do_print(path, amount, list/matlist, notify_admins, mob/user) + if(notify_admins) + investigate_log("[key_name(user)] built [amount] of [path] at [src]([type]).", INVESTIGATE_RESEARCH) + message_admins("[ADMIN_LOOKUPFLW(user)] has built [amount] of [path] at a [src]([type]).") + for(var/i in 1 to amount) + var/obj/item/I = new path(get_turf(src)) + if(efficient_with(I.type)) + I.materials = matlist.Copy() + SSblackbox.record_feedback("nested tally", "item_printed", amount, list("[type]", "[path]")) + +/obj/machinery/rnd/production/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material + if (!materials.mat_container) // no connected silo + return 0 + var/list/all_materials = being_built.reagents_list + being_built.materials + + var/A = materials.mat_container.amount(M) + if(!A) + A = reagents.get_reagent_amount(M) + + // these types don't have their .materials set in do_print, so don't allow + // them to be constructed efficiently + var/ef = efficient_with(being_built.build_path) ? efficiency_coeff : 1 + return round(A / max(1, all_materials[M] / ef)) + +/obj/machinery/rnd/production/proc/efficient_with(path) + return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal) + +/obj/machinery/rnd/production/proc/user_try_print_id(id, amount) + if((!istype(linked_console) && requires_console) || !id) + return FALSE + if(istext(amount)) + amount = text2num(amount) + if(isnull(amount)) + amount = 1 + var/datum/design/D = (linked_console || requires_console)? linked_console.stored_research.researched_designs[id] : get_techweb_design_by_id(id) + if(!istype(D)) + return FALSE + if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags))) + say("Warning: Printing failed: This fabricator does not have the necessary keys to decrypt design schematics. Please update the research data with the on-screen button and contact Nanotrasen Support!") + return FALSE + if(D.build_type && !(D.build_type & allowed_buildtypes)) + say("This machine does not have the necessary manipulation systems for this design. Please contact Nanotrasen Support!") + return FALSE + if(!materials.mat_container) + say("No connection to material storage, please contact the quartermaster.") + return FALSE + if(materials.on_hold()) + say("Mineral access is on hold, please contact the quartermaster.") + return FALSE + var/power = 1000 + amount = CLAMP(amount, 1, 50) + for(var/M in D.materials) + power += round(D.materials[M] * amount / 35) + power = min(3000, power) + use_power(power) + var/coeff = efficient_with(D.build_path) ? efficiency_coeff : 1 + var/list/efficient_mats = list() + for(var/MAT in D.materials) + efficient_mats[MAT] = D.materials[MAT]/coeff + if(!materials.mat_container.has_materials(efficient_mats, amount)) + say("Not enough materials to complete prototype[amount > 1? "s" : ""].") + return FALSE + for(var/R in D.reagents_list) + if(!reagents.has_reagent(R, D.reagents_list[R]*amount/coeff)) + say("Not enough reagents to complete prototype[amount > 1? "s" : ""].") + return FALSE + materials.mat_container.use_amount(efficient_mats, amount) + materials.silo_log(src, "built", -amount, "[D.name]", efficient_mats) + for(var/R in D.reagents_list) + reagents.remove_reagent(R, D.reagents_list[R]*amount/coeff) + busy = TRUE + if(production_animation) + flick(production_animation, src) + var/timecoeff = D.lathe_time_factor / efficiency_coeff + addtimer(CALLBACK(src, .proc/reset_busy), (30 * timecoeff * amount) ** 0.5) + addtimer(CALLBACK(src, .proc/do_print, D.build_path, amount, efficient_mats, D.dangerous_construction, usr), (32 * timecoeff * amount) ** 0.8) + return TRUE + +/obj/machinery/rnd/production/proc/search(string) + matching_designs.Cut() + for(var/v in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[v] + if(!(D.build_type & allowed_buildtypes) || !(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags))) + continue + if(findtext(D.name,string)) + matching_designs.Add(D) + +/obj/machinery/rnd/production/proc/generate_ui() + var/list/ui = list() + ui += ui_header() + switch(screen) + if(RESEARCH_FABRICATOR_SCREEN_MATERIALS) + ui += ui_screen_materials() + if(RESEARCH_FABRICATOR_SCREEN_CHEMICALS) + ui += ui_screen_chemicals() + if(RESEARCH_FABRICATOR_SCREEN_SEARCH) + ui += ui_screen_search() + if(RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW) + ui += ui_screen_category_view() + else + ui += ui_screen_main() + for(var/i in 1 to length(ui)) + if(!findtextEx(ui[i], RDSCREEN_NOBREAK)) + ui[i] += "
    " + ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "") + return ui.Join("") + +/obj/machinery/rnd/production/proc/ui_header() + var/list/l = list() + l += "
    [host_research.organization] [department_tag] Department Lathe" + l += "Security protocols: [(obj_flags & EMAGGED)? "Disabled" : "Enabled"]" + if (materials.mat_container) + l += "Material Amount: [materials.format_amount()]" + else + l += "No material storage connected, please contact the quartermaster." + l += "Chemical volume: [reagents.total_volume] / [reagents.maximum_volume]" + l += "Synchronize Research" + l += "Main Screen
    [RDSCREEN_NOBREAK]" + return l + +/obj/machinery/rnd/production/proc/ui_screen_materials() + if (!materials.mat_container) + screen = RESEARCH_FABRICATOR_SCREEN_MAIN + return ui_screen_main() + var/list/l = list() + l += "

    Material Storage:

    " + for(var/mat_id in materials.mat_container.materials) + var/datum/material/M = materials.mat_container.materials[mat_id] + l += "* [M.amount] of [M.name]: " + if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "Eject [RDSCREEN_NOBREAK]" + if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" + if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]" + l += "" + l += "
    [RDSCREEN_NOBREAK]" + return l + +/obj/machinery/rnd/production/proc/ui_screen_chemicals() + var/list/l = list() + l += "
    Disposal All Chemicals in Storage" + l += "

    Chemical Storage:

    " + for(var/datum/reagent/R in reagents.reagent_list) + l += "[R.name]: [R.volume]" + l += "Purge" + l += "
    " + return l + +/obj/machinery/rnd/production/proc/ui_screen_search() + var/list/l = list() + var/coeff = efficiency_coeff + l += "

    Search Results:

    " + l += "
    \ + \ + \ + \ + \ +

    " + for(var/datum/design/D in matching_designs) + l += design_menu_entry(D, coeff) + l += "" + return l + +/obj/machinery/rnd/production/proc/design_menu_entry(datum/design/D, coeff) + if(!istype(D)) + return + if(!coeff) + coeff = efficiency_coeff + if(!efficient_with(D.build_path)) + coeff = 1 + var/list/l = list() + var/temp_material + var/c = 50 + var/t + var/all_materials = D.materials + D.reagents_list + for(var/M in all_materials) + t = check_mat(D, M) + temp_material += " | " + if (t < 1) + temp_material += "[all_materials[M]/coeff] [CallMaterialName(M)]" + else + temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" + c = min(c,t) + + if (c >= 1) + l += "[D.name][RDSCREEN_NOBREAK]" + if(c >= 5) + l += "x5[RDSCREEN_NOBREAK]" + if(c >= 10) + l += "x10[RDSCREEN_NOBREAK]" + l += "[temp_material][RDSCREEN_NOBREAK]" + else + l += "[D.name][temp_material][RDSCREEN_NOBREAK]" + l += "" + return l + +/obj/machinery/rnd/production/Topic(raw, ls) + if(..()) + return + add_fingerprint(usr) + usr.set_machine(src) + if(ls["switch_screen"]) + screen = text2num(ls["switch_screen"]) + if(ls["build"]) //Causes the Protolathe to build something. + if(busy) + say("Warning: Fabricators busy!") + else + user_try_print_id(ls["build"], ls["amount"]) + if(ls["search"]) //Search for designs with name matching pattern + search(ls["to_search"]) + screen = RESEARCH_FABRICATOR_SCREEN_SEARCH + if(ls["sync_research"]) + update_research() + say("Synchronizing research with host technology database.") + if(ls["category"]) + selected_category = ls["category"] + if(ls["dispose"]) //Causes the protolathe to dispose of a single reagent (all of it) + reagents.del_reagent(ls["dispose"]) + if(ls["disposeall"]) //Causes the protolathe to dispose of all it's reagents. + reagents.clear_reagents() + if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material + eject_sheets(ls["ejectsheet"], ls["eject_amt"]) + updateUsrDialog() + +/obj/machinery/rnd/production/proc/eject_sheets(eject_sheet, eject_amt) + var/datum/component/material_container/mat_container = materials.mat_container + if (!mat_container) + say("No access to material storage, please contact the quartermaster.") + return 0 + if (materials.on_hold()) + say("Mineral access is on hold, please contact the quartermaster.") + return 0 + var/count = mat_container.retrieve_sheets(text2num(eject_amt), eject_sheet, drop_location()) + var/list/matlist = list() + matlist[eject_sheet] = MINERAL_MATERIAL_AMOUNT + materials.silo_log(src, "ejected", -count, "sheets", matlist) + return count + +/obj/machinery/rnd/production/proc/ui_screen_main() + var/list/l = list() + l += "
    \ + \ + \ + \ + \ + \ +

    " + + l += list_categories(categories, RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW) + + return l + +/obj/machinery/rnd/production/proc/ui_screen_category_view() + if(!selected_category) + return ui_screen_main() + var/list/l = list() + l += "

    Browsing [selected_category]:

    " + var/coeff = efficiency_coeff + for(var/v in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[v] + if(!(selected_category in D.category)|| !(D.build_type & allowed_buildtypes)) + continue + if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags))) + continue + l += design_menu_entry(D, coeff) + l += "
    " + return l + +/obj/machinery/rnd/production/proc/list_categories(list/categories, menu_num) + if(!categories) + return + + var/line_length = 1 + var/list/l = "" + + for(var/C in categories) + if(line_length > 2) + l += "" + line_length = 1 + + l += "" + line_length++ + + l += "
    [C]
    " + return l diff --git a/code/modules/research/nanites/nanite_programs/buffing.dm b/code/modules/research/nanites/nanite_programs/buffing.dm index be12d06e..dde61ec3 100644 --- a/code/modules/research/nanites/nanite_programs/buffing.dm +++ b/code/modules/research/nanites/nanite_programs/buffing.dm @@ -35,7 +35,7 @@ host_mob.adjustStaminaLoss(-10) //stimulants give stamina heal now host_mob.lying = 0 host_mob.update_canmove() - host_mob.reagents.add_reagent("stimulants", 1.5) + host_mob.reagents.add_reagent(/datum/reagent/medicine/stimulants, 1.5) /datum/nanite_program/hardening name = "Dermal Hardening" diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index ad9e73f4..ad48b64b 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -61,7 +61,10 @@ /datum/nanite_program/purging/active_effect() host_mob.adjustToxLoss(-1) for(var/datum/reagent/R in host_mob.reagents.reagent_list) - host_mob.reagents.remove_reagent(R.id,1) + if(R.type == /datum/reagent/fermi/nanite_b_gone) + host_mob.adjustToxLoss(4) + continue + host_mob.reagents.remove_reagent(R.type,1) /datum/nanite_program/brain_heal name = "Neural Regeneration" @@ -161,7 +164,7 @@ /datum/nanite_program/purging_advanced/active_effect() host_mob.adjustToxLoss(-1, forced = TRUE) for(var/datum/reagent/toxin/R in host_mob.reagents.reagent_list) - host_mob.reagents.remove_reagent(R.id,1) + host_mob.reagents.remove_reagent(R.type,1) /datum/nanite_program/regenerative_advanced name = "Bio-Reconstruction" diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 8a8b941a..709258e9 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -1,1131 +1,1131 @@ - -/* -Research and Development (R&D) Console - -This is the main work horse of the R&D system. It contains the menus/controls for the Destructive Analyzer, Protolathe, and Circuit -imprinter. - -Basic use: When it first is created, it will attempt to link up to related devices within 3 squares. It'll only link up if they -aren't already linked to another console. Any consoles it cannot link up with (either because all of a certain type are already -linked or there aren't any in range), you'll just not have access to that menu. In the settings menu, there are menu options that -allow a player to attempt to re-sync with nearby consoles. You can also force it to disconnect from a specific console. - -The only thing that requires toxins access is locking and unlocking the console on the settings menu. -Nothing else in the console has ID requirements. - -*/ -/obj/machinery/computer/rdconsole - name = "R&D Console" - desc = "A console used to interface with R&D tools." - icon_screen = "rdcomp" - icon_keyboard = "rd_key" - var/datum/techweb/stored_research //Reference to global science techweb. - var/obj/item/disk/tech_disk/t_disk //Stores the technology disk. - var/obj/item/disk/design_disk/d_disk //Stores the design disk. - circuit = /obj/item/circuitboard/computer/rdconsole - - var/obj/machinery/rnd/destructive_analyzer/linked_destroy //Linked Destructive Analyzer - var/obj/machinery/rnd/production/protolathe/linked_lathe //Linked Protolathe - var/obj/machinery/rnd/production/circuit_imprinter/linked_imprinter //Linked Circuit Imprinter - - req_access = list(ACCESS_TOX) //lA AND SETTING MANIPULATION REQUIRES SCIENTIST ACCESS. - - //UI VARS - var/screen = RDSCREEN_MENU - var/back = RDSCREEN_MENU - var/locked = FALSE - var/tdisk_uple = FALSE - var/ddisk_uple = FALSE - var/datum/techweb_node/selected_node - var/datum/design/selected_design - var/selected_category - var/list/datum/design/matching_designs - var/disk_slot_selected - var/searchstring = "" - var/searchtype = "" - var/ui_mode = RDCONSOLE_UI_MODE_NORMAL - - var/research_control = TRUE - -/obj/machinery/computer/rdconsole/production - circuit = /obj/item/circuitboard/computer/rdconsole/production - research_control = FALSE - -/proc/CallMaterialName(ID) - if (copytext(ID, 1, 2) == "$" && GLOB.materials_list[ID]) - var/datum/material/material = GLOB.materials_list[ID] - return material.name - - else if(GLOB.chemical_reagents_list[ID]) - var/datum/reagent/reagent = GLOB.chemical_reagents_list[ID] - return reagent.name - return "ERROR: Report This" - -/obj/machinery/computer/rdconsole/proc/SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any). - for(var/obj/machinery/rnd/D in oview(3,src)) - if(D.linked_console != null || D.disabled || D.panel_open) - continue - if(istype(D, /obj/machinery/rnd/destructive_analyzer)) - if(linked_destroy == null) - linked_destroy = D - D.linked_console = src - else if(istype(D, /obj/machinery/rnd/production/protolathe)) - if(linked_lathe == null) - var/obj/machinery/rnd/production/protolathe/P = D - if(!P.console_link) - continue - linked_lathe = D - D.linked_console = src - else if(istype(D, /obj/machinery/rnd/production/circuit_imprinter)) - if(linked_imprinter == null) - var/obj/machinery/rnd/production/circuit_imprinter/C = D - if(!C.console_link) - continue - linked_imprinter = D - D.linked_console = src - -/obj/machinery/computer/rdconsole/Initialize() - . = ..() - stored_research = SSresearch.science_tech - stored_research.consoles_accessing[src] = TRUE - matching_designs = list() - SyncRDevices() - -/obj/machinery/computer/rdconsole/Destroy() - if(stored_research) - stored_research.consoles_accessing -= src - if(linked_destroy) - linked_destroy.linked_console = null - linked_destroy = null - if(linked_lathe) - linked_lathe.linked_console = null - linked_lathe = null - if(linked_imprinter) - linked_imprinter.linked_console = null - linked_imprinter = null - if(t_disk) - t_disk.forceMove(get_turf(src)) - t_disk = null - if(d_disk) - d_disk.forceMove(get_turf(src)) - d_disk = null - matching_designs = null - selected_node = null - selected_design = null - return ..() - -/obj/machinery/computer/rdconsole/attackby(obj/item/D, mob/user, params) - //Loading a disk into it. - if(istype(D, /obj/item/disk)) - if(istype(D, /obj/item/disk/tech_disk)) - if(t_disk) - to_chat(user, "A technology disk is already loaded!") - return - if(!user.transferItemToLoc(D, src)) - to_chat(user, "[D] is stuck to your hand!") - return - t_disk = D - else if (istype(D, /obj/item/disk/design_disk)) - if(d_disk) - to_chat(user, "A design disk is already loaded!") - return - if(!user.transferItemToLoc(D, src)) - to_chat(user, "[D] is stuck to your hand!") - return - d_disk = D - else - to_chat(user, "Machine cannot accept disks in that format.") - return - to_chat(user, "You insert [D] into \the [src]!") - else if(!(linked_destroy && linked_destroy.busy) && !(linked_lathe && linked_lathe.busy) && !(linked_imprinter && linked_imprinter.busy)) - . = ..() - -/obj/machinery/computer/rdconsole/proc/research_node(id, mob/user) - if(!stored_research.available_nodes[id] || stored_research.researched_nodes[id]) - say("Node unlock failed: Either already researched or not available!") - return FALSE - var/datum/techweb_node/TN = SSresearch.techweb_nodes[id] - if(!istype(TN)) - say("Node unlock failed: Unknown error.") - return FALSE - var/list/price = TN.get_price(stored_research) - if(stored_research.can_afford(price)) - investigate_log("[key_name(user)] researched [id]([json_encode(price)]) on techweb id [stored_research.id].", INVESTIGATE_RESEARCH) - if(stored_research == SSresearch.science_tech) - SSblackbox.record_feedback("associative", "science_techweb_unlock", 1, list("id" = "[id]", "name" = TN.display_name, "price" = "[json_encode(price)]", "time" = SQLtime())) - if(stored_research.research_node(SSresearch.techweb_nodes[id])) - say("Successfully researched [TN.display_name].") - var/logname = "Unknown" - if(isAI(user)) - logname = "AI: [user.name]" - else if(iscyborg(user)) - logname = "Cyborg: [user.name]" - else if(isliving(user)) - var/mob/living/L = user - logname = L.get_visible_name() - stored_research.research_logs += "[logname] researched node id [id] with cost [json_encode(price)] at [COORD(src)]." - return TRUE - else - say("Failed to research node: Internal database error!") - return FALSE - say("Not enough research points...") - return FALSE - -/obj/machinery/computer/rdconsole/on_deconstruction() - if(linked_destroy) - linked_destroy.linked_console = null - linked_destroy = null - if(linked_lathe) - linked_lathe.linked_console = null - linked_lathe = null - if(linked_imprinter) - linked_imprinter.linked_console = null - linked_imprinter = null - ..() - -/obj/machinery/computer/rdconsole/emag_act(mob/user) - if(!(obj_flags & EMAGGED)) - to_chat(user, "You disable the security protocols[locked? " and unlock the console":""].") - playsound(src, "sparks", 75, 1) - obj_flags |= EMAGGED - locked = FALSE - return ..() - -/obj/machinery/computer/rdconsole/multitool_act(mob/user, obj/item/multitool/I) - var/lathe = linked_lathe && linked_lathe.multitool_act(user, I) - var/print = linked_imprinter && linked_imprinter.multitool_act(user, I) - return lathe || print - -/obj/machinery/computer/rdconsole/proc/list_categories(list/categories, menu_num as num) - if(!categories) - return - - var/line_length = 1 - var/list/l = "" - - for(var/C in categories) - if(line_length > 2) - l += "" - line_length = 1 - - l += "" - line_length++ - - l += "
    [C]
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_header() - var/list/l = list() - var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs) - l += "[sheet.css_tag()][RDSCREEN_NOBREAK]" - l += "
    [stored_research.organization] Research and Development Network" - l += "Available points:
    [techweb_point_display_rdconsole(stored_research.research_points, stored_research.last_bitcoins)]" - l += "Security protocols: [obj_flags & EMAGGED ? "Disabled" : "Enabled"]" - l += "Main Menu | Back
    [RDSCREEN_NOBREAK]" - l += "[ui_mode == 1? "Normal View" : "Normal View"] | [ui_mode == 2? "Expert View" : "Expert View"] | [ui_mode == 3? "List View" : "List View"]" - return l - -/obj/machinery/computer/rdconsole/proc/ui_main_menu() - var/list/l = list() - if(research_control) - l += "

    Technology" - if(d_disk) - l += "
    Design Disk" - if(t_disk) - l += "
    Tech Disk" - if(linked_destroy) - l += "
    Destructive Analyzer" - if(linked_lathe) - l += "
    Protolathe" - if(linked_imprinter) - l += "
    Circuit Imprinter" - l += "
    Settings

    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_locked() - return list("

    SYSTEM LOCKED


    ") - -/obj/machinery/computer/rdconsole/proc/ui_settings() - var/list/l = list() - l += "

    R&D Console Settings:

    " - l += "Device Linkage Menu" - l += "Lock Console
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_device_linking() - var/list/l = list() - l += "Settings Menu
    " - l += "

    R&D Console Device Linkage Menu:

    " - l += "Re-sync with Nearby Devices" - l += "

    Linked Devices:

    " - l += linked_destroy? "* Destructive Analyzer Disconnect" : "* No Destructive Analyzer Linked" - l += linked_lathe? "* Protolathe Disconnect" : "* No Protolathe Linked" - l += linked_imprinter? "* Circuit Imprinter Disconnect" : "* No Circuit Imprinter Linked" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe_header() - var/list/l = list() - l += "
    Protolathe Menu" - if(linked_lathe.materials.mat_container) - l += "Material Amount: [linked_lathe.materials.format_amount()]" - else - l += "No material storage connected, please contact the quartermaster." - l += "Chemical volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe_category_view() //Legacy code - RDSCREEN_UI_LATHE_CHECK - var/list/l = list() - l += ui_protolathe_header() - l += "

    Browsing [selected_category]:

    " - for(var/v in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[v] - if(!(selected_category in D.category)|| !(D.build_type & PROTOLATHE)) - continue - if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags))) - continue - var/temp_material - var/c = 50 - var/coeff = linked_lathe.efficiency_coeff - if(!linked_lathe.efficient_with(D.build_path)) - coeff = 1 - - var/all_materials = D.materials + D.reagents_list - for(var/M in all_materials) - var/t = linked_lathe.check_mat(D, M) - temp_material += " | " - if (t < 1) - temp_material += "[all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" - c = min(c,t) - - if (c >= 1) - l += "[D.name][RDSCREEN_NOBREAK]" - if(c >= 5) - l += "x5[RDSCREEN_NOBREAK]" - if(c >= 10) - l += "x10[RDSCREEN_NOBREAK]" - l += "[temp_material][RDSCREEN_NOBREAK]" - else - l += "[D.name][temp_material][RDSCREEN_NOBREAK]" - l += "" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe() //Legacy code - RDSCREEN_UI_LATHE_CHECK - var/list/l = list() - l += ui_protolathe_header() - - l += "
    \ - \ - \ - \ - \ - \ -

    " - - l += list_categories(linked_lathe.categories, RDSCREEN_PROTOLATHE_CATEGORY_VIEW) - - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe_search() //Legacy code - RDSCREEN_UI_LATHE_CHECK - var/list/l = list() - l += ui_protolathe_header() - for(var/datum/design/D in matching_designs) - if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags))) - continue - var/temp_material - var/c = 50 - var/all_materials = D.materials + D.reagents_list - var/coeff = linked_lathe.efficiency_coeff - if(!linked_lathe.efficient_with(D.build_path)) - coeff = 1 - for(var/M in all_materials) - var/t = linked_lathe.check_mat(D, M) - temp_material += " | " - if (t < 1) - temp_material += "[all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" - c = min(c,t) - - if (c >= 1) - l += "[D.name][RDSCREEN_NOBREAK]" - if(c >= 5) - l += "x5[RDSCREEN_NOBREAK]" - if(c >= 10) - l += "x10[RDSCREEN_NOBREAK]" - l += "[temp_material][RDSCREEN_NOBREAK]" - else - l += "[D.name][temp_material][RDSCREEN_NOBREAK]" - l += "" - l += "" - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe_materials() //Legacy code - RDSCREEN_UI_LATHE_CHECK - var/datum/component/material_container/mat_container = linked_lathe.materials.mat_container - if (!mat_container) - screen = RDSCREEN_PROTOLATHE - return ui_protolathe() - var/list/l = list() - l += ui_protolathe_header() - l += "

    Material Storage:

    " - for(var/mat_id in mat_container.materials) - var/datum/material/M = mat_container.materials[mat_id] - l += "* [M.amount] of [M.name]: " - if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "Eject [RDSCREEN_NOBREAK]" - if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" - if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]" - l += "" - l += "
    [RDSCREEN_NOBREAK]" - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe_chemicals() //Legacy code - RDSCREEN_UI_LATHE_CHECK - var/list/l = list() - l += ui_protolathe_header() - l += "
    Disposal All Chemicals in Storage" - l += "

    Chemical Storage:

    " - for(var/datum/reagent/R in linked_lathe.reagents.reagent_list) - l += "[R.name]: [R.volume]" - l += "Purge" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit_header() //Legacy Code - var/list/l = list() - l += "
    Circuit Imprinter Menu" - if (linked_imprinter.materials.mat_container) - l += "Material Amount: [linked_imprinter.materials.format_amount()]" - else - l += "No material storage connected, please contact the quartermaster." - l += "Chemical volume: [linked_imprinter.reagents.total_volume] / [linked_imprinter.reagents.maximum_volume]
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit() //Legacy code - RDSCREEN_UI_IMPRINTER_CHECK - var/list/l = list() - l += ui_circuit_header() - l += "

    Circuit Imprinter Menu:

    " - - l += "
    \ - \ - \ - \ - \ - \ -

    " - - l += list_categories(linked_imprinter.categories, RDSCREEN_IMPRINTER_CATEGORY_VIEW) - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit_category_view() //Legacy code - RDSCREEN_UI_IMPRINTER_CHECK - var/list/l = list() - l += ui_circuit_header() - l += "

    Browsing [selected_category]:

    " - - for(var/v in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[v] - if(!(selected_category in D.category) || !(D.build_type & IMPRINTER)) - continue - if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags))) - continue - var/temp_materials - var/check_materials = TRUE - - var/all_materials = D.materials + D.reagents_list - var/coeff = linked_imprinter.efficiency_coeff - if(!linked_imprinter.efficient_with(D.build_path)) - coeff = 1 - - for(var/M in all_materials) - temp_materials += " | " - if (!linked_imprinter.check_mat(D, M)) - check_materials = FALSE - temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" - if (check_materials) - l += "[D.name][temp_materials]" - else - l += "[D.name][temp_materials]" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit_search() //Legacy code - RDSCREEN_UI_IMPRINTER_CHECK - var/list/l = list() - l += ui_circuit_header() - l += "

    Search results:

    " - - for(var/datum/design/D in matching_designs) - if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags))) - continue - var/temp_materials - var/check_materials = TRUE - var/all_materials = D.materials + D.reagents_list - var/coeff = linked_imprinter.efficiency_coeff - if(!linked_imprinter.efficient_with(D.build_path)) - coeff = 1 - for(var/M in all_materials) - temp_materials += " | " - if (!linked_imprinter.check_mat(D, M)) - check_materials = FALSE - temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" - if (check_materials) - l += "[D.name][temp_materials]" - else - l += "[D.name][temp_materials]" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit_chemicals() //legacy code - RDSCREEN_UI_IMPRINTER_CHECK - var/list/l = list() - l += ui_circuit_header() - l += "Disposal All Chemicals in Storage
    " - l += "

    Chemical Storage:

    " - for(var/datum/reagent/R in linked_imprinter.reagents.reagent_list) - l += "[R.name]: [R.volume]" - l += "Purge" - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit_materials() //Legacy code! - RDSCREEN_UI_IMPRINTER_CHECK - var/datum/component/material_container/mat_container = linked_imprinter.materials.mat_container - if (!mat_container) - screen = RDSCREEN_IMPRINTER - return ui_circuit() - var/list/l = list() - l += ui_circuit_header() - l += "

    Material Storage:

    " - for(var/mat_id in mat_container.materials) - var/datum/material/M = mat_container.materials[mat_id] - l += "* [M.amount] of [M.name]: " - if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "Eject [RDSCREEN_NOBREAK]" - if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" - if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_techdisk() //Legacy code - RDSCREEN_UI_TDISK_CHECK - var/list/l = list() - l += "
    Disk Operations: Clear Disk" - l += "Eject Disk" - l += "Upload All" - l += "Load Technology to Disk
    " - l += "

    Stored Technology Nodes:

    " - for(var/i in t_disk.stored_research.researched_nodes) - var/datum/techweb_node/N = t_disk.stored_research.researched_nodes[i] - l += "[N.display_name]" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_designdisk() //Legacy code - RDSCREEN_UI_DDISK_CHECK - var/list/l = list() - l += "Disk Operations: Clear DiskUpload AllEject Disk" - for(var/i in 1 to d_disk.max_blueprints) - l += "
    " - if(d_disk.blueprints[i]) - var/datum/design/D = d_disk.blueprints[i] - l += "[D.name]" - l += "Operations: Upload to database Clear Slot" - else - l += "Empty Slot Operations: Load Design to Slot" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_designdisk_upload() //Legacy code - RDSCREEN_UI_DDISK_CHECK - var/list/l = list() - l += "Return to Disk Operations
    " - l += "

    Load Design to Disk:

    " - for(var/v in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[v] - l += "[D.name] " - l += "Copy to Disk" - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_deconstruct() //Legacy code - RDSCREEN_UI_DECONSTRUCT_CHECK - var/list/l = list() - if(!linked_destroy.loaded_item) - l += "
    No item loaded. Standing-by...
    " - else - l += "
    [RDSCREEN_NOBREAK]" - l += "
    [icon2html(linked_destroy.loaded_item, usr)][linked_destroy.loaded_item.name] Eject
    [RDSCREEN_NOBREAK]" - l += "Select a node to boost by deconstructing this item. This item can boost:" - - var/anything = FALSE - var/list/boostable_nodes = techweb_item_boost_check(linked_destroy.loaded_item) - for(var/id in boostable_nodes) - anything = TRUE - var/list/worth = boostable_nodes[id] - var/datum/techweb_node/N = get_techweb_node_by_id(id) - - l += "
    [RDSCREEN_NOBREAK]" - if (stored_research.researched_nodes[N.id]) // already researched - l += "[N.display_name]" - l += "This node has already been researched." - else if(!length(worth)) // reveal only - if (stored_research.hidden_nodes[N.id]) - l += "[N.display_name]" - l += "This node will be revealed." - else - l += "[N.display_name]" - l += "This node has already been revealed." - else // boost by the difference - var/list/differences = list() - var/list/already_boosted = stored_research.boosted_nodes[N.id] - for(var/i in worth) - var/already_boosted_amount = already_boosted? stored_research.boosted_nodes[N.id][i] : 0 - var/amt = min(worth[i], N.research_costs[i]) - already_boosted_amount - if(amt > 0) - differences[i] = amt - if (length(differences)) - l += "[N.display_name]" - l += "This node will be boosted with the following:
    [techweb_point_display_generic(differences)]" - else - l += "[N.display_name]" - l += "This node has already been boosted." - l += "
    [RDSCREEN_NOBREAK]" - - // point deconstruction and material reclamation use the same ID to prevent accidentally missing the points - var/list/point_values = techweb_item_point_check(linked_destroy.loaded_item) - if(point_values) - anything = TRUE - l += "
    [RDSCREEN_NOBREAK]" - if (stored_research.deconstructed_items[linked_destroy.loaded_item.type]) - l += "Point Deconstruction" - l += "This item's points have already been claimed." - else - l += "Point Deconstruction" - l += "This item is worth:
    [techweb_point_display_generic(point_values)]!" - l += "
    [RDSCREEN_NOBREAK]" - - if(!(linked_destroy.loaded_item.resistance_flags & INDESTRUCTIBLE)) - var/list/materials = linked_destroy.loaded_item.materials - l += "
    [materials.len? "Material Reclamation" : "Destroy Item"]" - for (var/M in materials) - l += "* [CallMaterialName(M)] x [materials[M]]" - l += "
    [RDSCREEN_NOBREAK]" - anything = TRUE - - if (!anything) - l += "Nothing!" - - l += "
    " - return l - -/obj/machinery/computer/rdconsole/proc/ui_techweb() - var/list/l = list() - if(islist(stored_research.research_logs) && stored_research.research_logs.len) - l += "Last action: [stored_research.research_logs[stored_research.research_logs.len]]" - if(ui_mode != RDCONSOLE_UI_MODE_LIST) - var/list/columns = list() - var/max_tier = 0 - for (var/node_ in stored_research.tiers) - var/datum/techweb_node/node = node_ - var/tier = stored_research.tiers[node] - LAZYINITLIST(columns["[tier]"]) // String hackery to make the numbers associative - columns["[tier]"] += ui_techweb_single_node(node, minimal=(tier != 1)) - max_tier = max(max_tier, tier) - - l += "[RDSCREEN_NOBREAK]" - for(var/tier in 0 to max_tier) - l += "[RDSCREEN_NOBREAK]" - l += "
    ResearchedAvailableFuture
    [RDSCREEN_NOBREAK]" - l += columns["[tier]"] - l += "
    [RDSCREEN_NOBREAK]" - else - var/list/avail = list() //This could probably be optimized a bit later. - var/list/unavail = list() - var/list/res = list() - for(var/v in stored_research.researched_nodes) - res += stored_research.researched_nodes[v] - for(var/v in stored_research.available_nodes) - if(stored_research.researched_nodes[v]) - continue - avail += stored_research.available_nodes[v] - for(var/v in stored_research.visible_nodes) - if(stored_research.available_nodes[v]) - continue - unavail += stored_research.visible_nodes[v] - l += "

    Technology Nodes:

    [RDSCREEN_NOBREAK]" - l += "

    Available for Research:

    " - for(var/datum/techweb_node/N in avail) - var/not_unlocked = (stored_research.available_nodes[N.id] && !stored_research.researched_nodes[N.id]) - var/has_points = (stored_research.can_afford(N.get_price(stored_research))) - var/research_href = not_unlocked? (has_points? "Research" : "Not Enough Points") : null - l += "[N.display_name][research_href]" - l += "

    Locked Nodes:

    " - for(var/datum/techweb_node/N in unavail) - l += "[N.display_name]" - l += "

    Researched Nodes:

    " - for(var/datum/techweb_node/N in res) - l += "[N.display_name]" - l += "
    [RDSCREEN_NOBREAK]" - return l - -/obj/machinery/computer/rdconsole/proc/machine_icon(atom/item) - return icon2html(initial(item.icon), usr, initial(item.icon_state), SOUTH) - -/obj/machinery/computer/rdconsole/proc/ui_techweb_single_node(datum/techweb_node/node, selflink=TRUE, minimal=FALSE) - var/list/l = list() - if (stored_research.hidden_nodes[node.id]) - return l - var/display_name = node.display_name - if (selflink) - display_name = "[display_name]" - l += "
    [display_name] [RDSCREEN_NOBREAK]" - if(minimal) - l += "
    [node.description]" - else - if(stored_research.researched_nodes[node.id]) - l += "Researched" - else if(stored_research.available_nodes[node.id]) - if(stored_research.can_afford(node.get_price(stored_research))) - l += "
    [node.price_display(stored_research)]" - else - l += "
    [node.price_display(stored_research)]" // gray - too expensive - else - l += "
    [node.price_display(stored_research)]" // red - missing prereqs - if(ui_mode == RDCONSOLE_UI_MODE_NORMAL) - l += "[node.description]" - for(var/i in node.designs) - var/datum/design/D = node.designs[i] - l += "[D.icon_html(usr)][RDSCREEN_NOBREAK]" - l += "
    [RDSCREEN_NOBREAK]" - return l - -/obj/machinery/computer/rdconsole/proc/ui_techweb_nodeview() - RDSCREEN_UI_SNODE_CHECK - var/list/l = list() - if(stored_research.hidden_nodes[selected_node.id]) - l += "

    ERROR: RESEARCH NODE UNKNOWN.

    " - return - - l += "[RDSCREEN_NOBREAK]" - if (length(selected_node.prerequisites)) - l += "[RDSCREEN_NOBREAK]" - l += "[RDSCREEN_NOBREAK]" - if (length(selected_node.unlocks)) - l += "[RDSCREEN_NOBREAK]" - - l += "[RDSCREEN_NOBREAK]" - if (length(selected_node.prerequisites)) - l += "[RDSCREEN_NOBREAK]" - l += "[RDSCREEN_NOBREAK]" - if (length(selected_node.unlocks)) - l += "[RDSCREEN_NOBREAK]" - - l += "
    RequiresCurrent NodeUnlocks
    [RDSCREEN_NOBREAK]" - for (var/i in selected_node.prerequisites) - l += ui_techweb_single_node(selected_node.prerequisites[i]) - l += "[RDSCREEN_NOBREAK]" - l += ui_techweb_single_node(selected_node, selflink=FALSE) - l += "[RDSCREEN_NOBREAK]" - for (var/i in selected_node.unlocks) - l += ui_techweb_single_node(selected_node.unlocks[i]) - l += "
    [RDSCREEN_NOBREAK]" - return l - -/obj/machinery/computer/rdconsole/proc/ui_techweb_designview() //Legacy code - RDSCREEN_UI_SDESIGN_CHECK - var/list/l = list() - var/datum/design/D = selected_design - l += "
    [D.icon_html(usr)][D.name]
    [RDSCREEN_NOBREAK]" - if(D.build_type) - var/lathes = list() - if(D.build_type & IMPRINTER) - lathes += "[machine_icon(/obj/machinery/rnd/production/circuit_imprinter)][RDSCREEN_NOBREAK]" - if (linked_imprinter && D.id in stored_research.researched_designs) - l += "Imprint" - if(D.build_type & PROTOLATHE) - lathes += "[machine_icon(/obj/machinery/rnd/production/protolathe)][RDSCREEN_NOBREAK]" - if (linked_lathe && D.id in stored_research.researched_designs) - l += "Construct" - if(D.build_type & AUTOLATHE) - lathes += "[machine_icon(/obj/machinery/autolathe)][RDSCREEN_NOBREAK]" - if(D.build_type & MECHFAB) - lathes += "[machine_icon(/obj/machinery/mecha_part_fabricator)][RDSCREEN_NOBREAK]" - if(D.build_type & BIOGENERATOR) - lathes += "[machine_icon(/obj/machinery/biogenerator)][RDSCREEN_NOBREAK]" - if(D.build_type & LIMBGROWER) - lathes += "[machine_icon(/obj/machinery/limbgrower)][RDSCREEN_NOBREAK]" - if(D.build_type & SMELTER) - lathes += "[machine_icon(/obj/machinery/mineral/processing_unit)][RDSCREEN_NOBREAK]" - l += "Construction types:" - l += lathes - l += "" - l += "Required materials:" - var/all_mats = D.materials + D.reagents_list - for(var/M in all_mats) - l += "* [CallMaterialName(M)] x [all_mats[M]]" - l += "Unlocked by:" - for (var/node in D.unlocked_by) - l += ui_techweb_single_node(node) - l += "[RDSCREEN_NOBREAK]
    " - return l - -//Fuck TGUI. -/obj/machinery/computer/rdconsole/proc/generate_ui() - var/list/ui = list() - ui += ui_header() - if(locked) - ui += ui_locked() - else - switch(screen) - if(RDSCREEN_MENU) - ui += ui_main_menu() - if(RDSCREEN_TECHWEB) - ui += ui_techweb() - if(RDSCREEN_TECHWEB_NODEVIEW) - ui += ui_techweb_nodeview() - if(RDSCREEN_TECHWEB_DESIGNVIEW) - ui += ui_techweb_designview() - if(RDSCREEN_DESIGNDISK) - ui += ui_designdisk() - if(RDSCREEN_DESIGNDISK_UPLOAD) - ui += ui_designdisk_upload() - if(RDSCREEN_TECHDISK) - ui += ui_techdisk() - if(RDSCREEN_DECONSTRUCT) - ui += ui_deconstruct() - if(RDSCREEN_PROTOLATHE) - ui += ui_protolathe() - if(RDSCREEN_PROTOLATHE_CATEGORY_VIEW) - ui += ui_protolathe_category_view() - if(RDSCREEN_PROTOLATHE_MATERIALS) - ui += ui_protolathe_materials() - if(RDSCREEN_PROTOLATHE_CHEMICALS) - ui += ui_protolathe_chemicals() - if(RDSCREEN_PROTOLATHE_SEARCH) - ui += ui_protolathe_search() - if(RDSCREEN_IMPRINTER) - ui += ui_circuit() - if(RDSCREEN_IMPRINTER_CATEGORY_VIEW) - ui += ui_circuit_category_view() - if(RDSCREEN_IMPRINTER_MATERIALS) - ui += ui_circuit_materials() - if(RDSCREEN_IMPRINTER_CHEMICALS) - ui += ui_circuit_chemicals() - if(RDSCREEN_IMPRINTER_SEARCH) - ui += ui_circuit_search() - if(RDSCREEN_SETTINGS) - ui += ui_settings() - if(RDSCREEN_DEVICE_LINKING) - ui += ui_device_linking() - for(var/i in 1 to length(ui)) - if(!findtextEx(ui[i], RDSCREEN_NOBREAK)) - ui[i] += "
    " - ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "") - return ui.Join("") - -/obj/machinery/computer/rdconsole/Topic(raw, ls) - if(..()) - return - add_fingerprint(usr) - usr.set_machine(src) - if(ls["switch_screen"]) - back = screen - screen = text2num(ls["switch_screen"]) - if(ls["ui_mode"]) - ui_mode = text2num(ls["ui_mode"]) - if(ls["lock_console"]) - if(obj_flags & EMAGGED) - to_chat(usr, "Security protocol error: Unable to lock.") - return - if(allowed(usr)) - lock_console(usr) - else - to_chat(usr, "Unauthorized Access.") - if(ls["unlock_console"]) - if(allowed(usr)) - unlock_console(usr) - else - to_chat(usr, "Unauthorized Access.") - if(ls["find_device"]) - SyncRDevices() - say("Resynced with nearby devices.") - if(ls["back_screen"]) - back = text2num(ls["back_screen"]) - if(ls["build"]) //Causes the Protolathe to build something. - if(QDELETED(linked_lathe)) - say("No Protolathe Linked!") - return - if(linked_lathe.busy) - say("Warning: Protolathe busy!") - else - linked_lathe.user_try_print_id(ls["build"], ls["amount"]) - if(ls["imprint"]) - if(QDELETED(linked_imprinter)) - say("No Circuit Imprinter Linked!") - return - if(linked_imprinter.busy) - say("Warning: Imprinter busy!") - else - linked_imprinter.user_try_print_id(ls["imprint"]) - if(ls["category"]) - selected_category = ls["category"] - if(ls["disconnect"]) //The R&D console disconnects with a specific device. - switch(ls["disconnect"]) - if("destroy") - if(QDELETED(linked_destroy)) - say("No Destructive Analyzer Linked!") - return - linked_destroy.linked_console = null - linked_destroy = null - if("lathe") - if(QDELETED(linked_lathe)) - say("No Protolathe Linked!") - return - linked_lathe.linked_console = null - linked_lathe = null - if("imprinter") - if(QDELETED(linked_imprinter)) - say("No Circuit Imprinter Linked!") - return - linked_imprinter.linked_console = null - linked_imprinter = null - if(ls["eject_design"]) //Eject the design disk. - eject_disk("design") - screen = RDSCREEN_MENU - say("Ejecting Design Disk") - if(ls["eject_tech"]) //Eject the technology disk. - eject_disk("tech") - screen = RDSCREEN_MENU - say("Ejecting Technology Disk") - if(ls["deconstruct"]) - if(QDELETED(linked_destroy)) - say("No Destructive Analyzer Linked!") - return - if(!linked_destroy.user_try_decon_id(ls["deconstruct"], usr)) - say("Destructive analysis failed!") - //Protolathe Materials - if(ls["disposeP"]) //Causes the protolathe to dispose of a single reagent (all of it) - if(QDELETED(linked_lathe)) - say("No Protolathe Linked!") - return - linked_lathe.reagents.del_reagent(ls["disposeP"]) - if(ls["disposeallP"]) //Causes the protolathe to dispose of all it's reagents. - if(QDELETED(linked_lathe)) - say("No Protolathe Linked!") - return - linked_lathe.reagents.clear_reagents() - if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material - if(QDELETED(linked_lathe)) - say("No Protolathe Linked!") - return - if(!linked_lathe.materials.mat_container) - say("No material storage linked to protolathe!") - return - linked_lathe.eject_sheets(ls["ejectsheet"], ls["eject_amt"]) - //Circuit Imprinter Materials - if(ls["disposeI"]) //Causes the circuit imprinter to dispose of a single reagent (all of it) - if(QDELETED(linked_imprinter)) - say("No Circuit Imprinter Linked!") - return - linked_imprinter.reagents.del_reagent(ls["disposeI"]) - if(ls["disposeallI"]) //Causes the circuit imprinter to dispose of all it's reagents. - if(QDELETED(linked_imprinter)) - say("No Circuit Imprinter Linked!") - return - linked_imprinter.reagents.clear_reagents() - if(ls["imprinter_ejectsheet"]) //Causes the imprinter to eject a sheet of material - if(QDELETED(linked_imprinter)) - say("No Circuit Imprinter Linked!") - return - if(!linked_imprinter.materials.mat_container) - say("No material storage linked to circuit imprinter!") - return - linked_imprinter.eject_sheets(ls["imprinter_ejectsheet"], ls["eject_amt"]) - if(ls["disk_slot"]) - disk_slot_selected = text2num(ls["disk_slot"]) - if(ls["research_node"]) - if(!research_control) - return //honestly should call them out for href exploiting :^) - if(!SSresearch.science_tech.available_nodes[ls["research_node"]]) - return //Nope! - research_node(ls["research_node"], usr) - if(ls["clear_tech"]) //Erase la on the technology disk. - if(QDELETED(t_disk)) - say("No Technology Disk Inserted!") - return - qdel(t_disk.stored_research) - t_disk.stored_research = new - say("Wiping technology disk.") - if(ls["copy_tech"]) //Copy some technology la from the research holder to the disk. - if(QDELETED(t_disk)) - say("No Technology Disk Inserted!") - return - stored_research.copy_research_to(t_disk.stored_research) - screen = RDSCREEN_TECHDISK - say("Downloading to technology disk.") - if(ls["clear_design"]) //Erases la on the design disk. - if(QDELETED(d_disk)) - say("No Design Disk Inserted!") - return - var/n = text2num(ls["clear_design"]) - if(!n) - for(var/i in 1 to d_disk.max_blueprints) - d_disk.blueprints[i] = null - say("Wiping design disk.") - else - var/datum/design/D = d_disk.blueprints[n] - say("Wiping design [D.name] from design disk.") - d_disk.blueprints[n] = null - if(ls["search"]) //Search for designs with name matching pattern - searchstring = ls["to_search"] - searchtype = ls["type"] - rescan_views() - if(searchtype == "proto") - screen = RDSCREEN_PROTOLATHE_SEARCH - else - screen = RDSCREEN_IMPRINTER_SEARCH - if(ls["updt_tech"]) //Uple the research holder with information from the technology disk. - if(QDELETED(t_disk)) - say("No Technology Disk Inserted!") - return - say("Uploading technology disk.") - t_disk.stored_research.copy_research_to(stored_research) - if(ls["copy_design"]) //Copy design la from the research holder to the design disk. - if(QDELETED(d_disk)) - say("No Design Disk Inserted!") - return - var/slot = text2num(ls["copy_design"]) - var/datum/design/D = stored_research.researched_designs[ls["copy_design_ID"]] - if(D) - var/autolathe_friendly = TRUE - if(D.reagents_list.len) - autolathe_friendly = FALSE - D.category -= "Imported" - else - for(var/x in D.materials) - if( !(x in list(MAT_METAL, MAT_GLASS))) - autolathe_friendly = FALSE - D.category -= "Imported" - - if(D.build_type & (AUTOLATHE|PROTOLATHE|CRAFTLATHE)) // Specifically excludes circuit imprinter and mechfab - D.build_type = autolathe_friendly ? (D.build_type | AUTOLATHE) : D.build_type - D.category |= "Imported" - d_disk.blueprints[slot] = D - screen = RDSCREEN_DESIGNDISK - if(ls["eject_item"]) //Eject the item inside the destructive analyzer. - if(QDELETED(linked_destroy)) - say("No Destructive Analyzer Linked!") - return - if(linked_destroy.busy) - to_chat(usr, "The destructive analyzer is busy at the moment.") - else if(linked_destroy.loaded_item) - linked_destroy.unload_item() - screen = RDSCREEN_MENU - if(ls["view_node"]) - selected_node = SSresearch.techweb_nodes[ls["view_node"]] - screen = RDSCREEN_TECHWEB_NODEVIEW - if(ls["view_design"]) - selected_design = SSresearch.techweb_designs[ls["view_design"]] - screen = RDSCREEN_TECHWEB_DESIGNVIEW - if(ls["updt_design"]) //Uples the research holder with design la from the design disk. - if(QDELETED(d_disk)) - say("No design disk found.") - return - var/n = text2num(ls["updt_design"]) - if(!n) - for(var/D in d_disk.blueprints) - if(D) - stored_research.add_design(D) - else - stored_research.add_design(d_disk.blueprints[n]) - - updateUsrDialog() - -/obj/machinery/computer/rdconsole/ui_interact(mob/user) - . = ..() - var/datum/browser/popup = new(user, "rndconsole", name, 900, 600) - popup.add_stylesheet("techwebs", 'html/browser/techwebs.css') - popup.set_content(generate_ui()) - popup.open() - -/obj/machinery/computer/rdconsole/proc/tdisk_uple_complete() - tdisk_uple = FALSE - updateUsrDialog() - -/obj/machinery/computer/rdconsole/proc/ddisk_uple_complete() - ddisk_uple = FALSE - updateUsrDialog() - -/obj/machinery/computer/rdconsole/proc/eject_disk(type) - if(type == "design") - d_disk.forceMove(get_turf(src)) - d_disk = null - if(type == "tech") - t_disk.forceMove(get_turf(src)) - t_disk = null - -/obj/machinery/computer/rdconsole/proc/rescan_views() - var/compare - matching_designs.Cut() - if(searchtype == "proto") - compare = PROTOLATHE - else if(searchtype == "imprint") - compare = IMPRINTER - for(var/v in stored_research.researched_designs) - var/datum/design/D = stored_research.researched_designs[v] - if(!(D.build_type & compare)) - continue - if(findtext(D.name,searchstring)) - matching_designs.Add(D) - -/obj/machinery/computer/rdconsole/proc/check_canprint(datum/design/D, buildtype) - var/amount = 50 - if(buildtype == IMPRINTER) - if(QDELETED(linked_imprinter)) - return FALSE - for(var/M in D.materials + D.reagents_list) - amount = min(amount, linked_imprinter.check_mat(D, M)) - if(amount < 1) - return FALSE - else if(buildtype == PROTOLATHE) - if(QDELETED(linked_lathe)) - return FALSE - for(var/M in D.materials + D.reagents_list) - amount = min(amount, linked_lathe.check_mat(D, M)) - if(amount < 1) - return FALSE - else - return FALSE - return amount - -/obj/machinery/computer/rdconsole/proc/lock_console(mob/user) - locked = TRUE - -/obj/machinery/computer/rdconsole/proc/unlock_console(mob/user) - locked = FALSE - -/obj/machinery/computer/rdconsole/robotics - name = "Robotics R&D Console" - req_access = null - req_access_txt = "29" - -/obj/machinery/computer/rdconsole/robotics/Initialize() - . = ..() - if(circuit) - circuit.name = "R&D Console - Robotics (Computer Board)" - circuit.build_path = /obj/machinery/computer/rdconsole/robotics - -/obj/machinery/computer/rdconsole/core - name = "Core R&D Console" - -/obj/machinery/computer/rdconsole/experiment - name = "E.X.P.E.R.I-MENTOR R&D Console" + +/* +Research and Development (R&D) Console + +This is the main work horse of the R&D system. It contains the menus/controls for the Destructive Analyzer, Protolathe, and Circuit +imprinter. + +Basic use: When it first is created, it will attempt to link up to related devices within 3 squares. It'll only link up if they +aren't already linked to another console. Any consoles it cannot link up with (either because all of a certain type are already +linked or there aren't any in range), you'll just not have access to that menu. In the settings menu, there are menu options that +allow a player to attempt to re-sync with nearby consoles. You can also force it to disconnect from a specific console. + +The only thing that requires toxins access is locking and unlocking the console on the settings menu. +Nothing else in the console has ID requirements. + +*/ +/obj/machinery/computer/rdconsole + name = "R&D Console" + desc = "A console used to interface with R&D tools." + icon_screen = "rdcomp" + icon_keyboard = "rd_key" + var/datum/techweb/stored_research //Reference to global science techweb. + var/obj/item/disk/tech_disk/t_disk //Stores the technology disk. + var/obj/item/disk/design_disk/d_disk //Stores the design disk. + circuit = /obj/item/circuitboard/computer/rdconsole + + var/obj/machinery/rnd/destructive_analyzer/linked_destroy //Linked Destructive Analyzer + var/obj/machinery/rnd/production/protolathe/linked_lathe //Linked Protolathe + var/obj/machinery/rnd/production/circuit_imprinter/linked_imprinter //Linked Circuit Imprinter + + req_access = list(ACCESS_TOX) //lA AND SETTING MANIPULATION REQUIRES SCIENTIST ACCESS. + + //UI VARS + var/screen = RDSCREEN_MENU + var/back = RDSCREEN_MENU + var/locked = FALSE + var/tdisk_uple = FALSE + var/ddisk_uple = FALSE + var/datum/techweb_node/selected_node + var/datum/design/selected_design + var/selected_category + var/list/datum/design/matching_designs + var/disk_slot_selected + var/searchstring = "" + var/searchtype = "" + var/ui_mode = RDCONSOLE_UI_MODE_NORMAL + + var/research_control = TRUE + +/obj/machinery/computer/rdconsole/production + circuit = /obj/item/circuitboard/computer/rdconsole/production + research_control = FALSE + +/proc/CallMaterialName(ID) + if (copytext(ID, 1, 2) == "$" && GLOB.materials_list[ID]) + var/datum/material/material = GLOB.materials_list[ID] + return material.name + + else if(GLOB.chemical_reagents_list[ID]) + var/datum/reagent/reagent = GLOB.chemical_reagents_list[ID] + return reagent.name + return "ERROR: Report This" + +/obj/machinery/computer/rdconsole/proc/SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any). + for(var/obj/machinery/rnd/D in oview(3,src)) + if(D.linked_console != null || D.disabled || D.panel_open) + continue + if(istype(D, /obj/machinery/rnd/destructive_analyzer)) + if(linked_destroy == null) + linked_destroy = D + D.linked_console = src + else if(istype(D, /obj/machinery/rnd/production/protolathe)) + if(linked_lathe == null) + var/obj/machinery/rnd/production/protolathe/P = D + if(!P.console_link) + continue + linked_lathe = D + D.linked_console = src + else if(istype(D, /obj/machinery/rnd/production/circuit_imprinter)) + if(linked_imprinter == null) + var/obj/machinery/rnd/production/circuit_imprinter/C = D + if(!C.console_link) + continue + linked_imprinter = D + D.linked_console = src + +/obj/machinery/computer/rdconsole/Initialize() + . = ..() + stored_research = SSresearch.science_tech + stored_research.consoles_accessing[src] = TRUE + matching_designs = list() + SyncRDevices() + +/obj/machinery/computer/rdconsole/Destroy() + if(stored_research) + stored_research.consoles_accessing -= src + if(linked_destroy) + linked_destroy.linked_console = null + linked_destroy = null + if(linked_lathe) + linked_lathe.linked_console = null + linked_lathe = null + if(linked_imprinter) + linked_imprinter.linked_console = null + linked_imprinter = null + if(t_disk) + t_disk.forceMove(get_turf(src)) + t_disk = null + if(d_disk) + d_disk.forceMove(get_turf(src)) + d_disk = null + matching_designs = null + selected_node = null + selected_design = null + return ..() + +/obj/machinery/computer/rdconsole/attackby(obj/item/D, mob/user, params) + //Loading a disk into it. + if(istype(D, /obj/item/disk)) + if(istype(D, /obj/item/disk/tech_disk)) + if(t_disk) + to_chat(user, "A technology disk is already loaded!") + return + if(!user.transferItemToLoc(D, src)) + to_chat(user, "[D] is stuck to your hand!") + return + t_disk = D + else if (istype(D, /obj/item/disk/design_disk)) + if(d_disk) + to_chat(user, "A design disk is already loaded!") + return + if(!user.transferItemToLoc(D, src)) + to_chat(user, "[D] is stuck to your hand!") + return + d_disk = D + else + to_chat(user, "Machine cannot accept disks in that format.") + return + to_chat(user, "You insert [D] into \the [src]!") + else if(!(linked_destroy && linked_destroy.busy) && !(linked_lathe && linked_lathe.busy) && !(linked_imprinter && linked_imprinter.busy)) + . = ..() + +/obj/machinery/computer/rdconsole/proc/research_node(id, mob/user) + if(!stored_research.available_nodes[id] || stored_research.researched_nodes[id]) + say("Node unlock failed: Either already researched or not available!") + return FALSE + var/datum/techweb_node/TN = SSresearch.techweb_nodes[id] + if(!istype(TN)) + say("Node unlock failed: Unknown error.") + return FALSE + var/list/price = TN.get_price(stored_research) + if(stored_research.can_afford(price)) + investigate_log("[key_name(user)] researched [id]([json_encode(price)]) on techweb id [stored_research.id].", INVESTIGATE_RESEARCH) + if(stored_research == SSresearch.science_tech) + SSblackbox.record_feedback("associative", "science_techweb_unlock", 1, list("id" = "[id]", "name" = TN.display_name, "price" = "[json_encode(price)]", "time" = SQLtime())) + if(stored_research.research_node(SSresearch.techweb_nodes[id])) + say("Successfully researched [TN.display_name].") + var/logname = "Unknown" + if(isAI(user)) + logname = "AI: [user.name]" + else if(iscyborg(user)) + logname = "Cyborg: [user.name]" + else if(isliving(user)) + var/mob/living/L = user + logname = L.get_visible_name() + stored_research.research_logs += "[logname] researched node id [id] with cost [json_encode(price)] at [COORD(src)]." + return TRUE + else + say("Failed to research node: Internal database error!") + return FALSE + say("Not enough research points...") + return FALSE + +/obj/machinery/computer/rdconsole/on_deconstruction() + if(linked_destroy) + linked_destroy.linked_console = null + linked_destroy = null + if(linked_lathe) + linked_lathe.linked_console = null + linked_lathe = null + if(linked_imprinter) + linked_imprinter.linked_console = null + linked_imprinter = null + ..() + +/obj/machinery/computer/rdconsole/emag_act(mob/user) + if(!(obj_flags & EMAGGED)) + to_chat(user, "You disable the security protocols[locked? " and unlock the console":""].") + playsound(src, "sparks", 75, 1) + obj_flags |= EMAGGED + locked = FALSE + return ..() + +/obj/machinery/computer/rdconsole/multitool_act(mob/user, obj/item/multitool/I) + var/lathe = linked_lathe && linked_lathe.multitool_act(user, I) + var/print = linked_imprinter && linked_imprinter.multitool_act(user, I) + return lathe || print + +/obj/machinery/computer/rdconsole/proc/list_categories(list/categories, menu_num as num) + if(!categories) + return + + var/line_length = 1 + var/list/l = "" + + for(var/C in categories) + if(line_length > 2) + l += "" + line_length = 1 + + l += "" + line_length++ + + l += "
    [C]
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_header() + var/list/l = list() + var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs) + l += "[sheet.css_tag()][RDSCREEN_NOBREAK]" + l += "
    [stored_research.organization] Research and Development Network" + l += "Available points:
    [techweb_point_display_rdconsole(stored_research.research_points, stored_research.last_bitcoins)]" + l += "Security protocols: [obj_flags & EMAGGED ? "Disabled" : "Enabled"]" + l += "Main Menu | Back
    [RDSCREEN_NOBREAK]" + l += "[ui_mode == 1? "Normal View" : "Normal View"] | [ui_mode == 2? "Expert View" : "Expert View"] | [ui_mode == 3? "List View" : "List View"]" + return l + +/obj/machinery/computer/rdconsole/proc/ui_main_menu() + var/list/l = list() + if(research_control) + l += "

    Technology" + if(d_disk) + l += "
    Design Disk" + if(t_disk) + l += "
    Tech Disk" + if(linked_destroy) + l += "
    Destructive Analyzer" + if(linked_lathe) + l += "
    Protolathe" + if(linked_imprinter) + l += "
    Circuit Imprinter" + l += "
    Settings

    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_locked() + return list("

    SYSTEM LOCKED


    ") + +/obj/machinery/computer/rdconsole/proc/ui_settings() + var/list/l = list() + l += "

    R&D Console Settings:

    " + l += "Device Linkage Menu" + l += "Lock Console
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_device_linking() + var/list/l = list() + l += "Settings Menu
    " + l += "

    R&D Console Device Linkage Menu:

    " + l += "Re-sync with Nearby Devices" + l += "

    Linked Devices:

    " + l += linked_destroy? "* Destructive Analyzer Disconnect" : "* No Destructive Analyzer Linked" + l += linked_lathe? "* Protolathe Disconnect" : "* No Protolathe Linked" + l += linked_imprinter? "* Circuit Imprinter Disconnect" : "* No Circuit Imprinter Linked" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_protolathe_header() + var/list/l = list() + l += "
    Protolathe Menu" + if(linked_lathe.materials.mat_container) + l += "Material Amount: [linked_lathe.materials.format_amount()]" + else + l += "No material storage connected, please contact the quartermaster." + l += "Chemical volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_protolathe_category_view() //Legacy code + RDSCREEN_UI_LATHE_CHECK + var/list/l = list() + l += ui_protolathe_header() + l += "

    Browsing [selected_category]:

    " + for(var/v in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[v] + if(!(selected_category in D.category)|| !(D.build_type & PROTOLATHE)) + continue + if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags))) + continue + var/temp_material + var/c = 50 + var/coeff = linked_lathe.efficiency_coeff + if(!linked_lathe.efficient_with(D.build_path)) + coeff = 1 + + var/all_materials = D.materials + D.reagents_list + for(var/M in all_materials) + var/t = linked_lathe.check_mat(D, M) + temp_material += " | " + if (t < 1) + temp_material += "[all_materials[M]/coeff] [CallMaterialName(M)]" + else + temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" + c = min(c,t) + + if (c >= 1) + l += "[D.name][RDSCREEN_NOBREAK]" + if(c >= 5) + l += "x5[RDSCREEN_NOBREAK]" + if(c >= 10) + l += "x10[RDSCREEN_NOBREAK]" + l += "[temp_material][RDSCREEN_NOBREAK]" + else + l += "[D.name][temp_material][RDSCREEN_NOBREAK]" + l += "" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_protolathe() //Legacy code + RDSCREEN_UI_LATHE_CHECK + var/list/l = list() + l += ui_protolathe_header() + + l += "
    \ + \ + \ + \ + \ + \ +

    " + + l += list_categories(linked_lathe.categories, RDSCREEN_PROTOLATHE_CATEGORY_VIEW) + + return l + +/obj/machinery/computer/rdconsole/proc/ui_protolathe_search() //Legacy code + RDSCREEN_UI_LATHE_CHECK + var/list/l = list() + l += ui_protolathe_header() + for(var/datum/design/D in matching_designs) + if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags))) + continue + var/temp_material + var/c = 50 + var/all_materials = D.materials + D.reagents_list + var/coeff = linked_lathe.efficiency_coeff + if(!linked_lathe.efficient_with(D.build_path)) + coeff = 1 + for(var/M in all_materials) + var/t = linked_lathe.check_mat(D, M) + temp_material += " | " + if (t < 1) + temp_material += "[all_materials[M]/coeff] [CallMaterialName(M)]" + else + temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" + c = min(c,t) + + if (c >= 1) + l += "[D.name][RDSCREEN_NOBREAK]" + if(c >= 5) + l += "x5[RDSCREEN_NOBREAK]" + if(c >= 10) + l += "x10[RDSCREEN_NOBREAK]" + l += "[temp_material][RDSCREEN_NOBREAK]" + else + l += "[D.name][temp_material][RDSCREEN_NOBREAK]" + l += "" + l += "" + return l + +/obj/machinery/computer/rdconsole/proc/ui_protolathe_materials() //Legacy code + RDSCREEN_UI_LATHE_CHECK + var/datum/component/material_container/mat_container = linked_lathe.materials.mat_container + if (!mat_container) + screen = RDSCREEN_PROTOLATHE + return ui_protolathe() + var/list/l = list() + l += ui_protolathe_header() + l += "

    Material Storage:

    " + for(var/mat_id in mat_container.materials) + var/datum/material/M = mat_container.materials[mat_id] + l += "* [M.amount] of [M.name]: " + if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "Eject [RDSCREEN_NOBREAK]" + if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" + if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]" + l += "" + l += "
    [RDSCREEN_NOBREAK]" + return l + +/obj/machinery/computer/rdconsole/proc/ui_protolathe_chemicals() //Legacy code + RDSCREEN_UI_LATHE_CHECK + var/list/l = list() + l += ui_protolathe_header() + l += "
    Disposal All Chemicals in Storage" + l += "

    Chemical Storage:

    " + for(var/datum/reagent/R in linked_lathe.reagents.reagent_list) + l += "[R.name]: [R.volume]" + l += "Purge" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_circuit_header() //Legacy Code + var/list/l = list() + l += "
    Circuit Imprinter Menu" + if (linked_imprinter.materials.mat_container) + l += "Material Amount: [linked_imprinter.materials.format_amount()]" + else + l += "No material storage connected, please contact the quartermaster." + l += "Chemical volume: [linked_imprinter.reagents.total_volume] / [linked_imprinter.reagents.maximum_volume]
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_circuit() //Legacy code + RDSCREEN_UI_IMPRINTER_CHECK + var/list/l = list() + l += ui_circuit_header() + l += "

    Circuit Imprinter Menu:

    " + + l += "
    \ + \ + \ + \ + \ + \ +

    " + + l += list_categories(linked_imprinter.categories, RDSCREEN_IMPRINTER_CATEGORY_VIEW) + return l + +/obj/machinery/computer/rdconsole/proc/ui_circuit_category_view() //Legacy code + RDSCREEN_UI_IMPRINTER_CHECK + var/list/l = list() + l += ui_circuit_header() + l += "

    Browsing [selected_category]:

    " + + for(var/v in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[v] + if(!(selected_category in D.category) || !(D.build_type & IMPRINTER)) + continue + if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags))) + continue + var/temp_materials + var/check_materials = TRUE + + var/all_materials = D.materials + D.reagents_list + var/coeff = linked_imprinter.efficiency_coeff + if(!linked_imprinter.efficient_with(D.build_path)) + coeff = 1 + + for(var/M in all_materials) + temp_materials += " | " + if (!linked_imprinter.check_mat(D, M)) + check_materials = FALSE + temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" + else + temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" + if (check_materials) + l += "[D.name][temp_materials]" + else + l += "[D.name][temp_materials]" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_circuit_search() //Legacy code + RDSCREEN_UI_IMPRINTER_CHECK + var/list/l = list() + l += ui_circuit_header() + l += "

    Search results:

    " + + for(var/datum/design/D in matching_designs) + if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags))) + continue + var/temp_materials + var/check_materials = TRUE + var/all_materials = D.materials + D.reagents_list + var/coeff = linked_imprinter.efficiency_coeff + if(!linked_imprinter.efficient_with(D.build_path)) + coeff = 1 + for(var/M in all_materials) + temp_materials += " | " + if (!linked_imprinter.check_mat(D, M)) + check_materials = FALSE + temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" + else + temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" + if (check_materials) + l += "[D.name][temp_materials]" + else + l += "[D.name][temp_materials]" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_circuit_chemicals() //legacy code + RDSCREEN_UI_IMPRINTER_CHECK + var/list/l = list() + l += ui_circuit_header() + l += "Disposal All Chemicals in Storage
    " + l += "

    Chemical Storage:

    " + for(var/datum/reagent/R in linked_imprinter.reagents.reagent_list) + l += "[R.name]: [R.volume]" + l += "Purge" + return l + +/obj/machinery/computer/rdconsole/proc/ui_circuit_materials() //Legacy code! + RDSCREEN_UI_IMPRINTER_CHECK + var/datum/component/material_container/mat_container = linked_imprinter.materials.mat_container + if (!mat_container) + screen = RDSCREEN_IMPRINTER + return ui_circuit() + var/list/l = list() + l += ui_circuit_header() + l += "

    Material Storage:

    " + for(var/mat_id in mat_container.materials) + var/datum/material/M = mat_container.materials[mat_id] + l += "* [M.amount] of [M.name]: " + if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "Eject [RDSCREEN_NOBREAK]" + if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" + if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_techdisk() //Legacy code + RDSCREEN_UI_TDISK_CHECK + var/list/l = list() + l += "
    Disk Operations: Clear Disk" + l += "Eject Disk" + l += "Upload All" + l += "Load Technology to Disk
    " + l += "

    Stored Technology Nodes:

    " + for(var/i in t_disk.stored_research.researched_nodes) + var/datum/techweb_node/N = t_disk.stored_research.researched_nodes[i] + l += "[N.display_name]" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_designdisk() //Legacy code + RDSCREEN_UI_DDISK_CHECK + var/list/l = list() + l += "Disk Operations: Clear DiskUpload AllEject Disk" + for(var/i in 1 to d_disk.max_blueprints) + l += "
    " + if(d_disk.blueprints[i]) + var/datum/design/D = d_disk.blueprints[i] + l += "[D.name]" + l += "Operations: Upload to database Clear Slot" + else + l += "Empty Slot Operations: Load Design to Slot" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_designdisk_upload() //Legacy code + RDSCREEN_UI_DDISK_CHECK + var/list/l = list() + l += "Return to Disk Operations
    " + l += "

    Load Design to Disk:

    " + for(var/v in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[v] + l += "[D.name] " + l += "Copy to Disk" + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_deconstruct() //Legacy code + RDSCREEN_UI_DECONSTRUCT_CHECK + var/list/l = list() + if(!linked_destroy.loaded_item) + l += "
    No item loaded. Standing-by...
    " + else + l += "
    [RDSCREEN_NOBREAK]" + l += "
    [icon2html(linked_destroy.loaded_item, usr)][linked_destroy.loaded_item.name] Eject
    [RDSCREEN_NOBREAK]" + l += "Select a node to boost by deconstructing this item. This item can boost:" + + var/anything = FALSE + var/list/boostable_nodes = techweb_item_boost_check(linked_destroy.loaded_item) + for(var/id in boostable_nodes) + anything = TRUE + var/list/worth = boostable_nodes[id] + var/datum/techweb_node/N = get_techweb_node_by_id(id) + + l += "
    [RDSCREEN_NOBREAK]" + if (stored_research.researched_nodes[N.id]) // already researched + l += "[N.display_name]" + l += "This node has already been researched." + else if(!length(worth)) // reveal only + if (stored_research.hidden_nodes[N.id]) + l += "[N.display_name]" + l += "This node will be revealed." + else + l += "[N.display_name]" + l += "This node has already been revealed." + else // boost by the difference + var/list/differences = list() + var/list/already_boosted = stored_research.boosted_nodes[N.id] + for(var/i in worth) + var/already_boosted_amount = already_boosted? stored_research.boosted_nodes[N.id][i] : 0 + var/amt = min(worth[i], N.research_costs[i]) - already_boosted_amount + if(amt > 0) + differences[i] = amt + if (length(differences)) + l += "[N.display_name]" + l += "This node will be boosted with the following:
    [techweb_point_display_generic(differences)]" + else + l += "[N.display_name]" + l += "This node has already been boosted." + l += "
    [RDSCREEN_NOBREAK]" + + // point deconstruction and material reclamation use the same ID to prevent accidentally missing the points + var/list/point_values = techweb_item_point_check(linked_destroy.loaded_item) + if(point_values) + anything = TRUE + l += "
    [RDSCREEN_NOBREAK]" + if (stored_research.deconstructed_items[linked_destroy.loaded_item.type]) + l += "Point Deconstruction" + l += "This item's points have already been claimed." + else + l += "Point Deconstruction" + l += "This item is worth:
    [techweb_point_display_generic(point_values)]!" + l += "
    [RDSCREEN_NOBREAK]" + + if(!(linked_destroy.loaded_item.resistance_flags & INDESTRUCTIBLE)) + var/list/materials = linked_destroy.loaded_item.materials + l += "
    [materials.len? "Material Reclamation" : "Destroy Item"]" + for (var/M in materials) + l += "* [CallMaterialName(M)] x [materials[M]]" + l += "
    [RDSCREEN_NOBREAK]" + anything = TRUE + + if (!anything) + l += "Nothing!" + + l += "
    " + return l + +/obj/machinery/computer/rdconsole/proc/ui_techweb() + var/list/l = list() + if(islist(stored_research.research_logs) && stored_research.research_logs.len) + l += "Last action: [stored_research.research_logs[stored_research.research_logs.len]]" + if(ui_mode != RDCONSOLE_UI_MODE_LIST) + var/list/columns = list() + var/max_tier = 0 + for (var/node_ in stored_research.tiers) + var/datum/techweb_node/node = node_ + var/tier = stored_research.tiers[node] + LAZYINITLIST(columns["[tier]"]) // String hackery to make the numbers associative + columns["[tier]"] += ui_techweb_single_node(node, minimal=(tier != 1)) + max_tier = max(max_tier, tier) + + l += "[RDSCREEN_NOBREAK]" + for(var/tier in 0 to max_tier) + l += "[RDSCREEN_NOBREAK]" + l += "
    ResearchedAvailableFuture
    [RDSCREEN_NOBREAK]" + l += columns["[tier]"] + l += "
    [RDSCREEN_NOBREAK]" + else + var/list/avail = list() //This could probably be optimized a bit later. + var/list/unavail = list() + var/list/res = list() + for(var/v in stored_research.researched_nodes) + res += stored_research.researched_nodes[v] + for(var/v in stored_research.available_nodes) + if(stored_research.researched_nodes[v]) + continue + avail += stored_research.available_nodes[v] + for(var/v in stored_research.visible_nodes) + if(stored_research.available_nodes[v]) + continue + unavail += stored_research.visible_nodes[v] + l += "

    Technology Nodes:

    [RDSCREEN_NOBREAK]" + l += "

    Available for Research:

    " + for(var/datum/techweb_node/N in avail) + var/not_unlocked = (stored_research.available_nodes[N.id] && !stored_research.researched_nodes[N.id]) + var/has_points = (stored_research.can_afford(N.get_price(stored_research))) + var/research_href = not_unlocked? (has_points? "Research" : "Not Enough Points") : null + l += "[N.display_name][research_href]" + l += "

    Locked Nodes:

    " + for(var/datum/techweb_node/N in unavail) + l += "[N.display_name]" + l += "

    Researched Nodes:

    " + for(var/datum/techweb_node/N in res) + l += "[N.display_name]" + l += "
    [RDSCREEN_NOBREAK]" + return l + +/obj/machinery/computer/rdconsole/proc/machine_icon(atom/item) + return icon2html(initial(item.icon), usr, initial(item.icon_state), SOUTH) + +/obj/machinery/computer/rdconsole/proc/ui_techweb_single_node(datum/techweb_node/node, selflink=TRUE, minimal=FALSE) + var/list/l = list() + if (stored_research.hidden_nodes[node.id]) + return l + var/display_name = node.display_name + if (selflink) + display_name = "[display_name]" + l += "
    [display_name] [RDSCREEN_NOBREAK]" + if(minimal) + l += "
    [node.description]" + else + if(stored_research.researched_nodes[node.id]) + l += "Researched" + else if(stored_research.available_nodes[node.id]) + if(stored_research.can_afford(node.get_price(stored_research))) + l += "
    [node.price_display(stored_research)]" + else + l += "
    [node.price_display(stored_research)]" // gray - too expensive + else + l += "
    [node.price_display(stored_research)]" // red - missing prereqs + if(ui_mode == RDCONSOLE_UI_MODE_NORMAL) + l += "[node.description]" + for(var/i in node.designs) + var/datum/design/D = node.designs[i] + l += "[D.icon_html(usr)][RDSCREEN_NOBREAK]" + l += "
    [RDSCREEN_NOBREAK]" + return l + +/obj/machinery/computer/rdconsole/proc/ui_techweb_nodeview() + RDSCREEN_UI_SNODE_CHECK + var/list/l = list() + if(stored_research.hidden_nodes[selected_node.id]) + l += "

    ERROR: RESEARCH NODE UNKNOWN.

    " + return + + l += "[RDSCREEN_NOBREAK]" + if (length(selected_node.prerequisites)) + l += "[RDSCREEN_NOBREAK]" + l += "[RDSCREEN_NOBREAK]" + if (length(selected_node.unlocks)) + l += "[RDSCREEN_NOBREAK]" + + l += "[RDSCREEN_NOBREAK]" + if (length(selected_node.prerequisites)) + l += "[RDSCREEN_NOBREAK]" + l += "[RDSCREEN_NOBREAK]" + if (length(selected_node.unlocks)) + l += "[RDSCREEN_NOBREAK]" + + l += "
    RequiresCurrent NodeUnlocks
    [RDSCREEN_NOBREAK]" + for (var/i in selected_node.prerequisites) + l += ui_techweb_single_node(selected_node.prerequisites[i]) + l += "[RDSCREEN_NOBREAK]" + l += ui_techweb_single_node(selected_node, selflink=FALSE) + l += "[RDSCREEN_NOBREAK]" + for (var/i in selected_node.unlocks) + l += ui_techweb_single_node(selected_node.unlocks[i]) + l += "
    [RDSCREEN_NOBREAK]" + return l + +/obj/machinery/computer/rdconsole/proc/ui_techweb_designview() //Legacy code + RDSCREEN_UI_SDESIGN_CHECK + var/list/l = list() + var/datum/design/D = selected_design + l += "
    [D.icon_html(usr)][D.name]
    [RDSCREEN_NOBREAK]" + if(D.build_type) + var/lathes = list() + if(D.build_type & IMPRINTER) + lathes += "[machine_icon(/obj/machinery/rnd/production/circuit_imprinter)][RDSCREEN_NOBREAK]" + if (linked_imprinter && D.id in stored_research.researched_designs) + l += "Imprint" + if(D.build_type & PROTOLATHE) + lathes += "[machine_icon(/obj/machinery/rnd/production/protolathe)][RDSCREEN_NOBREAK]" + if (linked_lathe && D.id in stored_research.researched_designs) + l += "Construct" + if(D.build_type & AUTOLATHE) + lathes += "[machine_icon(/obj/machinery/autolathe)][RDSCREEN_NOBREAK]" + if(D.build_type & MECHFAB) + lathes += "[machine_icon(/obj/machinery/mecha_part_fabricator)][RDSCREEN_NOBREAK]" + if(D.build_type & BIOGENERATOR) + lathes += "[machine_icon(/obj/machinery/biogenerator)][RDSCREEN_NOBREAK]" + if(D.build_type & LIMBGROWER) + lathes += "[machine_icon(/obj/machinery/limbgrower)][RDSCREEN_NOBREAK]" + if(D.build_type & SMELTER) + lathes += "[machine_icon(/obj/machinery/mineral/processing_unit)][RDSCREEN_NOBREAK]" + l += "Construction types:" + l += lathes + l += "" + l += "Required materials:" + var/all_mats = D.materials + D.reagents_list + for(var/M in all_mats) + l += "* [CallMaterialName(M)] x [all_mats[M]]" + l += "Unlocked by:" + for (var/node in D.unlocked_by) + l += ui_techweb_single_node(node) + l += "[RDSCREEN_NOBREAK]
    " + return l + +//Fuck TGUI. +/obj/machinery/computer/rdconsole/proc/generate_ui() + var/list/ui = list() + ui += ui_header() + if(locked) + ui += ui_locked() + else + switch(screen) + if(RDSCREEN_MENU) + ui += ui_main_menu() + if(RDSCREEN_TECHWEB) + ui += ui_techweb() + if(RDSCREEN_TECHWEB_NODEVIEW) + ui += ui_techweb_nodeview() + if(RDSCREEN_TECHWEB_DESIGNVIEW) + ui += ui_techweb_designview() + if(RDSCREEN_DESIGNDISK) + ui += ui_designdisk() + if(RDSCREEN_DESIGNDISK_UPLOAD) + ui += ui_designdisk_upload() + if(RDSCREEN_TECHDISK) + ui += ui_techdisk() + if(RDSCREEN_DECONSTRUCT) + ui += ui_deconstruct() + if(RDSCREEN_PROTOLATHE) + ui += ui_protolathe() + if(RDSCREEN_PROTOLATHE_CATEGORY_VIEW) + ui += ui_protolathe_category_view() + if(RDSCREEN_PROTOLATHE_MATERIALS) + ui += ui_protolathe_materials() + if(RDSCREEN_PROTOLATHE_CHEMICALS) + ui += ui_protolathe_chemicals() + if(RDSCREEN_PROTOLATHE_SEARCH) + ui += ui_protolathe_search() + if(RDSCREEN_IMPRINTER) + ui += ui_circuit() + if(RDSCREEN_IMPRINTER_CATEGORY_VIEW) + ui += ui_circuit_category_view() + if(RDSCREEN_IMPRINTER_MATERIALS) + ui += ui_circuit_materials() + if(RDSCREEN_IMPRINTER_CHEMICALS) + ui += ui_circuit_chemicals() + if(RDSCREEN_IMPRINTER_SEARCH) + ui += ui_circuit_search() + if(RDSCREEN_SETTINGS) + ui += ui_settings() + if(RDSCREEN_DEVICE_LINKING) + ui += ui_device_linking() + for(var/i in 1 to length(ui)) + if(!findtextEx(ui[i], RDSCREEN_NOBREAK)) + ui[i] += "
    " + ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "") + return ui.Join("") + +/obj/machinery/computer/rdconsole/Topic(raw, ls) + if(..()) + return + add_fingerprint(usr) + usr.set_machine(src) + if(ls["switch_screen"]) + back = screen + screen = text2num(ls["switch_screen"]) + if(ls["ui_mode"]) + ui_mode = text2num(ls["ui_mode"]) + if(ls["lock_console"]) + if(obj_flags & EMAGGED) + to_chat(usr, "Security protocol error: Unable to lock.") + return + if(allowed(usr)) + lock_console(usr) + else + to_chat(usr, "Unauthorized Access.") + if(ls["unlock_console"]) + if(allowed(usr)) + unlock_console(usr) + else + to_chat(usr, "Unauthorized Access.") + if(ls["find_device"]) + SyncRDevices() + say("Resynced with nearby devices.") + if(ls["back_screen"]) + back = text2num(ls["back_screen"]) + if(ls["build"]) //Causes the Protolathe to build something. + if(QDELETED(linked_lathe)) + say("No Protolathe Linked!") + return + if(linked_lathe.busy) + say("Warning: Protolathe busy!") + else + linked_lathe.user_try_print_id(ls["build"], ls["amount"]) + if(ls["imprint"]) + if(QDELETED(linked_imprinter)) + say("No Circuit Imprinter Linked!") + return + if(linked_imprinter.busy) + say("Warning: Imprinter busy!") + else + linked_imprinter.user_try_print_id(ls["imprint"]) + if(ls["category"]) + selected_category = ls["category"] + if(ls["disconnect"]) //The R&D console disconnects with a specific device. + switch(ls["disconnect"]) + if("destroy") + if(QDELETED(linked_destroy)) + say("No Destructive Analyzer Linked!") + return + linked_destroy.linked_console = null + linked_destroy = null + if("lathe") + if(QDELETED(linked_lathe)) + say("No Protolathe Linked!") + return + linked_lathe.linked_console = null + linked_lathe = null + if("imprinter") + if(QDELETED(linked_imprinter)) + say("No Circuit Imprinter Linked!") + return + linked_imprinter.linked_console = null + linked_imprinter = null + if(ls["eject_design"]) //Eject the design disk. + eject_disk("design") + screen = RDSCREEN_MENU + say("Ejecting Design Disk") + if(ls["eject_tech"]) //Eject the technology disk. + eject_disk("tech") + screen = RDSCREEN_MENU + say("Ejecting Technology Disk") + if(ls["deconstruct"]) + if(QDELETED(linked_destroy)) + say("No Destructive Analyzer Linked!") + return + if(!linked_destroy.user_try_decon_id(ls["deconstruct"], usr)) + say("Destructive analysis failed!") + //Protolathe Materials + if(ls["disposeP"]) //Causes the protolathe to dispose of a single reagent (all of it) + if(QDELETED(linked_lathe)) + say("No Protolathe Linked!") + return + linked_lathe.reagents.del_reagent(ls["disposeP"]) + if(ls["disposeallP"]) //Causes the protolathe to dispose of all it's reagents. + if(QDELETED(linked_lathe)) + say("No Protolathe Linked!") + return + linked_lathe.reagents.clear_reagents() + if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material + if(QDELETED(linked_lathe)) + say("No Protolathe Linked!") + return + if(!linked_lathe.materials.mat_container) + say("No material storage linked to protolathe!") + return + linked_lathe.eject_sheets(ls["ejectsheet"], ls["eject_amt"]) + //Circuit Imprinter Materials + if(ls["disposeI"]) //Causes the circuit imprinter to dispose of a single reagent (all of it) + if(QDELETED(linked_imprinter)) + say("No Circuit Imprinter Linked!") + return + linked_imprinter.reagents.del_reagent(ls["disposeI"]) + if(ls["disposeallI"]) //Causes the circuit imprinter to dispose of all it's reagents. + if(QDELETED(linked_imprinter)) + say("No Circuit Imprinter Linked!") + return + linked_imprinter.reagents.clear_reagents() + if(ls["imprinter_ejectsheet"]) //Causes the imprinter to eject a sheet of material + if(QDELETED(linked_imprinter)) + say("No Circuit Imprinter Linked!") + return + if(!linked_imprinter.materials.mat_container) + say("No material storage linked to circuit imprinter!") + return + linked_imprinter.eject_sheets(ls["imprinter_ejectsheet"], ls["eject_amt"]) + if(ls["disk_slot"]) + disk_slot_selected = text2num(ls["disk_slot"]) + if(ls["research_node"]) + if(!research_control) + return //honestly should call them out for href exploiting :^) + if(!SSresearch.science_tech.available_nodes[ls["research_node"]]) + return //Nope! + research_node(ls["research_node"], usr) + if(ls["clear_tech"]) //Erase la on the technology disk. + if(QDELETED(t_disk)) + say("No Technology Disk Inserted!") + return + qdel(t_disk.stored_research) + t_disk.stored_research = new + say("Wiping technology disk.") + if(ls["copy_tech"]) //Copy some technology la from the research holder to the disk. + if(QDELETED(t_disk)) + say("No Technology Disk Inserted!") + return + stored_research.copy_research_to(t_disk.stored_research) + screen = RDSCREEN_TECHDISK + say("Downloading to technology disk.") + if(ls["clear_design"]) //Erases la on the design disk. + if(QDELETED(d_disk)) + say("No Design Disk Inserted!") + return + var/n = text2num(ls["clear_design"]) + if(!n) + for(var/i in 1 to d_disk.max_blueprints) + d_disk.blueprints[i] = null + say("Wiping design disk.") + else + var/datum/design/D = d_disk.blueprints[n] + say("Wiping design [D.name] from design disk.") + d_disk.blueprints[n] = null + if(ls["search"]) //Search for designs with name matching pattern + searchstring = ls["to_search"] + searchtype = ls["type"] + rescan_views() + if(searchtype == "proto") + screen = RDSCREEN_PROTOLATHE_SEARCH + else + screen = RDSCREEN_IMPRINTER_SEARCH + if(ls["updt_tech"]) //Uple the research holder with information from the technology disk. + if(QDELETED(t_disk)) + say("No Technology Disk Inserted!") + return + say("Uploading technology disk.") + t_disk.stored_research.copy_research_to(stored_research) + if(ls["copy_design"]) //Copy design la from the research holder to the design disk. + if(QDELETED(d_disk)) + say("No Design Disk Inserted!") + return + var/slot = text2num(ls["copy_design"]) + var/datum/design/D = stored_research.researched_designs[ls["copy_design_ID"]] + if(D) + var/autolathe_friendly = TRUE + if(D.reagents_list.len) + autolathe_friendly = FALSE + D.category -= "Imported" + else + for(var/x in D.materials) + if( !(x in list(MAT_METAL, MAT_GLASS))) + autolathe_friendly = FALSE + D.category -= "Imported" + + if(D.build_type & (AUTOLATHE|PROTOLATHE|CRAFTLATHE)) // Specifically excludes circuit imprinter and mechfab + D.build_type = autolathe_friendly ? (D.build_type | AUTOLATHE) : D.build_type + D.category |= "Imported" + d_disk.blueprints[slot] = D + screen = RDSCREEN_DESIGNDISK + if(ls["eject_item"]) //Eject the item inside the destructive analyzer. + if(QDELETED(linked_destroy)) + say("No Destructive Analyzer Linked!") + return + if(linked_destroy.busy) + to_chat(usr, "The destructive analyzer is busy at the moment.") + else if(linked_destroy.loaded_item) + linked_destroy.unload_item() + screen = RDSCREEN_MENU + if(ls["view_node"]) + selected_node = SSresearch.techweb_nodes[ls["view_node"]] + screen = RDSCREEN_TECHWEB_NODEVIEW + if(ls["view_design"]) + selected_design = SSresearch.techweb_designs[ls["view_design"]] + screen = RDSCREEN_TECHWEB_DESIGNVIEW + if(ls["updt_design"]) //Uples the research holder with design la from the design disk. + if(QDELETED(d_disk)) + say("No design disk found.") + return + var/n = text2num(ls["updt_design"]) + if(!n) + for(var/D in d_disk.blueprints) + if(D) + stored_research.add_design(D) + else + stored_research.add_design(d_disk.blueprints[n]) + + updateUsrDialog() + +/obj/machinery/computer/rdconsole/ui_interact(mob/user) + . = ..() + var/datum/browser/popup = new(user, "rndconsole", name, 900, 600) + popup.add_stylesheet("techwebs", 'html/browser/techwebs.css') + popup.set_content(generate_ui()) + popup.open() + +/obj/machinery/computer/rdconsole/proc/tdisk_uple_complete() + tdisk_uple = FALSE + updateUsrDialog() + +/obj/machinery/computer/rdconsole/proc/ddisk_uple_complete() + ddisk_uple = FALSE + updateUsrDialog() + +/obj/machinery/computer/rdconsole/proc/eject_disk(type) + if(type == "design") + d_disk.forceMove(get_turf(src)) + d_disk = null + if(type == "tech") + t_disk.forceMove(get_turf(src)) + t_disk = null + +/obj/machinery/computer/rdconsole/proc/rescan_views() + var/compare + matching_designs.Cut() + if(searchtype == "proto") + compare = PROTOLATHE + else if(searchtype == "imprint") + compare = IMPRINTER + for(var/v in stored_research.researched_designs) + var/datum/design/D = stored_research.researched_designs[v] + if(!(D.build_type & compare)) + continue + if(findtext(D.name,searchstring)) + matching_designs.Add(D) + +/obj/machinery/computer/rdconsole/proc/check_canprint(datum/design/D, buildtype) + var/amount = 50 + if(buildtype == IMPRINTER) + if(QDELETED(linked_imprinter)) + return FALSE + for(var/M in D.materials + D.reagents_list) + amount = min(amount, linked_imprinter.check_mat(D, M)) + if(amount < 1) + return FALSE + else if(buildtype == PROTOLATHE) + if(QDELETED(linked_lathe)) + return FALSE + for(var/M in D.materials + D.reagents_list) + amount = min(amount, linked_lathe.check_mat(D, M)) + if(amount < 1) + return FALSE + else + return FALSE + return amount + +/obj/machinery/computer/rdconsole/proc/lock_console(mob/user) + locked = TRUE + +/obj/machinery/computer/rdconsole/proc/unlock_console(mob/user) + locked = FALSE + +/obj/machinery/computer/rdconsole/robotics + name = "Robotics R&D Console" + req_access = null + req_access_txt = "29" + +/obj/machinery/computer/rdconsole/robotics/Initialize() + . = ..() + if(circuit) + circuit.name = "R&D Console - Robotics (Computer Board)" + circuit.build_path = /obj/machinery/computer/rdconsole/robotics + +/obj/machinery/computer/rdconsole/core + name = "Core R&D Console" + +/obj/machinery/computer/rdconsole/experiment + name = "E.X.P.E.R.I-MENTOR R&D Console" diff --git a/code/modules/research/xenobiology/crossbreeding/__corecross.dm b/code/modules/research/xenobiology/crossbreeding/__corecross.dm index 1146f01f..17a6b77b 100644 --- a/code/modules/research/xenobiology/crossbreeding/__corecross.dm +++ b/code/modules/research/xenobiology/crossbreeding/__corecross.dm @@ -114,19 +114,19 @@ To add a crossbreed: name = "blood extract" desc = "A sphere of liquid blood, somehow managing to stay together." color = "#FF0000" - list_reagents = list("blood" = 50) + list_reagents = list(/datum/reagent/blood = 50) /obj/item/slimecrossbeaker/pax //5u synthpax. name = "peace-inducing extract" desc = "A small blob of synthetic pax." color = "#FFCCCC" - list_reagents = list("synthpax" = 5) + list_reagents = list(/datum/reagent/pax/peaceborg = 5) /obj/item/slimecrossbeaker/omnizine //15u omnizine. name = "healing extract" desc = "A gelatinous extract of pure omnizine." color = "#FF00FF" - list_reagents = list("omnizine" = 15) + list_reagents = list(/datum/reagent/medicine/omnizine = 15) /obj/item/slimecrossbeaker/autoinjector //As with the above, but automatically injects whomever it is used on with contents. var/ignore_flags = FALSE @@ -160,7 +160,7 @@ To add a crossbreed: name = "mending solution" desc = "A strange glob of sweet-smelling semifluid, which seems to stick to skin rather easily." color = "#FF00FF" - list_reagents = list("regen_jelly" = 20) + list_reagents = list(/datum/reagent/medicine/regen_jelly = 20) /obj/item/slimecrossbeaker/autoinjector/slimejelly //Primarily for slimepeople, but you do you. self_use_only = TRUE @@ -168,13 +168,13 @@ To add a crossbreed: name = "slime jelly bubble" desc = "A sphere of slime jelly. It seems to stick to your skin, but avoids other surfaces." color = "#00FF00" - list_reagents = list("slimejelly" = 50) + list_reagents = list(/datum/reagent/toxin/slimejelly = 50) /obj/item/slimecrossbeaker/autoinjector/peaceandlove name = "peaceful distillation" desc = "A light pink gooey sphere. Simply touching it makes you a little dizzy." color = "#DDAAAA" - list_reagents = list("synthpax" = 10, "space_drugs" = 15) //Peace, dudes + list_reagents = list(/datum/reagent/pax/peaceborg = 10, /datum/reagent/drug/space_drugs = 15) //Peace, dudes /obj/item/slimecrossbeaker/autoinjector/peaceandlove/Initialize() . = ..() @@ -184,4 +184,4 @@ To add a crossbreed: name = "invigorating gel" desc = "A bubbling purple mixture, designed to heal and boost movement." color = "#FF00FF" - list_reagents = list("regen_jelly" = 30, "methamphetamine" = 9) + list_reagents = list(/datum/reagent/medicine/regen_jelly = 30, /datum/reagent/drug/methamphetamine = 9) diff --git a/code/modules/research/xenobiology/crossbreeding/_misc.dm b/code/modules/research/xenobiology/crossbreeding/_misc.dm index 0099fe14..4684352e 100644 --- a/code/modules/research/xenobiology/crossbreeding/_misc.dm +++ b/code/modules/research/xenobiology/crossbreeding/_misc.dm @@ -50,7 +50,7 @@ filling_color = "#964B00" tastes = list("cardboard" = 3, "sadness" = 3) foodtype = null //Don't ask what went into them. You're better off not knowing. - list_reagents = list("stabilizednutriment" = 10, "nutriment" = 2) //Won't make you fat. Will make you question your sanity. + list_reagents = list(/datum/reagent/consumable/nutriment/stabilized = 10, /datum/reagent/consumable/nutriment = 2) //Won't make you fat. Will make you question your sanity. /obj/item/reagent_containers/food/snacks/rationpack/checkLiked(fraction, mob/M) //Nobody likes rationpacks. Nobody. if(last_check_time + 50 < world.time) diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 2b803b2a..eba26ad2 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -922,9 +922,9 @@ datum/status_effect/stabilized/blue/on_remove() /datum/status_effect/stabilized/lightpink/tick() for(var/mob/living/carbon/human/H in range(1, get_turf(owner))) - if(H != owner && H.stat != DEAD && H.health <= 0 && !H.reagents.has_reagent("epinephrine")) + if(H != owner && H.stat != DEAD && H.health <= 0 && !H.reagents.has_reagent(/datum/reagent/medicine/epinephrine)) to_chat(owner, "[linked_extract] pulses in sync with [H]'s heartbeat, trying to keep [H.p_them()] alive.") - H.reagents.add_reagent("epinephrine",5) + H.reagents.add_reagent(/datum/reagent/medicine/epinephrine,5) return ..() /datum/status_effect/stabilized/lightpink/on_remove() diff --git a/code/modules/research/xenobiology/crossbreeding/burning.dm b/code/modules/research/xenobiology/crossbreeding/burning.dm index 363331e1..e5b30962 100644 --- a/code/modules/research/xenobiology/crossbreeding/burning.dm +++ b/code/modules/research/xenobiology/crossbreeding/burning.dm @@ -14,10 +14,10 @@ Burning extracts: create_reagents(10, INJECTABLE | DRAWABLE) /obj/item/slimecross/burning/attack_self(mob/user) - if(!reagents.has_reagent("plasma",10)) + if(!reagents.has_reagent(/datum/reagent/toxin/plasma,10)) to_chat(user, "This extract needs to be full of plasma to activate!") return - reagents.remove_reagent("plasma",10) + reagents.remove_reagent(/datum/reagent/toxin/plasma,10) to_chat(user, "You squeeze the extract, and it absorbs the plasma!") playsound(src, 'sound/effects/bubbles.ogg', 50, 1) playsound(src, 'sound/magic/fireball.ogg', 50, 1) @@ -44,7 +44,7 @@ Burning extracts: /obj/item/slimecross/burning/orange/do_effect(mob/user) user.visible_message("[src] boils over with a caustic gas!") var/datum/reagents/R = new/datum/reagents(100) - R.add_reagent("condensedcapsaicin", 100) + R.add_reagent(/datum/reagent/consumable/condensedcapsaicin, 100) var/datum/effect_system/smoke_spread/chem/smoke = new smoke.set_up(R, 7, get_turf(user)) @@ -113,8 +113,8 @@ Burning extracts: /obj/item/slimecross/burning/darkblue/do_effect(mob/user) user.visible_message("[src] releases a burst of chilling smoke!") var/datum/reagents/R = new/datum/reagents(100) - R.add_reagent("frostoil", 40) - user.reagents.add_reagent("cryoxadone",10) + R.add_reagent(/datum/reagent/consumable/frostoil, 40) + user.reagents.add_reagent(/datum/reagent/medicine/cryoxadone,10) var/datum/effect_system/smoke_spread/chem/smoke = new smoke.set_up(R, 7, get_turf(user)) smoke.start() @@ -131,7 +131,7 @@ Burning extracts: for(var/i = 0, i < amount, i++) var/path = get_random_food() var/obj/item/O = new path(pick(turfs)) - O.reagents.add_reagent("slimejelly",5) //Oh god it burns + O.reagents.add_reagent(/datum/reagent/toxin/slimejelly, 5) //Oh god it burns if(prob(50)) O.desc += " It smells strange..." user.visible_message("[src] produces a few pieces of food!") @@ -268,7 +268,7 @@ Burning extracts: /obj/item/slimecross/burning/lightpink/do_effect(mob/user) user.visible_message("[src] lets off a hypnotizing pink glow!") for(var/mob/living/carbon/C in view(7, get_turf(user))) - C.reagents.add_reagent("pax",5) + C.reagents.add_reagent(/datum/reagent/pax, 5) ..() /obj/item/slimecross/burning/adamantine diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm index 7b5fe9e8..75a15be9 100644 --- a/code/modules/research/xenobiology/crossbreeding/charged.dm +++ b/code/modules/research/xenobiology/crossbreeding/charged.dm @@ -15,10 +15,10 @@ Charged extracts: create_reagents(10, INJECTABLE | DRAWABLE) /obj/item/slimecross/charged/attack_self(mob/user) - if(!reagents.has_reagent("plasma",10)) + if(!reagents.has_reagent(/datum/reagent/toxin/plasma,10)) to_chat(user, "This extract needs to be full of plasma to activate!") return - reagents.remove_reagent("plasma",10) + reagents.remove_reagent(/datum/reagent/toxin/plasma,10) to_chat(user, "You squeeze the extract, and it absorbs the plasma!") playsound(src, 'sound/effects/bubbles.ogg', 50, 1) playsound(src, 'sound/effects/light_flicker.ogg', 50, 1) diff --git a/code/modules/research/xenobiology/crossbreeding/chilling.dm b/code/modules/research/xenobiology/crossbreeding/chilling.dm index ff55a87d..1405bbad 100644 --- a/code/modules/research/xenobiology/crossbreeding/chilling.dm +++ b/code/modules/research/xenobiology/crossbreeding/chilling.dm @@ -14,10 +14,10 @@ Chilling extracts: create_reagents(10, INJECTABLE | DRAWABLE) /obj/item/slimecross/chilling/attack_self(mob/user) - if(!reagents.has_reagent("plasma",10)) + if(!reagents.has_reagent(/datum/reagent/toxin/plasma,10)) to_chat(user, "This extract needs to be full of plasma to activate!") return - reagents.remove_reagent("plasma",10) + reagents.remove_reagent(/datum/reagent/toxin/plasma,10) to_chat(user, "You squeeze the extract, and it absorbs the plasma!") playsound(src, 'sound/effects/bubbles.ogg', 50, 1) playsound(src, 'sound/effects/glassbr1.ogg', 50, 1) @@ -56,7 +56,7 @@ Chilling extracts: return user.visible_message("[src] shatters, and a healing aura fills the room briefly.") for(var/mob/living/carbon/C in A) - C.reagents.add_reagent("regen_jelly",10) + C.reagents.add_reagent(/datum/reagent/medicine/regen_jelly,10) ..() /obj/item/slimecross/chilling/blue diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index d6536f4f..0e8bf1e1 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -20,7 +20,7 @@ Consuming extracts: if(last_produced + cooldown > world.time) to_chat(user, "[src] is still digesting after its last meal!") return - var/datum/reagent/N = O.reagents.has_reagent("nutriment") + var/datum/reagent/N = O.reagents.has_reagent(/datum/reagent/consumable/nutriment) if(N) nutriment_eaten += N.volume to_chat(user, "[src] opens up and swallows [O] whole!") @@ -73,7 +73,7 @@ Consuming extracts: to_chat(M, "Tastes like [taste].") playsound(get_turf(M), 'sound/items/eatfood.ogg', 20, 1) if(nutrition) - M.reagents.add_reagent("nutriment",nutrition) + M.reagents.add_reagent(/datum/reagent/consumable/nutriment,nutrition) do_effect(M, user) qdel(src) return @@ -199,7 +199,7 @@ Consuming extracts: nutrition = 0 //We don't want normal nutriment /obj/item/slime_cookie/silver/do_effect(mob/living/M, mob/user) - M.reagents.add_reagent("stabilizednutriment",10) + M.reagents.add_reagent(/datum/reagent/consumable/nutriment/stabilized, 10) /obj/item/slimecross/consuming/bluespace colour = "bluespace" diff --git a/code/modules/research/xenobiology/crossbreeding/industrial.dm b/code/modules/research/xenobiology/crossbreeding/industrial.dm index a21fddb6..bec2c2c1 100644 --- a/code/modules/research/xenobiology/crossbreeding/industrial.dm +++ b/code/modules/research/xenobiology/crossbreeding/industrial.dm @@ -30,13 +30,13 @@ Industrial extracts: /obj/item/slimecross/industrial/process() var/IsWorking = FALSE - if(reagents.has_reagent("plasma",amount = 2) && plasmarequired > 1) //Can absorb as much as 2 + if(reagents.has_reagent(/datum/reagent/toxin/plasma,amount = 2) && plasmarequired > 1) //Can absorb as much as 2 IsWorking = TRUE - reagents.remove_reagent("plasma",2) + reagents.remove_reagent(/datum/reagent/toxin/plasma,2) plasmaabsorbed += 2 - else if(reagents.has_reagent("plasma",amount = 1)) //Can absorb as little as 1 + else if(reagents.has_reagent(/datum/reagent/toxin/plasma,amount = 1)) //Can absorb as little as 1 IsWorking = TRUE - reagents.remove_reagent("plasma",1) + reagents.remove_reagent(/datum/reagent/toxin/plasma,1) plasmaabsorbed += 1 if(plasmaabsorbed >= plasmarequired) diff --git a/code/modules/research/xenobiology/crossbreeding/regenerative.dm b/code/modules/research/xenobiology/crossbreeding/regenerative.dm index 6c7ea102..55865d1a 100644 --- a/code/modules/research/xenobiology/crossbreeding/regenerative.dm +++ b/code/modules/research/xenobiology/crossbreeding/regenerative.dm @@ -51,7 +51,7 @@ Regenerative extracts: colour = "purple" /obj/item/slimecross/regenerative/purple/core_effect(mob/living/target, mob/user) - target.reagents.add_reagent("regen_jelly",10) + target.reagents.add_reagent(/datum/reagent/medicine/regen_jelly,10) /obj/item/slimecross/regenerative/blue colour = "blue" @@ -174,7 +174,7 @@ Regenerative extracts: /obj/item/slimecross/regenerative/red/core_effect(mob/living/target, mob/user) to_chat(target, "You feel... faster.") - target.reagents.add_reagent("ephedrine",3) + target.reagents.add_reagent(/datum/reagent/medicine/ephedrine,3) /obj/item/slimecross/regenerative/green colour = "green" @@ -185,7 +185,7 @@ Regenerative extracts: var/mob/living/simple_animal/slime/S = target S.random_colour() if(isjellyperson(target)) - target.reagents.add_reagent("slime_toxin",5) + target.reagents.add_reagent(/datum/reagent/slime_toxin,5) /obj/item/slimecross/regenerative/pink @@ -193,7 +193,7 @@ Regenerative extracts: /obj/item/slimecross/regenerative/pink/core_effect(mob/living/target, mob/user) to_chat(target, "You feel more calm.") - target.reagents.add_reagent("krokodil",4) + target.reagents.add_reagent(/datum/reagent/drug/krokodil,4) /obj/item/slimecross/regenerative/gold colour = "gold" diff --git a/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm b/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm index 0b27b1e2..914c5e54 100644 --- a/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm +++ b/code/modules/research/xenobiology/crossbreeding/selfsustaining.dm @@ -41,10 +41,10 @@ Self-sustaining extracts: return if(reagentselect == "lesser plasma") amount = 4 - reagentselect = "plasma" + reagentselect = /datum/reagent/toxin/plasma if(reagentselect == "holy water and uranium") - reagentselect = "holywater" - secondary = "uranium" + reagentselect = /datum/reagent/water/holywater + secondary = /datum/reagent/uranium extract.forceMove(user.drop_location()) qdel(src) user.put_in_active_hand(extract) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 7fe7fc97..96dd104e 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -42,7 +42,7 @@ /obj/item/slime_extract/on_grind() if(Uses) - grind_results["slimejelly"] = 20 + grind_results[/datum/reagent/toxin/slimejelly] = 20 //Effect when activated by a Luminescent. Separated into a minor and major effect. Returns cooldown in deciseconds. /obj/item/slime_extract/proc/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) @@ -78,7 +78,7 @@ name = "grey slime extract" icon_state = "grey slime extract" effectmod = "reproductive" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood,/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/grey/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -103,7 +103,7 @@ name = "gold slime extract" icon_state = "gold slime extract" effectmod = "symbiont" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood,/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/gold/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -132,7 +132,7 @@ name = "silver slime extract" icon_state = "silver slime extract" effectmod = "consuming" - activate_reagents = list("plasma","water") + activate_reagents = list(/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/silver/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -157,7 +157,7 @@ name = "metal slime extract" icon_state = "metal slime extract" effectmod = "industrial" - activate_reagents = list("plasma","water") + activate_reagents = list(/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/metal/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -181,7 +181,7 @@ name = "purple slime extract" icon_state = "purple slime extract" effectmod = "regenerative" - activate_reagents = list("blood","plasma") + activate_reagents = list(/datum/reagent/blood,/datum/reagent/toxin/plasma) /obj/item/slime_extract/purple/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -193,14 +193,14 @@ if(SLIME_ACTIVATE_MAJOR) to_chat(user, "You activate [src], and it releases regenerative chemicals!") - user.reagents.add_reagent("regen_jelly",10) + user.reagents.add_reagent(/datum/reagent/medicine/regen_jelly,10) return 600 /obj/item/slime_extract/darkpurple name = "dark purple slime extract" icon_state = "dark purple slime extract" effectmod = "self-sustaining" - activate_reagents = list("plasma") + activate_reagents = list(/datum/reagent/toxin/plasma) /obj/item/slime_extract/darkpurple/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -223,19 +223,19 @@ name = "orange slime extract" icon_state = "orange slime extract" effectmod = "burning" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood,/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/orange/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) if(SLIME_ACTIVATE_MINOR) to_chat(user, "You activate [src]. You start feeling hot!") - user.reagents.add_reagent("capsaicin",10) + user.reagents.add_reagent(/datum/reagent/consumable/capsaicin,10) return 150 if(SLIME_ACTIVATE_MAJOR) - user.reagents.add_reagent("phosphorus",5)// - user.reagents.add_reagent("potassium",5) // = smoke, along with any reagents inside mr. slime - user.reagents.add_reagent("sugar",5) // + user.reagents.add_reagent(/datum/reagent/phosphorus,5) + user.reagents.add_reagent(/datum/reagent/potassium,5) // = smoke, along with any reagents inside mr. slime + user.reagents.add_reagent(/datum/reagent/consumable/sugar,5) to_chat(user, "You activate [src], and a cloud of smoke bursts out of your skin!") return 450 @@ -243,7 +243,7 @@ name = "yellow slime extract" icon_state = "yellow slime extract" effectmod = "charged" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood,/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/yellow/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -266,13 +266,13 @@ name = "red slime extract" icon_state = "red slime extract" effectmod = "sanguine" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood,/datum/reagent/toxin/plasma,/datum/reagent/water) /obj/item/slime_extract/red/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) if(SLIME_ACTIVATE_MINOR) to_chat(user, "You activate [src]. You start feeling fast!") - user.reagents.add_reagent("ephedrine",5) + user.reagents.add_reagent(/datum/reagent/medicine/ephedrine,5) return 450 if(SLIME_ACTIVATE_MAJOR) @@ -286,15 +286,15 @@ name = "blue slime extract" icon_state = "blue slime extract" effectmod = "stabilized" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma, /datum/reagent/water) /obj/item/slime_extract/blue/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) if(SLIME_ACTIVATE_MINOR) to_chat(user, "You activate [src]. Your genome feels more stable!") user.adjustCloneLoss(-15) - user.reagents.add_reagent("mutadone", 10) - user.reagents.add_reagent("potass_iodide", 10) + user.reagents.add_reagent(/datum/reagent/medicine/mutadone, 10) + user.reagents.add_reagent(/datum/reagent/medicine/potass_iodide, 10) return 250 if(SLIME_ACTIVATE_MAJOR) @@ -310,7 +310,7 @@ name = "dark blue slime extract" icon_state = "dark blue slime extract" effectmod = "chilling" - activate_reagents = list("plasma","water") + activate_reagents = list(/datum/reagent/toxin/plasma, /datum/reagent/water) /obj/item/slime_extract/darkblue/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -318,8 +318,8 @@ to_chat(user, "You activate [src]. You start feeling colder!") user.ExtinguishMob() user.adjust_fire_stacks(-20) - user.reagents.add_reagent("frostoil",4) - user.reagents.add_reagent("cryoxadone",5) + user.reagents.add_reagent(/datum/reagent/consumable/frostoil,4) + user.reagents.add_reagent(/datum/reagent/medicine/cryoxadone,5) return 100 if(SLIME_ACTIVATE_MAJOR) @@ -333,7 +333,7 @@ name = "pink slime extract" icon_state = "pink slime extract" effectmod = "gentle" - activate_reagents = list("blood","plasma") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma) /obj/item/slime_extract/pink/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -354,14 +354,14 @@ user.visible_message("[user]'s skin starts flashing hypnotically...", "Your skin starts forming odd patterns, pacifying creatures around you.") for(var/mob/living/carbon/C in viewers(user, null)) if(C != user) - C.reagents.add_reagent("pax",2) + C.reagents.add_reagent(/datum/reagent/pax,2) return 600 /obj/item/slime_extract/green name = "green slime extract" icon_state = "green slime extract" effectmod = "mutative" - activate_reagents = list("blood","plasma","radium") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma, /datum/reagent/radium) /obj/item/slime_extract/green/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -385,7 +385,7 @@ name = "light pink slime extract" icon_state = "light pink slime extract" effectmod = "loyal" - activate_reagents = list("plasma") + activate_reagents = list(/datum/reagent/toxin/plasma) /obj/item/slime_extract/lightpink/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -409,7 +409,7 @@ name = "black slime extract" icon_state = "black slime extract" effectmod = "transformative" - activate_reagents = list("plasma") + activate_reagents = list(/datum/reagent/toxin/plasma) /obj/item/slime_extract/black/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -430,7 +430,7 @@ name = "oil slime extract" icon_state = "oil slime extract" effectmod = "detonating" - activate_reagents = list("blood","plasma") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma) /obj/item/slime_extract/oil/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -453,7 +453,7 @@ name = "adamantine slime extract" icon_state = "adamantine slime extract" effectmod = "crystalline" - activate_reagents = list("plasma") + activate_reagents = list(/datum/reagent/toxin/plasma) /obj/item/slime_extract/adamantine/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -482,7 +482,7 @@ name = "bluespace slime extract" icon_state = "bluespace slime extract" effectmod = "warping" - activate_reagents = list("blood","plasma") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma) var/teleport_ready = FALSE var/teleport_x = 0 var/teleport_y = 0 @@ -518,7 +518,7 @@ name = "pyrite slime extract" icon_state = "pyrite slime extract" effectmod = "prismatic" - activate_reagents = list("blood","plasma") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma) /obj/item/slime_extract/pyrite/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -544,12 +544,12 @@ name = "cerulean slime extract" icon_state = "cerulean slime extract" effectmod = "recurring" - activate_reagents = list("blood","plasma") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma) /obj/item/slime_extract/cerulean/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) if(SLIME_ACTIVATE_MINOR) - user.reagents.add_reagent("salbutamol",15) + user.reagents.add_reagent(/datum/reagent/medicine/salbutamol,15) to_chat(user, "You feel like you don't need to breathe!") return 150 @@ -564,7 +564,7 @@ name = "sepia slime extract" icon_state = "sepia slime extract" effectmod = "lengthened" - activate_reagents = list("blood","plasma","water") + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma, /datum/reagent/water) /obj/item/slime_extract/sepia/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) @@ -586,7 +586,7 @@ name = "rainbow slime extract" icon_state = "rainbow slime extract" effectmod = "hyperchromatic" - activate_reagents = list("blood","plasma","lesser plasma","slimejelly","holy water and uranium") //Curse this snowflake reagent list. + activate_reagents = list(/datum/reagent/blood, /datum/reagent/toxin/plasma,"lesser plasma", /datum/reagent/toxin/slimejelly,"holy water and uranium") //Curse this snowflake reagent list. /obj/item/slime_extract/rainbow/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) switch(activation_type) diff --git a/code/modules/surgery/advanced/necrotic_revival.dm b/code/modules/surgery/advanced/necrotic_revival.dm index 8c579302..6c8dc2f1 100644 --- a/code/modules/surgery/advanced/necrotic_revival.dm +++ b/code/modules/surgery/advanced/necrotic_revival.dm @@ -19,7 +19,7 @@ implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) implements = list(/obj/item/reagent_containers/syringe = 100, /obj/item/pen = 30) time = 50 - chems_needed = list("zombiepowder", "rezadone") + chems_needed = list(/datum/reagent/toxin/zombiepowder, /datum/reagent/medicine/rezadone) require_all_chems = FALSE /datum/surgery_step/bionecrosis/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) diff --git a/code/modules/surgery/advanced/viral_bonding.dm b/code/modules/surgery/advanced/viral_bonding.dm index b87d5e00..3a144648 100644 --- a/code/modules/surgery/advanced/viral_bonding.dm +++ b/code/modules/surgery/advanced/viral_bonding.dm @@ -19,7 +19,7 @@ name = "viral bond" implements = list(/obj/item/cautery = 100, TOOL_WELDER = 50, /obj/item = 30) // 30% success with any hot item. time = 100 - chems_needed = list("spaceacillin","virusfood","formaldehyde") + chems_needed = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/consumable/virus_food,/datum/reagent/toxin/formaldehyde) /datum/surgery_step/viral_bond/tool_check(mob/user, obj/item/tool) if(implement_type == TOOL_WELDER || implement_type == /obj/item) diff --git a/code/modules/surgery/embalming.dm b/code/modules/surgery/embalming.dm index 45f02af5..4cc8efe5 100644 --- a/code/modules/surgery/embalming.dm +++ b/code/modules/surgery/embalming.dm @@ -13,7 +13,7 @@ name = "embalming body" implements = list(/obj/item/hemostat = 100) time = 10 - chems_needed = list("drying_agent","formaldehyde") + chems_needed = list(/datum/reagent/drying_agent, /datum/reagent/space_cleaner/sterilizine) require_all_chems = FALSE /datum/surgery_step/embalming/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) diff --git a/code/modules/surgery/graft_synthtissue.dm b/code/modules/surgery/graft_synthtissue.dm index 8826de71..97484301 100644 --- a/code/modules/surgery/graft_synthtissue.dm +++ b/code/modules/surgery/graft_synthtissue.dm @@ -22,7 +22,7 @@ implements = list(/obj/item/hemostat = 100, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) repeatable = TRUE time = 75 - chems_needed = list("synthtissue") + chems_needed = list(/datum/reagent/synthtissue) var/obj/item/organ/chosen_organ var/health_restored = 10 @@ -41,7 +41,7 @@ chosen_organ = organs[chosen_organ] if(!chosen_organ) return -1 - if(!target.reagents.has_reagent("synthtissue")) + if(!target.reagents.has_reagent(/datum/reagent/synthtissue)) to_chat(user, "There's no synthtissue available for use on [chosen_organ]") return -1 var/datum/reagent/synthtissue/Sf = locate(/datum/reagent/synthtissue) in target.reagents.reagent_list @@ -58,7 +58,7 @@ health_restored += (Sf.data["grown_volume"]/10) user.visible_message("[user] begins to graft synthtissue onto [chosen_organ].") - target.reagents.remove_reagent("synthtissue", 10) + target.reagents.remove_reagent(/datum/reagent/synthtissue, 10) /datum/surgery_step/graft_synthtissue/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) user.visible_message("[user] successfully repairs part of [chosen_organ].", "You succeed in repairing parts of [chosen_organ].") diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm index fcb0427b..0e183708 100644 --- a/code/modules/surgery/organs/appendix.dm +++ b/code/modules/surgery/organs/appendix.dm @@ -44,5 +44,5 @@ /obj/item/organ/appendix/prepare_eat() var/obj/S = ..() if(inflamed) - S.reagents.add_reagent("bad_food", 5) + S.reagents.add_reagent(/datum/reagent/toxin/bad_food, 5) return S diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm index 1edcfaa1..c722f956 100644 --- a/code/modules/surgery/organs/augments_chest.dm +++ b/code/modules/surgery/organs/augments_chest.dm @@ -32,7 +32,7 @@ . = ..() if(!owner || . & EMP_PROTECT_SELF) return - owner.reagents.add_reagent("bad_food", poison_amount / severity) + owner.reagents.add_reagent(/datum/reagent/toxin/bad_food, poison_amount / severity) to_chat(owner, "You feel like your insides are burning.") diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 097a132a..ca42e76d 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -244,5 +244,5 @@ obj/item/organ/heart/cybernetic/upgraded/on_life() min_next_adrenaline = world.time + rand(250, 600) //anywhere from 4.5 to 10 minutes to_chat(owner, "You feel yourself dying, but you refuse to give up!") owner.heal_overall_damage(15, 15) - if(owner.reagents.get_reagent_amount("ephedrine") < 20) - owner.reagents.add_reagent("ephedrine", 10) + if(owner.reagents.get_reagent_amount(/datum/reagent/medicine/ephedrine) < 20) + owner.reagents.add_reagent(/datum/reagent/medicine/ephedrine, 10) diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index e8c55856..6916c017 100644 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -1,128 +1,126 @@ -#define LIVER_DEFAULT_HEALTH 100 //amount of damage required for liver failure -#define LIVER_DEFAULT_TOX_TOLERANCE 3 //amount of toxins the liver can filter out -#define LIVER_DEFAULT_TOX_LETHALITY 0.01 //lower values lower how harmful toxins are to the liver -#define LIVER_SWELLING_MOVE_MODIFY "pharma" - -/obj/item/organ/liver - name = "liver" - icon_state = "liver" - w_class = WEIGHT_CLASS_NORMAL - zone = BODY_ZONE_CHEST - slot = ORGAN_SLOT_LIVER - desc = "Pairing suggestion: chianti and fava beans." - - maxHealth = STANDARD_ORGAN_THRESHOLD - healing_factor = STANDARD_ORGAN_HEALING - decay_factor = STANDARD_ORGAN_DECAY - - var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol - var/failing //is this liver failing? - var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off - var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver - var/filterToxins = TRUE //whether to filter toxins - var/swelling = 0 - var/cachedmoveCalc = 1 - -/obj/item/organ/liver/on_life() - var/mob/living/carbon/C = owner - - if(istype(C)) - if(!(organ_flags & ORGAN_FAILING))//can't process reagents with a failing liver - //slowly heal liver damage - damage = max(0, damage - 0.1) - - if(filterToxins && !HAS_TRAIT(owner, TRAIT_TOXINLOVER)) - //handle liver toxin filtration - for(var/I in C.reagents.reagent_list) - var/datum/reagent/pickedreagent = I - if(istype(pickedreagent, /datum/reagent/toxin)) - var/thisamount = C.reagents.get_reagent_amount(initial(pickedreagent.id)) - if (thisamount <= toxTolerance && thisamount) - C.reagents.remove_reagent(initial(pickedreagent.id), 1) - else - damage += (thisamount*toxLethality) - - //metabolize reagents - C.reagents.metabolize(C, can_overdose=TRUE) - - if(damage > 10 && prob(damage/3))//the higher the damage the higher the probability - to_chat(C, "You feel a dull pain in your abdomen.") - - if(damage > maxHealth)//cap liver damage - damage = maxHealth - - if(swelling >= 10) - pharmacokinesis() - -/obj/item/organ/liver/prepare_eat() - var/obj/S = ..() - S.reagents.add_reagent("iron", 5) - return S - -//Just in case -/obj/item/organ/liver/Remove(mob/living/carbon/M, special = 0) - ..() - if(!QDELETED(M)) - M.remove_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY) - M.ResetBloodVol() //At the moment, this shouldn't allow application twice. You either have this OR a thirsty ferret. - sizeMoveMod(1, M) - -//Applies some of the effects to the patient. -/obj/item/organ/liver/proc/pharmacokinesis() - var/moveCalc = 1+((round(swelling) - 9)/3) - if(moveCalc == cachedmoveCalc)//reduce calculations - return - if(prob(5)) - to_chat(owner, "You feel a stange ache in your side, almost like a stitch. This pain is affecting your movements and making you feel lightheaded.") - var/mob/living/carbon/human/H = owner - H.add_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) - H.AdjustBloodVol(moveCalc/3) - sizeMoveMod(moveCalc, H) - -/obj/item/organ/liver/proc/sizeMoveMod(var/value, mob/living/carbon/human/H) - if(cachedmoveCalc == value) - return - H.next_move_modifier /= cachedmoveCalc - H.next_move_modifier *= value - cachedmoveCalc = value - -/obj/item/organ/liver/fly - name = "insectoid liver" - icon_state = "liver-x" //xenomorph liver? It's just a black liver so it fits. - desc = "A mutant liver designed to handle the unique diet of a flyperson." - alcohol_tolerance = 0.007 //flies eat vomit, so a lower alcohol tolerance is perfect! - -/obj/item/organ/liver/plasmaman - name = "reagent processing crystal" - icon_state = "liver-p" - desc = "A large crystal that is somehow capable of metabolizing chemicals, these are found in plasmamen." - -/obj/item/organ/liver/ipc - name = "reagent processing liver" - icon_state = "liver-c" - -/obj/item/organ/liver/cybernetic - name = "cybernetic liver" - icon_state = "liver-c" - desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce." - organ_flags = ORGAN_SYNTHETIC - maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD - -/obj/item/organ/liver/cybernetic/upgraded - name = "upgraded cybernetic liver" - icon_state = "liver-c-u" - desc = "An upgraded version of the cybernetic liver, designed to improve upon organic livers. It is resistant to alcohol poisoning and is very robust at filtering toxins." - alcohol_tolerance = 0.001 - maxHealth = 2 * STANDARD_ORGAN_THRESHOLD - toxTolerance = 15 //can shrug off up to 15u of toxins - toxLethality = 0.008 //20% less damage than a normal liver - -/obj/item/organ/liver/cybernetic/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_SELF) - return - switch(severity) - if(1) - damage+=100 - if(2) - damage+=50 +#define LIVER_DEFAULT_HEALTH 100 //amount of damage required for liver failure +#define LIVER_DEFAULT_TOX_TOLERANCE 3 //amount of toxins the liver can filter out +#define LIVER_DEFAULT_TOX_LETHALITY 0.01 //lower values lower how harmful toxins are to the liver +#define LIVER_SWELLING_MOVE_MODIFY "pharma" + +/obj/item/organ/liver + name = "liver" + icon_state = "liver" + w_class = WEIGHT_CLASS_NORMAL + zone = BODY_ZONE_CHEST + slot = ORGAN_SLOT_LIVER + desc = "Pairing suggestion: chianti and fava beans." + + maxHealth = STANDARD_ORGAN_THRESHOLD + healing_factor = STANDARD_ORGAN_HEALING + decay_factor = STANDARD_ORGAN_DECAY + + var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol + var/failing //is this liver failing? + var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off + var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver + var/filterToxins = TRUE //whether to filter toxins + var/swelling = 0 + var/cachedmoveCalc = 1 + +/obj/item/organ/liver/on_life() + var/mob/living/carbon/C = owner + + if(istype(C)) + if(!(organ_flags & ORGAN_FAILING))//can't process reagents with a failing liver + //slowly heal liver damage + damage = max(0, damage - 0.1) + + if(filterToxins && !HAS_TRAIT(owner, TRAIT_TOXINLOVER)) + //handle liver toxin filtration + for(var/datum/reagent/toxin/T in C.reagents.reagent_list) + var/thisamount = C.reagents.get_reagent_amount(T.type) + if (thisamount && thisamount <= toxTolerance) + C.reagents.remove_reagent(T.type, 1) + else + damage += (thisamount*toxLethality) + + //metabolize reagents + C.reagents.metabolize(C, can_overdose=TRUE) + + if(damage > 10 && prob(damage/3))//the higher the damage the higher the probability + to_chat(C, "You feel a dull pain in your abdomen.") + + if(damage > maxHealth)//cap liver damage + damage = maxHealth + + if(swelling >= 10) + pharmacokinesis() + +/obj/item/organ/liver/prepare_eat() + var/obj/S = ..() + S.reagents.add_reagent(/datum/reagent/iron, 5) + return S + +//Just in case +/obj/item/organ/liver/Remove(mob/living/carbon/M, special = 0) + ..() + if(!QDELETED(M)) + M.remove_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY) + M.ResetBloodVol() //At the moment, this shouldn't allow application twice. You either have this OR a thirsty ferret. + sizeMoveMod(1, M) + +//Applies some of the effects to the patient. +/obj/item/organ/liver/proc/pharmacokinesis() + var/moveCalc = 1+((round(swelling) - 9)/3) + if(moveCalc == cachedmoveCalc)//reduce calculations + return + if(prob(5)) + to_chat(owner, "You feel a stange ache in your side, almost like a stitch. This pain is affecting your movements and making you feel lightheaded.") + var/mob/living/carbon/human/H = owner + H.add_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc) + H.AdjustBloodVol(moveCalc/3) + sizeMoveMod(moveCalc, H) + +/obj/item/organ/liver/proc/sizeMoveMod(var/value, mob/living/carbon/human/H) + if(cachedmoveCalc == value) + return + H.next_move_modifier /= cachedmoveCalc + H.next_move_modifier *= value + cachedmoveCalc = value + +/obj/item/organ/liver/fly + name = "insectoid liver" + icon_state = "liver-x" //xenomorph liver? It's just a black liver so it fits. + desc = "A mutant liver designed to handle the unique diet of a flyperson." + alcohol_tolerance = 0.007 //flies eat vomit, so a lower alcohol tolerance is perfect! + +/obj/item/organ/liver/plasmaman + name = "reagent processing crystal" + icon_state = "liver-p" + desc = "A large crystal that is somehow capable of metabolizing chemicals, these are found in plasmamen." + +/obj/item/organ/liver/ipc + name = "reagent processing liver" + icon_state = "liver-c" + +/obj/item/organ/liver/cybernetic + name = "cybernetic liver" + icon_state = "liver-c" + desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce." + organ_flags = ORGAN_SYNTHETIC + maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD + +/obj/item/organ/liver/cybernetic/upgraded + name = "upgraded cybernetic liver" + icon_state = "liver-c-u" + desc = "An upgraded version of the cybernetic liver, designed to improve upon organic livers. It is resistant to alcohol poisoning and is very robust at filtering toxins." + alcohol_tolerance = 0.001 + maxHealth = 2 * STANDARD_ORGAN_THRESHOLD + toxTolerance = 15 //can shrug off up to 15u of toxins + toxLethality = 0.008 //20% less damage than a normal liver + +/obj/item/organ/liver/cybernetic/emp_act(severity) + . = ..() + if(. & EMP_PROTECT_SELF) + return + switch(severity) + if(1) + damage+=100 + if(2) + damage+=50 diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 5452a1aa..24fc2b37 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -68,7 +68,7 @@ var/heat_level_3_damage = HEAT_GAS_DAMAGE_LEVEL_3 var/heat_damage_type = BURN - var/crit_stabilizing_reagent = "epinephrine" + var/crit_stabilizing_reagent = /datum/reagent/medicine/epinephrine @@ -300,13 +300,13 @@ var/bz_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/bz]) if(bz_pp > BZ_trip_balls_min) H.hallucination += 10 - H.reagents.add_reagent("bz_metabolites",5) + H.reagents.add_reagent(/datum/reagent/bz_metabolites,5) if(prob(33)) H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150) else if(bz_pp > 0.01) H.hallucination += 5 - H.reagents.add_reagent("bz_metabolites",1) + H.reagents.add_reagent(/datum/reagent/bz_metabolites,1) // Tritium @@ -330,16 +330,15 @@ H.adjustFireLoss(nitryl_pp/4) gas_breathed = breath_gases[/datum/gas/nitryl] if (gas_breathed > gas_stimulation_min) - var/existing = H.reagents.get_reagent_amount("no2") - H.reagents.add_reagent("no2", max(0, 5 - existing)) + H.reagents.add_reagent(/datum/reagent/nitryl,1) breath_gases[/datum/gas/nitryl]-=gas_breathed // Stimulum gas_breathed = breath_gases[/datum/gas/stimulum] if (gas_breathed > gas_stimulation_min) - var/existing = H.reagents.get_reagent_amount("stimulum") - H.reagents.add_reagent("stimulum", max(0, 5 - existing)) + var/existing = H.reagents.get_reagent_amount(/datum/reagent/stimulum) + H.reagents.add_reagent(/datum/reagent/stimulum, max(0, 5 - existing)) breath_gases[/datum/gas/stimulum]-=gas_breathed // Miasma @@ -459,7 +458,7 @@ /obj/item/organ/lungs/prepare_eat() var/obj/S = ..() - S.reagents.add_reagent("salbutamol", 5) + S.reagents.add_reagent(/datum/reagent/medicine/salbutamol, 5) return S /obj/item/organ/lungs/ipc diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index c39d717d..fc205f60 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -164,7 +164,7 @@ name = "appendix" icon_state = "appendix" icon = 'icons/obj/surgery.dmi' - list_reagents = list("nutriment" = 5) + list_reagents = list(/datum/reagent/consumable/nutriment = 5) foodtype = RAW | MEAT | GROSS diff --git a/code/modules/vehicles/cars/clowncar.dm b/code/modules/vehicles/cars/clowncar.dm index 63ef4fda..ef38140e 100644 --- a/code/modules/vehicles/cars/clowncar.dm +++ b/code/modules/vehicles/cars/clowncar.dm @@ -105,7 +105,7 @@ visible_message("[user] has pressed one of the colorful buttons on [src] and the clown car spews out a cloud of laughing gas.") var/datum/reagents/R = new/datum/reagents(300) R.my_atom = src - R.add_reagent("superlaughter", 50) + R.add_reagent(/datum/reagent/consumable/superlaughter, 50) var/datum/effect_system/smoke_spread/chem/smoke = new() smoke.set_up(R, 4) smoke.attach(src) diff --git a/hyperstation/code/modules/crafting/bounties.dm b/hyperstation/code/modules/crafting/bounties.dm index a7a53b84..dbdd1551 100644 --- a/hyperstation/code/modules/crafting/bounties.dm +++ b/hyperstation/code/modules/crafting/bounties.dm @@ -16,7 +16,7 @@ /datum/bounty/lewd/applies_to(obj/O) if(!istype(O, /obj/item/reagent_containers)) return FALSE - if(!O.reagents || !O.reagents.has_reagent(wanted_reagent.id)) + if(!O.reagents || !O.reagents.has_reagent(wanted_reagent.type)) return FALSE if(O.flags_1 & HOLOGRAM_1) return FALSE @@ -25,7 +25,7 @@ /datum/bounty/lewd/ship(obj/O) if(!applies_to(O)) return - shipped_volume += O.reagents.get_reagent_amount(wanted_reagent.id) + shipped_volume += O.reagents.get_reagent_amount(wanted_reagent.type) if(shipped_volume > required_volume) shipped_volume = required_volume @@ -102,4 +102,4 @@ datum/bounty/lewd/fluid/New() worth += fluids[/datum/reagent/consumable/milk]*2 worth += fluids[/datum/reagent/consumable/femcum]*5 return worth -*/ \ No newline at end of file +*/ diff --git a/hyperstation/code/modules/resize/sizechems.dm b/hyperstation/code/modules/resize/sizechems.dm index f5beb94a..982cd4c4 100644 --- a/hyperstation/code/modules/resize/sizechems.dm +++ b/hyperstation/code/modules/resize/sizechems.dm @@ -4,7 +4,6 @@ //Sizechem reagent /datum/reagent/sizechem name = "Cell-Volume Altering Base" - id = "sizechem" description = "A stabilized compound liquid, used as a basis for increasing or decreasing the size of living matter with more recipes." color = "#C900CC" taste_description = "regret" @@ -39,7 +38,6 @@ //Growthchem reagent /datum/reagent/growthchem name = "Prospacillin" - id = "growthchem" description = "A stabilized altercation of size-altering liquids, this one appears to increase cell volume." color = "#E70C0C" taste_description = "a sharp, fiery and intoxicating flavour" @@ -89,7 +87,6 @@ //Shrinkchem reagent /datum/reagent/shrinkchem name = "Diminicillin" - id = "shrinkchem" description = "A stabilized altercation of size-altering liquids, this one appears to decrease cell volume." color = "#0C26E7" taste_description = "a pungent, acidic and jittery flavour" diff --git a/icons/obj/food/containers.dmi b/icons/obj/food/containers.dmi index 3e3c0091bbc8e2b3d6a1bf21a78183199377fbe1..66737bb9d1a56a65be42cba49ffecf0509918608 100644 GIT binary patch literal 12143 zcmbulcUTkA_a;6x=}o$H6cGUtkzPVmdXo-9=txI;P3T2X5D`>LKopSPoAgMNs+55A z-g`*`32gZ6?(^*ap6~AOkNx9jGI#ErIdkW{=brPPo1mwoN=bHy3;+O1bv2b20D#AJ z(@1Us06-sA9*#S~1RI+AsyO)Ac{_XgI(vEmKwwt(qggo(K)kNyjroph*%_;aFnIPWYnjfN4;NsNZ6N*u>4J)PK$e5kn}THnx-J*Cqv z)T@}=rS;-qT77#?RK1mx??+)+YOtox3t@eDm7ffmdXGgZ$1V{QM{8En$h=;k%~m!j^>J*Nawe~vb2hJ= z!)`DcT5^6K;l_*kBU2*t03S*nAR5U!4e%#4P&(=8q)ppR@v z{Qhn#tpLCUsH-R%24?MLhXm3aA@?oln zf{zFW2%bEAMAFtqHOw3nK=W+&LG?f`o@xuRN>r3*eqXo9V+EdQ1uk_~9`0y`@OaWX zsIN|dk)Kh3iJwun4)Wkc7VDc`ynSI90J}Q>VIYw?=RvGULr5)sWQ7;W)x|`{70K18 zh^InBDDfbiBy#Z<5sf0vY%ah<63P1B9GoHwvap7qug$pklJ`uPaJ%oc%&rb!|U=d#OADI(qoVME@`& zjxb;8fw;Kw=0r(G0fJ4&Un`e}Cz3rgoq$%@vU&9k+~|rZFE9?|xT=sCVsHdW-+C`{ zy^M4nHf)bOk4u66dnB}GBh&c zwRdz3&Mqt{c>Y)*I`GmW^QwKj)r>(`MT-bHx)H?b&)-=#Qpm{TNs0{t}lmb_WeZQ*8!J!K!>Myc?Ly^w&<4{rxAR> z*3OO>?lMO5H9uD>{Oi}RK%+9BbE+sw+r_p3$|a9k(a@0ocFq3NmO;*?6*_twWPGsM=Ks$v+N4T5ZW*{2f%9% zZG>Psav^u>U&zmmNT-|@s;CR}X|%IBp(LT0`T$7eVSGK+io*Li>NaFZ9E+mYGavGz z@85}l(ed%Fj5Y42#0twegK7Hn#DWYf*gqNu+FV$AU@_5Jiq?!e3ob-zaU#pppYfz z&Em2oiay7hUgx19b%#v{ZI^l`CWWq_V`5^I{Qc`AT(_*sK_L9&xD4>+YX#r}c_7R$ zA(g3^&b@cN<=MokM-4NhE?m(%gN$KuqTK&I%>qHK5Kqk3WV~17BV4!d$;ixXB!^>` zHV}2BJuAeVf{>07lxal6A!+pXwu{?B+g!NV>FR3#hobWG`yezgid|u>K>L}qGYjss zcrE`T?XPWYl+2R$BU4vb|0M4IaMyojfzT6l*APw&q<;7iX8cznLl<(K_-7pdPVpTR_=dHN;*+8>{osH~ol&g&AD0UEcEPZEd(;^1?goSdA=v9Y({zY`MXsS#XI z6k3ckeySY`orq&NJUpS`tXdd6#9J&5OXn)($?*Y4mnIszDH&Pwq&#ge4vC zSaQ~2uF8{B7Y=}na|FMmakF4vy=OF zr<;FLy*0e65#GV(UwU`e1`yj!A9!|trDcqbeamnX=@N#vw_xWduG;}(w#=9A9S%s%wqmJE17UwF*Z2)Lcuftu;F>+)^_!<**xwg=5++MJQ7bAe1<&vP0 za9Z}!B%CvFKHq6#9PN3_N(8=6jac-OJY0;TE-t4-!$))x(dSV!e5KXSVa!45lL98? zQ?>G^FXIK}goe&M*SsWC($enn2PD3udez+UTlebl)POwx(0ZlkZDeCLvn9@wSm+f9 z6}_UwJO4kv@xOQD$8(W*=mE5Zos|DKNBaLeICj}mgp8b=vR$sEVx}t{hY&)daCD_QDOiu-Y@x3e-P(gmZz^$Mua19w>Y&2vL`*) z1k4lc=}McM@60rKN<8yDUR5_VF$u|z`_G8ac%QPf-*$B=aZf3!-B!T)QF+ie1-0}! z4P$3%ocwagJYHX=H(lk2(1LQypUdqgkCYJQmX^s11G`HCVV@UD z>Z*l7?HM82qUJ{wMfS z$CrRTH8r)H!>d=XNE#^s93uUN7FgY+Gr?CE3IkWD)-n)v`}-ZcXi&-A9F|6@|+GVyRQTL$ssS`&(83$MX9TXWJ8alHJP<#-t;HFW6u`p%k!?a4qUOuW-@ z^mK*w=d;_A%Usq=c1_n;BS2$&s3vCb<_2&p;?jHY@Y4Is5@Px3Z%=zvks_Y`(~4vt z>XGR#gf0!+bd6K;NDvPm*WY@?XxJ6x$Vb$?qS?|Qxn;s_ONvp#y5xWb%t;(NB`-*p zJ)2+gaGt#XAvAYpzZt_Lcv7Np)qxQ(E>+S9ND;w+co_rO*HTJC^6{jC{g?Sy>K)TS%is!;<%{cVb zNWpNU>~O;bUk{!4c@4S#bl{+3jH2BNbEGMq=Q)GS@%YTx#&Tt$Df?XS<;&8`ItB)Y z8@p*;B+H#SZ;hKm;Way$H@Yu`us@7Wv%aQ?2vx*=i^fYifB1~FYkNi=V>B2d?uQ2S z^z^uZj@{`R_hp;A>@979#~(mx7;Zl{8gka4>CMAG@YyCGG0t1Kl|QZ-^bKE4=oJ|m z8DSZ>p{1pJpSZ7|UtPKIjR6uv`v_B7&g=-yli7@v4?xs7!{3I?yxS8dcbL{~md-2N zB#@r*Vq2iN7J5=I&w1L5PfKXS!99j=+h?KFIeM*36a9n(&%WF0VNDA1jGmsJq;s5B zn?>^t* zyQmx8C4gPL=h28ddE91c+Z|a zBh?sL!aqRXOy3*u*bn9(KYl2=y9-^M?_H+;7SuH{HvZxt`9lKg;IPJ1(_(u)IJg>> zTs-R@G~PRb_>8^Eki8VVuWcyL=Q$Nm`*>zyax(S`dnuq(@#6<+5Y*fIiQ~|h?~>Th zPB|iTu=nYqUi+qNTQy+O_NyTaKlEa0NXP@7k<9>|8t@penX9YowDtS0RoOqj28Zjq z+S*}%c4=&{!kpv^DU&~z!hT%g0=8slet!ORRLI$O%*n<`h}O=0YltZdZ*eqF83@M( z^*rL@jKJf-L+b$y>;ReNk9=IR4W>@xK(@GSkK$SSqQ!{x7TUrrQ@?$?hsfS=b#bYl zI{p1yV@SXz4J0OJ^!S7`*K?t*dwZ7RN+oM?OU?|vKwAW{u!Imb{Of}JbhJP zFAgYN6>FCtC2r_c&Mp{kUNOB3Le)Azdd~M|EaB7B)9IH;_5eit5p%~Co6A80>~VS3qV_Z?QJU|JHF0jmoxJtt6bb1N;GxI0f#bA0Jk#)0-NF;^&^ zpeurzE3ERhQ-NHGst&9ERX7Ddz7Qiyk&HOgqNc}z$P`mmRmG8MyL5W>_81p4VO9~F z84VCqsh9KZ?;$RD?_robSbcr{)Ja`K!?f@J(MVS)muffTfRelcIWn;D_b-n#wzjs` zbQ>Wf$Bb=0kDQpC+&BDmo@x}*8F+zby&yH>47V$rA%CH-za%2W%iCSusz*sl$uZU( zaKOO`0VKT^!+UH0&hoA8do!JD|1u0eHeU0p(YMu?jF~zJ!Jb2fe(gxt{@?tYR+o z7iT+hH~&}Gh&vqEy?Z?ADltKe^}ZXGI{y=f({4EZb0A%&zI8WgC*gOe65N^{7i_ZX<^&Xs}3SRy~swZAfRTz=ZnK{rJ&r|;_~JrAbj=wXjiIkHN|>8rpmy; zAjT}JLJsxnB~xXx6-L&3gSy}n%qotuHn(NfnCVS`^+NoA`Cfy;>;c}h2hEG){9I3N zr*4doCu<{xgU-#gzDUxZ?KN1_f~Z+Vx_qJA*O%?YKLv9r7w@ImevswV&=#A}Wlk;t zY>`-g^!Fhb1k0LGn{Sgzoiy_Hil>@mj>lE^N}v&EO4b)F4z#+B*O9rhkr6y~`$ zV8aM=G%p?t-(hoaf?`kvVN-|eLkL*yKjHP|?!@vfgynCEiH$T?}8^Y&w(yvxl_rcjnY0u_P8&x zFVK%f4?mailh?HhVE0s5Gk`q4E_ijU?1DJ-O$`o}foL-vJi+eG6GB`9*yzlpBzBjpXM-zX^lY@wa+4IObZv$fo4*!DX zh=l$3NMwy0yEp?iK_v;@{sAA0#I?xYz}HsmRm7fWn-|{P*Zd}QosL8*I$6$)U;Z|_ zmlIk$Shm^_%r5>GJ05oLDX>^szP9Ot#{fQ;rFmTA6YX#v4tl^wB1ML?kQvAe$tm$a z&5RxLKR5Ib!XQrB?O(rk*_mr-ym7diTxRDO<9Sk%-)hZHqm5^1X69_+)%c>Qtn3-i zTXRD^{2=H8j$2?{f5^$G$TKK75tF}`%e`&b8*;{3zno- zln%S7O>P=G^D&Fl6$ip>v*COr+g3?K9u2HDN`$n}`-HE=T*ixBgD%Rfh|xrSyP3V4 z{|F2I!?}$U|CdzU|6y@1v}M*(Qi=qCv$L}T7@L$`4+S1DS!zb-&u3eW946@<;i4a< zS7;HC^=xmy$&+yGM?nZY*wQ~#_RFyq-A=Ktb|3YX7(cI%Dp07 z$ftrw?Sq+U_!Kt=_HH)3J){w;RmS8?`&rq};btP2Si@zDc&olLo`1--~`MyJI}JV}Of? zu&t zF!+?8(47x)5f+Il=$>G$piPIt1FOidRY9LTi=JhlY;YQEF`@E*SWO~Dy)Ec;vLxTN z+7U1Il&wj=#y9=<1n_*f>8MUJ^pL+ZZOxyx066g}o%utfzYtqbc)(4szfkbgERRwC z_3PKo>4>SRP4jef5_DZL9ppDW@%rq${mW@=P_wZHHG|!WUTuIdn*h^Nubs@};|b3c ziAm{pi8no~OW##Fj-*G%7(kzHQwfGXSujn0lRPil$@M)iPf<<1pE$RE`a^PYad*1= zn>oxcBhb3WGE$s~`mj5U;Bhn^I3g+btZNt=nfAjXH+;N`3vB6*5}yK66U} zdiZ#1hn1DJ%6&#WiAA($&H9xz)8K2A@YKoly=?P_aV)l7W zA@XB}akuAwF5F{b%ovK@LqBAfX9ht=86;N0id%=B>F6LjzXi?I-sipiZoXOGAJ3}& z_sqFP$1F4ODLF-!9UL4TZTJ4wl^;%yn`&x7$r4JvpdinhFG|ZTOmkOUj(v2xrpx`I zc5>_2y~?InqXVeS?u9r>-(lEwoWne;?QA9&X!2L{yY}8k@ua#j(Mn zq3~qyV=_Ka{oHBAch9D!^;lmk8woPrqRdyW3&%~c%?PK*%JTVhKR+>m%V*cr1eNAC z_vT^*6re4dI4Ch`2MM4e{#NUAg#ihA65(}>hQ)aqg{8SlW(9_<<@epmeyhmeTIqxE zKi$lHw^GM`@*tUN0)P8K<)KJoi~F+&cQQBjkt~@Tv*hPf9}1*caMNV(oT!>0q3R1S zJs{47-eq0c4X1J_9-y`{H5Udtj?7taO>p$QFNURvNwdlXxc7#){S8{F!3Qz+kzvSk zwOik$@a_1{kC%{~*g#^4!*Rx%l|4LC>h*4uBPPP44BhD*K{R3sXzaJmjMF^4I8^Od zOrFsaRo5ryEK%;??$G~-u{Et@aTI{i(wv>xza8$mplbercH<0*JRf$01u~_p+meh(!mXyCBPCV<{4&uaI2;O9RDx$Y7btOBy zZ zn^JL&+o-qGNRGQ*NLNo1OO*ReebDX`gr=q@IqsAIcpxksx4sfiaxgwVZoS1G00hk9 zjgJH2s#0mp+yXUR7gjd&dL1+COz_>IN=10=jQmVcXOMI((;EoK+a)u&AG*7Yi%|*i zC8l-Vsyuw(00GEy!~1893Bi1drW1;8M7*CnGToSmZH`23IN&uNbqssa2m&qwDPp(t z-Rb(sNPL^AN}F;T{8{4rE-|efUa=#%>{3og<2&#q+@$@{3prMf%JQfwH^|2T;locg z$hUj`83FRw#oJZ`h=C_9wUMP{3kvu>oKpp+=H_<*wMaGUp`jr_R-%=eUV%Mrg_M_B z54Lru{`PBB5z%`yOwA8UiC-#>@8aw6f6jRfID^h?3pP7WZvW}E;`xH8W)Mx-8Y`Tc zEVmTEB|g?T-SC85udlH2Z{BpBZjBMNu=UCSQ~bJ6q8{psBavFdli#A}t*M?kIWc4@=^B8ytxM5mJM&7?(VH-jf236=TL7 z5B;_#^nNn4C^E+^+!O|Fp87f&{-3Laim$nBSJx_v{5+#q3SV;l`~B|H#&Nu%Al2EnExU~>SqH_khV1v;+*|jZgTNr7q`yGN^*^RghGsb6 zs|VIskK>>KUcCBdg>)GvMpv$&_ugp$QSv|6UUvvpppVF3dGoi&myXTrJ91e6G~p0d z5mKxrLr3O<7XDcxxX_7Zm6{4FNmm=v8I0tJEx4fL0K3g?V~Z~KJ&VDC69G_VTq6L| z79_^*h5}sforX2WGlqZ1JXM1)_L>VnwA)=Ozt5%2J&xK>*FE^WuZe&9P`G>OuIC8} zH=}eF!EZJ<`-L)6=}GCF4oRNH2#nZbwRo1d+#0{3lP zTfYo~UggD>YgcAbPG1GERajB}l+*T6wfLu6f(Q8397ha>yj)3sIY#M(3|%2(5iwf8 zQu0e&mz2zgtUn$vn@`quid{Mv56Jy^^Szq__XKoCG|60_BkBu#%<6FMnv5nRM8oB zQS>3%o5xG?o}Vf5Fm7{wN=_TJ!?(5$^{b0yUK0-e#~t;Y@+ib#k}WVd4AltFlT4n5 z)Z@QfS#9XzeDjJd7xz;5Pv_sriqbv!`~wsneBd8&hhSe@2+cHS2<^%@`n7)a3hO(n z(e(vwWMouST-+5PvUhZmeZov%ALNBPL=>Pi#KdeAe}dL!3a@1(v2G`WTF|lj`-X4z z&ufN6MX}2x;C+delaY}TiPOg)yAzp+Cp@5*nbz}9ihdQ9L_y}GkE38bxKH^_=o8se z#lbRPXOM(((C9BJ<~7=f7Cpk9`3unK=4LF;tdfORGOTCUH>BNAk4;6v&Ju@xGlK^& z!8CO62~N@2iiO`JAP@-r;L#(hKq(v>YFg*Qus)pa+F{O;cn&f#%x_8A^dZ+<^6& zAgg0g`-gaw@ppK)k$dA4d#YpPd@ol_rwD_yo>wmI$bG_c^p7AaKJsd&f2!Zz$O+Lo z&bO+zPbk-x(Jr(_jp50m4>YU1@?=6C+xR=g$*qvFNAfI{`RIesEo`t>(87k~aR5d8 zZ8RFKH}qLl^^;tPIF45B$VoQhfHT3Mc|p^$w^IIl z!CBYjks)R74XJ!LhYUxevo4vC=i$mzOJxo7N**5NHj)RioBQNXR7H@Il-pjYUrMudR7&?Y_Ynh%>|G}-f0g3m_N=VohiTzO4x$n z=}!84mzm+WesR2OI<)%o1REL_iM@@D^ILCD{7-#4`#A4FLOc&EZlvP zxFQp9m25*pL*{C>d|Xi)!u}@~4!nU##-(ct#cvl^a2lHcpBdySz-65EKfcq8n_tF} z@R*8h_c`RlHxftME7w+652wi;{ZYTpbdb%Y_o-;V>p0iRIk-&|{-GtQ_o-i<+VfYQ z)b-&^`Md;=-^nhYGPhZ2sq>zCIw`EOq)gM9Sg!M`9nKd{XJAH>z`5LNYHC z;`KF%Zg7Q5Ie!>pqQJrC5>oxZi{z`_SN`x_gZde7agwf5Ga%QdMsvf6c1^F6M&(r} zw#_>HB=m7v#dOuKx;lE2NZ9qfo=oB&j=7q@^1A;3zetu(^^@Knb~rUN)$?51@*R%8 zc0K6F@%%v-@Xxu8!puO{4TpV-W3Fv4&*-q`#^({bVULn=bo_m2<868&+}4$@54o+v z%!)L5)c?!AmH#DKCLHoWz3a+q;v}h$ccm{Rb$2?vC?@W@nxcw4Wco*05h3LRqWSyx z@9Wh~{_d?P$Q<3;S{x;H-Zxc_bhaNBCpvk{$JlILff#CeF0*|&D@d>HLlo=;M{iP) zaZzF*>kpTTOM>qTX`{1hkB{Mvp-ohtWjU^<0I%F}B`#4cv7haa)#O-OJ_t4E4?V52m(2ctw^qL-L%5(A3OX}0TxdEehiLb9WSu=<8z7}^r&QL9~ zry%_OkS6GCVv_*a%Y3P^M9?7yeyh{o_@eC75o@jAUQD5tMe>PIndI%Up^4RVF_=}_ zLowhuTOsgY(%y z!v<^Sqve-#uT4H1JqlX;Fj816D0j8qGxo|uRvW?zL5Ftk7c!>6R05nohQ=Qs(k63$ z!pAAeovSSp1Ref(k}T-tM zr`3gk^u7px!q$>H;>Qvh_9)=gm;Qc=2l#H!PxO+P+H@x^ED9&feKV)>Yp*yXm4I?> zdf>?+XMIw&Q*j>AG#JSF2tluBfGD&Qr~^eQ92kaawm;;Stl7~ozccEX9*MXg0E%l7 zgn`B}rOEjgFR70O(&|utb>ZuSpYLkr$g&jb!fu63hInqiTV@K7w}=ob$G+OB?l^e2 zWuAWPJ~jLDo%DcG4q=es)=o;s+DT#t1KHKOcxFjO6eh<(2x2LeivUCCdLW0o*bM{V zbb+NRAB~-B@g6ROW?%}c^O+YU4r!{pEu*v@RP)3lHJ}gRt9dMe?We@a?~HOaY_uWA#N(vd+1Wz4?FezJ$>6s=1wQG4 z%ho5C2K{#2hoOqjCuUocOm#=Q3!dxEXSh-VPcwc|Rh9myr_Q&5Tpty}``TaZodq__ ze;(ZamH84JdKELYYpmx!r|bC0ilLSJR~Mh&>PNl#gL!7=+A+aT*f~}aGs3g`1c;pC31tn?OBZ_cSDCo?G@7W zn{!VB5|fUkbjhA*oy752U51-}Prq9++qOPNjz(X6WPZX$#>Wa#grSDtj5xw)V38D0 zRitSaz7(M-Mk*o>BVEYVu12P31ONF^zv{4TTKfo=hyAU_L|{U(8ZQ_6k*#fXcdlKc zA4+0JF6W)bgxiOoLLYp+NC-CEJr4mTUh96m@>@IE!ZO{zQ7lX*fMlYgWeu2D5)9W2 zU-qf<@wW+_EQ|FgB#ydHklFXMZa4@s2|cS?y3%_l7QXt?0&?vnmbPwik%x-JJ=6PZ zem*VT#Kb|++xyHIHO}Rb=fIzk`aAp7Mw<#MU7laeAF({qRXtm&~do9xhm+gG^b8qn*Zb@H#FO-Bt?RJX2I^<8f-EXcu2 zpvOgG2}hjsE{z~VeahT^<+w%<*~uwi+E?BSfmZV)i~8wUu2qRfByrWk3bE?VK0Dbu zCm$ZxVU&w3kh}YCsC+Bq(NmW7<29$#pWf_{UEfjP>%{NK{29uF5ELT)ns#jLiUbHO zIE8$o4bOYy0!Vpk9JFxOVjNG8A-96eFj3aXgyFx9wzlmU;^&YPY+D~rG(>Fk4x&;r zx->cl2cyB&5eB5ds61U}euFssWUOuH&KN z1W*&Xu7cEgaslg0ZObd=qv!_#z~Og?;8WH^Q7^Y>nbUGChvYt1ESj%4dsGxr)*y8q z^L+@}Q;;ZWvVm3?cKp_dov)G)5EfPGN@J z#S!;)9;4S*-X15~uy;5Fxb<}3b-G7Ad2uwM?iLMQ&3HET*By8cF(V9`*1Ep@=_GkI z(m^dE=Peq3TPt~%B52x#PmH^JWBPFSyhJ(9zES#F7t*K+k=9)WUq?=#}+ZfScd+OGhN4!iF1zoT0WiOxGE!@c-k-Pm(w1B#E+phw( zM~$pm3OmOedf6~vAN)@le}|qZ_d?nFdi=RD1c%oF8)AZ$)fWGLEYP6@G;CZlTz4lrM>2D(7|BSF=KH!vC23**5rSqW24CX&(PrCLGvG z2E49mR>LSA4RMl@1jC$p4O@;d0tOcdE}VW%Oq>jROhv}Uj`zzNL}d$mk%9X4m{~OQ-<>3GT literal 11879 zcmbt)bySq!yYJ9lf`l}v@CE5o8l)Q$P&%aZOV`jPh#;VpFm#7>4a|MC?zGlz#xGwM$;Eq9#bU~i}e4*i3{)! zm(cUv#KG?ud!xo_hRb61ye}kq$P7kjgm-?Rpd!{?!uctob3c$GH|&Y=&9Gez`i~bM z9+#r|>EH|94$Z@JhV#4Q!O@vDt-HBjGjkR)%B`H{Om2&7!(yrWW&cFJ(&30FQhPTmpj0&!&}zIH@HDggXmNCSEnEl3rJN# z?zP|7KiObEDn;mF*URq@L@ge?#Af9qr}_RMwJ%pzCxxB6ln6s{PKwk0*kk1=cAv|P zyu*yfH{rX!F15D71`{>$ew-Wm8!D5I2o}ETo?i9H$K=CAteKJI_~iU~Fy@p@uL}*B z*M*n2rfo1}JHxK6t$fc|Xg6rvaC+L5v}BSXoCTl4>%kHzoaH->AWJw)q#UjSc_jZp zD1JCOE*-fX`F9p9Hhg*7PfBD1W=T(KUACRt8D~T}{LWz1JfG2N9<^5~4~D_E5k)TX z2?^6xA&9BJe)RV*+%~h~7to5bP*s0aBhB^JM!vST z_7yBgiiFVwI{v_VRKFvJ zgqcZE_wSe8pL9yJvI{ph-g)g#C|(HA@R=!SYLYlQIsNs3E&S0Eg^s^}YwD*@tMwW- zHbp;%A{F+Ug>OSfI*1Zvj*?!xpCR-|I-F*!|DNT*XQDj_@B8tC#leb=OU$tK;@4zU zRMaaqHNs}|rSx>#v@PZbOV?ZwH#Z`(n~>*;AW(1yILpeI8|F9)ks$-cCM4)PJ8e=Z zDEEBBP*haJuoufNe9y~%i9Us`^2yhRmzHuqmYjWQDc*6mxh`{|eMzIA!+qm(OYqDH zi3{pJKDh9s=xWd~m%c4vBC^``-kY%;&sVI@?q!&(Un3eq5`@zf^YsdyT7H6QiY>i+ zTYz?yF^?*gdCZm1B5^j|GTeU#JM_BtSA9U1sKxB)}O4UoD<$>X~-ioD_!tmz>sFMLZSVJdhZJ)w0&qg}s z@Wlrb=9Af3K}Za9Fs+D)NHJm<21~1}t9#~b6WAGWOQ0gtflPp5VU9JsnJc!9Kg9hV z?SU?-`GX2=x*GO(W*OCI*s89vkruKY?(U1H(VYIJ1x-$VKxB+y1IfdH(e z$A(;5jN=7mB{E(LLS#!zOS=!2+Ij5rIP73KfD~|cQ=phjxWd*yy%;16A^{l$T`c*= zb+oiRM<4Z)si>)a|3Ejn>Sc7ts<0;{KOF>OdGX@+q3R?1n?h}r2eG1Tgkf>B%hKi( zF~-XYg$nVcV9qSEl}DT=wN^OI>h`xkSyW`uNN;$Yu9+F{$fZXc++$Cv3NP_}Z2muL z8*ox4^GJ}n!mV!y-qpo=DiFy1GwkMCL>v0$3$=ohnklhE`7q9B23YmjZ(QLWa zr}1MfUFaefaPN;{^?fY( z`g}U*cNjkS(-!;ewu3ZikpsSVm4eX?KEckk<;X#Ah~~pSk_o#Qz{}6y6uC7?bs*20 z`m>;}Sf~^AS&+K5b-|Xp*{Gw!-ku1vxmXo$q}J)N_hh-u14_yzj!9rG0gnw8Me!#u ze%l3D7-jY!BTxy5Ayr)xtMW;#$<#!Z?2D$`@+HmpWU z$clI)Uh|6O$4wb(3pQBiBw|iKep!DSgw!!M-dpDV>o2(g_<4V*uxVT2fMJQ#9zyaX z9{TPCHIc>)_u5T{dAXQov$;e;QK#`Uh9P(PXVW1e1*qs8JgVxTTJM}yZY%?0Ss`(6 z#Je}};rdWfm-)w6*Pn?a%gebmG6WUtHSZ4>sbSB!C=~p;cV}o&xz4OBc*zoJvnBTq zYjR?-%RpaWA5e!^h3$&Uc&Ueb8yq)BQziJZM;4RCn#t&Qwc?tnLfF4N;S>%#;1A!) zV$0!25XZ9MTP9&pV6zhcPtNoIiP+4rZvX~s4)Qk$8Ty_qy_*tzxq7TJgGLAa1t`Bq z-cq~o9*R9ldN-zC+9_fh)#DgSh-GCiZ4B#I!zHF&xk!{n6*7;aPDI}%P+&DsD$-Qu z=VP|}9&WLDo$tSW{rdIgvzPx+NRse#a}!-%UA_92k@P(@IVI&LST!uE(nxK__%-KX!)xRn<8_3pydtWT4D8L!9|m(i&4Se>(+Ps zGKLfbgt&$tWCTkqcmu^Yd-*Ic0!aiy&KuUnF4?e(Z;Xzq$WB8&%UPxUaWnYdTnYH$NNTK|KSXJ`h8?1cI8zC z<=NR8MhS++G5Xg53fyz@*8l7{toUr_+OZ2C%)MY870mKyHP5Y3%4g?VZBObhL-*Uc z@#pgrG7wE>rli?yFq)!2KK}2#G6DjzrO5TZK9!c;r!@{&O{h&0MH*)~6g<%oque$* z8e+hD{n2N3vE_=TSc{=LEG=ZwtmC9#+A#4Ip5%rQrHZ! zkN!8SoD5TiAXR}t@X%WJ-UeOY>gz`p7Cu&NGxqY5y@EK$vHrJAd2brCmKDf15n6yWo{gvzx&JUxqm;HQq5 zZ+3%}rGx@Zrk?!@MJHutaZ8;|>0!)z9<9hta$o=!Qi_0Oy;;k0V+vK>Qee|h0>yKDM58t=Rke+5HY-#6(FBzkADQ*F#M89}%WUmj3 zkv4P1H5j{i#a&i?gxDT*!GP)o4=E^#ld3Ad)y|?Oh(u=dsr5L@|N8aIZ#&zU-)H{~ zk^$2h?^`D^(}J}CH7ya6LGWiIxDFgRU9SHI8q`XA(^L(qLUF*c-)(m=qFQZ0!nfmo zyVnyNMKy*gG0?Zj9d6vb!`m&XNh_r}A>?e+&YPZ(j1n5m#zsbJ_ac*arypB_cf`zH z1{e2zaK8{c^yZ{I!M(P@-yj2I%6x!gN?T>jPN=bQ!QSn!FxkTk?dXss0BwzC?C5=W=BBEWW@&yt;E}x)6{E^z z?j7XwotO_8Wd+RK{NkRkiR!x~0eyp=qStg@ZY{9kMxx!9{5=CxDy+zX5Ej73 z_8lWZ~ISayI+Wb~xY7)YMd(e-`=V-ByR)^4J^2>lQ>>T3X;n zQDNa+KD^#e+oZ#9oV_OS;=nSG4Ah^^6&q@uRgmHGTw7`>`nz~`;4+S_)*-ZQVna(v*A5~UX_5fxcy4)Gq-t4KZ z)?D}JiHs+M%~gkt%=&xy&1h%meo@-uRmYjJu`vdywW6u*f-ggC+2`gb`rLdqy&vH` zX}7=JxzL&Y`Lj*?tyswdtSj$kU-GUR1C(<$o3)6lxjn<1L`DA$MZfr(K%w(yPYlSU z=HNWy^9JDhtGxV>+m1ByIVE7+Q|cy;X{8$@4zI>nNtKRJl*&h@bt01&{Pw5pDDdM0 z6n5)N`(45J1&z0|)QM|)c1Q^IS?TGYxX?FKl%>*&vVe*|MZTr_F$|Ci-7h#0xy%hY+ovLRbSv;^Gn&AQO^e~|3sJ^XjztSR#q0{^75a5{PxS2kePpSJfy7Pe_s&) zUk&76)iXa*k|jJz$Z6&o0cfW3t@Ym0oFiD*h5Y8~C59l&cj0>5k+lnC1!-YT&FDlsDC%k(`aNLg3@YWIhDr}Bb3!;K~#@l+V~L!6D>K~=%U|Q z%$5t3MZXr>O_QK+z|`Q^1_qelWH5F27M5^*k@fxsPI!uP#R9^(shOEvJk03%-Gc0ah=|sm;S?_Qs{4MOIkNG-wT-dB#;E(9f@m*e$vjm zZyGdp@>K8XesSw>Qvn^7YuwRcpgefZq5GrFdR-e$0#djPzu$7ew#)do8)Z6kxU>`7 z*e7Sy*Brs^3rG9AecegtNbW%Kg(r-!Xa#e1Oftql+@_pvTmR;+u^2~RT}}>uej^+r z-2_H{s)9f=5*H))<3ge6ZRk`uSrg~^rlcV2XVcGhns5Q)B&biNk4ZukNI zfEGAE8;R@$6%U;wSBph%uNgYf%#gp%A8HP+7MB!zX^;|tDm2BgpdPcV75K5NU>=30(jDGerB!~=xq^8u zeT|Jub_H0f(C&{SD9UOcV*D1s6-Im&uinQ_Iq$25ur{V|I-te0 z5csK$D41(rQH8d>$AZYQscWo>ZN200diV@>mg#v^W&4jm8TetWbrX>*b>-~%Tw zpJ{F?lsZY_#ty3t&kf+pvi?p7;Un6=D6u3l2O#M{+I zhBdvrUPgxWa^xmDGSSo3F`opc5-l6oEZ>3dp+U?%Is5Eq-CCd%Il^#6yC6WI{zd#AT?L{B-aG?bF zfrWM`O2Bxk^PZGC=n3jXuX)ev{_(-nji48vj7-cS5BtbqGnMVtTi?vVIaAXNP0OL@ z32MGB&OSz_BCNC_TfKux1a$0A^J;9(j@6ANPpluH+7gua=J1+3K^>jg4$M_b$G!DS zn*k#oczr{&_mo4S=$+Fa9#~x2={%b89xh!H0>+504EPOK5oLYR+if9t@jUYO=T108 zZ|P|`Npf{Ex~>~%eMX#&n3g|8LlZ0Xgb_y@aC^sf%kB#)fBPM=q!E4na1z-xj8 z>QfdOsF3ID$IM1^cc*rWXYIu1;sVBxmgsis{y4pE#w?I%KYyzq!oTJv{-k8mVaRTH zzD4%CqwF!)YiJ$yvz7TTE%a>YFLYCUadwp7aa*sDnM+W7Fl^1b#q)BB^A6!g=xOzn za={JT>bmty$w$?l3QoO_#T*=}1PfK{AHyYZ4s)#DEf7KVO@Ty&x))nwupi=bea6_W zQIAx|cblm5%i3UWu02`JnW__!Tm++z@+vPp*7|f+S~Q&4CCfQeUc#1mauMZwulsvOKpjFhK&65Da(2 zZX6dRxr-1t47}M-oE_wZ@>`o&=XL-DHOm-8v^~hI~3s+k< z#16;iD7>YBMF|jn_)q(WTz}c8N4C$KGRWuK-VVnK&YwKbf{9(9tGzHi$4a}vGQ}{7 zzVHR%T(gjjbPRa~o}8RKZasEhXc~Dfwf-}~lm3mFSq@bxfsNa6^4vvL+6UrX_a=Wz zgm*4@jMo0pv8+G(UfQv7Z|D+tl*e-G#l-ikXkVnDR+=w1TFia&Y=i;SkJSJ552AiV z6TYYD;?_Fn2An4T<3}YY`N(R+2IpF(f`Jjcg(jEc5oIvCRJUMpTqpP4rC(Y9rpBpi zLE!LHmsKyMSA)!ru8VN(jgsGo3uoqLs?LDcpC7FrpscQ2iVpr*d{4%=Kf4Q}zFfgt z`F#yq-2N0Y1Tn9b|Ebxt!+?ap4gDbF);*ei0eaBPFAANlp123B#tN zy7zx~Bbqq9e2mjHa?Glx^=Am^BYnsi?vB{49+=psoG)TeRl1sI@c)@1kR@HbPXFD4 zaQ{r#=%ZvovZm0D` z(8|eY{=JhM7ewzO%mj+n)`(7RqNR{9JAbS7sGat>51us<8|Psvx6tTB13LZLYtb(z zENlUEAZVom8jO3NIipK-8hK#qH~oStZhV-a%AECXhV(ljZM;w56iHXG@GXmJT>&;t{pctTo2d&FyrR7I_^8Xm_5KK_DiKDRo;e4Z0(T5M`7++*Zl(kGu7&5c6FhF#4bZ^>ys)Rka zG-l3$KUapcDD0V-anXlPxxz|t8u_PIbgL77=k zUoPJea&W~ZTB{gogSvMe@o-;5WL2*&1{gA;z}LP7=598>FNeFgF}SU*xIy#>IX=o3ZtZ8)ND}u~qrI6E}c|-s2)%V7--Db`^`vT_i7@4959X>R_$7 zP+=&@FDtqEfTp+FHQl;@DAbvl)AJp*XwW5&nct?&XB+-xL&|Vc$QC7tM1-T`Q34<3 z#5`QbQ+_g1!TLQ$wuJAfwS@IBEtT{UC{E1zn>-t5i^-9I`>^MoVnY^evxk{Ic08>$#N71+oKS5s^IOW>@N_ z`IO?~rx&4KxpOYkj&B;)Yv^bGV&k&cj8&&`UjIOs-sZ}fSRR!!P8~*!b>zJuG2eu- za%pkB@Q%ZoNyk~foZCgW({p>&`y01qfpX%{YSVU1=(|ySSJ$6A;{_O?zP`RMi(h&s zgFtu1`JWH>S}cTF)rm{%>K+Uobkek3nB~?z07*{d{ovQnq#K_#8#D^5IiQK~6?5)R z%KO-L*uK%m*o%i_sBC4wrK5*B;f&272TdydU}LnEHc*u57>-%xLs^>gxY=5J1*r&Q z(Cds=V^ZyKTK9u$8L4bRZuKrLO`C^#!(+qk3^><8uyUderf;pD+v0$uEo6Ne-J*$a z4@tMD@{wE-g!IOc;W6ACi9%Y;u)sb&8&B6n53Q(Zu%bgn9Q(OiX}eEfs9-9UU<(OlRXuuJ{`? zV(H%3aK>zw6=YioGv{K#NkV|Ae&Z;#xZuMk#w=kgFOjXK?6XisQ*YyIJ#;9?llpmc zhCD0%g=ew#pZUgDKr1eqn7}!CakV#w;^9LaZae8cQ3yy&-B#Y?1F=TM9-+ZAq1=k~ zXpGL#F_hX80NK;Sp~$^8rDhFzib{~>`dzf($Y~tX#*ay z_4eygurtOK8snxPTH$^#D=-e_U1E6!KLLQJaDF8qRkPGvXgBfK-L8%T^vdOvt8eTK z2hb4ip|Z16U*`_0dDbR!r3JZiL{6p6%(&2$!7cIf2-s3v+;1ykXaHaOcHKnKh8PsD z>vIG5ruPG%)b9TEmVvl ziwK;tzFeC8l$;#?;RCUkSvz$U$TjN)CD5tnFag(x4INiFTRq|+}hkR;IP7@4`1O24F}*jy(DT3-X9d#qsK*KFubf)O(v zC^{Kxic;{STq;tW5M=&x0D0iHQ{J{Jz(TzRz-8;)GfP*4B6v~WWPTsRp1C>y_%3>r zUSonX?UJ?zbJ~p`c+4KVp1)veW6bF#klEBq$hVkVQrz-9oGef0M+Dbs`4s z4n&6mKnT6f?nKcdB6u~5hRQU&NIh+SzLAIn?0un5cB8lE?cK|uRWf-rlGK%nesp_# zi`jLJwmi4hm}oYD(*rEL^6;q3Lrno4G*GAnW~P{1&J$}{ZOP+EVc!E20K5(Bgm6hj zY0F$qQB&fJfkPr-%l7STTkz2HgJ4rZPwvo%*dE-NyT%1IHu6B%Z9?L(Bcj&2KeIfr z|05$O4^Q98=1{Hssyt|hjvTaj*L_1c*|Z0dVL02wefJK%UBO;*)AXL{m)hlzxW8G< zzJ-XN$rLc6z1PhtXlS-Uq0!N}tYTjAXtV*vSf@qUgPl&DLbn7c-J5rhCvtDCd#D^F z5~H@gl0R=6<=dTZjeMWC5Ce4KStp^Aw!&i#fD=;7t={0{X2a(EP4p9mpGpglaD;`0 zRVX>Mut8oQW4nL6r*ugOKL}X~R$bmiAyc#&J7hwWD=XknQmejP#~DK83$T3We)#Yq@JAa9nJPx`K*7}Gag-oJXlLja_ed-P z5whe}@!WHZSWQh01XAozEGR6*wj2E_XJYcz#f4lB*y!L_>}{J>fMy(V?AVX;j3I+8 zSP3KuF)%tx?eoy_Xr<>PO!`_Qz&oX!Td+my>1W$sbpWY|rR^5=DF?27vBS11%QC{go%s&@lT+=BqlB5E9=h&Zb zjIjv+XL!8VTc~_JX;oDtFioaP1>Sh%-Mhv!@uxaVK-IidS}ykcf57oaopoC?8xr8H zig7)2qXiY|-TPLIZc9zL>GO~oyPkh{lw2eKI7-KRA0rpr4a`?;4r7VskHXC(_|Nxo z{tNtQ>f6hq8K@zk*L<=RR6{w3{34`wo2pE8Cf&4)b;$i<=b7?-yQC-Y(3eSPqM^Sq zYrUQ8JiDrE&5}1@i0(E{}dg2;Ou_(4<6?c&sGJ*9A)XE2OALnvfEG=7AK^Zo7?=@t63P<%7rL(uN^*o6VGlsVCe+)klG zqUy2+&h8CHLxy^gq2{UX>}Gu^&D71W=$}I^I-c{{w#-^LtJ9ku(>6+7WqG8UB;JLG z%I2oP0`N4bEp{OjtTp(UP&~T|$5l&5LH?GX9;ZxZZg-86$)=;Vy6x+4bBsj3rs;=@ zgHCK$Dokq!SRr(kUZew7Ac;*jWKv^QpC(;X6j8BsvzqG=-Z7e%FNTv|Nhj z<~K#{x@wU-N+T#uq(<|!jBm&&oKc8ipO(Ff$^0{aN;P2rjo9|_MqR2)MEXG+F~9#2 z%S96kTgEg$c~ZzHqdlNGt==Pne2z@#M@sV~^ur~w+p zGD8SH>vrYbz5a>^FhTJu0@`DqGobB$B}wz*G5|Fb0&K~2p>G%%magTUhZk;d@vJ<;bTyp_c8juFrCdDx=wc^e6!d4+Ca&>6qPx8N?Z z0#_dK_s6?3LJR}~rvy~~ocMkavJDrR>!W|@vZ2javSB;dopfi5l^G8}FP}aZV-^}u z{5mbf^ciGvlzYzC!+b*K_VWf{NfpinHm$H4(8Lcdrl>v0)Zgk&3LyXqci~g>8l7zd zJ-ifYbMVs82|p#KWP*x|WT^L6uZ210%9UcN%yWySG=MX06dFlVMf6mRHFqg?%32Bt zA1`m8fc}_Aw$(VC{fi<9smY^JD$0h-x2{`o%SPJ)^}Dx_?E>bp!P4Q_eL*IX{rGQt z@xV6@u+y1?gY7*u_OHg;|9Lkgx;l#B{n!%;31ctHSpI0X|KZ*p;{n&)J-Wp!blr|u z(Xvd#Zgf|*&m(;Xan~aEFejHwmz(XhKs07EFCfEaQ%u}m)L&k2+Z_pFjH7OcV=R9} z?g&bD@mE9tMJ?=2W9Icd=RP5`p0D1p6DR!UE|!!egHI zX7JT3JC@j7MIp>r%DjlP(Dc^Qk^Y4?IRizxX7BlxW)1mX^U5Sbts9yfbD^CS<6cb& zOQq83hjV^vzC8^8_<*U+%D8ao?`Fetzx8ac6~-T!Etr1b8uy23(YDJryRz>5J2Kvf zFZG|VbnVB%WSUGMEPlBTvW}kP?Th8j9?KsFIe`i)_C2D!y>c2mLK>I!#GG6f*^~Wc zj}n_qd`jWR&n@mRsk^19=Xuta&!uee*;M#NC_W_|d&Tdqii|{D{&**Od=>qp`2gH7 zXxPdj4NvlGxx7xAf=F6vu3h8VUi~w&LdW>N1)y5VG2z@_5qOO?cvYed)6Wx?jr7er zyTL4yp6~etSPJ6^Nc~Sz~@w_qky6ctNemm6vG;e`#`C`o67#%pQ zaV-T}X|+!2?gbHq;{k5SJk`vFAMrO6V6Qnj9V4NW+Y68jUHT(fQ2#BxZD@wk??`ZH2hji0Nm94LTm%~fo z`bE1-CyiBrSaC9Og#(vxW4H-l`9L~GP61=hX9k*g6`azeMU@%iWXow0cv)KQnlVMd zuvb6ic!dn$0&l=Qi&Xt$*Y{yOUdVtVAc7S!%vV`DdKJA(eaQvOu;G5SIgtB!=Yo6d z#@DsJHj7)__f=!ew{J0;eD`8jArED7+ka0Mh?H- z+Axb8bTKU;^6XXJe9*?XU!el3ss@HjtjIGhrN^-!Lk}8Pf6F65{C-Iju~R>>jszg* z3#<*Qw@Y15PTELVX_1h&3swkYour mind starts to restore some of it's clarity as you feel the effects of the drug wain.") if (mental_capacity <= 500 || phase == 4) - if (owner.reagents.has_reagent("mannitol")) + if (owner.reagents.has_reagent(/datum/reagent/medicine/mannitol)) mental_capacity += 5 - if (owner.reagents.has_reagent("neurine")) + if (owner.reagents.has_reagent(/datum/reagent/medicine/neurine)) mental_capacity += 10 //mindshield check @@ -380,7 +380,7 @@ if(owner.client?.prefs.lewdchem && !customEcho) to_chat(owner, "[pick("I belong to [enthrallGender].", "[enthrallGender] knows whats best for me.", "Obedence is pleasure.", "I exist to serve [enthrallGender].", "[enthrallGender] is so dominant, it feels right to obey them.")].") if (4) //mindbroken - if (mental_capacity >= 499 && (owner.getOrganLoss(ORGAN_SLOT_BRAIN) <=0 || HAS_TRAIT(M, TRAIT_MINDSHIELD)) && !owner.reagents.has_reagent("MKUltra")) + if (mental_capacity >= 499 && (owner.getOrganLoss(ORGAN_SLOT_BRAIN) <=0 || HAS_TRAIT(M, TRAIT_MINDSHIELD)) && !owner.reagents.has_reagent(/datum/reagent/fermi/enthrall)) phase = 2 mental_capacity = 500 customTriggers = list() @@ -752,18 +752,18 @@ deltaResist*= 0.5-(((2/200)*M.arousalloss)/1)//more aroused you are, the weaker resistance you can give, the less you are, the more you gain. (+/- 0.5) //chemical resistance, brain and annaphros are the key to undoing, but the subject has to to be willing to resist. - if (owner.reagents.has_reagent("mannitol")) + if (owner.reagents.has_reagent(/datum/reagent/medicine/mannitol)) deltaResist *= 1.25 - if (owner.reagents.has_reagent("neurine")) + if (owner.reagents.has_reagent(/datum/reagent/medicine/neurine)) deltaResist *= 1.5 if (!HAS_TRAIT(owner, TRAIT_CROCRIN_IMMUNE) && M.canbearoused) - if (owner.reagents.has_reagent("anaphro")) + if (owner.reagents.has_reagent(/datum/reagent/drug/anaphrodisiac)) deltaResist *= 1.5 - if (owner.reagents.has_reagent("anaphro+")) + if (owner.reagents.has_reagent(/datum/reagent/drug/anaphrodisiacplus)) deltaResist *= 2 - if (owner.reagents.has_reagent("aphro")) + if (owner.reagents.has_reagent(/datum/reagent/drug/aphrodisiac)) deltaResist *= 0.75 - if (owner.reagents.has_reagent("aphro+")) + if (owner.reagents.has_reagent(/datum/reagent/drug/aphrodisiacplus)) deltaResist *= 0.5 //Antag resistance diff --git a/modular_citadel/code/game/objects/items/storage/firstaid.dm b/modular_citadel/code/game/objects/items/storage/firstaid.dm index 95c88ecc..2b52374f 100644 --- a/modular_citadel/code/game/objects/items/storage/firstaid.dm +++ b/modular_citadel/code/game/objects/items/storage/firstaid.dm @@ -63,8 +63,8 @@ if(empty) return new /obj/item/hypospray/mkii/tricord(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/tricord(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/tricord(src) /obj/item/storage/hypospraykit/fire name = "burn treatment hypospray kit" @@ -76,8 +76,8 @@ if(empty) return new /obj/item/hypospray/mkii/burn(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/kelotane(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/kelotane(src) /obj/item/storage/hypospraykit/toxin name = "toxin treatment hypospray kit" @@ -88,8 +88,8 @@ if(empty) return new /obj/item/hypospray/mkii/toxin(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/antitoxin(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/antitoxin(src) /obj/item/storage/hypospraykit/o2 name = "oxygen deprivation hypospray kit" @@ -100,8 +100,8 @@ if(empty) return new /obj/item/hypospray/mkii/oxygen(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/dexalin(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/dexalin(src) /obj/item/storage/hypospraykit/enlarge name = "organomegaly trauma hypospray kit" @@ -112,12 +112,12 @@ if(empty) return new /obj/item/hypospray/mkii/enlarge(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/breastreduction(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/breastreduction(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/breastreduction(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/penisreduction(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/penisreduction(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/penisreduction(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/breastreduction(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/breastreduction(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/breastreduction(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/penisreduction(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/penisreduction(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/penisreduction(src) /obj/item/storage/hypospraykit/brute name = "brute trauma hypospray kit" @@ -128,8 +128,8 @@ if(empty) return new /obj/item/hypospray/mkii/brute(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine(src) - new /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/bicaridine(src) + new /obj/item/reagent_containers/glass/bottle/vial/small/bicaridine(src) /obj/item/storage/hypospraykit/tactical name = "combat hypospray kit" @@ -141,8 +141,8 @@ return new /obj/item/defibrillator/compact/combat/loaded(src) new /obj/item/hypospray/mkii/CMO/combat(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/combat(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/combat(src) /obj/item/storage/hypospraykit/cmo name = "deluxe hypospray kit" @@ -161,11 +161,11 @@ if(empty) return new /obj/item/hypospray/mkii/CMO(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/tricord(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/charcoal(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/salglu(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/dexalin(src) - new /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/synthflesh(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/tricord(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/charcoal(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/salglu(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/dexalin(src) + new /obj/item/reagent_containers/glass/bottle/vial/large/synthflesh(src) /obj/item/storage/box/vials name = "box of hypovials" diff --git a/modular_citadel/code/modules/arousal/arousal.dm b/modular_citadel/code/modules/arousal/arousal.dm index 5f31d788..8ab3c58a 100644 --- a/modular_citadel/code/modules/arousal/arousal.dm +++ b/modular_citadel/code/modules/arousal/arousal.dm @@ -28,9 +28,9 @@ /datum/species var/arousal_gain_rate = AROUSAL_START_VALUE //Rate at which this species becomes aroused var/arousal_lose_rate = AROUSAL_START_VALUE //Multiplier for how easily arousal can be relieved - var/list/cum_fluids = list("semen") - var/list/milk_fluids = list("milk") - var/list/femcum_fluids = list("femcum") + var/list/cum_fluids = list(/datum/reagent/consumable/semen) + var/list/milk_fluids = list(/datum/reagent/consumable/milk) + var/list/femcum_fluids = list(/datum/reagent/consumable/femcum) //Mob procs /mob/living/carbon/human/proc/underwear_toggle() diff --git a/modular_citadel/code/modules/arousal/organs/breasts.dm b/modular_citadel/code/modules/arousal/organs/breasts.dm index 67cd4628..b88c4883 100644 --- a/modular_citadel/code/modules/arousal/organs/breasts.dm +++ b/modular_citadel/code/modules/arousal/organs/breasts.dm @@ -12,7 +12,7 @@ //var/breast_sizes = list ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "huge", "massive", "giga", "impossible", "flat") var/breast_values = list ("a" = 1, "b" = 2, "c" = 3, "d" = 4, "e" = 5, "f" = 6, "g" = 7, "h" = 8, "i" = 9, "j" = 10, "k" = 11, "l" = 12, "m" = 13, "n" = 14, "o" = 15, "huge" = 16, "massive" = 17, "giga" = 25, "impossible" = 30, "flat" = 0) // Note: Do not forget to define new sizes. var/statuscheck = FALSE - fluid_id = "milk" + fluid_id = /datum/reagent/consumable/milk var/amount = 2 fluid_mult = 0.25 // Set to a lower value due to production scaling with size (I.E. D cups produce the "normal" amount) fluid_max_volume = 10 @@ -80,7 +80,7 @@ //string = "breasts_[lowertext(shape)]_[size]-s" if(producing && sent_full_message) - desc += " They're leaking [fluid_id]." + desc += " They're leaking [initial(fluid_id.name)]." var/string if(owner) if(owner.dna.species.use_skintones && owner.dna.features["genitals_use_skintone"]) diff --git a/modular_citadel/code/modules/arousal/organs/genitals.dm b/modular_citadel/code/modules/arousal/organs/genitals.dm index 89f26775..4ac28ea0 100644 --- a/modular_citadel/code/modules/arousal/organs/genitals.dm +++ b/modular_citadel/code/modules/arousal/organs/genitals.dm @@ -9,7 +9,7 @@ var/can_climax = FALSE var/fluid_transfer_factor = 0.0 //How much would a partner get in them if they climax using this? var/size = 2 //can vary between num or text, just used in icon_state strings - var/fluid_id = null + var/datum/reagent/fluid_id = null var/fluid_max_volume = 15 var/fluid_efficiency = 1 var/fluid_rate = 1 diff --git a/modular_citadel/code/modules/arousal/organs/testicles.dm b/modular_citadel/code/modules/arousal/organs/testicles.dm index a7578257..be570831 100644 --- a/modular_citadel/code/modules/arousal/organs/testicles.dm +++ b/modular_citadel/code/modules/arousal/organs/testicles.dm @@ -13,7 +13,7 @@ //fluid_mult = 0.133 // Set to a lower value due to production scaling with size (I.E. 6 inches the "normal" amount) fluid_mult = 1.0 //Defaults to 1 no matter what you do. It just does. Just gonna adapt I guess. fluid_max_volume = 3 - fluid_id = "semen" + fluid_id = /datum/reagent/consumable/semen producing = TRUE can_masturbate_with = FALSE masturbation_verb = "massage" diff --git a/modular_citadel/code/modules/arousal/organs/womb.dm b/modular_citadel/code/modules/arousal/organs/womb.dm index 28d7bb43..2f89d4c6 100644 --- a/modular_citadel/code/modules/arousal/organs/womb.dm +++ b/modular_citadel/code/modules/arousal/organs/womb.dm @@ -6,7 +6,7 @@ zone = "groin" slot = "womb" internal = TRUE - fluid_id = "femcum" + fluid_id = /datum/reagent/consumable/femcum producing = TRUE var/pregnant = FALSE //this is for pregnancy code diff --git a/modular_citadel/code/modules/clothing/glasses/phantomthief.dm b/modular_citadel/code/modules/clothing/glasses/phantomthief.dm index b1b351b3..716e33c7 100644 --- a/modular_citadel/code/modules/clothing/glasses/phantomthief.dm +++ b/modular_citadel/code/modules/clothing/glasses/phantomthief.dm @@ -25,11 +25,10 @@ . += "[DisplayTimeText(nextadrenalinepop - world.time)] left before the adrenaline injector can be used again." /obj/item/clothing/glasses/phantomthief/syndicate/proc/injectadrenaline(mob/user, combatmodestate) - if(istype(user)) - if(combatmodestate && world.time >= nextadrenalinepop) - nextadrenalinepop = world.time + 5 MINUTES - user.reagents.add_reagent("syndicateadrenals", 5) - user.playsound_local(user, 'modular_citadel/sound/misc/adrenalinject.ogg', 100, 0, pressure_affected = FALSE) + if(istype(user) && combatmodestate && world.time >= nextadrenalinepop) + nextadrenalinepop = world.time + 5 MINUTES + user.reagents.add_reagent(/datum/reagent/syndicateadrenals, 5) + user.playsound_local(user, 'modular_citadel/sound/misc/adrenalinject.ogg', 100, 0, pressure_affected = FALSE) /obj/item/clothing/glasses/phantomthief/syndicate/equipped(mob/user, slot) . = ..() diff --git a/modular_citadel/code/modules/mining/mining_ruins.dm b/modular_citadel/code/modules/mining/mining_ruins.dm index 66b6fd04..f744ee4e 100644 --- a/modular_citadel/code/modules/mining/mining_ruins.dm +++ b/modular_citadel/code/modules/mining/mining_ruins.dm @@ -23,4 +23,4 @@ desc = "A syringe filled with a strange viscous liquid. It might be best to leave it alone." amount_per_transfer_from_this = 1 volume = 1 - list_reagents = list("xenomicrobes" = 1) \ No newline at end of file + list_reagents = list(/datum/reagent/xenomicrobes = 1) diff --git a/modular_citadel/code/modules/mob/living/simple_animal/banana_spider.dm b/modular_citadel/code/modules/mob/living/simple_animal/banana_spider.dm index d2006cd1..0705d2e4 100644 --- a/modular_citadel/code/modules/mob/living/simple_animal/banana_spider.dm +++ b/modular_citadel/code/modules/mob/living/simple_animal/banana_spider.dm @@ -140,10 +140,10 @@ icon_state = "banana_peel" bitesize = 3 eatverb = "devours" - list_reagents = list("nutriment" = 3, "vitamin" = 2) + list_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2) foodtype = GROSS | MEAT | RAW - grind_results = list("blood" = 20, "liquidgibs" = 5) - juice_results = list("banana" = 0) + grind_results = list(/datum/reagent/blood = 20, /datum/reagent/liquidgibs = 5) + juice_results = list(/datum/reagent/consumable/banana = 0) /obj/item/reagent_containers/food/snacks/deadbanana_spider/Initialize() diff --git a/modular_citadel/code/modules/projectiles/boxes_magazines/external/pistol.dm b/modular_citadel/code/modules/projectiles/boxes_magazines/external/pistol.dm index 886a07e4..f8f06829 100644 --- a/modular_citadel/code/modules/projectiles/boxes_magazines/external/pistol.dm +++ b/modular_citadel/code/modules/projectiles/boxes_magazines/external/pistol.dm @@ -4,7 +4,7 @@ id = "10mminc" build_type = PROTOLATHE materials = list(MAT_PLASMA = 50000, MAT_METAL = 18000) - reagents_list = list("plasma" = 120, "napalm" = 240) + reagents_list = list(/datum/reagent/toxin/plasma = 120, /datum/reagent/napalm = 240) build_path = /obj/item/ammo_box/magazine/m10mm/fire category = list("Weapons") departmental_flags = DEPARTMENTAL_FLAG_SECURITY @@ -25,7 +25,7 @@ id = "10mmhp" build_type = PROTOLATHE materials = list(MAT_METAL = 40000, MAT_GLASS = 50000) - reagents_list = list("sonic_powder" = 280) + reagents_list = list(/datum/reagent/sonic_powder = 280) build_path = /obj/item/ammo_box/magazine/m10mm/hp category = list("Ammo") departmental_flags = DEPARTMENTAL_FLAG_SECURITY diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm index f582026b..a51beb98 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm @@ -131,8 +131,7 @@ Creating a chem with a low purity will make you permanently fall in love with so /datum/reagent/fermi/enthrall name = "MKUltra" - id = "enthrall" - description = "A forbidden deep red mixture that overwhelms a foreign body with waves of pleasure, intoxicating them into servitude. When taken by the creator, it will enhance the draw of their voice to those affected by it." + description = "A forbidden deep red mixture that increases a person's succeptability to another's words. When taken by the creator, it will enhance the draw of their voice to those affected by it." color = "#660015" // rgb: , 0, 255 taste_description = "synthetic chocolate, a base tone of alcohol, and high notes of roses" overdose_threshold = 100 //If this is too easy to get 100u of this, then double it please. @@ -149,7 +148,6 @@ Creating a chem with a low purity will make you permanently fall in love with so /datum/reagent/fermi/enthrall/test name = "MKUltraTest" - id = "enthrallTest" description = "A forbidden deep red mixture that makes you like Fermis a little too much. Unobtainable and due to be removed from the wiki." data = list("creatorID" = "honkatonkbramblesnatch", "creatorGender" = "Mistress", "creatorName" = "Fermis Yakumo") creatorID = "honkatonkbramblesnatch"//ckey @@ -158,7 +156,6 @@ Creating a chem with a low purity will make you permanently fall in love with so purity = 1 /datum/reagent/fermi/enthrall/test/on_new() - id = "enthrall" ..() creator = get_mob_by_key(creatorID) @@ -205,7 +202,7 @@ Creating a chem with a low purity will make you permanently fall in love with so if(purity < 0.5)//DO NOT SPLIT INTO DIFFERENT CHEM: This relies on DoNotSplit - has to be done this way. if(volume < 0.5)//You don't get to escape that easily FallInLove(pick(GLOB.player_list), M) - M.reagents.remove_reagent(id, volume) + M.reagents.remove_reagent(type, volume) if (M.ckey == creatorID && creatorName == M.real_name)//If the creator drinks it, they fall in love randomly. If someone else drinks it, the creator falls in love with them. if(M.has_status_effect(STATUS_EFFECT_INLOVE))//Can't be enthralled when enthralled, so to speak. @@ -221,7 +218,7 @@ Creating a chem with a low purity will make you permanently fall in love with so if(LAZYLEN(seen)) return - M.reagents.remove_reagent(id, volume) + M.reagents.del_reagent(type) FallInLove(M, pick(seen)) return @@ -230,7 +227,7 @@ Creating a chem with a low purity will make you permanently fall in love with so if(M.has_status_effect(STATUS_EFFECT_INLOVE)) return if((C in viewers(7, get_turf(M))) && (C.client)) - M.reagents.remove_reagent(id, volume) + M.reagents.del_reagent(type) FallInLove(C, M) return @@ -299,7 +296,6 @@ Creating a chem with a low purity will make you permanently fall in love with so //Creates a gas cloud when the reaction blows up, causing everyone in it to fall in love with someone/something while it's in their system. /datum/reagent/fermi/enthrallExplo//Created in a gas cloud when it explodes name = "Gaseous MKUltra" - id = "enthrallExplo" description = "A forbidden deep red gas that overwhelms a foreign body, causing the person they next lay their eyes on to become more interesting. Studies have shown that people are 66% more likely to make friends with this in the air. Produced when MKUltra explodes." color = "#2C051A" // rgb: , 0, 255 metabolization_rate = 0.1 diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 0ed95586..09fbf754 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -39,7 +39,6 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //Clone serum #chemClone /datum/reagent/fermi/SDGF //vars, mostly only care about keeping track if there's a player in the clone or not. name = "synthetic-derived growth factor" - id = "SDGF" description = "A rapidly diving mass of Embryonic stem cells. These cells are missing a nucleus and quickly replicate a host’s DNA before growing to form an almost perfect clone of the host. In some cases neural replication takes longer, though the underlying reason underneath has yet to be determined." color = "#a502e0" // rgb: 96, 0, 255 var/playerClone = FALSE @@ -54,9 +53,9 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING var/pollStarted = FALSE var/location_created var/startHunger - impure_chem = "SDGFtox" + impure_chem = /datum/reagent/impure/SDGFtox inverse_chem_val = 0.5 - inverse_chem = "SDZF" + inverse_chem = /datum/reagent/impure/SDZF can_synth = TRUE @@ -118,8 +117,8 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING SM.nutrition = startHunger/2 //Transfer remaining reagent to clone. I think around 30u will make a healthy clone, otherwise they'll have clone damage, blood loss, brain damage and hunger. - SM.reagents.add_reagent("SDGFheal", volume) - M.reagents.remove_reagent(id, volume) + SM.reagents.add_reagent(/datum/reagent/fermi/SDGFheal, volume) + M.reagents.remove_reagent(type, volume) log_game("FERMICHEM: [volume]u of SDGFheal has been transferred to the clone") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Sentient clones made") return @@ -137,7 +136,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING M.adjustBruteLoss(-1, 0) M.adjustFireLoss(-1, 0) M.heal_bodypart_damage(1,1) - M.reagents.remove_reagent(id, 1)//faster rate of loss. + M.reagents.remove_reagent(type, 1)//faster rate of loss. else //If there's no ghosts, but they've made a large amount, then proceed to make flavourful clone, where you become fat and useless until you split. switch(current_cycle) if(21) @@ -182,7 +181,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING log_game("FERMICHEM: [M] ckey: [M.key] has created a mindless clone of themselves") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Braindead clones made") if(87 to INFINITY) - M.reagents.remove_reagent(id, volume)//removes SGDF on completion. Has to do it this way because of how i've coded it. If some madlab gets over 1k of SDGF, they can have the clone healing. + M.reagents.remove_reagent(type, volume)//removes SGDF on completion. Has to do it this way because of how i've coded it. If some madlab gets over 1k of SDGF, they can have the clone healing. ..() @@ -263,18 +262,17 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING SM.set_species(mutation) //Transfer remaining reagent to clone. I think around 30u will make a healthy clone, otherwise they'll have clone damage, blood loss, brain damage and hunger. - SM.reagents.add_reagent("SDGFheal", volume) - M.reagents.remove_reagent(id, volume) - + SM.reagents.add_reagent(/datum/reagent/fermi/SDGFheal, volume) + log_combat(M, M, "SDGF clone-vived", src) + M.reagents.del_reagent(type) SM.updatehealth() SM.emote("gasp") - log_combat(M, M, "SDGF clone-vived", src) + return ..() //Unobtainable, used in clone spawn. /datum/reagent/fermi/SDGFheal name = "synthetic-derived healing factor" - id = "SDGFheal" description = "Leftover SDGF is transferred into the resulting clone, which quickly heals up the stresses from suddenly splitting. Restores blood, nutrition, and repaires brain and clone damage quickly. Only obtainable from using excess SDGF, and only enters the cloned body." metabolization_rate = 1 can_synth = FALSE @@ -290,7 +288,6 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //Unobtainable, used if SDGF is impure but not too impure /datum/reagent/impure/SDGFtox name = "Synthetic-derived apoptosis factor" - id = "SDGFtox" description = "Impure synthetic-derived growth factor causes certain cells to undergo cell death, causing clone damage, and damaging blood cells."//i.e. tell me please, figure it's a good way to get pinged for bugfixes. metabolization_rate = 1 can_synth = FALSE @@ -303,7 +300,6 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //Fail state of SDGF /datum/reagent/impure/SDZF name = "synthetic-derived zombie factor" - id = "SDZF" description = "A horribly peverse mass of Embryonic stem cells made real by the hands of a failed chemist. Emulates normal synthetic-derived growth factor, but produces a hostile zombie at the end of it." color = "#a502e0" // rgb: 96, 0, 255 metabolization_rate = 0.5 * REAGENTS_METABOLISM @@ -335,7 +331,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING M.adjustToxLoss(1, 0)// the warning! if(86)//mean clone time! - if (!M.reagents.has_reagent("pen_acid"))//Counterplay is pent.) + if (!M.reagents.has_reagent(/datum/reagent/medicine/pen_acid))//Counterplay is pent.) message_admins("(non-infectious) SDZF: Zombie spawned at [M] [COORD(M)]!") M.nutrition = startHunger - 500//YOU BEST BE RUNNING AWAY AFTER THIS YOU BADDIE M.next_move_modifier = 1 @@ -349,7 +345,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING ZI.name = M.real_name ZI.desc = "[M]'s clone, gone horribly wrong." log_game("FERMICHEM: [M] ckey: [M.key]'s clone has become a horrifying zombie instead") - M.reagents.remove_reagent(id, 20) + M.reagents.remove_reagent(type, 20) else//easier to deal with to_chat(M, "The pentetic acid seems to have stopped the decay for now, clumping up the cells into a horrifying tumour!") @@ -359,11 +355,12 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING S.name = "Living teratoma" S.real_name = "Living teratoma"//horrifying!! S.rabid = 1//Make them an angery boi - M.reagents.remove_reagent(id, volume) + M.reagents.remove_reagent(type, volume) to_chat(M, "A large glob of the tumour suddenly splits itself from your body. You feel grossed out and slimey...") log_game("FERMICHEM: [M] ckey: [M.key]'s clone has become a horrifying teratoma instead") SSblackbox.record_feedback("tally", "fermi_chem", 1, "Zombie clones made!") if(87 to INFINITY) - M.adjustToxLoss(1, 0) + M.adjustToxLoss(2, 0) + M.reagents.remove_reagent(type, 1) ..() diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/astrogen.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/astrogen.dm index 995bc84a..ca661316 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/astrogen.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/astrogen.dm @@ -15,7 +15,6 @@ I'd like to point out from my calculations it'll take about 60-80 minutes to die /datum/reagent/fermi/astral // Gives you the ability to astral project for a moment! name = "Astrogen" - id = "astral" description = "An opalescent murky liquid that is said to distort your soul from your being." color = "#A080H4" // rgb: , 0, 255 taste_description = "your mind" @@ -74,7 +73,7 @@ I'd like to point out from my calculations it'll take about 60-80 minutes to die if(prob(50)) to_chat(G, "The high conentration of Astrogen in your blood causes you to lapse your concentration for a moment, bringing your projection back to yourself!
    ") do_teleport(G, M.loc) - M.reagents.remove_reagent(id, current_cycle/10, FALSE)//exponent + metabolization_rate = current_cycle/10 //exponential sleepytime+=5 if(G)//This is a mess because of how slow qdel is, so this is all to stop runtimes. if(G.mind) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/eigentstasium.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/eigentstasium.dm index 00c6338a..a83ebe60 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/eigentstasium.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/eigentstasium.dm @@ -11,7 +11,6 @@ /datum/reagent/fermi/eigenstate name = "Eigenstasium" - id = "eigenstate" description = "A strange mixture formed from a controlled reaction of bluespace with plasma, that causes localised eigenstate fluxuations within the patient" taste_description = "wiggly cosmic dust." color = "#5020F4" // rgb: 50, 20, 255 @@ -69,8 +68,9 @@ /datum/reagent/fermi/eigenstate/on_mob_delete(mob/living/M) //returns back to original location do_sparks(5,FALSE,M) to_chat(M, "You feel your wavefunction collapse!") - do_teleport(M, location_return, 0, asoundin = 'sound/effects/phasein.ogg') //Teleports home - do_sparks(5,FALSE,M) + if(!M.reagents.has_reagent(/datum/reagent/stabilizing_agent)) + do_teleport(M, location_return, 0, asoundin = 'sound/effects/phasein.ogg') //Teleports home + do_sparks(5,FALSE,M) qdel(Eigenstate) ..() @@ -168,7 +168,7 @@ if(prob(20)) do_sparks(5,FALSE,M) - SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "[id]_overdose")//holdover until above fix works + SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "[type]_overdose")//holdover until above fix works ..() /datum/reagent/fermi/eigenstate/reaction_turf(turf/T, reac_volume) diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm index 5703ed8f..cb71321d 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/enlargement.dm @@ -20,15 +20,14 @@ /datum/reagent/fermi/breast_enlarger name = "Succubus milk" - id = "breast_enlarger" description = "A volatile collodial mixture derived from milk that encourages mammary production via a potent estrogen mix." color = "#E60584" // rgb: 96, 0, 255 taste_description = "a milky ice cream like flavour." overdose_threshold = 17 metabolization_rate = 0.25 - impure_chem = "BEsmaller" //If you make an inpure chem, it stalls growth + impure_chem = /datum/reagent/fermi/BEsmaller //If you make an inpure chem, it stalls growth inverse_chem_val = 0.35 - inverse_chem = "BEsmaller" //At really impure vols, it just becomes 100% inverse + inverse_chem = /datum/reagent/fermi/BEsmaller //At really impure vols, it just becomes 100% inverse can_synth = FALSE /datum/reagent/fermi/breast_enlarger/on_mob_add(mob/living/carbon/M) @@ -46,7 +45,7 @@ M.Knockdown(50) M.Stun(50) B.throw_at(T2, 8, 1) - M.reagents.remove_reagent(id, volume) + M.reagents.del_reagent(type) return log_game("FERMICHEM: [M] ckey: [M.key] has ingested Sucubus milk") var/mob/living/carbon/human/H = M @@ -92,7 +91,7 @@ nB.cached_size = 0 nB.prev_size = 0 to_chat(M, "Your chest feels warm, tingling with newfound sensitivity.") - M.reagents.remove_reagent(id, 5) + M.reagents.remove_reagent(type, 5) B = nB //If they have them, increase size. If size is comically big, limit movement and rip clothes. B.cached_size = B.cached_size + 0.05 @@ -146,7 +145,6 @@ /datum/reagent/fermi/BEsmaller name = "Modesty milk" - id = "BEsmaller" description = "A volatile collodial mixture derived from milk that encourages mammary reduction via a potent estrogen mix. Produced by reacting impure Succubus milk." color = "#E60584" // rgb: 96, 0, 255 taste_description = "a milky ice cream like flavour." @@ -170,7 +168,6 @@ /datum/reagent/fermi/BEsmaller_hypo name = "Rectify milk" //Rectify - id = "BEsmaller_hypo" color = "#E60584" taste_description = "a milky ice cream like flavour." metabolization_rate = 0.25 @@ -212,15 +209,14 @@ //Since someone else made this in the time it took me to PR it, I merged them. /datum/reagent/fermi/penis_enlarger // Due to popular demand...! name = "Incubus draft" - id = "penis_enlarger" description = "A volatile collodial mixture derived from various masculine solutions that encourages a larger gentleman's package via a potent testosterone mix, formula derived from a collaboration from Fermichem and Doctor Ronald Hyatt, who is well known for his phallus palace." //The toxic masculinity thing is a joke because I thought it would be funny to include it in the reagents, but I don't think many would find it funny? dumb color = "#888888" // This is greyish..? taste_description = "chinese dragon powder" overdose_threshold = 17 //ODing makes you male and removes female genitals metabolization_rate = 0.5 - impure_chem = "PEsmaller" //If you make an inpure chem, it stalls growth + impure_chem = /datum/reagent/fermi/PEsmaller //If you make an inpure chem, it stalls growth inverse_chem_val = 0.35 - inverse_chem = "PEsmaller" //At really impure vols, it just becomes 100% inverse and shrinks instead. + inverse_chem = /datum/reagent/fermi/PEsmaller //At really impure vols, it just becomes 100% inverse and shrinks instead. can_synth = FALSE /datum/reagent/fermi/penis_enlarger/on_mob_add(mob/living/carbon/M) @@ -237,7 +233,7 @@ M.Knockdown(50) M.Stun(50) P.throw_at(T2, 8, 1) - M.reagents.remove_reagent(id, volume) + M.reagents.del_reagent(type) return var/mob/living/carbon/human/H = M H.genital_override = TRUE @@ -274,7 +270,7 @@ to_chat(M, "Your groin feels warm, as you feel a newly forming bulge down below.") nP.cached_length = 1 nP.prev_length = 1 - M.reagents.remove_reagent(id, 5) + M.reagents.remove_reagent(type, 5) P = nP if(!T)//Hyper change// Adds testicles if there are none. @@ -351,7 +347,6 @@ /datum/reagent/fermi/PEsmaller // Due to cozmo's request...! name = "Chastity draft" - id = "PEsmaller" description = "A volatile collodial mixture derived from various masculine solutions that encourages a smaller gentleman's package via a potent testosterone mix. Produced by reacting impure Incubus draft." color = "#888888" // This is greyish..? taste_description = "chinese dragon powder" @@ -376,7 +371,6 @@ /datum/reagent/fermi/PEsmaller_hypo name = "Rectify draft" - id = "PEsmaller_hypo" color = "#888888" // This is greyish..? taste_description = "chinese dragon powder" description = "A medicine used to treat organomegaly in a patient's penis." diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index 838af7b4..cf9b20ae 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -3,14 +3,12 @@ /datum/reagent/fermi name = "Fermi" //This should never exist, but it does so that it can exist in the case of errors.. - id = "fermi" taste_description = "affection and love!" can_synth = FALSE value = 20 - //SplitChem = TRUE - impure_chem = "fermiTox"// What chemical is metabolised with an inpure reaction + impure_chem = /datum/reagent/impure/fermiTox // What chemical is metabolised with an inpure reaction inverse_chem_val = 0.25 // If the impurity is below 0.5, replace ALL of the chem with inverse_chemupon metabolising - inverse_chem = "fermiTox" + inverse_chem = /datum/reagent/impure/fermiTox //This should process fermichems to find out how pure they are and what effect to do. /datum/reagent/fermi/on_mob_add(mob/living/carbon/M, amount) @@ -34,7 +32,6 @@ /datum/reagent/fermi/hatmium //for hatterhat name = "Hat growth serium" - id = "hatmium" description = "A strange substance that draws in a hat from the hat dimention." color = "#7c311a" // rgb: , 0, 255 taste_description = "like jerky, whiskey and an off aftertaste of a crypt." @@ -80,7 +77,6 @@ /datum/reagent/fermi/furranium name = "Furranium" - id = "furranium" description = "OwO whats this?" color = "#f9b9bc" // rgb: , 0, 255 taste_description = "dewicious degenyewacy" @@ -169,14 +165,13 @@ //Writen by Trilby!! Embellsished a little by me. /datum/reagent/fermi/nanite_b_gone - name = "Naninte bane" - id = "nanite_b_gone" + name = "Nanite bane" description = "A stablised EMP that is highly volatile, shocking small nano machines that will kill them off at a rapid rate in a patient's system." color = "#708f8f" overdose_threshold = 15 - impure_chem = "nanite_b_goneTox" //If you make an inpure chem, it stalls growth + impure_chem = /datum/reagent/fermi/nanite_b_goneTox //If you make an inpure chem, it stalls growth inverse_chem_val = 0.25 - inverse_chem = "nanite_b_goneTox" //At really impure vols, it just becomes 100% inverse + inverse_chem = /datum/reagent/fermi/nanite_b_goneTox //At really impure vols, it just becomes 100% inverse taste_description = "what can only be described as licking a battery." pH = 9 value = 90 @@ -211,7 +206,6 @@ /datum/reagent/fermi/nanite_b_goneTox name = "Electromagnetic crystals" - id = "nanite_b_goneTox" description = "Causes items upon the patient to sometimes short out, as well as causing a shock in the patient, if the residual charge between the crystals builds up to sufficient quantities" metabolization_rate = 0.5 chemical_flags = REAGENT_INVISIBLE @@ -234,7 +228,6 @@ /datum/reagent/fermi/fermiAcid name = "Acid vapour" - id = "fermiAcid" description = "Someone didn't do like an otter, and add acid to water." taste_description = "acid burns, ow" color = "#FFFFFF" @@ -277,7 +270,6 @@ /datum/reagent/fermi/fermiTest name = "Fermis Test Reagent" - id = "fermiTest" description = "You should be really careful with this...! Also, how did you get this?" chemical_flags = REAGENT_FORCEONNEW can_synth = FALSE @@ -287,7 +279,7 @@ if(LAZYLEN(holder.reagent_list) == 1) return else - holder.remove_reagent("fermiTest", volume)//Avoiding recurrsion + holder.del_reagent(type)//Avoiding recurrsion var/location = get_turf(holder.my_atom) if(purity < 0.34 || purity == 1) var/datum/effect_system/foam_spread/s = new() @@ -300,10 +292,10 @@ if(purity >= 0.67) for (var/datum/reagent/reagent in holder.reagent_list) if (istype(reagent, /datum/reagent/fermi)) - var/datum/chemical_reaction/fermi/Ferm = GLOB.chemical_reagents_list[reagent.id] + var/datum/chemical_reaction/fermi/Ferm = GLOB.chemical_reagents_list[reagent.type] Ferm.FermiExplode(src, holder.my_atom, holder, holder.total_volume, holder.chem_temp, holder.pH) else - var/datum/chemical_reaction/Ferm = GLOB.chemical_reagents_list[reagent.id] + var/datum/chemical_reaction/Ferm = GLOB.chemical_reagents_list[reagent.type] Ferm.on_reaction(holder, reagent.volume) for(var/mob/M in viewers(8, location)) to_chat(M, "The solution reacts dramatically, with a meow!") @@ -312,7 +304,6 @@ /datum/reagent/fermi/acidic_buffer name = "Acidic buffer" - id = "acidic_buffer" description = "This reagent will consume itself and move the pH of a beaker towards acidity when added to another." color = "#fbc314" pH = 0 @@ -320,7 +311,7 @@ //Consumes self on addition and shifts pH /datum/reagent/fermi/acidic_buffer/on_new(datapH) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return ..() data = datapH if(LAZYLEN(holder.reagent_list) == 1) @@ -330,19 +321,18 @@ for(var/mob/M in seen) to_chat(M, "The beaker fizzes as the pH changes!") playsound(get_turf(holder.my_atom), 'sound/FermiChem/bufferadd.ogg', 50, 1) - holder.remove_reagent(id, volume, ignore_pH = TRUE) + holder.remove_reagent(type, volume, ignore_pH = TRUE) ..() /datum/reagent/fermi/basic_buffer name = "Basic buffer" - id = "basic_buffer" description = "This reagent will consume itself and move the pH of a beaker towards alkalinity when added to another." color = "#3853a4" pH = 14 can_synth = TRUE /datum/reagent/fermi/basic_buffer/on_new(datapH) - if(holder.has_reagent("stabilizing_agent")) + if(holder.has_reagent(/datum/reagent/stabilizing_agent)) return ..() data = datapH if(LAZYLEN(holder.reagent_list) == 1) @@ -352,15 +342,14 @@ for(var/mob/M in seen) to_chat(M, "The beaker froths as the pH changes!") playsound(get_turf(holder.my_atom), 'sound/FermiChem/bufferadd.ogg', 50, 1) - holder.remove_reagent(id, volume, ignore_pH = TRUE) + holder.remove_reagent(type, volume, ignore_pH = TRUE) ..() //Turns you into a cute catto while it's in your system. //If you manage to gamble perfectly, makes you have cat ears after you transform back. But really, you shouldn't end up with that with how random it is. /datum/reagent/fermi/secretcatchem //Should I hide this from code divers? A secret cit chem? name = "secretcatchem" //an attempt at hiding it - id = "secretcatchem" - description = "An illegal and hidden chem that turns people into cats. It's said that it's so rare and unstable that having it means you've been blessed." + description = "An illegal and hidden chem that turns people into cats. It's said that it's so rare and unstable that having it means you've been blessed. If used on someone in crit, it will turn them into a cat permanently, until the cat is killed." taste_description = "hairballs and cream" color = "#ffc224" var/catshift = FALSE diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 12c0ef43..cdca8631 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -1,14 +1,13 @@ /datum/reagent/fermi/yamerol name = "Yamerol" - id = "yamerol" description = "For when you've trouble speaking or breathing, just yell YAMEROL! A chem that helps soothe any congestion problems and at high concentrations restores damaged lungs and tongues!" taste_description = "a weird, syrupy flavour, yamero" color = "#68e83a" pH = 8.6 overdose_threshold = 35 - impure_chem = "yamerol_tox" + impure_chem = /datum/reagent/impure/yamerol_tox inverse_chem_val = 0.4 - inverse_chem = "yamerol_tox" + inverse_chem = /datum/reagent/impure/yamerol_tox can_synth = TRUE /datum/reagent/fermi/yamerol/on_mob_life(mob/living/carbon/C) @@ -34,7 +33,7 @@ qdel(T) nT.Insert(C) to_chat(C, "You feel your tongue.... unfluffify...?") - holder.remove_reagent(src.id, "10") + holder.remove_reagent(type, 10) ..() /datum/reagent/fermi/yamerol/overdose_process(mob/living/carbon/C) @@ -50,7 +49,7 @@ T = new() T.Insert(C) to_chat(C, "You feel your tongue reform in your mouth.") - holder.remove_reagent(src.id, "10") + holder.remove_reagent(type, 10) else if((oT.name == "fluffy tongue") && (purity == 1)) var/obj/item/organ/tongue/T @@ -62,20 +61,18 @@ qdel(oT) T.Insert(C) to_chat(C, "You feel your tongue.... unfluffify...?") - holder.remove_reagent(src.id, "10") + holder.remove_reagent(type, 10) if(!C.getorganslot(ORGAN_SLOT_LUNGS)) var/obj/item/organ/lungs/yamerol/L = new() L.Insert(C) to_chat(C, "You feel the yamerol merge in your chest.") - holder.remove_reagent(src.id, "10") - + holder.remove_reagent(type, 10) C.adjustOxyLoss(-3) ..() /datum/reagent/impure/yamerol_tox name = "Yamer oh no" - id = "yamerol_tox" description = "A dangerous, cloying toxin that stucks to a patient’s respiratory system, damaging their tongue, lungs and causing suffocation." taste_description = "a weird, syrupy flavour, yamero" color = "#68e83a" @@ -96,7 +93,6 @@ /datum/reagent/synthtissue name = "Synthtissue" - id = "synthtissue" description = "Synthetic tissue used for grafting onto damaged organs during surgery, or for treating limb damage. Has a very tight growth window between 305-320, any higher and the temperature will cause the cells to die. Additionally, growth time is considerably long, so chemists are encouraged to leave beakers with said reaction ongoing, while they tend to their other duties." pH = 7.6 metabolization_rate = 0.05 // gives time to craft by lowing it from .1 @@ -124,7 +120,7 @@ if(data["grown_volume"] > 175) //I don't think this is even possible, but damn to I want to see if someone can (bare in mind it takes 2s to grow 0.05u) if(volume >= 14) if(C.regenerate_organs(only_one = TRUE)) - C.reagents.remove_reagent(id, 15) + C.reagents.remove_reagent(type, 15) to_chat(C, "You feel something reform inside of you!") data["injected_vol"] -= metabolization_rate diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/other_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/other_reagents.dm index c8ebde11..87f9d71c 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1,6 +1,5 @@ /datum/reagent/syndicateadrenals name = "Syndicate Adrenaline" - id = "syndicateadrenals" description = "Regenerates your stamina and increases your reaction time." color = "#E62111" overdose_threshold = 6 diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm index 11f525a4..282be5eb 100644 --- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm +++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm @@ -9,19 +9,19 @@ /datum/chemical_reaction/proc/FermiFinish(datum/reagents/holder, var/atom/my_atom, reactVol) if(clear_conversion == REACTION_CLEAR_IMPURE | REACTION_CLEAR_INVERSE) for(var/id in results) - var/datum/reagent/R = my_atom.reagents.has_reagent("[id]") - if(!R || R.purity == 1) + var/datum/reagent/R = my_atom.reagents.has_reagent(id) + if(R.purity == 1) continue var/cached_volume = R.volume if(clear_conversion == REACTION_CLEAR_INVERSE && R.inverse_chem) if(R.inverse_chem_val > R.purity) - my_atom.reagents.remove_reagent(R.id, cached_volume, FALSE) + my_atom.reagents.remove_reagent(R.type, cached_volume, FALSE) my_atom.reagents.add_reagent(R.inverse_chem, cached_volume, FALSE, other_purity = 1) else if (clear_conversion == REACTION_CLEAR_IMPURE && R.impure_chem) var/impureVol = cached_volume * (1 - R.purity) - my_atom.reagents.remove_reagent(R.id, (impureVol), FALSE) + my_atom.reagents.remove_reagent(R.type, (impureVol), FALSE) my_atom.reagents.add_reagent(R.impure_chem, impureVol, FALSE, other_purity = 1) R.cached_purity = R.purity R.purity = 1 @@ -70,13 +70,13 @@ R.my_atom = my_atom //Give the gas a fingerprint for (var/datum/reagent/reagent in my_atom.reagents.reagent_list) //make gas for reagents, has to be done this way, otherwise it never stops Exploding - R.add_reagent(reagent.id, reagent.volume/3) //Seems fine? I think I fixed the infinite explosion bug. + R.add_reagent(reagent.type, reagent.volume/3) //Seems fine? I think I fixed the infinite explosion bug. if (reagent.purity < 0.6) ImpureTot = (ImpureTot + (1-reagent.purity)) / 2 if(pH < 4) //if acidic, make acid spray - R.add_reagent("fermiAcid", (volume/3)) + R.add_reagent(/datum/reagent/impure/fermiTox, (volume/3)) if(R.reagent_list) s.set_up(R, (volume/5), my_atom) s.start() @@ -96,9 +96,9 @@ /datum/chemical_reaction/fermi/eigenstate name = "Eigenstasium" - id = "eigenstate" - results = list("eigenstate" = 0.1) - required_reagents = list("bluespace" = 0.1, "stable_plasma" = 0.1, "sugar" = 0.1) + id = /datum/reagent/fermi/eigenstate + results = list(/datum/reagent/fermi/eigenstate = 1) + required_reagents = list(/datum/reagent/bluespace = 1, /datum/reagent/stable_plasma = 1, /datum/reagent/consumable/caramel = 1) mix_message = "the reaction zaps suddenly!" //FermiChem vars: OptimalTempMin = 350 // Lower area of bell curve for determining heat based rate reactions @@ -130,9 +130,9 @@ //serum /datum/chemical_reaction/fermi/SDGF name = "Synthetic-derived growth factor" - id = "SDGF" - results = list("SDGF" = 0.3) - required_reagents = list("stable_plasma" = 0.15, "clonexadone" = 0.15, "uranium" = 0.15, "synthflesh" = 0.15) + id = /datum/reagent/fermi/SDGF + results = list(/datum/reagent/fermi/SDGF = 3) + required_reagents = list(/datum/reagent/stable_plasma = 1.5, /datum/reagent/medicine/clonexadone = 1.5, /datum/reagent/uranium = 1.5, /datum/reagent/medicine/synthflesh = 1.5) mix_message = "the reaction gives off a blorble!" required_temp = 1 //FermiChem vars: @@ -167,9 +167,9 @@ /datum/chemical_reaction/fermi/breast_enlarger name = "Sucubus milk" - id = "breast_enlarger" - results = list("breast_enlarger" = 0.8) - required_reagents = list("salglu_solution" = 0.1, "milk" = 0.1, "synthflesh" = 0.2, "silicon" = 0.3, "aphro" = 0.3) + id = /datum/reagent/fermi/breast_enlarger + results = list(/datum/reagent/fermi/breast_enlarger = 8) + required_reagents = list(/datum/reagent/medicine/salglu_solution = 1, /datum/reagent/consumable/milk = 1, /datum/reagent/medicine/synthflesh = 2, /datum/reagent/silicon = 3, /datum/reagent/drug/aphrodisiac = 3) mix_message = "the reaction gives off a mist of milk." //FermiChem vars: OptimalTempMin = 200 @@ -192,8 +192,8 @@ var/datum/reagent/fermi/breast_enlarger/BE = locate(/datum/reagent/fermi/breast_enlarger) in my_atom.reagents.reagent_list var/cached_volume = BE.volume if(BE.purity < 0.35) - holder.remove_reagent(src.id, cached_volume) - holder.add_reagent("BEsmaller", cached_volume) + holder.remove_reagent(type, cached_volume) + holder.add_reagent(/datum/reagent/fermi/BEsmaller, cached_volume) /datum/chemical_reaction/fermi/breast_enlarger/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH) @@ -207,9 +207,9 @@ /datum/chemical_reaction/fermi/penis_enlarger name = "Incubus draft" - id = "penis_enlarger" - results = list("penis_enlarger" = 0.8) - required_reagents = list("blood" = 0.5, "synthflesh" = 0.2, "carbon" = 0.2, "aphro" = 0.2, "salglu_solution" = 0.1,) + id = /datum/reagent/fermi/penis_enlarger + results = list(/datum/reagent/fermi/penis_enlarger = 8) + required_reagents = list(/datum/reagent/blood = 5, /datum/reagent/medicine/synthflesh = 2, /datum/reagent/carbon = 2, /datum/reagent/drug/aphrodisiac = 2, /datum/reagent/medicine/salglu_solution = 1) mix_message = "the reaction gives off a spicy mist." //FermiChem vars: OptimalTempMin = 200 @@ -241,14 +241,14 @@ var/datum/reagent/fermi/penis_enlarger/PE = locate(/datum/reagent/fermi/penis_enlarger) in my_atom.reagents.reagent_list var/cached_volume = PE.volume if(PE.purity < 0.35) - holder.remove_reagent(src.id, cached_volume) - holder.add_reagent("PEsmaller", cached_volume) + holder.remove_reagent(type, cached_volume) + holder.add_reagent(/datum/reagent/fermi/PEsmaller, cached_volume) /datum/chemical_reaction/fermi/astral name = "Astrogen" - id = "astral" - results = list("astral" = 0.5) - required_reagents = list("eigenstate" = 0.1, "plasma" = 0.3, "synaptizine" = 0.1, "aluminium" = 0.5) + id = /datum/reagent/fermi/astral + results = list(/datum/reagent/fermi/astral = 5) + required_reagents = list(/datum/reagent/fermi/eigenstate = 1, /datum/reagent/toxin/plasma = 3, /datum/reagent/medicine/synaptizine = 1, /datum/reagent/aluminium = 5) //FermiChem vars: OptimalTempMin = 700 OptimalTempMax = 800 @@ -267,14 +267,12 @@ PurityMin = 0.25 -/datum/chemical_reaction/fermi/enthrall/ //check this +/datum/chemical_reaction/fermi/enthrall //check this name = "MKUltra" - id = "enthrall" - results = list("enthrall" = 0.5) - //required_reagents = list("iron" = 1, "iodine" = 1) Test vars - //required_reagents = list("cocoa" = 0.1, "astral" = 0.1, "mindbreaker" = 0.1, "psicodine" = 0.1, "happiness" = 0.1) - required_reagents = list("cocoa" = 0.1, "bluespace" = 0.1, "mindbreaker" = 0.1, "psicodine" = 0.1, "happiness" = 0.1) //TEMPORARY UNTIL HEADMINS GIVE THE OKAY FOR MK USE. - required_catalysts = list("blood" = 1) + id = /datum/reagent/fermi/enthrall + results = list(/datum/reagent/fermi/enthrall = 5) + required_reagents = list(/datum/reagent/consumable/coco = 1, /datum/reagent/bluespace = 1, /datum/reagent/toxin/mindbreaker = 1, /datum/reagent/medicine/psicodine = 1, /datum/reagent/drug/happiness = 1) + required_catalysts = list(/datum/reagent/blood = 1) mix_message = "the reaction gives off a burgundy plume of smoke!" //FermiChem vars: OptimalTempMin = 780 @@ -316,7 +314,8 @@ //So slimes can play too. /datum/chemical_reaction/fermi/enthrall/slime - required_catalysts = list("jellyblood" = 1) + id = "enthrall2" + required_catalysts = list(/datum/reagent/blood/jellyblood = 1) /datum/chemical_reaction/fermi/enthrall/slime/FermiFinish(datum/reagents/holder, var/atom/my_atom) var/datum/reagent/blood/jellyblood/B = locate(/datum/reagent/blood/jellyblood) in my_atom.reagents.reagent_list//The one line change. @@ -341,16 +340,16 @@ var/turf/T = get_turf(my_atom) var/datum/reagents/R = new/datum/reagents(1000) var/datum/effect_system/smoke_spread/chem/s = new() - R.add_reagent("enthrallExplo", volume) + R.add_reagent(/datum/reagent/fermi/enthrallExplo, volume) s.set_up(R, volume/2, T) s.start() my_atom.reagents.clear_reagents() /datum/chemical_reaction/fermi/hatmium // done name = "Hat growth serum" - id = "hatmium" - results = list("hatmium" = 0.5) - required_reagents = list("ethanol" = 0.1, "nutriment" = 0.3, "cooking_oil" = 0.2, "iron" = 0.1, "gold" = 0.3) + id = /datum/reagent/fermi/hatmium + results = list(/datum/reagent/fermi/hatmium = 5) + required_reagents = list(/datum/reagent/consumable/ethanol = 1, /datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/cooking_oil = 2, /datum/reagent/iron = 1, /datum/reagent/gold = 3) //mix_message = "" //FermiChem vars: OptimalTempMin = 500 @@ -379,9 +378,9 @@ /datum/chemical_reaction/fermi/furranium name = "Furranium" - id = "furranium" - results = list("furranium" = 0.5) - required_reagents = list("aphro" = 0.1, "moonsugar" = 0.1, "silver" = 0.2, "salglu_solution" = 0.1) + id = /datum/reagent/fermi/furranium + results = list(/datum/reagent/fermi/furranium = 5) + required_reagents = list(/datum/reagent/drug/aphrodisiac = 1, /datum/reagent/moonsugar = 1, /datum/reagent/silver = 2, /datum/reagent/medicine/salglu_solution = 1) mix_message = "You think you can hear a howl come from the beaker." //FermiChem vars: OptimalTempMin = 350 @@ -405,9 +404,9 @@ //Nano-b-gone /datum/chemical_reaction/fermi/nanite_b_gone//done test name = "Naninte bain" - id = "nanite_b_gone" - results = list("nanite_b_gone" = 4) - required_reagents = list("synthflesh" = 1, "uranium" = 1, "iron" = 1, "salglu_solution" = 1) + id = /datum/reagent/fermi/nanite_b_gone + results = list(/datum/reagent/fermi/nanite_b_gone = 4) + required_reagents = list(/datum/reagent/medicine/synthflesh = 1, /datum/reagent/uranium = 1, /datum/reagent/iron = 1, /datum/reagent/medicine/salglu_solution = 1) mix_message = "the reaction gurgles, encapsulating the reagents in flesh before the emp can be set off." required_temp = 450//To force fermireactions before EMP. //FermiChem vars: @@ -427,9 +426,9 @@ /datum/chemical_reaction/fermi/acidic_buffer//done test name = "Acetic acid buffer" - id = "acidic_buffer" - results = list("acidic_buffer" = 10) //acetic acid - required_reagents = list("salglu_solution" = 1, "ethanol" = 3, "oxygen" = 3, "water" = 3) + id = /datum/reagent/fermi/acidic_buffer + results = list(/datum/reagent/fermi/acidic_buffer = 10) //acetic acid + required_reagents = list(/datum/reagent/medicine/salglu_solution = 1, /datum/reagent/consumable/ethanol = 3, /datum/reagent/oxygen = 3, /datum/reagent/water = 3) //FermiChem vars: OptimalTempMin = 250 OptimalTempMax = 500 @@ -454,10 +453,10 @@ /datum/chemical_reaction/fermi/basic_buffer//done test name = "Ethyl Ethanoate buffer" - id = "basic_buffer" - results = list("basic_buffer" = 5) - required_reagents = list("lye" = 1, "ethanol" = 2, "water" = 2) - required_catalysts = list("sacid" = 1) //vagely acetic + id = /datum/reagent/fermi/basic_buffer + results = list(/datum/reagent/fermi/basic_buffer = 5) + required_reagents = list(/datum/reagent/lye = 1, /datum/reagent/consumable/ethanol = 2, /datum/reagent/water = 2) + required_catalysts = list(/datum/reagent/toxin/acid = 1) //vagely acetic //FermiChem vars: OptimalTempMin = 250 OptimalTempMax = 500 @@ -486,11 +485,11 @@ //ChemReactionVars: /datum/chemical_reaction/fermi/secretcatchem //DONE name = "secretcatchem" - id = "secretcatchem" - results = list("secretcatchem" = 0.5) - required_reagents = list("stable_plasma" = 0.1, "sugar" = 0.1, "cream" = 0.1, "clonexadone" = 0.1)//Yes this will make a plushie if you don't lucky guess. It'll eat all your reagents too. - required_catalysts = list("SDGF" = 1) - required_temp = 600 + id = /datum/reagent/fermi/secretcatchem + results = list(/datum/reagent/fermi/secretcatchem = 5) + required_reagents = list(/datum/reagent/stable_plasma = 1, /datum/reagent/consumable/caramel = 1, /datum/reagent/consumable/cream = 1, /datum/reagent/medicine/clonexadone = 1)//Yes this will make a kitty if you don't lucky guess. It'll eat all your reagents too. + required_catalysts = list(/datum/reagent/fermi/SDGF = 1) + required_temp = 500 mix_message = "the reaction gives off a meow!" mix_sound = "modular_citadel/sound/voice/merowr.ogg" //FermiChem vars: @@ -520,8 +519,8 @@ HIonRelease += (rand(-25, 25)/100) RateUpLim += (rand(1, 1000)/100) PurityMin += (rand(-1, 1)/10) - var/additions = list("aluminium", "silver", "gold", "plasma", "silicon", "uranium", "milk") - required_reagents[pick(additions)] = rand(0.1, 0.5)//weird + var/picked = pick(/datum/reagent/aluminium, /datum/reagent/silver, /datum/reagent/gold, /datum/reagent/toxin/plasma, /datum/reagent/silicon, /datum/reagent/uranium, /datum/reagent/consumable/milk) + required_reagents[picked] = rand(1, 5)//weird /datum/chemical_reaction/fermi/secretcatchem/FermiFinish(datum/reagents/holder, var/atom/my_atom) SSblackbox.record_feedback("tally", "catgirlium")//log @@ -539,9 +538,9 @@ /datum/chemical_reaction/fermi/yamerol//done test name = "Yamerol" - id = "yamerol" - results = list("yamerol" = 1.5) - required_reagents = list("perfluorodecalin" = 0.5, "salbutamol" = 0.5, "water" = 0.5) + id = /datum/reagent/fermi/yamerol + results = list(/datum/reagent/fermi/yamerol = 3) + required_reagents = list(/datum/reagent/medicine/perfluorodecalin = 1, /datum/reagent/medicine/salbutamol = 1, /datum/reagent/water = 1) //FermiChem vars: OptimalTempMin = 300 OptimalTempMax = 500 diff --git a/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm b/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm index d9f2cdf0..c55f43b0 100644 --- a/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm +++ b/modular_citadel/code/modules/reagents/reagents/cit_reagents.dm @@ -1,8 +1,7 @@ //body bluids /datum/reagent/consumable/semen name = "Semen" - id = "semen" - description = "Sperm from some animal. Useless for anything but insemination, really." + description = "Sperm from some animal. I bet you'll drink this out of a bucket someday." taste_description = "something salty" taste_mult = 2 //Not very overpowering flavor data = list("donor"=null,"viruses"=null,"donor_DNA"=null,"blood_type"=null,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null) @@ -48,7 +47,6 @@ /datum/reagent/consumable/femcum name = "Female Ejaculate" - id = "femcum" description = "Vaginal lubricant found in most mammals and other animals of similar nature. Where you found this is your own business." taste_description = "something with a tang" // wew coders who haven't eaten out a girl. taste_mult = 2 @@ -128,7 +126,6 @@ /datum/reagent/drug/aphrodisiac name = "Crocin" - id = "aphro" description = "Naturally found in the crocus and gardenia flowers, this drug acts as a natural and safe aphrodisiac." taste_description = "strawberry roofies" taste_mult = 2 //Hide the roofies in stronger flavors @@ -147,7 +144,6 @@ /datum/reagent/drug/aphrodisiacplus name = "Hexacrocin" - id = "aphro+" description = "Chemically condensed form of basic crocin. This aphrodisiac is extremely powerful and addictive in most animals.\ Addiction withdrawals can cause brain damage and shortness of breath. Overdosage can lead to brain damage and a\ permanent increase in libido (commonly referred to as 'bimbofication')." @@ -202,7 +198,6 @@ /datum/reagent/drug/anaphrodisiac name = "Camphor" - id = "anaphro" description = "Naturally found in some species of evergreen trees, camphor is a waxy substance. When injested by most animals, it acts as an anaphrodisiac\ , reducing libido and calming them. Non-habit forming and not addictive." taste_description = "dull bitterness" @@ -217,7 +212,6 @@ /datum/reagent/drug/anaphrodisiacplus name = "Hexacamphor" - id = "anaphro+" description = "Chemically condensed camphor. Causes an extreme reduction in libido and a permanent one if overdosed. Non-addictive." taste_description = "tranquil celibacy" color = "#D9D9D9"//rgb(217, 217, 217) @@ -241,32 +235,32 @@ //recipes /datum/chemical_reaction/aphro name = "crocin" - id = "aphro" - results = list("aphro" = 6) - required_reagents = list("carbon" = 2, "hydrogen" = 2, "oxygen" = 2, "water" = 1) + id = /datum/reagent/drug/aphrodisiac + results = list(/datum/reagent/drug/aphrodisiac = 6) + required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/oxygen = 2, /datum/reagent/water = 1) required_temp = 400 mix_message = "The mixture boils off a pink vapor..."//The water boils off, leaving the crocin /datum/chemical_reaction/aphroplus name = "hexacrocin" - id = "aphro+" - results = list("aphro+" = 1) - required_reagents = list("aphro" = 6, "phenol" = 1) + id = /datum/reagent/drug/aphrodisiacplus + results = list(/datum/reagent/drug/aphrodisiacplus = 1) + required_reagents = list(/datum/reagent/drug/aphrodisiac = 6, /datum/reagent/phenol = 1) required_temp = 400 mix_message = "The mixture rapidly condenses and darkens in color..." /datum/chemical_reaction/anaphro name = "camphor" - id = "anaphro" - results = list("anaphro" = 6) - required_reagents = list("carbon" = 2, "hydrogen" = 2, "oxygen" = 2, "sulfur" = 1) + id = /datum/reagent/drug/anaphrodisiac + results = list(/datum/reagent/drug/anaphrodisiac = 6) + required_reagents = list(/datum/reagent/carbon = 2, /datum/reagent/hydrogen = 2, /datum/reagent/oxygen = 2, /datum/reagent/sulfur = 1) required_temp = 400 mix_message = "The mixture boils off a yellow, smelly vapor..."//Sulfur burns off, leaving the camphor /datum/chemical_reaction/anaphroplus name = "pentacamphor" - id = "anaphro+" - results = list("anaphro+" = 1) - required_reagents = list("anaphro" = 5, "acetone" = 1) + id = /datum/reagent/drug/anaphrodisiacplus + results = list(/datum/reagent/drug/anaphrodisiacplus = 1) + required_reagents = list(/datum/reagent/drug/aphrodisiac = 5, /datum/reagent/acetone = 1) required_temp = 300 mix_message = "The mixture thickens and heats up slighty..." diff --git a/modular_citadel/code/modules/vore/eating/voreitems.dm b/modular_citadel/code/modules/vore/eating/voreitems.dm index 74178254..05ab1e5f 100644 --- a/modular_citadel/code/modules/vore/eating/voreitems.dm +++ b/modular_citadel/code/modules/vore/eating/voreitems.dm @@ -35,7 +35,6 @@ /* /datum/reagent/medicine/ickypak name = "Ickypak" - id = "ickypak" description = "A foul-smelling green liquid, for inducing muscle contractions to expel accidentally ingested things." reagent_state = LIQUID color = "#0E900E" @@ -57,6 +56,6 @@ /datum/chemical_reaction/ickypak name = "Ickypak" - id = "ickypak" - results = list("ickypak" = 2) - required_reagents = list("chlorine" = 2 , "oil" = 1) */ \ No newline at end of file + id = /datum/reagent/medicine/ickypak + results = list(/datum/reagent/medicine/ickypak = 2) + required_reagents = list(/datum/reagent/chlorine = 2 , /datum/reagent/oil = 1) */ \ No newline at end of file diff --git a/modular_citadel/code/modules/vore/resizing/sizechemicals.dm b/modular_citadel/code/modules/vore/resizing/sizechemicals.dm index 1f5dbf2b..0c53886e 100644 --- a/modular_citadel/code/modules/vore/resizing/sizechemicals.dm +++ b/modular_citadel/code/modules/vore/resizing/sizechemicals.dm @@ -5,7 +5,6 @@ /datum/reagent/medicine/macrocillin name = "Macrocillin" - id = "macrocillin" description = "Glowing yellow liquid." reagent_state = LIQUID color = "#FFFF00" // rgb: 255, 255, 0 @@ -17,13 +16,12 @@ M.sizescale(size) M << "You grow!" break - if(M.reagents.has_reagent("macrocillin")) - M.reagents.remove_reagent("macrocillin", 20) + if(M.reagents.has_reagent(/datum/reagent/medicine/macrocillin)) + M.reagents.remove_reagent(/datum/reagent/medicine/macrocillin, 20) ..() /datum/reagent/medicine/microcillin name = "Microcillin" - id = "microcillin" description = "Murky purple liquid." reagent_state = LIQUID color = "#800080" @@ -35,14 +33,13 @@ M.sizescale(size) M << "You shrink!" break; - if(M.reagents.has_reagent("microcillin")) - M.reagents.remove_reagent("microcillin", 20) + if(M.reagents.has_reagent(/datum/reagent/medicine/microcillin)) + M.reagents.remove_reagent(/datum/reagent/medicine/microcillin, 20) ..() /datum/reagent/medicine/normalcillin name = "Normalcillin" - id = "normalcillin" description = "Translucent cyan liquid." reagent_state = LIQUID color = "#00FFFF" @@ -62,14 +59,13 @@ M.sizescale(SIZESCALE_SMALL) M << "You grow!" - if(M.reagents.has_reagent("normalcillin")) - M.reagents.remove_reagent("normalcillin", 20) + if(M.reagents.has_reagent(/datum/reagent/medicine/normalcillin)) + M.reagents.remove_reagent(/datum/reagent/medicine/normalcillin, 20) ..() /datum/reagent/medicine/sizeoxadone name = "Sizeoxadone" - id = "sizeoxadone" description = "A volatile liquid used as a precursor to size-altering chemicals. Causes dizziness if taken unprocessed." reagent_state = LIQUID color = "#1E90FF" @@ -93,7 +89,6 @@ /datum/reagent/medicine/ickypak name = "Ickypak" - id = "ickypak" description = "A foul-smelling green liquid, for inducing muscle contractions to expel accidentally ingested things." reagent_state = LIQUID color = "#0E900E" From 41f0a84a87318d5fcacbb7041e63d44db85f2043 Mon Sep 17 00:00:00 2001 From: Archie Date: Fri, 18 Dec 2020 01:30:17 -0300 Subject: [PATCH 2/2] Fire Extinguisher Reagents --- code/game/objects/items/extinguisher.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/extinguisher.dm b/code/game/objects/items/extinguisher.dm index 4585685c..81317b6e 100644 --- a/code/game/objects/items/extinguisher.dm +++ b/code/game/objects/items/extinguisher.dm @@ -65,7 +65,7 @@ icon_state = "foam_extinguisher0" //item_state = "foam_extinguisher" needs sprite dog_fashion = null - chem = "firefighting_foam" + chem = /datum/reagent/firefighting_foam tanktype = /obj/structure/reagent_dispensers/foamtank sprite_name = "foam_extinguisher" precision = TRUE