Merge pull request #4221 from tigercat2000/tgalerts

-tg- screen alerts
This commit is contained in:
TheDZD
2016-04-19 19:13:31 -04:00
54 changed files with 1764 additions and 1178 deletions
+3 -1
View File
@@ -12,7 +12,7 @@
. = ..()
if(can_buckle && buckled_mob)
return user_unbuckle_mob(user)
/atom/movable/attack_robot(mob/living/user)
. = ..()
if(can_buckle && buckled_mob && Adjacent(user)) // attack_robot is called on all ranges, so the Adjacent check is needed
@@ -46,6 +46,7 @@
buckled_mob = M
M.update_canmove()
post_buckle_mob(M)
M.throw_alert("buckled", /obj/screen/alert/restrained/buckled, new_master = src)
return 1
/atom/movable/proc/unbuckle_mob()
@@ -54,6 +55,7 @@
buckled_mob.buckled = null
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.update_canmove()
buckled_mob.clear_alert("buckled")
buckled_mob = null
post_buckle_mob(.)
+1
View File
@@ -53,6 +53,7 @@
var/strip_delay = DEFAULT_ITEM_STRIP_DELAY
var/put_on_delay = DEFAULT_ITEM_PUTON_DELAY
var/breakouttime = 0
/* Species-specific sprites, concept stolen from Paradise//vg/.
ex:
+3 -110
View File
@@ -12,7 +12,7 @@
throw_range = 5
materials = list(MAT_METAL=500)
origin_tech = "materials=1"
var/breakouttime = 600 //Deciseconds = 60s = 1 minutes
breakouttime = 600 //Deciseconds = 60s = 1 minutes
var/cuffsound = 'sound/weapons/handcuffs.ogg'
var/trashtype = null //For disposable cuffs
@@ -50,7 +50,7 @@
else
loc = target
target.handcuffed = src
target.update_inv_handcuffed(1)
target.update_handcuffed()
return
/obj/item/weapon/restraints/handcuffs/cable
@@ -121,7 +121,7 @@
if(do_mob(user, C, 30))
if(!C.handcuffed)
C.handcuffed = new /obj/item/weapon/restraints/handcuffs/cable/zipties/used(C)
C.update_inv_handcuffed(1)
C.update_handcuffed()
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
add_logs(C, user, "ziptie-cuffed")
else
@@ -133,110 +133,3 @@
/obj/item/weapon/restraints/handcuffs/cable/zipties/used/attack()
return
//Legcuffs
/obj/item/weapon/restraints/legcuffs
name = "leg cuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items.dmi'
icon_state = "handcuff"
flags = CONDUCT
throwforce = 0
w_class = 3.0
origin_tech = "materials=1"
slowdown = 7
var/breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/weapon/restraints/legcuffs/beartrap
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap0"
desc = "A trap used to catch bears and other legged creatures."
var/armed = 0
var/obj/item/weapon/grenade/iedcasing/IED = null
/obj/item/weapon/restraints/legcuffs/beartrap/Destroy()
if(IED)
qdel(IED)
IED = null
return ..()
/obj/item/weapon/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking \his head in the [src.name]! It looks like \he's trying to commit suicide.</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/weapon/restraints/legcuffs/beartrap/attack_self(mob/user as mob)
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "beartrap[armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/weapon/restraints/legcuffs/beartrap/attackby(var/obj/item/I, mob/user as mob) //Let's get explosive.
if(istype(I, /obj/item/weapon/grenade/iedcasing))
if(IED)
to_chat(user, "<span class='warning'>This beartrap already has an IED hooked up to it!</span>")
return
IED = I
switch(IED.assembled)
if(0,1) //if it's not fueled/hooked up
to_chat(user, "<span class='warning'>You haven't prepared this IED yet!</span>")
IED = null
return
if(2,3)
user.drop_item(src)
I.forceMove(src)
message_admins("[key_name_admin(user)] has rigged a beartrap with an IED.")
log_game("[key_name(user)] has rigged a beartrap with an IED.")
to_chat(user, "<span class='notice'>You sneak the [IED] underneath the pressure plate and connect the trigger wire.</span>")
desc = "A trap used to catch bears and other legged creatures. <span class='warning'>There is an IED hooked up to it.</span>"
else
to_chat(user, "<span class='danger'>You shouldn't be reading this message! Contact a coder or someone, something broke!</span>")
IED = null
return
if(istype(I, /obj/item/weapon/screwdriver))
if(IED)
IED.forceMove(get_turf(src))
IED = null
to_chat(user, "<span class='notice'>You remove the IED from the [src].</span>")
return
..()
/obj/item/weapon/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc))
if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
var/mob/living/L = AM
armed = 0
icon_state = "beartrap0"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
if(IED && isturf(src.loc))
IED.active = 1
IED.overlays -= image('icons/obj/grenade.dmi', icon_state = "improvised_grenade_filled")
IED.icon_state = initial(icon_state) + "_active"
IED.assembled = 3
message_admins("[key_name_admin(usr)] has triggered an IED-rigged [name].")
log_game("[key_name(usr)] has triggered an IED-rigged [name].")
spawn(IED.det_time)
IED.prime()
if(ishuman(AM))
var/mob/living/carbon/H = AM
if(H.lying)
H.apply_damage(20,BRUTE,"chest")
else
H.apply_damage(20,BRUTE,(pick("l_leg", "r_leg")))
if(!H.legcuffed) //beartrap can't cuff you leg if there's already a beartrap or legcuffs.
H.legcuffed = src
src.loc = H
H.update_inv_legcuffed(0)
feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart.
else
L.apply_damage(20,BRUTE)
..()
+98 -3
View File
@@ -1,5 +1,5 @@
/obj/item/weapon/legcuffs
name = "legcuffs"
/obj/item/weapon/restraints/legcuffs
name = "leg cuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items.dmi'
@@ -8,7 +8,102 @@
throwforce = 0
w_class = 3.0
origin_tech = "materials=1"
var/breakouttime = 300 //Deciseconds = 30s = 0.5 minute
slowdown = 7
breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/weapon/restraints/legcuffs/beartrap
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap0"
desc = "A trap used to catch bears and other legged creatures."
var/armed = 0
var/obj/item/weapon/grenade/iedcasing/IED = null
/obj/item/weapon/restraints/legcuffs/beartrap/Destroy()
if(IED)
qdel(IED)
IED = null
return ..()
/obj/item/weapon/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking \his head in the [src.name]! It looks like \he's trying to commit suicide.</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/weapon/restraints/legcuffs/beartrap/attack_self(mob/user as mob)
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "beartrap[armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/weapon/restraints/legcuffs/beartrap/attackby(var/obj/item/I, mob/user as mob) //Let's get explosive.
if(istype(I, /obj/item/weapon/grenade/iedcasing))
if(IED)
to_chat(user, "<span class='warning'>This beartrap already has an IED hooked up to it!</span>")
return
IED = I
switch(IED.assembled)
if(0,1) //if it's not fueled/hooked up
to_chat(user, "<span class='warning'>You haven't prepared this IED yet!</span>")
IED = null
return
if(2,3)
user.drop_item(src)
I.forceMove(src)
message_admins("[key_name_admin(user)] has rigged a beartrap with an IED.")
log_game("[key_name(user)] has rigged a beartrap with an IED.")
to_chat(user, "<span class='notice'>You sneak the [IED] underneath the pressure plate and connect the trigger wire.</span>")
desc = "A trap used to catch bears and other legged creatures. <span class='warning'>There is an IED hooked up to it.</span>"
else
to_chat(user, "<span class='danger'>You shouldn't be reading this message! Contact a coder or someone, something broke!</span>")
IED = null
return
if(istype(I, /obj/item/weapon/screwdriver))
if(IED)
IED.forceMove(get_turf(src))
IED = null
to_chat(user, "<span class='notice'>You remove the IED from the [src].</span>")
return
..()
/obj/item/weapon/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc))
if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
var/mob/living/L = AM
armed = 0
icon_state = "beartrap0"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
if(IED && isturf(src.loc))
IED.active = 1
IED.overlays -= image('icons/obj/grenade.dmi', icon_state = "improvised_grenade_filled")
IED.icon_state = initial(icon_state) + "_active"
IED.assembled = 3
message_admins("[key_name_admin(usr)] has triggered an IED-rigged [name].")
log_game("[key_name(usr)] has triggered an IED-rigged [name].")
spawn(IED.det_time)
IED.prime()
if(ishuman(AM))
var/mob/living/carbon/H = AM
if(H.lying)
H.apply_damage(20,BRUTE,"chest")
else
H.apply_damage(20,BRUTE,(pick("l_leg", "r_leg")))
if(!H.legcuffed) //beartrap can't cuff you leg if there's already a beartrap or legcuffs.
H.legcuffed = src
src.loc = H
H.update_inv_legcuffed(0)
feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart.
else
L.apply_damage(20,BRUTE)
..()
/obj/item/weapon/legcuffs/bolas
name = "bolas"
+1 -1
View File
@@ -127,7 +127,7 @@
C.handcuffed = null
if(C.buckled && C.buckled.buckle_requires_restraints)
C.buckled.unbuckle_mob()
C.update_inv_handcuffed()
C.update_handcuffed()
return
else
..()
+1 -8
View File
@@ -10,13 +10,6 @@
var/planchette = "A"
var/lastuser = null
/obj/structure/spirit_board/proc/announce_to_ghosts()
for(var/mob/dead/observer/O in player_list)
if(O.client)
var/area/A = get_area(src)
if(A)
to_chat(O, "\blue <b>Someone has begun playing with a [src.name] in [A.name]!. (<a href='?src=\ref[O];jump=\ref[src]'>Teleport</a>)</b>")
/obj/structure/spirit_board/examine(mob/user)
..(user)
to_chat(user, "[initial(desc)] The planchette is sitting at \"[planchette]\".")
@@ -37,7 +30,7 @@
if(virgin)
virgin = 0
announce_to_ghosts()
notify_ghosts("Someone has begun playing with a [src.name] in [get_area(src)]!", source = src)
planchette = input("Choose the letter.", "Seance!") in list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
add_logs(M, src, "picked a letter on", addition="which was \"[planchette]\".")