diff --git a/code/game/objects/items/weapons/photography.dm b/code/game/objects/items/weapons/photography.dm index 0c5181dd498..f3adea5e440 100644 --- a/code/game/objects/items/weapons/photography.dm +++ b/code/game/objects/items/weapons/photography.dm @@ -11,7 +11,7 @@ /obj/item/weapon/camera_test name = "camera" icon = 'icons/obj/items.dmi' - desc = "A one use - polaroid camera. 10 photos left." + desc = "A polaroid camera. 30 photos left." icon_state = "camera" item_state = "electropack" w_class = 2.0 @@ -21,7 +21,8 @@ throwforce = 5 throw_speed = 4 throw_range = 10 - var/pictures_left = 10 + var/pictures_max = 30 + var/pictures_left = 30 var/can_use = 1 /obj/item/weapon/photo @@ -30,130 +31,190 @@ icon_state = "photo" item_state = "clipboard" w_class = 1.0 + var/icon/img //Big photo image + var/scribble //Scribble on the back. - -////////////////////////////////////////////////////////////////////////////////////////////////// -/obj/item/weapon/camera_test/attack(mob/living/carbon/human/M as mob, mob/user as mob) - return - -/obj/item/weapon/camera_test/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) - if (!can_use || !pictures_left || ismob(target.loc)) return - - var/turf/the_turf = get_turf(target) - - var/icon/photo = icon('icons/obj/items.dmi',"photo") - - var/icon/turficon = build_composite_icon(the_turf) - turficon.Scale(22,20) - - photo.Blend(turficon,ICON_OVERLAY,6,8) - - var/mob_title = null - var/mob_detail = null - - var/item_title = null - var/item_detail = null - - var/itemnumber = 0 - for(var/atom/A in the_turf) - if(istype(A, /obj/item/weapon/photo)) continue - if(A.invisibility) continue - if(ismob(A)) - var/icon/X = build_composite_icon(A) - X.Scale(22,20) - photo.Blend(X,ICON_OVERLAY,6,8) - del(X) - - if(!mob_title) - mob_title = "[A]" - else - mob_title += " and [A]" - - if(!mob_detail) - - var/holding = null - if(istype(A, /mob/living/carbon)) - var/mob/living/carbon/temp = A - if(temp.l_hand || temp.r_hand) - if(temp.l_hand) holding = "They are holding \a [temp.l_hand]" - if(temp.r_hand) - if(holding) - holding += " and \a [temp.r_hand]." - else - holding = "They are holding \a [temp.r_hand]." - - if(isliving(A)) - var/mob/living/L = A - - if(!mob_detail) - mob_detail = "You can see [L] on the photo[L.health < 75 ? " - [L] looks hurt":""].[holding ? " [holding]":"."]" - else - mob_detail += "You can also see [L] on the photo[L.health < 75 ? " - [L] looks hurt":""].[holding ? " [holding]":"."]" - - else - if(itemnumber < 5) - var/icon/X = build_composite_icon(A) - X.Scale(22,20) - photo.Blend(X,ICON_OVERLAY,6,8) - del(X) - itemnumber++ - - if(!item_title) - item_title = " \a [A]" - else - item_title = " some objects" - - if(!item_detail) - item_detail = "\a [A]" - else - item_detail += " and \a [A]" - - var/finished_title = null - var/finished_detail = null - - if(!item_title && !mob_title) - finished_title = "boring photo" - finished_detail = "This is a pretty boring photo of \a [the_turf]." - else - if(mob_title) - finished_title = "photo of [mob_title][item_title ? " and[item_title]":""]" - finished_detail = "[mob_detail][item_detail ? " Theres also [item_detail].":"."]" - else if(item_title) - finished_title = "photo of[item_title]" - finished_detail = "You can see [item_detail]." - - var/obj/item/weapon/photo/P = new/obj/item/weapon/photo( get_turf(src) ) - - P.icon = photo - P.name = finished_title - P.desc = finished_detail - - playsound(src.loc, pick('sound/items/polaroid1.ogg','sound/items/polaroid2.ogg'), 75, 1, -3) - - pictures_left-- - src.desc = "A one use - polaroid camera. [pictures_left] photos left." - user << "\blue [pictures_left] photos left." - can_use = 0 - spawn(50) can_use = 1 - -/* - * Photos - */ -/obj/item/weapon/paper/photograph/New() +/obj/item/weapon/photo/New() ..() src.pixel_y = 0 src.pixel_x = 0 return -/obj/item/weapon/paper/photograph/attack_self(mob/user as mob) +/obj/item/weapon/photo/attack_self(var/mob/user as mob) + ..() + examine() - var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32) - if ((src.loc == user && user.stat == 0)) - src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null)) - src.add_fingerprint(user) +/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob) + if (istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon)) + var/txt = input(usr, "What would you like to write on the back?", "Photo Writing", null) as text + txt = copytext(txt, 1, 128) + if ((loc == usr && usr.stat == 0)) + scribble = txt + + ..() + +/obj/item/weapon/photo/examine() + set src in oview(2) + ..() + if (scribble) + usr << "\blue you see something written on photo's back. " + show(usr) + +/obj/item/weapon/photo/proc/show(var/mob/usr) + usr << browse_rsc(src.img, "tmp_photo.png") + usr << browse("Photo" \ + + "" \ + + "
Writings on the back:
[scribble]" : ]"\ + + "", "window=book;size=200x[scribble ? 400 : 200]") + onclose(usr, "[name]") return +/obj/item/weapon/photo/verb/rename() + set name = "Rename photo" + set category = "Object" + set src in usr + + var/n_name = input(usr, "What would you like to label the photo?", "Photo Labelling", src.name) as text + n_name = copytext(n_name, 1, 32) + //loc.loc check is for making possible renaming photos in clipboards + if (( (src.loc == usr || (src.loc.loc && src.loc.loc == usr)) && usr.stat == 0)) + name = "photo[(n_name ? text("- '[n_name]'") : null)]" + add_fingerprint(usr) + return + +/obj/item/weapon/camera_film + name = "film cartridge" + icon = 'items.dmi' + desc = "A camera film cartridge. Insert it into a camera to reload it." + icon_state = "film" + item_state = "electropack" + w_class = 1.0 + + +////////////////////////////////////////////////////////////////////////////////////////////////// +/obj/item/weapon/camera_test/attack(mob/living/carbon/human/M as mob, mob/user as mob) + return + +/obj/item/weapon/camera_test/proc/get_icon(turf/the_turf as turf) + //Bigger icon base to capture those icons that were shifted to the next tile + //i.e. pretty much all wall-mounted machinery + var/icon/res = icon('96x96.dmi',"") + + var/icon/turficon = build_composite_icon(the_turf) + res.Blend(turficon,ICON_OVERLAY,33,33) + + var/atoms[] = list() + for(var/atom/A in the_turf) + if(A.invisibility) continue + atoms.Add(A) + + //Sorting icons based on levels + var/gap = atoms.len + var/swapped = 1 + while (gap > 1 || swapped) + swapped = 0 + if (gap > 1) + gap = round(gap / 1.247330950103979) + if (gap < 1) + gap = 1 + for (var/i = 1; gap + i <= atoms.len; i++) + var/atom/l = atoms[i] //Fucking hate + var/atom/r = atoms[gap+i] //how lists work here + if (l.layer > r.layer) //no "atoms[i].layer" for me + atoms.Swap(i, gap + i) + swapped = 1 + + for (var/i; i <= atoms.len; i++) + var/atom/A = atoms[i] + if (A) + var/icon/img = getFlatIcon(A,A.dir)//build_composite_icon(A) + if(istype(img, /icon)) + res.Blend(new/icon(img,"",A.dir),ICON_OVERLAY,33+A.pixel_x,33+A.pixel_y) + return res + +/obj/item/weapon/camera_test/attack_self(var/mob/user as mob) + ..() + if (can_use) + can_use = 0 + icon_state = "camera_off" + usr << "\red You turn the camera off." + else + can_use = 1 + icon_state = "camera" + usr << "\blue You turn the camera on." + +/obj/item/weapon/camera_test/proc/get_mobs(turf/the_turf as turf) + var/mob_detail + for(var/mob/living/carbon/A in the_turf) + if(A.invisibility) continue + var/holding = null + if(A.l_hand || A.r_hand) + if(A.l_hand) holding = "They are holding \a [A.l_hand]" + if(A.r_hand) + if(holding) + holding += " and \a [A.r_hand]" + else + holding = "They are holding \a [A.r_hand]" + + if(!mob_detail) + mob_detail = "You can see [A] on the photo[A:health < 75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]. " + else + mob_detail += "You can also see [A] on the photo[A:health < 75 ? " - [A] looks hurt":""].[holding ? " [holding]":"."]." + return mob_detail + +/obj/item/weapon/camera_test/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) + if (!can_use || !pictures_left || ismob(target.loc)) return + + var/x_c = target.x - 1 + var/y_c = target.y + 1 + var/z_c = target.z + + var/icon/temp = icon('96x96.dmi',"") + var/icon/black = icon('space.dmi', "black") + var/mobs = "" + for (var/i = 1; i <= 3; i++) + for (var/j = 1; j <= 3; j++) + var/turf/T = locate(x_c,y_c,z_c) + var/mob/dummy = new(T) //Go go visibility check dummy + var/viewer = user + if (user.client) //To make shooting through security cameras possible + viewer = user.client.eye + if(dummy in viewers(world.view, viewer)) + temp.Blend(get_icon(T),ICON_OVERLAY,32*(j-1-1),32 - 32*(i-1)) + else + temp.Blend(black,ICON_OVERLAY,32*(j-1),64 - 32*(i-1)) + mobs += get_mobs(T) + del dummy //Alas, nameless creature + x_c++ + y_c-- + x_c = x_c - 3 + + var/obj/item/weapon/photo/P = new/obj/item/weapon/photo() + P.loc = usr.loc + if(!user.get_inactive_hand()) + usr.put_in_inactive_hand(P) + var/icon/small_img = icon(temp) + var/icon/ic = icon('items.dmi',"photo") + small_img.Scale(8,8) + ic.Blend(small_img,ICON_OVERLAY,10,13) + P.icon = ic + P.img = temp + P.desc = mobs + P.pixel_x = rand(-10,10) + P.pixel_y = rand(-10,10) + playsound(src.loc, pick('polaroid1.ogg','polaroid2.ogg'), 75, 1, -3) + + pictures_left-- + src.desc = "A polaroid camera. It has [pictures_left] photos left." + user << "\blue [pictures_left] photos left." + can_use = 0 + icon_state = "camera_off" + spawn(50) //Icon operations are pretty costy, so don't want them to spam photos + can_use = 1 + icon_state = "camera" + /* diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index ab555f9bd32..b22685860d3 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -89,6 +89,25 @@ add_fingerprint(user) +/obj/item/weapon/melee/baton/throw_impact(atom/hit_atom) + if (prob(50)) + if(istype(hit_atom, /mob/living)) + var/mob/living/carbon/human/H = hit_atom + if(status) + H.apply_effect(10, STUN, 0) + H.apply_effect(10, WEAKEN, 0) + H.apply_effect(10, STUTTER, 0) + charges-- + + H.visible_message("[src] hits [H] with stunning end!") + H.attack_log += "\[[time_stamp()]\] Stunned by thrown [src.name]" + log_attack("Flying [src.name] stunned [H.name] ([H.ckey])" ) + + log_admin("ATTACK: Flying [src.name] stunned [H.name] ([H.ckey])") + msg_admin_attack("ATTACK: Flying [src.name] stunned [H.name] ([H.ckey])") //BS12 EDIT ALG + return + return ..() + /obj/item/weapon/melee/baton/emp_act(severity) switch(severity) if(1) diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 20df82c211c..25da103db03 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -8,7 +8,7 @@ throw_speed = 3 throw_range = 10 var/obj/item/weapon/pen/haspen //The stored pen. - var/obj/item/weapon/paper/toppaper //The topmost piece of paper. + var/obj/item/weapon/toppaper //The topmost piece of paper. flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT pressure_resistance = 10 @@ -45,11 +45,12 @@ return /obj/item/weapon/clipboard/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/paper)) + if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo)) user.drop_item() W.loc = src - toppaper = W - user << "You clip the paper onto \the [src]." + if(istype(W, /obj/item/weapon/paper)) + toppaper = W + user << "You clip the [W] onto \the [src]." update_icon() else if(toppaper) toppaper.attackby(usr.get_active_hand(), usr) @@ -68,10 +69,13 @@ var/obj/item/weapon/paper/P = toppaper dat += "Write Remove - [P.name]

" - for(P in src) - if(P == toppaper) - continue - dat += "Write Remove Move to top - [P.name]
" + for(var/obj/item/weapon/paper/P in src) + if(P==toppaper) + continue + dat += "Remove - [P.name]
" + for(var/obj/item/weapon/photo/Ph in src) + dat += "Remove - [Ph.name]
" + user << browse(dat, "window=clipboard") onclose(user, "clipboard") add_fingerprint(usr) @@ -128,6 +132,11 @@ usr << browse("[P.name][P.info][P.stamps]", "window=[P.name]") onclose(usr, "[P.name]") + if(href_list["look"]) + var/obj/item/weapon/photo/P = locate(href_list["look"]) + if(P) + P.show(usr) + if(href_list["top"]) var/obj/item/P = locate(href_list["top"]) if(P) diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index abb23f3d556..25b40fada61 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -46,7 +46,7 @@ for(var/obj/item/weapon/paper/P in src) dat += "Remove - [P.name]
" for(var/obj/item/weapon/photo/Ph in src) - dat += "Remove - [Ph.name]
" + dat += "Remove - [Ph.name]
" user << browse(dat, "window=folder") onclose(user, "folder") add_fingerprint(usr) @@ -74,6 +74,10 @@ else usr << browse("[P.name][P.info][P.stamps]", "window=[P.name]") onclose(usr, "[P.name]") + if(href_list["look"]) + var/obj/item/weapon/photo/P = locate(href_list["look"]) + if(P) + P.show(usr) //Update everything attack_self(usr) diff --git a/icons/mob/feet.dmi b/icons/mob/feet.dmi index a946e94f0b2..b7b7b3fdf8b 100644 Binary files a/icons/mob/feet.dmi and b/icons/mob/feet.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index 3637d1eb4c2..9ac1157e3af 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ