Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #202 from TimThe4th/sssssh
Browse files Browse the repository at this point in the history
сигареты и голопад
  • Loading branch information
johncoder0 authored Jul 12, 2023
2 parents 916dfa1 + 48c39e3 commit babd6bd
Show file tree
Hide file tree
Showing 10 changed files with 453 additions and 0 deletions.
4 changes: 4 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
#include "code\bos\game\objects\items\shooting_range.dm"
#include "code\bos\game\objects\items\toys.dm"
#include "code\bos\game\objects\items\wallet.dm"
#include "code\bos\game\objects\items\devices\holopad_hand.dm"
#include "code\bos\game\objects\items\devices\radio.dm"
#include "code\bos\game\objects\items\devices\spy_sensor.dm"
#include "code\bos\game\objects\items\devices\syndietele.dm"
Expand All @@ -199,6 +200,7 @@
#include "code\bos\game\objects\items\weapons\implants\implants\fake_death.dm"
#include "code\bos\game\objects\items\weapons\implants\implants\spying.dm"
#include "code\bos\game\objects\items\weapons\storage\boxes.dm"
#include "code\bos\game\objects\items\weapons\storage\cigarettes.dm"
#include "code\bos\game\objects\items\weapons\storage\mgsbox.dm"
#include "code\bos\game\objects\items\weapons\storage\snb.dm"
#include "code\bos\game\objects\items\weapons\storage\uplink_kits.dm"
Expand Down Expand Up @@ -242,6 +244,7 @@
#include "code\bos\modules\clothing\hats\kgb_hat.dm"
#include "code\bos\modules\clothing\hats\sombrero.dm"
#include "code\bos\modules\clothing\mask\booker_face.dm"
#include "code\bos\modules\clothing\mask\smokable.dm"
#include "code\bos\modules\clothing\suit\blazer.dm"
#include "code\bos\modules\clothing\suit\booker.dm"
#include "code\bos\modules\clothing\suit\cyberpunk_overcoat.dm"
Expand Down Expand Up @@ -355,6 +358,7 @@
#include "code\bos\modules\projectiles\projectile\special.dm"
#include "code\bos\modules\reagents\Chemistry-Reagents-Recipes.dm"
#include "code\bos\modules\reagents\kvasok.dm"
#include "code\bos\modules\reagents\tobacco.dm"
#include "code\bos\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Food-Drinks.dm"
#include "code\bos\modules\species\mantid\mantid.dm"
#include "code\bos\modules\species\station\prometheans.dm"
Expand Down
16 changes: 16 additions & 0 deletions code/_helpers/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -924,3 +924,19 @@ lighting determines lighting capturing (optional), suppress_errors suppreses err
cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)

return cap


/proc/build_composite_icon_omnidir(atom/A)
var/icon/composite = icon('icons/effects/effects.dmi', "icon_state"="nothing")
for(var/O in A.underlays)
var/image/I = O
composite.Blend(new /icon(I.icon, I.icon_state), ICON_OVERLAY)
var/icon/ico_omnidir = new(A.icon)
if(A.icon_state in ico_omnidir.IconStates())
composite.Blend(new /icon(ico_omnidir, A.icon_state), ICON_OVERLAY)
else
composite.Blend(new /icon(ico_omnidir, null), ICON_OVERLAY)
for(var/O in A.overlays)
var/image/I = O
composite.Blend(new /icon(I.icon, I.icon_state), ICON_OVERLAY)
return composite
205 changes: 205 additions & 0 deletions code/bos/game/objects/items/devices/holopad_hand.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
#define CALL_NONE 0
#define CALL_CALLING 1
#define CALL_RINGING 2
#define CALL_IN_CALL 3

/obj/item/device/holopad
name = "Holopad"
desc = "Small handheld disk with controls."
icon = 'icons/bos/obj/holopad.dmi'
icon_state = "holopad"
item_state = "card-id"
w_class = ITEM_SIZE_TINY
var/voice
var/id
var/uniq_id
var/obj/item/device/holopad/abonent = null
var/call_state = CALL_NONE
var/obj/effect/hologram = null
var/updatingPos = 0
origin_tech = list(TECH_DATA = 4, TECH_BLUESPACE = 2, TECH_MAGNET = 4)

/obj/item/device/holopad/Initialize()
uniq_id = random_id("holopad_device", 00000, 99999)
id = rand(1000, 9999)
name = "[initial(name)] [id] #[uniq_id]"
voice = "Holopad [id]"
GLOB.listening_objects += src
. = ..()

/obj/item/device/holopad/Destroy()
GLOB.listening_objects -= src
abonent = null
. = ..()


/obj/item/device/holopad/verb/setID()
set name="Set ID"
set category = "Object"
set src in usr
var/newid = sanitize(input(usr, "What would be new ID?") as null|text, MAX_NAME_LEN)
if(newid && CanPhysicallyInteract(usr))
id = newid
name = "[initial(name)] [id] #[uniq_id]"

/obj/item/device/holopad/proc/getName(override_busy = 0)
if(call_state!=CALL_NONE && !override_busy)
return "Holopad [id] #[uniq_id] - busy"
else
return "Holopad [id] #[uniq_id]"

/obj/item/device/holopad/proc/incall(obj/item/device/holopad/caller)
if(call_state != CALL_NONE)
return FALSE
abonent = caller
call_state = CALL_RINGING
icon_state = "holopad_ringing"
desc = "[initial(desc)] Incoming call from [caller.getName()]."
INVOKE_ASYNC(src, .proc/ring)
return TRUE

/obj/item/device/holopad/proc/ring()
if(call_state != CALL_RINGING)
return
audible_message(SPAN_WARNING("Something vibrates.."), hearing_distance = 4)
addtimer(CALLBACK(src, .proc/ring), 50)

/obj/item/device/holopad/proc/placeCall(mob/user)
var/list/Targets = list()
for(var/obj/item/device/holopad/H in GLOB.listening_objects)
if(H == src)
continue
Targets[H.getName()] = H
var/selection = input("Who do you want to call?") as null|anything in Targets
if(!selection)
return
var/obj/item/device/holopad/target = Targets[selection]
if(!target)
return
if(target.incall(src))
call_state = CALL_CALLING
abonent = target
icon_state = "holopad_calling"
to_chat(user, SPAN_NOTICE("Calling [sanitize(abonent.getName(1))]"))
else
to_chat(user, SPAN_WARNING("Remote device is busy"))

/obj/item/device/holopad/proc/acceptCall()
if(call_state == CALL_RINGING)
if(abonent && abonent.call_state == CALL_CALLING)
abonent.acceptCall()
call_state = CALL_IN_CALL
icon_state = "holopad_in_call"
addtimer(CALLBACK(src, .proc/update_holo), 1)

audible_message("<span class='name'>[voice]</span> transmits, \"Connection established\"", hearing_distance = 1)
else
call_state = CALL_NONE
icon_state = initial(icon_state)
desc = initial(desc)
abonent = null

else if(call_state == CALL_CALLING)
call_state = CALL_IN_CALL
icon_state = "holopad_in_call"
addtimer(CALLBACK(src, .proc/update_holo), 1)

audible_message("<span class='name'>[voice]</span> transmits, \"Connection established\"", hearing_distance = 1)

/obj/item/device/holopad/proc/hangUp(remote = 0)
if(!remote && abonent)
abonent.hangUp(1)

if(call_state==CALL_NONE)
return

audible_message(SPAN_WARNING("Connection closed"), hearing_distance = 4)
call_state = CALL_NONE
icon_state = initial(icon_state)
desc = initial(desc)
abonent = null
qdel(hologram)

/obj/item/device/holopad/dropped()
update_holo()

/obj/item/device/holopad/proc/update_holo()
if(call_state == CALL_IN_CALL)
if(!abonent)
return
if(!abonent.hologram)
abonent.hologram = new()
abonent.hologram.name = "Hologram [sanitize(id)]"
abonent.hologram.layer = 5
if(isliving(loc))
abonent.hologram.icon = getHologramIcon(build_composite_icon_omnidir(loc))
else
abonent.hologram.icon = icon('icons/effects/effects.dmi', "icon_state"="nothing")
if(!abonent.updatingPos)
abonent.update_holo_pos()

/obj/item/device/holopad/proc/update_holo_pos()
if(call_state != CALL_IN_CALL)
updatingPos = 0
return
updatingPos = 1
if(isliving(loc))
var/mob/living/L = loc
hologram.dir = turn(L.dir,180)
hologram.loc = L.loc
hologram.pixel_x = ((L.dir&4)?32:((L.dir&8)?-32:0))
hologram.pixel_y = ((L.dir&1)?32:((L.dir&2)?-32:0))
else if(isturf(loc))
hologram.dir = 2
hologram.loc = loc
hologram.pixel_x = 0
hologram.pixel_y = 0
else
hangUp()
addtimer(CALLBACK(src, .proc/update_holo_pos), 2)


/obj/item/device/holopad/attack_self(mob/user)
switch(call_state)
if(CALL_NONE)
placeCall()
if(CALL_CALLING)
hangUp()
if(CALL_RINGING)
acceptCall()
if(CALL_IN_CALL)
hangUp()

/obj/item/device/holopad/hear_talk(mob/user, datum/language/speaking)
if(call_state == CALL_IN_CALL)
abonent.receive(speaking, user == loc)

/obj/item/device/holopad/proc/receive(speaking, mob/user)
var/list/listening = get_mobs_or_objects_in_view(3, src)

for(var/mob/observer/ghost/G in GLOB.ghost_mob_list)
if(get_dist(src, G) > world.view && G.get_preference_value(/datum/client_preference/ghost_ears) != GLOB.PREF_ALL_SPEECH)
continue
listening |= G

if(!user)
voice = "Holopad Background Voice"
for(var/mob/M in listening)
to_chat(M, "<span class='name'>[voice]</span> transmits, \"[speaking]\" ")


/*
/obj/item/device/holopad/cheap
name = "Holopda"
desc = "New brand pda now with holo-link and built-in clock."
icon = 'icons/bos/obj/holopda.dmi'
w_class = ITEM_SIZE_SMALL
/obj/item/device/holopad/cheap/examine(mob/user)
. = ..()
to_chat(user, "\the [src] displays [stationtime2text()].")
*/
#undef CALL_NONE
#undef CALL_CALLING
#undef CALL_RINGING
#undef CALL_IN_CALL
35 changes: 35 additions & 0 deletions code/bos/game/objects/items/weapons/storage/cigarettes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/obj/item/storage/fancy/cigarettes/bos/elpedros
name = "pack of El Pedro's"
desc = "One of the most popular brands of women's cigarettes in Lordania. \
Every smoking girl is ready to give a lot of money for blocks of such cigarettes."
icon_state = "ppacket"
icon = 'icons/bos/obj/cigarettes.dmi'
startswith = list(/obj/item/clothing/mask/smokable/cigarette/elpedros = 4)

/obj/item/storage/fancy/cigarettes/bos/nirvana
name = "pack of Nirvana Honeys"
desc = "The Manufacturer promises that these honey cigarettes will take you directly to Nirvana. \
In fact, this is just a crappy brand of cigarettes. But with honey flavor!"
icon_state = "npacket"
startswith = list(/obj/item/clothing/mask/smokable/cigarette/nirvana = 6)

/obj/item/storage/fancy/cigarettes/bos/mars
name = "pack of Marsian Coffee"
desc = "Popular coffee cigarettes produced by Marsian branch of SyndiBust. \
Originally named «Gideon's Coffee», the name was changed due to a lawsuit filed by relatives of Jimmy Gideon."
icon_state = "mpacket"
startswith = list(/obj/item/clothing/mask/smokable/cigarette/mars = 6)

/obj/item/storage/fancy/cigarettes/bos/pear
name = "pack of Green Pear"
desc = "Selenian brand of cigarettes with specific flavor and smiling pear on it's cover. \
Sometimes it seems that time flies like a clock while smoking them."
icon_state = "pepacket"
startswith = list(/obj/item/clothing/mask/smokable/cigarette/pear = 6)

/obj/item/storage/fancy/cigarettes/bos/chinese
name = "pack of Yao Yan"
desc = "Special brand of medical cigarettes produced in collaboration between Me-Vir and Euclidian government. \
Shoddy taste, but less harmful than other cigarettes."
icon_state = "cpacket"
startswith = list(/obj/item/clothing/mask/smokable/cigarette/chinese = 6)
30 changes: 30 additions & 0 deletions code/bos/modules/clothing/mask/smokable.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/obj/item/clothing/mask/smokable/cigarette/elpedros
name = "thin cigarette"
brand = "\improper El Pedro's"
icon_state = "cigpro"
type_butt = /obj/item/trash/cigbutt/professionals
filling = list(/datum/reagent/tobacco/female = 1)

/obj/item/clothing/mask/smokable/cigarette/nirvana
name = "cigarette"
brand = "\improper Nirvana Honeys"
icon_state = "cigoff"
filling = list(/datum/reagent/tobacco/honey = 1)

/obj/item/clothing/mask/smokable/cigarette/mars
name = "cigarette"
brand = "\improper Marsian Coffee"
icon_state = "cigjer"
filling = list(/datum/reagent/tobacco/coffee = 1)

/obj/item/clothing/mask/smokable/cigarette/pear
name = "cigarette"
brand = "\improper Green Pear"
icon_state = "cigoff"
filling = list(/datum/reagent/tobacco/perception = 1)

/obj/item/clothing/mask/smokable/cigarette/chinese
name = "cigarette"
brand = "\improper Yao Yan"
icon_state = "cigoff"
filling = list(/datum/reagent/tobacco/medical = 1)
Loading

0 comments on commit babd6bd

Please sign in to comment.