forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Builder13
committed
Sep 14, 2024
1 parent
7ced868
commit 9749c47
Showing
17 changed files
with
591 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/obj/overmap/radio/distress/panic_distress | ||
name = "panic distress" | ||
icon = 'packs/infinity/icons/obj/distress.dmi' | ||
icon_state = "distress" | ||
|
||
/obj/overmap/radio/distress/panic_distress/get_scan_data(mob/user) | ||
return list("A unilateral, broadband data broadcast originating at \the [source] carrying only an emergency code sequence.") | ||
|
||
/obj/overmap/radio/distress/panic_distress/set_origin(obj/overmap/origin) | ||
GLOB.moved_event.register(origin, src, TYPE_PROC_REF(/obj/overmap/radio, follow)) | ||
GLOB.destroyed_event.register(origin, src, TYPE_PROC_REF(/datum, qdel_self)) | ||
forceMove(origin.loc) | ||
source = origin | ||
pixel_x = 0 | ||
pixel_y = 0 | ||
|
||
/obj/overmap/visitable/proc/distress(mob/user) | ||
|
||
log_and_message_admins(message ="Overmap panic button hit on z[z] ([name]) by '[user?.ckey || "Unknown"]'") | ||
|
||
var/distress_message = "Это автоматический сигнал бедствия от радиомаяка, соответствующего стандарту MIL-DTL-93352, передаваемого на частоте [PUB_FREQ*0.1]кГц. \ | ||
Этот маяк был запущен с '[initial(name)]'. Местоположение передающего устройства: [get_distress_info()]. \ | ||
Согласно Межпланетной конвенции о космической спасательной деятельности, лица, получившие это сообщение, должны попытаться предпринять попытку спасения, \ | ||
или передать сообщение тем, кто может это сделать. Это сообщение повторится еще раз через 5 минут. Спасибо за вашу помощь." | ||
|
||
//sends to a single z-level of every /obj/overmap/visitable | ||
var/list/sent_to_z = list() | ||
for(var/zlevel in map_sectors) | ||
var/obj/overmap/visitable/O = map_sectors[zlevel] | ||
if(!isnull(O)) | ||
var/should_send = TRUE | ||
var/list/overmap_z_list = O.map_z | ||
for(var/z_map in overmap_z_list) | ||
if(z_map in sent_to_z) | ||
should_send = FALSE | ||
else | ||
sent_to_z.Add(z_map) | ||
if(should_send && length(overmap_z_list)) | ||
priority_announcement.Announce(distress_message, "Automated Distress Signal", new_sound = sound('packs/infinity/sound/AI/sos.ogg'), zlevels = overmap_z_list) | ||
|
||
//sends to a single random z-level (original) | ||
//priority_announcement.Announce(distress_message, "Automated Distress Signal", new_sound = sound('packs/infinity/sound/AI/sos.ogg'), zlevels = GLOB.using_map.player_levels) | ||
|
||
var/obj/overmap/radio/distress/panic_distress/emergency_signal = new /obj/overmap/radio/distress/panic_distress() | ||
|
||
emergency_signal.set_origin(src) | ||
|
||
addtimer(new Callback(src, PROC_REF(distress_update)), 5 MINUTES) | ||
return TRUE | ||
|
||
/obj/overmap/visitable/proc/get_distress_info() | ||
return "\[X:[x], Y:[y]\]" | ||
|
||
// Get heading in degrees (like a compass heading) | ||
/obj/overmap/visitable/ship/proc/get_heading_degrees() | ||
return (Atan2(speed[2], speed[1]) + 360) % 360 // Yes ATAN2(y, x) is correct to get clockwise degrees | ||
|
||
/obj/overmap/visitable/ship/get_distress_info() | ||
var/turf/T = get_turf(src) // Usually we're on the turf, but sometimes we might be landed or something. | ||
var/x_to_use = T?.x || "UNK" | ||
var/y_to_use = T?.y || "UNK" | ||
return "\[X:[x_to_use], Y:[y_to_use], VEL:[get_speed() * 1000], HDG:[get_heading_degrees()]\]" | ||
|
||
/obj/overmap/visitable/proc/distress_update() | ||
var/message = "Это последнее сообщение с маяка бедствия, запущенного '[initial(name)]'. Местоположение передающего устройства: [get_distress_info()]. \ | ||
Пожалуйста, окажите помощь в соответствии с вашими обязательствами по Межпланетной конвенции о космической спасательной деятельности, или передайте это сообщение той стороне, которая может это сделать." | ||
|
||
//sends to a single z-level of every /obj/overmap/visitable | ||
var/list/sent_to_z = list() | ||
for(var/zlevel in map_sectors) | ||
var/obj/overmap/visitable/O = map_sectors[zlevel] | ||
if(!isnull(O)) | ||
var/should_send = TRUE | ||
var/list/overmap_z_list = O.map_z | ||
for(var/z_map in overmap_z_list) | ||
if(z_map in sent_to_z) | ||
should_send = FALSE | ||
else | ||
sent_to_z.Add(z_map) | ||
if(should_send && length(overmap_z_list)) | ||
priority_announcement.Announce(message, "Automated Distress Signal", new_sound = sound('packs/infinity/sound/AI/sos.ogg'), zlevels = overmap_z_list) | ||
|
||
//sends to a single random z-level (original) | ||
//priority_announcement.Announce(message, "Automated Distress Signal", new_sound = sound('packs/infinity/sound/AI/sos.ogg'), zlevels = GLOB.using_map.player_levels) |
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,64 @@ | ||
/obj/structure/panic_button | ||
name = "distress beacon trigger" | ||
desc = "WARNING: Will deploy ship's distress beacon and request help. Misuse may result in fines and jail time." | ||
icon = 'packs/infinity/icons/obj/panicbutton.dmi' | ||
icon_state = "panicbutton" | ||
anchored = TRUE | ||
|
||
var/glass = TRUE | ||
var/launched = FALSE | ||
|
||
|
||
/obj/structure/panic_button/on_update_icon() | ||
if(launched) | ||
icon_state = "[initial(icon_state)]_launched" | ||
else if(!glass) | ||
icon_state = "[initial(icon_state)]_open" | ||
else | ||
icon_state = "[initial(icon_state)]" | ||
|
||
/obj/structure/panic_button/attack_hand(mob/living/user) | ||
if(!istype(user)) | ||
return ..() | ||
|
||
if(user.incapacitated()) | ||
return | ||
|
||
// Already launched | ||
if(launched) | ||
to_chat(user, "<span class='warning'>The button is already depressed; the beacon has been launched already.</span>") | ||
// Glass present | ||
else if(glass) | ||
if(user.a_intent == I_HURT) | ||
user.custom_emote(VISIBLE_MESSAGE, "smashes the glass on [src]!") | ||
glass = FALSE | ||
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg') | ||
update_icon() | ||
else | ||
user.custom_emote(VISIBLE_MESSAGE, "pats [src] in a friendly manner.") | ||
to_chat(user, "<span class='warning'>If you're trying to break the glass, you'll have to hit it harder than that...</span>") | ||
// Must be !glass and !launched | ||
else if(!glass && !launched) | ||
user.custom_emote(VISIBLE_MESSAGE, "pushes the button on [src]!") | ||
playsound(src, get_sfx("button")) | ||
update_icon() | ||
launch(usr) | ||
|
||
/obj/structure/panic_button/proc/launch(mob/living/user) | ||
var/sound/SND = sound('packs/infinity/sound/misc/emergency_beacon_launched.ogg') // Inside the loop because playsound_local modifies it for each person, so, need separate instances | ||
|
||
if(launched) | ||
return | ||
launched = TRUE | ||
|
||
var/overmap_sector | ||
|
||
if(GLOB.using_map.use_overmap) | ||
overmap_sector = map_sectors["[z]"] | ||
|
||
var/obj/overmap/visitable/S = overmap_sector | ||
if(!S) | ||
error("Distress button hit on z[z] but that's not an overmap sector...") | ||
return | ||
S.distress(user) | ||
playsound(src, SND, 25) |
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,83 @@ | ||
|
||
#### Список PRов: | ||
|
||
- https://github.com/SierraBay/SierraBay12/pull/2667 | ||
<!-- | ||
Ссылки на PRы, связанные с модом: | ||
- Создание | ||
- Большие изменения | ||
--> | ||
|
||
<!-- Название мода. Не важно на русском или на английском. --> | ||
## Overmap | ||
|
||
ID мода: OVERMAP | ||
<!-- | ||
Название модпака прописными буквами, СОЕДИНЁННЫМИ_ПОДЧЁРКИВАНИЕМ, | ||
которое ты будешь использовать для обозначения файлов. | ||
--> | ||
|
||
### Описание мода | ||
|
||
Портирует отображение для скана контактов и экстренную кнопку бедствия. В идеале может содержать любые изменения по овермапу. | ||
<!-- | ||
Что он делает, что добавляет: что, куда, зачем и почему - всё здесь. | ||
А также любая полезная информация. | ||
--> | ||
|
||
### Изменения *кор кода* | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если вы редактировали какие-либо процедуры или переменные в кор коде, | ||
они должны быть указаны здесь. | ||
Нужно указать и файл, и процедуры/переменные. | ||
Изменений нет - напиши "Отсутствуют" | ||
--> | ||
|
||
### Оверрайды | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если ты добавлял новый модульный оверрайд, его нужно указать здесь. | ||
Здесь указываются оверрайды в твоём моде и папке `_master_files` | ||
Изменений нет - напиши "Отсутствуют" | ||
--> | ||
|
||
### Дефайны | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если требовалось добавить какие-либо дефайны, укажи файлы, | ||
в которые ты их добавил, а также перечисли имена. | ||
И то же самое, если ты используешь дефайны, определённые другим модом. | ||
Не используешь - напиши "Отсутствуют" | ||
--> | ||
|
||
### Используемые файлы, не содержащиеся в модпаке | ||
|
||
- `mods/_master_files/code/modules/overmap/distress.dm` | ||
- `mods/_master_files/code/modules/overmap/panicbutton.dm` | ||
- `packs/infinity/icons/obj/distress.dmi` | ||
- `packs/infinity/sound/AI/sos.ogg` | ||
- `packs/infinity/icons/obj/panicbutton.dmi` | ||
- `packs/infinity/sound/misc/emergency_beacon_launched.ogg` | ||
<!-- | ||
Будь то немодульный файл или модульный файл, который не содержится в папке, | ||
принадлежащей этому конкретному моду, он должен быть упомянут здесь. | ||
Хорошими примерами являются иконки или звуки, которые используются одновременно | ||
несколькими модулями, или что-либо подобное. | ||
--> | ||
|
||
### Авторы: | ||
|
||
Портировал:Builder13 | ||
Оригинальный ПР: https://github.com/ss220-space/Baystation12/pull/350 (ImJustKisik) | ||
<!-- | ||
Здесь находится твой никнейм | ||
Если работал совместно - никнеймы тех, кто помогал. | ||
В случае порта чего-либо должна быть ссылка на источник. | ||
--> |
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,4 @@ | ||
/singleton/modpack/overmap | ||
name = "Overmap" | ||
desc = "Дополнения и изменения, связанные с овермапом." | ||
author = "Builder13(портировал), ImJustKisik(автор)" |
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,15 @@ | ||
#ifndef MODPACK_OVERMAP | ||
#define MODPACK_OVERMAP | ||
|
||
#include "_overmap.dm" | ||
|
||
#include "code/contacts/contact_class.dm" | ||
#include "code/contacts/special_contact_class.dm" | ||
|
||
#include "code/overmap_object.dm" | ||
#include "code/ship.dm" | ||
|
||
#include "code/overmap_objects/stationary.dm" | ||
#include "code/overmap_objects/ships.dm" | ||
|
||
#endif |
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,38 @@ | ||
/decl/ship_contact_class | ||
var/class_short = "Ship" | ||
var/class_long = "Unknown Ship Class" | ||
var/min_ship_mass = 0 | ||
var/max_ship_mass = INFINITY | ||
|
||
/decl/ship_contact_class/ship | ||
class_short = "SH" | ||
class_long = "Ship" | ||
max_ship_mass = 10000 | ||
|
||
/decl/ship_contact_class/shuttle | ||
class_short = "SHUTTLE" | ||
class_long = "Shuttle" | ||
max_ship_mass = 10000 | ||
|
||
/decl/ship_contact_class/destroyer_escort | ||
class_short = "DE" | ||
class_long = "Destroyer Escort" | ||
min_ship_mass = 10000 | ||
max_ship_mass = 50000 | ||
|
||
/decl/ship_contact_class/destroyer | ||
class_short = "DD" | ||
class_long = "Destroyer" | ||
min_ship_mass = 50000 | ||
max_ship_mass = 100000 | ||
|
||
/decl/ship_contact_class/cruiser | ||
class_short = "CA" | ||
class_long = "Cruiser" | ||
min_ship_mass = 100000 | ||
max_ship_mass = 250000 | ||
|
||
/decl/ship_contact_class/capital_ship | ||
class_short = "CAP" | ||
class_long = "Capital Ship" | ||
min_ship_mass = 250000 |
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,34 @@ | ||
/decl/ship_contact_class/srv | ||
class_short = "SRV" | ||
class_long = "Sol Research Vessel" | ||
max_ship_mass = 12000 | ||
|
||
/decl/ship_contact_class/srv_shuttle | ||
class_short = "SRV" | ||
class_long = "Research Shuttle" | ||
max_ship_mass = 6000 | ||
|
||
/decl/ship_contact_class/gagarin | ||
class_short = "GRC" | ||
class_long = "Gagarin-Class recon craft" | ||
max_ship_mass = 55000 | ||
|
||
/decl/ship_contact_class/merchant | ||
class_short = "FTU" | ||
class_long = "Free Trader Union Ship" | ||
max_ship_mass = 7000 | ||
|
||
/decl/ship_contact_class/nagashino | ||
class_short = "NAG" | ||
class_long = "Nagashino-Class patrol craft" | ||
max_ship_mass = 5000 | ||
|
||
/decl/ship_contact_class/dagon | ||
class_short = "MAKO" | ||
class_long = "Mako-Class Frigate" | ||
max_ship_mass = 70000 | ||
|
||
/decl/ship_contact_class/nt_sshuttle | ||
class_short = "NSS" | ||
class_long = "Nanotrasen Small Shuttle" | ||
max_ship_mass = 70000 |
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,13 @@ | ||
/obj/overmap | ||
var/scanner_desc = "" | ||
|
||
/obj/overmap/get_scan_data(mob/user) | ||
var/temp_data = list({"<b>Scan conducted at</b>: <br>[stationtime2text()] [stationdate2text()] <b>Grid coordinates</b>:<br> [x],[y]\n\n[scanner_desc]"}) | ||
for(var/id in scans) | ||
var/datum/sector_scan/scan = scans[id] | ||
if (!scan.required_skill || user.skill_check(scan.required_skill, scan.required_skill_level)) | ||
temp_data += scan.description | ||
else if (scan.low_skill_description) | ||
temp_data += scan.low_skill_description | ||
|
||
return temp_data |
Oops, something went wrong.