Teshari Tweaks

This commit is contained in:
Anewbe
2017-01-15 01:20:23 -06:00
parent 93a630e2e8
commit 3852ac1e22
6 changed files with 79 additions and 44 deletions

View File

@@ -32,3 +32,10 @@
if(!available_turfs.len)
available_turfs = start_turfs
return pick(available_turfs)
/proc/is_below_sound_pressure(var/turf/T)
var/datum/gas_mixture/environment = T ? T.return_air() : null
var/pressure = environment ? environment.return_pressure() : 0
if(pressure < SOUND_MINIMUM_PRESSURE)
return TRUE
return FALSE

View File

@@ -73,14 +73,14 @@
// Turns a direction into text
/proc/dir2text(direction)
switch (direction)
if (1.0) return "north"
if (2.0) return "south"
if (4.0) return "east"
if (8.0) return "west"
if (5.0) return "northeast"
if (6.0) return "southeast"
if (9.0) return "northwest"
if (10.0) return "southwest"
if (NORTH) return "north"
if (SOUTH) return "south"
if (EAST) return "east"
if (WEST) return "west"
if (NORTHEAST) return "northeast"
if (SOUTHEAST) return "southeast"
if (NORTHWEST) return "northwest"
if (SOUTHWEST) return "southwest"
// Turns text into proper directions
/proc/text2dir(direction)

View File

@@ -59,7 +59,7 @@
if(is_preference_enabled(/datum/client_preference/ghost_ears) && (speaker in view(src)))
message = "<b>[message]</b>"
if((sdisabilities & DEAF) || ear_deaf)
if(is_deaf())
if(!language || !(language.flags & INNATE)) // INNATE is the flag for audible-emote-language, so we don't want to show an "x talks but you cannot hear them" message if it's set
if(speaker == src)
src << "<span class='warning'>You cannot hear yourself speak!</span>"

View File

@@ -90,6 +90,54 @@
return 0
/mob/living/carbon/human
var/next_sonar_ping = 0
/mob/living/carbon/human/proc/sonar_ping()
set name = "Listen In"
set desc = "Allows you to listen in to movement and noises around you."
set category = "Abilities"
if(incapacitated())
src << "<span class='warning'>You need to recover before you can use this ability.</span>"
return
if(world.time < next_sonar_ping)
src << "<span class='warning'>You need another moment to focus.</span>"
return
if(is_deaf() || is_below_sound_pressure(get_turf(src)))
src << "<span class='warning'>You are for all intents and purposes currently deaf!</span>"
return
next_sonar_ping += 10 SECONDS
var/heard_something = FALSE
src << "<span class='notice'>You take a moment to listen in to your environment...</span>"
for(var/mob/living/L in range(client.view, src))
var/turf/T = get_turf(L)
if(!T || L == src || L.stat == DEAD || is_below_sound_pressure(T))
continue
heard_something = TRUE
var/feedback = list()
feedback += "<span class='notice'>There are noises of movement "
var/direction = get_dir(src, L)
if(direction)
feedback += "towards the [dir2text(direction)], "
switch(get_dist(src, L) / client.view)
if(0 to 0.2)
feedback += "very close by."
if(0.2 to 0.4)
feedback += "close by."
if(0.4 to 0.6)
feedback += "some distance away."
if(0.6 to 0.8)
feedback += "further away."
else
feedback += "far away."
else // No need to check distance if they're standing right on-top of us
feedback += "right on top of you."
feedback += "</span>"
src << jointext(feedback,null)
if(!heard_something)
src << "<span class='notice'>You hear no movement but your own.</span>"
#undef HUMAN_EATING_NO_ISSUE
#undef HUMAN_EATING_NO_MOUTH
#undef HUMAN_EATING_BLOCKED_MOUTH

View File

@@ -31,8 +31,9 @@
brute_mod = 1.35
burn_mod = 1.35
mob_size = MOB_SMALL
pass_flags = PASSTABLE
holder_type = /obj/item/weapon/holder/human
short_sighted = 1
// short_sighted = 1
gluttonous = 1
blood_volume = 400
hunger_factor = 0.2
@@ -84,40 +85,13 @@
/datum/unarmed_attack/claws,
/datum/unarmed_attack/stomp/weak
)
/*
var/shock_cap = 30
var/hallucination_cap = 25
// I'm... so... ronrery, so ronery...
/datum/species/teshari/handle_environment_special(var/mob/living/carbon/human/H)
// If they're dead or unconcious they're a bit beyond this kind of thing.
if(H.stat)
return
// No point processing if we're already stressing the hell out.
if(H.hallucination >= hallucination_cap && H.shock_stage >= shock_cap)
return
// Check for company.
for(var/mob/living/M in viewers(H))
if(M == H || M.stat == DEAD || M.invisibility > H.see_invisible)
continue
if(M.faction == "neutral" || M.faction == H.faction)
return
// No company? Suffer :(
if(H.shock_stage < shock_cap)
H.shock_stage += 1
if(H.shock_stage >= shock_cap && H.hallucination < hallucination_cap)
H.hallucination += 2.5
*/
/datum/species/teshari/get_vision_flags(var/mob/living/carbon/human/H)
if(!(H.sdisabilities & DEAF) && !H.ear_deaf)
return SEE_SELF|SEE_MOBS
else
return SEE_SELF
inherent_verbs = list(
/mob/living/carbon/human/proc/sonar_ping,
/mob/living/proc/hide
)
/datum/species/teshari/equip_survival_gear(var/mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(H),slot_shoes)

View File

@@ -50,13 +50,13 @@
if(!client) return
if (type)
if((type & 1) && ((sdisabilities & BLIND) || blinded || paralysis) )//Vision related
if((type & 1) && (is_blind() || paralysis) )//Vision related
if (!( alt ))
return
else
msg = alt
type = alt_type
if ((type & 2) && ((sdisabilities & DEAF) || ear_deaf))//Hearing related
if ((type & 2) && is_deaf())//Hearing related
if (!( alt ))
return
else
@@ -154,6 +154,12 @@
return UNBUCKLED
return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED
/mob/proc/is_blind()
return ((sdisabilities & BLIND) || blinded || incapacitated(INCAPACITATION_KNOCKOUT))
/mob/proc/is_deaf()
return ((sdisabilities & DEAF) || ear_deaf || incapacitated(INCAPACITATION_KNOCKOUT))
/mob/proc/is_physically_disabled()
return incapacitated(INCAPACITATION_DISABLED)