This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
forked from Proxima-Project/Proxi-Bay12
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from TimThe4th/sssssh
сигареты и голопад
- Loading branch information
Showing
10 changed files
with
453 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.