Vending machines are more dangerous when throwing items

This commit is contained in:
CitadelStationBot
2017-05-18 16:37:18 -05:00
parent 97286d25fc
commit 670a6f2126
4 changed files with 90 additions and 56 deletions
+3
View File
@@ -528,6 +528,9 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
/obj/item/throw_impact(atom/A)
if(A && !QDELETED(A))
if(is_hot() && isliving(A))
var/mob/living/L = A
L.IgniteMob()
var/itempush = 1
if(w_class < 4)
itempush = 0 //too light to push anything
@@ -472,8 +472,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM
flags = CONDUCT
slot_flags = SLOT_BELT
var/lit = 0
var/fancy = TRUE
heat = 1500
resistance_flags = FIRE_PROOF
light_color = LIGHT_COLOR_FIRE
/obj/item/weapon/lighter/update_icon()
if(lit)
@@ -484,37 +486,28 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/weapon/lighter/ignition_effect(atom/A, mob/user)
. = "<span class='rose'>With a single flick of their wrist, [user] smoothly lights [A] with [src]. Damn [user.p_theyre()] cool.</span>"
/obj/item/weapon/lighter/greyscale
name = "cheap lighter"
desc = "A cheap-as-free lighter."
icon_state = "lighter"
/obj/item/weapon/lighter/greyscale/Initialize()
. = ..()
add_atom_colour(color2hex(randomColor(1)), FIXED_COLOUR_PRIORITY)
update_icon()
/obj/item/weapon/lighter/greyscale/update_icon()
cut_overlays()
var/mutable_appearance/base_overlay = mutable_appearance(icon,"[initial(icon_state)]_base")
base_overlay.appearance_flags = RESET_COLOR //the edging doesn't change color
/obj/item/weapon/lighter/proc/set_lit(new_lit)
lit = new_lit
if(lit)
base_overlay.icon_state = "[initial(icon_state)]_on"
add_overlay(base_overlay)
/obj/item/weapon/lighter/greyscale/ignition_effect(atom/A, mob/user)
. = "<span class='notice'>After some fiddling, [user] manages to light [A] with [src].</span>"
force = 5
damtype = "fire"
hitsound = 'sound/items/welder.ogg'
attack_verb = list("burnt", "singed")
set_light(1)
START_PROCESSING(SSobj, src)
else
hitsound = "swing_hit"
force = 0
attack_verb = null //human_defense.dm takes care of it
set_light(0)
STOP_PROCESSING(SSobj, src)
update_icon()
/obj/item/weapon/lighter/attack_self(mob/living/user)
if(user.is_holding(src))
if(!lit)
lit = 1
update_icon()
force = 5
damtype = "fire"
hitsound = 'sound/items/welder.ogg'
attack_verb = list("burnt", "singed")
if(!istype(src, /obj/item/weapon/lighter/greyscale))
set_lit(TRUE)
if(fancy)
user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", "<span class='notice'>Without even breaking stride, you flip open and lights [src] in one smooth movement.</span>")
else
var/prot = FALSE
@@ -534,20 +527,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.apply_damage(5, BURN, hitzone)
user.visible_message("<span class='warning'>After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn their finger in the process.</span>", "<span class='warning'>You burn yourself while lighting the lighter!</span>")
set_light(1)
START_PROCESSING(SSobj, src)
else
lit = 0
update_icon()
hitsound = "swing_hit"
force = 0
attack_verb = null //human_defense.dm takes care of it
if(!istype(src, /obj/item/weapon/lighter/greyscale))
set_lit(FALSE)
if(fancy)
user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what [user.p_theyre()] doing. Wow.", "<span class='notice'>You quietly shut off [src] without even looking at what you're doing. Wow.</span>")
else
user.visible_message("[user] quietly shuts off [src].", "<span class='notice'>You quietly shut off [src].")
set_light(0)
STOP_PROCESSING(SSobj, src)
else
. = ..()
@@ -562,7 +547,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(M == user)
cig.attackby(src, user)
else
if(!istype(src, /obj/item/weapon/lighter/greyscale))
if(fancy)
cig.light("<span class='rose'>[user] whips the [name] out and holds it for [M]. [user.p_their(TRUE)] arm is as steady as the unflickering flame they light \the [cig] with.</span>")
else
cig.light("<span class='notice'>[user] holds the [name] out for [M], and lights the [cig.name].</span>")
@@ -575,6 +560,30 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/weapon/lighter/is_hot()
return lit * heat
/obj/item/weapon/lighter/greyscale
name = "cheap lighter"
desc = "A cheap-as-free lighter."
icon_state = "lighter"
fancy = FALSE
/obj/item/weapon/lighter/greyscale/Initialize()
. = ..()
add_atom_colour(color2hex(randomColor(1)), FIXED_COLOUR_PRIORITY)
update_icon()
/obj/item/weapon/lighter/greyscale/update_icon()
cut_overlays()
var/mutable_appearance/base_overlay = mutable_appearance(icon,"[initial(icon_state)]_base")
base_overlay.appearance_flags = RESET_COLOR //the edging doesn't change color
if(lit)
base_overlay.icon_state = "[initial(icon_state)]_on"
add_overlay(base_overlay)
/obj/item/weapon/lighter/greyscale/ignition_effect(atom/A, mob/user)
. = "<span class='notice'>After some fiddling, [user] manages to light [A] with [src].</span>"
///////////
//ROLLING//
///////////
@@ -48,23 +48,27 @@
/obj/item/weapon/grenade/attack_self(mob/user)
if(!active)
if(clown_check(user))
to_chat(user, "<span class='warning'>You prime the [name]! [det_time/10] seconds!</span>")
playsound(user.loc, 'sound/weapons/armbomb.ogg', 60, 1)
active = 1
icon_state = initial(icon_state) + "_active"
add_fingerprint(user)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
var/message = "[ADMIN_LOOKUPFLW(user)]) has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]"
GLOB.bombers += message
message_admins(message)
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].")
preprime(user)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
spawn(det_time)
prime()
/obj/item/weapon/grenade/proc/preprime(mob/user)
if(user)
to_chat(user, "<span class='warning'>You prime the [name]! [det_time/10] seconds!</span>")
playsound(loc, 'sound/weapons/armbomb.ogg', 60, 1)
active = TRUE
icon_state = initial(icon_state) + "_active"
add_fingerprint(user)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
if(user)
var/message = "[ADMIN_LOOKUPFLW(user)]) has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]"
GLOB.bombers += message
message_admins(message)
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].")
addtimer(CALLBACK(src, .proc/prime), det_time)
/obj/item/weapon/grenade/proc/prime()
@@ -104,4 +108,4 @@
if(damage && attack_type == PROJECTILE_ATTACK && prob(15))
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
prime()
return 1 //It hit the grenade, not them
return 1 //It hit the grenade, not them