Bleeding edgy refresh (#303)
* not code stuff * other things * global vars, defines, helpers * onclick hud stuff, orphans, world.dm * controllers and datums * game folder * everything not client/mobs in modules * client folder * stage 1 mob stuff * simple animal things * silicons * carbon things * ayylmaos and monkeys * hyoomahn * icons n shit * sprite fixes * compile fixes * some fixes I cherrypicked. * qdel fixes * forgot brain refractors
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
//Dead mobs can exist whenever. This is needful
|
||||
/mob/dead/New(loc)
|
||||
..()
|
||||
if(!initialized)
|
||||
args[1] = FALSE
|
||||
Initialize(arglist(args)) //EXIST DAMN YOU!!!
|
||||
|
||||
/mob/dead/dust() //ghosts can't be vaporised.
|
||||
return
|
||||
|
||||
/mob/dead/gib() //ghosts can't be gibbed.
|
||||
return
|
||||
@@ -0,0 +1,32 @@
|
||||
/mob/dead/new_player/Login()
|
||||
if(!mind)
|
||||
mind = new /datum/mind(key)
|
||||
mind.active = 1
|
||||
mind.current = src
|
||||
|
||||
..()
|
||||
|
||||
if(join_motd)
|
||||
to_chat(src, "<div class=\"motd\">[join_motd]</div>")
|
||||
|
||||
if(admin_notice)
|
||||
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [admin_notice]</span>")
|
||||
|
||||
if(config.soft_popcap && living_player_count() >= config.soft_popcap)
|
||||
to_chat(src, "<span class='notice'><b>Server Notice:</b>\n \t [config.soft_popcap_message]</span>")
|
||||
|
||||
sight |= SEE_TURFS
|
||||
|
||||
/*
|
||||
var/list/watch_locations = list()
|
||||
for(var/obj/effect/landmark/landmark in landmarks_list)
|
||||
if(landmark.tag == "landmark*new_player")
|
||||
watch_locations += landmark.loc
|
||||
|
||||
if(watch_locations.len>0)
|
||||
loc = pick(watch_locations)
|
||||
*/
|
||||
new_player_panel()
|
||||
client.playtitlemusic()
|
||||
if(ticker.current_state < GAME_STATE_SETTING_UP)
|
||||
to_chat(src, "Please set up your character and select \"Ready\". The game will start in about [round(ticker.GetTimeLeft(), 1)/10] seconds.")
|
||||
@@ -0,0 +1,7 @@
|
||||
/mob/dead/new_player/Logout()
|
||||
ready = 0
|
||||
..()
|
||||
if(!spawning)//Here so that if they are spawning and log out, the other procs can play out and they will have a mob to come back to.
|
||||
key = null//We null their key before deleting the mob, so they are properly kicked out.
|
||||
qdel(src)
|
||||
return
|
||||
@@ -0,0 +1,493 @@
|
||||
|
||||
|
||||
/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 = NONE
|
||||
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
density = 0
|
||||
stat = DEAD
|
||||
canmove = 0
|
||||
|
||||
anchored = 1 // don't get pushed around
|
||||
var/mob/living/new_character //for instant transfer once the round is set up
|
||||
|
||||
/mob/dead/new_player/Initialize()
|
||||
if(initialized)
|
||||
stack_trace("Warning: [src]([type]) initialized multiple times!")
|
||||
initialized = TRUE
|
||||
tag = "mob_[next_mob_id++]"
|
||||
mob_list += src
|
||||
|
||||
if(client && ticker.state == GAME_STATE_STARTUP)
|
||||
var/obj/screen/splash/S = new(client, TRUE, TRUE)
|
||||
S.Fade(TRUE)
|
||||
|
||||
if(length(newplayer_start))
|
||||
loc = pick(newplayer_start)
|
||||
else
|
||||
loc = locate(1,1,1)
|
||||
|
||||
/mob/dead/new_player/proc/new_player_panel()
|
||||
|
||||
var/output = "<center><p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
|
||||
|
||||
if(!ticker || ticker.current_state <= GAME_STATE_PREGAME)
|
||||
if(ready)
|
||||
output += "<p>\[ <b>Ready</b> | <a href='byond://?src=\ref[src];ready=0'>Not Ready</a> \]</p>"
|
||||
else
|
||||
output += "<p>\[ <a href='byond://?src=\ref[src];ready=1'>Ready</a> | <b>Not Ready</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><a href='byond://?src=\ref[src];observe=1'>Observe</A></p>"
|
||||
|
||||
if(!IsGuestKey(src.key))
|
||||
if (dbcon.Connect())
|
||||
var/isadmin = 0
|
||||
if(src.client && src.client.holder)
|
||||
isadmin = 1
|
||||
var/DBQuery/query_get_new_polls = dbcon.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 = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
|
||||
if(!query_get_new_polls.Execute())
|
||||
return
|
||||
var/newpoll = 0
|
||||
if(query_get_new_polls.NextRow())
|
||||
newpoll = 1
|
||||
|
||||
if(newpoll)
|
||||
output += "<p><b><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A> (NEW!)</b></p>"
|
||||
else
|
||||
output += "<p><a href='byond://?src=\ref[src];showpoll=1'>Show Player Polls</A></p>"
|
||||
|
||||
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>", 220, 265)
|
||||
popup.set_window_options("can_close=0")
|
||||
popup.set_content(output)
|
||||
popup.open(0)
|
||||
return
|
||||
|
||||
/mob/dead/new_player/Stat()
|
||||
..()
|
||||
|
||||
if(statpanel("Lobby"))
|
||||
stat("Game Mode:", (ticker.hide_mode) ? "Secret" : "[master_mode]")
|
||||
stat("Map:", SSmapping.config.map_name)
|
||||
|
||||
if(ticker.current_state == GAME_STATE_PREGAME)
|
||||
var/time_remaining = ticker.GetTimeLeft()
|
||||
if(time_remaining >= 0)
|
||||
time_remaining /= 10
|
||||
stat("Time To Start:", (time_remaining >= 0) ? "[round(time_remaining)]s" : "DELAYED")
|
||||
|
||||
stat("Players:", "[ticker.totalPlayers]")
|
||||
if(client.holder)
|
||||
stat("Players Ready:", "[ticker.totalPlayersReady]")
|
||||
|
||||
|
||||
/mob/dead/new_player/Topic(href, href_list[])
|
||||
if(src != usr)
|
||||
return 0
|
||||
|
||||
if(!client)
|
||||
return 0
|
||||
|
||||
//Determines Relevent Population Cap
|
||||
var/relevant_cap
|
||||
if(config.hard_popcap && config.extreme_popcap)
|
||||
relevant_cap = min(config.hard_popcap, config.extreme_popcap)
|
||||
else
|
||||
relevant_cap = max(config.hard_popcap, config.extreme_popcap)
|
||||
|
||||
if(href_list["show_preferences"])
|
||||
client.prefs.ShowChoices(src)
|
||||
return 1
|
||||
|
||||
if(href_list["ready"])
|
||||
if(!ticker || ticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started
|
||||
ready = text2num(href_list["ready"])
|
||||
|
||||
if(href_list["refresh"])
|
||||
src << browse(null, "window=playersetup") //closes the player setup window
|
||||
new_player_panel()
|
||||
|
||||
if(href_list["observe"])
|
||||
|
||||
if(alert(src,"Are you sure you wish to observe? You will not be able to play this round!","Player Setup","Yes","No") == "Yes")
|
||||
if(!client)
|
||||
return 1
|
||||
var/mob/dead/observer/observer = new()
|
||||
|
||||
spawning = 1
|
||||
|
||||
observer.started_as_observer = 1
|
||||
close_spawn_windows()
|
||||
var/obj/O = locate("landmark*Observer-Start")
|
||||
to_chat(src, "<span class='notice'>Now teleporting.</span>")
|
||||
if (O)
|
||||
observer.loc = O.loc
|
||||
else
|
||||
to_chat(src, "<span class='notice'>Teleporting failed. The map is probably still loading...</span>")
|
||||
observer.key = key
|
||||
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.stopLobbySound()
|
||||
qdel(mind)
|
||||
|
||||
qdel(src)
|
||||
return 1
|
||||
|
||||
if(href_list["late_join"])
|
||||
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
|
||||
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(ticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in admin_datums)))
|
||||
to_chat(usr, "<span class='danger'>[config.hard_popcap_message]</span>")
|
||||
|
||||
var/queue_position = ticker.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
|
||||
ticker.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 [ticker.queued_players.len].</span>")
|
||||
return
|
||||
LateChoices()
|
||||
|
||||
if(href_list["manifest"])
|
||||
ViewManifest()
|
||||
|
||||
if(href_list["SelectedJob"])
|
||||
|
||||
if(!enter_allowed)
|
||||
to_chat(usr, "<span class='notice'>There is an administrative lock on entering the game!</span>")
|
||||
return
|
||||
|
||||
if(ticker.queued_players.len && !(ckey(key) in admin_datums))
|
||||
if((living_player_count() >= relevant_cap) || (src != ticker.queued_players[1]))
|
||||
to_chat(usr, "<span class='warning'>Server is full.</span>")
|
||||
return
|
||||
|
||||
AttemptLateSpawn(href_list["SelectedJob"])
|
||||
return
|
||||
|
||||
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>")
|
||||
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>")
|
||||
|
||||
/mob/dead/new_player/proc/IsJobAvailable(rank)
|
||||
var/datum/job/job = SSjob.GetJob(rank)
|
||||
if(!job)
|
||||
return 0
|
||||
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 1
|
||||
for(var/datum/job/J in SSjob.occupations)
|
||||
if(J && J.current_positions < J.total_positions && J.title != job.title)
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
if(jobban_isbanned(src,rank))
|
||||
return 0
|
||||
if(!job.player_old_enough(src.client))
|
||||
return 0
|
||||
if(config.enforce_human_authority && !client.prefs.pref_species.qualifies_for_rank(rank, client.prefs.features))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/mob/dead/new_player/proc/AttemptLateSpawn(rank)
|
||||
if(!IsJobAvailable(rank))
|
||||
alert(src, "[rank] is not available. Please try another.")
|
||||
return 0
|
||||
|
||||
if(ticker.late_join_disabled)
|
||||
alert(src, "An administrator has disabled late join spawning.")
|
||||
return FALSE
|
||||
|
||||
if(SSshuttle.arrivals)
|
||||
close_spawn_windows() //In case we get held up
|
||||
if(SSshuttle.arrivals.damaged && config.arrivals_shuttle_require_safe_latejoin)
|
||||
src << alert("The arrivals shuttle is currently malfunctioning! You cannot join.")
|
||||
return FALSE
|
||||
|
||||
//Remove the player from the join queue if he was in one and reset the timer
|
||||
ticker.queued_players -= src
|
||||
ticker.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, 1)
|
||||
if(isliving(equip)) //Borgs get borged in the equip, so we need to make sure we handle the new mob.
|
||||
character = equip
|
||||
|
||||
var/D
|
||||
if(latejoin.len)
|
||||
D = get_turf(pick(latejoin))
|
||||
if(!D)
|
||||
for(var/turf/T in get_area_turfs(/area/shuttle/arrival))
|
||||
if(!T.density)
|
||||
var/clear = 1
|
||||
for(var/obj/O in T)
|
||||
if(O.density)
|
||||
clear = 0
|
||||
break
|
||||
if(clear)
|
||||
D = T
|
||||
continue
|
||||
|
||||
character.loc = D
|
||||
character.update_parallax_teleport()
|
||||
|
||||
var/atom/movable/chair = locate(/obj/structure/chair) in character.loc
|
||||
if(chair)
|
||||
chair.buckle_mob(character)
|
||||
|
||||
ticker.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
|
||||
data_core.manifest_inject(humanc)
|
||||
if(SSshuttle.arrivals)
|
||||
SSshuttle.arrivals.QueueAnnounce(humanc, rank)
|
||||
else
|
||||
AnnounceArrival(humanc, rank)
|
||||
AddEmploymentContract(humanc)
|
||||
if(highlander)
|
||||
to_chat(humanc, "<span class='userdanger'><i>THERE CAN BE ONLY ONE!!!</i></span>")
|
||||
humanc.make_scottish()
|
||||
|
||||
joined_player_list += character.ckey
|
||||
|
||||
if(config.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)
|
||||
ticker.mode.make_antag_chance(humanc)
|
||||
if(SHUTTLE_CALL)
|
||||
if(SSshuttle.emergency.timeLeft(1) > initial(SSshuttle.emergencyCallTime)*0.5)
|
||||
ticker.mode.make_antag_chance(humanc)
|
||||
qdel(src)
|
||||
|
||||
/mob/dead/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee)
|
||||
//TODO: figure out a way to exclude wizards/nukeops/demons from this.
|
||||
sleep(30)
|
||||
for(var/C in employmentCabinets)
|
||||
var/obj/structure/filingcabinet/employment/employmentCabinet = C
|
||||
if(!employmentCabinet.virgin)
|
||||
employmentCabinet.addFile(employee)
|
||||
|
||||
|
||||
/mob/dead/new_player/proc/LateChoices()
|
||||
var/mills = world.time - round_start_time // 1/10 of a second, not real milliseconds but whatever
|
||||
//var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something
|
||||
var/mins = (mills % 36000) / 600
|
||||
var/hours = mills / 36000
|
||||
|
||||
var/dat = "<div class='notice'>Round Duration: [round(hours)]h [round(mins)]m</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>"
|
||||
|
||||
var/available_job_count = 0
|
||||
for(var/datum/job/job in SSjob.occupations)
|
||||
if(job && IsJobAvailable(job.title))
|
||||
available_job_count++;
|
||||
|
||||
if(length(SSjob.prioritized_jobs))
|
||||
dat += "<div class='notice red'>The station has flagged these jobs as high priority:<br>"
|
||||
var/amt = length(SSjob.prioritized_jobs)
|
||||
var/amt_count
|
||||
for(var/datum/job/a in SSjob.prioritized_jobs)
|
||||
amt_count++
|
||||
if(amt_count != amt) // checks for the last job added.
|
||||
dat += " [a.title], "
|
||||
else
|
||||
dat += " [a.title]. </div>"
|
||||
|
||||
dat += "<div class='clearBoth'>Choose from the following open positions:</div><br>"
|
||||
dat += "<div class='jobs'><div class='jobsColumn'>"
|
||||
var/job_count = 0
|
||||
for(var/datum/job/job in SSjob.occupations)
|
||||
if(job && IsJobAvailable(job.title))
|
||||
job_count++;
|
||||
if (job_count > round(available_job_count / 2))
|
||||
dat += "</div><div class='jobsColumn'>"
|
||||
var/position_class = "otherPosition"
|
||||
if (job.title in command_positions)
|
||||
position_class = "commandPosition"
|
||||
dat += "<a class='[position_class]' href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a><br>"
|
||||
if(!job_count) //if there's nowhere to go, assistant opens up.
|
||||
for(var/datum/job/job in SSjob.occupations)
|
||||
if(job.title != "Assistant") continue
|
||||
dat += "<a class='otherPosition' href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a><br>"
|
||||
break
|
||||
dat += "</div></div>"
|
||||
|
||||
// Removing the old window method but leaving it here for reference
|
||||
//src << browse(dat, "window=latechoices;size=300x640;can_close=1")
|
||||
|
||||
// Added the new browser window method
|
||||
var/datum/browser/popup = new(src, "latechoices", "Choose Profession", 440, 500)
|
||||
popup.add_stylesheet("playeroptions", 'html/browser/playeroptions.css')
|
||||
popup.set_content(dat)
|
||||
popup.open(0) // 0 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)
|
||||
|
||||
if(config.force_random_names || jobban_isbanned(src, "appearance"))
|
||||
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)
|
||||
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.stopLobbySound()
|
||||
|
||||
/mob/dead/new_player/proc/ViewManifest()
|
||||
var/dat = "<html><body>"
|
||||
dat += "<h4>Crew Manifest</h4>"
|
||||
dat += 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
|
||||
@@ -0,0 +1,550 @@
|
||||
/datum/polloption
|
||||
var/optionid
|
||||
var/optiontext
|
||||
|
||||
/mob/dead/new_player/proc/handle_player_polling()
|
||||
if(!dbcon.IsConnected())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/DBQuery/query_poll_get = dbcon.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())
|
||||
return
|
||||
var/output = "<div align='center'><B>Player polls</B><hr><table>"
|
||||
var/i = 0
|
||||
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=\ref[src];pollid=[pollid]\"><b>[pollquestion]</b></a></td></tr>"
|
||||
i++
|
||||
output += "</table>"
|
||||
src << browse(output,"window=playerpolllist;size=500x300")
|
||||
|
||||
/mob/dead/new_player/proc/poll_player(pollid)
|
||||
if(!pollid)
|
||||
return
|
||||
if (!dbcon.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/DBQuery/query_poll_get_details = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
|
||||
if(!query_poll_get_details.warn_execute())
|
||||
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])
|
||||
switch(polltype)
|
||||
if(POLLTYPE_OPTION)
|
||||
var/DBQuery/query_option_get_votes = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_option_get_votes.warn_execute())
|
||||
return
|
||||
var/votedoptionid = 0
|
||||
if(query_option_get_votes.NextRow())
|
||||
votedoptionid = text2num(query_option_get_votes.item[1])
|
||||
var/list/datum/polloption/options = list()
|
||||
var/DBQuery/query_option_options = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if(!query_option_options.warn_execute())
|
||||
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
|
||||
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/DBQuery/query_text_get_votes = dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_text_get_votes.warn_execute())
|
||||
return
|
||||
var/vote_text = ""
|
||||
if(query_text_get_votes.NextRow())
|
||||
vote_text = query_text_get_votes.item[1]
|
||||
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>"
|
||||
if(!vote_text)
|
||||
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'></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>"
|
||||
else
|
||||
vote_text = replacetext(vote_text, "\n", "<br>")
|
||||
output += "[vote_text]"
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
if(POLLTYPE_RATING)
|
||||
var/DBQuery/query_rating_get_votes = dbcon.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())
|
||||
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>"
|
||||
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/DBQuery/query_rating_options = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if(!query_rating_options.warn_execute())
|
||||
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>"
|
||||
output += "<input type='hidden' name='minid' value='[minid]'>"
|
||||
output += "<input type='hidden' name='maxid' value='[maxid]'>"
|
||||
output += "<p><input type='submit' value='Submit'></form>"
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
if(POLLTYPE_MULTI)
|
||||
var/DBQuery/query_multi_get_votes = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_multi_get_votes.warn_execute())
|
||||
return
|
||||
var/list/votedfor = list()
|
||||
while(query_multi_get_votes.NextRow())
|
||||
votedfor.Add(text2num(query_multi_get_votes.item[1]))
|
||||
var/list/datum/polloption/options = list()
|
||||
var/maxoptionid = 0
|
||||
var/minoptionid = 0
|
||||
var/DBQuery/query_multi_options = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if(!query_multi_options.warn_execute())
|
||||
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
|
||||
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/simple/IRV)
|
||||
irv_assets.send(src)
|
||||
|
||||
var/DBQuery/query_irv_get_votes = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_irv_get_votes.warn_execute())
|
||||
return
|
||||
|
||||
var/list/votedfor = list()
|
||||
while(query_irv_get_votes.NextRow())
|
||||
votedfor.Add(text2num(query_irv_get_votes.item[1]))
|
||||
|
||||
var/list/datum/polloption/options = list()
|
||||
|
||||
var/DBQuery/query_irv_options = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if(!query_irv_options.warn_execute())
|
||||
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
|
||||
|
||||
//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-1.10.2.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
|
||||
|
||||
/mob/dead/new_player/proc/poll_check_voted(pollid, text = FALSE)
|
||||
var/table = "poll_vote"
|
||||
if (text)
|
||||
table = "poll_textreply"
|
||||
if (!dbcon.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/DBQuery/query_hasvoted = dbcon.NewQuery("SELECT id FROM `[format_table_name(table)]` WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_hasvoted.warn_execute())
|
||||
return
|
||||
if(query_hasvoted.NextRow())
|
||||
to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
|
||||
return
|
||||
. = "Player"
|
||||
if(client.holder)
|
||||
. = client.holder.rank.name
|
||||
return .
|
||||
|
||||
|
||||
/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 [ckey]")
|
||||
message_admins("[key_name_admin(usr)] attempted to rig the vote by voting as [ckey]")
|
||||
to_chat(usr, "<span class='danger'>You don't seem to be [ckey].</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 (!dbcon.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/DBQuery/query_validate_poll = dbcon.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())
|
||||
return 0
|
||||
if (!query_validate_poll.NextRow())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/dead/new_player/proc/vote_on_irv_poll(pollid, list/votelist)
|
||||
if (!dbcon.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/DBQuery/query_irv_id = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
if(!query_irv_id.warn_execute())
|
||||
return 0
|
||||
var/list/optionlist = list()
|
||||
while (query_irv_id.NextRow())
|
||||
optionlist += text2num(query_irv_id.item[1])
|
||||
|
||||
//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 a 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/DBQuery/query_irv_del_old = dbcon.NewQuery("DELETE FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_irv_del_old.warn_execute())
|
||||
return 0
|
||||
|
||||
//now to add the new ones.
|
||||
var/DBQuery/query_irv_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES [sqlrowlist]")
|
||||
if(!query_irv_vote.warn_execute())
|
||||
return 0
|
||||
src << browse(null,"window=playerpoll")
|
||||
return 1
|
||||
|
||||
|
||||
/mob/dead/new_player/proc/vote_on_poll(pollid, optionid)
|
||||
if (!dbcon.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/adminrank = sanitizeSQL(poll_check_voted(pollid))
|
||||
if(!adminrank)
|
||||
return
|
||||
var/DBQuery/query_option_vote = dbcon.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())
|
||||
return
|
||||
usr << browse(null,"window=playerpoll")
|
||||
return 1
|
||||
|
||||
/mob/dead/new_player/proc/log_text_poll_reply(pollid, replytext)
|
||||
if (!dbcon.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/adminrank = sanitizeSQL(poll_check_voted(pollid, TRUE))
|
||||
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/DBQuery/query_text_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')")
|
||||
if(!query_text_vote.warn_execute())
|
||||
return
|
||||
usr << browse(null,"window=playerpoll")
|
||||
return 1
|
||||
|
||||
/mob/dead/new_player/proc/vote_on_numval_poll(pollid, optionid, rating)
|
||||
if (!dbcon.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/DBQuery/query_numval_hasvoted = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'")
|
||||
if(!query_numval_hasvoted.warn_execute())
|
||||
return
|
||||
if(query_numval_hasvoted.NextRow())
|
||||
to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
|
||||
return
|
||||
var/adminrank = "Player"
|
||||
if(client.holder)
|
||||
adminrank = client.holder.rank.name
|
||||
adminrank = sanitizeSQL(adminrank)
|
||||
var/DBQuery/query_numval_vote = dbcon.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())
|
||||
return
|
||||
usr << browse(null,"window=playerpoll")
|
||||
return 1
|
||||
|
||||
/mob/dead/new_player/proc/vote_on_multi_poll(pollid, optionid)
|
||||
if (!dbcon.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/DBQuery/query_multi_choicelen = dbcon.NewQuery("SELECT multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]")
|
||||
if(!query_multi_choicelen.warn_execute())
|
||||
return 1
|
||||
var/i
|
||||
if(query_multi_choicelen.NextRow())
|
||||
i = text2num(query_multi_choicelen.item[1])
|
||||
var/DBQuery/query_multi_hasvoted = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_multi_hasvoted.warn_execute())
|
||||
return 1
|
||||
while(i)
|
||||
if(query_multi_hasvoted.NextRow())
|
||||
i--
|
||||
else
|
||||
break
|
||||
if(!i)
|
||||
return 2
|
||||
var/adminrank = "Player"
|
||||
if(client.holder)
|
||||
adminrank = client.holder.rank.name
|
||||
adminrank = sanitizeSQL(adminrank)
|
||||
var/DBQuery/query_multi_vote = dbcon.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())
|
||||
return 1
|
||||
usr << browse(null,"window=playerpoll")
|
||||
return 0
|
||||
@@ -0,0 +1,85 @@
|
||||
|
||||
//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)
|
||||
undershirt = random_undershirt(gender)
|
||||
socks = random_socks()
|
||||
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()
|
||||
if(!pref_species)
|
||||
var/rando_race = pick(config.roundstart_races)
|
||||
pref_species = new rando_race()
|
||||
features = random_features()
|
||||
age = rand(AGE_MIN,AGE_MAX)
|
||||
|
||||
/datum/preferences/proc/update_preview_icon()
|
||||
// Silicons only need a very basic preview since there is no customization for them.
|
||||
if(job_engsec_high)
|
||||
switch(job_engsec_high)
|
||||
if(AI)
|
||||
preview_icon = icon('icons/mob/AI.dmi', "AI", SOUTH)
|
||||
preview_icon.Scale(64, 64)
|
||||
return
|
||||
if(CYBORG)
|
||||
preview_icon = icon('icons/mob/robots.dmi', "robot", SOUTH)
|
||||
preview_icon.Scale(64, 64)
|
||||
return
|
||||
|
||||
// Set up the dummy for its photoshoot
|
||||
var/mob/living/carbon/human/dummy/mannequin = new()
|
||||
copy_to(mannequin)
|
||||
|
||||
// Determine what job is marked as 'High' priority, and dress them up as such.
|
||||
var/datum/job/previewJob
|
||||
var/highRankFlag = job_civilian_high | job_medsci_high | job_engsec_high
|
||||
|
||||
if(job_civilian_low & ASSISTANT)
|
||||
previewJob = SSjob.GetJob("Assistant")
|
||||
else if(highRankFlag)
|
||||
var/highDeptFlag
|
||||
if(job_civilian_high)
|
||||
highDeptFlag = CIVILIAN
|
||||
else if(job_medsci_high)
|
||||
highDeptFlag = MEDSCI
|
||||
else if(job_engsec_high)
|
||||
highDeptFlag = ENGSEC
|
||||
|
||||
for(var/datum/job/job in SSjob.occupations)
|
||||
if(job.flag == highRankFlag && job.department_flag == highDeptFlag)
|
||||
previewJob = job
|
||||
break
|
||||
|
||||
if(previewJob)
|
||||
mannequin.job = previewJob.title
|
||||
previewJob.equip(mannequin, TRUE)
|
||||
CHECK_TICK
|
||||
preview_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||
preview_icon.Scale(48+32, 16+32)
|
||||
CHECK_TICK
|
||||
mannequin.setDir(NORTH)
|
||||
|
||||
var/icon/stamp = getFlatIcon(mannequin)
|
||||
CHECK_TICK
|
||||
preview_icon.Blend(stamp, ICON_OVERLAY, 25, 17)
|
||||
CHECK_TICK
|
||||
mannequin.setDir(WEST)
|
||||
stamp = getFlatIcon(mannequin)
|
||||
CHECK_TICK
|
||||
preview_icon.Blend(stamp, ICON_OVERLAY, 1, 9)
|
||||
CHECK_TICK
|
||||
mannequin.setDir(SOUTH)
|
||||
stamp = getFlatIcon(mannequin)
|
||||
CHECK_TICK
|
||||
preview_icon.Blend(stamp, ICON_OVERLAY, 49, 1)
|
||||
CHECK_TICK
|
||||
preview_icon.Scale(preview_icon.Width() * 2, preview_icon.Height() * 2) // Scaling here to prevent blurring in the browser.
|
||||
CHECK_TICK
|
||||
qdel(mannequin)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,636 @@
|
||||
/datum/sprite_accessory
|
||||
var/extra = 0
|
||||
var/extra_icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
var/extra_color_src = MUTCOLORS2 //The color source for the extra overlay.
|
||||
var/extra2 = 0
|
||||
var/extra2_icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
var/extra2_color_src = MUTCOLORS3
|
||||
// var/list/ckeys_allowed = null
|
||||
|
||||
/* tbi eventually idk
|
||||
/datum/sprite_accessory/legs/digitigrade_mam
|
||||
name = "Anthro Digitigrade Legs"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
*/
|
||||
|
||||
/datum/sprite_accessory/tails/lizard/none
|
||||
name = "None"
|
||||
icon_state = "None"
|
||||
|
||||
/datum/sprite_accessory/tails_animated/lizard/none
|
||||
name = "None"
|
||||
icon_state = "None"
|
||||
|
||||
/******************************************
|
||||
************ Human Ears/Tails *************
|
||||
*******************************************/
|
||||
|
||||
/datum/sprite_accessory/ears/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
hasinner = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/ears/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
hasinner = 1
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/tails/human/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/catbig
|
||||
name = "Cat, Big"
|
||||
icon_state = "catbig"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/catbig
|
||||
name = "Cat, Big"
|
||||
icon_state = "catbig"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/ears/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "fennec"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "fennec"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "fennec"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/ears/lab
|
||||
name = "Dog, Floppy"
|
||||
icon_state = "lab"
|
||||
hasinner = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/ears/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/shark
|
||||
name = "Shark"
|
||||
icon_state = "shark"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/shark/datashark
|
||||
name = "datashark"
|
||||
icon_state = "datashark"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/ailurus
|
||||
name = "ailurus"
|
||||
icon_state = "ailurus"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/ears/squirrel
|
||||
name = "Squirrel"
|
||||
icon_state = "squirrel"
|
||||
hasinner= 1
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails/human/squirrel
|
||||
name = "Squirrel"
|
||||
icon_state = "squirrel"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
/datum/sprite_accessory/tails_animated/human/squirrel
|
||||
name = "Squirrel"
|
||||
icon_state = "squirrel"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
|
||||
/******************************************
|
||||
*************** Body Parts ****************
|
||||
*******************************************/
|
||||
|
||||
/datum/sprite_accessory/mam_ears
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
/datum/sprite_accessory/mam_ears/none
|
||||
name = "None"
|
||||
|
||||
/datum/sprite_accessory/mam_tails
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
/datum/sprite_accessory/mam_tails/none
|
||||
name = "None"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
/datum/sprite_accessory/mam_tails_animated/none
|
||||
name = "None"
|
||||
|
||||
/******************************************
|
||||
**************** Snouts *******************
|
||||
*******************************************/
|
||||
|
||||
/datum/sprite_accessory/snouts/lcanid
|
||||
name = "Fox, Long"
|
||||
icon_state = "lcanid"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/snouts/scanid
|
||||
name = "Fox, Short"
|
||||
icon_state = "scanid"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/snouts/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/snouts/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/snouts/otie
|
||||
name = "Otie"
|
||||
icon_state = "otie"
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/******************************************
|
||||
************ Actual Species ***************
|
||||
*******************************************/
|
||||
//Cat, Big
|
||||
/datum/sprite_accessory/mam_ears/catbig
|
||||
name = "Cat, Big"
|
||||
icon_state = "cat"
|
||||
hasinner = 1
|
||||
icon = 'icons/mob/mutant_bodyparts.dmi'
|
||||
|
||||
/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"
|
||||
|
||||
//Wolf
|
||||
/datum/sprite_accessory/mam_ears/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
hasinner = 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
|
||||
//Fox
|
||||
/datum/sprite_accessory/mam_ears/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
hasinner = 0
|
||||
|
||||
/datum/sprite_accessory/mam_tails/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
extra = 1
|
||||
extra_color_src = MUTCOLORS2
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
extra = 1
|
||||
extra_color_src = MUTCOLORS2
|
||||
|
||||
//Fennec
|
||||
/datum/sprite_accessory/mam_ears/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "fennec"
|
||||
hasinner = 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "fennec"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "fennec"
|
||||
|
||||
//Lab
|
||||
/datum/sprite_accessory/mam_ears/lab
|
||||
name = "Dog, Long"
|
||||
icon_state = "lab"
|
||||
|
||||
/datum/sprite_accessory/mam_tails/lab
|
||||
name = "Lab"
|
||||
icon_state = "lab"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/lab
|
||||
name = "Lab"
|
||||
icon_state = "lab"
|
||||
|
||||
//Husky
|
||||
/datum/sprite_accessory/mam_ears/husky
|
||||
name = "Husky"
|
||||
icon_state = "wolf"
|
||||
hasinner = 1
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
extra = 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
extra = 1
|
||||
|
||||
//Murid
|
||||
/datum/sprite_accessory/mam_ears/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
|
||||
/datum/sprite_accessory/mam_tails/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
color_src = 0
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/murid
|
||||
name = "Murid"
|
||||
icon_state = "murid"
|
||||
color_src = 0
|
||||
|
||||
//Shark
|
||||
/datum/sprite_accessory/mam_tails/shark
|
||||
name = "Shark"
|
||||
icon_state = "shark"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
|
||||
|
||||
/datum/sprite_accessory/mam_tails/shark/datashark
|
||||
name = "DataShark"
|
||||
icon_state = "datashark"
|
||||
color_src = 0
|
||||
icon = 'icons/mob/mam_bodyparts.dmi'
|
||||
// ckeys_allowed = list("rubyflamewing")
|
||||
|
||||
|
||||
//Squirrel
|
||||
/datum/sprite_accessory/mam_ears/squirrel
|
||||
name = "Squirrel"
|
||||
icon_state = "squirrel"
|
||||
hasinner= 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails/squirrel
|
||||
name = "Squirrel"
|
||||
icon_state = "squirrel"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/squirrel
|
||||
name = "Squirrel"
|
||||
icon_state = "squirrel"
|
||||
|
||||
// Wah
|
||||
|
||||
/datum/sprite_accessory/mam_tails/ailurus
|
||||
name = "Ailurus"
|
||||
icon_state = "ailurus"
|
||||
extra = 1
|
||||
extra_color_src = MUTCOLORS2
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/ailurus
|
||||
name = "Ailurus"
|
||||
icon_state = "ailurus"
|
||||
extra = 1
|
||||
extra_color_src = MUTCOLORS2
|
||||
|
||||
// Hawk
|
||||
|
||||
/datum/sprite_accessory/mam_tails/hawk
|
||||
name = "Hawk"
|
||||
icon_state = "hawk"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/hawk
|
||||
name = "Hawk"
|
||||
icon_state = "hawk"
|
||||
|
||||
//Otusian
|
||||
/datum/sprite_accessory/mam_ears/otie
|
||||
name = "Otusian"
|
||||
icon_state = "otie"
|
||||
hasinner= 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails/otie
|
||||
name = "Otusian"
|
||||
icon_state = "otie"
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/otie
|
||||
name = "Otusian"
|
||||
icon_state = "otie"
|
||||
|
||||
// G Shepherd
|
||||
/datum/sprite_accessory/mam_tails/shepherd
|
||||
name = "Shepherd"
|
||||
icon_state = "shepherd"
|
||||
extra = 1
|
||||
extra2 = 1
|
||||
|
||||
/datum/sprite_accessory/mam_tails_animated/shepherd
|
||||
name = "Shepherd"
|
||||
icon_state = "shepherd"
|
||||
extra = 1
|
||||
extra2 = 1
|
||||
|
||||
|
||||
/******************************************
|
||||
************ Body Markings ****************
|
||||
*******************************************/
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings
|
||||
extra = 1
|
||||
extra2 = 1
|
||||
icon = 'icons/mob/special/mam_body_markings.dmi'
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/none
|
||||
name = "None"
|
||||
icon_state = "none"
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/belly
|
||||
name = "Belly"
|
||||
icon_state = "belly"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/ailurus
|
||||
name = "Red Panda"
|
||||
icon_state = "ailurus"
|
||||
extra_color_src = MUTCOLORS2
|
||||
extra2_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
color_src = MUTCOLORS2
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/otie
|
||||
name = "Otie"
|
||||
icon_state = "otie"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/cow
|
||||
name = "Cow"
|
||||
icon_state = "cow"
|
||||
color_src = MUTCOLORS2
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/fennec
|
||||
name = "Fennec"
|
||||
icon_state = "Fennec"
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/corvid
|
||||
name = "Crow"
|
||||
icon_state = "corvid"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/hawk
|
||||
name = "Hawk"
|
||||
icon_state = "hawk"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/tiger
|
||||
name = "Tiger Stripes"
|
||||
color_src = MUTCOLORS3
|
||||
icon_state = "tiger"
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
color_src = MUTCOLORS2
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/shepherd
|
||||
name = "Shepherd"
|
||||
icon_state = "shepherd"
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/corgi
|
||||
name = "Corgi"
|
||||
icon_state = "corgi"
|
||||
color_src = MUTCOLORS2
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/moth
|
||||
name = "Moth"
|
||||
icon_state = "moth"
|
||||
color_src = MUTCOLORS2
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/datum/sprite_accessory/mam_body_markings/shark
|
||||
name = "Shark"
|
||||
icon_state = "shark"
|
||||
color_src = MUTCOLORS2
|
||||
extra_color_src = MUTCOLORS3
|
||||
gender_specific = 1
|
||||
|
||||
/******************************************
|
||||
************ Taur Bodies ******************
|
||||
*******************************************/
|
||||
/datum/sprite_accessory/taur
|
||||
icon = 'icons/mob/special/mam_taur.dmi'
|
||||
extra_icon = 'icons/mob/special/mam_taur.dmi'
|
||||
extra = 1
|
||||
extra2_icon = 'icons/mob/special/mam_taur.dmi'
|
||||
extra2 = 1
|
||||
center = TRUE
|
||||
dimension_x = 64
|
||||
|
||||
/datum/sprite_accessory/taur/none
|
||||
name = "None"
|
||||
icon_state = "None"
|
||||
|
||||
/datum/sprite_accessory/taur/panther
|
||||
name = "Panther"
|
||||
icon_state = "panther"
|
||||
|
||||
/datum/sprite_accessory/taur/tajaran
|
||||
name = "Tajaran"
|
||||
icon_state = "tajaran"
|
||||
|
||||
/datum/sprite_accessory/taur/horse
|
||||
name = "Horse"
|
||||
icon_state = "horse"
|
||||
|
||||
/datum/sprite_accessory/taur/lab
|
||||
name = "Lab"
|
||||
icon_state = "lab"
|
||||
|
||||
/datum/sprite_accessory/taur/shepherd
|
||||
name = "Shepherd"
|
||||
icon_state = "shepherd"
|
||||
|
||||
/datum/sprite_accessory/taur/husky
|
||||
name = "Husky"
|
||||
icon_state = "husky"
|
||||
|
||||
/datum/sprite_accessory/taur/cow
|
||||
name = "Cow"
|
||||
icon_state = "cow"
|
||||
|
||||
/datum/sprite_accessory/taur/fox
|
||||
name = "Fox"
|
||||
icon_state = "fox"
|
||||
|
||||
/datum/sprite_accessory/taur/wolf
|
||||
name = "Wolf"
|
||||
icon_state = "wolf"
|
||||
|
||||
/datum/sprite_accessory/taur/naga
|
||||
name = "Naga"
|
||||
icon_state = "naga"
|
||||
|
||||
/datum/sprite_accessory/taur/otie
|
||||
name = "Otie"
|
||||
icon_state = "otie"
|
||||
|
||||
/datum/sprite_accessory/taur/drake
|
||||
name = "Drake"
|
||||
icon_state = "drake"
|
||||
|
||||
/datum/sprite_accessory/taur/drider
|
||||
name = "Drider"
|
||||
icon_state = "drider"
|
||||
|
||||
/******************************************
|
||||
*************** Ayyliums ******************
|
||||
*******************************************/
|
||||
|
||||
//Xeno Dorsal Tubes
|
||||
/datum/sprite_accessory/xeno_dorsal
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
color_src = 0
|
||||
|
||||
/datum/sprite_accessory/xeno_dorsal/none
|
||||
name = "None"
|
||||
|
||||
/datum/sprite_accessory/xeno_dorsal/normal
|
||||
name = "Dorsal Tubes"
|
||||
icon_state = "dortubes"
|
||||
|
||||
//Xeno Tail
|
||||
/datum/sprite_accessory/xeno_tail
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
color_src = 0
|
||||
|
||||
/datum/sprite_accessory/xeno_tail/none
|
||||
name = "None"
|
||||
|
||||
/datum/sprite_accessory/xeno_tail/normal
|
||||
name = "Xenomorph Tail"
|
||||
icon_state = "xeno"
|
||||
|
||||
//Xeno Caste Heads
|
||||
//unused as of October 3, 2016
|
||||
/datum/sprite_accessory/xeno_head
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
color_src = 0
|
||||
|
||||
/datum/sprite_accessory/xeno_head/none
|
||||
name = "None"
|
||||
|
||||
|
||||
/datum/sprite_accessory/xeno_head/hunter
|
||||
name = "Hunter"
|
||||
icon_state = "hunter"
|
||||
|
||||
/datum/sprite_accessory/xeno_head/drone
|
||||
name = "Drone"
|
||||
icon_state = "drone"
|
||||
|
||||
/datum/sprite_accessory/xeno_head/sentinel
|
||||
name = "Sentinel"
|
||||
icon_state = "sentinel"
|
||||
/*
|
||||
//Slimecoon Parts
|
||||
/datum/sprite_accessory/slimecoon_ears
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
name = "Slimecoon Ears"
|
||||
icon_state = "slimecoon"
|
||||
/datum/sprite_accessory/slimecoon_tail
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
name = "Slimecoon Tail"
|
||||
icon_state = "slimecoon"
|
||||
/datum/sprite_accessory/slimecoon_snout
|
||||
icon = 'icons/mob/exotic_bodyparts.dmi'
|
||||
name = "Hunter"
|
||||
icon_state = "slimecoon" */
|
||||
@@ -2,6 +2,9 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
|
||||
var/list/image/ghost_images_full = list() //this is a list of full images of the ghosts themselves
|
||||
var/list/image/ghost_images_default = list() //this is a list of the default (non-accessorized, non-dir) images of the ghosts themselves
|
||||
var/list/image/ghost_images_simple = list() //this is a list of all ghost images as the simple white ghost
|
||||
|
||||
var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
|
||||
/mob/dead/observer
|
||||
name = "ghost"
|
||||
desc = "It's a g-g-g-g-ghooooost!" //jinkies!
|
||||
@@ -56,10 +59,12 @@ var/list/image/ghost_images_simple = list() //this is a list of all ghost images
|
||||
// of the mob
|
||||
var/deadchat_name
|
||||
|
||||
/mob/dead/observer/New(mob/body)
|
||||
/mob/dead/observer/Initialize()
|
||||
invisibility = observer_default_invisibility
|
||||
|
||||
verbs += /mob/dead/observer/proc/dead_tele
|
||||
|
||||
if(global.cross_allowed)
|
||||
if(config.cross_allowed)
|
||||
verbs += /mob/dead/observer/proc/server_hop
|
||||
|
||||
ghostimage = image(src.icon,src,src.icon_state)
|
||||
@@ -74,9 +79,10 @@ var/list/image/ghost_images_simple = list() //this is a list of all ghost images
|
||||
updateallghostimages()
|
||||
|
||||
var/turf/T
|
||||
var/mob/body = loc
|
||||
if(ismob(body))
|
||||
T = get_turf(body) //Where is the body located?
|
||||
attack_log = body.attack_log //preserve our attack logs by copying them to our ghost
|
||||
logging = body.logging //preserve our logs by copying them to our ghost
|
||||
|
||||
gender = body.gender
|
||||
if(body.mind && body.mind.name)
|
||||
@@ -100,7 +106,12 @@ var/list/image/ghost_images_simple = list() //this is a list of all ghost images
|
||||
update_icon()
|
||||
|
||||
if(!T)
|
||||
T = pick(latejoin) //Safety in case we cannot find the body's position
|
||||
var/list/turfs = get_area_turfs(/area/shuttle/arrival)
|
||||
if(turfs.len)
|
||||
T = pick(turfs)
|
||||
else
|
||||
T = locate(round(world.maxx/2), round(world.maxy/2), ZLEVEL_STATION) //middle of the station
|
||||
|
||||
loc = T
|
||||
|
||||
if(!name) //To prevent nameless ghosts
|
||||
@@ -314,13 +325,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(!client)
|
||||
return
|
||||
if(!(mind && mind.current))
|
||||
src << "<span class='warning'>You have no body.</span>"
|
||||
to_chat(src, "<span class='warning'>You have no body.</span>")
|
||||
return
|
||||
if(!can_reenter_corpse)
|
||||
src << "<span class='warning'>You cannot re-enter your body.</span>"
|
||||
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
|
||||
usr << "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>"
|
||||
to_chat(usr, "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>")
|
||||
return
|
||||
client.view = world.view
|
||||
SStgui.on_transfer(src, mind.current) // Transfer NanoUIs.
|
||||
@@ -331,7 +342,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(flashwindow)
|
||||
window_flash(client)
|
||||
if(message)
|
||||
src << "<span class='ghostalert'>[message]</span>"
|
||||
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)
|
||||
@@ -345,7 +356,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
A.add_overlay(source)
|
||||
source.layer = old_layer
|
||||
source.plane = old_plane
|
||||
src << "<span class='ghostalert'><a href=?src=\ref[src];reenter=1>(Click to re-enter)</a></span>"
|
||||
to_chat(src, "<span class='ghostalert'><a href=?src=\ref[src];reenter=1>(Click to re-enter)</a></span>")
|
||||
if(sound)
|
||||
src << sound(sound)
|
||||
|
||||
@@ -354,7 +365,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set name = "Teleport"
|
||||
set desc= "Teleport to a location"
|
||||
if(!isobserver(usr))
|
||||
usr << "Not when you're not dead!"
|
||||
to_chat(usr, "Not when you're not dead!")
|
||||
return
|
||||
var/A
|
||||
A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas
|
||||
@@ -367,7 +378,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
L+=T
|
||||
|
||||
if(!L || !L.len)
|
||||
usr << "No area available."
|
||||
to_chat(usr, "No area available.")
|
||||
|
||||
usr.loc = pick(L)
|
||||
update_parallax_contents()
|
||||
@@ -393,7 +404,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
|
||||
|
||||
if(orbiting && orbiting.orbiting != target)
|
||||
src << "<span class='notice'>Now orbiting [target].</span>"
|
||||
to_chat(src, "<span class='notice'>Now orbiting [target].</span>")
|
||||
|
||||
var/rot_seg
|
||||
|
||||
@@ -446,7 +457,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
A.loc = T
|
||||
A.update_parallax_contents()
|
||||
else
|
||||
A << "This mob is not located in the game world."
|
||||
to_chat(A, "This mob is not located in the game world.")
|
||||
|
||||
/mob/dead/observer/verb/change_view_range()
|
||||
set category = "Ghost"
|
||||
@@ -488,11 +499,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/memory()
|
||||
set hidden = 1
|
||||
src << "<span class='danger'>You are dead! You have no mind to store memory!</span>"
|
||||
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
|
||||
src << "<span class='danger'>You are dead! You have no mind to store memory!</span>"
|
||||
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"
|
||||
@@ -500,7 +511,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set category = "Ghost"
|
||||
ghostvision = !(ghostvision)
|
||||
updateghostsight()
|
||||
usr << "You [(ghostvision?"now":"no longer")] have ghost vision."
|
||||
to_chat(usr, "You [(ghostvision?"now":"no longer")] have ghost vision.")
|
||||
|
||||
/mob/dead/observer/verb/toggle_darkness()
|
||||
set name = "Toggle Darkness"
|
||||
@@ -581,14 +592,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
return 0
|
||||
|
||||
if(ismegafauna(target))
|
||||
src << "<span class='warning'>This creature is too powerful for you to possess!</span>"
|
||||
to_chat(src, "<span class='warning'>This creature is too powerful for you to possess!</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)
|
||||
src << "<span class='warning'>Someone has taken this body while you were choosing!</span>"
|
||||
to_chat(src, "<span class='warning'>Someone has taken this body while you were choosing!</span>")
|
||||
return 0
|
||||
|
||||
target.key = key
|
||||
@@ -599,14 +610,32 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set category = "Ghost"
|
||||
set name = "Server Hop!"
|
||||
set desc= "Jump to the other server"
|
||||
if (alert(src, "Jump to server running at [global.cross_address]?", "Server Hop", "Yes", "No") != "Yes")
|
||||
if(notransform)
|
||||
return
|
||||
if(!config.cross_allowed)
|
||||
verbs -= /mob/dead/observer/proc/server_hop
|
||||
to_chat(src, "<span class='notice'>Server Hop has been disabled.</span>")
|
||||
return
|
||||
if (alert(src, "Jump to server running at [config.cross_address]?", "Server Hop", "Yes", "No") != "Yes")
|
||||
return 0
|
||||
if (client && global.cross_allowed)
|
||||
src << "<span class='notice'>Sending you to [global.cross_address].</span>"
|
||||
if (client && config.cross_allowed)
|
||||
to_chat(src, "<span class='notice'>Sending you to [config.cross_address].</span>")
|
||||
new /obj/screen/splash(client)
|
||||
notransform = TRUE
|
||||
sleep(29) //let the animation play
|
||||
notransform = FALSE
|
||||
winset(src, null, "command=.options") //other wise the user never knows if byond is downloading resources
|
||||
client << link(global.cross_address)
|
||||
client << link(config.cross_address + "?server_hop=[key]")
|
||||
else
|
||||
src << "<span class='error'>There is no other server configured!</span>"
|
||||
to_chat(src, "<span class='error'>There is no other server configured!</span>")
|
||||
|
||||
/proc/show_server_hop_transfer_screen(expected_key)
|
||||
//only show it to incoming ghosts
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
if(O.key == expected_key)
|
||||
if(O.client)
|
||||
new /obj/screen/splash(O.client, TRUE)
|
||||
break
|
||||
|
||||
//this is a mob verb instead of atom for performance reasons
|
||||
//see /mob/verb/examinate() in mob.dm for more info
|
||||
@@ -643,8 +672,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
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.
|
||||
@@ -668,11 +707,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
if(data_huds_on) //remove old huds
|
||||
remove_data_huds()
|
||||
src << "<span class='notice'>Data HUDs disabled.</span>"
|
||||
to_chat(src, "<span class='notice'>Data HUDs disabled.</span>")
|
||||
data_huds_on = 0
|
||||
else
|
||||
show_data_huds()
|
||||
src << "<span class='notice'>Data HUDs enabled.</span>"
|
||||
to_chat(src, "<span class='notice'>Data HUDs enabled.</span>")
|
||||
data_huds_on = 1
|
||||
|
||||
/mob/dead/observer/verb/restore_ghost_apperance()
|
||||
@@ -781,9 +820,15 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(SSpai)
|
||||
SSpai.recruitWindow(src)
|
||||
else
|
||||
usr << "Can't become a pAI candidate while not dead!"
|
||||
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
|
||||
|
||||
/proc/set_observer_default_invisibility(amount, message=null)
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
G.invisibility = amount
|
||||
if(message)
|
||||
to_chat(G, message)
|
||||
observer_default_invisibility = amount
|
||||
|
||||
@@ -18,5 +18,5 @@
|
||||
else
|
||||
speaker = V.source
|
||||
var/link = FOLLOW_LINK(src, speaker)
|
||||
src << "[link] [message]"
|
||||
to_chat(src, "[link] [message]")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user