April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
/mob/dead/dust() //ghosts can't be vaporised.
|
||||
return
|
||||
|
||||
/mob/dead/gib() //ghosts can't be gibbed.
|
||||
return
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
..()
|
||||
|
||||
if(join_motd)
|
||||
to_chat(src, "<div class=\"motd\">[join_motd]</div>")
|
||||
if(GLOB.join_motd)
|
||||
to_chat(src, "<div class=\"motd\">[GLOB.join_motd]</div>")
|
||||
|
||||
if(admin_notice)
|
||||
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [admin_notice]</span>")
|
||||
if(GLOB.admin_notice)
|
||||
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [GLOB.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>")
|
||||
@@ -28,5 +28,5 @@
|
||||
*/
|
||||
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.")
|
||||
if(SSticker.current_state < GAME_STATE_SETTING_UP)
|
||||
to_chat(src, "Please set up your character and select \"Ready\". The game will start in about [round(SSticker.GetTimeLeft(), 1)/10] seconds.")
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
stack_trace("Warning: [src]([type]) initialized multiple times!")
|
||||
initialized = TRUE
|
||||
tag = "mob_[next_mob_id++]"
|
||||
mob_list += src
|
||||
GLOB.mob_list += src
|
||||
|
||||
if(client && ticker.state == GAME_STATE_STARTUP)
|
||||
if(client && SSticker.state == GAME_STATE_STARTUP)
|
||||
var/obj/screen/splash/S = new(client, TRUE, TRUE)
|
||||
S.Fade(TRUE)
|
||||
|
||||
if(length(newplayer_start))
|
||||
loc = pick(newplayer_start)
|
||||
if(length(GLOB.newplayer_start))
|
||||
loc = pick(GLOB.newplayer_start)
|
||||
else
|
||||
loc = locate(1,1,1)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
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(!SSticker || SSticker.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
|
||||
@@ -48,11 +48,11 @@
|
||||
output += "<p><a href='byond://?src=\ref[src];observe=1'>Observe</A></p>"
|
||||
|
||||
if(!IsGuestKey(src.key))
|
||||
if (dbcon.Connect())
|
||||
if (GLOB.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]\")")
|
||||
var/DBQuery/query_get_new_polls = GLOB.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
|
||||
@@ -77,18 +77,18 @@
|
||||
..()
|
||||
|
||||
if(statpanel("Lobby"))
|
||||
stat("Game Mode:", (ticker.hide_mode) ? "Secret" : "[master_mode]")
|
||||
stat("Game Mode:", (SSticker.hide_mode) ? "Secret" : "[GLOB.master_mode]")
|
||||
stat("Map:", SSmapping.config.map_name)
|
||||
|
||||
if(ticker.current_state == GAME_STATE_PREGAME)
|
||||
var/time_remaining = ticker.GetTimeLeft()
|
||||
if(SSticker.current_state == GAME_STATE_PREGAME)
|
||||
var/time_remaining = SSticker.GetTimeLeft()
|
||||
if(time_remaining >= 0)
|
||||
time_remaining /= 10
|
||||
stat("Time To Start:", (time_remaining >= 0) ? "[round(time_remaining)]s" : "DELAYED")
|
||||
|
||||
stat("Players:", "[ticker.totalPlayers]")
|
||||
stat("Players:", "[SSticker.totalPlayers]")
|
||||
if(client.holder)
|
||||
stat("Players Ready:", "[ticker.totalPlayersReady]")
|
||||
stat("Players Ready:", "[SSticker.totalPlayersReady]")
|
||||
|
||||
|
||||
/mob/dead/new_player/Topic(href, href_list[])
|
||||
@@ -110,7 +110,7 @@
|
||||
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
|
||||
if(!SSticker || SSticker.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"])
|
||||
@@ -141,14 +141,14 @@
|
||||
observer.real_name = observer.client.prefs.real_name
|
||||
observer.name = observer.real_name
|
||||
observer.update_icon()
|
||||
observer.stopLobbySound()
|
||||
observer.stop_sound_channel(CHANNEL_LOBBYMUSIC)
|
||||
qdel(mind)
|
||||
|
||||
qdel(src)
|
||||
return 1
|
||||
|
||||
if(href_list["late_join"])
|
||||
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
|
||||
if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING)
|
||||
to_chat(usr, "<span class='danger'>The round is either not ready, or has already finished...</span>")
|
||||
return
|
||||
|
||||
@@ -156,17 +156,17 @@
|
||||
LateChoices()
|
||||
return
|
||||
|
||||
if(ticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in admin_datums)))
|
||||
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.hard_popcap_message]</span>")
|
||||
|
||||
var/queue_position = ticker.queued_players.Find(usr)
|
||||
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
|
||||
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>")
|
||||
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()
|
||||
|
||||
@@ -175,12 +175,12 @@
|
||||
|
||||
if(href_list["SelectedJob"])
|
||||
|
||||
if(!enter_allowed)
|
||||
if(!GLOB.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]))
|
||||
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
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
alert(src, "[rank] is not available. Please try another.")
|
||||
return 0
|
||||
|
||||
if(ticker.late_join_disabled)
|
||||
if(SSticker.late_join_disabled)
|
||||
alert(src, "An administrator has disabled late join spawning.")
|
||||
return FALSE
|
||||
|
||||
@@ -314,8 +314,8 @@
|
||||
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
|
||||
SSticker.queued_players -= src
|
||||
SSticker.queue_delay = 4
|
||||
|
||||
SSjob.AssignRole(src, rank, 1)
|
||||
|
||||
@@ -325,8 +325,8 @@
|
||||
character = equip
|
||||
|
||||
var/D
|
||||
if(latejoin.len)
|
||||
D = get_turf(pick(latejoin))
|
||||
if(GLOB.latejoin.len)
|
||||
D = get_turf(pick(GLOB.latejoin))
|
||||
if(!D)
|
||||
for(var/turf/T in get_area_turfs(/area/shuttle/arrival))
|
||||
if(!T.density)
|
||||
@@ -346,46 +346,46 @@
|
||||
if(chair)
|
||||
chair.buckle_mob(character)
|
||||
|
||||
ticker.minds += character.mind
|
||||
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
|
||||
data_core.manifest_inject(humanc)
|
||||
GLOB.data_core.manifest_inject(humanc)
|
||||
if(SSshuttle.arrivals)
|
||||
SSshuttle.arrivals.QueueAnnounce(humanc, rank)
|
||||
else
|
||||
AnnounceArrival(humanc, rank)
|
||||
AddEmploymentContract(humanc)
|
||||
if(highlander)
|
||||
if(GLOB.highlander)
|
||||
to_chat(humanc, "<span class='userdanger'><i>THERE CAN BE ONLY ONE!!!</i></span>")
|
||||
humanc.make_scottish()
|
||||
|
||||
joined_player_list += character.ckey
|
||||
GLOB.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)
|
||||
SSticker.mode.make_antag_chance(humanc)
|
||||
if(SHUTTLE_CALL)
|
||||
if(SSshuttle.emergency.timeLeft(1) > initial(SSshuttle.emergencyCallTime)*0.5)
|
||||
ticker.mode.make_antag_chance(humanc)
|
||||
SSticker.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)
|
||||
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/mills = world.time - round_start_time // 1/10 of a second, not real milliseconds but whatever
|
||||
var/mills = world.time - SSticker.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
|
||||
@@ -425,7 +425,7 @@
|
||||
if (job_count > round(available_job_count / 2))
|
||||
dat += "</div><div class='jobsColumn'>"
|
||||
var/position_class = "otherPosition"
|
||||
if (job.title in command_positions)
|
||||
if (job.title in GLOB.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.
|
||||
@@ -471,12 +471,12 @@
|
||||
. = new_character
|
||||
if(.)
|
||||
new_character.key = key //Manually transfer the key to log them in
|
||||
new_character.stopLobbySound()
|
||||
new_character.stop_sound_channel(CHANNEL_LOBBYMUSIC)
|
||||
|
||||
/mob/dead/new_player/proc/ViewManifest()
|
||||
var/dat = "<html><body>"
|
||||
dat += "<h4>Crew Manifest</h4>"
|
||||
dat += data_core.get_manifest(OOC = 1)
|
||||
dat += GLOB.data_core.get_manifest(OOC = 1)
|
||||
|
||||
src << browse(dat, "window=manifest;size=387x420;can_close=1")
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
var/optiontext
|
||||
|
||||
/mob/dead/new_player/proc/handle_player_polling()
|
||||
if(!dbcon.IsConnected())
|
||||
if(!GLOB.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")]")
|
||||
var/DBQuery/query_poll_get = GLOB.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>"
|
||||
@@ -22,10 +22,10 @@
|
||||
/mob/dead/new_player/proc/poll_player(pollid)
|
||||
if(!pollid)
|
||||
return
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.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]")
|
||||
var/DBQuery/query_poll_get_details = GLOB.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 = ""
|
||||
@@ -41,14 +41,14 @@
|
||||
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]'")
|
||||
var/DBQuery/query_option_get_votes = GLOB.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]")
|
||||
var/DBQuery/query_option_options = GLOB.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())
|
||||
@@ -82,7 +82,7 @@
|
||||
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]'")
|
||||
var/DBQuery/query_text_get_votes = GLOB.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 = ""
|
||||
@@ -111,7 +111,7 @@
|
||||
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")
|
||||
var/DBQuery/query_rating_get_votes = GLOB.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>"
|
||||
@@ -129,7 +129,7 @@
|
||||
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]")
|
||||
var/DBQuery/query_rating_options = GLOB.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())
|
||||
@@ -163,7 +163,7 @@
|
||||
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]'")
|
||||
var/DBQuery/query_multi_get_votes = GLOB.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()
|
||||
@@ -172,7 +172,7 @@
|
||||
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]")
|
||||
var/DBQuery/query_multi_options = GLOB.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())
|
||||
@@ -214,7 +214,7 @@
|
||||
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]'")
|
||||
var/DBQuery/query_irv_get_votes = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
|
||||
if(!query_irv_get_votes.warn_execute())
|
||||
return
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
|
||||
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]")
|
||||
var/DBQuery/query_irv_options = GLOB.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())
|
||||
@@ -327,10 +327,10 @@
|
||||
var/table = "poll_vote"
|
||||
if (text)
|
||||
table = "poll_textreply"
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.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]'")
|
||||
var/DBQuery/query_hasvoted = GLOB.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())
|
||||
@@ -355,14 +355,14 @@
|
||||
return 1
|
||||
|
||||
/mob/dead/new_player/proc/vote_valid_check(pollid, holder, type)
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.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")]")
|
||||
var/DBQuery/query_validate_poll = GLOB.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())
|
||||
@@ -370,7 +370,7 @@
|
||||
return 1
|
||||
|
||||
/mob/dead/new_player/proc/vote_on_irv_poll(pollid, list/votelist)
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
@@ -395,7 +395,7 @@
|
||||
return 0
|
||||
|
||||
//lets collect the options
|
||||
var/DBQuery/query_irv_id = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
|
||||
var/DBQuery/query_irv_id = GLOB.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()
|
||||
@@ -426,12 +426,12 @@
|
||||
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]'")
|
||||
var/DBQuery/query_irv_del_old = GLOB.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]")
|
||||
var/DBQuery/query_irv_vote = GLOB.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")
|
||||
@@ -439,7 +439,7 @@
|
||||
|
||||
|
||||
/mob/dead/new_player/proc/vote_on_poll(pollid, optionid)
|
||||
if (!dbcon.Connect())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
@@ -452,14 +452,14 @@
|
||||
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]')")
|
||||
var/DBQuery/query_option_vote = GLOB.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())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
@@ -479,14 +479,14 @@
|
||||
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]')")
|
||||
var/DBQuery/query_text_vote = GLOB.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())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
@@ -496,7 +496,7 @@
|
||||
//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]'")
|
||||
var/DBQuery/query_numval_hasvoted = GLOB.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())
|
||||
@@ -506,14 +506,14 @@
|
||||
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])")
|
||||
var/DBQuery/query_numval_vote = GLOB.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())
|
||||
if (!GLOB.dbcon.Connect())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return 0
|
||||
if (!vote_rig_check())
|
||||
@@ -523,13 +523,13 @@
|
||||
//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]")
|
||||
var/DBQuery/query_multi_choicelen = GLOB.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]'")
|
||||
var/DBQuery/query_multi_hasvoted = GLOB.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)
|
||||
@@ -543,7 +543,7 @@
|
||||
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]')")
|
||||
var/DBQuery/query_multi_vote = GLOB.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")
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
// Silicons only need a very basic preview since there is no customization for them.
|
||||
if(job_engsec_high)
|
||||
switch(job_engsec_high)
|
||||
if(AI)
|
||||
if(AI_JF)
|
||||
preview_icon = icon('icons/mob/AI.dmi', "AI", SOUTH)
|
||||
preview_icon.Scale(64, 64)
|
||||
return
|
||||
|
||||
@@ -812,7 +812,7 @@
|
||||
gender = FEMALE
|
||||
|
||||
/datum/sprite_accessory/undershirt/lover
|
||||
name = "Lover shirt"
|
||||
name = "Lover Shirt"
|
||||
icon_state = "lover"
|
||||
gender = NEUTER
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/mob/dead/observer/Logout()
|
||||
if (client)
|
||||
client.images -= ghost_darkness_images
|
||||
client.images -= (GLOB.ghost_images_default+GLOB.ghost_images_simple)
|
||||
|
||||
if(observetarget)
|
||||
if(ismob(observetarget))
|
||||
var/mob/target = observetarget
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
var/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness, BUT NOT THE GHOSTS THEMSELVES!
|
||||
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
|
||||
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
|
||||
|
||||
var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
/mob/dead/observer
|
||||
name = "ghost"
|
||||
@@ -19,8 +17,6 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
see_in_dark = 100
|
||||
invisibility = INVISIBILITY_OBSERVER
|
||||
languages_spoken = ALL
|
||||
languages_understood = ALL
|
||||
var/can_reenter_corpse
|
||||
var/datum/hud/living/carbon/hud = null // hud
|
||||
var/bootime = 0
|
||||
@@ -29,11 +25,9 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
//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 = null //this mobs ghost image, for deleting and stuff
|
||||
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/seedarkness = 1
|
||||
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?
|
||||
@@ -60,22 +54,24 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
var/deadchat_name
|
||||
|
||||
/mob/dead/observer/Initialize()
|
||||
invisibility = observer_default_invisibility
|
||||
invisibility = GLOB.observer_default_invisibility
|
||||
|
||||
verbs += /mob/dead/observer/proc/dead_tele
|
||||
|
||||
if(config.cross_allowed)
|
||||
verbs += /mob/dead/observer/proc/server_hop
|
||||
|
||||
ghostimage = image(src.icon,src,src.icon_state)
|
||||
if(icon_state in ghost_forms_with_directions_list)
|
||||
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")
|
||||
ghost_images_full |= ghostimage
|
||||
ghost_images_default |= ghostimage_default
|
||||
ghost_images_simple |= ghostimage_simple
|
||||
ghostimage_simple.override = TRUE
|
||||
GLOB.ghost_images_simple |= ghostimage_simple
|
||||
|
||||
updateallghostimages()
|
||||
|
||||
var/turf/T
|
||||
@@ -123,6 +119,8 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
verbs -= /mob/dead/observer/verb/possess
|
||||
|
||||
animate(src, pixel_y = 2, time = 10, loop = -1)
|
||||
|
||||
grant_all_languages()
|
||||
..()
|
||||
|
||||
/mob/dead/observer/narsie_act()
|
||||
@@ -137,16 +135,11 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
animate(src, color = old_color, time = 10)
|
||||
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 10)
|
||||
|
||||
/mob/dead/observer/Destroy()
|
||||
ghost_images_full -= ghostimage
|
||||
qdel(ghostimage)
|
||||
ghostimage = null
|
||||
|
||||
ghost_images_default -= ghostimage_default
|
||||
GLOB.ghost_images_default -= ghostimage_default
|
||||
qdel(ghostimage_default)
|
||||
ghostimage_default = null
|
||||
|
||||
ghost_images_simple -= ghostimage_simple
|
||||
GLOB.ghost_images_simple -= ghostimage_simple
|
||||
qdel(ghostimage_simple)
|
||||
ghostimage_simple = null
|
||||
|
||||
@@ -170,49 +163,44 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
|
||||
if(hair_image)
|
||||
cut_overlay(hair_image)
|
||||
ghostimage.add_overlay(hair_image)
|
||||
hair_image = null
|
||||
|
||||
if(facial_hair_image)
|
||||
cut_overlay(facial_hair_image)
|
||||
ghostimage.add_overlay(facial_hair_image)
|
||||
facial_hair_image = null
|
||||
|
||||
|
||||
if(new_form)
|
||||
icon_state = new_form
|
||||
ghostimage.icon_state = new_form
|
||||
if(icon_state in ghost_forms_with_directions_list)
|
||||
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 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
|
||||
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 ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them
|
||||
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 = facial_hair_styles_list[facial_hair_style]
|
||||
S = GLOB.facial_hair_styles_list[facial_hair_style]
|
||||
if(S)
|
||||
facial_hair_image = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER)
|
||||
if(facial_hair_color)
|
||||
facial_hair_image.color = "#" + facial_hair_color
|
||||
facial_hair_image.alpha = 200
|
||||
add_overlay(facial_hair_image)
|
||||
ghostimage.add_overlay(facial_hair_image)
|
||||
if(hair_style)
|
||||
S = hair_styles_list[hair_style]
|
||||
S = GLOB.hair_styles_list[hair_style]
|
||||
if(S)
|
||||
hair_image = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER)
|
||||
if(hair_color)
|
||||
hair_image.color = "#" + hair_color
|
||||
hair_image.alpha = 200
|
||||
add_overlay(hair_image)
|
||||
ghostimage.add_overlay(hair_image)
|
||||
|
||||
/*
|
||||
* Increase the brightness of a color by calculating the average distance between the R, G and B values,
|
||||
@@ -310,14 +298,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/Stat()
|
||||
..()
|
||||
if(statpanel("Status"))
|
||||
if(ticker && ticker.mode)
|
||||
for(var/datum/gang/G in ticker.mode.gangs)
|
||||
if(SSticker && SSticker.mode)
|
||||
for(var/datum/gang/G in SSticker.mode.gangs)
|
||||
if(G.is_dominating)
|
||||
stat(null, "[G.name] Gang Takeover: [max(G.domination_time_remaining(), 0)]")
|
||||
if(istype(ticker.mode, /datum/game_mode/blob))
|
||||
var/datum/game_mode/blob/B = ticker.mode
|
||||
if(istype(SSticker.mode, /datum/game_mode/blob))
|
||||
var/datum/game_mode/blob/B = SSticker.mode
|
||||
if(B.message_sent)
|
||||
stat(null, "Blobs to Blob Win: [blobs_legit.len]/[B.blobwincount]")
|
||||
stat(null, "Blobs to Blob Win: [GLOB.blobs_legit.len]/[B.blobwincount]")
|
||||
|
||||
/mob/dead/observer/verb/reenter_corpse()
|
||||
set category = "Ghost"
|
||||
@@ -368,7 +356,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
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
|
||||
A = input("Area to jump to", "BOOYEA", A) as null|anything in GLOB.sortedAreas
|
||||
var/area/thearea = A
|
||||
if(!thearea)
|
||||
return
|
||||
@@ -510,35 +498,42 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
|
||||
set category = "Ghost"
|
||||
ghostvision = !(ghostvision)
|
||||
updateghostsight()
|
||||
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"
|
||||
seedarkness = !(seedarkness)
|
||||
updateghostsight()
|
||||
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
|
||||
|
||||
/mob/dead/observer/proc/updateghostsight()
|
||||
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 (seedarkness)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
if (!ghostvision || ghost_others <= GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
if (!ghostvision)
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
else
|
||||
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
|
||||
|
||||
updateghostimages()
|
||||
..()
|
||||
|
||||
/proc/updateallghostimages()
|
||||
listclearnulls(ghost_images_full)
|
||||
listclearnulls(ghost_images_default)
|
||||
listclearnulls(ghost_images_simple)
|
||||
listclearnulls(ghost_darkness_images)
|
||||
listclearnulls(GLOB.ghost_images_default)
|
||||
listclearnulls(GLOB.ghost_images_simple)
|
||||
|
||||
for (var/mob/dead/observer/O in player_list)
|
||||
for (var/mob/dead/observer/O in GLOB.player_list)
|
||||
O.updateghostimages()
|
||||
|
||||
/mob/dead/observer/proc/updateghostimages()
|
||||
@@ -547,34 +542,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
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_THEIR_SETTING)
|
||||
client.images -= ghost_images_full
|
||||
if(GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
client.images -= ghost_images_default
|
||||
client.images -= GLOB.ghost_images_default
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client.images -= ghost_images_simple
|
||||
|
||||
if ((seedarkness || !ghostvision) && client.prefs.ghost_others == GHOST_OTHERS_THEIR_SETTING)
|
||||
client.images -= ghost_darkness_images
|
||||
lastsetting = null
|
||||
else if(ghostvision && (!seedarkness || client.prefs.ghost_others <= GHOST_OTHERS_DEFAULT_SPRITE))
|
||||
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
|
||||
if(!lastsetting)
|
||||
client.images |= ghost_darkness_images
|
||||
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_THEIR_SETTING)
|
||||
client.images |= ghost_images_full
|
||||
if (ghostimage)
|
||||
client.images -= ghostimage //remove ourself
|
||||
if(GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
client.images |= ghost_images_default
|
||||
if(ghostimage_default)
|
||||
client.images -= ghostimage_default
|
||||
client.images |= (GLOB.ghost_images_default-ghostimage_default)
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client.images |= ghost_images_simple
|
||||
if(ghostimage_simple)
|
||||
client.images -= ghostimage_simple
|
||||
lastsetting = client.prefs.ghost_others
|
||||
client.images |= (GLOB.ghost_images_simple-ghostimage_simple)
|
||||
|
||||
/mob/dead/observer/verb/possess()
|
||||
set category = "Ghost"
|
||||
@@ -582,8 +562,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set desc= "Take over the body of a mindless creature!"
|
||||
|
||||
var/list/possessible = list()
|
||||
for(var/mob/living/L in living_mob_list)
|
||||
if(!(L in player_list) && !L.mind)
|
||||
for(var/mob/living/L in GLOB.living_mob_list)
|
||||
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
|
||||
@@ -595,7 +575,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
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(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)
|
||||
@@ -631,7 +611,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/proc/show_server_hop_transfer_screen(expected_key)
|
||||
//only show it to incoming ghosts
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
for(var/mob/dead/observer/O in GLOB.player_list)
|
||||
if(O.key == expected_key)
|
||||
if(O.client)
|
||||
new /obj/screen/splash(O.client, TRUE)
|
||||
@@ -652,7 +632,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
var/dat
|
||||
dat += "<h4>Crew Manifest</h4>"
|
||||
dat += data_core.get_manifest()
|
||||
dat += GLOB.data_core.get_manifest()
|
||||
|
||||
src << browse(dat, "window=manifest;size=387x420;can_close=1")
|
||||
|
||||
@@ -692,12 +672,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/proc/show_data_huds()
|
||||
for(var/hudtype in datahuds)
|
||||
var/datum/atom_hud/H = huds[hudtype]
|
||||
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 = huds[hudtype]
|
||||
var/datum/atom_hud/H = GLOB.huds[hudtype]
|
||||
H.remove_hud_from(src)
|
||||
|
||||
/mob/dead/observer/verb/toggle_data_huds()
|
||||
@@ -742,7 +722,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
update_icon()
|
||||
|
||||
/mob/dead/observer/canUseTopic()
|
||||
/mob/dead/observer/canUseTopic(atom/movable/AM,be_close = FALSE)
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
return 1
|
||||
return
|
||||
@@ -754,11 +734,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
. = ..()
|
||||
switch(var_name)
|
||||
if("icon")
|
||||
ghostimage.icon = icon
|
||||
ghostimage_default.icon = icon
|
||||
ghostimage_simple.icon = icon
|
||||
if("icon_state")
|
||||
ghostimage.icon_state = icon_state
|
||||
ghostimage_default.icon_state = icon_state
|
||||
ghostimage_simple.icon_state = icon_state
|
||||
if("fun_verbs")
|
||||
@@ -805,7 +783,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(mob_eye.hud_used)
|
||||
LAZYINITLIST(mob_eye.observers)
|
||||
mob_eye.observers |= src
|
||||
mob_eye.hud_used.show_hud(1,src)
|
||||
mob_eye.hud_used.show_hud(mob_eye.hud_used.hud_version, src)
|
||||
observetarget = mob_eye
|
||||
|
||||
/mob/dead/observer/verb/register_pai_candidate()
|
||||
@@ -826,9 +804,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
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.")
|
||||
|
||||
/proc/set_observer_default_invisibility(amount, message=null)
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
for(var/mob/dead/observer/G in GLOB.player_list)
|
||||
G.invisibility = amount
|
||||
if(message)
|
||||
to_chat(G, message)
|
||||
observer_default_invisibility = amount
|
||||
GLOB.observer_default_invisibility = amount
|
||||
|
||||
@@ -8,15 +8,18 @@
|
||||
|
||||
. = src.say_dead(message)
|
||||
|
||||
/mob/dead/observer/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans)
|
||||
/mob/dead/observer/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
var/atom/movable/to_follow = speaker
|
||||
if(radio_freq)
|
||||
var/atom/movable/virtualspeaker/V = speaker
|
||||
|
||||
if(isAI(V.source))
|
||||
var/mob/living/silicon/ai/S = V.source
|
||||
speaker = S.eyeobj
|
||||
to_follow = S.eyeobj
|
||||
else
|
||||
speaker = V.source
|
||||
var/link = FOLLOW_LINK(src, speaker)
|
||||
to_follow = V.source
|
||||
var/link = FOLLOW_LINK(src, to_follow)
|
||||
// Recompose the message, because it's scrambled by default
|
||||
message = compose_message(speaker, message_language, raw_message, radio_freq, spans)
|
||||
to_chat(src, "[link] [message]")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user