diff --git a/config/game_options.txt b/config/game_options.txt index 5812daf382b..d84a17af2fd 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -591,3 +591,6 @@ RANDOM_LOOT_WEIGHT_MODIFIER 1 ## FF CONFIGS ROUNDSTART_RACES nabber +MOUSE_GHOST_RESPAWN_TIME 3 +MOUSE_GHOST_DISABLE 0 +MOUSE_GHOST_ONLY_VETERAN 1 diff --git a/tff_modular/modules/mouse_ghost/code/configuration.dm b/tff_modular/modules/mouse_ghost/code/configuration.dm new file mode 100644 index 00000000000..e0e12340bbf --- /dev/null +++ b/tff_modular/modules/mouse_ghost/code/configuration.dm @@ -0,0 +1,9 @@ +/datum/config_entry/number/mouse_ghost_respawn_time + default = 3 + integer = FALSE + min_val = 0 + +/datum/config_entry/flag/mouse_ghost_disable + +/datum/config_entry/flag/mouse_ghost_only_veteran + default = TRUE diff --git a/tff_modular/modules/mouse_ghost/code/mob/dead/observer/observer.dm b/tff_modular/modules/mouse_ghost/code/mob/dead/observer/observer.dm new file mode 100644 index 00000000000..c844b854c30 --- /dev/null +++ b/tff_modular/modules/mouse_ghost/code/mob/dead/observer/observer.dm @@ -0,0 +1,57 @@ +/mob/ghostize() + . = ..() + var/mob/dead/observer/ghost = . + ghost?.client?.time_died_as_mouse = ghost?.client?.player_details.time_of_death + +/mob/dead/observer/verb/become_mouse() + set name = "Become mouse" + set category = "Ghost" + + if(CONFIG_GET(flag/mouse_ghost_disable)) + to_chat(src, span_warning("Spawning as a mouse is currently disabled.")) + return + + if(!client) + return + if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse) + to_chat(src, span_warning("Your non-dead body prevent you from respawning.")) + return + + if (CONFIG_GET(flag/mouse_ghost_only_veteran) && !SSplayer_ranks.is_veteran(client)) + to_chat(src, span_warning("At the moment, this requires veteran rank.")) + return + + var/mouse_ghost_respawn_time = CONFIG_GET(number/mouse_ghost_respawn_time) + var/timedifference = world.time - client.time_died_as_mouse + if(client.time_died_as_mouse && timedifference <= mouse_ghost_respawn_time * 600) + var/timedifference_text + timedifference_text = time2text(mouse_ghost_respawn_time * 600 - timedifference,"mm:ss") + to_chat(src, span_warning("You may only spawn again as a mouse more than [mouse_ghost_respawn_time] minutes after your death. You have [timedifference_text] left.")) + return + + var/response = tgui_alert(src, "Are you -sure- you want to become a mouse?","Are you sure you want to squeek?",list("Squeek!","Nope!")) + if(response != "Squeek!") return //Hit the wrong key...again. + + var/mob/living/basic/mouse/host + var/obj/machinery/atmospherics/components/unary/vent_pump/vent_found + var/list/vents = list() + // Поиск подходящей вентиляции + for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/components/unary/vent_pump)) + if(QDELETED(temp_vent)) + continue + if(is_station_level(temp_vent.loc.z) && !temp_vent.welded) + var/datum/pipeline/temp_vent_parent = temp_vent.parents[1] + if(!temp_vent_parent) + continue + if(length(temp_vent_parent.other_atmos_machines) > 20) + vents += temp_vent + if(vents.len) + vent_found = pick(vents) + host = new /mob/living/basic/mouse/(get_turf(vent_found)) + else + to_chat(src, span_warning("Unable to find any unwelded vents to spawn mice at.")) + + if(host) + host.ckey = src.ckey + host.move_into_vent(vent_found) + to_chat(host, span_info("You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.")) diff --git a/tff_modular/modules/mouse_ghost/code/mob/living/basic/vermin/mouse.dm b/tff_modular/modules/mouse_ghost/code/mob/living/basic/vermin/mouse.dm new file mode 100644 index 00000000000..592d6fd13fe --- /dev/null +++ b/tff_modular/modules/mouse_ghost/code/mob/living/basic/vermin/mouse.dm @@ -0,0 +1,51 @@ +/mob/living/basic/mouse + mobility_flags = MOBILITY_FLAGS_REST_CAPABLE_DEFAULT + icon = 'tff_modular/modules/mouse_ghost/icons/mob/simple/mouse.dmi' + +/mob/living/basic/mouse/Initialize() + . = ..() + add_verb(src, /mob/living/proc/toggle_resting) + +/mob/living/basic/mouse/death() + if(client) + client.time_died_as_mouse = world.time + . = ..() + +/mob/living/basic/mouse/update_resting() + . = ..() + if(stat == DEAD) + return + update_appearance(UPDATE_ICON_STATE) + +/mob/living/basic/mouse/update_icon_state() + . = ..() + if (resting) + icon_state = "[icon_living]_rest" + return + icon_state = "[icon_living]" + +/datum/language_holder/mouse + understood_languages = list( + /datum/language/mouse = list(LANGUAGE_ATOM), + ) + spoken_languages = list( + /datum/language/mouse = list(LANGUAGE_ATOM), + ) + +/datum/language/mouse + name = "Squeekspeak" + desc = "Ancient language of the mousekind. Allegedly has over 300 words for cheese." + key = "n" + default_priority = 10 + + icon = 'tff_modular/modules/mouse_ghost/icons/ui/chat/language.dmi' + icon_state = "mouse" + + syllables = list( + list( + "skee", "ree", "chit", "pip", "squeak", "whik", "fik", "tik", "zit", "kee", "pik", "mip", "skrit", "chirk", "frip", + ), + ) + +/mob/living/basic/mouse + initial_language_holder = /datum/language_holder/mouse diff --git a/tff_modular/modules/mouse_ghost/code/modules/client/client_defines.dm b/tff_modular/modules/mouse_ghost/code/modules/client/client_defines.dm new file mode 100644 index 00000000000..f8e5136a054 --- /dev/null +++ b/tff_modular/modules/mouse_ghost/code/modules/client/client_defines.dm @@ -0,0 +1,2 @@ +/client + var/time_died_as_mouse = null diff --git a/tff_modular/modules/mouse_ghost/icons/mob/simple/mouse.dmi b/tff_modular/modules/mouse_ghost/icons/mob/simple/mouse.dmi new file mode 100644 index 00000000000..d6e2d2932ff Binary files /dev/null and b/tff_modular/modules/mouse_ghost/icons/mob/simple/mouse.dmi differ diff --git a/tff_modular/modules/mouse_ghost/icons/ui/chat/language.dmi b/tff_modular/modules/mouse_ghost/icons/ui/chat/language.dmi new file mode 100644 index 00000000000..e40dedab7db Binary files /dev/null and b/tff_modular/modules/mouse_ghost/icons/ui/chat/language.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 401c588d52f..b1b6b68d761 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -8879,6 +8879,10 @@ #include "tff_modular\modules\martial\sleeping_carp.dm" #include "tff_modular\modules\modular_automapper\automapper.dm" #include "tff_modular\modules\modular_automapper\replacer.dm" +#include "tff_modular\modules\mouse_ghost\code\configuration.dm" +#include "tff_modular\modules\mouse_ghost\code\mob\dead\observer\observer.dm" +#include "tff_modular\modules\mouse_ghost\code\mob\living\basic\vermin\mouse.dm" +#include "tff_modular\modules\mouse_ghost\code\modules\client\client_defines.dm" #include "tff_modular\modules\nabbers\code\_nabbers.dm" #include "tff_modular\modules\nabbers\code\nabber_bodyparts.dm" #include "tff_modular\modules\nabbers\code\nabber_bolaimmunity.dm"