diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm
index 5bc8ab5f5de..d480bb6bbbd 100644
--- a/code/__DEFINES/is_helpers.dm
+++ b/code/__DEFINES/is_helpers.dm
@@ -41,6 +41,29 @@ var/list/static/global/pointed_types = typecacheof(list(
#define ismineralturf(A) istype(A, /turf/simulated/mineral)
+//Mobs
+#define isliving(A) (istype(A, /mob/living))
+
+#define isbrain(A) (istype(A, /mob/living/carbon/brain))
+
+//Carbon mobs
+#define iscarbon(A) (istype(A, /mob/living/carbon))
+
+#define ishuman(A) (istype(A, /mob/living/carbon/human))
+
+//more carbon mobs
+#define isalien(A) (istype(A, /mob/living/carbon/alien))
+
+#define islarva(A) (istype(A, /mob/living/carbon/alien/larva))
+
+#define isalienadult(A) (istype(A, /mob/living/carbon/alien/humanoid))
+
+#define isalienhunter(A) (istype(A, /mob/living/carbon/alien/humanoid/hunter))
+
+#define isaliensentinel(A) (istype(A, /mob/living/carbon/alien/humanoid/sentinel))
+
+#define isslime(A) (istype((A), /mob/living/carbon/slime))
+
// Misc
#define isclient(A) istype(A, /client)
#define isradio(A) istype(A, /obj/item/radio)
diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm
index 5bf38e54ad8..efe8a4aac86 100644
--- a/code/__DEFINES/mobs.dm
+++ b/code/__DEFINES/mobs.dm
@@ -128,15 +128,6 @@
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
#define EYE_SHINE_THRESHOLD 6 //dark_view threshold past which a humanoid's eyes will 'shine' in the dark.
-#define isliving(A) (istype((A), /mob/living))
-#define iscarbon(A) (istype((A), /mob/living/carbon))
-#define ishuman(A) (istype((A), /mob/living/carbon/human))
-#define isbrain(A) (istype((A), /mob/living/carbon/brain))
-#define isalien(A) (istype((A), /mob/living/carbon/alien))
-#define isalienadult(A) (istype((A), /mob/living/carbon/alien/humanoid))
-#define islarva(A) (istype((A), /mob/living/carbon/alien/larva))
-#define isslime(A) (istype((A), /mob/living/carbon/slime))
-
//Human sub-species
#define isabductor(A) (is_species(A, "Abductor"))
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index 76d60fc7b19..e706b89ca85 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -9,15 +9,10 @@
icon = 'icons/mob/alien.dmi'
gender = NEUTER
dna = null
-
-
alien_talk_understand = 1
-
nightvision = 1
-
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 = CANPARALYSE|CANPUSH
@@ -27,7 +22,6 @@
var/heat_protection = 0.5
var/leaping = 0
ventcrawler = 2
-
var/list/alien_organs = list()
/mob/living/carbon/alien/New()
@@ -118,31 +112,6 @@
else
clear_alert("alien_fire")
-/mob/living/carbon/alien/handle_mutations_and_radiation()
- // Aliens love radiation nom nom nom
- if(radiation)
- if(radiation > 100)
- radiation = 100
-
- if(radiation < 0)
- radiation = 0
-
- switch(radiation)
- if(1 to 49)
- radiation--
- if(prob(25))
- adjustToxLoss(1)
-
- if(50 to 74)
- radiation -= 2
- adjustToxLoss(1)
- if(prob(5))
- radiation -= 5
-
- if(75 to 100)
- radiation -= 3
- adjustToxLoss(3)
-
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
if(..())
return
diff --git a/code/modules/mob/living/carbon/alien/alien_defenses.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm
similarity index 88%
rename from code/modules/mob/living/carbon/alien/alien_defenses.dm
rename to code/modules/mob/living/carbon/alien/alien_defense.dm
index 5934987f8a4..22954451834 100644
--- a/code/modules/mob/living/carbon/alien/alien_defenses.dm
+++ b/code/modules/mob/living/carbon/alien/alien_defense.dm
@@ -5,7 +5,7 @@
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 as mob)
+/mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M)
if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
@@ -40,14 +40,12 @@ In all, this is a lot like the monkey code. /N
else
to_chat(M, "[name] is too injured for that.")
-/mob/living/carbon/alien/attack_larva(mob/living/carbon/alien/larva/L as mob)
+/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 as mob)
+/mob/living/carbon/alien/attack_hand(mob/living/carbon/human/M)
if(..()) //to allow surgery to return properly.
return 0
- if(istype(src,/mob/living/carbon/alien/humanoid))
- return 0 //this is horrible but 100% necessary
switch(M.a_intent)
if(INTENT_HELP)
@@ -55,12 +53,11 @@ In all, this is a lot like the monkey code. /N
if(INTENT_GRAB)
grabbedby(M)
if(INTENT_HARM, INTENT_DISARM)
+ M.do_attack_animation(src)
return 1
return 0
-
-
-/mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M as mob)
+/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)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 182bc0bd9eb..8946189b4cb 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -78,138 +78,14 @@
updatehealth()
-/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(M.Victim) return // can't attack while eating!
-
- if(stat > -100)
-
- M.do_attack_animation(src)
- visible_message("The [M.name] glomps [src]!", \
- "The [M.name] glomps [src]!")
- var/damage = rand(1, 3)
-
- if(M.is_adult)
- damage = rand(10, 40)
- else
- damage = rand(5, 35)
-
- adjustBruteLoss(damage)
-
- if(M.powerlevel > 0)
- var/stunprob = 10
- var/power = M.powerlevel + rand(0,3)
-
- switch(M.powerlevel)
- if(1 to 2) stunprob = 20
- if(3 to 4) stunprob = 30
- if(5 to 6) stunprob = 40
- if(7 to 8) stunprob = 60
- if(9) stunprob = 70
- if(10) stunprob = 95
-
- if(prob(stunprob))
- M.powerlevel -= 3
- if(M.powerlevel < 0)
- M.powerlevel = 0
-
- visible_message("The [M.name] has shocked [src]!", \
- "The [M.name] has shocked [src]!")
-
- Weaken(power)
- if(stuttering < power)
- stuttering = power
- Stun(power)
-
- var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
- s.set_up(5, 1, src)
- s.start()
-
- if(prob(stunprob) && M.powerlevel >= 8)
- adjustFireLoss(M.powerlevel * rand(6,10))
-
-
- updatehealth()
-
- return
-
-/mob/living/carbon/alien/humanoid/attack_animal(mob/living/simple_animal/M as mob)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- M.do_attack_animation(src)
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- visible_message("[M] [M.attacktext] [src]!", \
- "[M] [M.attacktext] [src]!")
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- adjustBruteLoss(damage)
- updatehealth()
-
-/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
- 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)
- M.do_attack_animation(src)
- var/damage = rand(1, 9)
- if(prob(90))
- if(HULK in M.mutations)//HULK SMASH
- damage = 15
- spawn(0)
- Paralyse(1)
- step_away(src,M,15)
- sleep(3)
- step_away(src,M,15)
- playsound(loc, "punch", 25, 1, -1)
- visible_message("[M] has punched [src]!", \
- "[M] has punched [src]!")
- if((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien.
- Paralyse(2)
- visible_message("[M] has weakened [src]!", \
- "[M] has weakened [src]!", \
- "You hear someone fall.")
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to punch [src]!")
-
- if(INTENT_DISARM)
- if(!lying)
- if(prob(5))//Very small chance to push an alien down.
- Paralyse(2)
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- visible_message("[M] has pushed down [src]!", \
- "[M] has pushed down [src]!")
- else
- if(prob(50))
- drop_item()
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- visible_message("[M] has disarmed [src]!", \
- "[M] has disarmed [src]!")
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to disarm [src]!")
+/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M)
+ ..()
+ var/damage = rand(5, 35)
+ if(M.is_adult)
+ damage = rand(10, 40)
+ adjustBruteLoss(damage)
+ add_attack_logs(src, M, "Slime'd for [damage] damage")
+ updatehealth()
return
/mob/living/carbon/alien/humanoid/restrained()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm
new file mode 100644
index 00000000000..0056bb709a5
--- /dev/null
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm
@@ -0,0 +1,45 @@
+/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
+ if(..())
+ switch(M.a_intent)
+ if(INTENT_HARM)
+ var/damage = rand(1, 9)
+ if(prob(90))
+ if(HULK in M.mutations)//HULK SMASH
+ damage = 15
+ spawn(0)
+ Paralyse(1)
+ step_away(src, M, 15)
+ sleep(3)
+ step_away(src, M, 15)
+ playsound(loc, "punch", 25, 1, -1)
+ visible_message("[M] has punched [src]!", \
+ "[M] has punched [src]!")
+ if((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien.
+ Paralyse(2)
+ visible_message("[M] has weakened [src]!", \
+ "[M] has weakened [src]!", \
+ "You hear someone fall.")
+ adjustBruteLoss(damage)
+ add_attack_logs(M, src, "Melee attacked with fists")
+ updatehealth()
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to punch [src]!")
+
+ if(INTENT_DISARM)
+ if(!lying)
+ if(prob(5))//Very small chance to push an alien down.
+ Paralyse(2)
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ add_attack_logs(M, src, "Pushed over")
+ visible_message("[M] has pushed down [src]!", \
+ "[M] has pushed down [src]!")
+ else
+ if(prob(50))
+ drop_item()
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ visible_message("[M] has disarmed [src]!", \
+ "[M] has disarmed [src]!")
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to disarm [src]!")
diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm
index 2d638dd0db1..783d683f060 100644
--- a/code/modules/mob/living/carbon/alien/larva/larva.dm
+++ b/code/modules/mob/living/carbon/alien/larva/larva.dm
@@ -73,91 +73,15 @@
/mob/living/carbon/alien/larva/attack_ui(slot_id)
return
-/mob/living/carbon/alien/larva/attack_animal(mob/living/simple_animal/M as mob)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- M.do_attack_animation(src)
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- visible_message("[M] [M.attacktext] [src]!", \
- "[M] [M.attacktext] [src]!")
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- adjustBruteLoss(damage)
- add_attack_logs(M, src, "Animal attacked", FALSE)
- updatehealth()
-
-
-
-/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(M.Victim)
- return // can't attack while eating!
-
- if(stat != DEAD)
- M.do_attack_animation(src)
- visible_message("The [M.name] glomps [src]!", \
- "The [M.name] glomps [src]!")
- var/damage = rand(1, 3)
-
- if(M.is_adult)
- damage = rand(20, 40)
- else
- damage = rand(5, 35)
-
-
- adjustBruteLoss(damage)
- updatehealth()
-
- return
-
-/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
+/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M)
..()
-
- switch(M.a_intent)
-
- if(INTENT_HELP)
- help_shake_act(M)
-
- if(INTENT_GRAB)
- grabbedby(M)
-
- else
- M.do_attack_animation(src)
- var/damage = rand(1, 9)
- if(prob(90))
- if(HULK in M.mutations)
- damage += 5
- spawn(0)
- Paralyse(1)
- step_away(src,M,15)
- sleep(3)
- step_away(src,M,15)
- playsound(loc, "punch", 25, 1, -1)
- visible_message("[M] has kicked [src]!", \
- "[M] has kicked [src]!")
- if((stat != DEAD) && (damage > 4.9))
- Paralyse(rand(5,10))
- visible_message("[M] has weakened [src]!", \
- "[M] has weakened [src]!", \
- "You hear someone fall.")
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to kick [src]!", \
- "[M] has attempted to kick [src]!")
+ var/damage = rand(5, 35)
+ if(M.is_adult)
+ damage = rand(20, 40)
+ adjustBruteLoss(damage)
+ add_attack_logs(src, M, "Slime'd for [damage] damage")
+ updatehealth()
+ return
/mob/living/carbon/alien/larva/restrained()
return 0
diff --git a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm
new file mode 100644
index 00000000000..fc7fa22510b
--- /dev/null
+++ b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm
@@ -0,0 +1,24 @@
+/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M)
+ if(..())
+ var/damage = rand(1, 9)
+ if(prob(90))
+ if(HULK in M.mutations)
+ damage += 5
+ spawn(0)
+ Paralyse(1)
+ step_away(src, M, 15)
+ sleep(3)
+ step_away(src, M, 15)
+ playsound(loc, "punch", 25, 1, -1)
+ add_attack_logs(M, src, "Melee attacked with fists")
+ visible_message("[M] has kicked [src]!", \
+ "[M] has kicked [src]!")
+ if((stat != DEAD) && (damage > 4.9))
+ Paralyse(rand(5,10))
+
+ adjustBruteLoss(damage)
+ updatehealth()
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to kick [src]!", \
+ "[M] has attempted to kick [src]!")
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm
index e61f8750901..757ccab9fb9 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/carbon/brain/life.dm
@@ -1,36 +1,20 @@
/mob/living/carbon/brain/handle_mutations_and_radiation()
if(radiation)
if(radiation > 100)
- radiation -= 3
- adjustToxLoss(3)
- updatehealth()
if(!container)
to_chat(src, "You feel weak.")
else
to_chat(src, "STATUS: CRITICAL AMOUNTS OF RADIATION DETECTED.")
switch(radiation)
- if(0 to 49)
- radiation--
- if(prob(25))
- adjustToxLoss(1)
- updatehealth()
- if(50 to 74)
- radiation -= 2
- adjustToxLoss(1)
+ if(50 to 75)
if(prob(5))
- radiation -= 5
if(!container)
to_chat(src, "You feel weak.")
else
to_chat(src, "STATUS: DANGEROUS AMOUNTS OF RADIATION DETECTED.")
- updatehealth()
-
- if(75 to 100)
- radiation -= 3
- adjustToxLoss(3)
- updatehealth()
+ ..()
/mob/living/carbon/brain/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
if(status_flags & GODMODE)
@@ -38,13 +22,10 @@
if(exposed_temperature > bodytemperature)
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
- //adjustFireLoss(2.5*discomfort)
- //adjustFireLoss(5.0*discomfort)
adjustFireLoss(20.0*discomfort)
else
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
- //adjustFireLoss(2.5*discomfort)
adjustFireLoss(5.0*discomfort)
/mob/living/carbon/brain/handle_regular_status_updates()
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 98815771019..a1e4b555412 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -201,11 +201,12 @@
swap_hand()
/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))
+ add_attack_logs(M, src, "Shaked", admin_notify = FALSE)
+ if(health >= config.health_threshold_crit)
+ if(src == M && ishuman(src))
var/mob/living/carbon/human/H = src
- src.visible_message( \
- text("[src] examines [].",src.gender==MALE?"himself":"herself"), \
+ visible_message( \
+ text("[src] examines [].",gender==MALE?"himself":"herself"), \
"You check yourself for injuries." \
)
@@ -259,20 +260,21 @@
"You shake [src], but they are unresponsive. Probably suffering from SSD.")
if(lying) // /vg/: For hugs. This is how update_icon figgers it out, anyway. - N3X15
var/t_him = "it"
- if(src.gender == MALE)
+ if(gender == MALE)
t_him = "him"
- else if(src.gender == FEMALE)
+ else if(gender == FEMALE)
t_him = "her"
- if(istype(src,/mob/living/carbon/human) && src:w_uniform)
+ if(ishuman(src))
var/mob/living/carbon/human/H = src
- H.w_uniform.add_fingerprint(M)
+ if(H.w_uniform)
+ H.w_uniform.add_fingerprint(M)
AdjustSleeping(-5)
- if(src.sleeping == 0)
- src.resting = 0
+ if(sleeping == 0)
+ resting = 0
AdjustParalysis(-3)
AdjustStunned(-3)
AdjustWeakened(-3)
- playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(!player_logged)
M.visible_message( \
"[M] shakes [src] trying to wake [t_him] up!",\
@@ -292,7 +294,7 @@
"[M] gives [src] a [pick("hug","warm embrace")].",\
"You hug [src].",\
)
- if(istype(src,/mob/living/carbon/human))
+ if(ishuman(src))
var/mob/living/carbon/human/H = src
if(H.wear_suit)
H.wear_suit.add_fingerprint(M)
diff --git a/code/modules/mob/living/carbon/carbon_defenses.dm b/code/modules/mob/living/carbon/carbon_defense.dm
similarity index 65%
rename from code/modules/mob/living/carbon/carbon_defenses.dm
rename to code/modules/mob/living/carbon/carbon_defense.dm
index eb6517e5f1d..7e6f427e069 100644
--- a/code/modules/mob/living/carbon/carbon_defenses.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -18,12 +18,11 @@
/mob/living/carbon/attackby(obj/item/I, mob/user, params)
- if(lying)
- if(surgeries.len)
- if(user != src && user.a_intent == INTENT_HELP)
- for(var/datum/surgery/S in surgeries)
- if(S.next_step(user, src))
- return 1
+ if(lying && surgeries.len)
+ if(user != src && user.a_intent == INTENT_HELP)
+ for(var/datum/surgery/S in surgeries)
+ if(S.next_step(user, src))
+ return 1
return ..()
/mob/living/carbon/attack_hand(mob/living/carbon/human/user)
@@ -39,8 +38,26 @@
var/datum/disease/D = thing
if(D.IsSpreadByTouch())
ContractDisease(D)
+
+ if(lying && surgeries.len)
+ if(user.a_intent == INTENT_HELP)
+ for(var/datum/surgery/S in surgeries)
+ if(S.next_step(user, user.a_intent))
+ return 1
return 0
+/mob/living/carbon/attack_slime(mob/living/carbon/slime/M)
+ if(..())
+ var/power = M.powerlevel + rand(0,3)
+ Weaken(power)
+ Stuttering(power)
+ Stun(power)
+ var/stunprob = M.powerlevel * 7 + 10
+ if(prob(stunprob) && M.powerlevel >= 8)
+ adjustFireLoss(M.powerlevel * rand(6,10))
+ updatehealth()
+ return 1
+
/mob/living/carbon/is_mouth_covered(head_only = FALSE, mask_only = FALSE)
if((!mask_only && head && (head.flags_cover & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)))
return TRUE
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 9a9454ad268..5a47bb052d5 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -306,112 +306,6 @@
return 0
..()
-/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M as mob)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- M.do_attack_animation(src)
- visible_message("[M] [M.attacktext] [src]!", \
- "[M] [M.attacktext] [src]!")
- add_attack_logs(M, src, "Animal attacked")
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
- return 0
- var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
- var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
- var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
-
- var/obj/item/organ/external/affected = src.get_organ(dam_zone)
- if(affected)
- affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
- apply_damage(damage, M.melee_damage_type, affecting, armor)
- updatehealth()
-
-/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L as mob)
-
- switch(L.a_intent)
- if(INTENT_HELP)
- visible_message("[L] rubs its head against [src].")
-
-
- else
- L.do_attack_animation(src)
- var/damage = rand(1, 3)
- visible_message("[L] bites [src]!", \
- "[L] bites [src]!")
- playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
-
- if(stat != DEAD)
- L.amount_grown = min(L.amount_grown + damage, L.max_grown)
- var/obj/item/organ/external/affecting = get_organ(ran_zone(L.zone_sel.selecting))
- var/armor_block = run_armor_check(affecting, "melee")
- apply_damage(damage, BRUTE, affecting, armor_block)
-
-/mob/living/carbon/human/attack_slime(mob/living/carbon/slime/M as mob)
- if(M.Victim) return // can't attack while eating!
-
- if(stat != DEAD)
- M.do_attack_animation(src)
- visible_message("The [M.name] glomps [src]!", \
- "The [M.name] glomps [src]!")
-
- var/damage = rand(1, 3)
-
- if(M.is_adult)
- damage = rand(10, 35)
- else
- damage = rand(5, 25)
-
- if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK))
- return 0
-
- var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
-
- var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
- var/armor_block = run_armor_check(affecting, "melee")
- apply_damage(damage, BRUTE, affecting, armor_block)
-
-
- if(M.powerlevel > 0)
- var/stunprob = 10
- var/power = M.powerlevel + rand(0,3)
-
- switch(M.powerlevel)
- if(1 to 2) stunprob = 20
- if(3 to 4) stunprob = 30
- if(5 to 6) stunprob = 40
- if(7 to 8) stunprob = 60
- if(9) stunprob = 70
- if(10) stunprob = 95
-
- if(prob(stunprob))
- M.powerlevel -= 3
- if(M.powerlevel < 0)
- M.powerlevel = 0
-
- for(var/mob/O in viewers(src, null))
- if((O.client && !( O.blinded )))
- O.show_message(text("The [M.name] has shocked []!", src), 1)
-
- Weaken(power)
- Stuttering(power)
- Stun(power)
-
- var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
- s.set_up(5, 1, src)
- s.start()
-
- if(prob(stunprob) && M.powerlevel >= 8)
- adjustFireLoss(M.powerlevel * rand(6,10))
-
-
- updatehealth()
-
- return
-
-
/mob/living/carbon/human/restrained()
if(handcuffed)
return 1
@@ -1834,6 +1728,39 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
return
..()
+/mob/living/carbon/human/proc/do_cpr(mob/living/carbon/human/H)
+ if(H.stat == DEAD || (H.status_flags & FAKEDEATH))
+ to_chat(src, "[H.name] is dead!")
+ return
+ if(!check_has_mouth())
+ to_chat(src, "You don't have a mouth, you cannot perform CPR!")
+ return
+ if(!H.check_has_mouth())
+ to_chat(src, "They don't have a mouth, you cannot perform CPR!")
+ return
+ if((head && (head.flags_cover & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH) && !wear_mask.mask_adjusted))
+ to_chat(src, "Remove your mask first!")
+ return 0
+ if((H.head && (H.head.flags_cover & HEADCOVERSMOUTH)) || (H.wear_mask && (H.wear_mask.flags_cover & MASKCOVERSMOUTH) && !H.wear_mask.mask_adjusted))
+ to_chat(src, "Remove their mask first!")
+ return 0
+ visible_message("[src] is trying to perform CPR on [H.name]!", \
+ "You try to perform CPR on [H.name]!")
+ if(do_mob(src, H, 40))
+ if(H.health > config.health_threshold_dead && H.health <= config.health_threshold_crit)
+ var/suff = min(H.getOxyLoss(), 7)
+ H.adjustOxyLoss(-suff)
+ H.updatehealth()
+ visible_message("[src] performs CPR on [H.name]!", \
+ "You perform CPR on [H.name].")
+
+ to_chat(H, "You feel a breath of fresh air enter your lungs. It feels good.")
+ to_chat(src, "Repeat at least every 7 seconds.")
+ add_attack_logs(src, H, "CPRed", FALSE)
+ return 1
+ else
+ to_chat(src, "You need to stay still while performing CPR!")
+
/mob/living/carbon/human/canBeHandcuffed()
if(get_num_arms() >= 2)
return TRUE
diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm
deleted file mode 100644
index 7c4039789a9..00000000000
--- a/code/modules/mob/living/carbon/human/human_attackalien.dm
+++ /dev/null
@@ -1,50 +0,0 @@
-/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if(check_shields(0, M.name))
- visible_message("[M] attempted to touch [src]!")
- return 0
-
- switch(M.a_intent)
- if(INTENT_HELP)
- visible_message("[M] caresses [src] with its scythe like arm.")
-
- if(INTENT_GRAB)
- grabbedby(M)
-
- if(INTENT_HARM)
- M.do_attack_animation(src)
- if(w_uniform)
- w_uniform.add_fingerprint(M)
-
- var/damage = rand(15, 30)
- if(!damage)
- playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
- visible_message("[M] has lunged at [src]!")
- return 0
-
- var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
- var/armor_block = run_armor_check(affecting, "melee")
-
- playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
- visible_message("[M] has slashed at [src]!")
-
- apply_damage(damage, BRUTE, affecting, armor_block)
- if(damage >= 25)
- visible_message("[M] has wounded [src]!")
- apply_effect(4, WEAKEN, armor_block)
- updatehealth()
-
- if(INTENT_DISARM)
- M.do_attack_animation(src)
- if(prob(80))
- var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
- playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
- apply_effect(5, WEAKEN, run_armor_check(affecting, "melee"))
- visible_message("[M] has tackled down [src]!")
- else
- if(prob(99)) //this looks fucking stupid but it was previously 'var/randn = rand(1, 100); if(randn <= 99)'
- playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
- drop_item()
- visible_message("[M] disarmed [src]!")
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
- visible_message("[M] has tried to disarm [src]!")
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm
deleted file mode 100644
index 57be152295b..00000000000
--- a/code/modules/mob/living/carbon/human/human_attackhand.dm
+++ /dev/null
@@ -1,201 +0,0 @@
-/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
- if(frozen)
- to_chat(M, "Do not touch Admin-Frozen people.")
- return
-
- var/mob/living/carbon/human/H = M
- if(istype(H))
- var/obj/item/organ/external/temp = H.bodyparts_by_name["r_hand"]
- if(H.hand)
- temp = H.bodyparts_by_name["l_hand"]
- if(!temp || !temp.is_usable())
- to_chat(H, "You can't use your hand.")
- return
-
- ..()
-
- if((M != src) && M.a_intent != INTENT_HELP && check_shields(0, M.name, attack_type = UNARMED_ATTACK))
- add_attack_logs(M, src, "Melee attacked with fists (miss/block)")
- visible_message("[M] attempted to touch [src]!")
- return 0
-
- var/datum/martial_art/attacker_style = M.martial_art
-
- species.handle_attack_hand(src, M)
-
- switch(M.a_intent)
- if(INTENT_HELP)
- if(attacker_style && attacker_style.help_act(H, src))//adminfu only...
- return 1
- if(can_operate(src))
- if(health >= config.health_threshold_crit)
- if(src.surgeries.len)
- for(var/datum/surgery/S in src.surgeries)
- if(S.next_step(M, src))
- return 1
- help_shake_act(M)
- add_attack_logs(M, src, "Shaked")
- return 1
- if(health >= config.health_threshold_crit)
- help_shake_act(M)
- add_attack_logs(M, src, "Shaked")
- return 1
- if(!H.check_has_mouth())
- to_chat(H, "You don't have a mouth, you cannot perform CPR!")
- return
- if(!check_has_mouth())
- to_chat(H, "They don't have a mouth, you cannot perform CPR!")
- return
- if((M.head && (M.head.flags_cover & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags_cover & MASKCOVERSMOUTH) && !M.wear_mask.mask_adjusted))
- to_chat(M, "Remove your mask!")
- return 0
- if((head && (head.flags_cover & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH) && !wear_mask.mask_adjusted))
- to_chat(M, "Remove his mask!")
- return 0
-
- M.visible_message("\The [M] is trying to perform CPR on \the [src]!", \
- "You try to perform CPR on \the [src]!")
- if(do_mob(M, src, 40))
- if(health > config.health_threshold_dead && health <= config.health_threshold_crit)
- var/suff = min(getOxyLoss(), 7)
- adjustOxyLoss(-suff)
- updatehealth()
- M.visible_message("\The [M] performs CPR on \the [src]!", \
- "You perform CPR on \the [src].")
-
- to_chat(src, "You feel a breath of fresh air enter your lungs. It feels good.")
- to_chat(M, "Repeat at least every 7 seconds.")
- add_attack_logs(M, src, "CPRed", FALSE)
- return 1
- else
- to_chat(M, "You need to stay still while performing CPR!")
-
- if(INTENT_GRAB)
- if(attacker_style && attacker_style.grab_act(H, src))
- return 1
- else
- src.grabbedby(M)
- return 1
-
- if(INTENT_HARM)
- //Vampire code
- if(M.mind && M.mind.vampire && (M.mind in ticker.mode.vampires) && !M.mind.vampire.draining && M.zone_sel && M.zone_sel.selecting == "head" && src != M)
- if((NO_BLOOD in species.species_traits) || species.exotic_blood || !blood_volume)
- to_chat(M, "They have no blood!")
- return
- if(mind && mind.vampire && (mind in ticker.mode.vampires))
- to_chat(M, "Your fangs fail to pierce [name]'s cold flesh")
- return
- if(SKELETON in mutations)
- to_chat(M, "There is no blood in a skeleton!")
- return
- if(issmall(src) && !ckey) //Monkeyized humans are okay, humanized monkeys are okay, NPC monkeys are not.
- to_chat(M, "Blood from a monkey is useless!")
- return
- //we're good to suck the blood, blaah
- M.mind.vampire.handle_bloodsucking(src)
- add_attack_logs(M, src, "vampirebit")
- return
- //end vampire codes
- if(attacker_style && attacker_style.harm_act(H, src))
- return 1
- else
- var/datum/unarmed_attack/attack = M.species.unarmed
-
- M.do_attack_animation(src)
- add_attack_logs(M, src, "Melee attacked with fists")
-
- if(!iscarbon(M))
- LAssailant = null
- else
- LAssailant = M
-
- var/damage = rand(M.species.punchdamagelow, M.species.punchdamagehigh)
- damage += attack.damage
- if(!damage)
- playsound(loc, attack.miss_sound, 25, 1, -1)
- visible_message("[M] tried to [pick(attack.attack_verb)] [src]!")
- return 0
-
-
- var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
- var/armor_block = run_armor_check(affecting, "melee")
-
- if(HULK in M.mutations)
- adjustBruteLoss(15)
-
- playsound(loc, attack.attack_sound, 25, 1, -1)
-
- visible_message("[M] [pick(attack.attack_verb)]ed [src]!")
-
- apply_damage(damage, BRUTE, affecting, armor_block, sharp = attack.sharp) //moving this back here means Armalis are going to knock you down 70% of the time, but they're pure adminbus anyway.
- if((stat != DEAD) && damage >= M.species.punchstunthreshold)
- visible_message("[M] has weakened [src]!", \
- "[M] has weakened [src]!")
- apply_effect(4, WEAKEN, armor_block)
- forcesay(hit_appends)
- else if(lying)
- forcesay(hit_appends)
-
-
- if(INTENT_DISARM)
- if(attacker_style && attacker_style.disarm_act(H, src))
- return 1
- else
- add_attack_logs(M, src, "Disarmed")
-
- if(w_uniform)
- w_uniform.add_fingerprint(M)
- var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
- var/randn = rand(1, 100)
- if(randn <= 25)
- apply_effect(2, WEAKEN, run_armor_check(affecting, "melee"))
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- visible_message("[M] has pushed [src]!")
- add_attack_logs(M, src, "Pushed over")
- if(!iscarbon(M))
- LAssailant = null
- else
- LAssailant = M
- return
-
- var/talked = 0 // BubbleWrap
-
- if(randn <= 60)
- //BubbleWrap: Disarming breaks a pull
- if(pulling)
- visible_message("[M] has broken [src]'s grip on [pulling]!")
- talked = 1
- stop_pulling()
-
- //BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it?
- if(istype(l_hand, /obj/item/grab))
- var/obj/item/grab/lgrab = l_hand
- if(lgrab.affecting)
- visible_message("[M] has broken [src]'s grip on [lgrab.affecting]!")
- talked = 1
- spawn(1)
- qdel(lgrab)
- if(istype(r_hand, /obj/item/grab))
- var/obj/item/grab/rgrab = r_hand
- if(rgrab.affecting)
- visible_message("[M] has broken [src]'s grip on [rgrab.affecting]!")
- talked = 1
- spawn(1)
- qdel(rgrab)
- //End BubbleWrap
-
- if(!talked) //BubbleWrap
- if(drop_item())
- visible_message("[M] has disarmed [src]!")
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- return
-
-
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] attempted to disarm [src]!")
- return
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index f01ab117448..c45154e4931 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -175,6 +175,11 @@ emp_act
affecting.sabotaged = 1
return 1
+/mob/living/carbon/human/grabbedby(mob/living/user)
+ if(w_uniform)
+ w_uniform.add_fingerprint(user)
+ ..()
+
//Returns 1 if the attack hit, 0 if it missed.
/mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, def_zone)
if(!I || !user)
@@ -343,6 +348,99 @@ emp_act
if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam)
+/mob/living/carbon/human/attack_hand(mob/user)
+ if(..()) //to allow surgery to return properly.
+ return
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ species.spec_attack_hand(H, src)
+
+/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L)
+ if(..()) //successful larva bite.
+ var/damage = rand(1, 3)
+ if(stat != DEAD)
+ L.amount_grown = min(L.amount_grown + damage, L.max_grown)
+ var/obj/item/organ/external/affecting = get_organ(ran_zone(L.zone_sel.selecting))
+ var/armor_block = run_armor_check(affecting, "melee")
+ apply_damage(damage, BRUTE, affecting, armor_block)
+ updatehealth()
+
+/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(check_shields(0, M.name))
+ visible_message("[M] attempted to touch [src]!")
+ return 0
+
+ if(..())
+ if(M.a_intent == INTENT_HARM)
+ if(w_uniform)
+ w_uniform.add_fingerprint(M)
+ var/damage = rand(15, 30)
+ if(!damage)
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
+ visible_message("[M] has lunged at [src]!")
+ return 0
+ var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
+ var/armor_block = run_armor_check(affecting, "melee")
+
+ playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
+ visible_message("[M] has slashed at [src]!", \
+ "[M] has slashed at [src]!")
+
+ apply_damage(damage, BRUTE, affecting, armor_block)
+ if(damage >= 25)
+ visible_message("[M] has wounded [src]!", \
+ "[M] has wounded [src]!")
+ apply_effect(4, WEAKEN, armor_block)
+ add_attack_logs(M, src, "Alien attacked")
+ updatehealth()
+
+ if(M.a_intent == INTENT_DISARM)
+ if(prob(80))
+ var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
+ playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
+ apply_effect(5, WEAKEN, run_armor_check(affecting, "melee"))
+ add_attack_logs(M, src, "Alien tackled")
+ visible_message("[M] has tackled down [src]!")
+ else
+ if(prob(99)) //this looks fucking stupid but it was previously 'var/randn = rand(1, 100); if(randn <= 99)'
+ playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
+ drop_item()
+ visible_message("[M] disarmed [src]!")
+ else
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
+ visible_message("[M] has tried to disarm [src]!")
+
+/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M)
+ if(..())
+ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
+ if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
+ return 0
+ var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
+ var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
+ var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
+ var/obj/item/organ/external/affected = src.get_organ(dam_zone)
+ if(affected)
+ affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
+ apply_damage(damage, M.melee_damage_type, affecting, armor)
+ updatehealth()
+
+/mob/living/carbon/human/attack_slime(mob/living/carbon/slime/M)
+ ..()
+ var/damage = rand(1, 3)
+
+ if(M.is_adult)
+ damage = rand(10, 35)
+ else
+ damage = rand(5, 25)
+
+ var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
+
+ var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
+ var/armor_block = run_armor_check(affecting, "melee")
+ apply_damage(damage, BRUTE, affecting, armor_block)
+
+ return
+
/mob/living/carbon/human/mech_melee_attack(obj/mecha/M)
if(M.occupant.a_intent == INTENT_HARM)
if(M.damtype == "brute")
diff --git a/code/modules/mob/living/carbon/human/species/apollo.dm b/code/modules/mob/living/carbon/human/species/apollo.dm
index f1ca3294017..6c37da34395 100644
--- a/code/modules/mob/living/carbon/human/species/apollo.dm
+++ b/code/modules/mob/living/carbon/human/species/apollo.dm
@@ -56,30 +56,27 @@
to_chat(C, "Your antennae tingle as you are overcome with pain...")
to_chat(C, "It feels like part of you has died.")
-/datum/species/wryn/handle_attack_hand(var/mob/living/carbon/human/H, var/mob/living/carbon/human/M)
- var/obj/item/organ/external/head/head_organ = H.get_organ("head")
- if(M.a_intent == INTENT_HARM)
- if(H.handcuffed)
- if(!H.get_int_organ(/obj/item/organ/internal/wryn/hivenode)) return
- var/turf/p_loc = M.loc
- var/turf/p_loc_m = H.loc
+/datum/species/wryn/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ if(target.handcuffed && target.get_int_organ(/obj/item/organ/internal/wryn/hivenode))
- M.visible_message("[M] begins to violently pull off [H]'s antennae.")
- to_chat(H, "[M] grips your antennae and starts violently pulling!")
- if(do_after(H, 250, target = src))
- if(p_loc == M.loc && p_loc_m == H.loc)
- var/obj/item/organ/internal/wryn/hivenode/node = new /obj/item/organ/internal/wryn/hivenode
- H.remove_language("Wryn Hivemind")
- node.remove(H)
- node.loc = M.loc
- to_chat(M, "You hear a loud crunch as you mercilessly pull off [H]'s antennae.")
- to_chat(H, "You hear a loud crunch as your antennae is ripped off your head by [M].")
- to_chat(H, "It's so quiet...")
- head_organ.h_style = "Bald"
- H.update_hair()
+ user.visible_message("[user] begins to violently pull off [target]'s antennae.")
+ to_chat(target, "[user] grips your antennae and starts violently pulling!")
+ if(do_mob(user, target, 250))
+ var/obj/item/organ/internal/wryn/hivenode/node = new /obj/item/organ/internal/wryn/hivenode
+ target.remove_language("Wryn Hivemind")
+ node.remove(target)
+ node.forceMove(user.loc)
+ to_chat(user, "You hear a loud crunch as you mercilessly pull off [target]'s antennae.")
+ to_chat(target, "You hear a loud crunch as your antennae is ripped off your head by [user].")
+ to_chat(target, "It's so quiet...")
+ var/obj/item/organ/external/head/head_organ = target.get_organ("head")
+ head_organ.h_style = "Bald"
+ target.update_hair()
- add_attack_logs(M, H, "Antennae removed")
- return 0
+ add_attack_logs(user, target, "Antennae removed")
+ return 0
+ else
+ ..()
/datum/species/nucleation
name = "Nucleation"
diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm
index 901d221a8b3..50f969cae45 100644
--- a/code/modules/mob/living/carbon/human/species/species.dm
+++ b/code/modules/mob/living/carbon/human/species/species.dm
@@ -315,8 +315,171 @@
/datum/species/proc/handle_death(var/mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns).
return
-/datum/species/proc/handle_attack_hand(var/mob/living/carbon/human/H, var/mob/living/carbon/human/M) //Handles any species-specific attackhand events.
- return
+/datum/species/proc/help(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ if(attacker_style && attacker_style.help_act(user, target))//adminfu only...
+ return 1
+ if(target.health >= config.health_threshold_crit)
+ target.help_shake_act(user)
+ return 1
+ else
+ user.do_cpr(target)
+
+/datum/species/proc/grab(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ if(attacker_style && attacker_style.grab_act(user, target))
+ return 1
+ else
+ target.grabbedby(user)
+ return 1
+
+/datum/species/proc/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ //Vampire code
+ if(user.mind && user.mind.vampire && (user.mind in ticker.mode.vampires) && !user.mind.vampire.draining && user.zone_sel && user.zone_sel.selecting == "head" && target != user)
+ if((NO_BLOOD in target.species.species_traits) || target.species.exotic_blood || !target.blood_volume)
+ to_chat(user, "They have no blood!")
+ return
+ if(target.mind && target.mind.vampire && (target.mind in ticker.mode.vampires))
+ to_chat(user, "Your fangs fail to pierce [target.name]'s cold flesh")
+ return
+ if(SKELETON in target.mutations)
+ to_chat(user, "There is no blood in a skeleton!")
+ return
+ if(issmall(target) && !target.ckey) //Monkeyized humans are okay, humanized monkeys are okay, NPC monkeys are not.
+ to_chat(user, "Blood from a monkey is useless!")
+ return
+ //we're good to suck the blood, blaah
+ user.mind.vampire.handle_bloodsucking(target)
+ add_attack_logs(user, target, "vampirebit")
+ return
+ //end vampire codes
+ if(attacker_style && attacker_style.harm_act(user, target))
+ return 1
+ else
+ var/datum/unarmed_attack/attack = user.species.unarmed
+
+ user.do_attack_animation(target)
+ add_attack_logs(user, target, "Melee attacked with fists", admin_notify = target.ckey ? TRUE : FALSE)
+
+ if(!iscarbon(user))
+ target.LAssailant = null
+ else
+ target.LAssailant = user
+
+ var/damage = rand(user.species.punchdamagelow, user.species.punchdamagehigh)
+ damage += attack.damage
+ if(!damage)
+ playsound(target.loc, attack.miss_sound, 25, 1, -1)
+ target.visible_message("[user] tried to [pick(attack.attack_verb)] [target]!")
+ return 0
+
+
+ var/obj/item/organ/external/affecting = target.get_organ(ran_zone(user.zone_sel.selecting))
+ var/armor_block = target.run_armor_check(affecting, "melee")
+
+ if(HULK in user.mutations)
+ target.adjustBruteLoss(15)
+
+ playsound(target.loc, attack.attack_sound, 25, 1, -1)
+
+ target.visible_message("[user] [pick(attack.attack_verb)]ed [target]!")
+
+ target.apply_damage(damage, BRUTE, affecting, armor_block, sharp = attack.sharp) //moving this back here means Armalis are going to knock you down 70% of the time, but they're pure adminbus anyway.
+ if((target.stat != DEAD) && damage >= user.species.punchstunthreshold)
+ target.visible_message("[user] has weakened [target]!", \
+ "[user] has weakened [target]!")
+ target.apply_effect(4, WEAKEN, armor_block)
+ target.forcesay(hit_appends)
+ else if(target.lying)
+ target.forcesay(hit_appends)
+
+/datum/species/proc/disarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ if(attacker_style && attacker_style.disarm_act(user, target))
+ return 1
+ else
+ add_attack_logs(user, target, "Disarmed", admin_notify = FALSE)
+ user.do_attack_animation(target)
+ if(target.w_uniform)
+ target.w_uniform.add_fingerprint(user)
+ var/obj/item/organ/external/affecting = target.get_organ(ran_zone(user.zone_sel.selecting))
+ var/randn = rand(1, 100)
+ if(randn <= 25)
+ target.apply_effect(2, WEAKEN, target.run_armor_check(affecting, "melee"))
+ playsound(target.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ target.visible_message("[user] has pushed [target]!")
+ add_attack_logs(user, target, "Pushed over", admin_notify = FALSE)
+ if(!iscarbon(user))
+ target.LAssailant = null
+ else
+ target.LAssailant = user
+ return
+
+ var/talked = 0 // BubbleWrap
+
+ if(randn <= 60)
+ //BubbleWrap: Disarming breaks a pull
+ if(target.pulling)
+ target.visible_message("[user] has broken [target]'s grip on [target.pulling]!")
+ talked = 1
+ target.stop_pulling()
+
+ //BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it?
+ if(istype(target.l_hand, /obj/item/grab))
+ var/obj/item/grab/lgrab = target.l_hand
+ if(lgrab.affecting)
+ target.visible_message("[user] has broken [target]'s grip on [lgrab.affecting]!")
+ talked = 1
+ spawn(1)
+ qdel(lgrab)
+ if(istype(target.r_hand, /obj/item/grab))
+ var/obj/item/grab/rgrab = target.r_hand
+ if(rgrab.affecting)
+ target.visible_message("[user] has broken [target]'s grip on [rgrab.affecting]!")
+ talked = 1
+ spawn(1)
+ qdel(rgrab)
+ //End BubbleWrap
+
+ if(!talked) //BubbleWrap
+ if(target.drop_item())
+ target.visible_message("[user] has disarmed [target]!")
+ playsound(target.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ return
+
+
+ playsound(target.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ target.visible_message("[user] attempted to disarm [target]!")
+
+/datum/species/proc/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art) //Handles any species-specific attackhand events.
+ if(!istype(M))
+ return
+ if(H.frozen)
+ to_chat(M, "Do not touch Admin-Frozen people.")
+ return
+
+ if(istype(M))
+ var/obj/item/organ/external/temp = M.bodyparts_by_name["r_hand"]
+ if(M.hand)
+ temp = M.bodyparts_by_name["l_hand"]
+ if(!temp || !temp.is_usable())
+ to_chat(M, "You can't use your hand.")
+ return
+
+ if((M != H) && M.a_intent != INTENT_HELP && H.check_shields(0, M.name, attack_type = UNARMED_ATTACK))
+ add_attack_logs(M, H, "Melee attacked with fists (miss/block)")
+ H.visible_message("[M] attempted to touch [H]!")
+ return 0
+
+ switch(M.a_intent)
+ if(INTENT_HELP)
+ help(M, H, attacker_style)
+
+ if(INTENT_GRAB)
+ grab(M, H, attacker_style)
+
+ if(INTENT_HARM)
+ harm(M, H, attacker_style)
+
+ if(INTENT_DISARM)
+ disarm(M, H, attacker_style)
/datum/species/proc/say_filter(mob/M, message, datum/language/speaking)
return message
diff --git a/code/modules/mob/living/carbon/slime/death.dm b/code/modules/mob/living/carbon/slime/death.dm
index 240454f3e0f..5c551d6e470 100644
--- a/code/modules/mob/living/carbon/slime/death.dm
+++ b/code/modules/mob/living/carbon/slime/death.dm
@@ -1,4 +1,6 @@
/mob/living/carbon/slime/death(gibbed)
+ if(stat == DEAD)
+ return
if(!gibbed)
if(is_adult)
var/mob/living/carbon/slime/M = new /mob/living/carbon/slime(loc)
@@ -11,13 +13,11 @@
number = rand(1, 1000)
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
return
-
- if(stat == DEAD) return
+ else
+ visible_message("The [name] seizes up and falls limp...")
stat = DEAD
icon_state = "[colour] baby slime dead"
overlays.len = 0
- for(var/mob/O in viewers(src, null))
- O.show_message("The [name] seizes up and falls limp...", 1) //ded -- Urist
update_canmove()
diff --git a/code/modules/mob/living/carbon/slime/emote.dm b/code/modules/mob/living/carbon/slime/emote.dm
index b4a6eb140f0..89a48096b23 100644
--- a/code/modules/mob/living/carbon/slime/emote.dm
+++ b/code/modules/mob/living/carbon/slime/emote.dm
@@ -1,4 +1,4 @@
-/mob/living/carbon/slime/emote(var/act, var/m_type=1, var/message = null)
+/mob/living/carbon/slime/emote(act, m_type = 1, message = null)
if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
//param = copytext(act, t1 + 1, length(act) + 1)
@@ -8,6 +8,9 @@
act = copytext(act,1,length(act))
act = lowertext(act)
+
+ var/regenerate_icons
+
switch(act) //Alphabetical please
if("me")
if(silent)
@@ -58,18 +61,44 @@
message = "The [src.name] vibrates!"
m_type = 1
+ if("noface") //mfw I have no face
+ mood = null
+ regenerate_icons = 1
+
+ if("smile")
+ mood = "mischevous"
+ regenerate_icons = 1
+
+ if(":3")
+ mood = ":33"
+ regenerate_icons = 1
+
+ if("pout")
+ mood = "pout"
+ regenerate_icons = 1
+
+ if("frown")
+ mood = "sad"
+ regenerate_icons = 1
+
+ if("scowl")
+ mood = "angry"
+ regenerate_icons = 1
+
if("help") //This is an exception
- to_chat(src, "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate")
+ to_chat(src, "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate. \n\nYou may also change your face with: \n\nsmile, :3, pout, frown, scowl, noface")
else
to_chat(src, "Unusable emote '[act]'. Say *help for a list.")
- if((message && src.stat == 0))
+ if((message && stat == CONSCIOUS))
+ if(client)
+ log_emote("[name]/[key] : [message]")
if(m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(703)
+ visible_message(message)
else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(746)
+ loc.audible_message(message)
+
+ if(regenerate_icons)
+ regenerate_icons()
+
return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm
index e0afe00ada2..ced452ab652 100644
--- a/code/modules/mob/living/carbon/slime/life.dm
+++ b/code/modules/mob/living/carbon/slime/life.dm
@@ -156,7 +156,14 @@
if(reagents)
reagents.metabolize(src)
- src.updatehealth()
+
+ if(reagents.get_reagent_amount("plasma")>=5)
+ mutation_chance = min(mutation_chance + 5,50) //Prevents mutation chance going >50%
+ reagents.remove_reagent("plasma", 5)
+ if(reagents.get_reagent_amount("epinephrine")>=5)
+ mutation_chance = max(mutation_chance - 5,0) //Prevents mutation chance going <0%
+ reagents.remove_reagent("epinephrine", 5)
+ updatehealth()
return //TODO: DEFERRED
@@ -235,6 +242,10 @@
/mob/living/carbon/slime/proc/handle_nutrition()
+ if(docile) //God as my witness, I will never go hungry again
+ nutrition = 700
+ return
+
if(prob(15))
nutrition -= 1 + is_adult
@@ -254,6 +265,15 @@
else
Evolve()
+/mob/living/carbon/slime/proc/add_nutrition(nutrition_to_add = 0, lastnut = 0)
+ nutrition = min((nutrition + nutrition_to_add), get_max_nutrition())
+ if(nutrition >= (lastnut + 50))
+ if(prob(80))
+ lastnut = nutrition
+ powerlevel++
+ if(powerlevel > 10)
+ powerlevel = 10
+ adjustToxLoss(-10)
/mob/living/carbon/slime/proc/handle_targets()
if(Tempstun)
@@ -282,7 +302,7 @@
if(Target)
--target_patience
- if(target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention
+ if(target_patience <= 0 || SStun || Discipline || attacked || docile) // Tired of chasing or something draws out attention
target_patience = 0
Target = null
@@ -365,6 +385,8 @@
else
if(holding_still)
holding_still = max(holding_still - 1, 0)
+ else if(docile && pulledby)
+ holding_still = 10
else if(canmove && isturf(loc) && prob(33))
step(src, pick(cardinal))
else if(!AIproc)
@@ -374,8 +396,12 @@
/mob/living/carbon/slime/proc/handle_speech_and_mood()
//Mood starts here
var/newmood = ""
- if(rabid || attacked) newmood = "angry"
- else if(Target) newmood = "mischevous"
+ if(rabid || attacked)
+ newmood = "angry"
+ else if(docile)
+ newmood = ":3"
+ else if(Target)
+ newmood = "mischevous"
if(!newmood)
if(Discipline && prob(25))
@@ -544,8 +570,13 @@
if(is_adult) return 300
else return 200
-/mob/living/carbon/slime/proc/will_hunt(var/hunger = -1) // Check for being stopped from feeding and chasing
- if(hunger == 2 || rabid || attacked) return 1
- if(Leader) return 0
- if(holding_still) return 0
+/mob/living/carbon/slime/proc/will_hunt(hunger = -1) // Check for being stopped from feeding and chasing
+ if(docile)
+ return 0
+ if(hunger == 2 || rabid || attacked)
+ return 1
+ if(Leader)
+ return 0
+ if(holding_still)
+ return 0
return 1
diff --git a/code/modules/mob/living/carbon/slime/powers.dm b/code/modules/mob/living/carbon/slime/powers.dm
index 95359f7d573..a2aca96c163 100644
--- a/code/modules/mob/living/carbon/slime/powers.dm
+++ b/code/modules/mob/living/carbon/slime/powers.dm
@@ -3,11 +3,15 @@
set desc = "This will let you feed on any valid creature in the surrounding area. This should also be used to halt the feeding process."
if(Victim)
Feedstop()
- return
+ return 0
+
+ if(docile)
+ to_chat(src, "I'm not hungry anymore...")
+ return 0
if(stat)
to_chat(src, "I must be conscious to do this...")
- return
+ return 0
var/list/choices = list()
for(var/mob/living/C in view(1,src))
@@ -15,32 +19,31 @@
choices += C
var/mob/living/M = input(src,"Who do you wish to feed on?") in null|choices
- if(!M) return
+ if(!M)
+ return 0
if(Adjacent(M))
-
- if(!istype(src, /mob/living/carbon/brain))
- if(!istype(M, /mob/living/carbon/slime))
- if(stat != 2)
- if(health > -70)
-
- for(var/mob/living/carbon/slime/met in view())
- if(met.Victim == M && met != src)
- to_chat(src, "The [met.name] is already feeding on this subject...")
- return
- to_chat(src, "I have latched onto the subject and begun feeding...")
- to_chat(M, "The [src.name] has latched onto your head!")
- Feedon(M)
-
- else
- to_chat(src, "This subject does not have a strong enough life energy...")
- else
- to_chat(src, "This subject does not have an edible life energy...")
- else
- to_chat(src, "I must not feed on my brothers...")
- else
+ if(isbrain(M))
to_chat(src, "This subject does not have an edible life energy...")
+ return 0
+ if(iscarbon(M) && (M.health < -70))
+ to_chat(src, "This subject does not have a strong enough life energy...")
+ return 0
+ if(isanimal(M) && (M.health < 1))//animals don't go into crit, stupid; fixes infinite energy exploit
+ to_chat(src, "This subject does not have a strong enough life energy...")
+ return 0
+
+ for(var/mob/living/carbon/slime/met in view())
+ if(met.Victim == M && met != src)
+ to_chat(src, "The [met.name] is already feeding on this subject...")
+ return 0
+
+ to_chat(src, "I have latched onto the subject and begun feeding...")
+ to_chat(M, "The [name] has latched onto your head!")
+
+ Feedon(M)
+ return 1
/mob/living/carbon/slime/proc/Feedon(var/mob/living/M)
Victim = M
@@ -49,55 +52,49 @@
anchored = 1
var/lastnut = nutrition
var/fed_succesfully = 0
+ var/health_minimum = -70
if(is_adult)
icon_state = "[colour] adult slime eat"
else
icon_state = "[colour] baby slime eat"
- while(Victim && M.health > -70 && M.stat != DEAD && stat != DEAD)
+ if(isanimal(Victim))
+ health_minimum = 0
+ while(Victim && Victim.health > health_minimum && stat != DEAD)
canmove = 0
- if(Adjacent(M))
+ if(Adjacent(Victim))
loc = M.loc
- if(prob(15) && M.client && istype(M, /mob/living/carbon))
- to_chat(M, "[pick("You can feel your body becoming weak!", \
- "You feel like you're about to die!", \
- "You feel every part of your body screaming in agony!", \
- "A low, rolling pain passes through your body!", \
- "Your body feels as if it's falling apart!", \
- "You feel extremely weak!", \
- "A sharp, deep pain bathes every inch of your body!")]")
-
- if(istype(M, /mob/living/carbon))
+ if(iscarbon(Victim))
Victim.adjustCloneLoss(rand(5,6))
Victim.adjustToxLoss(rand(1,2))
if(Victim.health <= 0)
Victim.adjustToxLoss(rand(2,4))
+ if(prob(15) && Victim.client)
+ to_chat(Victim, "[pick("You can feel your body becoming weak!", \
+ "You feel like you're about to die!", \
+ "You feel every part of your body screaming in agony!", \
+ "A low, rolling pain passes through your body!", \
+ "Your body feels as if it's falling apart!", \
+ "You feel extremely weak!", \
+ "A sharp, deep pain bathes every inch of your body!")]")
+
fed_succesfully = 1
- else if(istype(M, /mob/living/simple_animal))
+ else if(health_minimum == 0) //we already know it's a simple_animal from above
Victim.adjustBruteLoss(is_adult ? rand(7, 15) : rand(4, 12))
fed_succesfully = 1
else
- if(prob(25))
- to_chat(src, "[pick("This subject is incompatable", \
- "This subject does not have a life energy", "This subject is empty", \
- "I am not satisified", "I can not feed from this subject", \
- "I do not feel nourished", "This subject is not food")]...")
+ to_chat(src, "[pick("This subject is incompatable", \
+ "This subject does not have a life energy", "This subject is empty", \
+ "I am not satisified", "I can not feed from this subject", \
+ "I do not feel nourished", "This subject is not food")]...")
if(fed_succesfully)
- //I have no idea why this is not in handle_nutrition()
- nutrition += rand(15,30)
- if(nutrition >= lastnut + 50)
- if(prob(80))
- lastnut = nutrition
- powerlevel++
- if(powerlevel > 10)
- powerlevel = 10
- adjustToxLoss(-10)
+ add_nutrition(rand(15,30), lastnut)
//Heal yourself.
adjustOxyLoss(-10)
@@ -128,7 +125,7 @@
anchored = 0
if(M)
- if(M.health <= -70)
+ if(M.health <= health_minimum)
M.canmove = 0
if(!client)
if(Victim && !rabid && !attacked)
diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm
index 5fa5a09c441..ecb233a2ebf 100644
--- a/code/modules/mob/living/carbon/slime/slime.dm
+++ b/code/modules/mob/living/carbon/slime/slime.dm
@@ -5,18 +5,14 @@
pass_flags = PASSTABLE
ventcrawler = 2
speak_emote = list("telepathically chirps")
-
layer = 5
-
maxHealth = 150
health = 150
gender = NEUTER
-
nutrition = 700
-
see_in_dark = 8
update_slimes = 0
-
+ faction = list("slime","neutral")
// canstun and canweaken don't affect slimes because they ignore stun and weakened variables
// for the sake of cleanliness, though, here they are.
status_flags = CANPARALYSE|CANPUSH
@@ -44,7 +40,7 @@
var/mood = "" // To show its face
var/is_adult = 0
-
+ var/docile = 0
var/core_removal_stage = 0 //For removing cores.
var/mutator_used = FALSE //So you can't shove a dozen mutators into a single slime
@@ -140,7 +136,8 @@
stat(null, "Health: [round((health / 150) * 100)]%")
if(client.statpanel == "Status")
- stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
+ if(!docile)
+ stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
if(amount_grown >= 10)
if(is_adult)
stat(null, "You can reproduce!")
@@ -194,9 +191,9 @@
return
/mob/living/carbon/slime/MouseDrop(atom/movable/A)
- if(isliving(A) && A != usr)
+ if(isliving(A) && A != src && usr == src)
var/mob/living/Food = A
- if(Food.Adjacent(usr) && !stat && Food.stat != DEAD) //messy
+ if(Food.Adjacent(src) && !stat && Food.stat != DEAD) //messy
Feedon(Food)
..()
@@ -207,73 +204,37 @@
return
/mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
+ ..()
if(Victim)
- return // can't attack while eating!
-
- M.do_attack_animation(src)
- visible_message("[M.name] has glomped [src]!", \
- "[M.name] has glomped [src]!")
- var/damage = rand(1, 3)
+ Victim = null
+ visible_message("[M] pulls [src] off!")
+ return
attacked += 5
- if(M.is_adult)
- damage = rand(1, 6)
- else
- damage = rand(1, 3)
- if(health > -100)
- adjustBruteLoss(damage)
+ if(nutrition >= 100) //steal some nutrition. negval handled in life()
+ nutrition -= (50 + (5 * M.amount_grown))
+ M.add_nutrition(50 + (5 * M.amount_grown))
+ if(health > 0)
+ adjustBruteLoss(4 + (2 * M.amount_grown)) //amt_grown isn't very linear but it works
updatehealth()
- return
+ M.adjustBruteLoss(-4 + (-2 * M.amount_grown))
+ M.updatehealth()
-/mob/living/carbon/slime/attack_animal(mob/living/simple_animal/M as mob)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- M.do_attack_animation(src)
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- visible_message("[M] [M.attacktext] [src]!", \
- "[M] [M.attacktext] [src]!")
+/mob/living/carbon/slime/attack_animal(mob/living/simple_animal/M)
+ if(..())
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- add_attack_logs(src, M, "Slime'd for [damage] damage")
attacked += 10
adjustBruteLoss(damage)
updatehealth()
-/mob/living/carbon/slime/attack_larva(mob/living/carbon/alien/larva/L as mob)
-
- switch(L.a_intent)
-
- if(INTENT_HELP)
- visible_message("[L] rubs its head against [src].")
-
-
- else
- L.do_attack_animation(src)
- attacked += 10
- visible_message("[L] bites [src]!", \
- "[L] bites [src]!")
- playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
-
- if(stat != DEAD)
- var/damage = rand(1, 3)
- L.amount_grown = min(L.amount_grown + damage, L.max_grown)
- adjustBruteLoss(damage)
-
-/mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
- ..()
+/mob/living/carbon/slime/attack_larva(mob/living/carbon/alien/larva/L)
+ if(..()) //successful larva bite.
+ var/damage = rand(1, 3)
+ if(stat != DEAD)
+ L.amount_grown = min(L.amount_grown + damage, L.max_grown)
+ adjustBruteLoss(damage)
+ updatehealth()
+/mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M)
if(Victim)
if(Victim == M)
if(prob(60))
@@ -298,6 +259,7 @@
return
else
+ M.do_attack_animation(src)
if(prob(30))
visible_message("[M] attempts to wrestle \the [name] off of [Victim]!")
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
@@ -322,12 +284,9 @@
step_away(src,M)
return
- else
- if(stat == DEAD && surgeries.len)
- if(M.a_intent == INTENT_HELP)
- for(var/datum/surgery/S in surgeries)
- if(S.next_step(M, src))
- return 1
+
+ if(..()) //To allow surgery to return properly.
+ return
switch(M.a_intent)
@@ -340,7 +299,6 @@
else
M.do_attack_animation(src)
var/damage = rand(1, 9)
-
attacked += 10
if(prob(90))
if(HULK in M.mutations)
@@ -352,16 +310,16 @@
if(prob(80) && !client)
Discipline++
spawn(0)
-
step_away(src,M,15)
sleep(3)
step_away(src,M,15)
playsound(loc, "punch", 25, 1, -1)
+ add_attack_logs(M, src, "Melee attacked with fists")
visible_message("[M] has punched [src]!", \
"[M] has punched [src]!")
- if(health > -100)
+ if(stat != DEAD)
adjustBruteLoss(damage)
updatehealth()
else
@@ -369,23 +327,9 @@
visible_message("[M] has attempted to punch [src]!")
return
-
-
-/mob/living/carbon/slime/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
- switch(M.a_intent)
- if(INTENT_HELP)
- visible_message("[M] caresses [src] with its scythe like arm.")
-
- if(INTENT_HARM)
- M.do_attack_animation(src)
+/mob/living/carbon/slime/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(..()) //if harm or disarm intent.
+ if(M.a_intent == INTENT_HARM)
if(prob(95))
attacked += 10
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
@@ -397,7 +341,8 @@
else
visible_message("[M] has wounded [name]!", \
")[M] has wounded [name]!")
- if(health > -100)
+ add_attack_logs(M, src, "Alien attacked")
+ if(stat != DEAD)
adjustBruteLoss(damage)
updatehealth()
else
@@ -405,11 +350,7 @@
visible_message("[M] has attempted to lunge at [name]!", \
"[M] has attempted to lunge at [name]!")
- if(INTENT_GRAB)
- grabbedby(M)
-
- if(INTENT_DISARM)
- M.do_attack_animation(src)
+ if(M.a_intent == INTENT_DISARM)
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
var/damage = 5
attacked += 10
@@ -424,7 +365,7 @@
anchored = 0
if(prob(80) && !client)
Discipline++
- if(!istype(src, /mob/living/carbon/slime))
+ if(!isslime(src))
if(Discipline == 1)
attacked = 0
@@ -442,16 +383,12 @@
drop_item()
visible_message("[M] has disarmed [name]!",
"[M] has disarmed [name]!")
+ add_attack_logs(M, src, "Alien disarmed")
adjustBruteLoss(damage)
updatehealth()
return
-/mob/living/carbon/slime/attackby(obj/item/W, mob/user, params)
- if(stat == DEAD && surgeries.len)
- if(user.a_intent == INTENT_HELP)
- for(var/datum/surgery/S in surgeries)
- if(S.next_step(user, src))
- return 1
+/mob/living/carbon/slime/attackby(obj/item/W, mob/living/user, params)
if(istype(W,/obj/item/stack/sheet/mineral/plasma)) //Lets you feed slimes plasma.
if(user in Friends)
++Friends[user]
@@ -464,6 +401,7 @@
else if(W.force > 0)
attacked += 10
if(prob(25))
+ user.do_attack_animation(src)
to_chat(user, "[W] passes right through [src]!")
return
if(Discipline && prob(50)) // wow, buddy, why am I getting attacked??
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index d1eeafa6b19..38065ac1f2c 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -229,18 +229,18 @@
// End BS12 momentum-transfer code.
-/mob/living/proc/grabbedby(mob/living/carbon/user,var/supress_message = 0)
+/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = 0)
if(user == src || anchored)
return 0
if(!(status_flags & CANPUSH))
return 0
- for(var/obj/item/grab/G in src.grabbed_by)
+ for(var/obj/item/grab/G in grabbed_by)
if(G.assailant == user)
to_chat(user, "You already grabbed [src].")
return
- add_attack_logs(user, src, "Grabbed passively")
+ add_attack_logs(user, src, "Grabbed passively", admin_notify = FALSE)
var/obj/item/grab/G = new /obj/item/grab(user, src)
if(buckled)
@@ -261,4 +261,78 @@
if(!supress_message)
visible_message("[user] has grabbed [src] passively!")
- return G
\ No newline at end of file
+ return G
+
+/mob/living/attack_slime(mob/living/carbon/slime/M)
+ if(!ticker)
+ to_chat(M, "You cannot attack people before the game has started.")
+ return
+
+ if(M.Victim)
+ return // can't attack while eating!
+
+ if(stat != DEAD)
+ M.do_attack_animation(src)
+ visible_message("The [M.name] glomps [src]!", \
+ "The [M.name] glomps [src]!")
+
+ 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("The [M.name] has shocked [src]!", \
+ "The [M.name] has shocked [src]!")
+
+ var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
+ s.set_up(5, 1, src)
+ s.start()
+ return 1
+ add_attack_logs(src, M, "Slime'd")
+ return
+
+/mob/living/attack_animal(mob/living/simple_animal/M)
+ if(M.melee_damage_upper == 0)
+ M.custom_emote(1, "[M.friendly] [src]")
+ return 0
+ else
+ if(M.attack_sound)
+ playsound(loc, M.attack_sound, 50, 1, 1)
+ M.do_attack_animation(src)
+ visible_message("\The [M] [M.attacktext] [src]!", \
+ "\The [M] [M.attacktext] [src]!")
+ add_attack_logs(M, src, "Animal attacked")
+ return 1
+
+/mob/living/attack_larva(mob/living/carbon/alien/larva/L)
+ switch(L.a_intent)
+ if(INTENT_HELP)
+ visible_message("[L.name] rubs its head against [src].")
+ return 0
+
+ else
+ L.do_attack_animation(src)
+ if(prob(90))
+ add_attack_logs(L, src, "Larva attacked")
+ visible_message("[L.name] bites [src]!", \
+ "[L.name] bites [src]!")
+ playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
+ return 1
+ else
+ visible_message("[L.name] has attempted to bite [src]!", \
+ "[L.name] has attempted to bite [src]!")
+ return 0
+
+/mob/living/attack_alien(mob/living/carbon/alien/humanoid/M)
+ switch(M.a_intent)
+ if(INTENT_HELP)
+ visible_message("[M] caresses [src] with its scythe like arm.")
+ return FALSE
+ if(INTENT_GRAB)
+ grabbedby(M)
+ return FALSE
+ else
+ M.do_attack_animation(src)
+ return TRUE
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 1b41edc5810..c84c7bdbbed 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -686,62 +686,6 @@ var/list/ai_verbs_default = list(
updatehealth()
return 2
-
-/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(isturf(loc) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
- switch(M.a_intent)
-
- if(INTENT_HELP)
- visible_message("[M] caresses [src]'s plating with its scythe like arm.")
-
- else //harm
- M.do_attack_animation(src)
- var/damage = rand(10, 20)
- if(prob(90))
- playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
- visible_message("[M] has slashed at [src]!",\
- "[M] has slashed at [src]!")
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
- visible_message("[M] took a swipe at [src]!", \
- "[M] took a swipe at [src]!")
-
- return
-
-/mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- M.do_attack_animation(src)
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- visible_message("[M] [M.attacktext] [src]!")
- add_attack_logs(M, src, "Animal attacked", FALSE)
- 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)
- updatehealth()
-
/mob/living/silicon/ai/reset_perspective(atom/A)
if(camera_light_on)
light_cameras()
diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm
new file mode 100644
index 00000000000..6d32c24bb0a
--- /dev/null
+++ b/code/modules/mob/living/silicon/ai/ai_defense.dm
@@ -0,0 +1,8 @@
+/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(!ticker)
+ to_chat(M, "You cannot attack people before the game has started.")
+ return
+ ..()
+
+/mob/living/silicon/ai/attack_slime(mob/living/carbon/slime/user)
+ return //immune to slimes
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index 94fe1eb06f0..54ebdaf4da2 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -242,41 +242,6 @@
adjustBruteLoss(damage)
updatehealth()
-/mob/living/silicon/pai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "You cannot attack someone in the spawn area.")
- return
-
- switch(M.a_intent)
-
- if(INTENT_HELP)
- for(var/mob/O in viewers(src, null))
- if((O.client && !( O.blinded )))
- O.show_message(text("[M] caresses [src]'s casing with its scythe like arm."), 1)
-
- else //harm
- M.do_attack_animation(src)
- var/damage = rand(10, 20)
- if(prob(90))
- playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
- for(var/mob/O in viewers(src, null))
- if((O.client && !( O.blinded )))
- O.show_message(text("[] has slashed at []!", M, src), 1)
- if(prob(8))
- flash_eyes(affect_silicon = 1)
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
- for(var/mob/O in viewers(src, null))
- if((O.client && !( O.blinded )))
- O.show_message(text("[] took a swipe at []!", M, src), 1)
- return
-
/mob/living/silicon/pai/proc/switchCamera(var/obj/machinery/camera/C)
usr:cameraFollow = null
if(!C)
diff --git a/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm b/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm
index 48b9d558979..b3e6a62cb2e 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone_abilities.dm
@@ -43,11 +43,11 @@
control_headlamp()
//Actual picking-up event.
-/mob/living/silicon/robot/drone/attack_hand(mob/living/carbon/human/M as mob)
+/mob/living/silicon/robot/drone/attack_hand(mob/living/carbon/human/M)
if(M.a_intent == INTENT_HELP)
get_scooped(M)
-
- ..()
+ else
+ ..()
/mob/living/silicon/robot/drone/verb/customize()
set name = "Customize Chassis"
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index f561d733535..701909d87ea 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -832,126 +832,10 @@ var/list/robot_verbs_default = list(
update_icons()
to_chat(usr, "You unlock your cover.")
-/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(istype(loc, /turf) && istype(loc.loc, /area/start))
- to_chat(M, "No attacking people at spawn, you jackass.")
- return
-
- switch(M.a_intent)
-
- if(INTENT_HELP)
- for(var/mob/O in viewers(src, null))
- if((O.client && !( O.blinded )))
- O.show_message(text("[M] caresses [src]'s plating with its scythe like arm."), 1)
-
- if(INTENT_GRAB)
- grabbedby(M)
-
- if(INTENT_HARM)
- M.do_attack_animation(src)
- var/damage = rand(10, 20)
- if(prob(90))
- playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
- visible_message("[M] has slashed at [src]!",\
- "[M] has slashed at [src]!")
- if(prob(8))
- flash_eyes(affect_silicon = 1)
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
- visible_message("[M] took a swipe at [src]!", \
- "[M] took a swipe at [src]!")
-
- if(INTENT_DISARM)
- if(!(lying))
- M.do_attack_animation(src)
- if(prob(85))
- Stun(7)
- step(src,get_dir(M,src))
- spawn(5)
- step(src,get_dir(M,src))
- playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
- visible_message("[M] has forced back [src]!",\
- "[M] has forced back [src]!")
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
- visible_message("[M] attempted to force back [src]!",\
- "[M] attempted to force back [src]!")
- return
-
-
-
-/mob/living/silicon/robot/attack_slime(mob/living/carbon/slime/M as mob)
- if(..()) //successful slime shock
- flash_eyes(affect_silicon = 1)
- var/stunprob = M.powerlevel * 7 + 10
- if(prob(stunprob) && M.powerlevel >= 8)
- adjustBruteLoss(M.powerlevel * rand(6,10))
-
- var/damage = rand(1, 3)
-
- if(M.is_adult)
- damage = rand(20, 40)
- else
- damage = rand(5, 35)
- damage = round(damage / 2) // borgs recieve half damage
- adjustBruteLoss(damage)
- updatehealth()
-
- return
-
-/mob/living/silicon/robot/attack_animal(mob/living/simple_animal/M as mob)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- M.do_attack_animation(src)
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- visible_message("[M] [M.attacktext] [src]!")
- add_attack_logs(M, src, "Animal attacked", FALSE)
- 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)
- updatehealth()
-
/mob/living/silicon/robot/attack_ghost(mob/user)
if(wiresexposed)
wires.Interact(user)
-/mob/living/silicon/robot/attack_hand(mob/user)
- add_fingerprint(user)
-
- if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
- if(cell)
- cell.updateicon()
- cell.add_fingerprint(user)
- user.put_in_active_hand(cell)
- to_chat(user, "You remove \the [cell].")
- cell = null
- update_icons()
- diag_hud_set_borgcell()
-
- if(!opened && (!istype(user, /mob/living/silicon)))
- if(user.a_intent == INTENT_HELP)
- user.visible_message("[user] pets [src]!", \
- "You pet [src]!")
-
/mob/living/silicon/robot/proc/allowed(obj/item/I)
var/obj/dummy = new /obj(null) // Create a dummy object to check access on as to avoid having to snowflake check_access on every mob
dummy.req_access = req_access
diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm
new file mode 100644
index 00000000000..033b244cf8c
--- /dev/null
+++ b/code/modules/mob/living/silicon/robot/robot_defense.dm
@@ -0,0 +1,59 @@
+/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(M.a_intent == INTENT_DISARM)
+ if(!lying)
+ M.do_attack_animation(src)
+ if(prob(85))
+ Stun(7)
+ step(src, get_dir(M,src))
+ spawn(5)
+ step(src, get_dir(M,src))
+ add_attack_logs(M, src, "Alien pushed over")
+ playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
+ visible_message("[M] has forced back [src]!",\
+ "[M] has forced back [src]!")
+ else
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
+ visible_message("[M] took a swipe at [src]!",\
+ "[M] took a swipe at [src]!")
+ else
+ ..()
+ return
+
+/mob/living/silicon/robot/attack_slime(mob/living/carbon/slime/M)
+ if(..()) //successful slime shock
+ flash_eyes(affect_silicon = 1)
+ var/stunprob = M.powerlevel * 7 + 10
+ if(prob(stunprob) && M.powerlevel >= 8)
+ adjustBruteLoss(M.powerlevel * rand(6,10))
+
+ var/damage = rand(1, 3)
+
+ if(M.is_adult)
+ damage = rand(20, 40)
+ else
+ damage = rand(5, 35)
+ damage = round(damage / 2) // borgs recieve half damage
+ adjustBruteLoss(damage)
+ updatehealth()
+ return
+
+/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
+ add_fingerprint(user)
+
+ if(opened && !wiresexposed && !issilicon(user))
+ if(cell)
+ cell.updateicon()
+ cell.add_fingerprint(user)
+ user.put_in_active_hand(cell)
+ to_chat(user, "You remove \the [cell].")
+ cell = null
+ update_icons()
+ diag_hud_set_borgcell()
+
+ if(!opened)
+ if(..()) // hulk attack
+ spark_system.start()
+ spawn(0)
+ step_away(src, user, 15)
+ sleep(3)
+ step_away(src, user, 15)
diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm
new file mode 100644
index 00000000000..480c9442bd7
--- /dev/null
+++ b/code/modules/mob/living/silicon/silicon_defense.dm
@@ -0,0 +1,65 @@
+/mob/living/silicon/grabbedby(mob/living/user)
+ return
+
+/mob/living/silicon/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(..()) //if harm or disarm intent
+ var/damage = rand(10, 20)
+ if(prob(90))
+ playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
+ visible_message("[M] has slashed at [src]!", \
+ "[M] has slashed at [src]!")
+ if(prob(8))
+ flash_eyes(affect_silicon = 1)
+ add_attack_logs(M, src, "Alien attacked")
+ adjustBruteLoss(damage)
+ updatehealth()
+ else
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
+ visible_message("[M] took a swipe at [src]!", \
+ "[M] took a swipe at [src]!")
+ return
+
+/mob/living/silicon/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)
+ updatehealth()
+
+/mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L)
+ if(L.a_intent == INTENT_HELP)
+ visible_message("[L.name] rubs its head against [src].")
+
+/mob/living/silicon/attack_hand(mob/living/carbon/human/M)
+ switch(M.a_intent)
+ if(INTENT_HELP)
+ M.visible_message("[M] pets [src]!", \
+ "You pet [src]!")
+ if("grab")
+ grabbedby(M)
+ else
+ M.do_attack_animation(src)
+ playsound(loc, 'sound/effects/bang.ogg', 10, 1)
+ if(HULK in M.mutations)
+ var/damage = rand(10,15)
+ adjustBruteLoss(damage)
+ add_attack_logs(M, src, "Melee attacked with fists")
+ playsound(loc, "punch", 25, 1, -1)
+ visible_message("[M] has punched [src]!", \
+ "[M] has punched [src]!")
+ return 1
+ else
+ visible_message("[M] punches [src], but doesn't leave a dent.", \
+ "[M] punches [src], but doesn't leave a dent.!")
+ return 0
diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm
new file mode 100644
index 00000000000..b122decd322
--- /dev/null
+++ b/code/modules/mob/living/simple_animal/animal_defense.dm
@@ -0,0 +1,60 @@
+/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M)
+ ..()
+ switch(M.a_intent)
+
+ if(INTENT_HELP)
+ if(health > 0)
+ visible_message("[M] [response_help] [src].")
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+
+ if(INTENT_GRAB)
+ grabbedby(M)
+
+ if(INTENT_HARM, INTENT_DISARM)
+ M.do_attack_animation(src)
+ visible_message("[M] [response_harm] [src]!")
+ playsound(loc, "punch", 25, 1, -1)
+ attack_threshold_check(harm_intent_damage)
+ add_attack_logs(M, src, "Melee attacked with fists")
+ updatehealth()
+ return 1
+
+/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(..()) //if harm or disarm intent.
+ var/damage = rand(15, 30)
+ visible_message("[M] has slashed at [src]!", \
+ "[M] has slashed at [src]!")
+ playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
+ add_attack_logs(M, src, "Alien attacked")
+ attack_threshold_check(damage)
+ return
+
+/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L)
+ if(..()) //successful larva bite
+ var/damage = rand(5, 10)
+ if(stat != DEAD)
+ L.amount_grown = min(L.amount_grown + damage, L.max_grown)
+ attack_threshold_check(damage)
+
+/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
+ if(..())
+ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
+ attack_threshold_check(damage, M.melee_damage_type)
+
+/mob/living/simple_animal/attack_slime(mob/living/carbon/slime/M)
+ ..()
+ var/damage = rand(1, 3)
+
+ if(M.is_adult)
+ damage = rand(20, 40)
+ else
+ damage = rand(5, 35)
+
+ attack_threshold_check(damage)
+ return
+
+/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
+ if(damage <= force_threshold || !damage_coeff[damagetype])
+ visible_message("[src] looks unharmed.")
+ else
+ apply_damage(damage, damagetype)
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index 0b685a261c5..c040fbe1ed2 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -258,21 +258,21 @@
return
return 1 //Successful completion. Used to prevent child process() continuing if this one is ended early.
-/mob/living/simple_animal/bot/attack_alien(var/mob/living/carbon/alien/user as mob)
+/mob/living/simple_animal/bot/attack_alien(mob/living/carbon/alien/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
apply_damage(rand(15,30), BRUTE)
- visible_message("[user] has slashed [src]!")
+ visible_message("[user] has slashed [src]!")
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
if(prob(10))
new /obj/effect/decal/cleanable/blood/oil(loc)
-/mob/living/simple_animal/bot/attack_animal(var/mob/living/simple_animal/M as mob)
+/mob/living/simple_animal/bot/attack_animal(mob/living/simple_animal/M)
M.do_attack_animation(src)
if(M.melee_damage_upper == 0)
return
apply_damage(M.melee_damage_upper, BRUTE)
- visible_message("[M] has [M.attacktext] [src]!")
+ visible_message("[M] has [M.attacktext] [src]!")
add_attack_logs(M, src, "Animal attacked", FALSE)
if(prob(10))
new /obj/effect/decal/cleanable/blood/oil(loc)
diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm
index a831c830459..13e7c893d86 100644
--- a/code/modules/mob/living/simple_animal/friendly/slime.dm
+++ b/code/modules/mob/living/simple_animal/friendly/slime.dm
@@ -20,7 +20,6 @@
maxHealth = 200
icon_state = "grey adult slime"
icon_living = "grey adult slime"
- icon_dead = "grey baby slime dead"
/mob/living/simple_animal/slime/New()
..()
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index a4eba013f94..c7b82dc44b8 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -264,19 +264,6 @@
..(act, m_type, message)
-/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
- if(M.melee_damage_upper == 0)
- M.custom_emote(1, "[M.friendly] [src]")
- else
- M.do_attack_animation(src)
- if(M.attack_sound)
- playsound(loc, M.attack_sound, 50, 1, 1)
- visible_message("\The [M] [M.attacktext] [src]!", \
- "\The [M] [M.attacktext] [src]!")
- add_attack_logs(M, src, "Animal attacked")
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- attack_threshold_check(damage,M.melee_damage_type)
-
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
if(!Proj)
return
@@ -285,104 +272,6 @@
Proj.on_hit(src, 0)
return 0
-/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
- ..()
-
- switch(M.a_intent)
-
- if(INTENT_HELP)
- if(health > 0)
- visible_message(" [M] [response_help] [src].")
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
-
- if(INTENT_GRAB)
- if(M == src || anchored)
- return
- if(!(status_flags & CANPUSH))
- return
-
- var/obj/item/grab/G = new /obj/item/grab(M, src )
-
- M.put_in_active_hand(G)
-
- G.synch()
-
- LAssailant = M
-
- visible_message("[M] has grabbed [src] passively!")
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
-
- if(INTENT_HARM, INTENT_DISARM)
- M.do_attack_animation(src)
- visible_message("[M] [response_harm] [src]!")
- playsound(loc, "punch", 25, 1, -1)
- attack_threshold_check(harm_intent_damage)
-
- return
-
-/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
-
- switch(M.a_intent)
-
- if(INTENT_HELP)
-
- visible_message("[M] caresses [src] with its scythe like arm.")
- if(INTENT_GRAB)
- grabbedby(M)
-
- if(INTENT_HARM, INTENT_DISARM)
- M.do_attack_animation(src)
- var/damage = rand(15, 30)
- visible_message("[M] has slashed at [src]!", \
- "[M] has slashed at [src]!")
- playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
- attack_threshold_check(damage)
-
- return
-
-/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
-
- switch(L.a_intent)
- if(INTENT_HELP)
- visible_message("[L] rubs its head against [src].")
-
-
- else
- L.do_attack_animation(src)
- var/damage = rand(5, 10)
- visible_message("[L] bites [src]!", \
- "[L] bites [src]!")
- playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
-
- if(stat != DEAD)
- L.amount_grown = min(L.amount_grown + damage, L.max_grown)
- attack_threshold_check(damage)
-
-
-/mob/living/simple_animal/attack_slime(mob/living/carbon/slime/M as mob)
- if(!ticker)
- to_chat(M, "You cannot attack people before the game has started.")
- return
-
- if(M.Victim) return // can't attack while eating!
-
- if(health > 0)
- M.do_attack_animation(src)
- visible_message("[M.name] glomps [src]!", \
- "[M.name] glomps [src]!")
-
- var/damage = rand(1, 3)
-
- if(M.is_adult)
- damage = rand(20, 40)
- else
- damage = rand(5, 35)
-
- attack_threshold_check(damage)
-
-
- return
-
/mob/living/simple_animal/attackby(obj/item/O, mob/living/user)
if(can_collar && !collar && istype(O, /obj/item/clothing/accessory/petcollar))
var/obj/item/clothing/accessory/petcollar/C = O
@@ -510,12 +399,6 @@
/mob/living/simple_animal/ExtinguishMob()
return
-/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
- if(damage <= force_threshold || !damage_coeff[damagetype])
- visible_message("[src] looks unharmed from the damage.")
- else
- apply_damage(damage, damagetype)
-
/mob/living/simple_animal/update_transform()
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
var/changed = 0
diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm
index 73fe73180c4..d8058efbb53 100644
--- a/code/modules/research/xenobiology/xenobiology.dm
+++ b/code/modules/research/xenobiology/xenobiology.dm
@@ -140,39 +140,27 @@
/obj/item/slimepotion/docility/attack(mob/living/carbon/slime/M, mob/user)
if(!isslime(M))
- to_chat(user, " The potion only works on slimes!")
+ to_chat(user, "The potion only works on slimes!")
return
if(M.stat)
- to_chat(user, " The slime is dead!")
- return
- if(M.mind)
- to_chat(user, " The slime resists!")
+ to_chat(user, "The slime is dead!")
return
if(being_used)
- to_chat(user, " You're already using this on another slime!")
+ to_chat(user, "You're already using this on another slime!")
return
- var/mob/living/simple_animal/slime/pet
- if(M.is_adult)
- pet = new /mob/living/simple_animal/slime/adult(M.loc)
- pet.icon_state = "[M.colour] adult slime"
- pet.icon_living = "[M.colour] adult slime"
- else
- pet = new /mob/living/simple_animal/slime(M.loc)
- pet.icon_state = "[M.colour] baby slime"
- pet.icon_living = "[M.colour] baby slime"
- pet.icon_dead = "[M.colour] baby slime dead"
- pet.colour = "[M.colour]"
- qdel(M)
+ M.docile = 1
+ M.nutrition = 700
+ to_chat(M, "You absorb the potion and feel your intense desire to feed melt away.")
+ to_chat(user, "You feed the slime the potion, removing its hunger and calming it.")
being_used = 1
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
if(!newname)
newname = "pet slime"
- pet.name = newname
- pet.real_name = newname
+ M.name = newname
+ M.real_name = newname
qdel(src)
- to_chat(user, "You feed the slime the potion, removing it's powers and calming it.")
/obj/item/slimepotion/sentience
name = "sentience potion"
diff --git a/paradise.dme b/paradise.dme
index af23976dccb..438cb2acaae 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -1571,7 +1571,7 @@
#include "code\modules\mob\living\update_status.dm"
#include "code\modules\mob\living\carbon\_defines.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
-#include "code\modules\mob\living\carbon\carbon_defenses.dm"
+#include "code\modules\mob\living\carbon\carbon_defense.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\death.dm"
#include "code\modules\mob\living\carbon\give.dm"
@@ -1580,7 +1580,7 @@
#include "code\modules\mob\living\carbon\update_icons.dm"
#include "code\modules\mob\living\carbon\update_status.dm"
#include "code\modules\mob\living\carbon\alien\alien.dm"
-#include "code\modules\mob\living\carbon\alien\alien_defenses.dm"
+#include "code\modules\mob\living\carbon\alien\alien_defense.dm"
#include "code\modules\mob\living\carbon\alien\death.dm"
#include "code\modules\mob\living\carbon\alien\life.dm"
#include "code\modules\mob\living\carbon\alien\login.dm"
@@ -1589,6 +1589,7 @@
#include "code\modules\mob\living\carbon\alien\humanoid\emote.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\empress.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm"
+#include "code\modules\mob\living\carbon\alien\humanoid\humanoid_defense.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\life.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\queen.dm"
@@ -1600,6 +1601,7 @@
#include "code\modules\mob\living\carbon\alien\larva\emote.dm"
#include "code\modules\mob\living\carbon\alien\larva\inventory.dm"
#include "code\modules\mob\living\carbon\alien\larva\larva.dm"
+#include "code\modules\mob\living\carbon\alien\larva\larva_defense.dm"
#include "code\modules\mob\living\carbon\alien\larva\life.dm"
#include "code\modules\mob\living\carbon\alien\larva\powers.dm"
#include "code\modules\mob\living\carbon\alien\larva\update_icons.dm"
@@ -1621,8 +1623,6 @@
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
-#include "code\modules\mob\living\carbon\human\human_attackalien.dm"
-#include "code\modules\mob\living\carbon\human\human_attackhand.dm"
#include "code\modules\mob\living\carbon\human\human_damage.dm"
#include "code\modules\mob\living\carbon\human\human_defense.dm"
#include "code\modules\mob\living\carbon\human\human_defines.dm"
@@ -1664,8 +1664,10 @@
#include "code\modules\mob\living\silicon\login.dm"
#include "code\modules\mob\living\silicon\say.dm"
#include "code\modules\mob\living\silicon\silicon.dm"
+#include "code\modules\mob\living\silicon\silicon_defense.dm"
#include "code\modules\mob\living\silicon\subsystems.dm"
#include "code\modules\mob\living\silicon\ai\ai.dm"
+#include "code\modules\mob\living\silicon\ai\ai_defense.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"
#include "code\modules\mob\living\silicon\ai\examine.dm"
#include "code\modules\mob\living\silicon\ai\latejoin.dm"
@@ -1703,6 +1705,7 @@
#include "code\modules\mob\living\silicon\robot\photos.dm"
#include "code\modules\mob\living\silicon\robot\robot.dm"
#include "code\modules\mob\living\silicon\robot\robot_damage.dm"
+#include "code\modules\mob\living\silicon\robot\robot_defense.dm"
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
#include "code\modules\mob\living\silicon\robot\robot_module_actions.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
@@ -1716,6 +1719,7 @@
#include "code\modules\mob\living\silicon\robot\drone\drone_manufacturer.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_say.dm"
#include "code\modules\mob\living\silicon\robot\drone\update_status.dm"
+#include "code\modules\mob\living\simple_animal\animal_defense.dm"
#include "code\modules\mob\living\simple_animal\constructs.dm"
#include "code\modules\mob\living\simple_animal\corpse.dm"
#include "code\modules\mob\living\simple_animal\parrot.dm"