Replaced most instances of Nanotrasen mentions into GATO, though I've kept some that have more sense to be kept as Nanotrasen (like nanotrasen marked stuff and such)
150 lines
6.3 KiB
Plaintext
150 lines
6.3 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/name_type = "station"
|
|
|
|
var/unlimited_uses = FALSE
|
|
var/ignores_timeout = FALSE
|
|
var/response_timer_id = null
|
|
var/approval_time = 600
|
|
var/allow_unicode = FALSE
|
|
var/admin_approved = FALSE
|
|
|
|
var/static/regex/standard_station_regex
|
|
|
|
/obj/item/station_charter/Initialize(mapload)
|
|
. = ..()
|
|
if(!standard_station_regex)
|
|
var/prefixes = jointext(GLOB.station_prefixes, "|")
|
|
var/names = jointext(GLOB.station_names, "|")
|
|
var/suffixes = jointext(GLOB.station_suffixes, "|")
|
|
var/numerals = jointext(GLOB.station_numerals, "|")
|
|
var/regexstr = "^(([prefixes]) )?(([names]) ?)([suffixes]) ([numerals])$"
|
|
standard_station_regex = new(regexstr)
|
|
|
|
/obj/item/station_charter/attack_self(mob/living/user)
|
|
if(used)
|
|
to_chat(user, "The [name_type] has already been named.")
|
|
return
|
|
if(!ignores_timeout && (world.time-SSticker.round_start_time > STATION_RENAME_TIME_LIMIT)) //5 minutes
|
|
to_chat(user, "The crew has already settled into the shift. It probably wouldn't be good to rename the [name_type] right now.")
|
|
return
|
|
if(response_timer_id)
|
|
to_chat(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 = html_decode(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(response_timer_id)
|
|
to_chat(user, "You're still waiting for approval from your employers about your proposed name change, it'd be best to wait for now.")
|
|
return
|
|
|
|
if(!new_name)
|
|
return
|
|
if(!allow_unicode && (length(new_name) != length_char(new_name)))
|
|
to_chat(user, "Unicode is not allowed. Adminhelp if you want to use it so badly.")
|
|
return
|
|
log_game("[key_name(user)] has proposed to name the station as \
|
|
[new_name]")
|
|
|
|
if(standard_station_regex.Find(new_name))
|
|
to_chat(user, "Your name has been automatically approved.")
|
|
rename_station(new_name, user.name, user.real_name, key_name(user))
|
|
return
|
|
|
|
to_chat(user, "Your name has been sent to your employers for approval.")
|
|
// Autoapproves after a certain time
|
|
var/requires_approval = CONFIG_GET(flag/station_name_needs_approval)
|
|
response_timer_id = addtimer(CALLBACK(src, PROC_REF(check_state), new_name, user.name, user.real_name, key_name(user)), approval_time, TIMER_STOPPABLE)
|
|
to_chat(GLOB.admins, "<span class='adminnotice'><b><font color=orange>CUSTOM STATION RENAME:</font></b>[ADMIN_LOOKUPFLW(user)] proposes to rename the [name_type] to [html_encode(new_name)] ([requires_approval ? "REQUIRES ADMIN APPROVAL and will autodeny" : "will autoapprove"] in [DisplayTimeText(approval_time)]). [ADMIN_SMITE(user)] (<A HREF='?_src_=holder;[HrefToken(TRUE)];reject_custom_name=[REF(src)]'>REJECT</A>)[requires_approval ? " (<A HREF='?_src_=holder;[HrefToken(TRUE)];approve_custom_name=[REF(src)]'>APPROVE</A>)" : ""] [ADMIN_CENTCOM_REPLY(user)]</span>")
|
|
|
|
/obj/item/station_charter/proc/check_state(designation, uname, ureal_name, ukey)
|
|
var/requires_approval = CONFIG_GET(flag/station_name_needs_approval)
|
|
if(requires_approval && !admin_approved)
|
|
var/turf/T = get_turf(src)
|
|
T.visible_message("<span class='warning'>A note appears on [src], stating this sector requires central command approval for its station names, which was not performed in time for this request. Looks like the change has been auto-rejected.</span>")
|
|
var/m = "Station rename has been autorejected due to config requiring admin approval."
|
|
message_admins(m)
|
|
log_admin(m)
|
|
else
|
|
rename_station(designation, uname, ureal_name, ukey)
|
|
response_timer_id = null
|
|
admin_approved = FALSE
|
|
|
|
/obj/item/station_charter/proc/allow_pass(user)
|
|
if(!user)
|
|
return
|
|
if(!response_timer_id)
|
|
return
|
|
admin_approved = TRUE
|
|
var/m = "[key_name(user)] has approved the proposed station name. It can still be denied prior to the timer expiring."
|
|
message_admins(m)
|
|
log_admin(m)
|
|
|
|
/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
|
|
admin_approved = FALSE
|
|
|
|
/obj/item/station_charter/proc/rename_station(designation, uname, ureal_name, ukey)
|
|
set_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]."
|
|
SSblackbox.record_feedback("text", "station_renames", 1, "[station_name()]")
|
|
if(!unlimited_uses)
|
|
used = TRUE
|
|
|
|
/obj/item/station_charter/admin
|
|
unlimited_uses = TRUE
|
|
ignores_timeout = TRUE
|
|
|
|
|
|
/obj/item/station_charter/flag
|
|
name = "GATO banner"
|
|
icon = 'icons/obj/items_and_weapons.dmi'
|
|
name_type = "planet"
|
|
icon_state = "banner"
|
|
item_state = "banner"
|
|
lefthand_file = 'icons/mob/inhands/equipment/banners_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/banners_righthand.dmi'
|
|
desc = "A cunning device used to claim ownership of planets."
|
|
w_class = 5
|
|
force = 15
|
|
|
|
/obj/item/station_charter/flag/rename_station(designation, uname, ureal_name, ukey)
|
|
set_station_name(designation)
|
|
minor_announce("[ureal_name] has designated the planet as [station_name()]", "Captain's Banner", 0)
|
|
log_game("[ukey] has renamed the planet as [station_name()].")
|
|
name = "banner of [station_name()]"
|
|
desc = "The banner bears the official coat of arms of GATO, signifying that [station_name()] has been claimed by Captain [uname] in the name of the company."
|
|
SSblackbox.record_feedback("text", "station_renames", 1, "[station_name()]")
|
|
if(!unlimited_uses)
|
|
used = TRUE
|
|
|
|
#undef STATION_RENAME_TIME_LIMIT
|