Re-add harmbatonning. Adds forcesay: if you're typing when you get hit by a stun weapon, you say a garbled version of what you were typing (from /tg/).

This commit is contained in:
Markolie
2014-11-22 20:22:28 +01:00
parent bab7b3aa09
commit e9fc80fe7f
4 changed files with 45 additions and 3 deletions
+5 -2
View File
@@ -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("<span class='suicide'>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</span>")
@@ -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
@@ -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
@@ -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)
+1
View File
@@ -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")