Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Мыши: Стадия 1 #5274

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions tff_modular/modules/mouse_ghost/code/configuration.dm
Original file line number Diff line number Diff line change
@@ -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
57 changes: 57 additions & 0 deletions tff_modular/modules/mouse_ghost/code/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
@@ -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."))
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/client
var/time_died_as_mouse = null
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading