Files
GS13NG/code/game/objects/items/charter.dm
Poojawa 0bca862419 Overhauls and 2/28 sync (#244)
* map tweaks/shuttle engines

* helpers and defines

* global/onclick

* controllers and datums

* mapping

* game folder

* some other stuff

* some modules

* modules that aren't mobs

* some mob stuff

* new player stuff

* mob living

* silicon stuff

* simple animal things

* carbon/ayylmao

* update_icons

* carbon/human

* sounds and tools

* icons and stuff

* hippie grinder changes + tgui

* kitchen.dmi

* compile issues fixed

* mapfix

* Mapfixes 2.0

* mapedit2.0

* mapmerger pls

* Revert "mapedit2.0"

This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481.

* clean up vore folder + 2 hotfixes

* admin ticket refinement

* Blob tweaks and LAZYADD

* LAZYADD IS LAZY

* Magic strings purged

* DEFINES NEED HIGHER PRIORITIES

* Only a sleepless idiot deals in absolute TRUE|FALSE

* u h g

* progress bar fix

* reverts ticket logs

* there's always that one guy

* fixes and stuff

* 2/27 fixes

* game folder stuff

* stats

* some modules again

* clothing stuff

gets vg clothing out of the main files

* everything not mobs again

* mob stuff

* maps, tgui, sql stuff

* icons

* additional fixes and compile errors

* don't need this anymore

* Oh right this isn't needed anymore

* maint bar re-added

* that doesn't need to be here

* stupid events

* wtfeven

* probably makes Travis happy

* don't care to fix the grinder atm

* fixes vending sprites, changes turret

* lethal, not lethals

* overylays are finicky creatures

* lazy fix for bleeding edgy (#252)

* map tweaks/shuttle engines

* helpers and defines

* global/onclick

* controllers and datums

* mapping

* game folder

* some other stuff

* some modules

* modules that aren't mobs

* some mob stuff

* new player stuff

* mob living

* silicon stuff

* simple animal things

* carbon/ayylmao

* update_icons

* carbon/human

* sounds and tools

* icons and stuff

* hippie grinder changes + tgui

* kitchen.dmi

* compile issues fixed

* mapfix

* Mapfixes 2.0

* mapedit2.0

* mapmerger pls

* Revert "mapedit2.0"

This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481.

* clean up vore folder + 2 hotfixes

* admin ticket refinement

* Blob tweaks and LAZYADD

* LAZYADD IS LAZY

* Magic strings purged

* DEFINES NEED HIGHER PRIORITIES

* Only a sleepless idiot deals in absolute TRUE|FALSE

* u h g

* progress bar fix

* reverts ticket logs

* there's always that one guy

* fixes and stuff

* 2/27 fixes

* game folder stuff

* stats

* some modules again

* clothing stuff

gets vg clothing out of the main files

* everything not mobs again

* mob stuff

* maps, tgui, sql stuff

* icons

* additional fixes and compile errors

* don't need this anymore

* Oh right this isn't needed anymore

* maint bar re-added

* that doesn't need to be here

* stupid events

* wtfeven

* probably makes Travis happy

* don't care to fix the grinder atm

* fixes vending sprites, changes turret

* lethal, not lethals

* overylays are finicky creatures
2017-02-28 09:30:49 -06:00

99 lines
3.7 KiB
Plaintext

#define STATION_RENAME_TIME_LIMIT 3000
/obj/item/station_charter
name = "station charter"
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll2"
desc = "An official document entrusting the governance of the station \
and surrounding space to the Captain. "
var/used = FALSE
var/unlimited_uses = FALSE
var/ignores_timeout = FALSE
var/response_timer_id = null
var/approval_time = 600
var/static/regex/standard_station_regex
/obj/item/station_charter/New()
. = ..()
if(!standard_station_regex)
var/prefixes = jointext(station_prefixes, "|")
var/names = jointext(station_names, "|")
var/suffixes = jointext(station_suffixes, "|")
var/numerals = jointext(station_numerals, "|")
var/regexstr = "(([prefixes]) )?(([names]) ?)([suffixes]) ([numerals])"
standard_station_regex = new(regexstr)
/obj/item/station_charter/Destroy()
if(response_timer_id)
deltimer(response_timer_id)
response_timer_id = null
. = ..()
/obj/item/station_charter/attack_self(mob/living/user)
if(used)
user << "This charter has already been used to name the station."
return
if(!ignores_timeout && (world.time-round_start_time > STATION_RENAME_TIME_LIMIT)) //5 minutes
user << "The crew has already settled into the shift. \
It probably wouldn't be good to rename the station right now."
return
if(response_timer_id)
user << "You're still waiting for approval from your employers about \
your proposed name change, it'd be best to wait for now."
return
var/new_name = stripped_input(user, message="What do you want to name \
[station_name()]? Keep in mind particularly terrible names may be \
rejected by your employers, while names using the standard format, \
will automatically be accepted.", max_length=MAX_CHARTER_LEN)
if(!new_name)
return
log_game("[key_name(user)] has proposed to name the station as \
[new_name]")
if(standard_station_regex.Find(new_name))
user << "Your name has been automatically approved."
rename_station(new_name, user)
return
user << "Your name has been sent to your employers for approval."
// Autoapproves after a certain time
response_timer_id = addtimer(CALLBACK(src, .proc/rename_station, new_name, user.name, user.real_name, key_name(user)), approval_time, TIMER_STOPPABLE)
admins << "<span class='adminnotice'><b><font color=orange>CUSTOM STATION RENAME:</font></b>[key_name_admin(user)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) proposes to rename the station to [new_name] (will autoapprove in [approval_time / 10] seconds). (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[user]'>BSA</A>) (<A HREF='?_src_=holder;reject_custom_name=\ref[src]'>REJECT</A>) (<a href='?_src_=holder;CentcommReply=\ref[user]'>RPLY</a>)</span>"
/obj/item/station_charter/proc/reject_proposed(user)
if(!user)
return
if(!response_timer_id)
return
var/turf/T = get_turf(src)
T.visible_message("<span class='warning'>The proposed changes disappear \
from [src]; it looks like they've been rejected.</span>")
var/m = "[key_name(user)] has rejected the proposed station name."
message_admins(m)
log_admin(m)
deltimer(response_timer_id)
response_timer_id = null
/obj/item/station_charter/proc/rename_station(designation, uname, ureal_name, ukey)
if(config && config.server_name)
world.name = "[config.server_name]: [designation]"
else
world.name = designation
station_name = designation
minor_announce("[ureal_name] has designated your station as [station_name()]", "Captain's Charter", 0)
log_game("[ukey] has renamed the station as [station_name()].")
name = "station charter for [station_name()]"
desc = "An official document entrusting the governance of \
[station_name()] and surrounding space to Captain [uname]."
if(!unlimited_uses)
used = TRUE
#undef STATION_RENAME_TIME_LIMIT