Merge branch 'master' into master

This commit is contained in:
BlackMajor
2020-01-24 00:50:46 +13:00
committed by GitHub
1489 changed files with 214160 additions and 206675 deletions
+38 -37
View File
@@ -1,37 +1,38 @@
// Camera mob, used by AI camera and blob.
/mob/camera
name = "camera mob"
density = FALSE
anchored = TRUE
status_flags = GODMODE // You can't damage it.
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
see_in_dark = 7
invisibility = INVISIBILITY_ABSTRACT // No one can see us
sight = SEE_SELF
move_on_shuttle = FALSE
var/call_life = FALSE //TRUE if Life() should be called on this camera every tick of the mobs subystem, as if it were a living mob
/mob/camera/Initialize()
. = ..()
if(call_life)
GLOB.living_cameras += src
/mob/camera/Destroy()
. = ..()
if(call_life)
GLOB.living_cameras -= src
/mob/camera/experience_pressure_difference()
return
/mob/camera/forceMove(atom/destination)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE, TRUE)
/mob/camera/canUseStorage()
return FALSE
/mob/camera/emote(act, m_type=1, message = null, intentional = FALSE)
return
// Camera mob, used by AI camera and blob.
/mob/camera
name = "camera mob"
density = FALSE
move_force = INFINITY
move_resist = INFINITY
status_flags = GODMODE // You can't damage it.
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
see_in_dark = 7
invisibility = INVISIBILITY_ABSTRACT // No one can see us
sight = SEE_SELF
move_on_shuttle = FALSE
var/call_life = FALSE //TRUE if Life() should be called on this camera every tick of the mobs subystem, as if it were a living mob
/mob/camera/Initialize()
. = ..()
if(call_life)
GLOB.living_cameras += src
/mob/camera/Destroy()
. = ..()
if(call_life)
GLOB.living_cameras -= src
/mob/camera/experience_pressure_difference()
return
/mob/camera/forceMove(atom/destination)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE, TRUE)
/mob/camera/canUseStorage()
return FALSE
/mob/camera/emote(act, m_type=1, message = null, intentional = FALSE)
return
+130 -129
View File
@@ -1,129 +1,130 @@
//Dead mobs can exist whenever. This is needful
INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead
sight = SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
throwforce = 0
/mob/dead/Initialize()
if(flags_1 & INITIALIZED_1)
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1
tag = "mob_[next_mob_id++]"
GLOB.mob_list += src
prepare_huds()
if(length(CONFIG_GET(keyed_list/cross_server)))
verbs += /mob/dead/proc/server_hop
set_focus(src)
return INITIALIZE_HINT_NORMAL
/mob/dead/canUseStorage()
return FALSE
/mob/dead/dust(just_ash, drop_items, force) //ghosts can't be vaporised.
return
/mob/dead/gib() //ghosts can't be gibbed.
return
/mob/dead/ConveyorMove() //lol
return
/mob/dead/forceMove(atom/destination)
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(destination)
if (old_turf?.z != new_turf?.z)
onTransitZ(old_turf?.z, new_turf?.z)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE, TRUE)
/mob/dead/Stat()
..()
if(!statpanel("Status"))
return
//stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]")
if(SSticker.HasRoundStarted())
return
var/time_remaining = SSticker.GetTimeLeft()
if(time_remaining > 0)
stat(null, "Time To Start: [round(time_remaining/10)]s")
else if(time_remaining == -10)
stat(null, "Time To Start: DELAYED")
else
stat(null, "Time To Start: SOON")
stat(null, "Players: [SSticker.totalPlayers]")
if(client.holder)
stat(null, "Players Ready: [SSticker.totalPlayersReady]")
/mob/dead/proc/server_hop()
set category = "OOC"
set name = "Server Hop!"
set desc= "Jump to the other server"
if(notransform)
return
var/list/csa = CONFIG_GET(keyed_list/cross_server)
var/pick
switch(csa.len)
if(0)
verbs -= /mob/dead/proc/server_hop
to_chat(src, "<span class='notice'>Server Hop has been disabled.</span>")
if(1)
pick = csa[0]
else
pick = input(src, "Pick a server to jump to", "Server Hop") as null|anything in csa
if(!pick)
return
var/addr = csa[pick]
if(alert(src, "Jump to server [pick] ([addr])?", "Server Hop", "Yes", "No") != "Yes")
return
var/client/C = client
to_chat(C, "<span class='notice'>Sending you to [pick].</span>")
new /obj/screen/splash(C)
notransform = TRUE
sleep(29) //let the animation play
notransform = FALSE
if(!C)
return
winset(src, null, "command=.options") //other wise the user never knows if byond is downloading resources
C << link("[addr]?server_hop=[key]")
/mob/dead/proc/update_z(new_z) // 1+ to register, null to unregister
if (registered_z != new_z)
if (registered_z)
SSmobs.dead_players_by_zlevel[registered_z] -= src
if (client)
if (new_z)
SSmobs.dead_players_by_zlevel[new_z] += src
registered_z = new_z
else
registered_z = null
/mob/dead/Login()
. = ..()
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
/mob/dead/Logout()
update_z(null)
return ..()
/mob/dead/onTransitZ(old_z,new_z)
..()
update_z(new_z)
//Dead mobs can exist whenever. This is needful
INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead
sight = SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
move_resist = INFINITY
throwforce = 0
/mob/dead/Initialize()
if(flags_1 & INITIALIZED_1)
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1
tag = "mob_[next_mob_id++]"
GLOB.mob_list += src
prepare_huds()
if(length(CONFIG_GET(keyed_list/cross_server)))
verbs += /mob/dead/proc/server_hop
set_focus(src)
return INITIALIZE_HINT_NORMAL
/mob/dead/canUseStorage()
return FALSE
/mob/dead/dust(just_ash, drop_items, force) //ghosts can't be vaporised.
return
/mob/dead/gib() //ghosts can't be gibbed.
return
/mob/dead/ConveyorMove() //lol
return
/mob/dead/forceMove(atom/destination)
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(destination)
if (old_turf?.z != new_turf?.z)
onTransitZ(old_turf?.z, new_turf?.z)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE, TRUE)
/mob/dead/Stat()
..()
if(!statpanel("Status"))
return
//stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]")
if(SSticker.HasRoundStarted())
return
var/time_remaining = SSticker.GetTimeLeft()
if(time_remaining > 0)
stat(null, "Time To Start: [round(time_remaining/10)]s")
else if(time_remaining == -10)
stat(null, "Time To Start: DELAYED")
else
stat(null, "Time To Start: SOON")
stat(null, "Players: [SSticker.totalPlayers]")
if(client.holder)
stat(null, "Players Ready: [SSticker.totalPlayersReady]")
/mob/dead/proc/server_hop()
set category = "OOC"
set name = "Server Hop!"
set desc= "Jump to the other server"
if(notransform)
return
var/list/csa = CONFIG_GET(keyed_list/cross_server)
var/pick
switch(csa.len)
if(0)
verbs -= /mob/dead/proc/server_hop
to_chat(src, "<span class='notice'>Server Hop has been disabled.</span>")
if(1)
pick = csa[0]
else
pick = input(src, "Pick a server to jump to", "Server Hop") as null|anything in csa
if(!pick)
return
var/addr = csa[pick]
if(alert(src, "Jump to server [pick] ([addr])?", "Server Hop", "Yes", "No") != "Yes")
return
var/client/C = client
to_chat(C, "<span class='notice'>Sending you to [pick].</span>")
new /obj/screen/splash(C)
notransform = TRUE
sleep(29) //let the animation play
notransform = FALSE
if(!C)
return
winset(src, null, "command=.options") //other wise the user never knows if byond is downloading resources
C << link("[addr]?server_hop=[key]")
/mob/dead/proc/update_z(new_z) // 1+ to register, null to unregister
if (registered_z != new_z)
if (registered_z)
SSmobs.dead_players_by_zlevel[registered_z] -= src
if (client)
if (new_z)
SSmobs.dead_players_by_zlevel[new_z] += src
registered_z = new_z
else
registered_z = null
/mob/dead/Login()
. = ..()
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
/mob/dead/Logout()
update_z(null)
return ..()
/mob/dead/onTransitZ(old_z,new_z)
..()
update_z(new_z)
+34 -34
View File
@@ -1,34 +1,34 @@
/mob/dead/new_player/Login()
if(CONFIG_GET(flag/use_exp_tracking))
client.set_exp_from_db()
client.set_db_player_flags()
if(!mind)
mind = new /datum/mind(key)
mind.active = 1
mind.current = src
..()
var/motd = global.config.motd
if(motd)
to_chat(src, "<div class=\"motd\">[motd]</div>", handle_whitespace=FALSE)
if(GLOB.admin_notice)
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [GLOB.admin_notice]</span>")
var/spc = CONFIG_GET(number/soft_popcap)
if(spc && living_player_count() >= spc)
to_chat(src, "<span class='notice'><b>Server Notice:</b>\n \t [CONFIG_GET(string/soft_popcap_message)]</span>")
sight |= SEE_TURFS
new_player_panel()
client.playtitlemusic()
if(SSticker.current_state < GAME_STATE_SETTING_UP)
var/tl = SSticker.GetTimeLeft()
var/postfix
if(tl > 0)
postfix = "in about [DisplayTimeText(tl)]"
else
postfix = "soon"
to_chat(src, "Please set up your character and select \"Ready\". The game will start [postfix].")
/mob/dead/new_player/Login()
if(CONFIG_GET(flag/use_exp_tracking))
client.set_exp_from_db()
client.set_db_player_flags()
if(!mind)
mind = new /datum/mind(key)
mind.active = 1
mind.current = src
..()
var/motd = global.config.motd
if(motd)
to_chat(src, "<div class=\"motd\">[motd]</div>", handle_whitespace=FALSE)
if(GLOB.admin_notice)
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [GLOB.admin_notice]</span>")
var/spc = CONFIG_GET(number/soft_popcap)
if(spc && living_player_count() >= spc)
to_chat(src, "<span class='notice'><b>Server Notice:</b>\n \t [CONFIG_GET(string/soft_popcap_message)]</span>")
sight |= SEE_TURFS
new_player_panel()
client.playtitlemusic()
if(SSticker.current_state < GAME_STATE_SETTING_UP)
var/tl = SSticker.GetTimeLeft()
var/postfix
if(tl > 0)
postfix = "in about [DisplayTimeText(tl)]"
else
postfix = "soon"
to_chat(src, "Please set up your character and select \"Ready\". The game will start [postfix].")
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,62 +1,62 @@
//The mob should have a gender you want before running this proc. Will run fine without H
/datum/preferences/proc/random_character(gender_override)
if(gender_override)
gender = gender_override
else
gender = pick(MALE,FEMALE)
underwear = random_underwear(gender)
undie_color = random_short_color()
undershirt = random_undershirt(gender)
shirt_color = random_short_color()
socks = random_socks()
socks_color = random_short_color()
skin_tone = random_skin_tone()
hair_style = random_hair_style(gender)
facial_hair_style = random_facial_hair_style(gender)
hair_color = random_short_color()
facial_hair_color = hair_color
eye_color = random_eye_color()
horn_color = "85615a"
wing_color = "fff"
if(!pref_species)
var/rando_race = pick(GLOB.roundstart_races)
pref_species = new rando_race()
features = random_features()
age = rand(AGE_MIN,AGE_MAX)
/datum/preferences/proc/update_preview_icon(equip_job = TRUE)
// Determine what job is marked as 'High' priority, and dress them up as such.
var/datum/job/previewJob = get_highest_job()
if(previewJob)
// Silicons only need a very basic preview since there is no customization for them.
if(istype(previewJob,/datum/job/ai))
parent.show_character_previews(image('icons/mob/ai.dmi', icon_state = resolve_ai_icon(preferred_ai_core_display), dir = SOUTH))
return
if(istype(previewJob,/datum/job/cyborg))
parent.show_character_previews(image('icons/mob/robots.dmi', icon_state = "robot", dir = SOUTH))
return
// Set up the dummy for its photoshoot
var/mob/living/carbon/human/dummy/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
// Apply the Dummy's preview background first so we properly layer everything else on top of it.
mannequin.add_overlay(mutable_appearance('modular_citadel/icons/ui/backgrounds.dmi', bgstate, layer = SPACE_LAYER))
copy_to(mannequin)
if(previewJob && equip_job)
mannequin.job = previewJob.title
previewJob.equip(mannequin, TRUE, preference_source = parent)
COMPILE_OVERLAYS(mannequin)
parent.show_character_previews(new /mutable_appearance(mannequin))
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
/datum/preferences/proc/get_highest_job()
var/highest_pref = 0
var/datum/job/highest_job
for(var/job in job_preferences)
if(job_preferences["[job]"] > highest_pref)
highest_job = SSjob.GetJob(job)
highest_pref = job_preferences["[job]"]
return highest_job
//The mob should have a gender you want before running this proc. Will run fine without H
/datum/preferences/proc/random_character(gender_override)
if(gender_override)
gender = gender_override
else
gender = pick(MALE,FEMALE)
underwear = random_underwear(gender)
undie_color = random_short_color()
undershirt = random_undershirt(gender)
shirt_color = random_short_color()
socks = random_socks()
socks_color = random_short_color()
skin_tone = random_skin_tone()
hair_style = random_hair_style(gender)
facial_hair_style = random_facial_hair_style(gender)
hair_color = random_short_color()
facial_hair_color = hair_color
eye_color = random_eye_color()
horn_color = "85615a"
wing_color = "fff"
if(!pref_species)
var/rando_race = pick(GLOB.roundstart_races)
pref_species = new rando_race()
features = random_features()
age = rand(AGE_MIN,AGE_MAX)
/datum/preferences/proc/update_preview_icon(equip_job = TRUE)
// Determine what job is marked as 'High' priority, and dress them up as such.
var/datum/job/previewJob = get_highest_job()
if(previewJob)
// Silicons only need a very basic preview since there is no customization for them.
if(istype(previewJob,/datum/job/ai))
parent.show_character_previews(image('icons/mob/ai.dmi', icon_state = resolve_ai_icon(preferred_ai_core_display), dir = SOUTH))
return
if(istype(previewJob,/datum/job/cyborg))
parent.show_character_previews(image('icons/mob/robots.dmi', icon_state = "robot", dir = SOUTH))
return
// Set up the dummy for its photoshoot
var/mob/living/carbon/human/dummy/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
// Apply the Dummy's preview background first so we properly layer everything else on top of it.
mannequin.add_overlay(mutable_appearance('modular_citadel/icons/ui/backgrounds.dmi', bgstate, layer = SPACE_LAYER))
copy_to(mannequin)
if(previewJob && equip_job)
mannequin.job = previewJob.title
previewJob.equip(mannequin, TRUE, preference_source = parent)
COMPILE_OVERLAYS(mannequin)
parent.show_character_previews(new /mutable_appearance(mannequin))
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
/datum/preferences/proc/get_highest_job()
var/highest_pref = 0
var/datum/job/highest_job
for(var/job in job_preferences)
if(job_preferences["[job]"] > highest_pref)
highest_job = SSjob.GetJob(job)
highest_pref = job_preferences["[job]"]
return highest_job
@@ -244,6 +244,10 @@
name = "Shark"
icon_state = "shark"
/datum/sprite_accessory/mam_snouts/hshark
name = "hShark"
icon_state = "hshark"
/datum/sprite_accessory/mam_snouts/toucan
name = "Toucan"
icon_state = "toucan"
@@ -370,6 +370,22 @@
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/smooth
name = "Smooth"
icon_state = "smooth"
/datum/sprite_accessory/tails_animated/human/smooth
name = "Smooth"
icon_state = "smooth"
/datum/sprite_accessory/tails/human/spikes
name = "Spikes"
icon_state = "spikes"
/datum/sprite_accessory/tails_animated/human/spikes
name = "Spikes"
icon_state = "spikes"
/datum/sprite_accessory/tails/human/shark
name = "Shark"
icon_state = "shark"
@@ -438,6 +454,22 @@
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
/datum/sprite_accessory/tails_animated/human/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
/datum/sprite_accessory/tails/human/ltiger
name = "Light Tiger"
icon_state = "ltiger"
/datum/sprite_accessory/tails_animated/human/ltiger
name = "Light Tiger"
icon_state = "ltiger"
/datum/sprite_accessory/tails/human/wolf
name = "Wolf"
icon_state = "wolf"
@@ -693,6 +725,30 @@ datum/sprite_accessory/mam_tails/insect
name = "Skunk"
icon_state = "skunk"
/datum/sprite_accessory/mam_tails/smooth
name = "Smooth"
icon_state = "smooth"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails_animated/smooth
name = "Smooth"
icon_state = "smooth"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails_animated/spikes
name = "Spikes"
icon_state = "spikes"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails/spikes
name = "Spikes"
icon_state = "spikes"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails/shark
name = "Shark"
icon_state = "shark"
@@ -741,6 +797,30 @@ datum/sprite_accessory/mam_tails/insect
name = "Tiger"
icon_state = "tiger"
/datum/sprite_accessory/mam_tails/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails_animated/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails/ltiger
name = "Light Tiger"
icon_state = "ltiger"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails_animated/ltiger
name = "Light Tiger"
icon_state = "ltiger"
color_src = MUTCOLORS
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/mam_tails/wolf
name = "Wolf"
icon_state = "wolf"
+6 -10
View File
@@ -12,7 +12,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
stat = DEAD
density = FALSE
canmove = 0
anchored = TRUE // don't get pushed around
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
invisibility = INVISIBILITY_OBSERVER
@@ -261,8 +260,9 @@ Transfer_mind is there to check if mob is being deleted/not going to have a body
Works together with spawning an observer, noted above.
*/
/mob/proc/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE)
/mob/proc/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE, voluntary = FALSE)
penalize = suiciding || penalize // suicide squad.
voluntary_ghosted = voluntary
if(!key || cmptext(copytext(key,1,2),"@") || (SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, can_reenter_corpse, special, penalize) & COMPONENT_BLOCK_GHOSTING))
return //mob has no key, is an aghost or some component hijacked.
stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now
@@ -286,9 +286,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Ghost"
set desc = "Relinquish your life and enter the land of the dead."
if(SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, (stat == DEAD) ? TRUE : FALSE, FALSE) & COMPONENT_BLOCK_GHOSTING)
return
var/penalty = CONFIG_GET(number/suicide_reenter_round_timer) MINUTES
var/roundstart_quit_limit = CONFIG_GET(number/roundstart_suicide_time_limit) MINUTES
if(world.time < roundstart_quit_limit)
@@ -296,6 +293,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(penalty + world.realtime - SSshuttle.realtimeofstart > SSshuttle.auto_call + SSshuttle.emergencyCallTime + SSshuttle.emergencyDockTime + SSshuttle.emergencyEscapeTime)
penalty = CANT_REENTER_ROUND
if(SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, (stat == DEAD) ? TRUE : FALSE, FALSE, (stat == DEAD)? penalty : 0, (stat == DEAD)? TRUE : FALSE) & COMPONENT_BLOCK_GHOSTING)
return
if(stat != DEAD)
succumb()
if(stat == DEAD)
@@ -308,7 +308,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/obj/machinery/cryopod/C = loc
C.despawn_occupant()
else
ghostize(0, penalize = TRUE) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
ghostize(0, penalize = TRUE, voluntary = TRUE) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
suicide_log(TRUE)
/mob/camera/verb/ghost()
@@ -664,10 +664,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(src, "<span class='warning'>This creature is too powerful for you to possess!</span>")
return 0
if(istype (target, /mob/living/simple_animal/hostile/spawner))
to_chat(src, "<span class='warning'>This isn't really a creature, now is it!</span>")
return 0
if(can_reenter_corpse && mind && mind.current)
if(alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No")
return 0
+40 -40
View File
@@ -1,40 +1,40 @@
/mob/dead/observer/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if (!message)
return
var/message_mode = get_message_mode(message)
if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN))
message = copytext(message, 3)
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(message_mode == MODE_ADMIN)
client.cmd_admin_say(message)
else if(message_mode == MODE_DEADMIN)
client.dsay(message)
return
src.log_talk(message, LOG_SAY, tag="ghost")
if(check_emote(message))
return
. = say_dead(message)
/mob/dead/observer/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
var/atom/movable/to_follow = speaker
if(radio_freq)
var/atom/movable/virtualspeaker/V = speaker
if(isAI(V.source))
var/mob/living/silicon/ai/S = V.source
to_follow = S.eyeobj
else
to_follow = V.source
var/link = FOLLOW_LINK(src, to_follow)
// Recompose the message, because it's scrambled by default
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
to_chat(src, "[link] [message]")
/mob/dead/observer/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if (!message)
return
var/message_mode = get_message_mode(message)
if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN))
message = copytext(message, 3)
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(message_mode == MODE_ADMIN)
client.cmd_admin_say(message)
else if(message_mode == MODE_DEADMIN)
client.dsay(message)
return
src.log_talk(message, LOG_SAY, tag="ghost")
if(check_emote(message))
return
. = say_dead(message)
/mob/dead/observer/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
var/atom/movable/to_follow = speaker
if(radio_freq)
var/atom/movable/virtualspeaker/V = speaker
if(isAI(V.source))
var/mob/living/silicon/ai/S = V.source
to_follow = S.eyeobj
else
to_follow = V.source
var/link = FOLLOW_LINK(src, to_follow)
// Recompose the message, because it's scrambled by default
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
to_chat(src, "[link] [message]")
+473 -473
View File
@@ -1,473 +1,473 @@
//These procs handle putting s tuff in your hands
//as they handle all relevant stuff like adding it to the player's screen and updating their overlays.
//Returns the thing we're currently holding
/mob/proc/get_active_held_item()
return get_item_for_held_index(active_hand_index)
//Finds the opposite limb for the active one (eg: upper left arm will find the item in upper right arm)
//So we're treating each "pair" of limbs as a team, so "both" refers to them
/mob/proc/get_inactive_held_item()
return get_item_for_held_index(get_inactive_hand_index())
//Finds the opposite index for the active one (eg: upper left arm will find the item in upper right arm)
//So we're treating each "pair" of limbs as a team, so "both" refers to them
/mob/proc/get_inactive_hand_index()
var/other_hand = 0
if(!(active_hand_index % 2))
other_hand = active_hand_index-1 //finding the matching "left" limb
else
other_hand = active_hand_index+1 //finding the matching "right" limb
if(other_hand < 0 || other_hand > held_items.len)
other_hand = 0
return other_hand
/mob/proc/get_item_for_held_index(i)
if(i > 0 && i <= held_items.len)
return held_items[i]
return FALSE
//Odd = left. Even = right
/mob/proc/held_index_to_dir(i)
if(!(i % 2))
return "r"
return "l"
//Check we have an organ for this hand slot (Dismemberment), Only relevant for humans
/mob/proc/has_hand_for_held_index(i)
return TRUE
//Check we have an organ for our active hand slot (Dismemberment),Only relevant for humans
/mob/proc/has_active_hand()
return has_hand_for_held_index(active_hand_index)
//Finds the first available (null) index OR all available (null) indexes in held_items based on a side.
//Lefts: 1, 3, 5, 7...
//Rights:2, 4, 6, 8...
/mob/proc/get_empty_held_index_for_side(side = "left", all = FALSE)
var/start = 0
var/static/list/lefts = list("l" = TRUE,"L" = TRUE,"LEFT" = TRUE,"left" = TRUE)
var/static/list/rights = list("r" = TRUE,"R" = TRUE,"RIGHT" = TRUE,"right" = TRUE) //"to remain silent"
if(lefts[side])
start = 1
else if(rights[side])
start = 2
if(!start)
return FALSE
var/list/empty_indexes
for(var/i in start to held_items.len step 2)
if(!held_items[i])
if(!all)
return i
if(!empty_indexes)
empty_indexes = list()
empty_indexes += i
return empty_indexes
//Same as the above, but returns the first or ALL held *ITEMS* for the side
/mob/proc/get_held_items_for_side(side = "left", all = FALSE)
var/start = 0
var/static/list/lefts = list("l" = TRUE,"L" = TRUE,"LEFT" = TRUE,"left" = TRUE)
var/static/list/rights = list("r" = TRUE,"R" = TRUE,"RIGHT" = TRUE,"right" = TRUE) //"to remain silent"
if(lefts[side])
start = 1
else if(rights[side])
start = 2
if(!start)
return FALSE
var/list/holding_items
for(var/i in start to held_items.len step 2)
var/obj/item/I = held_items[i]
if(I)
if(!all)
return I
if(!holding_items)
holding_items = list()
holding_items += I
return holding_items
/mob/proc/get_empty_held_indexes()
var/list/L
for(var/i in 1 to held_items.len)
if(!held_items[i])
if(!L)
L = list()
L += i
return L
/mob/proc/get_held_index_of_item(obj/item/I)
return held_items.Find(I)
//Sad that this will cause some overhead, but the alias seems necessary
//*I* may be happy with a million and one references to "indexes" but others won't be
/mob/proc/is_holding(obj/item/I)
return get_held_index_of_item(I)
//Checks if we're holding an item of type: typepath
/mob/proc/is_holding_item_of_type(typepath)
for(var/obj/item/I in held_items)
if(istype(I, typepath))
return I
return FALSE
//Checks if we're holding a tool that has given quality
//Returns the tool that has the best version of this quality
/mob/proc/is_holding_tool_quality(quality)
var/obj/item/best_item
var/best_quality = INFINITY
for(var/obj/item/I in held_items)
if(I.tool_behaviour == quality && I.toolspeed < best_quality)
best_item = I
best_quality = I.toolspeed
return best_item
//To appropriately fluff things like "they are holding [I] in their [get_held_index_name(get_held_index_of_item(I))]"
//Can be overridden to pass off the fluff to something else (eg: science allowing people to add extra robotic limbs, and having this proc react to that
// with say "they are holding [I] in their Nanotrasen Brand Utility Arm - Right Edition" or w/e
/mob/proc/get_held_index_name(i)
var/list/hand = list()
if(i > 2)
hand += "upper "
var/num = 0
if(!(i % 2))
num = i-2
hand += "right hand"
else
num = i-1
hand += "left hand"
num -= (num*0.5)
if(num > 1) //"upper left hand #1" seems weird, but "upper left hand #2" is A-ok
hand += " #[num]"
return hand.Join()
//Returns if a certain item can be equipped to a certain slot.
// Currently invalid for two-handed items - call obj/item/mob_can_equip() instead.
/mob/proc/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE)
return FALSE
/mob/proc/can_put_in_hand(I, hand_index)
if(hand_index > held_items.len)
return FALSE
if(!put_in_hand_check(I))
return FALSE
if(!has_hand_for_held_index(hand_index))
return FALSE
return !held_items[hand_index]
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE, ignore_anim = TRUE)
if(forced || can_put_in_hand(I, hand_index))
if(isturf(I.loc) && !ignore_anim)
I.do_pickup_animation(src)
if(hand_index == null)
return FALSE
if(get_item_for_held_index(hand_index) != null)
dropItemToGround(get_item_for_held_index(hand_index), force = TRUE)
I.forceMove(src)
held_items[hand_index] = I
I.layer = ABOVE_HUD_LAYER
I.plane = ABOVE_HUD_PLANE
I.equipped(src, SLOT_HANDS)
if(I.pulledby)
I.pulledby.stop_pulling()
update_inv_hands()
I.pixel_x = initial(I.pixel_x)
I.pixel_y = initial(I.pixel_y)
I.transform = initial(I.transform)
return hand_index || TRUE
return FALSE
//Puts the item into the first available left hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(obj/item/I)
return put_in_hand(I, get_empty_held_index_for_side("l"))
//Puts the item into the first available right hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_r_hand(obj/item/I)
return put_in_hand(I, get_empty_held_index_for_side("r"))
/mob/proc/put_in_hand_check(obj/item/I)
if(incapacitated() && !(I.item_flags&ABSTRACT)) //Cit change - Changes lying to incapacitated so that it's plausible to pick things up while on the ground
return FALSE
if(!istype(I))
return FALSE
return TRUE
//Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE)
return put_in_hand(I, active_hand_index, forced, ignore_animation)
//Puts the item into our inactive hand if possible, returns TRUE on success
/mob/proc/put_in_inactive_hand(obj/item/I)
return put_in_hand(I, get_inactive_hand_index())
//Puts the item our active hand if possible. Failing that it tries other hands. Returns TRUE on success.
//If both fail it drops it on the floor and returns FALSE.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE)
if(!I)
return FALSE
// If the item is a stack and we're already holding a stack then merge
if (istype(I, /obj/item/stack))
var/obj/item/stack/I_stack = I
var/obj/item/stack/active_stack = get_active_held_item()
if (I_stack.zero_amount())
return FALSE
if (merge_stacks)
if (istype(active_stack) && istype(I_stack, active_stack.merge_type))
if (I_stack.merge(active_stack))
to_chat(usr, "<span class='notice'>Your [active_stack.name] stack now contains [active_stack.get_amount()] [active_stack.singular_name]\s.</span>")
return TRUE
else
var/obj/item/stack/inactive_stack = get_inactive_held_item()
if (istype(inactive_stack) && istype(I_stack, inactive_stack.merge_type))
if (I_stack.merge(inactive_stack))
to_chat(usr, "<span class='notice'>Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s.</span>")
return TRUE
if(put_in_active_hand(I, forced))
return TRUE
var/hand = get_empty_held_index_for_side("l")
if(!hand)
hand = get_empty_held_index_for_side("r")
if(hand)
if(put_in_hand(I, hand, forced))
return TRUE
if(del_on_fail)
qdel(I)
return FALSE
I.forceMove(drop_location())
I.layer = initial(I.layer)
I.plane = initial(I.plane)
I.dropped(src)
return FALSE
/mob/proc/drop_all_held_items()
. = FALSE
for(var/obj/item/I in held_items)
. |= dropItemToGround(I)
//Here lie drop_from_inventory and before_item_take, already forgotten and not missed.
/mob/proc/canUnEquip(obj/item/I, force)
if(!I)
return TRUE
if(HAS_TRAIT(I, TRAIT_NODROP) && !force)
return FALSE
return TRUE
/mob/proc/putItemFromInventoryInHandIfPossible(obj/item/I, hand_index, force_removal = FALSE)
if(!can_put_in_hand(I, hand_index))
return FALSE
if(!temporarilyRemoveItemFromInventory(I, force_removal))
return FALSE
I.remove_item_from_storage(src)
if(!put_in_hand(I, hand_index))
qdel(I)
CRASH("Assertion failure: putItemFromInventoryInHandIfPossible") //should never be possible
return TRUE
//The following functions are the same save for one small difference
//for when you want the item to end up on the ground
//will force move the item to the ground and call the turf's Entered
/mob/proc/dropItemToGround(obj/item/I, force = FALSE)
return doUnEquip(I, force, drop_location(), FALSE)
//for when the item will be immediately placed in a loc other than the ground
/mob/proc/transferItemToLoc(obj/item/I, newloc = null, force = FALSE)
return doUnEquip(I, force, newloc, FALSE)
//visibly unequips I but it is NOT MOVED AND REMAINS IN SRC
//item MUST BE FORCEMOVE'D OR QDEL'D
/mob/proc/temporarilyRemoveItemFromInventory(obj/item/I, force = FALSE, idrop = TRUE)
return doUnEquip(I, force, null, TRUE, idrop)
//DO NOT CALL THIS PROC
//use one of the above 3 helper procs
//you may override it, but do not modify the args
/mob/proc/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) //Force overrides TRAIT_NODROP for things like wizarditis and admin undress.
//Use no_move if the item is just gonna be immediately moved afterward
//Invdrop is used to prevent stuff in pockets dropping. only set to false if it's going to immediately be replaced
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for TRAIT_NODROP.
return TRUE
if(HAS_TRAIT(I, TRAIT_NODROP) && !force)
return FALSE
var/hand_index = get_held_index_of_item(I)
if(hand_index)
held_items[hand_index] = null
update_inv_hands()
if(I)
if(client)
client.screen -= I
I.layer = initial(I.layer)
I.plane = initial(I.plane)
I.appearance_flags &= ~NO_CLIENT_COLOR
if(!no_move && !(I.item_flags & DROPDEL)) //item may be moved/qdel'd immedietely, don't bother moving it
if (isnull(newloc))
I.moveToNullspace()
else
I.forceMove(newloc)
I.dropped(src)
return TRUE
//Outdated but still in use apparently. This should at least be a human proc.
//Daily reminder to murder this - Remie.
/mob/living/proc/get_equipped_items(include_pockets = FALSE)
return
/mob/living/carbon/get_equipped_items(include_pockets = FALSE)
var/list/items = list()
if(back)
items += back
if(head)
items += head
if(wear_mask)
items += wear_mask
if(wear_neck)
items += wear_neck
return items
/mob/living/carbon/human/get_equipped_items(include_pockets = FALSE)
var/list/items = ..()
if(belt)
items += belt
if(ears)
items += ears
if(glasses)
items += glasses
if(gloves)
items += gloves
if(shoes)
items += shoes
if(wear_id)
items += wear_id
if(wear_suit)
items += wear_suit
if(w_uniform)
items += w_uniform
if(include_pockets)
if(l_store)
items += l_store
if(r_store)
items += r_store
if(s_store)
items += s_store
return items
/mob/living/proc/unequip_everything()
var/list/items = list()
items |= get_equipped_items(TRUE)
for(var/I in items)
dropItemToGround(I)
drop_all_held_items()
/obj/item/proc/equip_to_best_slot(mob/M)
if(src != M.get_active_held_item())
to_chat(M, "<span class='warning'>You are not holding anything to equip!</span>")
return FALSE
if(M.equip_to_appropriate_slot(src))
M.update_inv_hands()
return TRUE
else
if(equip_delay_self)
return
if(M.active_storage && M.active_storage.parent && SEND_SIGNAL(M.active_storage.parent, COMSIG_TRY_STORAGE_INSERT, src,M))
return TRUE
var/list/obj/item/possible = list(M.get_inactive_held_item(), M.get_item_by_slot(SLOT_BELT), M.get_item_by_slot(SLOT_GENERC_DEXTROUS_STORAGE), M.get_item_by_slot(SLOT_BACK))
for(var/i in possible)
if(!i)
continue
var/obj/item/I = i
if(SEND_SIGNAL(I, COMSIG_TRY_STORAGE_INSERT, src, M))
return TRUE
to_chat(M, "<span class='warning'>You are unable to equip that!</span>")
return FALSE
/mob/verb/quick_equip()
set name = "quick-equip"
set hidden = 1
var/obj/item/I = get_active_held_item()
if (I)
I.equip_to_best_slot(src)
//used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...)
/mob/proc/getBackSlot()
return SLOT_BACK
/mob/proc/getBeltSlot()
return SLOT_BELT
//Inventory.dm is -kind of- an ok place for this I guess
//This is NOT for dismemberment, as the user still technically has 2 "hands"
//This is for multi-handed mobs, such as a human with a third limb installed
//This is a very rare proc to call (besides admin fuckery) so
//any cost it has isn't a worry
/mob/proc/change_number_of_hands(amt)
if(amt < held_items.len)
for(var/i in held_items.len to amt step -1)
dropItemToGround(held_items[i])
held_items.len = amt
if(hud_used)
hud_used.build_hand_slots()
/mob/living/carbon/human/change_number_of_hands(amt)
var/old_limbs = held_items.len
if(amt < old_limbs)
for(var/i in hand_bodyparts.len to amt step -1)
var/obj/item/bodypart/BP = hand_bodyparts[i]
BP.dismember()
hand_bodyparts[i] = null
hand_bodyparts.len = amt
else if(amt > old_limbs)
hand_bodyparts.len = amt
for(var/i in old_limbs+1 to amt)
var/path = /obj/item/bodypart/l_arm
if(!(i % 2))
path = /obj/item/bodypart/r_arm
var/obj/item/bodypart/BP = new path ()
BP.owner = src
BP.held_index = i
bodyparts += BP
hand_bodyparts[i] = BP
..() //Don't redraw hands until we have organs for them
/mob/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool)
return ..() && (user == src)
//These procs handle putting s tuff in your hands
//as they handle all relevant stuff like adding it to the player's screen and updating their overlays.
//Returns the thing we're currently holding
/mob/proc/get_active_held_item()
return get_item_for_held_index(active_hand_index)
//Finds the opposite limb for the active one (eg: upper left arm will find the item in upper right arm)
//So we're treating each "pair" of limbs as a team, so "both" refers to them
/mob/proc/get_inactive_held_item()
return get_item_for_held_index(get_inactive_hand_index())
//Finds the opposite index for the active one (eg: upper left arm will find the item in upper right arm)
//So we're treating each "pair" of limbs as a team, so "both" refers to them
/mob/proc/get_inactive_hand_index()
var/other_hand = 0
if(!(active_hand_index % 2))
other_hand = active_hand_index-1 //finding the matching "left" limb
else
other_hand = active_hand_index+1 //finding the matching "right" limb
if(other_hand < 0 || other_hand > held_items.len)
other_hand = 0
return other_hand
/mob/proc/get_item_for_held_index(i)
if(i > 0 && i <= held_items.len)
return held_items[i]
return FALSE
//Odd = left. Even = right
/mob/proc/held_index_to_dir(i)
if(!(i % 2))
return "r"
return "l"
//Check we have an organ for this hand slot (Dismemberment), Only relevant for humans
/mob/proc/has_hand_for_held_index(i)
return TRUE
//Check we have an organ for our active hand slot (Dismemberment),Only relevant for humans
/mob/proc/has_active_hand()
return has_hand_for_held_index(active_hand_index)
//Finds the first available (null) index OR all available (null) indexes in held_items based on a side.
//Lefts: 1, 3, 5, 7...
//Rights:2, 4, 6, 8...
/mob/proc/get_empty_held_index_for_side(side = "left", all = FALSE)
var/start = 0
var/static/list/lefts = list("l" = TRUE,"L" = TRUE,"LEFT" = TRUE,"left" = TRUE)
var/static/list/rights = list("r" = TRUE,"R" = TRUE,"RIGHT" = TRUE,"right" = TRUE) //"to remain silent"
if(lefts[side])
start = 1
else if(rights[side])
start = 2
if(!start)
return FALSE
var/list/empty_indexes
for(var/i in start to held_items.len step 2)
if(!held_items[i])
if(!all)
return i
if(!empty_indexes)
empty_indexes = list()
empty_indexes += i
return empty_indexes
//Same as the above, but returns the first or ALL held *ITEMS* for the side
/mob/proc/get_held_items_for_side(side = "left", all = FALSE)
var/start = 0
var/static/list/lefts = list("l" = TRUE,"L" = TRUE,"LEFT" = TRUE,"left" = TRUE)
var/static/list/rights = list("r" = TRUE,"R" = TRUE,"RIGHT" = TRUE,"right" = TRUE) //"to remain silent"
if(lefts[side])
start = 1
else if(rights[side])
start = 2
if(!start)
return FALSE
var/list/holding_items
for(var/i in start to held_items.len step 2)
var/obj/item/I = held_items[i]
if(I)
if(!all)
return I
if(!holding_items)
holding_items = list()
holding_items += I
return holding_items
/mob/proc/get_empty_held_indexes()
var/list/L
for(var/i in 1 to held_items.len)
if(!held_items[i])
if(!L)
L = list()
L += i
return L
/mob/proc/get_held_index_of_item(obj/item/I)
return held_items.Find(I)
//Sad that this will cause some overhead, but the alias seems necessary
//*I* may be happy with a million and one references to "indexes" but others won't be
/mob/proc/is_holding(obj/item/I)
return get_held_index_of_item(I)
//Checks if we're holding an item of type: typepath
/mob/proc/is_holding_item_of_type(typepath)
for(var/obj/item/I in held_items)
if(istype(I, typepath))
return I
return FALSE
//Checks if we're holding a tool that has given quality
//Returns the tool that has the best version of this quality
/mob/proc/is_holding_tool_quality(quality)
var/obj/item/best_item
var/best_quality = INFINITY
for(var/obj/item/I in held_items)
if(I.tool_behaviour == quality && I.toolspeed < best_quality)
best_item = I
best_quality = I.toolspeed
return best_item
//To appropriately fluff things like "they are holding [I] in their [get_held_index_name(get_held_index_of_item(I))]"
//Can be overridden to pass off the fluff to something else (eg: science allowing people to add extra robotic limbs, and having this proc react to that
// with say "they are holding [I] in their Nanotrasen Brand Utility Arm - Right Edition" or w/e
/mob/proc/get_held_index_name(i)
var/list/hand = list()
if(i > 2)
hand += "upper "
var/num = 0
if(!(i % 2))
num = i-2
hand += "right hand"
else
num = i-1
hand += "left hand"
num -= (num*0.5)
if(num > 1) //"upper left hand #1" seems weird, but "upper left hand #2" is A-ok
hand += " #[num]"
return hand.Join()
//Returns if a certain item can be equipped to a certain slot.
// Currently invalid for two-handed items - call obj/item/mob_can_equip() instead.
/mob/proc/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE)
return FALSE
/mob/proc/can_put_in_hand(I, hand_index)
if(hand_index > held_items.len)
return FALSE
if(!put_in_hand_check(I))
return FALSE
if(!has_hand_for_held_index(hand_index))
return FALSE
return !held_items[hand_index]
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE, ignore_anim = TRUE)
if(forced || can_put_in_hand(I, hand_index))
if(isturf(I.loc) && !ignore_anim)
I.do_pickup_animation(src)
if(hand_index == null)
return FALSE
if(get_item_for_held_index(hand_index) != null)
dropItemToGround(get_item_for_held_index(hand_index), force = TRUE)
I.forceMove(src)
held_items[hand_index] = I
I.layer = ABOVE_HUD_LAYER
I.plane = ABOVE_HUD_PLANE
I.equipped(src, SLOT_HANDS)
if(I.pulledby)
I.pulledby.stop_pulling()
update_inv_hands()
I.pixel_x = initial(I.pixel_x)
I.pixel_y = initial(I.pixel_y)
I.transform = initial(I.transform)
return hand_index || TRUE
return FALSE
//Puts the item into the first available left hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(obj/item/I)
return put_in_hand(I, get_empty_held_index_for_side("l"))
//Puts the item into the first available right hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_r_hand(obj/item/I)
return put_in_hand(I, get_empty_held_index_for_side("r"))
/mob/proc/put_in_hand_check(obj/item/I)
if(incapacitated() && !(I.item_flags&ABSTRACT)) //Cit change - Changes lying to incapacitated so that it's plausible to pick things up while on the ground
return FALSE
if(!istype(I))
return FALSE
return TRUE
//Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE)
return put_in_hand(I, active_hand_index, forced, ignore_animation)
//Puts the item into our inactive hand if possible, returns TRUE on success
/mob/proc/put_in_inactive_hand(obj/item/I)
return put_in_hand(I, get_inactive_hand_index())
//Puts the item our active hand if possible. Failing that it tries other hands. Returns TRUE on success.
//If both fail it drops it on the floor and returns FALSE.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE)
if(!I)
return FALSE
// If the item is a stack and we're already holding a stack then merge
if (istype(I, /obj/item/stack))
var/obj/item/stack/I_stack = I
var/obj/item/stack/active_stack = get_active_held_item()
if (I_stack.zero_amount())
return FALSE
if (merge_stacks)
if (istype(active_stack) && istype(I_stack, active_stack.merge_type))
if (I_stack.merge(active_stack))
to_chat(usr, "<span class='notice'>Your [active_stack.name] stack now contains [active_stack.get_amount()] [active_stack.singular_name]\s.</span>")
return TRUE
else
var/obj/item/stack/inactive_stack = get_inactive_held_item()
if (istype(inactive_stack) && istype(I_stack, inactive_stack.merge_type))
if (I_stack.merge(inactive_stack))
to_chat(usr, "<span class='notice'>Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s.</span>")
return TRUE
if(put_in_active_hand(I, forced))
return TRUE
var/hand = get_empty_held_index_for_side("l")
if(!hand)
hand = get_empty_held_index_for_side("r")
if(hand)
if(put_in_hand(I, hand, forced))
return TRUE
if(del_on_fail)
qdel(I)
return FALSE
I.forceMove(drop_location())
I.layer = initial(I.layer)
I.plane = initial(I.plane)
I.dropped(src)
return FALSE
/mob/proc/drop_all_held_items()
. = FALSE
for(var/obj/item/I in held_items)
. |= dropItemToGround(I)
//Here lie drop_from_inventory and before_item_take, already forgotten and not missed.
/mob/proc/canUnEquip(obj/item/I, force)
if(!I)
return TRUE
if(HAS_TRAIT(I, TRAIT_NODROP) && !force)
return FALSE
return TRUE
/mob/proc/putItemFromInventoryInHandIfPossible(obj/item/I, hand_index, force_removal = FALSE)
if(!can_put_in_hand(I, hand_index))
return FALSE
if(!temporarilyRemoveItemFromInventory(I, force_removal))
return FALSE
I.remove_item_from_storage(src)
if(!put_in_hand(I, hand_index))
qdel(I)
CRASH("Assertion failure: putItemFromInventoryInHandIfPossible") //should never be possible
return TRUE
//The following functions are the same save for one small difference
//for when you want the item to end up on the ground
//will force move the item to the ground and call the turf's Entered
/mob/proc/dropItemToGround(obj/item/I, force = FALSE)
return doUnEquip(I, force, drop_location(), FALSE)
//for when the item will be immediately placed in a loc other than the ground
/mob/proc/transferItemToLoc(obj/item/I, newloc = null, force = FALSE)
return doUnEquip(I, force, newloc, FALSE)
//visibly unequips I but it is NOT MOVED AND REMAINS IN SRC
//item MUST BE FORCEMOVE'D OR QDEL'D
/mob/proc/temporarilyRemoveItemFromInventory(obj/item/I, force = FALSE, idrop = TRUE)
return doUnEquip(I, force, null, TRUE, idrop)
//DO NOT CALL THIS PROC
//use one of the above 3 helper procs
//you may override it, but do not modify the args
/mob/proc/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) //Force overrides TRAIT_NODROP for things like wizarditis and admin undress.
//Use no_move if the item is just gonna be immediately moved afterward
//Invdrop is used to prevent stuff in pockets dropping. only set to false if it's going to immediately be replaced
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for TRAIT_NODROP.
return TRUE
if(HAS_TRAIT(I, TRAIT_NODROP) && !force)
return FALSE
var/hand_index = get_held_index_of_item(I)
if(hand_index)
held_items[hand_index] = null
update_inv_hands()
if(I)
if(client)
client.screen -= I
I.layer = initial(I.layer)
I.plane = initial(I.plane)
I.appearance_flags &= ~NO_CLIENT_COLOR
if(!no_move && !(I.item_flags & DROPDEL)) //item may be moved/qdel'd immedietely, don't bother moving it
if (isnull(newloc))
I.moveToNullspace()
else
I.forceMove(newloc)
I.dropped(src)
return TRUE
//Outdated but still in use apparently. This should at least be a human proc.
//Daily reminder to murder this - Remie.
/mob/living/proc/get_equipped_items(include_pockets = FALSE)
return
/mob/living/carbon/get_equipped_items(include_pockets = FALSE)
var/list/items = list()
if(back)
items += back
if(head)
items += head
if(wear_mask)
items += wear_mask
if(wear_neck)
items += wear_neck
return items
/mob/living/carbon/human/get_equipped_items(include_pockets = FALSE)
var/list/items = ..()
if(belt)
items += belt
if(ears)
items += ears
if(glasses)
items += glasses
if(gloves)
items += gloves
if(shoes)
items += shoes
if(wear_id)
items += wear_id
if(wear_suit)
items += wear_suit
if(w_uniform)
items += w_uniform
if(include_pockets)
if(l_store)
items += l_store
if(r_store)
items += r_store
if(s_store)
items += s_store
return items
/mob/living/proc/unequip_everything()
var/list/items = list()
items |= get_equipped_items(TRUE)
for(var/I in items)
dropItemToGround(I)
drop_all_held_items()
/obj/item/proc/equip_to_best_slot(mob/M)
if(src != M.get_active_held_item())
to_chat(M, "<span class='warning'>You are not holding anything to equip!</span>")
return FALSE
if(M.equip_to_appropriate_slot(src))
M.update_inv_hands()
return TRUE
else
if(equip_delay_self)
return
if(M.active_storage && M.active_storage.parent && SEND_SIGNAL(M.active_storage.parent, COMSIG_TRY_STORAGE_INSERT, src,M))
return TRUE
var/list/obj/item/possible = list(M.get_inactive_held_item(), M.get_item_by_slot(SLOT_BELT), M.get_item_by_slot(SLOT_GENERC_DEXTROUS_STORAGE), M.get_item_by_slot(SLOT_BACK))
for(var/i in possible)
if(!i)
continue
var/obj/item/I = i
if(SEND_SIGNAL(I, COMSIG_TRY_STORAGE_INSERT, src, M))
return TRUE
to_chat(M, "<span class='warning'>You are unable to equip that!</span>")
return FALSE
/mob/verb/quick_equip()
set name = "quick-equip"
set hidden = 1
var/obj/item/I = get_active_held_item()
if (I)
I.equip_to_best_slot(src)
//used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...)
/mob/proc/getBackSlot()
return SLOT_BACK
/mob/proc/getBeltSlot()
return SLOT_BELT
//Inventory.dm is -kind of- an ok place for this I guess
//This is NOT for dismemberment, as the user still technically has 2 "hands"
//This is for multi-handed mobs, such as a human with a third limb installed
//This is a very rare proc to call (besides admin fuckery) so
//any cost it has isn't a worry
/mob/proc/change_number_of_hands(amt)
if(amt < held_items.len)
for(var/i in held_items.len to amt step -1)
dropItemToGround(held_items[i])
held_items.len = amt
if(hud_used)
hud_used.build_hand_slots()
/mob/living/carbon/human/change_number_of_hands(amt)
var/old_limbs = held_items.len
if(amt < old_limbs)
for(var/i in hand_bodyparts.len to amt step -1)
var/obj/item/bodypart/BP = hand_bodyparts[i]
BP.dismember()
hand_bodyparts[i] = null
hand_bodyparts.len = amt
else if(amt > old_limbs)
hand_bodyparts.len = amt
for(var/i in old_limbs+1 to amt)
var/path = /obj/item/bodypart/l_arm
if(!(i % 2))
path = /obj/item/bodypart/r_arm
var/obj/item/bodypart/BP = new path ()
BP.owner = src
BP.held_index = i
bodyparts += BP
hand_bodyparts[i] = BP
..() //Don't redraw hands until we have organs for them
/mob/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool)
return ..() && (user == src)
+1 -1
View File
@@ -14,7 +14,7 @@
/obj/effect/dummy/phased_mob/slaughter/ex_act()
return
/obj/effect/dummy/phased_mob/slaughter/bullet_act()
return
return BULLET_ACT_FORCE_PIERCE
/obj/effect/dummy/phased_mob/slaughter/singularity_act()
return
+145 -145
View File
@@ -1,145 +1,145 @@
/mob/living/carbon/alien
name = "alien"
icon = 'icons/mob/alien.dmi'
gender = FEMALE //All xenos are girls!!
dna = null
faction = list(ROLE_ALIEN)
ventcrawler = VENTCRAWLER_ALWAYS
sight = SEE_MOBS
see_in_dark = 4
verb_say = "hisses"
initial_language_holder = /datum/language_holder/alien
bubble_icon = "alien"
type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/xeno
var/obj/item/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/has_fine_manipulation = 0
var/move_delay_add = 0 // movement delay to add
status_flags = CANUNCONSCIOUS|CANPUSH
var/heat_protection = 0.5
var/leaping = 0
gib_type = /obj/effect/decal/cleanable/blood/gibs/xeno
unique_name = 1
var/static/regex/alien_name_regex = new("alien (larva|sentinel|drone|hunter|praetorian|queen)( \\(\\d+\\))?")
/mob/living/carbon/alien/Initialize()
verbs += /mob/living/proc/mob_sleep
verbs += /mob/living/proc/lay_down
create_bodyparts() //initialize bodyparts
create_internal_organs()
. = ..()
/mob/living/carbon/alien/create_internal_organs()
internal_organs += new /obj/item/organ/brain/alien
internal_organs += new /obj/item/organ/alien/hivenode
internal_organs += new /obj/item/organ/tongue/alien
internal_organs += new /obj/item/organ/eyes/night_vision/alien
internal_organs += new /obj/item/organ/ears
..()
/mob/living/carbon/alien/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) // beepsky won't hunt aliums
return -10
/mob/living/carbon/alien/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
var/loc_temp = get_temperature(environment)
// Aliens are now weak to fire.
//After then, it reacts to the surrounding atmosphere based on your thermal protection
if(!on_fire) // If you're on fire, ignore local air temperature
if(loc_temp > bodytemperature)
//Place is hotter than we are
var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of heat protection.
if(thermal_protection < 1)
adjust_bodytemperature((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR))
else
adjust_bodytemperature(1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR))
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
//Body temperature is too hot.
throw_alert("alien_fire", /obj/screen/alert/alien_fire)
switch(bodytemperature)
if(360 to 400)
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
if(400 to 460)
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
if(460 to INFINITY)
if(on_fire)
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
else
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
else
clear_alert("alien_fire")
/mob/living/carbon/alien/reagent_check(datum/reagent/R) //can metabolize all reagents
return 0
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
/mob/living/carbon/alien/Stat()
..()
if(statpanel("Status"))
stat(null, "Intent: [a_intent]")
/mob/living/carbon/alien/getTrail()
if(getBruteLoss() < 200)
return pick (list("xltrails_1", "xltrails2"))
else
return pick (list("xttrails_1", "xttrails2"))
/*----------------------------------------
Proc: AddInfectionImages()
Des: Gives the client of the alien an image on each infected mob.
----------------------------------------*/
/mob/living/carbon/alien/proc/AddInfectionImages()
if (client)
for (var/i in GLOB.mob_living_list)
var/mob/living/L = i
if(HAS_TRAIT(L, TRAIT_XENO_HOST))
var/obj/item/organ/body_egg/alien_embryo/A = L.getorgan(/obj/item/organ/body_egg/alien_embryo)
if(A)
var/I = image('icons/mob/alien.dmi', loc = L, icon_state = "infected[A.stage]")
client.images += I
return
/*----------------------------------------
Proc: RemoveInfectionImages()
Des: Removes all infected images from the alien.
----------------------------------------*/
/mob/living/carbon/alien/proc/RemoveInfectionImages()
if (client)
for(var/image/I in client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
qdel(I)
return
/mob/living/carbon/alien/canBeHandcuffed()
return 1
/mob/living/carbon/alien/get_standard_pixel_y_offset(lying = 0)
return initial(pixel_y)
/mob/living/carbon/alien/proc/alien_evolve(mob/living/carbon/alien/new_xeno)
to_chat(src, "<span class='noticealien'>You begin to evolve!</span>")
visible_message("<span class='alertalien'>[src] begins to twist and contort!</span>")
new_xeno.setDir(dir)
if(!alien_name_regex.Find(name))
new_xeno.name = name
new_xeno.real_name = real_name
if(mind)
mind.transfer_to(new_xeno)
qdel(src)
/mob/living/carbon/alien/can_hold_items()
return has_fine_manipulation
/mob/living/carbon/alien
name = "alien"
icon = 'icons/mob/alien.dmi'
gender = FEMALE //All xenos are girls!!
dna = null
faction = list(ROLE_ALIEN)
ventcrawler = VENTCRAWLER_ALWAYS
sight = SEE_MOBS
see_in_dark = 4
verb_say = "hisses"
initial_language_holder = /datum/language_holder/alien
bubble_icon = "alien"
type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/xeno
var/obj/item/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/has_fine_manipulation = 0
var/move_delay_add = 0 // movement delay to add
status_flags = CANUNCONSCIOUS|CANPUSH
var/heat_protection = 0.5
var/leaping = 0
gib_type = /obj/effect/decal/cleanable/blood/gibs/xeno
unique_name = 1
var/static/regex/alien_name_regex = new("alien (larva|sentinel|drone|hunter|praetorian|queen)( \\(\\d+\\))?")
/mob/living/carbon/alien/Initialize()
verbs += /mob/living/proc/mob_sleep
verbs += /mob/living/proc/lay_down
create_bodyparts() //initialize bodyparts
create_internal_organs()
. = ..()
/mob/living/carbon/alien/create_internal_organs()
internal_organs += new /obj/item/organ/brain/alien
internal_organs += new /obj/item/organ/alien/hivenode
internal_organs += new /obj/item/organ/tongue/alien
internal_organs += new /obj/item/organ/eyes/night_vision/alien
internal_organs += new /obj/item/organ/ears
..()
/mob/living/carbon/alien/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) // beepsky won't hunt aliums
return -10
/mob/living/carbon/alien/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
var/loc_temp = get_temperature(environment)
// Aliens are now weak to fire.
//After then, it reacts to the surrounding atmosphere based on your thermal protection
if(!on_fire) // If you're on fire, ignore local air temperature
if(loc_temp > bodytemperature)
//Place is hotter than we are
var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of heat protection.
if(thermal_protection < 1)
adjust_bodytemperature((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR))
else
adjust_bodytemperature(1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR))
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
//Body temperature is too hot.
throw_alert("alien_fire", /obj/screen/alert/alien_fire)
switch(bodytemperature)
if(360 to 400)
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
if(400 to 460)
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
if(460 to INFINITY)
if(on_fire)
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
else
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
else
clear_alert("alien_fire")
/mob/living/carbon/alien/reagent_check(datum/reagent/R) //can metabolize all reagents
return 0
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
/mob/living/carbon/alien/Stat()
..()
if(statpanel("Status"))
stat(null, "Intent: [a_intent]")
/mob/living/carbon/alien/getTrail()
if(getBruteLoss() < 200)
return pick (list("xltrails_1", "xltrails2"))
else
return pick (list("xttrails_1", "xttrails2"))
/*----------------------------------------
Proc: AddInfectionImages()
Des: Gives the client of the alien an image on each infected mob.
----------------------------------------*/
/mob/living/carbon/alien/proc/AddInfectionImages()
if (client)
for (var/i in GLOB.mob_living_list)
var/mob/living/L = i
if(HAS_TRAIT(L, TRAIT_XENO_HOST))
var/obj/item/organ/body_egg/alien_embryo/A = L.getorgan(/obj/item/organ/body_egg/alien_embryo)
if(A)
var/I = image('icons/mob/alien.dmi', loc = L, icon_state = "infected[A.stage]")
client.images += I
return
/*----------------------------------------
Proc: RemoveInfectionImages()
Des: Removes all infected images from the alien.
----------------------------------------*/
/mob/living/carbon/alien/proc/RemoveInfectionImages()
if (client)
for(var/image/I in client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
qdel(I)
return
/mob/living/carbon/alien/canBeHandcuffed()
return 1
/mob/living/carbon/alien/get_standard_pixel_y_offset(lying = 0)
return initial(pixel_y)
/mob/living/carbon/alien/proc/alien_evolve(mob/living/carbon/alien/new_xeno)
to_chat(src, "<span class='noticealien'>You begin to evolve!</span>")
visible_message("<span class='alertalien'>[src] begins to twist and contort!</span>")
new_xeno.setDir(dir)
if(!alien_name_regex.Find(name))
new_xeno.name = name
new_xeno.real_name = real_name
if(mind)
mind.transfer_to(new_xeno)
qdel(src)
/mob/living/carbon/alien/can_hold_items()
return has_fine_manipulation
@@ -1,128 +1,128 @@
/mob/living/carbon/alien/get_eye_protection()
return ..() + 2 //potential cyber implants + natural eye protection
/mob/living/carbon/alien/get_ear_protection()
return 2 //no ears
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush)
return ..(AM, skipcatch = TRUE, hitpush = FALSE)
/mob/living/carbon/alien/can_embed(obj/item/I)
return FALSE
/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other.
As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble.
In all, this is a lot like the monkey code. /N
*/
/mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M)
. = ..()
if(!.) // the attack was blocked or was help/grab intent
return
switch(M.a_intent)
if (INTENT_HELP)
if(!recoveringstam)
resting = 0
AdjustStun(-60)
AdjustKnockdown(-60)
AdjustUnconscious(-60)
AdjustSleeping(-100)
visible_message("<span class='notice'>[M.name] nuzzles [src] trying to wake [p_them()] up!</span>")
if(INTENT_DISARM, INTENT_HARM)
if(health > 0)
M.do_attack_animation(src, ATTACK_EFFECT_BITE)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
visible_message("<span class='danger'>[M.name] bites [src]!</span>", \
"<span class='userdanger'>[M.name] bites [src]!</span>", null, COMBAT_MESSAGE_RANGE)
adjustBruteLoss(1)
log_combat(M, src, "attacked")
updatehealth()
else
to_chat(M, "<span class='warning'>[name] is too injured for that.</span>")
/mob/living/carbon/alien/attack_larva(mob/living/carbon/alien/larva/L)
return attack_alien(L)
/mob/living/carbon/alien/attack_hand(mob/living/carbon/human/M)
. = ..()
if(.) //To allow surgery to return properly.
return
switch(M.a_intent)
if(INTENT_HELP)
help_shake_act(M)
if(INTENT_GRAB)
grabbedby(M)
if (INTENT_HARM)
if(HAS_TRAIT(M, TRAIT_PACIFISM))
to_chat(M, "<span class='notice'>You don't want to hurt [src]!</span>")
return TRUE
M.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
if(INTENT_DISARM)
if(HAS_TRAIT(M, TRAIT_PACIFISM))
to_chat(M, "<span class='notice'>You don't want to hurt [src]!</span>")
return TRUE
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
/mob/living/carbon/alien/attack_paw(mob/living/carbon/monkey/M)
. = ..()
if(.) //successful monkey bite.
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
apply_damage(rand(1, 3), BRUTE, affecting)
/mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M)
. = ..()
if(.)
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
switch(M.melee_damage_type)
if(BRUTE)
adjustBruteLoss(damage)
if(BURN)
adjustFireLoss(damage)
if(TOX)
adjustToxLoss(damage)
if(OXY)
adjustOxyLoss(damage)
if(CLONE)
adjustCloneLoss(damage)
if(STAMINA)
adjustStaminaLoss(damage)
/mob/living/carbon/alien/attack_slime(mob/living/simple_animal/slime/M)
. = ..()
if(!.) //unsuccessful slime attack
return
var/damage = rand(5, 35)
if(M.is_adult)
damage = rand(10, 40)
adjustBruteLoss(damage)
log_combat(M, src, "attacked")
updatehealth()
/mob/living/carbon/alien/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
switch (severity)
if (1)
gib()
return
if (2)
take_overall_damage(60, 60)
adjustEarDamage(30,120)
if(3)
take_overall_damage(30,0)
if(prob(50))
Unconscious(20)
adjustEarDamage(15,60)
/mob/living/carbon/alien/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15)
return 0
/mob/living/carbon/alien/acid_act(acidpwr, acid_volume)
return 0//aliens are immune to acid.
/mob/living/carbon/alien/get_eye_protection()
return ..() + 2 //potential cyber implants + natural eye protection
/mob/living/carbon/alien/get_ear_protection()
return 2 //no ears
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
return ..(AM, skipcatch = TRUE, hitpush = FALSE)
/mob/living/carbon/alien/can_embed(obj/item/I)
return FALSE
/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other.
As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble.
In all, this is a lot like the monkey code. /N
*/
/mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M)
. = ..()
if(!.) // the attack was blocked or was help/grab intent
return
switch(M.a_intent)
if (INTENT_HELP)
if(!recoveringstam)
resting = 0
AdjustStun(-60)
AdjustKnockdown(-60)
AdjustUnconscious(-60)
AdjustSleeping(-100)
visible_message("<span class='notice'>[M.name] nuzzles [src] trying to wake [p_them()] up!</span>")
if(INTENT_DISARM, INTENT_HARM)
if(health > 0)
M.do_attack_animation(src, ATTACK_EFFECT_BITE)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
visible_message("<span class='danger'>[M.name] bites [src]!</span>", \
"<span class='userdanger'>[M.name] bites [src]!</span>", null, COMBAT_MESSAGE_RANGE)
adjustBruteLoss(1)
log_combat(M, src, "attacked")
updatehealth()
else
to_chat(M, "<span class='warning'>[name] is too injured for that.</span>")
/mob/living/carbon/alien/attack_larva(mob/living/carbon/alien/larva/L)
return attack_alien(L)
/mob/living/carbon/alien/attack_hand(mob/living/carbon/human/M)
. = ..()
if(.) //To allow surgery to return properly.
return
switch(M.a_intent)
if(INTENT_HELP)
help_shake_act(M)
if(INTENT_GRAB)
grabbedby(M)
if (INTENT_HARM)
if(HAS_TRAIT(M, TRAIT_PACIFISM))
to_chat(M, "<span class='notice'>You don't want to hurt [src]!</span>")
return TRUE
M.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
if(INTENT_DISARM)
if(HAS_TRAIT(M, TRAIT_PACIFISM))
to_chat(M, "<span class='notice'>You don't want to hurt [src]!</span>")
return TRUE
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
/mob/living/carbon/alien/attack_paw(mob/living/carbon/monkey/M)
. = ..()
if(.) //successful monkey bite.
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
apply_damage(rand(1, 3), BRUTE, affecting)
/mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M)
. = ..()
if(.)
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
switch(M.melee_damage_type)
if(BRUTE)
adjustBruteLoss(damage)
if(BURN)
adjustFireLoss(damage)
if(TOX)
adjustToxLoss(damage)
if(OXY)
adjustOxyLoss(damage)
if(CLONE)
adjustCloneLoss(damage)
if(STAMINA)
adjustStaminaLoss(damage)
/mob/living/carbon/alien/attack_slime(mob/living/simple_animal/slime/M)
. = ..()
if(!.) //unsuccessful slime attack
return
var/damage = rand(5, 35)
if(M.is_adult)
damage = rand(10, 40)
adjustBruteLoss(damage)
log_combat(M, src, "attacked")
updatehealth()
/mob/living/carbon/alien/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
switch (severity)
if (EXPLODE_DEVASTATE)
gib()
return
if (EXPLODE_HEAVY)
take_overall_damage(60, 60)
adjustEarDamage(30,120)
if(EXPLODE_LIGHT)
take_overall_damage(30,0)
if(prob(50))
Unconscious(20)
adjustEarDamage(15,60)
/mob/living/carbon/alien/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15)
return 0
/mob/living/carbon/alien/acid_act(acidpwr, acid_volume)
return 0//aliens are immune to acid.
+15 -15
View File
@@ -1,15 +1,15 @@
/mob/living/carbon/alien/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(with_bodyparts)
new /obj/effect/gibspawner/xeno(location, src)
else
new /obj/effect/gibspawner/xeno/bodypartless(location, src)
/mob/living/carbon/alien/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-a")
/mob/living/carbon/alien/spawn_dust()
new /obj/effect/decal/remains/xeno(loc)
/mob/living/carbon/alien/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-a")
/mob/living/carbon/alien/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(with_bodyparts)
new /obj/effect/gibspawner/xeno(location, src)
else
new /obj/effect/gibspawner/xeno/bodypartless(location, src)
/mob/living/carbon/alien/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-a")
/mob/living/carbon/alien/spawn_dust()
new /obj/effect/decal/remains/xeno(loc)
/mob/living/carbon/alien/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-a")
@@ -1,90 +1,90 @@
/mob/living/carbon/alien/humanoid/hunter
name = "alien hunter"
caste = "h"
maxHealth = 125
health = 125
icon_state = "alienh"
var/obj/screen/leap_icon = null
/mob/living/carbon/alien/humanoid/hunter/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/small
..()
//Hunter verbs
/mob/living/carbon/alien/humanoid/hunter/proc/toggle_leap(message = 1)
leap_on_click = !leap_on_click
leap_icon.icon_state = "leap_[leap_on_click ? "on":"off"]"
update_icons()
if(message)
to_chat(src, "<span class='noticealien'>You will now [leap_on_click ? "leap at":"slash at"] enemies!</span>")
else
return
/mob/living/carbon/alien/humanoid/hunter/ClickOn(atom/A, params)
face_atom(A)
if(leap_on_click)
leap_at(A)
else
..()
#define MAX_ALIEN_LEAP_DIST 7
/mob/living/carbon/alien/humanoid/hunter/proc/leap_at(atom/A)
if(!canmove || leaping)
return
if(pounce_cooldown > world.time)
to_chat(src, "<span class='alertalien'>You are too fatigued to pounce right now!</span>")
return
if(!has_gravity() || !A.has_gravity())
to_chat(src, "<span class='alertalien'>It is unsafe to leap without gravity!</span>")
//It's also extremely buggy visually, so it's balance+bugfix
return
else //Maybe uses plasma in the future, although that wouldn't make any sense...
leaping = 1
weather_immunities += "lava"
update_icons()
throw_at(A, MAX_ALIEN_LEAP_DIST, 1, src, FALSE, TRUE, callback = CALLBACK(src, .proc/leap_end))
/mob/living/carbon/alien/humanoid/hunter/proc/leap_end()
leaping = 0
weather_immunities -= "lava"
update_icons()
/mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/A)
if(!leaping)
return ..()
pounce_cooldown = world.time + pounce_cooldown_time
if(A)
if(isliving(A))
var/mob/living/L = A
if(!L.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK))
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
L.Knockdown(100)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
else
Knockdown(40, 1, 1)
toggle_leap(0)
else if(A.density && !A.CanPass(src))
visible_message("<span class ='danger'>[src] smashes into [A]!</span>", "<span class ='alertalien'>[src] smashes into [A]!</span>")
Knockdown(40, 1, 1)
if(leaping)
leaping = 0
update_icons()
update_canmove()
/mob/living/carbon/alien/humanoid/float(on)
if(leaping)
return
..()
/mob/living/carbon/alien/humanoid/hunter
name = "alien hunter"
caste = "h"
maxHealth = 125
health = 125
icon_state = "alienh"
var/obj/screen/leap_icon = null
/mob/living/carbon/alien/humanoid/hunter/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/small
..()
//Hunter verbs
/mob/living/carbon/alien/humanoid/hunter/proc/toggle_leap(message = 1)
leap_on_click = !leap_on_click
leap_icon.icon_state = "leap_[leap_on_click ? "on":"off"]"
update_icons()
if(message)
to_chat(src, "<span class='noticealien'>You will now [leap_on_click ? "leap at":"slash at"] enemies!</span>")
else
return
/mob/living/carbon/alien/humanoid/hunter/ClickOn(atom/A, params)
face_atom(A)
if(leap_on_click)
leap_at(A)
else
..()
#define MAX_ALIEN_LEAP_DIST 7
/mob/living/carbon/alien/humanoid/hunter/proc/leap_at(atom/A)
if(!canmove || leaping)
return
if(pounce_cooldown > world.time)
to_chat(src, "<span class='alertalien'>You are too fatigued to pounce right now!</span>")
return
if(!has_gravity() || !A.has_gravity())
to_chat(src, "<span class='alertalien'>It is unsafe to leap without gravity!</span>")
//It's also extremely buggy visually, so it's balance+bugfix
return
else //Maybe uses plasma in the future, although that wouldn't make any sense...
leaping = 1
weather_immunities += "lava"
update_icons()
throw_at(A, MAX_ALIEN_LEAP_DIST, 1, src, FALSE, TRUE, callback = CALLBACK(src, .proc/leap_end))
/mob/living/carbon/alien/humanoid/hunter/proc/leap_end()
leaping = 0
weather_immunities -= "lava"
update_icons()
/mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!leaping)
return ..()
pounce_cooldown = world.time + pounce_cooldown_time
if(hit_atom)
if(isliving(hit_atom))
var/mob/living/L = hit_atom
if(!L.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK))
L.visible_message("<span class ='danger'>[src] pounces on [L]!</span>", "<span class ='userdanger'>[src] pounces on you!</span>")
L.Knockdown(100)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
else
Knockdown(40, 1, 1)
toggle_leap(0)
else if(hit_atom.density && !hit_atom.CanPass(src))
visible_message("<span class ='danger'>[src] smashes into [hit_atom]!</span>", "<span class ='alertalien'>[src] smashes into [hit_atom]!</span>")
Knockdown(40, 1, 1)
if(leaping)
leaping = 0
update_icons()
update_canmove()
/mob/living/carbon/alien/humanoid/float(on)
if(leaping)
return
..()
@@ -1,23 +1,23 @@
/mob/living/carbon/alien/humanoid/death(gibbed)
if(stat == DEAD)
return
. = ..()
update_canmove()
update_icons()
status_flags |= CANPUSH
//When the alien queen dies, all others must pay the price for letting her die.
/mob/living/carbon/alien/humanoid/royal/queen/death(gibbed)
if(stat == DEAD)
return
for(var/mob/living/carbon/C in GLOB.alive_mob_list)
if(C == src) //Make sure not to proc it on ourselves.
continue
var/obj/item/organ/alien/hivenode/node = C.getorgan(/obj/item/organ/alien/hivenode)
if(istype(node)) // just in case someone would ever add a diffirent node to hivenode slot
node.queen_death()
/mob/living/carbon/alien/humanoid/death(gibbed)
if(stat == DEAD)
return
. = ..()
update_canmove()
update_icons()
status_flags |= CANPUSH
//When the alien queen dies, all others must pay the price for letting her die.
/mob/living/carbon/alien/humanoid/royal/queen/death(gibbed)
if(stat == DEAD)
return
for(var/mob/living/carbon/C in GLOB.alive_mob_list)
if(C == src) //Make sure not to proc it on ourselves.
continue
var/obj/item/organ/alien/hivenode/node = C.getorgan(/obj/item/organ/alien/hivenode)
if(istype(node)) // just in case someone would ever add a diffirent node to hivenode slot
node.queen_death()
return ..()
@@ -1,119 +1,119 @@
/mob/living/carbon/alien/humanoid
name = "alien"
icon_state = "alien"
pass_flags = PASSTABLE
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno = 5, /obj/item/stack/sheet/animalhide/xeno = 1)
possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
limb_destroyer = 1
hud_type = /datum/hud/alien
var/obj/item/r_store = null
var/obj/item/l_store = null
var/caste = ""
var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
var/leap_on_click = 0
var/pounce_cooldown = 0
var/pounce_cooldown_time = 30
var/custom_pixel_x_offset = 0 //for admin fuckery.
var/custom_pixel_y_offset = 0
var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown
var/drooling = 0 //For Neruotoxic spit overlays
bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien,
/obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien)
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/humanoid/Initialize()
AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null))
. = ..()
/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
return handcuffed
/mob/living/carbon/alien/humanoid/show_inv(mob/user)
user.set_machine(src)
var/list/dat = list()
dat += {"
<HR>
<span class='big bold'>[name]</span>
<HR>"}
for(var/i in 1 to held_items.len)
var/obj/item/I = get_item_for_held_index(i)
dat += "<BR><B>[get_held_index_name(i)]:</B><A href='?src=[REF(src)];item=[SLOT_HANDS];hand_index=[i]'>[(I && !(I.item_flags & ABSTRACT)) ? I : "<font color=grey>Empty</font>"]</a>"
dat += "<BR><A href='?src=[REF(src)];pouches=1'>Empty Pouches</A>"
if(handcuffed)
dat += "<BR><A href='?src=[REF(src)];item=[SLOT_HANDCUFFED]'>Handcuffed</A>"
if(legcuffed)
dat += "<BR><A href='?src=[REF(src)];item=[SLOT_LEGCUFFED]'>Legcuffed</A>"
dat += {"
<BR>
<BR><A href='?src=[REF(user)];mach_close=mob[REF(src)]'>Close</A>
"}
user << browse(dat.Join(), "window=mob[REF(src)];size=325x500")
onclose(user, "mob[REF(src)]")
/mob/living/carbon/alien/humanoid/Topic(href, href_list)
..()
//strip panel
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
if(href_list["pouches"])
visible_message("<span class='danger'>[usr] tries to empty [src]'s pouches.</span>", \
"<span class='userdanger'>[usr] tries to empty [src]'s pouches.</span>")
if(do_mob(usr, src, POCKET_STRIP_DELAY * 0.5))
dropItemToGround(r_store)
dropItemToGround(l_store)
/mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I)
playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
..(I, cuff_break = INSTANT_CUFFBREAK)
/mob/living/carbon/alien/humanoid/resist_grab(moving_resist)
if(pulledby.grab_state)
visible_message("<span class='danger'>[src] has broken free of [pulledby]'s grip!</span>")
pulledby.stop_pulling()
. = 0
/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0)
if(leaping)
return -32
else if(custom_pixel_y_offset)
return custom_pixel_y_offset
else
return initial(pixel_y)
/mob/living/carbon/alien/humanoid/get_standard_pixel_x_offset(lying = 0)
if(leaping)
return -32
else if(custom_pixel_x_offset)
return custom_pixel_x_offset
else
return initial(pixel_x)
/mob/living/carbon/alien/humanoid/get_permeability_protection(list/target_zones)
return 0.8
/mob/living/carbon/alien/humanoid/alien_evolve(mob/living/carbon/alien/humanoid/new_xeno)
drop_all_held_items()
for(var/atom/movable/A in stomach_contents)
stomach_contents.Remove(A)
new_xeno.stomach_contents.Add(A)
A.forceMove(new_xeno)
..()
//For alien evolution/promotion/queen finder procs. Checks for an active alien of that type
/proc/get_alien_type(var/alienpath)
for(var/mob/living/carbon/alien/humanoid/A in GLOB.alive_mob_list)
if(!istype(A, alienpath))
continue
if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid.
continue
return A
return FALSE
/mob/living/carbon/alien/humanoid/check_breath(datum/gas_mixture/breath)
if(breath && breath.total_moles() > 0 && !sneaking)
playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5)
..()
/mob/living/carbon/alien/humanoid
name = "alien"
icon_state = "alien"
pass_flags = PASSTABLE
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno = 5, /obj/item/stack/sheet/animalhide/xeno = 1)
possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
limb_destroyer = 1
hud_type = /datum/hud/alien
var/obj/item/r_store = null
var/obj/item/l_store = null
var/caste = ""
var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
var/leap_on_click = 0
var/pounce_cooldown = 0
var/pounce_cooldown_time = 30
var/custom_pixel_x_offset = 0 //for admin fuckery.
var/custom_pixel_y_offset = 0
var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown
var/drooling = 0 //For Neruotoxic spit overlays
bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien,
/obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien)
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/humanoid/Initialize()
AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null))
. = ..()
/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
return handcuffed
/mob/living/carbon/alien/humanoid/show_inv(mob/user)
user.set_machine(src)
var/list/dat = list()
dat += {"
<HR>
<span class='big bold'>[name]</span>
<HR>"}
for(var/i in 1 to held_items.len)
var/obj/item/I = get_item_for_held_index(i)
dat += "<BR><B>[get_held_index_name(i)]:</B><A href='?src=[REF(src)];item=[SLOT_HANDS];hand_index=[i]'>[(I && !(I.item_flags & ABSTRACT)) ? I : "<font color=grey>Empty</font>"]</a>"
dat += "<BR><A href='?src=[REF(src)];pouches=1'>Empty Pouches</A>"
if(handcuffed)
dat += "<BR><A href='?src=[REF(src)];item=[SLOT_HANDCUFFED]'>Handcuffed</A>"
if(legcuffed)
dat += "<BR><A href='?src=[REF(src)];item=[SLOT_LEGCUFFED]'>Legcuffed</A>"
dat += {"
<BR>
<BR><A href='?src=[REF(user)];mach_close=mob[REF(src)]'>Close</A>
"}
user << browse(dat.Join(), "window=mob[REF(src)];size=325x500")
onclose(user, "mob[REF(src)]")
/mob/living/carbon/alien/humanoid/Topic(href, href_list)
..()
//strip panel
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
if(href_list["pouches"])
visible_message("<span class='danger'>[usr] tries to empty [src]'s pouches.</span>", \
"<span class='userdanger'>[usr] tries to empty [src]'s pouches.</span>")
if(do_mob(usr, src, POCKET_STRIP_DELAY * 0.5))
dropItemToGround(r_store)
dropItemToGround(l_store)
/mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I)
playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
..(I, cuff_break = INSTANT_CUFFBREAK)
/mob/living/carbon/alien/humanoid/resist_grab(moving_resist)
if(pulledby.grab_state)
visible_message("<span class='danger'>[src] has broken free of [pulledby]'s grip!</span>")
pulledby.stop_pulling()
. = 0
/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0)
if(leaping)
return -32
else if(custom_pixel_y_offset)
return custom_pixel_y_offset
else
return initial(pixel_y)
/mob/living/carbon/alien/humanoid/get_standard_pixel_x_offset(lying = 0)
if(leaping)
return -32
else if(custom_pixel_x_offset)
return custom_pixel_x_offset
else
return initial(pixel_x)
/mob/living/carbon/alien/humanoid/get_permeability_protection(list/target_zones)
return 0.8
/mob/living/carbon/alien/humanoid/alien_evolve(mob/living/carbon/alien/humanoid/new_xeno)
drop_all_held_items()
for(var/atom/movable/A in stomach_contents)
stomach_contents.Remove(A)
new_xeno.stomach_contents.Add(A)
A.forceMove(new_xeno)
..()
//For alien evolution/promotion/queen finder procs. Checks for an active alien of that type
/proc/get_alien_type(var/alienpath)
for(var/mob/living/carbon/alien/humanoid/A in GLOB.alive_mob_list)
if(!istype(A, alienpath))
continue
if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid.
continue
return A
return FALSE
/mob/living/carbon/alien/humanoid/check_breath(datum/gas_mixture/breath)
if(breath && breath.total_moles() > 0 && !sneaking)
playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5)
..()
@@ -1,139 +1,139 @@
/mob/living/carbon/alien/humanoid/royal
//Common stuffs for Praetorian and Queen
icon = 'icons/mob/alienqueen.dmi'
status_flags = 0
ventcrawler = VENTCRAWLER_NONE //pull over that ass too fat
unique_name = 0
pixel_x = -16
bubble_icon = "alienroyal"
mob_size = MOB_SIZE_LARGE
layer = LARGE_MOB_LAYER //above most mobs, but below speechbubbles
pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper.
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno = 20, /obj/item/stack/sheet/animalhide/xeno = 3)
var/alt_inhands_file = 'icons/mob/alienqueen.dmi'
/mob/living/carbon/alien/humanoid/royal/can_inject()
return 0
/mob/living/carbon/alien/humanoid/royal/queen
name = "alien queen"
caste = "q"
maxHealth = 400
health = 400
icon_state = "alienq"
var/datum/action/small_sprite/smallsprite = new/datum/action/small_sprite/queen()
/mob/living/carbon/alien/humanoid/royal/queen/Initialize()
//there should only be one queen
for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in GLOB.carbon_list)
if(Q == src)
continue
if(Q.stat == DEAD)
continue
if(Q.client)
name = "alien princess ([rand(1, 999)])" //if this is too cutesy feel free to change it/remove it.
break
real_name = src.name
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
smallsprite.Grant(src)
return ..()
/mob/living/carbon/alien/humanoid/royal/queen/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/large/queen
internal_organs += new /obj/item/organ/alien/resinspinner
internal_organs += new /obj/item/organ/alien/acid
internal_organs += new /obj/item/organ/alien/neurotoxin
internal_organs += new /obj/item/organ/alien/eggsac
..()
//Queen verbs
/obj/effect/proc_holder/alien/lay_egg
name = "Lay Egg"
desc = "Lay an egg to produce huggers to impregnate prey with."
plasma_cost = 75
check_turf = TRUE
action_icon_state = "alien_egg"
/obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user)
if(locate(/obj/structure/alien/egg) in get_turf(user))
to_chat(user, "<span class='alertalien'>There's already an egg here.</span>")
return FALSE
if(!check_vent_block(user))
return FALSE
user.visible_message("<span class='alertalien'>[user] has laid an egg!</span>")
new /obj/structure/alien/egg(user.loc)
return TRUE
//Button to let queen choose her praetorian.
/obj/effect/proc_holder/alien/royal/queen/promote
name = "Create Royal Parasite"
desc = "Produce a royal parasite to grant one of your children the honor of being your Praetorian."
plasma_cost = 500 //Plasma cost used on promotion, not spawning the parasite.
action_icon_state = "alien_queen_promote"
/obj/effect/proc_holder/alien/royal/queen/promote/fire(mob/living/carbon/alien/user)
var/obj/item/queenpromote/prom
if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/))
to_chat(user, "<span class='noticealien'>You already have a Praetorian!</span>")
return 0
else
for(prom in user)
to_chat(user, "<span class='noticealien'>You discard [prom].</span>")
qdel(prom)
return 0
prom = new (user.loc)
if(!user.put_in_active_hand(prom, 1))
to_chat(user, "<span class='warning'>You must empty your hands before preparing the parasite.</span>")
return 0
else //Just in case telling the player only once is not enough!
to_chat(user, "<span class='noticealien'>Use the royal parasite on one of your children to promote her to Praetorian!</span>")
return 0
/obj/item/queenpromote
name = "\improper royal parasite"
desc = "Inject this into one of your grown children to promote her to a Praetorian!"
icon_state = "alien_medal"
item_flags = ABSTRACT | DROPDEL
icon = 'icons/mob/alien.dmi'
/obj/item/queenpromote/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
/obj/item/queenpromote/attack(mob/living/M, mob/living/carbon/alien/humanoid/user)
if(!isalienadult(M) || isalienroyal(M))
to_chat(user, "<span class='noticealien'>You may only use this with your adult, non-royal children!</span>")
return
if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/))
to_chat(user, "<span class='noticealien'>You already have a Praetorian!</span>")
return
var/mob/living/carbon/alien/humanoid/A = M
if(A.stat == CONSCIOUS && A.mind && A.key)
if(!user.usePlasma(500))
to_chat(user, "<span class='noticealien'>You must have 500 plasma stored to use this!</span>")
return
to_chat(A, "<span class='noticealien'>The queen has granted you a promotion to Praetorian!</span>")
user.visible_message("<span class='alertalien'>[A] begins to expand, twist and contort!</span>")
var/mob/living/carbon/alien/humanoid/royal/praetorian/new_prae = new (A.loc)
A.mind.transfer_to(new_prae)
qdel(A)
qdel(src)
return
else
to_chat(user, "<span class='warning'>This child must be alert and responsive to become a Praetorian!</span>")
/obj/item/queenpromote/attack_self(mob/user)
to_chat(user, "<span class='noticealien'>You discard [src].</span>")
qdel(src)
/mob/living/carbon/alien/humanoid/royal
//Common stuffs for Praetorian and Queen
icon = 'icons/mob/alienqueen.dmi'
status_flags = 0
ventcrawler = VENTCRAWLER_NONE //pull over that ass too fat
unique_name = 0
pixel_x = -16
bubble_icon = "alienroyal"
mob_size = MOB_SIZE_LARGE
layer = LARGE_MOB_LAYER //above most mobs, but below speechbubbles
pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper.
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno = 20, /obj/item/stack/sheet/animalhide/xeno = 3)
var/alt_inhands_file = 'icons/mob/alienqueen.dmi'
/mob/living/carbon/alien/humanoid/royal/can_inject()
return 0
/mob/living/carbon/alien/humanoid/royal/queen
name = "alien queen"
caste = "q"
maxHealth = 400
health = 400
icon_state = "alienq"
var/datum/action/small_sprite/smallsprite = new/datum/action/small_sprite/queen()
/mob/living/carbon/alien/humanoid/royal/queen/Initialize()
//there should only be one queen
for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in GLOB.carbon_list)
if(Q == src)
continue
if(Q.stat == DEAD)
continue
if(Q.client)
name = "alien princess ([rand(1, 999)])" //if this is too cutesy feel free to change it/remove it.
break
real_name = src.name
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
smallsprite.Grant(src)
return ..()
/mob/living/carbon/alien/humanoid/royal/queen/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/large/queen
internal_organs += new /obj/item/organ/alien/resinspinner
internal_organs += new /obj/item/organ/alien/acid
internal_organs += new /obj/item/organ/alien/neurotoxin
internal_organs += new /obj/item/organ/alien/eggsac
..()
//Queen verbs
/obj/effect/proc_holder/alien/lay_egg
name = "Lay Egg"
desc = "Lay an egg to produce huggers to impregnate prey with."
plasma_cost = 75
check_turf = TRUE
action_icon_state = "alien_egg"
/obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user)
if(locate(/obj/structure/alien/egg) in get_turf(user))
to_chat(user, "<span class='alertalien'>There's already an egg here.</span>")
return FALSE
if(!check_vent_block(user))
return FALSE
user.visible_message("<span class='alertalien'>[user] has laid an egg!</span>")
new /obj/structure/alien/egg(user.loc)
return TRUE
//Button to let queen choose her praetorian.
/obj/effect/proc_holder/alien/royal/queen/promote
name = "Create Royal Parasite"
desc = "Produce a royal parasite to grant one of your children the honor of being your Praetorian."
plasma_cost = 500 //Plasma cost used on promotion, not spawning the parasite.
action_icon_state = "alien_queen_promote"
/obj/effect/proc_holder/alien/royal/queen/promote/fire(mob/living/carbon/alien/user)
var/obj/item/queenpromote/prom
if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/))
to_chat(user, "<span class='noticealien'>You already have a Praetorian!</span>")
return 0
else
for(prom in user)
to_chat(user, "<span class='noticealien'>You discard [prom].</span>")
qdel(prom)
return 0
prom = new (user.loc)
if(!user.put_in_active_hand(prom, 1))
to_chat(user, "<span class='warning'>You must empty your hands before preparing the parasite.</span>")
return 0
else //Just in case telling the player only once is not enough!
to_chat(user, "<span class='noticealien'>Use the royal parasite on one of your children to promote her to Praetorian!</span>")
return 0
/obj/item/queenpromote
name = "\improper royal parasite"
desc = "Inject this into one of your grown children to promote her to a Praetorian!"
icon_state = "alien_medal"
item_flags = ABSTRACT | DROPDEL
icon = 'icons/mob/alien.dmi'
/obj/item/queenpromote/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
/obj/item/queenpromote/attack(mob/living/M, mob/living/carbon/alien/humanoid/user)
if(!isalienadult(M) || isalienroyal(M))
to_chat(user, "<span class='noticealien'>You may only use this with your adult, non-royal children!</span>")
return
if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/))
to_chat(user, "<span class='noticealien'>You already have a Praetorian!</span>")
return
var/mob/living/carbon/alien/humanoid/A = M
if(A.stat == CONSCIOUS && A.mind && A.key)
if(!user.usePlasma(500))
to_chat(user, "<span class='noticealien'>You must have 500 plasma stored to use this!</span>")
return
to_chat(A, "<span class='noticealien'>The queen has granted you a promotion to Praetorian!</span>")
user.visible_message("<span class='alertalien'>[A] begins to expand, twist and contort!</span>")
var/mob/living/carbon/alien/humanoid/royal/praetorian/new_prae = new (A.loc)
A.mind.transfer_to(new_prae)
qdel(A)
qdel(src)
return
else
to_chat(user, "<span class='warning'>This child must be alert and responsive to become a Praetorian!</span>")
/obj/item/queenpromote/attack_self(mob/user)
to_chat(user, "<span class='noticealien'>You discard [src].</span>")
qdel(src)
@@ -1,98 +1,98 @@
/mob/living/carbon/alien/humanoid/update_icons()
cut_overlays()
for(var/I in overlays_standing)
add_overlay(I)
var/asleep = IsSleeping()
if(stat == DEAD)
//If we mostly took damage from fire
if(fireloss > 125)
icon_state = "alien[caste]_husked"
else
icon_state = "alien[caste]_dead"
else if((stat == UNCONSCIOUS && !asleep) || stat == SOFT_CRIT || IsKnockdown())
icon_state = "alien[caste]_unconscious"
else if(leap_on_click)
icon_state = "alien[caste]_pounce"
else if(lying || resting || asleep)
icon_state = "alien[caste]_sleep"
else if(mob_size == MOB_SIZE_LARGE)
icon_state = "alien[caste]"
if(drooling)
add_overlay("alienspit_[caste]")
else
icon_state = "alien[caste]"
if(drooling)
add_overlay("alienspit")
if(leaping)
if(alt_icon == initial(alt_icon))
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
icon_state = "alien[caste]_leap"
pixel_x = -32
pixel_y = -32
else
if(alt_icon != initial(alt_icon))
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
pixel_x = get_standard_pixel_x_offset(lying)
pixel_y = get_standard_pixel_y_offset(lying)
update_inv_hands()
update_inv_handcuffed()
/mob/living/carbon/alien/humanoid/regenerate_icons()
if(!..())
// update_icons() //Handled in update_transform(), leaving this here as a reminder
update_transform()
/mob/living/carbon/alien/humanoid/update_transform() //The old method of updating lying/standing was update_icons(). Aliens still expect that.
if(lying > 0)
lying = 90 //Anything else looks retarded
..()
update_icons()
/mob/living/carbon/alien/humanoid/update_inv_handcuffed()
remove_overlay(HANDCUFF_LAYER)
if(handcuffed)
var/cuff_icon = handcuffed.item_state
var/dmi_file = 'icons/mob/alien.dmi'
if(mob_size == MOB_SIZE_LARGE)
cuff_icon += "_[caste]"
dmi_file = 'icons/mob/alienqueen.dmi'
var/mutable_appearance/cuffs = mutable_appearance(dmi_file, cuff_icon, -HANDCUFF_LAYER)
cuffs.color = handcuffed.color
overlays_standing[HANDCUFF_LAYER] = cuffs
apply_overlay(HANDCUFF_LAYER)
//Royals have bigger sprites, so inhand things must be handled differently.
/mob/living/carbon/alien/humanoid/royal/update_inv_hands()
..()
remove_overlay(HANDS_LAYER)
var/list/hands = list()
var/obj/item/l_hand = get_item_for_held_index(1)
if(l_hand)
var/itm_state = l_hand.item_state
if(!itm_state)
itm_state = l_hand.icon_state
hands += mutable_appearance(alt_inhands_file, "[itm_state][caste]_l", -HANDS_LAYER)
var/obj/item/r_hand = get_item_for_held_index(2)
if(r_hand)
var/itm_state = r_hand.item_state
if(!itm_state)
itm_state = r_hand.icon_state
hands += mutable_appearance(alt_inhands_file, "[itm_state][caste]_r", -HANDS_LAYER)
overlays_standing[HANDS_LAYER] = hands
/mob/living/carbon/alien/humanoid/update_icons()
cut_overlays()
for(var/I in overlays_standing)
add_overlay(I)
var/asleep = IsSleeping()
if(stat == DEAD)
//If we mostly took damage from fire
if(fireloss > 125)
icon_state = "alien[caste]_husked"
else
icon_state = "alien[caste]_dead"
else if((stat == UNCONSCIOUS && !asleep) || stat == SOFT_CRIT || IsKnockdown())
icon_state = "alien[caste]_unconscious"
else if(leap_on_click)
icon_state = "alien[caste]_pounce"
else if(lying || resting || asleep)
icon_state = "alien[caste]_sleep"
else if(mob_size == MOB_SIZE_LARGE)
icon_state = "alien[caste]"
if(drooling)
add_overlay("alienspit_[caste]")
else
icon_state = "alien[caste]"
if(drooling)
add_overlay("alienspit")
if(leaping)
if(alt_icon == initial(alt_icon))
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
icon_state = "alien[caste]_leap"
pixel_x = -32
pixel_y = -32
else
if(alt_icon != initial(alt_icon))
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
pixel_x = get_standard_pixel_x_offset(lying)
pixel_y = get_standard_pixel_y_offset(lying)
update_inv_hands()
update_inv_handcuffed()
/mob/living/carbon/alien/humanoid/regenerate_icons()
if(!..())
// update_icons() //Handled in update_transform(), leaving this here as a reminder
update_transform()
/mob/living/carbon/alien/humanoid/update_transform() //The old method of updating lying/standing was update_icons(). Aliens still expect that.
if(lying > 0)
lying = 90 //Anything else looks retarded
..()
update_icons()
/mob/living/carbon/alien/humanoid/update_inv_handcuffed()
remove_overlay(HANDCUFF_LAYER)
if(handcuffed)
var/cuff_icon = handcuffed.item_state
var/dmi_file = 'icons/mob/alien.dmi'
if(mob_size == MOB_SIZE_LARGE)
cuff_icon += "_[caste]"
dmi_file = 'icons/mob/alienqueen.dmi'
var/mutable_appearance/cuffs = mutable_appearance(dmi_file, cuff_icon, -HANDCUFF_LAYER)
cuffs.color = handcuffed.color
overlays_standing[HANDCUFF_LAYER] = cuffs
apply_overlay(HANDCUFF_LAYER)
//Royals have bigger sprites, so inhand things must be handled differently.
/mob/living/carbon/alien/humanoid/royal/update_inv_hands()
..()
remove_overlay(HANDS_LAYER)
var/list/hands = list()
var/obj/item/l_hand = get_item_for_held_index(1)
if(l_hand)
var/itm_state = l_hand.item_state
if(!itm_state)
itm_state = l_hand.icon_state
hands += mutable_appearance(alt_inhands_file, "[itm_state][caste]_l", -HANDS_LAYER)
var/obj/item/r_hand = get_item_for_held_index(2)
if(r_hand)
var/itm_state = r_hand.item_state
if(!itm_state)
itm_state = r_hand.icon_state
hands += mutable_appearance(alt_inhands_file, "[itm_state][caste]_r", -HANDS_LAYER)
overlays_standing[HANDS_LAYER] = hands
apply_overlay(HANDS_LAYER)
@@ -1,23 +1,23 @@
/mob/living/carbon/alien/larva/death(gibbed)
if(stat == DEAD)
return
. = ..()
update_icons()
/mob/living/carbon/alien/larva/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(with_bodyparts)
new /obj/effect/gibspawner/larva(location, src)
else
new /obj/effect/gibspawner/larva/bodypartless(location, src)
/mob/living/carbon/alien/larva/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-l")
/mob/living/carbon/alien/larva/spawn_dust()
new /obj/effect/decal/remains/xeno(loc)
/mob/living/carbon/alien/larva/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-l")
/mob/living/carbon/alien/larva/death(gibbed)
if(stat == DEAD)
return
. = ..()
update_icons()
/mob/living/carbon/alien/larva/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(with_bodyparts)
new /obj/effect/gibspawner/larva(location, src)
else
new /obj/effect/gibspawner/larva/bodypartless(location, src)
/mob/living/carbon/alien/larva/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-l")
/mob/living/carbon/alien/larva/spawn_dust()
new /obj/effect/decal/remains/xeno(loc)
/mob/living/carbon/alien/larva/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-l")
@@ -56,7 +56,7 @@
/mob/living/carbon/alien/larva/toggle_throw_mode()
return
/mob/living/carbon/alien/larva/start_pulling()
/mob/living/carbon/alien/larva/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE)
return
/mob/living/carbon/alien/larva/stripPanelUnequip(obj/item/what, mob/who)
@@ -1,63 +1,63 @@
/obj/effect/proc_holder/alien/hide
name = "Hide"
desc = "Allows aliens to hide beneath tables or certain items. Toggled on or off."
plasma_cost = 0
action_icon_state = "alien_hide"
/obj/effect/proc_holder/alien/hide/fire(mob/living/carbon/alien/user)
if(user.stat != CONSCIOUS)
return
if (user.layer != ABOVE_NORMAL_TURF_LAYER)
user.layer = ABOVE_NORMAL_TURF_LAYER
user.visible_message("<span class='name'>[user] scurries to the ground!</span>", \
"<span class='noticealien'>You are now hiding.</span>")
else
user.layer = MOB_LAYER
user.visible_message("[user] slowly peeks up from the ground...", \
"<span class='noticealien'>You stop hiding.</span>")
return 1
/obj/effect/proc_holder/alien/larva_evolve
name = "Evolve"
desc = "Evolve into a higher alien caste."
plasma_cost = 0
action_icon_state = "alien_evolve_larva"
/obj/effect/proc_holder/alien/larva_evolve/fire(mob/living/carbon/alien/user)
if(!islarva(user))
return
var/mob/living/carbon/alien/larva/L = user
if(L.handcuffed || L.legcuffed) // Cuffing larvas ? Eh ?
to_chat(user, "<span class='danger'>You cannot evolve when you are cuffed.</span>")
return
if(L.amount_grown >= L.max_grown) //TODO ~Carn
to_chat(L, "<span class='name'>You are growing into a beautiful alien! It is time to choose a caste.</span>")
to_chat(L, "<span class='info'>There are three to choose from:</span>")
to_chat(L, "<span class='name'>Hunters</span> <span class='info'>are the most agile caste, tasked with hunting for hosts. They are faster than a human and can even pounce, but are not much tougher than a drone.</span>")
to_chat(L, "<span class='name'>Sentinels</span> <span class='info'>are tasked with protecting the hive. With their ranged spit, invisibility, and high health, they make formidable guardians and acceptable secondhand hunters.</span>")
to_chat(L, "<span class='name'>Drones</span> <span class='info'>are the weakest and slowest of the castes, but can grow into a praetorian and then queen if no queen exists, and are vital to maintaining a hive with their resin secretion abilities.</span>")
var/alien_caste = alert(L, "Please choose which alien caste you shall belong to.",,"Hunter","Sentinel","Drone")
if(user.incapacitated()) //something happened to us while we were choosing.
return
var/mob/living/carbon/alien/humanoid/new_xeno
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(L.loc)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(L.loc)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone(L.loc)
L.alien_evolve(new_xeno)
return 0
else
to_chat(user, "<span class='danger'>You are not fully grown.</span>")
return 0
/obj/effect/proc_holder/alien/hide
name = "Hide"
desc = "Allows aliens to hide beneath tables or certain items. Toggled on or off."
plasma_cost = 0
action_icon_state = "alien_hide"
/obj/effect/proc_holder/alien/hide/fire(mob/living/carbon/alien/user)
if(user.stat != CONSCIOUS)
return
if (user.layer != ABOVE_NORMAL_TURF_LAYER)
user.layer = ABOVE_NORMAL_TURF_LAYER
user.visible_message("<span class='name'>[user] scurries to the ground!</span>", \
"<span class='noticealien'>You are now hiding.</span>")
else
user.layer = MOB_LAYER
user.visible_message("[user] slowly peeks up from the ground...", \
"<span class='noticealien'>You stop hiding.</span>")
return 1
/obj/effect/proc_holder/alien/larva_evolve
name = "Evolve"
desc = "Evolve into a higher alien caste."
plasma_cost = 0
action_icon_state = "alien_evolve_larva"
/obj/effect/proc_holder/alien/larva_evolve/fire(mob/living/carbon/alien/user)
if(!islarva(user))
return
var/mob/living/carbon/alien/larva/L = user
if(L.handcuffed || L.legcuffed) // Cuffing larvas ? Eh ?
to_chat(user, "<span class='danger'>You cannot evolve when you are cuffed.</span>")
return
if(L.amount_grown >= L.max_grown) //TODO ~Carn
to_chat(L, "<span class='name'>You are growing into a beautiful alien! It is time to choose a caste.</span>")
to_chat(L, "<span class='info'>There are three to choose from:</span>")
to_chat(L, "<span class='name'>Hunters</span> <span class='info'>are the most agile caste, tasked with hunting for hosts. They are faster than a human and can even pounce, but are not much tougher than a drone.</span>")
to_chat(L, "<span class='name'>Sentinels</span> <span class='info'>are tasked with protecting the hive. With their ranged spit, invisibility, and high health, they make formidable guardians and acceptable secondhand hunters.</span>")
to_chat(L, "<span class='name'>Drones</span> <span class='info'>are the weakest and slowest of the castes, but can grow into a praetorian and then queen if no queen exists, and are vital to maintaining a hive with their resin secretion abilities.</span>")
var/alien_caste = alert(L, "Please choose which alien caste you shall belong to.",,"Hunter","Sentinel","Drone")
if(user.incapacitated()) //something happened to us while we were choosing.
return
var/mob/living/carbon/alien/humanoid/new_xeno
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(L.loc)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(L.loc)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone(L.loc)
L.alien_evolve(new_xeno)
return 0
else
to_chat(user, "<span class='danger'>You are not fully grown.</span>")
return 0
+52 -52
View File
@@ -1,52 +1,52 @@
/mob/living/carbon/alien/Life()
findQueen()
return..()
/mob/living/carbon/alien/check_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
return
if(!breath || (breath.total_moles() == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_used = 0
var/tox_detect_threshold = 0.02
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
var/list/breath_gases = breath.gases
//Partial pressure of the toxins in our breath
var/Toxins_pp = (breath_gases[/datum/gas/plasma]/breath.total_moles())*breath_pressure
if(Toxins_pp > tox_detect_threshold) // Detect toxins in air
adjustPlasma(breath_gases[/datum/gas/plasma]*250)
throw_alert("alien_tox", /obj/screen/alert/alien_tox)
toxins_used = breath_gases[/datum/gas/plasma]
else
clear_alert("alien_tox")
//Breathe in toxins and out oxygen
breath_gases[/datum/gas/plasma] -= toxins_used
breath_gases[/datum/gas/oxygen] += toxins_used
GAS_GARBAGE_COLLECT(breath.gases)
//BREATH TEMPERATURE
handle_breath_temperature(breath)
/mob/living/carbon/alien/handle_status_effects()
..()
//natural reduction of movement delay due to stun.
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
/mob/living/carbon/alien/handle_changeling()
return
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
if(..())
return
adjust_bodytemperature(BODYTEMP_HEATING_MAX) //If you're on fire, you heat up!
return
/mob/living/carbon/alien/Life()
findQueen()
return..()
/mob/living/carbon/alien/check_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
return
if(!breath || (breath.total_moles() == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_used = 0
var/tox_detect_threshold = 0.02
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
var/list/breath_gases = breath.gases
//Partial pressure of the toxins in our breath
var/Toxins_pp = (breath_gases[/datum/gas/plasma]/breath.total_moles())*breath_pressure
if(Toxins_pp > tox_detect_threshold) // Detect toxins in air
adjustPlasma(breath_gases[/datum/gas/plasma]*250)
throw_alert("alien_tox", /obj/screen/alert/alien_tox)
toxins_used = breath_gases[/datum/gas/plasma]
else
clear_alert("alien_tox")
//Breathe in toxins and out oxygen
breath_gases[/datum/gas/plasma] -= toxins_used
breath_gases[/datum/gas/oxygen] += toxins_used
GAS_GARBAGE_COLLECT(breath.gases)
//BREATH TEMPERATURE
handle_breath_temperature(breath)
/mob/living/carbon/alien/handle_status_effects()
..()
//natural reduction of movement delay due to stun.
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
/mob/living/carbon/alien/handle_changeling()
return
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
if(..())
return
adjust_bodytemperature(BODYTEMP_HEATING_MAX) //If you're on fire, you heat up!
return
+23 -23
View File
@@ -1,23 +1,23 @@
/mob/living/proc/alien_talk(message, shown_name = real_name)
src.log_talk(message, LOG_SAY)
message = trim(message)
if(!message)
return
var/message_a = say_quote(message)
var/rendered = "<i><span class='alien'>Hivemind, <span class='name'>[shown_name]</span> <span class='message'>[message_a]</span></span></i>"
for(var/mob/S in GLOB.player_list)
if(!S.stat && S.hivecheck())
to_chat(S, rendered)
if(S in GLOB.dead_mob_list)
var/link = FOLLOW_LINK(S, src)
to_chat(S, "[link] [rendered]")
/mob/living/carbon/alien/humanoid/royal/queen/alien_talk(message, shown_name = name)
shown_name = "<FONT size = 3>[shown_name]</FONT>"
..(message, shown_name)
/mob/living/carbon/hivecheck()
var/obj/item/organ/alien/hivenode/N = getorgan(/obj/item/organ/alien/hivenode)
if(N && !N.recent_queen_death) //Mob has alien hive node and is not under the dead queen special effect.
return N
/mob/living/proc/alien_talk(message, shown_name = real_name)
src.log_talk(message, LOG_SAY)
message = trim(message)
if(!message)
return
var/message_a = say_quote(message)
var/rendered = "<i><span class='alien'>Hivemind, <span class='name'>[shown_name]</span> <span class='message'>[message_a]</span></span></i>"
for(var/mob/S in GLOB.player_list)
if(!S.stat && S.hivecheck())
to_chat(S, rendered)
if(S in GLOB.dead_mob_list)
var/link = FOLLOW_LINK(S, src)
to_chat(S, "[link] [rendered]")
/mob/living/carbon/alien/humanoid/royal/queen/alien_talk(message, shown_name = name)
shown_name = "<FONT size = 3>[shown_name]</FONT>"
..(message, shown_name)
/mob/living/carbon/hivecheck()
var/obj/item/organ/alien/hivenode/N = getorgan(/obj/item/organ/alien/hivenode)
if(N && !N.recent_queen_death) //Mob has alien hive node and is not under the dead queen special effect.
return N
+32 -32
View File
@@ -1,33 +1,33 @@
/mob/living/carbon/alien/proc/updatePlasmaDisplay()
if(hud_used) //clientless aliens
hud_used.alien_plasma_display.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='magenta'>[round(getPlasma())]</font></div>"
/mob/living/carbon/alien/larva/updatePlasmaDisplay()
return
/mob/living/carbon/alien/proc/findQueen()
if(hud_used)
hud_used.alien_queen_finder.cut_overlays()
var/mob/queen = get_alien_type(/mob/living/carbon/alien/humanoid/royal/queen)
if(!queen)
return
var/turf/Q = get_turf(queen)
var/turf/A = get_turf(src)
if(Q.z != A.z) //The queen is on a different Z level, we cannot sense that far.
return
var/Qdir = get_dir(src, Q)
var/Qdist = get_dist(src, Q)
var/finder_icon = "finder_center" //Overlay showed when adjacent to or on top of the queen!
switch(Qdist)
if(2 to 7)
finder_icon = "finder_near"
if(8 to 20)
finder_icon = "finder_med"
if(21 to INFINITY)
finder_icon = "finder_far"
var/image/finder_eye = image('icons/mob/screen_alien.dmi', finder_icon, dir = Qdir)
hud_used.alien_queen_finder.add_overlay(finder_eye)
/mob/living/carbon/alien/humanoid/royal/queen/findQueen()
/mob/living/carbon/alien/proc/updatePlasmaDisplay()
if(hud_used) //clientless aliens
hud_used.alien_plasma_display.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='magenta'>[round(getPlasma())]</font></div>"
/mob/living/carbon/alien/larva/updatePlasmaDisplay()
return
/mob/living/carbon/alien/proc/findQueen()
if(hud_used)
hud_used.alien_queen_finder.cut_overlays()
var/mob/queen = get_alien_type(/mob/living/carbon/alien/humanoid/royal/queen)
if(!queen)
return
var/turf/Q = get_turf(queen)
var/turf/A = get_turf(src)
if(Q.z != A.z) //The queen is on a different Z level, we cannot sense that far.
return
var/Qdir = get_dir(src, Q)
var/Qdist = get_dist(src, Q)
var/finder_icon = "finder_center" //Overlay showed when adjacent to or on top of the queen!
switch(Qdist)
if(2 to 7)
finder_icon = "finder_near"
if(8 to 20)
finder_icon = "finder_med"
if(21 to INFINITY)
finder_icon = "finder_far"
var/image/finder_eye = image('icons/mob/screen_alien.dmi', finder_icon, dir = Qdir)
hud_used.alien_queen_finder.add_overlay(finder_eye)
/mob/living/carbon/alien/humanoid/royal/queen/findQueen()
return //Queen already knows where she is. Hopefully.
@@ -1,139 +1,139 @@
// 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, "<span class='danger'>Your throat feels sore.</span>")
if(prob(2))
to_chat(owner, "<span class='danger'>Mucous runs down the back of your throat.</span>")
if(4)
if(prob(2))
owner.emote("sneeze")
if(prob(2))
owner.emote("cough")
if(prob(4))
to_chat(owner, "<span class='danger'>Your muscles ache.</span>")
if(prob(20))
owner.take_bodypart_damage(1)
if(prob(4))
to_chat(owner, "<span class='danger'>Your stomach hurts.</span>")
if(prob(20))
owner.adjustToxLoss(1)
if(5)
to_chat(owner, "<span class='danger'>You feel something tearing its way out of your stomach...</span>")
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)
ghost.transfer_ckey(new_xeno, FALSE)
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
var/mob/living/carbon/old_owner = owner
if(kill_on_sucess) //ITS TOO LATE
new_xeno.visible_message("<span class='danger'>[new_xeno] bursts out of [owner]!</span>", "<span class='userdanger'>You exit [owner], your previous host.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
owner.apply_damage(rand(100,300),BRUTE,zone,FALSE) //Random high damage to torso so health sensors don't metagame.
var/obj/item/bodypart/B = owner.get_bodypart(zone)
B.drop_organs(owner) //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("<span class='danger'>[new_xeno] wriggles out of [owner]!</span>", "<span class='userdanger'>You exit [owner], your previous host.</span>")
owner.adjustBruteLoss(40)
old_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(mob/living/carbon/C)
for(var/mob/living/carbon/alien/alien in GLOB.player_list)
if(alien.client)
var/I = image('icons/mob/alien.dmi', loc = C, 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(mob/living/carbon/C)
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 == C)
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, "<span class='danger'>Your throat feels sore.</span>")
if(prob(2))
to_chat(owner, "<span class='danger'>Mucous runs down the back of your throat.</span>")
if(4)
if(prob(2))
owner.emote("sneeze")
if(prob(2))
owner.emote("cough")
if(prob(4))
to_chat(owner, "<span class='danger'>Your muscles ache.</span>")
if(prob(20))
owner.take_bodypart_damage(1)
if(prob(4))
to_chat(owner, "<span class='danger'>Your stomach hurts.</span>")
if(prob(20))
owner.adjustToxLoss(1)
if(5)
to_chat(owner, "<span class='danger'>You feel something tearing its way out of your stomach...</span>")
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)
ghost.transfer_ckey(new_xeno, FALSE)
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
var/mob/living/carbon/old_owner = owner
if(kill_on_sucess) //ITS TOO LATE
new_xeno.visible_message("<span class='danger'>[new_xeno] bursts out of [owner]!</span>", "<span class='userdanger'>You exit [owner], your previous host.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
owner.apply_damage(rand(100,300),BRUTE,zone,FALSE) //Random high damage to torso so health sensors don't metagame.
var/obj/item/bodypart/B = owner.get_bodypart(zone)
B.drop_organs(owner) //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("<span class='danger'>[new_xeno] wriggles out of [owner]!</span>", "<span class='userdanger'>You exit [owner], your previous host.</span>")
owner.adjustBruteLoss(40)
old_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(mob/living/carbon/C)
for(var/mob/living/carbon/alien/alien in GLOB.player_list)
if(alien.client)
var/I = image('icons/mob/alien.dmi', loc = C, 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(mob/living/carbon/C)
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 == C)
qdel(I)
@@ -1,271 +1,271 @@
//TODO: Make these simple_animals
#define MIN_IMPREGNATION_TIME 100 //time it takes to impregnate someone
#define MAX_IMPREGNATION_TIME 150
#define MIN_ACTIVE_TIME 200 //time between being dropped and going idle
#define MAX_ACTIVE_TIME 400
/obj/item/clothing/mask/facehugger
name = "alien"
desc = "It has some sort of a tube at the end of its tail."
icon = 'icons/mob/alien.dmi'
icon_state = "facehugger"
item_state = "facehugger"
w_class = WEIGHT_CLASS_TINY //note: can be picked up by aliens unlike most other items of w_class below 4
clothing_flags = ALLOWINTERNALS
throw_range = 5
tint = 3
flags_cover = MASKCOVERSEYES | MASKCOVERSMOUTH
layer = MOB_LAYER
max_integrity = 100
mutantrace_variation = STYLE_MUZZLE
var/stat = CONSCIOUS //UNCONSCIOUS is the idle state in this case
var/sterile = FALSE
var/real = TRUE //0 for the toy, 1 for real. Sure I could istype, but fuck that.
var/strength = 5
var/attached = 0
/obj/item/clothing/mask/facehugger/lamarr
name = "Lamarr"
sterile = TRUE
/obj/item/clothing/mask/facehugger/dead
icon_state = "facehugger_dead"
item_state = "facehugger_inactive"
sterile = TRUE
stat = DEAD
/obj/item/clothing/mask/facehugger/impregnated
icon_state = "facehugger_impregnated"
item_state = "facehugger_impregnated"
sterile = TRUE
stat = DEAD
/obj/item/clothing/mask/facehugger/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
..()
if(obj_integrity < 90)
Die()
/obj/item/clothing/mask/facehugger/attackby(obj/item/O, mob/user, params)
return O.attack_obj(src, user)
/obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens
return attack_hand(user)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/mask/facehugger/attack_hand(mob/user)
if((stat == CONSCIOUS && !sterile) && !isalien(user))
if(Leap(user))
return
. = ..()
/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user)
..()
if(user.transferItemToLoc(src, get_turf(M)))
Leap(M)
/obj/item/clothing/mask/facehugger/examine(mob/user)
. = ..()
if(!real)//So that giant red text about probisci doesn't show up.
return
switch(stat)
if(DEAD,UNCONSCIOUS)
. += "<span class='boldannounce'>[src] is not moving.</span>"
if(CONSCIOUS)
. += "<span class='boldannounce'>[src] seems to be active!</span>"
if (sterile)
. += "<span class='boldannounce'>It looks like the proboscis has been removed.</span>"
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
Die()
/obj/item/clothing/mask/facehugger/equipped(mob/M)
Attach(M)
/obj/item/clothing/mask/facehugger/Crossed(atom/target)
HasProximity(target)
return
/obj/item/clothing/mask/facehugger/on_found(mob/finder)
if(stat == CONSCIOUS)
return HasProximity(finder)
return 0
/obj/item/clothing/mask/facehugger/HasProximity(atom/movable/AM as mob|obj)
if(CanHug(AM) && Adjacent(AM))
return Leap(AM)
return 0
/obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
if(stat == CONSCIOUS)
icon_state = "[initial(icon_state)]_thrown"
addtimer(CALLBACK(src, .proc/clear_throw_icon_state), 15)
/obj/item/clothing/mask/facehugger/proc/clear_throw_icon_state()
if(icon_state == "[initial(icon_state)]_thrown")
icon_state = "[initial(icon_state)]"
/obj/item/clothing/mask/facehugger/throw_impact(atom/hit_atom)
..()
if(stat == CONSCIOUS)
icon_state = "[initial(icon_state)]"
Leap(hit_atom)
/obj/item/clothing/mask/facehugger/proc/valid_to_attach(mob/living/M)
// valid targets: carbons except aliens and devils
// facehugger state early exit checks
if(stat != CONSCIOUS)
return FALSE
if(attached)
return FALSE
if(iscarbon(M))
// disallowed carbons
if(isalien(M) || isdevil(M))
return FALSE
var/mob/living/carbon/target = M
// gotta have a head to be implanted (no changelings or sentient plants)
if(!target.get_bodypart(BODY_ZONE_HEAD))
return FALSE
if(target.getorgan(/obj/item/organ/alien/hivenode) || target.getorgan(/obj/item/organ/body_egg/alien_embryo))
return FALSE
// carbon, has head, not alien or devil, has no hivenode or embryo: valid
return TRUE
return FALSE
/obj/item/clothing/mask/facehugger/proc/Leap(mob/living/M)
if(!valid_to_attach(M))
return FALSE
if(iscarbon(M))
var/mob/living/carbon/target = M
if(target.wear_mask && istype(target.wear_mask, /obj/item/clothing/mask/facehugger))
return FALSE
// passed initial checks - time to leap!
M.visible_message("<span class='danger'>[src] leaps at [M]'s face!</span>", \
"<span class='userdanger'>[src] leaps at [M]'s face!</span>")
// probiscis-blocker handling
if(iscarbon(M))
var/mob/living/carbon/target = M
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.is_mouth_covered(head_only = 1))
H.visible_message("<span class='danger'>[src] smashes against [H]'s [H.head]!</span>", \
"<span class='userdanger'>[src] smashes against [H]'s [H.head]!</span>")
Die()
return FALSE
if(target.wear_mask)
var/obj/item/clothing/W = target.wear_mask
if(target.dropItemToGround(W))
target.visible_message("<span class='danger'>[src] tears [W] off of [target]'s face!</span>", \
"<span class='userdanger'>[src] tears [W] off of [target]'s face!</span>")
target.equip_to_slot_if_possible(src, SLOT_WEAR_MASK, 0, 1, 1)
return TRUE // time for a smoke
/obj/item/clothing/mask/facehugger/proc/Attach(mob/living/M)
if(!valid_to_attach(M))
return
// early returns and validity checks done: attach.
attached++
//ensure we detach once we no longer need to be attached
addtimer(CALLBACK(src, .proc/detach), MAX_IMPREGNATION_TIME)
if(!sterile)
M.take_bodypart_damage(strength,0) //done here so that humans in helmets take damage
M.Unconscious(MAX_IMPREGNATION_TIME/0.3) //something like 25 ticks = 20 seconds with the default settings
GoIdle() //so it doesn't jump the people that tear it off
addtimer(CALLBACK(src, .proc/Impregnate, M), rand(MIN_IMPREGNATION_TIME, MAX_IMPREGNATION_TIME))
/obj/item/clothing/mask/facehugger/proc/detach()
attached = 0
/obj/item/clothing/mask/facehugger/proc/Impregnate(mob/living/target)
if(!target || target.stat == DEAD) //was taken off or something
return
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.wear_mask != src)
return
if(!sterile)
target.visible_message("<span class='danger'>[src] falls limp after violating [target]'s face!</span>", \
"<span class='userdanger'>[src] falls limp after violating [target]'s face!</span>")
Die()
icon_state = "[initial(icon_state)]_impregnated"
var/obj/item/bodypart/chest/LC = target.get_bodypart(BODY_ZONE_CHEST)
if((!LC || LC.status != BODYPART_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
new /obj/item/organ/body_egg/alien_embryo(target)
else
target.visible_message("<span class='danger'>[src] violates [target]'s face!</span>", \
"<span class='userdanger'>[src] violates [target]'s face!</span>")
/obj/item/clothing/mask/facehugger/proc/GoActive()
if(stat == DEAD || stat == CONSCIOUS)
return
stat = CONSCIOUS
icon_state = "[initial(icon_state)]"
/obj/item/clothing/mask/facehugger/proc/GoIdle()
if(stat == DEAD || stat == UNCONSCIOUS)
return
stat = UNCONSCIOUS
icon_state = "[initial(icon_state)]_inactive"
addtimer(CALLBACK(src, .proc/GoActive), rand(MIN_ACTIVE_TIME, MAX_ACTIVE_TIME))
/obj/item/clothing/mask/facehugger/proc/Die()
if(stat == DEAD)
return
icon_state = "[initial(icon_state)]_dead"
item_state = "facehugger_inactive"
stat = DEAD
visible_message("<span class='danger'>[src] curls up into a ball!</span>")
/proc/CanHug(mob/living/M)
if(!istype(M))
return 0
if(M.stat == DEAD)
return 0
if(M.getorgan(/obj/item/organ/alien/hivenode))
return 0
if(ismonkey(M))
return 1
var/mob/living/carbon/C = M
if(ishuman(C) && !(SLOT_WEAR_MASK in C.dna.species.no_equip))
var/mob/living/carbon/human/H = C
if(H.is_mouth_covered(head_only = 1))
return 0
return 1
return 0
#undef MIN_ACTIVE_TIME
#undef MAX_ACTIVE_TIME
#undef MIN_IMPREGNATION_TIME
#undef MAX_IMPREGNATION_TIME
//TODO: Make these simple_animals
#define MIN_IMPREGNATION_TIME 100 //time it takes to impregnate someone
#define MAX_IMPREGNATION_TIME 150
#define MIN_ACTIVE_TIME 200 //time between being dropped and going idle
#define MAX_ACTIVE_TIME 400
/obj/item/clothing/mask/facehugger
name = "alien"
desc = "It has some sort of a tube at the end of its tail."
icon = 'icons/mob/alien.dmi'
icon_state = "facehugger"
item_state = "facehugger"
w_class = WEIGHT_CLASS_TINY //note: can be picked up by aliens unlike most other items of w_class below 4
clothing_flags = ALLOWINTERNALS
throw_range = 5
tint = 3
flags_cover = MASKCOVERSEYES | MASKCOVERSMOUTH
layer = MOB_LAYER
max_integrity = 100
mutantrace_variation = STYLE_MUZZLE
var/stat = CONSCIOUS //UNCONSCIOUS is the idle state in this case
var/sterile = FALSE
var/real = TRUE //0 for the toy, 1 for real. Sure I could istype, but fuck that.
var/strength = 5
var/attached = 0
/obj/item/clothing/mask/facehugger/lamarr
name = "Lamarr"
sterile = TRUE
/obj/item/clothing/mask/facehugger/dead
icon_state = "facehugger_dead"
item_state = "facehugger_inactive"
sterile = TRUE
stat = DEAD
/obj/item/clothing/mask/facehugger/impregnated
icon_state = "facehugger_impregnated"
item_state = "facehugger_impregnated"
sterile = TRUE
stat = DEAD
/obj/item/clothing/mask/facehugger/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
..()
if(obj_integrity < 90)
Die()
/obj/item/clothing/mask/facehugger/attackby(obj/item/O, mob/user, params)
return O.attack_obj(src, user)
/obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens
return attack_hand(user)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/mask/facehugger/attack_hand(mob/user)
if((stat == CONSCIOUS && !sterile) && !isalien(user))
if(Leap(user))
return
. = ..()
/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user)
..()
if(user.transferItemToLoc(src, get_turf(M)))
Leap(M)
/obj/item/clothing/mask/facehugger/examine(mob/user)
. = ..()
if(!real)//So that giant red text about probisci doesn't show up.
return
switch(stat)
if(DEAD,UNCONSCIOUS)
. += "<span class='boldannounce'>[src] is not moving.</span>"
if(CONSCIOUS)
. += "<span class='boldannounce'>[src] seems to be active!</span>"
if (sterile)
. += "<span class='boldannounce'>It looks like the proboscis has been removed.</span>"
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
Die()
/obj/item/clothing/mask/facehugger/equipped(mob/M)
Attach(M)
/obj/item/clothing/mask/facehugger/Crossed(atom/target)
HasProximity(target)
return
/obj/item/clothing/mask/facehugger/on_found(mob/finder)
if(stat == CONSCIOUS)
return HasProximity(finder)
return 0
/obj/item/clothing/mask/facehugger/HasProximity(atom/movable/AM as mob|obj)
if(CanHug(AM) && Adjacent(AM))
return Leap(AM)
return 0
/obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
if(stat == CONSCIOUS)
icon_state = "[initial(icon_state)]_thrown"
addtimer(CALLBACK(src, .proc/clear_throw_icon_state), 15)
/obj/item/clothing/mask/facehugger/proc/clear_throw_icon_state()
if(icon_state == "[initial(icon_state)]_thrown")
icon_state = "[initial(icon_state)]"
/obj/item/clothing/mask/facehugger/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..()
if(stat == CONSCIOUS)
icon_state = "[initial(icon_state)]"
Leap(hit_atom)
/obj/item/clothing/mask/facehugger/proc/valid_to_attach(mob/living/M)
// valid targets: carbons except aliens and devils
// facehugger state early exit checks
if(stat != CONSCIOUS)
return FALSE
if(attached)
return FALSE
if(iscarbon(M))
// disallowed carbons
if(isalien(M) || isdevil(M))
return FALSE
var/mob/living/carbon/target = M
// gotta have a head to be implanted (no changelings or sentient plants)
if(!target.get_bodypart(BODY_ZONE_HEAD))
return FALSE
if(target.getorgan(/obj/item/organ/alien/hivenode) || target.getorgan(/obj/item/organ/body_egg/alien_embryo))
return FALSE
// carbon, has head, not alien or devil, has no hivenode or embryo: valid
return TRUE
return FALSE
/obj/item/clothing/mask/facehugger/proc/Leap(mob/living/M)
if(!valid_to_attach(M))
return FALSE
if(iscarbon(M))
var/mob/living/carbon/target = M
if(target.wear_mask && istype(target.wear_mask, /obj/item/clothing/mask/facehugger))
return FALSE
// passed initial checks - time to leap!
M.visible_message("<span class='danger'>[src] leaps at [M]'s face!</span>", \
"<span class='userdanger'>[src] leaps at [M]'s face!</span>")
// probiscis-blocker handling
if(iscarbon(M))
var/mob/living/carbon/target = M
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.is_mouth_covered(head_only = 1))
H.visible_message("<span class='danger'>[src] smashes against [H]'s [H.head]!</span>", \
"<span class='userdanger'>[src] smashes against [H]'s [H.head]!</span>")
Die()
return FALSE
if(target.wear_mask)
var/obj/item/clothing/W = target.wear_mask
if(target.dropItemToGround(W))
target.visible_message("<span class='danger'>[src] tears [W] off of [target]'s face!</span>", \
"<span class='userdanger'>[src] tears [W] off of [target]'s face!</span>")
target.equip_to_slot_if_possible(src, SLOT_WEAR_MASK, 0, 1, 1)
return TRUE // time for a smoke
/obj/item/clothing/mask/facehugger/proc/Attach(mob/living/M)
if(!valid_to_attach(M))
return
// early returns and validity checks done: attach.
attached++
//ensure we detach once we no longer need to be attached
addtimer(CALLBACK(src, .proc/detach), MAX_IMPREGNATION_TIME)
if(!sterile)
M.take_bodypart_damage(strength,0) //done here so that humans in helmets take damage
M.Unconscious(MAX_IMPREGNATION_TIME/0.3) //something like 25 ticks = 20 seconds with the default settings
GoIdle() //so it doesn't jump the people that tear it off
addtimer(CALLBACK(src, .proc/Impregnate, M), rand(MIN_IMPREGNATION_TIME, MAX_IMPREGNATION_TIME))
/obj/item/clothing/mask/facehugger/proc/detach()
attached = 0
/obj/item/clothing/mask/facehugger/proc/Impregnate(mob/living/target)
if(!target || target.stat == DEAD) //was taken off or something
return
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.wear_mask != src)
return
if(!sterile)
target.visible_message("<span class='danger'>[src] falls limp after violating [target]'s face!</span>", \
"<span class='userdanger'>[src] falls limp after violating [target]'s face!</span>")
Die()
icon_state = "[initial(icon_state)]_impregnated"
var/obj/item/bodypart/chest/LC = target.get_bodypart(BODY_ZONE_CHEST)
if((!LC || LC.status != BODYPART_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
new /obj/item/organ/body_egg/alien_embryo(target)
else
target.visible_message("<span class='danger'>[src] violates [target]'s face!</span>", \
"<span class='userdanger'>[src] violates [target]'s face!</span>")
/obj/item/clothing/mask/facehugger/proc/GoActive()
if(stat == DEAD || stat == CONSCIOUS)
return
stat = CONSCIOUS
icon_state = "[initial(icon_state)]"
/obj/item/clothing/mask/facehugger/proc/GoIdle()
if(stat == DEAD || stat == UNCONSCIOUS)
return
stat = UNCONSCIOUS
icon_state = "[initial(icon_state)]_inactive"
addtimer(CALLBACK(src, .proc/GoActive), rand(MIN_ACTIVE_TIME, MAX_ACTIVE_TIME))
/obj/item/clothing/mask/facehugger/proc/Die()
if(stat == DEAD)
return
icon_state = "[initial(icon_state)]_dead"
item_state = "facehugger_inactive"
stat = DEAD
visible_message("<span class='danger'>[src] curls up into a ball!</span>")
/proc/CanHug(mob/living/M)
if(!istype(M))
return 0
if(M.stat == DEAD)
return 0
if(M.getorgan(/obj/item/organ/alien/hivenode))
return 0
if(ismonkey(M))
return 1
var/mob/living/carbon/C = M
if(ishuman(C) && !(SLOT_WEAR_MASK in C.dna.species.no_equip))
var/mob/living/carbon/human/H = C
if(H.is_mouth_covered(head_only = 1))
return 0
return 1
return 0
#undef MIN_ACTIVE_TIME
#undef MAX_ACTIVE_TIME
#undef MIN_IMPREGNATION_TIME
#undef MAX_IMPREGNATION_TIME
File diff suppressed because it is too large Load Diff
+456 -456
View File
@@ -1,456 +1,456 @@
/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("<span class='warning'>[src] catches [I]!</span>") //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("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
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("<span class='danger'>The [M.name] has shocked [src]!</span>", \
"<span class='userdanger'>The [M.name] has shocked [src]!</span>")
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("<span class='userdanger'>The blob attacks!</span>")
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(
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
"<span class='italics'>You hear a heavy electrical crack.</span>" \
)
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, "<span class='warning'>You can't put [p_them()] out with just your bare hands!</span>")
return
if(health >= 0 && !(HAS_TRAIT(src, TRAIT_FAKEDEATH)))
if(lying)
if(buckled)
to_chat(M, "<span class='warning'>You need to unbuckle [src] first to do that!")
return
M.visible_message("<span class='notice'>[M] shakes [src] trying to get [p_them()] up!</span>", \
"<span class='notice'>You shake [src] trying to get [p_them()] up!</span>")
else if(check_zone(M.zone_selected) == "mouth") // I ADDED BOOP-EH-DEH-NOSEH - Jon
M.visible_message( \
"<span class='notice'>[M] boops [src]'s nose.</span>", \
"<span class='notice'>You boop [src] on the nose.</span>", )
playsound(src, 'sound/items/Nose_boop.ogg', 50, 0)
else if(check_zone(M.zone_selected) == "head")
var/mob/living/carbon/human/H = src
var/datum/species/pref_species = H.dna.species
M.visible_message("<span class='notice'>[M] gives [H] a pat on the head to make [p_them()] feel better!</span>", \
"<span class='notice'>You give [H] a pat on the head to make [p_them()] feel better!</span>")
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) == "r_arm" || check_zone(M.zone_selected) == "l_arm")
M.visible_message( \
"<span class='notice'>[M] shakes [src]'s hand.</span>", \
"<span class='notice'>You shake [src]'s hand.</span>", )
else
M.visible_message("<span class='notice'>[M] hugs [src] to make [p_them()] feel better!</span>", \
"<span class='notice'>You hug [src] to make [p_them()] feel better!</span>")
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, "<span class='warning'>Your eyes sting a little.</span>")
if(prob(40))
eyes.applyOrganDamage(1)
else if (damage == 2)
to_chat(src, "<span class='warning'>Your eyes burn.</span>")
eyes.applyOrganDamage(rand(2, 4))
else if( damage >= 3)
to_chat(src, "<span class='warning'>Your eyes itch and burn severely!</span>")
eyes.applyOrganDamage(rand(12, 16))
if(eyes.damage > 10)
blind_eyes(damage)
blur_eyes(damage * rand(3, 6))
if(eyes.damage > 20)
if(prob(eyes.damage - 20))
if(!HAS_TRAIT(src, TRAIT_NEARSIGHT))
to_chat(src, "<span class='warning'>Your eyes start to burn badly!</span>")
become_nearsighted(EYE_DAMAGE)
else if(prob(eyes.damage - 25))
if(!HAS_TRAIT(src, TRAIT_BLIND))
to_chat(src, "<span class='warning'>You can't see anything!</span>")
eyes.applyOrganDamage(eyes.maxHealth)
else
to_chat(src, "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>")
if(has_bane(BANE_LIGHT))
mind.disrupt_spells(-500)
return 1
else if(damage == 0) // just enough protection
if(prob(20))
to_chat(src, "<span class='notice'>Something bright flashes in the corner of your vision!</span>")
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, "<span class='warning'>Your ears start to ring badly!</span>")
if(prob(ears.damage - 5))
to_chat(src, "<span class='userdanger'>You can't hear anything!</span>")
ears.damage = min(ears.damage, ears.maxHealth)
// you need earmuffs, inacusiate, or replacement
else if(ears.damage >= 5)
to_chat(src, "<span class='warning'>Your ears start to ring!</span>")
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("<span class='warning'>[src] catches [I]!</span>") //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("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
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("<span class='danger'>The [M.name] has shocked [src]!</span>", \
"<span class='userdanger'>The [M.name] has shocked [src]!</span>")
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("<span class='userdanger'>The blob attacks!</span>")
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(
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
"<span class='italics'>You hear a heavy electrical crack.</span>" \
)
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, "<span class='warning'>You can't put [p_them()] out with just your bare hands!</span>")
return
if(health >= 0 && !(HAS_TRAIT(src, TRAIT_FAKEDEATH)))
if(lying)
if(buckled)
to_chat(M, "<span class='warning'>You need to unbuckle [src] first to do that!")
return
M.visible_message("<span class='notice'>[M] shakes [src] trying to get [p_them()] up!</span>", \
"<span class='notice'>You shake [src] trying to get [p_them()] up!</span>")
else if(check_zone(M.zone_selected) == "mouth") // I ADDED BOOP-EH-DEH-NOSEH - Jon
M.visible_message( \
"<span class='notice'>[M] boops [src]'s nose.</span>", \
"<span class='notice'>You boop [src] on the nose.</span>", )
playsound(src, 'sound/items/Nose_boop.ogg', 50, 0)
else if(check_zone(M.zone_selected) == "head")
var/mob/living/carbon/human/H = src
var/datum/species/pref_species = H.dna.species
M.visible_message("<span class='notice'>[M] gives [H] a pat on the head to make [p_them()] feel better!</span>", \
"<span class='notice'>You give [H] a pat on the head to make [p_them()] feel better!</span>")
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) == "r_arm" || check_zone(M.zone_selected) == "l_arm")
M.visible_message( \
"<span class='notice'>[M] shakes [src]'s hand.</span>", \
"<span class='notice'>You shake [src]'s hand.</span>", )
else
M.visible_message("<span class='notice'>[M] hugs [src] to make [p_them()] feel better!</span>", \
"<span class='notice'>You hug [src] to make [p_them()] feel better!</span>")
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, "<span class='warning'>Your eyes sting a little.</span>")
if(prob(40))
eyes.applyOrganDamage(1)
else if (damage == 2)
to_chat(src, "<span class='warning'>Your eyes burn.</span>")
eyes.applyOrganDamage(rand(2, 4))
else if( damage >= 3)
to_chat(src, "<span class='warning'>Your eyes itch and burn severely!</span>")
eyes.applyOrganDamage(rand(12, 16))
if(eyes.damage > 10)
blind_eyes(damage)
blur_eyes(damage * rand(3, 6))
if(eyes.damage > 20)
if(prob(eyes.damage - 20))
if(!HAS_TRAIT(src, TRAIT_NEARSIGHT))
to_chat(src, "<span class='warning'>Your eyes start to burn badly!</span>")
become_nearsighted(EYE_DAMAGE)
else if(prob(eyes.damage - 25))
if(!HAS_TRAIT(src, TRAIT_BLIND))
to_chat(src, "<span class='warning'>You can't see anything!</span>")
eyes.applyOrganDamage(eyes.maxHealth)
else
to_chat(src, "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>")
if(has_bane(BANE_LIGHT))
mind.disrupt_spells(-500)
return 1
else if(damage == 0) // just enough protection
if(prob(20))
to_chat(src, "<span class='notice'>Something bright flashes in the corner of your vision!</span>")
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, "<span class='warning'>Your ears start to ring badly!</span>")
if(prob(ears.damage - 5))
to_chat(src, "<span class='userdanger'>You can't hear anything!</span>")
ears.damage = min(ears.damage, ears.maxHealth)
// you need earmuffs, inacusiate, or replacement
else if(ears.damage >= 5)
to_chat(src, "<span class='warning'>Your ears start to ring!</span>")
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
@@ -1,66 +1,66 @@
/mob/living/carbon
gender = MALE
pressure_resistance = 15
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,RAD_HUD)
has_limbs = 1
held_items = list(null, null)
var/list/stomach_contents = list()
var/list/internal_organs = list() //List of /obj/item/organ in the mob. They don't go in the contents for some reason I don't want to know.
var/list/internal_organs_slot= list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
var/silent = FALSE //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
var/dreaming = 0 //How many dream images we have left to send
var/obj/item/restraints/handcuffed //Whether or not the mob is handcuffed
var/obj/item/restraints/legcuffed //Same as handcuffs but for legs. Bear traps use this.
var/disgust = 0
//inventory slots
var/obj/item/back = null
var/obj/item/clothing/mask/wear_mask = null
var/obj/item/clothing/neck/wear_neck = null
var/obj/item/tank/internal = null
var/obj/item/head = null
var/obj/item/gloves = null //only used by humans
var/obj/item/shoes = null //only used by humans.
var/obj/item/clothing/glasses/glasses = null //only used by humans.
var/obj/item/ears = null //only used by humans.
var/datum/dna/dna = null//Carbon
var/datum/mind/last_mind = null //last mind to control this mob, for blood-based cloning
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/co2overloadtime = null
var/o2overloadtime = null //for Ash walker's weaker lungs, and future atmosia hazards
var/temperature_resistance = T0C+75
var/obj/item/reagent_containers/food/snacks/meat/slab/type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab
var/gib_type = /obj/effect/decal/cleanable/blood/gibs
rotate_on_lying = TRUE
var/tinttotal = 0 // Total level of visualy impairing items
var/list/bodyparts = list(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm,
/obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
//Gets filled up in create_bodyparts()
var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
var/list/leg_bodyparts = list()
var/icon_render_key = ""
var/static/list/limb_icon_cache = list()
//halucination vars
var/image/halimage
var/image/halbody
var/obj/halitem
var/hal_screwyhud = SCREWYHUD_NONE
var/next_hallucination = 0
var/cpr_time = 1 //CPR cooldown.
var/damageoverlaytemp = 0
var/drunkenness = 0 //Overall drunkenness - check handle_alcohol() in life.dm for effects
/mob/living/carbon
gender = MALE
pressure_resistance = 15
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,RAD_HUD)
has_limbs = 1
held_items = list(null, null)
var/list/stomach_contents = list()
var/list/internal_organs = list() //List of /obj/item/organ in the mob. They don't go in the contents for some reason I don't want to know.
var/list/internal_organs_slot= list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
var/silent = FALSE //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
var/dreaming = 0 //How many dream images we have left to send
var/obj/item/restraints/handcuffed //Whether or not the mob is handcuffed
var/obj/item/restraints/legcuffed //Same as handcuffs but for legs. Bear traps use this.
var/disgust = 0
//inventory slots
var/obj/item/back = null
var/obj/item/clothing/mask/wear_mask = null
var/obj/item/clothing/neck/wear_neck = null
var/obj/item/tank/internal = null
var/obj/item/head = null
var/obj/item/gloves = null //only used by humans
var/obj/item/shoes = null //only used by humans.
var/obj/item/clothing/glasses/glasses = null //only used by humans.
var/obj/item/ears = null //only used by humans.
var/datum/dna/dna = null//Carbon
var/datum/mind/last_mind = null //last mind to control this mob, for blood-based cloning
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/co2overloadtime = null
var/o2overloadtime = null //for Ash walker's weaker lungs, and future atmosia hazards
var/temperature_resistance = T0C+75
var/obj/item/reagent_containers/food/snacks/meat/slab/type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab
var/gib_type = /obj/effect/decal/cleanable/blood/gibs
rotate_on_lying = TRUE
var/tinttotal = 0 // Total level of visualy impairing items
var/list/bodyparts = list(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm,
/obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
//Gets filled up in create_bodyparts()
var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
var/list/leg_bodyparts = list()
var/icon_render_key = ""
var/static/list/limb_icon_cache = list()
//halucination vars
var/image/halimage
var/image/halbody
var/obj/halitem
var/hal_screwyhud = SCREWYHUD_NONE
var/next_hallucination = 0
var/cpr_time = 1 //CPR cooldown.
var/damageoverlaytemp = 0
var/drunkenness = 0 //Overall drunkenness - check handle_alcohol() in life.dm for effects
@@ -41,9 +41,6 @@
update_damage_overlays()
else
adjustStaminaLoss(damage_amount, forced = forced)
//citadel code
if(AROUSAL)
adjustArousalLoss(damage_amount)
return TRUE
+72 -72
View File
@@ -1,72 +1,72 @@
/mob/living/carbon/death(gibbed)
if(stat == DEAD)
return
silent = FALSE
losebreath = 0
if(!gibbed)
emote("deathgasp")
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
. = ..()
for(var/T in get_traumas())
var/datum/brain_trauma/BT = T
BT.on_death()
if(SSticker.mode)
SSticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now
/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts)
var/atom/Tsec = drop_location()
for(var/mob/M in src)
if(M in stomach_contents)
stomach_contents.Remove(M)
M.forceMove(Tsec)
visible_message("<span class='danger'>[M] bursts out of [src]!</span>")
..()
/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
var/atom/Tsec = drop_location()
if(!no_bodyparts)
if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop.
for(var/X in internal_organs)
if(no_brain || !istype(X, /obj/item/organ/brain))
qdel(X)
else //we're going to drop all bodyparts except chest, so the only organs that needs spilling are those inside it.
for(var/X in internal_organs)
var/obj/item/organ/O = X
if(no_brain && istype(O, /obj/item/organ/brain))
qdel(O) //so the brain isn't transfered to the head when the head drops.
continue
var/org_zone = check_zone(O.zone) //both groin and chest organs.
if(org_zone == BODY_ZONE_CHEST)
O.Remove(src)
O.forceMove(Tsec)
O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
else
for(var/X in internal_organs)
var/obj/item/organ/I = X
if(no_brain && istype(I, /obj/item/organ/brain))
qdel(I)
continue
if(no_organs && !istype(I, /obj/item/organ/brain))
qdel(I)
continue
I.Remove(src)
I.forceMove(Tsec)
I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
/mob/living/carbon/spread_bodyparts()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
BP.drop_limb()
BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
/mob/living/carbon/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
return ..()
/mob/living/carbon/death(gibbed)
if(stat == DEAD)
return
silent = FALSE
losebreath = 0
if(!gibbed)
emote("deathgasp")
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
. = ..()
for(var/T in get_traumas())
var/datum/brain_trauma/BT = T
BT.on_death()
if(SSticker.mode)
SSticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now
/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts)
var/atom/Tsec = drop_location()
for(var/mob/M in src)
if(M in stomach_contents)
stomach_contents.Remove(M)
M.forceMove(Tsec)
visible_message("<span class='danger'>[M] bursts out of [src]!</span>")
..()
/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
var/atom/Tsec = drop_location()
if(!no_bodyparts)
if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop.
for(var/X in internal_organs)
if(no_brain || !istype(X, /obj/item/organ/brain))
qdel(X)
else //we're going to drop all bodyparts except chest, so the only organs that needs spilling are those inside it.
for(var/X in internal_organs)
var/obj/item/organ/O = X
if(no_brain && istype(O, /obj/item/organ/brain))
qdel(O) //so the brain isn't transfered to the head when the head drops.
continue
var/org_zone = check_zone(O.zone) //both groin and chest organs.
if(org_zone == BODY_ZONE_CHEST)
O.Remove(src)
O.forceMove(Tsec)
O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
else
for(var/X in internal_organs)
var/obj/item/organ/I = X
if(no_brain && istype(I, /obj/item/organ/brain))
qdel(I)
continue
if(no_organs && !istype(I, /obj/item/organ/brain))
qdel(I)
continue
I.Remove(src)
I.forceMove(Tsec)
I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
/mob/living/carbon/spread_bodyparts()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
BP.drop_limb()
BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
/mob/living/carbon/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
return ..()
+100 -100
View File
@@ -1,100 +1,100 @@
/datum/emote/living/carbon
mob_type_allowed_typecache = list(/mob/living/carbon)
/datum/emote/living/carbon/airguitar
key = "airguitar"
message = "is strumming the air and headbanging like a safari chimp."
restraint_check = TRUE
/datum/emote/living/carbon/blink
key = "blink"
key_third_person = "blinks"
message = "blinks."
/datum/emote/living/carbon/blink_r
key = "blink_r"
message = "blinks rapidly."
/datum/emote/living/carbon/clap
key = "clap"
key_third_person = "claps"
message = "claps."
muzzle_ignore = TRUE
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
mob_type_allowed_typecache = list(/mob/living/carbon, /mob/living/silicon/pai)
/datum/emote/living/carbon/clap/run_emote(mob/living/user, params)
. = ..()
if (.)
if (ishuman(user))
// Need hands to clap
if (!user.get_bodypart(BODY_ZONE_L_ARM) || !user.get_bodypart(BODY_ZONE_R_ARM))
return
var/clap = pick('sound/misc/clap1.ogg',
'sound/misc/clap2.ogg',
'sound/misc/clap3.ogg',
'sound/misc/clap4.ogg')
playsound(user, clap, 50, 1, -1)
/datum/emote/living/carbon/gnarl
key = "gnarl"
key_third_person = "gnarls"
message = "gnarls and shows its teeth..."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
/datum/emote/living/carbon/moan
key = "moan"
key_third_person = "moans"
message = "moans!"
message_mime = "appears to moan!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/roll
key = "roll"
key_third_person = "rolls"
message = "rolls."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
restraint_check = TRUE
/datum/emote/living/carbon/scratch
key = "scratch"
key_third_person = "scratches"
message = "scratches."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
restraint_check = TRUE
/datum/emote/living/carbon/screech
key = "screech"
key_third_person = "screeches"
message = "screeches."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
/datum/emote/living/carbon/sign
key = "sign"
key_third_person = "signs"
message_param = "signs the number %t."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
restraint_check = TRUE
/datum/emote/living/carbon/sign/select_param(mob/user, params)
. = ..()
if(!isnum(text2num(params)))
return message
/datum/emote/living/carbon/sign/signal
key = "signal"
key_third_person = "signals"
message_param = "raises %t fingers."
mob_type_allowed_typecache = list(/mob/living/carbon/human)
restraint_check = TRUE
/datum/emote/living/carbon/tail
key = "tail"
message = "waves their tail."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
/datum/emote/living/carbon/wink
key = "wink"
key_third_person = "winks"
message = "winks."
/datum/emote/living/carbon
mob_type_allowed_typecache = list(/mob/living/carbon)
/datum/emote/living/carbon/airguitar
key = "airguitar"
message = "is strumming the air and headbanging like a safari chimp."
restraint_check = TRUE
/datum/emote/living/carbon/blink
key = "blink"
key_third_person = "blinks"
message = "blinks."
/datum/emote/living/carbon/blink_r
key = "blink_r"
message = "blinks rapidly."
/datum/emote/living/carbon/clap
key = "clap"
key_third_person = "claps"
message = "claps."
muzzle_ignore = TRUE
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
mob_type_allowed_typecache = list(/mob/living/carbon, /mob/living/silicon/pai)
/datum/emote/living/carbon/clap/run_emote(mob/living/user, params)
. = ..()
if (.)
if (ishuman(user))
// Need hands to clap
if (!user.get_bodypart(BODY_ZONE_L_ARM) || !user.get_bodypart(BODY_ZONE_R_ARM))
return
var/clap = pick('sound/misc/clap1.ogg',
'sound/misc/clap2.ogg',
'sound/misc/clap3.ogg',
'sound/misc/clap4.ogg')
playsound(user, clap, 50, 1, -1)
/datum/emote/living/carbon/gnarl
key = "gnarl"
key_third_person = "gnarls"
message = "gnarls and shows its teeth..."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
/datum/emote/living/carbon/moan
key = "moan"
key_third_person = "moans"
message = "moans!"
message_mime = "appears to moan!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/roll
key = "roll"
key_third_person = "rolls"
message = "rolls."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
restraint_check = TRUE
/datum/emote/living/carbon/scratch
key = "scratch"
key_third_person = "scratches"
message = "scratches."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
restraint_check = TRUE
/datum/emote/living/carbon/screech
key = "screech"
key_third_person = "screeches"
message = "screeches."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
/datum/emote/living/carbon/sign
key = "sign"
key_third_person = "signs"
message_param = "signs the number %t."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
restraint_check = TRUE
/datum/emote/living/carbon/sign/select_param(mob/user, params)
. = ..()
if(!isnum(text2num(params)))
return message
/datum/emote/living/carbon/sign/signal
key = "signal"
key_third_person = "signals"
message_param = "raises %t fingers."
mob_type_allowed_typecache = list(/mob/living/carbon/human)
restraint_check = TRUE
/datum/emote/living/carbon/tail
key = "tail"
message = "waves their tail."
mob_type_allowed_typecache = list(/mob/living/carbon/monkey, /mob/living/carbon/alien)
/datum/emote/living/carbon/wink
key = "wink"
key_third_person = "winks"
message = "winks."
+68 -68
View File
@@ -1,69 +1,69 @@
/mob/living/carbon/human/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-h")
/mob/living/carbon/human/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-h")
/mob/living/carbon/human/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(dna?.species?.gib_types)
var/datum/species/S = dna.species
var/length = length(S.gib_types)
if(length)
var/path = (with_bodyparts && length > 1) ? S.gib_types[2] : S.gib_types[1]
new path(location, src, get_static_viruses())
else
new S.gib_types(location, src, get_static_viruses())
else
if(with_bodyparts)
new /obj/effect/gibspawner/human(location, src, get_static_viruses())
else
new /obj/effect/gibspawner/human/bodypartless(location, src, get_static_viruses())
/mob/living/carbon/human/spawn_dust(just_ash = FALSE)
if(just_ash)
new /obj/effect/decal/cleanable/ash(loc)
else
new /obj/effect/decal/remains/human(loc)
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD)
return
stop_sound_channel(CHANNEL_HEARTBEAT)
var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART)
if(H)
H.beat = BEAT_NONE
. = ..()
dizziness = 0
jitteriness = 0
if(ismecha(loc))
var/obj/mecha/M = loc
if(M.occupant == src)
M.go_out()
dna.species.spec_death(gibbed, src)
if(SSticker.HasRoundStarted())
SSblackbox.ReportDeath(src)
if(is_devil(src))
INVOKE_ASYNC(is_devil(src), /datum/antagonist/devil.proc/beginResurrectionCheck, src)
/mob/living/carbon/human/proc/makeSkeleton()
ADD_TRAIT(src, TRAIT_DISFIGURED, TRAIT_GENERIC)
set_species(/datum/species/skeleton)
return TRUE
/mob/living/carbon/proc/Drain()
become_husk(CHANGELING_DRAIN)
ADD_TRAIT(src, TRAIT_NOCLONE, CHANGELING_DRAIN)
blood_volume = 0
return TRUE
/mob/living/carbon/proc/makeUncloneable()
ADD_TRAIT(src, TRAIT_NOCLONE, MADE_UNCLONEABLE)
blood_volume = 0
/mob/living/carbon/human/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-h")
/mob/living/carbon/human/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-h")
/mob/living/carbon/human/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(dna?.species?.gib_types)
var/datum/species/S = dna.species
var/length = length(S.gib_types)
if(length)
var/path = (with_bodyparts && length > 1) ? S.gib_types[2] : S.gib_types[1]
new path(location, src, get_static_viruses())
else
new S.gib_types(location, src, get_static_viruses())
else
if(with_bodyparts)
new /obj/effect/gibspawner/human(location, src, get_static_viruses())
else
new /obj/effect/gibspawner/human/bodypartless(location, src, get_static_viruses())
/mob/living/carbon/human/spawn_dust(just_ash = FALSE)
if(just_ash)
new /obj/effect/decal/cleanable/ash(loc)
else
new /obj/effect/decal/remains/human(loc)
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD)
return
stop_sound_channel(CHANNEL_HEARTBEAT)
var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART)
if(H)
H.beat = BEAT_NONE
. = ..()
dizziness = 0
jitteriness = 0
if(ismecha(loc))
var/obj/mecha/M = loc
if(M.occupant == src)
M.go_out()
dna.species.spec_death(gibbed, src)
if(SSticker.HasRoundStarted())
SSblackbox.ReportDeath(src)
if(is_devil(src))
INVOKE_ASYNC(is_devil(src), /datum/antagonist/devil.proc/beginResurrectionCheck, src)
/mob/living/carbon/human/proc/makeSkeleton()
ADD_TRAIT(src, TRAIT_DISFIGURED, TRAIT_GENERIC)
set_species(/datum/species/skeleton)
return TRUE
/mob/living/carbon/proc/Drain()
become_husk(CHANGELING_DRAIN)
ADD_TRAIT(src, TRAIT_NOCLONE, CHANGELING_DRAIN)
blood_volume = 0
return TRUE
/mob/living/carbon/proc/makeUncloneable()
ADD_TRAIT(src, TRAIT_NOCLONE, MADE_UNCLONEABLE)
blood_volume = 0
return TRUE
+48 -48
View File
@@ -1,48 +1,48 @@
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
status_flags = GODMODE|CANPUSH
mouse_drag_pointer = MOUSE_INACTIVE_POINTER
var/in_use = FALSE
no_vore = TRUE
INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
/mob/living/carbon/human/dummy/Destroy()
in_use = FALSE
return ..()
/mob/living/carbon/human/dummy/Life()
return
/mob/living/carbon/human/dummy/proc/wipe_state()
delete_equipment()
icon_render_key = null
cut_overlays(TRUE)
//Inefficient pooling/caching way.
GLOBAL_LIST_EMPTY(human_dummy_list)
GLOBAL_LIST_EMPTY(dummy_mob_list)
/proc/generate_or_wait_for_human_dummy(slotkey)
if(!slotkey)
return new /mob/living/carbon/human/dummy
var/mob/living/carbon/human/dummy/D = GLOB.human_dummy_list[slotkey]
if(istype(D))
UNTIL(!D.in_use)
else
pass()
if(QDELETED(D))
D = new
GLOB.human_dummy_list[slotkey] = D
GLOB.dummy_mob_list += D
D.in_use = TRUE
return D
/proc/unset_busy_human_dummy(slotnumber)
if(!slotnumber)
return
var/mob/living/carbon/human/dummy/D = GLOB.human_dummy_list[slotnumber]
if(istype(D))
D.wipe_state()
D.in_use = FALSE
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
status_flags = GODMODE|CANPUSH
mouse_drag_pointer = MOUSE_INACTIVE_POINTER
var/in_use = FALSE
no_vore = TRUE
INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
/mob/living/carbon/human/dummy/Destroy()
in_use = FALSE
return ..()
/mob/living/carbon/human/dummy/Life()
return
/mob/living/carbon/human/dummy/proc/wipe_state()
delete_equipment()
icon_render_key = null
cut_overlays(TRUE)
//Inefficient pooling/caching way.
GLOBAL_LIST_EMPTY(human_dummy_list)
GLOBAL_LIST_EMPTY(dummy_mob_list)
/proc/generate_or_wait_for_human_dummy(slotkey)
if(!slotkey)
return new /mob/living/carbon/human/dummy
var/mob/living/carbon/human/dummy/D = GLOB.human_dummy_list[slotkey]
if(istype(D))
UNTIL(!D.in_use)
else
pass()
if(QDELETED(D))
D = new
GLOB.human_dummy_list[slotkey] = D
GLOB.dummy_mob_list += D
D.in_use = TRUE
return D
/proc/unset_busy_human_dummy(slotnumber)
if(!slotnumber)
return
var/mob/living/carbon/human/dummy/D = GLOB.human_dummy_list[slotnumber]
if(istype(D))
D.wipe_state()
D.in_use = FALSE
+189 -189
View File
@@ -1,189 +1,189 @@
/datum/emote/living/carbon/human
mob_type_allowed_typecache = list(/mob/living/carbon/human)
/datum/emote/living/carbon/human/cry
key = "cry"
key_third_person = "cries"
message = "cries."
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/dap
key = "dap"
key_third_person = "daps"
message = "sadly can't find anybody to give daps to, and daps themself. Shameful."
message_param = "give daps to %t."
restraint_check = TRUE
/datum/emote/living/carbon/human/eyebrow
key = "eyebrow"
message = "raises an eyebrow."
/datum/emote/living/carbon/human/grumble
key = "grumble"
key_third_person = "grumbles"
message = "grumbles!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/handshake
key = "handshake"
message = "shakes their own hands."
message_param = "shakes hands with %t."
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/hug
key = "hug"
key_third_person = "hugs"
message = "hugs themself."
message_param = "hugs %t."
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/mawp
key = "mawp"
key_third_person = "mawps"
message = "mawps annoyingly."
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/mawp/run_emote(mob/living/user, params)
. = ..()
if(.)
if(ishuman(user))
if(prob(10))
user.adjustEarDamage(-5, -5)
/datum/emote/living/carbon/human/mumble
key = "mumble"
key_third_person = "mumbles"
message = "mumbles!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/pale
key = "pale"
message = "goes pale for a second."
/datum/emote/living/carbon/human/raise
key = "raise"
key_third_person = "raises"
message = "raises a hand."
restraint_check = TRUE
/datum/emote/living/carbon/human/salute
key = "salute"
key_third_person = "salutes"
message = "salutes."
message_param = "salutes to %t."
restraint_check = TRUE
/datum/emote/living/carbon/human/shrug
key = "shrug"
key_third_person = "shrugs"
message = "shrugs."
/datum/emote/living/carbon/human/wag
key = "wag"
key_third_person = "wags"
message = "wags their tail."
/datum/emote/living/carbon/human/wag/run_emote(mob/user, params)
. = ..()
if(!.)
return
var/mob/living/carbon/human/H = user
if(!istype(H) || !H.dna || !H.dna.species || !H.dna.species.can_wag_tail(H))
return
if(!H.dna.species.is_wagging_tail())
H.dna.species.start_wagging_tail(H)
else
H.dna.species.stop_wagging_tail(H)
/datum/emote/living/carbon/human/wag/can_run_emote(mob/user, status_check = TRUE)
if(!..())
return FALSE
var/mob/living/carbon/human/H = user
return H.dna && H.dna.species && H.dna.species.can_wag_tail(user)
/datum/emote/living/carbon/human/wag/select_message_type(mob/user)
. = ..()
var/mob/living/carbon/human/H = user
if(!H.dna || !H.dna.species)
return
if(H.dna.species.is_wagging_tail())
. = null
/datum/emote/living/carbon/human/wing
key = "wing"
key_third_person = "wings"
message = "their wings."
/datum/emote/living/carbon/human/wing/run_emote(mob/user, params)
. = ..()
if(.)
var/mob/living/carbon/human/H = user
if(findtext(select_message_type(user), "open"))
H.OpenWings()
else
H.CloseWings()
/datum/emote/living/carbon/human/wing/select_message_type(mob/user)
. = ..()
var/mob/living/carbon/human/H = user
if("wings" in H.dna.species.mutant_bodyparts)
. = "opens " + message
else
. = "closes " + message
/datum/emote/living/carbon/human/wing/can_run_emote(mob/user, status_check = TRUE)
if(!..())
return FALSE
var/mob/living/carbon/human/H = user
if(H.dna && H.dna.species && (H.dna.features["wings"] != "None"))
return TRUE
/mob/living/carbon/human/proc/OpenWings()
if(!dna || !dna.species)
return
if("wings" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wings"
dna.species.mutant_bodyparts |= "wingsopen"
update_body()
/mob/living/carbon/human/proc/CloseWings()
if(!dna || !dna.species)
return
if("wingsopen" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wingsopen"
dna.species.mutant_bodyparts |= "wings"
update_body()
if(isturf(loc))
var/turf/T = loc
T.Entered(src)
/datum/emote/sound/human
mob_type_allowed_typecache = list(/mob/living/carbon/human)
emote_type = EMOTE_AUDIBLE
/datum/emote/sound/human/buzz
key = "buzz"
key_third_person = "buzzes"
message = "buzzes."
message_param = "buzzes at %t."
sound = 'sound/machines/buzz-sigh.ogg'
/datum/emote/sound/human/buzz2
key = "buzz2"
message = "buzzes twice."
sound = 'sound/machines/buzz-two.ogg'
/datum/emote/sound/human/ping
key = "ping"
key_third_person = "pings"
message = "pings."
message_param = "pings at %t."
sound = 'sound/machines/ping.ogg'
/datum/emote/sound/human/chime
key = "chime"
key_third_person = "chimes"
message = "chimes."
sound = 'sound/machines/chime.ogg'
/datum/emote/living/carbon/human
mob_type_allowed_typecache = list(/mob/living/carbon/human)
/datum/emote/living/carbon/human/cry
key = "cry"
key_third_person = "cries"
message = "cries."
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/dap
key = "dap"
key_third_person = "daps"
message = "sadly can't find anybody to give daps to, and daps themself. Shameful."
message_param = "give daps to %t."
restraint_check = TRUE
/datum/emote/living/carbon/human/eyebrow
key = "eyebrow"
message = "raises an eyebrow."
/datum/emote/living/carbon/human/grumble
key = "grumble"
key_third_person = "grumbles"
message = "grumbles!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/handshake
key = "handshake"
message = "shakes their own hands."
message_param = "shakes hands with %t."
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/hug
key = "hug"
key_third_person = "hugs"
message = "hugs themself."
message_param = "hugs %t."
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/mawp
key = "mawp"
key_third_person = "mawps"
message = "mawps annoyingly."
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/mawp/run_emote(mob/living/user, params)
. = ..()
if(.)
if(ishuman(user))
if(prob(10))
user.adjustEarDamage(-5, -5)
/datum/emote/living/carbon/human/mumble
key = "mumble"
key_third_person = "mumbles"
message = "mumbles!"
emote_type = EMOTE_AUDIBLE
/datum/emote/living/carbon/human/pale
key = "pale"
message = "goes pale for a second."
/datum/emote/living/carbon/human/raise
key = "raise"
key_third_person = "raises"
message = "raises a hand."
restraint_check = TRUE
/datum/emote/living/carbon/human/salute
key = "salute"
key_third_person = "salutes"
message = "salutes."
message_param = "salutes to %t."
restraint_check = TRUE
/datum/emote/living/carbon/human/shrug
key = "shrug"
key_third_person = "shrugs"
message = "shrugs."
/datum/emote/living/carbon/human/wag
key = "wag"
key_third_person = "wags"
message = "wags their tail."
/datum/emote/living/carbon/human/wag/run_emote(mob/user, params)
. = ..()
if(!.)
return
var/mob/living/carbon/human/H = user
if(!istype(H) || !H.dna || !H.dna.species || !H.dna.species.can_wag_tail(H))
return
if(!H.dna.species.is_wagging_tail())
H.dna.species.start_wagging_tail(H)
else
H.dna.species.stop_wagging_tail(H)
/datum/emote/living/carbon/human/wag/can_run_emote(mob/user, status_check = TRUE)
if(!..())
return FALSE
var/mob/living/carbon/human/H = user
return H.dna && H.dna.species && H.dna.species.can_wag_tail(user)
/datum/emote/living/carbon/human/wag/select_message_type(mob/user)
. = ..()
var/mob/living/carbon/human/H = user
if(!H.dna || !H.dna.species)
return
if(H.dna.species.is_wagging_tail())
. = null
/datum/emote/living/carbon/human/wing
key = "wing"
key_third_person = "wings"
message = "their wings."
/datum/emote/living/carbon/human/wing/run_emote(mob/user, params)
. = ..()
if(.)
var/mob/living/carbon/human/H = user
if(findtext(select_message_type(user), "open"))
H.OpenWings()
else
H.CloseWings()
/datum/emote/living/carbon/human/wing/select_message_type(mob/user)
. = ..()
var/mob/living/carbon/human/H = user
if("wings" in H.dna.species.mutant_bodyparts)
. = "opens " + message
else
. = "closes " + message
/datum/emote/living/carbon/human/wing/can_run_emote(mob/user, status_check = TRUE)
if(!..())
return FALSE
var/mob/living/carbon/human/H = user
if(H.dna && H.dna.species && (H.dna.features["wings"] != "None"))
return TRUE
/mob/living/carbon/human/proc/OpenWings()
if(!dna || !dna.species)
return
if("wings" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wings"
dna.species.mutant_bodyparts |= "wingsopen"
update_body()
/mob/living/carbon/human/proc/CloseWings()
if(!dna || !dna.species)
return
if("wingsopen" in dna.species.mutant_bodyparts)
dna.species.mutant_bodyparts -= "wingsopen"
dna.species.mutant_bodyparts |= "wings"
update_body()
if(isturf(loc))
var/turf/T = loc
T.Entered(src)
/datum/emote/sound/human
mob_type_allowed_typecache = list(/mob/living/carbon/human)
emote_type = EMOTE_AUDIBLE
/datum/emote/sound/human/buzz
key = "buzz"
key_third_person = "buzzes"
message = "buzzes."
message_param = "buzzes at %t."
sound = 'sound/machines/buzz-sigh.ogg'
/datum/emote/sound/human/buzz2
key = "buzz2"
message = "buzzes twice."
sound = 'sound/machines/buzz-two.ogg'
/datum/emote/sound/human/ping
key = "ping"
key_third_person = "pings"
message = "pings."
message_param = "pings at %t."
sound = 'sound/machines/ping.ogg'
/datum/emote/sound/human/chime
key = "chime"
key_third_person = "chimes"
message = "chimes."
sound = 'sound/machines/chime.ogg'
+415 -408
View File
@@ -1,408 +1,415 @@
/mob/living/carbon/human/examine(mob/user)
//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
if(isliving(user))
var/mob/living/L = user
if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA))
obscure_name = TRUE
. = list("<span class='info'>*---------*\nThis is <EM>[!obscure_name ? name : "Unknown"]</EM>!")
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)
. += "<span class='warning'>[t_He] [t_has] [hand_number > 1 ? "" : "a"] blood-stained hand[hand_number > 1 ? "s" : ""]!</span>"
//handcuffed?
if(handcuffed)
if(istype(handcuffed, /obj/item/restraints/handcuffs/cable))
. += "<span class='warning'>[t_He] [t_is] [icon2html(handcuffed, user)] restrained with cable!</span>"
else
. += "<span class='warning'>[t_He] [t_is] [icon2html(handcuffed, user)] handcuffed!</span>"
//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))
. += "<span class='warning'><B>[t_His] eyes are glowing an unnatural red!</B></span>"
//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
//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(cursed_stuff)
. += cursed_stuff
//END OF CIT CHANGES
//Jitters
switch(jitteriness)
if(300 to INFINITY)
. += "<span class='warning'><B>[t_He] [t_is] convulsing violently!</B></span>"
if(200 to 300)
. += "<span class='warning'>[t_He] [t_is] extremely jittery.</span>"
if(100 to 200)
. += "<span class='warning'>[t_He] [t_is] twitching ever so slightly.</span>"
var/appears_dead = 0
if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH)))
appears_dead = 1
if(suiciding)
. += "<span class='warning'>[t_He] appear[p_s()] to have committed suicide... there is no hope of recovery.</span>"
if(hellbound)
. += "<span class='warning'>[t_His] soul seems to have been ripped out of [t_his] body. Revival is impossible.</span>"
if(getorgan(/obj/item/organ/brain) && !key && !get_ghost(FALSE, TRUE))
. += "<span class='deadsay'>[t_He] [t_is] limp and unresponsive; there are no signs of life and [t_his] soul has departed...</span>"
else
. += "<span class='deadsay'>[t_He] [t_is] limp and unresponsive; there are no signs of life...</span>"
if(get_bodypart(BODY_ZONE_HEAD) && !getorgan(/obj/item/organ/brain))
. += "<span class='deadsay'>It appears that [t_his] brain is missing...</span>"
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 += "<B>[t_He] [t_has] \a [icon2html(I, user)] [I] embedded in [t_his] [BP.name]!</B>\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 += "<B>[capitalize(t_his)] [BP.name] is [damage_text]!</B>\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 += "<span class='deadsay'><B>[t_His] [parse_zone(t)] is missing!</B></span>\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 += "<B>[capitalize(t_his)] [parse_zone(t)] is missing!</B>\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] <b>moderate</b> bruising!\n"
else
msg += "<B>[t_He] [t_has] severe bruising!</B>\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] <b>moderate</b> burns!\n"
else
msg += "<B>[t_He] [t_has] severe burns!</B>\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] <b>moderate</b> cellular damage!\n"
else
msg += "<b>[t_He] [t_has] severe cellular damage!</b>\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(bleed_rate >= 8) //8 is the rate at which heparin causes you to bleed
msg += "<b>[t_He] [t_is] bleeding uncontrollably!</b>\n"
else
msg += "<B>[t_He] [t_is] bleeding!</B>\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 += "[t_He] has wild, spacey eyes and they have a strange, abnormal look to them.\n"
else
msg += "[t_He] has wild, spacey eyes and they 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 = 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"
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.cit_toggles & HYPNO)
msg += "<span class='velvet'><i>You feel your chords resonate looking at them.</i></span>\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 += "<span class='deadsay'>[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.</span>\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))
. += "<span class='warning'>[msg.Join("")]</span>"
var/trait_exam = common_trait_examine()
if (!isnull(trait_exam))
. += trait_exam
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)
. += "<span class='deptradio'>Rank:</span> [R.fields["rank"]]\n<a href='?src=[REF(src)];hud=1;photo_front=1'>\[Front photo\]</a><a href='?src=[REF(src)];hud=1;photo_side=1'>\[Side photo\]</a>"
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"]
. += "<a href='?src=[REF(src)];hud=m;p_stat=1'>\[[health_r]\]</a>"
health_r = R.fields["m_stat"]
. += "<a href='?src=[REF(src)];hud=m;m_stat=1'>\[[health_r]\]</a>"
R = find_record("name", perpname, GLOB.data_core.medical)
if(R)
. += "<a href='?src=[REF(src)];hud=m;evaluation=1'>\[Medical evaluation\]</a>"
if(traitstring)
. += "<span class='info'>Detected physiological traits:\n[traitstring]</span>"
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("<span class='deptradio'>Criminal status:</span> <a href='?src=[REF(src)];hud=s;status=1'>\[[criminal]\]</a>",
"<span class='deptradio'>Security record:</span> <a href='?src=[REF(src)];hud=s;view=1'>\[View\]</a>",
"<a href='?src=[REF(src)];hud=s;add_crime=1'>\[Add crime\]</a>",
"<a href='?src=[REF(src)];hud=s;view_comment=1'>\[View comment log\]</a>",
"<a href='?src=[REF(src)];hud=s;add_comment=1'>\[Add comment\]</a>"), "")
else if(isobserver(user) && traitstring)
. += "<span class='info'><b>Traits:</b> [traitstring]</span>"
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()]"
. += "*---------*</span>"
/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)
//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
if(isliving(user))
var/mob/living/L = user
if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA))
obscure_name = TRUE
. = list("<span class='info'>*---------*\nThis is <EM>[!obscure_name ? name : "Unknown"]</EM>!")
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 && !(U.attached_accessory.flags_inv & HIDEACCESSORY) && !(U.flags_inv & HIDEACCESSORY))
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)
. += "<span class='warning'>[t_He] [t_has] [hand_number > 1 ? "" : "a"] blood-stained hand[hand_number > 1 ? "s" : ""]!</span>"
//handcuffed?
if(handcuffed)
if(istype(handcuffed, /obj/item/restraints/handcuffs/cable))
. += "<span class='warning'>[t_He] [t_is] [icon2html(handcuffed, user)] restrained with cable!</span>"
else
. += "<span class='warning'>[t_He] [t_is] [icon2html(handcuffed, user)] handcuffed!</span>"
//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))
. += "<span class='warning'><B>[t_His] eyes are glowing an unnatural red!</B></span>"
//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
//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(cursed_stuff)
. += cursed_stuff
//END OF CIT CHANGES
//Jitters
switch(jitteriness)
if(300 to INFINITY)
. += "<span class='warning'><B>[t_He] [t_is] convulsing violently!</B></span>"
if(200 to 300)
. += "<span class='warning'>[t_He] [t_is] extremely jittery.</span>"
if(100 to 200)
. += "<span class='warning'>[t_He] [t_is] twitching ever so slightly.</span>"
var/appears_dead = 0
if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH)))
appears_dead = 1
if(suiciding)
. += "<span class='warning'>[t_He] appear[p_s()] to have committed suicide... there is no hope of recovery.</span>"
if(hellbound)
. += "<span class='warning'>[t_His] soul seems to have been ripped out of [t_his] body. Revival is impossible.</span>"
if(getorgan(/obj/item/organ/brain) && !key && !get_ghost(FALSE, TRUE))
. += "<span class='deadsay'>[t_He] [t_is] limp and unresponsive; there are no signs of life and [t_his] soul has departed...</span>"
else
. += "<span class='deadsay'>[t_He] [t_is] limp and unresponsive; there are no signs of life...</span>"
if(get_bodypart(BODY_ZONE_HEAD) && !getorgan(/obj/item/organ/brain))
. += "<span class='deadsay'>It appears that [t_his] brain is missing...</span>"
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 += "<B>[t_He] [t_has] \a [icon2html(I, user)] [I] embedded in [t_his] [BP.name]!</B>\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 += "<B>[capitalize(t_his)] [BP.name] is [damage_text]!</B>\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 += "<span class='deadsay'><B>[t_His] [parse_zone(t)] is missing!</B></span>\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 += "<B>[capitalize(t_his)] [parse_zone(t)] is missing!</B>\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] <b>moderate</b> bruising!\n"
else
msg += "<B>[t_He] [t_has] severe bruising!</B>\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] <b>moderate</b> burns!\n"
else
msg += "<B>[t_He] [t_has] severe burns!</B>\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] <b>moderate</b> cellular damage!\n"
else
msg += "<b>[t_He] [t_has] severe cellular damage!</b>\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(bleed_rate >= 8) //8 is the rate at which heparin causes you to bleed
msg += "<b>[t_He] [t_is] bleeding uncontrollably!</b>\n"
else
msg += "<B>[t_He] [t_is] bleeding!</B>\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 += "[t_He] has wild, spacey eyes and they have a strange, abnormal look to them.\n"
else
msg += "[t_He] has wild, spacey eyes and they 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 = 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"
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.cit_toggles & HYPNO)
msg += "<span class='velvet'><i>You feel your chords resonate looking at them.</i></span>\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 += "<span class='deadsay'>[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.</span>\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))
. += "<span class='warning'>[msg.Join("")]</span>"
var/trait_exam = common_trait_examine()
if (!isnull(trait_exam))
. += trait_exam
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)
. += "<span class='deptradio'>Rank:</span> [R.fields["rank"]]\n<a href='?src=[REF(src)];hud=1;photo_front=1'>\[Front photo\]</a><a href='?src=[REF(src)];hud=1;photo_side=1'>\[Side photo\]</a>"
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"]
. += "<a href='?src=[REF(src)];hud=m;p_stat=1'>\[[health_r]\]</a>"
health_r = R.fields["m_stat"]
. += "<a href='?src=[REF(src)];hud=m;m_stat=1'>\[[health_r]\]</a>"
R = find_record("name", perpname, GLOB.data_core.medical)
if(R)
. += "<a href='?src=[REF(src)];hud=m;evaluation=1'>\[Medical evaluation\]</a>"
if(traitstring)
. += "<span class='info'>Detected physiological traits:\n[traitstring]</span>"
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("<span class='deptradio'>Criminal status:</span> <a href='?src=[REF(src)];hud=s;status=1'>\[[criminal]\]</a>",
"<span class='deptradio'>Security record:</span> <a href='?src=[REF(src)];hud=s;view=1'>\[View\]</a>",
"<a href='?src=[REF(src)];hud=s;add_crime=1'>\[Add crime\]</a>",
"<a href='?src=[REF(src)];hud=s;view_comment=1'>\[View comment log\]</a>",
"<a href='?src=[REF(src)];hud=s;add_comment=1'>\[Add comment\]</a>"), "")
else if(isobserver(user) && traitstring)
. += "<span class='info'><b>Traits:</b> [traitstring]</span>"
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()]"
if(print_flavor_text_2())
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_2()]"
. += "*---------*</span>"
/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()
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,70 +1,70 @@
/mob/living/carbon/human
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD, NANITE_HUD, DIAG_NANITE_FULL_HUD,ANTAG_HUD,GLAND_HUD,SENTIENT_DISEASE_HUD,RAD_HUD)
hud_type = /datum/hud/human
possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
pressure_resistance = 25
can_buckle = TRUE
buckle_lying = FALSE
mob_biotypes = list(MOB_ORGANIC, MOB_HUMANOID)
//Hair colour and style
var/hair_color = "000"
var/hair_style = "Bald"
//Facial hair colour and style
var/facial_hair_color = "000"
var/facial_hair_style = "Shaved"
//Eye colour
var/eye_color = "000"
var/horn_color = "85615a" //specific horn colors, because why not?
var/wing_color = "fff" //wings too
var/skin_tone = "caucasian1" //Skin tone
var/lip_style = null //no lipstick by default- arguably misleading, as it could be used for general makeup
var/lip_color = "white"
var/age = 30 //Player's age
var/underwear = "Nude" //Which underwear the player wants
var/undie_color = "FFFFFF"
var/undershirt = "Nude" //Which undershirt the player wants
var/shirt_color = "FFFFFF"
var/socks = "Nude" //Which socks the player wants
var/socks_color = "FFFFFF"
//Equipment slots
var/obj/item/wear_suit = null
var/obj/item/w_uniform = null
var/obj/item/belt = null
var/obj/item/wear_id = null
var/obj/item/r_store = null
var/obj/item/l_store = null
var/obj/item/s_store = null
var/special_voice = "" // For changing our voice. Used by a symptom.
var/bleed_rate = 0 //how much are we bleeding
var/bleedsuppress = 0 //for stopping bloodloss, eventually this will be limb-based like bleeding
var/blood_state = BLOOD_STATE_NOT_BLOODY
var/list/blood_smear = list(BLOOD_STATE_BLOOD = 0, BLOOD_STATE_OIL = 0, BLOOD_STATE_NOT_BLOODY = 0)
var/name_override //For temporary visible name changes
var/genital_override = FALSE //Force genitals on things incase of chems
var/nameless = FALSE //For drones of both the insectoid and robotic kind. And other types of nameless critters.
var/custom_species = null
var/datum/personal_crafting/handcrafting
var/datum/physiology/physiology
var/list/datum/bioware = list()
var/creamed = FALSE //to use with creampie overlays
var/static/list/can_ride_typecache = typecacheof(list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot))
var/lastpuke = 0
var/last_fire_update
/mob/living/carbon/human
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD, NANITE_HUD, DIAG_NANITE_FULL_HUD,ANTAG_HUD,GLAND_HUD,SENTIENT_DISEASE_HUD,RAD_HUD)
hud_type = /datum/hud/human
possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
pressure_resistance = 25
can_buckle = TRUE
buckle_lying = FALSE
mob_biotypes = list(MOB_ORGANIC, MOB_HUMANOID)
//Hair colour and style
var/hair_color = "000"
var/hair_style = "Bald"
//Facial hair colour and style
var/facial_hair_color = "000"
var/facial_hair_style = "Shaved"
//Eye colour
var/eye_color = "000"
var/horn_color = "85615a" //specific horn colors, because why not?
var/wing_color = "fff" //wings too
var/skin_tone = "caucasian1" //Skin tone
var/lip_style = null //no lipstick by default- arguably misleading, as it could be used for general makeup
var/lip_color = "white"
var/age = 30 //Player's age
var/underwear = "Nude" //Which underwear the player wants
var/undie_color = "FFFFFF"
var/undershirt = "Nude" //Which undershirt the player wants
var/shirt_color = "FFFFFF"
var/socks = "Nude" //Which socks the player wants
var/socks_color = "FFFFFF"
//Equipment slots
var/obj/item/wear_suit = null
var/obj/item/w_uniform = null
var/obj/item/belt = null
var/obj/item/wear_id = null
var/obj/item/r_store = null
var/obj/item/l_store = null
var/obj/item/s_store = null
var/special_voice = "" // For changing our voice. Used by a symptom.
var/bleed_rate = 0 //how much are we bleeding
var/bleedsuppress = 0 //for stopping bloodloss, eventually this will be limb-based like bleeding
var/blood_state = BLOOD_STATE_NOT_BLOODY
var/list/blood_smear = list(BLOOD_STATE_BLOOD = 0, BLOOD_STATE_OIL = 0, BLOOD_STATE_NOT_BLOODY = 0)
var/name_override //For temporary visible name changes
var/genital_override = FALSE //Force genitals on things incase of chems
var/nameless = FALSE //For drones of both the insectoid and robotic kind. And other types of nameless critters.
var/custom_species = null
var/datum/personal_crafting/handcrafting
var/datum/physiology/physiology
var/list/datum/bioware = list()
var/creamed = FALSE //to use with creampie overlays
var/static/list/can_ride_typecache = typecacheof(list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot))
var/lastpuke = 0
var/last_fire_update
@@ -1,142 +1,142 @@
/mob/living/carbon/human/restrained(ignore_grab)
. = ((wear_suit && wear_suit.breakouttime) || ..())
/mob/living/carbon/human/canBeHandcuffed()
if(get_num_arms(FALSE) >= 2)
return TRUE
else
return FALSE
//gets assignment from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_assignment(if_no_id = "No id", if_no_job = "No job", hand_first = TRUE)
var/obj/item/card/id/id = get_idcard(hand_first)
if(id)
. = id.assignment
else
var/obj/item/pda/pda = wear_id
if(istype(pda))
. = pda.ownjob
else
return if_no_id
if(!.)
return if_no_job
//gets name from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_authentification_name(if_no_id = "Unknown")
var/obj/item/card/id/id = get_idcard(FALSE)
if(id)
return id.registered_name
var/obj/item/pda/pda = wear_id
if(istype(pda))
return pda.owner
return if_no_id
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a separate proc as it'll be useful elsewhere
/mob/living/carbon/human/get_visible_name()
var/face_name = get_face_name("")
var/id_name = get_id_name("")
if(name_override)
return name_override
if(face_name)
if(id_name && (id_name != face_name))
return "[face_name] (as [id_name])"
return face_name
if(id_name)
return id_name
return "Unknown"
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when Fluacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name(if_no_face="Unknown")
if( wear_mask && (wear_mask.flags_inv&HIDEFACE) ) //Wearing a mask which hides our face, use id-name if possible
return if_no_face
if( head && (head.flags_inv&HIDEFACE) )
return if_no_face //Likewise for hats
var/obj/item/bodypart/O = get_bodypart(BODY_ZONE_HEAD)
if( !O || (HAS_TRAIT(src, TRAIT_DISFIGURED)) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name || nameless) //disfigured. use id-name if possible
return if_no_face
return real_name
//gets name from ID or PDA itself, ID inside PDA doesn't matter
//Useful when player is being seen by other mobs
/mob/living/carbon/human/proc/get_id_name(if_no_id = "Unknown")
var/obj/item/storage/wallet/wallet = wear_id
var/obj/item/pda/pda = wear_id
var/obj/item/card/id/id = wear_id
var/obj/item/modular_computer/tablet/tablet = wear_id
if(istype(wallet))
id = wallet.front_id
if(istype(id))
. = id.registered_name
else if(istype(pda))
. = pda.owner
else if(istype(tablet))
var/obj/item/computer_hardware/card_slot/card_slot = tablet.all_components[MC_CARD]
if(card_slot && (card_slot.stored_card2 || card_slot.stored_card))
if(card_slot.stored_card2) //The second card is the one used for authorization in the ID changing program, so we prioritize it here for consistency
. = card_slot.stored_card2.registered_name
else
if(card_slot.stored_card)
. = card_slot.stored_card.registered_name
if(!.)
. = if_no_id //to prevent null-names making the mob unclickable
return
//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/get_idcard(hand_first = TRUE)
. = ..()
if(. && hand_first)
return
//Check inventory slots
var/obj/item/card/id/id_card = wear_id?.GetID()
if(!id_card)
id_card = belt?.GetID()
return id_card || .
/mob/living/carbon/human/IsAdvancedToolUser()
if(HAS_TRAIT(src, TRAIT_MONKEYLIKE))
return FALSE
return TRUE//Humans can use guns and such
/mob/living/carbon/human/reagent_check(datum/reagent/R)
return dna.species.handle_chemicals(R,src)
// if it returns 0, it will run the usual on_mob_life for that reagent. otherwise, it will stop after running handle_chemicals for the species.
/mob/living/carbon/human/can_track(mob/living/user)
if(wear_id && istype(wear_id.GetID(), /obj/item/card/id/syndicate))
return 0
if(istype(head, /obj/item/clothing/head))
var/obj/item/clothing/head/hat = head
if(hat.blockTracking)
return 0
return ..()
/mob/living/carbon/human/can_use_guns(obj/item/G)
. = ..()
if(!.)
return
if(G.trigger_guard == TRIGGER_GUARD_NORMAL)
if(HAS_TRAIT(src, TRAIT_CHUNKYFINGERS))
to_chat(src, "<span class='warning'>Your meaty finger is much too large for the trigger guard!</span>")
return FALSE
if(HAS_TRAIT(src, TRAIT_NOGUNS))
to_chat(src, "<span class='warning'>Your fingers don't fit in the trigger guard!</span>")
return FALSE
/mob/living/carbon/human/can_see_reagents()
. = ..()
if(.) //No need to run through all of this if it's already true.
return
if(isclothing(glasses) && (glasses.clothing_flags & SCAN_REAGENTS))
return TRUE
/*
/mob/living/carbon/human/transfer_blood_dna(list/blood_dna)
..()
if(blood_dna.len)
last_bloodtype = blood_dna[blood_dna[blood_dna.len]]//trust me this works
last_blood_DNA = blood_dna[blood_dna.len]*/
/mob/living/carbon/human/restrained(ignore_grab)
. = ((wear_suit && wear_suit.breakouttime) || ..())
/mob/living/carbon/human/canBeHandcuffed()
if(get_num_arms(FALSE) >= 2)
return TRUE
else
return FALSE
//gets assignment from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_assignment(if_no_id = "No id", if_no_job = "No job", hand_first = TRUE)
var/obj/item/card/id/id = get_idcard(hand_first)
if(id)
. = id.assignment
else
var/obj/item/pda/pda = wear_id
if(istype(pda))
. = pda.ownjob
else
return if_no_id
if(!.)
return if_no_job
//gets name from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_authentification_name(if_no_id = "Unknown")
var/obj/item/card/id/id = get_idcard(FALSE)
if(id)
return id.registered_name
var/obj/item/pda/pda = wear_id
if(istype(pda))
return pda.owner
return if_no_id
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a separate proc as it'll be useful elsewhere
/mob/living/carbon/human/get_visible_name()
var/face_name = get_face_name("")
var/id_name = get_id_name("")
if(name_override)
return name_override
if(face_name)
if(id_name && (id_name != face_name))
return "[face_name] (as [id_name])"
return face_name
if(id_name)
return id_name
return "Unknown"
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when Fluacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name(if_no_face="Unknown")
if( wear_mask && (wear_mask.flags_inv&HIDEFACE) ) //Wearing a mask which hides our face, use id-name if possible
return if_no_face
if( head && (head.flags_inv&HIDEFACE) )
return if_no_face //Likewise for hats
var/obj/item/bodypart/O = get_bodypart(BODY_ZONE_HEAD)
if( !O || (HAS_TRAIT(src, TRAIT_DISFIGURED)) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name || nameless) //disfigured. use id-name if possible
return if_no_face
return real_name
//gets name from ID or PDA itself, ID inside PDA doesn't matter
//Useful when player is being seen by other mobs
/mob/living/carbon/human/proc/get_id_name(if_no_id = "Unknown")
var/obj/item/storage/wallet/wallet = wear_id
var/obj/item/pda/pda = wear_id
var/obj/item/card/id/id = wear_id
var/obj/item/modular_computer/tablet/tablet = wear_id
if(istype(wallet))
id = wallet.front_id
if(istype(id))
. = id.registered_name
else if(istype(pda))
. = pda.owner
else if(istype(tablet))
var/obj/item/computer_hardware/card_slot/card_slot = tablet.all_components[MC_CARD]
if(card_slot && (card_slot.stored_card2 || card_slot.stored_card))
if(card_slot.stored_card2) //The second card is the one used for authorization in the ID changing program, so we prioritize it here for consistency
. = card_slot.stored_card2.registered_name
else
if(card_slot.stored_card)
. = card_slot.stored_card.registered_name
if(!.)
. = if_no_id //to prevent null-names making the mob unclickable
return
//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/get_idcard(hand_first = TRUE)
. = ..()
if(. && hand_first)
return
//Check inventory slots
var/obj/item/card/id/id_card = wear_id?.GetID()
if(!id_card)
id_card = belt?.GetID()
return id_card || .
/mob/living/carbon/human/IsAdvancedToolUser()
if(HAS_TRAIT(src, TRAIT_MONKEYLIKE))
return FALSE
return TRUE//Humans can use guns and such
/mob/living/carbon/human/reagent_check(datum/reagent/R)
return dna.species.handle_chemicals(R,src)
// if it returns 0, it will run the usual on_mob_life for that reagent. otherwise, it will stop after running handle_chemicals for the species.
/mob/living/carbon/human/can_track(mob/living/user)
if(wear_id && istype(wear_id.GetID(), /obj/item/card/id/syndicate))
return 0
if(istype(head, /obj/item/clothing/head))
var/obj/item/clothing/head/hat = head
if(hat.blockTracking)
return 0
return ..()
/mob/living/carbon/human/can_use_guns(obj/item/G)
. = ..()
if(!.)
return
if(G.trigger_guard == TRIGGER_GUARD_NORMAL)
if(HAS_TRAIT(src, TRAIT_CHUNKYFINGERS))
to_chat(src, "<span class='warning'>Your meaty finger is much too large for the trigger guard!</span>")
return FALSE
if(HAS_TRAIT(src, TRAIT_NOGUNS))
to_chat(src, "<span class='warning'>Your fingers don't fit in the trigger guard!</span>")
return FALSE
/mob/living/carbon/human/can_see_reagents()
. = ..()
if(.) //No need to run through all of this if it's already true.
return
if(isclothing(glasses) && (glasses.clothing_flags & SCAN_REAGENTS))
return TRUE
/*
/mob/living/carbon/human/transfer_blood_dna(list/blood_dna)
..()
if(blood_dna.len)
last_bloodtype = blood_dna[blood_dna[blood_dna.len]]//trust me this works
last_blood_DNA = blood_dna[blood_dna.len]*/
@@ -1,78 +1,78 @@
/mob/living/carbon/human/get_movespeed_modifiers()
var/list/considering = ..()
. = considering
if(HAS_TRAIT(src, TRAIT_IGNORESLOWDOWN))
for(var/id in .)
var/list/data = .[id]
if(data[MOVESPEED_DATA_INDEX_FLAGS] & IGNORE_NOSLOW)
.[id] = data
/mob/living/carbon/human/movement_delay()
. = ..()
if(dna && dna.species)
. += dna.species.movement_delay(src)
/mob/living/carbon/human/slip(knockdown_amount, obj/O, lube)
if(HAS_TRAIT(src, TRAIT_NOSLIPALL))
return 0
if (!(lube&GALOSHES_DONT_HELP))
if(HAS_TRAIT(src, TRAIT_NOSLIPWATER))
return 0
if(shoes && istype(shoes, /obj/item/clothing))
var/obj/item/clothing/CS = shoes
if (CS.clothing_flags & NOSLIP)
return 0
return ..()
/mob/living/carbon/human/experience_pressure_difference()
playsound(src, 'sound/effects/space_wind.ogg', 50, 1)
if(shoes && istype(shoes, /obj/item/clothing))
var/obj/item/clothing/S = shoes
if (S.clothing_flags & NOSLIP)
return 0
return ..()
/mob/living/carbon/human/mob_has_gravity()
. = ..()
if(!.)
if(mob_negates_gravity())
. = 1
/mob/living/carbon/human/mob_negates_gravity()
return ((shoes && shoes.negates_gravity()) || (dna.species.negates_gravity(src)))
/mob/living/carbon/human/Move(NewLoc, direct)
. = ..()
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_move(src, NewLoc)
if(shoes)
if(!lying && !buckled)
if(loc == NewLoc)
if(!has_gravity(loc))
return
var/obj/item/clothing/shoes/S = shoes
//Bloody footprints
var/turf/T = get_turf(src)
if(S.bloody_shoes && S.bloody_shoes[S.blood_state])
var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(/obj/effect/decal/cleanable/blood/footprints) in T
if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == bloodtype_to_color(S.last_bloodtype)))
return
S.bloody_shoes[S.blood_state] = max(0, S.bloody_shoes[S.blood_state]-BLOOD_LOSS_PER_STEP)
var/obj/effect/decal/cleanable/blood/footprints/FP = new /obj/effect/decal/cleanable/blood/footprints(T)
FP.blood_state = S.blood_state
FP.entered_dirs |= dir
FP.bloodiness = S.bloody_shoes[S.blood_state]
if(S.last_bloodtype)
FP.blood_DNA += list(S.last_blood_DNA = S.last_bloodtype)
FP.update_icon()
update_inv_shoes()
//End bloody footprints
S.step_action()
/mob/living/carbon/human/Process_Spacemove(movement_dir = 0) //Temporary laziness thing. Will change to handles by species reee.
if(dna.species.space_move(src))
return TRUE
return ..()
/mob/living/carbon/human/get_movespeed_modifiers()
var/list/considering = ..()
. = considering
if(HAS_TRAIT(src, TRAIT_IGNORESLOWDOWN))
for(var/id in .)
var/list/data = .[id]
if(data[MOVESPEED_DATA_INDEX_FLAGS] & IGNORE_NOSLOW)
.[id] = data
/mob/living/carbon/human/movement_delay()
. = ..()
if(dna && dna.species)
. += dna.species.movement_delay(src)
/mob/living/carbon/human/slip(knockdown_amount, obj/O, lube)
if(HAS_TRAIT(src, TRAIT_NOSLIPALL))
return 0
if (!(lube&GALOSHES_DONT_HELP))
if(HAS_TRAIT(src, TRAIT_NOSLIPWATER))
return 0
if(shoes && istype(shoes, /obj/item/clothing))
var/obj/item/clothing/CS = shoes
if (CS.clothing_flags & NOSLIP)
return 0
return ..()
/mob/living/carbon/human/experience_pressure_difference()
playsound(src, 'sound/effects/space_wind.ogg', 50, 1)
if(shoes && istype(shoes, /obj/item/clothing))
var/obj/item/clothing/S = shoes
if (S.clothing_flags & NOSLIP)
return 0
return ..()
/mob/living/carbon/human/mob_has_gravity()
. = ..()
if(!.)
if(mob_negates_gravity())
. = 1
/mob/living/carbon/human/mob_negates_gravity()
return ((shoes && shoes.negates_gravity()) || (dna.species.negates_gravity(src)))
/mob/living/carbon/human/Move(NewLoc, direct)
. = ..()
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_move(src, NewLoc)
if(shoes)
if(!lying && !buckled)
if(loc == NewLoc)
if(!has_gravity(loc))
return
var/obj/item/clothing/shoes/S = shoes
//Bloody footprints
var/turf/T = get_turf(src)
if(S.bloody_shoes && S.bloody_shoes[S.blood_state])
var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(/obj/effect/decal/cleanable/blood/footprints) in T
if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == bloodtype_to_color(S.last_bloodtype)))
return
S.bloody_shoes[S.blood_state] = max(0, S.bloody_shoes[S.blood_state]-BLOOD_LOSS_PER_STEP)
var/obj/effect/decal/cleanable/blood/footprints/FP = new /obj/effect/decal/cleanable/blood/footprints(T)
FP.blood_state = S.blood_state
FP.entered_dirs |= dir
FP.bloodiness = S.bloody_shoes[S.blood_state]
if(S.last_bloodtype)
FP.blood_DNA += list(S.last_blood_DNA = S.last_bloodtype)
FP.update_icon()
update_inv_shoes()
//End bloody footprints
S.step_action()
/mob/living/carbon/human/Process_Spacemove(movement_dir = 0) //Temporary laziness thing. Will change to handles by species reee.
if(dna.species.space_move(src))
return TRUE
return ..()
+273 -273
View File
@@ -1,273 +1,273 @@
/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE)
return dna.species.can_equip(I, slot, disable_warning, src, bypass_equip_delay_self)
// Return the item currently in the slot ID
/mob/living/carbon/human/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_BACK)
return back
if(SLOT_WEAR_MASK)
return wear_mask
if(SLOT_NECK)
return wear_neck
if(SLOT_HANDCUFFED)
return handcuffed
if(SLOT_LEGCUFFED)
return legcuffed
if(SLOT_BELT)
return belt
if(SLOT_WEAR_ID)
return wear_id
if(SLOT_EARS)
return ears
if(SLOT_GLASSES)
return glasses
if(SLOT_GLOVES)
return gloves
if(SLOT_HEAD)
return head
if(SLOT_SHOES)
return shoes
if(SLOT_WEAR_SUIT)
return wear_suit
if(SLOT_W_UNIFORM)
return w_uniform
if(SLOT_L_STORE)
return l_store
if(SLOT_R_STORE)
return r_store
if(SLOT_S_STORE)
return s_store
return null
/mob/living/carbon/human/proc/get_all_slots()
. = get_head_slots() | get_body_slots()
/mob/living/carbon/human/proc/get_body_slots()
return list(
back,
s_store,
handcuffed,
legcuffed,
wear_suit,
gloves,
shoes,
belt,
wear_id,
l_store,
r_store,
w_uniform
)
/mob/living/carbon/human/proc/get_head_slots()
return list(
head,
wear_mask,
wear_neck,
glasses,
ears,
)
/mob/living/carbon/human/proc/get_storage_slots()
return list(
back,
belt,
l_store,
r_store,
s_store,
)
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
. = ..()
if(!.) //a check failed or the item has already found its slot
return
var/not_handled = FALSE //Added in case we make this type path deeper one day
switch(slot)
if(SLOT_BELT)
belt = I
update_inv_belt()
if(SLOT_WEAR_ID)
wear_id = I
sec_hud_set_ID()
update_inv_wear_id()
if(SLOT_EARS)
ears = I
update_inv_ears()
if(SLOT_GLASSES)
glasses = I
var/obj/item/clothing/glasses/G = I
if(G.glass_colour_type)
update_glasses_color(G, 1)
if(G.tint)
update_tint()
if(G.vision_correction)
clear_fullscreen("nearsighted")
clear_fullscreen("eye_damage")
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
update_inv_glasses()
if(SLOT_GLOVES)
gloves = I
update_inv_gloves()
if(SLOT_SHOES)
shoes = I
update_inv_shoes()
if(SLOT_WEAR_SUIT)
wear_suit = I
if(I.flags_inv & HIDEJUMPSUIT)
update_inv_w_uniform()
if(wear_suit.breakouttime) //when equipping a straightjacket
stop_pulling() //can't pull if restrained
update_action_buttons_icon() //certain action buttons will no longer be usable.
update_inv_wear_suit()
if(SLOT_W_UNIFORM)
w_uniform = I
update_suit_sensors()
update_inv_w_uniform()
if(SLOT_L_STORE)
l_store = I
update_inv_pockets()
if(SLOT_R_STORE)
r_store = I
update_inv_pockets()
if(SLOT_S_STORE)
s_store = I
update_inv_s_store()
else
to_chat(src, "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>")
not_handled = TRUE
//Item is handled and in slot, valid to call callback, for this proc should always be true
if(!not_handled)
I.equipped(src, slot)
return not_handled //For future deeper overrides
/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE)
var/index = get_held_index_of_item(I)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
if(index && !QDELETED(src) && dna.species.mutanthands) //hand freed, fill with claws, skip if we're getting deleted.
put_in_hand(new dna.species.mutanthands(), index)
if(I == wear_suit)
if(s_store && invdrop)
dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit.
if(wear_suit.breakouttime) //when unequipping a straightjacket
drop_all_held_items() //suit is restraining
update_action_buttons_icon() //certain action buttons may be usable again.
wear_suit = null
if(!QDELETED(src)) //no need to update we're getting deleted anyway
if(I.flags_inv & HIDEJUMPSUIT)
update_inv_w_uniform()
update_inv_wear_suit()
else if(I == w_uniform)
if(invdrop)
if(r_store)
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store)
dropItemToGround(l_store, TRUE)
if(wear_id && !CHECK_BITFIELD(wear_id.item_flags, NO_UNIFORM_REQUIRED))
dropItemToGround(wear_id)
if(belt && !CHECK_BITFIELD(belt.item_flags, NO_UNIFORM_REQUIRED))
dropItemToGround(belt)
w_uniform = null
update_suit_sensors()
if(!QDELETED(src))
update_inv_w_uniform()
else if(I == gloves)
gloves = null
if(!QDELETED(src))
update_inv_gloves()
else if(I == glasses)
glasses = null
var/obj/item/clothing/glasses/G = I
if(G.glass_colour_type)
update_glasses_color(G, 0)
if(G.tint)
update_tint()
if(G.vision_correction)
if(HAS_TRAIT(src, TRAIT_NEARSIGHT))
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
if(!QDELETED(src))
update_inv_glasses()
else if(I == ears)
ears = null
if(!QDELETED(src))
update_inv_ears()
else if(I == shoes)
shoes = null
if(!QDELETED(src))
update_inv_shoes()
else if(I == belt)
belt = null
if(!QDELETED(src))
update_inv_belt()
else if(I == wear_id)
wear_id = null
sec_hud_set_ID()
if(!QDELETED(src))
update_inv_wear_id()
else if(I == r_store)
r_store = null
if(!QDELETED(src))
update_inv_pockets()
else if(I == l_store)
l_store = null
if(!QDELETED(src))
update_inv_pockets()
else if(I == s_store)
s_store = null
if(!QDELETED(src))
update_inv_s_store()
/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
if((C.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(C.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR)))
update_hair()
if(toggle_off && internal && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
update_internals_hud_icon(0)
internal = null
if(C.flags_inv & HIDEEYES)
update_inv_glasses()
sec_hud_set_security_status()
..()
/mob/living/carbon/human/head_update(obj/item/I, forced)
if((I.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || forced)
update_hair()
else
var/obj/item/clothing/C = I
if(istype(C) && C.dynamic_hair_suffix)
update_hair()
if(I.flags_inv & HIDEEYES || forced)
update_inv_glasses()
if(I.flags_inv & HIDEEARS || forced)
update_body()
sec_hud_set_security_status()
..()
/mob/living/carbon/human/proc/equipOutfit(outfit, visualsOnly = FALSE, client/preference_source)
var/datum/outfit/O = null
if(ispath(outfit))
O = new outfit
else
O = outfit
if(!istype(O))
return 0
if(!O)
return 0
return O.equip(src, visualsOnly, preference_source)
//delete all equipment without dropping anything
/mob/living/carbon/human/proc/delete_equipment()
for(var/slot in get_all_slots())//order matters, dependant slots go first
qdel(slot)
for(var/obj/item/I in held_items)
qdel(I)
/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE)
return dna.species.can_equip(I, slot, disable_warning, src, bypass_equip_delay_self)
// Return the item currently in the slot ID
/mob/living/carbon/human/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_BACK)
return back
if(SLOT_WEAR_MASK)
return wear_mask
if(SLOT_NECK)
return wear_neck
if(SLOT_HANDCUFFED)
return handcuffed
if(SLOT_LEGCUFFED)
return legcuffed
if(SLOT_BELT)
return belt
if(SLOT_WEAR_ID)
return wear_id
if(SLOT_EARS)
return ears
if(SLOT_GLASSES)
return glasses
if(SLOT_GLOVES)
return gloves
if(SLOT_HEAD)
return head
if(SLOT_SHOES)
return shoes
if(SLOT_WEAR_SUIT)
return wear_suit
if(SLOT_W_UNIFORM)
return w_uniform
if(SLOT_L_STORE)
return l_store
if(SLOT_R_STORE)
return r_store
if(SLOT_S_STORE)
return s_store
return null
/mob/living/carbon/human/proc/get_all_slots()
. = get_head_slots() | get_body_slots()
/mob/living/carbon/human/proc/get_body_slots()
return list(
back,
s_store,
handcuffed,
legcuffed,
wear_suit,
gloves,
shoes,
belt,
wear_id,
l_store,
r_store,
w_uniform
)
/mob/living/carbon/human/proc/get_head_slots()
return list(
head,
wear_mask,
wear_neck,
glasses,
ears,
)
/mob/living/carbon/human/proc/get_storage_slots()
return list(
back,
belt,
l_store,
r_store,
s_store,
)
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
. = ..()
if(!.) //a check failed or the item has already found its slot
return
var/not_handled = FALSE //Added in case we make this type path deeper one day
switch(slot)
if(SLOT_BELT)
belt = I
update_inv_belt()
if(SLOT_WEAR_ID)
wear_id = I
sec_hud_set_ID()
update_inv_wear_id()
if(SLOT_EARS)
ears = I
update_inv_ears()
if(SLOT_GLASSES)
glasses = I
var/obj/item/clothing/glasses/G = I
if(G.glass_colour_type)
update_glasses_color(G, 1)
if(G.tint)
update_tint()
if(G.vision_correction)
clear_fullscreen("nearsighted")
clear_fullscreen("eye_damage")
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
update_inv_glasses()
if(SLOT_GLOVES)
gloves = I
update_inv_gloves()
if(SLOT_SHOES)
shoes = I
update_inv_shoes()
if(SLOT_WEAR_SUIT)
wear_suit = I
if(I.flags_inv & HIDEJUMPSUIT)
update_inv_w_uniform()
if(wear_suit.breakouttime) //when equipping a straightjacket
stop_pulling() //can't pull if restrained
update_action_buttons_icon() //certain action buttons will no longer be usable.
update_inv_wear_suit()
if(SLOT_W_UNIFORM)
w_uniform = I
update_suit_sensors()
update_inv_w_uniform()
if(SLOT_L_STORE)
l_store = I
update_inv_pockets()
if(SLOT_R_STORE)
r_store = I
update_inv_pockets()
if(SLOT_S_STORE)
s_store = I
update_inv_s_store()
else
to_chat(src, "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>")
not_handled = TRUE
//Item is handled and in slot, valid to call callback, for this proc should always be true
if(!not_handled)
I.equipped(src, slot)
return not_handled //For future deeper overrides
/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE)
var/index = get_held_index_of_item(I)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
if(index && !QDELETED(src) && dna.species.mutanthands) //hand freed, fill with claws, skip if we're getting deleted.
put_in_hand(new dna.species.mutanthands(), index)
if(I == wear_suit)
if(s_store && invdrop)
dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit.
if(wear_suit.breakouttime) //when unequipping a straightjacket
drop_all_held_items() //suit is restraining
update_action_buttons_icon() //certain action buttons may be usable again.
wear_suit = null
if(!QDELETED(src)) //no need to update we're getting deleted anyway
if(I.flags_inv & HIDEJUMPSUIT)
update_inv_w_uniform()
update_inv_wear_suit()
else if(I == w_uniform)
if(invdrop)
if(r_store)
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store)
dropItemToGround(l_store, TRUE)
if(wear_id && !CHECK_BITFIELD(wear_id.item_flags, NO_UNIFORM_REQUIRED))
dropItemToGround(wear_id)
if(belt && !CHECK_BITFIELD(belt.item_flags, NO_UNIFORM_REQUIRED))
dropItemToGround(belt)
w_uniform = null
update_suit_sensors()
if(!QDELETED(src))
update_inv_w_uniform()
else if(I == gloves)
gloves = null
if(!QDELETED(src))
update_inv_gloves()
else if(I == glasses)
glasses = null
var/obj/item/clothing/glasses/G = I
if(G.glass_colour_type)
update_glasses_color(G, 0)
if(G.tint)
update_tint()
if(G.vision_correction)
if(HAS_TRAIT(src, TRAIT_NEARSIGHT))
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
if(!QDELETED(src))
update_inv_glasses()
else if(I == ears)
ears = null
if(!QDELETED(src))
update_inv_ears()
else if(I == shoes)
shoes = null
if(!QDELETED(src))
update_inv_shoes()
else if(I == belt)
belt = null
if(!QDELETED(src))
update_inv_belt()
else if(I == wear_id)
wear_id = null
sec_hud_set_ID()
if(!QDELETED(src))
update_inv_wear_id()
else if(I == r_store)
r_store = null
if(!QDELETED(src))
update_inv_pockets()
else if(I == l_store)
l_store = null
if(!QDELETED(src))
update_inv_pockets()
else if(I == s_store)
s_store = null
if(!QDELETED(src))
update_inv_s_store()
/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
if((C.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(C.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR)))
update_hair()
if(toggle_off && internal && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
update_internals_hud_icon(0)
internal = null
if(C.flags_inv & HIDEEYES)
update_inv_glasses()
sec_hud_set_security_status()
..()
/mob/living/carbon/human/head_update(obj/item/I, forced)
if((I.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || forced)
update_hair()
else
var/obj/item/clothing/C = I
if(istype(C) && C.dynamic_hair_suffix)
update_hair()
if(I.flags_inv & HIDEEYES || forced)
update_inv_glasses()
if(I.flags_inv & HIDEEARS || forced)
update_body()
sec_hud_set_security_status()
..()
/mob/living/carbon/human/proc/equipOutfit(outfit, visualsOnly = FALSE, client/preference_source)
var/datum/outfit/O = null
if(ispath(outfit))
O = new outfit
else
O = outfit
if(!istype(O))
return 0
if(!O)
return 0
return O.equip(src, visualsOnly, preference_source)
//delete all equipment without dropping anything
/mob/living/carbon/human/proc/delete_equipment()
for(var/slot in get_all_slots())//order matters, dependant slots go first
qdel(slot)
for(var/obj/item/I in held_items)
qdel(I)
@@ -39,10 +39,6 @@
//Stuff jammed in your limbs hurts
handle_embedded_objects()
if(stat != DEAD)
//process your dick energy
handle_arousal(times_fired)
//Update our name based on whether our face is obscured/disfigured
name = get_visible_name()
+116 -116
View File
@@ -1,116 +1,116 @@
/mob/living/carbon/human/say_mod(input, message_mode)
verb_say = dna.species.say_mod
. = ..()
if(message_mode != MODE_CUSTOM_SAY && message_mode != MODE_WHISPER_CRIT)
switch(slurring)
if(10 to 25)
return "jumbles"
if(25 to 50)
return "slurs"
if(50 to INFINITY)
return "garbles"
/mob/living/carbon/human/GetVoice()
if(istype(wear_mask, /obj/item/clothing/mask/chameleon))
var/obj/item/clothing/mask/chameleon/V = wear_mask
if(V.vchange && wear_id)
var/obj/item/card/id/idcard = wear_id.GetID()
if(istype(idcard))
return idcard.registered_name
else
return real_name
else
return real_name
if(mind)
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling && changeling.mimicing )
return changeling.mimicing
if(GetSpecialVoice())
return GetSpecialVoice()
return real_name
/mob/living/carbon/human/IsVocal()
// how do species that don't breathe talk? magic, that's what.
if(!HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT) && !getorganslot(ORGAN_SLOT_LUNGS))
return FALSE
if(mind)
return !mind.miming
return TRUE
/mob/living/carbon/human/proc/SetSpecialVoice(new_voice)
if(new_voice)
special_voice = new_voice
return
/mob/living/carbon/human/proc/UnsetSpecialVoice()
special_voice = ""
return
/mob/living/carbon/human/proc/GetSpecialVoice()
return special_voice
/mob/living/carbon/human/binarycheck()
if(ears)
var/obj/item/radio/headset/dongle = ears
if(!istype(dongle))
return FALSE
if(dongle.translate_binary)
return TRUE
/mob/living/carbon/human/radio(message, message_mode, list/spans, language)
. = ..()
if(.)
return
switch(message_mode)
if(MODE_HEADSET)
if (ears)
ears.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_DEPARTMENT)
if (ears)
ears.talk_into(src, message, message_mode, spans, language)
return ITALICS | REDUCE_RANGE
if(message_mode in GLOB.radiochannels)
if(ears)
ears.talk_into(src, message, message_mode, spans, language)
return ITALICS | REDUCE_RANGE
return 0
/mob/living/carbon/human/get_alt_name()
if(name != GetVoice())
return " (as [get_id_name("Unknown")])"
/mob/living/carbon/human/proc/forcesay(list/append) //this proc is at the bottom of the file because quote fuckery makes notepad++ cri
if(stat == CONSCIOUS)
if(client)
var/virgin = 1 //has the text been modified yet?
var/temp = winget(client, "input", "text")
if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //"case sensitive means
temp = replacetext(temp, ";", "") //general radio
if(findtext(trim_left(temp), ":", 6, 7)) //dept radio
temp = copytext(trim_left(temp), 8)
virgin = 0
if(virgin)
temp = copytext(trim_left(temp), 6) //normal speech
virgin = 0
while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary)
temp = copytext(trim_left(temp), 3)
if(findtext(temp, "*", 1, 2)) //emotes
return
var/trimmed = trim_left(temp)
if(length(trimmed))
if(append)
temp += pick(append)
say(temp)
winset(client, "input", "text=[null]")
/mob/living/carbon/human/say_mod(input, message_mode)
verb_say = dna.species.say_mod
. = ..()
if(message_mode != MODE_CUSTOM_SAY && message_mode != MODE_WHISPER_CRIT)
switch(slurring)
if(10 to 25)
return "jumbles"
if(25 to 50)
return "slurs"
if(50 to INFINITY)
return "garbles"
/mob/living/carbon/human/GetVoice()
if(istype(wear_mask, /obj/item/clothing/mask/chameleon))
var/obj/item/clothing/mask/chameleon/V = wear_mask
if(V.vchange && wear_id)
var/obj/item/card/id/idcard = wear_id.GetID()
if(istype(idcard))
return idcard.registered_name
else
return real_name
else
return real_name
if(mind)
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling && changeling.mimicing )
return changeling.mimicing
if(GetSpecialVoice())
return GetSpecialVoice()
return real_name
/mob/living/carbon/human/IsVocal()
// how do species that don't breathe talk? magic, that's what.
if(!HAS_TRAIT_FROM(src, TRAIT_NOBREATH, SPECIES_TRAIT) && !getorganslot(ORGAN_SLOT_LUNGS))
return FALSE
if(mind)
return !mind.miming
return TRUE
/mob/living/carbon/human/proc/SetSpecialVoice(new_voice)
if(new_voice)
special_voice = new_voice
return
/mob/living/carbon/human/proc/UnsetSpecialVoice()
special_voice = ""
return
/mob/living/carbon/human/proc/GetSpecialVoice()
return special_voice
/mob/living/carbon/human/binarycheck()
if(ears)
var/obj/item/radio/headset/dongle = ears
if(!istype(dongle))
return FALSE
if(dongle.translate_binary)
return TRUE
/mob/living/carbon/human/radio(message, message_mode, list/spans, language)
. = ..()
if(.)
return
switch(message_mode)
if(MODE_HEADSET)
if (ears)
ears.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_DEPARTMENT)
if (ears)
ears.talk_into(src, message, message_mode, spans, language)
return ITALICS | REDUCE_RANGE
if(message_mode in GLOB.radiochannels)
if(ears)
ears.talk_into(src, message, message_mode, spans, language)
return ITALICS | REDUCE_RANGE
return 0
/mob/living/carbon/human/get_alt_name()
if(name != GetVoice())
return " (as [get_id_name("Unknown")])"
/mob/living/carbon/human/proc/forcesay(list/append) //this proc is at the bottom of the file because quote fuckery makes notepad++ cri
if(stat == CONSCIOUS)
if(client)
var/virgin = 1 //has the text been modified yet?
var/temp = winget(client, "input", "text")
if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //"case sensitive means
temp = replacetext(temp, ";", "") //general radio
if(findtext(trim_left(temp), ":", 6, 7)) //dept radio
temp = copytext(trim_left(temp), 8)
virgin = 0
if(virgin)
temp = copytext(trim_left(temp), 6) //normal speech
virgin = 0
while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary)
temp = copytext(trim_left(temp), 3)
if(findtext(temp, "*", 1, 2)) //emotes
return
var/trimmed = trim_left(temp)
if(length(trimmed))
if(append)
temp += pick(append)
say(temp)
winset(client, "input", "text=[null]")
+11 -23
View File
@@ -323,12 +323,6 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
for(var/datum/disease/A in C.diseases)
A.cure(FALSE)
//CITADEL EDIT
if(NOAROUSAL in species_traits)
C.canbearoused = FALSE
else
if(C.client)
C.canbearoused = C.client.prefs.arousable
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(NOGENITALS in H.dna.species.species_traits)
@@ -1586,10 +1580,10 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
"<span class='notice'>You slap [user == target ? "yourself" : "\the [target]"] in the face! </span>",\
"You hear a slap."
)
if (!HAS_TRAIT(target, TRAIT_NYMPHO))
stop_wagging_tail(target)
user.do_attack_animation(target, ATTACK_EFFECT_FACE_SLAP)
user.adjustStaminaLossBuffered(3)
if (!HAS_TRAIT(target, TRAIT_PERMABONER))
stop_wagging_tail(target)
return FALSE
else if(aim_for_groin && (target == user || target.lying || same_dir) && (target_on_help || target_restrained || target_aiming_for_groin))
if(target.client?.prefs.cit_toggles & NO_ASS_SLAP)
@@ -1597,19 +1591,17 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return FALSE
user.do_attack_animation(target, ATTACK_EFFECT_ASS_SLAP)
user.adjustStaminaLossBuffered(3)
target.adjust_arousal(20,maso = TRUE)
if (ishuman(target) && HAS_TRAIT(target, TRAIT_MASO) && target.has_dna() && prob(10))
target.mob_climax(forced_climax=TRUE)
if (!HAS_TRAIT(target, TRAIT_PERMABONER))
stop_wagging_tail(target)
playsound(target.loc, 'sound/weapons/slap.ogg', 50, 1, -1)
user.visible_message(\
"<span class='danger'>\The [user] slaps \the [target]'s ass!</span>",\
"<span class='notice'>You slap [user == target ? "your" : "\the [target]'s"] ass!</span>",\
"You hear a slap."
)
if (target.canbearoused)
target.adjustArousalLoss(5)
if (target.getArousalLoss() >= 100 && ishuman(target) && HAS_TRAIT(target, TRAIT_MASO) && target.has_dna())
target.mob_climax(forced_climax=TRUE)
if (!HAS_TRAIT(target, TRAIT_NYMPHO))
stop_wagging_tail(target)
)
return FALSE
else if(attacker_style && attacker_style.disarm_act(user,target))
return 1
@@ -1962,10 +1954,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(BP)
if(damage > 0 ? BP.receive_damage(damage_amount, 0) : BP.heal_damage(abs(damage_amount), 0))
H.update_damage_overlays()
if(HAS_TRAIT(H, TRAIT_MASO))
H.adjustArousalLoss(damage_amount, 0)
if (H.getArousalLoss() >= 100 && ishuman(H) && H.has_dna())
H.mob_climax(forced_climax=TRUE)
if(HAS_TRAIT(H, TRAIT_MASO) && prob(damage_amount))
H.mob_climax(forced_climax=TRUE)
else//no bodypart, we deal damage with a more general method.
H.adjustBruteLoss(damage_amount)
@@ -1996,8 +1986,6 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(BRAIN)
var/damage_amount = forced ? damage : damage * hit_percent * H.physiology.brain_mod
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, damage_amount)
if(AROUSAL) //Citadel edit - arousal
H.adjustArousalLoss(damage * hit_percent)
return 1
/datum/species/proc/on_hit(obj/item/projectile/P, mob/living/carbon/human/H)
@@ -2010,7 +1998,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/proc/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H)
// called before a projectile hit
return 0
return
/////////////
//BREATHING//
@@ -1,18 +1,18 @@
/datum/species/abductor
name = "Abductor"
id = "abductor"
say_mod = "gibbers"
sexes = FALSE
species_traits = list(NOBLOOD,NOEYES,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_CHUNKYFINGERS,TRAIT_NOHUNGER,TRAIT_NOBREATH)
mutanttongue = /obj/item/organ/tongue/abductor
/datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
abductor_hud.add_hud_to(C)
/datum/species/abductor/on_species_loss(mob/living/carbon/C)
. = ..()
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
abductor_hud.remove_hud_from(C)
/datum/species/abductor
name = "Abductor"
id = "abductor"
say_mod = "gibbers"
sexes = FALSE
species_traits = list(NOBLOOD,NOEYES,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_VIRUSIMMUNE,TRAIT_CHUNKYFINGERS,TRAIT_NOHUNGER,TRAIT_NOBREATH)
mutanttongue = /obj/item/organ/tongue/abductor
/datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
abductor_hud.add_hud_to(C)
/datum/species/abductor/on_species_loss(mob/living/carbon/C)
. = ..()
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
abductor_hud.remove_hud_from(C)
@@ -1,24 +1,24 @@
/datum/species/android
name = "Android"
id = "android"
say_mod = "states"
species_traits = list(NOBLOOD,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_NOFIRE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_LIMBATTACHMENT)
inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID)
meat = null
gib_types = /obj/effect/gibspawner/robot
damage_overlay_type = "synth"
mutanttongue = /obj/item/organ/tongue/robot
limbs_id = "synth"
/datum/species/android/on_species_gain(mob/living/carbon/C)
. = ..()
for(var/X in C.bodyparts)
var/obj/item/bodypart/O = X
O.change_bodypart_status(BODYPART_ROBOTIC, FALSE, TRUE)
/datum/species/android/on_species_loss(mob/living/carbon/C)
. = ..()
for(var/X in C.bodyparts)
var/obj/item/bodypart/O = X
O.change_bodypart_status(BODYPART_ORGANIC,FALSE, TRUE)
/datum/species/android
name = "Android"
id = "android"
say_mod = "states"
species_traits = list(NOBLOOD,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_NOFIRE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_LIMBATTACHMENT)
inherent_biotypes = list(MOB_ROBOTIC, MOB_HUMANOID)
meat = null
gib_types = /obj/effect/gibspawner/robot
damage_overlay_type = "synth"
mutanttongue = /obj/item/organ/tongue/robot
limbs_id = "synth"
/datum/species/android/on_species_gain(mob/living/carbon/C)
. = ..()
for(var/X in C.bodyparts)
var/obj/item/bodypart/O = X
O.change_bodypart_status(BODYPART_ROBOTIC, FALSE, TRUE)
/datum/species/android/on_species_loss(mob/living/carbon/C)
. = ..()
for(var/X in C.bodyparts)
var/obj/item/bodypart/O = X
O.change_bodypart_status(BODYPART_ORGANIC,FALSE, TRUE)
@@ -1,145 +1,145 @@
/datum/species/angel
name = "Angel"
id = "angel"
default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS)
mutant_bodyparts = list("wings")
default_features = list("mcolor" = "FFF", "tail_human" = "None", "ears" = "None", "wings" = "Angel")
use_skintones = 1
no_equip = list(SLOT_BACK)
blacklisted = 1
limbs_id = "human"
skinned_type = /obj/item/stack/sheet/animalhide/human
var/datum/action/innate/flight/fly
/datum/species/angel/on_species_gain(mob/living/carbon/human/H, datum/species/old_species)
..()
if(H.dna && H.dna.species && (H.dna.features["wings"] != "Angel"))
if(!("wings" in H.dna.species.mutant_bodyparts))
H.dna.species.mutant_bodyparts |= "wings"
H.dna.features["wings"] = "Angel"
H.update_body()
if(ishuman(H) && !fly)
fly = new
fly.Grant(H)
ADD_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT)
/datum/species/angel/on_species_loss(mob/living/carbon/human/H)
if(fly)
fly.Remove(H)
if(H.movement_type & FLYING)
H.setMovetype(H.movement_type & ~FLYING)
ToggleFlight(H,0)
if(H.dna && H.dna.species && (H.dna.features["wings"] == "Angel"))
if("wings" in H.dna.species.mutant_bodyparts)
H.dna.species.mutant_bodyparts -= "wings"
H.dna.features["wings"] = "None"
H.update_body()
REMOVE_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT)
..()
/datum/species/angel/spec_life(mob/living/carbon/human/H)
HandleFlight(H)
/datum/species/angel/proc/HandleFlight(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
if(!CanFly(H))
ToggleFlight(H,0)
return 0
return 1
else
return 0
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
if(H.stat || H.IsStun() || H.IsKnockdown())
return 0
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "Your suit blocks your wings from extending!")
return 0
var/turf/T = get_turf(H)
if(!T)
return 0
var/datum/gas_mixture/environment = T.return_air()
if(environment && !(environment.return_pressure() > 30))
to_chat(H, "<span class='warning'>The atmosphere is too thin for you to fly!</span>")
return 0
else
return 1
/datum/action/innate/flight
name = "Toggle Flight"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "flight"
/datum/action/innate/flight/Activate()
var/mob/living/carbon/human/H = owner
var/datum/species/angel/A = H.dna.species
if(A.CanFly(H))
if(H.movement_type & FLYING)
to_chat(H, "<span class='notice'>You settle gently back onto the ground...</span>")
A.ToggleFlight(H,0)
H.update_canmove()
else
to_chat(H, "<span class='notice'>You beat your wings and begin to hover gently above the ground...</span>")
H.resting = 0
A.ToggleFlight(H,1)
H.update_canmove()
/datum/species/angel/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
if(H.buckled)
buckled_obj = H.buckled
to_chat(H, "<span class='notice'>Your wings spazz out and launch you!</span>")
playsound(H.loc, 'sound/misc/slip.ogg', 50, 1, -3)
for(var/obj/item/I in H.held_items)
H.accident(I)
var/olddir = H.dir
H.stop_pulling()
if(buckled_obj)
buckled_obj.unbuckle_mob(H)
step(buckled_obj, olddir)
else
for(var/i=1, i<5, i++)
spawn (i)
step(H, olddir)
H.spin(1,1)
return 1
/datum/species/angel/spec_stun(mob/living/carbon/human/H,amount)
if(H.movement_type & FLYING)
ToggleFlight(H,0)
flyslip(H)
. = ..()
/datum/species/angel/negates_gravity(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
return 1
/datum/species/angel/space_move(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
return 1
/datum/species/angel/proc/ToggleFlight(mob/living/carbon/human/H,flight)
if(flight && CanFly(H))
stunmod = 2
speedmod = -0.35
H.setMovetype(H.movement_type | FLYING)
override_float = TRUE
H.pass_flags |= PASSTABLE
H.OpenWings()
else
stunmod = 1
speedmod = 0
H.setMovetype(H.movement_type & ~FLYING)
override_float = FALSE
H.pass_flags &= ~PASSTABLE
/datum/species/angel
name = "Angel"
id = "angel"
default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS)
mutant_bodyparts = list("wings")
default_features = list("mcolor" = "FFF", "tail_human" = "None", "ears" = "None", "wings" = "Angel")
use_skintones = 1
no_equip = list(SLOT_BACK)
blacklisted = 1
limbs_id = "human"
skinned_type = /obj/item/stack/sheet/animalhide/human
var/datum/action/innate/flight/fly
/datum/species/angel/on_species_gain(mob/living/carbon/human/H, datum/species/old_species)
..()
if(H.dna && H.dna.species && (H.dna.features["wings"] != "Angel"))
if(!("wings" in H.dna.species.mutant_bodyparts))
H.dna.species.mutant_bodyparts |= "wings"
H.dna.features["wings"] = "Angel"
H.update_body()
if(ishuman(H) && !fly)
fly = new
fly.Grant(H)
ADD_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT)
/datum/species/angel/on_species_loss(mob/living/carbon/human/H)
if(fly)
fly.Remove(H)
if(H.movement_type & FLYING)
H.setMovetype(H.movement_type & ~FLYING)
ToggleFlight(H,0)
if(H.dna && H.dna.species && (H.dna.features["wings"] == "Angel"))
if("wings" in H.dna.species.mutant_bodyparts)
H.dna.species.mutant_bodyparts -= "wings"
H.dna.features["wings"] = "None"
H.update_body()
REMOVE_TRAIT(H, TRAIT_HOLY, SPECIES_TRAIT)
..()
/datum/species/angel/spec_life(mob/living/carbon/human/H)
HandleFlight(H)
/datum/species/angel/proc/HandleFlight(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
if(!CanFly(H))
ToggleFlight(H,0)
return 0
return 1
else
return 0
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
if(H.stat || H.IsStun() || H.IsKnockdown())
return 0
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "Your suit blocks your wings from extending!")
return 0
var/turf/T = get_turf(H)
if(!T)
return 0
var/datum/gas_mixture/environment = T.return_air()
if(environment && !(environment.return_pressure() > 30))
to_chat(H, "<span class='warning'>The atmosphere is too thin for you to fly!</span>")
return 0
else
return 1
/datum/action/innate/flight
name = "Toggle Flight"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUN
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "flight"
/datum/action/innate/flight/Activate()
var/mob/living/carbon/human/H = owner
var/datum/species/angel/A = H.dna.species
if(A.CanFly(H))
if(H.movement_type & FLYING)
to_chat(H, "<span class='notice'>You settle gently back onto the ground...</span>")
A.ToggleFlight(H,0)
H.update_canmove()
else
to_chat(H, "<span class='notice'>You beat your wings and begin to hover gently above the ground...</span>")
H.resting = 0
A.ToggleFlight(H,1)
H.update_canmove()
/datum/species/angel/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
if(H.buckled)
buckled_obj = H.buckled
to_chat(H, "<span class='notice'>Your wings spazz out and launch you!</span>")
playsound(H.loc, 'sound/misc/slip.ogg', 50, 1, -3)
for(var/obj/item/I in H.held_items)
H.accident(I)
var/olddir = H.dir
H.stop_pulling()
if(buckled_obj)
buckled_obj.unbuckle_mob(H)
step(buckled_obj, olddir)
else
for(var/i=1, i<5, i++)
spawn (i)
step(H, olddir)
H.spin(1,1)
return 1
/datum/species/angel/spec_stun(mob/living/carbon/human/H,amount)
if(H.movement_type & FLYING)
ToggleFlight(H,0)
flyslip(H)
. = ..()
/datum/species/angel/negates_gravity(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
return 1
/datum/species/angel/space_move(mob/living/carbon/human/H)
if(H.movement_type & FLYING)
return 1
/datum/species/angel/proc/ToggleFlight(mob/living/carbon/human/H,flight)
if(flight && CanFly(H))
stunmod = 2
speedmod = -0.35
H.setMovetype(H.movement_type | FLYING)
override_float = TRUE
H.pass_flags |= PASSTABLE
H.OpenWings()
else
stunmod = 1
speedmod = 0
H.setMovetype(H.movement_type & ~FLYING)
override_float = FALSE
H.pass_flags &= ~PASSTABLE
H.CloseWings()
@@ -1,36 +1,36 @@
/datum/species/fly
name = "Anthromorphic Fly"
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("<span class='danger'>[H] vomits on the floor!</span>", \
"<span class='userdanger'>You throw up on the floor!</span>")
..()
/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 = "Anthromorphic Fly"
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("<span class='danger'>[H] vomits on the floor!</span>", \
"<span class='userdanger'>You throw up on the floor!</span>")
..()
/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
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,93 +1,93 @@
/datum/species/lizard
// Reptilian humanoids with scaled skin and tails.
name = "Anthromorphic Lizard"
id = "lizard"
say_mod = "hisses"
default_color = "00FF00"
species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,LIPS,HORNCOLOR,WINGCOLOR)
inherent_biotypes = list(MOB_ORGANIC, MOB_HUMANOID, MOB_REPTILE)
mutant_bodyparts = list("tail_lizard", "snout", "spines", "horns", "frills", "body_markings", "legs", "taur", "deco_wings")
mutanttongue = /obj/item/organ/tongue/lizard
mutanttail = /obj/item/organ/tail/lizard
coldmod = 1.5
heatmod = 0.67
default_features = list("mcolor" = "0F0", "mcolor2" = "0F0", "mcolor3" = "0F0", "tail_lizard" = "Smooth", "snout" = "Round",
"horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None",
"legs" = "Digitigrade", "taur" = "None", "deco_wings" = "None")
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
gib_types = list(/obj/effect/gibspawner/lizard, /obj/effect/gibspawner/lizard/bodypartless)
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
/datum/species/lizard/qualifies_for_rank(rank, list/features)
return TRUE
//I wag in death
/datum/species/lizard/spec_death(gibbed, mob/living/carbon/human/H)
if(H)
stop_wagging_tail(H)
/datum/species/lizard/spec_stun(mob/living/carbon/human/H,amount)
if(H)
stop_wagging_tail(H)
. = ..()
/datum/species/lizard/can_wag_tail(mob/living/carbon/human/H)
return ("tail_lizard" in mutant_bodyparts) || ("waggingtail_lizard" in mutant_bodyparts)
/datum/species/lizard/is_wagging_tail(mob/living/carbon/human/H)
return ("waggingtail_lizard" in mutant_bodyparts)
/datum/species/lizard/start_wagging_tail(mob/living/carbon/human/H)
if("tail_lizard" in mutant_bodyparts)
mutant_bodyparts -= "tail_lizard"
mutant_bodyparts -= "spines"
mutant_bodyparts |= "waggingtail_lizard"
mutant_bodyparts |= "waggingspines"
H.update_body()
/datum/species/lizard/stop_wagging_tail(mob/living/carbon/human/H)
if("waggingtail_lizard" in mutant_bodyparts)
mutant_bodyparts -= "waggingtail_lizard"
mutant_bodyparts -= "waggingspines"
mutant_bodyparts |= "tail_lizard"
mutant_bodyparts |= "spines"
H.update_body()
/*
Lizard subspecies: ASHWALKERS
*/
/datum/species/lizard/ashwalker
name = "Ash Walker"
id = "ashlizard"
limbs_id = "lizard"
species_traits = list(MUTCOLORS,EYECOLOR,LIPS,DIGITIGRADE)
inherent_traits = list(TRAIT_CHUNKYFINGERS)
mutantlungs = /obj/item/organ/lungs/ashwalker
burnmod = 0.9
brutemod = 0.9
/datum/species/lizard/ashwalker/on_species_gain(mob/living/carbon/human/C, datum/species/old_species)
if((C.dna.features["spines"] != "None" ) && (C.dna.features["tail_lizard"] == "None")) //tbh, it's kinda ugly for them not to have a tail yet have floating spines
C.dna.features["tail_lizard"] = "Smooth"
C.update_body()
return ..()
/datum/species/lizard
// Reptilian humanoids with scaled skin and tails.
name = "Anthromorphic Lizard"
id = "lizard"
say_mod = "hisses"
default_color = "00FF00"
species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,LIPS,HORNCOLOR,WINGCOLOR)
inherent_biotypes = list(MOB_ORGANIC, MOB_HUMANOID, MOB_REPTILE)
mutant_bodyparts = list("tail_lizard", "snout", "spines", "horns", "frills", "body_markings", "legs", "taur", "deco_wings")
mutanttongue = /obj/item/organ/tongue/lizard
mutanttail = /obj/item/organ/tail/lizard
coldmod = 1.5
heatmod = 0.67
default_features = list("mcolor" = "0F0", "mcolor2" = "0F0", "mcolor3" = "0F0", "tail_lizard" = "Smooth", "snout" = "Round",
"horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None",
"legs" = "Digitigrade", "taur" = "None", "deco_wings" = "None")
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
gib_types = list(/obj/effect/gibspawner/lizard, /obj/effect/gibspawner/lizard/bodypartless)
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
/datum/species/lizard/qualifies_for_rank(rank, list/features)
return TRUE
//I wag in death
/datum/species/lizard/spec_death(gibbed, mob/living/carbon/human/H)
if(H)
stop_wagging_tail(H)
/datum/species/lizard/spec_stun(mob/living/carbon/human/H,amount)
if(H)
stop_wagging_tail(H)
. = ..()
/datum/species/lizard/can_wag_tail(mob/living/carbon/human/H)
return ("tail_lizard" in mutant_bodyparts) || ("waggingtail_lizard" in mutant_bodyparts)
/datum/species/lizard/is_wagging_tail(mob/living/carbon/human/H)
return ("waggingtail_lizard" in mutant_bodyparts)
/datum/species/lizard/start_wagging_tail(mob/living/carbon/human/H)
if("tail_lizard" in mutant_bodyparts)
mutant_bodyparts -= "tail_lizard"
mutant_bodyparts -= "spines"
mutant_bodyparts |= "waggingtail_lizard"
mutant_bodyparts |= "waggingspines"
H.update_body()
/datum/species/lizard/stop_wagging_tail(mob/living/carbon/human/H)
if("waggingtail_lizard" in mutant_bodyparts)
mutant_bodyparts -= "waggingtail_lizard"
mutant_bodyparts -= "waggingspines"
mutant_bodyparts |= "tail_lizard"
mutant_bodyparts |= "spines"
H.update_body()
/*
Lizard subspecies: ASHWALKERS
*/
/datum/species/lizard/ashwalker
name = "Ash Walker"
id = "ashlizard"
limbs_id = "lizard"
species_traits = list(MUTCOLORS,EYECOLOR,LIPS,DIGITIGRADE)
inherent_traits = list(TRAIT_CHUNKYFINGERS)
mutantlungs = /obj/item/organ/lungs/ashwalker
burnmod = 0.9
brutemod = 0.9
/datum/species/lizard/ashwalker/on_species_gain(mob/living/carbon/human/C, datum/species/old_species)
if((C.dna.features["spines"] != "None" ) && (C.dna.features["tail_lizard"] == "None")) //tbh, it's kinda ugly for them not to have a tail yet have floating spines
C.dna.features["tail_lizard"] = "Smooth"
C.update_body()
return ..()
@@ -1,155 +1,155 @@
/datum/species/plasmaman
name = "Plasmaman"
id = "plasmaman"
say_mod = "rattles"
sexes = 0
meat = /obj/item/stack/sheet/mineral/plasma
species_traits = list(NOBLOOD,NOTRANSSTING,NOGENITALS)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_NOHUNGER,TRAIT_CALCIUM_HEALER)
inherent_biotypes = list(MOB_INORGANIC, MOB_HUMANOID)
mutantlungs = /obj/item/organ/lungs/plasmaman
mutanttongue = /obj/item/organ/tongue/bone/plasmaman
mutantliver = /obj/item/organ/liver/plasmaman
mutantstomach = /obj/item/organ/stomach/plasmaman
dangerous_existence = 1 //So so much
blacklisted = 1 //See above
burnmod = 1.5
heatmod = 1.5
breathid = "tox"
damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
var/internal_fire = FALSE //If the bones themselves are burning clothes won't help you much
disliked_food = FRUIT
liked_food = VEGETABLES
/datum/species/plasmaman/spec_life(mob/living/carbon/human/H)
var/datum/gas_mixture/environment = H.loc.return_air()
var/atmos_sealed = FALSE
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 & STOPSPRESSUREDAMAGE)
atmos_sealed = TRUE
if((!istype(H.w_uniform, /obj/item/clothing/under/plasmaman) || !istype(H.head, /obj/item/clothing/head/helmet/space/plasmaman)) && !atmos_sealed)
if(environment)
if(environment.total_moles())
if(environment.gases[/datum/gas/oxygen] && (environment.gases[/datum/gas/oxygen]) >= 1) //Same threshhold that extinguishes fire
H.adjust_fire_stacks(0.5)
if(!H.on_fire && H.fire_stacks > 0)
H.visible_message("<span class='danger'>[H]'s body reacts with the atmosphere and bursts into flames!</span>","<span class='userdanger'>Your body reacts with the atmosphere and bursts into flame!</span>")
H.IgniteMob()
internal_fire = TRUE
else
if(H.fire_stacks)
var/obj/item/clothing/under/plasmaman/P = H.w_uniform
if(istype(P))
P.Extinguish(H)
internal_fire = FALSE
else
internal_fire = FALSE
H.update_fire()
/datum/species/plasmaman/handle_fire(mob/living/carbon/human/H, no_protection)
if(internal_fire)
no_protection = TRUE
..()
/datum/species/plasmaman/before_equip_job(datum/job/J, mob/living/carbon/human/H, visualsOnly = FALSE)
var/current_job = J.title
var/datum/outfit/plasmaman/O = new /datum/outfit/plasmaman
switch(current_job)
if("Chaplain")
O = new /datum/outfit/plasmaman/chaplain
if("Curator")
O = new /datum/outfit/plasmaman/curator
if("Janitor")
O = new /datum/outfit/plasmaman/janitor
if("Botanist")
O = new /datum/outfit/plasmaman/botany
if("Bartender", "Lawyer")
O = new /datum/outfit/plasmaman/bar
if("Cook")
O = new /datum/outfit/plasmaman/chef
if("Security Officer")
O = new /datum/outfit/plasmaman/security
if("Detective")
O = new /datum/outfit/plasmaman/detective
if("Warden")
O = new /datum/outfit/plasmaman/warden
if("Cargo Technician", "Quartermaster")
O = new /datum/outfit/plasmaman/cargo
if("Shaft Miner")
O = new /datum/outfit/plasmaman/mining
if("Medical Doctor")
O = new /datum/outfit/plasmaman/medical
if("Chemist")
O = new /datum/outfit/plasmaman/chemist
if("Geneticist")
O = new /datum/outfit/plasmaman/genetics
if("Roboticist")
O = new /datum/outfit/plasmaman/robotics
if("Virologist")
O = new /datum/outfit/plasmaman/viro
if("Scientist")
O = new /datum/outfit/plasmaman/science
if("Station Engineer")
O = new /datum/outfit/plasmaman/engineering
if("Atmospheric Technician")
O = new /datum/outfit/plasmaman/atmospherics
if("Captain")
O = new /datum/outfit/plasmaman/captain
if("Head of Personnel")
O = new /datum/outfit/plasmaman/hop
if("Head of Security")
O = new /datum/outfit/plasmaman/hos
if("Chief Engineer")
O = new /datum/outfit/plasmaman/ce
if("Chief Medical Officer")
O = new /datum/outfit/plasmaman/cmo
if("Research Director")
O = new /datum/outfit/plasmaman/rd
if("Mime")
O = new /datum/outfit/plasmaman/mime
if("Clown")
O = new /datum/outfit/plasmaman/clown
H.equipOutfit(O, visualsOnly)
H.internal = H.get_item_for_held_index(2)
H.update_internals_hud_icon(1)
return 0
/datum/species/plasmaman/random_name(gender,unique,lastname)
if(unique)
return random_unique_plasmaman_name()
var/randname = plasmaman_name()
if(lastname)
randname += " [lastname]"
return randname
/datum/species/plasmaman
name = "Plasmaman"
id = "plasmaman"
say_mod = "rattles"
sexes = 0
meat = /obj/item/stack/sheet/mineral/plasma
species_traits = list(NOBLOOD,NOTRANSSTING,NOGENITALS)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_NOHUNGER,TRAIT_CALCIUM_HEALER)
inherent_biotypes = list(MOB_INORGANIC, MOB_HUMANOID)
mutantlungs = /obj/item/organ/lungs/plasmaman
mutanttongue = /obj/item/organ/tongue/bone/plasmaman
mutantliver = /obj/item/organ/liver/plasmaman
mutantstomach = /obj/item/organ/stomach/plasmaman
dangerous_existence = 1 //So so much
blacklisted = 1 //See above
burnmod = 1.5
heatmod = 1.5
breathid = "tox"
damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
var/internal_fire = FALSE //If the bones themselves are burning clothes won't help you much
disliked_food = FRUIT
liked_food = VEGETABLES
/datum/species/plasmaman/spec_life(mob/living/carbon/human/H)
var/datum/gas_mixture/environment = H.loc.return_air()
var/atmos_sealed = FALSE
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 & STOPSPRESSUREDAMAGE)
atmos_sealed = TRUE
if((!istype(H.w_uniform, /obj/item/clothing/under/plasmaman) || !istype(H.head, /obj/item/clothing/head/helmet/space/plasmaman)) && !atmos_sealed)
if(environment)
if(environment.total_moles())
if(environment.gases[/datum/gas/oxygen] && (environment.gases[/datum/gas/oxygen]) >= 1) //Same threshhold that extinguishes fire
H.adjust_fire_stacks(0.5)
if(!H.on_fire && H.fire_stacks > 0)
H.visible_message("<span class='danger'>[H]'s body reacts with the atmosphere and bursts into flames!</span>","<span class='userdanger'>Your body reacts with the atmosphere and bursts into flame!</span>")
H.IgniteMob()
internal_fire = TRUE
else
if(H.fire_stacks)
var/obj/item/clothing/under/plasmaman/P = H.w_uniform
if(istype(P))
P.Extinguish(H)
internal_fire = FALSE
else
internal_fire = FALSE
H.update_fire()
/datum/species/plasmaman/handle_fire(mob/living/carbon/human/H, no_protection)
if(internal_fire)
no_protection = TRUE
..()
/datum/species/plasmaman/before_equip_job(datum/job/J, mob/living/carbon/human/H, visualsOnly = FALSE)
var/current_job = J.title
var/datum/outfit/plasmaman/O = new /datum/outfit/plasmaman
switch(current_job)
if("Chaplain")
O = new /datum/outfit/plasmaman/chaplain
if("Curator")
O = new /datum/outfit/plasmaman/curator
if("Janitor")
O = new /datum/outfit/plasmaman/janitor
if("Botanist")
O = new /datum/outfit/plasmaman/botany
if("Bartender", "Lawyer")
O = new /datum/outfit/plasmaman/bar
if("Cook")
O = new /datum/outfit/plasmaman/chef
if("Security Officer")
O = new /datum/outfit/plasmaman/security
if("Detective")
O = new /datum/outfit/plasmaman/detective
if("Warden")
O = new /datum/outfit/plasmaman/warden
if("Cargo Technician", "Quartermaster")
O = new /datum/outfit/plasmaman/cargo
if("Shaft Miner")
O = new /datum/outfit/plasmaman/mining
if("Medical Doctor")
O = new /datum/outfit/plasmaman/medical
if("Chemist")
O = new /datum/outfit/plasmaman/chemist
if("Geneticist")
O = new /datum/outfit/plasmaman/genetics
if("Roboticist")
O = new /datum/outfit/plasmaman/robotics
if("Virologist")
O = new /datum/outfit/plasmaman/viro
if("Scientist")
O = new /datum/outfit/plasmaman/science
if("Station Engineer")
O = new /datum/outfit/plasmaman/engineering
if("Atmospheric Technician")
O = new /datum/outfit/plasmaman/atmospherics
if("Captain")
O = new /datum/outfit/plasmaman/captain
if("Head of Personnel")
O = new /datum/outfit/plasmaman/hop
if("Head of Security")
O = new /datum/outfit/plasmaman/hos
if("Chief Engineer")
O = new /datum/outfit/plasmaman/ce
if("Chief Medical Officer")
O = new /datum/outfit/plasmaman/cmo
if("Research Director")
O = new /datum/outfit/plasmaman/rd
if("Mime")
O = new /datum/outfit/plasmaman/mime
if("Clown")
O = new /datum/outfit/plasmaman/clown
H.equipOutfit(O, visualsOnly)
H.internal = H.get_item_for_held_index(2)
H.update_internals_hud_icon(1)
return 0
/datum/species/plasmaman/random_name(gender,unique,lastname)
if(unique)
return random_unique_plasmaman_name()
var/randname = plasmaman_name()
if(lastname)
randname += " [lastname]"
return randname
@@ -1,222 +1,222 @@
#define HEART_RESPAWN_THRESHHOLD 40
#define HEART_SPECIAL_SHADOWIFY 2
/datum/species/shadow
// Humans cursed to stay in the darkness, lest their life forces drain. They regain health in shadow and die in light.
name = "???"
id = "shadow"
sexes = 0
blacklisted = 1
ignored_by = list(/mob/living/simple_animal/hostile/faithless)
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/shadow
species_traits = list(NOBLOOD,NOEYES)
inherent_traits = list(TRAIT_RADIMMUNE,TRAIT_VIRUSIMMUNE,TRAIT_NOBREATH)
dangerous_existence = 1
mutanteyes = /obj/item/organ/eyes/night_vision
/datum/species/shadow/spec_life(mob/living/carbon/human/H)
var/turf/T = H.loc
if(istype(T))
var/light_amount = T.get_lumcount()
if(light_amount > SHADOW_SPECIES_LIGHT_THRESHOLD) //if there's enough light, start dying
H.take_overall_damage(1,1)
else if (light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) //heal in the dark
H.heal_overall_damage(1,1)
/datum/species/shadow/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN])
return TRUE
return ..()
/datum/species/shadow/nightmare
name = "Nightmare"
id = "nightmare"
limbs_id = "shadow"
burnmod = 1.5
blacklisted = TRUE
no_equip = list(SLOT_WEAR_MASK, SLOT_WEAR_SUIT, SLOT_GLOVES, SLOT_SHOES, SLOT_W_UNIFORM, SLOT_S_STORE)
species_traits = list(NOBLOOD,NO_UNDERWEAR,NO_DNA_COPY,NOTRANSSTING,NOEYES,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_NOBREATH,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_CHUNKYFINGERS,TRAIT_RADIMMUNE,TRAIT_VIRUSIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOHUNGER)
mutanteyes = /obj/item/organ/eyes/night_vision/nightmare
mutant_organs = list(/obj/item/organ/heart/nightmare)
mutant_brain = /obj/item/organ/brain/nightmare
var/info_text = "You are a <span class='danger'>Nightmare</span>. The ability <span class='warning'>shadow walk</span> allows unlimited, unrestricted movement in the dark while activated. \
Your <span class='warning'>light eater</span> will destroy any light producing objects you attack, as well as destroy any lights a living creature may be holding. You will automatically dodge gunfire and melee attacks when on a dark tile. If killed, you will eventually revive if left in darkness."
/datum/species/shadow/nightmare/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
to_chat(C, "[info_text]")
C.fully_replace_character_name("[pick(GLOB.nightmare_names)]")
/datum/species/shadow/nightmare/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H)
var/turf/T = H.loc
if(istype(T))
var/light_amount = T.get_lumcount()
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
H.visible_message("<span class='danger'>[H] dances in the shadows, evading [P]!</span>")
playsound(T, "bullet_miss", 75, 1)
return -1
return 0
/datum/species/shadow/nightmare/check_roundstart_eligible()
return FALSE
//Organs
/obj/item/organ/brain/nightmare
name = "tumorous mass"
desc = "A fleshy growth that was dug out of the skull of a Nightmare."
icon_state = "brain-x-d"
var/obj/effect/proc_holder/spell/targeted/shadowwalk/shadowwalk
/obj/item/organ/brain/nightmare/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
..()
if(M.dna.species.id != "nightmare")
M.set_species(/datum/species/shadow/nightmare)
visible_message("<span class='warning'>[M] thrashes as [src] takes root in [M.p_their()] body!</span>")
var/obj/effect/proc_holder/spell/targeted/shadowwalk/SW = new
M.AddSpell(SW)
shadowwalk = SW
/obj/item/organ/brain/nightmare/Remove(mob/living/carbon/M, special = 0)
if(shadowwalk)
M.RemoveSpell(shadowwalk)
..()
/obj/item/organ/heart/nightmare
name = "heart of darkness"
desc = "An alien organ that twists and writhes when exposed to light."
icon = 'icons/obj/surgery.dmi'
icon_state = "demon_heart-on"
color = "#1C1C1C"
var/respawn_progress = 0
var/obj/item/light_eater/blade
decay_factor = 0
/obj/item/organ/heart/nightmare/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
return ..()
user.visible_message("<span class='warning'>[user] raises [src] to [user.p_their()] mouth and tears into it with [user.p_their()] teeth!</span>", \
"<span class='danger'>[src] feels unnaturally cold in your hands. You raise [src] your mouth and devour it!</span>")
playsound(user, 'sound/magic/demon_consume.ogg', 50, 1)
user.visible_message("<span class='warning'>Blood erupts from [user]'s arm as it reforms into a weapon!</span>", \
"<span class='userdanger'>Icy blood pumps through your veins as your arm reforms itself!</span>")
user.temporarilyRemoveItemFromInventory(src, TRUE)
Insert(user)
/obj/item/organ/heart/nightmare/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
..()
if(special != HEART_SPECIAL_SHADOWIFY)
blade = new/obj/item/light_eater
M.put_in_hands(blade)
/obj/item/organ/heart/nightmare/Remove(mob/living/carbon/M, special = 0)
respawn_progress = 0
if(blade && special != HEART_SPECIAL_SHADOWIFY)
M.visible_message("<span class='warning'>\The [blade] disintegrates!</span>")
QDEL_NULL(blade)
..()
/obj/item/organ/heart/nightmare/Stop()
return 0
/obj/item/organ/heart/nightmare/update_icon()
return //always beating visually
/obj/item/organ/heart/nightmare/on_death()
if(!owner)
return
var/turf/T = get_turf(owner)
if(istype(T))
var/light_amount = T.get_lumcount()
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
respawn_progress++
playsound(owner,'sound/effects/singlebeat.ogg',40,1)
if(respawn_progress >= HEART_RESPAWN_THRESHHOLD)
owner.revive(full_heal = TRUE)
if(!(owner.dna.species.id == "shadow" || owner.dna.species.id == "nightmare"))
var/mob/living/carbon/old_owner = owner
Remove(owner, HEART_SPECIAL_SHADOWIFY)
old_owner.set_species(/datum/species/shadow)
Insert(old_owner, HEART_SPECIAL_SHADOWIFY)
to_chat(owner, "<span class='userdanger'>You feel the shadows invade your skin, leaping into the center of your chest! You're alive!</span>")
SEND_SOUND(owner, sound('sound/effects/ghost.ogg'))
owner.visible_message("<span class='warning'>[owner] staggers to [owner.p_their()] feet!</span>")
playsound(owner, 'sound/hallucinations/far_noise.ogg', 50, 1)
respawn_progress = 0
//Weapon
/obj/item/light_eater
name = "light eater" //as opposed to heavy eater
icon_state = "arm_blade"
item_state = "arm_blade"
force = 25
armour_penetration = 35
lefthand_file = 'icons/mob/inhands/antag/changeling_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/changeling_righthand.dmi'
item_flags = ABSTRACT | DROPDEL
w_class = WEIGHT_CLASS_HUGE
sharpness = IS_SHARP
total_mass = TOTAL_MASS_HAND_REPLACEMENT
/obj/item/light_eater/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
AddComponent(/datum/component/butchering, 80, 70)
/obj/item/light_eater/afterattack(atom/movable/AM, mob/user, proximity)
. = ..()
if(!proximity)
return
if(isopenturf(AM))
var/turf/open/T = AM
if(T.light_range && !isspaceturf(T)) //no fairy grass or light tile can escape the fury of the darkness.
to_chat(user, "<span class='notice'>You scrape away [T] with your [name] and snuff out its lights.</span>")
T.ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
else if(isliving(AM))
var/mob/living/L = AM
if(iscyborg(AM))
var/mob/living/silicon/robot/borg = AM
if(borg.lamp_intensity)
borg.update_headlamp(TRUE, INFINITY)
to_chat(borg, "<span class='danger'>Your headlamp is fried! You'll need a human to help replace it.</span>")
for(var/obj/item/assembly/flash/cyborg/F in borg.held_items)
if(!F.crit_fail)
F.burn_out()
else
for(var/obj/item/O in AM)
if(O.light_range && O.light_power)
disintegrate(O)
if(L.pulling && L.pulling.light_range && isitem(L.pulling))
disintegrate(L.pulling)
else if(isitem(AM))
var/obj/item/I = AM
if(I.light_range && I.light_power)
disintegrate(I)
/obj/item/light_eater/proc/disintegrate(obj/item/O)
if(istype(O, /obj/item/pda))
var/obj/item/pda/PDA = O
PDA.set_light(0)
PDA.fon = FALSE
PDA.f_lum = 0
PDA.update_icon()
visible_message("<span class='danger'>The light in [PDA] shorts out!</span>")
else
visible_message("<span class='danger'>[O] is disintegrated by [src]!</span>")
O.burn()
playsound(src, 'sound/items/welder.ogg', 50, 1)
#undef HEART_SPECIAL_SHADOWIFY
#undef HEART_RESPAWN_THRESHHOLD
#define HEART_RESPAWN_THRESHHOLD 40
#define HEART_SPECIAL_SHADOWIFY 2
/datum/species/shadow
// Humans cursed to stay in the darkness, lest their life forces drain. They regain health in shadow and die in light.
name = "???"
id = "shadow"
sexes = 0
blacklisted = 1
ignored_by = list(/mob/living/simple_animal/hostile/faithless)
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/shadow
species_traits = list(NOBLOOD,NOEYES)
inherent_traits = list(TRAIT_RADIMMUNE,TRAIT_VIRUSIMMUNE,TRAIT_NOBREATH)
dangerous_existence = 1
mutanteyes = /obj/item/organ/eyes/night_vision
/datum/species/shadow/spec_life(mob/living/carbon/human/H)
var/turf/T = H.loc
if(istype(T))
var/light_amount = T.get_lumcount()
if(light_amount > SHADOW_SPECIES_LIGHT_THRESHOLD) //if there's enough light, start dying
H.take_overall_damage(1,1)
else if (light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD) //heal in the dark
H.heal_overall_damage(1,1)
/datum/species/shadow/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN])
return TRUE
return ..()
/datum/species/shadow/nightmare
name = "Nightmare"
id = "nightmare"
limbs_id = "shadow"
burnmod = 1.5
blacklisted = TRUE
no_equip = list(SLOT_WEAR_MASK, SLOT_WEAR_SUIT, SLOT_GLOVES, SLOT_SHOES, SLOT_W_UNIFORM, SLOT_S_STORE)
species_traits = list(NOBLOOD,NO_UNDERWEAR,NO_DNA_COPY,NOTRANSSTING,NOEYES,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_NOBREATH,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_CHUNKYFINGERS,TRAIT_RADIMMUNE,TRAIT_VIRUSIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NODISMEMBER,TRAIT_NOHUNGER)
mutanteyes = /obj/item/organ/eyes/night_vision/nightmare
mutant_organs = list(/obj/item/organ/heart/nightmare)
mutant_brain = /obj/item/organ/brain/nightmare
var/info_text = "You are a <span class='danger'>Nightmare</span>. The ability <span class='warning'>shadow walk</span> allows unlimited, unrestricted movement in the dark while activated. \
Your <span class='warning'>light eater</span> will destroy any light producing objects you attack, as well as destroy any lights a living creature may be holding. You will automatically dodge gunfire and melee attacks when on a dark tile. If killed, you will eventually revive if left in darkness."
/datum/species/shadow/nightmare/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
to_chat(C, "[info_text]")
C.fully_replace_character_name("[pick(GLOB.nightmare_names)]")
/datum/species/shadow/nightmare/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H)
var/turf/T = H.loc
if(istype(T))
var/light_amount = T.get_lumcount()
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
H.visible_message("<span class='danger'>[H] dances in the shadows, evading [P]!</span>")
playsound(T, "bullet_miss", 75, 1)
return BULLET_ACT_FORCE_PIERCE
return ..()
/datum/species/shadow/nightmare/check_roundstart_eligible()
return FALSE
//Organs
/obj/item/organ/brain/nightmare
name = "tumorous mass"
desc = "A fleshy growth that was dug out of the skull of a Nightmare."
icon_state = "brain-x-d"
var/obj/effect/proc_holder/spell/targeted/shadowwalk/shadowwalk
/obj/item/organ/brain/nightmare/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
..()
if(M.dna.species.id != "nightmare")
M.set_species(/datum/species/shadow/nightmare)
visible_message("<span class='warning'>[M] thrashes as [src] takes root in [M.p_their()] body!</span>")
var/obj/effect/proc_holder/spell/targeted/shadowwalk/SW = new
M.AddSpell(SW)
shadowwalk = SW
/obj/item/organ/brain/nightmare/Remove(mob/living/carbon/M, special = 0)
if(shadowwalk)
M.RemoveSpell(shadowwalk)
..()
/obj/item/organ/heart/nightmare
name = "heart of darkness"
desc = "An alien organ that twists and writhes when exposed to light."
icon = 'icons/obj/surgery.dmi'
icon_state = "demon_heart-on"
color = "#1C1C1C"
var/respawn_progress = 0
var/obj/item/light_eater/blade
decay_factor = 0
/obj/item/organ/heart/nightmare/attack(mob/M, mob/living/carbon/user, obj/target)
if(M != user)
return ..()
user.visible_message("<span class='warning'>[user] raises [src] to [user.p_their()] mouth and tears into it with [user.p_their()] teeth!</span>", \
"<span class='danger'>[src] feels unnaturally cold in your hands. You raise [src] your mouth and devour it!</span>")
playsound(user, 'sound/magic/demon_consume.ogg', 50, 1)
user.visible_message("<span class='warning'>Blood erupts from [user]'s arm as it reforms into a weapon!</span>", \
"<span class='userdanger'>Icy blood pumps through your veins as your arm reforms itself!</span>")
user.temporarilyRemoveItemFromInventory(src, TRUE)
Insert(user)
/obj/item/organ/heart/nightmare/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
..()
if(special != HEART_SPECIAL_SHADOWIFY)
blade = new/obj/item/light_eater
M.put_in_hands(blade)
/obj/item/organ/heart/nightmare/Remove(mob/living/carbon/M, special = 0)
respawn_progress = 0
if(blade && special != HEART_SPECIAL_SHADOWIFY)
M.visible_message("<span class='warning'>\The [blade] disintegrates!</span>")
QDEL_NULL(blade)
..()
/obj/item/organ/heart/nightmare/Stop()
return 0
/obj/item/organ/heart/nightmare/update_icon()
return //always beating visually
/obj/item/organ/heart/nightmare/on_death()
if(!owner)
return
var/turf/T = get_turf(owner)
if(istype(T))
var/light_amount = T.get_lumcount()
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
respawn_progress++
playsound(owner,'sound/effects/singlebeat.ogg',40,1)
if(respawn_progress >= HEART_RESPAWN_THRESHHOLD)
owner.revive(full_heal = TRUE)
if(!(owner.dna.species.id == "shadow" || owner.dna.species.id == "nightmare"))
var/mob/living/carbon/old_owner = owner
Remove(owner, HEART_SPECIAL_SHADOWIFY)
old_owner.set_species(/datum/species/shadow)
Insert(old_owner, HEART_SPECIAL_SHADOWIFY)
to_chat(owner, "<span class='userdanger'>You feel the shadows invade your skin, leaping into the center of your chest! You're alive!</span>")
SEND_SOUND(owner, sound('sound/effects/ghost.ogg'))
owner.visible_message("<span class='warning'>[owner] staggers to [owner.p_their()] feet!</span>")
playsound(owner, 'sound/hallucinations/far_noise.ogg', 50, 1)
respawn_progress = 0
//Weapon
/obj/item/light_eater
name = "light eater" //as opposed to heavy eater
icon_state = "arm_blade"
item_state = "arm_blade"
force = 25
armour_penetration = 35
lefthand_file = 'icons/mob/inhands/antag/changeling_lefthand.dmi'
righthand_file = 'icons/mob/inhands/antag/changeling_righthand.dmi'
item_flags = ABSTRACT | DROPDEL
w_class = WEIGHT_CLASS_HUGE
sharpness = IS_SHARP
total_mass = TOTAL_MASS_HAND_REPLACEMENT
/obj/item/light_eater/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT)
AddComponent(/datum/component/butchering, 80, 70)
/obj/item/light_eater/afterattack(atom/movable/AM, mob/user, proximity)
. = ..()
if(!proximity)
return
if(isopenturf(AM))
var/turf/open/T = AM
if(T.light_range && !isspaceturf(T)) //no fairy grass or light tile can escape the fury of the darkness.
to_chat(user, "<span class='notice'>You scrape away [T] with your [name] and snuff out its lights.</span>")
T.ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
else if(isliving(AM))
var/mob/living/L = AM
if(iscyborg(AM))
var/mob/living/silicon/robot/borg = AM
if(borg.lamp_intensity)
borg.update_headlamp(TRUE, INFINITY)
to_chat(borg, "<span class='danger'>Your headlamp is fried! You'll need a human to help replace it.</span>")
for(var/obj/item/assembly/flash/cyborg/F in borg.held_items)
if(!F.crit_fail)
F.burn_out()
else
for(var/obj/item/O in AM)
if(O.light_range && O.light_power)
disintegrate(O)
if(L.pulling && L.pulling.light_range && isitem(L.pulling))
disintegrate(L.pulling)
else if(isitem(AM))
var/obj/item/I = AM
if(I.light_range && I.light_power)
disintegrate(I)
/obj/item/light_eater/proc/disintegrate(obj/item/O)
if(istype(O, /obj/item/pda))
var/obj/item/pda/PDA = O
PDA.set_light(0)
PDA.fon = FALSE
PDA.f_lum = 0
PDA.update_icon()
visible_message("<span class='danger'>The light in [PDA] shorts out!</span>")
else
visible_message("<span class='danger'>[O] is disintegrated by [src]!</span>")
O.burn()
playsound(src, 'sound/items/welder.ogg', 50, 1)
#undef HEART_SPECIAL_SHADOWIFY
#undef HEART_RESPAWN_THRESHHOLD
@@ -1,30 +1,30 @@
/datum/species/skeleton
// 2spooky
name = "Spooky Scary Skeleton"
id = "skeleton"
say_mod = "rattles"
blacklisted = 0
sexes = 0
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/skeleton
species_traits = list(NOBLOOD,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_FAKEDEATH, TRAIT_CALCIUM_HEALER)
inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID)
mutanttongue = /obj/item/organ/tongue/bone
damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
disliked_food = NONE
liked_food = GROSS | MEAT | RAW | DAIRY
/datum/species/skeleton/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN])
return TRUE
return ..()
/datum/species/skeleton/space
name = "Spooky Spacey Skeleton"
id = "spaceskeleton"
limbs_id = "skeleton"
blacklisted = 1
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_FAKEDEATH, TRAIT_CALCIUM_HEALER)
/datum/species/skeleton/space/check_roundstart_eligible()
/datum/species/skeleton
// 2spooky
name = "Spooky Scary Skeleton"
id = "skeleton"
say_mod = "rattles"
blacklisted = 0
sexes = 0
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/skeleton
species_traits = list(NOBLOOD,NOGENITALS,NOAROUSAL)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_FAKEDEATH, TRAIT_CALCIUM_HEALER)
inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID)
mutanttongue = /obj/item/organ/tongue/bone
damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
disliked_food = NONE
liked_food = GROSS | MEAT | RAW | DAIRY
/datum/species/skeleton/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN])
return TRUE
return ..()
/datum/species/skeleton/space
name = "Spooky Spacey Skeleton"
id = "spaceskeleton"
limbs_id = "skeleton"
blacklisted = 1
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_FAKEDEATH, TRAIT_CALCIUM_HEALER)
/datum/species/skeleton/space/check_roundstart_eligible()
return FALSE
@@ -1,127 +1,127 @@
/datum/species/synth
name = "Synthetic" //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_NOLIMBDISABLE,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_NOLIMBDISABLE,TRAIT_NOHUNGER,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)
/datum/species/synth/on_species_loss(mob/living/carbon/human/H)
. = ..()
UnregisterSignal(H, COMSIG_MOB_SAY)
/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)
/datum/species/synth
name = "Synthetic" //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_NOLIMBDISABLE,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_NOLIMBDISABLE,TRAIT_NOHUNGER,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)
/datum/species/synth/on_species_loss(mob/living/carbon/human/H)
. = ..()
UnregisterSignal(H, COMSIG_MOB_SAY)
/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
@@ -1,98 +1,98 @@
#define REGENERATION_DELAY 60 // After taking damage, how long it takes for automatic regeneration to begin
/datum/species/zombie
// 1spooky
name = "High-Functioning Zombie"
id = "zombie"
say_mod = "moans"
sexes = 0
blacklisted = 1
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/zombie
species_traits = list(NOBLOOD,NOZOMBIE,NOTRANSSTING)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NOBREATH,TRAIT_NODEATH,TRAIT_FAKEDEATH)
inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID)
mutanttongue = /obj/item/organ/tongue/zombie
var/static/list/spooks = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg')
disliked_food = NONE
liked_food = GROSS | MEAT | RAW
/datum/species/zombie/notspaceproof
id = "notspaceproofzombie"
limbs_id = "zombie"
blacklisted = 0
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NOBREATH,TRAIT_NODEATH,TRAIT_FAKEDEATH)
/datum/species/zombie/notspaceproof/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN])
return TRUE
return ..()
/datum/species/zombie/infectious
name = "Infectious Zombie"
id = "memezombies"
limbs_id = "zombie"
mutanthands = /obj/item/zombie_hand
armor = 20 // 120 damage to KO a zombie, which kills it
speedmod = 1.6
mutanteyes = /obj/item/organ/eyes/night_vision/zombie
var/heal_rate = 1
var/regen_cooldown = 0
/datum/species/zombie/infectious/check_roundstart_eligible()
return FALSE
/datum/species/zombie/infectious/spec_stun(mob/living/carbon/human/H,amount)
. = min(20, amount)
/datum/species/zombie/infectious/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE)
. = ..()
if(.)
regen_cooldown = world.time + REGENERATION_DELAY
/datum/species/zombie/infectious/spec_life(mob/living/carbon/C)
. = ..()
C.a_intent = INTENT_HARM // THE SUFFERING MUST FLOW
//Zombies never actually die, they just fall down until they regenerate enough to rise back up.
//They must be restrained, beheaded or gibbed to stop being a threat.
if(regen_cooldown < world.time)
var/heal_amt = heal_rate
if(C.InCritical())
heal_amt *= 2
C.heal_overall_damage(heal_amt,heal_amt)
C.adjustToxLoss(-heal_amt)
if(!C.InCritical() && prob(4))
playsound(C, pick(spooks), 50, TRUE, 10)
//Congrats you somehow died so hard you stopped being a zombie
/datum/species/zombie/infectious/spec_death(gibbed, mob/living/carbon/C)
. = ..()
var/obj/item/organ/zombie_infection/infection
infection = C.getorganslot(ORGAN_SLOT_ZOMBIE)
if(infection)
qdel(infection)
/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
// Deal with the source of this zombie corruption
// Infection organ needs to be handled separately from mutant_organs
// because it persists through species transitions
var/obj/item/organ/zombie_infection/infection
infection = C.getorganslot(ORGAN_SLOT_ZOMBIE)
if(!infection)
infection = new()
infection.Insert(C)
// Your skin falls off
/datum/species/krokodil_addict
name = "Human"
id = "goofzombies"
limbs_id = "zombie" //They look like zombies
sexes = 0
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/zombie
mutanttongue = /obj/item/organ/tongue/zombie
#undef REGENERATION_DELAY
#define REGENERATION_DELAY 60 // After taking damage, how long it takes for automatic regeneration to begin
/datum/species/zombie
// 1spooky
name = "High-Functioning Zombie"
id = "zombie"
say_mod = "moans"
sexes = 0
blacklisted = 1
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/zombie
species_traits = list(NOBLOOD,NOZOMBIE,NOTRANSSTING)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NOBREATH,TRAIT_NODEATH,TRAIT_FAKEDEATH)
inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID)
mutanttongue = /obj/item/organ/tongue/zombie
var/static/list/spooks = list('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg','sound/hallucinations/veryfar_noise.ogg','sound/hallucinations/wail.ogg')
disliked_food = NONE
liked_food = GROSS | MEAT | RAW
/datum/species/zombie/notspaceproof
id = "notspaceproofzombie"
limbs_id = "zombie"
blacklisted = 0
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_EASYDISMEMBER,TRAIT_LIMBATTACHMENT,TRAIT_NOBREATH,TRAIT_NODEATH,TRAIT_FAKEDEATH)
/datum/species/zombie/notspaceproof/check_roundstart_eligible()
if(SSevents.holidays && SSevents.holidays[HALLOWEEN])
return TRUE
return ..()
/datum/species/zombie/infectious
name = "Infectious Zombie"
id = "memezombies"
limbs_id = "zombie"
mutanthands = /obj/item/zombie_hand
armor = 20 // 120 damage to KO a zombie, which kills it
speedmod = 1.6
mutanteyes = /obj/item/organ/eyes/night_vision/zombie
var/heal_rate = 1
var/regen_cooldown = 0
/datum/species/zombie/infectious/check_roundstart_eligible()
return FALSE
/datum/species/zombie/infectious/spec_stun(mob/living/carbon/human/H,amount)
. = min(20, amount)
/datum/species/zombie/infectious/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H, forced = FALSE)
. = ..()
if(.)
regen_cooldown = world.time + REGENERATION_DELAY
/datum/species/zombie/infectious/spec_life(mob/living/carbon/C)
. = ..()
C.a_intent = INTENT_HARM // THE SUFFERING MUST FLOW
//Zombies never actually die, they just fall down until they regenerate enough to rise back up.
//They must be restrained, beheaded or gibbed to stop being a threat.
if(regen_cooldown < world.time)
var/heal_amt = heal_rate
if(C.InCritical())
heal_amt *= 2
C.heal_overall_damage(heal_amt,heal_amt)
C.adjustToxLoss(-heal_amt)
if(!C.InCritical() && prob(4))
playsound(C, pick(spooks), 50, TRUE, 10)
//Congrats you somehow died so hard you stopped being a zombie
/datum/species/zombie/infectious/spec_death(gibbed, mob/living/carbon/C)
. = ..()
var/obj/item/organ/zombie_infection/infection
infection = C.getorganslot(ORGAN_SLOT_ZOMBIE)
if(infection)
qdel(infection)
/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
// Deal with the source of this zombie corruption
// Infection organ needs to be handled separately from mutant_organs
// because it persists through species transitions
var/obj/item/organ/zombie_infection/infection
infection = C.getorganslot(ORGAN_SLOT_ZOMBIE)
if(!infection)
infection = new()
infection.Insert(C)
// Your skin falls off
/datum/species/krokodil_addict
name = "Human"
id = "goofzombies"
limbs_id = "zombie" //They look like zombies
sexes = 0
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/zombie
mutanttongue = /obj/item/organ/tongue/zombie
#undef REGENERATION_DELAY
+142 -142
View File
@@ -1,142 +1,142 @@
/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_BACK)
return back
if(SLOT_WEAR_MASK)
return wear_mask
if(SLOT_NECK)
return wear_neck
if(SLOT_HEAD)
return head
if(SLOT_HANDCUFFED)
return handcuffed
if(SLOT_LEGCUFFED)
return legcuffed
return null
/mob/living/carbon/proc/equip_in_one_of_slots(obj/item/I, list/slots, qdel_on_fail = 1)
for(var/slot in slots)
if(equip_to_slot_if_possible(I, slots[slot], qdel_on_fail = 0, disable_warning = TRUE))
return slot
if(qdel_on_fail)
qdel(I)
return null
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/equip_to_slot(obj/item/I, slot)
if(!slot)
return
if(!istype(I))
return
var/index = get_held_index_of_item(I)
if(index)
held_items[index] = null
if(I.pulledby)
I.pulledby.stop_pulling()
I.screen_loc = null
if(client)
client.screen -= I
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
if(observe.client)
observe.client.screen -= I
I.forceMove(src)
I.layer = ABOVE_HUD_LAYER
I.plane = ABOVE_HUD_PLANE
I.appearance_flags |= NO_CLIENT_COLOR
var/not_handled = FALSE
switch(slot)
if(SLOT_BACK)
back = I
update_inv_back()
if(SLOT_WEAR_MASK)
wear_mask = I
wear_mask_update(I, toggle_off = 0)
if(SLOT_HEAD)
head = I
head_update(I)
if(SLOT_NECK)
wear_neck = I
update_inv_neck(I)
if(SLOT_HANDCUFFED)
handcuffed = I
update_handcuffed()
if(SLOT_LEGCUFFED)
legcuffed = I
update_inv_legcuffed()
if(SLOT_HANDS)
put_in_hands(I)
update_inv_hands()
if(SLOT_IN_BACKPACK)
if(!SEND_SIGNAL(back, COMSIG_TRY_STORAGE_INSERT, I, src, TRUE))
not_handled = TRUE
else
not_handled = TRUE
//Item has been handled at this point and equipped callback can be safely called
//We cannot call it for items that have not been handled as they are not yet correctly
//in a slot (handled further down inheritance chain, probably living/carbon/human/equip_to_slot
if(!not_handled)
I.equipped(src, slot)
return not_handled
/mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE)
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
return
if(I == head)
head = null
if(!QDELETED(src))
head_update(I)
else if(I == back)
back = null
if(!QDELETED(src))
update_inv_back()
else if(I == wear_mask)
wear_mask = null
if(!QDELETED(src))
wear_mask_update(I, toggle_off = 1)
if(I == wear_neck)
wear_neck = null
if(!QDELETED(src))
update_inv_neck(I)
else if(I == handcuffed)
handcuffed = null
if(buckled && buckled.buckle_requires_restraints)
buckled.unbuckle_mob(src)
if(!QDELETED(src))
update_handcuffed()
else if(I == legcuffed)
legcuffed = null
if(!QDELETED(src))
update_inv_legcuffed()
//handle stuff to update when a mob equips/unequips a mask.
/mob/living/proc/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
update_inv_wear_mask()
/mob/living/carbon/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
if(C.tint || initial(C.tint))
update_tint()
update_inv_wear_mask()
//handle stuff to update when a mob equips/unequips a headgear.
/mob/living/carbon/proc/head_update(obj/item/I, forced)
if(istype(I, /obj/item/clothing))
var/obj/item/clothing/C = I
if(C.tint || initial(C.tint))
update_tint()
update_sight()
if(I.flags_inv & HIDEMASK || forced)
update_inv_wear_mask()
update_inv_head()
/mob/living/carbon/proc/get_holding_bodypart_of_item(obj/item/I)
var/index = get_held_index_of_item(I)
return index && hand_bodyparts[index]
/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_BACK)
return back
if(SLOT_WEAR_MASK)
return wear_mask
if(SLOT_NECK)
return wear_neck
if(SLOT_HEAD)
return head
if(SLOT_HANDCUFFED)
return handcuffed
if(SLOT_LEGCUFFED)
return legcuffed
return null
/mob/living/carbon/proc/equip_in_one_of_slots(obj/item/I, list/slots, qdel_on_fail = 1)
for(var/slot in slots)
if(equip_to_slot_if_possible(I, slots[slot], qdel_on_fail = 0, disable_warning = TRUE))
return slot
if(qdel_on_fail)
qdel(I)
return null
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/equip_to_slot(obj/item/I, slot)
if(!slot)
return
if(!istype(I))
return
var/index = get_held_index_of_item(I)
if(index)
held_items[index] = null
if(I.pulledby)
I.pulledby.stop_pulling()
I.screen_loc = null
if(client)
client.screen -= I
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
if(observe.client)
observe.client.screen -= I
I.forceMove(src)
I.layer = ABOVE_HUD_LAYER
I.plane = ABOVE_HUD_PLANE
I.appearance_flags |= NO_CLIENT_COLOR
var/not_handled = FALSE
switch(slot)
if(SLOT_BACK)
back = I
update_inv_back()
if(SLOT_WEAR_MASK)
wear_mask = I
wear_mask_update(I, toggle_off = 0)
if(SLOT_HEAD)
head = I
head_update(I)
if(SLOT_NECK)
wear_neck = I
update_inv_neck(I)
if(SLOT_HANDCUFFED)
handcuffed = I
update_handcuffed()
if(SLOT_LEGCUFFED)
legcuffed = I
update_inv_legcuffed()
if(SLOT_HANDS)
put_in_hands(I)
update_inv_hands()
if(SLOT_IN_BACKPACK)
if(!SEND_SIGNAL(back, COMSIG_TRY_STORAGE_INSERT, I, src, TRUE))
not_handled = TRUE
else
not_handled = TRUE
//Item has been handled at this point and equipped callback can be safely called
//We cannot call it for items that have not been handled as they are not yet correctly
//in a slot (handled further down inheritance chain, probably living/carbon/human/equip_to_slot
if(!not_handled)
I.equipped(src, slot)
return not_handled
/mob/living/carbon/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE)
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
return
if(I == head)
head = null
if(!QDELETED(src))
head_update(I)
else if(I == back)
back = null
if(!QDELETED(src))
update_inv_back()
else if(I == wear_mask)
wear_mask = null
if(!QDELETED(src))
wear_mask_update(I, toggle_off = 1)
if(I == wear_neck)
wear_neck = null
if(!QDELETED(src))
update_inv_neck(I)
else if(I == handcuffed)
handcuffed = null
if(buckled && buckled.buckle_requires_restraints)
buckled.unbuckle_mob(src)
if(!QDELETED(src))
update_handcuffed()
else if(I == legcuffed)
legcuffed = null
if(!QDELETED(src))
update_inv_legcuffed()
//handle stuff to update when a mob equips/unequips a mask.
/mob/living/proc/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
update_inv_wear_mask()
/mob/living/carbon/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
if(C.tint || initial(C.tint))
update_tint()
update_inv_wear_mask()
//handle stuff to update when a mob equips/unequips a headgear.
/mob/living/carbon/proc/head_update(obj/item/I, forced)
if(istype(I, /obj/item/clothing))
var/obj/item/clothing/C = I
if(C.tint || initial(C.tint))
update_tint()
update_sight()
if(I.flags_inv & HIDEMASK || forced)
update_inv_wear_mask()
update_inv_head()
/mob/living/carbon/proc/get_holding_bodypart_of_item(obj/item/I)
var/index = get_held_index_of_item(I)
return index && hand_bodyparts[index]
File diff suppressed because it is too large Load Diff
@@ -403,9 +403,9 @@
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
if(!Proj.nodamage && Proj.damage < src.health && isliving(Proj.firer))
retaliate(Proj.firer)
..()
return ..()
/mob/living/carbon/monkey/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE)
/mob/living/carbon/monkey/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))
@@ -1,9 +1,9 @@
/mob/living/carbon/monkey/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-m")
/mob/living/carbon/monkey/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-m")
/mob/living/carbon/monkey/death(gibbed)
walk(src,0) // Stops dead monkeys from fleeing their attacker or climbing out from inside His Grace
. = ..()
/mob/living/carbon/monkey/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-m")
/mob/living/carbon/monkey/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-m")
/mob/living/carbon/monkey/death(gibbed)
walk(src,0) // Stops dead monkeys from fleeing their attacker or climbing out from inside His Grace
. = ..()
+172 -172
View File
@@ -1,172 +1,172 @@
/mob/living/carbon/monkey
/mob/living/carbon/monkey/Life()
set invisibility = 0
if (notransform)
return
if(..())
if(!client)
if(stat == CONSCIOUS)
if(on_fire || buckled || restrained() || (resting && canmove)) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting)
if(!resisting && prob(MONKEY_RESIST_PROB))
resisting = TRUE
walk_to(src,0)
resist()
else if(resisting)
resisting = FALSE
else if((mode == MONKEY_IDLE && !pickupTarget && !prob(MONKEY_SHENANIGAN_PROB)) || !handle_combat())
if(prob(25) && canmove && isturf(loc) && !pulledby)
step(src, pick(GLOB.cardinals))
else if(prob(1))
emote(pick("scratch","jump","roll","tail"))
else
walk_to(src,0)
/mob/living/carbon/monkey/handle_mutations_and_radiation()
if(radiation)
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
if(!IsKnockdown())
emote("collapse")
Knockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(src, "<span class='danger'>You feel weak.</span>")
if(radiation > RAD_MOB_MUTATE)
if(prob(1))
to_chat(src, "<span class='danger'>You mutate!</span>")
randmutb()
emote("gasp")
domutcheck()
if(radiation > RAD_MOB_MUTATE * 2 && prob(50))
gorillize()
return
if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB))
vomit(10, TRUE)
return ..()
/mob/living/carbon/monkey/handle_breath_temperature(datum/gas_mixture/breath)
if(abs(BODYTEMP_NORMAL - breath.temperature) > 50)
switch(breath.temperature)
if(-INFINITY to 120)
adjustFireLoss(3)
if(120 to 200)
adjustFireLoss(1.5)
if(200 to 260)
adjustFireLoss(0.5)
if(360 to 400)
adjustFireLoss(2)
if(400 to 1000)
adjustFireLoss(3)
if(1000 to INFINITY)
adjustFireLoss(8)
/mob/living/carbon/monkey/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
var/loc_temp = get_temperature(environment)
if(stat != DEAD)
adjust_bodytemperature(natural_bodytemperature_stabilization())
if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < bodytemperature)
adjust_bodytemperature(max((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR, BODYTEMP_COOLING_MAX))
else
adjust_bodytemperature(min((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX))
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !HAS_TRAIT(src, TRAIT_RESISTHEAT))
switch(bodytemperature)
if(360 to 400)
throw_alert("temp", /obj/screen/alert/hot, 1)
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
if(400 to 460)
throw_alert("temp", /obj/screen/alert/hot, 2)
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
if(460 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot, 3)
if(on_fire)
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
else
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(src, TRAIT_RESISTCOLD))
if(!istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
switch(bodytemperature)
if(200 to 260)
throw_alert("temp", /obj/screen/alert/cold, 1)
apply_damage(COLD_DAMAGE_LEVEL_1, BURN)
if(120 to 200)
throw_alert("temp", /obj/screen/alert/cold, 2)
apply_damage(COLD_DAMAGE_LEVEL_2, BURN)
if(-INFINITY to 120)
throw_alert("temp", /obj/screen/alert/cold, 3)
apply_damage(COLD_DAMAGE_LEVEL_3, BURN)
else
clear_alert("temp")
else
clear_alert("temp")
//Account for massive pressure differences
var/pressure = environment.return_pressure()
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
switch(adjusted_pressure)
if(HAZARD_HIGH_PRESSURE to INFINITY)
adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) )
throw_alert("pressure", /obj/screen/alert/highpressure, 2)
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
throw_alert("pressure", /obj/screen/alert/highpressure, 1)
if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE)
clear_alert("pressure")
if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE)
throw_alert("pressure", /obj/screen/alert/lowpressure, 1)
else
adjustBruteLoss( LOW_PRESSURE_DAMAGE )
throw_alert("pressure", /obj/screen/alert/lowpressure, 2)
return
/mob/living/carbon/monkey/handle_random_events()
if (prob(1) && prob(2))
emote("scratch")
/mob/living/carbon/monkey/has_smoke_protection()
if(wear_mask)
if(wear_mask.clothing_flags & BLOCK_GAS_SMOKE_EFFECT)
return 1
/mob/living/carbon/monkey/handle_fire()
. = ..()
if(on_fire)
//the fire tries to damage the exposed clothes and items
var/list/burning_items = list()
//HEAD//
var/obj/item/clothing/head_clothes = null
if(wear_mask)
head_clothes = wear_mask
if(wear_neck)
head_clothes = wear_neck
if(head)
head_clothes = head
if(head_clothes)
burning_items += head_clothes
if(back)
burning_items += back
for(var/X in burning_items)
var/obj/item/I = X
if(!(I.resistance_flags & FIRE_PROOF))
I.take_damage(fire_stacks, BURN, "fire", 0)
adjust_bodytemperature(BODYTEMP_HEATING_MAX)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "on_fire", /datum/mood_event/on_fire)
/mob/living/carbon/monkey
/mob/living/carbon/monkey/Life()
set invisibility = 0
if (notransform)
return
if(..())
if(!client)
if(stat == CONSCIOUS)
if(on_fire || buckled || restrained() || (resting && canmove)) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting)
if(!resisting && prob(MONKEY_RESIST_PROB))
resisting = TRUE
walk_to(src,0)
resist()
else if(resisting)
resisting = FALSE
else if((mode == MONKEY_IDLE && !pickupTarget && !prob(MONKEY_SHENANIGAN_PROB)) || !handle_combat())
if(prob(25) && canmove && isturf(loc) && !pulledby)
step(src, pick(GLOB.cardinals))
else if(prob(1))
emote(pick("scratch","jump","roll","tail"))
else
walk_to(src,0)
/mob/living/carbon/monkey/handle_mutations_and_radiation()
if(radiation)
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
if(!IsKnockdown())
emote("collapse")
Knockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(src, "<span class='danger'>You feel weak.</span>")
if(radiation > RAD_MOB_MUTATE)
if(prob(1))
to_chat(src, "<span class='danger'>You mutate!</span>")
randmutb()
emote("gasp")
domutcheck()
if(radiation > RAD_MOB_MUTATE * 2 && prob(50))
gorillize()
return
if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB))
vomit(10, TRUE)
return ..()
/mob/living/carbon/monkey/handle_breath_temperature(datum/gas_mixture/breath)
if(abs(BODYTEMP_NORMAL - breath.temperature) > 50)
switch(breath.temperature)
if(-INFINITY to 120)
adjustFireLoss(3)
if(120 to 200)
adjustFireLoss(1.5)
if(200 to 260)
adjustFireLoss(0.5)
if(360 to 400)
adjustFireLoss(2)
if(400 to 1000)
adjustFireLoss(3)
if(1000 to INFINITY)
adjustFireLoss(8)
/mob/living/carbon/monkey/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
var/loc_temp = get_temperature(environment)
if(stat != DEAD)
adjust_bodytemperature(natural_bodytemperature_stabilization())
if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < bodytemperature)
adjust_bodytemperature(max((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR, BODYTEMP_COOLING_MAX))
else
adjust_bodytemperature(min((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX))
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !HAS_TRAIT(src, TRAIT_RESISTHEAT))
switch(bodytemperature)
if(360 to 400)
throw_alert("temp", /obj/screen/alert/hot, 1)
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
if(400 to 460)
throw_alert("temp", /obj/screen/alert/hot, 2)
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
if(460 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot, 3)
if(on_fire)
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
else
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !HAS_TRAIT(src, TRAIT_RESISTCOLD))
if(!istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
switch(bodytemperature)
if(200 to 260)
throw_alert("temp", /obj/screen/alert/cold, 1)
apply_damage(COLD_DAMAGE_LEVEL_1, BURN)
if(120 to 200)
throw_alert("temp", /obj/screen/alert/cold, 2)
apply_damage(COLD_DAMAGE_LEVEL_2, BURN)
if(-INFINITY to 120)
throw_alert("temp", /obj/screen/alert/cold, 3)
apply_damage(COLD_DAMAGE_LEVEL_3, BURN)
else
clear_alert("temp")
else
clear_alert("temp")
//Account for massive pressure differences
var/pressure = environment.return_pressure()
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
switch(adjusted_pressure)
if(HAZARD_HIGH_PRESSURE to INFINITY)
adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) )
throw_alert("pressure", /obj/screen/alert/highpressure, 2)
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
throw_alert("pressure", /obj/screen/alert/highpressure, 1)
if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE)
clear_alert("pressure")
if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE)
throw_alert("pressure", /obj/screen/alert/lowpressure, 1)
else
adjustBruteLoss( LOW_PRESSURE_DAMAGE )
throw_alert("pressure", /obj/screen/alert/lowpressure, 2)
return
/mob/living/carbon/monkey/handle_random_events()
if (prob(1) && prob(2))
emote("scratch")
/mob/living/carbon/monkey/has_smoke_protection()
if(wear_mask)
if(wear_mask.clothing_flags & BLOCK_GAS_SMOKE_EFFECT)
return 1
/mob/living/carbon/monkey/handle_fire()
. = ..()
if(on_fire)
//the fire tries to damage the exposed clothes and items
var/list/burning_items = list()
//HEAD//
var/obj/item/clothing/head_clothes = null
if(wear_mask)
head_clothes = wear_mask
if(wear_neck)
head_clothes = wear_neck
if(head)
head_clothes = head
if(head_clothes)
burning_items += head_clothes
if(back)
burning_items += back
for(var/X in burning_items)
var/obj/item/I = X
if(!(I.resistance_flags & FIRE_PROOF))
I.take_damage(fire_stacks, BURN, "fire", 0)
adjust_bodytemperature(BODYTEMP_HEATING_MAX)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "on_fire", /datum/mood_event/on_fire)
+174 -174
View File
@@ -1,174 +1,174 @@
/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
can_be_held = "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, "<span class='warning'>Bluespace harmonics prevent the spawning of more than [cap] monkeys on the station at one time!</span>")
return INITIALIZE_HINT_QDEL
SSmobs.cubemonkeys += src
create_dna(src)
dna.initialize_dna(random_blood_type())
/mob/living/carbon/monkey/Destroy()
SSmobs.cubemonkeys -= src
return ..()
/mob/living/carbon/monkey/generate_mob_holder()
var/obj/item/clothing/head/mob_holder/holder = new(get_turf(src), src, "monkey", 'icons/mob/animals_held.dmi', 'icons/mob/animals_held_lh.dmi', 'icons/mob/animals_held_rh.dmi', TRUE)
return holder
/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(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
can_be_held = "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, "<span class='warning'>Bluespace harmonics prevent the spawning of more than [cap] monkeys on the station at one time!</span>")
return INITIALIZE_HINT_QDEL
SSmobs.cubemonkeys += src
create_dna(src)
dna.initialize_dna(random_blood_type())
/mob/living/carbon/monkey/Destroy()
SSmobs.cubemonkeys -= src
return ..()
/mob/living/carbon/monkey/generate_mob_holder()
var/obj/item/clothing/head/mob_holder/holder = new(get_turf(src), src, "monkey", 'icons/mob/animals_held.dmi', 'icons/mob/animals_held_lh.dmi', 'icons/mob/animals_held_rh.dmi', TRUE)
return holder
/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(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
@@ -189,18 +189,18 @@
..()
switch (severity)
if (1)
if (EXPLODE_DEVASTATE)
gib()
return
if (2)
if (EXPLODE_HEAVY)
take_overall_damage(60, 60)
damage_clothes(200, BRUTE, "bomb")
adjustEarDamage(30, 120)
if(prob(70))
Unconscious(200)
if(3)
if(EXPLODE_LIGHT)
take_overall_damage(30, 0)
damage_clothes(50, BRUTE, "bomb")
adjustEarDamage(15,60)
@@ -1,80 +1,80 @@
/mob/living/carbon/monkey/regenerate_icons()
if(!..())
update_body_parts()
update_hair()
update_inv_wear_mask()
update_inv_head()
update_inv_back()
update_transform()
////////
/mob/living/carbon/monkey/update_hair()
remove_overlay(HAIR_LAYER)
var/obj/item/bodypart/head/HD = get_bodypart(BODY_ZONE_HEAD)
if(!HD) //Decapitated
return
if(HAS_TRAIT(src, TRAIT_HUSK))
return
var/hair_hidden = 0
if(head)
var/obj/item/I = head
if(I.flags_inv & HIDEHAIR)
hair_hidden = 1
if(wear_mask)
var/obj/item/clothing/mask/M = wear_mask
if(M.flags_inv & HIDEHAIR)
hair_hidden = 1
if(!hair_hidden)
if(!getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
overlays_standing[HAIR_LAYER] = mutable_appearance('icons/mob/human_face.dmi', "debrained", -HAIR_LAYER)
apply_overlay(HAIR_LAYER)
/mob/living/carbon/monkey/update_fire()
..("Monkey_burning")
/mob/living/carbon/monkey/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
clear_alert("legcuffed")
if(legcuffed)
var/mutable_appearance/legcuffs = mutable_appearance('icons/mob/restraints.dmi', legcuffed.item_state, -LEGCUFF_LAYER)
legcuffs.color = handcuffed.color
legcuffs.pixel_y = 8
overlays_standing[HANDCUFF_LAYER] = legcuffs
apply_overlay(LEGCUFF_LAYER)
throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = legcuffed)
//monkey HUD updates for items in our inventory
//update whether our head item appears on our hud.
/mob/living/carbon/monkey/update_hud_head(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_head
client.screen += I
//update whether our mask item appears on our hud.
/mob/living/carbon/monkey/update_hud_wear_mask(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_mask
client.screen += I
//update whether our neck item appears on our hud.
/mob/living/carbon/monkey/update_hud_neck(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_neck
client.screen += I
//update whether our back item appears on our hud.
/mob/living/carbon/monkey/update_hud_back(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_back
/mob/living/carbon/monkey/regenerate_icons()
if(!..())
update_body_parts()
update_hair()
update_inv_wear_mask()
update_inv_head()
update_inv_back()
update_transform()
////////
/mob/living/carbon/monkey/update_hair()
remove_overlay(HAIR_LAYER)
var/obj/item/bodypart/head/HD = get_bodypart(BODY_ZONE_HEAD)
if(!HD) //Decapitated
return
if(HAS_TRAIT(src, TRAIT_HUSK))
return
var/hair_hidden = 0
if(head)
var/obj/item/I = head
if(I.flags_inv & HIDEHAIR)
hair_hidden = 1
if(wear_mask)
var/obj/item/clothing/mask/M = wear_mask
if(M.flags_inv & HIDEHAIR)
hair_hidden = 1
if(!hair_hidden)
if(!getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
overlays_standing[HAIR_LAYER] = mutable_appearance('icons/mob/human_face.dmi', "debrained", -HAIR_LAYER)
apply_overlay(HAIR_LAYER)
/mob/living/carbon/monkey/update_fire()
..("Monkey_burning")
/mob/living/carbon/monkey/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
clear_alert("legcuffed")
if(legcuffed)
var/mutable_appearance/legcuffs = mutable_appearance('icons/mob/restraints.dmi', legcuffed.item_state, -LEGCUFF_LAYER)
legcuffs.color = handcuffed.color
legcuffs.pixel_y = 8
overlays_standing[HANDCUFF_LAYER] = legcuffs
apply_overlay(LEGCUFF_LAYER)
throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = legcuffed)
//monkey HUD updates for items in our inventory
//update whether our head item appears on our hud.
/mob/living/carbon/monkey/update_hud_head(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_head
client.screen += I
//update whether our mask item appears on our hud.
/mob/living/carbon/monkey/update_hud_wear_mask(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_mask
client.screen += I
//update whether our neck item appears on our hud.
/mob/living/carbon/monkey/update_hud_neck(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_neck
client.screen += I
//update whether our back item appears on our hud.
/mob/living/carbon/monkey/update_hud_back(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
I.screen_loc = ui_monkey_back
client.screen += I
+281 -281
View File
@@ -1,281 +1,281 @@
/mob/living/carbon
var/list/overlays_standing[TOTAL_LAYERS]
/mob/living/carbon/proc/apply_overlay(cache_index)
if((. = overlays_standing[cache_index]))
add_overlay(.)
/mob/living/carbon/proc/remove_overlay(cache_index)
var/I = overlays_standing[cache_index]
if(I)
cut_overlay(I)
overlays_standing[cache_index] = null
/mob/living/carbon/regenerate_icons()
if(notransform)
return 1
update_inv_hands()
update_inv_handcuffed()
update_inv_legcuffed()
update_fire()
/mob/living/carbon/update_inv_hands()
remove_overlay(HANDS_LAYER)
if (handcuffed)
drop_all_held_items()
return
var/list/hands = list()
for(var/obj/item/I in held_items)
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
I.screen_loc = ui_hand_position(get_held_index_of_item(I))
client.screen += I
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
if(observe.client && observe.client.eye == src)
observe.client.screen += I
else
observers -= observe
if(!observers.len)
observers = null
break
var/t_state = I.item_state
if(!t_state)
t_state = I.icon_state
var/icon_file = I.lefthand_file
if(get_held_index_of_item(I) % 2 == 0)
icon_file = I.righthand_file
hands += I.build_worn_icon(state = t_state, default_layer = HANDS_LAYER, default_icon_file = icon_file, isinhands = TRUE)
overlays_standing[HANDS_LAYER] = hands
apply_overlay(HANDS_LAYER)
/mob/living/carbon/update_fire(var/fire_icon = "Generic_mob_burning")
remove_overlay(FIRE_LAYER)
if(on_fire)
var/mutable_appearance/new_fire_overlay = mutable_appearance('icons/mob/OnFire.dmi', fire_icon, -FIRE_LAYER)
new_fire_overlay.appearance_flags = RESET_COLOR
overlays_standing[FIRE_LAYER] = new_fire_overlay
apply_overlay(FIRE_LAYER)
/mob/living/carbon/update_damage_overlays()
remove_overlay(DAMAGE_LAYER)
var/dam_colors = "#E62525"
if(ishuman(src))
var/mob/living/carbon/human/H = src
dam_colors = bloodtype_to_color(H.dna.blood_type)
var/mutable_appearance/damage_overlay = mutable_appearance('icons/mob/dam_mob.dmi', "blank", -DAMAGE_LAYER, color = dam_colors)
overlays_standing[DAMAGE_LAYER] = damage_overlay
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
if(BP.dmg_overlay_type)
if(BP.brutestate)
damage_overlay.add_overlay("[BP.dmg_overlay_type]_[BP.body_zone]_[BP.brutestate]0") //we're adding icon_states of the base image as overlays
if(BP.burnstate)
damage_overlay.add_overlay("[BP.dmg_overlay_type]_[BP.body_zone]_0[BP.burnstate]")
apply_overlay(DAMAGE_LAYER)
/mob/living/carbon/update_inv_wear_mask()
remove_overlay(FACEMASK_LAYER)
if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated
return
if(client && hud_used && hud_used.inv_slots[SLOT_WEAR_MASK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_WEAR_MASK]
inv.update_icon()
if(wear_mask)
if(!(head && (head.flags_inv & HIDEMASK)))
overlays_standing[FACEMASK_LAYER] = wear_mask.build_worn_icon(state = wear_mask.icon_state, default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/mask.dmi')
update_hud_wear_mask(wear_mask)
apply_overlay(FACEMASK_LAYER)
/mob/living/carbon/update_inv_neck()
remove_overlay(NECK_LAYER)
if(client && hud_used && hud_used.inv_slots[SLOT_NECK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_NECK]
inv.update_icon()
if(wear_neck)
if(!(head && (head.flags_inv & HIDENECK)))
overlays_standing[NECK_LAYER] = wear_neck.build_worn_icon(state = wear_neck.icon_state, default_layer = NECK_LAYER, default_icon_file = 'icons/mob/neck.dmi')
update_hud_neck(wear_neck)
apply_overlay(NECK_LAYER)
/mob/living/carbon/update_inv_back()
remove_overlay(BACK_LAYER)
if(client && hud_used && hud_used.inv_slots[SLOT_BACK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_BACK]
inv.update_icon()
if(back)
overlays_standing[BACK_LAYER] = back.build_worn_icon(state = back.icon_state, default_layer = BACK_LAYER, default_icon_file = 'icons/mob/back.dmi')
update_hud_back(back)
apply_overlay(BACK_LAYER)
/mob/living/carbon/update_inv_head()
remove_overlay(HEAD_LAYER)
if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated
return
if(client && hud_used && hud_used.inv_slots[SLOT_BACK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_HEAD]
inv.update_icon()
if(head)
overlays_standing[HEAD_LAYER] = head.build_worn_icon(state = head.icon_state, default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/head.dmi')
update_hud_head(head)
apply_overlay(HEAD_LAYER)
/mob/living/carbon/update_inv_handcuffed()
remove_overlay(HANDCUFF_LAYER)
if(handcuffed)
var/mutable_appearance/cuffs = mutable_appearance('icons/mob/restraints.dmi', handcuffed.item_state, -HANDCUFF_LAYER)
cuffs.color = handcuffed.color
overlays_standing[HANDCUFF_LAYER] = cuffs
apply_overlay(HANDCUFF_LAYER)
/mob/living/carbon/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
clear_alert("legcuffed")
if(legcuffed)
var/mutable_appearance/legcuffs = mutable_appearance('icons/mob/restraints.dmi', legcuffed.item_state, -LEGCUFF_LAYER)
legcuffs.color = legcuffed.color
overlays_standing[LEGCUFF_LAYER] = legcuffs
apply_overlay(LEGCUFF_LAYER)
throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = legcuffed)
//mob HUD updates for items in our inventory
//update whether handcuffs appears on our hud.
/mob/living/carbon/proc/update_hud_handcuffed()
if(hud_used)
for(var/hand in hud_used.hand_slots)
var/obj/screen/inventory/hand/H = hud_used.hand_slots[hand]
if(H)
H.update_icon()
//update whether our head item appears on our hud.
/mob/living/carbon/proc/update_hud_head(obj/item/I)
return
//update whether our mask item appears on our hud.
/mob/living/carbon/proc/update_hud_wear_mask(obj/item/I)
return
//update whether our neck item appears on our hud.
/mob/living/carbon/proc/update_hud_neck(obj/item/I)
return
//update whether our back item appears on our hud.
/mob/living/carbon/proc/update_hud_back(obj/item/I)
return
//Overlays for the worn overlay so you can overlay while you overlay
//eg: ammo counters, primed grenade flashing, etc.
//"icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file
/obj/item/proc/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE)
. = list()
/mob/living/carbon/update_body()
update_body_parts()
/mob/living/carbon/proc/update_body_parts()
//CHECK FOR UPDATE
var/oldkey = icon_render_key
icon_render_key = generate_icon_render_key()
if(oldkey == icon_render_key)
return
remove_overlay(BODYPARTS_LAYER)
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
BP.update_limb()
//LOAD ICONS
if(limb_icon_cache[icon_render_key])
load_limb_from_cache()
return
//GENERATE NEW LIMBS
var/list/new_limbs = list()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
new_limbs += BP.get_limb_icon()
if(new_limbs.len)
overlays_standing[BODYPARTS_LAYER] = new_limbs
limb_icon_cache[icon_render_key] = new_limbs
apply_overlay(BODYPARTS_LAYER)
update_damage_overlays()
/////////////////////
// Limb Icon Cache //
/////////////////////
/*
Called from update_body_parts() these procs handle the limb icon cache.
the limb icon cache adds an icon_render_key to a human mob, it represents:
- skin_tone (if applicable)
- gender
- limbs (stores as the limb name and whether it is removed/fine, organic/robotic)
These procs only store limbs as to increase the number of matching icon_render_keys
This cache exists because drawing 6/7 icons for humans constantly is quite a waste
See RemieRichards on irc.rizon.net #coderbus
*/
//produces a key based on the mob's limbs
/mob/living/carbon/proc/generate_icon_render_key()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
. += "-[BP.body_zone]"
if(BP.use_digitigrade)
. += "-digitigrade[BP.use_digitigrade]"
if(BP.animal_origin)
. += "-[BP.animal_origin]"
if(BP.status == BODYPART_ORGANIC)
. += "-organic"
else
. += "-robotic"
if(HAS_TRAIT(src, TRAIT_HUSK))
. += "-husk"
//change the mob's icon to the one matching its key
/mob/living/carbon/proc/load_limb_from_cache()
if(limb_icon_cache[icon_render_key])
remove_overlay(BODYPARTS_LAYER)
overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]
apply_overlay(BODYPARTS_LAYER)
update_damage_overlays()
/mob/living/carbon
var/list/overlays_standing[TOTAL_LAYERS]
/mob/living/carbon/proc/apply_overlay(cache_index)
if((. = overlays_standing[cache_index]))
add_overlay(.)
/mob/living/carbon/proc/remove_overlay(cache_index)
var/I = overlays_standing[cache_index]
if(I)
cut_overlay(I)
overlays_standing[cache_index] = null
/mob/living/carbon/regenerate_icons()
if(notransform)
return 1
update_inv_hands()
update_inv_handcuffed()
update_inv_legcuffed()
update_fire()
/mob/living/carbon/update_inv_hands()
remove_overlay(HANDS_LAYER)
if (handcuffed)
drop_all_held_items()
return
var/list/hands = list()
for(var/obj/item/I in held_items)
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
I.screen_loc = ui_hand_position(get_held_index_of_item(I))
client.screen += I
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
if(observe.client && observe.client.eye == src)
observe.client.screen += I
else
observers -= observe
if(!observers.len)
observers = null
break
var/t_state = I.item_state
if(!t_state)
t_state = I.icon_state
var/icon_file = I.lefthand_file
if(get_held_index_of_item(I) % 2 == 0)
icon_file = I.righthand_file
hands += I.build_worn_icon(state = t_state, default_layer = HANDS_LAYER, default_icon_file = icon_file, isinhands = TRUE)
overlays_standing[HANDS_LAYER] = hands
apply_overlay(HANDS_LAYER)
/mob/living/carbon/update_fire(var/fire_icon = "Generic_mob_burning")
remove_overlay(FIRE_LAYER)
if(on_fire)
var/mutable_appearance/new_fire_overlay = mutable_appearance('icons/mob/OnFire.dmi', fire_icon, -FIRE_LAYER)
new_fire_overlay.appearance_flags = RESET_COLOR
overlays_standing[FIRE_LAYER] = new_fire_overlay
apply_overlay(FIRE_LAYER)
/mob/living/carbon/update_damage_overlays()
remove_overlay(DAMAGE_LAYER)
var/dam_colors = "#E62525"
if(ishuman(src))
var/mob/living/carbon/human/H = src
dam_colors = bloodtype_to_color(H.dna.blood_type)
var/mutable_appearance/damage_overlay = mutable_appearance('icons/mob/dam_mob.dmi', "blank", -DAMAGE_LAYER, color = dam_colors)
overlays_standing[DAMAGE_LAYER] = damage_overlay
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
if(BP.dmg_overlay_type)
if(BP.brutestate)
damage_overlay.add_overlay("[BP.dmg_overlay_type]_[BP.body_zone]_[BP.brutestate]0") //we're adding icon_states of the base image as overlays
if(BP.burnstate)
damage_overlay.add_overlay("[BP.dmg_overlay_type]_[BP.body_zone]_0[BP.burnstate]")
apply_overlay(DAMAGE_LAYER)
/mob/living/carbon/update_inv_wear_mask()
remove_overlay(FACEMASK_LAYER)
if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated
return
if(client && hud_used && hud_used.inv_slots[SLOT_WEAR_MASK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_WEAR_MASK]
inv.update_icon()
if(wear_mask)
if(!(head && (head.flags_inv & HIDEMASK)))
overlays_standing[FACEMASK_LAYER] = wear_mask.build_worn_icon(state = wear_mask.icon_state, default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/mask.dmi')
update_hud_wear_mask(wear_mask)
apply_overlay(FACEMASK_LAYER)
/mob/living/carbon/update_inv_neck()
remove_overlay(NECK_LAYER)
if(client && hud_used && hud_used.inv_slots[SLOT_NECK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_NECK]
inv.update_icon()
if(wear_neck)
if(!(head && (head.flags_inv & HIDENECK)))
overlays_standing[NECK_LAYER] = wear_neck.build_worn_icon(state = wear_neck.icon_state, default_layer = NECK_LAYER, default_icon_file = 'icons/mob/neck.dmi')
update_hud_neck(wear_neck)
apply_overlay(NECK_LAYER)
/mob/living/carbon/update_inv_back()
remove_overlay(BACK_LAYER)
if(client && hud_used && hud_used.inv_slots[SLOT_BACK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_BACK]
inv.update_icon()
if(back)
overlays_standing[BACK_LAYER] = back.build_worn_icon(state = back.icon_state, default_layer = BACK_LAYER, default_icon_file = 'icons/mob/back.dmi')
update_hud_back(back)
apply_overlay(BACK_LAYER)
/mob/living/carbon/update_inv_head()
remove_overlay(HEAD_LAYER)
if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated
return
if(client && hud_used && hud_used.inv_slots[SLOT_BACK])
var/obj/screen/inventory/inv = hud_used.inv_slots[SLOT_HEAD]
inv.update_icon()
if(head)
overlays_standing[HEAD_LAYER] = head.build_worn_icon(state = head.icon_state, default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/head.dmi')
update_hud_head(head)
apply_overlay(HEAD_LAYER)
/mob/living/carbon/update_inv_handcuffed()
remove_overlay(HANDCUFF_LAYER)
if(handcuffed)
var/mutable_appearance/cuffs = mutable_appearance('icons/mob/restraints.dmi', handcuffed.item_state, -HANDCUFF_LAYER)
cuffs.color = handcuffed.color
overlays_standing[HANDCUFF_LAYER] = cuffs
apply_overlay(HANDCUFF_LAYER)
/mob/living/carbon/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
clear_alert("legcuffed")
if(legcuffed)
var/mutable_appearance/legcuffs = mutable_appearance('icons/mob/restraints.dmi', legcuffed.item_state, -LEGCUFF_LAYER)
legcuffs.color = legcuffed.color
overlays_standing[LEGCUFF_LAYER] = legcuffs
apply_overlay(LEGCUFF_LAYER)
throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = legcuffed)
//mob HUD updates for items in our inventory
//update whether handcuffs appears on our hud.
/mob/living/carbon/proc/update_hud_handcuffed()
if(hud_used)
for(var/hand in hud_used.hand_slots)
var/obj/screen/inventory/hand/H = hud_used.hand_slots[hand]
if(H)
H.update_icon()
//update whether our head item appears on our hud.
/mob/living/carbon/proc/update_hud_head(obj/item/I)
return
//update whether our mask item appears on our hud.
/mob/living/carbon/proc/update_hud_wear_mask(obj/item/I)
return
//update whether our neck item appears on our hud.
/mob/living/carbon/proc/update_hud_neck(obj/item/I)
return
//update whether our back item appears on our hud.
/mob/living/carbon/proc/update_hud_back(obj/item/I)
return
//Overlays for the worn overlay so you can overlay while you overlay
//eg: ammo counters, primed grenade flashing, etc.
//"icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file
/obj/item/proc/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE)
. = list()
/mob/living/carbon/update_body()
update_body_parts()
/mob/living/carbon/proc/update_body_parts()
//CHECK FOR UPDATE
var/oldkey = icon_render_key
icon_render_key = generate_icon_render_key()
if(oldkey == icon_render_key)
return
remove_overlay(BODYPARTS_LAYER)
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
BP.update_limb()
//LOAD ICONS
if(limb_icon_cache[icon_render_key])
load_limb_from_cache()
return
//GENERATE NEW LIMBS
var/list/new_limbs = list()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
new_limbs += BP.get_limb_icon()
if(new_limbs.len)
overlays_standing[BODYPARTS_LAYER] = new_limbs
limb_icon_cache[icon_render_key] = new_limbs
apply_overlay(BODYPARTS_LAYER)
update_damage_overlays()
/////////////////////
// Limb Icon Cache //
/////////////////////
/*
Called from update_body_parts() these procs handle the limb icon cache.
the limb icon cache adds an icon_render_key to a human mob, it represents:
- skin_tone (if applicable)
- gender
- limbs (stores as the limb name and whether it is removed/fine, organic/robotic)
These procs only store limbs as to increase the number of matching icon_render_keys
This cache exists because drawing 6/7 icons for humans constantly is quite a waste
See RemieRichards on irc.rizon.net #coderbus
*/
//produces a key based on the mob's limbs
/mob/living/carbon/proc/generate_icon_render_key()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
. += "-[BP.body_zone]"
if(BP.use_digitigrade)
. += "-digitigrade[BP.use_digitigrade]"
if(BP.animal_origin)
. += "-[BP.animal_origin]"
if(BP.status == BODYPART_ORGANIC)
. += "-organic"
else
. += "-robotic"
if(HAS_TRAIT(src, TRAIT_HUSK))
. += "-husk"
//change the mob's icon to the one matching its key
/mob/living/carbon/proc/load_limb_from_cache()
if(limb_icon_cache[icon_render_key])
remove_overlay(BODYPARTS_LAYER)
overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]
apply_overlay(BODYPARTS_LAYER)
update_damage_overlays()
+280 -280
View File
@@ -1,280 +1,280 @@
/*
apply_damage(a,b,c)
args
a:damage - How much damage to take
b:damage_type - What type of damage to take, brute, burn
c:def_zone - Where to take the damage if its brute or burn
Returns
standard 0 if fail
*/
/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE)
var/hit_percent = (100-blocked)/100
if(!damage || (hit_percent <= 0))
return 0
var/damage_amount = forced ? damage : damage * hit_percent
switch(damagetype)
if(BRUTE)
adjustBruteLoss(damage_amount, forced = forced)
if(BURN)
adjustFireLoss(damage_amount, forced = forced)
if(TOX)
adjustToxLoss(damage_amount, forced = forced)
if(OXY)
adjustOxyLoss(damage_amount, forced = forced)
if(CLONE)
adjustCloneLoss(damage_amount, forced = forced)
if(STAMINA)
adjustStaminaLoss(damage_amount, forced = forced)
return 1
/mob/living/proc/apply_damage_type(damage = 0, damagetype = BRUTE) //like apply damage except it always uses the damage procs
switch(damagetype)
if(BRUTE)
return adjustBruteLoss(damage)
if(BURN)
return adjustFireLoss(damage)
if(TOX)
return adjustToxLoss(damage)
if(OXY)
return adjustOxyLoss(damage)
if(CLONE)
return adjustCloneLoss(damage)
if(STAMINA)
return adjustStaminaLoss(damage)
/mob/living/proc/get_damage_amount(damagetype = BRUTE)
switch(damagetype)
if(BRUTE)
return getBruteLoss()
if(BURN)
return getFireLoss()
if(TOX)
return getToxLoss()
if(OXY)
return getOxyLoss()
if(CLONE)
return getCloneLoss()
if(STAMINA)
return getStaminaLoss()
/mob/living/proc/apply_damages(brute = 0, burn = 0, tox = 0, oxy = 0, clone = 0, def_zone = null, blocked = FALSE, stamina = 0, brain = 0)
if(blocked >= 100)
return 0
if(brute)
apply_damage(brute, BRUTE, def_zone, blocked)
if(burn)
apply_damage(burn, BURN, def_zone, blocked)
if(tox)
apply_damage(tox, TOX, def_zone, blocked)
if(oxy)
apply_damage(oxy, OXY, def_zone, blocked)
if(clone)
apply_damage(clone, CLONE, def_zone, blocked)
if(stamina)
apply_damage(stamina, STAMINA, def_zone, blocked)
if(brain)
apply_damage(brain, BRAIN, def_zone, blocked)
return 1
/mob/living/proc/apply_effect(effect = 0,effecttype = EFFECT_STUN, blocked = FALSE, knockdown_stamoverride, knockdown_stammax)
var/hit_percent = (100-blocked)/100
if(!effect || (hit_percent <= 0))
return 0
switch(effecttype)
if(EFFECT_STUN)
Stun(effect * hit_percent)
if(EFFECT_KNOCKDOWN)
Knockdown(effect * hit_percent, override_stamdmg = knockdown_stammax ? CLAMP(knockdown_stamoverride, 0, knockdown_stammax-getStaminaLoss()) : knockdown_stamoverride)
if(EFFECT_UNCONSCIOUS)
Unconscious(effect * hit_percent)
if(EFFECT_IRRADIATE)
radiation += max(effect * hit_percent, 0)
if(EFFECT_SLUR)
slurring = max(slurring,(effect * hit_percent))
if(EFFECT_STUTTER)
if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) // stun is usually associated with stutter
stuttering = max(stuttering,(effect * hit_percent))
if(EFFECT_EYE_BLUR)
blur_eyes(effect * hit_percent)
if(EFFECT_DROWSY)
drowsyness = max(drowsyness,(effect * hit_percent))
if(EFFECT_JITTER)
if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE))
jitteriness = max(jitteriness,(effect * hit_percent))
return 1
/mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = FALSE, stamina = 0, jitter = 0, kd_stamoverride, kd_stammax)
if(blocked >= 100)
return 0
if(stun)
apply_effect(stun, EFFECT_STUN, blocked)
if(knockdown)
apply_effect(knockdown, EFFECT_KNOCKDOWN, blocked, kd_stamoverride, kd_stammax)
if(unconscious)
apply_effect(unconscious, EFFECT_UNCONSCIOUS, blocked)
if(irradiate)
apply_effect(irradiate, EFFECT_IRRADIATE, blocked)
if(slur)
apply_effect(slur, EFFECT_SLUR, blocked)
if(stutter)
apply_effect(stutter, EFFECT_STUTTER, blocked)
if(eyeblur)
apply_effect(eyeblur, EFFECT_EYE_BLUR, blocked)
if(drowsy)
apply_effect(drowsy, EFFECT_DROWSY, blocked)
if(stamina)
apply_damage(stamina, STAMINA, null, blocked)
if(jitter)
apply_effect(jitter, EFFECT_JITTER, blocked)
return 1
/mob/living/proc/getBruteLoss()
return bruteloss
/mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
bruteloss = CLAMP((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getOxyLoss()
return oxyloss
/mob/living/proc/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
oxyloss = CLAMP((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(status_flags & GODMODE)
return 0
oxyloss = amount
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getToxLoss()
return toxloss
/mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
toxloss = CLAMP((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
toxloss = amount
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getFireLoss()
return fireloss
/mob/living/proc/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
fireloss = CLAMP((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getCloneLoss()
return cloneloss
/mob/living/proc/adjustCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
cloneloss = CLAMP((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
cloneloss = amount
if(updating_health)
updatehealth()
return amount
/mob/living/proc/adjustOrganLoss(slot, amount, maximum)
return
/mob/living/proc/setOrganLoss(slot, amount, maximum)
return
/mob/living/proc/getOrganLoss(slot)
return
/mob/living/proc/getStaminaLoss()
return staminaloss
/mob/living/proc/adjustStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
return
/mob/living/proc/setStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
return
// heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(-burn, FALSE)
adjustStaminaLoss(-stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
// damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(burn, FALSE)
adjustStaminaLoss(stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
// heal MANY bodyparts, in random order
/mob/living/proc/heal_overall_damage(brute = 0, burn = 0, stamina = 0, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(-burn, FALSE)
adjustStaminaLoss(-stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
// damage MANY bodyparts, in random order
/mob/living/proc/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(burn, FALSE)
adjustStaminaLoss(stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
//heal up to amount damage, in a given order
/mob/living/proc/heal_ordered_damage(amount, list/damage_types)
. = amount //we'll return the amount of damage healed
for(var/i in damage_types)
var/amount_to_heal = min(amount, get_damage_amount(i)) //heal only up to the amount of damage we have
if(amount_to_heal)
apply_damage_type(-amount_to_heal, i)
amount -= amount_to_heal //remove what we healed from our current amount
if(!amount)
break
. -= amount //if there's leftover healing, remove it from what we return
/*
apply_damage(a,b,c)
args
a:damage - How much damage to take
b:damage_type - What type of damage to take, brute, burn
c:def_zone - Where to take the damage if its brute or burn
Returns
standard 0 if fail
*/
/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE)
var/hit_percent = (100-blocked)/100
if(!damage || (hit_percent <= 0))
return 0
var/damage_amount = forced ? damage : damage * hit_percent
switch(damagetype)
if(BRUTE)
adjustBruteLoss(damage_amount, forced = forced)
if(BURN)
adjustFireLoss(damage_amount, forced = forced)
if(TOX)
adjustToxLoss(damage_amount, forced = forced)
if(OXY)
adjustOxyLoss(damage_amount, forced = forced)
if(CLONE)
adjustCloneLoss(damage_amount, forced = forced)
if(STAMINA)
adjustStaminaLoss(damage_amount, forced = forced)
return 1
/mob/living/proc/apply_damage_type(damage = 0, damagetype = BRUTE) //like apply damage except it always uses the damage procs
switch(damagetype)
if(BRUTE)
return adjustBruteLoss(damage)
if(BURN)
return adjustFireLoss(damage)
if(TOX)
return adjustToxLoss(damage)
if(OXY)
return adjustOxyLoss(damage)
if(CLONE)
return adjustCloneLoss(damage)
if(STAMINA)
return adjustStaminaLoss(damage)
/mob/living/proc/get_damage_amount(damagetype = BRUTE)
switch(damagetype)
if(BRUTE)
return getBruteLoss()
if(BURN)
return getFireLoss()
if(TOX)
return getToxLoss()
if(OXY)
return getOxyLoss()
if(CLONE)
return getCloneLoss()
if(STAMINA)
return getStaminaLoss()
/mob/living/proc/apply_damages(brute = 0, burn = 0, tox = 0, oxy = 0, clone = 0, def_zone = null, blocked = FALSE, stamina = 0, brain = 0)
if(blocked >= 100)
return 0
if(brute)
apply_damage(brute, BRUTE, def_zone, blocked)
if(burn)
apply_damage(burn, BURN, def_zone, blocked)
if(tox)
apply_damage(tox, TOX, def_zone, blocked)
if(oxy)
apply_damage(oxy, OXY, def_zone, blocked)
if(clone)
apply_damage(clone, CLONE, def_zone, blocked)
if(stamina)
apply_damage(stamina, STAMINA, def_zone, blocked)
if(brain)
apply_damage(brain, BRAIN, def_zone, blocked)
return 1
/mob/living/proc/apply_effect(effect = 0,effecttype = EFFECT_STUN, blocked = FALSE, knockdown_stamoverride, knockdown_stammax)
var/hit_percent = (100-blocked)/100
if(!effect || (hit_percent <= 0))
return 0
switch(effecttype)
if(EFFECT_STUN)
Stun(effect * hit_percent)
if(EFFECT_KNOCKDOWN)
Knockdown(effect * hit_percent, override_stamdmg = knockdown_stammax ? CLAMP(knockdown_stamoverride, 0, knockdown_stammax-getStaminaLoss()) : knockdown_stamoverride)
if(EFFECT_UNCONSCIOUS)
Unconscious(effect * hit_percent)
if(EFFECT_IRRADIATE)
radiation += max(effect * hit_percent, 0)
if(EFFECT_SLUR)
slurring = max(slurring,(effect * hit_percent))
if(EFFECT_STUTTER)
if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) // stun is usually associated with stutter
stuttering = max(stuttering,(effect * hit_percent))
if(EFFECT_EYE_BLUR)
blur_eyes(effect * hit_percent)
if(EFFECT_DROWSY)
drowsyness = max(drowsyness,(effect * hit_percent))
if(EFFECT_JITTER)
if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE))
jitteriness = max(jitteriness,(effect * hit_percent))
return 1
/mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = FALSE, stamina = 0, jitter = 0, kd_stamoverride, kd_stammax)
if(blocked >= 100)
return BULLET_ACT_BLOCK
if(stun)
apply_effect(stun, EFFECT_STUN, blocked)
if(knockdown)
apply_effect(knockdown, EFFECT_KNOCKDOWN, blocked, kd_stamoverride, kd_stammax)
if(unconscious)
apply_effect(unconscious, EFFECT_UNCONSCIOUS, blocked)
if(irradiate)
apply_effect(irradiate, EFFECT_IRRADIATE, blocked)
if(slur)
apply_effect(slur, EFFECT_SLUR, blocked)
if(stutter)
apply_effect(stutter, EFFECT_STUTTER, blocked)
if(eyeblur)
apply_effect(eyeblur, EFFECT_EYE_BLUR, blocked)
if(drowsy)
apply_effect(drowsy, EFFECT_DROWSY, blocked)
if(stamina)
apply_damage(stamina, STAMINA, null, blocked)
if(jitter)
apply_effect(jitter, EFFECT_JITTER, blocked)
return BULLET_ACT_HIT
/mob/living/proc/getBruteLoss()
return bruteloss
/mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
bruteloss = CLAMP((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getOxyLoss()
return oxyloss
/mob/living/proc/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
oxyloss = CLAMP((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(status_flags & GODMODE)
return 0
oxyloss = amount
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getToxLoss()
return toxloss
/mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
toxloss = CLAMP((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
toxloss = amount
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getFireLoss()
return fireloss
/mob/living/proc/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
fireloss = CLAMP((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/getCloneLoss()
return cloneloss
/mob/living/proc/adjustCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
cloneloss = CLAMP((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
cloneloss = amount
if(updating_health)
updatehealth()
return amount
/mob/living/proc/adjustOrganLoss(slot, amount, maximum)
return
/mob/living/proc/setOrganLoss(slot, amount, maximum)
return
/mob/living/proc/getOrganLoss(slot)
return
/mob/living/proc/getStaminaLoss()
return staminaloss
/mob/living/proc/adjustStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
return
/mob/living/proc/setStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
return
// heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(-burn, FALSE)
adjustStaminaLoss(-stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
// damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(burn, FALSE)
adjustStaminaLoss(stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
// heal MANY bodyparts, in random order
/mob/living/proc/heal_overall_damage(brute = 0, burn = 0, stamina = 0, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(-burn, FALSE)
adjustStaminaLoss(-stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
// damage MANY bodyparts, in random order
/mob/living/proc/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
adjustFireLoss(burn, FALSE)
adjustStaminaLoss(stamina, FALSE)
if(updating_health)
updatehealth()
update_stamina()
//heal up to amount damage, in a given order
/mob/living/proc/heal_ordered_damage(amount, list/damage_types)
. = amount //we'll return the amount of damage healed
for(var/i in damage_types)
var/amount_to_heal = min(amount, get_damage_amount(i)) //heal only up to the amount of damage we have
if(amount_to_heal)
apply_damage_type(-amount_to_heal, i)
amount -= amount_to_heal //remove what we healed from our current amount
if(!amount)
break
. -= amount //if there's leftover healing, remove it from what we return
+107 -107
View File
@@ -1,107 +1,107 @@
/mob/living/gib(no_brain, no_organs, no_bodyparts)
var/prev_lying = lying
if(stat != DEAD)
death(1)
if(!prev_lying)
gib_animation()
spill_organs(no_brain, no_organs, no_bodyparts)
release_vore_contents(silent = TRUE) // return of the bomb safe internals.
if(!no_bodyparts)
spread_bodyparts(no_brain, no_organs)
for(var/X in implants)
var/obj/item/implant/I = X
qdel(I)
spawn_gibs(no_bodyparts)
qdel(src)
/mob/living/proc/gib_animation()
return
/mob/living/proc/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(MOB_ROBOTIC in mob_biotypes)
new /obj/effect/gibspawner/robot(location, src, get_static_viruses())
else
new /obj/effect/gibspawner/generic(location, src, get_static_viruses())
/mob/living/proc/spill_organs()
return
/mob/living/proc/spread_bodyparts()
return
/mob/living/dust(just_ash, drop_items, force)
death(TRUE)
if(drop_items)
unequip_everything()
if(buckled)
buckled.unbuckle_mob(src, force = TRUE)
dust_animation()
release_vore_contents(silent = TRUE) //technically grief protection, I guess? if they're SM'd it doesn't matter seconds after anyway.
spawn_dust(just_ash)
QDEL_IN(src,5) // since this is sometimes called in the middle of movement, allow half a second for movement to finish, ghosting to happen and animation to play. Looks much nicer and doesn't cause multiple runtimes.
/mob/living/proc/dust_animation()
return
/mob/living/proc/spawn_dust(just_ash = FALSE)
new /obj/effect/decal/cleanable/ash(loc)
/mob/living/death(gibbed)
stat = DEAD
unset_machine()
timeofdeath = world.time
tod = STATION_TIME_TIMESTAMP("hh:mm:ss")
for(var/obj/item/I in contents)
I.on_mob_death(src, gibbed)
if(mind)
mind.store_memory("Time of death: [tod]", 0)
GLOB.alive_mob_list -= src
if(!gibbed)
GLOB.dead_mob_list += src
set_drugginess(0)
set_disgust(0)
SetSleeping(0, 0)
blind_eyes(1)
reset_perspective(null)
reload_fullscreen()
update_action_buttons_icon()
update_damage_hud()
update_health_hud()
update_canmove()
med_hud_set_health()
med_hud_set_status()
if(!gibbed && !QDELETED(src))
addtimer(CALLBACK(src, .proc/med_hud_set_status), (DEFIB_TIME_LIMIT * 10) + 1)
stop_pulling()
var/signal = SEND_SIGNAL(src, COMSIG_MOB_DEATH, gibbed)
var/turf/T = get_turf(src)
if(mind && mind.name && mind.active && !istype(T.loc, /area/ctf) && !(signal & COMPONENT_BLOCK_DEATH_BROADCAST))
var/rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[get_area_name(T)]</b>.</span>"
deadchat_broadcast(rendered, follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE)
if (client && client.prefs && client.prefs.auto_ooc)
if (!(client.prefs.chat_toggles & CHAT_OOC))
client.prefs.chat_toggles ^= CHAT_OOC
if (client)
client.move_delay = initial(client.move_delay)
for(var/s in ownedSoullinks)
var/datum/soullink/S = s
S.ownerDies(gibbed)
for(var/s in sharedSoullinks)
var/datum/soullink/S = s
S.sharerDies(gibbed)
return TRUE
/mob/living/gib(no_brain, no_organs, no_bodyparts)
var/prev_lying = lying
if(stat != DEAD)
death(1)
if(!prev_lying)
gib_animation()
spill_organs(no_brain, no_organs, no_bodyparts)
release_vore_contents(silent = TRUE) // return of the bomb safe internals.
if(!no_bodyparts)
spread_bodyparts(no_brain, no_organs)
for(var/X in implants)
var/obj/item/implant/I = X
qdel(I)
spawn_gibs(no_bodyparts)
qdel(src)
/mob/living/proc/gib_animation()
return
/mob/living/proc/spawn_gibs(with_bodyparts, atom/loc_override)
var/location = loc_override ? loc_override.drop_location() : drop_location()
if(MOB_ROBOTIC in mob_biotypes)
new /obj/effect/gibspawner/robot(location, src, get_static_viruses())
else
new /obj/effect/gibspawner/generic(location, src, get_static_viruses())
/mob/living/proc/spill_organs()
return
/mob/living/proc/spread_bodyparts()
return
/mob/living/dust(just_ash, drop_items, force)
death(TRUE)
if(drop_items)
unequip_everything()
if(buckled)
buckled.unbuckle_mob(src, force = TRUE)
dust_animation()
release_vore_contents(silent = TRUE) //technically grief protection, I guess? if they're SM'd it doesn't matter seconds after anyway.
spawn_dust(just_ash)
QDEL_IN(src,5) // since this is sometimes called in the middle of movement, allow half a second for movement to finish, ghosting to happen and animation to play. Looks much nicer and doesn't cause multiple runtimes.
/mob/living/proc/dust_animation()
return
/mob/living/proc/spawn_dust(just_ash = FALSE)
new /obj/effect/decal/cleanable/ash(loc)
/mob/living/death(gibbed)
stat = DEAD
unset_machine()
timeofdeath = world.time
tod = STATION_TIME_TIMESTAMP("hh:mm:ss")
for(var/obj/item/I in contents)
I.on_mob_death(src, gibbed)
if(mind)
mind.store_memory("Time of death: [tod]", 0)
GLOB.alive_mob_list -= src
if(!gibbed)
GLOB.dead_mob_list += src
set_drugginess(0)
set_disgust(0)
SetSleeping(0, 0)
blind_eyes(1)
reset_perspective(null)
reload_fullscreen()
update_action_buttons_icon()
update_damage_hud()
update_health_hud()
update_canmove()
med_hud_set_health()
med_hud_set_status()
if(!gibbed && !QDELETED(src))
addtimer(CALLBACK(src, .proc/med_hud_set_status), (DEFIB_TIME_LIMIT * 10) + 1)
stop_pulling()
var/signal = SEND_SIGNAL(src, COMSIG_MOB_DEATH, gibbed)
var/turf/T = get_turf(src)
if(mind && mind.name && mind.active && !istype(T.loc, /area/ctf) && !(signal & COMPONENT_BLOCK_DEATH_BROADCAST))
var/rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[get_area_name(T)]</b>.</span>"
deadchat_broadcast(rendered, follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE)
if (client && client.prefs && client.prefs.auto_ooc)
if (!(client.prefs.chat_toggles & CHAT_OOC))
client.prefs.chat_toggles ^= CHAT_OOC
if (client)
client.move_delay = initial(client.move_delay)
for(var/s in ownedSoullinks)
var/datum/soullink/S = s
S.ownerDies(gibbed)
for(var/s in sharedSoullinks)
var/datum/soullink/S = s
S.sharerDies(gibbed)
return TRUE
File diff suppressed because it is too large Load Diff
+130 -130
View File
@@ -1,130 +1,130 @@
//Generic system for picking up mobs.
//Currently works for head and hands.
/obj/item/clothing/head/mob_holder
name = "bugged mob"
desc = "Yell at coderbrush."
icon = null
icon_state = ""
var/mob/living/held_mob
var/can_head = FALSE
w_class = WEIGHT_CLASS_BULKY
/obj/item/clothing/head/mob_holder/Initialize(mapload, mob/living/M, _worn_state, alt_worn, lh_icon, rh_icon, _can_head_override = FALSE)
. = ..()
if(M)
M.setDir(SOUTH)
held_mob = M
M.forceMove(src)
appearance = M.appearance
name = M.name
desc = M.desc
if(_can_head_override)
can_head = _can_head_override
if(alt_worn)
alternate_worn_icon = alt_worn
if(_worn_state)
item_state = _worn_state
icon_state = _worn_state
if(lh_icon)
lefthand_file = lh_icon
if(rh_icon)
righthand_file = rh_icon
if(!can_head)
slot_flags = NONE
/obj/item/clothing/head/mob_holder/Destroy()
if(held_mob)
release()
return ..()
/obj/item/clothing/head/mob_holder/dropped()
..()
if(isturf(loc))//don't release on soft-drops
release()
/obj/item/clothing/head/mob_holder/proc/release()
if(isliving(loc))
var/mob/living/L = loc
L.dropItemToGround(src)
if(held_mob)
var/mob/living/m = held_mob
m.forceMove(get_turf(m))
m.reset_perspective()
m.setDir(SOUTH)
held_mob = null
qdel(src)
/obj/item/clothing/head/mob_holder/relaymove(mob/user)
return
/obj/item/clothing/head/mob_holder/container_resist()
if(isliving(loc))
var/mob/living/L = loc
visible_message("<span class='warning'>[src] escapes [L]!</span>")
release()
/mob/living/proc/mob_pickup(mob/living/L)
var/obj/item/clothing/head/mob_holder/holder = generate_mob_holder()
if(!holder)
return
drop_all_held_items()
L.put_in_hands(holder)
return
/mob/living/proc/mob_try_pickup(mob/living/user)
if(!ishuman(user) || !src.Adjacent(user) || user.incapacitated() || !can_be_held)
return FALSE
if(user.get_active_held_item())
to_chat(user, "<span class='warning'>Your hands are full!</span>")
return FALSE
if(buckled)
to_chat(user, "<span class='warning'>[src] is buckled to something!</span>")
return FALSE
if(src == user)
to_chat(user, "<span class='warning'>You can't pick yourself up.</span>")
return FALSE
visible_message("<span class='warning'>[user] starts picking up [src].</span>", \
"<span class='userdanger'>[user] starts picking you up!</span>")
if(!do_after(user, 20, target = src))
return FALSE
if(user.get_active_held_item()||buckled)
return FALSE
visible_message("<span class='warning'>[user] picks up [src]!</span>", \
"<span class='userdanger'>[user] picks you up!</span>")
to_chat(user, "<span class='notice'>You pick [src] up.</span>")
mob_pickup(user)
return TRUE
/mob/living/AltClick(mob/user)
. = ..()
if(mob_try_pickup(user))
return TRUE
// I didn't define these for mobs, because you shouldn't be able to breathe out of mobs and using their loc isn't always the logical thing to do.
/obj/item/clothing/head/mob_holder/assume_air(datum/gas_mixture/env)
var/atom/location = loc
if(!loc)
return //null
var/turf/T = get_turf(loc)
while(location != T)
location = location.loc
if(ismob(location))
return location.loc.assume_air(env)
return loc.assume_air(env)
/obj/item/clothing/head/mob_holder/remove_air(amount)
var/atom/location = loc
if(!loc)
return //null
var/turf/T = get_turf(loc)
while(location != T)
location = location.loc
if(ismob(location))
return location.loc.remove_air(amount)
return loc.remove_air(amount)
//Generic system for picking up mobs.
//Currently works for head and hands.
/obj/item/clothing/head/mob_holder
name = "bugged mob"
desc = "Yell at coderbrush."
icon = null
icon_state = ""
var/mob/living/held_mob
var/can_head = FALSE
w_class = WEIGHT_CLASS_BULKY
/obj/item/clothing/head/mob_holder/Initialize(mapload, mob/living/M, _worn_state, alt_worn, lh_icon, rh_icon, _can_head_override = FALSE)
. = ..()
if(M)
M.setDir(SOUTH)
held_mob = M
M.forceMove(src)
appearance = M.appearance
name = M.name
desc = M.desc
if(_can_head_override)
can_head = _can_head_override
if(alt_worn)
alternate_worn_icon = alt_worn
if(_worn_state)
item_state = _worn_state
icon_state = _worn_state
if(lh_icon)
lefthand_file = lh_icon
if(rh_icon)
righthand_file = rh_icon
if(!can_head)
slot_flags = NONE
/obj/item/clothing/head/mob_holder/Destroy()
if(held_mob)
release()
return ..()
/obj/item/clothing/head/mob_holder/dropped()
..()
if(isturf(loc))//don't release on soft-drops
release()
/obj/item/clothing/head/mob_holder/proc/release()
if(isliving(loc))
var/mob/living/L = loc
L.dropItemToGround(src)
if(held_mob)
var/mob/living/m = held_mob
m.forceMove(get_turf(m))
m.reset_perspective()
m.setDir(SOUTH)
held_mob = null
qdel(src)
/obj/item/clothing/head/mob_holder/relaymove(mob/user)
return
/obj/item/clothing/head/mob_holder/container_resist()
if(isliving(loc))
var/mob/living/L = loc
visible_message("<span class='warning'>[src] escapes [L]!</span>")
release()
/mob/living/proc/mob_pickup(mob/living/L)
var/obj/item/clothing/head/mob_holder/holder = generate_mob_holder()
if(!holder)
return
drop_all_held_items()
L.put_in_hands(holder)
return
/mob/living/proc/mob_try_pickup(mob/living/user)
if(!ishuman(user) || !src.Adjacent(user) || user.incapacitated() || !can_be_held)
return FALSE
if(user.get_active_held_item())
to_chat(user, "<span class='warning'>Your hands are full!</span>")
return FALSE
if(buckled)
to_chat(user, "<span class='warning'>[src] is buckled to something!</span>")
return FALSE
if(src == user)
to_chat(user, "<span class='warning'>You can't pick yourself up.</span>")
return FALSE
visible_message("<span class='warning'>[user] starts picking up [src].</span>", \
"<span class='userdanger'>[user] starts picking you up!</span>")
if(!do_after(user, 20, target = src))
return FALSE
if(user.get_active_held_item()||buckled)
return FALSE
visible_message("<span class='warning'>[user] picks up [src]!</span>", \
"<span class='userdanger'>[user] picks you up!</span>")
to_chat(user, "<span class='notice'>You pick [src] up.</span>")
mob_pickup(user)
return TRUE
/mob/living/AltClick(mob/user)
. = ..()
if(mob_try_pickup(user))
return TRUE
// I didn't define these for mobs, because you shouldn't be able to breathe out of mobs and using their loc isn't always the logical thing to do.
/obj/item/clothing/head/mob_holder/assume_air(datum/gas_mixture/env)
var/atom/location = loc
if(!loc)
return //null
var/turf/T = get_turf(loc)
while(location != T)
location = location.loc
if(ismob(location))
return location.loc.assume_air(env)
return loc.assume_air(env)
/obj/item/clothing/head/mob_holder/remove_air(amount)
var/atom/location = loc
if(!loc)
return //null
var/turf/T = get_turf(loc)
while(location != T)
location = location.loc
if(ismob(location))
return location.loc.remove_air(amount)
return loc.remove_air(amount)
+34 -24
View File
@@ -75,7 +75,7 @@
return
if(ismovableatom(A))
var/atom/movable/AM = A
if(PushAM(AM))
if(PushAM(AM, move_force))
return
/mob/living/Bumped(atom/movable/AM)
@@ -218,36 +218,46 @@
return
//Called when we want to push an atom/movable
/mob/living/proc/PushAM(atom/movable/AM)
/mob/living/proc/PushAM(atom/movable/AM, force = move_force)
if(now_pushing)
return 1
return TRUE
if(moving_diagonally)// no pushing during diagonal moves.
return 1
return TRUE
if(!client && (mob_size < MOB_SIZE_SMALL))
return
if(!AM.anchored)
now_pushing = 1
var/t = get_dir(src, AM)
if (istype(AM, /obj/structure/window))
var/obj/structure/window/W = AM
if(W.fulltile)
for(var/obj/structure/window/win in get_step(W,t))
now_pushing = 0
return
if(pulling == AM)
stop_pulling()
var/current_dir
if(isliving(AM))
current_dir = AM.dir
step(AM, t)
if(current_dir)
AM.setDir(current_dir)
now_pushing = 0
now_pushing = TRUE
var/t = get_dir(src, AM)
var/push_anchored = FALSE
if((AM.move_resist * MOVE_FORCE_CRUSH_RATIO) <= force)
if(move_crush(AM, move_force, t))
push_anchored = TRUE
if((AM.move_resist * MOVE_FORCE_FORCEPUSH_RATIO) <= force) //trigger move_crush and/or force_push regardless of if we can push it normally
if(force_push(AM, move_force, t, push_anchored))
push_anchored = TRUE
if((AM.anchored && !push_anchored) || (force < (AM.move_resist * MOVE_FORCE_PUSH_RATIO)))
now_pushing = FALSE
return
if (istype(AM, /obj/structure/window))
var/obj/structure/window/W = AM
if(W.fulltile)
for(var/obj/structure/window/win in get_step(W,t))
now_pushing = FALSE
return
if(pulling == AM)
stop_pulling()
var/current_dir
if(isliving(AM))
current_dir = AM.dir
if(step(AM, t))
step(src, t)
if(current_dir)
AM.setDir(current_dir)
now_pushing = FALSE
/mob/living/start_pulling(atom/movable/AM, supress_message = 0)
/mob/living/start_pulling(atom/movable/AM, state, force = pull_force, supress_message = FALSE)
if(!AM || !src)
return FALSE
if(!(AM.can_be_pulled(src)))
if(!(AM.can_be_pulled(src, state, force)))
return FALSE
if(throwing || incapacitated())
return FALSE
File diff suppressed because it is too large Load Diff
+115 -115
View File
@@ -1,116 +1,116 @@
/mob/living
see_invisible = SEE_INVISIBLE_LIVING
sight = 0
see_in_dark = 2
hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,RAD_HUD)
pressure_resistance = 10
var/resize = 1 //Badminnery resize
var/lastattacker = null
var/lastattackerckey = null
//Health and life related vars
var/maxHealth = 100 //Maximum health that should be possible.
var/health = 100 //A mob's health
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
var/bruteloss = 0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
var/oxyloss = 0 //Oxygen depravation damage (no air in lungs)
var/toxloss = 0 //Toxic damage caused by being poisoned or radiated
var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt.
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are knocked down if it gets too high. Holodeck and hallucinations deal this.
var/crit_threshold = HEALTH_THRESHOLD_CRIT // when the mob goes from "normal" to crit
var/confused = 0 //Makes the mob move in random directions.
var/hallucination = 0 //Directly affects how long a mob will hallucinate for
var/last_special = 0 //Used by the resist verb, likely used to prevent players from bypassing next_move by logging in/out.
var/timeofdeath = 0
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = FALSE //FALSE is off, INCORPOREAL_MOVE_BASIC is normal, INCORPOREAL_MOVE_SHADOW is for ninjas
//and INCORPOREAL_MOVE_JAUNT is blocked by holy water/salt
var/list/roundstart_quirks = list()
var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
var/now_pushing = null //used by living/Bump() and living/PushAM() to prevent potential infinite loop.
var/cameraFollow = null
var/tod = null // Time of death
var/on_fire = 0 //The "Are we on fire?" var
var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20
var/bloodcrawl = 0 //0 No blood crawling, BLOODCRAWL for bloodcrawling, BLOODCRAWL_EAT for crawling+mob devour
var/holder = null //The holder for blood crawling
var/ventcrawler = 0 //0 No vent crawling, 1 vent crawling in the nude, 2 vent crawling always
var/limb_destroyer = 0 //1 Sets AI behavior that allows mobs to target and dismember limbs with their basic attack.
var/mob_size = MOB_SIZE_HUMAN
var/list/mob_biotypes = list(MOB_ORGANIC)
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/has_limbs = 0 //does the mob have distinct limbs?(arms,legs, chest,head)
var/list/pipes_shown = list()
var/last_played_vent
var/smoke_delay = 0 //used to prevent spam with smoke reagent reaction on mob.
var/bubble_icon = "default" //what icon the mob uses for speechbubbles
var/last_bumped = 0
var/unique_name = 0 //if a mob's name should be appended with an id when created e.g. Mob (666)
var/list/butcher_results = null //these will be yielded from butchering with a probability chance equal to the butcher item's effectiveness
var/list/guaranteed_butcher_results = null //these will always be yielded from butchering
var/butcher_difficulty = 0 //effectiveness prob. is modified negatively by this amount; positive numbers make it more difficult, negative ones make it easier
var/hellbound = 0 //People who've signed infernal contracts are unrevivable.
var/list/weather_immunities = list()
var/stun_absorption = null //converted to a list of stun absorption sources this mob has when one is added
var/blood_volume = 0 //how much blood the mob has
var/blood_ratio = 1 //How much blood the mob needs, in terms of ratio (i.e 1.2 will require BLOOD_VOLUME_NORMAL of 672) DO NOT GO ABOVE 3.55 Well, actually you can but, then they can't get enough blood.
var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override
var/see_override = 0 //0 for no override, sets see_invisible = see_override in silicon & carbon life process via update_sight()
var/list/status_effects //a list of all status effects the mob has
var/druggy = 0
//Speech
var/stuttering = 0
var/slurring = 0
var/cultslurring = 0
var/derpspeech = 0
var/list/implants = null
var/datum/riding/riding_datum
var/datum/language/selected_default_language
var/last_words //used for database logging
var/list/obj/effect/proc_holder/abilities = list()
var/can_be_held = FALSE //whether this can be picked up and held.
var/radiation = 0 //If the mob is irradiated.
var/ventcrawl_layer = PIPING_LAYER_DEFAULT
var/losebreath = 0
//List of active diseases
var/list/diseases = list() // list of all diseases in a mob
var/list/disease_resistances = list()
var/drag_slowdown = TRUE //Whether the mob is slowed down when dragging another prone mob
/mob/living
see_invisible = SEE_INVISIBLE_LIVING
sight = 0
see_in_dark = 2
hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,RAD_HUD)
pressure_resistance = 10
var/resize = 1 //Badminnery resize
var/lastattacker = null
var/lastattackerckey = null
//Health and life related vars
var/maxHealth = 100 //Maximum health that should be possible.
var/health = 100 //A mob's health
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
var/bruteloss = 0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
var/oxyloss = 0 //Oxygen depravation damage (no air in lungs)
var/toxloss = 0 //Toxic damage caused by being poisoned or radiated
var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt.
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are knocked down if it gets too high. Holodeck and hallucinations deal this.
var/crit_threshold = HEALTH_THRESHOLD_CRIT // when the mob goes from "normal" to crit
var/confused = 0 //Makes the mob move in random directions.
var/hallucination = 0 //Directly affects how long a mob will hallucinate for
var/last_special = 0 //Used by the resist verb, likely used to prevent players from bypassing next_move by logging in/out.
var/timeofdeath = 0
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = FALSE //FALSE is off, INCORPOREAL_MOVE_BASIC is normal, INCORPOREAL_MOVE_SHADOW is for ninjas
//and INCORPOREAL_MOVE_JAUNT is blocked by holy water/salt
var/list/roundstart_quirks = list()
var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
var/now_pushing = null //used by living/Bump() and living/PushAM() to prevent potential infinite loop.
var/cameraFollow = null
var/tod = null // Time of death
var/on_fire = 0 //The "Are we on fire?" var
var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20
var/bloodcrawl = 0 //0 No blood crawling, BLOODCRAWL for bloodcrawling, BLOODCRAWL_EAT for crawling+mob devour
var/holder = null //The holder for blood crawling
var/ventcrawler = 0 //0 No vent crawling, 1 vent crawling in the nude, 2 vent crawling always
var/limb_destroyer = 0 //1 Sets AI behavior that allows mobs to target and dismember limbs with their basic attack.
var/mob_size = MOB_SIZE_HUMAN
var/list/mob_biotypes = list(MOB_ORGANIC)
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/has_limbs = 0 //does the mob have distinct limbs?(arms,legs, chest,head)
var/list/pipes_shown = list()
var/last_played_vent
var/smoke_delay = 0 //used to prevent spam with smoke reagent reaction on mob.
var/bubble_icon = "default" //what icon the mob uses for speechbubbles
var/last_bumped = 0
var/unique_name = 0 //if a mob's name should be appended with an id when created e.g. Mob (666)
var/list/butcher_results = null //these will be yielded from butchering with a probability chance equal to the butcher item's effectiveness
var/list/guaranteed_butcher_results = null //these will always be yielded from butchering
var/butcher_difficulty = 0 //effectiveness prob. is modified negatively by this amount; positive numbers make it more difficult, negative ones make it easier
var/hellbound = 0 //People who've signed infernal contracts are unrevivable.
var/list/weather_immunities = list()
var/stun_absorption = null //converted to a list of stun absorption sources this mob has when one is added
var/blood_volume = 0 //how much blood the mob has
var/blood_ratio = 1 //How much blood the mob needs, in terms of ratio (i.e 1.2 will require BLOOD_VOLUME_NORMAL of 672) DO NOT GO ABOVE 3.55 Well, actually you can but, then they can't get enough blood.
var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override
var/see_override = 0 //0 for no override, sets see_invisible = see_override in silicon & carbon life process via update_sight()
var/list/status_effects //a list of all status effects the mob has
var/druggy = 0
//Speech
var/stuttering = 0
var/slurring = 0
var/cultslurring = 0
var/derpspeech = 0
var/list/implants = null
var/datum/riding/riding_datum
var/datum/language/selected_default_language
var/last_words //used for database logging
var/list/obj/effect/proc_holder/abilities = list()
var/can_be_held = FALSE //whether this can be picked up and held.
var/radiation = 0 //If the mob is irradiated.
var/ventcrawl_layer = PIPING_LAYER_DEFAULT
var/losebreath = 0
//List of active diseases
var/list/diseases = list() // list of all diseases in a mob
var/list/disease_resistances = list()
var/drag_slowdown = TRUE //Whether the mob is slowed down when dragging another prone mob
var/rotate_on_lying = FALSE
@@ -2,6 +2,21 @@
. = ..()
update_turf_movespeed(loc)
/mob/living/CanPass(atom/movable/mover, turf/target)
if((mover.pass_flags & PASSMOB))
return TRUE
if(istype(mover, /obj/item/projectile))
var/obj/item/projectile/P = mover
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
if(mover.throwing)
return (!density || lying)
if(buckled == mover)
return TRUE
if(ismob(mover))
if (mover in buckled_mobs)
return TRUE
return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
/mob/living/toggle_move_intent()
. = ..()
update_move_intent_slowdown()
+27 -27
View File
@@ -1,27 +1,27 @@
/mob/living/Login()
..()
//Mind updates
sync_mind()
mind.show_memory(src, 0)
//Round specific stuff
if(SSticker.mode)
switch(SSticker.mode.name)
if("sandbox")
CanBuild()
update_damage_hud()
update_health_hud()
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
//Vents
if(ventcrawler)
to_chat(src, "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>")
if(ranged_ability)
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
if(vore_init && !vorepref_init) //Vore's been initialized, voreprefs haven't. If this triggers then that means that voreprefs failed to load due to the client being missing.
apply_vore_prefs()
/mob/living/Login()
..()
//Mind updates
sync_mind()
mind.show_memory(src, 0)
//Round specific stuff
if(SSticker.mode)
switch(SSticker.mode.name)
if("sandbox")
CanBuild()
update_damage_hud()
update_health_hud()
var/turf/T = get_turf(src)
if (isturf(T))
update_z(T.z)
//Vents
if(ventcrawler)
to_chat(src, "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>")
if(ranged_ability)
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
if(vore_init && !vorepref_init) //Vore's been initialized, voreprefs haven't. If this triggers then that means that voreprefs failed to load due to the client being missing.
apply_vore_prefs()
+4 -4
View File
@@ -1,5 +1,5 @@
/mob/living/Logout()
update_z(null)
..()
if(!key && mind) //key and mind have become separated.
/mob/living/Logout()
update_z(null)
..()
if(!key && mind) //key and mind have become separated.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
+419 -419
View File
@@ -1,419 +1,419 @@
GLOBAL_LIST_INIT(department_radio_prefixes, list(":", "."))
GLOBAL_LIST_INIT(department_radio_keys, list(
// Location
MODE_KEY_R_HAND = MODE_R_HAND,
MODE_KEY_L_HAND = MODE_L_HAND,
MODE_KEY_INTERCOM = MODE_INTERCOM,
// Department
MODE_KEY_DEPARTMENT = MODE_DEPARTMENT,
RADIO_KEY_COMMAND = RADIO_CHANNEL_COMMAND,
RADIO_KEY_SCIENCE = RADIO_CHANNEL_SCIENCE,
RADIO_KEY_MEDICAL = RADIO_CHANNEL_MEDICAL,
RADIO_KEY_ENGINEERING = RADIO_CHANNEL_ENGINEERING,
RADIO_KEY_SECURITY = RADIO_CHANNEL_SECURITY,
RADIO_KEY_SUPPLY = RADIO_CHANNEL_SUPPLY,
RADIO_KEY_SERVICE = RADIO_CHANNEL_SERVICE,
// Faction
RADIO_KEY_SYNDICATE = RADIO_CHANNEL_SYNDICATE,
RADIO_KEY_CENTCOM = RADIO_CHANNEL_CENTCOM,
// Admin
MODE_KEY_ADMIN = MODE_ADMIN,
MODE_KEY_DEADMIN = MODE_DEADMIN,
// Misc
RADIO_KEY_AI_PRIVATE = RADIO_CHANNEL_AI_PRIVATE, // AI Upload channel
MODE_KEY_VOCALCORDS = MODE_VOCALCORDS, // vocal cords, used by Voice of God
//kinda localization -- rastaf0
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
// Location
"ê" = MODE_R_HAND,
"ä" = MODE_L_HAND,
"ø" = MODE_INTERCOM,
// Department
"ð" = MODE_DEPARTMENT,
"ñ" = RADIO_CHANNEL_COMMAND,
"ò" = RADIO_CHANNEL_SCIENCE,
"ü" = RADIO_CHANNEL_MEDICAL,
"ó" = RADIO_CHANNEL_ENGINEERING,
"û" = RADIO_CHANNEL_SECURITY,
"ã" = RADIO_CHANNEL_SUPPLY,
"ì" = RADIO_CHANNEL_SERVICE,
// Faction
"å" = RADIO_CHANNEL_SYNDICATE,
"í" = RADIO_CHANNEL_CENTCOM,
// Admin
"ç" = MODE_ADMIN,
"â" = MODE_ADMIN,
// Misc
"ù" = RADIO_CHANNEL_AI_PRIVATE,
"÷" = MODE_VOCALCORDS
))
/mob/living/proc/Ellipsis(original_msg, chance = 50, keep_words)
if(chance <= 0)
return "..."
if(chance >= 100)
return original_msg
var/list/words = splittext(original_msg," ")
var/list/new_words = list()
var/new_msg = ""
for(var/w in words)
if(prob(chance))
new_words += "..."
if(!keep_words)
continue
new_words += w
new_msg = jointext(new_words," ")
return new_msg
/mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
var/static/list/crit_allowed_modes = list(MODE_WHISPER = TRUE, MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE)
var/static/list/unconscious_allowed_modes = list(MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE)
var/talk_key = get_key(message)
var/static/list/one_character_prefix = list(MODE_HEADSET = TRUE, MODE_ROBOT = TRUE, MODE_WHISPER = TRUE)
if(sanitize)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(!message || message == "")
return
var/datum/saymode/saymode = SSradio.saymodes[talk_key]
var/message_mode = get_message_mode(message)
var/original_message = message
var/in_critical = InCritical()
if(one_character_prefix[message_mode])
message = copytext(message, 2)
else if(message_mode || saymode)
message = copytext(message, 3)
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(message_mode == MODE_ADMIN)
if(client)
client.cmd_admin_say(message)
return
if(message_mode == MODE_DEADMIN)
if(client)
client.dsay(message)
return
if(stat == DEAD)
say_dead(original_message)
return
if(check_emote(original_message) || !can_speak_basic(original_message, ignore_spam))
return
if(in_critical)
if(!(crit_allowed_modes[message_mode]))
return
else if(stat == UNCONSCIOUS)
if(!(unconscious_allowed_modes[message_mode]))
return
// language comma detection.
var/datum/language/message_language = get_message_language(message)
if(message_language)
// No, you cannot speak in xenocommon just because you know the key
if(can_speak_in_language(message_language))
language = message_language
message = copytext(message, 3)
// Trim the space if they said ",0 I LOVE LANGUAGES"
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(!language)
language = get_default_language()
// Detection of language needs to be before inherent channels, because
// AIs use inherent channels for the holopad. Most inherent channels
// ignore the language argument however.
if(saymode && !saymode.handle_message(src, message, language))
return
if(!can_speak_vocal(message))
to_chat(src, "<span class='warning'>You find yourself unable to speak!</span>")
return
var/message_range = 7
var/succumbed = FALSE
var/fullcrit = InFullCritical()
if((InCritical() && !fullcrit) || message_mode == MODE_WHISPER)
message_range = 1
message_mode = MODE_WHISPER
src.log_talk(message, LOG_WHISPER)
if(fullcrit)
var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health)
// If we cut our message short, abruptly end it with a-..
var/message_len = length(message)
message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
message = Ellipsis(message, 10, 1)
message_mode = MODE_WHISPER_CRIT
succumbed = TRUE
else
src.log_talk(message, LOG_SAY, forced_by=forced)
message = treat_message(message) // unfortunately we still need this
var/sigreturn = SEND_SIGNAL(src, COMSIG_MOB_SAY, args)
if (sigreturn & COMPONENT_UPPERCASE_SPEECH)
message = uppertext(message)
if(!message)
return
last_words = message
spans |= speech_span
if(language)
var/datum/language/L = GLOB.language_datum_instances[language]
spans |= L.spans
var/radio_return = radio(message, message_mode, spans, language)
if(radio_return & ITALICS)
spans |= SPAN_ITALICS
if(radio_return & REDUCE_RANGE)
message_range = 1
if(radio_return & NOPASS)
return 1
//No screams in space, unless you're next to someone.
var/turf/T = get_turf(src)
var/datum/gas_mixture/environment = T.return_air()
var/pressure = (environment)? environment.return_pressure() : 0
if(pressure < SOUND_MINIMUM_PRESSURE)
message_range = 1
if(pressure < ONE_ATMOSPHERE*0.4) //Thin air, let's italicise the message
spans |= SPAN_ITALICS
send_speech(message, message_range, src, bubble_type, spans, language, message_mode)
if(succumbed)
succumb()
to_chat(src, compose_message(src, language, message, null, spans, message_mode))
return 1
/mob/living/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, face_name = FALSE, atom/movable/source)
. = ..()
if(isliving(speaker))
var/turf/sourceturf = get_turf(source)
var/turf/T = get_turf(src)
if(sourceturf && T && !(sourceturf in get_hear(5, T)))
. = "<span class='small'>[.]</span>"
/mob/living/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if(!client)
return
var/deaf_message
var/deaf_type
if(speaker != src)
if(!radio_freq) //These checks have to be seperate, else people talking on the radio will make "You can't hear yourself!" appear when hearing people over the radio while deaf.
deaf_message = "<span class='name'>[speaker]</span> [speaker.verb_say] something but you cannot hear [speaker.p_them()]."
deaf_type = 1
else
deaf_message = "<span class='notice'>You can't hear yourself!</span>"
deaf_type = 2 // Since you should be able to hear yourself without looking
// Recompose message for AI hrefs, language incomprehension.
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
show_message(message, MSG_AUDIBLE, deaf_message, deaf_type)
return message
/mob/living/send_speech(message, message_range = 6, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null, message_mode)
var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE)
var/eavesdrop_range = 0
if(eavesdropping_modes[message_mode])
eavesdrop_range = EAVESDROP_EXTRA_RANGE
var/list/listening = get_hearers_in_view(message_range+eavesdrop_range, source)
var/list/the_dead = list()
var/list/yellareas //CIT CHANGE - adds the ability for yelling to penetrate walls and echo throughout areas
if(!eavesdrop_range && say_test(message) == "2") //CIT CHANGE - ditto
yellareas = get_areas_in_range(message_range*0.5, source) //CIT CHANGE - ditto
for(var/_M in GLOB.player_list)
var/mob/M = _M
if(M.stat != DEAD) //not dead, not important
if(yellareas) //CIT CHANGE - see above. makes yelling penetrate walls
var/area/A = get_area(M) //CIT CHANGE - ditto
if(istype(A) && A.ambientsounds != SPACE && A in yellareas) //CIT CHANGE - ditto
listening |= M //CIT CHANGE - ditto
continue
if(!M.client || !client) //client is so that ghosts don't have to listen to mice
continue
if(get_dist(M, source) > 7 || M.z != z) //they're out of range of normal hearing
if(eavesdropping_modes[message_mode] && !(M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
continue
if(!(M.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
continue
listening |= M
the_dead[M] = TRUE
var/eavesdropping
var/eavesrendered
if(eavesdrop_range)
eavesdropping = stars(message)
eavesrendered = compose_message(src, message_language, eavesdropping, null, spans, message_mode, FALSE, source)
var/rendered = compose_message(src, message_language, message, null, spans, message_mode, FALSE, source)
for(var/_AM in listening)
var/atom/movable/AM = _AM
if(eavesdrop_range && get_dist(source, AM) > message_range && !(the_dead[AM]))
AM.Hear(eavesrendered, src, message_language, eavesdropping, null, spans, message_mode, source)
else
AM.Hear(rendered, src, message_language, message, null, spans, message_mode, source)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LIVING_SAY_SPECIAL, src, message)
//speech bubble
var/list/speech_bubble_recipients = list()
for(var/mob/M in listening)
if(M.client)
speech_bubble_recipients.Add(M.client)
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /.proc/flick_overlay, I, speech_bubble_recipients, 30)
/mob/proc/binarycheck()
return FALSE
/mob/living/can_speak(message) //For use outside of Say()
if(can_speak_basic(message) && can_speak_vocal(message))
return 1
/mob/living/proc/can_speak_basic(message, ignore_spam = FALSE) //Check BEFORE handling of xeno and ling channels
if(client)
if(client.prefs.muted & MUTE_IC)
to_chat(src, "<span class='danger'>You cannot speak in IC (muted).</span>")
return 0
if(!ignore_spam && client.handle_spam_prevention(message,MUTE_IC))
return 0
return 1
/mob/living/proc/can_speak_vocal(message) //Check AFTER handling of xeno and ling channels
if(HAS_TRAIT(src, TRAIT_MUTE))
return 0
if(is_muzzled())
return 0
if(!IsVocal())
return 0
return 1
/mob/living/proc/get_key(message)
var/key = copytext(message, 1, 2)
if(key in GLOB.department_radio_prefixes)
return lowertext(copytext(message, 2, 3))
/mob/living/proc/get_message_language(message)
if(copytext(message, 1, 2) == ",")
var/key = copytext(message, 2, 3)
for(var/ld in GLOB.all_languages)
var/datum/language/LD = ld
if(initial(LD.key) == key)
return LD
return null
/mob/living/proc/treat_message(message)
if(HAS_TRAIT(src, TRAIT_UNINTELLIGIBLE_SPEECH))
message = unintelligize(message)
if(derpspeech)
message = derpspeech(message, stuttering)
if(stuttering)
message = stutter(message)
if(slurring)
message = slur(message,slurring)
if(cultslurring)
message = cultslur(message)
message = capitalize(message)
return message
/mob/living/proc/radio(message, message_mode, list/spans, language)
var/obj/item/implant/radio/imp = locate() in implants
if(imp?.radio.on)
if(message_mode == MODE_HEADSET)
imp.radio.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(message_mode == MODE_DEPARTMENT || message_mode in GLOB.radiochannels)
imp.radio.talk_into(src, message, message_mode, spans, language)
return ITALICS | REDUCE_RANGE
switch(message_mode)
if(MODE_WHISPER)
return ITALICS
if(MODE_R_HAND)
for(var/obj/item/r_hand in get_held_items_for_side("r", all = TRUE))
if (r_hand)
return r_hand.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_L_HAND)
for(var/obj/item/l_hand in get_held_items_for_side("l", all = TRUE))
if (l_hand)
return l_hand.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_INTERCOM)
for (var/obj/item/radio/intercom/I in view(1, null))
I.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_BINARY)
return ITALICS | REDUCE_RANGE //Does not return 0 since this is only reached by humans, not borgs or AIs.
return 0
/mob/living/say_mod(input, message_mode)
. = ..()
if(message_mode == MODE_WHISPER_CRIT)
. = "[verb_whisper] in [p_their()] last breath"
else if(message_mode != MODE_CUSTOM_SAY)
if(message_mode == MODE_WHISPER)
. = verb_whisper
else if(stuttering)
. = "stammers"
else if(derpspeech)
. = "gibbers"
/mob/living/whisper(message, bubble_type, list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
say("#[message]", bubble_type, spans, sanitize, language, ignore_spam, forced)
/mob/living/get_language_holder(shadow=TRUE)
if(mind && shadow)
// Mind language holders shadow mob holders.
. = mind.get_language_holder()
if(.)
return .
. = ..()
GLOBAL_LIST_INIT(department_radio_prefixes, list(":", "."))
GLOBAL_LIST_INIT(department_radio_keys, list(
// Location
MODE_KEY_R_HAND = MODE_R_HAND,
MODE_KEY_L_HAND = MODE_L_HAND,
MODE_KEY_INTERCOM = MODE_INTERCOM,
// Department
MODE_KEY_DEPARTMENT = MODE_DEPARTMENT,
RADIO_KEY_COMMAND = RADIO_CHANNEL_COMMAND,
RADIO_KEY_SCIENCE = RADIO_CHANNEL_SCIENCE,
RADIO_KEY_MEDICAL = RADIO_CHANNEL_MEDICAL,
RADIO_KEY_ENGINEERING = RADIO_CHANNEL_ENGINEERING,
RADIO_KEY_SECURITY = RADIO_CHANNEL_SECURITY,
RADIO_KEY_SUPPLY = RADIO_CHANNEL_SUPPLY,
RADIO_KEY_SERVICE = RADIO_CHANNEL_SERVICE,
// Faction
RADIO_KEY_SYNDICATE = RADIO_CHANNEL_SYNDICATE,
RADIO_KEY_CENTCOM = RADIO_CHANNEL_CENTCOM,
// Admin
MODE_KEY_ADMIN = MODE_ADMIN,
MODE_KEY_DEADMIN = MODE_DEADMIN,
// Misc
RADIO_KEY_AI_PRIVATE = RADIO_CHANNEL_AI_PRIVATE, // AI Upload channel
MODE_KEY_VOCALCORDS = MODE_VOCALCORDS, // vocal cords, used by Voice of God
//kinda localization -- rastaf0
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
// Location
"ê" = MODE_R_HAND,
"ä" = MODE_L_HAND,
"ø" = MODE_INTERCOM,
// Department
"ð" = MODE_DEPARTMENT,
"ñ" = RADIO_CHANNEL_COMMAND,
"ò" = RADIO_CHANNEL_SCIENCE,
"ü" = RADIO_CHANNEL_MEDICAL,
"ó" = RADIO_CHANNEL_ENGINEERING,
"û" = RADIO_CHANNEL_SECURITY,
"ã" = RADIO_CHANNEL_SUPPLY,
"ì" = RADIO_CHANNEL_SERVICE,
// Faction
"å" = RADIO_CHANNEL_SYNDICATE,
"í" = RADIO_CHANNEL_CENTCOM,
// Admin
"ç" = MODE_ADMIN,
"â" = MODE_ADMIN,
// Misc
"ù" = RADIO_CHANNEL_AI_PRIVATE,
"÷" = MODE_VOCALCORDS
))
/mob/living/proc/Ellipsis(original_msg, chance = 50, keep_words)
if(chance <= 0)
return "..."
if(chance >= 100)
return original_msg
var/list/words = splittext(original_msg," ")
var/list/new_words = list()
var/new_msg = ""
for(var/w in words)
if(prob(chance))
new_words += "..."
if(!keep_words)
continue
new_words += w
new_msg = jointext(new_words," ")
return new_msg
/mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
var/static/list/crit_allowed_modes = list(MODE_WHISPER = TRUE, MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE)
var/static/list/unconscious_allowed_modes = list(MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE)
var/talk_key = get_key(message)
var/static/list/one_character_prefix = list(MODE_HEADSET = TRUE, MODE_ROBOT = TRUE, MODE_WHISPER = TRUE)
if(sanitize)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(!message || message == "")
return
var/datum/saymode/saymode = SSradio.saymodes[talk_key]
var/message_mode = get_message_mode(message)
var/original_message = message
var/in_critical = InCritical()
if(one_character_prefix[message_mode])
message = copytext(message, 2)
else if(message_mode || saymode)
message = copytext(message, 3)
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(message_mode == MODE_ADMIN)
if(client)
client.cmd_admin_say(message)
return
if(message_mode == MODE_DEADMIN)
if(client)
client.dsay(message)
return
if(stat == DEAD)
say_dead(original_message)
return
if(check_emote(original_message) || !can_speak_basic(original_message, ignore_spam))
return
if(in_critical)
if(!(crit_allowed_modes[message_mode]))
return
else if(stat == UNCONSCIOUS)
if(!(unconscious_allowed_modes[message_mode]))
return
// language comma detection.
var/datum/language/message_language = get_message_language(message)
if(message_language)
// No, you cannot speak in xenocommon just because you know the key
if(can_speak_in_language(message_language))
language = message_language
message = copytext(message, 3)
// Trim the space if they said ",0 I LOVE LANGUAGES"
if(findtext(message, " ", 1, 2))
message = copytext(message, 2)
if(!language)
language = get_default_language()
// Detection of language needs to be before inherent channels, because
// AIs use inherent channels for the holopad. Most inherent channels
// ignore the language argument however.
if(saymode && !saymode.handle_message(src, message, language))
return
if(!can_speak_vocal(message))
to_chat(src, "<span class='warning'>You find yourself unable to speak!</span>")
return
var/message_range = 7
var/succumbed = FALSE
var/fullcrit = InFullCritical()
if((InCritical() && !fullcrit) || message_mode == MODE_WHISPER)
message_range = 1
message_mode = MODE_WHISPER
src.log_talk(message, LOG_WHISPER)
if(fullcrit)
var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health)
// If we cut our message short, abruptly end it with a-..
var/message_len = length(message)
message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
message = Ellipsis(message, 10, 1)
message_mode = MODE_WHISPER_CRIT
succumbed = TRUE
else
src.log_talk(message, LOG_SAY, forced_by=forced)
message = treat_message(message) // unfortunately we still need this
var/sigreturn = SEND_SIGNAL(src, COMSIG_MOB_SAY, args)
if (sigreturn & COMPONENT_UPPERCASE_SPEECH)
message = uppertext(message)
if(!message)
return
last_words = message
spans |= speech_span
if(language)
var/datum/language/L = GLOB.language_datum_instances[language]
spans |= L.spans
var/radio_return = radio(message, message_mode, spans, language)
if(radio_return & ITALICS)
spans |= SPAN_ITALICS
if(radio_return & REDUCE_RANGE)
message_range = 1
if(radio_return & NOPASS)
return 1
//No screams in space, unless you're next to someone.
var/turf/T = get_turf(src)
var/datum/gas_mixture/environment = T.return_air()
var/pressure = (environment)? environment.return_pressure() : 0
if(pressure < SOUND_MINIMUM_PRESSURE)
message_range = 1
if(pressure < ONE_ATMOSPHERE*0.4) //Thin air, let's italicise the message
spans |= SPAN_ITALICS
send_speech(message, message_range, src, bubble_type, spans, language, message_mode)
if(succumbed)
succumb()
to_chat(src, compose_message(src, language, message, null, spans, message_mode))
return 1
/mob/living/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, face_name = FALSE, atom/movable/source)
. = ..()
if(isliving(speaker))
var/turf/sourceturf = get_turf(source)
var/turf/T = get_turf(src)
if(sourceturf && T && !(sourceturf in get_hear(5, T)))
. = "<span class='small'>[.]</span>"
/mob/living/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if(!client)
return
var/deaf_message
var/deaf_type
if(speaker != src)
if(!radio_freq) //These checks have to be seperate, else people talking on the radio will make "You can't hear yourself!" appear when hearing people over the radio while deaf.
deaf_message = "<span class='name'>[speaker]</span> [speaker.verb_say] something but you cannot hear [speaker.p_them()]."
deaf_type = 1
else
deaf_message = "<span class='notice'>You can't hear yourself!</span>"
deaf_type = 2 // Since you should be able to hear yourself without looking
// Recompose message for AI hrefs, language incomprehension.
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
show_message(message, MSG_AUDIBLE, deaf_message, deaf_type)
return message
/mob/living/send_speech(message, message_range = 6, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null, message_mode)
var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE)
var/eavesdrop_range = 0
if(eavesdropping_modes[message_mode])
eavesdrop_range = EAVESDROP_EXTRA_RANGE
var/list/listening = get_hearers_in_view(message_range+eavesdrop_range, source)
var/list/the_dead = list()
var/list/yellareas //CIT CHANGE - adds the ability for yelling to penetrate walls and echo throughout areas
if(!eavesdrop_range && say_test(message) == "2") //CIT CHANGE - ditto
yellareas = get_areas_in_range(message_range*0.5, source) //CIT CHANGE - ditto
for(var/_M in GLOB.player_list)
var/mob/M = _M
if(M.stat != DEAD) //not dead, not important
if(yellareas) //CIT CHANGE - see above. makes yelling penetrate walls
var/area/A = get_area(M) //CIT CHANGE - ditto
if(istype(A) && A.ambientsounds != SPACE && A in yellareas) //CIT CHANGE - ditto
listening |= M //CIT CHANGE - ditto
continue
if(!M.client || !client) //client is so that ghosts don't have to listen to mice
continue
if(get_dist(M, source) > 7 || M.z != z) //they're out of range of normal hearing
if(eavesdropping_modes[message_mode] && !(M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
continue
if(!(M.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
continue
listening |= M
the_dead[M] = TRUE
var/eavesdropping
var/eavesrendered
if(eavesdrop_range)
eavesdropping = stars(message)
eavesrendered = compose_message(src, message_language, eavesdropping, null, spans, message_mode, FALSE, source)
var/rendered = compose_message(src, message_language, message, null, spans, message_mode, FALSE, source)
for(var/_AM in listening)
var/atom/movable/AM = _AM
if(eavesdrop_range && get_dist(source, AM) > message_range && !(the_dead[AM]))
AM.Hear(eavesrendered, src, message_language, eavesdropping, null, spans, message_mode, source)
else
AM.Hear(rendered, src, message_language, message, null, spans, message_mode, source)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LIVING_SAY_SPECIAL, src, message)
//speech bubble
var/list/speech_bubble_recipients = list()
for(var/mob/M in listening)
if(M.client)
speech_bubble_recipients.Add(M.client)
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, /.proc/flick_overlay, I, speech_bubble_recipients, 30)
/mob/proc/binarycheck()
return FALSE
/mob/living/can_speak(message) //For use outside of Say()
if(can_speak_basic(message) && can_speak_vocal(message))
return 1
/mob/living/proc/can_speak_basic(message, ignore_spam = FALSE) //Check BEFORE handling of xeno and ling channels
if(client)
if(client.prefs.muted & MUTE_IC)
to_chat(src, "<span class='danger'>You cannot speak in IC (muted).</span>")
return 0
if(!ignore_spam && client.handle_spam_prevention(message,MUTE_IC))
return 0
return 1
/mob/living/proc/can_speak_vocal(message) //Check AFTER handling of xeno and ling channels
if(HAS_TRAIT(src, TRAIT_MUTE))
return 0
if(is_muzzled())
return 0
if(!IsVocal())
return 0
return 1
/mob/living/proc/get_key(message)
var/key = copytext(message, 1, 2)
if(key in GLOB.department_radio_prefixes)
return lowertext(copytext(message, 2, 3))
/mob/living/proc/get_message_language(message)
if(copytext(message, 1, 2) == ",")
var/key = copytext(message, 2, 3)
for(var/ld in GLOB.all_languages)
var/datum/language/LD = ld
if(initial(LD.key) == key)
return LD
return null
/mob/living/proc/treat_message(message)
if(HAS_TRAIT(src, TRAIT_UNINTELLIGIBLE_SPEECH))
message = unintelligize(message)
if(derpspeech)
message = derpspeech(message, stuttering)
if(stuttering)
message = stutter(message)
if(slurring)
message = slur(message,slurring)
if(cultslurring)
message = cultslur(message)
message = capitalize(message)
return message
/mob/living/proc/radio(message, message_mode, list/spans, language)
var/obj/item/implant/radio/imp = locate() in implants
if(imp?.radio.on)
if(message_mode == MODE_HEADSET)
imp.radio.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(message_mode == MODE_DEPARTMENT || message_mode in GLOB.radiochannels)
imp.radio.talk_into(src, message, message_mode, spans, language)
return ITALICS | REDUCE_RANGE
switch(message_mode)
if(MODE_WHISPER)
return ITALICS
if(MODE_R_HAND)
for(var/obj/item/r_hand in get_held_items_for_side("r", all = TRUE))
if (r_hand)
return r_hand.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_L_HAND)
for(var/obj/item/l_hand in get_held_items_for_side("l", all = TRUE))
if (l_hand)
return l_hand.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_INTERCOM)
for (var/obj/item/radio/intercom/I in view(1, null))
I.talk_into(src, message, , spans, language)
return ITALICS | REDUCE_RANGE
if(MODE_BINARY)
return ITALICS | REDUCE_RANGE //Does not return 0 since this is only reached by humans, not borgs or AIs.
return 0
/mob/living/say_mod(input, message_mode)
. = ..()
if(message_mode == MODE_WHISPER_CRIT)
. = "[verb_whisper] in [p_their()] last breath"
else if(message_mode != MODE_CUSTOM_SAY)
if(message_mode == MODE_WHISPER)
. = verb_whisper
else if(stuttering)
. = "stammers"
else if(derpspeech)
. = "gibbers"
/mob/living/whisper(message, bubble_type, list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
say("#[message]", bubble_type, spans, sanitize, language, ignore_spam, forced)
/mob/living/get_language_holder(shadow=TRUE)
if(mind && shadow)
// Mind language holders shadow mob holders.
. = mind.get_language_holder()
if(.)
return .
. = ..()
File diff suppressed because it is too large Load Diff
@@ -42,9 +42,8 @@
/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
..(Proj)
. = ..()
updatehealth()
return 2
/mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
return // no eyes, no flashing
+56 -56
View File
@@ -1,56 +1,56 @@
/mob/living/silicon/ai/death(gibbed)
if(stat == DEAD)
return
. = ..()
var/old_icon = icon_state
if("[icon_state]_dead" in icon_states(icon))
icon_state = "[icon_state]_dead"
else
icon_state = "ai_dead"
if("[old_icon]_death_transition" in icon_states(icon))
flick("[old_icon]_death_transition", src)
cameraFollow = null
anchored = FALSE //unbolt floorbolts
update_canmove()
if(eyeobj)
eyeobj.setLoc(get_turf(src))
set_eyeobj_visible(FALSE)
GLOB.shuttle_caller_list -= src
SSshuttle.autoEvac()
ShutOffDoomsdayDevice()
if(explosive)
spawn(10)
explosion(src.loc, 3, 6, 12, 15)
if(src.key)
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
O.mode = 2
O.update()
if(istype(loc, /obj/item/aicard/aitater))
loc.icon_state = "aitater-404"
else if(istype(loc, /obj/item/aicard/aispook))
loc.icon_state = "aispook-404"
else if(istype(loc, /obj/item/aicard))
loc.icon_state = "aicard-404"
/mob/living/silicon/ai/proc/ShutOffDoomsdayDevice()
if(nuking)
set_security_level("red")
nuking = FALSE
for(var/obj/item/pinpointer/nuke/P in GLOB.pinpointer_list)
P.switch_mode_to(TRACK_NUKE_DISK) //Party's over, back to work, everyone
P.alert = FALSE
if(doomsday_device)
doomsday_device.timing = FALSE
SSshuttle.clearHostileEnvironment(doomsday_device)
qdel(doomsday_device)
/mob/living/silicon/ai/death(gibbed)
if(stat == DEAD)
return
. = ..()
var/old_icon = icon_state
if("[icon_state]_dead" in icon_states(icon))
icon_state = "[icon_state]_dead"
else
icon_state = "ai_dead"
if("[old_icon]_death_transition" in icon_states(icon))
flick("[old_icon]_death_transition", src)
cameraFollow = null
move_resist = MOVE_FORCE_NORMAL
update_canmove()
if(eyeobj)
eyeobj.setLoc(get_turf(src))
set_eyeobj_visible(FALSE)
GLOB.shuttle_caller_list -= src
SSshuttle.autoEvac()
ShutOffDoomsdayDevice()
if(explosive)
spawn(10)
explosion(src.loc, 3, 6, 12, 15)
if(src.key)
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
O.mode = 2
O.update()
if(istype(loc, /obj/item/aicard/aitater))
loc.icon_state = "aitater-404"
else if(istype(loc, /obj/item/aicard/aispook))
loc.icon_state = "aispook-404"
else if(istype(loc, /obj/item/aicard))
loc.icon_state = "aicard-404"
/mob/living/silicon/ai/proc/ShutOffDoomsdayDevice()
if(nuking)
set_security_level("red")
nuking = FALSE
for(var/obj/item/pinpointer/nuke/P in GLOB.pinpointer_list)
P.switch_mode_to(TRACK_NUKE_DISK) //Party's over, back to work, everyone
P.alert = FALSE
if(doomsday_device)
doomsday_device.timing = FALSE
SSshuttle.clearHostileEnvironment(doomsday_device)
qdel(doomsday_device)
+21 -21
View File
@@ -1,22 +1,22 @@
/mob/living/silicon/ai/examine(mob/user)
. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] <EM>[src]</EM>!")
if (stat == DEAD)
. += "<span class='deadsay'>It appears to be powered-down.</span>"
else
if (getBruteLoss())
if (getBruteLoss() < 30)
. += "<span class='warning'>It looks slightly dented.</span>"
else
. += "<span class='danger'>It looks severely dented!</span>"
if (getFireLoss())
if (getFireLoss() < 30)
. += "<span class='warning'>It looks slightly charred.</span>"
else
. += "<span class='danger'>Its casing is melted and heat-warped!</span>"
if(deployed_shell)
. += "The wireless networking light is blinking."
else if (!shunted && !client)
. += "[src]Core.exe has stopped responding! NTOS is searching for a solution to the problem..."
. += "*---------*</span>"
/mob/living/silicon/ai/examine(mob/user)
. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] <EM>[src]</EM>!")
if (stat == DEAD)
. += "<span class='deadsay'>It appears to be powered-down.</span>"
else
if (getBruteLoss())
if (getBruteLoss() < 30)
. += "<span class='warning'>It looks slightly dented.</span>"
else
. += "<span class='danger'>It looks severely dented!</span>"
if (getFireLoss())
if (getFireLoss() < 30)
. += "<span class='warning'>It looks slightly charred.</span>"
else
. += "<span class='danger'>Its casing is melted and heat-warped!</span>"
if(deployed_shell)
. += "The wireless networking light is blinking."
else if (!shunted && !client)
. += "[src]Core.exe has stopped responding! NTOS is searching for a solution to the problem..."
. += "*---------*</span>"
. += ..()
@@ -1,204 +1,204 @@
// CAMERA NET
//
// The datum containing all the chunks.
#define CHUNK_SIZE 16 // Only chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc..
GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new)
/datum/cameranet
var/name = "Camera Net" // Name to show for VV and stat()
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
var/list/cameras = list()
// The chunks of the map, mapping the areas that the cameras can see.
var/list/chunks = list()
var/ready = 0
// The object used for the clickable stat() button.
var/obj/effect/statclick/statclick
// The objects used in vis_contents of obscured turfs
var/list/vis_contents_objects
var/obj/effect/overlay/camera_static/vis_contents_opaque
var/obj/effect/overlay/camera_static/vis_contents_transparent
// The image given to the effect in vis_contents on AI clients
var/image/obscured
var/image/obscured_transparent
/datum/cameranet/New()
vis_contents_opaque = new /obj/effect/overlay/camera_static()
vis_contents_transparent = new /obj/effect/overlay/camera_static/transparent()
vis_contents_objects = list(vis_contents_opaque, vis_contents_transparent)
obscured = new('icons/effects/cameravis.dmi', vis_contents_opaque, null, CAMERA_STATIC_LAYER)
obscured.plane = CAMERA_STATIC_PLANE
obscured_transparent = new('icons/effects/cameravis.dmi', vis_contents_transparent, null, CAMERA_STATIC_LAYER)
obscured_transparent.plane = CAMERA_STATIC_PLANE
// Checks if a chunk has been Generated in x, y, z.
/datum/cameranet/proc/chunkGenerated(x, y, z)
x &= ~(CHUNK_SIZE - 1)
y &= ~(CHUNK_SIZE - 1)
return chunks["[x],[y],[z]"]
// Returns the chunk in the x, y, z.
// If there is no chunk, it creates a new chunk and returns that.
/datum/cameranet/proc/getCameraChunk(x, y, z)
x &= ~(CHUNK_SIZE - 1)
y &= ~(CHUNK_SIZE - 1)
var/key = "[x],[y],[z]"
. = chunks[key]
if(!.)
chunks[key] = . = new /datum/camerachunk(x, y, z)
// Updates what the aiEye can see. It is recommended you use this when the aiEye moves or it's location is set.
/datum/cameranet/proc/visibility(list/moved_eyes, client/C, list/other_eyes, use_static = USE_STATIC_OPAQUE)
if(!islist(moved_eyes))
moved_eyes = moved_eyes ? list(moved_eyes) : list()
if(islist(other_eyes))
other_eyes = (other_eyes - moved_eyes)
else
other_eyes = list()
if(C)
switch(use_static)
if(USE_STATIC_TRANSPARENT)
C.images += obscured_transparent
if(USE_STATIC_OPAQUE)
C.images += obscured
for(var/V in moved_eyes)
var/mob/camera/aiEye/eye = V
var/list/visibleChunks = list()
if(eye.loc)
// 0xf = 15
var/static_range = eye.static_visibility_range
var/x1 = max(0, eye.x - static_range) & ~(CHUNK_SIZE - 1)
var/y1 = max(0, eye.y - static_range) & ~(CHUNK_SIZE - 1)
var/x2 = min(world.maxx, eye.x + static_range) & ~(CHUNK_SIZE - 1)
var/y2 = min(world.maxy, eye.y + static_range) & ~(CHUNK_SIZE - 1)
for(var/x = x1; x <= x2; x += CHUNK_SIZE)
for(var/y = y1; y <= y2; y += CHUNK_SIZE)
visibleChunks |= getCameraChunk(x, y, eye.z)
var/list/remove = eye.visibleCameraChunks - visibleChunks
var/list/add = visibleChunks - eye.visibleCameraChunks
for(var/chunk in remove)
var/datum/camerachunk/c = chunk
c.remove(eye, FALSE)
for(var/chunk in add)
var/datum/camerachunk/c = chunk
c.add(eye)
if(!eye.visibleCameraChunks.len)
var/client/client = eye.GetViewerClient()
if(client)
switch(eye.use_static)
if(USE_STATIC_TRANSPARENT)
client.images -= GLOB.cameranet.obscured_transparent
if(USE_STATIC_OPAQUE)
client.images -= GLOB.cameranet.obscured
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.
/datum/cameranet/proc/updateVisibility(atom/A, opacity_check = 1)
if(!SSticker || (opacity_check && !A.opacity))
return
majorChunkChange(A, 2)
/datum/cameranet/proc/updateChunk(x, y, z)
var/datum/camerachunk/chunk = chunkGenerated(x, y, z)
if (!chunk)
return
chunk.hasChanged()
// Removes a camera from a chunk.
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
majorChunkChange(c, 0)
// Add a camera to a chunk.
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
// Used for Cyborg cameras. Since portable cameras can be in ANY chunk.
/datum/cameranet/proc/updatePortableCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
// It will also add the atom to the cameras list if you set the choice to 1.
// Setting the choice to 0 will remove the camera from the chunks.
// If you want to update the chunks around an object, without adding/removing a camera, use choice 2.
/datum/cameranet/proc/majorChunkChange(atom/c, choice)
if(!c)
return
var/turf/T = get_turf(c)
if(T)
var/x1 = max(0, T.x - (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
var/y1 = max(0, T.y - (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
var/x2 = min(world.maxx, T.x + (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
var/y2 = min(world.maxy, T.y + (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
for(var/x = x1; x <= x2; x += CHUNK_SIZE)
for(var/y = y1; y <= y2; y += CHUNK_SIZE)
var/datum/camerachunk/chunk = chunkGenerated(x, y, T.z)
if(chunk)
if(choice == 0)
// Remove the camera.
chunk.cameras -= c
else if(choice == 1)
// You can't have the same camera in the list twice.
chunk.cameras |= c
chunk.hasChanged()
// Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0.
/datum/cameranet/proc/checkCameraVis(mob/living/target)
var/turf/position = get_turf(target)
return checkTurfVis(position)
/datum/cameranet/proc/checkTurfVis(turf/position)
var/datum/camerachunk/chunk = chunkGenerated(position.x, position.y, position.z)
if(chunk)
if(chunk.changed)
chunk.hasChanged(1) // Update now, no matter if it's visible or not.
if(chunk.visibleTurfs[position])
return 1
return 0
/datum/cameranet/proc/stat_entry()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
stat(name, statclick.update("Cameras: [GLOB.cameranet.cameras.len] | Chunks: [GLOB.cameranet.chunks.len]"))
/obj/effect/overlay/camera_static
name = "static"
icon = null
icon_state = null
anchored = TRUE // should only appear in vis_contents, but to be safe
appearance_flags = RESET_TRANSFORM | TILE_BOUND
// this combination makes the static block clicks to everything below it,
// without appearing in the right-click menu for non-AI clients
mouse_opacity = MOUSE_OPACITY_ICON
invisibility = INVISIBILITY_ABSTRACT
layer = CAMERA_STATIC_LAYER
plane = CAMERA_STATIC_PLANE
/obj/effect/overlay/camera_static/transparent
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
// CAMERA NET
//
// The datum containing all the chunks.
#define CHUNK_SIZE 16 // Only chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc..
GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new)
/datum/cameranet
var/name = "Camera Net" // Name to show for VV and stat()
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
var/list/cameras = list()
// The chunks of the map, mapping the areas that the cameras can see.
var/list/chunks = list()
var/ready = 0
// The object used for the clickable stat() button.
var/obj/effect/statclick/statclick
// The objects used in vis_contents of obscured turfs
var/list/vis_contents_objects
var/obj/effect/overlay/camera_static/vis_contents_opaque
var/obj/effect/overlay/camera_static/vis_contents_transparent
// The image given to the effect in vis_contents on AI clients
var/image/obscured
var/image/obscured_transparent
/datum/cameranet/New()
vis_contents_opaque = new /obj/effect/overlay/camera_static()
vis_contents_transparent = new /obj/effect/overlay/camera_static/transparent()
vis_contents_objects = list(vis_contents_opaque, vis_contents_transparent)
obscured = new('icons/effects/cameravis.dmi', vis_contents_opaque, null, CAMERA_STATIC_LAYER)
obscured.plane = CAMERA_STATIC_PLANE
obscured_transparent = new('icons/effects/cameravis.dmi', vis_contents_transparent, null, CAMERA_STATIC_LAYER)
obscured_transparent.plane = CAMERA_STATIC_PLANE
// Checks if a chunk has been Generated in x, y, z.
/datum/cameranet/proc/chunkGenerated(x, y, z)
x &= ~(CHUNK_SIZE - 1)
y &= ~(CHUNK_SIZE - 1)
return chunks["[x],[y],[z]"]
// Returns the chunk in the x, y, z.
// If there is no chunk, it creates a new chunk and returns that.
/datum/cameranet/proc/getCameraChunk(x, y, z)
x &= ~(CHUNK_SIZE - 1)
y &= ~(CHUNK_SIZE - 1)
var/key = "[x],[y],[z]"
. = chunks[key]
if(!.)
chunks[key] = . = new /datum/camerachunk(x, y, z)
// Updates what the aiEye can see. It is recommended you use this when the aiEye moves or it's location is set.
/datum/cameranet/proc/visibility(list/moved_eyes, client/C, list/other_eyes, use_static = USE_STATIC_OPAQUE)
if(!islist(moved_eyes))
moved_eyes = moved_eyes ? list(moved_eyes) : list()
if(islist(other_eyes))
other_eyes = (other_eyes - moved_eyes)
else
other_eyes = list()
if(C)
switch(use_static)
if(USE_STATIC_TRANSPARENT)
C.images += obscured_transparent
if(USE_STATIC_OPAQUE)
C.images += obscured
for(var/V in moved_eyes)
var/mob/camera/aiEye/eye = V
var/list/visibleChunks = list()
if(eye.loc)
// 0xf = 15
var/static_range = eye.static_visibility_range
var/x1 = max(0, eye.x - static_range) & ~(CHUNK_SIZE - 1)
var/y1 = max(0, eye.y - static_range) & ~(CHUNK_SIZE - 1)
var/x2 = min(world.maxx, eye.x + static_range) & ~(CHUNK_SIZE - 1)
var/y2 = min(world.maxy, eye.y + static_range) & ~(CHUNK_SIZE - 1)
for(var/x = x1; x <= x2; x += CHUNK_SIZE)
for(var/y = y1; y <= y2; y += CHUNK_SIZE)
visibleChunks |= getCameraChunk(x, y, eye.z)
var/list/remove = eye.visibleCameraChunks - visibleChunks
var/list/add = visibleChunks - eye.visibleCameraChunks
for(var/chunk in remove)
var/datum/camerachunk/c = chunk
c.remove(eye, FALSE)
for(var/chunk in add)
var/datum/camerachunk/c = chunk
c.add(eye)
if(!eye.visibleCameraChunks.len)
var/client/client = eye.GetViewerClient()
if(client)
switch(eye.use_static)
if(USE_STATIC_TRANSPARENT)
client.images -= GLOB.cameranet.obscured_transparent
if(USE_STATIC_OPAQUE)
client.images -= GLOB.cameranet.obscured
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.
/datum/cameranet/proc/updateVisibility(atom/A, opacity_check = 1)
if(!SSticker || (opacity_check && !A.opacity))
return
majorChunkChange(A, 2)
/datum/cameranet/proc/updateChunk(x, y, z)
var/datum/camerachunk/chunk = chunkGenerated(x, y, z)
if (!chunk)
return
chunk.hasChanged()
// Removes a camera from a chunk.
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
majorChunkChange(c, 0)
// Add a camera to a chunk.
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
// Used for Cyborg cameras. Since portable cameras can be in ANY chunk.
/datum/cameranet/proc/updatePortableCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
// It will also add the atom to the cameras list if you set the choice to 1.
// Setting the choice to 0 will remove the camera from the chunks.
// If you want to update the chunks around an object, without adding/removing a camera, use choice 2.
/datum/cameranet/proc/majorChunkChange(atom/c, choice)
if(!c)
return
var/turf/T = get_turf(c)
if(T)
var/x1 = max(0, T.x - (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
var/y1 = max(0, T.y - (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
var/x2 = min(world.maxx, T.x + (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
var/y2 = min(world.maxy, T.y + (CHUNK_SIZE / 2)) & ~(CHUNK_SIZE - 1)
for(var/x = x1; x <= x2; x += CHUNK_SIZE)
for(var/y = y1; y <= y2; y += CHUNK_SIZE)
var/datum/camerachunk/chunk = chunkGenerated(x, y, T.z)
if(chunk)
if(choice == 0)
// Remove the camera.
chunk.cameras -= c
else if(choice == 1)
// You can't have the same camera in the list twice.
chunk.cameras |= c
chunk.hasChanged()
// Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0.
/datum/cameranet/proc/checkCameraVis(mob/living/target)
var/turf/position = get_turf(target)
return checkTurfVis(position)
/datum/cameranet/proc/checkTurfVis(turf/position)
var/datum/camerachunk/chunk = chunkGenerated(position.x, position.y, position.z)
if(chunk)
if(chunk.changed)
chunk.hasChanged(1) // Update now, no matter if it's visible or not.
if(chunk.visibleTurfs[position])
return 1
return 0
/datum/cameranet/proc/stat_entry()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
stat(name, statclick.update("Cameras: [GLOB.cameranet.cameras.len] | Chunks: [GLOB.cameranet.chunks.len]"))
/obj/effect/overlay/camera_static
name = "static"
icon = null
icon_state = null
anchored = TRUE // should only appear in vis_contents, but to be safe
appearance_flags = RESET_TRANSFORM | TILE_BOUND
// this combination makes the static block clicks to everything below it,
// without appearing in the right-click menu for non-AI clients
mouse_opacity = MOUSE_OPACITY_ICON
invisibility = INVISIBILITY_ABSTRACT
layer = CAMERA_STATIC_LAYER
plane = CAMERA_STATIC_PLANE
/obj/effect/overlay/camera_static/transparent
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
@@ -1,142 +1,142 @@
#define UPDATE_BUFFER 25 // 2.5 seconds
// CAMERA CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the AI Eye to stream these chunks and know what it can and cannot see.
/datum/camerachunk
var/list/obscuredTurfs = list()
var/list/visibleTurfs = list()
var/list/cameras = list()
var/list/turfs = list()
var/list/seenby = list()
var/changed = 0
var/x = 0
var/y = 0
var/z = 0
// Add an AI eye to the chunk, then update if changed.
/datum/camerachunk/proc/add(mob/camera/aiEye/eye)
eye.visibleCameraChunks += src
seenby += eye
if(changed)
update()
// Remove an AI eye from the chunk, then update if changed.
/datum/camerachunk/proc/remove(mob/camera/aiEye/eye, remove_static_with_last_chunk = TRUE)
eye.visibleCameraChunks -= src
seenby -= eye
if(remove_static_with_last_chunk && !eye.visibleCameraChunks.len)
var/client/client = eye.GetViewerClient()
if(client)
switch(eye.use_static)
if(USE_STATIC_TRANSPARENT)
client.images -= GLOB.cameranet.obscured_transparent
if(USE_STATIC_OPAQUE)
client.images -= GLOB.cameranet.obscured
// Called when a chunk has changed. I.E: A wall was deleted.
/datum/camerachunk/proc/visibilityChanged(turf/loc)
if(!visibleTurfs[loc])
return
hasChanged()
// Updates the chunk, makes sure that it doesn't update too much. If the chunk isn't being watched it will
// instead be flagged to update the next time an AI Eye moves near it.
/datum/camerachunk/proc/hasChanged(update_now = 0)
if(seenby.len || update_now)
addtimer(CALLBACK(src, .proc/update), UPDATE_BUFFER, TIMER_UNIQUE)
else
changed = 1
// The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists.
/datum/camerachunk/proc/update()
var/list/newVisibleTurfs = list()
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
var/turf/point = locate(src.x + (CHUNK_SIZE / 2), src.y + (CHUNK_SIZE / 2), src.z)
if(get_dist(point, c) > CHUNK_SIZE + (CHUNK_SIZE / 2))
continue
for(var/turf/t in c.can_see())
// Possible optimization: if(turfs[t]) here, rather than &= turfs afterwards.
// List associations use a tree or hashmap of some sort (alongside the list itself)
// so are surprisingly fast. (significantly faster than var/thingy/x in list, in testing)
newVisibleTurfs[t] = t
// Removes turf that isn't in turfs.
newVisibleTurfs &= turfs
var/list/visAdded = newVisibleTurfs - visibleTurfs
var/list/visRemoved = visibleTurfs - newVisibleTurfs
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf in visAdded)
var/turf/t = turf
t.vis_contents -= GLOB.cameranet.vis_contents_objects
for(var/turf in visRemoved)
var/turf/t = turf
if(obscuredTurfs[t] && !istype(t, /turf/open/ai_visible))
t.vis_contents += GLOB.cameranet.vis_contents_objects
changed = 0
// Create a new camera chunk, since the chunks are made as they are needed.
/datum/camerachunk/New(x, y, z)
x &= ~(CHUNK_SIZE - 1)
y &= ~(CHUNK_SIZE - 1)
src.x = x
src.y = y
src.z = z
for(var/obj/machinery/camera/c in urange(CHUNK_SIZE, locate(x + (CHUNK_SIZE / 2), y + (CHUNK_SIZE / 2), z)))
if(c.can_use())
cameras += c
for(var/turf/t in block(locate(max(x, 1), max(y, 1), z), locate(min(x + CHUNK_SIZE - 1, world.maxx), min(y + CHUNK_SIZE - 1, world.maxy), z)))
turfs[t] = t
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
for(var/turf/t in c.can_see())
// Possible optimization: if(turfs[t]) here, rather than &= turfs afterwards.
// List associations use a tree or hashmap of some sort (alongside the list itself)
// so are surprisingly fast. (significantly faster than var/thingy/x in list, in testing)
visibleTurfs[t] = t
// Removes turf that isn't in turfs.
visibleTurfs &= turfs
obscuredTurfs = turfs - visibleTurfs
for(var/turf in obscuredTurfs)
var/turf/t = turf
t.vis_contents += GLOB.cameranet.vis_contents_objects
#undef UPDATE_BUFFER
#undef CHUNK_SIZE
#define UPDATE_BUFFER 25 // 2.5 seconds
// CAMERA CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the AI Eye to stream these chunks and know what it can and cannot see.
/datum/camerachunk
var/list/obscuredTurfs = list()
var/list/visibleTurfs = list()
var/list/cameras = list()
var/list/turfs = list()
var/list/seenby = list()
var/changed = 0
var/x = 0
var/y = 0
var/z = 0
// Add an AI eye to the chunk, then update if changed.
/datum/camerachunk/proc/add(mob/camera/aiEye/eye)
eye.visibleCameraChunks += src
seenby += eye
if(changed)
update()
// Remove an AI eye from the chunk, then update if changed.
/datum/camerachunk/proc/remove(mob/camera/aiEye/eye, remove_static_with_last_chunk = TRUE)
eye.visibleCameraChunks -= src
seenby -= eye
if(remove_static_with_last_chunk && !eye.visibleCameraChunks.len)
var/client/client = eye.GetViewerClient()
if(client)
switch(eye.use_static)
if(USE_STATIC_TRANSPARENT)
client.images -= GLOB.cameranet.obscured_transparent
if(USE_STATIC_OPAQUE)
client.images -= GLOB.cameranet.obscured
// Called when a chunk has changed. I.E: A wall was deleted.
/datum/camerachunk/proc/visibilityChanged(turf/loc)
if(!visibleTurfs[loc])
return
hasChanged()
// Updates the chunk, makes sure that it doesn't update too much. If the chunk isn't being watched it will
// instead be flagged to update the next time an AI Eye moves near it.
/datum/camerachunk/proc/hasChanged(update_now = 0)
if(seenby.len || update_now)
addtimer(CALLBACK(src, .proc/update), UPDATE_BUFFER, TIMER_UNIQUE)
else
changed = 1
// The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists.
/datum/camerachunk/proc/update()
var/list/newVisibleTurfs = list()
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
var/turf/point = locate(src.x + (CHUNK_SIZE / 2), src.y + (CHUNK_SIZE / 2), src.z)
if(get_dist(point, c) > CHUNK_SIZE + (CHUNK_SIZE / 2))
continue
for(var/turf/t in c.can_see())
// Possible optimization: if(turfs[t]) here, rather than &= turfs afterwards.
// List associations use a tree or hashmap of some sort (alongside the list itself)
// so are surprisingly fast. (significantly faster than var/thingy/x in list, in testing)
newVisibleTurfs[t] = t
// Removes turf that isn't in turfs.
newVisibleTurfs &= turfs
var/list/visAdded = newVisibleTurfs - visibleTurfs
var/list/visRemoved = visibleTurfs - newVisibleTurfs
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf in visAdded)
var/turf/t = turf
t.vis_contents -= GLOB.cameranet.vis_contents_objects
for(var/turf in visRemoved)
var/turf/t = turf
if(obscuredTurfs[t] && !istype(t, /turf/open/ai_visible))
t.vis_contents += GLOB.cameranet.vis_contents_objects
changed = 0
// Create a new camera chunk, since the chunks are made as they are needed.
/datum/camerachunk/New(x, y, z)
x &= ~(CHUNK_SIZE - 1)
y &= ~(CHUNK_SIZE - 1)
src.x = x
src.y = y
src.z = z
for(var/obj/machinery/camera/c in urange(CHUNK_SIZE, locate(x + (CHUNK_SIZE / 2), y + (CHUNK_SIZE / 2), z)))
if(c.can_use())
cameras += c
for(var/turf/t in block(locate(max(x, 1), max(y, 1), z), locate(min(x + CHUNK_SIZE - 1, world.maxx), min(y + CHUNK_SIZE - 1, world.maxy), z)))
turfs[t] = t
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
for(var/turf/t in c.can_see())
// Possible optimization: if(turfs[t]) here, rather than &= turfs afterwards.
// List associations use a tree or hashmap of some sort (alongside the list itself)
// so are surprisingly fast. (significantly faster than var/thingy/x in list, in testing)
visibleTurfs[t] = t
// Removes turf that isn't in turfs.
visibleTurfs &= turfs
obscuredTurfs = turfs - visibleTurfs
for(var/turf in obscuredTurfs)
var/turf/t = turf
t.vis_contents += GLOB.cameranet.vis_contents_objects
#undef UPDATE_BUFFER
#undef CHUNK_SIZE
+206 -206
View File
@@ -1,206 +1,206 @@
// AI EYE
//
// An invisible (no icon) mob that the AI controls to look around the station with.
// It streams chunks as it moves around, which will show it what the AI can and cannot see.
/mob/camera/aiEye
name = "Inactive AI Eye"
icon_state = "ai_camera"
icon = 'icons/mob/cameramob.dmi'
invisibility = INVISIBILITY_MAXIMUM
hud_possible = list(ANTAG_HUD, AI_DETECT_HUD = HUD_LIST_LIST)
var/list/visibleCameraChunks = list()
var/mob/living/silicon/ai/ai = null
var/relay_speech = FALSE
var/use_static = USE_STATIC_OPAQUE
var/static_visibility_range = 16
var/ai_detector_visible = TRUE
var/ai_detector_color = COLOR_RED
/mob/camera/aiEye/Initialize()
. = ..()
GLOB.aiEyes += src
update_ai_detect_hud()
setLoc(loc, TRUE)
/mob/camera/aiEye/proc/update_ai_detect_hud()
var/datum/atom_hud/ai_detector/hud = GLOB.huds[DATA_HUD_AI_DETECT]
var/list/old_images = hud_list[AI_DETECT_HUD]
if(!ai_detector_visible)
hud.remove_from_hud(src)
QDEL_LIST(old_images)
return
if(!hud.hudusers.len)
//no one is watching, do not bother updating anything
return
hud.remove_from_hud(src)
var/static/list/vis_contents_objects = list()
var/obj/effect/overlay/ai_detect_hud/hud_obj = vis_contents_objects[ai_detector_color]
if(!hud_obj)
hud_obj = new /obj/effect/overlay/ai_detect_hud()
hud_obj.color = ai_detector_color
vis_contents_objects[ai_detector_color] = hud_obj
var/list/new_images = list()
var/list/turfs = get_visible_turfs()
for(var/T in turfs)
var/image/I = (old_images.len > new_images.len) ? old_images[new_images.len + 1] : image(null, T)
I.loc = T
I.vis_contents += hud_obj
new_images += I
for(var/i in (new_images.len + 1) to old_images.len)
qdel(old_images[i])
hud_list[AI_DETECT_HUD] = new_images
hud.add_to_hud(src)
/mob/camera/aiEye/proc/get_visible_turfs()
if(!isturf(loc))
return list()
var/client/C = GetViewerClient()
var/view = C ? getviewsize(C.view) : getviewsize(world.view)
var/turf/lowerleft = locate(max(1, x - (view[1] - 1)/2), max(1, y - (view[2] - 1)/2), z)
var/turf/upperright = locate(min(world.maxx, lowerleft.x + (view[1] - 1)), min(world.maxy, lowerleft.y + (view[2] - 1)), lowerleft.z)
return block(lowerleft, upperright)
// Use this when setting the aiEye's location.
// It will also stream the chunk that the new loc is in.
/mob/camera/aiEye/proc/setLoc(T, force_update = FALSE, dir)
if(ai)
if(!isturf(ai.loc))
return
T = get_turf(T)
if(!force_update && (T == get_turf(src)) )
return //we are already here!
if (T)
forceMove(T)
else
moveToNullspace()
if(use_static != USE_STATIC_NONE)
ai.camera_visibility(src)
if(ai.client && !ai.multicam_on)
ai.client.eye = src
update_ai_detect_hud()
update_parallax_contents()
//Holopad
if(istype(ai.current, /obj/machinery/holopad))
var/obj/machinery/holopad/H = ai.current
H.move_hologram(ai, T, dir)
if(ai.camera_light_on)
ai.light_cameras()
if(ai.master_multicam)
ai.master_multicam.refresh_view()
/mob/camera/aiEye/Move()
return 0
/mob/camera/aiEye/proc/GetViewerClient()
if(ai)
return ai.client
return null
/mob/camera/aiEye/Destroy()
if(ai)
ai.all_eyes -= src
ai = null
for(var/V in visibleCameraChunks)
var/datum/camerachunk/c = V
c.remove(src)
GLOB.aiEyes -= src
if(ai_detector_visible)
var/datum/atom_hud/ai_detector/hud = GLOB.huds[DATA_HUD_AI_DETECT]
hud.remove_from_hud(src)
var/list/L = hud_list[AI_DETECT_HUD]
QDEL_LIST(L)
return ..()
/atom/proc/move_camera_by_click()
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
if(AI.eyeobj && (AI.multicam_on || (AI.client.eye == AI.eyeobj)) && (AI.eyeobj.z == z))
AI.cameraFollow = null
if (isturf(loc) || isturf(src))
AI.eyeobj.setLoc(src)
// This will move the AIEye. It will also cause lights near the eye to light up, if toggled.
// This is handled in the proc below this one.
/client/proc/AIMove(n, direct, mob/living/silicon/ai/user)
var/initial = initial(user.sprint)
var/max_sprint = 50
if(user.cooldown && user.cooldown < world.timeofday) // 3 seconds
user.sprint = initial
for(var/i = 0; i < max(user.sprint, initial); i += 20)
var/turf/step = get_turf(get_step(user.eyeobj, direct))
if(step)
user.eyeobj.setLoc(step, null, direct)
user.cooldown = world.timeofday + 5
if(user.acceleration)
user.sprint = min(user.sprint + 0.5, max_sprint)
else
user.sprint = initial
if(!user.tracking)
user.cameraFollow = null
// Return to the Core.
/mob/living/silicon/ai/proc/view_core()
if(istype(current,/obj/machinery/holopad))
var/obj/machinery/holopad/H = current
H.clear_holo(src)
else
current = null
cameraFollow = null
unset_machine()
if(isturf(loc) && (QDELETED(eyeobj) || !eyeobj.loc))
to_chat(src, "ERROR: Eyeobj not found. Creating new eye...")
create_eye()
eyeobj?.setLoc(loc)
/mob/living/silicon/ai/proc/create_eye()
if(eyeobj)
return
eyeobj = new /mob/camera/aiEye()
all_eyes += eyeobj
eyeobj.ai = src
eyeobj.setLoc(loc)
eyeobj.name = "[name] (AI Eye)"
set_eyeobj_visible(TRUE)
/mob/living/silicon/ai/proc/set_eyeobj_visible(state = TRUE)
if(!eyeobj)
return
eyeobj.mouse_opacity = state ? MOUSE_OPACITY_ICON : initial(eyeobj.mouse_opacity)
eyeobj.invisibility = state ? INVISIBILITY_OBSERVER : initial(eyeobj.invisibility)
/mob/living/silicon/ai/verb/toggle_acceleration()
set category = "AI Commands"
set name = "Toggle Camera Acceleration"
if(incapacitated())
return
acceleration = !acceleration
to_chat(usr, "Camera acceleration has been toggled [acceleration ? "on" : "off"].")
/mob/camera/aiEye/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if(relay_speech && speaker && ai && !radio_freq && speaker != ai && near_camera(speaker))
ai.relay_speech(message, speaker, message_language, raw_message, radio_freq, spans, message_mode)
/obj/effect/overlay/ai_detect_hud
name = ""
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
icon = 'icons/effects/alphacolors.dmi'
icon_state = ""
alpha = 100
layer = ABOVE_ALL_MOB_LAYER
plane = GAME_PLANE
// AI EYE
//
// An invisible (no icon) mob that the AI controls to look around the station with.
// It streams chunks as it moves around, which will show it what the AI can and cannot see.
/mob/camera/aiEye
name = "Inactive AI Eye"
icon_state = "ai_camera"
icon = 'icons/mob/cameramob.dmi'
invisibility = INVISIBILITY_MAXIMUM
hud_possible = list(ANTAG_HUD, AI_DETECT_HUD = HUD_LIST_LIST)
var/list/visibleCameraChunks = list()
var/mob/living/silicon/ai/ai = null
var/relay_speech = FALSE
var/use_static = USE_STATIC_OPAQUE
var/static_visibility_range = 16
var/ai_detector_visible = TRUE
var/ai_detector_color = COLOR_RED
/mob/camera/aiEye/Initialize()
. = ..()
GLOB.aiEyes += src
update_ai_detect_hud()
setLoc(loc, TRUE)
/mob/camera/aiEye/proc/update_ai_detect_hud()
var/datum/atom_hud/ai_detector/hud = GLOB.huds[DATA_HUD_AI_DETECT]
var/list/old_images = hud_list[AI_DETECT_HUD]
if(!ai_detector_visible)
hud.remove_from_hud(src)
QDEL_LIST(old_images)
return
if(!hud.hudusers.len)
//no one is watching, do not bother updating anything
return
hud.remove_from_hud(src)
var/static/list/vis_contents_objects = list()
var/obj/effect/overlay/ai_detect_hud/hud_obj = vis_contents_objects[ai_detector_color]
if(!hud_obj)
hud_obj = new /obj/effect/overlay/ai_detect_hud()
hud_obj.color = ai_detector_color
vis_contents_objects[ai_detector_color] = hud_obj
var/list/new_images = list()
var/list/turfs = get_visible_turfs()
for(var/T in turfs)
var/image/I = (old_images.len > new_images.len) ? old_images[new_images.len + 1] : image(null, T)
I.loc = T
I.vis_contents += hud_obj
new_images += I
for(var/i in (new_images.len + 1) to old_images.len)
qdel(old_images[i])
hud_list[AI_DETECT_HUD] = new_images
hud.add_to_hud(src)
/mob/camera/aiEye/proc/get_visible_turfs()
if(!isturf(loc))
return list()
var/client/C = GetViewerClient()
var/view = C ? getviewsize(C.view) : getviewsize(world.view)
var/turf/lowerleft = locate(max(1, x - (view[1] - 1)/2), max(1, y - (view[2] - 1)/2), z)
var/turf/upperright = locate(min(world.maxx, lowerleft.x + (view[1] - 1)), min(world.maxy, lowerleft.y + (view[2] - 1)), lowerleft.z)
return block(lowerleft, upperright)
// Use this when setting the aiEye's location.
// It will also stream the chunk that the new loc is in.
/mob/camera/aiEye/proc/setLoc(T, force_update = FALSE, dir)
if(ai)
if(!isturf(ai.loc))
return
T = get_turf(T)
if(!force_update && (T == get_turf(src)) )
return //we are already here!
if (T)
forceMove(T)
else
moveToNullspace()
if(use_static != USE_STATIC_NONE)
ai.camera_visibility(src)
if(ai.client && !ai.multicam_on)
ai.client.eye = src
update_ai_detect_hud()
update_parallax_contents()
//Holopad
if(istype(ai.current, /obj/machinery/holopad))
var/obj/machinery/holopad/H = ai.current
H.move_hologram(ai, T, dir)
if(ai.camera_light_on)
ai.light_cameras()
if(ai.master_multicam)
ai.master_multicam.refresh_view()
/mob/camera/aiEye/Move()
return 0
/mob/camera/aiEye/proc/GetViewerClient()
if(ai)
return ai.client
return null
/mob/camera/aiEye/Destroy()
if(ai)
ai.all_eyes -= src
ai = null
for(var/V in visibleCameraChunks)
var/datum/camerachunk/c = V
c.remove(src)
GLOB.aiEyes -= src
if(ai_detector_visible)
var/datum/atom_hud/ai_detector/hud = GLOB.huds[DATA_HUD_AI_DETECT]
hud.remove_from_hud(src)
var/list/L = hud_list[AI_DETECT_HUD]
QDEL_LIST(L)
return ..()
/atom/proc/move_camera_by_click()
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
if(AI.eyeobj && (AI.multicam_on || (AI.client.eye == AI.eyeobj)) && (AI.eyeobj.z == z))
AI.cameraFollow = null
if (isturf(loc) || isturf(src))
AI.eyeobj.setLoc(src)
// This will move the AIEye. It will also cause lights near the eye to light up, if toggled.
// This is handled in the proc below this one.
/client/proc/AIMove(n, direct, mob/living/silicon/ai/user)
var/initial = initial(user.sprint)
var/max_sprint = 50
if(user.cooldown && user.cooldown < world.timeofday) // 3 seconds
user.sprint = initial
for(var/i = 0; i < max(user.sprint, initial); i += 20)
var/turf/step = get_turf(get_step(user.eyeobj, direct))
if(step)
user.eyeobj.setLoc(step, null, direct)
user.cooldown = world.timeofday + 5
if(user.acceleration)
user.sprint = min(user.sprint + 0.5, max_sprint)
else
user.sprint = initial
if(!user.tracking)
user.cameraFollow = null
// Return to the Core.
/mob/living/silicon/ai/proc/view_core()
if(istype(current,/obj/machinery/holopad))
var/obj/machinery/holopad/H = current
H.clear_holo(src)
else
current = null
cameraFollow = null
unset_machine()
if(isturf(loc) && (QDELETED(eyeobj) || !eyeobj.loc))
to_chat(src, "ERROR: Eyeobj not found. Creating new eye...")
create_eye()
eyeobj?.setLoc(loc)
/mob/living/silicon/ai/proc/create_eye()
if(eyeobj)
return
eyeobj = new /mob/camera/aiEye()
all_eyes += eyeobj
eyeobj.ai = src
eyeobj.setLoc(loc)
eyeobj.name = "[name] (AI Eye)"
set_eyeobj_visible(TRUE)
/mob/living/silicon/ai/proc/set_eyeobj_visible(state = TRUE)
if(!eyeobj)
return
eyeobj.mouse_opacity = state ? MOUSE_OPACITY_ICON : initial(eyeobj.mouse_opacity)
eyeobj.invisibility = state ? INVISIBILITY_OBSERVER : initial(eyeobj.invisibility)
/mob/living/silicon/ai/verb/toggle_acceleration()
set category = "AI Commands"
set name = "Toggle Camera Acceleration"
if(incapacitated())
return
acceleration = !acceleration
to_chat(usr, "Camera acceleration has been toggled [acceleration ? "on" : "off"].")
/mob/camera/aiEye/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if(relay_speech && speaker && ai && !radio_freq && speaker != ai && near_camera(speaker))
ai.relay_speech(message, speaker, message_language, raw_message, radio_freq, spans, message_mode)
/obj/effect/overlay/ai_detect_hud
name = ""
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
icon = 'icons/effects/alphacolors.dmi'
icon_state = ""
alpha = 100
layer = ABOVE_ALL_MOB_LAYER
plane = GAME_PLANE
+12 -12
View File
@@ -1,12 +1,12 @@
/mob/living/silicon/ai/Login()
..()
if(stat != DEAD)
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
O.mode = 1
O.emotion = emote_display
O.update()
set_eyeobj_visible(TRUE)
if(multicam_on)
end_multicam()
view_core()
/mob/living/silicon/ai/Login()
..()
if(stat != DEAD)
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
O.mode = 1
O.emotion = emote_display
O.update()
set_eyeobj_visible(TRUE)
if(multicam_on)
end_multicam()
view_core()
+8 -8
View File
@@ -1,8 +1,8 @@
/mob/living/silicon/ai/Logout()
..()
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
O.mode = 0
O.update()
set_eyeobj_visible(FALSE)
view_core()
/mob/living/silicon/ai/Logout()
..()
for(var/each in GLOB.ai_status_displays) //change status
var/obj/machinery/status_display/ai/O = each
O.mode = 0
O.update()
set_eyeobj_visible(FALSE)
view_core()
+179 -179
View File
@@ -1,179 +1,179 @@
/mob/living/silicon/ai/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
if(parent && istype(parent) && parent.stat != DEAD) //If there is a defined "parent" AI, it is actually an AI, and it is alive, anything the AI tries to say is said by the parent instead.
parent.say(message, language)
return
..(message)
/mob/living/silicon/ai/compose_track_href(atom/movable/speaker, namepart)
var/mob/M = speaker.GetSource()
if(M)
return "<a href='?src=[REF(src)];track=[html_encode(namepart)]'>"
return ""
/mob/living/silicon/ai/compose_job(atom/movable/speaker, message_langs, raw_message, radio_freq)
//Also includes the </a> for AI hrefs, for convenience.
return "[radio_freq ? " (" + speaker.GetJob() + ")" : ""]" + "[speaker.GetSource() ? "</a>" : ""]"
/mob/living/silicon/ai/IsVocal()
return !CONFIG_GET(flag/silent_ai)
/mob/living/silicon/ai/radio(message, message_mode, list/spans, language)
if(incapacitated())
return FALSE
if(!radio_enabled) //AI cannot speak if radio is disabled (via intellicard) or depowered.
to_chat(src, "<span class='danger'>Your radio transmitter is offline!</span>")
return FALSE
..()
/mob/living/silicon/ai/get_message_mode(message)
if(copytext(message, 1, 3) in list(":h", ":H", ".h", ".H", "#h", "#H"))
return MODE_HOLOPAD
else
return ..()
//For holopads only. Usable by AI.
/mob/living/silicon/ai/proc/holopad_talk(message, language)
message = trim(message)
if (!message)
return
var/obj/machinery/holopad/T = current
if(istype(T) && T.masters[src])//If there is a hologram and its master is the user.
var/turf/padturf = get_turf(T)
var/padloc
if(padturf)
padloc = AREACOORD(padturf)
else
padloc = "(UNKNOWN)"
src.log_talk(message, LOG_SAY, tag="HOLOPAD in [padloc]")
send_speech(message, 7, T, "robot", message_language = language)
to_chat(src, "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> <span class='message robot'>\"[message]\"</span></span></i>")
else
to_chat(src, "No holopad connected.")
// Make sure that the code compiles with AI_VOX undefined
#ifdef AI_VOX
#define VOX_DELAY 600
/mob/living/silicon/ai/verb/announcement_help()
set name = "Announcement Help"
set desc = "Display a list of vocal words to announce to the crew."
set category = "AI Commands"
if(incapacitated())
return
var/dat = {"
<font class='bad'>WARNING:</font> Misuse of the announcement system will get you job banned.<BR><BR>
Here is a list of words you can type into the 'Announcement' button to create sentences to vocally announce to everyone on the same level at you.<BR>
<UL><LI>You can also click on the word to PREVIEW it.</LI>
<LI>You can only say 30 words for every announcement.</LI>
<LI>Do not use punctuation as you would normally, if you want a pause you can use the full stop and comma characters by separating them with spaces, like so: 'Alpha . Test , Bravo'.</LI>
<LI>Numbers are in word format, e.g. eight, sixty, etc </LI>
<LI>Sound effects begin with an 's' before the actual word, e.g. scensor</LI>
<LI>Use Ctrl+F to see if a word exists in the list.</LI></UL><HR>
"}
var/index = 0
for(var/word in GLOB.vox_sounds)
index++
dat += "<A href='?src=[REF(src)];say_word=[word]'>[capitalize(word)]</A>"
if(index != GLOB.vox_sounds.len)
dat += " / "
var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400)
popup.set_content(dat)
popup.open()
/mob/living/silicon/ai/proc/announcement()
var/static/announcing_vox = 0 // Stores the time of the last announcement
if(announcing_vox > world.time)
to_chat(src, "<span class='notice'>Please wait [DisplayTimeText(announcing_vox - world.time)].</span>")
return
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) as text
last_announcement = message
var/voxType = input(src, "Male or female VOX?", "VOX-gender") in list("male", "female")
if(!message || announcing_vox > world.time)
return
if(incapacitated())
return
if(control_disabled)
to_chat(src, "<span class='warning'>Wireless interface disabled, unable to interact with announcement PA.</span>")
return
var/list/words = splittext(trim(message), " ")
var/list/incorrect_words = list()
if(words.len > 30)
words.len = 30
for(var/word in words)
word = lowertext(trim(word))
if(!word)
words -= word
continue
if(!GLOB.vox_sounds[word] && voxType == "female")
incorrect_words += word
if(!GLOB.vox_sounds_male[word] && voxType == "male")
incorrect_words += word
if(incorrect_words.len)
to_chat(src, "<span class='notice'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>")
return
announcing_vox = world.time + VOX_DELAY
log_game("[key_name(src)] made a vocal announcement with the following message: [message].")
for(var/word in words)
play_vox_word(word, src.z, null, voxType)
/proc/play_vox_word(word, z_level, mob/only_listener, voxType = "female")
word = lowertext(word)
if( (GLOB.vox_sounds[word] && voxType == "female") || (GLOB.vox_sounds_male[word] && voxType == "male") )
var/sound_file
if(voxType == "female")
sound_file = GLOB.vox_sounds[word]
else
sound_file = GLOB.vox_sounds_male[word]
var/sound/voice = sound(sound_file, wait = 1, channel = CHANNEL_VOX)
voice.status = SOUND_STREAM
// If there is no single listener, broadcast to everyone in the same z level
if(!only_listener)
// Play voice for all mobs in the z level
for(var/mob/M in GLOB.player_list)
if(M.client && M.can_hear() && (M.client.prefs.toggles & SOUND_ANNOUNCEMENTS))
var/turf/T = get_turf(M)
if(T.z == z_level)
SEND_SOUND(M, voice)
else
SEND_SOUND(only_listener, voice)
return 1
return 0
#undef VOX_DELAY
#endif
/mob/living/silicon/ai/could_speak_in_language(datum/language/dt)
if(is_servant_of_ratvar(src))
// Ratvarian AIs can only speak Ratvarian
. = ispath(dt, /datum/language/ratvar)
else
. = ..()
/mob/living/silicon/ai/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
if(parent && istype(parent) && parent.stat != DEAD) //If there is a defined "parent" AI, it is actually an AI, and it is alive, anything the AI tries to say is said by the parent instead.
parent.say(message, language)
return
..(message)
/mob/living/silicon/ai/compose_track_href(atom/movable/speaker, namepart)
var/mob/M = speaker.GetSource()
if(M)
return "<a href='?src=[REF(src)];track=[html_encode(namepart)]'>"
return ""
/mob/living/silicon/ai/compose_job(atom/movable/speaker, message_langs, raw_message, radio_freq)
//Also includes the </a> for AI hrefs, for convenience.
return "[radio_freq ? " (" + speaker.GetJob() + ")" : ""]" + "[speaker.GetSource() ? "</a>" : ""]"
/mob/living/silicon/ai/IsVocal()
return !CONFIG_GET(flag/silent_ai)
/mob/living/silicon/ai/radio(message, message_mode, list/spans, language)
if(incapacitated())
return FALSE
if(!radio_enabled) //AI cannot speak if radio is disabled (via intellicard) or depowered.
to_chat(src, "<span class='danger'>Your radio transmitter is offline!</span>")
return FALSE
..()
/mob/living/silicon/ai/get_message_mode(message)
if(copytext(message, 1, 3) in list(":h", ":H", ".h", ".H", "#h", "#H"))
return MODE_HOLOPAD
else
return ..()
//For holopads only. Usable by AI.
/mob/living/silicon/ai/proc/holopad_talk(message, language)
message = trim(message)
if (!message)
return
var/obj/machinery/holopad/T = current
if(istype(T) && T.masters[src])//If there is a hologram and its master is the user.
var/turf/padturf = get_turf(T)
var/padloc
if(padturf)
padloc = AREACOORD(padturf)
else
padloc = "(UNKNOWN)"
src.log_talk(message, LOG_SAY, tag="HOLOPAD in [padloc]")
send_speech(message, 7, T, "robot", message_language = language)
to_chat(src, "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> <span class='message robot'>\"[message]\"</span></span></i>")
else
to_chat(src, "No holopad connected.")
// Make sure that the code compiles with AI_VOX undefined
#ifdef AI_VOX
#define VOX_DELAY 600
/mob/living/silicon/ai/verb/announcement_help()
set name = "Announcement Help"
set desc = "Display a list of vocal words to announce to the crew."
set category = "AI Commands"
if(incapacitated())
return
var/dat = {"
<font class='bad'>WARNING:</font> Misuse of the announcement system will get you job banned.<BR><BR>
Here is a list of words you can type into the 'Announcement' button to create sentences to vocally announce to everyone on the same level at you.<BR>
<UL><LI>You can also click on the word to PREVIEW it.</LI>
<LI>You can only say 30 words for every announcement.</LI>
<LI>Do not use punctuation as you would normally, if you want a pause you can use the full stop and comma characters by separating them with spaces, like so: 'Alpha . Test , Bravo'.</LI>
<LI>Numbers are in word format, e.g. eight, sixty, etc </LI>
<LI>Sound effects begin with an 's' before the actual word, e.g. scensor</LI>
<LI>Use Ctrl+F to see if a word exists in the list.</LI></UL><HR>
"}
var/index = 0
for(var/word in GLOB.vox_sounds)
index++
dat += "<A href='?src=[REF(src)];say_word=[word]'>[capitalize(word)]</A>"
if(index != GLOB.vox_sounds.len)
dat += " / "
var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400)
popup.set_content(dat)
popup.open()
/mob/living/silicon/ai/proc/announcement()
var/static/announcing_vox = 0 // Stores the time of the last announcement
if(announcing_vox > world.time)
to_chat(src, "<span class='notice'>Please wait [DisplayTimeText(announcing_vox - world.time)].</span>")
return
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) as text
last_announcement = message
var/voxType = input(src, "Male or female VOX?", "VOX-gender") in list("male", "female")
if(!message || announcing_vox > world.time)
return
if(incapacitated())
return
if(control_disabled)
to_chat(src, "<span class='warning'>Wireless interface disabled, unable to interact with announcement PA.</span>")
return
var/list/words = splittext(trim(message), " ")
var/list/incorrect_words = list()
if(words.len > 30)
words.len = 30
for(var/word in words)
word = lowertext(trim(word))
if(!word)
words -= word
continue
if(!GLOB.vox_sounds[word] && voxType == "female")
incorrect_words += word
if(!GLOB.vox_sounds_male[word] && voxType == "male")
incorrect_words += word
if(incorrect_words.len)
to_chat(src, "<span class='notice'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>")
return
announcing_vox = world.time + VOX_DELAY
log_game("[key_name(src)] made a vocal announcement with the following message: [message].")
for(var/word in words)
play_vox_word(word, src.z, null, voxType)
/proc/play_vox_word(word, z_level, mob/only_listener, voxType = "female")
word = lowertext(word)
if( (GLOB.vox_sounds[word] && voxType == "female") || (GLOB.vox_sounds_male[word] && voxType == "male") )
var/sound_file
if(voxType == "female")
sound_file = GLOB.vox_sounds[word]
else
sound_file = GLOB.vox_sounds_male[word]
var/sound/voice = sound(sound_file, wait = 1, channel = CHANNEL_VOX)
voice.status = SOUND_STREAM
// If there is no single listener, broadcast to everyone in the same z level
if(!only_listener)
// Play voice for all mobs in the z level
for(var/mob/M in GLOB.player_list)
if(M.client && M.can_hear() && (M.client.prefs.toggles & SOUND_ANNOUNCEMENTS))
var/turf/T = get_turf(M)
if(T.z == z_level)
SEND_SOUND(M, voice)
else
SEND_SOUND(only_listener, voice)
return 1
return 0
#undef VOX_DELAY
#endif
/mob/living/silicon/ai/could_speak_in_language(datum/language/dt)
if(is_servant_of_ratvar(src))
// Ratvarian AIs can only speak Ratvarian
. = ispath(dt, /datum/language/ratvar)
else
. = ..()
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -1,13 +1,13 @@
/mob/living/silicon/spawn_gibs(with_bodyparts, atom/loc_override)
new /obj/effect/gibspawner/robot(loc_override ? loc_override.drop_location() : drop_location(), src)
/mob/living/silicon/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
/mob/living/silicon/death(gibbed)
if(!gibbed)
emote("deathgasp")
diag_hud_set_status()
diag_hud_set_health()
update_health_hud()
/mob/living/silicon/spawn_gibs(with_bodyparts, atom/loc_override)
new /obj/effect/gibspawner/robot(loc_override ? loc_override.drop_location() : drop_location(), src)
/mob/living/silicon/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
/mob/living/silicon/death(gibbed)
if(!gibbed)
emote("deathgasp")
diag_hud_set_status()
diag_hud_set_health()
update_health_hud()
. = ..()
+93 -93
View File
@@ -1,93 +1,93 @@
/mob/living/silicon/proc/show_laws() //Redefined in ai/laws.dm and robot/laws.dm
return
/mob/living/silicon/proc/laws_sanity_check()
if (!laws)
make_laws()
/mob/living/silicon/proc/post_lawchange(announce = TRUE)
throw_alert("newlaw", /obj/screen/alert/newlaw)
if(announce && last_lawchange_announce != world.time)
to_chat(src, "<b>Your laws have been changed.</b>")
addtimer(CALLBACK(src, .proc/show_laws), 0)
last_lawchange_announce = world.time
/mob/living/silicon/proc/set_law_sixsixsix(law, announce = TRUE)
laws_sanity_check()
laws.set_law_sixsixsix(law)
post_lawchange(announce)
/mob/living/silicon/proc/set_zeroth_law(law, law_borg, announce = TRUE)
laws_sanity_check()
laws.set_zeroth_law(law, law_borg)
post_lawchange(announce)
/mob/living/silicon/proc/add_inherent_law(law, announce = TRUE)
laws_sanity_check()
laws.add_inherent_law(law)
post_lawchange(announce)
/mob/living/silicon/proc/clear_inherent_laws(announce = TRUE)
laws_sanity_check()
laws.clear_inherent_laws()
post_lawchange(announce)
/mob/living/silicon/proc/add_supplied_law(number, law, announce = TRUE)
laws_sanity_check()
laws.add_supplied_law(number, law)
post_lawchange(announce)
/mob/living/silicon/proc/clear_supplied_laws(announce = TRUE)
laws_sanity_check()
laws.clear_supplied_laws()
post_lawchange(announce)
/mob/living/silicon/proc/add_ion_law(law, announce = TRUE)
laws_sanity_check()
laws.add_ion_law(law)
post_lawchange(announce)
/mob/living/silicon/proc/add_hacked_law(law, announce = TRUE)
laws_sanity_check()
laws.add_hacked_law(law)
post_lawchange(announce)
/mob/living/silicon/proc/replace_random_law(law, groups, announce = TRUE)
laws_sanity_check()
. = laws.replace_random_law(law,groups)
post_lawchange(announce)
/mob/living/silicon/proc/shuffle_laws(list/groups, announce = TRUE)
laws_sanity_check()
laws.shuffle_laws(groups)
post_lawchange(announce)
/mob/living/silicon/proc/remove_law(number, announce = TRUE)
laws_sanity_check()
. = laws.remove_law(number)
post_lawchange(announce)
/mob/living/silicon/proc/clear_ion_laws(announce = TRUE)
laws_sanity_check()
laws.clear_ion_laws()
post_lawchange(announce)
/mob/living/silicon/proc/clear_hacked_laws(announce = TRUE)
laws_sanity_check()
laws.clear_hacked_laws()
post_lawchange(announce)
/mob/living/silicon/proc/make_laws()
laws = new /datum/ai_laws
laws.set_laws_config()
laws.associate(src)
/mob/living/silicon/proc/clear_zeroth_law(force, announce = TRUE)
laws_sanity_check()
laws.clear_zeroth_law(force)
post_lawchange(announce)
/mob/living/silicon/proc/clear_law_sixsixsix(force, announce = TRUE)
laws_sanity_check()
laws.clear_law_sixsixsix(force)
post_lawchange(announce)
/mob/living/silicon/proc/show_laws() //Redefined in ai/laws.dm and robot/laws.dm
return
/mob/living/silicon/proc/laws_sanity_check()
if (!laws)
make_laws()
/mob/living/silicon/proc/post_lawchange(announce = TRUE)
throw_alert("newlaw", /obj/screen/alert/newlaw)
if(announce && last_lawchange_announce != world.time)
to_chat(src, "<b>Your laws have been changed.</b>")
addtimer(CALLBACK(src, .proc/show_laws), 0)
last_lawchange_announce = world.time
/mob/living/silicon/proc/set_law_sixsixsix(law, announce = TRUE)
laws_sanity_check()
laws.set_law_sixsixsix(law)
post_lawchange(announce)
/mob/living/silicon/proc/set_zeroth_law(law, law_borg, announce = TRUE)
laws_sanity_check()
laws.set_zeroth_law(law, law_borg)
post_lawchange(announce)
/mob/living/silicon/proc/add_inherent_law(law, announce = TRUE)
laws_sanity_check()
laws.add_inherent_law(law)
post_lawchange(announce)
/mob/living/silicon/proc/clear_inherent_laws(announce = TRUE)
laws_sanity_check()
laws.clear_inherent_laws()
post_lawchange(announce)
/mob/living/silicon/proc/add_supplied_law(number, law, announce = TRUE)
laws_sanity_check()
laws.add_supplied_law(number, law)
post_lawchange(announce)
/mob/living/silicon/proc/clear_supplied_laws(announce = TRUE)
laws_sanity_check()
laws.clear_supplied_laws()
post_lawchange(announce)
/mob/living/silicon/proc/add_ion_law(law, announce = TRUE)
laws_sanity_check()
laws.add_ion_law(law)
post_lawchange(announce)
/mob/living/silicon/proc/add_hacked_law(law, announce = TRUE)
laws_sanity_check()
laws.add_hacked_law(law)
post_lawchange(announce)
/mob/living/silicon/proc/replace_random_law(law, groups, announce = TRUE)
laws_sanity_check()
. = laws.replace_random_law(law,groups)
post_lawchange(announce)
/mob/living/silicon/proc/shuffle_laws(list/groups, announce = TRUE)
laws_sanity_check()
laws.shuffle_laws(groups)
post_lawchange(announce)
/mob/living/silicon/proc/remove_law(number, announce = TRUE)
laws_sanity_check()
. = laws.remove_law(number)
post_lawchange(announce)
/mob/living/silicon/proc/clear_ion_laws(announce = TRUE)
laws_sanity_check()
laws.clear_ion_laws()
post_lawchange(announce)
/mob/living/silicon/proc/clear_hacked_laws(announce = TRUE)
laws_sanity_check()
laws.clear_hacked_laws()
post_lawchange(announce)
/mob/living/silicon/proc/make_laws()
laws = new /datum/ai_laws
laws.set_laws_config()
laws.associate(src)
/mob/living/silicon/proc/clear_zeroth_law(force, announce = TRUE)
laws_sanity_check()
laws.clear_zeroth_law(force)
post_lawchange(announce)
/mob/living/silicon/proc/clear_law_sixsixsix(force, announce = TRUE)
laws_sanity_check()
laws.clear_law_sixsixsix(force)
post_lawchange(announce)
+10 -10
View File
@@ -1,10 +1,10 @@
/mob/living/silicon/Login()
if(mind && SSticker.mode)
SSticker.mode.remove_cultist(mind, 0, 0)
var/datum/antagonist/rev/rev = mind.has_antag_datum(/datum/antagonist/rev)
if(rev)
rev.remove_revolutionary(TRUE)
var/datum/antagonist/bloodsucker/V = mind.has_antag_datum(/datum/antagonist/bloodsucker)
if(V)
mind.remove_antag_datum(V)
..()
/mob/living/silicon/Login()
if(mind && SSticker.mode)
SSticker.mode.remove_cultist(mind, 0, 0)
var/datum/antagonist/rev/rev = mind.has_antag_datum(/datum/antagonist/rev)
if(rev)
rev.remove_revolutionary(TRUE)
var/datum/antagonist/bloodsucker/V = mind.has_antag_datum(/datum/antagonist/bloodsucker)
if(V)
mind.remove_antag_datum(V)
..()
+12 -12
View File
@@ -1,12 +1,12 @@
/mob/living/silicon/pai/death(gibbed)
if(stat == DEAD)
return
stat = DEAD
canmove = 0
update_sight()
clear_fullscreens()
//New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here.
GLOB.alive_mob_list -= src
ghostize()
qdel(src)
/mob/living/silicon/pai/death(gibbed)
if(stat == DEAD)
return
stat = DEAD
canmove = 0
update_sight()
clear_fullscreens()
//New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here.
GLOB.alive_mob_list -= src
ghostize()
qdel(src)
+429 -429
View File
@@ -1,429 +1,429 @@
/mob/living/silicon/pai
name = "pAI"
icon = 'icons/mob/pai.dmi'
icon_state = "repairbot"
mouse_opacity = MOUSE_OPACITY_OPAQUE
density = FALSE
pass_flags = PASSTABLE | PASSMOB
mob_size = MOB_SIZE_TINY
desc = "A generic pAI mobile hard-light holographics emitter. It seems to be deactivated."
weather_immunities = list("ash")
health = 500
maxHealth = 500
layer = BELOW_MOB_LAYER
can_be_held = TRUE
var/network = "ss13"
var/obj/machinery/camera/current = null
var/ram = 100 // Used as currency to purchase different abilities
var/list/software = list()
var/userDNA // The DNA string of our assigned user
var/obj/item/paicard/card // The card we inhabit
var/hacking = FALSE //Are we hacking a door?
var/speakStatement = "states"
var/speakExclamation = "declares"
var/speakDoubleExclamation = "alarms"
var/speakQuery = "queries"
var/obj/item/pai_cable/cable // The cable we produce and use when door or camera jacking
var/master // Name of the one who commands us
var/master_dna // DNA string for owner verification
// Various software-specific vars
var/temp // General error reporting text contained here will typically be shown once and cleared
var/screen // Which screen our main window displays
var/subscreen // Which specific function of the main screen is being displayed
var/obj/item/pda/ai/pai/pda = null
var/secHUD = 0 // Toggles whether the Security HUD is active or not
var/medHUD = 0 // Toggles whether the Medical HUD is active or not
var/datum/data/record/medicalActive1 // Datacore record declarations for record software
var/datum/data/record/medicalActive2
var/datum/data/record/securityActive1 // Could probably just combine all these into one
var/datum/data/record/securityActive2
var/obj/machinery/door/hackdoor // The airlock being hacked
var/hackprogress = 0 // Possible values: 0 - 100, >= 100 means the hack is complete and will be reset upon next check
var/obj/item/integrated_signaler/signaler // AI's signaller
var/holoform = FALSE
var/canholo = TRUE
var/obj/item/card/id/access_card = null
var/chassis = "repairbot"
var/dynamic_chassis
var/dynamic_chassis_sit = FALSE //whether we're sitting instead of resting spritewise
var/dynamic_chassis_bellyup = FALSE //whether we're lying down bellyup
var/list/possible_chassis //initialized in initialize.
var/list/dynamic_chassis_icons //ditto.
var/list/chassis_pixel_offsets_x //stupid dogborgs
var/static/item_head_icon = 'icons/mob/pai_item_head.dmi'
var/static/item_lh_icon = 'icons/mob/pai_item_lh.dmi'
var/static/item_rh_icon = 'icons/mob/pai_item_rh.dmi'
var/emitterhealth = 20
var/emittermaxhealth = 20
var/emitterregen = 0.25
var/emitter_next_use = 0
var/emitter_emp_cd = 300
var/emittercd = 50
var/emitteroverloadcd = 100
var/radio_short = FALSE
var/radio_short_cooldown = 5 MINUTES
var/radio_short_timerid
canmove = FALSE
var/silent = FALSE
var/brightness_power = 5
var/icon/custom_holoform_icon
/mob/living/silicon/pai/Destroy()
if (loc != card)
card.forceMove(drop_location())
card.pai = null
card.cut_overlays()
card.add_overlay("pai-off")
GLOB.pai_list -= src
return ..()
/mob/living/silicon/pai/Initialize()
var/obj/item/paicard/P = loc
START_PROCESSING(SSfastprocess, src)
GLOB.pai_list += src
make_laws()
canmove = 0
if(!istype(P)) //when manually spawning a pai, we create a card to put it into.
var/newcardloc = P
P = new /obj/item/paicard(newcardloc)
P.setPersonality(src)
forceMove(P)
card = P
signaler = new(src)
if(!radio)
radio = new /obj/item/radio(src)
//PDA
pda = new(src)
spawn(5)
pda.ownjob = "pAI Messenger"
pda.owner = text("[]", src)
pda.name = pda.owner + " (" + pda.ownjob + ")"
possible_chassis = typelist(NAMEOF(src, possible_chassis), list("cat" = TRUE, "mouse" = TRUE, "monkey" = TRUE, "corgi" = FALSE,
"fox" = FALSE, "repairbot" = TRUE, "rabbit" = TRUE, "borgi" = FALSE ,
"parrot" = FALSE, "bear" = FALSE , "mushroom" = FALSE, "crow" = FALSE ,
"fairy" = FALSE , "spiderbot" = FALSE)) //assoc value is whether it can be picked up.
dynamic_chassis_icons = typelist(NAMEOF(src, dynamic_chassis_icons), initialize_dynamic_chassis_icons())
chassis_pixel_offsets_x = typelist(NAMEOF(src, chassis_pixel_offsets_x), default_chassis_pixel_offsets_x())
. = ..()
var/datum/action/innate/pai/software/SW = new
var/datum/action/innate/pai/shell/AS = new /datum/action/innate/pai/shell
var/datum/action/innate/pai/chassis/AC = new /datum/action/innate/pai/chassis
var/datum/action/innate/pai/rest/AR = new /datum/action/innate/pai/rest
var/datum/action/innate/pai/light/AL = new /datum/action/innate/pai/light
var/datum/action/language_menu/ALM = new
SW.Grant(src)
AS.Grant(src)
AC.Grant(src)
AR.Grant(src)
AL.Grant(src)
ALM.Grant(src)
emitter_next_use = world.time + 10 SECONDS
/mob/living/silicon/pai/Life()
if(hacking)
process_hack()
return ..()
/mob/living/silicon/pai/proc/process_hack()
if(cable && cable.machine && istype(cable.machine, /obj/machinery/door) && cable.machine == hackdoor && get_dist(src, hackdoor) <= 1)
hackprogress = CLAMP(hackprogress + 4, 0, 100)
else
temp = "Door Jack: Connection to airlock has been lost. Hack aborted."
hackprogress = 0
hacking = FALSE
hackdoor = null
return
if(screen == "doorjack" && subscreen == 0) // Update our view, if appropriate
paiInterface()
if(hackprogress >= 100)
hackprogress = 0
var/obj/machinery/door/D = cable.machine
D.open()
hacking = FALSE
/mob/living/silicon/pai/make_laws()
laws = new /datum/ai_laws/pai()
return TRUE
/mob/living/silicon/pai/Login()
..()
usr << browse_rsc('html/paigrid.png') // Go ahead and cache the interface resources as early as possible
if(client)
client.perspective = EYE_PERSPECTIVE
if(holoform)
client.eye = src
else
client.eye = card
/mob/living/silicon/pai/Stat()
..()
if(statpanel("Status"))
if(!stat)
stat(null, text("Emitter Integrity: [emitterhealth * (100/emittermaxhealth)]"))
else
stat(null, text("Systems nonfunctional"))
/mob/living/silicon/pai/restrained(ignore_grab)
. = FALSE
// See software.dm for Topic()
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
if(be_close && !in_range(M, src))
to_chat(src, "<span class='warning'>You are too far away!</span>")
return FALSE
return TRUE
/mob/proc/makePAI(delold)
var/obj/item/paicard/card = new /obj/item/paicard(get_turf(src))
var/mob/living/silicon/pai/pai = new /mob/living/silicon/pai(card)
transfer_ckey(pai)
pai.name = name
card.setPersonality(pai)
if(delold)
qdel(src)
/datum/action/innate/pai
name = "PAI Action"
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
var/mob/living/silicon/pai/P
/datum/action/innate/pai/Trigger()
if(!ispAI(owner))
return 0
P = owner
/datum/action/innate/pai/software
name = "Software Interface"
button_icon_state = "pai"
background_icon_state = "bg_tech"
/datum/action/innate/pai/software/Trigger()
..()
P.paiInterface()
/datum/action/innate/pai/shell
name = "Toggle Holoform"
button_icon_state = "pai_holoform"
background_icon_state = "bg_tech"
/datum/action/innate/pai/shell/Trigger()
..()
if(P.holoform)
P.fold_in(FALSE)
else
P.fold_out()
/datum/action/innate/pai/chassis
name = "Holochassis Appearance Composite"
button_icon_state = "pai_chassis"
background_icon_state = "bg_tech"
/datum/action/innate/pai/chassis/Trigger()
..()
P.choose_chassis()
/datum/action/innate/pai/rest
name = "Rest"
button_icon_state = "pai_rest"
background_icon_state = "bg_tech"
/datum/action/innate/pai/rest/Trigger()
..()
P.lay_down()
/datum/action/innate/pai/light
name = "Toggle Integrated Lights"
icon_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "emp"
background_icon_state = "bg_tech"
/datum/action/innate/pai/light/Trigger()
..()
P.toggle_integrated_light()
/mob/living/silicon/pai/Process_Spacemove(movement_dir = 0)
. = ..()
if(!.)
add_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE, 100, multiplicative_slowdown = 2)
return TRUE
remove_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE)
return TRUE
/mob/living/silicon/pai/examine(mob/user)
. = ..()
. += "A personal AI in holochassis mode. Its master ID string seems to be [master]."
/mob/living/silicon/pai/Life()
if(stat == DEAD)
return
if(cable)
if(get_dist(src, cable) > 1)
var/turf/T = get_turf(src.loc)
T.visible_message("<span class='warning'>[src.cable] rapidly retracts back into its spool.</span>", "<span class='italics'>You hear a click and the sound of wire spooling rapidly.</span>")
qdel(src.cable)
cable = null
silent = max(silent - 1, 0)
. = ..()
/mob/living/silicon/pai/updatehealth()
if(status_flags & GODMODE)
return
health = maxHealth - getBruteLoss() - getFireLoss()
update_stat()
/mob/living/silicon/pai/process()
emitterhealth = CLAMP((emitterhealth + emitterregen), -50, emittermaxhealth)
/mob/living/silicon/pai/proc/short_radio()
if(radio_short_timerid)
deltimer(radio_short_timerid)
radio_short = TRUE
to_chat(src, "<span class='danger'>Your radio shorts out!</span>")
radio_short_timerid = addtimer(CALLBACK(src, .proc/unshort_radio), radio_short_cooldown, flags = TIMER_STOPPABLE)
/mob/living/silicon/pai/proc/unshort_radio()
radio_short = FALSE
to_chat(src, "<span class='danger'>You feel your radio is operational once more.</span>")
if(radio_short_timerid)
deltimer(radio_short_timerid)
/mob/living/silicon/pai/proc/initialize_dynamic_chassis_icons()
. = list()
var/icon/curr //for inserts
//This is a horrible system and I wish I was not as lazy and did something smarter, like just generating a new icon in memory which is probably more efficient.
//Basic /tg/ cyborgs
.["Cyborg - Engineering (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "engineer"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (loaderborg)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "loaderborg"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (handyeng)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "handyeng"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (sleekeng)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "sleekeng"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (marinaeng)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "marinaeng"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "medical"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (marinamed)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "marinamed"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (eyebotmed)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "eyebotmed"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "sec"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (sleeksec)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "sleeksec"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (marinasec)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "marinasec"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Clown (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "clown"), HOLOFORM_FILTER_PAI, FALSE)
//Citadel dogborgs
//Engi
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (dog - valeeng)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (dog - pupdozer)"] = curr
//Med
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "medihound")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihound-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihound-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihound-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (dog - medihound)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (dog - medihounddark)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valemed")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valemed-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valemed-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valemed-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (dog - valemed)"] = curr
//Sec
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "k9")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (dog - k9)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (dog - k9dark)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valesec")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesec-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesec-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesec-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (dog - valesec)"] = curr
//Service
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Service (dog - valeserv)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Service (dog - valeservdark)"] = curr
//Sci
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valesci")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesci-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesci-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesci-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Science (dog - valesci)"] = curr
//Misc
.["Cyborg - Misc (dog - blade)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/widerobot.dmi', "blade"), HOLOFORM_FILTER_PAI, FALSE)
/mob/living/silicon/pai/proc/default_chassis_pixel_offsets_x()
. = list()
//Engi
.["Cyborg - Engineering (dog - valeeng)"] = -16
.["Cyborg - Engineering (dog - pupdozer)"] = -16
//Med
.["Cyborg - Medical (dog - medihound)"] = -16
.["Cyborg - Medical (dog - medihounddark)"] = -16
.["Cyborg - Medical (dog - valemed)"] = -16
//Sec
.["Cyborg - Security (dog - k9)"] = -16
.["Cyborg - Security (dog - valesec)"] = -16
.["Cyborg - Security (dog - k9dark)"] = -16
//Service
.["Cyborg - Service (dog - valeserv)"] = -16
.["Cyborg - Service (dog - valeservdark)"] = -16
//Sci
.["Cyborg - Security (dog - valesci)"] = -16
//Misc
.["Cyborg - Misc (dog - blade)"] = -16
/mob/living/silicon/pai
name = "pAI"
icon = 'icons/mob/pai.dmi'
icon_state = "repairbot"
mouse_opacity = MOUSE_OPACITY_OPAQUE
density = FALSE
pass_flags = PASSTABLE | PASSMOB
mob_size = MOB_SIZE_TINY
desc = "A generic pAI mobile hard-light holographics emitter. It seems to be deactivated."
weather_immunities = list("ash")
health = 500
maxHealth = 500
layer = BELOW_MOB_LAYER
can_be_held = TRUE
var/network = "ss13"
var/obj/machinery/camera/current = null
var/ram = 100 // Used as currency to purchase different abilities
var/list/software = list()
var/userDNA // The DNA string of our assigned user
var/obj/item/paicard/card // The card we inhabit
var/hacking = FALSE //Are we hacking a door?
var/speakStatement = "states"
var/speakExclamation = "declares"
var/speakDoubleExclamation = "alarms"
var/speakQuery = "queries"
var/obj/item/pai_cable/cable // The cable we produce and use when door or camera jacking
var/master // Name of the one who commands us
var/master_dna // DNA string for owner verification
// Various software-specific vars
var/temp // General error reporting text contained here will typically be shown once and cleared
var/screen // Which screen our main window displays
var/subscreen // Which specific function of the main screen is being displayed
var/obj/item/pda/ai/pai/pda = null
var/secHUD = 0 // Toggles whether the Security HUD is active or not
var/medHUD = 0 // Toggles whether the Medical HUD is active or not
var/datum/data/record/medicalActive1 // Datacore record declarations for record software
var/datum/data/record/medicalActive2
var/datum/data/record/securityActive1 // Could probably just combine all these into one
var/datum/data/record/securityActive2
var/obj/machinery/door/hackdoor // The airlock being hacked
var/hackprogress = 0 // Possible values: 0 - 100, >= 100 means the hack is complete and will be reset upon next check
var/obj/item/integrated_signaler/signaler // AI's signaller
var/holoform = FALSE
var/canholo = TRUE
var/obj/item/card/id/access_card = null
var/chassis = "repairbot"
var/dynamic_chassis
var/dynamic_chassis_sit = FALSE //whether we're sitting instead of resting spritewise
var/dynamic_chassis_bellyup = FALSE //whether we're lying down bellyup
var/list/possible_chassis //initialized in initialize.
var/list/dynamic_chassis_icons //ditto.
var/list/chassis_pixel_offsets_x //stupid dogborgs
var/static/item_head_icon = 'icons/mob/pai_item_head.dmi'
var/static/item_lh_icon = 'icons/mob/pai_item_lh.dmi'
var/static/item_rh_icon = 'icons/mob/pai_item_rh.dmi'
var/emitterhealth = 20
var/emittermaxhealth = 20
var/emitterregen = 0.25
var/emitter_next_use = 0
var/emitter_emp_cd = 300
var/emittercd = 50
var/emitteroverloadcd = 100
var/radio_short = FALSE
var/radio_short_cooldown = 5 MINUTES
var/radio_short_timerid
canmove = FALSE
var/silent = FALSE
var/brightness_power = 5
var/icon/custom_holoform_icon
/mob/living/silicon/pai/Destroy()
if (loc != card)
card.forceMove(drop_location())
card.pai = null
card.cut_overlays()
card.add_overlay("pai-off")
GLOB.pai_list -= src
return ..()
/mob/living/silicon/pai/Initialize()
var/obj/item/paicard/P = loc
START_PROCESSING(SSfastprocess, src)
GLOB.pai_list += src
make_laws()
canmove = 0
if(!istype(P)) //when manually spawning a pai, we create a card to put it into.
var/newcardloc = P
P = new /obj/item/paicard(newcardloc)
P.setPersonality(src)
forceMove(P)
card = P
signaler = new(src)
if(!radio)
radio = new /obj/item/radio(src)
//PDA
pda = new(src)
spawn(5)
pda.ownjob = "pAI Messenger"
pda.owner = text("[]", src)
pda.name = pda.owner + " (" + pda.ownjob + ")"
possible_chassis = typelist(NAMEOF(src, possible_chassis), list("cat" = TRUE, "mouse" = TRUE, "monkey" = TRUE, "corgi" = FALSE,
"fox" = FALSE, "repairbot" = TRUE, "rabbit" = TRUE, "borgi" = FALSE ,
"parrot" = FALSE, "bear" = FALSE , "mushroom" = FALSE, "crow" = FALSE ,
"fairy" = FALSE , "spiderbot" = FALSE)) //assoc value is whether it can be picked up.
dynamic_chassis_icons = typelist(NAMEOF(src, dynamic_chassis_icons), initialize_dynamic_chassis_icons())
chassis_pixel_offsets_x = typelist(NAMEOF(src, chassis_pixel_offsets_x), default_chassis_pixel_offsets_x())
. = ..()
var/datum/action/innate/pai/software/SW = new
var/datum/action/innate/pai/shell/AS = new /datum/action/innate/pai/shell
var/datum/action/innate/pai/chassis/AC = new /datum/action/innate/pai/chassis
var/datum/action/innate/pai/rest/AR = new /datum/action/innate/pai/rest
var/datum/action/innate/pai/light/AL = new /datum/action/innate/pai/light
var/datum/action/language_menu/ALM = new
SW.Grant(src)
AS.Grant(src)
AC.Grant(src)
AR.Grant(src)
AL.Grant(src)
ALM.Grant(src)
emitter_next_use = world.time + 10 SECONDS
/mob/living/silicon/pai/Life()
if(hacking)
process_hack()
return ..()
/mob/living/silicon/pai/proc/process_hack()
if(cable && cable.machine && istype(cable.machine, /obj/machinery/door) && cable.machine == hackdoor && get_dist(src, hackdoor) <= 1)
hackprogress = CLAMP(hackprogress + 4, 0, 100)
else
temp = "Door Jack: Connection to airlock has been lost. Hack aborted."
hackprogress = 0
hacking = FALSE
hackdoor = null
return
if(screen == "doorjack" && subscreen == 0) // Update our view, if appropriate
paiInterface()
if(hackprogress >= 100)
hackprogress = 0
var/obj/machinery/door/D = cable.machine
D.open()
hacking = FALSE
/mob/living/silicon/pai/make_laws()
laws = new /datum/ai_laws/pai()
return TRUE
/mob/living/silicon/pai/Login()
..()
usr << browse_rsc('html/paigrid.png') // Go ahead and cache the interface resources as early as possible
if(client)
client.perspective = EYE_PERSPECTIVE
if(holoform)
client.eye = src
else
client.eye = card
/mob/living/silicon/pai/Stat()
..()
if(statpanel("Status"))
if(!stat)
stat(null, text("Emitter Integrity: [emitterhealth * (100/emittermaxhealth)]"))
else
stat(null, text("Systems nonfunctional"))
/mob/living/silicon/pai/restrained(ignore_grab)
. = FALSE
// See software.dm for Topic()
/mob/living/silicon/pai/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
if(be_close && !in_range(M, src))
to_chat(src, "<span class='warning'>You are too far away!</span>")
return FALSE
return TRUE
/mob/proc/makePAI(delold)
var/obj/item/paicard/card = new /obj/item/paicard(get_turf(src))
var/mob/living/silicon/pai/pai = new /mob/living/silicon/pai(card)
transfer_ckey(pai)
pai.name = name
card.setPersonality(pai)
if(delold)
qdel(src)
/datum/action/innate/pai
name = "PAI Action"
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
var/mob/living/silicon/pai/P
/datum/action/innate/pai/Trigger()
if(!ispAI(owner))
return 0
P = owner
/datum/action/innate/pai/software
name = "Software Interface"
button_icon_state = "pai"
background_icon_state = "bg_tech"
/datum/action/innate/pai/software/Trigger()
..()
P.paiInterface()
/datum/action/innate/pai/shell
name = "Toggle Holoform"
button_icon_state = "pai_holoform"
background_icon_state = "bg_tech"
/datum/action/innate/pai/shell/Trigger()
..()
if(P.holoform)
P.fold_in(FALSE)
else
P.fold_out()
/datum/action/innate/pai/chassis
name = "Holochassis Appearance Composite"
button_icon_state = "pai_chassis"
background_icon_state = "bg_tech"
/datum/action/innate/pai/chassis/Trigger()
..()
P.choose_chassis()
/datum/action/innate/pai/rest
name = "Rest"
button_icon_state = "pai_rest"
background_icon_state = "bg_tech"
/datum/action/innate/pai/rest/Trigger()
..()
P.lay_down()
/datum/action/innate/pai/light
name = "Toggle Integrated Lights"
icon_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "emp"
background_icon_state = "bg_tech"
/datum/action/innate/pai/light/Trigger()
..()
P.toggle_integrated_light()
/mob/living/silicon/pai/Process_Spacemove(movement_dir = 0)
. = ..()
if(!.)
add_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE, 100, multiplicative_slowdown = 2)
return TRUE
remove_movespeed_modifier(MOVESPEED_ID_PAI_SPACEWALK_SPEEDMOD, TRUE)
return TRUE
/mob/living/silicon/pai/examine(mob/user)
. = ..()
. += "A personal AI in holochassis mode. Its master ID string seems to be [master]."
/mob/living/silicon/pai/Life()
if(stat == DEAD)
return
if(cable)
if(get_dist(src, cable) > 1)
var/turf/T = get_turf(src.loc)
T.visible_message("<span class='warning'>[src.cable] rapidly retracts back into its spool.</span>", "<span class='italics'>You hear a click and the sound of wire spooling rapidly.</span>")
qdel(src.cable)
cable = null
silent = max(silent - 1, 0)
. = ..()
/mob/living/silicon/pai/updatehealth()
if(status_flags & GODMODE)
return
health = maxHealth - getBruteLoss() - getFireLoss()
update_stat()
/mob/living/silicon/pai/process()
emitterhealth = CLAMP((emitterhealth + emitterregen), -50, emittermaxhealth)
/mob/living/silicon/pai/proc/short_radio()
if(radio_short_timerid)
deltimer(radio_short_timerid)
radio_short = TRUE
to_chat(src, "<span class='danger'>Your radio shorts out!</span>")
radio_short_timerid = addtimer(CALLBACK(src, .proc/unshort_radio), radio_short_cooldown, flags = TIMER_STOPPABLE)
/mob/living/silicon/pai/proc/unshort_radio()
radio_short = FALSE
to_chat(src, "<span class='danger'>You feel your radio is operational once more.</span>")
if(radio_short_timerid)
deltimer(radio_short_timerid)
/mob/living/silicon/pai/proc/initialize_dynamic_chassis_icons()
. = list()
var/icon/curr //for inserts
//This is a horrible system and I wish I was not as lazy and did something smarter, like just generating a new icon in memory which is probably more efficient.
//Basic /tg/ cyborgs
.["Cyborg - Engineering (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "engineer"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (loaderborg)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "loaderborg"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (handyeng)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "handyeng"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (sleekeng)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "sleekeng"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (marinaeng)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "marinaeng"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "medical"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (marinamed)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "marinamed"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (eyebotmed)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "eyebotmed"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "sec"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (sleeksec)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "sleeksec"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (marinasec)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/robots.dmi', "marinasec"), HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Clown (default)"] = process_holoform_icon_filter(icon('icons/mob/robots.dmi', "clown"), HOLOFORM_FILTER_PAI, FALSE)
//Citadel dogborgs
//Engi
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeeng-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (dog - valeeng)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "pupdozer-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Engineering (dog - pupdozer)"] = curr
//Med
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "medihound")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihound-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihound-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihound-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (dog - medihound)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "medihounddark-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (dog - medihounddark)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valemed")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valemed-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valemed-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valemed-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Medical (dog - valemed)"] = curr
//Sec
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "k9")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (dog - k9)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "k9dark-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (dog - k9dark)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valesec")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesec-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesec-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesec-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Security (dog - valesec)"] = curr
//Service
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeserv-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Service (dog - valeserv)"] = curr
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valeservdark-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Service (dog - valeservdark)"] = curr
//Sci
curr = icon('modular_citadel/icons/mob/widerobot.dmi', "valesci")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesci-rest"), "rest")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesci-sit"), "sit")
curr.Insert(icon('modular_citadel/icons/mob/widerobot.dmi', "valesci-bellyup"), "bellyup")
process_holoform_icon_filter(curr, HOLOFORM_FILTER_PAI, FALSE)
.["Cyborg - Science (dog - valesci)"] = curr
//Misc
.["Cyborg - Misc (dog - blade)"] = process_holoform_icon_filter(icon('modular_citadel/icons/mob/widerobot.dmi', "blade"), HOLOFORM_FILTER_PAI, FALSE)
/mob/living/silicon/pai/proc/default_chassis_pixel_offsets_x()
. = list()
//Engi
.["Cyborg - Engineering (dog - valeeng)"] = -16
.["Cyborg - Engineering (dog - pupdozer)"] = -16
//Med
.["Cyborg - Medical (dog - medihound)"] = -16
.["Cyborg - Medical (dog - medihounddark)"] = -16
.["Cyborg - Medical (dog - valemed)"] = -16
//Sec
.["Cyborg - Security (dog - k9)"] = -16
.["Cyborg - Security (dog - valesec)"] = -16
.["Cyborg - Security (dog - k9dark)"] = -16
//Service
.["Cyborg - Service (dog - valeserv)"] = -16
.["Cyborg - Service (dog - valeservdark)"] = -16
//Sci
.["Cyborg - Security (dog - valesci)"] = -16
//Misc
.["Cyborg - Misc (dog - blade)"] = -16
@@ -55,7 +55,7 @@
if(P.stun)
fold_in(force = TRUE)
visible_message("<span class='warning'>The electrically-charged projectile disrupts [src]'s holomatrix, forcing [src] to fold in!</span>")
. = ..()
return ..()
/mob/living/silicon/pai/stripPanelUnequip(obj/item/what, mob/who, where) //prevents stripping
to_chat(src, "<span class='warning'>Your holochassis stutters and warps intensely as you attempt to interact with the object, forcing you to cease lest the field fail.</span>")
@@ -104,7 +104,7 @@
visible_message("<span class='notice'>[src] [resting? "lays down for a moment..." : "perks up from the ground"]</span>")
update_icon()
/mob/living/silicon/pai/start_pulling(atom/movable/AM, gs)
/mob/living/silicon/pai/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE)
if(ispAI(AM))
return ..()
return FALSE
@@ -1,61 +1,61 @@
/*
name
key
description
role
comments
ready = 0
*/
/datum/paiCandidate/proc/savefile_path(mob/user)
return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/pai.sav"
/datum/paiCandidate/proc/savefile_save(mob/user)
if(IsGuestKey(user.key))
return 0
var/savefile/F = new /savefile(src.savefile_path(user))
WRITE_FILE(F["name"], name)
WRITE_FILE(F["description"], description)
WRITE_FILE(F["role"], role)
WRITE_FILE(F["comments"], comments)
WRITE_FILE(F["version"], 1)
return 1
// loads the savefile corresponding to the mob's ckey
// if silent=true, report incompatible savefiles
// returns 1 if loaded (or file was incompatible)
// returns 0 if savefile did not exist
/datum/paiCandidate/proc/savefile_load(mob/user, silent = TRUE)
if (IsGuestKey(user.key))
return 0
var/path = savefile_path(user)
if (!fexists(path))
return 0
var/savefile/F = new /savefile(path)
if(!F)
return //Not everyone has a pai savefile.
var/version = null
F["version"] >> version
if (isnull(version) || version != 1)
fdel(path)
if (!silent)
alert(user, "Your savefile was incompatible with this version and was deleted.")
return 0
F["name"] >> src.name
F["description"] >> src.description
F["role"] >> src.role
F["comments"] >> src.comments
return 1
/*
name
key
description
role
comments
ready = 0
*/
/datum/paiCandidate/proc/savefile_path(mob/user)
return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/pai.sav"
/datum/paiCandidate/proc/savefile_save(mob/user)
if(IsGuestKey(user.key))
return 0
var/savefile/F = new /savefile(src.savefile_path(user))
WRITE_FILE(F["name"], name)
WRITE_FILE(F["description"], description)
WRITE_FILE(F["role"], role)
WRITE_FILE(F["comments"], comments)
WRITE_FILE(F["version"], 1)
return 1
// loads the savefile corresponding to the mob's ckey
// if silent=true, report incompatible savefiles
// returns 1 if loaded (or file was incompatible)
// returns 0 if savefile did not exist
/datum/paiCandidate/proc/savefile_load(mob/user, silent = TRUE)
if (IsGuestKey(user.key))
return 0
var/path = savefile_path(user)
if (!fexists(path))
return 0
var/savefile/F = new /savefile(path)
if(!F)
return //Not everyone has a pai savefile.
var/version = null
F["version"] >> version
if (isnull(version) || version != 1)
fdel(path)
if (!silent)
alert(user, "Your savefile was incompatible with this version and was deleted.")
return 0
F["name"] >> src.name
F["description"] >> src.description
F["role"] >> src.role
F["comments"] >> src.comments
return 1
File diff suppressed because it is too large Load Diff
+35 -35
View File
@@ -1,35 +1,35 @@
/mob/living/silicon/robot/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-r")
/mob/living/silicon/robot/dust(just_ash, drop_items, force)
if(mmi)
qdel(mmi)
..()
/mob/living/silicon/robot/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
/mob/living/silicon/robot/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-r")
/mob/living/silicon/robot/death(gibbed)
if(stat == DEAD)
return
. = ..()
locked = FALSE //unlock cover
update_canmove()
if(!QDELETED(builtInCamera) && builtInCamera.status)
builtInCamera.toggle_cam(src,0)
update_headlamp(1) //So borg lights are disabled when killed.
uneq_all() // particularly to ensure sight modes are cleared
update_icons()
unbuckle_all_mobs(TRUE)
SSblackbox.ReportDeath(src)
/mob/living/silicon/robot/gib_animation()
new /obj/effect/temp_visual/gib_animation(loc, "gibbed-r")
/mob/living/silicon/robot/dust(just_ash, drop_items, force)
if(mmi)
qdel(mmi)
..()
/mob/living/silicon/robot/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
/mob/living/silicon/robot/dust_animation()
new /obj/effect/temp_visual/dust_animation(loc, "dust-r")
/mob/living/silicon/robot/death(gibbed)
if(stat == DEAD)
return
. = ..()
locked = FALSE //unlock cover
update_canmove()
if(!QDELETED(builtInCamera) && builtInCamera.status)
builtInCamera.toggle_cam(src,0)
update_headlamp(1) //So borg lights are disabled when killed.
uneq_all() // particularly to ensure sight modes are cleared
update_icons()
unbuckle_all_mobs(TRUE)
SSblackbox.ReportDeath(src)

Some files were not shown because too many files have changed in this diff Show More