Alt-clicking descriptions when examining

This commit is contained in:
kingofkosmos
2017-09-29 05:51:31 +03:00
committed by CitadelStationBot
parent d25894447e
commit f0c684c15e
22 changed files with 301 additions and 19 deletions
@@ -58,6 +58,13 @@ GLOBAL_LIST_EMPTY(PDAs)
var/obj/item/inserted_item //Used for pen, crayon, and lipstick insertion or removal. Same as above.
var/overlays_x_offset = 0 //x offset to use for certain overlays
/obj/item/device/pda/examine(mob/user)
..()
if(!id && !inserted_item)
return
else
to_chat(user, "<span class='notice'>Alt-click to remove contents.</span>")
/obj/item/device/pda/Initialize()
. = ..()
if(fon)
+5 -2
View File
@@ -1,7 +1,7 @@
GLOBAL_LIST_EMPTY(GPS_list)
/obj/item/device/gps
name = "global positioning system"
desc = "Helping lost spacemen find their way through the planets since 2016. Alt+click to toggle power."
desc = "Helping lost spacemen find their way through the planets since 2016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = WEIGHT_CLASS_SMALL
@@ -15,6 +15,9 @@ GLOBAL_LIST_EMPTY(GPS_list)
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
/obj/item/device/gps/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>")
/obj/item/device/gps/Initialize()
. = ..()
@@ -209,4 +212,4 @@ GLOBAL_LIST_EMPTY(GPS_list)
clear()
tagged = null
STOP_PROCESSING(SSfastprocess, src)
. = ..()
. = ..()
@@ -1,6 +1,6 @@
/obj/item/device/radio/headset
name = "radio headset"
desc = "An updated, modular intercom that fits over the head. Takes encryption keys. \nTo speak on the general radio frequency, use ; before speaking."
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
icon_state = "headset"
item_state = "headset"
materials = list(MAT_METAL=75)
@@ -11,6 +11,12 @@
var/obj/item/device/encryptionkey/keyslot2 = null
dog_fashion = null
/obj/item/device/radio/headset/examine(mob/user)
..()
to_chat(user, "<span class='notice'>To speak on the general radio frequency, use ; before speaking.</span>")
if (command)
to_chat(user, "<span class='notice'>Alt-click to toggle the high-volume mode.</span>")
/obj/item/device/radio/headset/Initialize()
. = ..()
recalculateChannels()
+192
View File
@@ -1,3 +1,4 @@
<<<<<<< HEAD
/obj/item/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
@@ -186,3 +187,194 @@
theturf.MakeSlippery(min_wet_time = 10, wet_time_to_add = 5)
user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "<span class='info'>You quietly empty out \the [src] using its release valve.</span>")
=======
/obj/item/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
flags_1 = CONDUCT_1
throwforce = 10
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 2
throw_range = 7
force = 10
materials = list(MAT_METAL=90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
dog_fashion = /datum/dog_fashion/back
resistance_flags = FIRE_PROOF
var/max_water = 50
var/last_use = 1
var/safety = TRUE
var/refilling = FALSE
var/sprite_name = "fire_extinguisher"
var/power = 5 //Maximum distance launched water will travel
var/precision = 0 //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row
var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled
/obj/item/extinguisher/mini
name = "pocket fire extinguisher"
desc = "A light and compact fibreglass-framed model fire extinguisher."
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
flags_1 = null //doesn't CONDUCT_1
throwforce = 2
w_class = WEIGHT_CLASS_SMALL
force = 3
materials = list()
max_water = 30
sprite_name = "miniFE"
dog_fashion = null
/obj/item/extinguisher/New()
..()
create_reagents(max_water)
reagents.add_reagent("water", max_water)
/obj/item/extinguisher/attack_self(mob/user)
safety = !safety
src.icon_state = "[sprite_name][!safety]"
src.desc = "The safety is [safety ? "on" : "off"]."
to_chat(user, "The safety is [safety ? "on" : "off"].")
return
/obj/item/extinguisher/attack(mob/M, mob/user)
if(user.a_intent == INTENT_HELP && !safety) //If we're on help intent and going to spray people, don't bash them.
return FALSE
else
return ..()
/obj/item/extinguisher/attack_obj(obj/O, mob/living/user)
if(AttemptRefill(O, user))
refilling = TRUE
return FALSE
else
return ..()
/obj/item/extinguisher/examine(mob/user)
..()
if(reagents.total_volume)
to_chat(user, "It contains [round(reagents.total_volume)] units.")
to_chat(user, "<span class='notice'>Alt-click to empty it.</span>")
else
to_chat(user, "It is empty.")
/obj/item/extinguisher/proc/AttemptRefill(atom/target, mob/user)
if(istype(target, /obj/structure/reagent_dispensers/watertank) && target.Adjacent(user))
var/safety_save = safety
safety = TRUE
if(reagents.total_volume == reagents.maximum_volume)
to_chat(user, "<span class='warning'>\The [src] is already full!</span>")
safety = safety_save
return 1
var/obj/structure/reagent_dispensers/watertank/W = target
var/transferred = W.reagents.trans_to(src, max_water)
if(transferred > 0)
to_chat(user, "<span class='notice'>\The [src] has been refilled by [transferred] units.</span>")
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
for(var/datum/reagent/water/R in reagents.reagent_list)
R.cooling_temperature = cooling_power
else
to_chat(user, "<span class='warning'>\The [W] is empty!</span>")
safety = safety_save
return 1
else
return 0
/obj/item/extinguisher/afterattack(atom/target, mob/user , flag)
// Make it so the extinguisher doesn't spray yourself when you click your inventory items
if (target.loc == user)
return
//TODO; Add support for reagents in water.
if(refilling)
refilling = FALSE
return
if (!safety)
if (src.reagents.total_volume < 1)
to_chat(usr, "<span class='warning'>\The [src] is empty!</span>")
return
if (world.time < src.last_use + 12)
return
src.last_use = world.time
playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3)
var/direction = get_dir(src,target)
if(user.buckled && isobj(user.buckled) && !user.buckled.anchored)
spawn(0)
var/obj/B = user.buckled
var/movementdirection = turn(direction,180)
step(B, movementdirection)
sleep(1)
step(B, movementdirection)
sleep(1)
step(B, movementdirection)
sleep(1)
step(B, movementdirection)
sleep(2)
step(B, movementdirection)
sleep(2)
step(B, movementdirection)
sleep(3)
step(B, movementdirection)
sleep(3)
step(B, movementdirection)
sleep(3)
step(B, movementdirection)
else user.newtonian_move(turn(direction, 180))
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
var/turf/T2 = get_step(T,turn(direction, -90))
var/list/the_targets = list(T,T1,T2)
if(precision)
var/turf/T3 = get_step(T1, turn(direction, 90))
var/turf/T4 = get_step(T2,turn(direction, -90))
the_targets = list(T,T1,T2,T3,T4)
for(var/a=0, a<5, a++)
spawn(0)
var/obj/effect/particle_effect/water/W = new /obj/effect/particle_effect/water(get_turf(src))
var/turf/my_target = pick(the_targets)
if(precision)
the_targets -= my_target
var/datum/reagents/R = new/datum/reagents(5)
if(!W) return
W.reagents = R
R.my_atom = W
if(!W || !src) return
src.reagents.trans_to(W,1)
for(var/b=0, b<power, b++)
step_towards(W,my_target)
if(!W || !W.reagents) return
W.reagents.reaction(get_turf(W))
for(var/A in get_turf(W))
if(!W) return
W.reagents.reaction(A)
if(W.loc == my_target) break
sleep(2)
else
return ..()
/obj/item/extinguisher/AltClick(mob/user)
EmptyExtinguisher(user)
/obj/item/extinguisher/proc/EmptyExtinguisher(var/mob/user)
if(loc == user && reagents.total_volume)
reagents.clear_reagents()
var/turf/T = get_turf(loc)
if(isopenturf(T))
var/turf/open/theturf = T
theturf.MakeSlippery(min_wet_time = 10, wet_time_to_add = 5)
user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "<span class='info'>You quietly empty out \the [src] using its release valve.</span>")
>>>>>>> 086d636... Alt-clicking descriptions when examining (#30988)
+1
View File
@@ -76,6 +76,7 @@
to_chat(user, "There are [get_amount()] in the stack.")
else
to_chat(user, "There is [get_amount()] in the stack.")
to_chat(user, "<span class='notice'>Alt-click to take a custom amount.</span>")
/obj/item/stack/proc/get_amount()
if(is_cyborg)
+13 -5
View File
@@ -125,13 +125,21 @@
icon_type = "cigarette"
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
/obj/item/storage/fancy/cigarettes/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to extract contents.</span>")
/obj/item/storage/fancy/cigarettes/AltClick(mob/user)
if(user.get_active_held_item())
if(user.stat || user.restrained())
return
for(var/obj/item/lighter/lighter in src)
remove_from_storage(lighter, user.loc)
user.put_in_active_hand(lighter)
break
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
if(W && contents.len > 0)
remove_from_storage(W, user)
user.put_in_hands(W)
contents -= W
to_chat(user, "<span class='notice'>You take a [icon_type] out of the pack.</span>")
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/update_icon()
if(fancy_open || !contents.len)
+6 -1
View File
@@ -123,6 +123,11 @@
icon_broken = "medalbox+b"
can_hold = list(/obj/item/clothing/accessory/medal)
/obj/item/storage/lockbox/medal/examine(mob/user)
..()
if(!locked)
to_chat(user, "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>")
/obj/item/storage/lockbox/medal/AltClick()
if(!locked)
open = (open ? FALSE : TRUE)
@@ -179,4 +184,4 @@
/obj/item/storage/lockbox/medal/sci/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
+6 -1
View File
@@ -427,6 +427,11 @@
var/obj/item/grenade/explosive = null
var/war_cry = "AAAAARGH!!!"
/obj/item/twohanded/spear/examine(mob/user)
..()
if(explosive)
to_chat(user, "<span class='notice'>Alt-click to set your war cry.</span>")
/obj/item/twohanded/spear/update_icon()
if(explosive)
icon_state = "spearbomb[wielded]"
@@ -475,7 +480,7 @@
if(G)
explosive = G
name = "explosive lance"
desc = "A makeshift spear with [G] attached to it. Alt+click on the spear to set your war cry!"
desc = "A makeshift spear with [G] attached to it."
update_icon()
// CHAINSAW
@@ -10,6 +10,10 @@
var/obj/item/extinguisher/stored_extinguisher
var/opened = 0
/obj/structure/extinguisher_cabinet/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>")
/obj/structure/extinguisher_cabinet/New(loc, ndir, building)
..()
if(building)
@@ -13,6 +13,10 @@
var/buildstacktype = /obj/item/stack/sheet/metal
var/buildstackamount = 0
/obj/structure/reflector/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to adjust its direction.</span>")
/obj/structure/reflector/bullet_act(obj/item/projectile/P)
var/turf/reflector_turf = get_turf(src)
var/turf/reflect_turf