Refactor of catpeople mutant organs

This commit is contained in:
ACCount
2017-11-01 23:14:34 +03:00
committed by CitadelStationBot
parent 56c534fa62
commit eb54055278
15 changed files with 220 additions and 144 deletions
+51 -14
View File
@@ -1091,7 +1091,8 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
log_admin("[key_name(usr)] sent \"[input]\" as the Tip of the Round.")
SSblackbox.add_details("admin_verb","Show Tip")
#define ON_PURRBATION(H) (!(H.dna.features["tail_human"] == "None" && H.dna.features["ears"] == "None"))
#define ON_PURRBATION(H) (\H.getorgan(/obj/item/organ/tail/cat) || H.getorgan(/obj/item/organ/ears/cat) || \
H.dna.features["ears"] == "Cat" || H.dna.features["human_tail"] == "Cat")
/proc/mass_purrbation()
for(var/M in GLOB.mob_list)
@@ -1105,36 +1106,72 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
purrbation_remove(M)
CHECK_TICK
/proc/purrbation_toggle(mob/living/carbon/human/H)
/proc/purrbation_toggle(mob/living/carbon/human/H, silent = FALSE)
if(!ishumanbasic(H))
return
if(!ON_PURRBATION(H))
purrbation_apply(H)
purrbation_apply(H, silent)
. = TRUE
else
purrbation_remove(H)
purrbation_remove(H, silent)
. = FALSE
/proc/purrbation_apply(mob/living/carbon/human/H)
/proc/purrbation_apply(mob/living/carbon/human/H, silent = FALSE)
if(!ishuman(H))
return
if(ON_PURRBATION(H))
return
to_chat(H, "Something is nya~t right.")
H.dna.features["tail_human"] = "Cat"
H.dna.features["ears"] = "Cat"
H.regenerate_icons()
playsound(get_turf(H), 'sound/effects/meow1.ogg', 50, 1, -1)
/proc/purrbation_remove(mob/living/carbon/human/H)
var/obj/item/organ/ears/cat/ears = new
var/obj/item/organ/tail/cat/tail = new
ears.Insert(H, drop_if_replaced=FALSE)
tail.Insert(H, drop_if_replaced=FALSE)
if(!silent)
to_chat(H, "Something is nya~t right.")
playsound(get_turf(H), 'sound/effects/meow1.ogg', 50, 1, -1)
/proc/purrbation_remove(mob/living/carbon/human/H, silent = FALSE)
if(!ishuman(H))
return
if(!ON_PURRBATION(H))
return
to_chat(H, "You are no longer a cat.")
H.dna.features["tail_human"] = "None"
var/obj/item/organ/ears/cat/ears = H.getorgan(/obj/item/organ/ears/cat)
var/obj/item/organ/tail/cat/tail = H.getorgan(/obj/item/organ/tail/cat)
if(ears)
var/obj/item/organ/ears/NE
if(H.dna.species && H.dna.species.mutantears)
// Roundstart cat ears override H.dna.species.mutantears, reset it here.
H.dna.species.mutantears = initial(H.dna.species.mutantears)
if(H.dna.species.mutantears)
NE = new H.dna.species.mutantears()
if(!NE)
// Go with default ears
NE = new /obj/item/organ/ears()
NE.Insert(H, drop_if_replaced = FALSE)
if(tail)
var/obj/item/organ/tail/NT
if(H.dna.species && H.dna.species.mutanttail)
// Roundstart cat tail overrides H.dna.species.mutanttail, reset it here.
H.dna.species.mutanttail = initial(H.dna.species.mutanttail)
if(H.dna.species.mutanttail)
NT = new H.dna.species.mutanttail()
if(NT)
NT.Insert(H, drop_if_replaced = FALSE)
else
tail.Remove(H)
H.dna.features["ears"] = "None"
H.regenerate_icons()
H.dna.features["tail_human"] = "None"
if(!silent)
to_chat(H, "You are no longer a cat.")
#undef ON_PURRBATION
+11 -7
View File
@@ -75,19 +75,23 @@
if(C.preserved)
return ..() * 2
return ..()
// Kitty Organs.
/datum/export/organ/cat/ears
// Mutant race organs.
/datum/export/organ/mutant/cat_ears
cost = 1000
unit_name = "cat ears"
unit_name = "cat ears pair"
export_types = list(/obj/item/organ/ears/cat)
/datum/export/organ/cat/tail
/datum/export/organ/mutant/cat_tail
cost = 1000
unit_name = "cat tail"
export_types = list(/obj/item/organ/tail/cat)
/datum/export/organ/mutant/lizard_tail
cost = 200
unit_name = "lizard tail"
export_types = list(/obj/item/organ/tail/lizard)
// Human organs.
// Do not put human brains here, they are not sellable for a purpose.
+3 -3
View File
@@ -97,7 +97,7 @@
/datum/crafting_recipe/tailclub
name = "Tail Club"
result = /obj/item/tailclub
reqs = list(/obj/item/severedtail = 1,
reqs = list(/obj/item/organ/tail/lizard = 1,
/obj/item/stack/sheet/metal = 1)
time = 40
category = CAT_WEAPONRY
@@ -106,7 +106,7 @@
/datum/crafting_recipe/tailwhip
name = "Liz O' Nine Tails"
result = /obj/item/melee/chainofcommand/tailwhip
reqs = list(/obj/item/severedtail = 1,
reqs = list(/obj/item/organ/tail/lizard = 1,
/obj/item/stack/cable_coil = 1)
time = 40
category = CAT_WEAPONRY
@@ -337,7 +337,7 @@
name = "Lizard Cloche Hat"
result = /obj/item/clothing/head/lizard
time = 10
reqs = list(/obj/item/severedtail = 1)
reqs = list(/obj/item/organ/tail/lizard = 1)
category = CAT_MISC
/datum/crafting_recipe/lizardhat_alternate
@@ -33,7 +33,7 @@
name = "Lizard tail kebab"
reqs = list(
/obj/item/stack/rods = 1,
/obj/item/severedtail = 1
/obj/item/organ/tail/lizard = 1
)
result = /obj/item/reagent_containers/food/snacks/kebab/tail
subcategory = CAT_MEAT
@@ -286,7 +286,7 @@
name = "Lizard wine"
time = 40
reqs = list(
/obj/item/severedtail = 1,
/obj/item/organ/tail/lizard = 1,
/datum/reagent/consumable/ethanol = 100
)
result = /obj/item/reagent_containers/food/drinks/bottle/lizardwine
+9
View File
@@ -72,6 +72,15 @@
H.dna.species.after_equip_job(src, H, visualsOnly)
<<<<<<< HEAD
=======
if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions))
if(H.dna.species.id != "human")
H.set_species(/datum/species/human)
H.rename_self("human", H.client)
purrbation_remove(H, silent=TRUE)
>>>>>>> b5e0746... Refactor of catpeople mutant organs (#32101)
if(!visualsOnly && announce)
announce(H)
@@ -71,6 +71,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/obj/item/organ/ears/mutantears = /obj/item/organ/ears
var/obj/item/mutanthands
var/obj/item/organ/tongue/mutanttongue = /obj/item/organ/tongue
var/obj/item/organ/tail/mutanttail = null
var/obj/item/organ/liver/mutantliver
var/obj/item/organ/stomach/mutantstomach
@@ -147,6 +148,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/obj/item/organ/tongue/tongue = C.getorganslot(ORGAN_SLOT_TONGUE)
var/obj/item/organ/liver/liver = C.getorganslot(ORGAN_SLOT_LIVER)
var/obj/item/organ/stomach/stomach = C.getorganslot(ORGAN_SLOT_STOMACH)
var/obj/item/organ/tail/tail = C.getorganslot(ORGAN_SLOT_TAIL)
var/should_have_brain = TRUE
var/should_have_heart = !(NOBLOOD in species_traits)
@@ -157,6 +159,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/should_have_tongue = TRUE
var/should_have_liver = !(NOLIVER in species_traits)
var/should_have_stomach = !(NOSTOMACH in species_traits)
var/should_have_tail = mutanttail
if(brain && (replace_current || !should_have_brain))
if(!brain.decoy_override)//Just keep it if it's fake
@@ -173,7 +176,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
heart = new mutant_heart()
heart.Insert(C)
if(lungs && (replace_current || !should_have_lungs))
if(lungs && (!should_have_lungs || replace_current))
lungs.Remove(C,1)
QDEL_NULL(lungs)
if(should_have_lungs && !lungs)
@@ -210,6 +213,13 @@ GLOBAL_LIST_EMPTY(roundstart_races)
appendix = new()
appendix.Insert(C)
if(tail && (!should_have_tail || replace_current))
tail.Remove(C,1)
QDEL_NULL(tail)
if(should_have_tail && !tail)
tail = new mutanttail()
tail.Insert(C)
if(C.get_bodypart("head"))
if(eyes && (replace_current || !should_have_eyes))
eyes.Remove(C,1)
@@ -28,6 +28,5 @@ datum/species/human/on_species_gain(mob/living/carbon/human/H, datum/species/old
if(H.dna.features["ears"] == "Cat")
mutantears = /obj/item/organ/ears/cat
if(H.dna.features["tail_human"] == "Cat")
var/tail = /obj/item/organ/tail/cat
mutant_organs += tail
mutanttail = /obj/item/organ/tail/cat
..()
@@ -1,3 +1,4 @@
<<<<<<< HEAD
/datum/species/lizard
// Reptilian humanoids with scaled skin and tails.
name = "Lizardperson"
@@ -49,3 +50,54 @@
id = "ashlizard"
limbs_id = "lizard"
species_traits = list(MUTCOLORS,EYECOLOR,LIPS,NOBREATH,NOGUNS,DIGITIGRADE)
=======
/datum/species/lizard
// Reptilian humanoids with scaled skin and tails.
name = "Lizardperson"
id = "lizard"
say_mod = "hisses"
default_color = "00FF00"
species_traits = list(MUTCOLORS,EYECOLOR,LIPS)
mutant_bodyparts = list("tail_lizard", "snout", "spines", "horns", "frills", "body_markings", "legs")
mutanttongue = /obj/item/organ/tongue/lizard
mutanttail = /obj/item/organ/tail/lizard
coldmod = 1.5
heatmod = 0.67
default_features = list("mcolor" = "0F0", "tail" = "Smooth", "snout" = "Round", "horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None", "legs" = "Normal Legs")
attack_verb = "slash"
attack_sound = 'sound/weapons/slash.ogg'
miss_sound = 'sound/weapons/slashmiss.ogg'
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/lizard
skinned_type = /obj/item/stack/sheet/animalhide/lizard
exotic_bloodtype = "L"
disliked_food = GRAIN | DAIRY
liked_food = GROSS | MEAT
/datum/species/lizard/after_equip_job(datum/job/J, mob/living/carbon/human/H)
H.grant_language(/datum/language/draconic)
/datum/species/lizard/random_name(gender,unique,lastname)
if(unique)
return random_unique_lizard_name(gender)
var/randname = lizard_name(gender)
if(lastname)
randname += " [lastname]"
return randname
//I wag in death
/datum/species/lizard/spec_death(gibbed, mob/living/carbon/human/H)
if(H)
H.endTailWag()
/*
Lizard subspecies: ASHWALKERS
*/
/datum/species/lizard/ashwalker
name = "Ash Walker"
id = "ashlizard"
limbs_id = "lizard"
species_traits = list(MUTCOLORS,EYECOLOR,LIPS,NOBREATH,NOGUNS,DIGITIGRADE)
>>>>>>> b5e0746... Refactor of catpeople mutant organs (#32101)
@@ -539,15 +539,3 @@
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/////////////////////////////////////////////////////////////////////////
/obj/item/severedtail
name = "tail"
desc = "A severed tail. Somewhere, no doubt, a lizard hater is very \
pleased with themselves."
icon = 'icons/obj/surgery.dmi'
icon_state = "severedtail"
color = "#161"
var/markings = "Smooth"
+24 -8
View File
@@ -15,7 +15,10 @@
// without external aid (earmuffs, drugs)
var/ear_damage = 0
var/bang_protect = 0 //Resistance against loud noises
//Resistance against loud noises
var/bang_protect = 0
// Multiplier for both long term and short term ear damage
var/damage_multiplier = 1
/obj/item/organ/ears/on_life()
if(!iscarbon(owner))
@@ -43,14 +46,14 @@
deaf = 1
/obj/item/organ/ears/proc/adjustEarDamage(ddmg, ddeaf)
ear_damage = max(ear_damage + ddmg, 0)
deaf = max(deaf + ddeaf, 0)
ear_damage = max(ear_damage + (ddmg*damage_multiplier), 0)
deaf = max(deaf + (ddeaf*damage_multiplier), 0)
/obj/item/organ/ears/proc/minimumDeafTicks(value)
deaf = max(deaf, value)
/obj/item/organ/ears/invincible/adjustEarDamage(ddmg, ddeaf)
return
/obj/item/organ/ears/invincible
damage_multiplier = 0
/mob/proc/restoreEars()
@@ -79,15 +82,28 @@
name = "cat ears"
icon = 'icons/obj/clothing/hats.dmi'
icon_state = "kitty"
<<<<<<< HEAD
=======
damage_multiplier = 2
>>>>>>> b5e0746... Refactor of catpeople mutant organs (#32101)
/obj/item/organ/ears/cat/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
color = H.hair_color
H.dna.features["ears"] = "Cat"
H.update_body()
if(istype(H))
color = H.hair_color
H.dna.species.mutant_bodyparts |= "ears"
H.dna.features["ears"] = "Cat"
H.update_body()
/obj/item/organ/ears/cat/Remove(mob/living/carbon/human/H, special = 0)
..()
<<<<<<< HEAD
color = H.hair_color
H.dna.features["ears"] = "None"
H.update_body()
=======
if(istype(H))
color = H.hair_color
H.dna.species.mutant_bodyparts -= "ears"
H.update_body()
>>>>>>> b5e0746... Refactor of catpeople mutant organs (#32101)
@@ -173,3 +173,9 @@
ears = new
ears.Insert(src)
if(!getorganslot(ORGAN_SLOT_TAIL))
var/obj/item/organ/tail/tail
if(dna && dna.species && dna.species.mutanttail)
tail = new dna.species.mutanttail
tail.Insert(src)
+50 -11
View File
@@ -1,23 +1,62 @@
// Note: tails only work in humans. They use human-specific parameters and rely on human code for displaying.
/obj/item/organ/tail
name = "tail"
desc = "What did you cut this off of?"
desc = "A severed tail. What did you cut this off of?"
icon_state = "severedtail"
zone = "groin"
slot = ORGAN_SLOT_TAIL
var/tail_type = "None"
/obj/item/organ/tail/Remove(mob/living/carbon/human/H, special = 0)
..()
if(istype(H))
H.endTailWag()
/obj/item/organ/tail/cat
name = "cat tail"
desc = "Who's wagging now?"
icon_state = "severedtail"
desc = "A severed cat tail. Who's wagging now?"
tail_type = "Cat"
/obj/item/organ/tail/cat/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
color = H.hair_color
H.dna.features["tail_human"] = "Cat"
H.update_body()
if(istype(H))
H.dna.species.mutant_bodyparts |= "tail_human"
H.dna.features["tail_human"] = tail_type
H.update_body()
/obj/item/organ/ears/cat/Remove(mob/living/carbon/human/H, special = 0)
/obj/item/organ/tail/cat/Remove(mob/living/carbon/human/H, special = 0)
..()
H.endTailWag()
H.dna.features["tail_human"] = "None"
color = H.hair_color
H.update_body()
if(istype(H))
H.dna.species.mutant_bodyparts -= "tail_human"
tail_type = H.dna.features["tail_human"]
color = H.hair_color
H.update_body()
/obj/item/organ/tail/lizard
name = "lizard tail"
desc = "A severed lizard tail. Somewhere, no doubt, a lizard hater is very pleased with themselves."
color = "#116611"
tail_type = "Smooth"
var/spines = "None"
/obj/item/organ/tail/lizard/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
if(istype(H))
H.dna.features["tail_lizard"] = tail_type
H.dna.features["spines"] = spines
H.dna.species.mutant_bodyparts |= "tail_lizard"
H.dna.species.mutant_bodyparts |= "spines"
H.update_body()
/obj/item/organ/tail/lizard/Remove(mob/living/carbon/human/H, special = 0)
..()
if(istype(H))
H.dna.species.mutant_bodyparts -= "tail_lizard"
H.dna.species.mutant_bodyparts -= "spines"
color = "#" + H.dna.features["mcolor"]
tail_type = H.dna.features["tail_lizard"]
spines = H.dna.features["spines"]
H.update_body()
-83
View File
@@ -1,83 +0,0 @@
// The detachment and attachment of lizard tails
// Dismemberment lite; can/should be generalized aka augs when we get more mutant parts and/or for actual dismemberment
// TAIL REMOVAL
/datum/surgery/tail_removal
name = "tail removal"
steps = list(/datum/surgery_step/sever_tail, /datum/surgery_step/close)
species = list(/mob/living/carbon/human)
possible_locs = list("groin")
/datum/surgery/tail_removal/can_start(mob/user, mob/living/carbon/target)
var/mob/living/carbon/human/L = target
if(("tail_lizard" in L.dna.species.mutant_bodyparts) || ("waggingtail_lizard" in L.dna.species.mutant_bodyparts))
return 1
return 0
/datum/surgery_step/sever_tail
name = "sever tail"
implements = list(/obj/item/scalpel = 100, /obj/item/circular_saw = 100,
/obj/item/melee/sabre = 100, /obj/item/melee/transforming/energy/sword/cyborg/saw = 100,
/obj/item/melee/arm_blade = 80, /obj/item/twohanded/required/chainsaw = 80,
/obj/item/mounted_chainsaw = 80, /obj/item/twohanded/fireaxe = 50,
/obj/item/hatchet = 40, /obj/item = 30) // 30% success with any sharp item.
time = 64
/datum/surgery_step/sever_tail/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to sever [target]'s tail!", "<span class='notice'>You begin to sever [target]'s tail...</span>")
/datum/surgery_step/sever_tail/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.is_sharp())
return FALSE
return TRUE
/datum/surgery_step/sever_tail/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/mob/living/carbon/human/L = target
user.visible_message("[user] severs [L]'s tail!", "<span class='notice'>You sever [L]'s tail.</span>")
if("tail_lizard" in L.dna.species.mutant_bodyparts)
L.dna.species.mutant_bodyparts -= "tail_lizard"
else if("waggingtail_lizard" in L.dna.species.mutant_bodyparts)
L.dna.species.mutant_bodyparts -= "waggingtail_lizard"
if("spines" in L.dna.features)
L.dna.features -= "spines"
var/obj/item/severedtail/S = new(get_turf(target))
S.add_atom_colour("#[L.dna.features["mcolor"]]", FIXED_COLOUR_PRIORITY)
S.markings = "[L.dna.features["tail_lizard"]]"
L.update_body()
return 1
// TAIL ATTACHMENT
/datum/surgery/tail_attachment
name = "tail attachment"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace, /datum/surgery_step/attach_tail, /datum/surgery_step/close)
species = list(/mob/living/carbon/human)
possible_locs = list("groin")
/datum/surgery/tail_attachment/can_start(mob/user, mob/living/carbon/target)
var/mob/living/carbon/human/L = target
if(!("tail_lizard" in L.dna.species.mutant_bodyparts) && !("waggingtail_lizard" in L.dna.species.mutant_bodyparts))
return 1
return 0
/datum/surgery_step/attach_tail
name = "attach tail"
implements = list(/obj/item/severedtail = 100)
time = 64
/datum/surgery_step/attach_tail/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to attach a tail to [target]!", "<span class='notice'>You begin to attach the tail to [target]...</span>")
/datum/surgery_step/attach_tail/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/mob/living/carbon/human/L = target
user.visible_message("[user] gives [L] a tail!", "<span class='notice'>You give [L] a tail. It adjusts to [L]'s melanin.</span>") // fluff for color
if(!(L.dna.features["mcolor"]))
L.dna.features["mcolor"] = tool.color
var/obj/item/severedtail/T = tool
L.dna.features["tail_lizard"] = T.markings
L.dna.species.mutant_bodyparts += "tail_lizard"
qdel(tool)
L.update_mutant_bodyparts()
return 1