Alter playsound paradigm

This commit is contained in:
Aronai Sieyes
2020-05-19 11:06:28 -04:00
parent 7d5042cacd
commit ad75bb86bd
347 changed files with 1541 additions and 1543 deletions
+1 -1
View File
@@ -40,7 +40,7 @@
if(emagged)
projectile = /obj/item/projectile/beam/shock
playsound(loc, emagged ? 'sound/weapons/laser3.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
playsound(src, emagged ? 'sound/weapons/laser3.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
var/obj/item/projectile/P = new projectile(loc)
P.firer = src
+2 -2
View File
@@ -22,7 +22,7 @@
/mob/living/bot/cleanbot/handleIdle()
if(!screwloose && !oddbutton && prob(2))
custom_emote(2, "makes an excited booping sound!")
playsound(src.loc, 'sound/machines/synth_yes.ogg', 50, 0)
playsound(src, 'sound/machines/synth_yes.ogg', 50, 0)
if(screwloose && prob(5)) // Make a mess
if(istype(loc, /turf/simulated))
@@ -179,7 +179,7 @@
if(!screwloose || !oddbutton)
if(user)
to_chat(user, "<span class='notice'>The [src] buzzes and beeps.</span>")
playsound(src.loc, 'sound/machines/buzzbeep.ogg', 50, 0)
playsound(src, 'sound/machines/buzzbeep.ogg', 50, 0)
oddbutton = 1
screwloose = 1
return 1
+1 -1
View File
@@ -65,7 +65,7 @@
if(emagged)
projectile = /obj/item/projectile/beam
playsound(loc, emagged ? 'sound/weapons/Laser.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
playsound(src, emagged ? 'sound/weapons/Laser.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
var/obj/item/projectile/P = new projectile(loc)
P.firer = src
+2 -2
View File
@@ -27,7 +27,7 @@
/mob/living/bot/cleanbot/edCLN/handleIdle()
if(prob(10))
custom_emote(2, "makes a less than thrilled beeping sound.")
playsound(src.loc, 'sound/machines/synth_yes.ogg', 50, 0)
playsound(src, 'sound/machines/synth_yes.ogg', 50, 0)
if(red_switch && !blue_switch && !green_switch && prob(10) || src.emagged)
if(istype(loc, /turf/simulated))
@@ -124,7 +124,7 @@
if(!emagged)
if(user)
to_chat(user, "<span class='notice'>The [src] buzzes and beeps.</span>")
playsound(src.loc, 'sound/machines/buzzbeep.ogg', 50, 0)
playsound(src, 'sound/machines/buzzbeep.ogg', 50, 0)
emagged = 1
return 1
+2 -2
View File
@@ -180,7 +180,7 @@
busy = 1
if(do_after(src, 30, A))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
visible_message("<span class='notice'>[src] waters \the [A].</span>")
tank.reagents.trans_to(T, 100 - T.waterlevel)
if(FARMBOT_UPROOT)
@@ -218,7 +218,7 @@
while(do_after(src, 10) && tank.reagents.total_volume < tank.reagents.maximum_volume)
tank.reagents.add_reagent("water", 10)
if(prob(5))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
busy = 0
action = ""
+3 -3
View File
@@ -58,7 +58,7 @@
emagged = 1
if(user)
to_chat(user, "<span class='notice'>The [src] buzzes and beeps.</span>")
playsound(src.loc, 'sound/machines/buzzbeep.ogg', 50, 0)
playsound(src, 'sound/machines/buzzbeep.ogg', 50, 0)
return 1
/mob/living/bot/floorbot/Topic(href, href_list)
@@ -102,7 +102,7 @@
if(prob(1))
custom_emote(2, "makes an excited beeping sound!")
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
playsound(src, 'sound/machines/twobeep.ogg', 50, 0)
/mob/living/bot/floorbot/handleAdjacentTarget()
if(get_turf(target) == src.loc)
@@ -278,7 +278,7 @@
/mob/living/bot/floorbot/explode()
turn_off()
visible_message("<span class='danger'>\The [src] blows apart!</span>")
playsound(src.loc, "sparks", 50, 1)
playsound(src, "sparks", 50, 1)
var/turf/Tsec = get_turf(src)
var/obj/item/weapon/storage/toolbox/mechanical/N = new /obj/item/weapon/storage/toolbox/mechanical(Tsec)
+5 -5
View File
@@ -44,7 +44,7 @@
)
var/message = pick(message_options)
say(message)
playsound(loc, message_options[message], 50, 0)
playsound(src, message_options[message], 50, 0)
/mob/living/bot/medbot/handleAdjacentTarget()
UnarmedAttack(target)
@@ -88,7 +88,7 @@
)
var/message = pick(message_options)
say(message)
playsound(loc, message_options[message], 50, 0)
playsound(src, message_options[message], 50, 0)
custom_emote(1, "points at [H.name].")
last_newpatient_speak = world.time
break
@@ -133,7 +133,7 @@
)
var/message = pick(death_messages)
say(message)
playsound(loc, death_messages[message], 50, 0)
playsound(src, death_messages[message], 50, 0)
// This is down here for the same reason as above.
else
@@ -148,7 +148,7 @@
)
var/message = pick(possible_messages)
say(message)
playsound(loc, possible_messages[message], 50, 0)
playsound(src, possible_messages[message], 50, 0)
busy = 0
update_icons()
@@ -293,7 +293,7 @@
reagent_glass = null
if(emagged && prob(25))
playsound(loc, 'sound/voice/medbot/minsult.ogg', 50, 0)
playsound(src, 'sound/voice/medbot/minsult.ogg', 50, 0)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
+5 -5
View File
@@ -183,7 +183,7 @@
locked = !locked
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the mulebot's controls!</span>")
flick("mulebot-emagged", src)
playsound(loc, 'sound/effects/sparks1.ogg', 100, 0)
playsound(src, 'sound/effects/sparks1.ogg', 100, 0)
return 1
/mob/living/bot/mulebot/update_icons()
@@ -202,13 +202,13 @@
/mob/living/bot/mulebot/handleFrustrated()
custom_emote(2, "makes a sighing buzz.")
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0)
..()
/mob/living/bot/mulebot/handleAdjacentTarget()
if(target == src.loc)
custom_emote(2, "makes a chiming sound.")
playsound(loc, 'sound/machines/chime.ogg', 50, 0)
playsound(src, 'sound/machines/chime.ogg', 50, 0)
UnarmedAttack(target)
resetTarget()
if(auto_return && home && (loc != home))
@@ -244,7 +244,7 @@
/mob/living/bot/mulebot/proc/runOver(var/mob/living/carbon/human/H)
if(istype(H)) // No safety checks - WILL run over lying humans. Stop ERPing in the maint!
visible_message("<span class='warning'>[src] drives over [H]!</span>")
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
playsound(src, 'sound/effects/splat.ogg', 50, 1)
var/damage = rand(5, 7)
H.apply_damage(2 * damage, BRUTE, BP_HEAD)
@@ -298,7 +298,7 @@
if(crates_only && !istype(C,/obj/structure/closet/crate))
custom_emote(2, "makes a sighing buzz.")
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0)
return
var/obj/structure/closet/crate/crate = C
+8 -8
View File
@@ -158,7 +158,7 @@
return
if(!target)
playsound(src.loc, pick(threat_found_sounds), 50)
playsound(src, pick(threat_found_sounds), 50)
global_announcer.autosay("[src] was attacked by a hostile <b>[target_name(attacker)]</b> in <b>[get_area(src)]</b>.", "[src]", "Security")
target = attacker
attacked = TRUE
@@ -169,7 +169,7 @@
if(declare_arrests)
global_announcer.autosay("[src] is [arrest_type ? "detaining" : "arresting"] a level [threat] suspect <b>[suspect_name]</b> in <b>[get_area(src)]</b>.", "[src]", "Security")
say("Down on the floor, [suspect_name]! You have [SECBOT_WAIT_TIME*2] seconds to comply.")
playsound(src.loc, pick(preparing_arrest_sounds), 50)
playsound(src, pick(preparing_arrest_sounds), 50)
// Register to be told when the target moves
GLOB.moved_event.register(target, src, /mob/living/bot/secbot/proc/target_moved)
@@ -207,7 +207,7 @@
awaiting_surrender = 0
say("Level [threat] infraction alert!")
custom_emote(1, "points at [M.name]!")
playsound(src.loc, pick(threat_found_sounds), 50)
playsound(src, pick(threat_found_sounds), 50)
return
/mob/living/bot/secbot/handleAdjacentTarget()
@@ -256,10 +256,10 @@
if(can_next_insult > world.time)
return
if(threat >= 10)
playsound(src.loc, 'sound/voice/binsult.ogg', 75)
playsound(src, 'sound/voice/binsult.ogg', 75)
can_next_insult = world.time + 20 SECONDS
else
playsound(src.loc, pick(fighting_sounds), 75)
playsound(src, pick(fighting_sounds), 75)
can_next_insult = world.time + 5 SECONDS
@@ -278,7 +278,7 @@
cuff = FALSE
if(!cuff)
H.stun_effect_act(0, stun_strength, null)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/Egloves.ogg', 50, 1, -1)
do_attack_animation(H)
busy = TRUE
update_icons()
@@ -288,7 +288,7 @@
visible_message("<span class='warning'>\The [H] was prodded by \the [src] with a stun baton!</span>")
insult(H)
else
playsound(loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
playsound(src, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
visible_message("<span class='warning'>\The [src] is trying to put handcuffs on \the [H]!</span>")
busy = TRUE
if(do_mob(src, H, 60))
@@ -303,7 +303,7 @@
var/mob/living/L = M
L.adjustBruteLoss(xeno_harm_strength)
do_attack_animation(M)
playsound(loc, "swing_hit", 50, 1, -1)
playsound(src, "swing_hit", 50, 1, -1)
busy = TRUE
update_icons()
spawn(2)
@@ -25,7 +25,7 @@
LAssailant = M
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("<font color='red'>[] has grabbed [] passively!</font>", M, src), 1)
@@ -40,7 +40,7 @@
step_away(src,M,15)
sleep(3)
step_away(src,M,15)
playsound(loc, "punch", 25, 1, -1)
playsound(src, "punch", 25, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("<font color='red'><B>[] has punched []!</B></font>", M, src), 1)
@@ -52,7 +52,7 @@
adjustBruteLoss(damage)
updatehealth()
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("<font color='red'><B>[] has attempted to punch []!</B></font>", M, src), 1)
@@ -98,7 +98,7 @@
m_type = 2
if("chirp")
message = "<B>[src]</B> chirps!"
playsound(loc, 'sound/misc/nymphchirp.ogg', 50, 0)
playsound(src, 'sound/misc/nymphchirp.ogg', 50, 0)
m_type = 2
if("help")
to_chat(src, "<span class='filter_say'>burp, chirp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roll, scratch,\nscretch, shake, sign-#, sulk, sway, tail, twitch, whimper</span>")
+402 -402
View File
@@ -1,403 +1,403 @@
/mob/living/carbon/Initialize()
. = ..()
//setup reagent holders
bloodstr = new/datum/reagents/metabolism/bloodstream(500, src)
ingested = new/datum/reagents/metabolism/ingested(500, src)
touching = new/datum/reagents/metabolism/touch(500, src)
reagents = bloodstr
if (!default_language && species_language)
default_language = GLOB.all_languages[species_language]
/mob/living/carbon/Life()
..()
handle_viruses()
// Increase germ_level regularly
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
germ_level++
/mob/living/carbon/Destroy()
qdel(ingested)
qdel(touching)
// We don't qdel(bloodstr) because it's the same as qdel(reagents)
for(var/guts in internal_organs)
qdel(guts)
for(var/food in stomach_contents)
qdel(food)
return ..()
/mob/living/carbon/rejuvenate()
bloodstr.clear_reagents()
ingested.clear_reagents()
touching.clear_reagents()
..()
/mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
if(src.nutrition && src.stat != 2)
adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10)
if(src.m_intent == "run")
adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10)
if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360)
src.bodytemperature += 2
// Moving around increases germ_level faster
if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
germ_level++
/mob/living/carbon/relaymove(var/mob/living/user, direction)
if((user in src.stomach_contents) && istype(user))
if(user.last_special <= world.time)
user.last_special = world.time + 50
src.visible_message("<span class='danger'>You hear something rumbling inside [src]'s stomach...</span>")
var/obj/item/I = user.get_active_hand()
if(I && I.force)
var/d = rand(round(I.force / 4), I.force)
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/organ = H.get_organ(BP_TORSO)
if (istype(organ))
if(organ.take_damage(d, 0))
H.UpdateDamageIcon()
H.updatehealth()
else
src.take_organ_damage(d)
user.visible_message("<span class='danger'>[user] attacks [src]'s stomach wall with the [I.name]!</span>")
playsound(user.loc, 'sound/effects/attackblob.ogg', 50, 1)
if(prob(src.getBruteLoss() - 50))
for(var/atom/movable/A in stomach_contents)
A.loc = loc
stomach_contents.Remove(A)
src.gib()
/mob/living/carbon/gib()
for(var/mob/M in src)
if(M in src.stomach_contents)
src.stomach_contents.Remove(M)
M.loc = src.loc
for(var/mob/N in viewers(src, null))
if(N.client)
N.show_message(text("<font color='red'><B>[M] bursts out of [src]!</B></font>"), 2)
..()
/mob/living/carbon/attack_hand(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
to_chat(H, "<font color='red'>You can't use your [temp.name]</font>")
return
return
/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, var/stun = 1)
if(status_flags & GODMODE) return 0 //godmode
if(def_zone == "l_hand" || def_zone == "r_hand") //Diona (And any other potential plant people) hands don't get shocked.
if(species.flags & IS_PLANT)
return 0
shock_damage *= siemens_coeff
if (shock_damage<1)
return 0
src.apply_damage(0.2 * shock_damage, BURN, def_zone, used_weapon="Electrocution") //shock the target organ
src.apply_damage(0.4 * shock_damage, BURN, BP_TORSO, used_weapon="Electrocution") //shock the torso more
src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part!
src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part!
playsound(loc, "sparks", 50, 1, -1)
if (shock_damage > 15)
src.visible_message(
"<span class='warning'>[src] was electrocuted[source ? " by the [source]" : ""]!</span>", \
"<span class='danger'>You feel a powerful shock course through your body!</span>", \
"<span class='warning'>You hear a heavy electrical crack.</span>" \
)
else
src.visible_message(
"<span class='warning'>[src] was shocked[source ? " by the [source]" : ""].</span>", \
"<span class='warning'>You feel a shock course through your body.</span>", \
"<span class='warning'>You hear a zapping sound.</span>" \
)
if(stun)
switch(shock_damage)
if(16 to 20)
Stun(2)
if(21 to 25)
Weaken(2)
if(26 to 30)
Weaken(5)
if(31 to INFINITY)
Weaken(10) //This should work for now, more is really silly and makes you lay there forever
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, loc)
s.start()
return shock_damage
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
if (src.health >= config.health_threshold_crit)
if(src == M && istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/datum/gender/T = gender_datums[H.get_visible_gender()]
src.visible_message( \
"<span class='notice'>[src] examines [T.himself].</span>", \
"<span class='notice'>You check yourself for injuries.</span>" \
)
for(var/obj/item/organ/external/org in H.organs)
var/list/status = list()
var/brutedamage = org.brute_dam
var/burndamage = org.burn_dam
/*
if(halloss > 0) //Makes halloss show up as actual wounds on self examine.
if(prob(30))
brutedamage += halloss
if(prob(30))
burndamage += halloss
*/
switch(brutedamage)
if(1 to 20)
status += "bruised"
if(20 to 40)
status += "wounded"
if(40 to INFINITY)
status += "mangled"
switch(burndamage)
if(1 to 10)
status += "numb"
if(10 to 40)
status += "blistered"
if(40 to INFINITY)
status += "peeling away"
if(org.is_stump())
status += "MISSING"
if(org.status & ORGAN_MUTATED)
status += "weirdly shapen"
if(org.dislocated == 2)
status += "dislocated"
if(org.status & ORGAN_BROKEN)
status += "hurts when touched"
if(org.status & ORGAN_DEAD)
status += "is bruised and necrotic"
if(!org.is_usable() || org.is_dislocated())
status += "dangling uselessly"
if(status.len)
src.show_message("My [org.name] is <span class='warning'> [english_list(status)].</span>",1)
else
src.show_message("My [org.name] is <span class='notice'> OK.</span>",1)
if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit))
H.play_xylophone()
else if (on_fire)
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if (M.on_fire)
M.visible_message("<span class='warning'>[M] tries to pat out [src]'s flames, but to no avail!</span>",
"<span class='warning'>You try to pat out [src]'s flames, but to no avail! Put yourself out first!</span>")
else
M.visible_message("<span class='warning'>[M] tries to pat out [src]'s flames!</span>",
"<span class='warning'>You try to pat out [src]'s flames! Hot!</span>")
if(do_mob(M, src, 15))
src.adjust_fire_stacks(-0.5)
if (prob(10) && (M.fire_stacks <= 0))
M.adjust_fire_stacks(1)
M.IgniteMob()
if (M.on_fire)
M.visible_message("<span class='danger'>The fire spreads from [src] to [M]!</span>",
"<span class='danger'>The fire spreads to you as well!</span>")
else
src.adjust_fire_stacks(-0.5) //Less effective than stop, drop, and roll - also accounting for the fact that it takes half as long.
if (src.fire_stacks <= 0)
M.visible_message("<span class='warning'>[M] successfully pats out [src]'s flames.</span>",
"<span class='warning'>You successfully pat out [src]'s flames.</span>")
src.ExtinguishMob()
src.fire_stacks = 0
else
if (istype(src,/mob/living/carbon/human) && src:w_uniform)
var/mob/living/carbon/human/H = src
H.w_uniform.add_fingerprint(M)
var/show_ssd
var/mob/living/carbon/human/H = src
var/datum/gender/T = gender_datums[H.get_visible_gender()] // make sure to cast to human before using get_gender() or get_visible_gender()!
if(istype(H)) show_ssd = H.species.show_ssd
if(show_ssd && !client && !teleop)
M.visible_message("<span class='notice'>[M] shakes [src] trying to wake [T.him] up!</span>", \
"<span class='notice'>You shake [src], but [T.he] [T.does] not respond... Maybe [T.he] [T.has] S.S.D?</span>")
else if(lying || src.sleeping)
src.sleeping = max(0,src.sleeping-5)
if(src.sleeping == 0)
src.resting = 0
M.visible_message("<span class='notice'>[M] shakes [src] trying to wake [T.him] up!</span>", \
"<span class='notice'>You shake [src] trying to wake [T.him] up!</span>")
else
var/mob/living/carbon/human/hugger = M
var/datum/gender/TM = gender_datums[M.get_visible_gender()]
if(M.resting == 1) //Are they resting on the ground?
M.visible_message("<span class='notice'>[M] grabs onto [src] and pulls [TM.himself] up</span>", \
"<span class='notice'>You grip onto [src] and pull yourself up off the ground!</span>")
if(M.fire_stacks >= (src.fire_stacks + 3)) //Fire checks.
src.adjust_fire_stacks(1)
M.adjust_fire_stacks(-1)
if(M.on_fire)
src.IgniteMob()
if(do_after(M, 0.5 SECONDS)) //.5 second delay. Makes it a bit stronger than just typing rest.
M.resting = 0 //Hoist yourself up up off the ground. No para/stunned/weakened removal.
else if(istype(hugger))
hugger.species.hug(hugger,src)
else
M.visible_message("<span class='notice'>[M] hugs [src] to make [T.him] feel better!</span>", \
"<span class='notice'>You hug [src] to make [T.him] feel better!</span>")
if(M.fire_stacks >= (src.fire_stacks + 3))
src.adjust_fire_stacks(1)
M.adjust_fire_stacks(-1)
if(M.on_fire)
src.IgniteMob()
AdjustParalysis(-3)
AdjustStunned(-3)
AdjustWeakened(-3)
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
/mob/living/carbon/proc/eyecheck()
return 0
/mob/living/carbon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
if(eyecheck() < intensity || override_blindness_check)
return ..()
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
// Stop! ... Hammertime! ~Carn
/mob/living/carbon/proc/getDNA()
return dna
/mob/living/carbon/proc/setDNA(var/datum/dna/newDNA)
dna = newDNA
// ++++ROCKDTBEN++++ MOB PROCS //END
/mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
var/temp_inc = max(min(BODYTEMP_HEATING_MAX*(1-get_heat_protection()), exposed_temperature - bodytemperature), 0)
bodytemperature += temp_inc
/mob/living/carbon/can_use_hands()
if(handcuffed)
return 0
if(buckled && istype(buckled, /obj/structure/bed/nest)) // buckling does not restrict hands
return 0
return 1
/mob/living/carbon/restrained()
if (handcuffed)
return 1
return
/mob/living/carbon/u_equip(obj/item/W as obj)
if(!W) return 0
else if (W == handcuffed)
handcuffed = null
update_inv_handcuffed()
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
else if (W == legcuffed)
legcuffed = null
update_inv_legcuffed()
else
..()
return
//generates realistic-ish pulse output based on preset levels
/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate
var/temp = 0 //see setup.dm:694
switch(src.pulse)
if(PULSE_NONE)
return "0"
if(PULSE_SLOW)
temp = rand(40, 60)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_NORM)
temp = rand(60, 90)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_FAST)
temp = rand(90, 120)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_2FAST)
temp = rand(120, 160)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_THREADY)
return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread"
// output for machines^ ^^^^^^^output for people^^^^^^^^^
/mob/living/carbon/verb/mob_sleep()
set name = "Sleep"
set category = "IC"
if(usr.sleeping)
to_chat(usr, "<font color='red'>You are already sleeping</font>")
return
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
usr.sleeping = 20 //Short nap
/mob/living/carbon/Bump(atom/A)
if(now_pushing)
return
..()
if(istype(A, /mob/living/carbon) && prob(10))
spread_disease_to(A, "Contact")
/mob/living/carbon/cannot_use_vents()
return
/mob/living/carbon/slip(var/slipped_on,stun_duration=8)
if(buckled)
return 0
stop_pulling()
to_chat(src, "<span class='warning'>You slipped on [slipped_on]!</span>")
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
Weaken(FLOOR(stun_duration/2, 1))
return 1
/mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1)
if(effect in chem_effects)
chem_effects[effect] += magnitude
else
chem_effects[effect] = magnitude
/mob/living/carbon/get_default_language()
if(default_language)
if(can_speak(default_language))
return default_language
else
return GLOB.all_languages[LANGUAGE_GIBBERISH]
if(!species)
return null
return species.default_language ? GLOB.all_languages[species.default_language] : null
/mob/living/carbon/proc/should_have_organ(var/organ_check)
return 0
/mob/living/carbon/can_feel_pain(var/check_organ)
if(isSynthetic())
return 0
return !(species.flags & NO_PAIN)
/mob/living/carbon/needs_to_breathe()
if(does_not_breathe)
return FALSE
return ..()
/mob/living/carbon/Initialize()
. = ..()
//setup reagent holders
bloodstr = new/datum/reagents/metabolism/bloodstream(500, src)
ingested = new/datum/reagents/metabolism/ingested(500, src)
touching = new/datum/reagents/metabolism/touch(500, src)
reagents = bloodstr
if (!default_language && species_language)
default_language = GLOB.all_languages[species_language]
/mob/living/carbon/Life()
..()
handle_viruses()
// Increase germ_level regularly
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
germ_level++
/mob/living/carbon/Destroy()
qdel(ingested)
qdel(touching)
// We don't qdel(bloodstr) because it's the same as qdel(reagents)
for(var/guts in internal_organs)
qdel(guts)
for(var/food in stomach_contents)
qdel(food)
return ..()
/mob/living/carbon/rejuvenate()
bloodstr.clear_reagents()
ingested.clear_reagents()
touching.clear_reagents()
..()
/mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
if(src.nutrition && src.stat != 2)
adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10)
if(src.m_intent == "run")
adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10)
if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360)
src.bodytemperature += 2
// Moving around increases germ_level faster
if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
germ_level++
/mob/living/carbon/relaymove(var/mob/living/user, direction)
if((user in src.stomach_contents) && istype(user))
if(user.last_special <= world.time)
user.last_special = world.time + 50
src.visible_message("<span class='danger'>You hear something rumbling inside [src]'s stomach...</span>")
var/obj/item/I = user.get_active_hand()
if(I && I.force)
var/d = rand(round(I.force / 4), I.force)
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/organ = H.get_organ(BP_TORSO)
if (istype(organ))
if(organ.take_damage(d, 0))
H.UpdateDamageIcon()
H.updatehealth()
else
src.take_organ_damage(d)
user.visible_message("<span class='danger'>[user] attacks [src]'s stomach wall with the [I.name]!</span>")
playsound(user, 'sound/effects/attackblob.ogg', 50, 1)
if(prob(src.getBruteLoss() - 50))
for(var/atom/movable/A in stomach_contents)
A.loc = loc
stomach_contents.Remove(A)
src.gib()
/mob/living/carbon/gib()
for(var/mob/M in src)
if(M in src.stomach_contents)
src.stomach_contents.Remove(M)
M.loc = src.loc
for(var/mob/N in viewers(src, null))
if(N.client)
N.show_message(text("<font color='red'><B>[M] bursts out of [src]!</B></font>"), 2)
..()
/mob/living/carbon/attack_hand(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
to_chat(H, "<font color='red'>You can't use your [temp.name]</font>")
return
return
/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, var/stun = 1)
if(status_flags & GODMODE) return 0 //godmode
if(def_zone == "l_hand" || def_zone == "r_hand") //Diona (And any other potential plant people) hands don't get shocked.
if(species.flags & IS_PLANT)
return 0
shock_damage *= siemens_coeff
if (shock_damage<1)
return 0
src.apply_damage(0.2 * shock_damage, BURN, def_zone, used_weapon="Electrocution") //shock the target organ
src.apply_damage(0.4 * shock_damage, BURN, BP_TORSO, used_weapon="Electrocution") //shock the torso more
src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part!
src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part!
playsound(src, "sparks", 50, 1, -1)
if (shock_damage > 15)
src.visible_message(
"<span class='warning'>[src] was electrocuted[source ? " by the [source]" : ""]!</span>", \
"<span class='danger'>You feel a powerful shock course through your body!</span>", \
"<span class='warning'>You hear a heavy electrical crack.</span>" \
)
else
src.visible_message(
"<span class='warning'>[src] was shocked[source ? " by the [source]" : ""].</span>", \
"<span class='warning'>You feel a shock course through your body.</span>", \
"<span class='warning'>You hear a zapping sound.</span>" \
)
if(stun)
switch(shock_damage)
if(16 to 20)
Stun(2)
if(21 to 25)
Weaken(2)
if(26 to 30)
Weaken(5)
if(31 to INFINITY)
Weaken(10) //This should work for now, more is really silly and makes you lay there forever
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, loc)
s.start()
return shock_damage
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
if (src.health >= config.health_threshold_crit)
if(src == M && istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/datum/gender/T = gender_datums[H.get_visible_gender()]
src.visible_message( \
"<span class='notice'>[src] examines [T.himself].</span>", \
"<span class='notice'>You check yourself for injuries.</span>" \
)
for(var/obj/item/organ/external/org in H.organs)
var/list/status = list()
var/brutedamage = org.brute_dam
var/burndamage = org.burn_dam
/*
if(halloss > 0) //Makes halloss show up as actual wounds on self examine.
if(prob(30))
brutedamage += halloss
if(prob(30))
burndamage += halloss
*/
switch(brutedamage)
if(1 to 20)
status += "bruised"
if(20 to 40)
status += "wounded"
if(40 to INFINITY)
status += "mangled"
switch(burndamage)
if(1 to 10)
status += "numb"
if(10 to 40)
status += "blistered"
if(40 to INFINITY)
status += "peeling away"
if(org.is_stump())
status += "MISSING"
if(org.status & ORGAN_MUTATED)
status += "weirdly shapen"
if(org.dislocated == 2)
status += "dislocated"
if(org.status & ORGAN_BROKEN)
status += "hurts when touched"
if(org.status & ORGAN_DEAD)
status += "is bruised and necrotic"
if(!org.is_usable() || org.is_dislocated())
status += "dangling uselessly"
if(status.len)
src.show_message("My [org.name] is <span class='warning'> [english_list(status)].</span>",1)
else
src.show_message("My [org.name] is <span class='notice'> OK.</span>",1)
if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit))
H.play_xylophone()
else if (on_fire)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if (M.on_fire)
M.visible_message("<span class='warning'>[M] tries to pat out [src]'s flames, but to no avail!</span>",
"<span class='warning'>You try to pat out [src]'s flames, but to no avail! Put yourself out first!</span>")
else
M.visible_message("<span class='warning'>[M] tries to pat out [src]'s flames!</span>",
"<span class='warning'>You try to pat out [src]'s flames! Hot!</span>")
if(do_mob(M, src, 15))
src.adjust_fire_stacks(-0.5)
if (prob(10) && (M.fire_stacks <= 0))
M.adjust_fire_stacks(1)
M.IgniteMob()
if (M.on_fire)
M.visible_message("<span class='danger'>The fire spreads from [src] to [M]!</span>",
"<span class='danger'>The fire spreads to you as well!</span>")
else
src.adjust_fire_stacks(-0.5) //Less effective than stop, drop, and roll - also accounting for the fact that it takes half as long.
if (src.fire_stacks <= 0)
M.visible_message("<span class='warning'>[M] successfully pats out [src]'s flames.</span>",
"<span class='warning'>You successfully pat out [src]'s flames.</span>")
src.ExtinguishMob()
src.fire_stacks = 0
else
if (istype(src,/mob/living/carbon/human) && src:w_uniform)
var/mob/living/carbon/human/H = src
H.w_uniform.add_fingerprint(M)
var/show_ssd
var/mob/living/carbon/human/H = src
var/datum/gender/T = gender_datums[H.get_visible_gender()] // make sure to cast to human before using get_gender() or get_visible_gender()!
if(istype(H)) show_ssd = H.species.show_ssd
if(show_ssd && !client && !teleop)
M.visible_message("<span class='notice'>[M] shakes [src] trying to wake [T.him] up!</span>", \
"<span class='notice'>You shake [src], but [T.he] [T.does] not respond... Maybe [T.he] [T.has] S.S.D?</span>")
else if(lying || src.sleeping)
src.sleeping = max(0,src.sleeping-5)
if(src.sleeping == 0)
src.resting = 0
M.visible_message("<span class='notice'>[M] shakes [src] trying to wake [T.him] up!</span>", \
"<span class='notice'>You shake [src] trying to wake [T.him] up!</span>")
else
var/mob/living/carbon/human/hugger = M
var/datum/gender/TM = gender_datums[M.get_visible_gender()]
if(M.resting == 1) //Are they resting on the ground?
M.visible_message("<span class='notice'>[M] grabs onto [src] and pulls [TM.himself] up</span>", \
"<span class='notice'>You grip onto [src] and pull yourself up off the ground!</span>")
if(M.fire_stacks >= (src.fire_stacks + 3)) //Fire checks.
src.adjust_fire_stacks(1)
M.adjust_fire_stacks(-1)
if(M.on_fire)
src.IgniteMob()
if(do_after(M, 0.5 SECONDS)) //.5 second delay. Makes it a bit stronger than just typing rest.
M.resting = 0 //Hoist yourself up up off the ground. No para/stunned/weakened removal.
else if(istype(hugger))
hugger.species.hug(hugger,src)
else
M.visible_message("<span class='notice'>[M] hugs [src] to make [T.him] feel better!</span>", \
"<span class='notice'>You hug [src] to make [T.him] feel better!</span>")
if(M.fire_stacks >= (src.fire_stacks + 3))
src.adjust_fire_stacks(1)
M.adjust_fire_stacks(-1)
if(M.on_fire)
src.IgniteMob()
AdjustParalysis(-3)
AdjustStunned(-3)
AdjustWeakened(-3)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
/mob/living/carbon/proc/eyecheck()
return 0
/mob/living/carbon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
if(eyecheck() < intensity || override_blindness_check)
return ..()
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
// Stop! ... Hammertime! ~Carn
/mob/living/carbon/proc/getDNA()
return dna
/mob/living/carbon/proc/setDNA(var/datum/dna/newDNA)
dna = newDNA
// ++++ROCKDTBEN++++ MOB PROCS //END
/mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
var/temp_inc = max(min(BODYTEMP_HEATING_MAX*(1-get_heat_protection()), exposed_temperature - bodytemperature), 0)
bodytemperature += temp_inc
/mob/living/carbon/can_use_hands()
if(handcuffed)
return 0
if(buckled && istype(buckled, /obj/structure/bed/nest)) // buckling does not restrict hands
return 0
return 1
/mob/living/carbon/restrained()
if (handcuffed)
return 1
return
/mob/living/carbon/u_equip(obj/item/W as obj)
if(!W) return 0
else if (W == handcuffed)
handcuffed = null
update_inv_handcuffed()
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
else if (W == legcuffed)
legcuffed = null
update_inv_legcuffed()
else
..()
return
//generates realistic-ish pulse output based on preset levels
/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate
var/temp = 0 //see setup.dm:694
switch(src.pulse)
if(PULSE_NONE)
return "0"
if(PULSE_SLOW)
temp = rand(40, 60)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_NORM)
temp = rand(60, 90)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_FAST)
temp = rand(90, 120)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_2FAST)
temp = rand(120, 160)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_THREADY)
return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread"
// output for machines^ ^^^^^^^output for people^^^^^^^^^
/mob/living/carbon/verb/mob_sleep()
set name = "Sleep"
set category = "IC"
if(usr.sleeping)
to_chat(usr, "<font color='red'>You are already sleeping</font>")
return
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
usr.sleeping = 20 //Short nap
/mob/living/carbon/Bump(atom/A)
if(now_pushing)
return
..()
if(istype(A, /mob/living/carbon) && prob(10))
spread_disease_to(A, "Contact")
/mob/living/carbon/cannot_use_vents()
return
/mob/living/carbon/slip(var/slipped_on,stun_duration=8)
if(buckled)
return 0
stop_pulling()
to_chat(src, "<span class='warning'>You slipped on [slipped_on]!</span>")
playsound(src, 'sound/misc/slip.ogg', 50, 1, -3)
Weaken(FLOOR(stun_duration/2, 1))
return 1
/mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1)
if(effect in chem_effects)
chem_effects[effect] += magnitude
else
chem_effects[effect] = magnitude
/mob/living/carbon/get_default_language()
if(default_language)
if(can_speak(default_language))
return default_language
else
return GLOB.all_languages[LANGUAGE_GIBBERISH]
if(!species)
return null
return species.default_language ? GLOB.all_languages[species.default_language] : null
/mob/living/carbon/proc/should_have_organ(var/organ_check)
return 0
/mob/living/carbon/can_feel_pain(var/check_organ)
if(isSynthetic())
return 0
return !(species.flags & NO_PAIN)
/mob/living/carbon/needs_to_breathe()
if(does_not_breathe)
return FALSE
return ..()
@@ -92,7 +92,7 @@
user.visible_message("<span class='danger'>\The [user] cut [src]'s neck with \the [W]!</span>")
if(W.hitsound)
playsound(loc, W.hitsound, 50, 1, -1)
playsound(src, W.hitsound, 50, 1, -1)
G.last_action = world.time
flick(G.hud.icon_state, G.hud)
@@ -112,7 +112,7 @@
apply_damage(damage, W.damtype, "torso", 0, sharp=W.sharp, edge=W.edge)
if(W.hitsound)
playsound(loc, W.hitsound, 50, 1, -1)
playsound(src, W.hitsound, 50, 1, -1)
add_attack_logs(user,src,"Knifed (shanked)")
@@ -87,7 +87,7 @@
to_chat(O, "<span class='deadsay'><b>[src]</b> has died in <b>[get_area(src)]</b>. [ghost_follow_link(src, O)] </span>")
if(!gibbed && species.death_sound)
playsound(loc, species.death_sound, 80, 1, 1)
playsound(src, species.death_sound, 80, 1, 1)
if(ticker && ticker.mode)
sql_report_death(src)
+13 -13
View File
@@ -75,7 +75,7 @@
message = "[display_msg] at [param]."
else
message = "[display_msg]."
playsound(src.loc, use_sound, 50, 0)
playsound(src, use_sound, 50, 0)
m_type = 1
//Promethean-only emotes
@@ -84,7 +84,7 @@
to_chat(src, "<span class='warning'>You are not a slime thing!</span>")
return
playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound.
playsound(src, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound.
message = "squishes."
m_type = 1
@@ -94,7 +94,7 @@
to_chat(src, "<span class='warning'>You are not a Skrell!</span>")
return
playsound(src.loc, 'sound/effects/warble.ogg', 50, 0) // Copyright CC BY 3.0 alienistcog (freesound.org) for the sound.
playsound(src, 'sound/effects/warble.ogg', 50, 0) // Copyright CC BY 3.0 alienistcog (freesound.org) for the sound.
message = "warbles."
m_type = 2
@@ -186,7 +186,7 @@
if("clap")
if(!src.restrained())
message = "claps."
playsound(src.loc, 'sound/misc/clapping.ogg')
playsound(src, 'sound/misc/clapping.ogg')
m_type = 2
if(miming)
m_type = 1
@@ -267,7 +267,7 @@
use_sound = pick('sound/effects/mob_effects/f_machine_cougha.ogg','sound/effects/mob_effects/f_machine_coughb.ogg')
else
use_sound = pick('sound/effects/mob_effects/m_machine_cougha.ogg','sound/effects/mob_effects/m_machine_coughb.ogg', 'sound/effects/mob_effects/m_machine_coughc.ogg')
playsound(src.loc, use_sound, 50, 0)
playsound(src, use_sound, 50, 0)
else
message = "makes a strong noise."
m_type = 2
@@ -540,7 +540,7 @@
use_sound = 'sound/effects/mob_effects/machine_sneeze.ogg'
else
use_sound = 'sound/effects/mob_effects/f_machine_sneeze.ogg'
playsound(src.loc, use_sound, 50, 0)
playsound(src, use_sound, 50, 0)
else
message = "makes a strange noise."
m_type = 2
@@ -653,14 +653,14 @@
break
if(M)
message = "<span class='danger'>slaps [M] across the face. Ouch!</span>"
playsound(loc, 'sound/effects/snap.ogg', 50, 1)
playsound(src, 'sound/effects/snap.ogg', 50, 1)
if(ishuman(M)) //Snowflakey!
var/mob/living/carbon/human/H = M
if(istype(H.wear_mask,/obj/item/clothing/mask/smokable))
H.drop_from_inventory(H.wear_mask)
else
message = "<span class='danger'>slaps [T.himself]!</span>"
playsound(loc, 'sound/effects/snap.ogg', 50, 1)
playsound(src, 'sound/effects/snap.ogg', 50, 1)
if("scream", "screams")
if(miming)
@@ -672,9 +672,9 @@
m_type = 2
/* Removed, pending the location of some actually good, properly licensed sounds.
if(get_gender() == FEMALE)
playsound(loc, "[species.female_scream_sound]", 80, 1)
playsound(src, "[species.female_scream_sound]", 80, 1)
else
playsound(loc, "[species.male_scream_sound]", 80, 1) //default to male screams if no gender is present.
playsound(src, "[species.male_scream_sound]", 80, 1) //default to male screams if no gender is present.
*/
else
message = "makes a very loud noise."
@@ -697,7 +697,7 @@
return
message = "snaps [T.his] fingers."
playsound(loc, 'sound/effects/fingersnap.ogg', 50, 1, -3)
playsound(src, 'sound/effects/fingersnap.ogg', 50, 1, -3)
if("swish")
src.animate_tail_once()
@@ -721,14 +721,14 @@
if("whistle" || "whistles")
if(!muzzled)
message = "whistles a tune."
playsound(loc, 'sound/misc/longwhistle.ogg') //praying this doesn't get abused
playsound(src, 'sound/misc/longwhistle.ogg') //praying this doesn't get abused
else
message = "makes a light spitting noise, a poor attempt at a whistle."
if("qwhistle")
if(!muzzled)
message = "whistles quietly."
playsound(loc, 'sound/misc/shortwhistle.ogg')
playsound(src, 'sound/misc/shortwhistle.ogg')
else
message = "makes a light spitting noise, a poor attempt at a whistle."
@@ -747,7 +747,7 @@
var/datum/gender/T = gender_datums[get_visible_gender()]
visible_message("<font color='red'>\The [src] begins playing [T.his] ribcage like a xylophone. It's quite spooky.</font>","<font color='blue'>You begin to play a spooky refrain on your ribcage.</font>","<font color='red'>You hear a spooky xylophone melody.</font>")
var/song = pick('sound/effects/xylophone1.ogg','sound/effects/xylophone2.ogg','sound/effects/xylophone3.ogg')
playsound(loc, song, 50, 1, -1)
playsound(src, song, 50, 1, -1)
xylophone = 1
spawn(1200)
xylophone=0
@@ -38,7 +38,7 @@
var/hit_zone = get_zone_with_miss_chance(H.zone_sel.selecting, src, H.get_accuracy_penalty())
if(!hit_zone)
H.do_attack_animation(src)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("<font color='red'><B>[H] reaches for [src], but misses!</B></font>")
return FALSE
@@ -111,7 +111,7 @@
LAssailant = M
H.do_attack_animation(src)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='warning'>[M] has grabbed [src][(M.zone_sel.selecting == "l_hand" || M.zone_sel.selecting == "r_hand")? " by their hands!":" passively!"]</span>")
return TRUE
@@ -220,7 +220,7 @@
else
H.visible_message("<span class='danger'>[attack_message]</span>")
playsound(loc, ((miss_type) ? (miss_type == 1 ? attack.miss_sound : 'sound/weapons/thudswoosh.ogg') : attack.attack_sound), 25, 1, -1)
playsound(src, ((miss_type) ? (miss_type == 1 ? attack.miss_sound : 'sound/weapons/thudswoosh.ogg') : attack.attack_sound), 25, 1, -1)
add_attack_logs(H,src,"Melee attacked with fists (miss/block)")
@@ -286,7 +286,7 @@
if((shoes || !(species.flags & NO_SLIP)) && randn <= 25)
var/armor_check = run_armor_check(affecting, "melee")
apply_effect(3, WEAKEN, armor_check)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(armor_check < 60)
visible_message("<span class='danger'>[M] has pushed [src]!</span>")
else
@@ -296,7 +296,7 @@
if(randn <= 60)
//See about breaking grips or pulls
if(break_all_grabs(M))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
//Actually disarm them
@@ -304,10 +304,10 @@
if(I)
drop_from_inventory(I)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>")
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("<font color='red'> <B>[M] attempted to disarm [src]!</B></font>")
return
@@ -227,7 +227,7 @@ emp_act
if(!hit_zone)
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("<span class='danger'>\The [user] misses [src] with \the [I]!</span>")
return null
@@ -72,7 +72,7 @@
else
failed = 1
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/pierce.ogg', 25, 1, -1)
if(failed)
src.Weaken(rand(2,4))
@@ -92,4 +92,4 @@
/datum/unarmed_attack/stomp/weak/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
var/obj/item/organ/external/affecting = target.get_organ(zone)
user.visible_message("<span class='warning'>[user] jumped up and down on \the [target]'s [affecting.name]!</span>")
playsound(user.loc, attack_sound, 25, 1, -1)
playsound(user, attack_sound, 25, 1, -1)
@@ -144,7 +144,7 @@
P.firer = src
P.old_style_target(A)
P.fire()
playsound(loc, 'sound/weapons/pierce.ogg', 25, 0)
playsound(src, 'sound/weapons/pierce.ogg', 25, 0)
else
..()
@@ -295,7 +295,7 @@
src.visible_message("<span class='danger'>\The [src] leaps at [T]!</span>")
src.throw_at(get_step(get_turf(T),get_turf(src)), 4, 1, src)
playsound(src.loc, 'sound/voice/hiss5.ogg', 50, 1)
playsound(src, 'sound/voice/hiss5.ogg', 50, 1)
sleep(5)
@@ -91,7 +91,7 @@ var/global/list/sparring_attack_cache = list()
/datum/unarmed_attack/proc/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
var/obj/item/organ/external/affecting = target.get_organ(zone)
user.visible_message("<span class='warning'>[user] [pick(attack_verb)] [target] in the [affecting.name]!</span>")
playsound(user.loc, attack_sound, 25, 1, -1)
playsound(user, attack_sound, 25, 1, -1)
/datum/unarmed_attack/proc/handle_eye_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target)
var/obj/item/organ/internal/eyes/eyes = target.internal_organs_by_name[O_EYES]
+2 -2
View File
@@ -165,7 +165,7 @@ default behaviour is:
if (!istype(AM, /atom/movable) || AM.anchored)
if(confused && prob(50) && m_intent=="run")
Weaken(2)
playsound(loc, "punch", 25, 1, -1)
playsound(src, "punch", 25, 1, -1)
visible_message("<span class='warning'>[src] [pick("ran", "slammed")] into \the [AM]!</span>")
src.apply_damage(5, BRUTE)
to_chat(src, "<span class='warning'>You just [pick("ran", "slammed")] into \the [AM]!</span>")
@@ -975,7 +975,7 @@ default behaviour is:
Stun(5)
src.visible_message("<span class='warning'>[src] throws up!</span>","<span class='warning'>You throw up!</span>")
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
playsound(src, 'sound/effects/splat.ogg', 50, 1)
var/turf/simulated/T = get_turf(src) //TODO: Make add_blood_floor remove blood from human mobs
if(istype(T))
+1 -1
View File
@@ -209,7 +209,7 @@
damage *= 0.66 // Take 2/3s as much damage.
visible_message("<span class='danger'>\The [B] [attack_verb] \the [src]!</span>", "<span class='danger'>[attack_message]!</span>")
playsound(loc, 'sound/effects/attackblob.ogg', 50, 1)
playsound(src, 'sound/effects/attackblob.ogg', 50, 1)
//Armor
var/soaked = get_armor_soak(def_zone, armor_check, armor_pen)
+6 -6
View File
@@ -23,7 +23,7 @@
message = "<b>[src]</b> beeps at [param]."
else
message = "<b>[src]</b> beeps."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
playsound(src, 'sound/machines/twobeep.ogg', 50, 0)
m_type = 1
if("ping")
@@ -40,7 +40,7 @@
message = "<b>[src]</b> pings at [param]."
else
message = "<b>[src]</b> pings."
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
playsound(src, 'sound/machines/ping.ogg', 50, 0)
m_type = 1
if("buzz")
@@ -57,7 +57,7 @@
message = "<b>[src]</b> buzzes at [param]."
else
message = "<b>[src]</b> buzzes."
playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 0)
m_type = 1
if("yes", "ye")
@@ -74,7 +74,7 @@
message = "<b>[src]</b> emits an affirmative blip at [param]."
else
message = "<b>[src]</b> emits an affirmative blip."
playsound(src.loc, 'sound/machines/synth_yes.ogg', 50, 0)
playsound(src, 'sound/machines/synth_yes.ogg', 50, 0)
m_type = 1
if("dwoop")
@@ -90,7 +90,7 @@
message = "<b>[src]</b> chirps happily at [param]"
else
message = "<b>[src]</b> chirps happily."
playsound(src.loc, 'sound/machines/dwoop.ogg', 50, 0)
playsound(src, 'sound/machines/dwoop.ogg', 50, 0)
m_type = 1
if("no")
@@ -107,7 +107,7 @@
message = "<b>[src]</b> emits a negative blip at [param]."
else
message = "<b>[src]</b> emits a negative blip."
playsound(src.loc, 'sound/machines/synth_no.ogg', 50, 0)
playsound(src, 'sound/machines/synth_no.ogg', 50, 0)
m_type = 1
..(act, m_type, message)
+1 -1
View File
@@ -8,7 +8,7 @@
var/turf/T = get_turf_or_move(src.loc)
for (var/mob/M in viewers(T))
M.show_message("<font color='red'>The data cable rapidly retracts back into its spool.</font>", 3, "<font color='red'>You hear a click and the sound of wire spooling rapidly.</font>", 2)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
playsound(src, 'sound/machines/click.ogg', 50, 1)
qdel(src.cable)
src.cable = null
@@ -127,7 +127,7 @@ var/list/mob_hat_cache = list()
if(!module) module = new module_type(src)
flavor_text = "It's a tiny little repair drone. The casing is stamped with an corporate logo and the subscript: '[using_map.company_name] Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
playsound(src, 'sound/machines/twobeep.ogg', 50, 0)
//Redefining some robot procs...
/mob/living/silicon/robot/drone/SetName(pickedName as text)
@@ -123,7 +123,7 @@
if(istype(module,/obj/item/weapon/robot_module/robot/security))
message = "<b>[src]</b> shows its legal authorization barcode."
playsound(src.loc, 'sound/voice/biamthelaw.ogg', 50, 0)
playsound(src, 'sound/voice/biamthelaw.ogg', 50, 0)
m_type = 2
else
to_chat(src, "You are not THE LAW, pal.")
@@ -132,7 +132,7 @@
if(istype(module,/obj/item/weapon/robot_module/robot/security))
message = "<b>[src]</b> <B>'s</B> speakers skreech, \"Halt! Security!\"."
playsound(src.loc, 'sound/voice/halt.ogg', 50, 0)
playsound(src, 'sound/voice/halt.ogg', 50, 0)
m_type = 2
else
to_chat(src, "You are not security.")
@@ -27,7 +27,7 @@
if(confirm == "Yes" && !QDELETED(loaded_item)) //This is pretty copypasta-y
to_chat(user, "You activate the analyzer's microlaser, analyzing \the [loaded_item] and breaking it down.")
flick("portable_analyzer_scan", src)
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
playsound(src, 'sound/items/Welder2.ogg', 50, 1)
for(var/T in loaded_item.origin_tech)
files.UpdateTech(T, loaded_item.origin_tech[T])
to_chat(user, "\The [loaded_item] had level [loaded_item.origin_tech[T]] in [CallTechName(T)].")
@@ -63,10 +63,10 @@
files.RefreshResearch()
if(success)
to_chat(user, "You connect to the research server, push your data upstream to it, then pull the resulting merged data from the master branch.")
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
else
to_chat(user, "Reserch server ping response timed out. Unable to connect. Please contact the system administrator.")
playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 1)
playsound(src, 'sound/machines/buzz-two.ogg', 50, 1)
if(response == "Eject")
if(loaded_item)
loaded_item.loc = get_turf(src)
@@ -276,7 +276,7 @@
var/choice = input("Would you like to change colour or mode?") as null|anything in list("Colour","Mode")
if(!choice) return
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
playsound(src, 'sound/effects/pop.ogg', 50, 0)
switch(choice)
@@ -486,7 +486,7 @@
return
stored_doors++
qdel(A)
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
playsound(src, 'sound/machines/hiss.ogg', 75, 1)
visible_message("\The [user] deflates \the [A] with \the [src]!")
return
if(istype(A, /obj/item/inflatable))
@@ -17,9 +17,9 @@ GLOBAL_LIST_EMPTY(available_ai_shells)
/mob/living/silicon/robot/proc/post_mmi_setup()
if(istype(mmi, /obj/item/device/mmi/inert/ai_remote))
make_shell()
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
playsound(src, 'sound/machines/twobeep.ogg', 50, 0)
else
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
playsound(src, 'sound/voice/liveagain.ogg', 75, 1)
return
/mob/living/silicon/robot/proc/make_shell()
@@ -24,4 +24,4 @@
laws = new /datum/ai_laws/gravekeeper()
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
playsound(src, 'sound/mecha/nominalsyndi.ogg', 75, 0)
@@ -21,7 +21,7 @@
if(!cell)
cell = new /obj/item/weapon/cell/high(src) // 15k cell, as recharging stations are a lot more rare on the Surface.
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
playsound(src, 'sound/mecha/nominalsyndi.ogg', 75, 0)
/mob/living/silicon/robot/lost/speech_bubble_appearance()
return "synthetic_evil"
@@ -25,7 +25,7 @@
radio.keyslot = new /obj/item/device/encryptionkey/syndicate(radio)
radio.recalculateChannels()
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
playsound(src, 'sound/mecha/nominalsyndi.ogg', 75, 0)
/mob/living/silicon/robot/syndicate/protector/init()
..()
@@ -25,4 +25,4 @@
radio.keyslot = new /obj/item/device/encryptionkey/syndicate(radio)
radio.recalculateChannels()
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
playsound(src, 'sound/mecha/nominalsyndi.ogg', 75, 0)
+1 -1
View File
@@ -143,7 +143,7 @@
if(do_after(src, reload_time))
if(reload_sound)
playsound(src.loc, reload_sound, 50, 1)
playsound(src, reload_sound, 50, 1)
reload_count = 0
. = TRUE
else
@@ -163,7 +163,7 @@
return 0
apply_damage(damage = shock_damage, damagetype = BURN, def_zone = null, blocked = null, blocked = resistance, used_weapon = null, sharp = FALSE, edge = FALSE)
playsound(loc, "sparks", 50, 1, -1)
playsound(src, "sparks", 50, 1, -1)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, loc)
@@ -104,7 +104,7 @@
var/mob/living/L = A
L.Weaken(cloaked_weaken_amount)
to_chat(L, span("danger", "\The [src] ambushes you!"))
playsound(L, 'sound/weapons/spiderlunge.ogg', 75, 1)
playsound(src, 'sound/weapons/spiderlunge.ogg', 75, 1)
uncloak()
..() // For the poison.
@@ -115,7 +115,7 @@
continue
visible_message(span("danger","\The [src] erupts from underneath, and hits \the [L]!"))
playsound(L, 'sound/weapons/heavysmash.ogg', 75, 1)
playsound(src, 'sound/weapons/heavysmash.ogg', 75, 1)
L.Weaken(3)
overshoot = FALSE
@@ -164,7 +164,7 @@
// Stun anyone in our way.
for(var/mob/living/L in T)
playsound(L, 'sound/weapons/heavysmash.ogg', 75, 1)
playsound(src, 'sound/weapons/heavysmash.ogg', 75, 1)
L.Weaken(2)
// Get into the tile.
@@ -93,7 +93,7 @@
var/was_stunned = L.incapacitated(INCAPACITATION_DISABLED)
L.Weaken(weaken_amount)
playsound(L, 'sound/effects/break_stone.ogg', 75, 1)
playsound(src, 'sound/effects/break_stone.ogg', 75, 1)
if(was_stunned) // Try to prevent chain-stuns by having them thrown.
var/throwdir = get_dir(src, L)
L.throw_at(get_edge_target_turf(L, throwdir), 5, 1, src)
@@ -56,7 +56,7 @@
/mob/living/simple_mob/illusion/attack_hand(mob/living/carbon/human/M)
if(!realistic)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message(span("warning", "\The [M]'s hand goes through \the [src]!"))
return
else
@@ -67,10 +67,10 @@
span("notice", "\The [M] hugs [src] to make [T.him] feel better!"), \
span("notice", "You hug [src] to make [T.him] feel better!")
) // slightly redundant as at the moment most mobs still use the normal gender var, but it works and future-proofs it
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(I_DISARM)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message(span("danger", "\The [M] attempted to disarm [src]!"))
M.do_attack_animation(src)
@@ -86,7 +86,7 @@
if(realistic)
return ..()
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message(span("warning", "\The [user]'s [I] goes through \the [src]!"))
return FALSE
@@ -152,7 +152,7 @@
visible_message(span("warning", "\The [src] creates \an [energy_ball] around itself!"))
playsound(src.loc, 'sound/effects/lightning_chargeup.ogg', 100, 1, extrarange = 30)
playsound(src, 'sound/effects/lightning_chargeup.ogg', 100, 1, extrarange = 30)
// Shock nearby things that aren't ourselves.
for(var/i = 1 to 10)
@@ -179,7 +179,7 @@
// Shoot a tesla bolt, and flashes people who are looking at the mecha without sufficent eye protection.
visible_message(span("warning", "\The [energy_ball] explodes in a flash of light, sending a shock everywhere!"))
playsound(src.loc, 'sound/effects/lightningbolt.ogg', 100, 1, extrarange = 30)
playsound(src, 'sound/effects/lightningbolt.ogg', 100, 1, extrarange = 30)
tesla_zap(src.loc, 5, ELECTRIC_ZAP_POWER, FALSE)
for(var/mob/living/L in viewers(src))
if(L == src)
@@ -38,6 +38,6 @@
/mob/living/simple_mob/animal/space/tree/death()
..(null,"is hacked into pieces!")
playsound(loc, 'sound/effects/woodcutting.ogg', 100, 1)
playsound(src, 'sound/effects/woodcutting.ogg', 100, 1)
new /obj/item/stack/material/wood(loc)
qdel(src)
@@ -69,7 +69,7 @@
sharp = TRUE
/obj/item/projectile/icicle/on_impact(atom/A)
playsound(get_turf(A), "shatter", 70, 1)
playsound(A, "shatter", 70, 1)
return ..()
/obj/item/projectile/icicle/get_structure_damage()
@@ -1,217 +1,217 @@
// The top-level slime defines. Xenobio slimes and feral slimes will inherit from this.
/mob/living/simple_mob/slime
name = "slime"
desc = "It's a slime."
tt_desc = "A Macrolimbus vulgaris"
icon = 'icons/mob/slime2.dmi'
icon_state = "slime baby"
icon_living = "slime baby"
icon_dead = "slime baby dead"
var/shiny = FALSE // If true, will add a 'shiny' overlay.
var/icon_state_override = null // Used for special slime appearances like the rainbow slime.
color = "#CACACA"
glow_range = 3
glow_intensity = 2
gender = NEUTER
faction = "slime" // Note that slimes are hostile to other slimes of different color regardless of faction (unless Unified).
maxHealth = 150
movement_cooldown = 0
pass_flags = PASSTABLE
makes_dirt = FALSE // Goop
mob_class = MOB_CLASS_SLIME
response_help = "pets"
// Atmos stuff.
minbodytemp = T0C-30
heat_damage_per_tick = 0
cold_damage_per_tick = 40
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
unsuitable_atoms_damage = 0
shock_resist = 0.5 // Slimes are resistant to electricity, and it actually charges them.
taser_kill = FALSE
water_resist = 0 // Slimes are very weak to water.
melee_damage_lower = 10
melee_damage_upper = 15
base_attack_cooldown = 10 // One attack a second.
attack_sound = 'sound/weapons/bite.ogg'
attacktext = list("glomped")
speak_emote = list("chirps")
friendly = list("pokes")
ai_holder_type = /datum/ai_holder/simple_mob/melee
say_list_type = /datum/say_list/slime
var/cores = 1 // How many cores you get when placed in a Processor.
var/obj/item/clothing/head/hat = null // The hat the slime may be wearing.
var/slime_color = "grey" // Used for updating the name and for slime color-ism.
var/unity = FALSE // If true, slimes will consider other colors as their own. Other slimes will see this slime as the same color as well.
var/coretype = /obj/item/slime_extract/grey // What core is inside the slime, and what you get from the processor.
var/reagent_injected = null // Some slimes inject reagents on attack. This tells the game what reagent to use.
var/injection_amount = 5 // This determines how much.
var/mood = ":3" // Icon to use to display 'mood', as an overlay.
can_enter_vent_with = list(/obj/item/clothing/head)
/datum/say_list/slime
speak = list("Blorp...", "Blop...")
emote_see = list("bounces", "jiggles", "sways")
emote_hear = list("squishes")
/mob/living/simple_mob/slime/Initialize()
verbs += /mob/living/proc/ventcrawl
update_mood()
glow_color = color
handle_light()
update_icon()
return ..()
/mob/living/simple_mob/slime/Destroy()
if(hat)
drop_hat()
return ..()
/mob/living/simple_mob/slime/death()
// Make dead slimes stop glowing.
glow_toggle = FALSE
handle_light()
..()
/mob/living/simple_mob/slime/revive()
// Make revived slimes resume glowing.
glow_toggle = initial(glow_toggle)
handle_light()
..()
/mob/living/simple_mob/slime/update_icon()
..() // Do the regular stuff first.
if(stat != DEAD)
// General slime shine.
var/image/I = image(icon, src, "slime light")
I.appearance_flags = RESET_COLOR
add_overlay(I)
// 'Shiny' overlay, for gemstone-slimes.
if(shiny)
I = image(icon, src, "slime shiny")
I.appearance_flags = RESET_COLOR
add_overlay(I)
// Mood overlay.
I = image(icon, src, "aslime-[mood]")
I.appearance_flags = RESET_COLOR
add_overlay(I)
// Hat simulator.
if(hat)
var/hat_state = hat.item_state ? hat.item_state : hat.icon_state
var/image/I = image('icons/mob/head.dmi', src, hat_state)
I.pixel_y = -7 // Slimes are small.
I.appearance_flags = RESET_COLOR
add_overlay(I)
// Controls the 'mood' overlay. Overrided in subtypes for specific behaviour.
/mob/living/simple_mob/slime/proc/update_mood()
mood = "feral" // This is to avoid another override in the /feral subtype.
/mob/living/simple_mob/slime/proc/unify()
unity = TRUE
// Interface override, because slimes are supposed to attack other slimes of different color regardless of faction.
// (unless Unified, of course).
/mob/living/simple_mob/slime/IIsAlly(mob/living/L)
. = ..()
if(istype(L, /mob/living/simple_mob/slime)) // Slimes should care about their color subfaction compared to another's.
var/mob/living/simple_mob/slime/S = L
if(S.unity || src.unity)
return TRUE
if(S.slime_color == src.slime_color)
return TRUE
else
return FALSE
// The other stuff was already checked in parent proc, and the . variable will implicitly return the correct value.
// Slimes regenerate passively.
/mob/living/simple_mob/slime/handle_special()
adjustOxyLoss(-1)
adjustToxLoss(-1)
adjustFireLoss(-1)
adjustCloneLoss(-1)
adjustBruteLoss(-1)
// Clicked on by empty hand.
/mob/living/simple_mob/slime/attack_hand(mob/living/L)
if(L.a_intent == I_GRAB && hat)
remove_hat(L)
else
..()
// Clicked on while holding an object.
/mob/living/simple_mob/slime/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/clothing/head)) // Handle hat simulator.
give_hat(I, user)
return
// Otherwise they're probably fighting the slime.
if(prob(25))
visible_message(span("warning", "\The [user]'s [I] passes right through \the [src]!"))
user.setClickCooldown(user.get_attack_speed(I))
return
..()
// Called when hit with an active slimebaton (or xeno taser).
// Subtypes react differently.
/mob/living/simple_mob/slime/proc/slimebatoned(mob/living/user, amount)
return
// Hat simulator
/mob/living/simple_mob/slime/proc/give_hat(var/obj/item/clothing/head/new_hat, var/mob/living/user)
if(!istype(new_hat))
to_chat(user, span("warning", "\The [new_hat] isn't a hat."))
return
if(hat)
to_chat(user, span("warning", "\The [src] is already wearing \a [hat]."))
return
else
user.drop_item(new_hat)
hat = new_hat
new_hat.forceMove(src)
to_chat(user, span("notice", "You place \a [new_hat] on \the [src]. How adorable!"))
update_icon()
return
/mob/living/simple_mob/slime/proc/remove_hat(var/mob/living/user)
if(!hat)
to_chat(user, "<span class='warning'>\The [src] doesn't have a hat to remove.</span>")
else
hat.forceMove(get_turf(src))
user.put_in_hands(hat)
to_chat(user, "<span class='warning'>You take away \the [src]'s [hat.name]. How mean.</span>")
hat = null
update_icon()
/mob/living/simple_mob/slime/proc/drop_hat()
if(!hat)
return
hat.forceMove(get_turf(src))
hat = null
update_icon()
/mob/living/simple_mob/slime/speech_bubble_appearance()
return "slime"
/mob/living/simple_mob/slime/proc/squish()
playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0)
// The top-level slime defines. Xenobio slimes and feral slimes will inherit from this.
/mob/living/simple_mob/slime
name = "slime"
desc = "It's a slime."
tt_desc = "A Macrolimbus vulgaris"
icon = 'icons/mob/slime2.dmi'
icon_state = "slime baby"
icon_living = "slime baby"
icon_dead = "slime baby dead"
var/shiny = FALSE // If true, will add a 'shiny' overlay.
var/icon_state_override = null // Used for special slime appearances like the rainbow slime.
color = "#CACACA"
glow_range = 3
glow_intensity = 2
gender = NEUTER
faction = "slime" // Note that slimes are hostile to other slimes of different color regardless of faction (unless Unified).
maxHealth = 150
movement_cooldown = 0
pass_flags = PASSTABLE
makes_dirt = FALSE // Goop
mob_class = MOB_CLASS_SLIME
response_help = "pets"
// Atmos stuff.
minbodytemp = T0C-30
heat_damage_per_tick = 0
cold_damage_per_tick = 40
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
unsuitable_atoms_damage = 0
shock_resist = 0.5 // Slimes are resistant to electricity, and it actually charges them.
taser_kill = FALSE
water_resist = 0 // Slimes are very weak to water.
melee_damage_lower = 10
melee_damage_upper = 15
base_attack_cooldown = 10 // One attack a second.
attack_sound = 'sound/weapons/bite.ogg'
attacktext = list("glomped")
speak_emote = list("chirps")
friendly = list("pokes")
ai_holder_type = /datum/ai_holder/simple_mob/melee
say_list_type = /datum/say_list/slime
var/cores = 1 // How many cores you get when placed in a Processor.
var/obj/item/clothing/head/hat = null // The hat the slime may be wearing.
var/slime_color = "grey" // Used for updating the name and for slime color-ism.
var/unity = FALSE // If true, slimes will consider other colors as their own. Other slimes will see this slime as the same color as well.
var/coretype = /obj/item/slime_extract/grey // What core is inside the slime, and what you get from the processor.
var/reagent_injected = null // Some slimes inject reagents on attack. This tells the game what reagent to use.
var/injection_amount = 5 // This determines how much.
var/mood = ":3" // Icon to use to display 'mood', as an overlay.
can_enter_vent_with = list(/obj/item/clothing/head)
/datum/say_list/slime
speak = list("Blorp...", "Blop...")
emote_see = list("bounces", "jiggles", "sways")
emote_hear = list("squishes")
/mob/living/simple_mob/slime/Initialize()
verbs += /mob/living/proc/ventcrawl
update_mood()
glow_color = color
handle_light()
update_icon()
return ..()
/mob/living/simple_mob/slime/Destroy()
if(hat)
drop_hat()
return ..()
/mob/living/simple_mob/slime/death()
// Make dead slimes stop glowing.
glow_toggle = FALSE
handle_light()
..()
/mob/living/simple_mob/slime/revive()
// Make revived slimes resume glowing.
glow_toggle = initial(glow_toggle)
handle_light()
..()
/mob/living/simple_mob/slime/update_icon()
..() // Do the regular stuff first.
if(stat != DEAD)
// General slime shine.
var/image/I = image(icon, src, "slime light")
I.appearance_flags = RESET_COLOR
add_overlay(I)
// 'Shiny' overlay, for gemstone-slimes.
if(shiny)
I = image(icon, src, "slime shiny")
I.appearance_flags = RESET_COLOR
add_overlay(I)
// Mood overlay.
I = image(icon, src, "aslime-[mood]")
I.appearance_flags = RESET_COLOR
add_overlay(I)
// Hat simulator.
if(hat)
var/hat_state = hat.item_state ? hat.item_state : hat.icon_state
var/image/I = image('icons/mob/head.dmi', src, hat_state)
I.pixel_y = -7 // Slimes are small.
I.appearance_flags = RESET_COLOR
add_overlay(I)
// Controls the 'mood' overlay. Overrided in subtypes for specific behaviour.
/mob/living/simple_mob/slime/proc/update_mood()
mood = "feral" // This is to avoid another override in the /feral subtype.
/mob/living/simple_mob/slime/proc/unify()
unity = TRUE
// Interface override, because slimes are supposed to attack other slimes of different color regardless of faction.
// (unless Unified, of course).
/mob/living/simple_mob/slime/IIsAlly(mob/living/L)
. = ..()
if(istype(L, /mob/living/simple_mob/slime)) // Slimes should care about their color subfaction compared to another's.
var/mob/living/simple_mob/slime/S = L
if(S.unity || src.unity)
return TRUE
if(S.slime_color == src.slime_color)
return TRUE
else
return FALSE
// The other stuff was already checked in parent proc, and the . variable will implicitly return the correct value.
// Slimes regenerate passively.
/mob/living/simple_mob/slime/handle_special()
adjustOxyLoss(-1)
adjustToxLoss(-1)
adjustFireLoss(-1)
adjustCloneLoss(-1)
adjustBruteLoss(-1)
// Clicked on by empty hand.
/mob/living/simple_mob/slime/attack_hand(mob/living/L)
if(L.a_intent == I_GRAB && hat)
remove_hat(L)
else
..()
// Clicked on while holding an object.
/mob/living/simple_mob/slime/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/clothing/head)) // Handle hat simulator.
give_hat(I, user)
return
// Otherwise they're probably fighting the slime.
if(prob(25))
visible_message(span("warning", "\The [user]'s [I] passes right through \the [src]!"))
user.setClickCooldown(user.get_attack_speed(I))
return
..()
// Called when hit with an active slimebaton (or xeno taser).
// Subtypes react differently.
/mob/living/simple_mob/slime/proc/slimebatoned(mob/living/user, amount)
return
// Hat simulator
/mob/living/simple_mob/slime/proc/give_hat(var/obj/item/clothing/head/new_hat, var/mob/living/user)
if(!istype(new_hat))
to_chat(user, span("warning", "\The [new_hat] isn't a hat."))
return
if(hat)
to_chat(user, span("warning", "\The [src] is already wearing \a [hat]."))
return
else
user.drop_item(new_hat)
hat = new_hat
new_hat.forceMove(src)
to_chat(user, span("notice", "You place \a [new_hat] on \the [src]. How adorable!"))
update_icon()
return
/mob/living/simple_mob/slime/proc/remove_hat(var/mob/living/user)
if(!hat)
to_chat(user, "<span class='warning'>\The [src] doesn't have a hat to remove.</span>")
else
hat.forceMove(get_turf(src))
user.put_in_hands(hat)
to_chat(user, "<span class='warning'>You take away \the [src]'s [hat.name]. How mean.</span>")
hat = null
update_icon()
/mob/living/simple_mob/slime/proc/drop_hat()
if(!hat)
return
hat.forceMove(get_turf(src))
hat = null
update_icon()
/mob/living/simple_mob/slime/speech_bubble_appearance()
return "slime"
/mob/living/simple_mob/slime/proc/squish()
playsound(src, 'sound/effects/slime_squish.ogg', 50, 0)
visible_message("<b>\The [src]</b> squishes!")
@@ -1,54 +1,54 @@
// Contains code for slimes getting attacked, beat, touched, etc, and reacting to that.
// Clicked on by empty hand.
// Handles trying to wrestle a slime off of someone being eatten.
/mob/living/simple_mob/slime/xenobio/attack_hand(mob/living/L)
if(victim) // Are we eating someone?
var/fail_odds = 30
if(victim == L) // Harder to get the slime off if it's you that is being eatten.
fail_odds = 60
if(prob(fail_odds))
visible_message(span("warning", "\The [L] attempts to wrestle \the [name] off!"))
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
else
visible_message(span("warning", "\The [L] manages to wrestle \the [name] off!"))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(prob(40))
adjust_discipline(1) // Do this here so that it will be justified discipline.
stop_consumption()
step_away(src, L)
else
..()
// Handles the actual harming by a melee weapon.
/mob/living/simple_mob/slime/xenobio/hit_with_weapon(obj/item/I, mob/living/user, effective_force, hit_zone)
..() // Apply damage and etc.
if(!stat && effective_force > 0)
if(!is_justified_to_discipline()) // Wow, buddy, why am I getting attacked??
adjust_discipline(1) // This builds resentment due to being unjustified.
if(user in friends) // Friend attacking us for no reason.
if(prob(25))
friends -= user
say("[user]... not friend...")
else // We're actually being bad.
var/prob_to_back_down = round(effective_force)
if(is_adult)
prob_to_back_down /= 2
if(prob(prob_to_back_down))
adjust_discipline(2) // Justified.
// Shocked grilles don't hurt slimes, and in fact give them charge.
/mob/living/simple_mob/slime/xenobio/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, def_zone = null)
power_charge = between(0, power_charge + round(shock_damage / 10), 10)
to_chat(src, span("notice", "\The [source] shocks you, and it charges you."))
// Getting slimebatoned/xenotased.
/mob/living/simple_mob/slime/xenobio/slimebatoned(mob/living/user, amount)
adjust_discipline(round(amount/2))
Weaken(amount) // This needs to come afterwards or else it will always be considered abuse to the slime.
// Contains code for slimes getting attacked, beat, touched, etc, and reacting to that.
// Clicked on by empty hand.
// Handles trying to wrestle a slime off of someone being eatten.
/mob/living/simple_mob/slime/xenobio/attack_hand(mob/living/L)
if(victim) // Are we eating someone?
var/fail_odds = 30
if(victim == L) // Harder to get the slime off if it's you that is being eatten.
fail_odds = 60
if(prob(fail_odds))
visible_message(span("warning", "\The [L] attempts to wrestle \the [name] off!"))
playsound(src, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
else
visible_message(span("warning", "\The [L] manages to wrestle \the [name] off!"))
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(prob(40))
adjust_discipline(1) // Do this here so that it will be justified discipline.
stop_consumption()
step_away(src, L)
else
..()
// Handles the actual harming by a melee weapon.
/mob/living/simple_mob/slime/xenobio/hit_with_weapon(obj/item/I, mob/living/user, effective_force, hit_zone)
..() // Apply damage and etc.
if(!stat && effective_force > 0)
if(!is_justified_to_discipline()) // Wow, buddy, why am I getting attacked??
adjust_discipline(1) // This builds resentment due to being unjustified.
if(user in friends) // Friend attacking us for no reason.
if(prob(25))
friends -= user
say("[user]... not friend...")
else // We're actually being bad.
var/prob_to_back_down = round(effective_force)
if(is_adult)
prob_to_back_down /= 2
if(prob(prob_to_back_down))
adjust_discipline(2) // Justified.
// Shocked grilles don't hurt slimes, and in fact give them charge.
/mob/living/simple_mob/slime/xenobio/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, def_zone = null)
power_charge = between(0, power_charge + round(shock_damage / 10), 10)
to_chat(src, span("notice", "\The [source] shocks you, and it charges you."))
// Getting slimebatoned/xenotased.
/mob/living/simple_mob/slime/xenobio/slimebatoned(mob/living/user, amount)
adjust_discipline(round(amount/2))
Weaken(amount) // This needs to come afterwards or else it will always be considered abuse to the slime.
+2 -2
View File
@@ -108,7 +108,7 @@
target.apply_effect(20, PARALYZE)
target.visible_message("<span class='danger'>[target] [target.species.get_knockout_message(target)]</span>")
playsound(attacker.loc, "swing_hit", 25, 1, -1)
playsound(attacker, "swing_hit", 25, 1, -1)
add_attack_logs(attacker,target,"Headbutted using grab")
attacker.drop_from_inventory(src)
@@ -121,7 +121,7 @@
to_chat(attacker, "<span class='warning'>You require a better grab to do this.</span>")
return
if(target.grab_joint(attacker, target_zone))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
/obj/item/weapon/grab/proc/pin_down(mob/target, mob/attacker)