mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 22:13:24 +00:00
Vast array of changes to replace mutantrace with species datum
This commit is contained in:
@@ -820,22 +820,14 @@
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/get_species()
|
||||
if(dna)
|
||||
switch(dna.mutantrace)
|
||||
if("lizard")
|
||||
return "Unathi"
|
||||
if("tajaran")
|
||||
return "Tajaran"
|
||||
if("skrell")
|
||||
return "Skrell"
|
||||
if("vox")
|
||||
return "Vox"
|
||||
if("plant")
|
||||
return "Mobile vegetation"
|
||||
if("golem")
|
||||
return "Animated Construct"
|
||||
else
|
||||
return "Human"
|
||||
|
||||
if(!species)
|
||||
set_species()
|
||||
|
||||
if(dna && dna.mutantrace == "golem")
|
||||
return "Animated Construct"
|
||||
|
||||
return species.name
|
||||
|
||||
/mob/living/carbon/get_species()
|
||||
if(src.dna)
|
||||
@@ -848,17 +840,6 @@
|
||||
else if(src.dna.mutantrace == "vox")
|
||||
return "vox"
|
||||
|
||||
/mob/living/carbon/proc/update_mutantrace_languages()
|
||||
if(src.dna)
|
||||
if(src.dna.mutantrace == "lizard")
|
||||
src.languages += new /datum/language/unathi
|
||||
else if(src.dna.mutantrace == "skrell")
|
||||
src.languages += new /datum/language/skrell
|
||||
else if(src.dna.mutantrace == "tajaran")
|
||||
src.languages += new /datum/language/tajaran
|
||||
else if(src.dna.mutantrace == "vox")
|
||||
src.languages += new /datum/language/vox
|
||||
|
||||
/mob/living/carbon/human/proc/play_xylophone()
|
||||
if(!src.xylophone)
|
||||
visible_message("\red [src] begins playing his ribcage like a xylophone. It's quite spooky.","\blue You begin to play a spooky refrain on your ribcage.","\red You hear a spooky xylophone melody.")
|
||||
@@ -1295,4 +1276,4 @@ mob/living/carbon/human/yank_out_object()
|
||||
update_icons()
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -103,34 +103,19 @@
|
||||
|
||||
if("hurt")
|
||||
|
||||
var/attack_verb
|
||||
if(M.dna)
|
||||
switch(M.dna.mutantrace)
|
||||
if("lizard")
|
||||
attack_verb = "scratch"
|
||||
if("tajaran")
|
||||
attack_verb = "scratch"
|
||||
if("plant")
|
||||
attack_verb = "slash"
|
||||
else
|
||||
attack_verb = "punch"
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>[M.species.attack_verb]ed [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [M.species.attack_verb]ed by [M.name] ([M.ckey])</font>")
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>[attack_verb]ed [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [attack_verb]ed by [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[M.name] ([M.ckey]) [attack_verb]ed [src.name] ([src.ckey])</font>")
|
||||
log_attack("<font color='red'>[M.name] ([M.ckey]) [M.species.attack_verb]ed [src.name] ([src.ckey])</font>")
|
||||
|
||||
var/damage = rand(0, 5)//BS12 EDIT
|
||||
if(!damage)
|
||||
switch(attack_verb)
|
||||
if("slash")
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
if("scratch")
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
if(M.species.attack_verb == "punch")
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
|
||||
visible_message("\red <B>[M] has attempted to [attack_verb] [src]!</B>")
|
||||
visible_message("\red <B>[M] has attempted to [M.species.attack_verb] [src]!</B>")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -140,21 +125,18 @@
|
||||
if(HULK in M.mutations) damage += 5
|
||||
|
||||
|
||||
switch(attack_verb)
|
||||
if("slash")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
if("scratch")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
else
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
if(M.species.attack_verb == "punch")
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
|
||||
visible_message("\red <B>[M] has [attack_verb]ed [src]!</B>")
|
||||
visible_message("\red <B>[M] has [M.species.attack_verb]ed [src]!</B>")
|
||||
//Rearranged, so claws don't increase weaken chance.
|
||||
if(damage >= 5 && prob(50))
|
||||
visible_message("\red <B>[M] has weakened [src]!</B>")
|
||||
apply_effect(2, WEAKEN, armor_block)
|
||||
|
||||
if(attack_verb == "scratch") damage += 5
|
||||
if(M.species.attack_verb != "punch") damage += 5
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@
|
||||
|
||||
if( (abs(310.15 - breath.temperature) > 50) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :(
|
||||
if(status_flags & GODMODE) return 1 //godmode
|
||||
if(breath.temperature < species.cold_level_1 && dna.mutantrace != "vox") //Vox are resistant to cold.
|
||||
if(breath.temperature < species.cold_level_1)
|
||||
if(prob(20))
|
||||
src << "\red You feel your face freezing and an icicle forming in your lungs!"
|
||||
else if(breath.temperature > species.heat_level_1)
|
||||
|
||||
@@ -220,14 +220,12 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
|
||||
var/husk_color_mod = rgb(96,88,80)
|
||||
var/hulk_color_mod = rgb(48,224,40)
|
||||
//var/plant_color_mod = rgb(144,224,144)
|
||||
var/necrosis_color_mod = rgb(10,50,0)
|
||||
|
||||
var/husk = (HUSK in src.mutations) //100% unnecessary -Agouri //nope, do you really want to iterate through src.mutations repeatedly? -Pete
|
||||
var/fat = (FAT in src.mutations)
|
||||
var/hulk = (HULK in src.mutations)
|
||||
var/skeleton = (SKELETON in src.mutations)
|
||||
var/plant = (PLANT in src.mutations || (dna && dna.mutantrace == "plant"))
|
||||
|
||||
var/g = "m"
|
||||
if(gender == FEMALE) g = "f"
|
||||
@@ -240,8 +238,6 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
else if(hulk)
|
||||
var/list/TONE = ReadRGB(hulk_color_mod)
|
||||
stand_icon.MapColors(rgb(TONE[1],0,0),rgb(0,TONE[2],0),rgb(0,0,TONE[3]))
|
||||
//else if(plant)
|
||||
// stand_icon.ColorTone(plant_color_mod)
|
||||
|
||||
var/datum/organ/external/head = get_organ("head")
|
||||
var/has_head = 0
|
||||
@@ -269,8 +265,6 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
else if(hulk)
|
||||
var/list/TONE = ReadRGB(hulk_color_mod)
|
||||
temp.MapColors(rgb(TONE[1],0,0),rgb(0,TONE[2],0),rgb(0,0,TONE[3]))
|
||||
//else if(plant)
|
||||
// temp.ColorTone(plant_color_mod)
|
||||
|
||||
//That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST
|
||||
//And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part)
|
||||
@@ -293,7 +287,7 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
stand_icon.Blend(temp, ICON_OVERLAY)
|
||||
|
||||
//Skin tone
|
||||
if(!skeleton && !husk && !hulk && !plant)
|
||||
if(!skeleton && !husk && !hulk && (species.flags & HAS_SKIN_TONE))
|
||||
if(s_tone >= 0)
|
||||
stand_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
|
||||
else
|
||||
@@ -309,18 +303,16 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
if(has_head)
|
||||
//Eyes
|
||||
if(!skeleton)
|
||||
var/icon/eyes_s = new/icon('icons/mob/human_face.dmi', "eyes_s")
|
||||
if(src.get_species()=="Vox")
|
||||
eyes_s = new/icon('icons/mob/human_face.dmi', "vox_eyes_s")
|
||||
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
stand_icon.Blend(eyes_s, ICON_OVERLAY)
|
||||
var/icon/eyes = new/icon('icons/mob/human_face.dmi', species.eyes)
|
||||
eyes.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
stand_icon.Blend(eyes, ICON_OVERLAY)
|
||||
|
||||
//Mouth (lipstick!)
|
||||
if(lip_style) //skeletons are allowed to wear lipstick no matter what you think, agouri.
|
||||
stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY)
|
||||
//Mouth (lipstick!)
|
||||
if(lip_style && (species && species.flags & HAS_LIPS)) //skeletons are allowed to wear lipstick no matter what you think, agouri.
|
||||
stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY)
|
||||
|
||||
//Underwear
|
||||
if(underwear >0 && underwear < 12 && (src.dna.mutantrace != "vox" && src.dna.mutantrace != "plant" && src.dna.mutantrace != "kidan"))
|
||||
if(underwear >0 && underwear < 12 && species.flags & HAS_UNDERWEAR)
|
||||
if(!fat && !skeleton)
|
||||
stand_icon.Blend(new /icon('icons/mob/human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
|
||||
|
||||
@@ -429,58 +421,23 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
var/skeleton = (SKELETON in src.mutations)
|
||||
if(skeleton)
|
||||
race_icon = 'icons/mob/human_races/r_skeleton.dmi'
|
||||
|
||||
//Icon data is kept in species datums within the mob.
|
||||
race_icon = 'icons/mob/human_races/r_human.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_human.dmi'
|
||||
|
||||
if(species.icobase)
|
||||
race_icon = species.icobase
|
||||
if(species.deform)
|
||||
deform_icon = species.deform
|
||||
|
||||
/*else if(dna)
|
||||
switch(dna.mutantrace)
|
||||
if("tajaran")
|
||||
race_icon = 'icons/mob/human_races/r_tajaran.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_tajaran.dmi'
|
||||
if("lizard")
|
||||
race_icon = 'icons/mob/human_races/r_lizard.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_lizard.dmi'
|
||||
if("skrell")
|
||||
race_icon = 'icons/mob/human_races/r_skrell.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_skrell.dmi'
|
||||
if("vox")
|
||||
race_icon = 'icons/mob/human_races/r_vox.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_vox.dmi'
|
||||
if("plant")
|
||||
race_icon = 'icons/mob/human_races/r_plant.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_plant.dmi'
|
||||
else
|
||||
race_icon = 'icons/mob/human_races/r_human.dmi'
|
||||
deform_icon = 'icons/mob/human_races/r_def_human.dmi'
|
||||
else
|
||||
icon = 'icons/mob/human_races/r_human.dmi' */
|
||||
//Icon data is kept in species datums within the mob.
|
||||
race_icon = species.icobase
|
||||
deform_icon = species.deform
|
||||
|
||||
if(dna)
|
||||
switch(dna.mutantrace)
|
||||
if("golem","slime","shadow","adamantine")
|
||||
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_l")
|
||||
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_s")
|
||||
// if("lizard","tajaran","skrell")
|
||||
// overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[gender]_l")
|
||||
// overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[gender]_s")
|
||||
// if("plant")
|
||||
// if(stat == DEAD) //TODO
|
||||
// overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_d")
|
||||
// else
|
||||
// overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_l")
|
||||
// overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_s")
|
||||
else
|
||||
overlays_lying[MUTANTRACE_LAYER] = null
|
||||
overlays_standing[MUTANTRACE_LAYER] = null
|
||||
|
||||
if(!dna || !(dna.mutantrace in list("golem","metroid")))
|
||||
update_body(0)
|
||||
|
||||
update_hair(0)
|
||||
if(update_icons) update_icons()
|
||||
|
||||
@@ -817,15 +774,11 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
|
||||
overlays_lying[TAIL_LAYER] = null
|
||||
overlays_standing[TAIL_LAYER] = null
|
||||
var/cur_species = get_species()
|
||||
if( cur_species == "Tajaran")
|
||||
|
||||
if(species.tail && species.flags & HAS_TAIL)
|
||||
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
|
||||
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "tajtail_l")
|
||||
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "tajtail_s")
|
||||
else if( cur_species == "Unathi")
|
||||
if(!wear_suit || !(wear_suit.flags_inv & HIDEJUMPSUIT) && !istype(wear_suit, /obj/item/clothing/suit/space))
|
||||
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "sogtail_l")
|
||||
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "sogtail_s")
|
||||
overlays_lying[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]_l")
|
||||
overlays_standing[TAIL_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]_s")
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
100
code/modules/mob/living/carbon/species.dm
Normal file
100
code/modules/mob/living/carbon/species.dm
Normal file
@@ -0,0 +1,100 @@
|
||||
#define NO_EAT 1
|
||||
#define NO_BREATHE 2
|
||||
#define NO_SLEEP 4
|
||||
#define NO_SHOCK 8
|
||||
#define NO_SCAN 16
|
||||
#define NON_GENDERED 32
|
||||
#define REQUIRE_LIGHT 64
|
||||
#define WHITELISTED 128
|
||||
#define HAS_SKIN_TONE 256
|
||||
#define HAS_LIPS 512
|
||||
#define HAS_UNDERWEAR 1024
|
||||
#define HAS_TAIL 2048
|
||||
#define IS_PLANT 4096
|
||||
|
||||
/*
|
||||
Datum-based species. Should make for much cleaner and easier to maintain mutantrace code.
|
||||
*/
|
||||
|
||||
/datum/species
|
||||
var/name // Species name.
|
||||
|
||||
var/icobase = 'icons/mob/human_races/r_human.dmi' // Normal icon set.
|
||||
var/deform = 'icons/mob/human_races/r_def_human.dmi' // Mutated icon set.
|
||||
var/eyes = "eyes_s" // Icon for eyes.
|
||||
|
||||
var/tail // Name of tail image in species effects icon file.
|
||||
var/primitive // Lesser form, if any (ie. monkey for humans)
|
||||
var/datum/language/language // Default racial language, if any.
|
||||
var/attack_verb = "punch" // Empty hand hurt intent verb.
|
||||
|
||||
var/breath_type // Non-oxygen gas breathed, if any.
|
||||
|
||||
var/cold_level_1 = 260 // Cold damage level 1 below this point.
|
||||
var/cold_level_2 = 200 // Cold damage level 2 below this point.
|
||||
var/cold_level_3 = 120 // Cold damage level 3 below this point.
|
||||
|
||||
var/heat_level_1 = 360 // Heat damage level 1 above this point.
|
||||
var/heat_level_2 = 400 // Heat damage level 2 above this point.
|
||||
var/heat_level_3 = 1000 // Heat damage level 2 above this point.
|
||||
|
||||
var/hazard_high_pressure = 550 // Dangerously high pressure.
|
||||
var/warning_high_pressure = 325 // High pressure warning.
|
||||
var/hazard_low_pressure = 50 // Dangerously low pressure.
|
||||
var/warning_low_pressure = 20 // Low pressure warning.
|
||||
|
||||
var/brute_resist // Physical damage reduction.
|
||||
var/burn_resist // Burn damage reduction.
|
||||
|
||||
var/flags = 0 // Various specific features.
|
||||
|
||||
/datum/species/human
|
||||
name = "Human"
|
||||
flags = HAS_LIPS | HAS_UNDERWEAR
|
||||
|
||||
/datum/species/unathi
|
||||
name = "Unathi"
|
||||
icobase = 'icons/mob/human_races/r_lizard.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_lizard.dmi'
|
||||
language = new /datum/language/unathi
|
||||
tail = "sogtail"
|
||||
attack_verb = "scratch"
|
||||
|
||||
flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_TAIL
|
||||
|
||||
/datum/species/tajaran
|
||||
name = "Tajara"
|
||||
icobase = 'icons/mob/human_races/r_tajaran.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_tajaran.dmi'
|
||||
language = new /datum/language/tajaran
|
||||
tail = "tajtail"
|
||||
attack_verb = "scratch"
|
||||
|
||||
flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_TAIL
|
||||
|
||||
/datum/species/skrell
|
||||
name = "Skrell"
|
||||
icobase = 'icons/mob/human_races/r_skrell.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_skrell.dmi'
|
||||
language = new /datum/language/skrell
|
||||
|
||||
flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR
|
||||
|
||||
/datum/species/vox
|
||||
name = "Vox"
|
||||
icobase = 'icons/mob/human_races/r_vox.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_vox.dmi'
|
||||
language = new /datum/language/vox
|
||||
|
||||
eyes = "vox_eyes_s"
|
||||
breath_type = "nitrogen"
|
||||
|
||||
flags = NO_SCAN
|
||||
|
||||
/datum/species/diona
|
||||
name = "Diona"
|
||||
icobase = 'icons/mob/human_races/r_plant.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_plant.dmi'
|
||||
attack_verb = "slash"
|
||||
|
||||
flags = NO_EAT | NO_BREATHE | REQUIRE_LIGHT | NON_GENDERED | NO_SCAN | IS_PLANT
|
||||
@@ -101,7 +101,7 @@
|
||||
M << "\blue Like lead slabs crashing into the ocean, alien thoughts drop into your mind: [text]"
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.dna.mutantrace == "vox")
|
||||
if(H.species.name == "Vox")
|
||||
return
|
||||
H << "\red Your nose begins to bleed..."
|
||||
H.drip(1)
|
||||
|
||||
@@ -349,17 +349,14 @@
|
||||
|
||||
if(client.prefs.species == "Tajaran") //This is like the worst, but it works, so meh. - Erthilo
|
||||
if(is_alien_whitelisted(src, "Tajaran") || !config.usealienwhitelist)
|
||||
new_character.dna.mutantrace = "tajaran"
|
||||
new_character.set_species(new /datum/species/tajaran)
|
||||
new_character.languages += new /datum/language/tajaran
|
||||
if(client.prefs.species == "Unathi")
|
||||
if(is_alien_whitelisted(src, "Soghun") || !config.usealienwhitelist)
|
||||
new_character.dna.mutantrace = "lizard"
|
||||
new_character.set_species(new /datum/species/unathi)
|
||||
new_character.languages += new /datum/language/unathi
|
||||
if(client.prefs.species == "Skrell")
|
||||
if(is_alien_whitelisted(src, "Skrell") || !config.usealienwhitelist)
|
||||
new_character.dna.mutantrace = "skrell"
|
||||
new_character.set_species(new /datum/species/skrell)
|
||||
new_character.languages += new /datum/language/skrell
|
||||
|
||||
|
||||
Reference in New Issue
Block a user