Revert "PLASE"

This reverts commit 8af225e6e3.
This commit is contained in:
Fermi
2019-11-24 03:06:08 +00:00
parent aeb8606ce0
commit ba4fa1ef67
2145 changed files with 1387321 additions and 5257 deletions
@@ -0,0 +1,633 @@
#define LINKIFY_READY(string, value) "<a href='byond://?src=[REF(src)];ready=[value]'>[string]</a>"
/mob/dead/new_player
var/ready = 0
var/spawning = 0//Referenced when you want to delete the new_player later on in the code.
flags_1 = NONE
invisibility = INVISIBILITY_ABSTRACT
density = FALSE
stat = DEAD
canmove = FALSE
anchored = TRUE // don't get pushed around
var/mob/living/new_character //for instant transfer once the round is set up
//Used to make sure someone doesn't get spammed with messages if they're ineligible for roles
var/ineligible_for_roles = FALSE
/mob/dead/new_player/Initialize()
if(client && SSticker.state == GAME_STATE_STARTUP)
var/obj/screen/splash/S = new(client, TRUE, TRUE)
S.Fade(TRUE)
if(length(GLOB.newplayer_start))
forceMove(pick(GLOB.newplayer_start))
else
forceMove(locate(1,1,1))
ComponentInitialize()
. = ..()
/mob/dead/new_player/prepare_huds()
return
/mob/dead/new_player/proc/new_player_panel()
var/output = "<center><p>Welcome, <b>[client ? client.prefs.real_name : "Unknown User"]</b></p>"
output += "<center><p><a href='byond://?src=[REF(src)];show_preferences=1'>Setup Character</a></p>"
if(SSticker.current_state <= GAME_STATE_PREGAME)
switch(ready)
if(PLAYER_NOT_READY)
output += "<p>\[ [LINKIFY_READY("Ready", PLAYER_READY_TO_PLAY)] | <b>Not Ready</b> | [LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)] \]</p>"
if(PLAYER_READY_TO_PLAY)
output += "<p>\[ <b>Ready</b> | [LINKIFY_READY("Not Ready", PLAYER_NOT_READY)] | [LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)] \]</p>"
if(PLAYER_READY_TO_OBSERVE)
output += "<p>\[ [LINKIFY_READY("Ready", PLAYER_READY_TO_PLAY)] | [LINKIFY_READY("Not Ready", PLAYER_NOT_READY)] | <b> Observe </b> \]</p>"
else
output += "<p><a href='byond://?src=[REF(src)];manifest=1'>View the Crew Manifest</a></p>"
output += "<p><a href='byond://?src=[REF(src)];late_join=1'>Join Game!</a></p>"
output += "<p>[LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)]</p>"
if(!IsGuestKey(src.key))
if (SSdbcore.Connect())
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
var/datum/DBQuery/query_get_new_polls = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[sanitizeSQL(ckey)]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[sanitizeSQL(ckey)]\")")
var/rs = REF(src)
if(query_get_new_polls.Execute())
var/newpoll = 0
if(query_get_new_polls.NextRow())
newpoll = 1
if(newpoll)
output += "<p><b><a href='byond://?src=[rs];showpoll=1'>Show Player Polls</A> (NEW!)</b></p>"
else
output += "<p><a href='byond://?src=[rs];showpoll=1'>Show Player Polls</A></p>"
qdel(query_get_new_polls)
if(QDELETED(src))
return
output += "</center>"
//src << browse(output,"window=playersetup;size=210x240;can_close=0")
var/datum/browser/popup = new(src, "playersetup", "<div align='center'>New Player Options</div>", 250, 265)
popup.set_window_options("can_close=0")
popup.set_content(output)
popup.open(FALSE)
/mob/dead/new_player/Topic(href, href_list[])
if(src != usr)
return 0
if(!client)
return 0
//Determines Relevent Population Cap
var/relevant_cap
var/hpc = CONFIG_GET(number/hard_popcap)
var/epc = CONFIG_GET(number/extreme_popcap)
if(hpc && epc)
relevant_cap = min(hpc, epc)
else
relevant_cap = max(hpc, epc)
if(href_list["show_preferences"])
client.prefs.ShowChoices(src)
return 1
if(href_list["ready"])
var/tready = text2num(href_list["ready"])
//Avoid updating ready if we're after PREGAME (they should use latejoin instead)
//This is likely not an actual issue but I don't have time to prove that this
//no longer is required
if(SSticker.current_state <= GAME_STATE_PREGAME)
ready = tready
//if it's post initialisation and they're trying to observe we do the needful
if(!SSticker.current_state < GAME_STATE_PREGAME && tready == PLAYER_READY_TO_OBSERVE)
ready = tready
make_me_an_observer()
return
if(href_list["refresh"])
src << browse(null, "window=playersetup") //closes the player setup window
new_player_panel()
if(href_list["late_join"])
if(!SSticker || !SSticker.IsRoundInProgress())
to_chat(usr, "<span class='danger'>The round is either not ready, or has already finished...</span>")
return
if(href_list["late_join"] == "override")
LateChoices()
return
if(SSticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in GLOB.admin_datums)))
to_chat(usr, "<span class='danger'>[CONFIG_GET(string/hard_popcap_message)]</span>")
var/queue_position = SSticker.queued_players.Find(usr)
if(queue_position == 1)
to_chat(usr, "<span class='notice'>You are next in line to join the game. You will be notified when a slot opens up.</span>")
else if(queue_position)
to_chat(usr, "<span class='notice'>There are [queue_position-1] players in front of you in the queue to join the game.</span>")
else
SSticker.queued_players += usr
to_chat(usr, "<span class='notice'>You have been added to the queue to join the game. Your position in queue is [SSticker.queued_players.len].</span>")
return
LateChoices()
if(href_list["manifest"])
ViewManifest()
if(href_list["SelectedJob"])
if(!SSticker || !SSticker.IsRoundInProgress())
var/msg = "[key_name(usr)] attempted to join the round using a href that shouldn't be available at this moment!"
log_admin(msg)
message_admins(msg)
to_chat(usr, "<span class='danger'>The round is either not ready, or has already finished...</span>")
return
if(!GLOB.enter_allowed)
to_chat(usr, "<span class='notice'>There is an administrative lock on entering the game!</span>")
return
if(SSticker.queued_players.len && !(ckey(key) in GLOB.admin_datums))
if((living_player_count() >= relevant_cap) || (src != SSticker.queued_players[1]))
to_chat(usr, "<span class='warning'>Server is full.</span>")
return
AttemptLateSpawn(href_list["SelectedJob"])
return
if(href_list["JoinAsGhostRole"])
if(!GLOB.enter_allowed)
to_chat(usr, "<span class='notice'> There is an administrative lock on entering the game!</span>")
if(SSticker.queued_players.len && !(ckey(key) in GLOB.admin_datums))
if((living_player_count() >= relevant_cap) || (src != SSticker.queued_players[1]))
to_chat(usr, "<span class='warning'>Server is full.</span>")
return
var/obj/effect/mob_spawn/MS = pick(GLOB.mob_spawners[href_list["JoinAsGhostRole"]])
if(MS.attack_ghost(src, latejoinercalling = TRUE))
SSticker.queued_players -= src
SSticker.queue_delay = 4
qdel(src)
if(!ready && href_list["preference"])
if(client)
client.prefs.process_link(src, href_list)
else if(!href_list["late_join"])
new_player_panel()
if(href_list["showpoll"])
handle_player_polling()
return
if(href_list["pollid"])
var/pollid = href_list["pollid"]
if(istext(pollid))
pollid = text2num(pollid)
if(isnum(pollid) && ISINTEGER(pollid))
src.poll_player(pollid)
return
if(href_list["votepollid"] && href_list["votetype"])
var/pollid = text2num(href_list["votepollid"])
var/votetype = href_list["votetype"]
//lets take data from the user to decide what kind of poll this is, without validating it
//what could go wrong
switch(votetype)
if(POLLTYPE_OPTION)
var/optionid = text2num(href_list["voteoptionid"])
if(vote_on_poll(pollid, optionid))
to_chat(usr, "<span class='notice'>Vote successful.</span>")
else
to_chat(usr, "<span class='danger'>Vote failed, please try again or contact an administrator.</span>")
if(POLLTYPE_TEXT)
var/replytext = href_list["replytext"]
if(log_text_poll_reply(pollid, replytext))
to_chat(usr, "<span class='notice'>Feedback logging successful.</span>")
else
to_chat(usr, "<span class='danger'>Feedback logging failed, please try again or contact an administrator.</span>")
if(POLLTYPE_RATING)
var/id_min = text2num(href_list["minid"])
var/id_max = text2num(href_list["maxid"])
if( (id_max - id_min) > 100 ) //Basic exploit prevention
//(protip, this stops no exploits)
to_chat(usr, "The option ID difference is too big. Please contact administration or the database admin.")
return
for(var/optionid = id_min; optionid <= id_max; optionid++)
if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to
var/rating
if(href_list["o[optionid]"] == "abstain")
rating = null
else
rating = text2num(href_list["o[optionid]"])
if(!isnum(rating) || !ISINTEGER(rating))
return
if(!vote_on_numval_poll(pollid, optionid, rating))
to_chat(usr, "<span class='danger'>Vote failed, please try again or contact an administrator.</span>")
return
to_chat(usr, "<span class='notice'>Vote successful.</span>")
if(POLLTYPE_MULTI)
var/id_min = text2num(href_list["minoptionid"])
var/id_max = text2num(href_list["maxoptionid"])
if( (id_max - id_min) > 100 ) //Basic exploit prevention
to_chat(usr, "The option ID difference is too big. Please contact administration or the database admin.")
return
for(var/optionid = id_min; optionid <= id_max; optionid++)
if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected
var/i = vote_on_multi_poll(pollid, optionid)
switch(i)
if(0)
continue
if(1)
to_chat(usr, "<span class='danger'>Vote failed, please try again or contact an administrator.</span>")
return
if(2)
to_chat(usr, "<span class='danger'>Maximum replies reached.</span>")
break
to_chat(usr, "<span class='notice'>Vote successful.</span>")
if(POLLTYPE_IRV)
if (!href_list["IRVdata"])
to_chat(src, "<span class='danger'>No ordering data found. Please try again or contact an administrator.</span>")
return
var/list/votelist = splittext(href_list["IRVdata"], ",")
if (!vote_on_irv_poll(pollid, votelist))
to_chat(src, "<span class='danger'>Vote failed, please try again or contact an administrator.</span>")
return
to_chat(src, "<span class='notice'>Vote successful.</span>")
//When you cop out of the round (NB: this HAS A SLEEP FOR PLAYER INPUT IN IT)
/mob/dead/new_player/proc/make_me_an_observer()
if(QDELETED(src) || !src.client)
ready = PLAYER_NOT_READY
return FALSE
var/this_is_like_playing_right = alert(src,"Are you sure you wish to observe? You will not be able to play this round!","Player Setup","Yes","No")
if(QDELETED(src) || !src.client || this_is_like_playing_right != "Yes")
ready = PLAYER_NOT_READY
src << browse(null, "window=playersetup") //closes the player setup window
new_player_panel()
return FALSE
var/mob/dead/observer/observer = new()
spawning = TRUE
observer.started_as_observer = TRUE
close_spawn_windows()
var/obj/effect/landmark/observer_start/O = locate(/obj/effect/landmark/observer_start) in GLOB.landmarks_list
to_chat(src, "<span class='notice'>Now teleporting.</span>")
if (O)
observer.forceMove(O.loc)
else
to_chat(src, "<span class='notice'>Teleporting failed. Ahelp an admin please</span>")
stack_trace("There's no freaking observer landmark available on this map or you're making observers before the map is initialised")
transfer_ckey(observer, FALSE)
observer.client = client
observer.set_ghost_appearance()
if(observer.client && observer.client.prefs)
observer.real_name = observer.client.prefs.real_name
observer.name = observer.real_name
observer.update_icon()
observer.stop_sound_channel(CHANNEL_LOBBYMUSIC)
QDEL_NULL(mind)
qdel(src)
return TRUE
/proc/get_job_unavailable_error_message(retval, jobtitle)
switch(retval)
if(JOB_AVAILABLE)
return "[jobtitle] is available."
if(JOB_UNAVAILABLE_GENERIC)
return "[jobtitle] is unavailable."
if(JOB_UNAVAILABLE_BANNED)
return "You are currently banned from [jobtitle]."
if(JOB_UNAVAILABLE_PLAYTIME)
return "You do not have enough relevant playtime for [jobtitle]."
if(JOB_UNAVAILABLE_ACCOUNTAGE)
return "Your account is not old enough for [jobtitle]."
if(JOB_UNAVAILABLE_SLOTFULL)
return "[jobtitle] is already filled to capacity."
if(JOB_UNAVAILABLE_SPECIESLOCK)
return "Your species cannot play as a [jobtitle]."
return "Error: Unknown job availability."
/mob/dead/new_player/proc/IsJobUnavailable(rank, latejoin = FALSE)
var/datum/job/job = SSjob.GetJob(rank)
if(!job)
return JOB_UNAVAILABLE_GENERIC
if((job.current_positions >= job.total_positions) && job.total_positions != -1)
if(job.title == "Assistant")
if(isnum(client.player_age) && client.player_age <= 14) //Newbies can always be assistants
return JOB_AVAILABLE
for(var/datum/job/J in SSjob.occupations)
if(J && J.current_positions < J.total_positions && J.title != job.title)
return JOB_UNAVAILABLE_SLOTFULL
else
return JOB_UNAVAILABLE_SLOTFULL
if(jobban_isbanned(src,rank))
return JOB_UNAVAILABLE_BANNED
if(QDELETED(src))
return JOB_UNAVAILABLE_GENERIC
if(!job.player_old_enough(client))
return JOB_UNAVAILABLE_ACCOUNTAGE
if(job.required_playtime_remaining(client))
return JOB_UNAVAILABLE_PLAYTIME
if(latejoin && !job.special_check_latejoin(client))
return JOB_UNAVAILABLE_GENERIC
if(!client.prefs.pref_species.qualifies_for_rank(rank, client.prefs.features))
return JOB_UNAVAILABLE_SPECIESLOCK
return JOB_AVAILABLE
/mob/dead/new_player/proc/AttemptLateSpawn(rank)
var/error = IsJobUnavailable(rank)
if(error != JOB_AVAILABLE)
alert(src, get_job_unavailable_error_message(error, rank))
return FALSE
if(SSticker.late_join_disabled)
alert(src, "An administrator has disabled late join spawning.")
return FALSE
var/arrivals_docked = TRUE
if(SSshuttle.arrivals)
close_spawn_windows() //In case we get held up
if(SSshuttle.arrivals.damaged && CONFIG_GET(flag/arrivals_shuttle_require_safe_latejoin))
src << alert("The arrivals shuttle is currently malfunctioning! You cannot join.")
return FALSE
if(CONFIG_GET(flag/arrivals_shuttle_require_undocked))
SSshuttle.arrivals.RequireUndocked(src)
arrivals_docked = SSshuttle.arrivals.mode != SHUTTLE_CALL
//Remove the player from the join queue if he was in one and reset the timer
SSticker.queued_players -= src
SSticker.queue_delay = 4
SSjob.AssignRole(src, rank, 1)
var/mob/living/character = create_character(TRUE) //creates the human and transfers vars and mind
var/equip = SSjob.EquipRank(character, rank, TRUE)
if(isliving(equip)) //Borgs get borged in the equip, so we need to make sure we handle the new mob.
character = equip
var/datum/job/job = SSjob.GetJob(rank)
if(job && !job.override_latejoin_spawn(character))
SSjob.SendToLateJoin(character)
if(!arrivals_docked)
var/obj/screen/splash/Spl = new(character.client, TRUE)
Spl.Fade(TRUE)
character.playsound_local(get_turf(character), 'sound/voice/ApproachingTG.ogg', 25)
character.update_parallax_teleport()
SSticker.minds += character.mind
var/mob/living/carbon/human/humanc
if(ishuman(character))
humanc = character //Let's retypecast the var to be human,
if(humanc) //These procs all expect humans
GLOB.data_core.manifest_inject(humanc)
if(SSshuttle.arrivals)
SSshuttle.arrivals.QueueAnnounce(humanc, rank)
else
AnnounceArrival(humanc, rank)
AddEmploymentContract(humanc)
if(GLOB.highlander)
to_chat(humanc, "<span class='userdanger'><i>THERE CAN BE ONLY ONE!!!</i></span>")
humanc.make_scottish()
if(GLOB.summon_guns_triggered)
give_guns(humanc)
if(GLOB.summon_magic_triggered)
give_magic(humanc)
GLOB.joined_player_list += character.ckey
GLOB.latejoiners += character
if(CONFIG_GET(flag/allow_latejoin_antagonists) && humanc) //Borgs aren't allowed to be antags. Will need to be tweaked if we get true latejoin ais.
if(SSshuttle.emergency)
switch(SSshuttle.emergency.mode)
if(SHUTTLE_RECALL, SHUTTLE_IDLE)
SSticker.mode.make_antag_chance(humanc)
if(SHUTTLE_CALL)
if(SSshuttle.emergency.timeLeft(1) > initial(SSshuttle.emergencyCallTime)*0.5)
SSticker.mode.make_antag_chance(humanc)
if(humanc && CONFIG_GET(flag/roundstart_traits))
SSquirks.AssignQuirks(humanc, humanc.client, TRUE, FALSE, job, FALSE)
log_manifest(character.mind.key,character.mind,character,latejoin = TRUE)
/mob/dead/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee)
//TODO: figure out a way to exclude wizards/nukeops/demons from this.
for(var/C in GLOB.employmentCabinets)
var/obj/structure/filingcabinet/employment/employmentCabinet = C
if(!employmentCabinet.virgin)
employmentCabinet.addFile(employee)
/mob/dead/new_player/proc/LateChoices()
var/level = "green"
switch(GLOB.security_level)
if(SEC_LEVEL_GREEN)
level = "green"
if(SEC_LEVEL_BLUE)
level = "blue"
if(SEC_LEVEL_AMBER)
level = "amber"
if(SEC_LEVEL_RED)
level = "red"
if(SEC_LEVEL_DELTA)
level = "delta"
var/dat = "<div class='notice'>Round Duration: [DisplayTimeText(world.time - SSticker.round_start_time)]<br>Alert Level: [capitalize(level)]</div>"
if(SSshuttle.emergency)
switch(SSshuttle.emergency.mode)
if(SHUTTLE_ESCAPE)
dat += "<div class='notice red'>The station has been evacuated.</div><br>"
if(SHUTTLE_CALL)
if(!SSshuttle.canRecall())
dat += "<div class='notice red'>The station is currently undergoing evacuation procedures.</div><br>"
for(var/datum/job/prioritized_job in SSjob.prioritized_jobs)
if(prioritized_job.current_positions >= prioritized_job.total_positions)
SSjob.prioritized_jobs -= prioritized_job
dat += "<center><table><tr><td valign='top'>"
var/column_counter = 0
var/free_space = 0
for(var/list/category in list(GLOB.command_positions) + list(GLOB.supply_positions) + list(GLOB.engineering_positions) + list(GLOB.nonhuman_positions - "pAI") + list(GLOB.civilian_positions) + list(GLOB.medical_positions) + list(GLOB.science_positions) + list(GLOB.security_positions))
var/cat_color = "fff" //random default
if(SSjob.name_occupations && SSjob.name_occupations[category[1]])
cat_color = SSjob.name_occupations[category[1]].selection_color //use the color of the first job in the category (the department head) as the category color
else
cat_color = SSjob.occupations[category[1]].selection_color
dat += "<fieldset style='width: 185px; border: 2px solid [cat_color]; display: inline'>"
dat += "<legend align='center' style='color: [cat_color]'>[SSjob.name_occupations[category[1]].exp_type_department]</legend>"
var/list/dept_dat = list()
for(var/job in category)
var/datum/job/job_datum = SSjob.name_occupations[job]
if(job_datum && IsJobUnavailable(job_datum.title, TRUE) == JOB_AVAILABLE)
var/command_bold = ""
if(job in GLOB.command_positions)
command_bold = " command"
if(job_datum in SSjob.prioritized_jobs)
dept_dat += "<a class='job[command_bold]' style='display:block;width:170px' href='byond://?src=[REF(src)];SelectedJob=[job_datum.title]'><span class='priority'>[job_datum.title] ([job_datum.current_positions])</span></a>"
else
dept_dat += "<a class='job[command_bold]' style='display:block;width:170px' href='byond://?src=[REF(src)];SelectedJob=[job_datum.title]'>[job_datum.title] ([job_datum.current_positions])</a>"
if(!dept_dat.len)
dept_dat += "<span class='nopositions'>No positions open.</span>"
dat += jointext(dept_dat, "")
dat += "</fieldset><br>"
column_counter++
if(free_space <=4)
free_space++
if(column_counter > 0 && (column_counter % 3 == 0))
dat += "</td><td valign='top'>"
if(free_space >= 5 && (free_space % 5 == 0) && (column_counter % 3 != 0))
free_space = 0
column_counter = 0
dat += "</td><td valign='top'>"
dat += "</td></tr></table></center></center>"
var/available_ghosts = 0
for(var/spawner in GLOB.mob_spawners)
if(!LAZYLEN(spawner))
continue
var/obj/effect/mob_spawn/S = pick(GLOB.mob_spawners[spawner])
if(!istype(S) || !S.can_latejoin())
continue
available_ghosts++
break
if(!available_ghosts)
dat += "<div class='notice red'>There are currently no open ghost spawners.</div>"
else
var/list/categorizedJobs = list("Ghost Role" = list(jobs = list(), titles = GLOB.mob_spawners, color = "#ffffff"))
for(var/spawner in GLOB.mob_spawners)
if(!LAZYLEN(spawner))
continue
var/obj/effect/mob_spawn/S = pick(GLOB.mob_spawners[spawner])
if(!istype(S) || !S.can_latejoin())
continue
categorizedJobs["Ghost Role"]["jobs"] += spawner
dat += "<center><table><tr><td valign='top'>"
for(var/jobcat in categorizedJobs)
if(!length(categorizedJobs[jobcat]["jobs"]))
continue
var/color = categorizedJobs[jobcat]["color"]
dat += "<fieldset style='border: 2px solid [color]; display: inline'>"
dat += "<legend align='center' style='color: [color]'>[jobcat]</legend>"
for(var/spawner in categorizedJobs[jobcat]["jobs"])
dat += "<a class='otherPosition' style='display:block;width:170px' href='byond://?src=[REF(src)];JoinAsGhostRole=[spawner]'>[spawner]</a>"
dat += "</fieldset><br>"
dat += "</td></tr></table></center>"
dat += "</div></div>"
var/datum/browser/popup = new(src, "latechoices", "Choose Profession", 720, 600)
popup.add_stylesheet("playeroptions", 'html/browser/playeroptions.css')
popup.set_content(jointext(dat, ""))
popup.open(FALSE) // FALSE is passed to open so that it doesn't use the onclose() proc
/mob/dead/new_player/proc/create_character(transfer_after)
spawning = 1
close_spawn_windows()
var/mob/living/carbon/human/H = new(loc)
var/frn = CONFIG_GET(flag/force_random_names)
if(!frn)
frn = jobban_isbanned(src, "appearance")
if(QDELETED(src))
return
if(frn)
client.prefs.random_character()
client.prefs.real_name = client.prefs.pref_species.random_name(gender,1)
client.prefs.copy_to(H)
H.dna.update_dna_identity()
if(mind)
if(transfer_after)
mind.late_joiner = TRUE
mind.active = 0 //we wish to transfer the key manually
mind.transfer_to(H) //won't transfer key since the mind is not active
H.name = real_name
. = H
new_character = .
if(transfer_after)
transfer_character()
/mob/dead/new_player/proc/transfer_character()
. = new_character
if(.)
new_character.key = key //Manually transfer the key to log them in
new_character.stop_sound_channel(CHANNEL_LOBBYMUSIC)
new_character = null
qdel(src)
/mob/dead/new_player/proc/ViewManifest()
var/dat = "<html><body>"
dat += "<h4>Crew Manifest</h4>"
dat += GLOB.data_core.get_manifest(OOC = 1)
src << browse(dat, "window=manifest;size=387x420;can_close=1")
/mob/dead/new_player/Move()
return 0
/mob/dead/new_player/proc/close_spawn_windows()
src << browse(null, "window=latechoices") //closes late choices window
src << browse(null, "window=playersetup") //closes the player setup window
src << browse(null, "window=preferences") //closes job selection
src << browse(null, "window=mob_occupation")
src << browse(null, "window=latechoices") //closes late job selection
/* Used to make sure that a player has a valid job preference setup, used to knock players out of eligibility for anything if their prefs don't make sense.
A "valid job preference setup" in this situation means at least having one job set to low, or not having "return to lobby" enabled
Prevents "antag rolling" by setting antag prefs on, all jobs to never, and "return to lobby if preferences not availible"
Doing so would previously allow you to roll for antag, then send you back to lobby if you didn't get an antag role
This also does some admin notification and logging as well, as well as some extra logic to make sure things don't go wrong
*/
/mob/dead/new_player/proc/check_preferences()
if(!client)
return FALSE //Not sure how this would get run without the mob having a client, but let's just be safe.
if(client.prefs.joblessrole != RETURNTOLOBBY)
return TRUE
// If they have antags enabled, they're potentially doing this on purpose instead of by accident. Notify admins if so.
var/has_antags = FALSE
if(client.prefs.be_special.len > 0)
has_antags = TRUE
if(client.prefs.job_preferences.len == 0)
if(!ineligible_for_roles)
to_chat(src, "<span class='danger'>You have no jobs enabled, along with return to lobby if job is unavailable. This makes you ineligible for any round start role, please update your job preferences.</span>")
ineligible_for_roles = TRUE
ready = PLAYER_NOT_READY
if(has_antags)
log_admin("[src.ckey] just got booted back to lobby with no jobs, but antags enabled.")
message_admins("[src.ckey] just got booted back to lobby with no jobs enabled, but antag rolling enabled. Likely antag rolling abuse.")
return FALSE //This is the only case someone should actually be completely blocked from antag rolling as well
return TRUE
+619
View File
@@ -0,0 +1,619 @@
/datum/polloption
var/optionid
var/optiontext
/mob/dead/new_player/proc/handle_player_polling()
if(!SSdbcore.IsConnected())
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
var/datum/DBQuery/query_poll_get = SSdbcore.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() BETWEEN starttime AND endtime [(client.holder ? "" : "AND adminonly = false")]")
if(!query_poll_get.warn_execute())
qdel(query_poll_get)
return
var/output = "<div align='center'><B>Player polls</B><hr><table>"
var/i = 0
var/rs = REF(src)
while(query_poll_get.NextRow())
var/pollid = query_poll_get.item[1]
var/pollquestion = query_poll_get.item[2]
output += "<tr bgcolor='#[ (i % 2 == 1) ? "e2e2e2" : "e2e2e2" ]'><td><a href=\"byond://?src=[rs];pollid=[pollid]\"><b>[pollquestion]</b></a></td></tr>"
i++
qdel(query_poll_get)
output += "</table>"
if(!QDELETED(src))
src << browse(output,"window=playerpolllist;size=500x300")
/mob/dead/new_player/proc/poll_player(pollid)
if(!pollid)
return
if (!SSdbcore.Connect())
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
var/datum/DBQuery/query_poll_get_details = SSdbcore.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
if(!query_poll_get_details.warn_execute())
qdel(query_poll_get_details)
return
var/pollstarttime = ""
var/pollendtime = ""
var/pollquestion = ""
var/polltype = ""
var/multiplechoiceoptions = 0
if(query_poll_get_details.NextRow())
pollstarttime = query_poll_get_details.item[1]
pollendtime = query_poll_get_details.item[2]
pollquestion = query_poll_get_details.item[3]
polltype = query_poll_get_details.item[4]
multiplechoiceoptions = text2num(query_poll_get_details.item[5])
qdel(query_poll_get_details)
switch(polltype)
if(POLLTYPE_OPTION)
var/datum/DBQuery/query_option_get_votes = SSdbcore.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_option_get_votes.warn_execute())
qdel(query_option_get_votes)
return
var/votedoptionid = 0
if(query_option_get_votes.NextRow())
votedoptionid = text2num(query_option_get_votes.item[1])
qdel(query_option_get_votes)
var/list/datum/polloption/options = list()
var/datum/DBQuery/query_option_options = SSdbcore.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
if(!query_option_options.warn_execute())
qdel(query_option_options)
return
while(query_option_options.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(query_option_options.item[1])
PO.optiontext = query_option_options.item[2]
options += PO
qdel(query_option_options)
var/output = "<div align='center'><B>Player poll</B><hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(!votedoptionid)
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
output += "<input type='hidden' name='src' value='[REF(src)]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value=[POLLTYPE_OPTION]>"
output += "<table><tr><td>"
for(var/datum/polloption/O in options)
if(O.optionid && O.optiontext)
if(votedoptionid)
if(votedoptionid == O.optionid)
output += "<b>[O.optiontext]</b><br>"
else
output += "[O.optiontext]<br>"
else
output += "<input type='radio' name='voteoptionid' value='[O.optionid]'>[O.optiontext]<br>"
output += "</td></tr></table>"
if(!votedoptionid)
output += "<p><input type='submit' value='Vote'>"
output += "</form>"
output += "</div>"
src << browse(null ,"window=playerpolllist")
src << browse(output,"window=playerpoll;size=500x250")
if(POLLTYPE_TEXT)
var/datum/DBQuery/query_text_get_votes = SSdbcore.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_text_get_votes.warn_execute())
qdel(query_text_get_votes)
return
var/vote_text = ""
if(query_text_get_votes.NextRow())
vote_text = query_text_get_votes.item[1]
qdel(query_text_get_votes)
var/output = "<div align='center'><B>Player poll</B><hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Feedback gathering runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
output += "<input type='hidden' name='src' value='[REF(src)]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value=[POLLTYPE_TEXT]>"
output += "<font size='2'>Please provide feedback below. You can use any letters of the English alphabet, numbers and the symbols: . , ! ? : ; -</font><br>"
output += "<textarea name='replytext' cols='50' rows='14'>[vote_text]</textarea>"
output += "<p><input type='submit' value='Submit'></form>"
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
output += "<input type='hidden' name='src' value='[REF(src)]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value=[POLLTYPE_TEXT]>"
output += "<input type='hidden' name='replytext' value='ABSTAIN'>"
output += "<input type='submit' value='Abstain'></form>"
src << browse(null ,"window=playerpolllist")
src << browse(output,"window=playerpoll;size=500x500")
if(POLLTYPE_RATING)
var/datum/DBQuery/query_rating_get_votes = SSdbcore.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, [format_table_name("poll_vote")] v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid")
if(!query_rating_get_votes.warn_execute())
qdel(query_rating_get_votes)
return
var/output = "<div align='center'><B>Player poll</B><hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
var/rating
while(query_rating_get_votes.NextRow())
var/optiontext = query_rating_get_votes.item[1]
rating = query_rating_get_votes.item[2]
output += "<br><b>[optiontext] - [rating]</b>"
qdel(query_rating_get_votes)
if(!rating)
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
output += "<input type='hidden' name='src' value='[REF(src)]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value=[POLLTYPE_RATING]>"
var/minid = 999999
var/maxid = 0
var/datum/DBQuery/query_rating_options = SSdbcore.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
if(!query_rating_options.warn_execute())
qdel(query_rating_options)
return
while(query_rating_options.NextRow())
var/optionid = text2num(query_rating_options.item[1])
var/optiontext = query_rating_options.item[2]
var/minvalue = text2num(query_rating_options.item[3])
var/maxvalue = text2num(query_rating_options.item[4])
var/descmin = query_rating_options.item[5]
var/descmid = query_rating_options.item[6]
var/descmax = query_rating_options.item[7]
if(optionid < minid)
minid = optionid
if(optionid > maxid)
maxid = optionid
var/midvalue = round( (maxvalue + minvalue) / 2)
output += "<br>[optiontext]: <select name='o[optionid]'>"
output += "<option value='abstain'>abstain</option>"
for (var/j = minvalue; j <= maxvalue; j++)
if(j == minvalue && descmin)
output += "<option value='[j]'>[j] ([descmin])</option>"
else if (j == midvalue && descmid)
output += "<option value='[j]'>[j] ([descmid])</option>"
else if (j == maxvalue && descmax)
output += "<option value='[j]'>[j] ([descmax])</option>"
else
output += "<option value='[j]'>[j]</option>"
output += "</select>"
qdel(query_rating_options)
output += "<input type='hidden' name='minid' value='[minid]'>"
output += "<input type='hidden' name='maxid' value='[maxid]'>"
output += "<p><input type='submit' value='Submit'></form>"
if(!QDELETED(src))
src << browse(null ,"window=playerpolllist")
src << browse(output,"window=playerpoll;size=500x500")
if(POLLTYPE_MULTI)
var/datum/DBQuery/query_multi_get_votes = SSdbcore.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_multi_get_votes.warn_execute())
qdel(query_multi_get_votes)
return
var/list/votedfor = list()
while(query_multi_get_votes.NextRow())
votedfor.Add(text2num(query_multi_get_votes.item[1]))
qdel(query_multi_get_votes)
var/list/datum/polloption/options = list()
var/maxoptionid = 0
var/minoptionid = 0
var/datum/DBQuery/query_multi_options = SSdbcore.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
if(!query_multi_options.warn_execute())
qdel(query_multi_options)
return
while(query_multi_options.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(query_multi_options.item[1])
PO.optiontext = query_multi_options.item[2]
if(PO.optionid > maxoptionid)
maxoptionid = PO.optionid
if(PO.optionid < minoptionid || !minoptionid)
minoptionid = PO.optionid
options += PO
qdel(query_multi_options)
var/output = "<div align='center'><B>Player poll</B><hr>"
output += "<b>Question: [pollquestion]</b><br>You can select up to [multiplechoiceoptions] options. If you select more, the first [multiplechoiceoptions] will be saved.<br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(!votedfor.len)
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
output += "<input type='hidden' name='src' value='[REF(src)]'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
output += "<input type='hidden' name='votetype' value=[POLLTYPE_MULTI]>"
output += "<input type='hidden' name='maxoptionid' value='[maxoptionid]'>"
output += "<input type='hidden' name='minoptionid' value='[minoptionid]'>"
output += "<table><tr><td>"
for(var/datum/polloption/O in options)
if(O.optionid && O.optiontext)
if(votedfor.len)
if(O.optionid in votedfor)
output += "<b>[O.optiontext]</b><br>"
else
output += "[O.optiontext]<br>"
else
output += "<input type='checkbox' name='option_[O.optionid]' value='[O.optionid]'>[O.optiontext]<br>"
output += "</td></tr></table>"
if(!votedfor.len)
output += "<p><input type='submit' value='Vote'></form>"
output += "</div>"
src << browse(null ,"window=playerpolllist")
src << browse(output,"window=playerpoll;size=500x250")
if(POLLTYPE_IRV)
var/datum/asset/irv_assets = get_asset_datum(/datum/asset/group/IRV)
irv_assets.send(src)
var/datum/DBQuery/query_irv_get_votes = SSdbcore.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_irv_get_votes.warn_execute())
qdel(query_irv_get_votes)
return
var/list/votedfor = list()
while(query_irv_get_votes.NextRow())
votedfor.Add(text2num(query_irv_get_votes.item[1]))
qdel(query_irv_get_votes)
var/list/datum/polloption/options = list()
var/datum/DBQuery/query_irv_options = SSdbcore.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
if(!query_irv_options.warn_execute())
qdel(query_irv_options)
return
while(query_irv_options.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(query_irv_options.item[1])
PO.optiontext = query_irv_options.item[2]
options["[PO.optionid]"] += PO
qdel(query_irv_options)
//if they already voted, use their sort
if (votedfor.len)
var/list/datum/polloption/newoptions = list()
for (var/V in votedfor)
var/datum/polloption/PO = options["[V]"]
if(PO)
newoptions["[V]"] = PO
options -= "[V]"
//add any options that they didn't vote on (some how, some way)
options = shuffle(options)
for (var/V in options)
newoptions["[V]"] = options["[V]"]
options = newoptions
//otherwise, lets shuffle it.
else
var/list/datum/polloption/newoptions = list()
while (options.len)
var/list/local_options = options.Copy()
var/key
//the jist is we randomly remove all options from a copy of options until only one reminds,
// move that over to our new list
// and repeat until we've moved all of them
while (local_options.len)
key = local_options[rand(1, local_options.len)]
local_options -= key
var/value = options[key]
options -= key
newoptions[key] = value
options = newoptions
var/output = {"
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="jquery.min.js"></script>
<script src="jquery-ui.custom-core-widgit-mouse-sortable-min.js"></script>
<style>
#sortable { list-style-type: none; margin: 0; padding: 2em; }
#sortable li { min-height: 1em; margin: 0px 1px 1px 1px; padding: 1px; border: 1px solid black; border-radius: 5px; background-color: white; cursor:move;}
#sortable .sortable-placeholder-highlight { min-height: 1em; margin: 0 2px 2px 2px; padding: 2px; border: 1px dotted blue; border-radius: 5px; background-color: GhostWhite; }
span.grippy { content: '....'; width: 10px; height: 20px; display: inline-block; overflow: hidden; line-height: 5px; padding: 3px 1px; cursor: move; vertical-align: middle; margin-top: -.7em; margin-right: .3em; font-size: 12px; font-family: sans-serif; letter-spacing: 2px; color: #cccccc; text-shadow: 1px 0 1px black; }
span.grippy::after { content: '.. .. .. ..';}
</style>
<script>
$(function() {
$( "#sortable" ).sortable({
placeholder: "sortable-placeholder-highlight",
axis: "y",
containment: "#ballot",
scroll: false,
cursor: "ns-resize",
tolerance: "pointer"
});
$( "#sortable" ).disableSelection();
$('form').submit(function(){
$('#IRVdata').val($( "#sortable" ).sortable("toArray", { attribute: "voteid" }));
});
});
</script>
</head>
<body>
<div align='center'><B>Player poll</B><hr>
<b>Question: [pollquestion]</b><br>Please sort the options in the order of <b>most preferred</b> to <b>least preferred</b><br>
<font size='2'>Revoting has been enabled on this poll, if you think you made a mistake, simply revote<br></font>
<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>
</div>
<form name='cardcomp' action='?src=[REF(src)]' method='POST'>
<input type='hidden' name='src' value='[REF(src)]'>
<input type='hidden' name='votepollid' value='[pollid]'>
<input type='hidden' name='votetype' value=[POLLTYPE_IRV]>
<input type='hidden' name='IRVdata' id='IRVdata'>
<div id="ballot" class="center">
<b><center>Most Preferred</center></b>
<ol id="sortable" class="rankings" style="padding:0px">
"}
for(var/O in options)
var/datum/polloption/PO = options["[O]"]
if(PO.optionid && PO.optiontext)
output += "<li voteid='[PO.optionid]' class='ranking'><span class='grippy'></span> [PO.optiontext]</li>\n"
output += {"
</ol>
<b><center>Least Preferred</center></b><br>
</div>
<p><input type='submit' value='[( votedfor.len ? "Re" : "")]Vote'></form>
"}
src << browse(null ,"window=playerpolllist")
src << browse(output,"window=playerpoll;size=500x500")
return
//Returns null on failure, TRUE if already voted, FALSE if not voted yet.
/mob/dead/new_player/proc/poll_check_voted(pollid, text = FALSE, silent = FALSE)
var/table = "poll_vote"
if (text)
table = "poll_textreply"
if (!SSdbcore.Connect())
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
var/datum/DBQuery/query_hasvoted = SSdbcore.NewQuery("SELECT id FROM `[format_table_name(table)]` WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_hasvoted.warn_execute())
qdel(query_hasvoted)
return
if(query_hasvoted.NextRow())
qdel(query_hasvoted)
if(!silent)
to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
return TRUE
qdel(query_hasvoted)
return FALSE
//Returns adminrank for use in polls.
/mob/dead/new_player/proc/poll_rank()
. = "Player"
if(client.holder)
. = client.holder.rank.name
/mob/dead/new_player/proc/vote_rig_check()
if (usr != src)
if (!usr || !src)
return 0
//we gots ourselfs a dirty cheater on our hands!
log_game("[key_name(usr)] attempted to rig the vote by voting as [key]")
message_admins("[key_name_admin(usr)] attempted to rig the vote by voting as [key]")
to_chat(usr, "<span class='danger'>You don't seem to be [key].</span>")
to_chat(src, "<span class='danger'>Something went horribly wrong processing your vote. Please contact an administrator, they should have gotten a message about this</span>")
return 0
return 1
/mob/dead/new_player/proc/vote_valid_check(pollid, holder, type)
if (!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return 0
pollid = text2num(pollid)
if (!pollid || pollid < 0)
return 0
//validate the poll is actually the right type of poll and its still active
var/datum/DBQuery/query_validate_poll = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime AND polltype = '[type]' [(holder ? "" : "AND adminonly = false")]")
if(!query_validate_poll.warn_execute())
qdel(query_validate_poll)
return 0
if (!query_validate_poll.NextRow())
qdel(query_validate_poll)
return 0
qdel(query_validate_poll)
return 1
/mob/dead/new_player/proc/vote_on_irv_poll(pollid, list/votelist)
if (!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return 0
if (!vote_rig_check())
return 0
pollid = text2num(pollid)
if (!pollid || pollid < 0)
return 0
if (!votelist || !istype(votelist) || !votelist.len)
return 0
if (!client)
return 0
//save these now so we can still process the vote if the client goes away while we process.
var/datum/admins/holder = client.holder
var/rank = "Player"
if (holder)
rank = holder.rank.name
var/ckey = client.ckey
var/address = client.address
//validate the poll
if (!vote_valid_check(pollid, holder, POLLTYPE_IRV))
return 0
//lets collect the options
var/datum/DBQuery/query_irv_id = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
if(!query_irv_id.warn_execute())
qdel(query_irv_id)
return 0
var/list/optionlist = list()
while (query_irv_id.NextRow())
optionlist += text2num(query_irv_id.item[1])
qdel(query_irv_id)
//validate their votes are actually in the list of options and actually numbers
var/list/numberedvotelist = list()
for (var/vote in votelist)
vote = text2num(vote)
numberedvotelist += vote
if (!vote) //this is fine because voteid starts at 1, so it will never be 0
to_chat(src, "<span class='danger'>Error: Invalid (non-numeric) votes in the vote data.</span>")
return 0
if (!(vote in optionlist))
to_chat(src, "<span class='danger'>Votes for choices that do not appear to be in the poll detected.</span>")
return 0
if (!numberedvotelist.len)
to_chat(src, "<span class='danger'>Invalid vote data</span>")
return 0
//lets add the vote, first we generate an insert statement.
var/sqlrowlist = ""
for (var/vote in numberedvotelist)
if (sqlrowlist != "")
sqlrowlist += ", " //a comma (,) at the start of the first row to insert will trigger a SQL error
sqlrowlist += "(Now(), [pollid], [vote], '[sanitizeSQL(ckey)]', INET_ATON('[sanitizeSQL(address)]'), '[sanitizeSQL(rank)]')"
//now lets delete their old votes (if any)
var/datum/DBQuery/query_irv_del_old = SSdbcore.NewQuery("DELETE FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_irv_del_old.warn_execute())
qdel(query_irv_del_old)
return 0
qdel(query_irv_del_old)
//now to add the new ones.
var/datum/DBQuery/query_irv_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES [sqlrowlist]")
if(!query_irv_vote.warn_execute())
qdel(query_irv_vote)
return 0
qdel(query_irv_vote)
if(!QDELETED(src))
src << browse(null,"window=playerpoll")
return 1
/mob/dead/new_player/proc/vote_on_poll(pollid, optionid)
if (!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return 0
if (!vote_rig_check())
return 0
if(!pollid || !optionid)
return
//validate the poll
if (!vote_valid_check(pollid, client.holder, POLLTYPE_OPTION))
return 0
var/voted = poll_check_voted(pollid)
if(isnull(voted) || voted) //Failed or already voted.
return
var/adminrank = sanitizeSQL(poll_rank())
if(!adminrank)
return
var/datum/DBQuery/query_option_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')")
if(!query_option_vote.warn_execute())
qdel(query_option_vote)
return
qdel(query_option_vote)
if(!QDELETED(usr))
usr << browse(null,"window=playerpoll")
return 1
/mob/dead/new_player/proc/log_text_poll_reply(pollid, replytext)
if (!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return 0
if (!vote_rig_check())
return 0
if(!pollid)
return
//validate the poll
if (!vote_valid_check(pollid, client.holder, POLLTYPE_TEXT))
return 0
if(!replytext)
to_chat(usr, "The text you entered was blank. Please correct the text and submit again.")
return
var/voted = poll_check_voted(pollid, text = TRUE, silent = TRUE)
if(isnull(voted))
return
var/adminrank = sanitizeSQL(poll_rank())
if(!adminrank)
return
replytext = sanitizeSQL(replytext)
if(!(length(replytext) > 0) || !(length(replytext) <= 8000))
to_chat(usr, "The text you entered was invalid or too long. Please correct the text and submit again.")
return
var/datum/DBQuery/query_text_vote
if(!voted)
query_text_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')")
else
query_text_vote = SSdbcore.NewQuery("UPDATE [format_table_name("poll_textreply")] SET datetime = Now(), ip = INET_ATON('[client.address]'), replytext = '[replytext]' WHERE pollid = '[pollid]' AND ckey = '[ckey]'")
if(!query_text_vote.warn_execute())
qdel(query_text_vote)
return
qdel(query_text_vote)
if(!QDELETED(usr))
usr << browse(null,"window=playerpoll")
return 1
/mob/dead/new_player/proc/vote_on_numval_poll(pollid, optionid, rating)
if (!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return 0
if (!vote_rig_check())
return 0
if(!pollid || !optionid || !rating)
return
//validate the poll
if (!vote_valid_check(pollid, client.holder, POLLTYPE_RATING))
return 0
var/datum/DBQuery/query_numval_hasvoted = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'")
if(!query_numval_hasvoted.warn_execute())
qdel(query_numval_hasvoted)
return
if(query_numval_hasvoted.NextRow())
qdel(query_numval_hasvoted)
to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
return
qdel(query_numval_hasvoted)
var/adminrank = "Player"
if(client.holder)
adminrank = client.holder.rank.name
adminrank = sanitizeSQL(adminrank)
var/datum/DBQuery/query_numval_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]', [(isnull(rating)) ? "null" : rating])")
if(!query_numval_vote.warn_execute())
qdel(query_numval_vote)
return
qdel(query_numval_vote)
if(!QDELETED(usr))
usr << browse(null,"window=playerpoll")
return 1
/mob/dead/new_player/proc/vote_on_multi_poll(pollid, optionid)
if (!SSdbcore.Connect())
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
return 0
if (!vote_rig_check())
return 0
if(!pollid || !optionid)
return 1
//validate the poll
if (!vote_valid_check(pollid, client.holder, POLLTYPE_MULTI))
return 0
var/datum/DBQuery/query_multi_choicelen = SSdbcore.NewQuery("SELECT multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
if(!query_multi_choicelen.warn_execute())
qdel(query_multi_choicelen)
return 1
var/i
if(query_multi_choicelen.NextRow())
i = text2num(query_multi_choicelen.item[1])
qdel(query_multi_choicelen)
var/datum/DBQuery/query_multi_hasvoted = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
if(!query_multi_hasvoted.warn_execute())
qdel(query_multi_hasvoted)
return 1
while(i)
if(query_multi_hasvoted.NextRow())
i--
else
break
qdel(query_multi_hasvoted)
if(!i)
return 2
var/adminrank = "Player"
if(!QDELETED(client) && client.holder)
adminrank = client.holder.rank.name
adminrank = sanitizeSQL(adminrank)
var/datum/DBQuery/query_multi_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')")
if(!query_multi_vote.warn_execute())
qdel(query_multi_vote)
return 1
qdel(query_multi_vote)
if(!QDELETED(usr))
usr << browse(null,"window=playerpoll")
return 0
@@ -0,0 +1,60 @@
//The mob should have a gender you want before running this proc. Will run fine without H
/datum/preferences/proc/random_character(gender_override)
if(gender_override)
gender = gender_override
else
gender = pick(MALE,FEMALE)
underwear = random_underwear(gender)
undie_color = random_short_color()
undershirt = random_undershirt(gender)
shirt_color = random_short_color()
socks = random_socks()
socks_color = random_short_color()
skin_tone = random_skin_tone()
hair_style = random_hair_style(gender)
facial_hair_style = random_facial_hair_style(gender)
hair_color = random_short_color()
facial_hair_color = hair_color
eye_color = random_eye_color()
horn_color = "85615a"
wing_color = "fff"
if(!pref_species)
var/rando_race = pick(GLOB.roundstart_races)
pref_species = new rando_race()
features = random_features()
age = rand(AGE_MIN,AGE_MAX)
/datum/preferences/proc/update_preview_icon()
// Determine what job is marked as 'High' priority, and dress them up as such.
var/datum/job/previewJob
var/highest_pref = 0
for(var/job in job_preferences)
if(job_preferences["[job]"] > highest_pref)
previewJob = SSjob.GetJob(job)
highest_pref = job_preferences["[job]"]
if(previewJob)
// Silicons only need a very basic preview since there is no customization for them.
if(istype(previewJob,/datum/job/ai))
parent.show_character_previews(image('icons/mob/ai.dmi', icon_state = resolve_ai_icon(preferred_ai_core_display), dir = SOUTH))
return
if(istype(previewJob,/datum/job/cyborg))
parent.show_character_previews(image('icons/mob/robots.dmi', icon_state = "robot", dir = SOUTH))
return
// Set up the dummy for its photoshoot
var/mob/living/carbon/human/dummy/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
mannequin.cut_overlays()
// Apply the Dummy's preview background first so we properly layer everything else on top of it.
mannequin.add_overlay(mutable_appearance('modular_citadel/icons/ui/backgrounds.dmi', bgstate, layer = SPACE_LAYER))
copy_to(mannequin)
if(previewJob)
mannequin.job = previewJob.title
previewJob.equip(mannequin, TRUE, preference_source = parent)
COMPILE_OVERLAYS(mannequin)
parent.show_character_previews(new /mutable_appearance(mannequin))
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
@@ -0,0 +1,296 @@
/******************************************
************* Lizard Markings *************
*******************************************/
/datum/sprite_accessory/body_markings
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/body_markings/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/body_markings/dtiger
name = "Dark Tiger Body"
icon_state = "dtiger"
gender_specific = 1
/datum/sprite_accessory/body_markings/ltiger
name = "Light Tiger Body"
icon_state = "ltiger"
gender_specific = 1
/datum/sprite_accessory/body_markings/lbelly
name = "Light Belly"
icon_state = "lbelly"
gender_specific = 1
/******************************************
************ Furry Markings ***************
*******************************************/
// These are all color matrixed and applied per-limb by default. you MUST comply with this if you want to have your markings work --Pooj
// use the HumanScissors tool to break your sprite up into the zones easier.
// Although Byond supposedly doesn't have an icon limit anymore of 512 states after 512.1478, just be careful about too many additions.
/datum/sprite_accessory/mam_body_markings
extra = FALSE
extra2 = FALSE
color_src = MATRIXED
gender_specific = 0
icon = 'modular_citadel/icons/mob/mam_markings.dmi'
/datum/sprite_accessory/mam_body_markings/none
name = "None"
icon_state = "none"
ckeys_allowed = list("yousshouldnteverbeseeingthisyoumeme")
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/plain
name = "Plain"
icon_state = "plain"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/redpanda
name = "Redpanda"
icon_state = "redpanda"
/datum/sprite_accessory/mam_body_markings/bat
name = "Bat"
icon_state = "bat"
/datum/sprite_accessory/mam_body_markings/bee
name = "Bee"
icon_state = "bee"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/belly
name = "Belly"
icon_state = "belly"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/bellyslim
name = "Bellyslim"
icon_state = "bellyslim"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/corgi
name = "Corgi"
icon_state = "corgi"
/datum/sprite_accessory/mam_body_markings/cow
name = "Bovine"
icon_state = "bovine"
/datum/sprite_accessory/mam_body_markings/corvid
name = "Corvid"
icon_state = "corvid"
/datum/sprite_accessory/mam_body_markings/dalmation
name = "Dalmation"
icon_state = "dalmation"
/datum/sprite_accessory/mam_body_markings/deer
name = "Deer"
icon_state = "deer"
/datum/sprite_accessory/mam_body_markings/dog
name = "Dog"
icon_state = "dog"
/datum/sprite_accessory/mam_body_markings/eevee
name = "Eevee"
icon_state = "eevee"
/datum/sprite_accessory/mam_body_markings/fennec
name = "Fennec"
icon_state = "Fennec"
/datum/sprite_accessory/mam_body_markings/fox
name = "Fox"
icon_state = "fox"
/datum/sprite_accessory/mam_body_markings/frog
name = "Frog"
icon_state = "frog"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/goat
name = "Goat"
icon_state = "goat"
/datum/sprite_accessory/mam_body_markings/handsfeet
name = "Handsfeet"
icon_state = "handsfeet"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/hawk
name = "Hawk"
icon_state = "hawk"
/datum/sprite_accessory/mam_body_markings/husky
name = "Husky"
icon_state = "husky"
/datum/sprite_accessory/mam_body_markings/hyena
name = "Hyena"
icon_state = "hyena"
/datum/sprite_accessory/mam_body_markings/lab
name = "Lab"
icon_state = "lab"
/datum/sprite_accessory/mam_body_markings/insect
name = "Insect"
icon_state = "insect"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/otie
name = "Otie"
icon_state = "otie"
/datum/sprite_accessory/mam_body_markings/otter
name = "Otter"
icon_state = "otter"
/datum/sprite_accessory/mam_body_markings/orca
name = "Orca"
icon_state = "orca"
/datum/sprite_accessory/mam_body_markings/panther
name = "Panther"
icon_state = "panther"
/datum/sprite_accessory/mam_body_markings/possum
name = "Possum"
icon_state = "possum"
/datum/sprite_accessory/mam_body_markings/raccoon
name = "Raccoon"
icon_state = "raccoon"
/datum/sprite_accessory/mam_body_markings/pede
name = "Scolipede"
icon_state = "scolipede"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/shark
name = "Shark"
icon_state = "shark"
/datum/sprite_accessory/mam_body_markings/skunk
name = "Skunk"
icon_state = "skunk"
/datum/sprite_accessory/mam_body_markings/sergal
name = "Sergal"
icon_state = "sergal"
/datum/sprite_accessory/mam_body_markings/shepherd
name = "Shepherd"
icon_state = "shepherd"
/datum/sprite_accessory/mam_body_markings/tajaran
name = "Tajaran"
icon_state = "tajaran"
/datum/sprite_accessory/mam_body_markings/tiger
name = "Tiger"
icon_state = "tiger"
/datum/sprite_accessory/mam_body_markings/turian
name = "Turian"
icon_state = "turian"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/mam_body_markings/wolf
name = "Wolf"
icon_state = "wolf"
/datum/sprite_accessory/mam_body_markings/xeno
name = "Xeno"
icon_state = "xeno"
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/******************************************
************* Insect Markings *************
*******************************************/
/datum/sprite_accessory/insect_fluff
icon = 'icons/mob/wings.dmi'
color_src = 0
/datum/sprite_accessory/insect_fluff/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/insect_fluff/plain
name = "Plain"
icon_state = "plain"
/datum/sprite_accessory/insect_fluff/reddish
name = "Reddish"
icon_state = "redish"
/datum/sprite_accessory/insect_fluff/royal
name = "Royal"
icon_state = "royal"
/datum/sprite_accessory/insect_fluff/gothic
name = "Gothic"
icon_state = "gothic"
/datum/sprite_accessory/insect_fluff/lovers
name = "Lovers"
icon_state = "lovers"
/datum/sprite_accessory/insect_fluff/whitefly
name = "White Fly"
icon_state = "whitefly"
/datum/sprite_accessory/insect_fluff/punished
name = "Burnt Off"
icon_state = "punished"
/datum/sprite_accessory/insect_fluff/firewatch
name = "Firewatch"
icon_state = "firewatch"
/datum/sprite_accessory/insect_fluff/deathhead
name = "Deathshead"
icon_state = "deathhead"
/datum/sprite_accessory/insect_fluff/poison
name = "Poison"
icon_state = "poison"
/datum/sprite_accessory/insect_fluff/ragged
name = "Ragged"
icon_state = "ragged"
/datum/sprite_accessory/insect_fluff/moonfly
name = "Moon Fly"
icon_state = "moonfly"
/datum/sprite_accessory/insect_fluff/snow
name = "Snow"
icon_state = "snow"
/datum/sprite_accessory/insect_fluff/colored
name = "Colored (Hair)"
icon_state = "snow"
color_src = HAIR
/datum/sprite_accessory/insect_fluff/colored1
name = "Colored (Primary)"
icon_state = "snow"
color_src = MUTCOLORS
/datum/sprite_accessory/insect_fluff/colored2
name = "Colored (Secondary)"
icon_state = "snow"
color_src = MUTCOLORS2
/datum/sprite_accessory/insect_fluff/colored3
name = "Colored (Tertiary)"
icon_state = "snow"
color_src = MUTCOLORS3
@@ -0,0 +1,303 @@
/datum/sprite_accessory/ears
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/ears/none
name = "None"
icon_state = "none"
/******************************************
*************** Human Ears ****************
*******************************************/
/datum/sprite_accessory/ears/human/axolotl
name = "Axolotl"
icon_state = "axolotl"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
/datum/sprite_accessory/ears/human/bear
name = "Bear"
icon_state = "bear"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/bigwolf
name = "Big Wolf"
icon_state = "bigwolf"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/bigwolfinner
name = "Big Wolf (ALT)"
icon_state = "bigwolfinner"
hasinner = 1
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/bigwolfdark
name = "Dark Big Wolf"
icon_state = "bigwolfdark"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/bigwolfinnerdark
name = "Dark Big Wolf (ALT)"
icon_state = "bigwolfinnerdark"
hasinner = 1
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/cat
name = "Cat"
icon_state = "cat"
hasinner = 1
color_src = HAIR
/datum/sprite_accessory/ears/human/cow
name = "Cow"
icon_state = "cow"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/curled
name = "Curled Horn"
icon_state = "horn1"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MUTCOLORS3
/datum/sprite_accessory/ears/human/eevee
name = "Eevee"
icon_state = "eevee"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/elephant
name = "Elephant"
icon_state = "elephant"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/elf
name = "Elf"
icon_state = "elf"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = SKINTONE
/datum/sprite_accessory/ears/fennec
name = "Fennec"
icon_state = "fennec"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/fish
name = "Fish"
icon_state = "fish"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/fox
name = "Fox"
icon_state = "fox"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
/datum/sprite_accessory/ears/human/jellyfish
name = "Jellyfish"
icon_state = "jellyfish"
color_src = HAIR
/datum/sprite_accessory/ears/lab
name = "Dog, Floppy"
icon_state = "lab"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
/datum/sprite_accessory/ears/murid
name = "Murid"
icon_state = "murid"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/otie
name = "Otusian"
icon_state = "otie"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
/datum/sprite_accessory/ears/human/pede
name = "Scolipede"
icon_state = "pede"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/rabbit
name = "Rabbit"
icon_state = "rabbit"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
/datum/sprite_accessory/ears/human/sergal
name = "Sergal"
icon_state = "sergal"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/human/skunk
name = "skunk"
icon_state = "skunk"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/squirrel
name = "Squirrel"
icon_state = "squirrel"
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/ears/wolf
name = "Wolf"
icon_state = "wolf"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
/******************************************
*************** Furry Ears ****************
*******************************************/
/datum/sprite_accessory/mam_ears
icon = 'modular_citadel/icons/mob/mam_ears.dmi'
color_src = MATRIXED
/datum/sprite_accessory/mam_ears/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/mam_ears/axolotl
name = "Axolotl"
icon_state = "axolotl"
/datum/sprite_accessory/mam_ears/bat
name = "Bat"
icon_state = "bat"
/datum/sprite_accessory/mam_ears/bear
name = "Bear"
icon_state = "bear"
/datum/sprite_accessory/mam_ears/bigwolf
name = "Big Wolf"
icon_state = "bigwolf"
/datum/sprite_accessory/mam_ears/bigwolfinner
name = "Big Wolf (ALT)"
icon_state = "bigwolfinner"
hasinner = 1
/datum/sprite_accessory/mam_ears/bigwolfdark
name = "Dark Big Wolf"
icon_state = "bigwolfdark"
/datum/sprite_accessory/mam_ears/bigwolfinnerdark
name = "Dark Big Wolf (ALT)"
icon_state = "bigwolfinnerdark"
hasinner = 1
/datum/sprite_accessory/mam_ears/cat
name = "Cat"
icon_state = "cat"
hasinner = 1
color_src = HAIR
/datum/sprite_accessory/mam_ears/catbig
name = "Cat, Big"
icon_state = "catbig"
/datum/sprite_accessory/mam_ears/cow
name = "Cow"
icon_state = "cow"
/datum/sprite_accessory/mam_ears/curled
name = "Curled Horn"
icon_state = "horn1"
color_src = MUTCOLORS3
/datum/sprite_accessory/mam_ears/deer
name = "Deer"
icon_state = "deer"
color_src = MUTCOLORS3
/datum/sprite_accessory/mam_ears/eevee
name = "Eevee"
icon_state = "eevee"
/datum/sprite_accessory/mam_ears/elf
name = "Elf"
icon_state = "elf"
color_src = MUTCOLORS3
/datum/sprite_accessory/mam_ears/elephant
name = "Elephant"
icon_state = "elephant"
/datum/sprite_accessory/mam_ears/fennec
name = "Fennec"
icon_state = "fennec"
/datum/sprite_accessory/mam_ears/fish
name = "Fish"
icon_state = "fish"
/datum/sprite_accessory/mam_ears/fox
name = "Fox"
icon_state = "fox"
/datum/sprite_accessory/mam_ears/husky
name = "Husky"
icon_state = "wolf"
/datum/sprite_accessory/mam_ears/kangaroo
name = "kangaroo"
icon_state = "kangaroo"
/datum/sprite_accessory/mam_ears/jellyfish
name = "Jellyfish"
icon_state = "jellyfish"
color_src = HAIR
/datum/sprite_accessory/mam_ears/lab
name = "Dog, Long"
icon_state = "lab"
/datum/sprite_accessory/mam_ears/murid
name = "Murid"
icon_state = "murid"
/datum/sprite_accessory/mam_ears/otie
name = "Otusian"
icon_state = "otie"
/datum/sprite_accessory/mam_ears/squirrel
name = "Squirrel"
icon_state = "squirrel"
/datum/sprite_accessory/mam_ears/pede
name = "Scolipede"
icon_state = "pede"
/datum/sprite_accessory/mam_ears/rabbit
name = "Rabbit"
icon_state = "rabbit"
/datum/sprite_accessory/mam_ears/sergal
name = "Sergal"
icon_state = "sergal"
/datum/sprite_accessory/mam_ears/skunk
name = "skunk"
icon_state = "skunk"
/datum/sprite_accessory/mam_ears/wolf
name = "Wolf"
icon_state = "wolf"
@@ -0,0 +1,381 @@
/datum/sprite_accessory/snouts
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/snouts/sharp
name = "Sharp"
icon_state = "sharp"
/datum/sprite_accessory/snouts/round
name = "Round"
icon_state = "round"
/datum/sprite_accessory/snouts/sharplight
name = "Sharp + Light"
icon_state = "sharplight"
/datum/sprite_accessory/snouts/roundlight
name = "Round + Light"
icon_state = "roundlight"
/datum/sprite_accessory/snout/guilmon
name = "Guilmon"
icon_state = "guilmon"
color_src = MATRIXED
//christ this was a mistake, but it's here just in case someone wants to selectively fix -- Pooj
/************* Lizard compatable snoots ***********
/datum/sprite_accessory/snouts/bird
name = "Beak"
icon_state = "bird"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/bigbeak
name = "Big Beak"
icon_state = "bigbeak"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/bug
name = "Bug"
icon_state = "bug"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
extra2 = TRUE
extra2_color_src = MUTCOLORS3
/datum/sprite_accessory/snouts/elephant
name = "Elephant"
icon_state = "elephant"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
extra = TRUE
extra_color_src = MUTCOLORS3
/datum/sprite_accessory/snouts/lcanid
name = "Mammal, Long"
icon_state = "lcanid"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/lcanidalt
name = "Mammal, Long ALT"
icon_state = "lcanidalt"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/scanid
name = "Mammal, Short"
icon_state = "scanid"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/scanidalt
name = "Mammal, Short ALT"
icon_state = "scanidalt"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/wolf
name = "Mammal, Thick"
icon_state = "wolf"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/wolfalt
name = "Mammal, Thick ALT"
icon_state = "wolfalt"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/redpanda
name = "WahCoon"
icon_state = "wah"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/rhino
name = "Horn"
icon_state = "rhino"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
extra = TRUE
extra = MUTCOLORS3
/datum/sprite_accessory/snouts/rodent
name = "Rodent"
icon_state = "rodent"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/husky
name = "Husky"
icon_state = "husky"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/otie
name = "Otie"
icon_state = "otie"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/pede
name = "Scolipede"
icon_state = "pede"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/sergal
name = "Sergal"
icon_state = "sergal"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
/datum/sprite_accessory/snouts/shark
name = "Shark"
icon_state = "shark"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
/datum/sprite_accessory/snouts/toucan
name = "Toucan"
icon_state = "toucan"
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
color_src = MATRIXED
*/
/******************************************
************** Mammal Snouts **************
*******************************************/
/datum/sprite_accessory/mam_snouts
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
/datum/sprite_accessory/mam_snouts/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/mam_snouts/bird
name = "Beak"
icon_state = "bird"
/datum/sprite_accessory/mam_snouts/bigbeak
name = "Big Beak"
icon_state = "bigbeak"
/datum/sprite_accessory/mam_snouts/bug
name = "Bug"
icon_state = "bug"
color_src = MUTCOLORS
extra2 = TRUE
extra2_color_src = MUTCOLORS3
/datum/sprite_accessory/mam_snouts/elephant
name = "Elephant"
icon_state = "elephant"
extra = TRUE
extra_color_src = MUTCOLORS3
/datum/sprite_accessory/mam_snouts/lcanid
name = "Mammal, Long"
icon_state = "lcanid"
/datum/sprite_accessory/mam_snouts/lcanidalt
name = "Mammal, Long ALT"
icon_state = "lcanidalt"
/datum/sprite_accessory/mam_snouts/scanid
name = "Mammal, Short"
icon_state = "scanid"
/datum/sprite_accessory/mam_snouts/scanidalt
name = "Mammal, Short ALT"
icon_state = "scanidalt"
/datum/sprite_accessory/mam_snouts/scanidalt2
name = "Mammal, Short ALT 2"
icon_state = "scanidalt2"
/datum/sprite_accessory/mam_snouts/wolf
name = "Mammal, Thick"
icon_state = "wolf"
/datum/sprite_accessory/mam_snouts/wolfalt
name = "Mammal, Thick ALT"
icon_state = "wolfalt"
/datum/sprite_accessory/mam_snouts/redpanda
name = "WahCoon"
icon_state = "wah"
/datum/sprite_accessory/mam_snouts/redpandaalt
name = "WahCoon ALT"
icon_state = "wahalt"
/datum/sprite_accessory/mam_snouts/rhino
name = "Horn"
icon_state = "rhino"
extra = TRUE
extra = MUTCOLORS3
/datum/sprite_accessory/mam_snouts/rodent
name = "Rodent"
icon_state = "rodent"
/datum/sprite_accessory/mam_snouts/husky
name = "Husky"
icon_state = "husky"
/datum/sprite_accessory/mam_snouts/otie
name = "Otie"
icon_state = "otie"
/datum/sprite_accessory/mam_snouts/pede
name = "Scolipede"
icon_state = "pede"
/datum/sprite_accessory/mam_snouts/sergal
name = "Sergal"
icon_state = "sergal"
/datum/sprite_accessory/mam_snouts/shark
name = "Shark"
icon_state = "shark"
/datum/sprite_accessory/mam_snouts/toucan
name = "Toucan"
icon_state = "toucan"
/datum/sprite_accessory/mam_snouts/sharp
name = "Sharp"
icon_state = "sharp"
color_src = MUTCOLORS
/datum/sprite_accessory/mam_snouts/round
name = "Round"
icon_state = "round"
color_src = MUTCOLORS
/datum/sprite_accessory/mam_snouts/sharplight
name = "Sharp + Light"
icon_state = "sharplight"
color_src = MUTCOLORS
/datum/sprite_accessory/mam_snouts/roundlight
name = "Round + Light"
icon_state = "roundlight"
color_src = MUTCOLORS
/******************************************
**************** Snouts *******************
*************but higher up*****************/
/datum/sprite_accessory/mam_snouts/fbird
name = "Beak (Top)"
icon_state = "fbird"
/datum/sprite_accessory/mam_snouts/fbigbeak
name = "Big Beak (Top)"
icon_state = "fbigbeak"
/datum/sprite_accessory/mam_snouts/fbug
name = "Bug (Top)"
icon_state = "fbug"
color_src = MUTCOLORS
extra2 = TRUE
extra2_color_src = MUTCOLORS3
/datum/sprite_accessory/mam_snouts/felephant
name = "Elephant (Top)"
icon_state = "felephant"
extra = TRUE
extra_color_src = MUTCOLORS3
/datum/sprite_accessory/mam_snouts/flcanid
name = "Mammal, Long (Top)"
icon_state = "flcanid"
/datum/sprite_accessory/mam_snouts/flcanidalt
name = "Mammal, Long ALT (Top)"
icon_state = "flcanidalt"
/datum/sprite_accessory/mam_snouts/fscanid
name = "Mammal, Short (Top)"
icon_state = "fscanid"
/datum/sprite_accessory/mam_snouts/fscanidalt
name = "Mammal, Short ALT (Top)"
icon_state = "fscanidalt"
/datum/sprite_accessory/mam_snouts/fscanidalt2
name = "Mammal, Short ALT 2 (Top)"
icon_state = "fscanidalt2"
/datum/sprite_accessory/mam_snouts/fwolf
name = "Mammal, Thick (Top)"
icon_state = "fwolf"
/datum/sprite_accessory/mam_snouts/fwolfalt
name = "Mammal, Thick ALT (Top)"
icon_state = "fwolfalt"
/datum/sprite_accessory/mam_snouts/fredpanda
name = "WahCoon (Top)"
icon_state = "fwah"
/datum/sprite_accessory/mam_snouts/frhino
name = "Horn (Top)"
icon_state = "frhino"
extra = TRUE
extra = MUTCOLORS3
/datum/sprite_accessory/mam_snouts/frodent
name = "Rodent (Top)"
icon_state = "frodent"
/datum/sprite_accessory/mam_snouts/fhusky
name = "Husky (Top)"
icon_state = "fhusky"
/datum/sprite_accessory/mam_snouts/fotie
name = "Otie (Top)"
icon_state = "fotie"
/datum/sprite_accessory/mam_snouts/fpede
name = "Scolipede (Top)"
icon_state = "fpede"
/datum/sprite_accessory/mam_snouts/fsergal
name = "Sergal (Top)"
icon_state = "fsergal"
/datum/sprite_accessory/mam_snouts/fshark
name = "Shark (Top)"
icon_state = "fshark"
/datum/sprite_accessory/mam_snouts/ftoucan
name = "Toucan (Top)"
icon_state = "ftoucan"
/datum/sprite_accessory/mam_snouts/fsharp
name = "Sharp (Top)"
icon_state = "fsharp"
color_src = MUTCOLORS
/datum/sprite_accessory/mam_snouts/fround
name = "Round (Top)"
icon_state = "fround"
color_src = MUTCOLORS
/datum/sprite_accessory/mam_snouts/fsharplight
name = "Sharp + Light (Top)"
icon_state = "fsharplight"
color_src = MUTCOLORS
/datum/sprite_accessory/mam_snouts/froundlight
name = "Round + Light (Top)"
icon_state = "froundlight"
color_src = MUTCOLORS
@@ -0,0 +1,750 @@
/datum/sprite_accessory/tails
icon = 'icons/mob/mutant_bodyparts.dmi'
/datum/sprite_accessory/tails_animated
icon = 'icons/mob/mutant_bodyparts.dmi'
/******************************************
************* Lizard Tails ****************
*******************************************/
/datum/sprite_accessory/tails/lizard/smooth
name = "Smooth"
icon_state = "smooth"
/datum/sprite_accessory/tails_animated/lizard/smooth
name = "Smooth"
icon_state = "smooth"
/datum/sprite_accessory/tails/lizard/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
/datum/sprite_accessory/tails_animated/lizard/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
/datum/sprite_accessory/tails/lizard/ltiger
name = "Light Tiger"
icon_state = "ltiger"
/datum/sprite_accessory/tails_animated/lizard/ltiger
name = "Light Tiger"
icon_state = "ltiger"
/datum/sprite_accessory/tails/lizard/spikes
name = "Spikes"
icon_state = "spikes"
/datum/sprite_accessory/tails_animated/lizard/spikes
name = "Spikes"
icon_state = "spikes"
/datum/sprite_accessory/tails/lizard/none
name = "None"
icon_state = "None"
/datum/sprite_accessory/tails_animated/lizard/none
name = "None"
icon_state = "None"
/datum/sprite_accessory/tails/lizard/axolotl
name = "Axolotl"
icon_state = "axolotl"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/lizard/axolotl
name = "Axolotl"
icon_state = "axolotl"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/body_markings/guilmon
name = "Guilmon"
icon_state = "guilmon"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/markings_notmammals.dmi'
/datum/sprite_accessory/tails/lizard/guilmon
name = "Guilmon"
icon_state = "guilmon"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/lizard/guilmon
name = "Guilmon"
icon_state = "guilmon"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/******************************************
************** Human Tails ****************
*******************************************/
/datum/sprite_accessory/tails/human/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/tails_animated/human/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/tails/human/ailurus
name = "Red Panda"
icon_state = "wah"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/ailurus
name = "Red Panda"
icon_state = "wah"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/axolotl
name = "Axolotl"
icon_state = "axolotl"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/axolotl
name = "Axolotl"
icon_state = "axolotl"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/mam_tails/batl
name = "Bat (Long)"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
icon_state = "batl"
/datum/sprite_accessory/mam_tails_animated/batl
name = "Bat (Long)"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
icon_state = "batl"
/datum/sprite_accessory/mam_tails/bats
name = "Bat (Short)"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
icon_state = "bats"
/datum/sprite_accessory/mam_tails_animated/bats
name = "Bat (Short)"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
icon_state = "bats"
/datum/sprite_accessory/tails/human/bee
name = "Bee"
icon_state = "bee"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/bee
name = "Bee"
icon_state = "bee"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/cat
name = "Cat"
icon_state = "cat"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = HAIR
/datum/sprite_accessory/tails_animated/human/cat
name = "Cat"
icon_state = "cat"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = HAIR
/datum/sprite_accessory/tails/human/catbig
name = "Cat, Big"
icon_state = "catbig"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/catbig
name = "Cat, Big"
icon_state = "catbig"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/cow
name = "Cow"
icon_state = "cow"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/cow
name = "Cow"
icon_state = "cow"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/corvid
name = "Corvid"
icon_state = "crow"
/datum/sprite_accessory/tails_animated/human/corvid
name = "Corvid"
icon_state = "crow"
/datum/sprite_accessory/tails/human/eevee
name = "Eevee"
icon_state = "eevee"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/eevee
name = "Eevee"
icon_state = "eevee"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/fennec
name = "Fennec"
icon_state = "fennec"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/fennec
name = "Fennec"
icon_state = "fennec"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/fish
name = "Fish"
icon_state = "fish"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/fish
name = "Fish"
icon_state = "fish"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/fox
name = "Fox"
icon_state = "fox"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/fox
name = "Fox"
icon_state = "fox"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/horse
name = "Horse"
icon_state = "horse"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = HAIR
/datum/sprite_accessory/tails_animated/human/horse
name = "Horse"
icon_state = "horse"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = HAIR
/datum/sprite_accessory/tails/human/husky
name = "Husky"
icon_state = "husky"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/husky
name = "Husky"
icon_state = "husky"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/insect
name = "Insect"
icon_state = "insect"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails_animated/human/insect
name = "insect"
icon_state = "insect"
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
color_src = MATRIXED
/datum/sprite_accessory/tails/human/kitsune
name = "Kitsune"
icon_state = "kitsune"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/kitsune
name = "Kitsune"
icon_state = "kitsune"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/murid
name = "Murid"
icon_state = "murid"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/murid
name = "Murid"
icon_state = "murid"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/otie
name = "Otusian"
icon_state = "otie"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/otie
name = "Otusian"
icon_state = "otie"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/orca
name = "Orca"
icon_state = "orca"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/orca
name = "Orca"
icon_state = "orca"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/pede
name = "Scolipede"
icon_state = "pede"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/pede
name = "Scolipede"
icon_state = "pede"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/rabbit
name = "Rabbit"
icon_state = "rabbit"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/rabbit
name = "Rabbit"
icon_state = "rabbit"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/sergal
name = "Sergal"
icon_state = "sergal"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/sergal
name = "Sergal"
icon_state = "sergal"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/skunk
name = "skunk"
icon_state = "skunk"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/skunk
name = "skunk"
icon_state = "skunk"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/shark
name = "Shark"
icon_state = "shark"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/shark
name = "Shark"
icon_state = "shark"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/datashark
name = "datashark"
icon_state = "datashark"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/datashark
name = "datashark"
icon_state = "datashark"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/straighttail
name = "Straight Tail"
icon_state = "straighttail"
/datum/sprite_accessory/tails_animated/human/straighttail
name = "Straight Tail"
icon_state = "straighttail"
/datum/sprite_accessory/tails/human/squirrel
name = "Squirrel"
icon_state = "squirrel"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/squirrel
name = "Squirrel"
icon_state = "squirrel"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/tentacle
name = "Tentacle"
icon_state = "tentacle"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/tentacle
name = "Tentacle"
icon_state = "tentacle"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/tiger
name = "Tiger"
icon_state = "tiger"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/tiger
name = "Tiger"
icon_state = "tiger"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails/human/wolf
name = "Wolf"
icon_state = "wolf"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/tails_animated/human/wolf
name = "Wolf"
icon_state = "wolf"
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/******************************************
************** Furry Tails ****************
*******************************************/
/datum/sprite_accessory/mam_tails
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/mam_tails/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/mam_tails_animated
color_src = MATRIXED
icon = 'modular_citadel/icons/mob/mam_tails.dmi'
/datum/sprite_accessory/mam_tails_animated/none
name = "None"
icon_state = "none"
color_src = MATRIXED
/datum/sprite_accessory/mam_tails/ailurus
name = "Red Panda"
icon_state = "wah"
extra = TRUE
/datum/sprite_accessory/mam_tails_animated/ailurus
name = "Red Panda"
icon_state = "wah"
extra = TRUE
/datum/sprite_accessory/mam_tails/axolotl
name = "Axolotl"
icon_state = "axolotl"
/datum/sprite_accessory/mam_tails_animated/axolotl
name = "Axolotl"
icon_state = "axolotl"
/datum/sprite_accessory/mam_tails/batl
name = "Bat (Long)"
icon_state = "batl"
/datum/sprite_accessory/mam_tails_animated/batl
name = "Bat (Long)"
icon_state = "batl"
/datum/sprite_accessory/mam_tails/bats
name = "Bat (Short)"
icon_state = "bats"
/datum/sprite_accessory/mam_tails_animated/bats
name = "Bat (Short)"
icon_state = "bats"
/datum/sprite_accessory/mam_tails/bee
name = "Bee"
icon_state = "bee"
/datum/sprite_accessory/mam_tails_animated/bee
name = "Bee"
icon_state = "bee"
/datum/sprite_accessory/mam_tails/cat
name = "Cat"
icon_state = "cat"
color_src = HAIR
/datum/sprite_accessory/mam_tails_animated/cat
name = "Cat"
icon_state = "cat"
color_src = HAIR
/datum/sprite_accessory/mam_tails/catbig
name = "Cat, Big"
icon_state = "catbig"
/datum/sprite_accessory/mam_tails_animated/catbig
name = "Cat, Big"
icon_state = "catbig"
/datum/sprite_accessory/mam_tails/corvid
name = "Corvid"
icon_state = "crow"
/datum/sprite_accessory/mam_tails_animated/corvid
name = "Corvid"
icon_state = "crow"
/datum/sprite_accessory/mam_tail/cow
name = "Cow"
icon_state = "cow"
/datum/sprite_accessory/mam_tails_animated/cow
name = "Cow"
icon_state = "cow"
/datum/sprite_accessory/mam_tails/eevee
name = "Eevee"
icon_state = "eevee"
/datum/sprite_accessory/mam_tails_animated/eevee
name = "Eevee"
icon_state = "eevee"
/datum/sprite_accessory/mam_tails/fennec
name = "Fennec"
icon_state = "fennec"
/datum/sprite_accessory/mam_tails_animated/fennec
name = "Fennec"
icon_state = "fennec"
/datum/sprite_accessory/mam_tails/human/fish
name = "Fish"
icon_state = "fish"
/datum/sprite_accessory/mam_tails_animated/human/fish
name = "Fish"
icon_state = "fish"
/datum/sprite_accessory/mam_tails/fox
name = "Fox"
icon_state = "fox"
/datum/sprite_accessory/mam_tails_animated/fox
name = "Fox"
icon_state = "fox"
/datum/sprite_accessory/mam_tails/hawk
name = "Hawk"
icon_state = "hawk"
/datum/sprite_accessory/mam_tails_animated/hawk
name = "Hawk"
icon_state = "hawk"
/datum/sprite_accessory/mam_tails/horse
name = "Horse"
icon_state = "horse"
color_src = HAIR
/datum/sprite_accessory/mam_tails_animated/horse
name = "Horse"
icon_state = "horse"
color_src = HAIR
/datum/sprite_accessory/mam_tails/husky
name = "Husky"
icon_state = "husky"
/datum/sprite_accessory/mam_tails_animated/husky
name = "Husky"
icon_state = "husky"
datum/sprite_accessory/mam_tails/insect
name = "Insect"
icon_state = "insect"
/datum/sprite_accessory/mam_tails_animated/insect
name = "Insect"
icon_state = "insect"
/datum/sprite_accessory/mam_tails/kangaroo
name = "kangaroo"
icon_state = "kangaroo"
/datum/sprite_accessory/mam_tails_animated/kangaroo
name = "kangaroo"
icon_state = "kangaroo"
/datum/sprite_accessory/mam_tails/kitsune
name = "Kitsune"
icon_state = "kitsune"
/datum/sprite_accessory/mam_tails_animated/kitsune
name = "Kitsune"
icon_state = "kitsune"
/datum/sprite_accessory/mam_tails/lab
name = "Lab"
icon_state = "lab"
/datum/sprite_accessory/mam_tails_animated/lab
name = "Lab"
icon_state = "lab"
/datum/sprite_accessory/mam_tails/murid
name = "Murid"
icon_state = "murid"
/datum/sprite_accessory/mam_tails_animated/murid
name = "Murid"
icon_state = "murid"
/datum/sprite_accessory/mam_tails/otie
name = "Otusian"
icon_state = "otie"
/datum/sprite_accessory/mam_tails_animated/otie
name = "Otusian"
icon_state = "otie"
/datum/sprite_accessory/mam_tails/orca
name = "Orca"
icon_state = "orca"
/datum/sprite_accessory/mam_tails_animated/orca
name = "Orca"
icon_state = "orca"
/datum/sprite_accessory/mam_tails/pede
name = "Scolipede"
icon_state = "pede"
/datum/sprite_accessory/mam_tails_animated/pede
name = "Scolipede"
icon_state = "pede"
/datum/sprite_accessory/mam_tails/rabbit
name = "Rabbit"
icon_state = "rabbit"
/datum/sprite_accessory/mam_tails_animated/rabbit
name = "Rabbit"
icon_state = "rabbit"
/datum/sprite_accessory/mam_tails/sergal
name = "Sergal"
icon_state = "sergal"
/datum/sprite_accessory/mam_tails_animated/sergal
name = "Sergal"
icon_state = "sergal"
/datum/sprite_accessory/mam_tails/skunk
name = "Skunk"
icon_state = "skunk"
/datum/sprite_accessory/mam_tails_animated/skunk
name = "Skunk"
icon_state = "skunk"
/datum/sprite_accessory/mam_tails/shark
name = "Shark"
icon_state = "shark"
/datum/sprite_accessory/mam_tails_animated/shark
name = "Shark"
icon_state = "shark"
/datum/sprite_accessory/mam_tails/shepherd
name = "Shepherd"
icon_state = "shepherd"
/datum/sprite_accessory/mam_tails_animated/shepherd
name = "Shepherd"
icon_state = "shepherd"
/datum/sprite_accessory/mam_tails/straighttail
name = "Straight Tail"
icon_state = "straighttail"
/datum/sprite_accessory/mam_tails_animated/straighttail
name = "Straight Tail"
icon_state = "straighttail"
/datum/sprite_accessory/mam_tails/squirrel
name = "Squirrel"
icon_state = "squirrel"
/datum/sprite_accessory/mam_tails_animated/squirrel
name = "Squirrel"
icon_state = "squirrel"
/datum/sprite_accessory/mam_tails/tentacle
name = "Tentacle"
icon_state = "tentacle"
/datum/sprite_accessory/mam_tails_animated/tentacle
name = "Tentacle"
icon_state = "tentacle"
/datum/sprite_accessory/mam_tails/tiger
name = "Tiger"
icon_state = "tiger"
/datum/sprite_accessory/mam_tails_animated/tiger
name = "Tiger"
icon_state = "tiger"
/datum/sprite_accessory/mam_tails/wolf
name = "Wolf"
icon_state = "wolf"
/datum/sprite_accessory/mam_tails_animated/wolf
name = "Wolf"
icon_state = "wolf"
@@ -0,0 +1,216 @@
//Angel Wings
/datum/sprite_accessory/wings/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/wings_open
icon = 'icons/mob/wings.dmi'
/datum/sprite_accessory/wings_open/angel
name = "Angel"
icon_state = "angel"
color_src = 0
dimension_x = 46
center = TRUE
dimension_y = 34
/datum/sprite_accessory/wings
icon = 'icons/mob/wings.dmi'
/datum/sprite_accessory/wings/angel
name = "Angel"
icon_state = "angel"
color_src = 0
dimension_x = 46
center = TRUE
dimension_y = 34
locked = TRUE
// Decorative wings
/datum/sprite_accessory/deco_wings
icon = 'icons/mob/wings.dmi'
color_src = WINGCOLOR
/datum/sprite_accessory/deco_wings/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/deco_wings/angel
name = "Angel"
icon_state = "angel"
color_src = 0
dimension_x = 46
center = TRUE
dimension_y = 34
/datum/sprite_accessory/deco_wings/bat
name = "Bat"
icon_state = "bat"
/datum/sprite_accessory/deco_wings/bee
name = "Bee"
icon_state = "bee"
/datum/sprite_accessory/deco_wings/fairy
name = "Fairy"
icon_state = "fairy"
/datum/sprite_accessory/deco_wings/feathery
name = "Feathery"
icon_state = "feathery"
/datum/sprite_accessory/deco_wings/atlas
name = "Atlas"
icon_state = "atlas"
/datum/sprite_accessory/deco_wings/deathhead
name = "Deathshead"
icon_state = "deathhead"
/datum/sprite_accessory/deco_wings/firewatch
name = "Firewatch"
icon_state = "firewatch"
/datum/sprite_accessory/deco_wings/gothic
name = "Gothic"
icon_state = "gothic"
/datum/sprite_accessory/deco_wings/lovers
name = "Lovers"
icon_state = "lovers"
/datum/sprite_accessory/deco_wings/luna
name = "Luna"
icon_state = "luna"
/datum/sprite_accessory/deco_wings/monarch
name = "Monarch"
icon_state = "monarch"
/datum/sprite_accessory/deco_wings/moonfly
name = "Moon Fly"
icon_state = "moonfly"
/datum/sprite_accessory/deco_wings/plain
name = "Plain"
icon_state = "plain"
/datum/sprite_accessory/deco_wings/poison
name = "Poison"
icon_state = "poison"
/datum/sprite_accessory/deco_wings/punished
name = "Burnt Off"
icon_state = "punished"
/datum/sprite_accessory/deco_wings/ragged
name = "Ragged"
icon_state = "ragged"
/datum/sprite_accessory/deco_wings/reddish
name = "Reddish"
icon_state = "redish"
/datum/sprite_accessory/deco_wings/royal
name = "Royal"
icon_state = "royal"
/datum/sprite_accessory/deco_wings/snow
name = "Snow"
icon_state = "snow"
/datum/sprite_accessory/deco_wings/whitefly
name = "White Fly"
icon_state = "whitefly"
//INSECT WINGS
/datum/sprite_accessory/insect_wings
icon = 'icons/mob/wings.dmi'
color_src = WINGCOLOR
/datum/sprite_accessory/insect_wings/none
name = "None"
icon_state = "none"
/datum/sprite_accessory/insect_wings/bat
name = "Bat"
icon_state = "bat"
/datum/sprite_accessory/insect_wings/bee
name = "Bee"
icon_state = "bee"
/datum/sprite_accessory/insect_wings/fairy
name = "Fairy"
icon_state = "fairy"
/datum/sprite_accessory/insect_wings/feathery
name = "Feathery"
icon_state = "feathery"
/datum/sprite_accessory/insect_wings/atlas
name = "Atlas"
icon_state = "atlas"
/datum/sprite_accessory/insect_wings/deathhead
name = "Deathshead"
icon_state = "deathhead"
/datum/sprite_accessory/insect_wings/firewatch
name = "Firewatch"
icon_state = "firewatch"
/datum/sprite_accessory/insect_wings/gothic
name = "Gothic"
icon_state = "gothic"
/datum/sprite_accessory/insect_wings/lovers
name = "Lovers"
icon_state = "lovers"
/datum/sprite_accessory/insect_wings/luna
name = "Luna"
icon_state = "luna"
/datum/sprite_accessory/insect_wings/monarch
name = "Monarch"
icon_state = "monarch"
/datum/sprite_accessory/insect_wings/moonfly
name = "Moon Fly"
icon_state = "moonfly"
/datum/sprite_accessory/insect_wings/plain
name = "Plain"
icon_state = "plain"
/datum/sprite_accessory/insect_wings/poison
name = "Poison"
icon_state = "poison"
/datum/sprite_accessory/insect_wings/punished
name = "Burnt Off"
icon_state = "punished"
/datum/sprite_accessory/insect_wings/ragged
name = "Ragged"
icon_state = "ragged"
/datum/sprite_accessory/insect_wings/reddish
name = "Reddish"
icon_state = "redish"
/datum/sprite_accessory/insect_wings/royal
name = "Royal"
icon_state = "royal"
/datum/sprite_accessory/insect_wings/snow
name = "Snow"
icon_state = "snow"
/datum/sprite_accessory/insect_wings/whitefly
name = "White Fly"
icon_state = "whitefly"
+900
View File
@@ -0,0 +1,900 @@
GLOBAL_LIST_EMPTY(ghost_images_default) //this is a list of the default (non-accessorized, non-dir) images of the ghosts themselves
GLOBAL_LIST_EMPTY(ghost_images_simple) //this is a list of all ghost images as the simple white ghost
GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
#define CANT_REENTER_ROUND -1
/mob/dead/observer
name = "ghost"
desc = "It's a g-g-g-g-ghooooost!" //jinkies!
icon = 'icons/mob/mob.dmi'
icon_state = "ghost"
layer = GHOST_LAYER
stat = DEAD
density = FALSE
canmove = 0
anchored = TRUE // don't get pushed around
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
invisibility = INVISIBILITY_OBSERVER
hud_type = /datum/hud/ghost
movement_type = GROUND | FLYING
var/can_reenter_corpse
var/reenter_round_timeout = 0 // used to prevent people from coming back through ghost roles/midround antags as they suicide/cryo for a duration set by CONFIG_GET(number/suicide_reenter_round_timer) and CONFIG_GET(number/roundstart_suicide_time_limit)
var/datum/hud/living/carbon/hud = null // hud
var/bootime = 0
var/started_as_observer //This variable is set to 1 when you enter the game as an observer.
//If you died in the game and are a ghsot - this will remain as null.
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
var/atom/movable/following = null
var/fun_verbs = 0
var/image/ghostimage_default = null //this mobs ghost image without accessories and dirs
var/image/ghostimage_simple = null //this mob with the simple white ghost sprite
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/mob/observetarget = null //The target mob that the ghost is observing. Used as a reference in logout()
var/ghost_hud_enabled = 1 //did this ghost disable the on-screen HUD?
var/data_huds_on = 0 //Are data HUDs currently enabled?
var/health_scan = FALSE //Are health scans currently enabled?
var/list/datahuds = list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED) //list of data HUDs shown to ghosts.
var/ghost_orbit = GHOST_ORBIT_CIRCLE
//These variables store hair data if the ghost originates from a species with head and/or facial hair.
var/hair_style
var/hair_color
var/mutable_appearance/hair_overlay
var/facial_hair_style
var/facial_hair_color
var/mutable_appearance/facial_hair_overlay
var/updatedir = 1 //Do we have to update our dir as the ghost moves around?
var/lastsetting = null //Stores the last setting that ghost_others was set to, for a little more efficiency when we update ghost images. Null means no update is necessary
//We store copies of the ghost display preferences locally so they can be referred to even if no client is connected.
//If there's a bug with changing your ghost settings, it's probably related to this.
var/ghost_accs = GHOST_ACCS_DEFAULT_OPTION
var/ghost_others = GHOST_OTHERS_DEFAULT_OPTION
// Used for displaying in ghost chat, without changing the actual name
// of the mob
var/deadchat_name
var/datum/spawners_menu/spawners_menu
/mob/dead/observer/Initialize()
set_invisibility(GLOB.observer_default_invisibility)
verbs += list(
/mob/dead/observer/proc/dead_tele,
/mob/dead/observer/proc/open_spawners_menu,
/mob/dead/observer/proc/view_gas)
if(icon_state in GLOB.ghost_forms_with_directions_list)
ghostimage_default = image(src.icon,src,src.icon_state + "_nodir")
else
ghostimage_default = image(src.icon,src,src.icon_state)
ghostimage_default.override = TRUE
GLOB.ghost_images_default |= ghostimage_default
ghostimage_simple = image(src.icon,src,"ghost_nodir")
ghostimage_simple.override = TRUE
GLOB.ghost_images_simple |= ghostimage_simple
updateallghostimages()
var/turf/T
var/mob/body = loc
if(ismob(body))
T = get_turf(body) //Where is the body located?
gender = body.gender
if(body.mind && body.mind.name)
name = body.mind.name
else
if(body.real_name)
name = body.real_name
else
name = random_unique_name(gender)
mind = body.mind //we don't transfer the mind but we keep a reference to it.
suiciding = body.suiciding // Transfer whether they committed suicide.
if(ishuman(body))
var/mob/living/carbon/human/body_human = body
if(HAIR in body_human.dna.species.species_traits)
hair_style = body_human.hair_style
hair_color = brighten_color(body_human.hair_color)
if(FACEHAIR in body_human.dna.species.species_traits)
facial_hair_style = body_human.facial_hair_style
facial_hair_color = brighten_color(body_human.facial_hair_color)
update_icon()
if(!T)
var/list/turfs = get_area_turfs(/area/shuttle/arrival)
if(turfs.len)
T = pick(turfs)
else
T = SSmapping.get_station_center()
forceMove(T)
if(!name) //To prevent nameless ghosts
name = random_unique_name(gender)
real_name = name
if(!fun_verbs)
verbs -= /mob/dead/observer/verb/boo
verbs -= /mob/dead/observer/verb/possess
animate(src, pixel_y = 2, time = 10, loop = -1)
GLOB.dead_mob_list += src
for(var/v in GLOB.active_alternate_appearances)
if(!v)
continue
var/datum/atom_hud/alternate_appearance/AA = v
AA.onNewMob(src)
. = ..()
grant_all_languages()
/mob/dead/observer/get_photo_description(obj/item/camera/camera)
if(!invisibility || camera.see_ghosts)
return "You can also see a g-g-g-g-ghooooost!"
/mob/dead/observer/narsie_act()
var/old_color = color
color = "#960000"
animate(src, color = old_color, time = 10, flags = ANIMATION_PARALLEL)
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 10)
/mob/dead/observer/ratvar_act()
var/old_color = color
color = "#FAE48C"
animate(src, color = old_color, time = 10, flags = ANIMATION_PARALLEL)
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 10)
/mob/dead/observer/Destroy()
GLOB.ghost_images_default -= ghostimage_default
QDEL_NULL(ghostimage_default)
GLOB.ghost_images_simple -= ghostimage_simple
QDEL_NULL(ghostimage_simple)
updateallghostimages()
QDEL_NULL(spawners_menu)
return ..()
/mob/dead/CanPass(atom/movable/mover, turf/target)
return 1
/*
* This proc will update the icon of the ghost itself, with hair overlays, as well as the ghost image.
* Please call update_icon(icon_state) from now on when you want to update the icon_state of the ghost,
* or you might end up with hair on a sprite that's not supposed to get it.
* Hair will always update its dir, so if your sprite has no dirs the haircut will go all over the place.
* |- Ricotez
*/
/mob/dead/observer/proc/update_icon(new_form)
if(client) //We update our preferences in case they changed right before update_icon was called.
ghost_accs = client.prefs.ghost_accs
ghost_others = client.prefs.ghost_others
if(hair_overlay)
cut_overlay(hair_overlay)
hair_overlay = null
if(facial_hair_overlay)
cut_overlay(facial_hair_overlay)
facial_hair_overlay = null
if(new_form)
icon_state = new_form
if(icon_state in GLOB.ghost_forms_with_directions_list)
ghostimage_default.icon_state = new_form + "_nodir" //if this icon has dirs, the default ghostimage must use its nodir version or clients with the preference set to default sprites only will see the dirs
else
ghostimage_default.icon_state = new_form
if(ghost_accs >= GHOST_ACCS_DIR && icon_state in GLOB.ghost_forms_with_directions_list) //if this icon has dirs AND the client wants to show them, we make sure we update the dir on movement
updatedir = 1
else
updatedir = 0 //stop updating the dir in case we want to show accessories with dirs on a ghost sprite without dirs
setDir(2 )//reset the dir to its default so the sprites all properly align up
if(ghost_accs == GHOST_ACCS_FULL && icon_state in GLOB.ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them
var/datum/sprite_accessory/S
if(facial_hair_style)
S = GLOB.facial_hair_styles_list[facial_hair_style]
if(S)
facial_hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER)
if(facial_hair_color)
facial_hair_overlay.color = "#" + facial_hair_color
facial_hair_overlay.alpha = 200
add_overlay(facial_hair_overlay)
if(hair_style)
S = GLOB.hair_styles_list[hair_style]
if(S)
hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER)
if(hair_color)
hair_overlay.color = "#" + hair_color
hair_overlay.alpha = 200
add_overlay(hair_overlay)
/*
* Increase the brightness of a color by calculating the average distance between the R, G and B values,
* and maximum brightness, then adding 30% of that average to R, G and B.
*
* I'll make this proc global and move it to its own file in a future update. |- Ricotez
*/
/mob/proc/brighten_color(input_color)
var/r_val
var/b_val
var/g_val
var/color_format = length(input_color)
if(color_format == 3)
r_val = hex2num(copytext(input_color, 1, 2))*16
g_val = hex2num(copytext(input_color, 2, 3))*16
b_val = hex2num(copytext(input_color, 3, 0))*16
else if(color_format == 6)
r_val = hex2num(copytext(input_color, 1, 3))
g_val = hex2num(copytext(input_color, 3, 5))
b_val = hex2num(copytext(input_color, 5, 0))
else
return 0 //If the color format is not 3 or 6, you're using an unexpected way to represent a color.
r_val += (255 - r_val) * 0.4
if(r_val > 255)
r_val = 255
g_val += (255 - g_val) * 0.4
if(g_val > 255)
g_val = 255
b_val += (255 - b_val) * 0.4
if(b_val > 255)
b_val = 255
return num2hex(r_val, 2) + num2hex(g_val, 2) + num2hex(b_val, 2)
/*
Transfer_mind is there to check if mob is being deleted/not going to have a body.
Works together with spawning an observer, noted above.
*/
/mob/proc/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE)
if(!key || cmptext(copytext(key,1,2),"@") || (!special && SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, can_reenter_corpse) & COMPONENT_BLOCK_GHOSTING))
return //mob has no key, is an aghost or some component hijacked.
stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now
var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc.
SStgui.on_transfer(src, ghost) // Transfer NanoUIs.
ghost.can_reenter_corpse = can_reenter_corpse
if(penalize) //penalizing them from making a ghost role / midround antag comeback right away.
var/penalty = CONFIG_GET(number/suicide_reenter_round_timer) MINUTES
var/roundstart_quit_limit = CONFIG_GET(number/roundstart_suicide_time_limit) MINUTES
if(world.time < roundstart_quit_limit) //add up the time difference to their antag rolling penalty if they quit before half a (ingame) hour even passed.
penalty += roundstart_quit_limit - world.time
if(penalty)
ghost.reenter_round_timeout = world.realtime + penalty
if(ghost.reenter_round_timeout - SSshuttle.realtimeofstart > SSshuttle.auto_call + SSshuttle.emergencyCallTime + SSshuttle.emergencyDockTime + SSshuttle.emergencyEscapeTime)
ghost.reenter_round_timeout = CANT_REENTER_ROUND
transfer_ckey(ghost, FALSE)
return ghost
/*
This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues.
*/
/mob/living/verb/ghost()
set category = "OOC"
set name = "Ghost"
set desc = "Relinquish your life and enter the land of the dead."
if(SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, (stat == DEAD) ? TRUE : FALSE, FALSE) & COMPONENT_BLOCK_GHOSTING)
return
var/penalty = CONFIG_GET(number/suicide_reenter_round_timer) MINUTES
var/roundstart_quit_limit = CONFIG_GET(number/roundstart_suicide_time_limit) MINUTES
if(world.time < roundstart_quit_limit)
penalty += roundstart_quit_limit - world.time
if(penalty + world.realtime - SSshuttle.realtimeofstart > SSshuttle.auto_call + SSshuttle.emergencyCallTime + SSshuttle.emergencyDockTime + SSshuttle.emergencyEscapeTime)
penalty = CANT_REENTER_ROUND
if(stat != DEAD)
succumb()
if(stat == DEAD)
ghostize(1)
else
var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst alive you won't be able to re-enter this round [penalty ? "or play ghost roles [penalty == CANT_REENTER_ROUND ? "until the round is over" : "for the next [DisplayTimeText(penalty)]"]" : ""]! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body")
if(response != "Ghost")
return //didn't want to ghost after-all
if(istype(loc, /obj/machinery/cryopod))
var/obj/machinery/cryopod/C = loc
C.despawn_occupant()
else
ghostize(0, penalize = TRUE) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
suicide_log(TRUE)
/mob/camera/verb/ghost()
set category = "OOC"
set name = "Ghost"
set desc = "Relinquish your life and enter the land of the dead."
if(SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, FALSE, FALSE) & COMPONENT_BLOCK_GHOSTING)
return
var/penalty = CONFIG_GET(number/suicide_reenter_round_timer) MINUTES
var/roundstart_quit_limit = CONFIG_GET(number/roundstart_suicide_time_limit) MINUTES
if(world.time < roundstart_quit_limit)
penalty += roundstart_quit_limit - world.time
if(penalty + world.realtime - SSshuttle.realtimeofstart > SSshuttle.auto_call + SSshuttle.emergencyCallTime + SSshuttle.emergencyDockTime + SSshuttle.emergencyEscapeTime)
penalty = CANT_REENTER_ROUND
var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst alive you won't be able to re-enter this round [penalty ? "or play ghost roles [penalty == CANT_REENTER_ROUND ? "until the round is over" : "for the next [DisplayTimeText(penalty)]"]" : ""]! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body")
if(response != "Ghost")
return
ghostize(0, penalize = TRUE)
/mob/dead/observer/proc/can_reenter_round(silent = FALSE)
if(reenter_round_timeout != CANT_REENTER_ROUND && reenter_round_timeout <= world.realtime)
return TRUE
if(!silent)
to_chat(src, "<span class='warning'>You are unable to reenter the round[reenter_round_timeout != CANT_REENTER_ROUND ? " yet. Your ghost role blacklist will expire in [DisplayTimeText(reenter_round_timeout - world.realtime)]" : ""].</span>")
return FALSE
/mob/dead/observer/Move(NewLoc, direct)
if(updatedir)
setDir(direct)//only update dir if we actually need it, so overlays won't spin on base sprites that don't have directions of their own
var/oldloc = loc
if(NewLoc)
forceMove(NewLoc)
update_parallax_contents()
else
forceMove(get_turf(src)) //Get out of closets and such as a ghost
if((direct & NORTH) && y < world.maxy)
y++
else if((direct & SOUTH) && y > 1)
y--
if((direct & EAST) && x < world.maxx)
x++
else if((direct & WEST) && x > 1)
x--
Moved(oldloc, direct)
/mob/dead/observer/verb/reenter_corpse()
set category = "Ghost"
set name = "Re-enter Corpse"
if(!client)
return
if(!mind || QDELETED(mind.current))
to_chat(src, "<span class='warning'>You have no body.</span>")
return
if(!can_reenter_corpse)
to_chat(src, "<span class='warning'>You cannot re-enter your body.</span>")
return
if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients
to_chat(usr, "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>")
return
client.change_view(CONFIG_GET(string/default_view))
SStgui.on_transfer(src, mind.current) // Transfer NanoUIs.
transfer_ckey(mind.current, FALSE)
return 1
/mob/dead/observer/proc/notify_cloning(var/message, var/sound, var/atom/source, flashwindow = TRUE)
if(flashwindow)
window_flash(client)
if(message)
to_chat(src, "<span class='ghostalert'>[message]</span>")
if(source)
var/obj/screen/alert/A = throw_alert("[REF(source)]_notify_cloning", /obj/screen/alert/notify_cloning)
if(A)
if(client && client.prefs && client.prefs.UI_style)
A.icon = ui_style2icon(client.prefs.UI_style)
A.desc = message
var/old_layer = source.layer
var/old_plane = source.plane
source.layer = FLOAT_LAYER
source.plane = FLOAT_PLANE
A.add_overlay(source)
source.layer = old_layer
source.plane = old_plane
to_chat(src, "<span class='ghostalert'><a href=?src=[REF(src)];reenter=1>(Click to re-enter)</a></span>")
if(sound)
SEND_SOUND(src, sound(sound))
/mob/dead/observer/proc/dead_tele()
set category = "Ghost"
set name = "Teleport"
set desc= "Teleport to a location"
if(!isobserver(usr))
to_chat(usr, "Not when you're not dead!")
return
var/list/filtered = list()
for(var/V in GLOB.sortedAreas)
var/area/A = V
if(!A.hidden)
filtered += A
var/area/thearea = input("Area to jump to", "BOOYEA") as null|anything in filtered
if(!thearea)
return
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
L+=T
if(!L || !L.len)
to_chat(usr, "No area available.")
return
usr.forceMove(pick(L))
update_parallax_contents()
/mob/dead/observer/proc/view_gas()
set category = "Ghost"
set name = "View Gases"
set desc= "View the atmospheric conditions in a location"
var/turf/loc = get_turf(src)
show_air_status_to(loc, usr)
/mob/dead/observer/verb/follow()
set category = "Ghost"
set name = "Orbit" // "Haunt"
set desc = "Follow and orbit a mob."
var/list/mobs = getpois(skip_mindless=1)
var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs
var/mob/target = mobs[input]
ManualFollow(target)
// This is the ghost's follow verb with an argument
/mob/dead/observer/proc/ManualFollow(atom/movable/target)
if (!istype(target))
return
var/icon/I = icon(target.icon,target.icon_state,target.dir)
var/orbitsize = (I.Width()+I.Height())*0.5
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
var/rot_seg
switch(ghost_orbit)
if(GHOST_ORBIT_TRIANGLE)
rot_seg = 3
if(GHOST_ORBIT_SQUARE)
rot_seg = 4
if(GHOST_ORBIT_PENTAGON)
rot_seg = 5
if(GHOST_ORBIT_HEXAGON)
rot_seg = 6
else //Circular
rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle
orbit(target,orbitsize, FALSE, 20, rot_seg)
/mob/dead/observer/orbit()
setDir(2)//reset dir so the right directional sprites show up
return ..()
/mob/dead/observer/stop_orbit(datum/component/orbiter/orbits)
. = ..()
//restart our floating animation after orbit is done.
pixel_y = 0
animate(src, pixel_y = 2, time = 10, loop = -1)
/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"
set name = "Jump to Mob"
set desc = "Teleport to a mob"
if(isobserver(usr)) //Make sure they're an observer!
var/list/dest = list() //List of possible destinations (mobs)
var/target = null //Chosen target.
dest += getpois(mobs_only=1) //Fill list, prompt user with list
target = input("Please, select a player!", "Jump to Mob", null, null) as null|anything in dest
if (!target)//Make sure we actually have a target
return
else
var/mob/M = dest[target] //Destination mob
var/mob/A = src //Source mob
var/turf/T = get_turf(M) //Turf of the destination mob
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
A.forceMove(T)
A.update_parallax_contents()
else
to_chat(A, "This mob is not located in the game world.")
/mob/dead/observer/verb/change_view_range()
set category = "Ghost"
set name = "View Range"
set desc = "Change your view range."
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
if(client.view == CONFIG_GET(string/default_view))
var/list/views = list()
for(var/i in 7 to max_view)
views |= i
var/new_view = input("Choose your new view", "Modify view range", 7) as null|anything in views
if(new_view)
client.change_view(CLAMP(new_view, 7, max_view))
else
client.change_view(CONFIG_GET(string/default_view))
/mob/dead/observer/verb/add_view_range(input as num)
set name = "Add View Range"
set hidden = TRUE
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
if(input)
client.rescale_view(input, 15, (max_view*2)+1)
/mob/dead/observer/verb/boo()
set category = "Ghost"
set name = "Boo!"
set desc= "Scare your crew members because of boredom!"
if(bootime > world.time)
return
var/obj/machinery/light/L = locate(/obj/machinery/light) in view(1, src)
if(L)
L.flicker()
bootime = world.time + 600
return
//Maybe in the future we can add more <i>spooky</i> code here!
return
/mob/dead/observer/memory()
set hidden = 1
to_chat(src, "<span class='danger'>You are dead! You have no mind to store memory!</span>")
/mob/dead/observer/add_memory()
set hidden = 1
to_chat(src, "<span class='danger'>You are dead! You have no mind to store memory!</span>")
/mob/dead/observer/verb/toggle_ghostsee()
set name = "Toggle Ghost Vision"
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
set category = "Ghost"
ghostvision = !(ghostvision)
update_sight()
to_chat(usr, "You [(ghostvision?"now":"no longer")] have ghost vision.")
/mob/dead/observer/verb/toggle_darkness()
set name = "Toggle Darkness"
set category = "Ghost"
switch(lighting_alpha)
if (LIGHTING_PLANE_ALPHA_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
else
lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
update_sight()
/mob/dead/observer/update_sight()
if(client)
ghost_others = client.prefs.ghost_others //A quick update just in case this setting was changed right before calling the proc
if (!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING
else
see_invisible = SEE_INVISIBLE_OBSERVER
updateghostimages()
..()
/proc/updateallghostimages()
listclearnulls(GLOB.ghost_images_default)
listclearnulls(GLOB.ghost_images_simple)
for (var/mob/dead/observer/O in GLOB.player_list)
O.updateghostimages()
/mob/dead/observer/proc/updateghostimages()
if (!client)
return
if(lastsetting)
switch(lastsetting) //checks the setting we last came from, for a little efficiency so we don't try to delete images from the client that it doesn't have anyway
if(GHOST_OTHERS_DEFAULT_SPRITE)
client.images -= GLOB.ghost_images_default
if(GHOST_OTHERS_SIMPLE)
client.images -= GLOB.ghost_images_simple
lastsetting = client.prefs.ghost_others
if(!ghostvision)
return
if(client.prefs.ghost_others != GHOST_OTHERS_THEIR_SETTING)
switch(client.prefs.ghost_others)
if(GHOST_OTHERS_DEFAULT_SPRITE)
client.images |= (GLOB.ghost_images_default-ghostimage_default)
if(GHOST_OTHERS_SIMPLE)
client.images |= (GLOB.ghost_images_simple-ghostimage_simple)
/mob/dead/observer/verb/possess()
set category = "Ghost"
set name = "Possess!"
set desc= "Take over the body of a mindless creature!"
if(!can_reenter_round())
return FALSE
var/list/possessible = list()
for(var/mob/living/L in GLOB.alive_mob_list)
if(istype(L,/mob/living/carbon/human/dummy) || !get_turf(L)) //Haha no.
continue
if(!(L in GLOB.player_list) && !L.mind)
possessible += L
var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in possessible
if(!target)
return 0
if(ismegafauna(target))
to_chat(src, "<span class='warning'>This creature is too powerful for you to possess!</span>")
return 0
if(istype (target, /mob/living/simple_animal/hostile/spawner))
to_chat(src, "<span class='warning'>This isn't really a creature, now is it!</span>")
return 0
if(can_reenter_corpse && mind && mind.current)
if(alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No")
return 0
if(target.key)
to_chat(src, "<span class='warning'>Someone has taken this body while you were choosing!</span>")
return 0
transfer_ckey(target, FALSE)
target.faction = list("neutral")
return 1
//this is a mob verb instead of atom for performance reasons
//see /mob/verb/examinate() in mob.dm for more info
//overridden here and in /mob/living for different point span classes and sanity checks
/mob/dead/observer/pointed(atom/A as mob|obj|turf in view())
if(!..())
return 0
usr.visible_message("<span class='deadsay'><b>[src]</b> points to [A].</span>")
return 1
/mob/dead/observer/verb/view_manifest()
set name = "View Crew Manifest"
set category = "Ghost"
var/dat
dat += "<h4>Crew Manifest</h4>"
dat += GLOB.data_core.get_manifest()
src << browse(dat, "window=manifest;size=387x420;can_close=1")
//this is called when a ghost is drag clicked to something.
/mob/dead/observer/MouseDrop(atom/over)
if(!usr || !over)
return
if (isobserver(usr) && usr.client.holder && (isliving(over) || iscameramob(over)) )
if (usr.client.holder.cmd_ghost_drag(src,over))
return
return ..()
/mob/dead/observer/Topic(href, href_list)
..()
if(usr == src)
if(href_list["follow"])
var/atom/movable/target = locate(href_list["follow"])
if(istype(target) && (target != src))
ManualFollow(target)
return
if(href_list["x"] && href_list["y"] && href_list["z"])
var/tx = text2num(href_list["x"])
var/ty = text2num(href_list["y"])
var/tz = text2num(href_list["z"])
var/turf/target = locate(tx, ty, tz)
if(istype(target))
forceMove(target)
return
if(href_list["reenter"])
reenter_corpse()
return
//We don't want to update the current var
//But we will still carry a mind.
/mob/dead/observer/mind_initialize()
return
/mob/dead/observer/proc/show_data_huds()
for(var/hudtype in datahuds)
var/datum/atom_hud/H = GLOB.huds[hudtype]
H.add_hud_to(src)
/mob/dead/observer/proc/remove_data_huds()
for(var/hudtype in datahuds)
var/datum/atom_hud/H = GLOB.huds[hudtype]
H.remove_hud_from(src)
/mob/dead/observer/verb/toggle_data_huds()
set name = "Toggle Sec/Med/Diag HUD"
set desc = "Toggles whether you see medical/security/diagnostic HUDs"
set category = "Ghost"
if(data_huds_on) //remove old huds
remove_data_huds()
to_chat(src, "<span class='notice'>Data HUDs disabled.</span>")
data_huds_on = 0
else
show_data_huds()
to_chat(src, "<span class='notice'>Data HUDs enabled.</span>")
data_huds_on = 1
/mob/dead/observer/verb/toggle_health_scan()
set name = "Toggle Health Scan"
set desc = "Toggles whether you health-scan living beings on click"
set category = "Ghost"
if(health_scan) //remove old huds
to_chat(src, "<span class='notice'>Health scan disabled.</span>")
health_scan = FALSE
else
to_chat(src, "<span class='notice'>Health scan enabled.</span>")
health_scan = TRUE
/mob/dead/observer/verb/restore_ghost_appearance()
set name = "Restore Ghost Character"
set desc = "Sets your deadchat name and ghost appearance to your \
roundstart character."
set category = "Ghost"
set_ghost_appearance()
if(client && client.prefs)
deadchat_name = client.prefs.real_name
/mob/dead/observer/proc/set_ghost_appearance()
if((!client) || (!client.prefs))
return
if(client.prefs.be_random_name)
client.prefs.real_name = random_unique_name(gender)
if(client.prefs.be_random_body)
client.prefs.random_character(gender)
if(HAIR in client.prefs.pref_species.species_traits)
hair_style = client.prefs.hair_style
hair_color = brighten_color(client.prefs.hair_color)
if(FACEHAIR in client.prefs.pref_species.species_traits)
facial_hair_style = client.prefs.facial_hair_style
facial_hair_color = brighten_color(client.prefs.facial_hair_color)
update_icon()
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
return IsAdminGhost(usr)
/mob/dead/observer/is_literate()
return 1
/mob/dead/observer/vv_edit_var(var_name, var_value)
. = ..()
switch(var_name)
if("icon")
ghostimage_default.icon = icon
ghostimage_simple.icon = icon
if("icon_state")
ghostimage_default.icon_state = icon_state
ghostimage_simple.icon_state = icon_state
if("fun_verbs")
if(fun_verbs)
verbs += /mob/dead/observer/verb/boo
verbs += /mob/dead/observer/verb/possess
else
verbs -= /mob/dead/observer/verb/boo
verbs -= /mob/dead/observer/verb/possess
/mob/dead/observer/reset_perspective(atom/A)
if(client)
if(ismob(client.eye) && (client.eye != src))
var/mob/target = client.eye
observetarget = null
if(target.observers)
target.observers -= src
UNSETEMPTY(target.observers)
if(..())
if(hud_used)
client.screen = list()
hud_used.show_hud(hud_used.hud_version)
/mob/dead/observer/verb/observe()
set name = "Observe"
set category = "OOC"
var/list/creatures = getpois()
reset_perspective(null)
var/eye_name = null
eye_name = input("Please, select a player!", "Observe", null, null) as null|anything in creatures
if (!eye_name)
return
var/mob/mob_eye = creatures[eye_name]
//Istype so we filter out points of interest that are not mobs
if(client && mob_eye && istype(mob_eye))
client.eye = mob_eye
if(mob_eye.hud_used)
client.screen = list()
LAZYINITLIST(mob_eye.observers)
mob_eye.observers |= src
mob_eye.hud_used.show_hud(mob_eye.hud_used.hud_version, src)
observetarget = mob_eye
/mob/dead/observer/verb/register_pai_candidate()
set category = "Ghost"
set name = "pAI Setup"
set desc = "Upload a fragment of your personality to the global pAI databanks"
register_pai()
/mob/dead/observer/proc/register_pai()
if(isobserver(src))
SSpai.recruitWindow(src)
else
to_chat(usr, "Can't become a pAI candidate while not dead!")
/mob/dead/observer/CtrlShiftClick(mob/user)
if(isobserver(user) && check_rights(R_SPAWN))
change_mob_type( /mob/living/carbon/human , null, null, TRUE) //always delmob, ghosts shouldn't be left lingering
/mob/dead/observer/examine(mob/user)
..()
if(!invisibility)
to_chat(user, "It seems extremely obvious.")
/mob/dead/observer/proc/set_invisibility(value)
invisibility = value
if(!value)
set_light(1, 2)
else
set_light(0, 0)
// Ghosts have no momentum, being massless ectoplasm
/mob/dead/observer/Process_Spacemove(movement_dir)
return 1
/mob/dead/observer/vv_edit_var(var_name, var_value)
. = ..()
if(var_name == "invisibility")
set_invisibility(invisibility) // updates light
/proc/set_observer_default_invisibility(amount, message=null)
for(var/mob/dead/observer/G in GLOB.player_list)
G.set_invisibility(amount)
if(message)
to_chat(G, message)
GLOB.observer_default_invisibility = amount
/mob/dead/observer/proc/open_spawners_menu()
set name = "Spawners Menu"
set desc = "See all currently available spawners"
set category = "Ghost"
if(!spawners_menu)
spawners_menu = new(src)
spawners_menu.ui_interact(src)
#undef CANT_REENTER_ROUND