module things, jfc
This commit is contained in:
@@ -4,6 +4,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
|
||||
/mob/dead
|
||||
sight = SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
|
||||
throwforce = 0
|
||||
|
||||
/mob/dead/Initialize()
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
@@ -14,12 +15,12 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
|
||||
prepare_huds()
|
||||
|
||||
if(length(CONFIG_GET(keyed_string_list/cross_server)))
|
||||
if(length(CONFIG_GET(keyed_list/cross_server)))
|
||||
verbs += /mob/dead/proc/server_hop
|
||||
set_focus(src)
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
/mob/dead/dust() //ghosts can't be vaporised.
|
||||
/mob/dead/dust(just_ash, drop_items, force) //ghosts can't be vaporised.
|
||||
return
|
||||
|
||||
/mob/dead/gib() //ghosts can't be gibbed.
|
||||
@@ -29,6 +30,10 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
return
|
||||
|
||||
/mob/dead/forceMove(atom/destination)
|
||||
var/turf/old_turf = get_turf(src)
|
||||
var/turf/new_turf = get_turf(destination)
|
||||
if (old_turf?.z != new_turf?.z)
|
||||
onTransitZ(old_turf?.z, new_turf?.z)
|
||||
loc = destination
|
||||
|
||||
/mob/dead/Stat()
|
||||
@@ -36,7 +41,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
|
||||
if(!statpanel("Status"))
|
||||
return
|
||||
//stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]") CIT CHANGE - obfuscates gamemode from player view
|
||||
//stat(null, "Game Mode: [SSticker.hide_mode ? "Secret" : "[GLOB.master_mode]"]")
|
||||
|
||||
if(SSticker.HasRoundStarted())
|
||||
return
|
||||
@@ -59,7 +64,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
set desc= "Jump to the other server"
|
||||
if(notransform)
|
||||
return
|
||||
var/list/csa = CONFIG_GET(keyed_string_list/cross_server)
|
||||
var/list/csa = CONFIG_GET(keyed_list/cross_server)
|
||||
var/pick
|
||||
switch(csa.len)
|
||||
if(0)
|
||||
@@ -92,3 +97,28 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
winset(src, null, "command=.options") //other wise the user never knows if byond is downloading resources
|
||||
|
||||
C << link("[addr]?server_hop=[key]")
|
||||
|
||||
/mob/dead/proc/update_z(new_z) // 1+ to register, null to unregister
|
||||
if (registered_z != new_z)
|
||||
if (registered_z)
|
||||
SSmobs.dead_players_by_zlevel[registered_z] -= src
|
||||
if (client)
|
||||
if (new_z)
|
||||
SSmobs.dead_players_by_zlevel[new_z] += src
|
||||
registered_z = new_z
|
||||
else
|
||||
registered_z = null
|
||||
|
||||
/mob/dead/Login()
|
||||
. = ..()
|
||||
var/turf/T = get_turf(src)
|
||||
if (isturf(T))
|
||||
update_z(T.z)
|
||||
|
||||
/mob/dead/Logout()
|
||||
update_z(null)
|
||||
return ..()
|
||||
|
||||
/mob/dead/onTransitZ(old_z,new_z)
|
||||
..()
|
||||
update_z(new_z)
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
var/isadmin = 0
|
||||
if(src.client && src.client.holder)
|
||||
isadmin = 1
|
||||
var/datum/DBQuery/query_get_new_polls = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
|
||||
var/datum/DBQuery/query_get_new_polls = SSdbcore.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[sanitizeSQL(ckey)]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[sanitizeSQL(ckey)]\")")
|
||||
var/rs = REF(src)
|
||||
if(query_get_new_polls.Execute())
|
||||
var/newpoll = 0
|
||||
|
||||
@@ -103,23 +103,20 @@
|
||||
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]"
|
||||
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
|
||||
output += "<input type='hidden' name='src' value='[REF(src)]'>"
|
||||
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
|
||||
output += "<input type='hidden' name='votetype' value=[POLLTYPE_TEXT]>"
|
||||
output += "<font size='2'>Please provide feedback below. You can use any letters of the English alphabet, numbers and the symbols: . , ! ? : ; -</font><br>"
|
||||
output += "<textarea name='replytext' cols='50' rows='14'>[vote_text]</textarea>"
|
||||
output += "<p><input type='submit' value='Submit'></form>"
|
||||
output += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
|
||||
output += "<input type='hidden' name='src' value='[REF(src)]'>"
|
||||
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
|
||||
output += "<input type='hidden' name='votetype' value=[POLLTYPE_TEXT]>"
|
||||
output += "<input type='hidden' name='replytext' value='ABSTAIN'>"
|
||||
output += "<input type='submit' value='Abstain'></form>"
|
||||
|
||||
src << browse(null ,"window=playerpolllist")
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
if(POLLTYPE_RATING)
|
||||
@@ -348,7 +345,8 @@
|
||||
src << browse(output,"window=playerpoll;size=500x500")
|
||||
return
|
||||
|
||||
/mob/dead/new_player/proc/poll_check_voted(pollid, text = FALSE)
|
||||
//Returns null on failure, TRUE if already voted, FALSE if not voted yet.
|
||||
/mob/dead/new_player/proc/poll_check_voted(pollid, text = FALSE, silent = FALSE)
|
||||
var/table = "poll_vote"
|
||||
if (text)
|
||||
table = "poll_textreply"
|
||||
@@ -361,13 +359,17 @@
|
||||
return
|
||||
if(query_hasvoted.NextRow())
|
||||
qdel(query_hasvoted)
|
||||
to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
|
||||
return
|
||||
if(!silent)
|
||||
to_chat(usr, "<span class='danger'>You've already replied to this poll.</span>")
|
||||
return TRUE
|
||||
qdel(query_hasvoted)
|
||||
return FALSE
|
||||
|
||||
//Returns adminrank for use in polls.
|
||||
/mob/dead/new_player/proc/poll_rank()
|
||||
. = "Player"
|
||||
if(client.holder)
|
||||
. = client.holder.rank.name
|
||||
return .
|
||||
|
||||
|
||||
/mob/dead/new_player/proc/vote_rig_check()
|
||||
@@ -487,7 +489,10 @@
|
||||
//validate the poll
|
||||
if (!vote_valid_check(pollid, client.holder, POLLTYPE_OPTION))
|
||||
return 0
|
||||
var/adminrank = sanitizeSQL(poll_check_voted(pollid))
|
||||
var/voted = poll_check_voted(pollid)
|
||||
if(isnull(voted) || voted) //Failed or already voted.
|
||||
return
|
||||
var/adminrank = sanitizeSQL(poll_rank())
|
||||
if(!adminrank)
|
||||
return
|
||||
var/datum/DBQuery/query_option_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')")
|
||||
@@ -513,14 +518,21 @@
|
||||
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))
|
||||
var/voted = poll_check_voted(pollid, text = TRUE, silent = TRUE)
|
||||
if(isnull(voted))
|
||||
return
|
||||
var/adminrank = sanitizeSQL(poll_rank())
|
||||
if(!adminrank)
|
||||
return
|
||||
replytext = sanitizeSQL(replytext)
|
||||
if(!(length(replytext) > 0) || !(length(replytext) <= 8000))
|
||||
to_chat(usr, "The text you entered was invalid or too long. Please correct the text and submit again.")
|
||||
return
|
||||
var/datum/DBQuery/query_text_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')")
|
||||
var/datum/DBQuery/query_text_vote
|
||||
if(!voted)
|
||||
query_text_vote = SSdbcore.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')")
|
||||
else
|
||||
query_text_vote = SSdbcore.NewQuery("UPDATE [format_table_name("poll_textreply")] SET datetime = Now(), ip = INET_ATON('[client.address]'), replytext = '[replytext]' WHERE pollid = '[pollid]' AND ckey = '[ckey]'")
|
||||
if(!query_text_vote.warn_execute())
|
||||
qdel(query_text_vote)
|
||||
return
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,5 +12,9 @@
|
||||
preferred_form = client.prefs.ghost_form
|
||||
ghost_orbit = client.prefs.ghost_orbit
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if (isturf(T))
|
||||
update_z(T.z)
|
||||
|
||||
update_icon(preferred_form)
|
||||
updateghostimages()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/mob/dead/observer/Logout()
|
||||
update_z(null)
|
||||
if (client)
|
||||
client.images -= (GLOB.ghost_images_default+GLOB.ghost_images_simple)
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
see_in_dark = 100
|
||||
invisibility = INVISIBILITY_OBSERVER
|
||||
hud_type = /datum/hud/ghost
|
||||
var/can_reenter_corpse
|
||||
var/datum/hud/living/carbon/hud = null // hud
|
||||
var/bootime = 0
|
||||
@@ -135,6 +136,10 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
grant_all_languages()
|
||||
|
||||
/mob/dead/observer/get_photo_description(obj/item/camera/camera)
|
||||
if(!invisibility || camera.see_ghosts)
|
||||
return "You can also see a g-g-g-g-ghooooost!"
|
||||
|
||||
/mob/dead/observer/narsie_act()
|
||||
var/old_color = color
|
||||
color = "#960000"
|
||||
@@ -267,6 +272,7 @@ Works together with spawning an observer, noted above.
|
||||
/*
|
||||
This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues.
|
||||
*/
|
||||
|
||||
/mob/living/verb/ghost()
|
||||
set category = "OOC"
|
||||
set name = "Ghost"
|
||||
@@ -281,6 +287,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
C.despawn_occupant()
|
||||
return
|
||||
// END EDIT
|
||||
|
||||
if(stat != DEAD)
|
||||
succumb()
|
||||
if(stat == DEAD)
|
||||
@@ -386,6 +393,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
if(!L || !L.len)
|
||||
to_chat(usr, "No area available.")
|
||||
return
|
||||
|
||||
usr.forceMove(pick(L))
|
||||
update_parallax_contents()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/dead/observer/say(message)
|
||||
/mob/dead/observer/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if (!message)
|
||||
return
|
||||
@@ -15,7 +15,7 @@
|
||||
client.dsay(message)
|
||||
return
|
||||
|
||||
log_talk(src,"Ghost/[src.key] : [message]", LOGSAY)
|
||||
src.log_talk(message, LOG_SAY, tag="ghost")
|
||||
|
||||
if(check_emote(message))
|
||||
return
|
||||
@@ -37,3 +37,4 @@
|
||||
// Recompose the message, because it's scrambled by default
|
||||
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode)
|
||||
to_chat(src, "[link] [message]")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user