Merge pull request #645 from Zuhayr/grenades

Allowed grenades to be stuffed into mouths and primed.
This commit is contained in:
Neerti
2015-12-24 06:35:07 -05:00
20 changed files with 62 additions and 35 deletions

View File

@@ -105,7 +105,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
if(!iscultist(user)) if(!iscultist(user))
user << "You can't mouth the arcane scratchings without fumbling over them." user << "You can't mouth the arcane scratchings without fumbling over them."
return return
if(istype(user.wear_mask, /obj/item/clothing/mask/muzzle)) if(user.is_muzzled())
user << "You are unable to speak the words of the rune." user << "You are unable to speak the words of the rune."
return return
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss())) if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))

View File

@@ -6,6 +6,7 @@
w_class = 2.0 w_class = 2.0
force = 2.0 force = 2.0
det_time = null det_time = null
var/stage = 0 var/stage = 0
var/state = 0 var/state = 0
var/path = 0 var/path = 0

View File

@@ -8,7 +8,8 @@
throw_speed = 4 throw_speed = 4
throw_range = 20 throw_range = 20
flags = CONDUCT flags = CONDUCT
slot_flags = SLOT_BELT slot_flags = SLOT_MASK|SLOT_BELT
var/active = 0 var/active = 0
var/det_time = 50 var/det_time = 50

View File

@@ -9,27 +9,25 @@
var/spawner_type = null // must be an object path var/spawner_type = null // must be an object path
var/deliveryamt = 1 // amount of type to deliver var/deliveryamt = 1 // amount of type to deliver
prime() // Prime now just handles the two loops that query for people in lockers and people who can see it. // Prime now just handles the two loops that query for people in lockers and people who can see it.
/obj/item/weapon/grenade/spawnergrenade/prime()
if(spawner_type && deliveryamt) if(spawner_type && deliveryamt)
// Make a quick flash // Make a quick flash
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
playsound(T, 'sound/effects/phasein.ogg', 100, 1) playsound(T, 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(T, null)) for(var/mob/living/carbon/human/M in viewers(T, null))
if(M:eyecheck() <= 0) if(M:eyecheck() <= 0)
flick("e_flash", M.flash) flick("e_flash", M.flash)
for(var/i=1, i<=deliveryamt, i++) // Spawn some hostile syndicate critters
var/atom/movable/x = new spawner_type for(var/i=1, i<=deliveryamt, i++)
x.loc = T var/atom/movable/x = new spawner_type(T)
if(prob(50)) if(prob(50))
for(var/j = 1, j <= rand(1, 3), j++) for(var/j = 1, j <= rand(1, 3), j++)
step(x, pick(NORTH,SOUTH,EAST,WEST)) step(x, pick(NORTH,SOUTH,EAST,WEST))
qdel(src)
// Spawn some hostile syndicate critters return
qdel(src)
return
/obj/item/weapon/grenade/spawnergrenade/manhacks /obj/item/weapon/grenade/spawnergrenade/manhacks
name = "manhack delivery grenade" name = "manhack delivery grenade"

View File

@@ -56,6 +56,7 @@
return return
user.visible_message("<span class='danger'>\The [user] has taped up \the [H]'s mouth!</span>") user.visible_message("<span class='danger'>\The [user] has taped up \the [H]'s mouth!</span>")
H.equip_to_slot_or_del(new /obj/item/clothing/mask/muzzle/tape(H), slot_wear_mask) H.equip_to_slot_or_del(new /obj/item/clothing/mask/muzzle/tape(H), slot_wear_mask)
else if(user.zone_sel.selecting == "r_hand" || user.zone_sel.selecting == "l_hand") else if(user.zone_sel.selecting == "r_hand" || user.zone_sel.selecting == "l_hand")

View File

@@ -7,7 +7,7 @@
usr << "You are unable to emote." usr << "You are unable to emote."
return return
var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) var/muzzled = is_muzzled()
if(m_type == 2 && muzzled) return if(m_type == 2 && muzzled) return
var/input var/input

View File

@@ -8,7 +8,7 @@
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act)) act = copytext(act,1,length(act))
var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) var/muzzled = is_muzzled()
switch(act) switch(act)
if ("me") if ("me")

View File

@@ -9,7 +9,7 @@
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act)) act = copytext(act,1,length(act))
var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) var/muzzled = is_muzzled()
//var/m_type = 1 //var/m_type = 1
for (var/obj/item/weapon/implant/I in src) for (var/obj/item/weapon/implant/I in src)

View File

@@ -150,10 +150,14 @@
//mask //mask
if(wear_mask && !skipmask) if(wear_mask && !skipmask)
var/descriptor = "on [T.his] face"
if(istype(wear_mask, /obj/item/weapon/grenade) && check_has_mouth())
descriptor = "in [T.his] mouth"
if(wear_mask.blood_DNA) if(wear_mask.blood_DNA)
msg += "<span class='warning'>[T.He] [T.has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] [(wear_mask.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [wear_mask.name] on [T.his] face!</span>\n" msg += "<span class='warning'>[T.He] [T.has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] [(wear_mask.blood_color != SYNTH_BLOOD_COLOUR) ? "blood" : "oil"]-stained [wear_mask.name] [descriptor]!</span>\n"
else else
msg += "[T.He] [T.has] \icon[wear_mask] \a [wear_mask] on [T.his] face.\n" msg += "[T.He] [T.has] \icon[wear_mask] \a [wear_mask] [descriptor].\n"
//eyes //eyes
if(glasses && !skipeyes) if(glasses && !skipeyes)

View File

@@ -1407,3 +1407,7 @@
return 0 return 0
return check_organ.can_feel_pain() return check_organ.can_feel_pain()
return !(species.flags & NO_PAIN) return !(species.flags & NO_PAIN)
/mob/living/carbon/human/is_muzzled()
return (wear_mask && (istype(wear_mask, /obj/item/clothing/mask/muzzle) || istype(src.wear_mask, /obj/item/weapon/grenade)))

View File

@@ -118,6 +118,16 @@
if(I_HURT) if(I_HURT)
if(M.zone_sel.selecting == "mouth" && wear_mask && istype(wear_mask, /obj/item/weapon/grenade))
var/obj/item/weapon/grenade/G = wear_mask
if(!G.active)
visible_message("<span class='danger'>\The [M] pulls the pin from \the [src]'s [G.name]!</span>")
G.activate(M)
update_inv_wear_mask()
else
M << "<span class='warning'>\The [G] is already primed! Run!</span>"
return
if(!istype(H)) if(!istype(H))
attack_generic(H,rand(1,3),"punched") attack_generic(H,rand(1,3),"punched")
return return

View File

@@ -69,7 +69,10 @@
if(stripping) if(stripping)
visible_message("<span class='danger'>\The [user] is trying to remove \the [src]'s [target_slot.name]!</span>") visible_message("<span class='danger'>\The [user] is trying to remove \the [src]'s [target_slot.name]!</span>")
else else
visible_message("<span class='danger'>\The [user] is trying to put \a [held] on \the [src]!</span>") if(slot_to_strip == slot_wear_mask && istype(held, /obj/item/weapon/grenade))
visible_message("<span class='danger'>\The [user] is trying to put \a [held] in \the [src]'s mouth!</span>")
else
visible_message("<span class='danger'>\The [user] is trying to put \a [held] on \the [src]!</span>")
if(!do_after(user,HUMAN_STRIP_DELAY)) if(!do_after(user,HUMAN_STRIP_DELAY))
return return

View File

@@ -112,7 +112,7 @@ var/global/list/sparring_attack_cache = list()
/datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone) /datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone)
if (user.wear_mask && istype(user.wear_mask, /obj/item/clothing/mask/muzzle)) if (user.is_muzzled())
return 0 return 0
if (user == target && (zone == BP_HEAD || zone == O_EYES || zone == O_MOUTH)) if (user == target && (zone == BP_HEAD || zone == O_EYES || zone == O_MOUTH))
return 0 return 0

View File

@@ -788,7 +788,7 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_wear_mask(var/update_icons=1) /mob/living/carbon/human/update_inv_wear_mask(var/update_icons=1)
if( wear_mask && ( istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory) ) && !(head && head.flags_inv & HIDEMASK)) if( wear_mask && ( istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory) || istype(wear_mask, /obj/item/weapon/grenade) ) && !(head && head.flags_inv & HIDEMASK))
wear_mask.screen_loc = ui_mask //TODO wear_mask.screen_loc = ui_mask //TODO
var/image/standing var/image/standing

View File

@@ -37,7 +37,7 @@
//This is used by both the whisper verb and human/say() to handle whispering //This is used by both the whisper verb and human/say() to handle whispering
/mob/living/carbon/human/proc/whisper_say(var/message, var/datum/language/speaking = null, var/alt_name="", var/verb="whispers") /mob/living/carbon/human/proc/whisper_say(var/message, var/datum/language/speaking = null, var/alt_name="", var/verb="whispers")
if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) if (is_muzzled())
src << "<span class='danger'>You're muzzled and cannot speak!</span>" src << "<span class='danger'>You're muzzled and cannot speak!</span>"
return return

View File

@@ -82,9 +82,6 @@ proc/get_radio_key_from_channel(var/channel)
/mob/living/proc/get_default_language() /mob/living/proc/get_default_language()
return default_language return default_language
/mob/living/proc/is_muzzled()
return 0
/mob/living/proc/handle_speech_problems(var/message, var/verb) /mob/living/proc/handle_speech_problems(var/message, var/verb)
var/list/returns[3] var/list/returns[3]
var/speech_problem_flag = 0 var/speech_problem_flag = 0
@@ -167,7 +164,7 @@ proc/get_radio_key_from_channel(var/channel)
speaking.broadcast(src,trim(message)) speaking.broadcast(src,trim(message))
return 1 return 1
verb = say_quote(message, speaking) verb = say_quote(message, speaking)
if(is_muzzled()) if(is_muzzled())
src << "<span class='danger'>You're muzzled and cannot speak!</span>" src << "<span class='danger'>You're muzzled and cannot speak!</span>"

View File

@@ -1131,3 +1131,7 @@ mob/proc/yank_out_object()
/mob/proc/isSynthetic() /mob/proc/isSynthetic()
return 0 return 0
/mob/proc/is_muzzled()
return 0

View File

@@ -213,7 +213,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
return 0 return 0
if(ishuman(user) && !(invocation_type in list(SpI_EMOTE, SpI_NONE))) if(ishuman(user) && !(invocation_type in list(SpI_EMOTE, SpI_NONE)))
if(istype(user.wear_mask, /obj/item/clothing/mask/muzzle)) if(user.is_muzzled())
user << "Mmmf mrrfff!" user << "Mmmf mrrfff!"
return 0 return 0

View File

@@ -0,0 +1,4 @@
author: Zuhayr
delete-after: True
changes:
- rscadd: "Added the ability to equip grenades to the mask slot, and to prime them by clicking someone with harm intent targeting the mouth."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB