diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 9a5b30a4e48..dee1abe8b29 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -16,7 +16,7 @@ var/obj/item/weapon/cell/high/bcell = null var/mob/foundmob = "" //Used in throwing proc. var/hitcost = 1500 //oh god why do power cells carry so much charge? We probably need to make a distinction between "industrial" sized power cells for APCs and power cells for everything else. - var/allowharm = 0 // Allow or disallow harming with the stunbaton + var/allowharm = 1 // Allow or disallow harming with the stunbaton /obj/item/weapon/melee/baton/suicide_act(mob/user) user.visible_message("[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.") @@ -114,7 +114,6 @@ deductcharge(hitcost) return - if(isrobot(M)) ..() return @@ -165,6 +164,10 @@ msg_admin_attack("[key_name(user)] stunned [key_name(L)] with the [src].") deductcharge(hitcost) + + if(ishuman(L)) + var/mob/living/carbon/human/H = L + H.forcesay(hit_appends) return 1 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index f15c9a5ac65..abfdc6a69bd 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -264,7 +264,8 @@ emp_act if(armor >= 2) return 0 if(!I.force) return 0 - + var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords) + apply_damage(I.force, I.damtype, affecting, armor, sharp=weapon_sharp, edge=weapon_edge, used_weapon=I) var/bloody = 0 @@ -310,6 +311,10 @@ emp_act if(bloody) bloody_body(src) + + if(Iforce > 10 || Iforce >= 5 && prob(33)) + forcesay(hit_appends) //forcesay checks stat already + //Melee weapon embedded object code. if (I.damtype == BRUTE && !I.is_robot_module()) var/damage = I.force diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 5d1b244e476..9aa5a461e54 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -77,6 +77,39 @@ ..(message) +/mob/living/carbon/human/proc/forcesay(list/append) + if(stat == CONSCIOUS) + if(client) + var/virgin = 1 //has the text been modified yet? + var/temp = winget(client, "input", "text") + if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //case sensitive means + + temp = replacetext(temp, ";", "") //general radio + + if(findtext(trim_left(temp), ":", 6, 7)) //dept radio + temp = copytext(trim_left(temp), 8) + virgin = 0 + + if(virgin) + temp = copytext(trim_left(temp), 6) //normal speech + virgin = 0 + + while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary) + temp = copytext(trim_left(temp), 3) + + if(findtext(temp, "*", 1, 2)) //emotes + return + world << "Text after stuff is [temp]" + temp = copytext(trim_left(temp), 1, rand(5,8)) + world << "Text after trimming is [temp]" + + var/trimmed = trim_left(temp) + if(length(trimmed)) + if(append) + temp += pick(append) + + say(temp) + winset(client, "input", "text=[null]") /mob/living/carbon/human/say_understands(var/other,var/datum/language/speaking = null) diff --git a/code/setup.dm b/code/setup.dm index 6277e4681a1..255f591a4e6 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -912,3 +912,4 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse #define IS_SKRELL 3 #define IS_UNATHI 4 +var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF") \ No newline at end of file