From 864c4ca1069ed11a940ccf520d5f9e150043ee04 Mon Sep 17 00:00:00 2001 From: Cameron653 Date: Fri, 15 Jun 2018 16:41:59 -0400 Subject: [PATCH] Gives Alraune the ability to select body shape. Gives Alraune the ability to select a fruit/vegetable to grow via an implant. Some code cleanup relating to custom body shape selection. Makes species name their defines instead of "name" Fixes a typo in custom_items where the reagent generator being selected was roiz instead of pumila. --- code/game/dna/dna2.dm | 6 ++ code/game/dna/dna2_helpers.dm | 5 ++ code/global_vr.dm | 27 +++++++ .../client/preference_setup/vore/07_traits.dm | 6 +- .../carbon/human/species/station/alraune.dm | 63 ++++++++++++++- .../carbon/human/species/station/blank_vr.dm | 5 +- .../station/protean_vr/protean_species.dm | 14 ++-- .../species/station/station_special_vr.dm | 7 +- code/modules/vore/eating/living_vr.dm | 3 +- .../vore/fluffstuff/custom_items_vr.dm | 76 ++++++++++++++++++- 10 files changed, 195 insertions(+), 17 deletions(-) diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 162cdd371d..b5a73224fc 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -199,6 +199,12 @@ var/global/list/datum/dna/gene/dna_genes[0] src.base_species = CS.base_species src.blood_color = CS.blood_color + if(istype(character.species,/datum/species/alraune)) + var/datum/species/alraune/CS = character.species + //src.species_traits = CS.traits.Copy() //No traits + src.base_species = CS.base_species + src.blood_color = CS.blood_color + // +1 to account for the none-of-the-above possibility SetUIValueRange(DNA_UI_EAR_STYLE, ear_style + 1, ear_styles_list.len + 1, 1) SetUIValueRange(DNA_UI_TAIL_STYLE, tail_style + 1, tail_styles_list.len + 1, 1) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index a7e7d2ddae..f4fcffbd34 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -233,6 +233,11 @@ var/datum/species/xenochimera/CS = H.species var/datum/species/xenochimera/new_CS = CS.produceCopy(dna.base_species,dna.species_traits,src) new_CS.blood_color = dna.blood_color + + if(istype(H.species,/datum/species/alraune)) + var/datum/species/alraune/CS = H.species + var/datum/species/alraune/new_CS = CS.produceCopy(dna.base_species,dna.species_traits,src) + new_CS.blood_color = dna.blood_color // VOREStation Edit End H.force_update_organs() //VOREStation Add - Gotta do this too diff --git a/code/global_vr.dm b/code/global_vr.dm index 8b4ab024fc..4170750ee4 100644 --- a/code/global_vr.dm +++ b/code/global_vr.dm @@ -5,3 +5,30 @@ robot_module_types += "Sci-borg" robot_module_types += "Pupdozer" return 1 + +var/global/list/acceptable_fruit_types= list( + "chili", + "berry", + "tomato", + "eggplant", + "apple", + "ambrosia", + "grape", + "greengrapes", + "peanut", + "cabbage", + "banana", + "potato", + "onion", + "soybean", + "wheat", + "rice", + "carrot", + "whitebeet", + "sugarcane", + "watermelon", + "pumpkin", + "lime", + "lemon", + "orange", + "cherry") \ No newline at end of file diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index e01f738066..95074680df 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -80,7 +80,8 @@ /datum/category_item/player_setup_item/vore/traits/copy_to_mob(var/mob/living/carbon/human/character) character.custom_species = pref.custom_species - if(pref.species == SPECIES_CUSTOM || pref.species == SPECIES_XENOCHIMERA) + var/datum/species/selected_species = all_species[pref.species] + if(selected_species.selects_bodytype) var/datum/species/custom/CS = character.species var/S = pref.custom_base ? pref.custom_base : "Human" var/datum/species/custom/new_CS = CS.produceCopy(S, pref.pos_traits + pref.neu_traits + pref.neg_traits, character) @@ -92,7 +93,8 @@ . += "Custom Species " . += "[pref.custom_species ? pref.custom_species : "-Input Name-"]
" - if(pref.species == SPECIES_CUSTOM || pref.species == SPECIES_XENOCHIMERA) + var/datum/species/selected_species = all_species[pref.species] + if(selected_species.selects_bodytype) . += "Icon Base: " . += "[pref.custom_base ? pref.custom_base : "Human"]
" diff --git a/code/modules/mob/living/carbon/human/species/station/alraune.dm b/code/modules/mob/living/carbon/human/species/station/alraune.dm index 0f8d7b5622..db57812851 100644 --- a/code/modules/mob/living/carbon/human/species/station/alraune.dm +++ b/code/modules/mob/living/carbon/human/species/station/alraune.dm @@ -14,6 +14,8 @@ min_age = 18 max_age = 250 health_hud_intensity = 1.5 + base_species = SPECIES_ALRAUNE + selects_bodytype = 1 body_temperature = T20C breath_type = "carbon_dioxide" @@ -88,6 +90,17 @@ O_EYES = /obj/item/organ/internal/eyes/alraune, ) +/datum/species/alraune/equip_survival_gear(var/mob/living/carbon/human/H) + ..() + + var/implanter = /obj/item/weapon/implanter/reagent_generator/fruit_implant + var/obj/item/weapon/implanter/reagent_generator/fruit_implant/implant = new implanter + + if(H.backbag == 1) + H.equip_to_slot_or_del(implant, slot_r_hand) + else + H.equip_to_slot_or_del(implant, slot_in_backpack) + /datum/species/alraune/can_breathe_water() return TRUE //eh, why not? Aquatic plants are a thing. @@ -333,4 +346,52 @@ icon = 'icons/mob/species/alraune/organs.dmi' icon_state = "phytoextractor" name = "phytoextractor" - desc = "A bulbous gourd-like structure." \ No newline at end of file + desc = "A bulbous gourd-like structure." + + + +/datum/species/alraune/proc/produceCopy(var/datum/species/to_copy,var/list/traits,var/mob/living/carbon/human/H) + ASSERT(to_copy) + ASSERT(istype(H)) + + if(ispath(to_copy)) + to_copy = "[initial(to_copy.name)]" + if(istext(to_copy)) + to_copy = all_species[to_copy] + + var/datum/species/alraune/new_copy = new() + + //Initials so it works with a simple path passed, or an instance + new_copy.base_species = to_copy.name + new_copy.icobase = to_copy.icobase + new_copy.deform = to_copy.deform + new_copy.tail = to_copy.tail + new_copy.tail_animation = to_copy.tail_animation + new_copy.icobase_tail = to_copy.icobase_tail + new_copy.color_mult = to_copy.color_mult + new_copy.primitive_form = to_copy.primitive_form + new_copy.appearance_flags = to_copy.appearance_flags + new_copy.flesh_color = to_copy.flesh_color + new_copy.base_color = to_copy.base_color + new_copy.blood_mask = to_copy.blood_mask + new_copy.damage_mask = to_copy.damage_mask + new_copy.damage_overlays = to_copy.damage_overlays + + //Set up a mob + H.species = new_copy + H.icon_state = lowertext(new_copy.get_bodytype()) + + if(new_copy.holder_type) + H.holder_type = new_copy.holder_type + + if(H.dna) + H.dna.ready_dna(H) + + return new_copy + +/datum/species/alraune/get_bodytype() + return base_species + +/datum/species/alraune/get_race_key() + var/datum/species/real = all_species[base_species] + return real.race_key \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station/blank_vr.dm b/code/modules/mob/living/carbon/human/species/station/blank_vr.dm index f2847a1523..670d72ce3d 100644 --- a/code/modules/mob/living/carbon/human/species/station/blank_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/blank_vr.dm @@ -5,11 +5,14 @@ var/metabolism = 0.0015 var/lightweight = 0 //Oof! Nonhelpful bump stumbles. var/trashcan = 0 //It's always sunny in the wrestling ring. + var/base_species = null // Unused outside of a few species + var/selects_bodytype = 0 // Allows the species to choose from body types intead of being forced to be just one. /datum/species/custom name = SPECIES_CUSTOM name_plural = "Custom" - var/base_species = "Human" + selects_bodytype = 1 + base_species = SPECIES_HUMAN unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/punch, /datum/unarmed_attack/bite) diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm index 618382f3a8..05237f5742 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm @@ -1,7 +1,7 @@ #define DAM_SCALE_FACTOR 0.01 #define METAL_PER_TICK 150 /datum/species/protean - name = "Protean" + name = SPECIES_PROTEAN name_plural = "Proteans" blurb = "Sometimes very advanced civilizations will produce the ability to swap into manufactured, robotic bodies. And sometimes \ VERY advanced civilizations have the option of 'nanoswarm' bodies. Effectively a single robot body comprised \ @@ -139,7 +139,7 @@ if(H.backbag == 1) //Somewhat misleading, 1 == no bag (not boolean) H.equip_to_slot_or_del(permit, slot_l_hand) - H.equip_to_slot_or_del(metal_stack, slot_r_hand) + H.equip_to_slot_or_del(metal_stack, slot_r_hand) else H.equip_to_slot_or_del(permit, slot_in_backpack) H.equip_to_slot_or_del(metal_stack, slot_in_backpack) @@ -172,7 +172,7 @@ var/obj/item/organ/internal/nano/refactory/refactory = locate() in H.internal_organs if(refactory && !(refactory.status & ORGAN_DEAD)) - + //MHydrogen adds speeeeeed if(refactory.get_stored_material("mhydrogen") >= METAL_PER_TICK) H.add_modifier(/datum/modifier/protean/mhydrogen, origin = refactory) @@ -233,7 +233,7 @@ var/obj/item/organ/internal/nano/refactory/refactory = origin.resolve() if(!istype(refactory) || refactory.status & ORGAN_DEAD) expire() - + //Out of materials if(!refactory.use_stored_material(material_name,material_use)) expire() @@ -255,7 +255,7 @@ on_created_text = "You feel yourself become nearly impervious to physical attacks as plasteel nanites are made." on_expired_text = "Your refactory finishes consuming the plasteel, and you return to your normal nanites." - + material_name = "plasteel" incoming_brute_damage_percent = 0.5 @@ -266,7 +266,7 @@ on_created_text = "You feel yourself become more reflective, able to resist heat and fire better for a time." on_expired_text = "Your refactory finishes consuming the diamond, and you return to your normal nanites." - + material_name = "diamond" incoming_fire_damage_percent = 0.2 @@ -277,7 +277,7 @@ on_created_text = "You feel new nanites being produced from your stockpile of steel, healing you slowly." on_expired_text = "Your steel supply has either run out, or is no longer needed, and your healing stops." - + material_name = "steel" /datum/modifier/protean/steel/tick() diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm index aa8af0e273..0b536e1fbb 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm @@ -5,7 +5,7 @@ /datum/species/xenochimera //Scree's race. - name = "Xenochimera" + name = SPECIES_XENOCHIMERA name_plural = "Xenochimeras" icobase = 'icons/mob/human_races/r_xenochimera.dmi' deform = 'icons/mob/human_races/r_def_xenochimera.dmi' @@ -14,7 +14,8 @@ slowdown = -0.2 //scuttly, but not as scuttly as a tajara or a teshari. brute_mod = 0.8 //About as tanky to brute as a Unathi. They'll probably snap and go feral when hurt though. burn_mod = 1.15 //As vulnerable to burn as a Tajara. - var/base_species = "Xenochimera" + base_species = "Xenochimera" + selects_bodytype = 1 num_alternate_languages = 2 secondary_langs = list("Sol Common") @@ -300,7 +301,7 @@ /////SPIDER RACE///// ///////////////////// /datum/species/spider //These actually look pretty damn spooky! - name = "Vasilissan" + name = SPECIES_VASILISSAN name_plural = "Vasilissans" icobase = 'icons/mob/human_races/r_spider.dmi' deform = 'icons/mob/human_races/r_def_spider.dmi' diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 129dd8b5ce..22b4bb8353 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -21,7 +21,8 @@ var/fuzzy = 1 // Preference toggle for sharp/fuzzy icon. var/tail_alt = 0 // Tail layer toggle. var/can_be_drop_prey = 0 - var/can_be_drop_pred = 1 //Mobs are pred by default. + var/can_be_drop_pred = 1 // Mobs are pred by default. + var/fruit_type = "apple" // Not used outside of Alraunes. This is on all /living just in case some other mob gets it or it's being bussed in an event. Mobs with fruit, anyone? // // Hook for generic creation of stuff on new creatures diff --git a/code/modules/vore/fluffstuff/custom_items_vr.dm b/code/modules/vore/fluffstuff/custom_items_vr.dm index 4b0e1ece7b..2e82c615cc 100644 --- a/code/modules/vore/fluffstuff/custom_items_vr.dm +++ b/code/modules/vore/fluffstuff/custom_items_vr.dm @@ -1033,7 +1033,7 @@ if(usr.incapacitated() || usr.stat > CONSCIOUS) return - var/obj/item/weapon/implant/reagent_generator/roiz/rimplant + var/obj/item/weapon/implant/reagent_generator/pumila_apple/rimplant for(var/I in contents) if(istype(I, /obj/item/weapon/implant/reagent_generator)) rimplant = I @@ -1998,7 +1998,7 @@ KA.desc = initial(KA.desc) KA.icon = initial(KA.icon) ..() - + //ArgobargSoup:Lynn Shady /obj/item/device/flashlight/pen/fluff/lynn name = "Lynn's penlight" @@ -2006,3 +2006,75 @@ icon = 'icons/vore/custom_items_vr.dmi' icon_state = "penlightlynn" + +//Fruit Implants for Alraune +/obj/item/weapon/implant/reagent_generator/fruit_implant + name = "fruit enabling implant" + desc = "This is an implant that hastens Alraune's fruit production." + generated_reagents = list("sugar" = 2) //This actually allows them. This could be anything, but sugar seems most fitting. + usable_volume = 250 //Five fruit. + transfer_amount = 50 + empty_message = list("Your have no fruit on you.", "You have a distinct lack of fruit..") + full_message = list("You have a multitude of fruit that is ready for harvest!", "You have fruit that is ready to be picked!") + emote_descriptor = list("fruit right off of the Alraune!", "a fruit from the Alraune!") //These are changed below + var/verb_descriptor = list("grabs", "snatches", "picks") + var/self_verb_descriptor = list("grab", "snatch", "pick") + var/short_emote_descriptor = list("picks", "grabs") + self_emote_descriptor = list("grab", "pick", "snatch") + assigned_proc = /mob/living/carbon/human/proc/use_reagent_implant_fruit_implant + +/obj/item/weapon/implant/reagent_generator/fruit_implant/implanted(mob/living/carbon/source) + if(source.species.name != "Alraune") + to_chat(source, "Perhaps using this implant as a non Alraune was a bad idea...") //You wasted it. Good job. + return 1 + processing_objects += src + to_chat(source, "You implant [source] with \the [src].") + emote_descriptor = list("fruit right off of [source]!", "a fruit from [source]!") + var/selection = input(source, "Choose your character's fruit type. Choosing nothing will result in a default of apples.", "Fruit Type", source.fruit_type) as null|anything in acceptable_fruit_types + if(selection) + source.fruit_type = selection + source.verbs |= assigned_proc + return 1 + +/obj/item/weapon/implanter/reagent_generator/fruit_implant + implant_type = /obj/item/weapon/implant/reagent_generator/fruit_implant + +/mob/living/carbon/human/proc/use_reagent_implant_fruit_implant() + set name = "Pick Fruit" + set desc = "Pick fruit off of [src]." + set category = "Object" + set src in view(1) + + //do_reagent_implant(usr) + if(!isliving(usr) || !usr.canClick()) + return + + if(usr.incapacitated() || usr.stat > CONSCIOUS) + return + + var/obj/item/weapon/implant/reagent_generator/fruit_implant/rimplant + for(var/I in contents) + if(istype(I, /obj/item/weapon/implant/reagent_generator)) + rimplant = I + break + if (rimplant) + if(rimplant.reagents.total_volume < rimplant.transfer_amount) + to_chat(src, "[pick(rimplant.empty_message)]") + return + + var/datum/seed/S = plant_controller.seeds["[fruit_type]"] //crosses fingers EVEN HARDER than last one. + S.harvest(usr,0,0,1) + + var/index = rand(0,2) + + if (usr != src) + var/emote = rimplant.emote_descriptor[index] + var/verb_desc = rimplant.verb_descriptor[index] + var/self_verb_desc = rimplant.self_verb_descriptor[index] + usr.visible_message("[usr] [verb_desc] [emote]", + "You [self_verb_desc] [emote]") + else + visible_message("[src] [pick(rimplant.short_emote_descriptor)] a fruit.", + "You [pick(rimplant.self_emote_descriptor)] a fruit.") + + rimplant.reagents.remove_any(rimplant.transfer_amount)