mirror of
https://github.com/KabKebab/GS13.git
synced 2026-02-09 23:27:37 +00:00
Revert "Merge branch 'punishesarchie' of https://github.com/MalricB/Hyper-Station-13 into punishesarchie"
This reverts commit1945c166b4, reversing changes made toc8d20ea83c.
This commit is contained in:
@@ -202,11 +202,6 @@
|
||||
if(filename == P.filename)
|
||||
return P
|
||||
|
||||
/datum/ntnet/proc/get_chat_channel_by_id(id)
|
||||
for(var/datum/ntnet_conversation/chan in chat_channels)
|
||||
if(chan.id == id)
|
||||
return chan
|
||||
|
||||
// Resets the IDS alarm
|
||||
/datum/ntnet/proc/resetIDS()
|
||||
intrusion_detection_alarm = FALSE
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
icon_state = "bus"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/ntnet_relay
|
||||
ui_x = 400
|
||||
ui_y = 300
|
||||
|
||||
var/datum/ntnet/NTNet = null // This is mostly for backwards reference and to allow varedit modifications from ingame.
|
||||
var/enabled = 1 // Set to 0 if the relay was turned off
|
||||
var/dos_failure = 0 // Set to 1 if the relay failed due to (D)DoS attack
|
||||
@@ -69,7 +66,7 @@
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ntnet_relay", "NTNet Quantum Relay", ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, ui_key, "ntnet_relay", "NTNet Quantum Relay", 500, 300, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
|
||||
@@ -91,12 +88,10 @@
|
||||
dos_failure = 0
|
||||
update_icon()
|
||||
SSnetworks.station_network.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
|
||||
return TRUE
|
||||
if("toggle")
|
||||
enabled = !enabled
|
||||
SSnetworks.station_network.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/ntnet_relay/Initialize()
|
||||
uid = gl_uid++
|
||||
@@ -118,4 +113,4 @@
|
||||
D.target = null
|
||||
D.error = "Connection to quantum relay severed"
|
||||
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
dat+="<HR><B>Feed Security functions:</B><BR>"
|
||||
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_menu_wanted=1'>[(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue</A>"
|
||||
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_menu_censor_story=1'>Censor Feed Stories</A>"
|
||||
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_menu_censor_channel=1'>Mark Feed Channel with Kinaris D-Notice (disables and locks the channel).</A>"
|
||||
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_menu_censor_channel=1'>Mark Feed Channel with Nanotrasen D-Notice (disables and locks the channel).</A>"
|
||||
dat+="<BR><HR><A href='?src=[REF(src)];[HrefToken()];ac_set_signature=1'>The newscaster recognises you as:<BR> <FONT COLOR='green'>[src.admin_signature]</FONT></A>"
|
||||
if(1)
|
||||
dat+= "Station Feed Channels<HR>"
|
||||
@@ -292,7 +292,7 @@
|
||||
if(9)
|
||||
dat+="<B>[admincaster_feed_channel.channel_name]: </B><FONT SIZE=1>\[created by: <FONT COLOR='maroon'>[admincaster_feed_channel.returnAuthor(-1)]</FONT>\]</FONT><HR>"
|
||||
if(src.admincaster_feed_channel.censored)
|
||||
dat+="<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Kinaris D-Notice.<BR>"
|
||||
dat+="<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>"
|
||||
dat+="No further feed story additions are allowed while the D-Notice is in effect.</FONT><BR><BR>"
|
||||
else
|
||||
if( isemptylist(src.admincaster_feed_channel.messages) )
|
||||
@@ -313,7 +313,7 @@
|
||||
dat+="<BR><HR><A href='?src=[REF(src)];[HrefToken()];ac_refresh=1'>Refresh</A>"
|
||||
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_setScreen=[1]'>Back</A>"
|
||||
if(10)
|
||||
dat+="<B>Kinaris Feed Censorship Tool</B><BR>"
|
||||
dat+="<B>Nanotrasen Feed Censorship Tool</B><BR>"
|
||||
dat+="<FONT SIZE=1>NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.<BR>"
|
||||
dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.</FONT>"
|
||||
dat+="<HR>Select Feed channel to get Stories from:<BR>"
|
||||
@@ -324,7 +324,7 @@
|
||||
dat+="<A href='?src=[REF(src)];[HrefToken()];ac_pick_censor_channel=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
|
||||
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_setScreen=[0]'>Cancel</A>"
|
||||
if(11)
|
||||
dat+="<B>Kinaris D-Notice Handler</B><HR>"
|
||||
dat+="<B>Nanotrasen D-Notice Handler</B><HR>"
|
||||
dat+="<FONT SIZE=1>A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's"
|
||||
dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed"
|
||||
dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.</FONT><HR>"
|
||||
@@ -353,7 +353,7 @@
|
||||
dat+="<B>[src.admincaster_feed_channel.channel_name]: </B><FONT SIZE=1>\[ created by: <FONT COLOR='maroon'>[src.admincaster_feed_channel.returnAuthor(-1)]</FONT> \]</FONT><BR>"
|
||||
dat+="Channel messages listed below. If you deem them dangerous to the station, you can <A href='?src=[REF(src)];[HrefToken()];ac_toggle_d_notice=[REF(src.admincaster_feed_channel)]'>Bestow a D-Notice upon the channel</A>.<HR>"
|
||||
if(src.admincaster_feed_channel.censored)
|
||||
dat+="<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Kinaris D-Notice.<BR>"
|
||||
dat+="<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>"
|
||||
dat+="No further feed story additions are allowed while the D-Notice is in effect.</FONT><BR><BR>"
|
||||
else
|
||||
if( isemptylist(src.admincaster_feed_channel.messages) )
|
||||
@@ -710,44 +710,20 @@
|
||||
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
var/turf/T = get_turf(usr)
|
||||
|
||||
var/chosen = pick_closest_path(object)
|
||||
if(!chosen)
|
||||
return
|
||||
if(ispath(chosen, /turf))
|
||||
var/turf/T = get_turf(usr.loc)
|
||||
T.ChangeTurf(chosen)
|
||||
else
|
||||
var/atom/A = new chosen(T)
|
||||
var/atom/A = new chosen(usr.loc)
|
||||
A.flags_1 |= ADMIN_SPAWNED_1
|
||||
|
||||
log_admin("[key_name(usr)] spawned [chosen] at [AREACOORD(usr)]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Atom") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/podspawn_atom(object as text)
|
||||
set category = "Debug"
|
||||
set desc = "(atom path) Spawn an atom via supply drop"
|
||||
set name = "Podspawn"
|
||||
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/chosen = pick_closest_path(object)
|
||||
if(!chosen)
|
||||
return
|
||||
var/turf/T = get_turf(usr)
|
||||
|
||||
if(ispath(chosen, /turf))
|
||||
T.ChangeTurf(chosen)
|
||||
else
|
||||
var/obj/structure/closet/supplypod/centcompod/pod = new()
|
||||
var/atom/A = new chosen(pod)
|
||||
A.flags_1 |= ADMIN_SPAWNED_1
|
||||
new /obj/effect/abstract/DPtarget(T, pod)
|
||||
|
||||
log_admin("[key_name(usr)] pod-spawned [chosen] at [AREACOORD(usr)]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Podspawn Atom") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/spawn_cargo(object as text)
|
||||
set category = "Debug"
|
||||
set desc = "(atom path) Spawn a cargo crate"
|
||||
@@ -1035,4 +1011,3 @@
|
||||
log_admin("Man up global: [key_name(usr)] told everybody to man up")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] told everybody to man up.</span>")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Man Up Global")
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ GLOBAL_PROTECT(protected_ranks)
|
||||
var/previous_rights = 0
|
||||
//load text from file and process each line separately
|
||||
for(var/line in world.file2list("[global.config.directory]/admin_ranks.txt"))
|
||||
if(!line || findtextEx_char(line,"#",1,2))
|
||||
if(!line || findtextEx(line,"#",1,2))
|
||||
continue
|
||||
var/next = findtext(line, "=")
|
||||
var/datum/admin_rank/R = new(ckeyEx(copytext(line, 1, next)))
|
||||
@@ -145,7 +145,7 @@ GLOBAL_PROTECT(protected_ranks)
|
||||
GLOB.protected_ranks += R
|
||||
var/prev = findchar(line, "+-*", next, 0)
|
||||
while(prev)
|
||||
next = findchar(line, "+-*", prev + length(line[prev]), 0)
|
||||
next = findchar(line, "+-*", prev + 1, 0)
|
||||
R.process_keyword(copytext(line, prev, next), previous_rights)
|
||||
prev = next
|
||||
previous_rights = R.rights
|
||||
|
||||
@@ -107,12 +107,11 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
|
||||
/client/proc/smite,
|
||||
/client/proc/spawn_floor_cluwne, // Yogs
|
||||
/client/proc/spawn_random_floor_cluwne,
|
||||
/client/proc/spawn_twitch_plays_clowncar,
|
||||
/client/proc/admin_away,
|
||||
/client/proc/roll_dices //CIT CHANGE - Adds dice verb
|
||||
))
|
||||
GLOBAL_PROTECT(admin_verbs_spawn)
|
||||
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/podspawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character))
|
||||
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character))
|
||||
GLOBAL_PROTECT(admin_verbs_server)
|
||||
GLOBAL_LIST_INIT(admin_verbs_server, world.AVerbsServer())
|
||||
/world/proc/AVerbsServer()
|
||||
@@ -172,7 +171,6 @@ GLOBAL_LIST_INIT(admin_verbs_debug, world.AVerbsDebug())
|
||||
/client/proc/cmd_display_overlay_log,
|
||||
/client/proc/reload_configuration,
|
||||
/datum/admins/proc/create_or_modify_area,
|
||||
/client/proc/generate_wikichem_list //DO NOT PRESS UNLESS YOU WANT SUPERLAG
|
||||
)
|
||||
GLOBAL_PROTECT(admin_verbs_possess)
|
||||
GLOBAL_LIST_INIT(admin_verbs_possess, list(/proc/possess, /proc/release))
|
||||
@@ -448,9 +446,11 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
|
||||
mob.name = initial(mob.name)
|
||||
mob.mouse_opacity = initial(mob.mouse_opacity)
|
||||
else
|
||||
var/new_key = ckeyEx(stripped_input(usr, "Enter your desired display name.", "Fake Key", key, 26))
|
||||
var/new_key = ckeyEx(input("Enter your desired display name.", "Fake Key", key) as text|null)
|
||||
if(!new_key)
|
||||
return
|
||||
if(length(new_key) >= 26)
|
||||
new_key = copytext(new_key, 1, 26)
|
||||
holder.fakekey = new_key
|
||||
createStealthKey()
|
||||
if(isobserver(mob))
|
||||
@@ -557,9 +557,9 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
|
||||
set desc = "Gives a spell to a mob."
|
||||
|
||||
var/list/spell_list = list()
|
||||
var/type_length = length_char("/obj/effect/proc_holder/spell") + 2
|
||||
var/type_length = length("/obj/effect/proc_holder/spell") + 2
|
||||
for(var/A in GLOB.spells)
|
||||
spell_list[copytext_char("[A]", type_length)] = A
|
||||
spell_list[copytext("[A]", type_length)] = A
|
||||
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
|
||||
if(!S)
|
||||
return
|
||||
|
||||
@@ -149,10 +149,10 @@
|
||||
else
|
||||
var/timeleft = SSshuttle.emergency.timeLeft()
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL)
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_leading(num2text(timeleft % 60), 2, "0")]</a><BR>"
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||
dat += "<a href='?_src_=holder;[HrefToken()];call_shuttle=2'>Send Back</a><br>"
|
||||
else
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_leading(num2text(timeleft % 60), 2, "0")]</a><BR>"
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||
dat += "<B>Continuous Round Status</B><BR>"
|
||||
dat += "<a href='?_src_=holder;[HrefToken()];toggle_continuous=1'>[CONFIG_GET(keyed_list/continuous)[SSticker.mode.config_tag] ? "Continue if antagonists die" : "End on antagonist death"]</a>"
|
||||
if(CONFIG_GET(keyed_list/continuous)[SSticker.mode.config_tag])
|
||||
|
||||
@@ -48,7 +48,7 @@ GLOBAL_PROTECT(href_token)
|
||||
target = ckey
|
||||
name = "[ckey]'s admin datum ([R])"
|
||||
rank = R
|
||||
admin_signature = "Kinaris Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
|
||||
admin_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
|
||||
href_token = GenerateToken()
|
||||
if(R.rights & R_DEBUG) //grant profile access
|
||||
world.SetConfig("APP/admin", ckey, "role=admin")
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
if(!SSticker.HasRoundStarted())
|
||||
alert("The game hasn't started yet!")
|
||||
return
|
||||
var/objective = stripped_input(usr, "Enter an objective")
|
||||
var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
|
||||
if(!objective)
|
||||
return
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Traitor All", "[objective]"))
|
||||
|
||||
@@ -52,11 +52,9 @@
|
||||
edit_emitter(user)
|
||||
|
||||
/obj/effect/sound_emitter/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(check_rights_for(user.client, R_SOUNDS))
|
||||
activate(user)
|
||||
to_chat(user, "<span class='notice'>Sound emitter activated.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/effect/sound_emitter/proc/edit_emitter(mob/user)
|
||||
var/dat = ""
|
||||
|
||||
@@ -2399,7 +2399,7 @@
|
||||
|
||||
var/atom/target //Where the object will be spawned
|
||||
var/where = href_list["object_where"]
|
||||
if (!( where in list("onfloor","frompod","inhand","inmarked") ))
|
||||
if (!( where in list("onfloor","inhand","inmarked") ))
|
||||
where = "onfloor"
|
||||
|
||||
|
||||
@@ -2410,7 +2410,7 @@
|
||||
where = "onfloor"
|
||||
target = usr
|
||||
|
||||
if("onfloor", "frompod")
|
||||
if("onfloor")
|
||||
switch(href_list["offset_type"])
|
||||
if ("absolute")
|
||||
target = locate(0 + X,0 + Y,0 + Z)
|
||||
@@ -2426,10 +2426,7 @@
|
||||
else
|
||||
target = marked_datum
|
||||
|
||||
var/obj/structure/closet/supplypod/centcompod/pod
|
||||
if(target)
|
||||
if(where == "frompod")
|
||||
pod = new()
|
||||
for (var/path in paths)
|
||||
for (var/i = 0; i < number; i++)
|
||||
if(path in typesof(/turf))
|
||||
@@ -2438,11 +2435,7 @@
|
||||
if(N && obj_name)
|
||||
N.name = obj_name
|
||||
else
|
||||
var/atom/O
|
||||
if(where == "frompod")
|
||||
O = new path(pod)
|
||||
else
|
||||
O = new path(target)
|
||||
var/atom/O = new path(target)
|
||||
if(!QDELETED(O))
|
||||
O.flags_1 |= ADMIN_SPAWNED_1
|
||||
if(obj_dir)
|
||||
@@ -2462,8 +2455,6 @@
|
||||
R.module.add_module(I, TRUE, TRUE)
|
||||
R.activate_module(I)
|
||||
|
||||
if(pod)
|
||||
new /obj/effect/abstract/DPtarget(target, pod)
|
||||
|
||||
if (number == 1)
|
||||
log_admin("[key_name(usr)] created a [english_list(paths)]")
|
||||
@@ -2492,6 +2483,8 @@
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_feed_channel.channel_name = stripped_input(usr, "Provide a Feed Channel Name.", "Network Channel Handler", "")
|
||||
while (findtext(src.admincaster_feed_channel.channel_name," ") == 1)
|
||||
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,length(src.admincaster_feed_channel.channel_name)+1)
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_set_channel_lock"])
|
||||
@@ -2531,7 +2524,9 @@
|
||||
else if(href_list["ac_set_new_message"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_feed_message.body = adminscrub(stripped_input(usr, "Write your Feed story.", "Network Channel Handler", ""))
|
||||
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story.", "Network Channel Handler", ""))
|
||||
while (findtext(src.admincaster_feed_message.returnBody(-1)," ") == 1)
|
||||
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.returnBody(-1),2,length(src.admincaster_feed_message.returnBody(-1))+1)
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_submit_new_message"])
|
||||
@@ -2590,13 +2585,17 @@
|
||||
else if(href_list["ac_set_wanted_name"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_wanted_message.criminal = adminscrub(stripped_input(usr, "Provide the name of the Wanted person.", "Network Security Handler", ""))
|
||||
src.admincaster_wanted_message.criminal = adminscrub(input(usr, "Provide the name of the Wanted person.", "Network Security Handler", ""))
|
||||
while(findtext(src.admincaster_wanted_message.criminal," ") == 1)
|
||||
src.admincaster_wanted_message.criminal = copytext(admincaster_wanted_message.criminal,2,length(admincaster_wanted_message.criminal)+1)
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_set_wanted_desc"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_wanted_message.body = adminscrub(stripped_input(usr, "Provide the a description of the Wanted person and any other details you deem important.", "Network Security Handler", ""))
|
||||
src.admincaster_wanted_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important.", "Network Security Handler", ""))
|
||||
while (findtext(src.admincaster_wanted_message.body," ") == 1)
|
||||
src.admincaster_wanted_message.body = copytext(src.admincaster_wanted_message.body,2,length(src.admincaster_wanted_message.body)+1)
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_submit_wanted"])
|
||||
@@ -2990,4 +2989,3 @@
|
||||
else
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection. The changes will last only for the current round.</span>")
|
||||
to_chat(usr, "<span class='adminnotice'>Mentor removed.</span>")
|
||||
|
||||
|
||||
@@ -862,8 +862,8 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
else if(ispath(expression[i]))
|
||||
val = expression[i]
|
||||
|
||||
else if(expression[i][1] in list("'", "\""))
|
||||
val = copytext_char(expression[i], 2, -1)
|
||||
else if(copytext(expression[i], 1, 2) in list("'", "\""))
|
||||
val = copytext(expression[i], 2, length(expression[i]))
|
||||
|
||||
else if(expression[i] == "\[")
|
||||
var/list/expressions_list = expression[++i]
|
||||
@@ -954,11 +954,11 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
if(is_proper_datum(object))
|
||||
D = object
|
||||
|
||||
if (object == world && (!long || expression[start + 1] == ".") && !(expression[start] in exclude)) //3 == length("SS") + 1
|
||||
if (object == world && (!long || expression[start + 1] == ".") && !(expression[start] in exclude))
|
||||
to_chat(usr, "<span class='danger'>World variables are not allowed to be accessed. Use global.</span>")
|
||||
return null
|
||||
|
||||
else if(expression [start] == "{" && long) //3 == length("0x") + 1
|
||||
else if(expression [start] == "{" && long)
|
||||
if(lowertext(copytext(expression[start + 1], 1, 3)) != "0x")
|
||||
to_chat(usr, "<span class='danger'>Invalid pointer syntax: [expression[start + 1]]</span>")
|
||||
return null
|
||||
@@ -1063,10 +1063,9 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
var/word = ""
|
||||
var/list/query_list = list()
|
||||
var/len = length(query_text)
|
||||
var/char = ""
|
||||
|
||||
for(var/i = 1, i <= len, i += length(char))
|
||||
char = query_text[i]
|
||||
for(var/i = 1, i <= len, i++)
|
||||
var/char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char in whitespace)
|
||||
if(word != "")
|
||||
@@ -1085,7 +1084,7 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
var/char2 = query_text[i + length(char)]
|
||||
var/char2 = copytext(query_text, i + 1, i + 2)
|
||||
|
||||
if(char2 in multi[char])
|
||||
query_list += "[char][char2]"
|
||||
@@ -1101,13 +1100,13 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
|
||||
word = "'"
|
||||
|
||||
for(i += length(char), i <= len, i += length(char))
|
||||
char = query_text[i]
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "'")
|
||||
if(query_text[i + length(char)] == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "'"
|
||||
i += length(query_text[i + length(char)])
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
@@ -1129,13 +1128,13 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
|
||||
word = "\""
|
||||
|
||||
for(i += length(char), i <= len, i += length(char))
|
||||
char = query_text[i]
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
|
||||
if(char == "\"")
|
||||
if(query_text[i + length(char)] == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
word += "\""
|
||||
i += length(query_text[i + length(char)])
|
||||
i++
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
node += "*"
|
||||
i++
|
||||
|
||||
else if(token(i)[1] == "/")
|
||||
else if (copytext(token(i), 1, 2) == "/")
|
||||
i = object_type(i, node)
|
||||
|
||||
else
|
||||
@@ -377,7 +377,7 @@
|
||||
//object_type: <type path>
|
||||
/datum/SDQL_parser/proc/object_type(i, list/node)
|
||||
|
||||
if(token(i)[1] != "/")
|
||||
if (copytext(token(i), 1, 2) != "/")
|
||||
return parse_error("Expected type, but it didn't begin with /")
|
||||
|
||||
var/path = text2path(token(i))
|
||||
@@ -416,7 +416,7 @@
|
||||
//string: ''' <some text> ''' | '"' <some text > '"'
|
||||
/datum/SDQL_parser/proc/string(i, list/node)
|
||||
|
||||
if(token(i)[1] in list("'", "\""))
|
||||
if(copytext(token(i), 1, 2) in list("'", "\""))
|
||||
node += token(i)
|
||||
|
||||
else
|
||||
@@ -427,7 +427,7 @@
|
||||
//array: '[' expression, expression, ... ']'
|
||||
/datum/SDQL_parser/proc/array(var/i, var/list/node)
|
||||
// Arrays get turned into this: list("[", list(exp_1a = exp_1b, ...), ...), "[" is to mark the next node as an array.
|
||||
if(token(i)[1] != "\[")
|
||||
if(copytext(token(i), 1, 2) != "\[")
|
||||
parse_error("Expected an array but found '[token(i)]'")
|
||||
return i + 1
|
||||
|
||||
@@ -613,7 +613,7 @@
|
||||
node += "null"
|
||||
i++
|
||||
|
||||
else if(lowertext(copytext(token(i), 1, 3)) == "0x" && isnum(hex2num(copytext(token(i), 3))))//3 == length("0x") + 1
|
||||
else if(lowertext(copytext(token(i), 1, 3)) == "0x" && isnum(hex2num(copytext(token(i), 3))))
|
||||
node += hex2num(copytext(token(i), 3))
|
||||
i++
|
||||
|
||||
@@ -621,12 +621,12 @@
|
||||
node += text2num(token(i))
|
||||
i++
|
||||
|
||||
else if(token(i)[1] in list("'", "\""))
|
||||
else if(copytext(token(i), 1, 2) in list("'", "\""))
|
||||
i = string(i, node)
|
||||
|
||||
else if(token(i)[1] == "\[") // Start a list.
|
||||
else if(copytext(token(i), 1, 2) == "\[") // Start a list.
|
||||
i = array(i, node)
|
||||
else if(token(i)[1] == "/")
|
||||
else if(copytext(token(i), 1, 2) == "/")
|
||||
i = object_type(i, node)
|
||||
else
|
||||
i = variable(i, node)
|
||||
|
||||
@@ -165,7 +165,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
//is_bwoink is TRUE if this ticket was started by an admin PM
|
||||
/datum/admin_help/New(msg, client/C, is_bwoink)
|
||||
//clean the input msg
|
||||
msg = sanitize(copytext_char(msg,1,MAX_MESSAGE_LEN))
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
if(!msg || !C || !C.mob)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return
|
||||
var/client/C
|
||||
if(istext(whom))
|
||||
if(whom[1] == "@")
|
||||
if(cmptext(copytext(whom,1,2),"@"))
|
||||
whom = findStealthKey(whom)
|
||||
C = GLOB.directory[whom]
|
||||
else if(istype(whom, /client))
|
||||
@@ -76,7 +76,7 @@
|
||||
var/client/recipient
|
||||
var/irc = 0
|
||||
if(istext(whom))
|
||||
if(whom[1] == "@")
|
||||
if(cmptext(copytext(whom,1,2),"@"))
|
||||
whom = findStealthKey(whom)
|
||||
if(whom == "IRCKEY")
|
||||
irc = 1
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
//clean the message if it's not sent by a high-rank admin
|
||||
if(!check_rights(R_SERVER|R_DEBUG,0)||irc)//no sending html to the poor bots
|
||||
msg = trim(sanitize(msg), MAX_MESSAGE_LEN)
|
||||
msg = trim(sanitize(copytext(msg,1,MAX_MESSAGE_LEN)))
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
if(!stealthkey)
|
||||
stealthkey = GenIrcStealthKey()
|
||||
|
||||
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
if(!msg)
|
||||
return "Error: No message"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
return
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))
|
||||
return
|
||||
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
mob.log_talk(msg, LOG_DSAY)
|
||||
|
||||
if (!msg)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var/map = input(src, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file
|
||||
if(!map)
|
||||
return
|
||||
if(copytext("[map]", -4) != ".dmm")//4 == length(".dmm")
|
||||
if(copytext("[map]",-4) != ".dmm")
|
||||
to_chat(src, "<span class='warning'>Filename must end in '.dmm': [map]</span>")
|
||||
return
|
||||
var/datum/map_template/M
|
||||
|
||||
@@ -1,377 +1,358 @@
|
||||
//- Are all the floors with or without air, as they should be? (regular or airless)
|
||||
//- Does the area have an APC?
|
||||
//- Does the area have an Air Alarm?
|
||||
//- Does the area have a Request Console?
|
||||
//- Does the area have lights?
|
||||
//- Does the area have a light switch?
|
||||
//- Does the area have enough intercoms?
|
||||
//- Does the area have enough security cameras? (Use the 'Camera Range Display' verb under Debug)
|
||||
//- Is the area connected to the scrubbers air loop?
|
||||
//- Is the area connected to the vent air loop? (vent pumps)
|
||||
//- Is everything wired properly?
|
||||
//- Does the area have a fire alarm and firedoors?
|
||||
//- Do all pod doors work properly?
|
||||
//- Are accesses set properly on doors, pod buttons, etc.
|
||||
//- Are all items placed properly? (not below vents, scrubbers, tables)
|
||||
//- Does the disposal system work properly from all the disposal units in this room and all the units, the pipes of which pass through this room?
|
||||
//- Check for any misplaced or stacked piece of pipe (air and disposal)
|
||||
//- Check for any misplaced or stacked piece of wire
|
||||
//- Identify how hard it is to break into the area and where the weak points are
|
||||
//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.
|
||||
|
||||
GLOBAL_PROTECT(admin_verbs_debug_mapping)
|
||||
GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list(
|
||||
/client/proc/camera_view, //-errorage
|
||||
/client/proc/sec_camera_report, //-errorage
|
||||
/client/proc/intercom_view, //-errorage
|
||||
/client/proc/air_status, //Air things
|
||||
/client/proc/Cell, //More air things
|
||||
/client/proc/atmosscan, //check plumbing
|
||||
/client/proc/powerdebug, //check power
|
||||
/client/proc/count_objects_on_z_level,
|
||||
/client/proc/count_objects_all,
|
||||
/client/proc/cmd_assume_direct_control, //-errorage
|
||||
/client/proc/startSinglo,
|
||||
/client/proc/set_server_fps, //allows you to set the ticklag.
|
||||
/client/proc/cmd_admin_grantfullaccess,
|
||||
/client/proc/cmd_admin_areatest_all,
|
||||
/client/proc/cmd_admin_areatest_station,
|
||||
#ifdef TESTING
|
||||
/client/proc/see_dirty_varedits,
|
||||
#endif
|
||||
/client/proc/cmd_admin_test_atmos_controllers,
|
||||
/client/proc/cmd_admin_rejuvenate,
|
||||
/datum/admins/proc/show_traitor_panel,
|
||||
/client/proc/disable_communication,
|
||||
/client/proc/cmd_show_at_list,
|
||||
/client/proc/cmd_show_at_markers,
|
||||
/client/proc/manipulate_organs,
|
||||
/client/proc/start_line_profiling,
|
||||
/client/proc/stop_line_profiling,
|
||||
/client/proc/show_line_profiling,
|
||||
/client/proc/create_mapping_job_icons,
|
||||
/client/proc/debug_z_levels,
|
||||
/client/proc/place_ruin
|
||||
))
|
||||
|
||||
/obj/effect/debugging/mapfix_marker
|
||||
name = "map fix marker"
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
icon_state = "mapfixmarker"
|
||||
desc = "I am a mappers mistake."
|
||||
|
||||
/obj/effect/debugging/marker
|
||||
icon = 'icons/turf/areas.dmi'
|
||||
icon_state = "yellow"
|
||||
|
||||
/obj/effect/debugging/marker/Move()
|
||||
return 0
|
||||
|
||||
/client/proc/camera_view()
|
||||
set category = "Mapping"
|
||||
set name = "Camera Range Display"
|
||||
|
||||
var/on = FALSE
|
||||
for(var/turf/T in world)
|
||||
if(T.maptext)
|
||||
on = TRUE
|
||||
T.maptext = null
|
||||
|
||||
if(!on)
|
||||
var/list/seen = list()
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
for(var/turf/T in C.can_see())
|
||||
seen[T]++
|
||||
for(var/turf/T in seen)
|
||||
T.maptext = "[seen[T]]"
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range")
|
||||
|
||||
#ifdef TESTING
|
||||
GLOBAL_LIST_EMPTY(dirty_vars)
|
||||
|
||||
|
||||
/client/proc/see_dirty_varedits()
|
||||
set category = "Mapping"
|
||||
set name = "Dirty Varedits"
|
||||
|
||||
var/list/dat = list()
|
||||
dat += "<h3>Abandon all hope ye who enter here</h3><br><br>"
|
||||
for(var/thing in GLOB.dirty_vars)
|
||||
dat += "[thing]<br>"
|
||||
CHECK_TICK
|
||||
var/datum/browser/popup = new(usr, "dirty_vars", "Dirty Varedits", 900, 750)
|
||||
popup.set_content(dat.Join())
|
||||
popup.open()
|
||||
#endif
|
||||
|
||||
/client/proc/sec_camera_report()
|
||||
set category = "Mapping"
|
||||
set name = "Camera Report"
|
||||
|
||||
if(!Master)
|
||||
alert(usr,"Master_controller not found.","Sec Camera Report")
|
||||
return 0
|
||||
|
||||
var/list/obj/machinery/camera/CL = list()
|
||||
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
CL += C
|
||||
|
||||
var/output = {"<B>Camera Abnormalities Report</B><HR>
|
||||
<B>The following abnormalities have been detected. The ones in red need immediate attention: Some of those in black may be intentional.</B><BR><ul>"}
|
||||
|
||||
for(var/obj/machinery/camera/C1 in CL)
|
||||
for(var/obj/machinery/camera/C2 in CL)
|
||||
if(C1 != C2)
|
||||
if(C1.c_tag == C2.c_tag)
|
||||
output += "<li><font color='red'>c_tag match for cameras at [ADMIN_VERBOSEJMP(C1)] and [ADMIN_VERBOSEJMP(C2)] - c_tag is [C1.c_tag]</font></li>"
|
||||
if(C1.loc == C2.loc && C1.dir == C2.dir && C1.pixel_x == C2.pixel_x && C1.pixel_y == C2.pixel_y)
|
||||
output += "<li><font color='red'>FULLY overlapping cameras at [ADMIN_VERBOSEJMP(C1)] Networks: [json_encode(C1.network)] and [json_encode(C2.network)]</font></li>"
|
||||
if(C1.loc == C2.loc)
|
||||
output += "<li>Overlapping cameras at [ADMIN_VERBOSEJMP(C1)] Networks: [json_encode(C1.network)] and [json_encode(C2.network)]</li>"
|
||||
var/turf/T = get_step(C1,turn(C1.dir,180))
|
||||
if(!T || !isturf(T) || !T.density )
|
||||
if(!(locate(/obj/structure/grille) in T))
|
||||
var/window_check = 0
|
||||
for(var/obj/structure/window/W in T)
|
||||
if (W.dir == turn(C1.dir,180) || W.dir in list(5,6,9,10) )
|
||||
window_check = 1
|
||||
break
|
||||
if(!window_check)
|
||||
output += "<li><font color='red'>Camera not connected to wall at [ADMIN_VERBOSEJMP(C1)] Network: [json_encode(C1.network)]</font></li>"
|
||||
|
||||
output += "</ul>"
|
||||
usr << browse(output,"window=airreport;size=1000x500")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Report") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/intercom_view()
|
||||
set category = "Mapping"
|
||||
set name = "Intercom Range Display"
|
||||
|
||||
var/static/intercom_range_display_status = FALSE
|
||||
intercom_range_display_status = !intercom_range_display_status //blame cyberboss if this breaks something
|
||||
|
||||
for(var/obj/effect/debugging/marker/M in world)
|
||||
qdel(M)
|
||||
|
||||
if(intercom_range_display_status)
|
||||
for(var/obj/item/radio/intercom/I in world)
|
||||
for(var/turf/T in orange(7,I))
|
||||
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
|
||||
if (!(F in view(7,I.loc)))
|
||||
qdel(F)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Intercom Range") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_show_at_list()
|
||||
set category = "Mapping"
|
||||
set name = "Show roundstart AT list"
|
||||
set desc = "Displays a list of active turfs coordinates at roundstart"
|
||||
|
||||
var/dat = {"<b>Coordinate list of Active Turfs at Roundstart</b>
|
||||
<br>Real-time Active Turfs list you can see in Air Subsystem at active_turfs var<br>"}
|
||||
|
||||
for(var/t in GLOB.active_turfs_startlist)
|
||||
var/turf/T = t
|
||||
dat += "[ADMIN_VERBOSEJMP(T)]\n"
|
||||
dat += "<br>"
|
||||
|
||||
usr << browse(dat, "window=at_list")
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Roundstart Active Turfs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_show_at_markers()
|
||||
set category = "Mapping"
|
||||
set name = "Show roundstart AT markers"
|
||||
set desc = "Places a marker on all active-at-roundstart turfs"
|
||||
|
||||
var/count = 0
|
||||
for(var/obj/effect/abstract/marker/at/AT in GLOB.all_abstract_markers)
|
||||
qdel(AT)
|
||||
count++
|
||||
|
||||
if(count)
|
||||
to_chat(usr, "[count] AT markers removed.")
|
||||
else
|
||||
for(var/t in GLOB.active_turfs_startlist)
|
||||
new /obj/effect/abstract/marker/at(t)
|
||||
count++
|
||||
to_chat(usr, "[count] AT markers placed.")
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Roundstart Active Turf Markers")
|
||||
|
||||
/client/proc/enable_debug_verbs()
|
||||
set category = "Debug"
|
||||
set name = "Debug verbs - Enable"
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
verbs -= /client/proc/enable_debug_verbs
|
||||
verbs.Add(/client/proc/disable_debug_verbs, GLOB.admin_verbs_debug_mapping)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Enable Debug Verbs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/disable_debug_verbs()
|
||||
set category = "Debug"
|
||||
set name = "Debug verbs - Disable"
|
||||
verbs.Remove(/client/proc/disable_debug_verbs, GLOB.admin_verbs_debug_mapping)
|
||||
verbs += /client/proc/enable_debug_verbs
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Disable Debug Verbs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/count_objects_on_z_level()
|
||||
set category = "Mapping"
|
||||
set name = "Count Objects On Level"
|
||||
var/level = input("Which z-level?","Level?") as text
|
||||
if(!level)
|
||||
return
|
||||
var/num_level = text2num(level)
|
||||
if(!num_level)
|
||||
return
|
||||
if(!isnum(num_level))
|
||||
return
|
||||
|
||||
var/type_text = input("Which type path?","Path?") as text
|
||||
if(!type_text)
|
||||
return
|
||||
var/type_path = text2path(type_text)
|
||||
if(!type_path)
|
||||
return
|
||||
|
||||
var/count = 0
|
||||
|
||||
var/list/atom/atom_list = list()
|
||||
|
||||
for(var/atom/A in world)
|
||||
if(istype(A,type_path))
|
||||
var/atom/B = A
|
||||
while(!(isturf(B.loc)))
|
||||
if(B && B.loc)
|
||||
B = B.loc
|
||||
else
|
||||
break
|
||||
if(B)
|
||||
if(B.z == num_level)
|
||||
count++
|
||||
atom_list += A
|
||||
|
||||
to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Count Objects Zlevel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/count_objects_all()
|
||||
set category = "Mapping"
|
||||
set name = "Count Objects All"
|
||||
|
||||
var/type_text = input("Which type path?","") as text
|
||||
if(!type_text)
|
||||
return
|
||||
var/type_path = text2path(type_text)
|
||||
if(!type_path)
|
||||
return
|
||||
|
||||
var/count = 0
|
||||
|
||||
for(var/atom/A in world)
|
||||
if(istype(A,type_path))
|
||||
count++
|
||||
|
||||
to_chat(world, "There are [count] objects of type [type_path] in the game world")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Count Objects All") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
//This proc is intended to detect lag problems relating to communication procs
|
||||
GLOBAL_VAR_INIT(say_disabled, FALSE)
|
||||
/client/proc/disable_communication()
|
||||
set category = "Mapping"
|
||||
set name = "Disable all communication verbs"
|
||||
|
||||
GLOB.say_disabled = !GLOB.say_disabled
|
||||
if(GLOB.say_disabled)
|
||||
message_admins("[key] used 'Disable all communication verbs', killing all communication methods.")
|
||||
else
|
||||
message_admins("[key] used 'Disable all communication verbs', restoring all communication methods.")
|
||||
|
||||
//This generates the icon states for job starting location landmarks.
|
||||
/client/proc/create_mapping_job_icons()
|
||||
set name = "Generate job landmarks icons"
|
||||
set category = "Mapping"
|
||||
var/icon/final = icon()
|
||||
var/mob/living/carbon/human/dummy/D = new(locate(1,1,1)) //spawn on 1,1,1 so we don't have runtimes when items are deleted
|
||||
D.setDir(SOUTH)
|
||||
for(var/job in subtypesof(/datum/job))
|
||||
var/datum/job/JB = new job
|
||||
switch(JB.title)
|
||||
if("AI")
|
||||
final.Insert(icon('icons/mob/ai.dmi', "ai", SOUTH, 1), "AI")
|
||||
if("Cyborg")
|
||||
final.Insert(icon('icons/mob/robots.dmi', "robot", SOUTH, 1), "Cyborg")
|
||||
else
|
||||
for(var/obj/item/I in D)
|
||||
qdel(I)
|
||||
randomize_human(D)
|
||||
JB.equip(D, TRUE, FALSE)
|
||||
COMPILE_OVERLAYS(D)
|
||||
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
||||
final.Insert(I, JB.title)
|
||||
qdel(D)
|
||||
//Also add the x
|
||||
for(var/x_number in 1 to 4)
|
||||
final.Insert(icon('icons/mob/screen_gen.dmi', "x[x_number == 1 ? "" : x_number]"), "x[x_number == 1 ? "" : x_number]")
|
||||
fcopy(final, "icons/mob/landmarks.dmi")
|
||||
|
||||
/client/proc/debug_z_levels()
|
||||
set name = "Debug Z-Levels"
|
||||
set category = "Mapping"
|
||||
|
||||
var/list/z_list = SSmapping.z_list
|
||||
var/list/messages = list()
|
||||
messages += "<b>World</b>: [world.maxx] x [world.maxy] x [world.maxz]<br>"
|
||||
|
||||
var/list/linked_levels = list()
|
||||
var/min_x = INFINITY
|
||||
var/min_y = INFINITY
|
||||
var/max_x = -INFINITY
|
||||
var/max_y = -INFINITY
|
||||
|
||||
for(var/z in 1 to max(world.maxz, z_list.len))
|
||||
if (z > z_list.len)
|
||||
messages += "<b>[z]</b>: Unmanaged (out of bounds)<br>"
|
||||
continue
|
||||
var/datum/space_level/S = z_list[z]
|
||||
if (!S)
|
||||
messages += "<b>[z]</b>: Unmanaged (null)<br>"
|
||||
continue
|
||||
var/linkage
|
||||
switch (S.linkage)
|
||||
if (UNAFFECTED)
|
||||
linkage = "no linkage"
|
||||
if (SELFLOOPING)
|
||||
linkage = "self-looping"
|
||||
if (CROSSLINKED)
|
||||
linkage = "linked at ([S.xi], [S.yi])"
|
||||
linked_levels += S
|
||||
min_x = min(min_x, S.xi)
|
||||
min_y = min(min_y, S.yi)
|
||||
max_x = max(max_x, S.xi)
|
||||
max_y = max(max_y, S.yi)
|
||||
else
|
||||
linkage = "unknown linkage '[S.linkage]'"
|
||||
|
||||
messages += "<b>[z]</b>: [S.name], [linkage], traits: [json_encode(S.traits)]<br>"
|
||||
if (S.z_value != z)
|
||||
messages += "-- z_value is [S.z_value], should be [z]<br>"
|
||||
if (S.name == initial(S.name))
|
||||
messages += "-- name not set<br>"
|
||||
if (z > world.maxz)
|
||||
messages += "-- exceeds max z"
|
||||
|
||||
var/grid[max_x - min_x + 1][max_y - min_y + 1]
|
||||
for(var/datum/space_level/S in linked_levels)
|
||||
grid[S.xi - min_x + 1][S.yi - min_y + 1] = S.z_value
|
||||
|
||||
messages += "<table border='1'>"
|
||||
for(var/y in max_y to min_y step -1)
|
||||
var/list/part = list()
|
||||
for(var/x in min_x to max_x)
|
||||
part += "[grid[x - min_x + 1][y - min_y + 1]]"
|
||||
messages += "<tr><td>[part.Join("</td><td>")]</td></tr>"
|
||||
messages += "</table>"
|
||||
|
||||
to_chat(src, messages.Join(""))
|
||||
//- Are all the floors with or without air, as they should be? (regular or airless)
|
||||
//- Does the area have an APC?
|
||||
//- Does the area have an Air Alarm?
|
||||
//- Does the area have a Request Console?
|
||||
//- Does the area have lights?
|
||||
//- Does the area have a light switch?
|
||||
//- Does the area have enough intercoms?
|
||||
//- Does the area have enough security cameras? (Use the 'Camera Range Display' verb under Debug)
|
||||
//- Is the area connected to the scrubbers air loop?
|
||||
//- Is the area connected to the vent air loop? (vent pumps)
|
||||
//- Is everything wired properly?
|
||||
//- Does the area have a fire alarm and firedoors?
|
||||
//- Do all pod doors work properly?
|
||||
//- Are accesses set properly on doors, pod buttons, etc.
|
||||
//- Are all items placed properly? (not below vents, scrubbers, tables)
|
||||
//- Does the disposal system work properly from all the disposal units in this room and all the units, the pipes of which pass through this room?
|
||||
//- Check for any misplaced or stacked piece of pipe (air and disposal)
|
||||
//- Check for any misplaced or stacked piece of wire
|
||||
//- Identify how hard it is to break into the area and where the weak points are
|
||||
//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.
|
||||
|
||||
GLOBAL_PROTECT(admin_verbs_debug_mapping)
|
||||
GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list(
|
||||
/client/proc/camera_view, //-errorage
|
||||
/client/proc/sec_camera_report, //-errorage
|
||||
/client/proc/intercom_view, //-errorage
|
||||
/client/proc/air_status, //Air things
|
||||
/client/proc/Cell, //More air things
|
||||
/client/proc/atmosscan, //check plumbing
|
||||
/client/proc/powerdebug, //check power
|
||||
/client/proc/count_objects_on_z_level,
|
||||
/client/proc/count_objects_all,
|
||||
/client/proc/cmd_assume_direct_control, //-errorage
|
||||
/client/proc/startSinglo,
|
||||
/client/proc/set_server_fps, //allows you to set the ticklag.
|
||||
/client/proc/cmd_admin_grantfullaccess,
|
||||
/client/proc/cmd_admin_areatest_all,
|
||||
/client/proc/cmd_admin_areatest_station,
|
||||
/client/proc/cmd_admin_test_atmos_controllers,
|
||||
/client/proc/cmd_admin_rejuvenate,
|
||||
/datum/admins/proc/show_traitor_panel,
|
||||
/client/proc/disable_communication,
|
||||
/client/proc/cmd_show_at_list,
|
||||
/client/proc/cmd_show_at_markers,
|
||||
/client/proc/manipulate_organs,
|
||||
/client/proc/start_line_profiling,
|
||||
/client/proc/stop_line_profiling,
|
||||
/client/proc/show_line_profiling,
|
||||
/client/proc/create_mapping_job_icons,
|
||||
/client/proc/debug_z_levels,
|
||||
/client/proc/place_ruin
|
||||
))
|
||||
|
||||
/obj/effect/debugging/mapfix_marker
|
||||
name = "map fix marker"
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
icon_state = "mapfixmarker"
|
||||
desc = "I am a mappers mistake."
|
||||
|
||||
/obj/effect/debugging/marker
|
||||
icon = 'icons/turf/areas.dmi'
|
||||
icon_state = "yellow"
|
||||
|
||||
/obj/effect/debugging/marker/Move()
|
||||
return 0
|
||||
|
||||
/client/proc/camera_view()
|
||||
set category = "Mapping"
|
||||
set name = "Camera Range Display"
|
||||
|
||||
var/on = FALSE
|
||||
for(var/turf/T in world)
|
||||
if(T.maptext)
|
||||
on = TRUE
|
||||
T.maptext = null
|
||||
|
||||
if(!on)
|
||||
var/list/seen = list()
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
for(var/turf/T in C.can_see())
|
||||
seen[T]++
|
||||
for(var/turf/T in seen)
|
||||
T.maptext = "[seen[T]]"
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range")
|
||||
|
||||
|
||||
|
||||
/client/proc/sec_camera_report()
|
||||
set category = "Mapping"
|
||||
set name = "Camera Report"
|
||||
|
||||
if(!Master)
|
||||
alert(usr,"Master_controller not found.","Sec Camera Report")
|
||||
return 0
|
||||
|
||||
var/list/obj/machinery/camera/CL = list()
|
||||
|
||||
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
CL += C
|
||||
|
||||
var/output = {"<B>Camera Abnormalities Report</B><HR>
|
||||
<B>The following abnormalities have been detected. The ones in red need immediate attention: Some of those in black may be intentional.</B><BR><ul>"}
|
||||
|
||||
for(var/obj/machinery/camera/C1 in CL)
|
||||
for(var/obj/machinery/camera/C2 in CL)
|
||||
if(C1 != C2)
|
||||
if(C1.c_tag == C2.c_tag)
|
||||
output += "<li><font color='red'>c_tag match for cameras at [ADMIN_VERBOSEJMP(C1)] and [ADMIN_VERBOSEJMP(C2)] - c_tag is [C1.c_tag]</font></li>"
|
||||
if(C1.loc == C2.loc && C1.dir == C2.dir && C1.pixel_x == C2.pixel_x && C1.pixel_y == C2.pixel_y)
|
||||
output += "<li><font color='red'>FULLY overlapping cameras at [ADMIN_VERBOSEJMP(C1)] Networks: [json_encode(C1.network)] and [json_encode(C2.network)]</font></li>"
|
||||
if(C1.loc == C2.loc)
|
||||
output += "<li>Overlapping cameras at [ADMIN_VERBOSEJMP(C1)] Networks: [json_encode(C1.network)] and [json_encode(C2.network)]</li>"
|
||||
var/turf/T = get_step(C1,turn(C1.dir,180))
|
||||
if(!T || !isturf(T) || !T.density )
|
||||
if(!(locate(/obj/structure/grille) in T))
|
||||
var/window_check = 0
|
||||
for(var/obj/structure/window/W in T)
|
||||
if (W.dir == turn(C1.dir,180) || W.dir in list(5,6,9,10) )
|
||||
window_check = 1
|
||||
break
|
||||
if(!window_check)
|
||||
output += "<li><font color='red'>Camera not connected to wall at [ADMIN_VERBOSEJMP(C1)] Network: [json_encode(C1.network)]</font></li>"
|
||||
|
||||
output += "</ul>"
|
||||
usr << browse(output,"window=airreport;size=1000x500")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Report") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/intercom_view()
|
||||
set category = "Mapping"
|
||||
set name = "Intercom Range Display"
|
||||
|
||||
var/static/intercom_range_display_status = FALSE
|
||||
intercom_range_display_status = !intercom_range_display_status //blame cyberboss if this breaks something
|
||||
|
||||
for(var/obj/effect/debugging/marker/M in world)
|
||||
qdel(M)
|
||||
|
||||
if(intercom_range_display_status)
|
||||
for(var/obj/item/radio/intercom/I in world)
|
||||
for(var/turf/T in orange(7,I))
|
||||
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
|
||||
if (!(F in view(7,I.loc)))
|
||||
qdel(F)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Intercom Range") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_show_at_list()
|
||||
set category = "Mapping"
|
||||
set name = "Show roundstart AT list"
|
||||
set desc = "Displays a list of active turfs coordinates at roundstart"
|
||||
|
||||
var/dat = {"<b>Coordinate list of Active Turfs at Roundstart</b>
|
||||
<br>Real-time Active Turfs list you can see in Air Subsystem at active_turfs var<br>"}
|
||||
|
||||
for(var/t in GLOB.active_turfs_startlist)
|
||||
var/turf/T = t
|
||||
dat += "[ADMIN_VERBOSEJMP(T)]\n"
|
||||
dat += "<br>"
|
||||
|
||||
usr << browse(dat, "window=at_list")
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Roundstart Active Turfs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_show_at_markers()
|
||||
set category = "Mapping"
|
||||
set name = "Show roundstart AT markers"
|
||||
set desc = "Places a marker on all active-at-roundstart turfs"
|
||||
|
||||
var/count = 0
|
||||
for(var/obj/effect/abstract/marker/at/AT in GLOB.all_abstract_markers)
|
||||
qdel(AT)
|
||||
count++
|
||||
|
||||
if(count)
|
||||
to_chat(usr, "[count] AT markers removed.")
|
||||
else
|
||||
for(var/t in GLOB.active_turfs_startlist)
|
||||
new /obj/effect/abstract/marker/at(t)
|
||||
count++
|
||||
to_chat(usr, "[count] AT markers placed.")
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Roundstart Active Turf Markers")
|
||||
|
||||
/client/proc/enable_debug_verbs()
|
||||
set category = "Debug"
|
||||
set name = "Debug verbs - Enable"
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
verbs -= /client/proc/enable_debug_verbs
|
||||
verbs.Add(/client/proc/disable_debug_verbs, GLOB.admin_verbs_debug_mapping)
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Enable Debug Verbs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/disable_debug_verbs()
|
||||
set category = "Debug"
|
||||
set name = "Debug verbs - Disable"
|
||||
verbs.Remove(/client/proc/disable_debug_verbs, GLOB.admin_verbs_debug_mapping)
|
||||
verbs += /client/proc/enable_debug_verbs
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Disable Debug Verbs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/count_objects_on_z_level()
|
||||
set category = "Mapping"
|
||||
set name = "Count Objects On Level"
|
||||
var/level = input("Which z-level?","Level?") as text
|
||||
if(!level)
|
||||
return
|
||||
var/num_level = text2num(level)
|
||||
if(!num_level)
|
||||
return
|
||||
if(!isnum(num_level))
|
||||
return
|
||||
|
||||
var/type_text = input("Which type path?","Path?") as text
|
||||
if(!type_text)
|
||||
return
|
||||
var/type_path = text2path(type_text)
|
||||
if(!type_path)
|
||||
return
|
||||
|
||||
var/count = 0
|
||||
|
||||
var/list/atom/atom_list = list()
|
||||
|
||||
for(var/atom/A in world)
|
||||
if(istype(A,type_path))
|
||||
var/atom/B = A
|
||||
while(!(isturf(B.loc)))
|
||||
if(B && B.loc)
|
||||
B = B.loc
|
||||
else
|
||||
break
|
||||
if(B)
|
||||
if(B.z == num_level)
|
||||
count++
|
||||
atom_list += A
|
||||
|
||||
to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Count Objects Zlevel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/count_objects_all()
|
||||
set category = "Mapping"
|
||||
set name = "Count Objects All"
|
||||
|
||||
var/type_text = input("Which type path?","") as text
|
||||
if(!type_text)
|
||||
return
|
||||
var/type_path = text2path(type_text)
|
||||
if(!type_path)
|
||||
return
|
||||
|
||||
var/count = 0
|
||||
|
||||
for(var/atom/A in world)
|
||||
if(istype(A,type_path))
|
||||
count++
|
||||
|
||||
to_chat(world, "There are [count] objects of type [type_path] in the game world")
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Count Objects All") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
//This proc is intended to detect lag problems relating to communication procs
|
||||
GLOBAL_VAR_INIT(say_disabled, FALSE)
|
||||
/client/proc/disable_communication()
|
||||
set category = "Mapping"
|
||||
set name = "Disable all communication verbs"
|
||||
|
||||
GLOB.say_disabled = !GLOB.say_disabled
|
||||
if(GLOB.say_disabled)
|
||||
message_admins("[key] used 'Disable all communication verbs', killing all communication methods.")
|
||||
else
|
||||
message_admins("[key] used 'Disable all communication verbs', restoring all communication methods.")
|
||||
|
||||
//This generates the icon states for job starting location landmarks.
|
||||
/client/proc/create_mapping_job_icons()
|
||||
set name = "Generate job landmarks icons"
|
||||
set category = "Mapping"
|
||||
var/icon/final = icon()
|
||||
var/mob/living/carbon/human/dummy/D = new(locate(1,1,1)) //spawn on 1,1,1 so we don't have runtimes when items are deleted
|
||||
D.setDir(SOUTH)
|
||||
for(var/job in subtypesof(/datum/job))
|
||||
var/datum/job/JB = new job
|
||||
switch(JB.title)
|
||||
if("AI")
|
||||
final.Insert(icon('icons/mob/ai.dmi', "ai", SOUTH, 1), "AI")
|
||||
if("Cyborg")
|
||||
final.Insert(icon('icons/mob/robots.dmi', "robot", SOUTH, 1), "Cyborg")
|
||||
else
|
||||
for(var/obj/item/I in D)
|
||||
qdel(I)
|
||||
randomize_human(D)
|
||||
JB.equip(D, TRUE, FALSE)
|
||||
COMPILE_OVERLAYS(D)
|
||||
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
||||
final.Insert(I, JB.title)
|
||||
qdel(D)
|
||||
//Also add the x
|
||||
for(var/x_number in 1 to 4)
|
||||
final.Insert(icon('icons/mob/screen_gen.dmi', "x[x_number == 1 ? "" : x_number]"), "x[x_number == 1 ? "" : x_number]")
|
||||
fcopy(final, "icons/mob/landmarks.dmi")
|
||||
|
||||
/client/proc/debug_z_levels()
|
||||
set name = "Debug Z-Levels"
|
||||
set category = "Mapping"
|
||||
|
||||
var/list/z_list = SSmapping.z_list
|
||||
var/list/messages = list()
|
||||
messages += "<b>World</b>: [world.maxx] x [world.maxy] x [world.maxz]<br>"
|
||||
|
||||
var/list/linked_levels = list()
|
||||
var/min_x = INFINITY
|
||||
var/min_y = INFINITY
|
||||
var/max_x = -INFINITY
|
||||
var/max_y = -INFINITY
|
||||
|
||||
for(var/z in 1 to max(world.maxz, z_list.len))
|
||||
if (z > z_list.len)
|
||||
messages += "<b>[z]</b>: Unmanaged (out of bounds)<br>"
|
||||
continue
|
||||
var/datum/space_level/S = z_list[z]
|
||||
if (!S)
|
||||
messages += "<b>[z]</b>: Unmanaged (null)<br>"
|
||||
continue
|
||||
var/linkage
|
||||
switch (S.linkage)
|
||||
if (UNAFFECTED)
|
||||
linkage = "no linkage"
|
||||
if (SELFLOOPING)
|
||||
linkage = "self-looping"
|
||||
if (CROSSLINKED)
|
||||
linkage = "linked at ([S.xi], [S.yi])"
|
||||
linked_levels += S
|
||||
min_x = min(min_x, S.xi)
|
||||
min_y = min(min_y, S.yi)
|
||||
max_x = max(max_x, S.xi)
|
||||
max_y = max(max_y, S.yi)
|
||||
else
|
||||
linkage = "unknown linkage '[S.linkage]'"
|
||||
|
||||
messages += "<b>[z]</b>: [S.name], [linkage], traits: [json_encode(S.traits)]<br>"
|
||||
if (S.z_value != z)
|
||||
messages += "-- z_value is [S.z_value], should be [z]<br>"
|
||||
if (S.name == initial(S.name))
|
||||
messages += "-- name not set<br>"
|
||||
if (z > world.maxz)
|
||||
messages += "-- exceeds max z"
|
||||
|
||||
var/grid[max_x - min_x + 1][max_y - min_y + 1]
|
||||
for(var/datum/space_level/S in linked_levels)
|
||||
grid[S.xi - min_x + 1][S.yi - min_y + 1] = S.z_value
|
||||
|
||||
messages += "<table border='1'>"
|
||||
for(var/y in max_y to min_y step -1)
|
||||
var/list/part = list()
|
||||
for(var/x in min_x to max_x)
|
||||
part += "[grid[x - min_x + 1][y - min_y + 1]]"
|
||||
messages += "<tr><td>[part.Join("</td><td>")]</td></tr>"
|
||||
messages += "</table>"
|
||||
|
||||
to_chat(src, messages.Join(""))
|
||||
|
||||
@@ -307,9 +307,9 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
// the type with the base type removed from the begaining
|
||||
var/fancytype = types[D.type]
|
||||
if (findtext(fancytype, types[type]))
|
||||
fancytype = copytext(fancytype, length(types[type]) + 1)
|
||||
var/shorttype = copytext("[D.type]", length("[type]") + 1)
|
||||
if (length_char(shorttype) > length_char(fancytype))
|
||||
fancytype = copytext(fancytype, length(types[type])+1)
|
||||
var/shorttype = copytext("[D.type]", length("[type]")+1)
|
||||
if (length(shorttype) > length(fancytype))
|
||||
shorttype = fancytype
|
||||
if (!length(shorttype))
|
||||
shorttype = "/"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
return
|
||||
log_prayer("[src.key]/([src.name]): [msg]")
|
||||
@@ -54,21 +54,21 @@
|
||||
//log_admin("HELP: [key_name(src)]: [msg]")
|
||||
|
||||
/proc/CentCom_announce(text , mob/Sender)
|
||||
var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
msg = "<span class='adminnotice'><b><font color=orange>CENTCOM:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_CENTCOM_REPLY(Sender)]:</b> [msg]</span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
/proc/Syndicate_announce(text , mob/Sender)
|
||||
var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
msg = "<span class='adminnotice'><b><font color=crimson>SYNDICATE:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_SYNDICATE_REPLY(Sender)]:</b> [msg]</span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
/proc/Nuke_request(text , mob/Sender)
|
||||
var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
msg = "<span class='adminnotice'><b><font color=orange>NUKE CODE REQUEST:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_CENTCOM_REPLY(Sender)] [ADMIN_SET_SD_CODE]:</b> [msg]</span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
|
||||
@@ -1243,31 +1243,13 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggled Hub Visibility", "[GLOB.hub_visibility ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/breadify(atom/movable/target)
|
||||
var/obj/item/reagent_containers/food/snacks/store/bread/plain/funnyBread = new(get_turf(target))
|
||||
target.forceMove(funnyBread)
|
||||
|
||||
/client/proc/smite(mob/living/carbon/human/target as mob)
|
||||
set name = "Smite"
|
||||
set category = "Fun"
|
||||
if(!check_rights(R_ADMIN) || !check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/list/punishment_list = list(ADMIN_PUNISHMENT_PIE,
|
||||
ADMIN_PUNISHMENT_FIREBALL,
|
||||
ADMIN_PUNISHMENT_CLUWNE,
|
||||
ADMIN_PUNISHMENT_LIGHTNING,
|
||||
ADMIN_PUNISHMENT_BRAINDAMAGE,
|
||||
ADMIN_PUNISHMENT_BSA,
|
||||
ADMIN_PUNISHMENT_GIB,
|
||||
ADMIN_PUNISHMENT_SUPPLYPOD_QUICK,
|
||||
ADMIN_PUNISHMENT_SUPPLYPOD,
|
||||
ADMIN_PUNISHMENT_MAZING,
|
||||
ADMIN_PUNISHMENT_ROD,
|
||||
ADMIN_PUNISHMENT_TABLETIDESTATIONWIDE,
|
||||
ADMIN_PUNISHMENT_FAKEBWOINK,
|
||||
ADMIN_PUNISHMENT_NUGGET,
|
||||
ADMIN_PUNISHMENT_BREADIFY)
|
||||
var/list/punishment_list = list(ADMIN_PUNISHMENT_PIE, ADMIN_PUNISHMENT_FIREBALL, ADMIN_PUNISHMENT_CLUWNE, ADMIN_PUNISHMENT_LIGHTNING, ADMIN_PUNISHMENT_BRAINDAMAGE, ADMIN_PUNISHMENT_BSA, ADMIN_PUNISHMENT_GIB, ADMIN_PUNISHMENT_SUPPLYPOD, ADMIN_PUNISHMENT_MAZING, ADMIN_PUNISHMENT_ROD)
|
||||
|
||||
var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in punishment_list
|
||||
|
||||
@@ -1305,22 +1287,6 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
var/turf/startT = spaceDebrisStartLoc(startside, T.z)
|
||||
var/turf/endT = spaceDebrisFinishLoc(startside, T.z)
|
||||
new /obj/effect/immovablerod(startT, endT,target)
|
||||
if(ADMIN_PUNISHMENT_SUPPLYPOD_QUICK)
|
||||
var/target_path = input(usr,"Enter typepath of an atom you'd like to send with the pod (type \"empty\" to send an empty pod):" ,"Typepath","/obj/item/reagent_containers/food/snacks/grown/harebell") as null|text
|
||||
var/obj/structure/closet/supplypod/centcompod/pod = new()
|
||||
pod.damage = 40
|
||||
pod.explosionSize = list(0,0,0,2)
|
||||
pod.effectStun = TRUE
|
||||
if (isnull(target_path)) //The user pressed "Cancel"
|
||||
return
|
||||
if (target_path != "empty")//if you didn't type empty, we want to load the pod with a delivery
|
||||
var/delivery = text2path(target_path)
|
||||
if(!ispath(delivery))
|
||||
delivery = pick_closest_path(target_path)
|
||||
if(!delivery)
|
||||
alert("ERROR: Incorrect / improper path given.")
|
||||
new delivery(pod)
|
||||
new /obj/effect/abstract/DPtarget(get_turf(target), pod)
|
||||
if(ADMIN_PUNISHMENT_SUPPLYPOD)
|
||||
var/datum/centcom_podlauncher/plaunch = new(usr)
|
||||
if(!holder)
|
||||
@@ -1333,7 +1299,6 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
plaunch.temp_pod.explosionSize = list(0,0,0,2)
|
||||
plaunch.temp_pod.effectStun = TRUE
|
||||
plaunch.ui_interact(usr)
|
||||
return //We return here because punish_log() is handled by the centcom_podlauncher datum
|
||||
|
||||
if(ADMIN_PUNISHMENT_MAZING)
|
||||
if(!puzzle_imprison(target))
|
||||
@@ -1342,47 +1307,12 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
if(ADMIN_PUNISHMENT_PIE)
|
||||
var/obj/item/reagent_containers/food/snacks/pie/cream/nostun/creamy = new(get_turf(target))
|
||||
creamy.splat(target)
|
||||
if(ADMIN_PUNISHMENT_TABLETIDESTATIONWIDE)
|
||||
priority_announce(html_decode("[target] has brought the wrath of the gods upon themselves and is now being tableslammed across the station. Please stand by."), null, 'sound/misc/announce.ogg', "CentCom")
|
||||
var/list/areas = list()
|
||||
for(var/area/A in world)
|
||||
if(A.z == SSmapping.station_start)
|
||||
areas += A
|
||||
SEND_SOUND(target, sound('hyperstation/sound/misc/slamofthenorthstar.ogg',volume=60))
|
||||
for(var/area/A in areas)
|
||||
for(var/obj/structure/table/T in A)
|
||||
T.tablepush(target, target)
|
||||
sleep(1)
|
||||
if(ADMIN_PUNISHMENT_FAKEBWOINK)
|
||||
SEND_SOUND(target, 'sound/effects/adminhelp.ogg')
|
||||
if(ADMIN_PUNISHMENT_NUGGET)
|
||||
if (!iscarbon(target))
|
||||
return
|
||||
var/mob/living/carbon/carbon_target = target
|
||||
var/timer = 2 SECONDS
|
||||
for (var/_limb in carbon_target.bodyparts)
|
||||
var/obj/item/bodypart/limb = _limb
|
||||
if (limb.body_part == HEAD || limb.body_part == CHEST)
|
||||
continue
|
||||
addtimer(CALLBACK(limb, /obj/item/bodypart/.proc/dismember), timer)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, carbon_target, 'sound/effects/cartoon_pop.ogg', 70), timer)
|
||||
addtimer(CALLBACK(carbon_target, /mob/living/.proc/spin, 4, 1), timer - 0.4 SECONDS)
|
||||
timer += 2 SECONDS
|
||||
if(ADMIN_PUNISHMENT_BREADIFY)
|
||||
#define BREADIFY_TIME (5 SECONDS)
|
||||
var/mutable_appearance/bread_appearance = mutable_appearance('icons/obj/food/burgerbread.dmi', "bread")
|
||||
var/mutable_appearance/transform_scanline = mutable_appearance('icons/effects/effects.dmi', "transform_effect")
|
||||
target.transformation_animation(bread_appearance, time = BREADIFY_TIME, transform_overlay=transform_scanline, reset_after=TRUE)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/breadify, target), BREADIFY_TIME)
|
||||
#undef BREADIFY_TIME
|
||||
|
||||
punish_log(target, punishment)
|
||||
|
||||
/client/proc/punish_log(var/whom, var/punishment)
|
||||
var/msg = "[key_name_admin(usr)] punished [key_name_admin(whom)] with [punishment]."
|
||||
var/msg = "[key_name_admin(usr)] punished [key_name_admin(target)] with [punishment]."
|
||||
message_admins(msg)
|
||||
admin_ticket_log(whom, msg)
|
||||
log_admin("[key_name(usr)] punished [key_name(whom)] with [punishment].")
|
||||
admin_ticket_log(target, msg)
|
||||
log_admin("[key_name(usr)] punished [key_name(target)] with [punishment].")
|
||||
|
||||
|
||||
/client/proc/trigger_centcom_recall()
|
||||
if(!check_rights(R_ADMIN))
|
||||
@@ -1452,4 +1382,3 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
|
||||
else
|
||||
message_admins("[key_name_admin(usr)] has [newstate ? "activated" : "deactivated"] job exp exempt status on [key_name_admin(C)]")
|
||||
log_admin("[key_name(usr)] has [newstate ? "activated" : "deactivated"] job exp exempt status on [key_name(C)]")
|
||||
|
||||
|
||||
33
code/modules/admin/verbs/spawnfloorcluwne.dm
Normal file
33
code/modules/admin/verbs/spawnfloorcluwne.dm
Normal file
@@ -0,0 +1,33 @@
|
||||
/client/proc/spawn_floor_cluwne()
|
||||
set category = "Fun"
|
||||
set name = "Unleash Targeted Floor Cluwne"
|
||||
set desc = "Pick a specific target. Be warned: spawning more than one may cause issues!"
|
||||
var/target
|
||||
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
target = input("Any specific target in mind? Please note only live, non cluwned, human targets are valid.", "Target", target) as null|anything in GLOB.player_list
|
||||
if(target && ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(H.loc)
|
||||
FC.forced = TRUE
|
||||
FC.Acquire_Victim(H)
|
||||
FC.target = H
|
||||
FC.current_victim = H
|
||||
log_admin("[key_name(usr)] spawned floor cluwne.")
|
||||
message_admins("[key_name(usr)] spawned floor cluwne.")
|
||||
deadchat_broadcast("<span class='deadsay'><b>Floor Cluwne</b> has just been spawned!</span>")
|
||||
|
||||
/client/proc/spawn_random_floor_cluwne()
|
||||
set category = "Fun"
|
||||
set name = "Unleash Random Floor Cluwne"
|
||||
set desc = "Goes after a random player in your Z level. Be warned: spawning more than one may cause issues!"
|
||||
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(usr)
|
||||
new /mob/living/simple_animal/hostile/floor_cluwne(T)
|
||||
log_admin("[key_name(usr)] spawned a random target floor cluwne.")
|
||||
message_admins("[key_name(usr)] spawned a random target floor cluwne.")
|
||||
@@ -211,7 +211,7 @@ GLOBAL_LIST_EMPTY(antagonists)
|
||||
return
|
||||
|
||||
/datum/antagonist/proc/edit_memory(mob/user)
|
||||
var/new_memo = stripped_multiline_input(user, "Write new memory", "Memory", antag_memory, MAX_MESSAGE_LEN)
|
||||
var/new_memo = copytext(trim(input(user,"Write new memory", "Memory", antag_memory) as null|message),1,MAX_MESSAGE_LEN)
|
||||
if (isnull(new_memo))
|
||||
return
|
||||
antag_memory = new_memo
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
owner.assigned_role = "[name] [sub_role]"
|
||||
owner.objectives += team.objectives
|
||||
finalize_abductor()
|
||||
ADD_TRAIT(owner, TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST)
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/abductor/on_removal()
|
||||
@@ -52,7 +51,6 @@
|
||||
if(owner.current)
|
||||
to_chat(owner.current,"<span class='userdanger'>You are no longer the [owner.special_role]!</span>")
|
||||
owner.special_role = null
|
||||
REMOVE_TRAIT(owner, TRAIT_ABDUCTOR_TRAINING, ABDUCTOR_ANTAGONIST)
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/abductor/greet()
|
||||
@@ -76,15 +74,11 @@
|
||||
|
||||
update_abductor_icons_added(owner,"abductor")
|
||||
|
||||
/datum/antagonist/abductor/scientist/on_gain()
|
||||
ADD_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST)
|
||||
ADD_TRAIT(owner, TRAIT_SURGEON, ABDUCTOR_ANTAGONIST)
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/abductor/scientist/on_removal()
|
||||
REMOVE_TRAIT(owner, TRAIT_ABDUCTOR_SCIENTIST_TRAINING, ABDUCTOR_ANTAGONIST)
|
||||
REMOVE_TRAIT(owner, TRAIT_SURGEON, ABDUCTOR_ANTAGONIST)
|
||||
. = ..()
|
||||
/datum/antagonist/abductor/scientist/finalize_abductor()
|
||||
..()
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
var/datum/species/abductor/A = H.dna.species
|
||||
A.scientist = TRUE
|
||||
|
||||
/datum/antagonist/abductor/admin_add(datum/mind/new_owner,mob/admin)
|
||||
var/list/current_teams = list()
|
||||
@@ -219,4 +213,4 @@
|
||||
/datum/antagonist/proc/update_abductor_icons_removed(datum/mind/alien_mind)
|
||||
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR]
|
||||
hud.leave_hud(alien_mind.current)
|
||||
set_antag_hud(alien_mind.current, null)
|
||||
set_antag_hud(alien_mind.current, null)
|
||||
@@ -132,24 +132,22 @@
|
||||
/obj/item/abductor
|
||||
icon = 'icons/obj/abductor.dmi'
|
||||
|
||||
/obj/item/abductor/proc/AbductorCheck(mob/user)
|
||||
if(HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING))
|
||||
/obj/item/abductor/proc/AbductorCheck(user)
|
||||
if(isabductor(user))
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>You can't figure how this works!</span>")
|
||||
return FALSE
|
||||
|
||||
/obj/item/abductor/proc/ScientistCheck(mob/user)
|
||||
var/training = HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING)
|
||||
var/sci_training = HAS_TRAIT(user, TRAIT_ABDUCTOR_SCIENTIST_TRAINING)
|
||||
/obj/item/abductor/proc/ScientistCheck(user)
|
||||
if(!AbductorCheck(user))
|
||||
return FALSE
|
||||
|
||||
if(training && !sci_training)
|
||||
to_chat(user, "<span class='warning'>You're not trained to use this!</span>")
|
||||
. = FALSE
|
||||
else if(!training && !sci_training)
|
||||
to_chat(user, "<span class='warning'>You can't figure how this works!</span>")
|
||||
. = FALSE
|
||||
else
|
||||
. = TRUE
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/datum/species/abductor/S = H.dna.species
|
||||
if(S.scientist)
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>You're not trained to use this!</span>")
|
||||
return FALSE
|
||||
|
||||
/obj/item/abductor/gizmo
|
||||
name = "science tool"
|
||||
@@ -683,7 +681,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
|
||||
desc = "Abduct with style - spiky style. Prevents digital tracking."
|
||||
icon_state = "alienhelmet"
|
||||
item_state = "alienhelmet"
|
||||
blockTracking = TRUE
|
||||
blockTracking = 1
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
|
||||
|
||||
// Operating Table / Beds / Lockers
|
||||
@@ -759,7 +757,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
|
||||
can_buckle = 1
|
||||
buckle_lying = 1
|
||||
|
||||
var/static/list/injected_reagents = list(/datum/reagent/medicine/corazone)
|
||||
var/static/list/injected_reagents = list("corazone")
|
||||
|
||||
/obj/structure/table/optable/abductor/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
icon_state = "gland"
|
||||
status = ORGAN_ROBOTIC
|
||||
beating = TRUE
|
||||
var/true_name = "baseline placebo referencer"
|
||||
var/cooldown_low = 300
|
||||
var/cooldown_high = 300
|
||||
var/next_activation = 0
|
||||
@@ -17,11 +16,6 @@
|
||||
var/mind_control_duration = 1800
|
||||
var/active_mind_control = FALSE
|
||||
|
||||
/obj/item/organ/heart/gland/examine(mob/user)
|
||||
. = ..()
|
||||
if(HAS_TRAIT(user, TRAIT_ABDUCTOR_SCIENTIST_TRAINING) || isobserver(user))
|
||||
to_chat(user, "<span class='notice'>It is \a [true_name].</span>")
|
||||
|
||||
/obj/item/organ/heart/gland/proc/ownerCheck()
|
||||
if(ishuman(owner))
|
||||
return TRUE
|
||||
@@ -101,7 +95,6 @@
|
||||
return
|
||||
|
||||
/obj/item/organ/heart/gland/heals
|
||||
true_name = "coherency harmonizer"
|
||||
cooldown_low = 200
|
||||
cooldown_high = 400
|
||||
uses = -1
|
||||
@@ -116,7 +109,6 @@
|
||||
owner.adjustOxyLoss(-20)
|
||||
|
||||
/obj/item/organ/heart/gland/slime
|
||||
true_name = "gastric animation galvanizer"
|
||||
cooldown_low = 600
|
||||
cooldown_high = 1200
|
||||
uses = -1
|
||||
@@ -138,7 +130,6 @@
|
||||
Slime.Leader = owner
|
||||
|
||||
/obj/item/organ/heart/gland/mindshock
|
||||
true_name = "neural crosstalk uninhibitor"
|
||||
cooldown_low = 400
|
||||
cooldown_high = 700
|
||||
uses = -1
|
||||
@@ -165,7 +156,6 @@
|
||||
H.hallucination += 60
|
||||
|
||||
/obj/item/organ/heart/gland/pop
|
||||
true_name = "anthropmorphic translocator"
|
||||
cooldown_low = 900
|
||||
cooldown_high = 1800
|
||||
uses = -1
|
||||
@@ -181,7 +171,6 @@
|
||||
owner.set_species(species)
|
||||
|
||||
/obj/item/organ/heart/gland/ventcrawling
|
||||
true_name = "pliant cartilage enabler"
|
||||
cooldown_low = 1800
|
||||
cooldown_high = 2400
|
||||
uses = 1
|
||||
@@ -194,7 +183,6 @@
|
||||
owner.ventcrawler = VENTCRAWLER_ALWAYS
|
||||
|
||||
/obj/item/organ/heart/gland/viral
|
||||
true_name = "contamination incubator"
|
||||
cooldown_low = 1800
|
||||
cooldown_high = 2400
|
||||
uses = 1
|
||||
@@ -229,7 +217,6 @@
|
||||
return A
|
||||
|
||||
/obj/item/organ/heart/gland/trauma
|
||||
true_name = "white matter randomiser"
|
||||
cooldown_low = 800
|
||||
cooldown_high = 1200
|
||||
uses = 5
|
||||
@@ -248,7 +235,6 @@
|
||||
owner.gain_trauma_type(BRAIN_TRAUMA_MILD, rand(TRAUMA_RESILIENCE_BASIC, TRAUMA_RESILIENCE_LOBOTOMY))
|
||||
|
||||
/obj/item/organ/heart/gland/spiderman
|
||||
true_name = "araneae cloister accelerator"
|
||||
cooldown_low = 450
|
||||
cooldown_high = 900
|
||||
uses = -1
|
||||
@@ -263,7 +249,6 @@
|
||||
S.directive = "Protect your nest inside [owner.real_name]."
|
||||
|
||||
/obj/item/organ/heart/gland/egg
|
||||
true_name = "roe/enzymatic synthesizer"
|
||||
cooldown_low = 300
|
||||
cooldown_high = 400
|
||||
uses = -1
|
||||
@@ -279,7 +264,6 @@
|
||||
new /obj/item/reagent_containers/food/snacks/egg/gland(T)
|
||||
|
||||
/obj/item/organ/heart/gland/electric
|
||||
true_name = "electron accumulator/discharger"
|
||||
cooldown_low = 800
|
||||
cooldown_high = 1200
|
||||
uses = -1
|
||||
@@ -305,7 +289,6 @@
|
||||
playsound(get_turf(owner), 'sound/magic/lightningshock.ogg', 50, 1)
|
||||
|
||||
/obj/item/organ/heart/gland/chem
|
||||
true_name = "intrinsic pharma-provider"
|
||||
cooldown_low = 50
|
||||
cooldown_high = 50
|
||||
uses = -1
|
||||
@@ -314,18 +297,24 @@
|
||||
var/list/possible_reagents = list()
|
||||
|
||||
/obj/item/organ/heart/gland/chem/Initialize()
|
||||
. = ..()
|
||||
for(var/R in subtypesof(/datum/reagent/drug) + subtypesof(/datum/reagent/medicine) + typesof(/datum/reagent/toxin))
|
||||
possible_reagents += R
|
||||
..()
|
||||
for(var/X in subtypesof(/datum/reagent/drug))
|
||||
var/datum/reagent/R = X
|
||||
possible_reagents += initial(R.id)
|
||||
for(var/X in subtypesof(/datum/reagent/medicine))
|
||||
var/datum/reagent/R = X
|
||||
possible_reagents += initial(R.id)
|
||||
for(var/X in typesof(/datum/reagent/toxin))
|
||||
var/datum/reagent/R = X
|
||||
possible_reagents += initial(R.id)
|
||||
|
||||
/obj/item/organ/heart/gland/chem/activate()
|
||||
var/chem_to_add = pick(possible_reagents)
|
||||
owner.reagents.add_reagent(chem_to_add, 2)
|
||||
owner.adjustToxLoss(-5, TRUE, TRUE)
|
||||
owner.adjustToxLoss(-2, TRUE, TRUE)
|
||||
..()
|
||||
|
||||
/obj/item/organ/heart/gland/plasma
|
||||
true_name = "effluvium sanguine-synonym emitter"
|
||||
cooldown_low = 1200
|
||||
cooldown_high = 1800
|
||||
uses = -1
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
actions += set_droppoint_action
|
||||
|
||||
/obj/machinery/computer/camera_advanced/abductor/proc/IsScientist(mob/living/carbon/human/H)
|
||||
return HAS_TRAIT(H, TRAIT_ABDUCTOR_SCIENTIST_TRAINING)
|
||||
var/datum/species/abductor/S = H.dna.species
|
||||
return S.scientist
|
||||
|
||||
/datum/action/innate/teleport_in
|
||||
name = "Send To"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(!HAS_TRAIT(user, TRAIT_ABDUCTOR_TRAINING))
|
||||
if(!isabductor(user))
|
||||
to_chat(user, "<span class='warning'>You start mashing alien buttons at random!</span>")
|
||||
if(do_after(user,100, target = src))
|
||||
TeleporterSend()
|
||||
|
||||
@@ -53,4 +53,4 @@
|
||||
. = ..()
|
||||
var/datum/effect_system/spark_spread/S = new
|
||||
S.set_up(10,0,loc)
|
||||
S.start()
|
||||
S.start()
|
||||
@@ -143,9 +143,9 @@
|
||||
create_reagents(10)
|
||||
|
||||
if(overmind && overmind.blob_reagent_datum)
|
||||
reagents.add_reagent(overmind.blob_reagent_datum.type, 10)
|
||||
reagents.add_reagent(overmind.blob_reagent_datum.id, 10)
|
||||
else
|
||||
reagents.add_reagent(/datum/reagent/toxin/spore, 10)
|
||||
reagents.add_reagent("spore", 10)
|
||||
|
||||
// Attach the smoke spreader and setup/start it.
|
||||
S.attach(location)
|
||||
|
||||
@@ -203,7 +203,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
|
||||
|
||||
/mob/camera/blob/proc/blob_talk(message)
|
||||
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
if (!message)
|
||||
return
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
|
||||
// Getting Flaws:
|
||||
//
|
||||
// Killing crew
|
||||
//
|
||||
// Gaining ranks
|
||||
|
||||
|
||||
|
||||
// * COMPULSION * Things you must do
|
||||
//
|
||||
// SELECTIVE: -Gender/BloodType/Job sustains you, but others give you less.
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
// * WEAKNESSES * Things that may harm you
|
||||
//
|
||||
// LIGHTS: -Bright light nullifies the Examine benefits of Masquerade.
|
||||
// -Bright lights disable your healing (including in Torpor)
|
||||
//
|
||||
// STAKES: -Stakes kill you immediately.
|
||||
//
|
||||
// PAINFUL: -Your feed victims scream, despite being unconscious.
|
||||
//
|
||||
// FIRE: -You only need your max health (not x2) in fire damage to die.
|
||||
//
|
||||
// CORPSE: -Your Masquerade turns off when unconscious or crit.
|
||||
//
|
||||
// FERAL: -
|
||||
//
|
||||
// CRAVEN
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// BANES //
|
||||
|
||||
// These are basically small weaknesses that affect your character in certain circumstances.
|
||||
// As a rule, they should be specific as to when they happen, or have only some certain
|
||||
// drawback.
|
||||
|
||||
// (core ideas)
|
||||
// SENSITIVE: You are slightly blinded by bright lights.
|
||||
// DARKFRIEND: Your automatic healing is at a crawl when in bright light.
|
||||
// TRADITIONAL: Every five minutes spent outside a coffin lowers your rate of automatic healing.
|
||||
// CONSUMED: Every five minutes spent outside a coffin increases the rate at which your blood ticks down.
|
||||
// GOURMAND: Animals and blood bags offer you no nourishment when feeding.
|
||||
// DEATHMASK: You no longer fake having a heartbeat, and always show up as pale when examined.
|
||||
// BESTIAL: When your blood is low, you will twitch involuntarily.
|
||||
|
||||
// (alternate ideas)
|
||||
// STERILE: There is a high chance that turning corpses to Bloodsuckers will fail, and further attempts on them by you are impossible.
|
||||
// FERAL: You're a threat to Vampire-kind: New Bloodsuckers may have an Objective to destroy you.
|
||||
// UNHOLY: The Chapel, the Bible, and Holy Water set you on fire.
|
||||
// PARANOID: Only your own claimed coffin counts for healing and banes.
|
||||
|
||||
|
||||
// ON LEVEL-UP:
|
||||
// Burn Damage increases
|
||||
// Regen Rate increases
|
||||
// Max Punch Damage increase
|
||||
// Reset Level Timer
|
||||
// Select Bane
|
||||
|
||||
|
||||
// How to Burn Vamps:
|
||||
// C.adjustFireLoss(20)
|
||||
// C.adjust_fire_stacks(6)
|
||||
// C.IgniteMob()
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/AssignRandomBane()
|
||||
return
|
||||
@@ -1,148 +0,0 @@
|
||||
// INTEGRATION: Adding Procs and Datums to existing "classes"
|
||||
/mob/living/proc/AmBloodsucker(falseIfInDisguise=FALSE)
|
||||
// No Datum
|
||||
if(!mind || !mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/mob/living/proc/HaveBloodsuckerBodyparts(var/displaymessage="") // displaymessage can be something such as "rising from death" for Torpid Sleep. givewarningto is the person receiving messages.
|
||||
if(!getorganslot(ORGAN_SLOT_HEART))
|
||||
if(displaymessage != "")
|
||||
to_chat(src, "<span class='warning'>Without a heart, you are incapable of [displaymessage].</span>")
|
||||
return FALSE
|
||||
if(!get_bodypart(BODY_ZONE_HEAD))
|
||||
if(displaymessage != "")
|
||||
to_chat(src, "<span class='warning'>Without a head, you are incapable of [displaymessage].</span>")
|
||||
return FALSE
|
||||
if(!getorgan(/obj/item/organ/brain)) // NOTE: This is mostly just here so we can do one scan for all needed parts when creating a vamp. You probably won't be trying to use powers w/out a brain.
|
||||
if(displaymessage != "")
|
||||
to_chat(src, "<span class='warning'>Without a brain, you are incapable of [displaymessage].</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
|
||||
// GET DAMAGE
|
||||
|
||||
|
||||
// Do NOT count the damage on prosthetics for this.
|
||||
/mob/living/proc/getBruteLoss_nonProsthetic()
|
||||
return getBruteLoss()
|
||||
|
||||
/mob/living/proc/getFireLoss_nonProsthetic()
|
||||
return getFireLoss()
|
||||
|
||||
/mob/living/carbon/getBruteLoss_nonProsthetic()
|
||||
var/amount = 0
|
||||
for(var/obj/item/bodypart/BP in bodyparts)
|
||||
if(BP.status < 2)
|
||||
amount += BP.brute_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/getFireLoss_nonProsthetic()
|
||||
var/amount = 0
|
||||
for(var/obj/item/bodypart/BP in bodyparts)
|
||||
if(BP.status < 2)
|
||||
amount += BP.burn_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon
|
||||
// EXAMINING
|
||||
/mob/living/carbon/human/proc/ReturnVampExamine(var/mob/viewer)
|
||||
if(!mind || !viewer.mind)
|
||||
return ""
|
||||
// Target must be a Vamp
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(!bloodsuckerdatum)
|
||||
return ""
|
||||
// Viewer is Target's Vassal?
|
||||
if(viewer.mind.has_antag_datum(ANTAG_DATUM_VASSAL) in bloodsuckerdatum.vassals)
|
||||
var/returnString = "\[<span class='warning'><EM>This is your Master!</EM></span>\]"
|
||||
var/returnIcon = "[icon2html('icons/misc/language.dmi', world, "bloodsucker")]"
|
||||
returnString += "\n"
|
||||
return returnIcon + returnString
|
||||
// Viewer not a Vamp AND not the target's vassal?
|
||||
if(!viewer.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) && !(viewer in bloodsuckerdatum.vassals))
|
||||
return ""
|
||||
// Default String
|
||||
var/returnString = "\[<span class='warning'><EM>[bloodsuckerdatum.ReturnFullName(1)]</EM></span>\]"
|
||||
var/returnIcon = "[icon2html('icons/misc/language.dmi', world, "bloodsucker")]"
|
||||
|
||||
// In Disguise (Veil)?
|
||||
//if (name_override != null)
|
||||
// returnString += "<span class='suicide'> ([real_name] in disguise!) </span>"
|
||||
|
||||
//returnString += "\n" Don't need spacers. Using . += "" in examine.dm does this on its own.
|
||||
return returnIcon + returnString
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/ReturnVassalExamine(var/mob/viewer)
|
||||
if(!mind || !viewer.mind)
|
||||
return ""
|
||||
// Am I not even a Vassal? Then I am not marked.
|
||||
var/datum/antagonist/vassal/vassaldatum = mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
if(!vassaldatum)
|
||||
return ""
|
||||
// Only Vassals and Bloodsuckers can recognize marks.
|
||||
if(!viewer.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) && !viewer.mind.has_antag_datum(ANTAG_DATUM_VASSAL))
|
||||
return ""
|
||||
|
||||
// Default String
|
||||
var/returnString = "\[<span class='warning'>"
|
||||
var/returnIcon = ""
|
||||
// Am I Viewer's Vassal?
|
||||
if(vassaldatum.master.owner == viewer.mind)
|
||||
returnString += "This [dna.species.name] bears YOUR mark!"
|
||||
returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal")]"
|
||||
// Am I someone ELSE'S Vassal?
|
||||
else if(viewer.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
returnString += "This [dna.species.name] bears the mark of <span class='boldwarning'>[vassaldatum.master.ReturnFullName(vassaldatum.master.owner.current,1)]</span>"
|
||||
returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal_grey")]"
|
||||
// Are you serving the same master as I am?
|
||||
else if(viewer.mind.has_antag_datum(ANTAG_DATUM_VASSAL) in vassaldatum.master.vassals)
|
||||
returnString += "[p_they(TRUE)] bears the mark of your Master"
|
||||
returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal")]"
|
||||
// You serve a different Master than I do.
|
||||
else
|
||||
returnString += "[p_they(TRUE)] bears the mark of another Bloodsucker"
|
||||
returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal_grey")]"
|
||||
|
||||
returnString += "</span>\]" // \n" Don't need spacers. Using . += "" in examine.dm does this on its own.
|
||||
return returnIcon + returnString
|
||||
|
||||
|
||||
// Am I "pale" when examined? Bloodsuckers can trick this.
|
||||
/mob/living/carbon/proc/ShowAsPaleExamine()
|
||||
|
||||
// Normal Creatures:
|
||||
if(!mind || !mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
return blood_volume < (BLOOD_VOLUME_SAFE * blood_ratio)
|
||||
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(bloodsuckerdatum.poweron_masquerade)
|
||||
return FALSE
|
||||
|
||||
// If a Bloodsucker is malnourished, AND if his temperature matches his surroundings (aka he hasn't fed recently and looks COLD)...
|
||||
return blood_volume < (BLOOD_VOLUME_OKAY * blood_ratio) // && !(bodytemperature <= get_temperature() + 2)
|
||||
|
||||
/mob/living/carbon/human/ShowAsPaleExamine()
|
||||
// Check for albino, as per human/examine.dm's check.
|
||||
if(dna.species.use_skintones && skin_tone == "albino")
|
||||
return TRUE
|
||||
|
||||
return ..() // Return vamp check
|
||||
|
||||
/mob/living/carbon/proc/scan_blood_volume()
|
||||
// Vamps don't show up normally to scanners unless Masquerade power is on ----> scanner.dm
|
||||
if(mind)
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if (istype(bloodsuckerdatum) && bloodsuckerdatum.poweron_masquerade)
|
||||
return BLOOD_VOLUME_NORMAL
|
||||
return blood_volume
|
||||
|
||||
/mob/living/proc/IsFrenzied()
|
||||
return FALSE
|
||||
|
||||
/mob/living/proc/StartFrenzy(inTime = 120)
|
||||
set waitfor = FALSE
|
||||
@@ -1,361 +0,0 @@
|
||||
|
||||
|
||||
// TO PLUG INTO LIFE:
|
||||
|
||||
// Cancel BLOOD life
|
||||
// Cancel METABOLISM life (or find a way to control what gets digested)
|
||||
// Create COLDBLOODED trait (thermal homeostasis)
|
||||
|
||||
// EXAMINE
|
||||
//
|
||||
// Show as dead when...
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/LifeTick()// Should probably run from life.dm, same as handle_changeling, but will be an utter pain to move
|
||||
set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side.
|
||||
var/notice_healing = FALSE
|
||||
while(owner && !AmFinalDeath()) // owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) == src
|
||||
if(owner.current.stat == CONSCIOUS && !poweron_feed && !HAS_TRAIT(owner.current, TRAIT_DEATHCOMA)) // Deduct Blood
|
||||
AddBloodVolume(-0.1) // -.15 (before tick went from 10 to 30, but we also charge more for faking life now)
|
||||
if(HandleHealing(1)) // Heal
|
||||
if(notice_healing == FALSE && owner.current.blood_volume > 0)
|
||||
to_chat(owner, "<span class='notice'>The power of your blood begins knitting your wounds...</span>")
|
||||
notice_healing = TRUE
|
||||
else if(notice_healing == TRUE)
|
||||
notice_healing = FALSE // Apply Low Blood Effects
|
||||
HandleStarving() // Death
|
||||
HandleDeath() // Standard Update
|
||||
update_hud()// Daytime Sleep in Coffin
|
||||
if (SSticker.mode.is_daylight() && !HAS_TRAIT_FROM(owner.current, TRAIT_DEATHCOMA, "bloodsucker"))
|
||||
if(istype(owner.current.loc, /obj/structure/closet/crate/coffin))
|
||||
Torpor_Begin()
|
||||
// Wait before next pass
|
||||
sleep(10)
|
||||
FreeAllVassals() // Free my Vassals! (if I haven't yet)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// BLOOD
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/AddBloodVolume(value)
|
||||
owner.current.blood_volume = CLAMP(owner.current.blood_volume + value, 0, maxBloodVolume)
|
||||
update_hud()
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/HandleFeeding(mob/living/carbon/target, mult=1)
|
||||
// mult: SILENT feed is 1/3 the amount
|
||||
var/blood_taken = min(feedAmount, target.blood_volume) * mult // Starts at 15 (now 8 since we doubled the Feed time)
|
||||
target.blood_volume -= blood_taken
|
||||
// Simple Animals lose a LOT of blood, and take damage. This is to keep cats, cows, and so forth from giving you insane amounts of blood.
|
||||
if(!ishuman(target))
|
||||
target.blood_volume -= (blood_taken / max(target.mob_size, 0.1)) * 3.5 // max() to prevent divide-by-zero
|
||||
target.apply_damage_type(blood_taken / 3.5) // Don't do too much damage, or else they die and provide no blood nourishment.
|
||||
if(target.blood_volume <= 0)
|
||||
target.blood_volume = 0
|
||||
target.death(0)
|
||||
///////////
|
||||
// Shift Body Temp (toward Target's temp, by volume taken)
|
||||
owner.current.bodytemperature = ((owner.current.blood_volume * owner.current.bodytemperature) + (blood_taken * target.bodytemperature)) / (owner.current.blood_volume + blood_taken)
|
||||
// our volume * temp, + their volume * temp, / total volume
|
||||
///////////
|
||||
// Reduce Value Quantity
|
||||
if(target.stat == DEAD) // Penalty for Dead Blood
|
||||
blood_taken /= 3
|
||||
if(!ishuman(target)) // Penalty for Non-Human Blood
|
||||
blood_taken /= 2
|
||||
//if (!iscarbon(target)) // Penalty for Animals (they're junk food)
|
||||
// Apply to Volume
|
||||
AddBloodVolume(blood_taken)
|
||||
// Reagents (NOT Blood!)
|
||||
if(target.reagents && target.reagents.total_volume)
|
||||
target.reagents.reaction(owner.current, INGEST, 1) // Run Reaction: what happens when what they have mixes with what I have?
|
||||
target.reagents.trans_to(owner.current, 1) // Run transfer of 1 unit of reagent from them to me.
|
||||
// Blood Gulp Sound
|
||||
owner.current.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// HEALING
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/HandleHealing(mult = 1)
|
||||
// NOTE: Mult of 0 is just a TEST to see if we are injured and need to go into Torpor!
|
||||
//It is called from your coffin on close (by you only)
|
||||
if(poweron_masquerade == TRUE || owner.current.AmStaked())
|
||||
return FALSE
|
||||
owner.current.adjustStaminaLoss(-1.5 + (regenRate * -7) * mult, 0) // Humans lose stamina damage really quickly. Vamps should heal more.
|
||||
owner.current.adjustCloneLoss(-0.1 * (regenRate * 2) * mult, 0)
|
||||
owner.current.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1 * (regenRate * 4) * mult) //adjustBrainLoss(-1 * (regenRate * 4) * mult, 0)
|
||||
// No Bleeding
|
||||
if(ishuman(owner.current)) //NOTE Current bleeding is horrible, not to count the amount of blood ballistics delete.
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.bleed_rate = 0
|
||||
if(iscarbon(owner.current)) // Damage Heal: Do I have damage to ANY bodypart?
|
||||
var/mob/living/carbon/C = owner.current
|
||||
var/costMult = 1 // Coffin makes it cheaper
|
||||
var/fireheal = 0 // BURN: Heal in Coffin while Fakedeath, or when damage above maxhealth (you can never fully heal fire)
|
||||
var/amInCoffinWhileTorpor = istype(C.loc, /obj/structure/closet/crate/coffin) && (mult == 0 || HAS_TRAIT(C, TRAIT_DEATHCOMA)) // Check for mult 0 OR death coma. (mult 0 means we're testing from coffin)
|
||||
if(amInCoffinWhileTorpor)
|
||||
mult *= 5 // Increase multiplier if we're sleeping in a coffin.
|
||||
fireheal = min(C.getFireLoss_nonProsthetic(), regenRate) // NOTE: Burn damage ONLY heals in torpor.
|
||||
costMult = 0.25
|
||||
C.ExtinguishMob()
|
||||
CureDisabilities() // Extinguish Fire
|
||||
C.remove_all_embedded_objects() // Remove Embedded!
|
||||
owner.current.regenerate_organs() // Heal Organs (will respawn original eyes etc. but we replace right away, next)
|
||||
CheckVampOrgans() // Heart, Eyes
|
||||
else
|
||||
if(owner.current.blood_volume <= 0) // No Blood? Lower Mult
|
||||
mult = 0.25
|
||||
// Crit from burn? Lower damage to maximum allowed.
|
||||
//if (C.getFireLoss() > owner.current.getMaxHealth())
|
||||
// fireheal = regenRate / 2
|
||||
// BRUTE: Always Heal
|
||||
var/bruteheal = min(C.getBruteLoss_nonProsthetic(), regenRate)
|
||||
var/toxinheal = min(C.getToxLoss(), regenRate)
|
||||
// Heal if Damaged
|
||||
if(bruteheal + fireheal + toxinheal > 0) // Just a check? Don't heal/spend, and return.
|
||||
if(mult == 0)
|
||||
return TRUE
|
||||
// We have damage. Let's heal (one time)
|
||||
C.adjustBruteLoss(-bruteheal * mult, forced = TRUE)// Heal BRUTE / BURN in random portions throughout the body.
|
||||
C.adjustFireLoss(-fireheal * mult, forced = TRUE)
|
||||
C.adjustToxLoss(-toxinheal * mult * 2, forced = TRUE) //Toxin healing because vamps arent immune
|
||||
//C.heal_overall_damage(bruteheal * mult, fireheal * mult) // REMOVED: We need to FORCE this, because otherwise, vamps won't heal EVER. Swapped to above.
|
||||
AddBloodVolume((bruteheal * -0.5 + fireheal * -1) / mult * costMult) // Costs blood to heal
|
||||
return TRUE // Healed! Done for this tick.
|
||||
if(amInCoffinWhileTorpor) // Limbs? (And I have no other healing)
|
||||
var/list/missing = owner.current.get_missing_limbs() // Heal Missing
|
||||
if (missing.len) // Cycle through ALL limbs and regen them!
|
||||
for (var/targetLimbZone in missing) // 1) Find ONE Limb and regenerate it.
|
||||
owner.current.regenerate_limb(targetLimbZone, 0) // regenerate_limbs() <--- If you want to EXCLUDE certain parts, do it like this ----> regenerate_limbs(0, list("head"))
|
||||
var/obj/item/bodypart/L = owner.current.get_bodypart( targetLimbZone ) // 2) Limb returns Damaged
|
||||
AddBloodVolume(50 * costMult) // Costs blood to heal
|
||||
L.brute_dam = 60
|
||||
to_chat(owner.current, "<span class='notice'>Your flesh knits as it regrows [L]!</span>")
|
||||
playsound(owner.current, 'sound/magic/demon_consume.ogg', 50, 1)
|
||||
// DONE! After regenerating ANY number of limbs, we stop here.
|
||||
return TRUE
|
||||
/*else // REMOVED: For now, let's just leave prosthetics on. Maybe you WANT to be a robovamp.
|
||||
// Remove Prosthetic/False Limb
|
||||
for(var/obj/item/bodypart/BP in C.bodyparts)
|
||||
message_admins("T1: [BP] ")
|
||||
if (istype(BP) && BP.status == 2)
|
||||
message_admins("T2: [BP] ")
|
||||
BP.drop_limb()
|
||||
return TRUE */
|
||||
// NOTE: Limbs have a "status", like their hosts "stat". 2 is dead (aka Prosthetic). 1 seems to be idle/alive.*/
|
||||
return FALSE
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/CureDisabilities()
|
||||
var/mob/living/carbon/C = owner.current
|
||||
C.cure_blind(list(EYE_DAMAGE))//()
|
||||
C.cure_nearsighted(EYE_DAMAGE)
|
||||
C.set_blindness(0) // Added 9/2/19
|
||||
C.set_blurriness(0) // Added 9/2/19
|
||||
C.update_tint() // Added 9/2/19
|
||||
C.update_sight() // Added 9/2/19
|
||||
for(var/O in C.internal_organs) //owner.current.adjust_eye_damage(-100) // This was removed by TG
|
||||
var/obj/item/organ/organ = O
|
||||
organ.setOrganDamage(0)
|
||||
owner.current.cure_husk()
|
||||
|
||||
// I am thirsty for blud!
|
||||
/datum/antagonist/bloodsucker/proc/HandleStarving()
|
||||
|
||||
// High: Faster Healing
|
||||
// Med: Pale
|
||||
// Low: Twitch
|
||||
// V.Low: Blur Vision
|
||||
// EMPTY: Frenzy!
|
||||
// BLOOD_VOLUME_GOOD: [336] Pale (handled in bloodsucker_integration.dm
|
||||
// BLOOD_VOLUME_BAD: [224] Jitter
|
||||
if(owner.current.blood_volume < BLOOD_VOLUME_BAD && !prob(0.5))
|
||||
owner.current.Jitter(3)
|
||||
// BLOOD_VOLUME_SURVIVE: [122] Blur Vision
|
||||
if(owner.current.blood_volume < BLOOD_VOLUME_BAD / 2)
|
||||
owner.current.blur_eyes(8 - 8 * (owner.current.blood_volume / BLOOD_VOLUME_BAD))
|
||||
// Nutrition
|
||||
owner.current.nutrition = min(owner.current.blood_volume, NUTRITION_LEVEL_FED) // <-- 350 //NUTRITION_LEVEL_FULL
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// DEATH
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/HandleDeath()
|
||||
// FINAL DEATH
|
||||
// Fire Damage? (above double health)
|
||||
if (owner.current.getFireLoss_nonProsthetic() >= owner.current.getMaxHealth() * 2)
|
||||
FinalDeath()
|
||||
return
|
||||
// Staked while "Temp Death" or Asleep
|
||||
if (owner.current.StakeCanKillMe() && owner.current.AmStaked())
|
||||
FinalDeath()
|
||||
return
|
||||
// Not "Alive"?
|
||||
if (!owner.current || !isliving(owner.current) || isbrain(owner.current) || !get_turf(owner.current))
|
||||
FinalDeath()
|
||||
return
|
||||
// Missing Brain or Heart?
|
||||
if (!owner.current.HaveBloodsuckerBodyparts())
|
||||
FinalDeath()
|
||||
return
|
||||
// Disable Powers: Masquerade * NOTE * This should happen as a FLAW!
|
||||
//if (stat >= UNCONSCIOUS)
|
||||
// for (var/datum/action/bloodsucker/masquerade/P in powers)
|
||||
// P.Deactivate()
|
||||
// TEMP DEATH
|
||||
var/total_brute = owner.current.getBruteLoss_nonProsthetic()
|
||||
var/total_burn = owner.current.getFireLoss_nonProsthetic()
|
||||
var/total_toxloss = owner.current.getToxLoss() //This is neater than just putting it in total_damage
|
||||
var/total_damage = total_brute + total_burn + total_toxloss
|
||||
// Died? Convert to Torpor (fake death)
|
||||
if (owner.current.stat >= DEAD)
|
||||
Torpor_Begin()
|
||||
to_chat(owner, "<span class='danger'>Your immortal body will not yet relinquish your soul to the abyss. You enter Torpor.</span>")
|
||||
if (poweron_masquerade == TRUE)
|
||||
to_chat(owner, "<span class='warning'>Your wounds will not heal until you disable the <span class='boldnotice'>Masquerade</span> power.</span>")
|
||||
// End Torpor:
|
||||
else // No damage, OR toxin healed AND brute healed and NOT in coffin (since you cannot heal burn)
|
||||
if (total_damage <= 0 || total_toxloss <= 0 && total_brute <= 0 && !istype(owner.current.loc, /obj/structure/closet/crate/coffin))
|
||||
// Not Daytime, Not in Torpor
|
||||
if (!SSticker.mode.is_daylight() && HAS_TRAIT_FROM(owner.current, TRAIT_DEATHCOMA, "bloodsucker"))
|
||||
Torpor_End()
|
||||
// Fake Unconscious
|
||||
if (poweron_masquerade == TRUE && total_damage >= owner.current.getMaxHealth() - HEALTH_THRESHOLD_FULLCRIT)
|
||||
owner.current.Unconscious(20,1)
|
||||
|
||||
//HEALTH_THRESHOLD_CRIT 0
|
||||
//HEALTH_THRESHOLD_FULLCRIT -30
|
||||
//HEALTH_THRESHOLD_DEAD -100
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/Torpor_Begin(amInCoffin=FALSE)
|
||||
owner.current.stat = UNCONSCIOUS
|
||||
owner.current.fakedeath("bloodsucker") // Come after UNCONSCIOUS or else it fails
|
||||
ADD_TRAIT(owner.current, TRAIT_NODEATH, "bloodsucker") // Without this, you'll just keep dying while you recover.
|
||||
ADD_TRAIT(owner.current, TRAIT_RESISTHIGHPRESSURE, "bloodsucker") // So you can heal in 0 G. otherwise you just...heal forever.
|
||||
ADD_TRAIT(owner.current, TRAIT_RESISTLOWPRESSURE, "bloodsucker") // So you can heal in 0 G. otherwise you just...heal forever.
|
||||
// Visuals
|
||||
owner.current.update_sight()
|
||||
owner.current.reload_fullscreen()
|
||||
// Disable ALL Powers
|
||||
for (var/datum/action/bloodsucker/power in powers)
|
||||
if (power.active && !power.can_use_in_torpor)
|
||||
power.DeactivatePower()
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/Torpor_End()
|
||||
owner.current.stat = SOFT_CRIT
|
||||
owner.current.cure_fakedeath("bloodsucker") // Come after SOFT_CRIT or else it fails
|
||||
REMOVE_TRAIT(owner.current, TRAIT_NODEATH, "bloodsucker")
|
||||
REMOVE_TRAIT(owner.current, TRAIT_RESISTHIGHPRESSURE, "bloodsucker")
|
||||
REMOVE_TRAIT(owner.current, TRAIT_RESISTLOWPRESSURE, "bloodsucker")
|
||||
to_chat(owner, "<span class='warning'>You have recovered from Torpor.</span>")
|
||||
|
||||
|
||||
/datum/antagonist/proc/AmFinalDeath()
|
||||
// Standard Antags can be dead OR final death
|
||||
return owner && (owner.current && owner.current.stat >= DEAD || owner.AmFinalDeath())
|
||||
|
||||
/datum/antagonist/bloodsucker/AmFinalDeath()
|
||||
return owner && owner.AmFinalDeath()
|
||||
/datum/antagonist/changeling/AmFinalDeath()
|
||||
return owner && owner.AmFinalDeath()
|
||||
|
||||
/datum/mind/proc/AmFinalDeath()
|
||||
return !current || QDELETED(current) || !isliving(current) || isbrain(current) || !get_turf(current) // NOTE: "isliving()" is not the same as STAT == CONSCIOUS. This is to make sure you're not a BORG (aka silicon)
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/FinalDeath()
|
||||
if(!iscarbon(owner.current)) //Check for non carbons.
|
||||
owner.current.gib()
|
||||
return
|
||||
playsound(get_turf(owner.current), 'sound/effects/tendril_destroyed.ogg', 60, 1)
|
||||
owner.current.drop_all_held_items()
|
||||
owner.current.unequip_everything()
|
||||
var/mob/living/carbon/C = owner.current
|
||||
C.remove_all_embedded_objects()
|
||||
// Make me UN-CLONEABLE
|
||||
owner.current.hellbound = TRUE // This was done during creation, but let's do it again one more time...to make SURE this guy stays dead, but they dont stay dead because brains can be cloned!
|
||||
// Free my Vassals!
|
||||
FreeAllVassals()
|
||||
// Elders get Dusted
|
||||
if (vamplevel >= 4) // (vamptitle)
|
||||
owner.current.visible_message("<span class='warning'>[owner.current]'s skin crackles and dries, their skin and bones withering to dust. A hollow cry whips from what is now a sandy pile of remains.</span>", \
|
||||
"<span class='userdanger'>Your soul escapes your withering body as the abyss welcomes you to your Final Death.</span>", \
|
||||
"<span class='italics'>You hear a dry, crackling sound.</span>")
|
||||
owner.current.dust()
|
||||
// Fledglings get Gibbed
|
||||
else
|
||||
owner.current.visible_message("<span class='warning'>[owner.current]'s skin bursts forth in a spray of gore and detritus. A horrible cry echoes from what is now a wet pile of decaying meat.</span>", \
|
||||
"<span class='userdanger'>Your soul escapes your withering body as the abyss welcomes you to your Final Death.</span>", \
|
||||
"<span class='italics'>You hear a wet, bursting sound.</span>")
|
||||
owner.current.gib(TRUE, FALSE, FALSE)//Brain cloning is wierd and allows hellbounds. Lets destroy the brain for safety.
|
||||
playsound(owner.current.loc, 'sound/effects/tendril_destroyed.ogg', 40, 1)
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// HUMAN FOOD
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/mob/proc/CheckBloodsuckerEatFood(var/food_nutrition)
|
||||
if (!isliving(src))
|
||||
return
|
||||
var/mob/living/L = src
|
||||
if (!L.AmBloodsucker())
|
||||
return
|
||||
// We're a vamp? Try to eat food...
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
bloodsuckerdatum.handle_eat_human_food(food_nutrition)
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/handle_eat_human_food(var/food_nutrition) // Called from snacks.dm and drinks.dm
|
||||
set waitfor = FALSE
|
||||
if (!owner.current || !iscarbon(owner.current))
|
||||
return
|
||||
var/mob/living/carbon/C = owner.current
|
||||
// Remove Nutrition, Give Bad Food
|
||||
C.nutrition -= food_nutrition
|
||||
foodInGut += food_nutrition
|
||||
// Already ate some bad clams? Then we can back out, because we're already sick from it.
|
||||
if (foodInGut != food_nutrition)
|
||||
return
|
||||
// Haven't eaten, but I'm in a Human Disguise.
|
||||
else if (poweron_masquerade)
|
||||
to_chat(C, "<span class='notice'>Your stomach turns, but your \"human disguise\" keeps the food down...for now.</span>")
|
||||
// Keep looping until we purge. If we have activated our Human Disguise, we ignore the food. But it'll come up eventually...
|
||||
var/sickphase = 0
|
||||
while (foodInGut)
|
||||
sleep(50)
|
||||
C.adjust_disgust(10 * sickphase)
|
||||
// Wait an interval...
|
||||
sleep(50 + 50 * sickphase) // At intervals of 100, 150, and 200. (10 seconds, 15 seconds, and 20 seconds)
|
||||
// Died? Cancel
|
||||
if(C.stat == DEAD)
|
||||
return
|
||||
// Put up disguise? Then hold off the vomit.
|
||||
if(poweron_masquerade)
|
||||
if(sickphase > 0)
|
||||
to_chat(C, "<span class='notice'>Your stomach settles temporarily. You regain your composure...for now.</span>")
|
||||
sickphase = 0
|
||||
continue
|
||||
switch(sickphase)
|
||||
if (1)
|
||||
to_chat(C, "<span class='warning'>You feel unwell. You can taste ash on your tongue.</span>")
|
||||
C.Stun(10)
|
||||
if (2)
|
||||
to_chat(C, "<span class='warning'>Your stomach turns. Whatever you ate tastes of grave dirt and brimstone.</span>")
|
||||
C.Dizzy(15)
|
||||
C.Stun(13)
|
||||
if (3)
|
||||
to_chat(C, "<span class='warning'>You purge the food of the living from your viscera! You've never felt worse.</span>")
|
||||
C.vomit(foodInGut * 4, foodInGut * 2, 0) // (var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1, var/toxic = 0)
|
||||
C.blood_volume = max(0, C.blood_volume - foodInGut * 2)
|
||||
C.Stun(30)
|
||||
//C.Dizzy(50)
|
||||
foodInGut = 0
|
||||
sickphase ++
|
||||
@@ -1,350 +0,0 @@
|
||||
|
||||
|
||||
// Hide a random object somewhere on the station:
|
||||
// var/turf/targetturf = get_random_station_turf()
|
||||
// var/turf/targetturf = get_safe_random_station_turf()
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/objective/bloodsucker
|
||||
martyr_compatible = TRUE
|
||||
|
||||
// GENERATE!
|
||||
/datum/objective/bloodsucker/proc/generate_objective()
|
||||
update_explanation_text()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// // PROCS // //
|
||||
|
||||
|
||||
/datum/objective/bloodsucker/proc/return_possible_targets()
|
||||
var/list/possible_targets = list()
|
||||
|
||||
// Look at all crew members, and for/loop through.
|
||||
for(var/datum/mind/possible_target in get_crewmember_minds())
|
||||
// Check One: Default Valid User
|
||||
if(possible_target != owner && ishuman(possible_target.current) && possible_target.current.stat != DEAD)// && is_unique_objective(possible_target))
|
||||
// Check Two: Am Bloodsucker? OR in Bloodsucker list?
|
||||
if (possible_target.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) || (possible_target in SSticker.mode.bloodsuckers))
|
||||
continue
|
||||
else
|
||||
possible_targets += possible_target
|
||||
|
||||
return possible_targets
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/objective/bloodsucker/lair
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/lair/update_explanation_text()
|
||||
explanation_text = "Create a lair by claiming a coffin, and protect it until the end of the shift"// Make sure to keep it safe!"
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/lair/check_completion()
|
||||
var/datum/antagonist/bloodsucker/antagdatum = owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if (antagdatum && antagdatum.coffin && antagdatum.lair)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// Space_Station_13_areas.dm <--- all the areas
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Vassal becomes a Head, or part of a department
|
||||
/datum/objective/bloodsucker/protege
|
||||
|
||||
// LOOKUP: /datum/crewmonitor/proc/update_data(z) for .assignment to see how to get a person's PDA.
|
||||
var/list/roles = list(
|
||||
"Captain",
|
||||
"Head of Personnel",
|
||||
"Research Director",
|
||||
"Chief Engineer",
|
||||
"Chief Medical Officer",
|
||||
"Quartermaster"
|
||||
)
|
||||
var/list/departs = list(
|
||||
"Research Director",
|
||||
"Chief Engineer",
|
||||
"Chief Medical Officer",
|
||||
"Quartermaster"
|
||||
)
|
||||
|
||||
|
||||
var/target_role // Equals "HEAD" when it's not a department role.
|
||||
var/department_string
|
||||
|
||||
// GENERATE!
|
||||
/datum/objective/bloodsucker/protege/generate_objective()
|
||||
target_role = rand(0,2) == 0 ? "HEAD" : pick(departs)
|
||||
|
||||
// Heads?
|
||||
if (target_role == "HEAD")
|
||||
target_amount = rand(1, round(SSticker.mode.num_players() / 20))
|
||||
target_amount = CLAMP(target_amount,1,3)
|
||||
// Department?
|
||||
else
|
||||
switch(target_role)
|
||||
if("Research Director")
|
||||
department_string = "Science"
|
||||
if("Chief Engineer")
|
||||
department_string = "Engineering"
|
||||
if("Chief Medical Officer")
|
||||
department_string = "Medical"
|
||||
if("Quartermaster")
|
||||
department_string = "Cargo"
|
||||
target_amount = rand(round(SSticker.mode.num_players() / 20), round(SSticker.mode.num_players() / 10))
|
||||
target_amount = CLAMP(target_amount, 2, 4)
|
||||
..()
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/protege/update_explanation_text()
|
||||
if (target_role == "HEAD")
|
||||
if (target_amount == 1)
|
||||
explanation_text = "Guarantee a Vassal ends up as a Department Head or in a Leadership role."
|
||||
else
|
||||
explanation_text = "Guarantee [target_amount] Vassals end up as different Leadership or Department Heads."
|
||||
else
|
||||
explanation_text = "Have [target_amount] Vassal[target_amount==1?"":"s"] in the [department_string] department."
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/protege/check_completion()
|
||||
|
||||
var/datum/antagonist/bloodsucker/antagdatum = owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if (!antagdatum || antagdatum.vassals.len == 0)
|
||||
return FALSE
|
||||
|
||||
// Get list of all jobs that are qualified (for HEAD, this is already done)
|
||||
var/list/valid_jobs
|
||||
if (target_role == "HEAD")
|
||||
valid_jobs = roles
|
||||
else
|
||||
valid_jobs = list()
|
||||
var/list/alljobs = subtypesof(/datum/job) // This is just a list of TYPES, not the actual variables!
|
||||
for(var/T in alljobs)
|
||||
var/datum/job/J = SSjob.GetJobType(T) //
|
||||
if (!istype(J))
|
||||
continue
|
||||
// Found a job whose Dept Head matches either list of heads, or this job IS the head
|
||||
if ((target_role in J.department_head) || target_role == J.title)
|
||||
valid_jobs += J.title
|
||||
|
||||
|
||||
// Check Vassals, and see if they match
|
||||
var/objcount = 0
|
||||
var/list/counted_roles = list() // So you can't have more than one Captain count.
|
||||
for(var/datum/antagonist/vassal/V in antagdatum.vassals)
|
||||
if (!V || !V.owner || !V.owner.current) // Must exist somewhere, as a vassal and have a living body.
|
||||
continue
|
||||
|
||||
var/thisRole = "none"
|
||||
// Mind Assigned
|
||||
if ((V.owner.assigned_role in valid_jobs) && !(V.owner.assigned_role in counted_roles))
|
||||
//to_chat(owner, "<span class='userdanger'>PROTEGE OBJECTIVE: (MIND ROLE)</span>")
|
||||
thisRole = V.owner.assigned_role
|
||||
// Mob Assigned
|
||||
else if ((V.owner.current.job in valid_jobs) && !(V.owner.current.job in counted_roles))
|
||||
//to_chat(owner, "<span class='userdanger'>PROTEGE OBJECTIVE: (MOB JOB)</span>")
|
||||
thisRole = V.owner.current.job
|
||||
// PDA Assigned
|
||||
else if (V.owner.current && ishuman(V.owner.current))
|
||||
var/mob/living/carbon/human/H = V.owner.current
|
||||
var/obj/item/card/id/I = H.wear_id ? H.wear_id.GetID() : null
|
||||
if (I && (I.assignment in valid_jobs) && !(I.assignment in counted_roles))
|
||||
//to_chat(owner, "<span class='userdanger'>PROTEGE OBJECTIVE: (GET ID)</span>")
|
||||
thisRole = I.assignment
|
||||
|
||||
// NO MATCH
|
||||
if (thisRole == "none")
|
||||
continue
|
||||
|
||||
// SUCCESS!
|
||||
objcount ++
|
||||
if (target_role == "HEAD")
|
||||
counted_roles += thisRole // Add to list so we don't count it again (but only if it's a Head)
|
||||
|
||||
// NOTE!!!!!!!!!!!
|
||||
|
||||
// Look for jobs value on mobs! This is assigned at start, but COULD be assigned from HoP?
|
||||
//
|
||||
// ALSO - Search through all jobs (look for prefs earlier that look for all jobs, and search through all jobs to see if their head matches the head listed, or it IS the head)
|
||||
//
|
||||
// ALSO - registered_account in _vending.dm for banks, and assigning new ones.
|
||||
|
||||
//to_chat(antagdatum.owner, "<span class='userdanger'>PROTEGE OBJECTIVE: Final Count: [objcount] of [antagdatum.vassals.len] vassals</span>")
|
||||
return objcount >= target_amount
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Eat blood from a lot of people
|
||||
/datum/objective/bloodsucker/gourmand
|
||||
|
||||
// HOW: Track each feed (if human). Count victory.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Convert a crewmate
|
||||
/datum/objective/bloodsucker/embrace
|
||||
|
||||
// HOW: Find crewmate. Check if person is a bloodsucker
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Defile a facility with blood
|
||||
/datum/objective/bloodsucker/desecrate
|
||||
|
||||
// Space_Station_13_areas.dm <--- all the areas
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Destroy the Solar Arrays
|
||||
/datum/objective/bloodsucker/solars
|
||||
|
||||
// Space_Station_13_areas.dm <--- all the areas
|
||||
/datum/objective/bloodsucker/solars/update_explanation_text()
|
||||
explanation_text = "Prevent all solar arrays on the station from functioning."
|
||||
|
||||
/datum/objective/bloodsucker/solars/check_completion()
|
||||
// Sort through all /obj/machinery/power/solar_control in the station ONLY, and check that they are functioning.
|
||||
// Make sure that lastgen is 0 or connected_panels.len is 0. Doesnt matter if it's tracking.
|
||||
for (var/obj/machinery/power/solar_control/SC in SSsun.solars)
|
||||
// Check On Station:
|
||||
var/turf/T = get_turf(SC)
|
||||
if(!T || !is_station_level(T.z)) // <------ Taken from NukeOp
|
||||
//message_admins("DEBUG A: [SC] not on station!")
|
||||
continue // Not on station! We don't care about this.
|
||||
if (SC && SC.lastgen > 0 && SC.connected_panels.len > 0 && SC.connected_tracker)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Steal hearts. You just really wanna have some hearts.
|
||||
/datum/objective/bloodsucker/heartthief
|
||||
// NOTE: Look up /steal in objective.dm for inspiration.
|
||||
|
||||
// GENERATE!
|
||||
/datum/objective/bloodsucker/heartthief/generate_objective()
|
||||
target_amount = rand(1,3)
|
||||
|
||||
update_explanation_text()
|
||||
//dangerrating += target_amount * 2
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/heartthief/update_explanation_text()
|
||||
explanation_text = "Steal and keep [target_amount] heart[target_amount == 1 ? "" : "s"]." // TO DO: Limit them to Human Only!
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/heartthief/check_completion()
|
||||
// -Must have a body.
|
||||
if(!owner.current)
|
||||
return FALSE
|
||||
// Taken from /steal in objective.dm
|
||||
var/list/all_items = owner.current.GetAllContents() // Includes items inside other items.
|
||||
var/itemcount = FALSE
|
||||
for(var/obj/I in all_items) //Check for items
|
||||
if(istype(I, /obj/item/organ/heart/))
|
||||
itemcount++
|
||||
if(itemcount >= target_amount) // Got the right amount?
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/objective/bloodsucker/survive
|
||||
martyr_compatible = FALSE
|
||||
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/survive/update_explanation_text()
|
||||
explanation_text = "Survive the entire shift without succumbing to Final Death."
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/survive/check_completion()
|
||||
// -Must have a body.
|
||||
if (!owner.current || !isliving(owner.current))
|
||||
return FALSE
|
||||
// Dead, without a head or heart? Cya
|
||||
return owner.current.stat != DEAD// || owner.current.HaveBloodsuckerBodyparts()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/objective/bloodsucker/vamphunter
|
||||
|
||||
// GENERATE!
|
||||
/datum/objective/bloodsucker/vamphunter/generate_objective()
|
||||
update_explanation_text()
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/vamphunter/update_explanation_text()
|
||||
explanation_text = "Destroy all Bloodsuckers on [station_name()]."
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/vamphunter/check_completion()
|
||||
for (var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if (M && M.current && M.current.stat != DEAD && get_turf(M.current))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/objective/bloodsucker/monsterhunter
|
||||
|
||||
// GENERATE!
|
||||
/datum/objective/bloodsucker/monsterhunter/generate_objective()
|
||||
update_explanation_text()
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/monsterhunter/update_explanation_text()
|
||||
explanation_text = "Destroy all monsters on [station_name()]."
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/monsterhunter/check_completion()
|
||||
var/list/datum/mind/monsters = list()
|
||||
monsters += SSticker.mode.bloodsuckers
|
||||
monsters += SSticker.mode.devils
|
||||
monsters += SSticker.mode.cult
|
||||
monsters += SSticker.mode.wizards
|
||||
monsters += SSticker.mode.apprentices
|
||||
//monsters += SSticker.mode.servants_of_ratvar
|
||||
//monsters += SSticker.mode.changelings disabled anyways
|
||||
|
||||
for (var/datum/mind/M in monsters)
|
||||
if (M && M != owner && M.current && M.current.stat != DEAD && get_turf(M.current))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/datum/objective/bloodsucker/vassal
|
||||
|
||||
// GENERATE!
|
||||
/datum/objective/bloodsucker/vassal/generate_objective()
|
||||
update_explanation_text()
|
||||
|
||||
// EXPLANATION
|
||||
/datum/objective/bloodsucker/vassal/update_explanation_text()
|
||||
explanation_text = "Guarantee the success of your Master's mission!"
|
||||
|
||||
// WIN CONDITIONS?
|
||||
/datum/objective/bloodsucker/vassal/check_completion()
|
||||
var/datum/antagonist/vassal/antag_datum = owner.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
return antag_datum.master && antag_datum.master.owner && antag_datum.master.owner.current && antag_datum.master.owner.current.stat != DEAD
|
||||
@@ -1,284 +0,0 @@
|
||||
/datum/action/bloodsucker
|
||||
name = "Vampiric Gift"
|
||||
desc = "A vampiric gift."
|
||||
button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon
|
||||
background_icon_state = "vamp_power_off" //And this is the state for the background icon
|
||||
var/background_icon_state_on = "vamp_power_on" // FULP: Our "ON" icon alternative.
|
||||
var/background_icon_state_off = "vamp_power_off" // FULP: Our "OFF" icon alternative.
|
||||
icon_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the ACTION icon
|
||||
button_icon_state = "power_feed" //And this is the state for the action icon
|
||||
buttontooltipstyle = "cult"
|
||||
|
||||
// Action-Related
|
||||
//var/amPassive = FALSE // REMOVED: Just made it its own kind. // Am I just "on" at all times? (aka NO ICON)
|
||||
var/amTargetted = FALSE // Am I asked to choose a target when enabled? (Shows as toggled ON when armed)
|
||||
var/amToggle = FALSE // Can I be actively turned on and off?
|
||||
var/amSingleUse = FALSE // Am I removed after a single use?
|
||||
var/active = FALSE
|
||||
var/cooldown = 20 // 10 ticks, 1 second.
|
||||
var/cooldownUntil = 0 // From action.dm: next_use_time = world.time + cooldown_time
|
||||
// Power-Related
|
||||
var/level_current = 0 // Can increase to yield new abilities. Each power goes up in strength each Rank.
|
||||
//var/level_max = 1 //
|
||||
var/bloodcost = 10
|
||||
var/needs_button = TRUE // Taken from Changeling - for passive abilities that dont need a button
|
||||
var/bloodsucker_can_buy = FALSE // Must be a bloodsucker to use this power.
|
||||
var/warn_constant_cost = FALSE // Some powers charge you for staying on. Masquerade, Cloak, Veil, etc.
|
||||
var/can_use_in_torpor = FALSE // Most powers don't function if you're in torpor.
|
||||
var/must_be_capacitated = FALSE // Some powers require you to be standing and ready.
|
||||
var/can_be_immobilized = FALSE // Brawn can be used when incapacitated/laying if it's because you're being immobilized. NOTE: If must_be_capacitated is FALSE, this is irrelevant.
|
||||
var/can_be_staked = FALSE // Only Feed can happen with a stake in you.
|
||||
var/cooldown_static = FALSE // Feed, Masquerade, and One-Shot powers don't improve their cooldown.
|
||||
//var/not_bloodsucker = FALSE // This goes to Vassals or Hunters, but NOT bloodsuckers.
|
||||
|
||||
/datum/action/bloodsucker/New()
|
||||
if (bloodcost > 0)
|
||||
desc += "<br><br><b>COST:</b> [bloodcost] Blood" // Modify description to add cost.
|
||||
if (warn_constant_cost)
|
||||
desc += "<br><br><i>Your over-time blood consumption increases while [name] is active.</i>"
|
||||
if (amSingleUse)
|
||||
desc += "<br><br><i>Useable once per night.</i>"
|
||||
..()
|
||||
|
||||
// NOTES
|
||||
//
|
||||
// click.dm <--- Where we can take over mouse clicks
|
||||
// spells.dm /add_ranged_ability() <--- How we take over the mouse click to use a power on a target.
|
||||
|
||||
/datum/action/bloodsucker/Trigger()
|
||||
// Active? DEACTIVATE AND END!
|
||||
if (active && CheckCanDeactivate(TRUE))
|
||||
DeactivatePower()
|
||||
return
|
||||
if (!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE))
|
||||
return
|
||||
PayCost()
|
||||
if (amToggle)
|
||||
active = !active
|
||||
UpdateButtonIcon()
|
||||
if (!amToggle || !active)
|
||||
StartCooldown() // Must come AFTER UpdateButton(), otherwise icon will revert.
|
||||
ActivatePower() // NOTE: ActivatePower() freezes this power in place until it ends.
|
||||
if (active) // Did we not manually disable? Handle it here.
|
||||
DeactivatePower()
|
||||
if (amSingleUse)
|
||||
RemoveAfterUse()
|
||||
|
||||
/datum/action/bloodsucker/proc/CheckCanPayCost(display_error)
|
||||
if(!owner || !owner.mind)
|
||||
return FALSE
|
||||
// Cooldown?
|
||||
if (cooldownUntil > world.time)
|
||||
if (display_error)
|
||||
to_chat(owner, "[src] is unavailable. Wait [(cooldownUntil - world.time) / 10] seconds.")
|
||||
return FALSE
|
||||
// Have enough blood?
|
||||
var/mob/living/L = owner
|
||||
if (L.blood_volume < bloodcost)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You need at least [bloodcost] blood to activate [name]</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/proc/CheckCanUse(display_error) // These checks can be scanned every frame while a ranged power is on.
|
||||
if(!owner || !owner.mind)
|
||||
return FALSE
|
||||
// Torpor?
|
||||
if(!can_use_in_torpor && HAS_TRAIT(owner, TRAIT_DEATHCOMA))
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>Not while you're in Torpor.</span>")
|
||||
return FALSE
|
||||
// Stake?
|
||||
if(!can_be_staked && owner.AmStaked())
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>You have a stake in your chest! Your powers are useless.</span>")
|
||||
return FALSE
|
||||
// Incap?
|
||||
if(must_be_capacitated)
|
||||
var/mob/living/L = owner
|
||||
if (L.incapacitated(TRUE, TRUE) || L.resting && !can_be_immobilized)
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>Not while you're incapacitated!</span>")
|
||||
return FALSE
|
||||
// Constant Cost (out of blood)
|
||||
if(warn_constant_cost)
|
||||
var/mob/living/L = owner
|
||||
if(L.blood_volume <= 0)
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>You don't have the blood to upkeep [src].</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/proc/StartCooldown()
|
||||
set waitfor = FALSE
|
||||
// Alpha Out
|
||||
button.color = rgb(128,0,0,128)
|
||||
button.alpha = 100
|
||||
// Calculate Cooldown (by power's level)
|
||||
var/this_cooldown = (cooldown_static || amSingleUse) ? cooldown : max(cooldown / 2, cooldown - (cooldown / 16 * (level_current-1)))
|
||||
// NOTE: With this formula, you'll hit half cooldown at level 8 for that power.
|
||||
|
||||
// Wait for cooldown
|
||||
cooldownUntil = world.time + this_cooldown
|
||||
spawn(this_cooldown)
|
||||
// Alpha In
|
||||
button.color = rgb(255,255,255,255)
|
||||
button.alpha = 255
|
||||
|
||||
/datum/action/bloodsucker/proc/CheckCanDeactivate(display_error)
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/UpdateButtonIcon(force = FALSE)
|
||||
background_icon_state = active? background_icon_state_on : background_icon_state_off
|
||||
..()//UpdateButtonIcon()
|
||||
|
||||
|
||||
/datum/action/bloodsucker/proc/PayCost()
|
||||
// owner for actions is the mob, not mind.
|
||||
var/mob/living/L = owner
|
||||
L.blood_volume -= bloodcost
|
||||
|
||||
|
||||
/datum/action/bloodsucker/proc/ActivatePower()
|
||||
|
||||
|
||||
/datum/action/bloodsucker/proc/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
active = FALSE
|
||||
UpdateButtonIcon()
|
||||
StartCooldown()
|
||||
|
||||
/datum/action/bloodsucker/proc/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active.
|
||||
return active && user && (!warn_constant_cost || user.blood_volume > 0)
|
||||
|
||||
/datum/action/bloodsucker/proc/RemoveAfterUse()
|
||||
// Un-Learn Me! (GO HOME
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if (istype(bloodsuckerdatum))
|
||||
bloodsuckerdatum.powers -= src
|
||||
Remove(owner)
|
||||
|
||||
/datum/action/bloodsucker/proc/Upgrade()
|
||||
level_current ++
|
||||
|
||||
/////////////////////////////////// PASSIVE POWERS ///////////////////////////////////
|
||||
|
||||
// New Type: Passive (Always on, no button)
|
||||
/datum/action/bloodsucker/passive
|
||||
|
||||
/datum/action/bloodsucker/passive/New()
|
||||
// REMOVED: DO NOTHBING!
|
||||
..()
|
||||
// Don't Display Button! (it doesn't do anything anyhow)
|
||||
button.screen_loc = DEFAULT_BLOODSPELLS
|
||||
button.moved = DEFAULT_BLOODSPELLS
|
||||
button.ordered = FALSE
|
||||
/datum/action/bloodsucker/passive/Destroy()
|
||||
if(owner)
|
||||
Remove(owner)
|
||||
target = null
|
||||
|
||||
/////////////////////////////////// TARGETTED POWERS ///////////////////////////////////
|
||||
|
||||
/datum/action/bloodsucker/targeted
|
||||
// NOTE: All Targeted spells are Toggles! We just don't bother checking here.
|
||||
var/target_range = 99
|
||||
var/message_Trigger = "Select a target."
|
||||
var/obj/effect/proc_holder/bloodsucker/bs_proc_holder
|
||||
var/power_activates_immediately = TRUE // Most powers happen the moment you click. Some, like Mesmerize, require time and shouldn't cost you if they fail.
|
||||
|
||||
var/power_in_use = FALSE // Is this power LOCKED due to being used?
|
||||
|
||||
/datum/action/bloodsucker/targeted/New(Target)
|
||||
desc += "<br>\[<i>Targeted Power</i>\]" // Modify description to add notice that this is aimed.
|
||||
..()
|
||||
// Create Proc Holder for intercepting clicks
|
||||
bs_proc_holder = new ()
|
||||
bs_proc_holder.linked_power = src
|
||||
|
||||
// Click power: Begin Aim
|
||||
/datum/action/bloodsucker/targeted/Trigger()
|
||||
if(active && CheckCanDeactivate(TRUE))
|
||||
DeactivateRangedAbility()
|
||||
DeactivatePower()
|
||||
return
|
||||
if(!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE))
|
||||
return
|
||||
active = !active
|
||||
UpdateButtonIcon()
|
||||
// Create & Link Targeting Proc
|
||||
var/mob/living/L = owner
|
||||
if(L.ranged_ability)
|
||||
L.ranged_ability.remove_ranged_ability()
|
||||
bs_proc_holder.add_ranged_ability(L)
|
||||
|
||||
if(message_Trigger != "")
|
||||
to_chat(owner, "<span class='announce'>[message_Trigger]</span>")
|
||||
|
||||
/datum/action/bloodsucker/targeted/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if(!owner.client) // <--- We don't allow non client usage so that using powers like mesmerize will FAIL if you try to use them as ghost. Why? because ranged_abvility in spell.dm
|
||||
return FALSE // doesn't let you remove powers if you're not there. So, let's just cancel the power entirely.
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
// Don't run ..(), we don't want to engage the cooldown until we USE this power!
|
||||
active = FALSE
|
||||
UpdateButtonIcon()
|
||||
|
||||
/datum/action/bloodsucker/targeted/proc/DeactivateRangedAbility()
|
||||
// Only Turned off when CLICK is disabled...aka, when you successfully clicked (or
|
||||
bs_proc_holder.remove_ranged_ability()
|
||||
|
||||
// Check if target is VALID (wall, turf, or character?)
|
||||
/datum/action/bloodsucker/targeted/proc/CheckValidTarget(atom/A)
|
||||
return FALSE // FALSE targets nothing.
|
||||
|
||||
// Check if valid target meets conditions
|
||||
/datum/action/bloodsucker/targeted/proc/CheckCanTarget(atom/A, display_error)
|
||||
// Out of Range
|
||||
if(!(A in view(target_range, owner)))
|
||||
if(display_error && target_range > 1) // Only warn for range if it's greater than 1. Brawn doesn't need to announce itself.
|
||||
to_chat(owner, "<span class='warning'>Your target is out of range.</span>")
|
||||
return FALSE
|
||||
return istype(A)
|
||||
|
||||
// Click Target
|
||||
/datum/action/bloodsucker/targeted/proc/ClickWithPower(atom/A)
|
||||
// CANCEL RANGED TARGET check
|
||||
if(power_in_use || !CheckValidTarget(A))
|
||||
return FALSE
|
||||
// Valid? (return true means DON'T cancel power!)
|
||||
if(!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE) || !CheckCanTarget(A, TRUE))
|
||||
return TRUE
|
||||
// Skip this part so we can return TRUE right away.
|
||||
if(power_activates_immediately)
|
||||
PowerActivatedSuccessfully() // Mesmerize pays only after success.
|
||||
power_in_use = TRUE // Lock us into this ability until it successfully fires off. Otherwise, we pay the blood even if we fail.
|
||||
FireTargetedPower(A) // We use this instead of ActivatePower(), which has no input
|
||||
power_in_use = FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/proc/FireTargetedPower(atom/A)
|
||||
// Like ActivatePower, but specific to Targeted (and takes an atom input). We don't use ActivatePower for targeted.
|
||||
|
||||
/datum/action/bloodsucker/targeted/proc/PowerActivatedSuccessfully()
|
||||
// The power went off! We now pay the cost of the power.
|
||||
PayCost()
|
||||
DeactivateRangedAbility()
|
||||
DeactivatePower()
|
||||
StartCooldown() // Do AFTER UpdateIcon() inside of DeactivatePower. Otherwise icon just gets wiped.
|
||||
|
||||
/datum/action/bloodsucker/targeted/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active.
|
||||
return ..()
|
||||
// Target Proc Holder
|
||||
/obj/effect/proc_holder/bloodsucker
|
||||
var/datum/action/bloodsucker/targeted/linked_power
|
||||
|
||||
/obj/effect/proc_holder/bloodsucker/remove_ranged_ability(msg)
|
||||
..()
|
||||
linked_power.DeactivatePower()
|
||||
|
||||
/obj/effect/proc_holder/bloodsucker/InterceptClickOn(mob/living/caller, params, atom/A)
|
||||
return linked_power.ClickWithPower(A)
|
||||
@@ -1,195 +0,0 @@
|
||||
#define TIME_BLOODSUCKER_DAY_WARN 90 // 1.5 minutes
|
||||
#define TIME_BLOODSUCKER_DAY_FINAL_WARN 25 // 25 sec
|
||||
#define TIME_BLOODSUCKER_DAY 60 // 1.5 minutes // 10 is a second, 600 is a minute.
|
||||
#define TIME_BLOODSUCKER_BURN_INTERVAL 40 // 4 sec
|
||||
|
||||
|
||||
// Over Time, tick down toward a "Solar Flare" of UV buffeting the station. This period is harmful to vamps.
|
||||
/obj/effect/sunlight
|
||||
//var/amDay = FALSE
|
||||
var/cancel_me = FALSE
|
||||
var/amDay = FALSE
|
||||
var/time_til_cycle = 0
|
||||
var/nightime_duration = 900 //15 minutes
|
||||
|
||||
/obj/effect/sunlight/Initialize()
|
||||
countdown()
|
||||
hud_tick()
|
||||
|
||||
/obj/effect/sunlight/proc/countdown()
|
||||
set waitfor = FALSE
|
||||
|
||||
while(!cancel_me)
|
||||
|
||||
time_til_cycle = nightime_duration
|
||||
|
||||
// Part 1: Night (all is well)
|
||||
while(time_til_cycle > TIME_BLOODSUCKER_DAY_WARN)
|
||||
sleep(10)
|
||||
if(cancel_me)
|
||||
return
|
||||
//sleep(TIME_BLOODSUCKER_NIGHT - TIME_BLOODSUCKER_DAY_WARN)
|
||||
warn_daylight(1,"<span class = 'danger'>Solar Flares will bombard the station with dangerous UV in [TIME_BLOODSUCKER_DAY_WARN / 60] minutes. <b>Prepare to seek cover in a coffin or closet.</b></span>") // time2text <-- use Help On
|
||||
give_home_power() // Give VANISHING ACT power to all vamps with a lair!
|
||||
|
||||
// Part 2: Night Ending
|
||||
while(time_til_cycle > TIME_BLOODSUCKER_DAY_FINAL_WARN)
|
||||
sleep(10)
|
||||
if(cancel_me)
|
||||
return
|
||||
//sleep(TIME_BLOODSUCKER_DAY_WARN - TIME_BLOODSUCKER_DAY_FINAL_WARN)
|
||||
message_admins("BLOODSUCKER NOTICE: Daylight beginning in [TIME_BLOODSUCKER_DAY_FINAL_WARN] seconds.)")
|
||||
warn_daylight(2,"<span class = 'userdanger'>Solar Flares are about to bombard the station! You have [TIME_BLOODSUCKER_DAY_FINAL_WARN] seconds to find cover!</span>",\
|
||||
"<span class = 'danger'>In [TIME_BLOODSUCKER_DAY_FINAL_WARN / 10], your master will be at risk of a Solar Flare. Make sure they find cover!</span>")
|
||||
|
||||
// (FINAL LIL WARNING)
|
||||
while(time_til_cycle > 5)
|
||||
sleep(10)
|
||||
if (cancel_me)
|
||||
return
|
||||
//sleep(TIME_BLOODSUCKER_DAY_FINAL_WARN - 50)
|
||||
warn_daylight(3,"<span class = 'userdanger'>Seek cover, for Sol rises!</span>")
|
||||
|
||||
// Part 3: Night Ending
|
||||
while (time_til_cycle > 0)
|
||||
sleep(10)
|
||||
if (cancel_me)
|
||||
return
|
||||
//sleep(50)
|
||||
warn_daylight(4,"<span class = 'userdanger'>Solar flares bombard the station with deadly UV light!</span><br><span class = ''>Stay in cover for the next [TIME_BLOODSUCKER_DAY / 60] minutes or risk Final Death!</span>",\
|
||||
"<span class = 'danger'>Solar flares bombard the station with UV light!</span>")
|
||||
|
||||
// Part 4: Day
|
||||
amDay = TRUE
|
||||
message_admins("BLOODSUCKER NOTICE: Daylight Beginning (Lasts for [TIME_BLOODSUCKER_DAY / 60] minutes.)")
|
||||
time_til_cycle = TIME_BLOODSUCKER_DAY
|
||||
sleep(10) // One second grace period.
|
||||
//var/daylight_time = TIME_BLOODSUCKER_DAY
|
||||
var/issued_XP = FALSE
|
||||
while(time_til_cycle > 0)
|
||||
punish_vamps()
|
||||
sleep(TIME_BLOODSUCKER_BURN_INTERVAL)
|
||||
if (cancel_me)
|
||||
return
|
||||
//daylight_time -= TIME_BLOODSUCKER_BURN_INTERVAL
|
||||
// Issue Level Up!
|
||||
if(!issued_XP && time_til_cycle <= 15)
|
||||
issued_XP = TRUE
|
||||
vamps_rank_up()
|
||||
|
||||
warn_daylight(5,"<span class = 'announce'>The solar flare has ended, and the daylight danger has passed...for now.</span>",\
|
||||
"<span class = 'announce'>The solar flare has ended, and the daylight danger has passed...for now.</span>")
|
||||
amDay = FALSE
|
||||
day_end() // Remove VANISHING ACT power from all vamps who have it! Clear Warnings (sunlight, locker protection)
|
||||
nightime_duration += 100 //Each day makes the night a minute longer.
|
||||
message_admins("BLOODSUCKER NOTICE: Daylight Ended. Resetting to Night (Lasts for [nightime_duration / 60] minutes.)")
|
||||
|
||||
/obj/effect/sunlight/proc/hud_tick()
|
||||
set waitfor = FALSE
|
||||
while(!cancel_me)
|
||||
// Update all Bloodsucker sunlight huds
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if(!istype(M) || !istype(M.current))
|
||||
continue
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(istype(bloodsuckerdatum))
|
||||
bloodsuckerdatum.update_sunlight(max(0, time_til_cycle), amDay) // This pings all HUDs
|
||||
sleep(10)
|
||||
time_til_cycle --
|
||||
|
||||
/obj/effect/sunlight/proc/warn_daylight(danger_level=0, vampwarn = "", vassalwarn = "")
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if(!istype(M))
|
||||
continue
|
||||
to_chat(M,vampwarn)
|
||||
if(M.current)
|
||||
if(danger_level == 1)
|
||||
M.current.playsound_local(null, 'sound/chatter/griffin_3.ogg', 50 + danger_level, 1)
|
||||
else if(danger_level == 2)
|
||||
M.current.playsound_local(null, 'sound/chatter/griffin_5.ogg', 50 + danger_level, 1)
|
||||
else if(danger_level == 3)
|
||||
M.current.playsound_local(null, 'sound/effects/alert.ogg', 75, 1)
|
||||
else if(danger_level == 4)
|
||||
M.current.playsound_local(null, 'sound/ambience/ambimystery.ogg', 100, 1)
|
||||
else if(danger_level == 5)
|
||||
M.current.playsound_local(null, 'sound/spookoween/ghosty_wind.ogg', 90, 1)
|
||||
|
||||
if(vassalwarn != "")
|
||||
for(var/datum/mind/M in SSticker.mode.vassals)
|
||||
if(!istype(M))
|
||||
continue
|
||||
to_chat(M,vassalwarn)
|
||||
|
||||
|
||||
/obj/effect/sunlight/proc/punish_vamps()
|
||||
// Cycle through all vamp antags and check if they're inside a closet.
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if(!istype(M) || !istype(M.current))
|
||||
continue
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(!istype(bloodsuckerdatum))
|
||||
continue
|
||||
// Closets offer SOME protection
|
||||
if(istype(M.current.loc, /obj/structure))
|
||||
// Coffins offer the BEST protection
|
||||
if(istype(M.current.loc, /obj/structure/closet/crate/coffin))
|
||||
SEND_SIGNAL(M.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/coffinsleep)
|
||||
continue
|
||||
else
|
||||
if(!bloodsuckerdatum.warn_sun_locker)
|
||||
to_chat(M, "<span class='warning'>Your skin sizzles. The [M.current.loc] doesn't protect well against UV bombardment.</span>")
|
||||
bloodsuckerdatum.warn_sun_locker = TRUE
|
||||
M.current.adjustFireLoss(0.5 + bloodsuckerdatum.vamplevel / 2) // M.current.fireloss += 0.5 + bloodsuckerdatum.vamplevel / 2 // Do DIRECT damage. Being spaced was causing this to not occur. setFireLoss(bloodsuckerdatum.vamplevel)
|
||||
M.current.updatehealth()
|
||||
SEND_SIGNAL(M.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/daylight_1)
|
||||
// Out in the Open? Buh Bye
|
||||
else
|
||||
if(!bloodsuckerdatum.warn_sun_burn)
|
||||
if(bloodsuckerdatum.vamplevel > 0)
|
||||
to_chat(M, "<span class='userdanger'>The solar flare sets your skin ablaze!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>The solar flare scalds your neophyte skin!</span>")
|
||||
bloodsuckerdatum.warn_sun_burn = TRUE
|
||||
if(M.current.fire_stacks <= 0)
|
||||
M.current.fire_stacks = 0
|
||||
if(bloodsuckerdatum.vamplevel > 0)
|
||||
M.current.adjust_fire_stacks(0.2 + bloodsuckerdatum.vamplevel / 10)
|
||||
M.current.IgniteMob()
|
||||
M.current.adjustFireLoss(2 + bloodsuckerdatum.vamplevel) // M.current.fireloss += 2 + bloodsuckerdatum.vamplevel // Do DIRECT damage. Being spaced was causing this to not occur. //setFireLoss(2 + bloodsuckerdatum.vamplevel)
|
||||
M.current.updatehealth()
|
||||
SEND_SIGNAL(M.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/daylight_2)
|
||||
|
||||
/obj/effect/sunlight/proc/day_end()
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if(!istype(M) || !istype(M.current))
|
||||
continue
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(!istype(bloodsuckerdatum))
|
||||
continue
|
||||
// Reset Warnings
|
||||
bloodsuckerdatum.warn_sun_locker = FALSE
|
||||
bloodsuckerdatum.warn_sun_burn = FALSE
|
||||
// Remove Dawn Powers
|
||||
for(var/datum/action/bloodsucker/P in bloodsuckerdatum.powers)
|
||||
if(istype(P, /datum/action/bloodsucker/gohome))
|
||||
bloodsuckerdatum.powers -= P
|
||||
P.Remove(M.current)
|
||||
|
||||
/obj/effect/sunlight/proc/vamps_rank_up()
|
||||
set waitfor = FALSE
|
||||
// Cycle through all vamp antags and check if they're inside a closet.
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if(!istype(M) || !istype(M.current))
|
||||
continue
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(istype(bloodsuckerdatum))
|
||||
bloodsuckerdatum.RankUp() // Rank up! Must still be in a coffin to level!
|
||||
|
||||
/obj/effect/sunlight/proc/give_home_power()
|
||||
// It's late...! Give the "Vanishing Act" gohome power to bloodsuckers.
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if(!istype(M) || !istype(M.current))
|
||||
continue
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(istype(bloodsuckerdatum) && bloodsuckerdatum.lair && !(locate(/datum/action/bloodsucker/gohome) in bloodsuckerdatum.powers))
|
||||
bloodsuckerdatum.BuyPower(new /datum/action/bloodsucker/gohome)
|
||||
@@ -1,110 +0,0 @@
|
||||
|
||||
|
||||
// For all things visual, such as leveling up
|
||||
|
||||
|
||||
// Look up: _vending.dm proc/ui_interact()
|
||||
// Malf_Modules.dm proc/use()
|
||||
|
||||
/*
|
||||
/datum/antagonist/bloodsucker/proc/LevelUpMenu()
|
||||
var/list/dat = list()
|
||||
dat += "<h3>You have become more ancient.<BR>Direct the path of your blood</h3>"
|
||||
dat += "<HR>"
|
||||
// Step One: Decide powers you CAN buy.
|
||||
for(var/pickedpower in typesof(/datum/action/bloodsucker))
|
||||
var/obj/effect/proc_holder/spell/bloodsucker/power = pickedpower
|
||||
// NAME
|
||||
dat += "<A href='byond://?src=[REF(src)];[module.mod_pick_name]=1'>[power.name]</A>"
|
||||
// COST
|
||||
dat += "<td align='right'><b>[power.name] </b><a href='byond://?src=[REF(src)];vend=[REF(R)]'>Vend</a></td>"
|
||||
dat == "<BR>"
|
||||
var/datum/browser/popup = new(owner.current, "bloodsuckerrank", "Bloodsucker Rank Up")
|
||||
popup.set_content(dat.Join())
|
||||
popup.open()
|
||||
/datum/antagonist/bloodsucker/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
*/
|
||||
|
||||
|
||||
// From browser.dm: /datum/browser/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null)
|
||||
|
||||
|
||||
/*
|
||||
var/list/dat = list()
|
||||
dat += "<B>Select use of processing time: (currently #[processing_time] left.)</B><BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<B>Install Module:</B><BR>"
|
||||
dat += "<I>The number afterwards is the amount of processing time it consumes.</I><BR>"
|
||||
for(var/datum/AI_Module/large/module in possible_modules)
|
||||
dat += "<A href='byond://?src=[REF(src)];[module.mod_pick_name]=1'>[module.module_name]</A><A href='byond://?src=[REF(src)];showdesc=[module.mod_pick_name]'>\[?\]</A> ([module.cost])<BR>"
|
||||
for(var/datum/AI_Module/small/module in possible_modules)
|
||||
dat += "<A href='byond://?src=[REF(src)];[module.mod_pick_name]=1'>[module.module_name]</A><A href='byond://?src=[REF(src)];showdesc=[module.mod_pick_name]'>\[?\]</A> ([module.cost])<BR>"
|
||||
dat += "<HR>"
|
||||
if(temp)
|
||||
dat += "[temp]"
|
||||
var/datum/browser/popup = new(user, "modpicker", "Malf Module Menu")
|
||||
popup.set_content(dat.Join())
|
||||
popup.open()
|
||||
*/
|
||||
|
||||
/*
|
||||
var/dat = ""
|
||||
var/datum/bank_account/account
|
||||
var/mob/living/carbon/human/H
|
||||
var/obj/item/card/id/C
|
||||
if(ishuman(user))
|
||||
H = user
|
||||
C = H.get_idcard(TRUE)
|
||||
if(!C)
|
||||
dat += "<font color = 'red'><h3>No ID Card detected!</h3></font>"
|
||||
else if (!C.registered_account)
|
||||
dat += "<font color = 'red'><h3>No account on registered ID card!</h3></font>"
|
||||
if(onstation && C && C.registered_account)
|
||||
account = C.registered_account
|
||||
dat += "<h3>Select an item</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
if(!product_records.len)
|
||||
dat += "<font color = 'red'>No product loaded!</font>"
|
||||
else
|
||||
var/list/display_records = product_records + coin_records
|
||||
if(extended_inventory)
|
||||
display_records = product_records + coin_records + hidden_records
|
||||
dat += "<table>"
|
||||
for (var/datum/data/vending_product/R in display_records)
|
||||
var/price_listed = "$[default_price]"
|
||||
var/is_hidden = hidden_records.Find(R)
|
||||
if(is_hidden && !extended_inventory)
|
||||
continue
|
||||
if(R.custom_price)
|
||||
price_listed = "$[R.custom_price]"
|
||||
if(!onstation || account && account.account_job && account.account_job.paycheck_department == payment_department)
|
||||
price_listed = "FREE"
|
||||
if(coin_records.Find(R) || is_hidden)
|
||||
price_listed = "$[R.custom_premium_price ? R.custom_premium_price : extra_price]"
|
||||
dat += "<tr><td><img src='data:image/jpeg;base64,[GetIconForProduct(R)]'/></td>"
|
||||
dat += "<td style=\"width: 100%\"><b>[sanitize(R.name)] ([price_listed])</b></td>"
|
||||
if(R.amount > 0 && ((C && C.registered_account && onstation) || (!onstation && isliving(user))))
|
||||
dat += "<td align='right'><b>[R.amount] </b><a href='byond://?src=[REF(src)];vend=[REF(R)]'>Vend</a></td>"
|
||||
else
|
||||
dat += "<td align='right'><span class='linkOff'>Not Available</span></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "</div>"
|
||||
if(onstation && C && C.registered_account)
|
||||
dat += "<b>Balance: $[account.account_balance]</b>"
|
||||
if(istype(src, /obj/machinery/vending/snack))
|
||||
dat += "<h3>Chef's Food Selection</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
for (var/O in dish_quants)
|
||||
if(dish_quants[O] > 0)
|
||||
var/N = dish_quants[O]
|
||||
dat += "<a href='byond://?src=[REF(src)];dispense=[sanitize(O)]'>Dispense</A> "
|
||||
dat += "<B>[capitalize(O)] ($[default_price]): [N]</B><br>"
|
||||
dat += "</div>"
|
||||
var/datum/browser/popup = new(user, "vending", (name))
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
|
||||
popup.open()
|
||||
*/
|
||||
@@ -1,790 +0,0 @@
|
||||
/datum/team/vampireclan
|
||||
name = "Clan" // Teravanni,
|
||||
|
||||
/datum/antagonist/bloodsucker
|
||||
name = "Bloodsucker"
|
||||
roundend_category = "bloodsuckers"
|
||||
antagpanel_category = "Bloodsucker"
|
||||
job_rank = ROLE_BLOODSUCKER
|
||||
|
||||
// NAME
|
||||
var/vampname // My Dracula name
|
||||
var/vamptitle // My Dracula title
|
||||
var/vampreputation // My "Surname" or description of my deeds
|
||||
// CLAN
|
||||
var/datum/team/vampireclan/clan
|
||||
var/list/datum/antagonist/vassal/vassals = list()// Vassals under my control. Periodically remove the dead ones.
|
||||
var/datum/mind/creator // Who made me? For both Vassals AND Bloodsuckers (though Master Vamps won't have one)
|
||||
// POWERS
|
||||
var/list/datum/action/powers = list()// Purchased powers
|
||||
var/poweron_feed = FALSE // Am I feeding?
|
||||
var/poweron_masquerade = FALSE
|
||||
// STATS
|
||||
var/vamplevel = 0
|
||||
var/vamplevel_unspent = 1
|
||||
var/regenRate = 0.3 // How many points of Brute do I heal per tick?
|
||||
var/feedAmount = 15 // Amount of blood drawn from a target per tick.
|
||||
var/maxBloodVolume = 600 // Maximum blood a Vamp can hold via feeding. // BLOOD_VOLUME_NORMAL 550 // BLOOD_VOLUME_SAFE 475 //BLOOD_VOLUME_OKAY 336 //BLOOD_VOLUME_BAD 224 // BLOOD_VOLUME_SURVIVE 122
|
||||
// OBJECTIVES
|
||||
var/list/datum/objective/objectives_given = list() // For removal if needed.
|
||||
var/area/lair
|
||||
var/obj/structure/closet/crate/coffin
|
||||
// TRACKING
|
||||
var/foodInGut = 0 // How much food to throw up later. You shouldn't have eaten that.
|
||||
var/warn_sun_locker = FALSE // So we only get the locker burn message once per day.
|
||||
var/warn_sun_burn = FALSE // So we only get the sun burn message once per day.
|
||||
var/had_toxlover = FALSE
|
||||
// LISTS
|
||||
var/static/list/defaultTraits = list (TRAIT_STABLEHEART, TRAIT_NOBREATH, TRAIT_SLEEPIMMUNE, TRAIT_NOCRITDAMAGE, TRAIT_RESISTCOLD, TRAIT_RADIMMUNE, TRAIT_VIRUSIMMUNE, TRAIT_NIGHT_VISION, \
|
||||
TRAIT_NOSOFTCRIT, TRAIT_NOHARDCRIT, TRAIT_AGEUSIA, TRAIT_COLDBLOODED, TRAIT_NONATURALHEAL, TRAIT_NOMARROW, TRAIT_NOPULSE, TRAIT_NOCLONE)
|
||||
// NOTES: TRAIT_AGEUSIA <-- Doesn't like flavors.
|
||||
// REMOVED: TRAIT_NODEATH
|
||||
// TO ADD:
|
||||
//var/static/list/defaultOrgans = list (/obj/item/organ/heart/vampheart,/obj/item/organ/heart/vampeyes)
|
||||
var/traitorwin = TRUE
|
||||
|
||||
/datum/antagonist/bloodsucker/on_gain()
|
||||
SSticker.mode.bloodsuckers |= owner // Add if not already in here (and you might be, if you were picked at round start)
|
||||
SSticker.mode.check_start_sunlight()// Start Sunlight? (if first Vamp)
|
||||
SelectFirstName()// Name & Title
|
||||
SelectTitle(am_fledgling=TRUE) // If I have a creator, then set as Fledgling.
|
||||
SelectReputation(am_fledgling=TRUE)
|
||||
AssignStarterPowersAndStats()// Give Powers & Stats
|
||||
forge_bloodsucker_objectives()// Objectives & Team
|
||||
update_bloodsucker_icons_added(owner.current, "bloodsucker") // Add Antag HUD
|
||||
LifeTick() // Run Life Function
|
||||
. = ..()
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/on_removal()
|
||||
SSticker.mode.bloodsuckers -= owner
|
||||
SSticker.mode.check_cancel_sunlight()// End Sunlight? (if last Vamp)
|
||||
ClearAllPowersAndStats()// Clear Powers & Stats
|
||||
clear_bloodsucker_objectives() // Objectives
|
||||
update_bloodsucker_icons_removed(owner.current)// Clear Antag HUD
|
||||
. = ..()
|
||||
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/greet()
|
||||
var/fullname = ReturnFullName(TRUE)
|
||||
to_chat(owner, "<span class='userdanger'>You are [fullname], a strain of vampire dubbed bloodsucker!</span><br>")
|
||||
owner.announce_objectives()
|
||||
to_chat(owner, "<span class='boldannounce'>* You regenerate your health slowly, you're weak to fire, and you depend on blood to survive. Allow your stolen blood to run too low, and you will find yourself at \
|
||||
risk of being discovered!</span><br>")
|
||||
//to_chat(owner, "<span class='boldannounce'>As an immortal, your power is linked to your age. The older you grow, the more abilities you will have access to.<span>")
|
||||
var/bloodsucker_greet
|
||||
bloodsucker_greet += "<span class='boldannounce'>* Other Bloodsuckers are not necessarily your friends, but your survival may depend on cooperation. Betray them at your own discretion and peril.</span><br>"
|
||||
bloodsucker_greet += "<span class='boldannounce'><i>* Use \",b\" to speak your ancient Bloodsucker language.</span><br>"
|
||||
bloodsucker_greet += "<span class='announce'>Bloodsucker Tip: Rest in a <i>Coffin</i> to claim it, and that area, as your lair.</span><br>"
|
||||
bloodsucker_greet += "<span class='announce'>Bloodsucker Tip: Fear the daylight! Solar flares will bombard the station periodically, and only your coffin can guarantee your safety.</span><br>"
|
||||
bloodsucker_greet += "<span class='announce'>Bloodsucker Tip: You wont loose blood if you are unconcious or sleeping. Use this to your advantage to conserve blood.</span><br>"
|
||||
to_chat(owner, bloodsucker_greet)
|
||||
|
||||
owner.current.playsound_local(null, 'sound/bloodsucker/BloodsuckerAlert.ogg', 100, FALSE, pressure_affected = FALSE)
|
||||
antag_memory += "Although you were born a mortal, in un-death you earned the name <b>[fullname]</b>.<br>"
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/farewell()
|
||||
owner.current.visible_message("[owner.current]'s skin flushes with color, their eyes growing glossier. They look...alive.",\
|
||||
"<span class='userdanger'><FONT size = 3>With a snap, your curse has ended. You are no longer a Bloodsucker. You live once more!</FONT></span>")
|
||||
// Refill with Blood
|
||||
owner.current.blood_volume = max(owner.current.blood_volume,BLOOD_VOLUME_SAFE)
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/SelectFirstName()
|
||||
// Names (EVERYONE gets one))
|
||||
if (owner.current.gender == MALE)
|
||||
vampname = pick("Desmond","Rudolph","Dracul","Vlad","Pyotr","Gregor","Cristian","Christoff","Marcu","Andrei","Constantin","Gheorghe","Grigore","Ilie","Iacob","Luca","Mihail","Pavel","Vasile","Octavian","Sorin", \
|
||||
"Sveyn","Aurel","Alexe","Iustin","Theodor","Dimitrie","Octav","Damien","Magnus","Caine","Abel", // Romanian/Ancient
|
||||
"Lucius","Gaius","Otho","Balbinus","Arcadius","Romanos","Alexios","Vitellius", // Latin
|
||||
"Melanthus","Teuthras","Orchamus","Amyntor","Axion", // Greek
|
||||
"Thoth","Thutmose","Osorkon,","Nofret","Minmotu","Khafra", // Egyptian
|
||||
"Dio") //lol yes
|
||||
|
||||
else
|
||||
vampname = pick("Islana","Tyrra","Greganna","Pytra","Hilda","Andra","Crina","Viorela","Viorica","Anemona","Camelia","Narcisa","Sorina","Alessia","Sophia","Gladda","Arcana","Morgan","Lasarra","Ioana","Elena", \
|
||||
"Alina","Rodica","Teodora","Denisa","Mihaela","Svetla","Stefania","Diyana","Kelssa","Lilith", // Romanian/Ancient
|
||||
"Alexia","Athanasia","Callista","Karena","Nephele","Scylla","Ursa", // Latin
|
||||
"Alcestis","Damaris","Elisavet","Khthonia","Teodora", // Greek
|
||||
"Nefret","Ankhesenpep") // Egyptian
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/SelectTitle(am_fledgling = 0, forced = FALSE)
|
||||
// Already have Title
|
||||
if (!forced && vamptitle != null)
|
||||
return
|
||||
// Titles [Master]
|
||||
if (!am_fledgling)
|
||||
if (owner.current.gender == MALE)
|
||||
vamptitle = pick ("Count","Baron","Viscount","Prince","Duke","Tzar","Dreadlord","Lord","Master")
|
||||
else
|
||||
vamptitle = pick ("Countess","Baroness","Viscountess","Princess","Duchess","Tzarina","Dreadlady","Lady","Mistress")
|
||||
to_chat(owner, "<span class='announce'>You have earned a title! You are now known as <i>[ReturnFullName(TRUE)]</i>!</span>")
|
||||
// Titles [Fledgling]
|
||||
else
|
||||
vamptitle = null
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/SelectReputation(am_fledgling = 0, forced=FALSE)
|
||||
// Already have Reputation
|
||||
if (!forced && vampreputation != null)
|
||||
return
|
||||
// Reputations [Master]
|
||||
if (!am_fledgling)
|
||||
vampreputation = pick("Butcher","Blood Fiend","Crimson","Red","Black","Terror","Nightman","Feared","Ravenous","Fiend","Malevolent","Wicked","Ancient","Plaguebringer","Sinister","Forgotten","Wretched","Baleful", \
|
||||
"Inqisitor","Harvester","Reviled","Robust","Betrayer","Destructor","Damned","Accursed","Terrible","Vicious","Profane","Vile","Depraved","Foul","Slayer","Manslayer","Sovereign","Slaughterer", \
|
||||
"Forsaken","Mad","Dragon","Savage","Villainous","Nefarious","Inquisitor","Marauder","Horrible","Immortal","Undying","Overlord","Corrupt","Hellspawn","Tyrant","Sanguineous")
|
||||
if (owner.current.gender == MALE)
|
||||
if (prob(10)) // Gender override
|
||||
vampreputation = pick("King of the Damned", "Blood King", "Emperor of Blades", "Sinlord", "God-King")
|
||||
else
|
||||
if (prob(10)) // Gender override
|
||||
vampreputation = pick("Queen of the Damned", "Blood Queen", "Empress of Blades", "Sinlady", "God-Queen")
|
||||
|
||||
to_chat(owner, "<span class='announce'>You have earned a reputation! You are now known as <i>[ReturnFullName(TRUE)]</i>!</span>")
|
||||
|
||||
// Reputations [Fledgling]
|
||||
else
|
||||
vampreputation = pick ("Crude","Callow","Unlearned","Neophyte","Novice","Unseasoned","Fledgling","Young","Neonate","Scrapling","Untested","Unproven","Unknown","Newly Risen","Born","Scavenger","Unknowing",\
|
||||
"Unspoiled","Disgraced","Defrocked","Shamed","Meek","Timid","Broken")//,"Fresh")
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/AmFledgling()
|
||||
return !vamptitle
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/ReturnFullName(var/include_rep=0)
|
||||
|
||||
var/fullname
|
||||
// Name First
|
||||
fullname = (vampname ? vampname : owner.current.name)
|
||||
// Title
|
||||
if(vamptitle)
|
||||
fullname = vamptitle + " " + fullname
|
||||
// Rep
|
||||
if(include_rep && vampreputation)
|
||||
fullname = fullname + " the " + vampreputation
|
||||
|
||||
return fullname
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/BuyPower(datum/action/bloodsucker/power)//(obj/effect/proc_holder/spell/power)
|
||||
powers += power
|
||||
power.Grant(owner.current)// owner.AddSpell(power)
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/AssignStarterPowersAndStats()
|
||||
// Blood/Rank Counter
|
||||
add_hud()
|
||||
update_hud(TRUE) // Set blood value, current rank
|
||||
// Powers
|
||||
BuyPower(new /datum/action/bloodsucker/feed)
|
||||
BuyPower(new /datum/action/bloodsucker/masquerade)
|
||||
BuyPower(new /datum/action/bloodsucker/veil)
|
||||
// Traits
|
||||
for (var/T in defaultTraits)
|
||||
ADD_TRAIT(owner.current, T, "bloodsucker")
|
||||
if(HAS_TRAIT(owner.current, TRAIT_TOXINLOVER)) //No slime bonuses here, no thank you
|
||||
had_toxlover = TRUE
|
||||
REMOVE_TRAIT(owner.current, TRAIT_TOXINLOVER, "species")
|
||||
// Traits: Species
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
var/datum/species/S = H.dna.species
|
||||
S.species_traits |= DRINKSBLOOD
|
||||
// Clear Addictions
|
||||
owner.current.reagents.addiction_list = list() // Start over from scratch. Lucky you! At least you're not addicted to blood anymore (if you were)
|
||||
// Stats
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
var/datum/species/S = H.dna.species
|
||||
// Make Changes
|
||||
S.brutemod *= 0.5 // <-------------------- Start small, but burn mod increases based on rank!
|
||||
S.coldmod = 0
|
||||
S.stunmod *= 0.25
|
||||
S.siemens_coeff *= 0.75 //base electrocution coefficient 1
|
||||
//S.heatmod += 0.5 // Heat shouldn't affect. Only Fire.
|
||||
//S.punchstunthreshold = 8 //damage at which punches from this race will stun 9
|
||||
S.punchdamagelow += 1 //lowest possible punch damage 0
|
||||
S.punchdamagehigh += 1 //highest possible punch damage 9
|
||||
// Clown
|
||||
if(istype(H) && owner.assigned_role == "Clown")
|
||||
H.dna.remove_mutation(CLOWNMUT)
|
||||
to_chat(H, "As a vampiric clown, you are no longer a danger to yourself. Your nature is subdued.")
|
||||
// Physiology
|
||||
CheckVampOrgans() // Heart, Eyes
|
||||
// Language
|
||||
owner.current.grant_language(/datum/language/vampiric)
|
||||
// Soul
|
||||
//owner.current.hellbound = TRUE Causes wierd stuff
|
||||
owner.hasSoul = FALSE // If false, renders the character unable to sell their soul.
|
||||
owner.isholy = FALSE // is this person a chaplain or admin role allowed to use bibles
|
||||
// Disabilities
|
||||
CureDisabilities()
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/ClearAllPowersAndStats()
|
||||
// Blood/Rank Counter
|
||||
remove_hud()
|
||||
// Powers
|
||||
while(powers.len)
|
||||
var/datum/action/bloodsucker/power = pick(powers)
|
||||
powers -= power
|
||||
power.Remove(owner.current)
|
||||
// owner.RemoveSpell(power)
|
||||
// Traits
|
||||
for(var/T in defaultTraits)
|
||||
REMOVE_TRAIT(owner.current, T, "bloodsucker")
|
||||
if(had_toxlover == TRUE)
|
||||
ADD_TRAIT(owner.current, TRAIT_TOXINLOVER, "species")
|
||||
|
||||
// Traits: Species
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.set_species(H.dna.species.type)
|
||||
// Stats
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.set_species(H.dna.species.type)
|
||||
// Clown
|
||||
if(istype(H) && owner.assigned_role == "Clown")
|
||||
H.dna.add_mutation(CLOWNMUT)
|
||||
// NOTE: Use initial() to return things to default!
|
||||
// Physiology
|
||||
owner.current.regenerate_organs()
|
||||
// Update Health
|
||||
owner.current.setMaxHealth(100)
|
||||
// Language
|
||||
owner.current.remove_language(/datum/language/vampiric)
|
||||
// Soul
|
||||
if (owner.soulOwner == owner) // Return soul, if *I* own it.
|
||||
owner.hasSoul = TRUE
|
||||
//owner.current.hellbound = FALSE
|
||||
|
||||
datum/antagonist/bloodsucker/proc/RankUp()
|
||||
set waitfor = FALSE
|
||||
if(!owner || !owner.current)
|
||||
return
|
||||
vamplevel_unspent ++
|
||||
// Spend Rank Immediately?
|
||||
if(istype(owner.current.loc, /obj/structure/closet/crate/coffin))
|
||||
SpendRank()
|
||||
else
|
||||
to_chat(owner, "<EM><span class='notice'>You have grown more ancient! Sleep in a coffin that you have claimed to thicken your blood and become more powerful.</span></EM>")
|
||||
if(vamplevel_unspent >= 2)
|
||||
to_chat(owner, "<span class='announce'>Bloodsucker Tip: If you cannot find or steal a coffin to use, they can be built from wooden planks.</span><br>")
|
||||
|
||||
datum/antagonist/bloodsucker/proc/LevelUpPowers()
|
||||
for(var/datum/action/bloodsucker/power in powers)
|
||||
power.level_current ++
|
||||
|
||||
datum/antagonist/bloodsucker/proc/SpendRank()
|
||||
set waitfor = FALSE
|
||||
if (vamplevel_unspent <= 0 || !owner || !owner.current || !owner.current.client)
|
||||
return
|
||||
/////////
|
||||
// Powers
|
||||
//TODO: Make this into a radial
|
||||
// Purchase Power Prompt
|
||||
var/list/options = list() // Taken from gasmask.dm, for Clown Masks.
|
||||
for(var/pickedpower in typesof(/datum/action/bloodsucker))
|
||||
var/datum/action/bloodsucker/power = pickedpower
|
||||
// If I don't own it, and I'm allowed to buy it.
|
||||
if(!(locate(power) in powers) && initial(power.bloodsucker_can_buy))
|
||||
options[initial(power.name)] = power // TESTING: After working with TGUI, it seems you can use initial() to view the variables inside a path?
|
||||
options["\[ Not Now \]"] = null
|
||||
// Abort?
|
||||
if(options.len > 1)
|
||||
var/choice = input(owner.current, "You have the opportunity to grow more ancient. Select a power to advance your Rank.", "Your Blood Thickens...") in options
|
||||
// Cheat-Safety: Can't keep opening/closing coffin to spam levels
|
||||
if(vamplevel_unspent <= 0) // Already spent all your points, and tried opening/closing your coffin, pal.
|
||||
return
|
||||
if(!istype(owner.current.loc, /obj/structure/closet/crate/coffin))
|
||||
to_chat(owner.current, "<span class='warning'>Return to your coffin to advance your Rank.</span>")
|
||||
return
|
||||
if(!choice || !options[choice] || (locate(options[choice]) in powers)) // ADDED: Check to see if you already have this power, due to window stacking.
|
||||
to_chat(owner.current, "<span class='notice'>You prevent your blood from thickening just yet, but you may try again later.</span>")
|
||||
return
|
||||
// Buy New Powers
|
||||
var/datum/action/bloodsucker/P = options[choice]
|
||||
BuyPower(new P)
|
||||
to_chat(owner.current, "<span class='notice'>You have learned [initial(P.name)]!</span>")
|
||||
else
|
||||
to_chat(owner.current, "<span class='notice'>You grow more ancient by the night!</span>")
|
||||
/////////
|
||||
// Advance Powers (including new)
|
||||
LevelUpPowers()
|
||||
////////
|
||||
// Advance Stats
|
||||
if(ishuman(owner.current))
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
var/datum/species/S = H.dna.species
|
||||
S.burnmod *= 1.025 // Slightly more burn damage
|
||||
S.stunmod *= 0.95 // Slightly less stun time.
|
||||
S.punchdamagelow += 0.75
|
||||
S.punchdamagehigh += 0.75 // NOTE: This affects the hitting power of Brawn.
|
||||
// More Health
|
||||
owner.current.setMaxHealth(owner.current.maxHealth + 5)
|
||||
// Vamp Stats
|
||||
regenRate += 0.05 // Points of brute healed (starts at 0.3)
|
||||
feedAmount += 2 // Increase how quickly I munch down vics (15)
|
||||
maxBloodVolume += 50 // Increase my max blood (600)
|
||||
/////////
|
||||
vamplevel ++
|
||||
vamplevel_unspent --
|
||||
|
||||
// Assign True Reputation
|
||||
if(vamplevel == 4)
|
||||
SelectReputation(am_fledgling = FALSE, forced = TRUE)
|
||||
to_chat(owner.current, "<span class='notice'>You are now a rank [vamplevel] Bloodsucker. Your strength, resistence, health, feed rate, regen rate, and maximum blood have all increased!</span>")
|
||||
to_chat(owner.current, "<span class='notice'>Your existing powers have all ranked up as well!</span>")
|
||||
update_hud(TRUE)
|
||||
owner.current.playsound_local(null, 'sound/effects/pope_entry.ogg', 25, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//This handles the application of antag huds/special abilities
|
||||
/datum/antagonist/bloodsucker/apply_innate_effects(mob/living/mob_override)
|
||||
return
|
||||
|
||||
//This handles the removal of antag huds/special abilities
|
||||
/datum/antagonist/bloodsucker/remove_innate_effects(mob/living/mob_override)
|
||||
return
|
||||
|
||||
//Assign default team and creates one for one of a kind team antagonists
|
||||
/datum/antagonist/bloodsucker/create_team(datum/team/team)
|
||||
return
|
||||
|
||||
// Create Objectives
|
||||
/datum/antagonist/bloodsucker/proc/forge_bloodsucker_objectives() // Fledgling vampires can have different objectives.
|
||||
|
||||
// TEAM
|
||||
//clan = new /datum/team/vampireclan(owner)
|
||||
|
||||
|
||||
// Lair Objective: Create a Lair
|
||||
var/datum/objective/bloodsucker/lair/lair_objective = new
|
||||
lair_objective.owner = owner
|
||||
lair_objective.generate_objective()
|
||||
add_objective(lair_objective)
|
||||
|
||||
// Protege Objective
|
||||
var/datum/objective/bloodsucker/protege/protege_objective = new
|
||||
protege_objective.owner = owner
|
||||
protege_objective.generate_objective()
|
||||
add_objective(protege_objective)
|
||||
|
||||
if (rand(0,1) == 0)
|
||||
// Heart Thief Objective
|
||||
var/datum/objective/bloodsucker/heartthief/heartthief_objective = new
|
||||
heartthief_objective.owner = owner
|
||||
heartthief_objective.generate_objective()
|
||||
add_objective(heartthief_objective)
|
||||
|
||||
else
|
||||
// Solars Objective
|
||||
var/datum/objective/bloodsucker/solars/solars_objective = new
|
||||
solars_objective.owner = owner
|
||||
solars_objective.generate_objective()
|
||||
add_objective(solars_objective)
|
||||
|
||||
// Survive Objective
|
||||
var/datum/objective/bloodsucker/survive/survive_objective = new
|
||||
survive_objective.owner = owner
|
||||
survive_objective.generate_objective()
|
||||
add_objective(survive_objective)
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/add_objective(var/datum/objective/O)
|
||||
objectives += O
|
||||
objectives_given += O
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/clear_bloodsucker_objectives()
|
||||
|
||||
var/datum/team/team = get_team()
|
||||
if(team)
|
||||
team.remove_member(owner)
|
||||
|
||||
for(var/O in objectives_given)
|
||||
objectives -= O
|
||||
qdel(O)
|
||||
objectives_given = list() // Traitors had this, so I added it. Not sure why.
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/get_team()
|
||||
return clan
|
||||
|
||||
//Name shown on antag list
|
||||
/datum/antagonist/bloodsucker/antag_listing_name()
|
||||
return ..() + "([ReturnFullName(TRUE)])"
|
||||
|
||||
//Whatever interesting things happened to the antag admins should know about
|
||||
//Include additional information about antag in this part
|
||||
/datum/antagonist/bloodsucker/antag_listing_status()
|
||||
if (owner && owner.AmFinalDeath())
|
||||
return "<font color=red>Final Death</font>"
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
//Individual roundend report
|
||||
/datum/antagonist/bloodsucker/roundend_report()
|
||||
// Get the default Objectives
|
||||
var/list/report = list()
|
||||
|
||||
// Vamp Name
|
||||
report += "<br><span class='header'><b>\[[ReturnFullName(TRUE)]\]</b></span>"
|
||||
|
||||
// Default Report
|
||||
//report += ..() //Hyperstation fix until https://github.com/Citadel-Station-13/Citadel-Station-13/pull/10623 is pulled
|
||||
|
||||
report += printplayer(owner)
|
||||
var/objectives_text = ""
|
||||
if(objectives.len)//If the traitor had no objectives, don't need to process this.
|
||||
var/count = 1
|
||||
for(var/datum/objective/objective in objectives)
|
||||
if(objective.check_completion())
|
||||
objectives_text += "<br><B>Objective #[count]</B>: [objective.explanation_text] <span class='greentext'>Success!</span>"
|
||||
else
|
||||
objectives_text += "<br><B>Objective #[count]</B>: [objective.explanation_text] <span class='redtext'>Fail.</span>"
|
||||
traitorwin = FALSE
|
||||
count++
|
||||
report += objectives_text
|
||||
// Now list their vassals
|
||||
if (vassals.len > 0)
|
||||
report += "<span class='header'>Their Vassals were...</span>"
|
||||
for (var/datum/antagonist/vassal/V in vassals)
|
||||
if (V.owner)
|
||||
var/jobname = V.owner.assigned_role ? "the [V.owner.assigned_role]" : ""
|
||||
report += "<b>[V.owner.name]</b> [jobname]"
|
||||
|
||||
var/special_role_text = lowertext(name)
|
||||
if(traitorwin)
|
||||
report += "<span class='greentext'>The [special_role_text] was successful!</span>"
|
||||
else
|
||||
report += "<span class='redtext'>The [special_role_text] has failed!</span>"
|
||||
SEND_SOUND(owner.current, 'sound/ambience/ambifailure.ogg')
|
||||
|
||||
return report.Join("<br>")
|
||||
|
||||
//Displayed at the start of roundend_category section, default to roundend_category header
|
||||
/datum/antagonist/bloodsucker/roundend_report_header()
|
||||
return "<span class='header'>Lurking in the darkness, the Bloodsuckers were:</span><br>"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 2019 Breakdown of Bloodsuckers:
|
||||
|
||||
// G A M E P L A Y
|
||||
//
|
||||
// Bloodsuckers should be inherrently powerful: they never stay dead, and they can hide in plain sight
|
||||
// better than any other antagonist aboard the station.
|
||||
//
|
||||
// However, only elder Bloodsuckers are the powerful creatures of legend. Ranking up as a Bloodsucker
|
||||
// should impart slight strength and health benefits, as well as powers that can grow over time. But
|
||||
// their weaknesses should grow as well, and not just to fire.
|
||||
|
||||
|
||||
// A B I L I T I E S
|
||||
//
|
||||
// * Bloodsuckers can FEIGN LIFE + DEATH.
|
||||
// Feigning LIFE:
|
||||
// - Warms up the body
|
||||
// - Creates a heartbeat
|
||||
// - Fake blood amount (550)
|
||||
// Feign DEATH: Not yet done
|
||||
// - When lying down or sitting, you appear "dead and lifeless"
|
||||
|
||||
// * Bloodsuckers REGENERATE
|
||||
// - Brute damage heals rather rapidly. Burn damage heals slowly.
|
||||
// - Healing is reduced when hungry or starved.
|
||||
// - Burn does not heal when starved. A starved vampire remains "dead" until burns can heal.
|
||||
// - Bodyparts and organs regrow in Torpor (except for the Heart and Brain).
|
||||
//
|
||||
// * Bloodsuckers are IMMORTAL
|
||||
// - Brute damage cannot destroy them (and it caps very low, so they don't stack too much)
|
||||
// - Burn damage can only kill them at very high amounts.
|
||||
// - Removing the head kills the vamp forever.
|
||||
// - Removing the heart kills the vamp until replaced.
|
||||
//
|
||||
// * Bloodsuckers are DEAD
|
||||
// - They do not breathe.
|
||||
// - Cold affects them less.
|
||||
// - They are immune to disease (but can spread it)
|
||||
// - Food is useless and cause sickness.
|
||||
// - Nothing can heal the vamp other than his own blood.
|
||||
//
|
||||
// * Bloodsuckers are PREDATORS
|
||||
// - They detect life/heartbeats nearby.
|
||||
// - They know other predators instantly (Vamps, Werewolves, and alien types) regardless of disguise.
|
||||
//
|
||||
//
|
||||
//
|
||||
// * Bloodsuckers enter Torpor when DEAD or RESTING in coffin
|
||||
// - Torpid vampires regenerate their health. Coffins negate cost and speed up the process.
|
||||
// ** To rest in a coffin, either SLEEP or CLOSE THE LID while you're in it. You will be given a prompt to sleep until healed. Healing in a coffin costs NO blood!
|
||||
//
|
||||
|
||||
|
||||
|
||||
// O B J E C T I V E S
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// 1) GROOM AN HEIR: Find a person with appropriate traits (hair, blood type, gender) to be turned as a Vampire. Before they rise, they must be properly trained. Raise them to great power after their change.
|
||||
//
|
||||
// 2) BIBLIOPHILE: Research objects of interest, study items looking for clues of ancient secrets, and hunt down the clues to a Vampiric artifact of horrible power.
|
||||
//
|
||||
// 3) CRYPT LORD: Build a terrifying sepulcher to your evil, with servants to lavish upon you in undeath. The trappings of a true crypt lord come at grave cost.
|
||||
//
|
||||
// 4) GOURMOND: Oh, to taste all the delicacies the station has to offer! DRINK ## BLOOD FROM VICTIMS WHO LIVE, EAT ## ORGANS FROM VICTIMS WHO LIVE
|
||||
|
||||
|
||||
// Vassals
|
||||
//
|
||||
// - Loyal to (and In Love With) Master
|
||||
// - Master can speak to, summon, or punish his Vassals, even while asleep or torpid.
|
||||
// - Master may have as many Vassals as Rank
|
||||
// - Vassals see their Master's speech emboldened!
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Dev Notes
|
||||
//
|
||||
// HEALING: Maybe Vamps metabolize specially? Like, they slowly drip their own blood into their system?
|
||||
// - Give Vamps their own metabolization proc, perhaps?
|
||||
// ** shadowpeople.dm has rules for healing.
|
||||
//
|
||||
// KILLING: It's almost impossible to track who someone has directly killed. But an Admin could be given
|
||||
// an easy way to whip a Bloodsucker for cruel behavior, as a RP mechanic but not a punishment.
|
||||
// **
|
||||
//
|
||||
// HUNGER: Just keep adjusting mob's nutrition to Blood Hunger level. No need to cancel nutrition from eating.
|
||||
// ** mob.dm /set_nutrition()
|
||||
// ** snacks.dm / attack() <-- Stop food from doing anything?
|
||||
|
||||
// ORGANS: Liver
|
||||
// ** life.dm /handle_liver()
|
||||
//
|
||||
// CORPSE: Most of these effects likely go away when using "Masquerade" to appear alive.
|
||||
// ** status_procs.dm /adjust_bodytemperature()
|
||||
// ** traits.dm /TRAIT_NOBREATH /TRAIT_SLEEPIMMUNE /TRAIT_RESISTCOLD /TRAIT_RADIMMUNE /TRAIT_VIRUSIMMUNE
|
||||
// * MASQUERADE ON/OFF: /TRAIT_FAKEDEATH (M)
|
||||
// * /TRAIT_NIGHT_VISION
|
||||
// * /TRAIT_DEATHCOMA <-- This basically makes you immobile. When using status_procs /fakedeath(), make sure to remove Coma unless we're in Torpor!
|
||||
// * /TRAIT_NODEATH <--- ???
|
||||
// ** species /NOZOMBIE
|
||||
// * ADD: TRAIT_COLDBLOODED <-- add to carbon/life.dm /natural_bodytemperature_stabilization()
|
||||
//
|
||||
// MASQUERADE Appear as human!
|
||||
// ** examine.dm /examine() <-- Change "blood_volume < BLOOD_VOLUME_SAFE" to a new examine
|
||||
//
|
||||
// NOSFERATU ** human.add_trait(TRAIT_DISFIGURED, "insert_vamp_datum_here") <-- Makes you UNKNOWN unless your ID says otherwise.
|
||||
// STEALTH ** human_helpers.dm /get_visible_name() ** shadowpeople.dm has rules for Light.
|
||||
//
|
||||
// FRENZY ** living.dm /update_mobility() (USED TO be update_canmove)
|
||||
//
|
||||
// PREDATOR See other Vamps!
|
||||
// * examine.dm /examine()
|
||||
//
|
||||
// WEAKNESSES: -Poor mood in Chapel or near Chaplain. -Stamina damage from Bible
|
||||
|
||||
|
||||
|
||||
//message_admins("DEBUG3: attempt_cast() [name] / [user_C.handcuffed] ")
|
||||
|
||||
|
||||
// TODO:
|
||||
//
|
||||
// Death (fire, heart, brain, head)
|
||||
// Disable Life: BLOOD
|
||||
// Body Temp
|
||||
// Spend blood over time (more if imitating life) (none if sleeping in coffin)
|
||||
// Auto-Heal (brute to 0, fire to 99) (toxin/o2 always 0)
|
||||
//
|
||||
// Hud Icons
|
||||
// UI Blood Counter
|
||||
// Examine Name (+Masquerade, only "Dead and lifeless" if not standing?)
|
||||
//
|
||||
//
|
||||
// Turn vamps
|
||||
// Create vassals
|
||||
//
|
||||
|
||||
|
||||
// FIX LIST
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
|
||||
// HUD! //
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/update_bloodsucker_icons_added(datum/mind/m)
|
||||
var/datum/atom_hud/antag/vamphud = GLOB.huds[ANTAG_HUD_BLOODSUCKER]
|
||||
vamphud.join_hud(owner.current)
|
||||
set_antag_hud(owner.current, "bloodsucker") // "bloodsucker"
|
||||
owner.current.hud_list[ANTAG_HUD].icon = image('icons/mob/hud.dmi', owner.current, "bloodsucker") //Check prepare_huds in mob.dm to see why.
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/update_bloodsucker_icons_removed(datum/mind/m)
|
||||
var/datum/atom_hud/antag/vamphud = GLOB.huds[ANTAG_HUD_BLOODSUCKER]
|
||||
vamphud.leave_hud(owner.current)
|
||||
set_antag_hud(owner.current, null)
|
||||
|
||||
/datum/atom_hud/antag/bloodsucker // from hud.dm in /datums/ Also see data_huds.dm + antag_hud.dm
|
||||
|
||||
/datum/atom_hud/antag/bloodsucker/add_to_single_hud(mob/M, atom/A)
|
||||
if (!check_valid_hud_user(M,A)) // FULP: This checks if the Mob is a Vassal, and if the Atom is his master OR on his team.
|
||||
return
|
||||
..()
|
||||
|
||||
/datum/atom_hud/antag/bloodsucker/proc/check_valid_hud_user(mob/M, atom/A) // Remember: A is being added to M's hud. Because M's hud is a /antag/vassal hud, this means M is the vassal here.
|
||||
// Ghost Admins always see Bloodsuckers/Vassals
|
||||
if (isobserver(M))
|
||||
return TRUE
|
||||
// GOAL: Vassals see their Master and his other Vassals.
|
||||
// GOAL: Vassals can BE seen by their Bloodsucker and his other Vassals.
|
||||
// GOAL: Bloodsuckers can see each other.
|
||||
if (!M || !A || !ismob(A) || !M.mind)// || !A.mind)
|
||||
return FALSE
|
||||
var/mob/A_mob = A
|
||||
if (!A_mob.mind)
|
||||
return FALSE
|
||||
// Find Datums: Bloodsucker
|
||||
var/datum/antagonist/bloodsucker/atom_B = A_mob.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
var/datum/antagonist/bloodsucker/mob_B = M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
// Check 1) Are we both Bloodsuckers?
|
||||
if (atom_B && mob_B)
|
||||
return TRUE
|
||||
// Find Datums: Vassal
|
||||
var/datum/antagonist/vassal/atom_V = A_mob.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
var/datum/antagonist/vassal/mob_V = M.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
// Check 2) If they are a BLOODSUCKER, then are they my Master?
|
||||
if (mob_V && atom_B == mob_V.master)
|
||||
return TRUE // SUCCESS!
|
||||
// Check 3) If I am a BLOODSUCKER, then are they my Vassal?
|
||||
if (mob_B && atom_V && (atom_V in mob_B.vassals))
|
||||
return TRUE // SUCCESS!
|
||||
// Check 4) If we are both VASSAL, then do we have the same master?
|
||||
if (atom_V && mob_V && atom_V.master == mob_V.master)
|
||||
return TRUE // SUCCESS!
|
||||
return FALSE
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
|
||||
|
||||
// BLOOD COUNTER & RANK MARKER ! //
|
||||
|
||||
#define ui_sunlight_display "WEST:6,CENTER-0:0" // 6 pixels to the right, zero tiles & 5 pixels DOWN.
|
||||
#define ui_blood_display "WEST:6,CENTER-1:0" // 1 tile down
|
||||
#define ui_vamprank_display "WEST:6,CENTER-2:-5" // 2 tiles down
|
||||
|
||||
/datum/hud
|
||||
var/obj/screen/bloodsucker/blood_counter/blood_display
|
||||
var/obj/screen/bloodsucker/rank_counter/vamprank_display
|
||||
var/obj/screen/bloodsucker/sunlight_counter/sunlight_display
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/add_hud()
|
||||
return
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/remove_hud()
|
||||
// No Hud? Get out.
|
||||
if (!owner.current.hud_used)
|
||||
return
|
||||
owner.current.hud_used.blood_display.invisibility = INVISIBILITY_ABSTRACT
|
||||
owner.current.hud_used.vamprank_display.invisibility = INVISIBILITY_ABSTRACT
|
||||
owner.current.hud_used.sunlight_display.invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/update_hud(updateRank=FALSE)
|
||||
// No Hud? Get out.
|
||||
if(!owner.current.hud_used)
|
||||
return
|
||||
// Update Blood Counter
|
||||
if (owner.current.hud_used.blood_display)
|
||||
var/valuecolor = "#FF6666"
|
||||
if(owner.current.blood_volume > BLOOD_VOLUME_SAFE)
|
||||
valuecolor = "#FFDDDD"
|
||||
else if(owner.current.blood_volume > BLOOD_VOLUME_BAD)
|
||||
valuecolor = "#FFAAAA"
|
||||
owner.current.hud_used.blood_display.update_counter(owner.current.blood_volume, valuecolor)
|
||||
|
||||
// Update Rank Counter
|
||||
if(owner.current.hud_used.vamprank_display)
|
||||
var/valuecolor = vamplevel_unspent ? "#FFFF00" : "#FF0000"
|
||||
owner.current.hud_used.vamprank_display.update_counter(vamplevel, valuecolor)
|
||||
if(updateRank) // Only change icon on special request.
|
||||
owner.current.hud_used.vamprank_display.icon_state = (vamplevel_unspent > 0) ? "rank_up" : "rank"
|
||||
|
||||
|
||||
/obj/screen/bloodsucker
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/bloodsucker/proc/clear()
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/bloodsucker/proc/update_counter(value, valuecolor)
|
||||
invisibility = 0 // Make Visible
|
||||
|
||||
/obj/screen/bloodsucker/blood_counter // NOTE: Look up /obj/screen/devil/soul_counter in _onclick / hud / human.dm
|
||||
icon = 'icons/mob/actions/bloodsucker.dmi'//'icons/mob/screen_gen.dmi'
|
||||
name = "Blood Consumed"
|
||||
icon_state = "blood_display"//"power_display"
|
||||
screen_loc = ui_blood_display
|
||||
|
||||
/obj/screen/bloodsucker/blood_counter/update_counter(value, valuecolor)
|
||||
..()
|
||||
maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[valuecolor]'>[round(value,1)]</font></div>"
|
||||
|
||||
/obj/screen/bloodsucker/rank_counter
|
||||
name = "Bloodsucker Rank"
|
||||
icon = 'icons/mob/actions/bloodsucker.dmi'
|
||||
icon_state = "rank"
|
||||
screen_loc = ui_vamprank_display
|
||||
|
||||
/obj/screen/bloodsucker/rank_counter/update_counter(value, valuecolor)
|
||||
..()
|
||||
maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[valuecolor]'>[round(value,1)]</font></div>"
|
||||
|
||||
/obj/screen/bloodsucker/sunlight_counter
|
||||
icon = 'icons/mob/actions/bloodsucker.dmi'
|
||||
name = "Solar Flare Timer"
|
||||
icon_state = "sunlight_night"
|
||||
screen_loc = ui_sunlight_display
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/update_sunlight(value, amDay = FALSE)
|
||||
// No Hud? Get out.
|
||||
if (!owner.current.hud_used)
|
||||
return
|
||||
// Update Sun Time
|
||||
if (owner.current.hud_used.sunlight_display)
|
||||
var/valuecolor = "#BBBBFF"
|
||||
if (amDay)
|
||||
valuecolor = "#FF5555"
|
||||
else if(value <= 25)
|
||||
valuecolor = "#FFCCCC"
|
||||
else if(value < 10)
|
||||
valuecolor = "#FF5555"
|
||||
var/value_string = (value >= 60) ? "[round(value / 60, 1)] m" : "[round(value,1)] s"
|
||||
owner.current.hud_used.sunlight_display.update_counter( value_string, valuecolor )
|
||||
owner.current.hud_used.sunlight_display.icon_state = "sunlight_" + (amDay ? "day":"night")
|
||||
|
||||
|
||||
/obj/screen/bloodsucker/sunlight_counter/update_counter(value, valuecolor)
|
||||
..()
|
||||
maptext = "<div align='center' valign='bottom' style='position:relative; top:0px; left:6px'><font color='[valuecolor]'>[value]</font></div>"
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/count_vassals(datum/mind/master)
|
||||
var/datum/antagonist/bloodsucker/B = master.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
var/vassal_amount = B.vassals.len
|
||||
return vassal_amount
|
||||
@@ -1,229 +0,0 @@
|
||||
/*
|
||||
#define HUNTER_SCAN_MIN_DISTANCE 8
|
||||
#define HUNTER_SCAN_MAX_DISTANCE 35
|
||||
#define HUNTER_SCAN_PING_TIME 20 //5s update time.
|
||||
/datum/antagonist/vamphunter
|
||||
name = "Hunter"
|
||||
roundend_category = "hunters"
|
||||
antagpanel_category = "Monster Hunter"
|
||||
job_rank = ROLE_MONSTERHUNTER
|
||||
var/list/datum/action/powers = list()// Purchased powers
|
||||
var/list/datum/objective/objectives_given = list() // For removal if needed.
|
||||
var/datum/martial_art/my_kungfu // Hunters know a lil kung fu.
|
||||
var/bad_dude = FALSE // Every first hunter spawned is a SHIT LORD.
|
||||
/datum/antagonist/vamphunter/on_gain()
|
||||
SSticker.mode.vamphunters |= owner // Add if not already in here (and you might be, if you were picked at round start)
|
||||
// Hunter Pinpointer
|
||||
//owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition)
|
||||
// Give Hunter Power
|
||||
var/datum/action/P = new /datum/action/bloodsucker/trackvamp
|
||||
P.Grant(owner.current)
|
||||
// Give Hunter Martial Arts
|
||||
//if (rand(1,3) == 1)
|
||||
// var/datum/martial_art/pick_type = pick (/datum/martial_art/cqc, /datum/martial_art/krav_maga, /datum/martial_art/cqc, /datum/martial_art/krav_maga, /datum/martial_art/wrestling) // /datum/martial_art/boxing <--- doesn't include grabbing, so don't use!
|
||||
// my_kungfu = new pick_type //pick (/datum/martial_art/boxing, /datum/martial_art/cqc) // ick_type
|
||||
// my_kungfu.teach(owner.current, 0)
|
||||
// Give Hunter Objective
|
||||
var/datum/objective/bloodsucker/monsterhunter/monsterhunter_objective = new
|
||||
monsterhunter_objective.owner = owner
|
||||
monsterhunter_objective.generate_objective()
|
||||
objectives += monsterhunter_objective
|
||||
objectives_given += monsterhunter_objective
|
||||
// Badguy Hunter? (Give him BADGUY objectives)
|
||||
if (bad_dude)
|
||||
// Stolen DIRECTLY from datum_traitor.dm
|
||||
if(prob(15) && !(locate(/datum/objective/download) in objectives) && !(owner.assigned_role in list("Research Director", "Scientist", "Roboticist")))
|
||||
var/datum/objective/download/download_objective = new
|
||||
download_objective.owner = owner
|
||||
download_objective.gen_amount_goal()
|
||||
objectives += download_objective
|
||||
objectives_given += download_objective
|
||||
else
|
||||
var/datum/objective/steal/steal_objective = new
|
||||
steal_objective.owner = owner
|
||||
steal_objective.find_target()
|
||||
objectives += steal_objective
|
||||
objectives_given += steal_objective
|
||||
. = ..()
|
||||
/datum/antagonist/vamphunter/on_removal()
|
||||
SSticker.mode.vamphunters -= owner // Add if not already in here (and you might be, if you were picked at round start)
|
||||
// Master Pinpointer
|
||||
//owner.current.remove_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition)
|
||||
// Take Hunter Power
|
||||
if (owner.current)
|
||||
for (var/datum/action/bloodsucker/P in owner.current.actions)
|
||||
P.Remove(owner.current)
|
||||
// Take Hunter Martial Arts
|
||||
//my_kungfu.remove(owner.current)
|
||||
// Remove Hunter Objectives
|
||||
for(var/O in objectives_given)
|
||||
objectives -= O
|
||||
qdel(O)
|
||||
objectives_given = list()
|
||||
. = ..()
|
||||
/datum/antagonist/vamphunter/greet()
|
||||
var/vamp_hunter_greet = "<span class='userdanger'>You are a fearless Monster Hunter!</span>"
|
||||
vamp_hunter_greet += "<span class='boldannounce'>You know there's one or more filthy creature onboard the station, though their identities elude you.<span>"
|
||||
vamp_hunter_greet += "<span class='boldannounce'>It's your job to root them out, destroy their nests, and save the crew.<span>"
|
||||
vamp_hunter_greet += "<span class='boldannounce'>Use <b>WHATEVER MEANS NECESSARY</b> to find these creatures...no matter who gets hurt or what you have to destroy to do it.</span>"
|
||||
vamp_hunter_greet += "There are greater stakes at hand than the safety of the station!<span>"
|
||||
vamp_hunter_greet += "<span class='boldannounce'>However, security may detain you if they discover your mission...<span>"
|
||||
antag_memory += "You remember your training:<br>"
|
||||
antag_memory += " -Bloodsuckers are weak to fire, or a stake to the heart. Removing their head or heart will also destroy them permanently.<br>"
|
||||
antag_memory += " -Wooden stakes can be made from planks, and hardened by a welding tool. Your recipes list has ways of making them even stronger.<br>"
|
||||
antag_memory += " -Changelings return to life unless their body is destroyed. Not even decapitation can stop them for long.<br>"
|
||||
antag_memory += " -Cultists are weak to the Chaplain's holy water.<br>"
|
||||
antag_memory += " -Wizards are notoriously hard to outmatch. Rob or steal whatever weapons you need to destroy them, and shoot before asking questions.<br><br>"
|
||||
if (my_kungfu != null)
|
||||
vamp_hunter_greet += "<span class='announce'>Hunter Tip: Use your [my_kungfu.name] techniques to give you an advantage over the enemy.</span><br>"
|
||||
antag_memory += "You remember your training: You are skilled in the [my_kungfu.name] style of combat.<br>"
|
||||
to_chat(owner, vamp_hunter_greet)
|
||||
/datum/antagonist/vamphunter/farewell()
|
||||
to_chat(owner, "<span class='userdanger'>Your hunt has ended: you are no longer a monster hunter!</span>")
|
||||
// TAKEN FROM: /datum/action/changeling/pheromone_receptors // pheromone_receptors.dm for a version of tracking that Changelings have!
|
||||
/datum/status_effect/agent_pinpointer/hunter_edition
|
||||
alert_type = /obj/screen/alert/status_effect/agent_pinpointer/hunter_edition
|
||||
minimum_range = HUNTER_SCAN_MIN_DISTANCE
|
||||
tick_interval = HUNTER_SCAN_PING_TIME
|
||||
duration = 160 // Lasts 10s
|
||||
range_fuzz_factor = 5//PINPOINTER_EXTRA_RANDOM_RANGE
|
||||
/obj/screen/alert/status_effect/agent_pinpointer/hunter_edition
|
||||
name = "Monster Tracking"
|
||||
desc = "You always know where the hellspawn are."
|
||||
/datum/status_effect/agent_pinpointer/hunter_edition/on_creation(mob/living/new_owner, ...)
|
||||
..()
|
||||
// Pick target
|
||||
var/turf/my_loc = get_turf(owner)
|
||||
var/list/mob/living/carbon/vamps = list()
|
||||
for(var/datum/mind/M in SSticker.mode.bloodsuckers)
|
||||
if (!M.current || M.current == owner || !get_turf(M.current) || !get_turf(new_owner))
|
||||
continue
|
||||
var/datum/antagonist/bloodsucker/antag_datum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(!istype(antag_datum))
|
||||
continue
|
||||
var/their_loc = get_turf(M.current)
|
||||
var/distance = get_dist_euclidian(my_loc, their_loc)
|
||||
if (distance < HUNTER_SCAN_MAX_DISTANCE)
|
||||
vamps[M.current] = (HUNTER_SCAN_MAX_DISTANCE ** 2) - (distance ** 2)
|
||||
// Found one!
|
||||
if(vamps.len)
|
||||
scan_target = pickweight(vamps) //Point at a 'random' vamp, biasing heavily towards closer ones.
|
||||
to_chat(owner, "<span class='warning'>You detect signs of monsters to the <b>[dir2text(get_dir(my_loc,get_turf(scan_target)))]!</b></span>")
|
||||
// Will yield a "?"
|
||||
else
|
||||
to_chat(owner, "<span class='notice'>There are no monsters nearby.</span>")
|
||||
// Force Point-To Immediately
|
||||
point_to_target()
|
||||
/datum/status_effect/agent_pinpointer/hunter_edition/scan_for_target()
|
||||
// Lose target? Done. Otherwise, scan for target's current position.
|
||||
if (!scan_target && owner)
|
||||
owner.remove_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition)
|
||||
// NOTE: Do NOT run ..(), or else we'll remove our target.
|
||||
/datum/status_effect/agent_pinpointer/hunter_edition/Destroy()
|
||||
if (scan_target)
|
||||
to_chat(owner, "<span class='notice'>You've lost the trail.</span>")
|
||||
..()
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
/datum/action/bloodsucker/trackvamp/
|
||||
name = "Track Monster"//"Cellular Emporium"
|
||||
desc = "Take a moment to look for clues of any nearby monsters.<br>These creatures are slippery, and often look like the crew."
|
||||
button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon
|
||||
background_icon_state = "vamp_power_off" //And this is the state for the background icon
|
||||
icon_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the ACTION icon
|
||||
button_icon_state = "power_hunter" //And this is the state for the action icon
|
||||
amToggle = FALSE // Action-Related
|
||||
cooldown = 300 // 10 ticks, 1 second.
|
||||
bloodcost = 0
|
||||
/datum/action/bloodsucker/trackvamp/ActivatePower()
|
||||
var/mob/living/user = owner
|
||||
to_chat(user, "<span class='notice'>You look around, scanning your environment and discerning signs of any filthy, wretched affronts to the natural order.</span>")
|
||||
if (!do_mob(user,owner,80))
|
||||
return
|
||||
// Add Power
|
||||
// REMOVED //user.apply_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition)
|
||||
// We don't track direction anymore!
|
||||
// Return text indicating direction
|
||||
display_proximity()
|
||||
// NOTE: DON'T DEACTIVATE!
|
||||
//DeactivatePower()
|
||||
/datum/action/bloodsucker/trackvamp/proc/display_proximity()
|
||||
// Pick target
|
||||
var/turf/my_loc = get_turf(owner)
|
||||
//var/list/mob/living/carbon/vamps = list()
|
||||
var/best_dist = 9999
|
||||
var/mob/living/best_vamp
|
||||
// Track ALL MONSTERS in Game Mode
|
||||
var/list/datum/mind/monsters = list()
|
||||
monsters += SSticker.mode.bloodsuckers
|
||||
monsters += SSticker.mode.devils
|
||||
//monsters += SSticker.mode.cult
|
||||
monsters += SSticker.mode.wizards
|
||||
monsters += SSticker.mode.apprentices
|
||||
monsters += SSticker.mode.servants_of_ratvar
|
||||
//monsters += SSticker.mode.changelings Disabled anyways
|
||||
//
|
||||
for(var/datum/mind/M in monsters)
|
||||
if (!M.current || M.current == owner)// || !get_turf(M.current) || !get_turf(owner))
|
||||
continue
|
||||
for(var/a in M.antag_datums)
|
||||
var/datum/antagonist/antag_datum = a // var/datum/antagonist/antag_datum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(!istype(antag_datum) || antag_datum.AmFinalDeath())
|
||||
continue
|
||||
var/their_loc = get_turf(M.current)
|
||||
var/distance = get_dist_euclidian(my_loc, their_loc)
|
||||
// Found One: Closer than previous/max distance
|
||||
if (distance < best_dist && distance <= HUNTER_SCAN_MAX_DISTANCE)
|
||||
best_dist = distance
|
||||
best_vamp = M.current
|
||||
break // Stop searching through my antag datums and go to the next guy
|
||||
// Found one!
|
||||
if(best_vamp)
|
||||
var/distString = best_dist <= HUNTER_SCAN_MAX_DISTANCE / 2 ? "<b>somewhere closeby!</b>" : "somewhere in the distance."
|
||||
//to_chat(owner, "<span class='warning'>You detect signs of Bloodsuckers to the <b>[dir2text(get_dir(my_loc,get_turf(targetVamp)))]!</b></span>")
|
||||
to_chat(owner, "<span class='warning'>You detect signs of monsters [distString]</span>")
|
||||
// Will yield a "?"
|
||||
else
|
||||
to_chat(owner, "<span class='notice'>There are no monsters nearby.</span>")
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// From martial.dm
|
||||
/*
|
||||
/datum/martial_art/hunter
|
||||
name = "Hunter-Fu"
|
||||
id = "MARTIALART_HUNTER" //ID, used by mind/has_martialart
|
||||
//streak = ""
|
||||
//max_streak_length = 6
|
||||
//current_target
|
||||
//datum/martial_art/base // The permanent style. This will be null unless the martial art is temporary
|
||||
//deflection_chance = 0 //Chance to deflect projectiles
|
||||
//reroute_deflection = FALSE //Delete the bullet, or actually deflect it in some direction?
|
||||
//block_chance = 0 //Chance to block melee attacks using items while on throw mode.
|
||||
//restraining = 0 //used in cqc's disarm_act to check if the disarmed is being restrained and so whether they should be put in a chokehold or not
|
||||
//help_verb
|
||||
//no_guns = FALSE
|
||||
//allow_temp_override = TRUE //if this martial art can be overridden by temporary martial arts
|
||||
/datum/martial_art/hunter/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
|
||||
return FALSE
|
||||
/datum/martial_art/hunter/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
|
||||
return FALSE
|
||||
/datum/martial_art/hunter/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
|
||||
return FALSE
|
||||
/datum/martial_art/hunter/can_use(mob/living/carbon/human/H)
|
||||
return TRUE
|
||||
/datum/martial_art/hunter/add_to_streak(element,mob/living/carbon/human/D)
|
||||
if(D != current_target)
|
||||
current_target = D
|
||||
streak = ""
|
||||
restraining = 0
|
||||
streak = streak+element
|
||||
if(length_char(streak) > max_streak_length)
|
||||
streak = streak[1]
|
||||
return
|
||||
/datum/martial_art/hunter/basic_hit(mob/living/carbon/human/A,mob/living/carbon/human/D)
|
||||
var/damage = rand(A.dna.species.punchdamagelow, A.dna.species.punchdamagehigh)
|
||||
*/
|
||||
*/
|
||||
@@ -1,151 +0,0 @@
|
||||
#define VASSAL_SCAN_MIN_DISTANCE 5
|
||||
#define VASSAL_SCAN_MAX_DISTANCE 500
|
||||
#define VASSAL_SCAN_PING_TIME 20 //2s update time.
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/attempt_turn_vassal(mob/living/carbon/C)
|
||||
C.silent = 0
|
||||
return SSticker.mode.make_vassal(C,owner)
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/FreeAllVassals()
|
||||
for (var/datum/antagonist/vassal/V in vassals)
|
||||
SSticker.mode.remove_vassal(V.owner)
|
||||
|
||||
/datum/antagonist/vassal
|
||||
name = "Vassal"//WARNING: DO NOT SELECT" // "Vassal"
|
||||
roundend_category = "vassals"
|
||||
antagpanel_category = "Bloodsucker"
|
||||
job_rank = ROLE_BLOODSUCKER
|
||||
var/datum/antagonist/bloodsucker/master // Who made me?
|
||||
var/list/datum/action/powers = list()// Purchased powers
|
||||
var/list/datum/objective/objectives_given = list() // For removal if needed.
|
||||
|
||||
/datum/antagonist/vassal/can_be_owned(datum/mind/new_owner)
|
||||
// If we weren't created by a bloodsucker, then we cannot be a vassal (assigned from antag panel)
|
||||
if (!master)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/vassal/on_gain()
|
||||
SSticker.mode.vassals |= owner // Add if not already in here (and you might be, if you were picked at round start)
|
||||
// Mindslave Add
|
||||
if(master)
|
||||
var/datum/antagonist/bloodsucker/B = master.owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(B)
|
||||
B.vassals |= src
|
||||
owner.enslave_mind_to_creator(master.owner.current)
|
||||
// Master Pinpointer
|
||||
owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/vassal_edition)
|
||||
// Powers
|
||||
var/datum/action/bloodsucker/vassal/recuperate/new_Recuperate = new ()
|
||||
new_Recuperate.Grant(owner.current)
|
||||
powers += new_Recuperate
|
||||
// Give Vassal Objective
|
||||
var/datum/objective/bloodsucker/vassal/vassal_objective = new
|
||||
vassal_objective.owner = owner
|
||||
vassal_objective.generate_objective()
|
||||
objectives += vassal_objective
|
||||
objectives_given += vassal_objective
|
||||
give_thrall_eyes()
|
||||
owner.current.grant_language(/datum/language/vampiric)
|
||||
// Add Antag HUD
|
||||
update_vassal_icons_added(owner.current, "vassal")
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/vassal/proc/give_thrall_eyes()
|
||||
var/obj/item/organ/eyes/vassal/E = new
|
||||
E.Insert(owner.current)
|
||||
|
||||
/obj/item/organ/eyes/vassal/
|
||||
lighting_alpha = 180 // LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE <--- This is too low a value at 128. We need to SEE what the darkness is so we can hide in it.
|
||||
see_in_dark = 12
|
||||
flash_protect = -1 //These eyes are weaker to flashes, but let you see in the dark
|
||||
|
||||
/datum/antagonist/vassal/proc/remove_thrall_eyes()
|
||||
var/obj/item/organ/eyes/E = new
|
||||
E.Insert(owner.current)
|
||||
|
||||
/datum/antagonist/vassal/on_removal()
|
||||
SSticker.mode.vassals -= owner // Add if not already in here (and you might be, if you were picked at round start)
|
||||
// Mindslave Remove
|
||||
if (master && master.owner)
|
||||
master.vassals -= src
|
||||
if (owner.enslaved_to == master.owner.current)
|
||||
owner.enslaved_to = null
|
||||
// Master Pinpointer
|
||||
owner.current.remove_status_effect(/datum/status_effect/agent_pinpointer/vassal_edition)
|
||||
// Powers
|
||||
while(powers.len)
|
||||
var/datum/action/power = pick(powers)
|
||||
powers -= power
|
||||
power.Remove(owner.current)
|
||||
// Remove Hunter Objectives
|
||||
for(var/O in objectives_given)
|
||||
objectives -= O
|
||||
qdel(O)
|
||||
objectives_given = list()
|
||||
remove_thrall_eyes()
|
||||
owner.current.remove_language(/datum/language/vampiric)
|
||||
// Clear Antag HUD
|
||||
update_vassal_icons_removed(owner.current)
|
||||
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/vassal/greet()
|
||||
to_chat(owner, "<span class='userdanger'>You are now the mortal servant of [master.owner.current], a bloodsucking vampire!</span>")
|
||||
to_chat(owner, "<span class='boldannounce'>The power of [master.owner.current.p_their()] immortal blood compells you to obey [master.owner.current.p_them()] in all things, even offering your own life to prolong theirs.<br>\
|
||||
You are not required to obey any other Bloodsucker, for only [master.owner.current] is your master. The laws of Nanotransen do not apply to you now; only your vampiric master's word must be obeyed.<span>")
|
||||
// Effects...
|
||||
owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE)
|
||||
//owner.store_memory("You became the mortal servant of [master.owner.current], a bloodsucking vampire!")
|
||||
antag_memory += "You became the mortal servant of <b>[master.owner.current]</b>, a bloodsucking vampire!<br>"
|
||||
// And to your new Master...
|
||||
to_chat(master.owner, "<span class='userdanger'>[owner.current] has become addicted to your immortal blood. [owner.current.p_they(TRUE)] [owner.current.p_are()] now your undying servant!</span>")
|
||||
master.owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE)
|
||||
|
||||
/datum/antagonist/vassal/farewell()
|
||||
owner.current.visible_message("[owner.current]'s eyes dart feverishly from side to side, and then stop. [owner.current.p_they(TRUE)] seem[owner.current.p_s()] calm, \
|
||||
like [owner.current.p_they()] [owner.current.p_have()] regained some lost part of [owner.current.p_them()]self.",\
|
||||
"<span class='userdanger'><FONT size = 3>With a snap, you are no longer enslaved to [master.owner]! You breathe in heavily, having regained your free will.</FONT></span>")
|
||||
owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE)
|
||||
// And to your former Master...
|
||||
//if (master && master.owner)
|
||||
// to_chat(master.owner, "<span class='userdanger'>You feel the bond with your vassal [owner.current] has somehow been broken!</span>")
|
||||
|
||||
/datum/status_effect/agent_pinpointer/vassal_edition
|
||||
id = "agent_pinpointer"
|
||||
alert_type = /obj/screen/alert/status_effect/agent_pinpointer/vassal_edition
|
||||
minimum_range = VASSAL_SCAN_MIN_DISTANCE
|
||||
tick_interval = VASSAL_SCAN_PING_TIME
|
||||
duration = -1 // runs out fast
|
||||
range_fuzz_factor = 0
|
||||
|
||||
/obj/screen/alert/status_effect/agent_pinpointer/vassal_edition
|
||||
name = "Blood Bond"
|
||||
desc = "You always know where your master is."
|
||||
//icon = 'icons/obj/device.dmi'
|
||||
//icon_state = "pinon"
|
||||
|
||||
/datum/status_effect/agent_pinpointer/vassal_edition/on_creation(mob/living/new_owner, ...)
|
||||
..()
|
||||
|
||||
var/datum/antagonist/vassal/antag_datum = new_owner.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
scan_target = antag_datum?.master?.owner?.current
|
||||
|
||||
/datum/status_effect/agent_pinpointer/vassal_edition/scan_for_target()
|
||||
// DO NOTHING. We already have our target, and don't wanna do anything from agent_pinpointer
|
||||
|
||||
/datum/antagonist/vassal/proc/update_vassal_icons_added(mob/living/vassal, icontype="vassal")
|
||||
var/datum/atom_hud/antag/bloodsucker/hud = GLOB.huds[ANTAG_HUD_BLOODSUCKER]
|
||||
hud.join_hud(vassal)
|
||||
set_antag_hud(vassal, icontype) // Located in icons/mob/hud.dmi
|
||||
owner.current.hud_list[ANTAG_HUD].icon = image('icons/mob/hud.dmi', owner.current, "bloodsucker")
|
||||
|
||||
/datum/antagonist/vassal/proc/update_vassal_icons_removed(mob/living/vassal)
|
||||
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_BLOODSUCKER]
|
||||
hud.leave_hud(vassal)
|
||||
set_antag_hud(vassal, null)
|
||||
|
||||
//Displayed at the start of roundend_category section, default to roundend_category header
|
||||
/*/datum/antagonist/vassal/roundend_report_header()
|
||||
return "<span class='header'>Loyal to their bloodsucking masters, the Vassals were:</span><br><br>"*/
|
||||
@@ -1,67 +0,0 @@
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/CheckVampOrgans()
|
||||
// Do I have any parts that need replacing?
|
||||
var/obj/item/organ/O
|
||||
// Heart
|
||||
O = owner.current.getorganslot(ORGAN_SLOT_HEART)
|
||||
if(!istype(O, /obj/item/organ/heart/vampheart))
|
||||
qdel(O)
|
||||
var/obj/item/organ/heart/vampheart/H = new
|
||||
H.Insert(owner.current)
|
||||
H.Stop() // Now...stop beating!
|
||||
// Eyes
|
||||
O = owner.current.getorganslot(ORGAN_SLOT_EYES)
|
||||
if(!istype(O, /obj/item/organ/eyes/vassal/bloodsucker))
|
||||
qdel(O)
|
||||
var/obj/item/organ/eyes/vassal/bloodsucker/E = new
|
||||
E.Insert(owner.current)
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/RemoveVampOrgans()
|
||||
// Heart
|
||||
var/obj/item/organ/heart/H = new
|
||||
H.Insert(owner.current)
|
||||
// Eyes
|
||||
var/obj/item/organ/eyes/E = new
|
||||
E.Insert(owner.current)
|
||||
// HEART: OVERWRITE //
|
||||
// HEART //
|
||||
/obj/item/organ/heart/vampheart
|
||||
beating = 0
|
||||
var/fakingit = 0
|
||||
|
||||
/obj/item/organ/heart/vampheart/prepare_eat()
|
||||
..()
|
||||
// Do cool stuff for eating vamp heart?
|
||||
|
||||
/obj/item/organ/heart/vampheart/Restart()
|
||||
beating = 0 // DONT run ..(). We don't want to start beating again.
|
||||
return 0
|
||||
|
||||
/obj/item/organ/heart/vampheart/Stop()
|
||||
fakingit = 0
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/heart/vampheart/proc/FakeStart()
|
||||
fakingit = 1 // We're pretending to beat, to fool people.
|
||||
|
||||
/obj/item/organ/heart/vampheart/HeartStrengthMessage()
|
||||
if(fakingit)
|
||||
return "a healthy"
|
||||
return "<span class='danger'>no</span>" // Bloodsuckers don't have a heartbeat at all when stopped (default is "an unstable")
|
||||
// EYES //
|
||||
|
||||
/obj/item/organ/eyes/vassal/bloodsucker
|
||||
flash_protect = 2 //Eye healing isnt working properly
|
||||
sight_flags = SEE_MOBS // Taken from augmented_eyesight.dm
|
||||
|
||||
/*
|
||||
// LIVER //
|
||||
/obj/item/organ/liver/vampliver
|
||||
// Livers run on_life(), which calls reagents.metabolize() in holder.dm, which calls on_mob_life.dm in the cheam (medicine_reagents.dm)
|
||||
// Holder also calls reagents.reaction_mob for the moment it happens
|
||||
/obj/item/organ/liver/vampliver/on_life()
|
||||
var/mob/living/carbon/C = owner
|
||||
if(!istype(C))
|
||||
return
|
||||
*/
|
||||
@@ -1,176 +0,0 @@
|
||||
|
||||
|
||||
// organ_internal.dm -- /obj/item/organ
|
||||
|
||||
|
||||
|
||||
// Do I have a stake in my heart?
|
||||
/mob/living/AmStaked()
|
||||
var/obj/item/bodypart/BP = get_bodypart("chest")
|
||||
if (!BP)
|
||||
return FALSE
|
||||
for(var/obj/item/I in BP.embedded_objects)
|
||||
if (istype(I,/obj/item/stake/))
|
||||
return TRUE
|
||||
return FALSE
|
||||
/mob/proc/AmStaked()
|
||||
return FALSE
|
||||
|
||||
|
||||
/mob/living/proc/StakeCanKillMe()
|
||||
return IsSleeping() || stat >= UNCONSCIOUS || blood_volume <= 0 || HAS_TRAIT(src, TRAIT_DEATHCOMA) // NOTE: You can't go to sleep in a coffin with a stake in you.
|
||||
|
||||
|
||||
///obj/item/weapon/melee/stake
|
||||
/obj/item/stake/
|
||||
name = "wooden stake"
|
||||
desc = "A simple wooden stake carved to a sharp point."
|
||||
icon = 'icons/obj/stake.dmi'
|
||||
icon_state = "wood" // Inventory Icon
|
||||
item_state = "wood" // In-hand Icon
|
||||
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi' // File for in-hand icon
|
||||
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
|
||||
attack_verb = list("staked")
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
force = 6
|
||||
throwforce = 10
|
||||
embedding = list("embed_chance" = 25, "embedded_fall_chance" = 0.5) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled
|
||||
//embed_chance = 25 // Look up "is_pointed" to see where we set stakes able to do this.
|
||||
//embedded_fall_chance = 0.5 // Chance it will fall out.
|
||||
obj_integrity = 30
|
||||
max_integrity = 30
|
||||
//embedded_fall_pain_multiplier
|
||||
var/staketime = 120 // Time it takes to embed the stake into someone's chest.
|
||||
|
||||
/obj/item/stake/basic
|
||||
name = "wooden stake"
|
||||
// This exists so Hardened/Silver Stake can't have a welding torch used on them.
|
||||
|
||||
/obj/item/stake/basic/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
//if (amWelded)
|
||||
// to_chat(user, "<span class='warning'>This stake has already been treated with fire.</span>")
|
||||
// return
|
||||
//amWelded = TRUE
|
||||
// Weld it
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(WT.use(0))//remove_fuel(0,user))
|
||||
user.visible_message("[user.name] scorched the pointy end of [src] with the welding tool.", \
|
||||
"<span class='notice'>You scorch the pointy end of [src] with the welding tool.</span>", \
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
// 8 Second Timer
|
||||
if(!do_mob(user, src, 80))
|
||||
return
|
||||
// Create the Stake
|
||||
qdel(src)
|
||||
var/obj/item/stake/hardened/new_item = new(usr.loc)
|
||||
user.put_in_hands(new_item)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/stake/afterattack(atom/target, mob/user, proximity)
|
||||
//to_chat(world, "<span class='notice'>DEBUG: Staking </span>")
|
||||
// Invalid Target, or not targetting chest with HARM intent?
|
||||
if(!iscarbon(target) || check_zone(user.zone_selected) != "chest" || user.a_intent != INTENT_HARM)
|
||||
return
|
||||
var/mob/living/carbon/C = target
|
||||
// Needs to be Down/Slipped in some way to Stake.
|
||||
if(!C.can_be_staked() || target == user)
|
||||
to_chat(user, "<span class='danger'>You cant stake [target] when they are moving moving about! They have to be laying down!</span>")
|
||||
return
|
||||
// Oops! Can't.
|
||||
if(HAS_TRAIT(C, TRAIT_PIERCEIMMUNE))
|
||||
to_chat(user, "<span class='danger'>[target]'s chest resists the stake. It won't go in.</span>")
|
||||
return
|
||||
// Make Attempt...
|
||||
to_chat(user, "<span class='notice'>You put all your weight into embedding the stake into [target]'s chest...</span>")
|
||||
playsound(user, 'sound/magic/Demon_consume.ogg', 50, 1)
|
||||
if(!do_mob(user, C, staketime, 0, 1, extra_checks=CALLBACK(C, /mob/living/carbon/proc/can_be_staked))) // user / target / time / uninterruptable / show progress bar / extra checks
|
||||
return
|
||||
// Drop & Embed Stake
|
||||
user.visible_message("<span class='danger'>[user.name] drives the [src] into [target]'s chest!</span>", \
|
||||
"<span class='danger'>You drive the [src] into [target]'s chest!</span>")
|
||||
playsound(get_turf(target), 'sound/effects/splat.ogg', 40, 1)
|
||||
user.dropItemToGround(src, TRUE) //user.drop_item() // "drop item" doesn't seem to exist anymore. New proc is user.dropItemToGround() but it doesn't seem like it's needed now?
|
||||
var/obj/item/bodypart/B = C.get_bodypart("chest") // This was all taken from hitby() in human_defense.dm
|
||||
B.embedded_objects |= src
|
||||
add_mob_blood(target)//Place blood on the stake
|
||||
loc = C // Put INSIDE the character
|
||||
B.receive_damage(w_class * embedding.embedded_impact_pain_multiplier)
|
||||
if(C.mind)
|
||||
var/datum/antagonist/bloodsucker/bloodsucker = C.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(bloodsucker)
|
||||
// If DEAD or TORPID...kill vamp!
|
||||
if(C.StakeCanKillMe()) // NOTE: This is the ONLY time a staked Torpid vamp dies.
|
||||
bloodsucker.FinalDeath()
|
||||
return
|
||||
else
|
||||
to_chat(target, "<span class='userdanger'>You have been staked! Your powers are useless, your death forever, while it remains in place.</span>")
|
||||
to_chat(user, "<span class='warning'>You missed [C.p_their(TRUE)]'s heart! It would be easier if [C.p_they(TRUE)] weren't struggling so much.</span>")
|
||||
|
||||
// Can this target be staked? If someone stands up before this is complete, it fails. Best used on someone stationary.
|
||||
/mob/living/carbon/proc/can_be_staked()
|
||||
//return resting || IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (has_trait(TRAIT_FAKEDEATH)) || resting || IsStun() || IsFrozen() || (pulledby && pulledby.grab_state >= GRAB_NECK)
|
||||
return (src.resting || src.lying)
|
||||
// ABOVE: Taken from update_mobility() in living.dm
|
||||
|
||||
/obj/item/stake/hardened
|
||||
// Created by welding and acid-treating a simple stake.
|
||||
name = "hardened stake"
|
||||
desc = "A hardened wooden stake carved to a sharp point and scorched at the end."
|
||||
icon_state = "hardened" // Inventory Icon
|
||||
force = 8
|
||||
throwforce = 12
|
||||
armour_penetration = 10
|
||||
embedding = list("embed_chance" = 50, "embedded_fall_chance" = 0) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled
|
||||
obj_integrity = 120
|
||||
max_integrity = 120
|
||||
|
||||
staketime = 80
|
||||
|
||||
/obj/item/stake/hardened/silver
|
||||
name = "silver stake"
|
||||
desc = "Polished and sharp at the end. For when some mofo is always trying to iceskate uphill."
|
||||
icon_state = "silver" // Inventory Icon
|
||||
item_state = "silver" // In-hand Icon
|
||||
siemens_coefficient = 1 //flags = CONDUCT // var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit)
|
||||
force = 9
|
||||
armour_penetration = 25
|
||||
embedding = list("embed_chance" = 65) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled
|
||||
obj_integrity = 300
|
||||
max_integrity = 300
|
||||
|
||||
staketime = 60
|
||||
|
||||
// Convert back to Silver
|
||||
/obj/item/stake/hardened/silver/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/WT = I
|
||||
if(WT.use(0))//remove_fuel(0, user))
|
||||
var/obj/item/stack/sheet/mineral/silver/newsheet = new (user.loc)
|
||||
for(var/obj/item/stack/sheet/mineral/silver/S in user.loc)
|
||||
if(S == newsheet)
|
||||
continue
|
||||
if(S.amount >= S.max_amount)
|
||||
continue
|
||||
S.attackby(newsheet, user)
|
||||
to_chat(user, "<span class='notice'>You melt down the stake and add it to the stack. It now contains [newsheet.amount] sheet\s.</span>")
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
// Look up recipes.dm OR pneumaticCannon.dm
|
||||
/datum/crafting_recipe/silver_stake
|
||||
name = "Silver Stake"
|
||||
result = /obj/item/stake/hardened/silver
|
||||
tools = list(/obj/item/weldingtool)
|
||||
reqs = list(/obj/item/stack/sheet/mineral/silver = 1,
|
||||
/obj/item/stake/hardened = 1)
|
||||
///obj/item/stack/packageWrap = 8,
|
||||
///obj/item/pipe = 2)
|
||||
time = 80
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
@@ -1,243 +0,0 @@
|
||||
|
||||
|
||||
// TRAIT_DEATHCOMA - Activate this when you're in your coffin to simulate sleep/death.
|
||||
|
||||
|
||||
// Coffins...
|
||||
// -heal all wounds, and quickly.
|
||||
// -restore limbs & organs
|
||||
//
|
||||
|
||||
// Without Coffins...
|
||||
// -
|
||||
// -limbs stay lost
|
||||
|
||||
|
||||
|
||||
// To put to sleep: use owner.current.fakedeath("bloodsucker") but change name to "bloodsucker_coffin" so you continue to stay fakedeath despite healing in the main thread!
|
||||
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/ClaimCoffin(obj/structure/closet/crate/claimed) // NOTE: This can be any "closet" that you are resting AND inside of.
|
||||
// ALREADY CLAIMED
|
||||
if(claimed.resident)
|
||||
if(claimed.resident == owner.current)
|
||||
to_chat(owner, "This is your [src].")
|
||||
else
|
||||
to_chat(owner, "This [src] has already been claimed by another.")
|
||||
return FALSE
|
||||
// Bloodsucker Learns new Recipes!
|
||||
owner.teach_crafting_recipe(/datum/crafting_recipe/bloodsucker/vassalrack)
|
||||
owner.teach_crafting_recipe(/datum/crafting_recipe/bloodsucker/candelabrum)
|
||||
// This is my Lair
|
||||
coffin = claimed
|
||||
lair = get_area(claimed)
|
||||
// DONE
|
||||
to_chat(owner, "<span class='userdanger'>You have claimed the [claimed] as your place of immortal rest! Your lair is now [lair].</span>")
|
||||
to_chat(owner, "<span class='danger'>You have learned new construction recipes to improve your lair.</span>")
|
||||
to_chat(owner, "<span class='announce'>Bloodsucker Tip: Find new lair recipes in the misc tab of the <i>Crafting Menu</i> at the bottom of the screen, including the <i>Persuasion Rack</i> for converting crew into Vassals.</span><br><br>")
|
||||
RunLair() // Start
|
||||
return TRUE
|
||||
|
||||
// crate.dm
|
||||
/obj/structure/closet/crate
|
||||
var/mob/living/resident // This lets bloodsuckers claim any "closet" as a Coffin, so long as they could get into it and close it. This locks it in place, too.
|
||||
|
||||
/obj/structure/closet/crate/coffin
|
||||
var/pryLidTimer = 250
|
||||
can_weld_shut = FALSE
|
||||
breakout_time = 200
|
||||
max_mob_size = MOB_SIZE_LARGE
|
||||
|
||||
|
||||
/obj/structure/closet/crate/coffin/blackcoffin
|
||||
name = "black coffin"
|
||||
desc = "For those departed who are not so dear."
|
||||
icon_state = "coffin"
|
||||
icon = 'icons/obj/vamp_obj.dmi'
|
||||
can_weld_shut = FALSE
|
||||
resistance_flags = 0 // Start off with no bonuses.
|
||||
open_sound = 'sound/bloodsucker/coffin_open.ogg'
|
||||
close_sound = 'sound/bloodsucker/coffin_close.ogg'
|
||||
breakout_time = 600
|
||||
pryLidTimer = 400
|
||||
resistance_flags = NONE
|
||||
|
||||
/obj/structure/closet/crate/coffin/meatcoffin
|
||||
name = "meat coffin"
|
||||
desc = "When you're ready to meat your maker, the steaks can never be too high."
|
||||
icon_state = "meatcoffin"
|
||||
icon = 'icons/obj/vamp_obj.dmi'
|
||||
can_weld_shut = FALSE
|
||||
resistance_flags = 0 // Start off with no bonuses.
|
||||
open_sound = 'sound/effects/footstep/slime1.ogg'
|
||||
close_sound = 'sound/effects/footstep/slime1.ogg'
|
||||
breakout_time = 200
|
||||
pryLidTimer = 200
|
||||
resistance_flags = NONE
|
||||
material_drop = /obj/item/reagent_containers/food/snacks/meat/slab
|
||||
material_drop_amount = 3
|
||||
|
||||
/obj/structure/closet/crate/coffin/metalcoffin
|
||||
name = "metal coffin"
|
||||
desc = "A big metal sardine can inside of another big metal sardine can, in space."
|
||||
icon_state = "metalcoffin"
|
||||
icon = 'icons/obj/vamp_obj.dmi'
|
||||
can_weld_shut = FALSE
|
||||
resistance_flags = FIRE_PROOF | LAVA_PROOF
|
||||
open_sound = 'sound/effects/pressureplate.ogg'
|
||||
close_sound = 'sound/effects/pressureplate.ogg'
|
||||
breakout_time = 300
|
||||
pryLidTimer = 200
|
||||
resistance_flags = NONE
|
||||
material_drop = /obj/item/stack/sheet/metal
|
||||
material_drop_amount = 5
|
||||
|
||||
//////////////////////////////////////////////
|
||||
|
||||
/obj/structure/closet/crate/proc/ClaimCoffin(mob/living/claimant) // NOTE: This can be any "closet" that you are resting AND inside of.
|
||||
// Bloodsucker Claim
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = claimant.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(bloodsuckerdatum)
|
||||
// Vamp Successfuly Claims Me?
|
||||
if(bloodsuckerdatum.ClaimCoffin(src))
|
||||
resident = claimant
|
||||
anchored = 1 // No moving this
|
||||
|
||||
/obj/structure/closet/crate/coffin/Destroy()
|
||||
UnclaimCoffin()
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/proc/UnclaimCoffin()
|
||||
if (resident)
|
||||
// Vamp Un-Claim
|
||||
if (resident.mind)
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = resident.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if (bloodsuckerdatum && bloodsuckerdatum.coffin == src)
|
||||
bloodsuckerdatum.coffin = null
|
||||
bloodsuckerdatum.lair = null
|
||||
to_chat(resident, "<span class='danger'><span class='italics'>You sense that the link with your coffin, your sacred place of rest, has been broken! You will need to seek another.</span></span>")
|
||||
resident = null // Remove resident. Because this object isnt removed from the game immediately (GC?) we need to give them a way to see they don't have a home anymore.
|
||||
|
||||
/obj/structure/closet/crate/coffin/can_open(mob/living/user)
|
||||
// You cannot lock in/out a coffin's owner. SORRY.
|
||||
if (locked)
|
||||
if(user == resident)
|
||||
if (welded)
|
||||
welded = FALSE
|
||||
update_icon()
|
||||
//to_chat(user, "<span class='notice'>You flip a secret latch and unlock [src].</span>") // Don't bother. We know it's unlocked.
|
||||
locked = FALSE
|
||||
return 1
|
||||
else
|
||||
playsound(get_turf(src), 'sound/machines/door_locked.ogg', 20, 1)
|
||||
to_chat(user, "<span class='notice'>[src] is locked tight from the inside.</span>")
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/coffin/close(mob/living/user)
|
||||
var/turf/Turf = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
if (!..())
|
||||
return FALSE
|
||||
// Only the User can put themself into Torpor (if you're already in it, you'll start to heal)
|
||||
if((user in src))
|
||||
// Bloodsucker Only
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(bloodsuckerdatum)
|
||||
LockMe(user)
|
||||
Turf = get_turf(user) //we may have moved. adjust as needed...
|
||||
A = get_area(src)
|
||||
// Claim?
|
||||
if(!bloodsuckerdatum.coffin && !resident && (is_station_level(Turf.z) || !A.map_name == "Space"))
|
||||
switch(alert(user,"Do you wish to claim this as your coffin? [get_area(src)] will be your lair.","Claim Lair","Yes", "No"))
|
||||
if("Yes")
|
||||
ClaimCoffin(user)
|
||||
if (user.AmStaked()) // Stake? No Heal!
|
||||
to_chat(bloodsuckerdatum.owner.current, "<span class='userdanger'>You are staked! Remove the offending weapon from your heart before sleeping.</span>")
|
||||
return
|
||||
// Heal
|
||||
if(bloodsuckerdatum.HandleHealing(0)) // Healing Mult 0 <--- We only want to check if healing is valid!
|
||||
to_chat(bloodsuckerdatum.owner.current, "<span class='notice'>You enter the horrible slumber of deathless Torpor. You will heal until you are renewed.</span>")
|
||||
bloodsuckerdatum.Torpor_Begin()
|
||||
// Level Up?
|
||||
bloodsuckerdatum.SpendRank() // Auto-Fails if not appropriate
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/crate/coffin/attackby(obj/item/W, mob/user, params)
|
||||
// You cannot weld or deconstruct an owned coffin. STILL NOT SORRY.
|
||||
if (resident != null && user != resident) // Owner can destroy their own coffin.
|
||||
if(opened)
|
||||
if(istype(W, cutting_tool))
|
||||
to_chat(user, "<span class='notice'>This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src].</span>")
|
||||
return
|
||||
else if(anchored && istype(W, /obj/item/wrench)) // Can't unanchor unless owner.
|
||||
to_chat(user, "<span class='danger'>The coffin won't come unanchored from the floor.</span>")
|
||||
return
|
||||
|
||||
if(locked && istype(W, /obj/item/crowbar))
|
||||
var/pry_time = pryLidTimer * W.toolspeed // Pry speed must be affected by the speed of the tool.
|
||||
user.visible_message("<span class='notice'>[user] tries to pry the lid off of [src] with [W].</span>", \
|
||||
"<span class='notice'>You begin prying the lid off of [src] with [W]. This should take about [DisplayTimeText(pry_time)].</span>")
|
||||
if (!do_mob(user,src,pry_time))
|
||||
return
|
||||
bust_open()
|
||||
user.visible_message("<span class='notice'>[user] snaps the door of [src] wide open.</span>", \
|
||||
"<span class='notice'>The door of [src] snaps open.</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/structure/closet/crate/coffin/AltClick(mob/user)
|
||||
// Distance Check (Inside Of)
|
||||
if (user in src) // user.Adjacent(src)
|
||||
LockMe(user, !locked)
|
||||
|
||||
/obj/structure/closet/crate/proc/LockMe(mob/user, inLocked = TRUE)
|
||||
// Lock
|
||||
if (user == resident)
|
||||
if (!broken)
|
||||
locked = inLocked
|
||||
to_chat(user, "<span class='notice'>You flip a secret latch and [locked?"":"un"]lock yourself inside [src].</span>")
|
||||
else
|
||||
to_chat(resident, "<span class='notice'>The secret latch to lock [src] from the inside is broken. You set it back into place...</span>")
|
||||
if (do_mob(resident, src, 50))//sleep(10)
|
||||
if (broken) // Spam Safety
|
||||
to_chat(resident, "<span class='notice'>You fix the mechanism and lock it.</span>")
|
||||
broken = FALSE
|
||||
locked = TRUE
|
||||
|
||||
// Look up recipes.dm OR pneumaticCannon.dm
|
||||
/datum/crafting_recipe/bloodsucker/blackcoffin
|
||||
name = "Black Coffin"
|
||||
result = /obj/structure/closet/crate/coffin/blackcoffin
|
||||
tools = list(/obj/item/weldingtool,
|
||||
/obj/item/screwdriver)
|
||||
reqs = list(/obj/item/stack/sheet/cloth = 1,
|
||||
/obj/item/stack/sheet/mineral/wood = 5,
|
||||
/obj/item/stack/sheet/metal = 1)
|
||||
///obj/item/stack/packageWrap = 8,
|
||||
///obj/item/pipe = 2)
|
||||
time = 150
|
||||
category = CAT_MISC
|
||||
always_availible = TRUE
|
||||
|
||||
/datum/crafting_recipe/bloodsucker/meatcoffin
|
||||
name = "Meat Coffin"
|
||||
result =/obj/structure/closet/crate/coffin/meatcoffin
|
||||
tools = list(/obj/item/kitchen/knife,
|
||||
/obj/item/kitchen/rollingpin)
|
||||
reqs = list(/obj/item/reagent_containers/food/snacks/meat/slab = 5,
|
||||
/obj/item/restraints/handcuffs/cable = 1)
|
||||
time = 150
|
||||
category = CAT_MISC
|
||||
always_availible = TRUE
|
||||
|
||||
/datum/crafting_recipe/bloodsucker/metalcoffin
|
||||
name = "Metal Coffin"
|
||||
result =/obj/structure/closet/crate/coffin/metalcoffin
|
||||
tools = list(/obj/item/weldingtool,
|
||||
/obj/item/screwdriver)
|
||||
reqs = list(/obj/item/stack/sheet/metal = 5)
|
||||
time = 100
|
||||
category = CAT_MISC
|
||||
always_availible = TRUE
|
||||
@@ -1,494 +0,0 @@
|
||||
|
||||
|
||||
// IDEAS --
|
||||
// An object that disguises your coffin while you're in it!
|
||||
//
|
||||
// An object that lets your lair itself protect you from sunlight, like a coffin would (no healing tho)
|
||||
|
||||
|
||||
|
||||
// Hide a random object somewhere on the station:
|
||||
// var/turf/targetturf = get_random_station_turf()
|
||||
// var/turf/targetturf = get_safe_random_station_turf()
|
||||
|
||||
|
||||
|
||||
|
||||
// CRYPT OBJECTS
|
||||
//
|
||||
//
|
||||
// PODIUM Stores your Relics
|
||||
//
|
||||
// ALTAR Transmute items into sacred items.
|
||||
//
|
||||
// PORTRAIT Gaze into your past to: restore mood boost?
|
||||
//
|
||||
// BOOKSHELF Discover secrets about crew and locations. Learn languages. Learn marial arts.
|
||||
//
|
||||
// BRAZER Burn rare ingredients to gleen insights.
|
||||
//
|
||||
// RUG Ornate, and creaks when stepped upon by any humanoid other than yourself and your vassals.
|
||||
//
|
||||
// X COFFIN (Handled elsewhere)
|
||||
//
|
||||
// X CANDELABRA (Handled elsewhere)
|
||||
//
|
||||
// THRONE Your mental powers work at any range on anyone inside your crypt.
|
||||
//
|
||||
// MIRROR Find any person
|
||||
//
|
||||
// BUST/STATUE Create terror, but looks just like you (maybe just in Examine?)
|
||||
|
||||
|
||||
// RELICS
|
||||
//
|
||||
// RITUAL DAGGER
|
||||
//
|
||||
// SKULL
|
||||
//
|
||||
// VAMPIRIC SCROLL
|
||||
//
|
||||
// SAINTS BONES
|
||||
//
|
||||
// GRIMOIRE
|
||||
|
||||
|
||||
// RARE INGREDIENTS
|
||||
// Ore
|
||||
// Books (Manuals)
|
||||
|
||||
|
||||
// NOTE: Look up AI and Sentient Disease to see how the game handles the selector logo that only one player is allowed to see. We could add hud for vamps to that?
|
||||
// ALTERNATIVELY, use the Vamp Huds on relics to mark them, but only show to relevant vamps?
|
||||
|
||||
|
||||
/obj/structure/bloodsucker
|
||||
var/mob/living/owner
|
||||
|
||||
/*
|
||||
/obj/structure/bloodsucker/bloodthrone
|
||||
name = "wicked throne"
|
||||
desc = "Twisted metal shards jut from the arm rests. Very uncomfortable looking. It would take a sadistic sort to sit on this jagged piece of furniture."
|
||||
/obj/structure/bloodsucker/bloodaltar
|
||||
name = "bloody altar"
|
||||
desc = "It is marble, lined with basalt, and radiates an unnerving chill that puts your skin on edge."
|
||||
/obj/structure/bloodsucker/bloodstatue
|
||||
name = "bloody countenance"
|
||||
desc = "It looks upsettingly familiar..."
|
||||
/obj/structure/bloodsucker/bloodportrait
|
||||
name = "oil portrait"
|
||||
desc = "A disturbingly familiar face stares back at you. On second thought, the reds don't seem to be painted in oil..."
|
||||
/obj/structure/bloodsucker/bloodbrazer
|
||||
name = "lit brazer"
|
||||
desc = "It burns slowly, but doesn't radiate any heat."
|
||||
/obj/structure/bloodsucker/bloodmirror
|
||||
name = "faded mirror"
|
||||
desc = "You get the sense that the foggy reflection looking back at you has an alien intelligence to it."
|
||||
*/
|
||||
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack
|
||||
name = "persuasion rack"
|
||||
desc = "If this wasn't meant for torture, then someone has some fairly horrifying hobbies."
|
||||
icon = 'icons/obj/vamp_obj.dmi'
|
||||
icon_state = "vassalrack"
|
||||
buckle_lying = FALSE
|
||||
anchored = FALSE
|
||||
density = TRUE // Start dense. Once fixed in place, go non-dense.
|
||||
can_buckle = TRUE
|
||||
var/useLock = FALSE // So we can't just keep dragging ppl on here.
|
||||
var/mob/buckled
|
||||
var/convert_progress = 3 // Resets on each new character to be added to the chair. Some effects should lower it...
|
||||
var/disloyalty_confirm = FALSE // Command & Antags need to CONFIRM they are willing to lose their role (and will only do it if the Vassal'ing succeeds)
|
||||
var/disloyalty_offered = FALSE // Has the popup been issued? Don't spam them.
|
||||
var/convert_cost = 100
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/deconstruct(disassembled = TRUE)
|
||||
new /obj/item/stack/sheet/metal(src.loc, 4)
|
||||
new /obj/item/stack/rods(loc, 4)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/examine(mob/user)
|
||||
. = ..()
|
||||
if((user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) || isobserver(user))
|
||||
. += {"<span class='cult'>This is the vassal rack, which allows you to thrall crewmembers into loyal minions in your service.</span>"}
|
||||
. += {"<span class='cult'>You need to first secure the vassal rack by clicking on it while it is in your lair.</span>"}
|
||||
. += {"<span class='cult'>Simply click and hold on a victim, and then drag their sprite on the vassal rack.</span>"}
|
||||
. += {"<span class='cult'>Make sure that the victim is handcuffed, or else they can simply run away or resist, as the process is not instant.</span>"}
|
||||
. += {"<span class='cult'>To convert the victim, simply click on the vassal rack itself. Sharp weapons work faster than other tools.</span>"}
|
||||
/* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
. += {"<span class='cult'>This is the vassal rack, which allows your master to thrall crewmembers into his minions.\n
|
||||
Aid your master in bringing their victims here and keeping them secure.\n
|
||||
You can secure victims to the vassal rack by click dragging the victim onto the rack while it is secured</span>"} */
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/MouseDrop_T(atom/movable/O, mob/user)
|
||||
if(!O.Adjacent(src) || O == user || !isliving(O) || !isliving(user) || useLock || has_buckled_mobs() || user.incapacitated())
|
||||
return
|
||||
if(!anchored && user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
to_chat(user, "<span class='danger'>Until this rack is secured in place, it cannot serve its purpose.</span>")
|
||||
return
|
||||
// PULL TARGET: Remember if I was pullin this guy, so we can restore this
|
||||
var/waspulling = (O == owner.pulling)
|
||||
var/wasgrabstate = owner.grab_state
|
||||
// * MOVE! *
|
||||
O.forceMove(drop_location())
|
||||
// PULL TARGET: Restore?
|
||||
if(waspulling)
|
||||
owner.start_pulling(O, wasgrabstate, TRUE)
|
||||
// NOTE: in bs_lunge.dm, we use [target.grabbedby(owner)], which simulates doing a grab action. We don't want that though...we're cutting directly back to where we were in a grab.
|
||||
// Do Action!
|
||||
useLock = TRUE
|
||||
if(do_mob(user, O, 50))
|
||||
attach_victim(O,user)
|
||||
useLock = FALSE
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/AltClick(mob/user)
|
||||
if(!has_buckled_mobs() || !isliving(user) || useLock)
|
||||
return
|
||||
// Attempt Release (Owner vs Non Owner)
|
||||
var/mob/living/carbon/C = pick(buckled_mobs)
|
||||
if(C)
|
||||
if(user == owner)
|
||||
unbuckle_mob(C)
|
||||
else
|
||||
user_unbuckle_mob(C,user)
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/attach_victim(mob/living/M, mob/living/user)
|
||||
// Standard Buckle Check
|
||||
if(!buckle_mob(M)) // force=TRUE))
|
||||
return
|
||||
// Attempt Buckle
|
||||
user.visible_message("<span class='notice'>[user] straps [M] into the rack, immobilizing them.</span>", \
|
||||
"<span class='boldnotice'>You secure [M] tightly in place. They won't escape you now.</span>")
|
||||
|
||||
playsound(src.loc, 'sound/effects/pop_expl.ogg', 25, 1)
|
||||
//M.forceMove(drop_location()) <--- CANT DO! This cancels the buckle_mob() we JUST did (even if we foced the move)
|
||||
M.setDir(2)
|
||||
density = TRUE
|
||||
var/matrix/m180 = matrix(M.transform)
|
||||
m180.Turn(180)//90)//180
|
||||
animate(M, transform = m180, time = 2)
|
||||
M.pixel_y = -2 //M.get_standard_pixel_y_offset(120)//180)
|
||||
update_icon()
|
||||
// Torture Stuff
|
||||
convert_progress = 2 // Goes down unless you start over.
|
||||
disloyalty_confirm = FALSE // New guy gets the chance to say NO if he's special.
|
||||
disloyalty_offered = FALSE // Prevents spamming torture window.
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/user_unbuckle_mob(mob/living/M, mob/user)
|
||||
// Attempt Unbuckle
|
||||
if(!user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
if(M == user)
|
||||
M.visible_message("<span class='danger'>[user] tries to release themself from the rack!</span>",\
|
||||
"<span class='danger'>You attempt to release yourself from the rack!</span>") // For sound if not seen --> "<span class='italics'>You hear a squishy wet noise.</span>")
|
||||
else
|
||||
M.visible_message("<span class='danger'>[user] tries to pull [M] rack!</span>",\
|
||||
"<span class='danger'>[user] attempts to release you from the rack!</span>") // For sound if not seen --> "<span class='italics'>You hear a squishy wet noise.</span>")
|
||||
if(!do_mob(user, M, 100))
|
||||
return
|
||||
// Did the time. Now try to do it.
|
||||
..()
|
||||
unbuckle_mob(M)
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/unbuckle_mob(mob/living/buckled_mob, force = FALSE)
|
||||
if(!..())
|
||||
return
|
||||
var/matrix/m180 = matrix(buckled_mob.transform)
|
||||
m180.Turn(180)//-90)//180
|
||||
animate(buckled_mob, transform = m180, time = 2)
|
||||
buckled_mob.pixel_y = buckled_mob.get_standard_pixel_y_offset(180)
|
||||
src.visible_message(text("<span class='danger'>[buckled_mob][buckled_mob.stat==DEAD?"'s corpse":""] slides off of the rack.</span>"))
|
||||
density = FALSE
|
||||
buckled_mob.AdjustKnockdown(30)
|
||||
update_icon()
|
||||
useLock = FALSE // Failsafe
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/attackby(obj/item/W, mob/user, params)
|
||||
if(has_buckled_mobs()) // Attack w/weapon vs guy standing there? Don't do an attack.
|
||||
attack_hand(user)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/attack_hand(mob/user)
|
||||
//. = ..() // Taken from sacrificial altar in divine.dm
|
||||
//if(.)
|
||||
// return
|
||||
// Go away. Torturing.
|
||||
if(useLock)
|
||||
return
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
// CHECK ONE: Am I claiming this? Is it in the right place?
|
||||
if(istype(bloodsuckerdatum) && !owner)
|
||||
if(!bloodsuckerdatum.lair)
|
||||
to_chat(user, "<span class='danger'>You don't have a lair. Claim a coffin to make that location your lair.</span>")
|
||||
if(bloodsuckerdatum.lair != get_area(src))
|
||||
to_chat(user, "<span class='danger'>You may only activate this structure in your lair: [bloodsuckerdatum.lair].</span>")
|
||||
return
|
||||
switch(alert(user,"Do you wish to afix this structure here? Be aware you wont be able to unsecure it anymore","Secure [src]","Yes", "No"))
|
||||
if("Yes")
|
||||
owner = user
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
return //No, you cant move this ever again
|
||||
// No One Home
|
||||
if(!has_buckled_mobs())
|
||||
return
|
||||
// CHECK TWO: Am I a non-bloodsucker?
|
||||
var/mob/living/carbon/C = pick(buckled_mobs)
|
||||
if(!istype(bloodsuckerdatum))
|
||||
// Try to release this guy
|
||||
user_unbuckle_mob(C, user)
|
||||
return
|
||||
// Bloodsucker Owner! Let the boy go.
|
||||
if(C.mind)
|
||||
var/datum/antagonist/vassal/vassaldatum = C.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
if (istype(vassaldatum) && vassaldatum.master == bloodsuckerdatum || C.stat >= DEAD)
|
||||
unbuckle_mob(C)
|
||||
useLock = FALSE // Failsafe
|
||||
return
|
||||
// Just torture the boy
|
||||
torture_victim(user, C)
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/torture_victim(mob/living/user, mob/living/target)
|
||||
// Check Bloodmob/living/M, force = FALSE, check_loc = TRUE
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(user.blood_volume < convert_cost + 5)
|
||||
to_chat(user, "<span class='notice'>You don't have enough blood to initiate the Dark Communion with [target].</span>")
|
||||
return
|
||||
if(!bloodsuckerdatum || bloodsuckerdatum.vassals.len * 5 > bloodsuckerdatum.vamplevel)
|
||||
to_chat(user, "<span class='notice'>Your power is yet too weak to bring more vassals under your control....</span>")
|
||||
return
|
||||
// Prep...
|
||||
useLock = TRUE
|
||||
// Step One: Tick Down Conversion from 3 to 0
|
||||
// Step Two: Break mindshielding/antag (on approve)
|
||||
// Step Three: Blood Ritual
|
||||
// Conversion Process
|
||||
if(convert_progress > 0)
|
||||
to_chat(user, "<span class='notice'>You prepare to initiate [target] into your service.</span>")
|
||||
if(!do_torture(user,target))
|
||||
to_chat(user, "<span class='danger'><i>The ritual has been interrupted!</i></span>")
|
||||
else
|
||||
convert_progress -- // Ouch. Stop. Don't.
|
||||
// All done!
|
||||
if(convert_progress <= 0)
|
||||
// FAIL: Can't be Vassal
|
||||
if(!SSticker.mode.can_make_vassal(target, user, display_warning=FALSE) || HAS_TRAIT(target, TRAIT_MINDSHIELD)) // If I'm an unconvertable Antag ONLY
|
||||
to_chat(user, "<span class='danger'>[target] doesn't respond to your persuasion. It doesn't appear they can be converted to follow you, they either have a mindshield or their external loyalties are too difficult for you to break.<i>\[ALT+click to release\]</span>")
|
||||
convert_progress ++ // Pop it back up some. Avoids wasting Blood on a lost cause.
|
||||
// SUCCESS: All done!
|
||||
else
|
||||
if(RequireDisloyalty(target))
|
||||
to_chat(user, "<span class='boldwarning'>[target] has external loyalties! [target.p_they(TRUE)] will require more <i>persuasion</i> to break [target.p_them()] to your will!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[target] looks ready for the <b>Dark Communion</b>.</span>")
|
||||
// Still Need More Persuasion...
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[target] could use [convert_progress == 1?"a little":"some"] more <i>persuasion</i>.</span>")
|
||||
useLock = FALSE
|
||||
return
|
||||
// Check: Mindshield & Antag
|
||||
if(!disloyalty_confirm && RequireDisloyalty(target))
|
||||
if(!do_disloyalty(user,target))
|
||||
to_chat(user, "<span class='danger'><i>The ritual has been interrupted!</i></span>")
|
||||
else if (!disloyalty_confirm)
|
||||
to_chat(user, "<span class='danger'>[target] refuses to give into your persuasion. Perhaps a little more?</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[target] looks ready for the <b>Dark Communion</b>.</span>")
|
||||
useLock = FALSE
|
||||
return
|
||||
// Check: Blood
|
||||
if(user.blood_volume < convert_cost)
|
||||
to_chat(user, "<span class='notice'>You don't have enough blood to initiate the Dark Communion with [target].</span>")
|
||||
useLock = FALSE
|
||||
return
|
||||
bloodsuckerdatum.AddBloodVolume(-convert_cost)
|
||||
target.add_mob_blood(user)
|
||||
user.visible_message("<span class='notice'>[user] marks a bloody smear on [target]'s forehead and puts a wrist up to [target.p_their()] mouth!</span>", \
|
||||
"<span class='notice'>You paint a bloody marking across [target]'s forehead, place your wrist to [target.p_their()] mouth, and subject [target.p_them()] to the Dark Communion.</span>")
|
||||
if(!do_mob(user, src, 50))
|
||||
to_chat(user, "<span class='danger'><i>The ritual has been interrupted!</i></span>")
|
||||
useLock = FALSE
|
||||
return
|
||||
// Convert to Vassal!
|
||||
if(bloodsuckerdatum && bloodsuckerdatum.attempt_turn_vassal(target))
|
||||
//remove_loyalties(target) // In case of Mindshield, or appropriate Antag (Traitor, Internal, etc)
|
||||
//if (!target.buckled)
|
||||
// to_chat(user, "<span class='danger'><i>The ritual has been interrupted!</i></span>")
|
||||
// useLock = FALSE
|
||||
// return
|
||||
user.playsound_local(null, 'sound/effects/explosion_distant.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head.
|
||||
target.playsound_local(null, 'sound/effects/explosion_distant.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head.
|
||||
target.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head.
|
||||
target.Jitter(25)
|
||||
target.emote("laugh")
|
||||
//remove_victim(target) // Remove on CLICK ONLY!
|
||||
useLock = FALSE
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/do_torture(mob/living/user, mob/living/target, mult=1)
|
||||
var/torture_time = 15 // Fifteen seconds if you aren't using anything. Shorter with weapons and such.
|
||||
var/torture_dmg_brute = 2
|
||||
var/torture_dmg_burn = 0
|
||||
// Get Bodypart
|
||||
var/target_string = ""
|
||||
var/obj/item/bodypart/BP = null
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
BP = pick(C.bodyparts)
|
||||
if(BP)
|
||||
target_string += BP.name
|
||||
// Get Weapon
|
||||
var/obj/item/I = user.get_active_held_item()
|
||||
if(!istype(I))
|
||||
I = user.get_inactive_held_item()
|
||||
// Create Strings
|
||||
var/method_string = I?.attack_verb?.len ? pick(I.attack_verb) : pick("harmed","tortured","wrenched","twisted","scoured","beaten","lashed","scathed")
|
||||
var/weapon_string = I ? I.name : pick("bare hands","hands","fingers","fists")
|
||||
// Weapon Bonus + SFX
|
||||
if(I)
|
||||
torture_time -= I.force / 4
|
||||
torture_dmg_brute += I.force / 4
|
||||
//torture_dmg_burn += I.
|
||||
if(I.sharpness == IS_SHARP)
|
||||
torture_time -= 1
|
||||
else if(I.sharpness == IS_SHARP_ACCURATE)
|
||||
torture_time -= 2
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/welder = I
|
||||
welder.welding = TRUE
|
||||
torture_time -= 5
|
||||
torture_dmg_burn += 5
|
||||
I.play_tool_sound(target)
|
||||
torture_time = max(50, torture_time * 10) // Minimum 5 seconds.
|
||||
// Now run process.
|
||||
if(!do_mob(user, target, torture_time * mult))
|
||||
return FALSE
|
||||
// SUCCESS
|
||||
if(I)
|
||||
playsound(loc, I.hitsound, 30, 1, -1)
|
||||
I.play_tool_sound(target)
|
||||
target.visible_message("<span class='danger'>[user] has [method_string] [target]'s [target_string] with [user.p_their()] [weapon_string]!</span>", \
|
||||
"<span class='userdanger'>[user] has [method_string] your [target_string] with [user.p_their()] [weapon_string]!</span>")
|
||||
if(!target.is_muzzled())
|
||||
target.emote("scream")
|
||||
target.Jitter(5)
|
||||
target.apply_damages(brute = torture_dmg_brute, burn = torture_dmg_burn, def_zone = (BP ? BP.body_zone : null)) // take_overall_damage(6,0)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/do_disloyalty(mob/living/user, mob/living/target)
|
||||
|
||||
// OFFER YES/NO NOW!
|
||||
spawn(10)
|
||||
if(useLock && target && target.client) // Are we still torturing? Did we cancel? Are they still here?
|
||||
to_chat(user, "<span class='notice'>[target] has been given the opportunity for servitude. You await their decision...</span>")
|
||||
var/alert_text = "You are being tortured! Do you want to give in and pledge your undying loyalty to [user]?"
|
||||
/* if(HAS_TRAIT(target, TRAIT_MINDSHIELD))
|
||||
alert_text += "\n\nYou will no longer be loyal to the station!"
|
||||
if(SSticker.mode.AmValidAntag(target.mind)) */
|
||||
alert_text += "\n\nYou will not lose your current objectives, but they come second to the will of your new master!"
|
||||
switch(alert(target, alert_text,"THE HORRIBLE PAIN! WHEN WILL IT END?!","Yes, Master!", "NEVER!"))
|
||||
if("Yes, Master!")
|
||||
disloyalty_accept(target)
|
||||
else
|
||||
disloyalty_refuse(target)
|
||||
if(!do_torture(user,target, 2))
|
||||
return FALSE
|
||||
|
||||
// NOTE: We only remove loyalties when we're CONVERTED!
|
||||
return TRUE
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/RequireDisloyalty(mob/living/target)
|
||||
return SSticker.mode.AmValidAntag(target.mind) //|| HAS_TRAIT(target, TRAIT_MINDSHIELD)
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/disloyalty_accept(mob/living/target)
|
||||
// FAILSAFE: Still on the rack?
|
||||
if(!(locate(target) in buckled_mobs))
|
||||
return
|
||||
// NOTE: You can say YES after torture. It'll apply to next time.
|
||||
disloyalty_confirm = TRUE
|
||||
/*if(HAS_TRAIT(target, TRAIT_MINDSHIELD))
|
||||
to_chat(target, "<span class='boldnotice'>You give in to the will of your torturer. If they are successful, you will no longer be loyal to the station!</span>")
|
||||
*/
|
||||
/obj/structure/bloodsucker/vassalrack/proc/disloyalty_refuse(mob/living/target)
|
||||
// FAILSAFE: Still on the rack?
|
||||
if(!(locate(target) in buckled_mobs))
|
||||
return
|
||||
// Failsafe: You already said YES.
|
||||
if(disloyalty_confirm)
|
||||
return
|
||||
to_chat(target, "<span class='notice'>You refuse to give in! You <i>will not</i> break!</span>")
|
||||
|
||||
|
||||
/obj/structure/bloodsucker/vassalrack/proc/remove_loyalties(mob/living/target)
|
||||
// Find Mind Implant & Destroy
|
||||
if(HAS_TRAIT(target, TRAIT_MINDSHIELD))
|
||||
for(var/obj/item/implant/I in target.implants)
|
||||
if(I.type == /obj/item/implant/mindshield)
|
||||
I.removed(target,silent=TRUE)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum
|
||||
name = "candelabrum"
|
||||
desc = "It burns slowly, but doesn't radiate any heat."
|
||||
icon = 'icons/obj/vamp_obj.dmi'
|
||||
icon_state = "candelabrum"
|
||||
light_color = "#66FFFF"//LIGHT_COLOR_BLUEGREEN // lighting.dm
|
||||
light_power = 3
|
||||
light_range = 0 // to 2
|
||||
density = FALSE
|
||||
anchored = FALSE
|
||||
var/lit = FALSE
|
||||
///obj/structure/bloodsucker/candelabrum/is_hot() // candle.dm
|
||||
//return FALSE
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/update_icon()
|
||||
icon_state = "candelabrum[lit ? "_lit" : ""]"
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/examine(mob/user)
|
||||
. = ..()
|
||||
if((user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) || isobserver(user))
|
||||
. += {"<span class='cult'>This is a magical candle which drains at the sanity of mortals who are not under your command while it is active.</span>"}
|
||||
. += {"<span class='cult'>You can alt click on it from any range to turn it on remotely, or simply be next to it and click on it to turn it on and off normally.</span>"}
|
||||
/* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
. += {"<span class='cult'>This is a magical candle which drains at the sanity of the fools who havent yet accepted your master, as long as it is active.\n
|
||||
You can turn it on and off by clicking on it while you are next to it</span>"} */
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/attack_hand(mob/user)
|
||||
var/datum/antagonist/bloodsucker/V = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) //I wish there was a better way to do this
|
||||
var/datum/antagonist/vassal/T = user.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
if(istype(V) || istype(T))
|
||||
toggle()
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/AltClick(mob/user)
|
||||
var/datum/antagonist/bloodsucker/V = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
// Bloodsuckers can turn their candles on from a distance. SPOOOOKY.
|
||||
if(istype(V))
|
||||
toggle()
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/proc/toggle(mob/user)
|
||||
lit = !lit
|
||||
if(lit)
|
||||
set_light(2, 3, "#66FFFF")
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
set_light(0)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bloodsucker/candelabrum/process()
|
||||
if(lit)
|
||||
for(var/mob/living/carbon/human/H in viewers(7, src))
|
||||
var/datum/antagonist/vassal/T = H.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
|
||||
var/datum/antagonist/bloodsucker/V = H.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if(V || T) //We dont want vassals or vampires affected by this
|
||||
return
|
||||
H.hallucination = 20
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "vampcandle", /datum/mood_event/vampcandle)
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// OTHER THINGS TO USE: HUMAN BLOOD. /obj/effect/decal/cleanable/blood
|
||||
|
||||
/obj/item/restraints/legcuffs/beartrap/bloodsucker
|
||||
@@ -1,85 +0,0 @@
|
||||
|
||||
|
||||
// Created by claiming a Coffin.
|
||||
|
||||
|
||||
|
||||
// THINGS TO SPAWN:
|
||||
//
|
||||
// /obj/effect/decal/cleanable/cobweb && /obj/effect/decal/cleanable/cobweb/cobweb2
|
||||
// /obj/effect/decal/cleanable/generic
|
||||
// /obj/effect/decal/cleanable/dirt/dust <-- Pretty cool, just stains the tile itself.
|
||||
// /obj/effect/decal/cleanable/blood/old
|
||||
|
||||
/*
|
||||
/area/
|
||||
// All coffins assigned to this area
|
||||
var/list/obj/structure/closet/crate/laircoffins = new list()
|
||||
// Called by Coffin when an area is claimed as a vamp's lair
|
||||
/area/proc/ClaimAsLair(/obj/structure/closet/crate/inClaimant)
|
||||
set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side.
|
||||
laircoffins += laircoffins
|
||||
sleep()
|
||||
// Cancel!
|
||||
if (laircoffins.len == 0)
|
||||
return
|
||||
*/
|
||||
|
||||
/datum/antagonist/bloodsucker/proc/RunLair()
|
||||
set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side.
|
||||
while(!AmFinalDeath() && coffin && lair)
|
||||
// WAit 2 min and Repeat
|
||||
sleep(120)
|
||||
// Coffin Moved SOMEHOW?
|
||||
if(lair != get_area(coffin))
|
||||
if(coffin)
|
||||
coffin.UnclaimCoffin()
|
||||
//lair = get_area(coffin)
|
||||
break // DONE
|
||||
var/list/turf/area_turfs = get_area_turfs(lair)
|
||||
// Create Dirt etc.
|
||||
var/turf/T_Dirty = pick(area_turfs)
|
||||
if(T_Dirty && !T_Dirty.density)
|
||||
// Default: Dirt
|
||||
// CHECK: Cobweb already there?
|
||||
//if (!locate(var/obj/effect/decal/cleanable/cobweb) in T_Dirty) // REMOVED! Cleanables don't stack.
|
||||
// STEP ONE: COBWEBS
|
||||
// CHECK: Wall to North?
|
||||
var/turf/check_N = get_step(T_Dirty, NORTH)
|
||||
if(istype(check_N, /turf/closed/wall))
|
||||
// CHECK: Wall to West?
|
||||
var/turf/check_W = get_step(T_Dirty, WEST)
|
||||
if(istype(check_W, /turf/closed/wall))
|
||||
new /obj/effect/decal/cleanable/cobweb (T_Dirty)
|
||||
// CHECK: Wall to East?
|
||||
var/turf/check_E = get_step(T_Dirty, EAST)
|
||||
if(istype(check_E, /turf/closed/wall))
|
||||
new /obj/effect/decal/cleanable/cobweb/cobweb2 (T_Dirty)
|
||||
// STEP TWO: DIRT
|
||||
new /obj/effect/decal/cleanable/dirt (T_Dirty)
|
||||
// Find Animals in Area
|
||||
/* if(rand(0,2) == 0)
|
||||
var/mobCount = 0
|
||||
var/mobMax = CLAMP(area_turfs.len / 25, 1, 4)
|
||||
for (var/turf/T in area_turfs)
|
||||
if(!T) continue
|
||||
var/mob/living/simple_animal/SA = locate() in T
|
||||
if(SA)
|
||||
mobCount ++
|
||||
if (mobCount >= mobMax) // Already at max
|
||||
break
|
||||
Spawn One
|
||||
if(mobCount < mobMax)
|
||||
Seek Out Location
|
||||
while(area_turfs.len > 0)
|
||||
var/turf/T = pick(area_turfs) // We use while&pick instead of a for/loop so it's random, rather than from the top of the list.
|
||||
if(T && !T.density)
|
||||
var/mob/living/simple_animal/SA = /mob/living/simple_animal/mouse // pick(/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse, /mob/living/simple_animal/hostile/retaliate/bat) //prob(300) /mob/living/simple_animal/mouse,
|
||||
new SA (T)
|
||||
break
|
||||
area_turfs -= T*/
|
||||
// NOTE: area_turfs is now cleared out!
|
||||
if(coffin)
|
||||
coffin.UnclaimCoffin()
|
||||
// Done (somehow)
|
||||
lair = null
|
||||
@@ -1,174 +0,0 @@
|
||||
|
||||
|
||||
/datum/action/bloodsucker/targeted/brawn
|
||||
name = "Brawn"//"Cellular Emporium"
|
||||
desc = "Snap restraints with ease, or deal terrible damage with your bare hands."
|
||||
button_icon_state = "power_strength"
|
||||
bloodcost = 10
|
||||
cooldown = 130
|
||||
target_range = 1
|
||||
power_activates_immediately = TRUE
|
||||
message_Trigger = ""//"Whom will you subvert to your will?"
|
||||
must_be_capacitated = TRUE
|
||||
can_be_immobilized = TRUE
|
||||
bloodsucker_can_buy = TRUE
|
||||
// Level Up
|
||||
var/upgrade_canLocker = FALSE
|
||||
var/upgrade_canDoor = FALSE
|
||||
|
||||
/datum/action/bloodsucker/targeted/brawn/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
. = TRUE
|
||||
// Break Out of Restraints! (And then cancel)
|
||||
if(CheckBreakRestraints())
|
||||
//PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!DEACTIVATE!
|
||||
. = FALSE //return FALSE
|
||||
// Throw Off Attacker! (And then cancel)
|
||||
if(CheckEscapePuller())
|
||||
//PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!DEACTIVATE!
|
||||
. = FALSE //return FALSE
|
||||
/*if(CheckBreakLocker())
|
||||
.= FALSE */
|
||||
// Did we successfuly use power to BREAK CUFFS and/or ESCAPE PULLER and/or escape from a locker?
|
||||
// Then PAY COST!
|
||||
if(. == FALSE)
|
||||
PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!DEACTIVATE!
|
||||
|
||||
// NOTE: We use . = FALSE so that we can break cuffs AND throw off our attacker in one use!
|
||||
//return TRUE
|
||||
/datum/action/bloodsucker/targeted/brawn/CheckValidTarget(atom/A)
|
||||
return isliving(A) || istype(A, /obj/machinery/door)
|
||||
|
||||
/datum/action/bloodsucker/targeted/brawn/CheckCanTarget(atom/A, display_error)
|
||||
// DEFAULT CHECKS (Distance)
|
||||
if(!..()) // Disable range notice for Brawn.
|
||||
return FALSE
|
||||
// Must outside Closet to target anyone!
|
||||
if(!isturf(owner.loc))
|
||||
return FALSE
|
||||
// Check: Self
|
||||
if(A == owner)
|
||||
return FALSE
|
||||
// Target Type: Living
|
||||
if(isliving(A))
|
||||
return TRUE
|
||||
// Target Type: Door
|
||||
else if(istype(A, /obj/machinery/door))
|
||||
return TRUE
|
||||
return ..() // yes, FALSE! You failed if you got here! BAD TARGET
|
||||
|
||||
/datum/action/bloodsucker/targeted/brawn/FireTargetedPower(atom/A)
|
||||
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
|
||||
var/mob/living/carbon/target = A
|
||||
var/mob/living/user = owner
|
||||
// Target Type: Mob
|
||||
if(isliving(target))
|
||||
var/mob/living/carbon/user_C = user
|
||||
var/hitStrength = user_C.dna.species.punchdamagehigh * 2.0 + 5
|
||||
// Knockdown!
|
||||
var/powerlevel = min(5, 1 + level_current)
|
||||
target.visible_message("<span class='danger'>[user] lands a vicious punch, sending [target] away!</span>", \
|
||||
"<span class='userdanger'>[user] has landed a horrifying punch on you, sending you flying!!</span>", null, COMBAT_MESSAGE_RANGE)
|
||||
if(rand(0, 5 + powerlevel) >= 5)
|
||||
target.Knockdown(min(5, rand(10, 10 * powerlevel)) )
|
||||
// Chance of KO
|
||||
if(rand(0, 6 + powerlevel) >= 6 && target.stat <= UNCONSCIOUS)
|
||||
target.Unconscious(40)
|
||||
// Attack!
|
||||
playsound(get_turf(target), 'sound/weapons/punch4.ogg', 60, 1, -1)
|
||||
user.do_attack_animation(target, ATTACK_EFFECT_SMASH)
|
||||
var/obj/item/bodypart/affecting = target.get_bodypart(ran_zone(target.zone_selected))
|
||||
target.apply_damage(hitStrength, BRUTE, affecting)
|
||||
// Knockback
|
||||
var/send_dir = get_dir(owner, target)
|
||||
var/turf/T = get_ranged_target_turf(target, send_dir, powerlevel)
|
||||
owner.newtonian_move(send_dir) // Bounce back in 0 G
|
||||
target.throw_at(T, powerlevel, TRUE, owner) //new /datum/forced_movement(target, get_ranged_target_turf(target, send_dir, (hitStrength / 4)), 1, FALSE)
|
||||
// Target Type: Door
|
||||
else if(istype(target, /obj/machinery/door))
|
||||
var/obj/machinery/door/D = target
|
||||
playsound(get_turf(usr), 'sound/machines/airlock_alien_prying.ogg', 40, 1, -1)
|
||||
to_chat(user, "<span class='notice'>You prepare to tear open [D].</span>")
|
||||
if(do_mob(usr,target,25))
|
||||
if (D.Adjacent(user))
|
||||
to_chat(user, "<span class='notice'>You tear open the [D].</span>")
|
||||
user.Stun(10)
|
||||
user.do_attack_animation(D, ATTACK_EFFECT_SMASH)
|
||||
playsound(get_turf(D), 'sound/effects/bang.ogg', 30, 1, -1)
|
||||
D.open(2) // open(2) is like a crowbar or jaws of life.
|
||||
// Target Type: Closet
|
||||
|
||||
/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakRestraints()
|
||||
if(!iscarbon(owner)) // || !owner.restrained()
|
||||
return FALSE
|
||||
// (NOTE: Just like biodegrade.dm, we only remove one thing per use //
|
||||
// Destroy Cuffs
|
||||
var/mob/living/carbon/user_C = owner
|
||||
//message_admins("DEBUG3: attempt_cast() [name] / [user_C.handcuffed] ")
|
||||
if(user_C.handcuffed)
|
||||
var/obj/O = user_C.get_item_by_slot(SLOT_HANDCUFFED)
|
||||
if(istype(O))
|
||||
//user_C.visible_message("<span class='warning'>[user_C] attempts to remove [O]!</span>",
|
||||
// "<span class='warning'>You snap [O] like it's nothing!</span>")
|
||||
user_C.clear_cuffs(O,TRUE)
|
||||
playsound(get_turf(usr), 'sound/effects/grillehit.ogg', 80, 1, -1)
|
||||
return TRUE
|
||||
/* Doesnt work
|
||||
// Destroy Straightjacket
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/user_H = owner
|
||||
if(user_H.wear_suit && user_H.wear_suit.breakouttime)
|
||||
var/obj/item/clothing/suit/straight_jacket/S = user_H.get_item_by_slot(ITEM_SLOT_ICLOTHING)
|
||||
if(istype(S))
|
||||
user_C.visible_message("<span class='warning'>[user_C] attempts to remove [S]!</span>",
|
||||
"<span class='warning'>You rip through [S] like it's nothing!</span>")
|
||||
user_C.clear_cuffs(S,TRUE)
|
||||
playsound(get_turf(usr), 'sound/effects/grillehit.ogg', 80, 1, -1)
|
||||
return TRUE */
|
||||
// Destroy Leg Cuffs
|
||||
if(user_C.legcuffed)
|
||||
var/obj/O = user_C.get_item_by_slot(SLOT_LEGCUFFED)
|
||||
if(istype(O))
|
||||
//user_C.visible_message("<span class='warning'>[user_C] attempts to remove [O]!</span>",
|
||||
// "<span class='warning'>You snap [O] like it's nothing!</span>")
|
||||
user_C.clear_cuffs(O,TRUE)
|
||||
playsound(get_turf(usr), 'sound/effects/grillehit.ogg', 80, 1, -1)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/action/bloodsucker/targeted/brawn/proc/CheckEscapePuller()
|
||||
if(!owner.pulledby)// || owner.pulledby.grab_state <= GRAB_PASSIVE)
|
||||
return FALSE
|
||||
var/mob/M = owner.pulledby
|
||||
var/pull_power = M.grab_state
|
||||
playsound(get_turf(M), 'sound/effects/woodhit.ogg', 75, 1, -1)
|
||||
// Knock Down (if Living)
|
||||
if (isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.Knockdown(pull_power * 10 + 20)
|
||||
// Knock Back (before Knockdown, which probably cancels pull)
|
||||
var/send_dir = get_dir(owner, M)
|
||||
var/turf/T = get_ranged_target_turf(M, send_dir, pull_power)
|
||||
owner.newtonian_move(send_dir) // Bounce back in 0 G
|
||||
M.throw_at(T, pull_power, TRUE, owner, FALSE) // Throw distance based on grab state! Harder grabs punished more aggressively.
|
||||
// /proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null)
|
||||
log_combat(owner, M, "used Brawn power")
|
||||
owner.visible_message("<span class='warning'>[owner] tears free of [M]'s grasp!</span>", \
|
||||
"<span class='warning'>You shrug off [M]'s grasp!</span>")
|
||||
owner.pulledby = null // It's already done, but JUST IN CASE.
|
||||
return TRUE
|
||||
/* Doesnt work
|
||||
/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakLocker()
|
||||
if(!istype(owner.loc, /obj/structure/closet))
|
||||
return FALSE
|
||||
playsound(get_turf(owner), 'sound/machines/airlock_alien_prying.ogg', 40, 1, -1)
|
||||
if(do_mob(owner ,target, 25))
|
||||
var/obj/structure/closet/C = owner.loc
|
||||
to_chat(owner, "<span class='notice'>You prepare to tear open the [C].</span>")
|
||||
owner.do_attack_animation(C, ATTACK_EFFECT_SMASH)
|
||||
playsound(get_turf(C), 'sound/effects/bang.ogg', 30, 1, -1)
|
||||
C.bust_open()
|
||||
return TRUE
|
||||
*/
|
||||
@@ -1,72 +0,0 @@
|
||||
|
||||
/datum/action/bloodsucker/cloak
|
||||
name = "Cloak of Darkness"
|
||||
desc = "Blend into the shadows and become invisible to the untrained eye. Movement is slowed in lightly lit areas."
|
||||
button_icon_state = "power_cloak"
|
||||
bloodcost = 5
|
||||
cooldown = 50
|
||||
bloodsucker_can_buy = TRUE
|
||||
amToggle = TRUE
|
||||
warn_constant_cost = TRUE
|
||||
var/was_running
|
||||
|
||||
var/moveintent_was_run
|
||||
var/walk_threshold = 0.4 // arbitrary number, to be changed. edit in last commit: this is fine after testing on box station for a bit
|
||||
var/lum
|
||||
|
||||
/datum/action/bloodsucker/cloak/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
// Must have nobody around to see the cloak
|
||||
var/watchers = viewers(9,get_turf(owner))
|
||||
for(var/mob/living/M in watchers)
|
||||
if(M != owner)
|
||||
to_chat(owner, "<span class='warning'>You may only vanish into the shadows unseen.</span>")
|
||||
return FALSE
|
||||
|
||||
/datum/action/bloodsucker/cloak/ActivatePower()
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
var/mob/living/user = owner
|
||||
|
||||
while(bloodsuckerdatum && ContinueActive(user) || user.m_intent == MOVE_INTENT_RUN)
|
||||
// Pay Blood Toll (if awake)
|
||||
owner.alpha = max(20, owner.alpha - min(75, 20 + 15 * level_current))
|
||||
bloodsuckerdatum.AddBloodVolume(-0.2)
|
||||
|
||||
moveintent_was_run = (user.m_intent == MOVE_INTENT_RUN)
|
||||
var/turf/T = get_turf(user)
|
||||
lum = T.get_lumcount()
|
||||
|
||||
if(istype(owner.loc))
|
||||
if(lum > walk_threshold)
|
||||
if(moveintent_was_run)
|
||||
user.toggle_move_intent()
|
||||
ADD_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
|
||||
|
||||
if(lum < walk_threshold)
|
||||
if(!moveintent_was_run)
|
||||
user.toggle_move_intent()
|
||||
REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
|
||||
|
||||
sleep(5) // Check every few ticks
|
||||
|
||||
// Return to Running (if you were before)
|
||||
if(was_running && user.m_intent != MOVE_INTENT_RUN)
|
||||
user.toggle_move_intent()
|
||||
|
||||
/datum/action/bloodsucker/cloak/ContinueActive(mob/living/user, mob/living/target)
|
||||
if (!..())
|
||||
return FALSE
|
||||
if(user.stat == !CONSCIOUS) // Must be CONSCIOUS
|
||||
to_chat(owner, "<span class='warning'>Your cloak failed due to you falling unconcious! </span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/cloak/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..()
|
||||
REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
|
||||
user.alpha = 255
|
||||
|
||||
if(moveintent_was_run)
|
||||
user.toggle_move_intent()
|
||||
@@ -1,324 +0,0 @@
|
||||
|
||||
|
||||
/datum/action/bloodsucker/feed
|
||||
name = "Feed"
|
||||
desc = "Draw the heartsblood of living victims in your grasp.<br><b>None/Passive:</b> Feed silently and unnoticed by your victim.<br><b>Aggressive: </b>Subdue your target quickly."
|
||||
button_icon_state = "power_feed"
|
||||
|
||||
bloodcost = 0
|
||||
cooldown = 30
|
||||
amToggle = TRUE
|
||||
bloodsucker_can_buy = TRUE
|
||||
can_be_staked = TRUE
|
||||
cooldown_static = TRUE
|
||||
|
||||
var/notice_range = 2 // Distance before silent feeding is noticed.
|
||||
var/mob/living/feed_target // So we can validate more than just the guy we're grappling.
|
||||
var/target_grappled = FALSE // If you started grappled, then ending it will end your Feed.
|
||||
|
||||
/datum/action/bloodsucker/feed/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
// Wearing mask
|
||||
var/mob/living/L = owner
|
||||
if (L.is_mouth_covered())
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You cannot feed with your mouth covered! Remove your mask.</span>")
|
||||
return FALSE
|
||||
// Find my Target!
|
||||
if (!FindMyTarget(display_error)) // Sets feed_target within after Validating
|
||||
return FALSE
|
||||
// Not in correct state
|
||||
// DONE!
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/feed/proc/ValidateTarget(mob/living/target, display_error) // Called twice: validating a subtle victim, or validating your grapple victim.
|
||||
// Bloodsuckers + Animals MUST be grabbed aggressively!
|
||||
if (!owner.pulling || target == owner.pulling && owner.grab_state < GRAB_AGGRESSIVE)
|
||||
// NOTE: It's OKAY that we are checking if(!target) below, AFTER animals here. We want passive check vs animal to warn you first, THEN the standard warning.
|
||||
// Animals:
|
||||
if (isliving(target) && !iscarbon(target))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Lesser beings require a tighter grip.</span>")
|
||||
return FALSE
|
||||
// Bloodsuckers:
|
||||
else if (iscarbon(target) && target.mind && target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Other Bloodsuckers will not fall for your subtle approach.</span>")
|
||||
return FALSE
|
||||
// Must have Target
|
||||
if (!target) // || !ismob(target)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You must be next to or grabbing a victim to feed from them.</span>")
|
||||
return FALSE
|
||||
// Not even living!
|
||||
if (!isliving(target) || issilicon(target))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You may only feed from living beings.</span>")
|
||||
return FALSE
|
||||
if (target.blood_volume <= 0)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your victim has no blood to take.</span>")
|
||||
return FALSE
|
||||
if (ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(NOBLOOD in H.dna.species.species_traits)// || owner.get_blood_id() != target.get_blood_id())
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your victim's blood is not suitable for you to take.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
// If I'm not grabbing someone, find me someone nearby.
|
||||
/datum/action/bloodsucker/feed/proc/FindMyTarget(display_error)
|
||||
// Default
|
||||
feed_target = null
|
||||
target_grappled = FALSE
|
||||
// If you are pulling a mob, that's your target. If you don't like it, then release them.
|
||||
if (owner.pulling && ismob(owner.pulling))
|
||||
// Check grapple target Valid
|
||||
if (!ValidateTarget(owner.pulling, display_error)) // Grabbed targets display error.
|
||||
return FALSE
|
||||
target_grappled = TRUE
|
||||
feed_target = owner.pulling
|
||||
return TRUE
|
||||
// Find Targets
|
||||
var/list/mob/living/seen_targets = view(1, owner)
|
||||
var/list/mob/living/seen_mobs = list()
|
||||
for(var/mob/living/M in seen_targets)
|
||||
if (isliving(M) && M != owner)
|
||||
seen_mobs += M
|
||||
// None Seen!
|
||||
if (seen_mobs.len == 0)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You must be next to or grabbing a victim to feed from them.</span>")
|
||||
return FALSE
|
||||
// Check Valids...
|
||||
var/list/targets_valid = list()
|
||||
var/list/targets_dead = list()
|
||||
for(var/mob/living/M in seen_mobs)
|
||||
// Check adjecent Valid target
|
||||
if (M != owner && ValidateTarget(M, display_error = FALSE)) // Do NOT display errors. We'll be doing this again in CheckCanUse(), which will rule out grabbed targets.
|
||||
// Prioritize living, but remember dead as backup
|
||||
if (M.stat < DEAD)
|
||||
targets_valid += M
|
||||
else
|
||||
targets_dead += M
|
||||
// No Living? Try dead.
|
||||
if (targets_valid.len == 0 && targets_dead.len > 0)
|
||||
targets_valid = targets_dead
|
||||
// No Targets
|
||||
if (targets_valid.len == 0)
|
||||
// Did I see targets? Then display at least one error
|
||||
if (seen_mobs.len > 1)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>None of these are valid targets to feed from subtly.</span>")
|
||||
else
|
||||
ValidateTarget(seen_mobs[1], display_error)
|
||||
return FALSE
|
||||
// Too Many Targets
|
||||
//else if (targets.len > 1)
|
||||
// if (display_error)
|
||||
// to_chat(owner, "<span class='warning'>You are adjecent to too many witnesses. Either grab your victim or move away.</span>")
|
||||
// return FALSE
|
||||
// One Target!
|
||||
else
|
||||
feed_target = pick(targets_valid)//targets[1]
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/feed/ActivatePower()
|
||||
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up Activate(), so Deactivate() can happen after.
|
||||
var/mob/living/target = feed_target // Stored during CheckCanUse(). Can be a grabbed OR adjecent character.
|
||||
var/mob/living/user = owner
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
// Am I SECRET or LOUD? It stays this way the whole time! I must END IT to try it the other way.
|
||||
var/amSilent = (!target_grappled || owner.grab_state <= GRAB_PASSIVE) // && iscarbon(target) // Non-carbons (animals) not passive. They go straight into aggressive.
|
||||
// Initial Wait
|
||||
var/feed_time = (amSilent ? 45 : 25) - (2.5 * level_current)
|
||||
feed_time = max(15, feed_time)
|
||||
if (amSilent)
|
||||
to_chat(user, "<span class='notice'>You lean quietly toward [target] and secretly draw out your fangs...</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You pull [target] close to you and draw out your fangs...</span>")
|
||||
if (!do_mob(user, target, feed_time,0,1,extra_checks=CALLBACK(src, .proc/ContinueActive, user, target)))//sleep(10)
|
||||
to_chat(user, "<span class='warning'>Your feeding was interrupted.</span>")
|
||||
//DeactivatePower(user,target)
|
||||
return
|
||||
// Put target to Sleep (Bloodsuckers are immune to their own bite's sleep effect)
|
||||
if (!amSilent)
|
||||
ApplyVictimEffects(target) // Sleep, paralysis, immobile, unconscious, and mute
|
||||
if(target.stat <= UNCONSCIOUS)
|
||||
sleep(1)
|
||||
// Wait, then Cancel if Invalid
|
||||
if (!ContinueActive(user,target)) // Cancel. They're gone.
|
||||
//DeactivatePower(user,target)
|
||||
return
|
||||
// Pull Target Close
|
||||
if (!target.density) // Pull target to you if they don't take up space.
|
||||
target.Move(user.loc)
|
||||
// Broadcast Message
|
||||
if (amSilent)
|
||||
//if (!iscarbon(target))
|
||||
// user.visible_message("<span class='notice'>[user] shifts [target] closer to [user.p_their()] mouth.</span>",
|
||||
// "<span class='notice'>You secretly slip your fangs into [target]'s flesh.</span>",
|
||||
// vision_distance = 2, ignored_mobs=target) // Only people who AREN'T the target will notice this action.
|
||||
//else
|
||||
var/deadmessage = target.stat == DEAD ? "" : " <i>[target.p_they(TRUE)] looks dazed, and will not remember this.</i>"
|
||||
user.visible_message("<span class='notice'>[user] puts [target]'s wrist up to [user.p_their()] mouth.</span>", \
|
||||
"<span class='notice'>You secretly slip your fangs into [target]'s wrist.[deadmessage]</span>", \
|
||||
vision_distance = notice_range, ignored_mobs=target) // Only people who AREN'T the target will notice this action.
|
||||
// Warn Feeder about Witnesses...
|
||||
var/was_unnoticed = TRUE
|
||||
for(var/mob/living/M in viewers(notice_range, owner))
|
||||
if(M != owner && M != target && iscarbon(M) && M.mind && !M.has_unlimited_silicon_privilege && !M.eye_blind && !M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
was_unnoticed = FALSE
|
||||
break
|
||||
if (was_unnoticed)
|
||||
to_chat(user, "<span class='notice'>You think no one saw you...</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Someone may have noticed...</span>")
|
||||
|
||||
else // /atom/proc/visible_message(message, self_message, blind_message, vision_distance, ignored_mobs)
|
||||
user.visible_message("<span class='warning'>[user] closes [user.p_their()] mouth around [target]'s neck!</span>", \
|
||||
"<span class='warning'>You sink your fangs into [target]'s neck.</span>")
|
||||
// My mouth is full!
|
||||
ADD_TRAIT(user, TRAIT_MUTE, "bloodsucker_feed")
|
||||
|
||||
// Begin Feed Loop
|
||||
var/warning_target_inhuman = FALSE
|
||||
var/warning_target_dead = FALSE
|
||||
var/warning_full = FALSE
|
||||
var/warning_target_bloodvol = 99999
|
||||
var/amount_taken = 0
|
||||
var/blood_take_mult = amSilent ? 0.3 : 1 // Quantity to take per tick, based on Silent or not.
|
||||
var/was_alive = target.stat < DEAD && ishuman(target)
|
||||
// Activate Effects
|
||||
//target.add_trait(TRAIT_MUTE, "bloodsucker_victim") // <----- Make mute a power you buy?
|
||||
|
||||
// FEEEEEEEEED!!! //
|
||||
bloodsuckerdatum.poweron_feed = TRUE
|
||||
while (bloodsuckerdatum && target && active)
|
||||
//user.mobility_flags &= ~MOBILITY_MOVE // user.canmove = 0 // Prevents spilling blood accidentally.
|
||||
|
||||
// Abort? A bloody mistake.
|
||||
if (!do_mob(user, target, 20, 0, 0, extra_checks=CALLBACK(src, .proc/ContinueActive, user, target)))
|
||||
// May have disabled Feed during do_mob
|
||||
if (!active || !ContinueActive(user, target))
|
||||
break
|
||||
|
||||
if (amSilent)
|
||||
to_chat(user, "<span class='warning'>Your feeding has been interrupted...but [target.p_they()] didn't seem to notice you.<span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Your feeding has been interrupted!</span>")
|
||||
user.visible_message("<span class='danger'>[user] is ripped from [target]'s throat. [target.p_their(TRUE)] blood sprays everywhere!</span>", \
|
||||
"<span class='userdanger'>Your teeth are ripped from [target]'s throat. [target.p_their(TRUE)] blood sprays everywhere!</span>")
|
||||
|
||||
// Deal Damage to Target (should have been more careful!)
|
||||
if (iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
C.bleed(15)
|
||||
playsound(get_turf(target), 'sound/effects/splat.ogg', 40, 1)
|
||||
if (ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.bleed_rate += 5
|
||||
target.add_splatter_floor(get_turf(target))
|
||||
user.add_mob_blood(target) // Put target's blood on us. The donor goes in the ( )
|
||||
target.add_mob_blood(target)
|
||||
target.take_overall_damage(10,0)
|
||||
target.emote("scream")
|
||||
|
||||
// Killed Target?
|
||||
if (was_alive)
|
||||
CheckKilledTarget(user,target)
|
||||
|
||||
return
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Handle Feeding! User & Victim Effects (per tick)
|
||||
bloodsuckerdatum.HandleFeeding(target, blood_take_mult)
|
||||
amount_taken += amSilent ? 0.3 : 1
|
||||
if (!amSilent)
|
||||
ApplyVictimEffects(target) // Sleep, paralysis, immobile, unconscious, and mute
|
||||
if (amount_taken > 5 && target.stat < DEAD && ishuman(target))
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood) // GOOD // in bloodsucker_life.dm
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Not Human?
|
||||
if (!ishuman(target))
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_bad) // BAD // in bloodsucker_life.dm
|
||||
if (!warning_target_inhuman)
|
||||
to_chat(user, "<span class='notice'>You recoil at the taste of a lesser lifeform.</span>")
|
||||
warning_target_inhuman = TRUE
|
||||
// Dead Blood?
|
||||
if (target.stat >= DEAD)
|
||||
if (ishuman(target))
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_dead) // BAD // in bloodsucker_life.dm
|
||||
if (!warning_target_dead)
|
||||
to_chat(user, "<span class='notice'>Your victim is dead. [target.p_their(TRUE)] blood barely nourishes you.</span>")
|
||||
warning_target_dead = TRUE
|
||||
// Full?
|
||||
if (!warning_full && user.blood_volume >= bloodsuckerdatum.maxBloodVolume)
|
||||
to_chat(user, "<span class='notice'>You are full. Further blood will be wasted.</span>")
|
||||
warning_full = TRUE
|
||||
// Blood Remaining? (Carbons/Humans only)
|
||||
if (iscarbon(target) && !target.AmBloodsucker(1))
|
||||
if (target.blood_volume <= BLOOD_VOLUME_BAD && warning_target_bloodvol > BLOOD_VOLUME_BAD)
|
||||
to_chat(user, "<span class='warning'>Your victim's blood volume is fatally low!</span>")
|
||||
else if (target.blood_volume <= BLOOD_VOLUME_OKAY && warning_target_bloodvol > BLOOD_VOLUME_OKAY)
|
||||
to_chat(user, "<span class='warning'>Your victim's blood volume is dangerously low.</span>")
|
||||
else if (target.blood_volume <= BLOOD_VOLUME_SAFE && warning_target_bloodvol > BLOOD_VOLUME_SAFE)
|
||||
to_chat(user, "<span class='notice'>Your victim's blood is at an unsafe level.</span>")
|
||||
warning_target_bloodvol = target.blood_volume // If we had a warning to give, it's been given by now.
|
||||
// Done?
|
||||
if (target.blood_volume <= 0)
|
||||
to_chat(user, "<span class='notice'>You have bled your victim dry.</span>")
|
||||
break
|
||||
|
||||
// Blood Gulp Sound
|
||||
owner.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head.
|
||||
|
||||
// DONE!
|
||||
//DeactivatePower(user,target)
|
||||
if (amSilent)
|
||||
to_chat(user, "<span class='notice'>You slowly release [target]'s wrist." + (target.stat == 0 ? " [target.p_their(TRUE)] face lacks expression, like you've already been forgotten.</span>" : ""))
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] unclenches their teeth from [target]'s neck.</span>", \
|
||||
"<span class='warning'>You retract your fangs and release [target] from your bite.</span>")
|
||||
|
||||
// /proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null)
|
||||
log_combat(owner, target, "fed on blood", addition="(and took [amount_taken] blood)")
|
||||
|
||||
// Killed Target?
|
||||
if (was_alive)
|
||||
CheckKilledTarget(user,target)
|
||||
|
||||
|
||||
/datum/action/bloodsucker/feed/proc/CheckKilledTarget(mob/living/user, mob/living/target)
|
||||
// Bad Vampire. You shouldn't do that.
|
||||
if (target && target.stat >= DEAD && ishuman(target))
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankkilled", /datum/mood_event/drankkilled) // BAD // in bloodsucker_life.dm
|
||||
|
||||
/datum/action/bloodsucker/feed/ContinueActive(mob/living/user, mob/living/target)
|
||||
return ..() && target && (!target_grappled || user.pulling == target)// Active, and still Antag,
|
||||
// NOTE: We only care about pulling if target started off that way. Mostly only important for Aggressive feed.
|
||||
|
||||
/datum/action/bloodsucker/feed/proc/ApplyVictimEffects(mob/living/target)
|
||||
// Bloodsuckers not affected by "the Kiss" of another vampire
|
||||
if (!target.mind || !target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
target.Unconscious(50,0)
|
||||
target.Knockdown(40 + 5 * level_current,1)
|
||||
// NOTE: THis is based on level of power!
|
||||
if (ishuman(target))
|
||||
target.adjustStaminaLoss(5, forced = TRUE)// Base Stamina Damage
|
||||
|
||||
/datum/action/bloodsucker/feed/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..() // activate = FALSE
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
// No longer Feeding
|
||||
if (bloodsuckerdatum)
|
||||
bloodsuckerdatum.poweron_feed = FALSE
|
||||
feed_target = null
|
||||
// My mouth is no longer full
|
||||
REMOVE_TRAIT(owner, TRAIT_MUTE, "bloodsucker_feed")
|
||||
// Let me move immediately
|
||||
user.update_canmove()
|
||||
@@ -1,54 +0,0 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/action/bloodsucker/fortitude
|
||||
name = "Fortitude"//"Cellular Emporium"
|
||||
desc = "Withstand egregious physical wounds and walk away from attacks that would stun, pierce, and dismember lesser beings. You cannot run while active."
|
||||
button_icon_state = "power_fortitude"
|
||||
bloodcost = 5
|
||||
cooldown = 80
|
||||
bloodsucker_can_buy = TRUE
|
||||
amToggle = TRUE
|
||||
warn_constant_cost = TRUE
|
||||
|
||||
var/this_resist // So we can raise and lower your brute resist based on what your level_current WAS.
|
||||
|
||||
/datum/action/bloodsucker/fortitude/ActivatePower()
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
var/mob/living/user = owner
|
||||
to_chat(user, "<span class='notice'>Your flesh, skin, and muscles become as steel.</span>")
|
||||
// Traits & Effects
|
||||
ADD_TRAIT(user, TRAIT_PIERCEIMMUNE, "fortitude")
|
||||
ADD_TRAIT(user, TRAIT_NODISMEMBER, "fortitude")
|
||||
ADD_TRAIT(user, TRAIT_STUNIMMUNE, "fortitude")
|
||||
ADD_TRAIT(user, TRAIT_NORUNNING, "fortitude")
|
||||
if (ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
this_resist = max(0.3, 0.7 - level_current * 0.1)
|
||||
H.physiology.brute_mod *= this_resist//0.5
|
||||
H.physiology.burn_mod *= this_resist//0.5
|
||||
// Stop Running (Taken from /datum/quirk/nyctophobia in negative.dm)
|
||||
var/was_running = (user.m_intent == MOVE_INTENT_RUN)
|
||||
if(was_running)
|
||||
user.toggle_move_intent()
|
||||
while(bloodsuckerdatum && ContinueActive(user) || user.m_intent == MOVE_INTENT_RUN)
|
||||
// Pay Blood Toll (if awake)
|
||||
if (user.stat == CONSCIOUS)
|
||||
bloodsuckerdatum.AddBloodVolume(-0.5) // Used to be 0.3 blood per 2 seconds, but we're making it more expensive to keep on.
|
||||
sleep(20) // Check every few ticks that we haven't disabled this power
|
||||
// Return to Running (if you were before)
|
||||
if(was_running && user.m_intent != MOVE_INTENT_RUN)
|
||||
user.toggle_move_intent()
|
||||
|
||||
/datum/action/bloodsucker/fortitude/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..()
|
||||
// Restore Traits & Effects
|
||||
REMOVE_TRAIT(user, TRAIT_PIERCEIMMUNE, "fortitude")
|
||||
REMOVE_TRAIT(user, TRAIT_NODISMEMBER, "fortitude")
|
||||
REMOVE_TRAIT(user, TRAIT_STUNIMMUNE, "fortitude")
|
||||
REMOVE_TRAIT(user, TRAIT_NORUNNING, "fortitude")
|
||||
if (ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H.physiology.brute_mod /= this_resist//0.5
|
||||
H.physiology.burn_mod /= this_resist//0.5
|
||||
@@ -1,115 +0,0 @@
|
||||
|
||||
|
||||
/datum/action/bloodsucker/gohome
|
||||
name = "Vanishing Act"
|
||||
desc = "As dawn aproaches, disperse into mist and return directly to your Lair.<br><b>WARNING:</b> You will drop <b>ALL</b> of your possessions if observed by mortals."
|
||||
button_icon_state = "power_gohome"
|
||||
background_icon_state_on = "vamp_power_off_oneshot" // Even though this never goes off.
|
||||
background_icon_state_off = "vamp_power_off_oneshot"
|
||||
|
||||
bloodcost = 25
|
||||
cooldown = 99999 // It'll never come back.
|
||||
amToggle = FALSE
|
||||
amSingleUse = TRUE
|
||||
|
||||
bloodsucker_can_buy = FALSE // You only get this if you've claimed a lair, and only just before sunrise.
|
||||
can_use_in_torpor = TRUE
|
||||
must_be_capacitated = TRUE
|
||||
can_be_immobilized = TRUE
|
||||
|
||||
/datum/action/bloodsucker/gohome/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
// Have No Lair (NOTE: You only got this power if you had a lair, so this means it's destroyed)
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
if (!istype(bloodsuckerdatum) || !bloodsuckerdatum.coffin)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your coffin has been destroyed!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/gohome/ActivatePower()
|
||||
var/mob/living/carbon/user = owner
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
// IMPORTANT: Check for lair at every step! It might get destroyed.
|
||||
to_chat(user, "<span class='notice'>You focus on separating your consciousness from your physical form...</span>")
|
||||
// STEP ONE: Flicker Lights
|
||||
for(var/obj/machinery/light/L in view(3, get_turf(owner))) // /obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
||||
L.flicker(5)
|
||||
playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 20, 1)
|
||||
sleep(50)
|
||||
for(var/obj/machinery/light/L in view(3, get_turf(owner))) // /obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
||||
L.flicker(5)
|
||||
playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 40, 1)
|
||||
sleep(50)
|
||||
for(var/obj/machinery/light/L in view(6, get_turf(owner))) // /obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
||||
L.flicker(5)
|
||||
playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 60, 1)
|
||||
// ( STEP TWO: Lights OFF? )
|
||||
// CHECK: Still have Coffin?
|
||||
if (!istype(bloodsuckerdatum) || !bloodsuckerdatum.coffin)
|
||||
to_chat(user, "<span class='warning'>Your coffin has been destroyed! You no longer have a destination.</span>")
|
||||
return FALSE
|
||||
if (!owner)
|
||||
return
|
||||
// SEEN?: (effects ONLY if there are witnesses! Otherwise you just POOF)
|
||||
// NOTE: Stolen directly from statue.dm, thanks guys!
|
||||
var/am_seen = FALSE // Do Effects (seen by anyone)
|
||||
var/drop_item = FALSE // Drop Stuff (seen by non-vamp)
|
||||
if (isturf(owner.loc)) // Only check if I'm not in a Locker or something.
|
||||
// A) Check for Darkness (we can just leave)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T && T.lighting_object && T.get_lumcount()>= 0.1)
|
||||
// B) Check for Viewers
|
||||
for(var/mob/living/M in viewers(owner))
|
||||
if(M != owner && isliving(M) && M.mind && !M.has_unlimited_silicon_privilege && !M.eye_blind) // M.client <--- add this in after testing!
|
||||
am_seen = TRUE
|
||||
if (!M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
drop_item = TRUE
|
||||
break
|
||||
// LOSE CUFFS
|
||||
if(user.handcuffed)
|
||||
var/obj/O = user.handcuffed
|
||||
user.dropItemToGround(O)
|
||||
if(user.legcuffed)
|
||||
var/obj/O = user.legcuffed
|
||||
user.dropItemToGround(O)
|
||||
// SEEN!
|
||||
if (drop_item)
|
||||
// DROP: Clothes, held items, and cuffs etc
|
||||
// NOTE: Taken from unequip_everything() in inventory.dm. We need to
|
||||
// *force* all items to drop, so we had to just gut the code out of it.
|
||||
var/list/items = list()
|
||||
items |= user.get_equipped_items()
|
||||
for(var/I in items)
|
||||
user.dropItemToGround(I,TRUE)
|
||||
for(var/obj/item/I in owner.held_items) // drop_all_held_items()
|
||||
user.dropItemToGround(I, TRUE)
|
||||
if (am_seen)
|
||||
// POOF EFFECTS
|
||||
playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1)
|
||||
var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/()
|
||||
puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke
|
||||
puff.set_up(3, 0, get_turf(owner))
|
||||
puff.start()
|
||||
// TELEPORT: Move to Coffin & Close it!
|
||||
do_teleport(owner, bloodsuckerdatum.coffin, no_effects = TRUE, forced = TRUE, channel = TELEPORT_CHANNEL_QUANTUM) // in teleport.dm?
|
||||
// SLEEP
|
||||
user.resting = TRUE
|
||||
//user.Unconscious(30,0)
|
||||
user.Stun(30,1)
|
||||
// CLOSE LID: If fail, force me in.
|
||||
if (!bloodsuckerdatum.coffin.close(owner))
|
||||
bloodsuckerdatum.coffin.insert(owner) // Puts me inside.
|
||||
// The following was taken from close() proc in closets.dm
|
||||
// (but we had to do it this way because there is no way to force entry)
|
||||
playsound(bloodsuckerdatum.coffin.loc, bloodsuckerdatum.coffin.close_sound, 15, 1, -3)
|
||||
bloodsuckerdatum.coffin.opened = FALSE
|
||||
bloodsuckerdatum.coffin.density = TRUE
|
||||
bloodsuckerdatum.coffin.update_icon()
|
||||
// Lock Coffin
|
||||
bloodsuckerdatum.coffin.LockMe(owner)
|
||||
// ( STEP FIVE: Create animal at prev location? )
|
||||
//var/mob/living/simple_animal/SA = /mob/living/simple_animal/hostile/retaliate/bat // pick(/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse, /mob/living/simple_animal/hostile/retaliate/bat) //prob(300) /mob/living/simple_animal/mouse,
|
||||
//new SA (owner.loc)
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
|
||||
// Level 1: Speed to location
|
||||
// Level 2: Dodge Bullets
|
||||
// Level 3: Stun People Passed
|
||||
|
||||
/datum/action/bloodsucker/targeted/haste
|
||||
name = "Immortal Haste"
|
||||
desc = "Dash somewhere with supernatural speed. Those nearby may be knocked away, stunned, or left empty-handed."
|
||||
button_icon_state = "power_speed"
|
||||
bloodcost = 6
|
||||
cooldown = 150
|
||||
target_range = 15
|
||||
power_activates_immediately = TRUE
|
||||
message_Trigger = ""//"Whom will you subvert to your will?"
|
||||
bloodsucker_can_buy = TRUE
|
||||
must_be_capacitated = TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/haste/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
// Being Grabbed
|
||||
if(owner.pulledby && owner.pulledby.grab_state >= GRAB_AGGRESSIVE)
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>You're being grabbed!</span>")
|
||||
return FALSE
|
||||
if(!owner.has_gravity(owner.loc)) //We dont want people to be able to use this to fly around in space
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>You cant dash while floating!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/haste/CheckValidTarget(atom/A)
|
||||
return isturf(A) || A.loc != owner.loc // Anything will do, if it's not me or my square
|
||||
|
||||
/datum/action/bloodsucker/targeted/haste/CheckCanTarget(atom/A, display_error)
|
||||
// DEFAULT CHECKS (Distance)
|
||||
if (!..())
|
||||
return FALSE
|
||||
// Check: Range
|
||||
//if (!(A in view(target_range, get_turf(owner))))
|
||||
// return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/haste/FireTargetedPower(atom/A)
|
||||
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
|
||||
var/mob/living/user = owner
|
||||
var/turf/T = isturf(A) ? A : get_turf(A)
|
||||
// Pulled? Not anymore.
|
||||
owner.pulledby = null
|
||||
// Step One: Heatseek toward Target's Turf
|
||||
walk_to(owner, T, 0, 0.01, 20) // NOTE: this runs in the background! to cancel it, you need to use walk(owner.current,0), or give them a new path.
|
||||
playsound(get_turf(owner), 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
var/safety = 20
|
||||
while(get_turf(owner) != T && safety > 0 && !(isliving(target) && target.Adjacent(owner)))
|
||||
user.canmove = FALSE //Dont move while doing the thing, or itll break
|
||||
safety --
|
||||
// Did I get knocked down?
|
||||
if(owner && owner.incapacitated(ignore_restraints=TRUE, ignore_grab=TRUE))// owner.incapacitated())
|
||||
// We're gonna cancel. But am I on the ground? Spin me!
|
||||
if(user.resting)
|
||||
var/send_dir = get_dir(owner, T)
|
||||
new /datum/forced_movement(owner, get_ranged_target_turf(owner, send_dir, 1), 1, FALSE)
|
||||
owner.spin(10)
|
||||
break
|
||||
// Spin/Stun people we pass.
|
||||
//var/mob/living/newtarget = locate(/mob/living) in oview(1, owner)
|
||||
var/list/mob/living/foundtargets = list()
|
||||
for(var/mob/living/newtarget in oview(1, owner))
|
||||
if (newtarget && newtarget != target && !(newtarget in foundtargets))//!newtarget.IsKnockdown())
|
||||
if (rand(0, 5) < level_current)
|
||||
playsound(get_turf(newtarget), "sound/weapons/punch[rand(1,4)].ogg", 15, 1, -1)
|
||||
newtarget.Knockdown(10 + level_current * 5)
|
||||
if(newtarget.IsStun())
|
||||
newtarget.spin(10,1)
|
||||
if (rand(0,4))
|
||||
newtarget.drop_all_held_items()
|
||||
foundtargets += newtarget
|
||||
sleep(1)
|
||||
if(user)
|
||||
user.update_canmove() //Let the poor guy move again
|
||||
|
||||
/datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..() // activate = FALSE
|
||||
user.update_canmove()
|
||||
@@ -1,87 +0,0 @@
|
||||
// Level 1: Grapple level 2
|
||||
// Level 2: Grapple 3 from Behind
|
||||
// Level 3: Grapple 3 from Shadows
|
||||
/datum/action/bloodsucker/targeted/lunge
|
||||
name = "Predatory Lunge"
|
||||
desc = "Spring at your target and aggressively grapple them without warning. Attacks from concealment or the rear may even knock them down."
|
||||
button_icon_state = "power_lunge"
|
||||
bloodcost = 10
|
||||
cooldown = 250
|
||||
target_range = 5
|
||||
power_activates_immediately = TRUE
|
||||
message_Trigger = "Whom will you ensnare within your grasp?"
|
||||
must_be_capacitated = TRUE
|
||||
bloodsucker_can_buy = TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/lunge/CheckCanUse(display_error)
|
||||
if(!..(display_error))// DEFAULT CHECKS
|
||||
return FALSE
|
||||
// Being Grabbed
|
||||
if(owner.pulledby && owner.pulledby.grab_state >= GRAB_AGGRESSIVE)
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>You're being grabbed!</span>")
|
||||
return FALSE
|
||||
if(!owner.has_gravity(owner.loc))//TODO figure out how to check if theyre able to move while in nograv
|
||||
if(display_error)
|
||||
to_chat(owner, "<span class='warning'>You cant lunge while floating!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/lunge/CheckValidTarget(atom/A)
|
||||
return isliving(A)
|
||||
|
||||
/datum/action/bloodsucker/targeted/lunge/CheckCanTarget(atom/A, display_error)
|
||||
// Check: Self
|
||||
if(target == owner)
|
||||
return FALSE
|
||||
// Check: Range
|
||||
//if (!(target in view(target_range, get_turf(owner))))
|
||||
// if (display_error)
|
||||
// to_chat(owner, "<span class='warning'>Your victim is too far away.</span>")
|
||||
// return FALSE
|
||||
// DEFAULT CHECKS (Distance)
|
||||
if(!..())
|
||||
return FALSE
|
||||
// Check: Turf
|
||||
var/mob/living/L = A
|
||||
if(!isturf(L.loc))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/lunge/FireTargetedPower(atom/A)
|
||||
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
|
||||
var/mob/living/carbon/target = A
|
||||
var/turf/T = get_turf(target)
|
||||
// Clear Vars
|
||||
owner.pulling = null
|
||||
// Will we Knock them Down?
|
||||
var/do_knockdown = !is_A_facing_B(target,owner) || owner.alpha <= 0 || istype(owner.loc, /obj/structure/closet)
|
||||
// CAUSES: Target has their back to me, I'm invisible, or I'm in a Closet
|
||||
// Step One: Heatseek toward Target's Turf
|
||||
|
||||
addtimer(CALLBACK(owner, .proc/_walk, 0), 2 SECONDS)
|
||||
target.playsound_local(get_turf(owner), 'sound/bloodsucker/lunge_warn.ogg', 60, FALSE, pressure_affected = FALSE) // target-only telegraphing
|
||||
owner.playsound_local(owner, 'sound/bloodsucker/lunge_warn.ogg', 60, FALSE, pressure_affected = FALSE) // audio feedback to the user
|
||||
if(do_mob(owner, owner, 6, TRUE, TRUE))
|
||||
walk_towards(owner, T, 0.1, 10) // yes i know i shouldn't use this but i don't know how to work in anything better
|
||||
if(get_turf(owner) != T && !(isliving(target) && target.Adjacent(owner)) && owner.incapacitated() && owner.resting)
|
||||
var/send_dir = get_dir(owner, T)
|
||||
new /datum/forced_movement(owner, get_ranged_target_turf(owner, send_dir, 1), 1, FALSE)
|
||||
owner.spin(10)
|
||||
// Step Two: Check if I'm at/adjectent to Target's CURRENT turf (not original...that was just a destination)
|
||||
for(var/i in 1 to 6)
|
||||
if (target.Adjacent(owner))
|
||||
// LEVEL 2: If behind target, mute or unconscious!
|
||||
if(do_knockdown) // && level_current >= 1)
|
||||
target.Knockdown(15 + 10 * level_current,1)
|
||||
target.adjustStaminaLoss(40 + 10 * level_current)
|
||||
// Cancel Walk (we were close enough to contact them)
|
||||
walk(owner, 0)
|
||||
target.Stun(10,1) //Without this the victim can just walk away
|
||||
target.grabbedby(owner) // Taken from mutations.dm under changelings
|
||||
target.grippedby(owner, instant = TRUE) //instant aggro grab
|
||||
break
|
||||
sleep(i*3)
|
||||
/datum/action/bloodsucker/targeted/lunge/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..() // activate = FALSE
|
||||
user.update_canmove()
|
||||
@@ -1,97 +0,0 @@
|
||||
|
||||
|
||||
|
||||
// WITHOUT THIS POWER:
|
||||
//
|
||||
// - Mid-Blood: SHOW AS PALE
|
||||
// - Low-Blood: SHOW AS DEAD
|
||||
// - No Heartbeat
|
||||
// - Examine shows actual blood
|
||||
// - Thermal homeostasis (ColdBlooded)
|
||||
|
||||
|
||||
|
||||
// WITH THIS POWER:
|
||||
// - Normal body temp -- remove Cold Blooded (return on deactivate)
|
||||
// -
|
||||
|
||||
|
||||
/datum/action/bloodsucker/masquerade
|
||||
name = "Masquerade"
|
||||
desc = "Feign the vital signs of a mortal, and escape both casual and medical notice as the monster you truly are."
|
||||
button_icon_state = "power_human"
|
||||
bloodcost = 10
|
||||
cooldown = 50
|
||||
amToggle = TRUE
|
||||
bloodsucker_can_buy = TRUE
|
||||
warn_constant_cost = TRUE
|
||||
can_use_in_torpor = TRUE // Masquerade is maybe the only one that can do this. It stops your healing.
|
||||
cooldown_static = TRUE
|
||||
|
||||
// NOTE: Firing off vulgar powers disables your Masquerade!
|
||||
|
||||
/*/datum/action/bloodsucker/masquerade/CheckCanUse(display_error)
|
||||
if(!..(display_error))// DEFAULT CHECKS
|
||||
return FALSE
|
||||
// DONE!
|
||||
return TRUE
|
||||
*/
|
||||
|
||||
|
||||
/datum/action/bloodsucker/masquerade/ActivatePower()
|
||||
|
||||
var/mob/living/user = owner
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
|
||||
to_chat(user, "<span class='notice'>Your heart beats falsely within your lifeless chest. You may yet pass for a mortal.</span>")
|
||||
to_chat(user, "<span class='warning'>Your vampiric healing is halted while imitating life.</span>")
|
||||
|
||||
|
||||
// Remove ColdBlooded & Hard/SoftCrit
|
||||
REMOVE_TRAIT(user, TRAIT_COLDBLOODED, "bloodsucker")
|
||||
REMOVE_TRAIT(user, TRAIT_NOHARDCRIT, "bloodsucker")
|
||||
REMOVE_TRAIT(user, TRAIT_NOSOFTCRIT, "bloodsucker")
|
||||
var/obj/item/organ/heart/vampheart/H = user.getorganslot(ORGAN_SLOT_HEART)
|
||||
|
||||
// WE ARE ALIVE! //
|
||||
bloodsuckerdatum.poweron_masquerade = TRUE
|
||||
while(bloodsuckerdatum && ContinueActive(user))
|
||||
|
||||
// HEART
|
||||
if (istype(H))
|
||||
H.FakeStart()
|
||||
|
||||
// PASSIVE (done from LIFE)
|
||||
// Don't Show Pale/Dead on low blood
|
||||
// Don't vomit food
|
||||
// Don't Heal
|
||||
|
||||
// Pay Blood Toll (if awake)
|
||||
if (user.stat == CONSCIOUS)
|
||||
bloodsuckerdatum.AddBloodVolume(-0.2)
|
||||
|
||||
sleep(20) // Check every few ticks that we haven't disabled this power
|
||||
|
||||
|
||||
/datum/action/bloodsucker/masquerade/ContinueActive(mob/living/user)
|
||||
// Disable if unable to use power anymore.
|
||||
//if (user.stat == DEAD || user.blood_volume <= 0) // not conscious or soft critor uncon, just dead
|
||||
// return FALSE
|
||||
return ..() // Active, and still Antag
|
||||
|
||||
|
||||
/datum/action/bloodsucker/masquerade/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..() // activate = FALSE
|
||||
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
bloodsuckerdatum.poweron_masquerade = FALSE
|
||||
|
||||
ADD_TRAIT(user, TRAIT_COLDBLOODED, "bloodsucker")
|
||||
ADD_TRAIT(user, TRAIT_NOHARDCRIT, "bloodsucker")
|
||||
ADD_TRAIT(user, TRAIT_NOSOFTCRIT, "bloodsucker")
|
||||
|
||||
// HEART
|
||||
var/obj/item/organ/heart/H = user.getorganslot(ORGAN_SLOT_HEART)
|
||||
H.Stop()
|
||||
|
||||
to_chat(user, "<span class='notice'>Your heart beats one final time, while your skin dries out and your icy pallor returns.</span>")
|
||||
@@ -1,111 +0,0 @@
|
||||
|
||||
// * MEZMERIZE
|
||||
// LOVE: Target falls in love with you. Being harmed directly causes them harm if they see it?
|
||||
// STAY: Target will do everything they can to stand in the same place.
|
||||
// FOLLOW: Target follows you, spouting random phrases from their history (or maybe Poly's or NPC's vocab?)
|
||||
// ATTACK: Target finds a nearby non-Bloodsucker victim to attack.
|
||||
|
||||
/datum/action/bloodsucker/targeted/mesmerize
|
||||
name = "Mesmerize"
|
||||
desc = "Dominate the mind of a mortal who can see your eyes."
|
||||
button_icon_state = "power_mez"
|
||||
bloodcost = 30
|
||||
cooldown = 200
|
||||
target_range = 1
|
||||
power_activates_immediately = FALSE
|
||||
message_Trigger = "Whom will you subvert to your will?"
|
||||
must_be_capacitated = TRUE
|
||||
bloodsucker_can_buy = TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/mesmerize/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if (!owner.getorganslot(ORGAN_SLOT_EYES))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You have no eyes with which to mesmerize.</span>")
|
||||
return FALSE
|
||||
// Check: Eyes covered?
|
||||
var/mob/living/L = owner
|
||||
if (istype(L) && L.is_eyes_covered() || !isturf(owner.loc))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your eyes are concealed from sight.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/A)
|
||||
return iscarbon(A)
|
||||
|
||||
/datum/action/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/A,display_error)
|
||||
// Check: Self
|
||||
if (A == owner)
|
||||
return FALSE
|
||||
var/mob/living/carbon/target = A // We already know it's carbon due to CheckValidTarget()
|
||||
// Bloodsucker
|
||||
if (target.mind && target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Bloodsuckers are immune to [src].</span>")
|
||||
return FALSE
|
||||
// Dead/Unconscious
|
||||
if (target.stat > CONSCIOUS)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your victim is not [(target.stat == DEAD || HAS_TRAIT(target, TRAIT_FAKEDEATH))?"alive":"conscious"].</span>")
|
||||
return FALSE
|
||||
// Check: Target has eyes?
|
||||
if (!target.getorganslot(ORGAN_SLOT_EYES))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>They have no eyes!</span>")
|
||||
return FALSE
|
||||
// Check: Target blind?
|
||||
if (target.eye_blind > 0)
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your victim's eyes are glazed over. They cannot perceive you.</span>")
|
||||
return FALSE
|
||||
// Check: Target See Me? (behind wall)
|
||||
if (!(owner in view(target_range, get_turf(target))))
|
||||
// Sub-Check: GET CLOSER
|
||||
//if (!(owner in range(target_range, get_turf(target)))
|
||||
// if (display_error)
|
||||
// to_chat(owner, "<span class='warning'>You're too far from your victim.</span>")
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You're too far outside your victim's view.</span>")
|
||||
return FALSE
|
||||
// Check: Facing target?
|
||||
if (!is_A_facing_B(owner,target)) // in unsorted.dm
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>You must be facing your victim.</span>")
|
||||
return FALSE
|
||||
// Check: Target facing me?
|
||||
if (!target.resting && !is_A_facing_B(target,owner))
|
||||
if (display_error)
|
||||
to_chat(owner, "<span class='warning'>Your victim must be facing you to see into your eyes.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A)
|
||||
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
|
||||
var/mob/living/carbon/target = A
|
||||
var/mob/living/user = owner
|
||||
|
||||
if(istype(target))
|
||||
target.Stun(40) //Utterly useless without this, its okay since there are so many checks to go through
|
||||
target.apply_status_effect(STATUS_EFFECT_MESMERIZE, 45) //So you cant rotate with combat mode, plus fancy status alert
|
||||
|
||||
if(do_mob(user, target, 40, 0, TRUE, extra_checks = CALLBACK(src, .proc/ContinueActive, user, target)))
|
||||
PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!
|
||||
var/power_time = 90 + level_current * 12
|
||||
target.apply_status_effect(STATUS_EFFECT_MESMERIZE, power_time + 80)
|
||||
to_chat(user, "<span class='notice'>[target] is fixed in place by your hypnotic gaze.</span>")
|
||||
target.Stun(power_time)
|
||||
target.next_move = world.time + power_time // <--- Use direct change instead. We want an unmodified delay to their next move // target.changeNext_move(power_time) // check click.dm
|
||||
target.notransform = TRUE // <--- Fuck it. We tried using next_move, but they could STILL resist. We're just doing a hard freeze.
|
||||
spawn(power_time)
|
||||
if(istype(target))
|
||||
target.notransform = FALSE
|
||||
// They Woke Up! (Notice if within view)
|
||||
if(istype(user) && target.stat == CONSCIOUS && (target in view(10, get_turf(user))) )
|
||||
to_chat(user, "<span class='warning'>[target] has snapped out of their trance.</span>")
|
||||
|
||||
|
||||
/datum/action/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target)
|
||||
return ..() && CheckCanUse() && CheckCanTarget(target)
|
||||
@@ -1,114 +0,0 @@
|
||||
|
||||
|
||||
/datum/action/bloodsucker/targeted/trespass
|
||||
name = "Trespass"
|
||||
desc = "Become mist and advance two tiles in one direction, ignoring all obstacles except for walls. Useful for skipping past doors and barricades."
|
||||
button_icon_state = "power_tres"
|
||||
|
||||
bloodcost = 10
|
||||
cooldown = 60
|
||||
amToggle = FALSE
|
||||
//target_range = 2
|
||||
|
||||
bloodsucker_can_buy = TRUE
|
||||
must_be_capacitated = FALSE
|
||||
can_be_immobilized = TRUE
|
||||
|
||||
var/turf/target_turf // We need to decide where we're going based on where we clicked. It's not actually the tile we clicked.
|
||||
|
||||
/datum/action/bloodsucker/targeted/trespass/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if(owner.notransform || !get_turf(owner))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/action/bloodsucker/targeted/trespass/CheckValidTarget(atom/A)
|
||||
// Can't target my tile
|
||||
if (A == get_turf(owner) || get_turf(A) == get_turf(owner))
|
||||
return FALSE
|
||||
|
||||
return TRUE // All we care about is destination. Anything you click is fine.
|
||||
|
||||
|
||||
/datum/action/bloodsucker/targeted/trespass/CheckCanTarget(atom/A, display_error)
|
||||
// NOTE: Do NOT use ..()! We don't want to check distance or anything.
|
||||
|
||||
// Get clicked tile
|
||||
var/final_turf = isturf(A) ? A : get_turf(A)
|
||||
|
||||
// Are either tiles WALLS?
|
||||
var/turf/from_turf = get_turf(owner)
|
||||
var/this_dir // = get_dir(from_turf, target_turf)
|
||||
for (var/i=1 to 2)
|
||||
// Keep Prev Direction if we've reached final turf
|
||||
if (from_turf != final_turf)
|
||||
this_dir = get_dir(from_turf, final_turf) // Recalculate dir so we don't overshoot on a diagonal.
|
||||
from_turf = get_step(from_turf, this_dir)
|
||||
// ERROR! Wall!
|
||||
if (iswallturf(from_turf))
|
||||
if (display_error)
|
||||
var/wallwarning = (i == 1) ? "in the way" : "at your destination"
|
||||
to_chat(owner, "<span class='warning'>There is a solid wall [wallwarning].</span>")
|
||||
return FALSE
|
||||
// Done
|
||||
target_turf = from_turf
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/action/bloodsucker/targeted/trespass/FireTargetedPower(atom/A)
|
||||
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
|
||||
|
||||
// Find target turf, at or below Atom
|
||||
var/mob/living/carbon/user = owner
|
||||
var/turf/my_turf = get_turf(owner)
|
||||
|
||||
user.visible_message("<span class='warning'>[user]'s form dissipates into a cloud of mist!</span>", \
|
||||
"<span class='notice'>You dissipate into formless mist.</span>")
|
||||
|
||||
|
||||
// Effect Origin
|
||||
playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1)
|
||||
var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/()
|
||||
puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke
|
||||
puff.set_up(3, 0, my_turf)
|
||||
puff.start()
|
||||
|
||||
var/mist_delay = max(5, 20 - level_current * 2.5) // Level up and do this faster.
|
||||
|
||||
// Freeze Me
|
||||
user.Stun(mist_delay, ignore_canstun = TRUE)
|
||||
user.density = 0
|
||||
var/invis_was = user.invisibility
|
||||
user.invisibility = INVISIBILITY_MAXIMUM
|
||||
|
||||
// LOSE CUFFS
|
||||
//lol don't
|
||||
|
||||
// Wait...
|
||||
sleep(mist_delay / 2)
|
||||
|
||||
// Move & Freeze
|
||||
if (isturf(target_turf))
|
||||
do_teleport(owner, target_turf, no_effects=TRUE, channel = TELEPORT_CHANNEL_QUANTUM) // in teleport.dm?
|
||||
user.Stun(mist_delay / 2, ignore_canstun = TRUE)
|
||||
|
||||
// Wait...
|
||||
sleep(mist_delay / 2)
|
||||
|
||||
// Un-Hide & Freeze
|
||||
user.dir = get_dir(my_turf, target_turf)
|
||||
user.Stun(mist_delay / 2, ignore_canstun = TRUE)
|
||||
user.density = 1
|
||||
user.invisibility = invis_was
|
||||
|
||||
// Effect Destination
|
||||
playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1)
|
||||
puff = new /datum/effect_system/steam_spread/()
|
||||
puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke
|
||||
puff.set_up(3, 0, target_turf)
|
||||
puff.start()
|
||||
@@ -1,163 +0,0 @@
|
||||
|
||||
/datum/action/bloodsucker/veil
|
||||
name = "Veil of Many Faces"
|
||||
desc = "Disguise yourself in the illusion of another identity."
|
||||
button_icon_state = "power_veil"
|
||||
bloodcost = 15
|
||||
cooldown = 100
|
||||
amToggle = TRUE
|
||||
bloodsucker_can_buy = TRUE
|
||||
warn_constant_cost = TRUE
|
||||
|
||||
// Outfit Vars
|
||||
var/list/original_items = list()
|
||||
|
||||
// Identity Vars
|
||||
var/prev_gender
|
||||
var/prev_skin_tone
|
||||
var/prev_hair_style
|
||||
var/prev_facial_hair_style
|
||||
var/prev_hair_color
|
||||
var/prev_facial_hair_color
|
||||
var/prev_underwear
|
||||
var/prev_undie_color
|
||||
var/prev_undershirt
|
||||
var/prev_shirt_color
|
||||
var/prev_socks
|
||||
var/prev_socks_color
|
||||
var/prev_disfigured
|
||||
var/list/prev_features // For lizards and such
|
||||
|
||||
|
||||
/datum/action/bloodsucker/veil/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/action/bloodsucker/veil/ActivatePower()
|
||||
|
||||
cast_effect() // POOF
|
||||
|
||||
//if (blahblahblah)
|
||||
// Disguise_Outfit()
|
||||
|
||||
Disguise_FaceName()
|
||||
|
||||
|
||||
/datum/action/bloodsucker/veil/proc/Disguise_Outfit()
|
||||
|
||||
// Step One: Back up original items
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/action/bloodsucker/veil/proc/Disguise_FaceName()
|
||||
|
||||
// Change Name/Voice
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H.name_override = H.dna.species.random_name(H.gender)
|
||||
H.name = H.name_override
|
||||
H.SetSpecialVoice(H.name_override)
|
||||
to_chat(owner, "<span class='warning'>You mystify the air around your person. Your identity is now altered.</span>")
|
||||
|
||||
// Store Prev Appearance
|
||||
prev_gender = H.gender
|
||||
prev_skin_tone = H.skin_tone
|
||||
prev_hair_style = H.hair_style
|
||||
prev_facial_hair_style = H.facial_hair_style
|
||||
prev_hair_color = H.hair_color
|
||||
prev_facial_hair_color = H.facial_hair_color
|
||||
prev_underwear = H.underwear
|
||||
prev_undie_color = H.undie_color
|
||||
prev_undershirt = H.undershirt
|
||||
prev_shirt_color = H.shirt_color
|
||||
prev_socks = H.socks
|
||||
prev_socks_color = H.socks_color
|
||||
//prev_eye_color
|
||||
prev_disfigured = HAS_TRAIT(H, TRAIT_DISFIGURED) // I was disfigured! //prev_disabilities = H.disabilities
|
||||
prev_features = H.dna.features
|
||||
|
||||
// Change Appearance, not randomizing clothes colour, itll just be janky
|
||||
H.gender = pick(MALE, FEMALE)
|
||||
H.skin_tone = random_skin_tone()
|
||||
H.hair_style = random_hair_style(H.gender)
|
||||
H.facial_hair_style = pick(random_facial_hair_style(H.gender),"Shaved")
|
||||
H.hair_color = random_short_color()
|
||||
H.facial_hair_color = H.hair_color
|
||||
H.underwear = random_underwear(H.gender)
|
||||
H.undershirt = random_undershirt(H.gender)
|
||||
H.socks = random_socks(H.gender)
|
||||
//H.eye_color = random_eye_color()
|
||||
REMOVE_TRAIT(H, TRAIT_DISFIGURED, null) //
|
||||
H.dna.features = random_features()
|
||||
|
||||
// Apply Appearance
|
||||
H.update_body() // Outfit and underware, also body.
|
||||
//H.update_mutant_bodyparts() // Lizard tails etc
|
||||
H.update_hair()
|
||||
H.update_body_parts()
|
||||
|
||||
// Wait here til we deactivate power or go unconscious
|
||||
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
|
||||
while (ContinueActive(owner) && istype(bloodsuckerdatum))//active && owner && owner.stat == CONSCIOUS)
|
||||
bloodsuckerdatum.AddBloodVolume(-0.2)
|
||||
sleep(10)
|
||||
|
||||
// Wait for a moment if you fell unconscious...
|
||||
if (owner && owner.stat > CONSCIOUS)
|
||||
sleep(50)
|
||||
|
||||
|
||||
/datum/action/bloodsucker/veil/DeactivatePower(mob/living/user = owner, mob/living/target)
|
||||
..()
|
||||
if (ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
// Revert Identity
|
||||
H.UnsetSpecialVoice()
|
||||
H.name_override = null
|
||||
H.name = H.real_name
|
||||
|
||||
// Revert Appearance
|
||||
H.gender = prev_gender
|
||||
H.skin_tone = prev_skin_tone
|
||||
H.hair_style = prev_hair_style
|
||||
H.facial_hair_style = prev_facial_hair_style
|
||||
H.hair_color = prev_hair_color
|
||||
H.facial_hair_color = prev_facial_hair_color
|
||||
H.underwear = prev_underwear
|
||||
H.undie_color = prev_undie_color
|
||||
H.undershirt = prev_undershirt
|
||||
H.shirt_color = prev_shirt_color
|
||||
H.socks = prev_socks
|
||||
H.socks_color = prev_socks_color
|
||||
|
||||
//H.disabilities = prev_disabilities // Restore HUSK, CLUMSY, etc.
|
||||
if (prev_disfigured)
|
||||
ADD_TRAIT(H, TRAIT_DISFIGURED, "husk") // NOTE: We are ASSUMING husk. // H.status_flags |= DISFIGURED // Restore "Unknown" disfigurement
|
||||
H.dna.features = prev_features
|
||||
// Apply Appearance
|
||||
H.update_body() // Outfit and underware, also body.
|
||||
H.update_hair()
|
||||
H.update_body_parts() // Body itself, maybe skin color?
|
||||
cast_effect() // POOF
|
||||
|
||||
// CAST EFFECT // // General effect (poof, splat, etc) when you cast. Doesn't happen automatically!
|
||||
/datum/action/bloodsucker/veil/proc/cast_effect()
|
||||
// Effect
|
||||
playsound(get_turf(owner), 'sound/magic/smoke.ogg', 20, 1)
|
||||
var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/()
|
||||
puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke
|
||||
puff.set_up(3, 0, get_turf(owner))
|
||||
puff.attach(owner) // OPTIONAL
|
||||
puff.start()
|
||||
owner.spin(8, 1) // Spin around like a loon.
|
||||
|
||||
/obj/effect/particle_effect/smoke/vampsmoke
|
||||
opaque = FALSE
|
||||
lifetime = 0
|
||||
/obj/effect/particle_effect/smoke/vampsmoke/fade_out(frames = 6)
|
||||
..(frames)
|
||||
@@ -1,38 +0,0 @@
|
||||
/datum/action/bloodsucker/vassal/recuperate
|
||||
name = "Sanguine Recuperation"
|
||||
desc = "Slowly heal brute damage while active. This process is exhausting, and requires some of your tainted blood."
|
||||
button_icon_state = "power_recup"
|
||||
amToggle = TRUE
|
||||
bloodcost = 30
|
||||
cooldown = 100
|
||||
|
||||
/datum/action/bloodsucker/vassal/recuperate/CheckCanUse(display_error)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if (owner.stat >= DEAD)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/bloodsucker/vassal/recuperate/ActivatePower()
|
||||
to_chat(owner, "<span class='notice'>Your muscles clench and your skin crawls as your master's immortal blood knits your wounds and gives you stamina.</span>")
|
||||
var/mob/living/carbon/C = owner
|
||||
var/mob/living/carbon/human/H
|
||||
if(ishuman(owner))
|
||||
H = owner
|
||||
while(ContinueActive(owner))
|
||||
C.adjustBruteLoss(-1.5)
|
||||
C.adjustFireLoss(-0.5)
|
||||
C.adjustToxLoss(-2, forced = TRUE)
|
||||
C.blood_volume -= 0.2
|
||||
C.adjustStaminaLoss(-15)
|
||||
// Stop Bleeding
|
||||
if(istype(H) && H.bleed_rate > 0 && rand(20) == 0)
|
||||
H.bleed_rate --
|
||||
C.Jitter(5)
|
||||
sleep(10)
|
||||
// DONE!
|
||||
//DeactivatePower(owner)
|
||||
|
||||
/datum/action/bloodsucker/vassal/recuperate/ContinueActive(mob/living/user, mob/living/target)
|
||||
return ..() && user.stat <= DEAD && user.blood_volume > 500
|
||||
@@ -13,5 +13,5 @@
|
||||
|
||||
//Recover from stuns.
|
||||
/obj/effect/proc_holder/changeling/adrenaline/sting_action(mob/living/user)
|
||||
user.do_adrenaline(0, FALSE, 70, 0, TRUE, list(/datum/reagent/medicine/epinephrine = 3, /datum/reagent/drug/methamphetamine/changeling = 10, /datum/reagent/medicine/mannitol = 10, /datum/reagent/medicine/regen_jelly = 10, /datum/reagent/medicine/changelingadrenaline = 5), "<span class='notice'>Energy rushes through us.</span>", 0, 0.75, 0)
|
||||
user.do_adrenaline(0, FALSE, 70, 0, TRUE, list("epinephrine" = 3, "changelingmeth" = 10, "mannitol" = 10, "regen_jelly" = 10, "changelingadrenaline" = 5), "<span class='notice'>Energy rushes through us.</span>", 0, 0.75, 0)
|
||||
return TRUE
|
||||
@@ -58,7 +58,7 @@
|
||||
target.mind.linglink = 1
|
||||
target.say("[MODE_TOKEN_CHANGELING] AAAAARRRRGGGGGHHHHH!!")
|
||||
to_chat(target, "<font color=#800040><span class='boldannounce'>You can now communicate in the changeling hivemind, say \"[MODE_TOKEN_CHANGELING] message\" to communicate!</span>")
|
||||
target.reagents.add_reagent(/datum/reagent/medicine/salbutamol, 40) // So they don't choke to death while you interrogate them
|
||||
target.reagents.add_reagent("salbutamol", 40) // So they don't choke to death while you interrogate them
|
||||
sleep(1800)
|
||||
SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]", "[i]"))
|
||||
if(!do_mob(user, target, 20))
|
||||
|
||||
@@ -500,7 +500,7 @@
|
||||
/obj/item/clothing/suit/space/changeling/process()
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
H.reagents.add_reagent(/datum/reagent/medicine/salbutamol, REAGENTS_METABOLISM)
|
||||
H.reagents.add_reagent("salbutamol", REAGENTS_METABOLISM)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/changeling
|
||||
name = "flesh mass"
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
C.vomit(0, toxic = TRUE)
|
||||
O.forceMove(get_turf(user))
|
||||
|
||||
user.reagents.add_reagent(/datum/reagent/medicine/mutadone, 10)
|
||||
user.reagents.add_reagent(/datum/reagent/medicine/pen_acid/pen_jelly, 20)
|
||||
user.reagents.add_reagent(/datum/reagent/medicine/antihol, 10)
|
||||
user.reagents.add_reagent(/datum/reagent/medicine/mannitol, 25)
|
||||
user.reagents.add_reagent("mutadone", 10)
|
||||
user.reagents.add_reagent("pen_jelly", 20)
|
||||
user.reagents.add_reagent("antihol", 10)
|
||||
user.reagents.add_reagent("mannitol", 25)
|
||||
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
|
||||
@@ -1,266 +1,266 @@
|
||||
/obj/effect/proc_holder/changeling/sting
|
||||
name = "Tiny Prick"
|
||||
desc = "Stabby stabby."
|
||||
var/sting_icon = null
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/Click()
|
||||
var/mob/user = usr
|
||||
if(!user || !user.mind)
|
||||
return
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(!changeling)
|
||||
return
|
||||
if(!changeling.chosen_sting)
|
||||
set_sting(user)
|
||||
else
|
||||
unset_sting(user)
|
||||
return
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/proc/set_sting(mob/user)
|
||||
to_chat(user, "<span class='notice'>We prepare our sting, use alt+click or middle mouse button on target to sting them.</span>")
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
changeling.chosen_sting = src
|
||||
|
||||
user.hud_used.lingstingdisplay.icon_state = sting_icon
|
||||
user.hud_used.lingstingdisplay.invisibility = 0
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/proc/unset_sting(mob/user)
|
||||
to_chat(user, "<span class='warning'>We retract our sting, we can't sting anyone for now.</span>")
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
changeling.chosen_sting = null
|
||||
|
||||
user.hud_used.lingstingdisplay.icon_state = null
|
||||
user.hud_used.lingstingdisplay.invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/mob/living/carbon/proc/unset_sting()
|
||||
if(mind)
|
||||
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(changeling && changeling.chosen_sting)
|
||||
changeling.chosen_sting.unset_sting(src)
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/can_sting(mob/user, mob/target)
|
||||
if(!..())
|
||||
return
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(!changeling.chosen_sting)
|
||||
to_chat(user, "We haven't prepared our sting yet!")
|
||||
if(!iscarbon(target))
|
||||
return
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
if(!AStar(user, target.loc, /turf/proc/Distance, changeling.sting_range, simulated_only = 0))
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/sting_feedback(mob/user, mob/target)
|
||||
if(!target)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>We stealthily sting [target.name].</span>")
|
||||
if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling))
|
||||
to_chat(target, "<span class='warning'>You feel a tiny prick.</span>")
|
||||
return 1
|
||||
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation
|
||||
name = "Temporary Transformation Sting"
|
||||
desc = "We silently sting a human, injecting a chemical that forces them to transform into a chosen being for a limited time. Additional stings extend the duration."
|
||||
helptext = "The victim will transform much like a changeling would for a limited time. Does not provide a warning to others. Mutations will not be transferred, and monkeys will become human. This ability is loud, and might cause our blood to react violently to heat."
|
||||
sting_icon = "sting_transform"
|
||||
chemical_cost = 10
|
||||
dna_cost = 2
|
||||
loudness = 1
|
||||
var/datum/changelingprofile/selected_dna = null
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_transform"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/Click()
|
||||
var/mob/user = usr
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(changeling.chosen_sting)
|
||||
unset_sting(user)
|
||||
return
|
||||
selected_dna = changeling.select_dna("Select the target DNA: ", "Target DNA")
|
||||
if(!selected_dna)
|
||||
return
|
||||
if(NOTRANSSTING in selected_dna.dna.species.species_traits)
|
||||
to_chat(user, "<span class = 'notice'>That DNA is not compatible with changeling retrovirus!</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target)
|
||||
if(!..())
|
||||
return
|
||||
if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits))
|
||||
to_chat(user, "<span class='warning'>Our sting appears ineffective against its DNA.</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/sting_action(mob/user, mob/target)
|
||||
|
||||
if(ismonkey(target))
|
||||
to_chat(user, "<span class='notice'>Our genes cry out as we sting [target.name]!</span>")
|
||||
|
||||
var/mob/living/carbon/C = target
|
||||
. = TRUE
|
||||
if(istype(C))
|
||||
if(C.reagents.has_reagent(/datum/reagent/changeling_string))
|
||||
C.reagents.add_reagent(/datum/reagent/changeling_string,120)
|
||||
log_combat(user, target, "stung", "transformation sting", ", extending the duration.")
|
||||
else
|
||||
C.reagents.add_reagent(/datum/reagent/changeling_string,120,list("desired_dna" = selected_dna.dna))
|
||||
log_combat(user, target, "stung", "transformation sting", " new identity is '[selected_dna.dna.real_name]'")
|
||||
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade
|
||||
name = "False Armblade Sting"
|
||||
desc = "We silently sting a human, injecting a retrovirus that mutates their arm to temporarily appear as an armblade."
|
||||
helptext = "The victim will form an armblade much like a changeling would, except the armblade is dull and useless. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_armblade"
|
||||
chemical_cost = 20
|
||||
dna_cost = 1
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_fake"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/item/melee/arm_blade/false
|
||||
desc = "A grotesque mass of flesh that used to be your arm. Although it looks dangerous at first, you can tell it's actually quite dull and useless."
|
||||
force = 5 //Basically as strong as a punch
|
||||
fake = TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade/can_sting(mob/user, mob/target)
|
||||
if(!..())
|
||||
return
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
if((HAS_TRAIT(L, TRAIT_HUSK)) || !L.has_dna())
|
||||
to_chat(user, "<span class='warning'>Our sting appears ineffective against its DNA.</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target)
|
||||
log_combat(user, target, "stung", object="false armblade sting")
|
||||
|
||||
var/obj/item/held = target.get_active_held_item()
|
||||
if(held && !target.dropItemToGround(held))
|
||||
to_chat(user, "<span class='warning'>[held] is stuck to [target.p_their()] hand, you cannot grow a false armblade over it!</span>")
|
||||
return
|
||||
|
||||
if(ismonkey(target))
|
||||
to_chat(user, "<span class='notice'>Our genes cry out as we sting [target.name]!</span>")
|
||||
|
||||
var/obj/item/melee/arm_blade/false/blade = new(target,1)
|
||||
target.put_in_hands(blade)
|
||||
target.visible_message("<span class='warning'>A grotesque blade forms around [target.name]\'s arm!</span>", "<span class='userdanger'>Your arm twists and mutates, transforming into a horrific monstrosity!</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
|
||||
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
|
||||
|
||||
addtimer(CALLBACK(src, .proc/remove_fake, target, blade), 600)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/melee/arm_blade/false/blade)
|
||||
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
|
||||
target.visible_message("<span class='warning'>With a sickening crunch, \
|
||||
[target] reforms [target.p_their()] [blade.name] into an arm!</span>",
|
||||
"<span class='warning'>[blade] reforms back to normal.</span>",
|
||||
"<span class='italics>You hear organic matter ripping and tearing!</span>")
|
||||
|
||||
qdel(blade)
|
||||
target.update_inv_hands()
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/extract_dna
|
||||
name = "Extract DNA Sting"
|
||||
desc = "We stealthily sting a target and extract their DNA."
|
||||
helptext = "Will give you the DNA of your target, allowing you to transform into them."
|
||||
sting_icon = "sting_extract"
|
||||
chemical_cost = 25
|
||||
dna_cost = 0
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_extract"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/extract_dna/can_sting(mob/user, mob/target)
|
||||
if(..())
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
return changeling.can_absorb_dna(target)
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/extract_dna/sting_action(mob/user, mob/living/carbon/human/target)
|
||||
log_combat(user, target, "stung", "extraction sting")
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(!(changeling.has_dna(target.dna)))
|
||||
changeling.add_new_profile(target)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/mute
|
||||
name = "Mute Sting"
|
||||
desc = "We silently sting a human, completely silencing them for a short time."
|
||||
helptext = "Does not provide a warning to the victim that they have been stung, until they try to speak and cannot. This ability is loud, and might cause our blood to react violently to heat."
|
||||
sting_icon = "sting_mute"
|
||||
chemical_cost = 20
|
||||
dna_cost = 2
|
||||
loudness = 2
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_mute"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/mute/sting_action(mob/user, mob/living/carbon/target)
|
||||
log_combat(user, target, "stung", "mute sting")
|
||||
target.silent += 30
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/blind
|
||||
name = "Blind Sting"
|
||||
desc = "Temporarily blinds the target."
|
||||
helptext = "This sting completely blinds a target for a short time. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_blind"
|
||||
chemical_cost = 25
|
||||
dna_cost = 1
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_blind"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target)
|
||||
log_combat(user, target, "stung", "blind sting")
|
||||
to_chat(target, "<span class='danger'>Your eyes burn horrifically!</span>")
|
||||
target.become_nearsighted(EYE_DAMAGE)
|
||||
target.blind_eyes(20)
|
||||
target.blur_eyes(40)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/LSD
|
||||
name = "Hallucination Sting"
|
||||
desc = "Causes terror in the target and deals a minor amount of toxin damage."
|
||||
helptext = "We evolve the ability to sting a target with a powerful toxic hallucinogenic chemical. The target does not notice they have been stung, and the effect begins instantaneously. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_lsd"
|
||||
chemical_cost = 10
|
||||
dna_cost = 1
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_lsd"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/target)
|
||||
log_combat(user, target, "stung", "LSD sting")
|
||||
if(target.reagents)
|
||||
target.reagents.add_reagent(/datum/reagent/blob/regenerative_materia, 5)
|
||||
target.reagents.add_reagent(/datum/reagent/toxin/mindbreaker, 5)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/cryo
|
||||
name = "Cryogenic Sting"
|
||||
desc = "We silently sting a human with a cocktail of chemicals that freeze them."
|
||||
helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_cryo"
|
||||
chemical_cost = 15
|
||||
dna_cost = 2
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_cryo"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/cryo/sting_action(mob/user, mob/target)
|
||||
log_combat(user, target, "stung", "cryo sting")
|
||||
if(target.reagents)
|
||||
target.reagents.add_reagent(/datum/reagent/consumable/frostoil, 30)
|
||||
return TRUE
|
||||
/obj/effect/proc_holder/changeling/sting
|
||||
name = "Tiny Prick"
|
||||
desc = "Stabby stabby."
|
||||
var/sting_icon = null
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/Click()
|
||||
var/mob/user = usr
|
||||
if(!user || !user.mind)
|
||||
return
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(!changeling)
|
||||
return
|
||||
if(!changeling.chosen_sting)
|
||||
set_sting(user)
|
||||
else
|
||||
unset_sting(user)
|
||||
return
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/proc/set_sting(mob/user)
|
||||
to_chat(user, "<span class='notice'>We prepare our sting, use alt+click or middle mouse button on target to sting them.</span>")
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
changeling.chosen_sting = src
|
||||
|
||||
user.hud_used.lingstingdisplay.icon_state = sting_icon
|
||||
user.hud_used.lingstingdisplay.invisibility = 0
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/proc/unset_sting(mob/user)
|
||||
to_chat(user, "<span class='warning'>We retract our sting, we can't sting anyone for now.</span>")
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
changeling.chosen_sting = null
|
||||
|
||||
user.hud_used.lingstingdisplay.icon_state = null
|
||||
user.hud_used.lingstingdisplay.invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/mob/living/carbon/proc/unset_sting()
|
||||
if(mind)
|
||||
var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(changeling && changeling.chosen_sting)
|
||||
changeling.chosen_sting.unset_sting(src)
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/can_sting(mob/user, mob/target)
|
||||
if(!..())
|
||||
return
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(!changeling.chosen_sting)
|
||||
to_chat(user, "We haven't prepared our sting yet!")
|
||||
if(!iscarbon(target))
|
||||
return
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
if(!AStar(user, target.loc, /turf/proc/Distance, changeling.sting_range, simulated_only = 0))
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/sting_feedback(mob/user, mob/target)
|
||||
if(!target)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>We stealthily sting [target.name].</span>")
|
||||
if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling))
|
||||
to_chat(target, "<span class='warning'>You feel a tiny prick.</span>")
|
||||
return 1
|
||||
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation
|
||||
name = "Temporary Transformation Sting"
|
||||
desc = "We silently sting a human, injecting a chemical that forces them to transform into a chosen being for a limited time. Additional stings extend the duration."
|
||||
helptext = "The victim will transform much like a changeling would for a limited time. Does not provide a warning to others. Mutations will not be transferred, and monkeys will become human. This ability is loud, and might cause our blood to react violently to heat."
|
||||
sting_icon = "sting_transform"
|
||||
chemical_cost = 10
|
||||
dna_cost = 2
|
||||
loudness = 1
|
||||
var/datum/changelingprofile/selected_dna = null
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_transform"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/Click()
|
||||
var/mob/user = usr
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(changeling.chosen_sting)
|
||||
unset_sting(user)
|
||||
return
|
||||
selected_dna = changeling.select_dna("Select the target DNA: ", "Target DNA")
|
||||
if(!selected_dna)
|
||||
return
|
||||
if(NOTRANSSTING in selected_dna.dna.species.species_traits)
|
||||
to_chat(user, "<span class = 'notice'>That DNA is not compatible with changeling retrovirus!</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target)
|
||||
if(!..())
|
||||
return
|
||||
if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits))
|
||||
to_chat(user, "<span class='warning'>Our sting appears ineffective against its DNA.</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/sting_action(mob/user, mob/target)
|
||||
|
||||
if(ismonkey(target))
|
||||
to_chat(user, "<span class='notice'>Our genes cry out as we sting [target.name]!</span>")
|
||||
|
||||
var/mob/living/carbon/C = target
|
||||
. = TRUE
|
||||
if(istype(C))
|
||||
if(C.reagents.has_reagent("changeling_sting_real"))
|
||||
C.reagents.add_reagent("changeling_sting_real",120)
|
||||
log_combat(user, target, "stung", "transformation sting", ", extending the duration.")
|
||||
else
|
||||
C.reagents.add_reagent("changeling_sting_real",120,list("desired_dna" = selected_dna.dna))
|
||||
log_combat(user, target, "stung", "transformation sting", " new identity is '[selected_dna.dna.real_name]'")
|
||||
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade
|
||||
name = "False Armblade Sting"
|
||||
desc = "We silently sting a human, injecting a retrovirus that mutates their arm to temporarily appear as an armblade."
|
||||
helptext = "The victim will form an armblade much like a changeling would, except the armblade is dull and useless. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_armblade"
|
||||
chemical_cost = 20
|
||||
dna_cost = 1
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_fake"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/item/melee/arm_blade/false
|
||||
desc = "A grotesque mass of flesh that used to be your arm. Although it looks dangerous at first, you can tell it's actually quite dull and useless."
|
||||
force = 5 //Basically as strong as a punch
|
||||
fake = TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade/can_sting(mob/user, mob/target)
|
||||
if(!..())
|
||||
return
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
if((HAS_TRAIT(L, TRAIT_HUSK)) || !L.has_dna())
|
||||
to_chat(user, "<span class='warning'>Our sting appears ineffective against its DNA.</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target)
|
||||
log_combat(user, target, "stung", object="false armblade sting")
|
||||
|
||||
var/obj/item/held = target.get_active_held_item()
|
||||
if(held && !target.dropItemToGround(held))
|
||||
to_chat(user, "<span class='warning'>[held] is stuck to [target.p_their()] hand, you cannot grow a false armblade over it!</span>")
|
||||
return
|
||||
|
||||
if(ismonkey(target))
|
||||
to_chat(user, "<span class='notice'>Our genes cry out as we sting [target.name]!</span>")
|
||||
|
||||
var/obj/item/melee/arm_blade/false/blade = new(target,1)
|
||||
target.put_in_hands(blade)
|
||||
target.visible_message("<span class='warning'>A grotesque blade forms around [target.name]\'s arm!</span>", "<span class='userdanger'>Your arm twists and mutates, transforming into a horrific monstrosity!</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
|
||||
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
|
||||
|
||||
addtimer(CALLBACK(src, .proc/remove_fake, target, blade), 600)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/melee/arm_blade/false/blade)
|
||||
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
|
||||
target.visible_message("<span class='warning'>With a sickening crunch, \
|
||||
[target] reforms [target.p_their()] [blade.name] into an arm!</span>",
|
||||
"<span class='warning'>[blade] reforms back to normal.</span>",
|
||||
"<span class='italics>You hear organic matter ripping and tearing!</span>")
|
||||
|
||||
qdel(blade)
|
||||
target.update_inv_hands()
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/extract_dna
|
||||
name = "Extract DNA Sting"
|
||||
desc = "We stealthily sting a target and extract their DNA."
|
||||
helptext = "Will give you the DNA of your target, allowing you to transform into them."
|
||||
sting_icon = "sting_extract"
|
||||
chemical_cost = 25
|
||||
dna_cost = 0
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_extract"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/extract_dna/can_sting(mob/user, mob/target)
|
||||
if(..())
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
return changeling.can_absorb_dna(target)
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/extract_dna/sting_action(mob/user, mob/living/carbon/human/target)
|
||||
log_combat(user, target, "stung", "extraction sting")
|
||||
var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(!(changeling.has_dna(target.dna)))
|
||||
changeling.add_new_profile(target)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/mute
|
||||
name = "Mute Sting"
|
||||
desc = "We silently sting a human, completely silencing them for a short time."
|
||||
helptext = "Does not provide a warning to the victim that they have been stung, until they try to speak and cannot. This ability is loud, and might cause our blood to react violently to heat."
|
||||
sting_icon = "sting_mute"
|
||||
chemical_cost = 20
|
||||
dna_cost = 2
|
||||
loudness = 2
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_mute"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/mute/sting_action(mob/user, mob/living/carbon/target)
|
||||
log_combat(user, target, "stung", "mute sting")
|
||||
target.silent += 30
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/blind
|
||||
name = "Blind Sting"
|
||||
desc = "Temporarily blinds the target."
|
||||
helptext = "This sting completely blinds a target for a short time. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_blind"
|
||||
chemical_cost = 25
|
||||
dna_cost = 1
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_blind"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target)
|
||||
log_combat(user, target, "stung", "blind sting")
|
||||
to_chat(target, "<span class='danger'>Your eyes burn horrifically!</span>")
|
||||
target.become_nearsighted(EYE_DAMAGE)
|
||||
target.blind_eyes(20)
|
||||
target.blur_eyes(40)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/LSD
|
||||
name = "Hallucination Sting"
|
||||
desc = "Causes terror in the target and deals a minor amount of toxin damage."
|
||||
helptext = "We evolve the ability to sting a target with a powerful toxic hallucinogenic chemical. The target does not notice they have been stung, and the effect begins instantaneously. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_lsd"
|
||||
chemical_cost = 10
|
||||
dna_cost = 1
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_lsd"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/target)
|
||||
log_combat(user, target, "stung", "LSD sting")
|
||||
if(target.reagents)
|
||||
target.reagents.add_reagent("regenerative_materia", 5)
|
||||
target.reagents.add_reagent("mindbreaker", 5)
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/cryo
|
||||
name = "Cryogenic Sting"
|
||||
desc = "We silently sting a human with a cocktail of chemicals that freeze them."
|
||||
helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing. This ability is somewhat loud, and carries a small risk of our blood gaining violent sensitivity to heat."
|
||||
sting_icon = "sting_cryo"
|
||||
chemical_cost = 15
|
||||
dna_cost = 2
|
||||
loudness = 1
|
||||
action_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
action_icon_state = "ling_sting_cryo"
|
||||
action_background_icon_state = "bg_ling"
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/cryo/sting_action(mob/user, mob/target)
|
||||
log_combat(user, target, "stung", "cryo sting")
|
||||
if(target.reagents)
|
||||
target.reagents.add_reagent("frostoil", 30)
|
||||
return TRUE
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
var/burndamage = L.getFireLoss()
|
||||
var/oxydamage = L.getOxyLoss()
|
||||
var/totaldamage = brutedamage + burndamage + oxydamage
|
||||
if(!totaldamage && (!L.reagents || !L.reagents.has_reagent(/datum/reagent/water/holywater)))
|
||||
if(!totaldamage && (!L.reagents || !L.reagents.has_reagent("holywater")))
|
||||
to_chat(ranged_ability_user, "<span class='inathneq'>\"[L] is unhurt and untainted.\"</span>")
|
||||
return TRUE
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
to_chat(ranged_ability_user, "<span class='brass'>You bathe [L == ranged_ability_user ? "yourself":"[L]"] in Inath-neq's power!</span>")
|
||||
var/targetturf = get_turf(L)
|
||||
var/has_holy_water = (L.reagents && L.reagents.has_reagent(/datum/reagent/water/holywater))
|
||||
var/has_holy_water = (L.reagents && L.reagents.has_reagent("holywater"))
|
||||
var/healseverity = max(round(totaldamage*0.05, 1), 1) //shows the general severity of the damage you just healed, 1 glow per 20
|
||||
for(var/i in 1 to healseverity)
|
||||
new /obj/effect/temp_visual/heal(targetturf, "#1E8CE1")
|
||||
@@ -129,7 +129,7 @@
|
||||
playsound(targetturf, 'sound/magic/staff_healing.ogg', 50, 1)
|
||||
|
||||
if(has_holy_water)
|
||||
L.reagents.del_reagent(/datum/reagent/water/holywater)
|
||||
L.reagents.remove_reagent("holywater", 1000)
|
||||
|
||||
remove_ranged_ability()
|
||||
|
||||
|
||||
@@ -180,11 +180,9 @@
|
||||
access_display(user)
|
||||
|
||||
/obj/item/clockwork/slab/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(is_servant_of_ratvar(user) && linking && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
linking = null
|
||||
to_chat(user, "<span class='notice'>Object link canceled.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/clockwork/slab/proc/access_display(mob/living/user)
|
||||
if(!is_servant_of_ratvar(user))
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
return
|
||||
if(client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if(!message)
|
||||
return
|
||||
src.log_talk(message, LOG_SAY, tag="clockwork eminence")
|
||||
@@ -98,7 +98,7 @@
|
||||
else
|
||||
to_chat(M, message)
|
||||
|
||||
/mob/camera/eminence/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
/mob/camera/eminence/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
. = ..()
|
||||
if(is_reebe(z) || is_servant_of_ratvar(speaker) || GLOB.ratvar_approaches || GLOB.ratvar_awakens) //Away from Reebe, the Eminence can't hear anything
|
||||
to_chat(src, message)
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
if(check_cult_victory())
|
||||
parts += "<span class='greentext big'>The cult has succeeded! Nar'Sie has snuffed out another torch in the void!</span>"
|
||||
else
|
||||
parts += "<span class='redtext big'>The staff managed to stop the cult! Dark words and heresy are no match for Kinaris's finest!</span>"
|
||||
parts += "<span class='redtext big'>The staff managed to stop the cult! Dark words and heresy are no match for Nanotrasen's finest!</span>"
|
||||
|
||||
if(objectives.len)
|
||||
parts += "<b>The cultists' objectives were:</b>"
|
||||
|
||||
@@ -502,7 +502,7 @@
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "holyflask"
|
||||
color = "#333333"
|
||||
list_reagents = list(/datum/reagent/fuel/unholywater = 50)
|
||||
list_reagents = list("unholywater" = 50)
|
||||
|
||||
/obj/item/shuttle_curse
|
||||
name = "cursed orb"
|
||||
@@ -809,7 +809,7 @@
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.stat != DEAD)
|
||||
H.reagents.add_reagent(/datum/reagent/fuel/unholywater, 4)
|
||||
H.reagents.add_reagent("unholywater", 4)
|
||||
if(isshade(target) || isconstruct(target))
|
||||
var/mob/living/simple_animal/M = target
|
||||
if(M.health+5 < M.maxHealth)
|
||||
@@ -910,7 +910,7 @@
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.stat != DEAD)
|
||||
H.reagents.add_reagent(/datum/reagent/fuel/unholywater, 7)
|
||||
H.reagents.add_reagent("unholywater", 7)
|
||||
if(isshade(target) || isconstruct(target))
|
||||
var/mob/living/simple_animal/M = target
|
||||
if(M.health+15 < M.maxHealth)
|
||||
|
||||
@@ -24,11 +24,11 @@ This file contains the cult dagger and rune list code
|
||||
|
||||
/obj/item/melee/cultblade/dagger/attack(mob/living/M, mob/living/user)
|
||||
if(iscultist(M))
|
||||
if(M.reagents && M.reagents.has_reagent(/datum/reagent/water/holywater)) //allows cultists to be rescued from the clutches of ordained religion
|
||||
if(M.reagents && M.reagents.has_reagent("holywater")) //allows cultists to be rescued from the clutches of ordained religion
|
||||
to_chat(user, "<span class='cult'>You remove the taint from [M].</span>" )
|
||||
var/holy2unholy = M.reagents.get_reagent_amount(/datum/reagent/water/holywater)
|
||||
M.reagents.del_reagent(/datum/reagent/water/holywater)
|
||||
M.reagents.add_reagent(/datum/reagent/fuel/unholywater,holy2unholy)
|
||||
var/holy2unholy = M.reagents.get_reagent_amount("holywater")
|
||||
M.reagents.del_reagent("holywater")
|
||||
M.reagents.add_reagent("unholywater",holy2unholy)
|
||||
log_combat(user, M, "smacked", src, " removing the holy water from them")
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
@@ -384,14 +384,14 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
|
||||
if(BANISH_WATER)
|
||||
if(iscarbon(body))
|
||||
var/mob/living/carbon/H = body
|
||||
return H.reagents.has_reagent(/datum/reagent/water/holywater)
|
||||
return H.reagents.has_reagent("holy water")
|
||||
return 0
|
||||
if(BANISH_COFFIN)
|
||||
return (body && istype(body.loc, /obj/structure/closet/crate/coffin))
|
||||
if(BANISH_FORMALDYHIDE)
|
||||
if(iscarbon(body))
|
||||
var/mob/living/carbon/H = body
|
||||
return H.reagents.has_reagent(/datum/reagent/toxin/formaldehyde)
|
||||
return H.reagents.has_reagent("formaldehyde")
|
||||
return 0
|
||||
if(BANISH_RUNES)
|
||||
if(body)
|
||||
|
||||
@@ -57,7 +57,7 @@ GLOBAL_LIST_INIT(disease_ability_singletons, list(
|
||||
var/short_desc = ""
|
||||
var/long_desc = ""
|
||||
var/stat_block = ""
|
||||
var/threshold_block = list()
|
||||
var/threshold_block = ""
|
||||
var/category = ""
|
||||
|
||||
var/list/symptoms
|
||||
@@ -76,7 +76,7 @@ GLOBAL_LIST_INIT(disease_ability_singletons, list(
|
||||
resistance += initial(S.resistance)
|
||||
stage_speed += initial(S.stage_speed)
|
||||
transmittable += initial(S.transmittable)
|
||||
threshold_block += initial(S.threshold_desc)
|
||||
threshold_block += "<br><br>[initial(S.threshold_desc)]"
|
||||
stat_block = "Resistance: [resistance]<br>Stealth: [stealth]<br>Stage Speed: [stage_speed]<br>Transmissibility: [transmittable]<br><br>"
|
||||
if(symptoms.len == 1) //lazy boy's dream
|
||||
name = initial(S.name)
|
||||
|
||||
@@ -118,7 +118,7 @@ the new instance inside the host to be updated to the template's stats.
|
||||
follow_next(Dir & NORTHWEST)
|
||||
last_move_tick = world.time
|
||||
|
||||
/mob/camera/disease/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
/mob/camera/disease/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
. = ..()
|
||||
var/atom/movable/to_follow = speaker
|
||||
if(radio_freq)
|
||||
@@ -130,7 +130,7 @@ the new instance inside the host to be updated to the template's stats.
|
||||
else
|
||||
link = ""
|
||||
// Recompose the message, because it's scrambled by default
|
||||
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
|
||||
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode)
|
||||
to_chat(src, "[link] [message]")
|
||||
|
||||
|
||||
@@ -325,11 +325,7 @@ the new instance inside the host to be updated to the template's stats.
|
||||
var/list/dat = list()
|
||||
|
||||
if(examining_ability)
|
||||
dat += "<a href='byond://?src=[REF(src)];main_menu=1'>Back</a><br>"
|
||||
dat += "<h1>[examining_ability.name]</h1>"
|
||||
dat += "[examining_ability.stat_block][examining_ability.long_desc][examining_ability.threshold_block]"
|
||||
for(var/entry in examining_ability.threshold_block)
|
||||
dat += "<b>[entry]</b>: [examining_ability.threshold_block[entry]]<br>"
|
||||
dat += "<a href='byond://?src=[REF(src)];main_menu=1'>Back</a><br><h1>[examining_ability.name]</h1>[examining_ability.stat_block][examining_ability.long_desc][examining_ability.threshold_block]"
|
||||
else
|
||||
dat += "<h1>Disease Statistics</h1><br>\
|
||||
Resistance: [DT.totalResistance()]<br>\
|
||||
|
||||
@@ -34,12 +34,6 @@
|
||||
. = ..()
|
||||
name_source = GLOB.commando_names
|
||||
|
||||
/datum/antagonist/ert/deathsquad/apply_innate_effects(mob/living/mob_override)
|
||||
ADD_TRAIT(owner, TRAIT_DISK_VERIFIER, DEATHSQUAD_TRAIT)
|
||||
|
||||
/datum/antagonist/ert/deathsquad/remove_innate_effects(mob/living/mob_override)
|
||||
REMOVE_TRAIT(owner, TRAIT_DISK_VERIFIER, DEATHSQUAD_TRAIT)
|
||||
|
||||
/datum/antagonist/ert/security // kinda handled by the base template but here for completion
|
||||
|
||||
/datum/antagonist/ert/security/red
|
||||
@@ -121,7 +115,7 @@
|
||||
|
||||
to_chat(owner, "<B><font size=3 color=red>You are the [name].</font></B>")
|
||||
|
||||
var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Kinaris's Security Division."
|
||||
var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Nanotrasen's Security Division."
|
||||
if(leader) //If Squad Leader
|
||||
missiondesc += " Lead your squad to ensure the completion of the mission. Board the shuttle when your team is ready."
|
||||
else
|
||||
@@ -138,7 +132,7 @@
|
||||
|
||||
to_chat(owner, "<B><font size=3 color=red>You are the [name].</font></B>")
|
||||
|
||||
var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Kinaris's Security Division."
|
||||
var/missiondesc = "Your squad is being sent on a mission to [station_name()] by Nanotrasen's Security Division."
|
||||
if(leader) //If Squad Leader
|
||||
missiondesc += " Lead your squad to ensure the completion of the mission. Board the shuttle when your team is ready."
|
||||
else
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
var/default_timer_set = 90
|
||||
var/minimum_timer_set = 90
|
||||
var/maximum_timer_set = 3600
|
||||
ui_style = "nanotrasen"
|
||||
var/ui_style = "nanotrasen"
|
||||
|
||||
var/numeric_input = ""
|
||||
var/ui_mode = NUKEUI_AWAIT_DISK
|
||||
var/timing = FALSE
|
||||
var/exploding = FALSE
|
||||
var/exploded = FALSE
|
||||
@@ -98,8 +97,6 @@
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
auth = I
|
||||
update_ui_mode()
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -236,167 +233,120 @@
|
||||
var/volume = (get_time_left() <= 20 ? 30 : 5)
|
||||
playsound(loc, 'sound/items/timer.ogg', volume, 0)
|
||||
|
||||
/obj/machinery/nuclearbomb/proc/update_ui_mode()
|
||||
if(exploded)
|
||||
ui_mode = NUKEUI_EXPLODED
|
||||
return
|
||||
|
||||
if(!auth)
|
||||
ui_mode = NUKEUI_AWAIT_DISK
|
||||
return
|
||||
|
||||
if(timing)
|
||||
ui_mode = NUKEUI_TIMING
|
||||
return
|
||||
|
||||
if(!safety)
|
||||
ui_mode = NUKEUI_AWAIT_ARM
|
||||
return
|
||||
|
||||
if(!yes_code)
|
||||
ui_mode = NUKEUI_AWAIT_CODE
|
||||
return
|
||||
|
||||
ui_mode = NUKEUI_AWAIT_TIMER
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "nuclear_bomb", name, 350, 442, master_ui, state)
|
||||
ui = new(user, src, ui_key, "nuclear_bomb", name, 500, 600, master_ui, state)
|
||||
ui.set_style(ui_style)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["disk_present"] = auth
|
||||
var/hidden_code = (ui_mode == NUKEUI_AWAIT_CODE && numeric_input != "ERROR")
|
||||
var/current_code = ""
|
||||
if(hidden_code)
|
||||
while(length(current_code) < length(numeric_input))
|
||||
current_code = "[current_code]*"
|
||||
else
|
||||
current_code = numeric_input
|
||||
while(length(current_code) < 5)
|
||||
current_code = "[current_code]-"
|
||||
|
||||
data["code_approved"] = yes_code
|
||||
var/first_status
|
||||
var/second_status
|
||||
switch(ui_mode)
|
||||
if(NUKEUI_AWAIT_DISK)
|
||||
first_status = "DEVICE LOCKED"
|
||||
if(timing)
|
||||
second_status = "TIME: [get_time_left()]"
|
||||
else
|
||||
second_status = "AWAIT DISK"
|
||||
if(NUKEUI_AWAIT_CODE)
|
||||
first_status = "INPUT CODE"
|
||||
second_status = "CODE: [current_code]"
|
||||
if(NUKEUI_AWAIT_TIMER)
|
||||
first_status = "INPUT TIME"
|
||||
second_status = "TIME: [current_code]"
|
||||
if(NUKEUI_AWAIT_ARM)
|
||||
first_status = "DEVICE READY"
|
||||
second_status = "TIME: [get_time_left()]"
|
||||
if(NUKEUI_TIMING)
|
||||
first_status = "DEVICE ARMED"
|
||||
second_status = "TIME: [get_time_left()]"
|
||||
if(NUKEUI_EXPLODED)
|
||||
first_status = "DEVICE DEPLOYED"
|
||||
second_status = "THANK YOU"
|
||||
|
||||
if(auth)
|
||||
if(yes_code)
|
||||
first_status = timing ? "Func/Set" : "Functional"
|
||||
else
|
||||
first_status = "Auth S2."
|
||||
else
|
||||
if(timing)
|
||||
first_status = "Set"
|
||||
else
|
||||
first_status = "Auth S1."
|
||||
var/second_status = exploded ? "Warhead triggered, thanks for flying Nanotrasen" : (safety ? "Safe" : "Engaged")
|
||||
data["status1"] = first_status
|
||||
data["status2"] = second_status
|
||||
data["anchored"] = anchored
|
||||
data["safety"] = safety
|
||||
data["timing"] = timing
|
||||
data["time_left"] = get_time_left()
|
||||
|
||||
data["timer_set"] = timer_set
|
||||
data["timer_is_not_default"] = timer_set != default_timer_set
|
||||
data["timer_is_not_min"] = timer_set != minimum_timer_set
|
||||
data["timer_is_not_max"] = timer_set != maximum_timer_set
|
||||
|
||||
var/message = "AUTH"
|
||||
if(auth)
|
||||
message = "[numeric_input]"
|
||||
if(yes_code)
|
||||
message = "*****"
|
||||
data["message"] = message
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
playsound(src, "terminal_type", 20, FALSE)
|
||||
switch(action)
|
||||
if("eject_disk")
|
||||
if(auth && auth.loc == src)
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
auth.forceMove(get_turf(src))
|
||||
auth = null
|
||||
. = TRUE
|
||||
else
|
||||
if("insert_disk")
|
||||
if(!auth)
|
||||
var/obj/item/I = usr.is_holding_item_of_type(/obj/item/disk/nuclear)
|
||||
if(I && disk_check(I) && usr.transferItemToLoc(I, src))
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
auth = I
|
||||
. = TRUE
|
||||
update_ui_mode()
|
||||
if("keypad")
|
||||
if(auth)
|
||||
var/digit = params["digit"]
|
||||
switch(digit)
|
||||
if("C")
|
||||
if(auth && ui_mode == NUKEUI_AWAIT_ARM)
|
||||
set_safety()
|
||||
yes_code = FALSE
|
||||
playsound(src, 'sound/machines/nuke/confirm_beep.ogg', 50, FALSE)
|
||||
update_ui_mode()
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
if("R")
|
||||
numeric_input = ""
|
||||
yes_code = FALSE
|
||||
. = TRUE
|
||||
if("E")
|
||||
switch(ui_mode)
|
||||
if(NUKEUI_AWAIT_CODE)
|
||||
if(numeric_input == r_code)
|
||||
numeric_input = ""
|
||||
yes_code = TRUE
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
. = TRUE
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
numeric_input = "ERROR"
|
||||
if(NUKEUI_AWAIT_TIMER)
|
||||
var/number_value = text2num(numeric_input)
|
||||
if(number_value)
|
||||
timer_set = CLAMP(number_value, minimum_timer_set, maximum_timer_set)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
set_safety()
|
||||
. = TRUE
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
update_ui_mode()
|
||||
if(numeric_input == r_code)
|
||||
numeric_input = ""
|
||||
yes_code = TRUE
|
||||
. = TRUE
|
||||
else
|
||||
numeric_input = "ERROR"
|
||||
if("0","1","2","3","4","5","6","7","8","9")
|
||||
if(numeric_input != "ERROR")
|
||||
numeric_input += digit
|
||||
if(length(numeric_input) > 5)
|
||||
numeric_input = "ERROR"
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
. = TRUE
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
if("arm")
|
||||
if(auth && yes_code && !safety && !exploded)
|
||||
playsound(src, 'sound/machines/nuke/confirm_beep.ogg', 50, FALSE)
|
||||
set_active()
|
||||
update_ui_mode()
|
||||
if("timer")
|
||||
if(auth && yes_code)
|
||||
var/change = params["change"]
|
||||
if(change == "reset")
|
||||
timer_set = default_timer_set
|
||||
else if(change == "decrease")
|
||||
timer_set = max(minimum_timer_set, timer_set - 10)
|
||||
else if(change == "increase")
|
||||
timer_set = min(maximum_timer_set, timer_set + 10)
|
||||
else if(change == "input")
|
||||
var/user_input = input(usr, "Set time to detonation.", name) as null|num
|
||||
if(!user_input)
|
||||
return
|
||||
var/N = text2num(user_input)
|
||||
if(!N)
|
||||
return
|
||||
timer_set = CLAMP(N,minimum_timer_set,maximum_timer_set)
|
||||
. = TRUE
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
if("safety")
|
||||
if(auth && yes_code && !exploded)
|
||||
set_safety()
|
||||
if("anchor")
|
||||
if(auth && yes_code)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
set_anchor()
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
if("toggle_timer")
|
||||
if(auth && yes_code && !safety && !exploded)
|
||||
set_active()
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/proc/set_anchor()
|
||||
if(isinspace() && !anchored)
|
||||
to_chat(usr, "<span class='warning'>There is nothing to anchor to!</span>")
|
||||
else
|
||||
if(!isinspace())
|
||||
anchored = !anchored
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>There is nothing to anchor to!</span>")
|
||||
|
||||
/obj/machinery/nuclearbomb/proc/set_safety()
|
||||
safety = !safety
|
||||
@@ -563,7 +513,7 @@
|
||||
/obj/machinery/nuclearbomb/beer/proc/fizzbuzz()
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
R.my_atom = src
|
||||
R.add_reagent(/datum/reagent/consumable/ethanol/beer, 100)
|
||||
R.add_reagent("beer", 100)
|
||||
|
||||
var/datum/effect_system/foam_spread/foam = new
|
||||
foam.set_up(200, get_turf(src), R)
|
||||
@@ -661,7 +611,10 @@ This is here to make the tiles around the station mininuke change when it's arme
|
||||
if(!fake)
|
||||
return
|
||||
|
||||
if(isobserver(user) || HAS_TRAIT(user, TRAIT_DISK_VERIFIER) || (user.mind && HAS_TRAIT(user.mind, TRAIT_DISK_VERIFIER)))
|
||||
var/ghost = isobserver(user)
|
||||
var/captain = user.mind && user.mind.assigned_role == "Captain"
|
||||
var/nukie = user.mind && user.mind.has_antag_datum(/datum/antagonist/nukeop)
|
||||
if(ghost || captain || nukie)
|
||||
. += "<span class='warning'>The serial numbers on [src] are incorrect.</span>"
|
||||
|
||||
/obj/item/disk/nuclear/attackby(obj/item/I, mob/living/user, params)
|
||||
@@ -700,7 +653,3 @@ This is here to make the tiles around the station mininuke change when it's arme
|
||||
|
||||
/obj/item/disk/nuclear/fake
|
||||
fake = TRUE
|
||||
|
||||
/obj/item/disk/nuclear/fake/obvious
|
||||
name = "cheap plastic imitation of the nuclear authentication disk"
|
||||
desc = "How anyone could mistake this for the real thing is beyond you."
|
||||
|
||||
@@ -24,13 +24,11 @@
|
||||
var/mob/living/M = mob_override || owner.current
|
||||
M.mirrorcanloadappearance = TRUE //Also gives them the option to use a mirror to load their custom character. Good luck if they use a plasma.
|
||||
update_synd_icons_added(M)
|
||||
ADD_TRAIT(owner, TRAIT_DISK_VERIFIER, NUKEOP_TRAIT)
|
||||
|
||||
/datum/antagonist/nukeop/remove_innate_effects(mob/living/mob_override)
|
||||
var/mob/living/M = mob_override || owner.current
|
||||
M.mirrorcanloadappearance = FALSE
|
||||
update_synd_icons_removed(M)
|
||||
REMOVE_TRAIT(owner, TRAIT_DISK_VERIFIER, NUKEOP_TRAIT)
|
||||
|
||||
/datum/antagonist/nukeop/proc/equip_op()
|
||||
if(!ishuman(owner.current))
|
||||
@@ -44,6 +42,7 @@
|
||||
owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/ops.ogg',100,0)
|
||||
to_chat(owner, "<span class='notice'>You are a [nuke_team ? nuke_team.syndicate_name : "syndicate"] agent!</span>")
|
||||
owner.announce_objectives()
|
||||
return
|
||||
|
||||
/datum/antagonist/nukeop/on_gain()
|
||||
give_alias()
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
spacewalk = TRUE
|
||||
sight = SEE_SELF
|
||||
throwforce = 0
|
||||
rad_flags = RAD_NO_CONTAMINATE | RAD_PROTECT_CONTENTS
|
||||
|
||||
see_in_dark = 8
|
||||
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
ShiftClickOn(A)
|
||||
return
|
||||
if(modifiers["alt"])
|
||||
altclick_listed_turf(A)
|
||||
AltClickNoInteract(src, A)
|
||||
return
|
||||
|
||||
if(iscarbon(A))
|
||||
@@ -351,7 +351,7 @@
|
||||
to_chat(H, "<span class='revenminor'>You feel [pick("suddenly sick", "a surge of nausea", "like your skin is <i>wrong</i>")].</span>")
|
||||
else
|
||||
if(mob.reagents)
|
||||
mob.reagents.add_reagent(/datum/reagent/toxin/plasma, 5)
|
||||
mob.reagents.add_reagent("plasma", 5)
|
||||
else
|
||||
mob.adjustToxLoss(5)
|
||||
for(var/obj/structure/spacevine/vine in T) //Fucking with botanists, the ability.
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
job_description = "Swarmer"
|
||||
death = FALSE
|
||||
roundstart = FALSE
|
||||
short_desc = "You are a swarmer, a weapon of a long dead civilization."
|
||||
flavour_text = {"
|
||||
<b>You are a swarmer, a weapon of a long dead civilization. Until further orders from your original masters are received, you must continue to consume and replicate.</b>
|
||||
<b>Clicking on any object will try to consume it, either deconstructing it into its components, destroying it, or integrating any materials it has into you if successful.</b>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/datum/antagonist/traitor/internal_affairs
|
||||
name = "Internal Affairs Agent"
|
||||
employer = "Kinaris"
|
||||
employer = "Nanotrasen"
|
||||
special_role = "internal affairs agent"
|
||||
antagpanel_category = "IAA"
|
||||
var/syndicate = FALSE
|
||||
@@ -242,7 +242,7 @@
|
||||
to_chat(owner.current, "<span class='userdanger'>You are the [special_role].</span>")
|
||||
if(syndicate)
|
||||
to_chat(owner.current, "<span class='userdanger'>Your target has been framed for [crime], and you have been tasked with eliminating them to prevent them defending themselves in court.</span>")
|
||||
to_chat(owner.current, "<B><font size=5 color=red>Any damage you cause will be a further embarrassment to Kinaris, so you have no limits on collateral damage.</font></B>")
|
||||
to_chat(owner.current, "<B><font size=5 color=red>Any damage you cause will be a further embarrassment to Nanotrasen, so you have no limits on collateral damage.</font></B>")
|
||||
to_chat(owner.current, "<span class='userdanger'> You have been provided with a standard uplink to accomplish your task. </span>")
|
||||
to_chat(owner.current, "<span class='userdanger'>By no means reveal that you, or any other NT employees, are undercover agents.</span>")
|
||||
else
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
owner.special_role = special_role
|
||||
if(give_objectives)
|
||||
forge_traitor_objectives()
|
||||
RegisterSignal(owner.current, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
|
||||
finalize_traitor()
|
||||
..()
|
||||
|
||||
@@ -49,18 +48,12 @@
|
||||
A.verbs -= /mob/living/silicon/ai/proc/choose_modules
|
||||
A.malf_picker.remove_malf_verbs(A)
|
||||
qdel(A.malf_picker)
|
||||
UnregisterSignal(owner.current, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
|
||||
|
||||
SSticker.mode.traitors -= owner
|
||||
if(!silent && owner.current)
|
||||
to_chat(owner.current,"<span class='userdanger'> You are no longer the [special_role]! </span>")
|
||||
owner.special_role = null
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/traitor/proc/handle_hearing(datum/source, list/hearing_args)
|
||||
var/message = hearing_args[HEARING_MESSAGE]
|
||||
message = GLOB.syndicate_code_phrase_regex.Replace(message, "<span class='blue'>$1</span>")
|
||||
message = GLOB.syndicate_code_response_regex.Replace(message, "<span class='red'>$1</span>")
|
||||
hearing_args[HEARING_MESSAGE] = message
|
||||
..()
|
||||
|
||||
/datum/antagonist/traitor/proc/add_objective(var/datum/objective/O)
|
||||
owner.objectives += O
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
var/wizard_name_second = pick(GLOB.wizard_second)
|
||||
var/randomname = "[wizard_name_first] [wizard_name_second]"
|
||||
var/mob/living/wiz_mob = owner.current
|
||||
var/newname = reject_bad_name(stripped_input(wiz_mob, "You are the [name]. Would you like to change your name to something else?", "Name change", randomname, MAX_NAME_LEN), TRUE)
|
||||
var/newname = copytext(sanitize(input(wiz_mob, "You are the [name]. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
var/code = DEFAULT_SIGNALER_CODE
|
||||
var/frequency = FREQ_SIGNALER
|
||||
var/delay = 0
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/suicider = null
|
||||
var/hearing_range = 1
|
||||
@@ -47,50 +48,64 @@
|
||||
holder.update_icon()
|
||||
return
|
||||
|
||||
/obj/item/assembly/signaler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
if(!is_secured(user))
|
||||
/obj/item/assembly/signaler/ui_interact(mob/user, flag1)
|
||||
. = ..()
|
||||
if(is_secured(user))
|
||||
var/t1 = "-------"
|
||||
var/dat = {"
|
||||
<TT>
|
||||
|
||||
<A href='byond://?src=[REF(src)];send=1'>Send Signal</A><BR>
|
||||
<B>Frequency/Code</B> for signaler:<BR>
|
||||
Frequency:
|
||||
[format_frequency(src.frequency)]
|
||||
<A href='byond://?src=[REF(src)];set=freq'>Set</A><BR>
|
||||
|
||||
Code:
|
||||
[src.code]
|
||||
<A href='byond://?src=[REF(src)];set=code'>Set</A><BR>
|
||||
[t1]
|
||||
</TT>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/ui_width = 280
|
||||
var/ui_height = 132
|
||||
ui = new(user, src, ui_key, "signaler", name, ui_width, ui_height, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/assembly/signaler/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["frequency"] = frequency
|
||||
data["code"] = code
|
||||
data["minFrequency"] = MIN_FREE_FREQ
|
||||
data["maxFrequency"] = MAX_FREE_FREQ
|
||||
|
||||
return data
|
||||
/obj/item/assembly/signaler/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
/obj/item/assembly/signaler/ui_act(action, params)
|
||||
if(..())
|
||||
if(!usr.canUseTopic(src, BE_CLOSE))
|
||||
usr << browse(null, "window=radio")
|
||||
onclose(usr, "radio")
|
||||
return
|
||||
switch(action)
|
||||
if("signal")
|
||||
INVOKE_ASYNC(src, .proc/signal)
|
||||
. = TRUE
|
||||
if("freq")
|
||||
frequency = unformat_frequency(params["freq"])
|
||||
frequency = sanitize_frequency(frequency, TRUE)
|
||||
set_frequency(frequency)
|
||||
. = TRUE
|
||||
if("code")
|
||||
code = text2num(params["code"])
|
||||
code = round(code)
|
||||
. = TRUE
|
||||
if("reset")
|
||||
if(params["reset"] == "freq")
|
||||
frequency = initial(frequency)
|
||||
else
|
||||
code = initial(code)
|
||||
. = TRUE
|
||||
|
||||
update_icon()
|
||||
|
||||
if (href_list["set"])
|
||||
|
||||
if(href_list["set"] == "freq")
|
||||
var/new_freq = input(usr, "Input a new signalling frequency", "Remote Signaller Frequency", format_frequency(frequency)) as num|null
|
||||
if(!usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
new_freq = unformat_frequency(new_freq)
|
||||
new_freq = sanitize_frequency(new_freq, TRUE)
|
||||
set_frequency(new_freq)
|
||||
|
||||
if(href_list["set"] == "code")
|
||||
var/new_code = input(usr, "Input a new signalling code", "Remote Signaller Code", code) as num|null
|
||||
if(!usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
new_code = round(new_code)
|
||||
new_code = CLAMP(new_code, 1, 100)
|
||||
code = new_code
|
||||
|
||||
if(href_list["send"])
|
||||
spawn( 0 )
|
||||
signal()
|
||||
|
||||
if(usr)
|
||||
attack_self(usr)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/assembly/signaler/attackby(obj/item/W, mob/user, params)
|
||||
if(issignaler(W))
|
||||
var/obj/item/assembly/signaler/signaler2 = W
|
||||
|
||||
@@ -1,101 +1,101 @@
|
||||
#define INCLUSIVE_MODE 1
|
||||
#define EXCLUSIVE_MODE 2
|
||||
#define RECOGNIZER_MODE 3
|
||||
#define VOICE_SENSOR_MODE 4
|
||||
|
||||
/obj/item/assembly/voice
|
||||
name = "voice analyzer"
|
||||
desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated."
|
||||
icon_state = "voice"
|
||||
materials = list(MAT_METAL=500, MAT_GLASS=50)
|
||||
flags_1 = HEAR_1
|
||||
attachable = TRUE
|
||||
verb_say = "beeps"
|
||||
verb_ask = "beeps"
|
||||
verb_exclaim = "beeps"
|
||||
var/listening = FALSE
|
||||
var/recorded = "" //the activation message
|
||||
var/mode = 1
|
||||
var/static/list/modes = list("inclusive",
|
||||
"exclusive",
|
||||
"recognizer",
|
||||
"voice sensor")
|
||||
|
||||
/obj/item/assembly/voice/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Use a multitool to swap between \"inclusive\", \"exclusive\", \"recognizer\", and \"voice sensor\" mode.</span>"
|
||||
|
||||
/obj/item/assembly/voice/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
. = ..()
|
||||
if(speaker == src)
|
||||
return
|
||||
|
||||
if(listening && !radio_freq)
|
||||
record_speech(speaker, raw_message, message_language)
|
||||
else
|
||||
if(check_activation(speaker, raw_message))
|
||||
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
|
||||
|
||||
/obj/item/assembly/voice/proc/record_speech(atom/movable/speaker, raw_message, datum/language/message_language)
|
||||
switch(mode)
|
||||
if(INCLUSIVE_MODE)
|
||||
recorded = raw_message
|
||||
listening = FALSE
|
||||
say("Activation message is '[recorded]'.", message_language)
|
||||
if(EXCLUSIVE_MODE)
|
||||
recorded = raw_message
|
||||
listening = FALSE
|
||||
say("Activation message is '[recorded]'.", message_language)
|
||||
if(RECOGNIZER_MODE)
|
||||
recorded = speaker.GetVoice()
|
||||
listening = FALSE
|
||||
say("Your voice pattern is saved.", message_language)
|
||||
if(VOICE_SENSOR_MODE)
|
||||
if(length(raw_message))
|
||||
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
|
||||
|
||||
/obj/item/assembly/voice/proc/check_activation(atom/movable/speaker, raw_message)
|
||||
. = FALSE
|
||||
switch(mode)
|
||||
if(INCLUSIVE_MODE)
|
||||
if(findtext(raw_message, recorded))
|
||||
. = TRUE
|
||||
if(EXCLUSIVE_MODE)
|
||||
if(raw_message == recorded)
|
||||
. = TRUE
|
||||
if(RECOGNIZER_MODE)
|
||||
if(speaker.GetVoice() == recorded)
|
||||
. = TRUE
|
||||
if(VOICE_SENSOR_MODE)
|
||||
if(length(raw_message))
|
||||
. = TRUE
|
||||
|
||||
/obj/item/assembly/voice/multitool_act(mob/living/user, obj/item/I)
|
||||
mode %= modes.len
|
||||
mode++
|
||||
to_chat(user, "<span class='notice'>You set [src] into [modes[mode]] mode.</span>")
|
||||
listening = FALSE
|
||||
recorded = ""
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/voice/activate()
|
||||
if(!secured || holder)
|
||||
return FALSE
|
||||
listening = !listening
|
||||
say("[listening ? "Now" : "No longer"] recording input.")
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/voice/attack_self(mob/user)
|
||||
if(!user)
|
||||
return FALSE
|
||||
activate()
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/voice/toggle_secure()
|
||||
. = ..()
|
||||
listening = FALSE
|
||||
|
||||
#undef INCLUSIVE_MODE
|
||||
#undef EXCLUSIVE_MODE
|
||||
#undef RECOGNIZER_MODE
|
||||
#undef VOICE_SENSOR_MODE
|
||||
#define INCLUSIVE_MODE 1
|
||||
#define EXCLUSIVE_MODE 2
|
||||
#define RECOGNIZER_MODE 3
|
||||
#define VOICE_SENSOR_MODE 4
|
||||
|
||||
/obj/item/assembly/voice
|
||||
name = "voice analyzer"
|
||||
desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated."
|
||||
icon_state = "voice"
|
||||
materials = list(MAT_METAL=500, MAT_GLASS=50)
|
||||
flags_1 = HEAR_1
|
||||
attachable = TRUE
|
||||
verb_say = "beeps"
|
||||
verb_ask = "beeps"
|
||||
verb_exclaim = "beeps"
|
||||
var/listening = FALSE
|
||||
var/recorded = "" //the activation message
|
||||
var/mode = 1
|
||||
var/static/list/modes = list("inclusive",
|
||||
"exclusive",
|
||||
"recognizer",
|
||||
"voice sensor")
|
||||
|
||||
/obj/item/assembly/voice/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Use a multitool to swap between \"inclusive\", \"exclusive\", \"recognizer\", and \"voice sensor\" mode.</span>"
|
||||
|
||||
/obj/item/assembly/voice/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
. = ..()
|
||||
if(speaker == src)
|
||||
return
|
||||
|
||||
if(listening && !radio_freq)
|
||||
record_speech(speaker, raw_message, message_language)
|
||||
else
|
||||
if(check_activation(speaker, raw_message))
|
||||
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
|
||||
|
||||
/obj/item/assembly/voice/proc/record_speech(atom/movable/speaker, raw_message, datum/language/message_language)
|
||||
switch(mode)
|
||||
if(INCLUSIVE_MODE)
|
||||
recorded = raw_message
|
||||
listening = FALSE
|
||||
say("Activation message is '[recorded]'.", message_language)
|
||||
if(EXCLUSIVE_MODE)
|
||||
recorded = raw_message
|
||||
listening = FALSE
|
||||
say("Activation message is '[recorded]'.", message_language)
|
||||
if(RECOGNIZER_MODE)
|
||||
recorded = speaker.GetVoice()
|
||||
listening = FALSE
|
||||
say("Your voice pattern is saved.", message_language)
|
||||
if(VOICE_SENSOR_MODE)
|
||||
if(length(raw_message))
|
||||
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
|
||||
|
||||
/obj/item/assembly/voice/proc/check_activation(atom/movable/speaker, raw_message)
|
||||
. = FALSE
|
||||
switch(mode)
|
||||
if(INCLUSIVE_MODE)
|
||||
if(findtext(raw_message, recorded))
|
||||
. = TRUE
|
||||
if(EXCLUSIVE_MODE)
|
||||
if(raw_message == recorded)
|
||||
. = TRUE
|
||||
if(RECOGNIZER_MODE)
|
||||
if(speaker.GetVoice() == recorded)
|
||||
. = TRUE
|
||||
if(VOICE_SENSOR_MODE)
|
||||
if(length(raw_message))
|
||||
. = TRUE
|
||||
|
||||
/obj/item/assembly/voice/multitool_act(mob/living/user, obj/item/I)
|
||||
mode %= modes.len
|
||||
mode++
|
||||
to_chat(user, "<span class='notice'>You set [src] into [modes[mode]] mode.</span>")
|
||||
listening = FALSE
|
||||
recorded = ""
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/voice/activate()
|
||||
if(!secured || holder)
|
||||
return FALSE
|
||||
listening = !listening
|
||||
say("[listening ? "Now" : "No longer"] recording input.")
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/voice/attack_self(mob/user)
|
||||
if(!user)
|
||||
return FALSE
|
||||
activate()
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/voice/toggle_secure()
|
||||
. = ..()
|
||||
listening = FALSE
|
||||
|
||||
#undef INCLUSIVE_MODE
|
||||
#undef EXCLUSIVE_MODE
|
||||
#undef RECOGNIZER_MODE
|
||||
#undef VOICE_SENSOR_MODE
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
//used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...)
|
||||
//string parsed by /datum/gas/proc/copy_from_turf
|
||||
var/initial_gas_mix = OPENTURF_DEFAULT_ATMOS
|
||||
var/initial_gas_mix = "o2=22;n2=82;TEMP=293.15"
|
||||
//approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings
|
||||
// If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ GLOBAL_LIST_INIT(meta_gas_overlays, meta_gas_overlay_list())
|
||||
GLOBAL_LIST_INIT(meta_gas_dangers, meta_gas_danger_list())
|
||||
GLOBAL_LIST_INIT(meta_gas_ids, meta_gas_id_list())
|
||||
GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list())
|
||||
|
||||
/datum/gas_mixture
|
||||
var/list/gases = list()
|
||||
var/temperature = 0 //kelvins
|
||||
@@ -338,9 +337,8 @@ GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list())
|
||||
if(!length(cached_gases))
|
||||
return
|
||||
var/list/reactions = list()
|
||||
for(var/datum/gas_reaction/G in SSair.gas_reactions)
|
||||
if(cached_gases[G.major_gas])
|
||||
reactions += G
|
||||
for(var/I in cached_gases)
|
||||
reactions += SSair.gas_reactions[I]
|
||||
if(!length(reactions))
|
||||
return
|
||||
reaction_results = new
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
/proc/init_gas_reactions()
|
||||
. = list()
|
||||
for(var/type in subtypesof(/datum/gas))
|
||||
.[type] = list()
|
||||
|
||||
for(var/r in subtypesof(/datum/gas_reaction))
|
||||
var/datum/gas_reaction/reaction = r
|
||||
@@ -14,19 +16,27 @@
|
||||
var/datum/gas/req_gas = req
|
||||
if (!reaction_key || initial(reaction_key.rarity) > initial(req_gas.rarity))
|
||||
reaction_key = req_gas
|
||||
reaction.major_gas = reaction_key
|
||||
. += reaction
|
||||
sortTim(., /proc/cmp_gas_reaction)
|
||||
.[reaction_key] += list(reaction)
|
||||
sortTim(., /proc/cmp_gas_reactions, TRUE)
|
||||
|
||||
/proc/cmp_gas_reaction(datum/gas_reaction/a, datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list
|
||||
return b.priority - a.priority
|
||||
/proc/cmp_gas_reactions(list/datum/gas_reaction/a, list/datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list
|
||||
if (!length(a) || !length(b))
|
||||
return length(b) - length(a)
|
||||
var/maxa
|
||||
var/maxb
|
||||
for (var/datum/gas_reaction/R in a)
|
||||
if (R.priority > maxa)
|
||||
maxa = R.priority
|
||||
for (var/datum/gas_reaction/R in b)
|
||||
if (R.priority > maxb)
|
||||
maxb = R.priority
|
||||
return maxb - maxa
|
||||
|
||||
/datum/gas_reaction
|
||||
//regarding the requirements lists: the minimum or maximum requirements must be non-zero.
|
||||
//when in doubt, use MINIMUM_MOLE_COUNT.
|
||||
var/list/min_requirements
|
||||
var/list/max_requirements
|
||||
var/major_gas //the highest rarity gas used in the reaction.
|
||||
var/exclude = FALSE //do it this way to allow for addition/removal of reactions midmatch in the future
|
||||
var/priority = 100 //lower numbers are checked/react later than higher numbers. if two reactions have the same priority they may happen in either order
|
||||
var/name = "reaction"
|
||||
|
||||
@@ -386,10 +386,9 @@
|
||||
send_signal(device_id, list("checks" = text2num(params["val"])^2), usr)
|
||||
. = TRUE
|
||||
if("set_external_pressure", "set_internal_pressure")
|
||||
|
||||
var/target = params["value"]
|
||||
if(!isnull(target))
|
||||
|
||||
var/area/A = get_area(src)
|
||||
var/target = input("New target pressure:", name, A.air_vent_info[device_id][(action == "set_external_pressure" ? "external" : "internal")]) as num|null
|
||||
if(!isnull(target) && !..())
|
||||
send_signal(device_id, list("[action]" = target), usr)
|
||||
. = TRUE
|
||||
if("reset_external_pressure")
|
||||
@@ -839,11 +838,11 @@
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/airalarm/AltClick(mob/user)
|
||||
. = ..()
|
||||
..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
|
||||
return
|
||||
togglelock(user)
|
||||
return TRUE
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
/obj/machinery/airalarm/proc/togglelock(mob/living/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -1,341 +1,342 @@
|
||||
// Quick overview:
|
||||
//
|
||||
// Pipes combine to form pipelines
|
||||
// Pipelines and other atmospheric objects combine to form pipe_networks
|
||||
// Note: A single pipe_network represents a completely open space
|
||||
//
|
||||
// Pipes -> Pipelines
|
||||
// Pipelines + Other Objects -> Pipe network
|
||||
|
||||
#define PIPE_VISIBLE_LEVEL 2
|
||||
#define PIPE_HIDDEN_LEVEL 1
|
||||
|
||||
/obj/machinery/atmospherics
|
||||
anchored = TRUE
|
||||
move_resist = INFINITY //Moving a connected machine without actually doing the normal (dis)connection things will probably cause a LOT of issues.
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
layer = GAS_PIPE_HIDDEN_LAYER //under wires
|
||||
resistance_flags = FIRE_PROOF
|
||||
max_integrity = 200
|
||||
obj_flags = CAN_BE_HIT | ON_BLUEPRINTS
|
||||
var/nodealert = 0
|
||||
var/can_unwrench = 0
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/pipe_flags = NONE
|
||||
|
||||
var/global/list/iconsetids = list()
|
||||
var/global/list/pipeimages = list()
|
||||
|
||||
var/image/pipe_vision_img = null
|
||||
|
||||
var/device_type = 0
|
||||
var/list/obj/machinery/atmospherics/nodes
|
||||
|
||||
var/construction_type
|
||||
var/pipe_state //icon_state as a pipe item
|
||||
var/on = FALSE
|
||||
|
||||
/obj/machinery/atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.ventcrawler)
|
||||
. += "<span class='notice'>Alt-click to crawl through it.</span>"
|
||||
|
||||
/obj/machinery/atmospherics/New(loc, process = TRUE, setdir)
|
||||
if(!isnull(setdir))
|
||||
setDir(setdir)
|
||||
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
|
||||
normalize_cardinal_directions()
|
||||
nodes = new(device_type)
|
||||
if (!armor)
|
||||
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 70)
|
||||
..()
|
||||
if(process)
|
||||
SSair.atmos_machinery += src
|
||||
SetInitDirections()
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(var/i in 1 to device_type)
|
||||
nullifyNode(i)
|
||||
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
dropContents()
|
||||
if(pipe_vision_img)
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/destroy_network()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(i)
|
||||
if(nodes[i])
|
||||
var/obj/machinery/atmospherics/N = nodes[i]
|
||||
N.disconnect(src)
|
||||
nodes[i] = null
|
||||
|
||||
/obj/machinery/atmospherics/proc/getNodeConnects()
|
||||
var/list/node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/D in GLOB.cardinals)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[i] = D
|
||||
break
|
||||
return node_connects
|
||||
|
||||
/obj/machinery/atmospherics/proc/normalize_cardinal_directions()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
setDir(NORTH)
|
||||
if(WEST)
|
||||
setDir(EAST)
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
node_connects = getNodeConnects()
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[i]))
|
||||
if(can_be_node(target, i))
|
||||
nodes[i] = target
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
|
||||
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
return connection_check(target, piping_layer)
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
/obj/machinery/atmospherics/proc/findConnecting(direction, prompted_layer)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(connection_check(target, prompted_layer))
|
||||
return target
|
||||
|
||||
/obj/machinery/atmospherics/proc/connection_check(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isConnectable(target, given_layer) && target.isConnectable(src, given_layer) && (target.initialize_directions & get_dir(target,src)))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/isConnectable(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isnull(given_layer))
|
||||
given_layer = piping_layer
|
||||
if((target.piping_layer == given_layer) || (target.pipe_flags & PIPING_ALL_LAYER))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/GetInitDirections()
|
||||
return initialize_directions
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenetAir()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/replacePipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
P.destroy_network()
|
||||
nodes[nodes.Find(reference)] = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pipe)) //lets you autodrop
|
||||
var/obj/item/pipe/pipe = W
|
||||
if(user.dropItemToGround(pipe))
|
||||
pipe.setPipingLayer(piping_layer) //align it with us
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/wrench_act(mob/living/user, obj/item/I)
|
||||
if(!can_unwrench(user))
|
||||
return ..()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first!</span>")
|
||||
return TRUE
|
||||
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
add_fingerprint(user)
|
||||
|
||||
var/unsafe_wrenching = FALSE
|
||||
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
|
||||
if (internal_pressure > 2*ONE_ATMOSPHERE)
|
||||
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
unsafe_wrenching = TRUE //Oh dear oh dear
|
||||
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"<span class='notice'>You unfasten \the [src].</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
|
||||
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
|
||||
if(unsafe_wrenching)
|
||||
unsafe_pressure_release(user, internal_pressure)
|
||||
deconstruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_unwrench(mob/user)
|
||||
return can_unwrench
|
||||
|
||||
// Throws the user when they unwrench a pipe with a major difference between the internal and environmental pressure.
|
||||
/obj/machinery/atmospherics/proc/unsafe_pressure_release(mob/user, pressures = null)
|
||||
if(!user)
|
||||
return
|
||||
if(!pressures)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
pressures = int_air.return_pressure() - env_air.return_pressure()
|
||||
|
||||
user.visible_message("<span class='danger'>[user] is sent flying by pressure!</span>","<span class='userdanger'>The pressure sends you flying!</span>")
|
||||
|
||||
// if get_dir(src, user) is not 0, target is the edge_target_turf on that dir
|
||||
// otherwise, edge_target_turf uses a random cardinal direction
|
||||
// range is pressures / 250
|
||||
// speed is pressures / 1250
|
||||
user.throw_at(get_edge_target_turf(user, get_dir(src, user) || pick(GLOB.cardinals)), pressures / 250, pressures / 1250)
|
||||
|
||||
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(can_unwrench)
|
||||
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src)
|
||||
stored.setPipingLayer(piping_layer)
|
||||
if(!disassembled)
|
||||
stored.obj_integrity = stored.max_integrity * 0.5
|
||||
transfer_fingerprints_to(stored)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2)
|
||||
|
||||
//Add identifiers for the iconset
|
||||
if(iconsetids[iconset] == null)
|
||||
iconsetids[iconset] = num2text(iconsetids.len + 1)
|
||||
|
||||
//Generate a unique identifier for this image combination
|
||||
var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]"
|
||||
|
||||
if((!(. = pipeimages[identifier])))
|
||||
var/image/pipe_overlay
|
||||
pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction)
|
||||
pipe_overlay.color = col
|
||||
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)
|
||||
|
||||
/obj/machinery/atmospherics/on_construction(obj_color, set_layer)
|
||||
if(can_unwrench)
|
||||
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
|
||||
pipe_color = obj_color
|
||||
setPipingLayer(set_layer)
|
||||
var/turf/T = get_turf(src)
|
||||
level = T.intact ? 2 : 1
|
||||
atmosinit()
|
||||
var/list/nodes = pipeline_expansion()
|
||||
for(var/obj/machinery/atmospherics/A in nodes)
|
||||
A.atmosinit()
|
||||
A.addMember(src)
|
||||
build_network()
|
||||
|
||||
/obj/machinery/atmospherics/Entered(atom/movable/AM)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
L.ventcrawl_layer = piping_layer
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
return ..()
|
||||
|
||||
#define VENT_SOUND_DELAY 30
|
||||
|
||||
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
|
||||
direction &= initialize_directions
|
||||
if(!direction || !(direction in GLOB.cardinals)) //cant go this way.
|
||||
return
|
||||
|
||||
if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug
|
||||
return
|
||||
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction, user.ventcrawl_layer)
|
||||
if(target_move)
|
||||
if(target_move.can_crawl_through())
|
||||
if(is_type_in_typecache(target_move, GLOB.ventcrawl_machinery))
|
||||
user.forceMove(target_move.loc) //handle entering and so on.
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
else
|
||||
var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets()
|
||||
if(pipenetdiff.len)
|
||||
user.update_pipe_vision(target_move)
|
||||
user.forceMove(target_move)
|
||||
user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
user.last_played_vent = world.time
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
else if(is_type_in_typecache(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
user.forceMove(loc)
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
|
||||
user.canmove = FALSE
|
||||
addtimer(VARSET_CALLBACK(user, canmove, TRUE), 1)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/AltClick(mob/living/L)
|
||||
if(is_type_in_typecache(src, GLOB.ventcrawl_machinery))
|
||||
return L.handle_ventcrawl(src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_crawl_through()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenets()
|
||||
return list()
|
||||
|
||||
/obj/machinery/atmospherics/update_remote_sight(mob/user)
|
||||
user.sight |= (SEE_TURFS|BLIND)
|
||||
|
||||
//Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
|
||||
/obj/machinery/atmospherics/proc/can_see_pipes()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/update_layer()
|
||||
// Quick overview:
|
||||
//
|
||||
// Pipes combine to form pipelines
|
||||
// Pipelines and other atmospheric objects combine to form pipe_networks
|
||||
// Note: A single pipe_network represents a completely open space
|
||||
//
|
||||
// Pipes -> Pipelines
|
||||
// Pipelines + Other Objects -> Pipe network
|
||||
|
||||
#define PIPE_VISIBLE_LEVEL 2
|
||||
#define PIPE_HIDDEN_LEVEL 1
|
||||
|
||||
/obj/machinery/atmospherics
|
||||
anchored = TRUE
|
||||
move_resist = INFINITY //Moving a connected machine without actually doing the normal (dis)connection things will probably cause a LOT of issues.
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
layer = GAS_PIPE_HIDDEN_LAYER //under wires
|
||||
resistance_flags = FIRE_PROOF
|
||||
max_integrity = 200
|
||||
obj_flags = CAN_BE_HIT | ON_BLUEPRINTS
|
||||
var/nodealert = 0
|
||||
var/can_unwrench = 0
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/pipe_flags = NONE
|
||||
|
||||
var/global/list/iconsetids = list()
|
||||
var/global/list/pipeimages = list()
|
||||
|
||||
var/image/pipe_vision_img = null
|
||||
|
||||
var/device_type = 0
|
||||
var/list/obj/machinery/atmospherics/nodes
|
||||
|
||||
var/construction_type
|
||||
var/pipe_state //icon_state as a pipe item
|
||||
var/on = FALSE
|
||||
|
||||
/obj/machinery/atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.ventcrawler)
|
||||
. += "<span class='notice'>Alt-click to crawl through it.</span>"
|
||||
|
||||
/obj/machinery/atmospherics/New(loc, process = TRUE, setdir)
|
||||
if(!isnull(setdir))
|
||||
setDir(setdir)
|
||||
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
|
||||
normalize_cardinal_directions()
|
||||
nodes = new(device_type)
|
||||
if (!armor)
|
||||
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 70)
|
||||
..()
|
||||
if(process)
|
||||
SSair.atmos_machinery += src
|
||||
SetInitDirections()
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(var/i in 1 to device_type)
|
||||
nullifyNode(i)
|
||||
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
dropContents()
|
||||
if(pipe_vision_img)
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/destroy_network()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(i)
|
||||
if(nodes[i])
|
||||
var/obj/machinery/atmospherics/N = nodes[i]
|
||||
N.disconnect(src)
|
||||
nodes[i] = null
|
||||
|
||||
/obj/machinery/atmospherics/proc/getNodeConnects()
|
||||
var/list/node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/D in GLOB.cardinals)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[i] = D
|
||||
break
|
||||
return node_connects
|
||||
|
||||
/obj/machinery/atmospherics/proc/normalize_cardinal_directions()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
setDir(NORTH)
|
||||
if(WEST)
|
||||
setDir(EAST)
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
node_connects = getNodeConnects()
|
||||
|
||||
for(var/i in 1 to device_type)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[i]))
|
||||
if(can_be_node(target, i))
|
||||
nodes[i] = target
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
|
||||
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
return connection_check(target, piping_layer)
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
/obj/machinery/atmospherics/proc/findConnecting(direction, prompted_layer)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(connection_check(target, prompted_layer))
|
||||
return target
|
||||
|
||||
/obj/machinery/atmospherics/proc/connection_check(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isConnectable(target, given_layer) && target.isConnectable(src, given_layer) && (target.initialize_directions & get_dir(target,src)))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/isConnectable(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isnull(given_layer))
|
||||
given_layer = piping_layer
|
||||
if((target.piping_layer == given_layer) || (target.pipe_flags & PIPING_ALL_LAYER))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/GetInitDirections()
|
||||
return initialize_directions
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenetAir()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/replacePipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
P.destroy_network()
|
||||
nodes[nodes.Find(reference)] = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pipe)) //lets you autodrop
|
||||
var/obj/item/pipe/pipe = W
|
||||
if(user.dropItemToGround(pipe))
|
||||
pipe.setPipingLayer(piping_layer) //align it with us
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/wrench_act(mob/living/user, obj/item/I)
|
||||
if(!can_unwrench(user))
|
||||
return ..()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first!</span>")
|
||||
return TRUE
|
||||
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
add_fingerprint(user)
|
||||
|
||||
var/unsafe_wrenching = FALSE
|
||||
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
|
||||
if (internal_pressure > 2*ONE_ATMOSPHERE)
|
||||
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
unsafe_wrenching = TRUE //Oh dear oh dear
|
||||
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"<span class='notice'>You unfasten \the [src].</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
|
||||
//You unwrenched a pipe full of pressure? Let's splat you into the wall, silly.
|
||||
if(unsafe_wrenching)
|
||||
unsafe_pressure_release(user, internal_pressure)
|
||||
deconstruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_unwrench(mob/user)
|
||||
return can_unwrench
|
||||
|
||||
// Throws the user when they unwrench a pipe with a major difference between the internal and environmental pressure.
|
||||
/obj/machinery/atmospherics/proc/unsafe_pressure_release(mob/user, pressures = null)
|
||||
if(!user)
|
||||
return
|
||||
if(!pressures)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
pressures = int_air.return_pressure() - env_air.return_pressure()
|
||||
|
||||
user.visible_message("<span class='danger'>[user] is sent flying by pressure!</span>","<span class='userdanger'>The pressure sends you flying!</span>")
|
||||
|
||||
// if get_dir(src, user) is not 0, target is the edge_target_turf on that dir
|
||||
// otherwise, edge_target_turf uses a random cardinal direction
|
||||
// range is pressures / 250
|
||||
// speed is pressures / 1250
|
||||
user.throw_at(get_edge_target_turf(user, get_dir(src, user) || pick(GLOB.cardinals)), pressures / 250, pressures / 1250)
|
||||
|
||||
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(can_unwrench)
|
||||
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src)
|
||||
stored.setPipingLayer(piping_layer)
|
||||
if(!disassembled)
|
||||
stored.obj_integrity = stored.max_integrity * 0.5
|
||||
transfer_fingerprints_to(stored)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2)
|
||||
|
||||
//Add identifiers for the iconset
|
||||
if(iconsetids[iconset] == null)
|
||||
iconsetids[iconset] = num2text(iconsetids.len + 1)
|
||||
|
||||
//Generate a unique identifier for this image combination
|
||||
var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]"
|
||||
|
||||
if((!(. = pipeimages[identifier])))
|
||||
var/image/pipe_overlay
|
||||
pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction)
|
||||
pipe_overlay.color = col
|
||||
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)
|
||||
|
||||
/obj/machinery/atmospherics/on_construction(obj_color, set_layer)
|
||||
if(can_unwrench)
|
||||
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
|
||||
pipe_color = obj_color
|
||||
setPipingLayer(set_layer)
|
||||
var/turf/T = get_turf(src)
|
||||
level = T.intact ? 2 : 1
|
||||
atmosinit()
|
||||
var/list/nodes = pipeline_expansion()
|
||||
for(var/obj/machinery/atmospherics/A in nodes)
|
||||
A.atmosinit()
|
||||
A.addMember(src)
|
||||
build_network()
|
||||
|
||||
/obj/machinery/atmospherics/Entered(atom/movable/AM)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
L.ventcrawl_layer = piping_layer
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
return ..()
|
||||
|
||||
#define VENT_SOUND_DELAY 30
|
||||
|
||||
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
|
||||
direction &= initialize_directions
|
||||
if(!direction || !(direction in GLOB.cardinals)) //cant go this way.
|
||||
return
|
||||
|
||||
if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug
|
||||
return
|
||||
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction, user.ventcrawl_layer)
|
||||
if(target_move)
|
||||
if(target_move.can_crawl_through())
|
||||
if(is_type_in_typecache(target_move, GLOB.ventcrawl_machinery))
|
||||
user.forceMove(target_move.loc) //handle entering and so on.
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
else
|
||||
var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets()
|
||||
if(pipenetdiff.len)
|
||||
user.update_pipe_vision(target_move)
|
||||
user.forceMove(target_move)
|
||||
user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
user.last_played_vent = world.time
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
else if(is_type_in_typecache(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
user.forceMove(loc)
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>", "<span class='notice'>You climb out the ventilation system.")
|
||||
|
||||
user.canmove = FALSE
|
||||
addtimer(VARSET_CALLBACK(user, canmove, TRUE), 1)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/AltClick(mob/living/L)
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery))
|
||||
L.handle_ventcrawl(src)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_crawl_through()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenets()
|
||||
return list()
|
||||
|
||||
/obj/machinery/atmospherics/update_remote_sight(mob/user)
|
||||
user.sight |= (SEE_TURFS|BLIND)
|
||||
|
||||
//Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
|
||||
/obj/machinery/atmospherics/proc/can_see_pipes()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/proc/update_layer()
|
||||
layer = initial(layer) + (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE
|
||||
@@ -43,7 +43,6 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/AltClick(mob/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
|
||||
@@ -51,7 +50,6 @@
|
||||
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
|
||||
investigate_log("Pump, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
|
||||
message_admins("Pump, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/Destroy()
|
||||
SSradio.remove_object(src,frequency)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_filter", name, 475, 185, master_ui, state)
|
||||
ui = new(user, src, ui_key, "atmos_filter", name, 475, 195, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/ui_data()
|
||||
|
||||
@@ -14,19 +14,23 @@
|
||||
construction_type = /obj/item/pipe/trinary/flippable
|
||||
pipe_state = "mixer"
|
||||
|
||||
ui_x = 370
|
||||
ui_y = 165
|
||||
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>You can hold <b>Ctrl</b> and click on it to toggle it on and off.</span>"
|
||||
. += "<span class='notice'>You can hold <b>Alt</b> and click on it to maximize its pressure.</span>"
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/CtrlClick(mob/user)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
|
||||
on = !on
|
||||
update_icon()
|
||||
return ..()
|
||||
investigate_log("Mixer, [src.name], turned on by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
|
||||
message_admins("Mixer, [src.name], turned [on ? "on" : "off"] by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/AltClick(mob/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
|
||||
@@ -34,7 +38,6 @@
|
||||
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
|
||||
investigate_log("Mixer, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
|
||||
message_admins("Mixer, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
|
||||
@@ -59,6 +62,12 @@
|
||||
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational()
|
||||
icon_state = "mixer_[on_state ? "on" : "off"][flipped ? "_f" : ""]"
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(stat != old_stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air3 = airs[3]
|
||||
@@ -70,13 +79,8 @@
|
||||
if(!on || !(nodes[1] && nodes[2] && nodes[3]) && !is_operational())
|
||||
return
|
||||
|
||||
//Get those gases, mah boiiii
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
var/datum/gas_mixture/air2 = airs[2]
|
||||
|
||||
if(!air1 || !air2)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air3 = airs[3]
|
||||
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
@@ -86,57 +90,60 @@
|
||||
return
|
||||
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
var/general_transfer = (target_pressure - output_starting_pressure) * air3.volume / R_IDEAL_GAS_EQUATION
|
||||
|
||||
var/transfer_moles1 = air1.temperature ? node1_concentration * general_transfer / air1.temperature : 0
|
||||
var/transfer_moles2 = air2.temperature ? node2_concentration * general_transfer / air2.temperature : 0
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles1 = 0
|
||||
var/transfer_moles2 = 0
|
||||
|
||||
if(air1.temperature > 0)
|
||||
transfer_moles1 = (node1_concentration * pressure_delta) * air3.volume / (air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
if(air2.temperature > 0)
|
||||
transfer_moles2 = (node2_concentration * pressure_delta) * air3.volume / (air2.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/air1_moles = air1.total_moles()
|
||||
var/air2_moles = air2.total_moles()
|
||||
|
||||
if(!node2_concentration)
|
||||
if(air1.temperature <= 0)
|
||||
return
|
||||
transfer_moles1 = min(transfer_moles1, air1_moles)
|
||||
transfer_moles2 = 0
|
||||
else if(!node1_concentration)
|
||||
if(air2.temperature <= 0)
|
||||
return
|
||||
transfer_moles2 = min(transfer_moles2, air2_moles)
|
||||
transfer_moles1 = 0
|
||||
else
|
||||
if(air1.temperature <= 0 || air2.temperature <= 0)
|
||||
return
|
||||
if((transfer_moles2 <= 0) || (transfer_moles1 <= 0))
|
||||
return
|
||||
if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2))
|
||||
var/ratio = 0
|
||||
if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2))
|
||||
var/ratio = 0
|
||||
if((transfer_moles1 > 0 ) && (transfer_moles2 > 0))
|
||||
ratio = min(air1_moles / transfer_moles1, air2_moles / transfer_moles2)
|
||||
transfer_moles1 *= ratio
|
||||
transfer_moles2 *= ratio
|
||||
if((transfer_moles2 == 0 ) && ( transfer_moles1 > 0))
|
||||
ratio = air1_moles / transfer_moles1
|
||||
if((transfer_moles1 == 0 ) && ( transfer_moles2 > 0))
|
||||
ratio = air2_moles / transfer_moles2
|
||||
|
||||
transfer_moles1 *= ratio
|
||||
transfer_moles2 *= ratio
|
||||
|
||||
//Actually transfer the gas
|
||||
|
||||
if(transfer_moles1)
|
||||
if(transfer_moles1 > 0)
|
||||
var/datum/gas_mixture/removed1 = air1.remove(transfer_moles1)
|
||||
air3.merge(removed1)
|
||||
|
||||
if(transfer_moles2 > 0)
|
||||
var/datum/gas_mixture/removed2 = air2.remove(transfer_moles2)
|
||||
air3.merge(removed2)
|
||||
|
||||
if(transfer_moles1)
|
||||
var/datum/pipeline/parent1 = parents[1]
|
||||
parent1.update = TRUE
|
||||
|
||||
if(transfer_moles2)
|
||||
var/datum/gas_mixture/removed2 = air2.remove(transfer_moles2)
|
||||
air3.merge(removed2)
|
||||
var/datum/pipeline/parent2 = parents[2]
|
||||
parent2.update = TRUE
|
||||
|
||||
var/datum/pipeline/parent3 = parents[3]
|
||||
parent3.update = TRUE
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_mixer", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, ui_key, "atmos_mixer", name, 370, 165, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/ui_data()
|
||||
@@ -144,8 +151,8 @@
|
||||
data["on"] = on
|
||||
data["set_pressure"] = round(target_pressure)
|
||||
data["max_pressure"] = round(MAX_OUTPUT_PRESSURE)
|
||||
data["node1_concentration"] = round(node1_concentration*100, 1)
|
||||
data["node2_concentration"] = round(node2_concentration*100, 1)
|
||||
data["node1_concentration"] = round(node1_concentration*100)
|
||||
data["node2_concentration"] = round(node2_concentration*100)
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/ui_act(action, params)
|
||||
@@ -173,19 +180,18 @@
|
||||
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
if("node1")
|
||||
var/value = text2num(params["concentration"])
|
||||
adjust_node1_value(value)
|
||||
node1_concentration = max(0, min(1, node1_concentration + value))
|
||||
node2_concentration = max(0, min(1, node2_concentration - value))
|
||||
investigate_log("was set to [node1_concentration] % on node 1 by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
. = TRUE
|
||||
if("node2")
|
||||
var/value = text2num(params["concentration"])
|
||||
adjust_node1_value(100 - value)
|
||||
node2_concentration = max(0, min(1, node2_concentration + value))
|
||||
node1_concentration = max(0, min(1, node1_concentration - value))
|
||||
investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/proc/adjust_node1_value(newValue)
|
||||
node1_concentration = newValue / 100
|
||||
node2_concentration = 1 - node1_concentration
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/can_unwrench(mob/user)
|
||||
. = ..()
|
||||
@@ -253,4 +259,4 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/airmix/flipped/inverse
|
||||
node1_concentration = O2STANDARD
|
||||
node2_concentration = N2STANDARD
|
||||
node2_concentration = N2STANDARD
|
||||
@@ -1,446 +1,430 @@
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'icons/obj/cryogenics.dmi'
|
||||
icon_state = "pod-off"
|
||||
density = TRUE
|
||||
max_integrity = 350
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 30, "acid" = 30)
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
state_open = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/cryo_tube
|
||||
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
||||
occupant_typecache = list(/mob/living/carbon, /mob/living/simple_animal)
|
||||
|
||||
var/autoeject = FALSE
|
||||
var/volume = 100
|
||||
|
||||
var/efficiency = 1
|
||||
var/sleep_factor = 0.00125
|
||||
var/unconscious_factor = 0.001
|
||||
var/heat_capacity = 20000
|
||||
var/conduction_coefficient = 0.3
|
||||
|
||||
var/obj/item/reagent_containers/glass/beaker = null
|
||||
var/reagent_transfer = 0
|
||||
|
||||
var/obj/item/radio/radio
|
||||
var/radio_key = /obj/item/encryptionkey/headset_med
|
||||
var/radio_channel = RADIO_CHANNEL_MEDICAL
|
||||
|
||||
var/running_anim = FALSE
|
||||
|
||||
var/escape_in_progress = FALSE
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Initialize()
|
||||
. = ..()
|
||||
initialize_directions = dir
|
||||
|
||||
radio = new(src)
|
||||
radio.keyslot = new radio_key
|
||||
radio.subspace_transmission = TRUE
|
||||
radio.canhear_range = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_construction()
|
||||
..(dir, dir)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/RefreshParts()
|
||||
var/C
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
C += M.rating
|
||||
|
||||
efficiency = initial(efficiency) * C
|
||||
sleep_factor = initial(sleep_factor) * C
|
||||
unconscious_factor = initial(unconscious_factor) * C
|
||||
heat_capacity = initial(heat_capacity) / C
|
||||
conduction_coefficient = initial(conduction_coefficient) * C
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
QDEL_NULL(beaker)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/contents_explosion(severity, target)
|
||||
..()
|
||||
if(beaker)
|
||||
beaker.ex_act(severity, target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/handle_atom_del(atom/A)
|
||||
..()
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_deconstruction()
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("pod-panel")
|
||||
|
||||
if(state_open)
|
||||
icon_state = "pod-open"
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/image/occupant_overlay
|
||||
|
||||
if(ismonkey(occupant)) // Monkey
|
||||
occupant_overlay = image(CRYOMOBS, "monkey")
|
||||
else if(isalienadult(occupant))
|
||||
if(isalienroyal(occupant)) // Queen and prae
|
||||
occupant_overlay = image(CRYOMOBS, "alienq")
|
||||
else if(isalienhunter(occupant)) // Hunter
|
||||
occupant_overlay = image(CRYOMOBS, "alienh")
|
||||
else if(isaliensentinel(occupant)) // Sentinel
|
||||
occupant_overlay = image(CRYOMOBS, "aliens")
|
||||
else // Drone or other
|
||||
occupant_overlay = image(CRYOMOBS, "aliend")
|
||||
|
||||
else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
|
||||
occupant_overlay = image(occupant.icon, occupant.icon_state)
|
||||
occupant_overlay.copy_overlays(occupant)
|
||||
|
||||
else
|
||||
occupant_overlay = image(CRYOMOBS, "generic")
|
||||
|
||||
occupant_overlay.dir = SOUTH
|
||||
occupant_overlay.pixel_y = 22
|
||||
|
||||
if(on && !running_anim && is_operational())
|
||||
icon_state = "pod-on"
|
||||
running_anim = TRUE
|
||||
run_anim(TRUE, occupant_overlay)
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-off")
|
||||
|
||||
else if(on && is_operational())
|
||||
icon_state = "pod-on"
|
||||
add_overlay("cover-on")
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay("cover-off")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/run_anim(anim_up, image/occupant_overlay)
|
||||
if(!on || !occupant || !is_operational())
|
||||
running_anim = FALSE
|
||||
return
|
||||
cut_overlays()
|
||||
if(occupant_overlay.pixel_y != 23) // Same effect as occupant_overlay.pixel_y == 22 || occupant_overlay.pixel_y == 24
|
||||
anim_up = occupant_overlay.pixel_y == 22 // Same effect as if(occupant_overlay.pixel_y == 22) anim_up = TRUE ; if(occupant_overlay.pixel_y == 24) anim_up = FALSE
|
||||
if(anim_up)
|
||||
occupant_overlay.pixel_y++
|
||||
else
|
||||
occupant_overlay.pixel_y--
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-on")
|
||||
addtimer(CALLBACK(src, .proc/run_anim, anim_up, occupant_overlay), 7, TIMER_UNIQUE)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
if(!is_operational())
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
if(mob_occupant.stat == DEAD) // We don't bother with dead people.
|
||||
return
|
||||
|
||||
if(mob_occupant.health >= mob_occupant.getMaxHealth()) // Don't bother with fully healed people.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
playsound(src, 'sound/machines/cryo_warning.ogg', volume) // Bug the doctors.
|
||||
var/msg = "Patient fully restored."
|
||||
if(autoeject) // Eject if configured.
|
||||
msg += " Auto ejecting patient now."
|
||||
open_machine()
|
||||
radio.talk_into(src, msg, radio_channel)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(air1.gases.len)
|
||||
if(mob_occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic.
|
||||
mob_occupant.Sleeping((mob_occupant.bodytemperature * sleep_factor) * 2000)
|
||||
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 2000)
|
||||
if(beaker)
|
||||
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
|
||||
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
|
||||
beaker.reagents.reaction(occupant, VAPOR)
|
||||
air1.gases[/datum/gas/oxygen] -= max(0,air1.gases[/datum/gas/oxygen] - 2 / efficiency) //Let's use gas for this
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
|
||||
reagent_transfer = 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(!nodes[1] || !airs[1] || !air1.gases.len || air1.gases[/datum/gas/oxygen] < 5) // Turn off if the machine won't work.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
var/cold_protection = 0
|
||||
var/temperature_delta = air1.temperature - mob_occupant.bodytemperature // The only semi-realistic thing here: share temperature between the cell and the occupant.
|
||||
|
||||
if(ishuman(occupant))
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
cold_protection = H.get_thermal_protection(air1.temperature, TRUE)
|
||||
|
||||
if(abs(temperature_delta) > 1)
|
||||
var/air_heat_capacity = air1.heat_capacity()
|
||||
|
||||
var/heat = ((1 - cold_protection) * 0.1 + conduction_coefficient) * temperature_delta * (air_heat_capacity * heat_capacity / (air_heat_capacity + heat_capacity))
|
||||
|
||||
air1.temperature = max(air1.temperature - heat / air_heat_capacity, TCMB)
|
||||
mob_occupant.adjust_bodytemperature(heat / heat_capacity, TCMB)
|
||||
|
||||
air1.gases[/datum/gas/oxygen] = max(0,air1.gases[/datum/gas/oxygen] - 0.5 / efficiency) // Magically consume gas? Why not, we run on cryo magic.
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/open_machine(drop = 0)
|
||||
if(!state_open && !panel_open)
|
||||
on = FALSE
|
||||
..()
|
||||
for(var/mob/M in contents) //only drop mobs
|
||||
M.forceMove(get_turf(src))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.update_canmove()
|
||||
occupant = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/close_machine(mob/living/carbon/user)
|
||||
if((isnull(user) || istype(user)) && state_open && !panel_open)
|
||||
..(user)
|
||||
return occupant
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
|
||||
"<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user, breakout_time, target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user)
|
||||
. = ..()
|
||||
if(occupant)
|
||||
if(on)
|
||||
. += "Someone's inside [src]!"
|
||||
else
|
||||
. += "You can barely make out a form floating in [src]."
|
||||
else
|
||||
. += "[src] seems empty."
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
|
||||
return
|
||||
if (target.IsKnockdown() || target.IsStun() || target.IsSleeping() || target.IsUnconscious())
|
||||
close_machine(target)
|
||||
else
|
||||
user.visible_message("<b>[user]</b> starts shoving [target] inside [src].", "<span class='notice'>You start shoving [target] inside [src].</span>")
|
||||
if (do_after(user, 25, target=target))
|
||||
close_machine(target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/reagent_containers/glass))
|
||||
. = 1 //no afterattack
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A beaker is already loaded into [src]!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
beaker = I
|
||||
user.visible_message("[user] places [I] in [src].", \
|
||||
"<span class='notice'>You place [I] in [src].</span>")
|
||||
var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list)
|
||||
log_game("[key_name(user)] added an [I] to cryo containing [reagentlist]")
|
||||
return
|
||||
if(!on && !occupant && !state_open && (default_deconstruction_screwdriver(user, "pod-off", "pod-off", I)) \
|
||||
|| default_change_direction_wrench(user, I) \
|
||||
|| default_pry_open(I) \
|
||||
|| default_deconstruction_crowbar(I))
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You can't access the maintenance panel while the pod is " \
|
||||
+ (on ? "active" : (occupant ? "full" : "open")) + ".</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_data()
|
||||
var/list/data = list()
|
||||
data["isOperating"] = on
|
||||
data["hasOccupant"] = occupant ? TRUE : FALSE
|
||||
data["isOpen"] = state_open
|
||||
data["autoEject"] = autoeject
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
switch(mob_occupant.stat)
|
||||
if(CONSCIOUS)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "good"
|
||||
if(SOFT_CRIT)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(UNCONSCIOUS)
|
||||
data["occupant"]["stat"] = "Unconscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(DEAD)
|
||||
data["occupant"]["stat"] = "Dead"
|
||||
data["occupant"]["statstate"] = "bad"
|
||||
data["occupant"]["health"] = round(mob_occupant.health, 1)
|
||||
data["occupant"]["maxHealth"] = mob_occupant.maxHealth
|
||||
data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["occupant"]["bruteLoss"] = round(mob_occupant.getBruteLoss(), 1)
|
||||
data["occupant"]["oxyLoss"] = round(mob_occupant.getOxyLoss(), 1)
|
||||
data["occupant"]["toxLoss"] = round(mob_occupant.getToxLoss(), 1)
|
||||
data["occupant"]["fireLoss"] = round(mob_occupant.getFireLoss(), 1)
|
||||
data["occupant"]["bodyTemperature"] = round(mob_occupant.bodytemperature, 1)
|
||||
if(mob_occupant.bodytemperature < TCRYO)
|
||||
data["occupant"]["temperaturestatus"] = "good"
|
||||
else if(mob_occupant.bodytemperature < T0C)
|
||||
data["occupant"]["temperaturestatus"] = "average"
|
||||
else
|
||||
data["occupant"]["temperaturestatus"] = "bad"
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
data["cellTemperature"] = round(air1.temperature, 1)
|
||||
|
||||
data["isBeakerLoaded"] = beaker ? TRUE : FALSE
|
||||
var/beakerContents = list()
|
||||
if(beaker && beaker.reagents && beaker.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
beakerContents += list(list("name" = R.name, "volume" = R.volume))
|
||||
data["beakerContents"] = beakerContents
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
if(on)
|
||||
on = FALSE
|
||||
else if(!state_open)
|
||||
on = TRUE
|
||||
. = TRUE
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
. = TRUE
|
||||
if("autoeject")
|
||||
autoeject = !autoeject
|
||||
. = TRUE
|
||||
if("ejectbeaker")
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/CtrlClick(mob/user)
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) && !state_open)
|
||||
on = !on
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
|
||||
return // we don't see the pipe network while inside cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user)
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_crawl_through()
|
||||
return // can't ventcrawl in or out of cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_see_pipes()
|
||||
return 0 // you can't see the pipe network when inside a cryo cell.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/return_temperature()
|
||||
var/datum/gas_mixture/G = airs[1]
|
||||
|
||||
if(G.total_moles() > 10)
|
||||
return G.temperature
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/wrench/W)
|
||||
. = ..()
|
||||
if(.)
|
||||
SetInitDirections()
|
||||
var/obj/machinery/atmospherics/node = nodes[1]
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
nodes[1] = null
|
||||
nullifyPipenet(parents[1])
|
||||
atmosinit()
|
||||
node = nodes[1]
|
||||
if(node)
|
||||
node.atmosinit()
|
||||
node.addMember(src)
|
||||
build_network()
|
||||
|
||||
#undef CRYOMOBS
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'icons/obj/cryogenics.dmi'
|
||||
icon_state = "pod-off"
|
||||
density = TRUE
|
||||
max_integrity = 350
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 30, "acid" = 30)
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
state_open = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/cryo_tube
|
||||
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
||||
occupant_typecache = list(/mob/living/carbon, /mob/living/simple_animal)
|
||||
|
||||
var/autoeject = FALSE
|
||||
var/volume = 100
|
||||
|
||||
var/efficiency = 1
|
||||
var/sleep_factor = 0.00125
|
||||
var/unconscious_factor = 0.001
|
||||
var/heat_capacity = 20000
|
||||
var/conduction_coefficient = 0.3
|
||||
|
||||
var/obj/item/reagent_containers/glass/beaker = null
|
||||
var/reagent_transfer = 0
|
||||
|
||||
var/obj/item/radio/radio
|
||||
var/radio_key = /obj/item/encryptionkey/headset_med
|
||||
var/radio_channel = RADIO_CHANNEL_MEDICAL
|
||||
|
||||
var/running_anim = FALSE
|
||||
|
||||
var/escape_in_progress = FALSE
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Initialize()
|
||||
. = ..()
|
||||
initialize_directions = dir
|
||||
|
||||
radio = new(src)
|
||||
radio.keyslot = new radio_key
|
||||
radio.subspace_transmission = TRUE
|
||||
radio.canhear_range = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_construction()
|
||||
..(dir, dir)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/RefreshParts()
|
||||
var/C
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
C += M.rating
|
||||
|
||||
efficiency = initial(efficiency) * C
|
||||
sleep_factor = initial(sleep_factor) * C
|
||||
unconscious_factor = initial(unconscious_factor) * C
|
||||
heat_capacity = initial(heat_capacity) / C
|
||||
conduction_coefficient = initial(conduction_coefficient) * C
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/Destroy()
|
||||
QDEL_NULL(radio)
|
||||
QDEL_NULL(beaker)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/contents_explosion(severity, target)
|
||||
..()
|
||||
if(beaker)
|
||||
beaker.ex_act(severity, target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/handle_atom_del(atom/A)
|
||||
..()
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/on_deconstruction()
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("pod-panel")
|
||||
|
||||
if(state_open)
|
||||
icon_state = "pod-open"
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/image/occupant_overlay
|
||||
|
||||
if(ismonkey(occupant)) // Monkey
|
||||
occupant_overlay = image(CRYOMOBS, "monkey")
|
||||
else if(isalienadult(occupant))
|
||||
if(isalienroyal(occupant)) // Queen and prae
|
||||
occupant_overlay = image(CRYOMOBS, "alienq")
|
||||
else if(isalienhunter(occupant)) // Hunter
|
||||
occupant_overlay = image(CRYOMOBS, "alienh")
|
||||
else if(isaliensentinel(occupant)) // Sentinel
|
||||
occupant_overlay = image(CRYOMOBS, "aliens")
|
||||
else // Drone or other
|
||||
occupant_overlay = image(CRYOMOBS, "aliend")
|
||||
|
||||
else if(ishuman(occupant) || islarva(occupant) || (isanimal(occupant) && !ismegafauna(occupant))) // Mobs that are smaller than cryotube
|
||||
occupant_overlay = image(occupant.icon, occupant.icon_state)
|
||||
occupant_overlay.copy_overlays(occupant)
|
||||
|
||||
else
|
||||
occupant_overlay = image(CRYOMOBS, "generic")
|
||||
|
||||
occupant_overlay.dir = SOUTH
|
||||
occupant_overlay.pixel_y = 22
|
||||
|
||||
if(on && !running_anim && is_operational())
|
||||
icon_state = "pod-on"
|
||||
running_anim = TRUE
|
||||
run_anim(TRUE, occupant_overlay)
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-off")
|
||||
|
||||
else if(on && is_operational())
|
||||
icon_state = "pod-on"
|
||||
add_overlay("cover-on")
|
||||
else
|
||||
icon_state = "pod-off"
|
||||
add_overlay("cover-off")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/run_anim(anim_up, image/occupant_overlay)
|
||||
if(!on || !occupant || !is_operational())
|
||||
running_anim = FALSE
|
||||
return
|
||||
cut_overlays()
|
||||
if(occupant_overlay.pixel_y != 23) // Same effect as occupant_overlay.pixel_y == 22 || occupant_overlay.pixel_y == 24
|
||||
anim_up = occupant_overlay.pixel_y == 22 // Same effect as if(occupant_overlay.pixel_y == 22) anim_up = TRUE ; if(occupant_overlay.pixel_y == 24) anim_up = FALSE
|
||||
if(anim_up)
|
||||
occupant_overlay.pixel_y++
|
||||
else
|
||||
occupant_overlay.pixel_y--
|
||||
add_overlay(occupant_overlay)
|
||||
add_overlay("cover-on")
|
||||
addtimer(CALLBACK(src, .proc/run_anim, anim_up, occupant_overlay), 7, TIMER_UNIQUE)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
if(!is_operational())
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
if(mob_occupant.stat == DEAD) // We don't bother with dead people.
|
||||
return
|
||||
|
||||
if(mob_occupant.health >= mob_occupant.getMaxHealth()) // Don't bother with fully healed people.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
playsound(src, 'sound/machines/cryo_warning.ogg', volume) // Bug the doctors.
|
||||
var/msg = "Patient fully restored."
|
||||
if(autoeject) // Eject if configured.
|
||||
msg += " Auto ejecting patient now."
|
||||
open_machine()
|
||||
radio.talk_into(src, msg, radio_channel)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(air1.gases.len)
|
||||
if(mob_occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic.
|
||||
mob_occupant.Sleeping((mob_occupant.bodytemperature * sleep_factor) * 2000)
|
||||
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 2000)
|
||||
if(beaker)
|
||||
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
|
||||
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
|
||||
beaker.reagents.reaction(occupant, VAPOR)
|
||||
air1.gases[/datum/gas/oxygen] -= max(0,air1.gases[/datum/gas/oxygen] - 2 / efficiency) //Let's use gas for this
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
|
||||
reagent_transfer = 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
|
||||
if(!nodes[1] || !airs[1] || !air1.gases.len || air1.gases[/datum/gas/oxygen] < 5) // Turn off if the machine won't work.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
var/cold_protection = 0
|
||||
var/temperature_delta = air1.temperature - mob_occupant.bodytemperature // The only semi-realistic thing here: share temperature between the cell and the occupant.
|
||||
|
||||
if(ishuman(occupant))
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
cold_protection = H.get_thermal_protection(air1.temperature, TRUE)
|
||||
|
||||
if(abs(temperature_delta) > 1)
|
||||
var/air_heat_capacity = air1.heat_capacity()
|
||||
|
||||
var/heat = ((1 - cold_protection) * 0.1 + conduction_coefficient) * temperature_delta * (air_heat_capacity * heat_capacity / (air_heat_capacity + heat_capacity))
|
||||
|
||||
air1.temperature = max(air1.temperature - heat / air_heat_capacity, TCMB)
|
||||
mob_occupant.adjust_bodytemperature(heat / heat_capacity, TCMB)
|
||||
|
||||
air1.gases[/datum/gas/oxygen] = max(0,air1.gases[/datum/gas/oxygen] - 0.5 / efficiency) // Magically consume gas? Why not, we run on cryo magic.
|
||||
GAS_GARBAGE_COLLECT(air1.gases)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/open_machine(drop = 0)
|
||||
if(!state_open && !panel_open)
|
||||
on = FALSE
|
||||
..()
|
||||
for(var/mob/M in contents) //only drop mobs
|
||||
M.forceMove(get_turf(src))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.update_canmove()
|
||||
occupant = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/close_machine(mob/living/carbon/user)
|
||||
if((isnull(user) || istype(user)) && state_open && !panel_open)
|
||||
..(user)
|
||||
return occupant
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
|
||||
"<span class='notice'>You struggle inside [src], kicking the release with your foot... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user, breakout_time, target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/examine(mob/user)
|
||||
. = ..()
|
||||
if(occupant)
|
||||
if(on)
|
||||
. += "Someone's inside [src]!"
|
||||
else
|
||||
. += "You can barely make out a form floating in [src]."
|
||||
else
|
||||
. += "[src] seems empty."
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
|
||||
return
|
||||
if (target.IsKnockdown() || target.IsStun() || target.IsSleeping() || target.IsUnconscious())
|
||||
close_machine(target)
|
||||
else
|
||||
user.visible_message("<b>[user]</b> starts shoving [target] inside [src].", "<span class='notice'>You start shoving [target] inside [src].</span>")
|
||||
if (do_after(user, 25, target=target))
|
||||
close_machine(target)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/reagent_containers/glass))
|
||||
. = 1 //no afterattack
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A beaker is already loaded into [src]!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
beaker = I
|
||||
user.visible_message("[user] places [I] in [src].", \
|
||||
"<span class='notice'>You place [I] in [src].</span>")
|
||||
var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list)
|
||||
log_game("[key_name(user)] added an [I] to cryo containing [reagentlist]")
|
||||
return
|
||||
if(!on && !occupant && !state_open && (default_deconstruction_screwdriver(user, "pod-off", "pod-off", I)) \
|
||||
|| default_change_direction_wrench(user, I) \
|
||||
|| default_pry_open(I) \
|
||||
|| default_deconstruction_crowbar(I))
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You can't access the maintenance panel while the pod is " \
|
||||
+ (on ? "active" : (occupant ? "full" : "open")) + ".</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_data()
|
||||
var/list/data = list()
|
||||
data["isOperating"] = on
|
||||
data["hasOccupant"] = occupant ? TRUE : FALSE
|
||||
data["isOpen"] = state_open
|
||||
data["autoEject"] = autoeject
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
switch(mob_occupant.stat)
|
||||
if(CONSCIOUS)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "good"
|
||||
if(SOFT_CRIT)
|
||||
data["occupant"]["stat"] = "Conscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(UNCONSCIOUS)
|
||||
data["occupant"]["stat"] = "Unconscious"
|
||||
data["occupant"]["statstate"] = "average"
|
||||
if(DEAD)
|
||||
data["occupant"]["stat"] = "Dead"
|
||||
data["occupant"]["statstate"] = "bad"
|
||||
data["occupant"]["health"] = round(mob_occupant.health, 1)
|
||||
data["occupant"]["maxHealth"] = mob_occupant.maxHealth
|
||||
data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["occupant"]["bruteLoss"] = round(mob_occupant.getBruteLoss(), 1)
|
||||
data["occupant"]["oxyLoss"] = round(mob_occupant.getOxyLoss(), 1)
|
||||
data["occupant"]["toxLoss"] = round(mob_occupant.getToxLoss(), 1)
|
||||
data["occupant"]["fireLoss"] = round(mob_occupant.getFireLoss(), 1)
|
||||
data["occupant"]["bodyTemperature"] = round(mob_occupant.bodytemperature, 1)
|
||||
if(mob_occupant.bodytemperature < TCRYO)
|
||||
data["occupant"]["temperaturestatus"] = "good"
|
||||
else if(mob_occupant.bodytemperature < T0C)
|
||||
data["occupant"]["temperaturestatus"] = "average"
|
||||
else
|
||||
data["occupant"]["temperaturestatus"] = "bad"
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[1]
|
||||
data["cellTemperature"] = round(air1.temperature, 1)
|
||||
|
||||
data["isBeakerLoaded"] = beaker ? TRUE : FALSE
|
||||
var/beakerContents = list()
|
||||
if(beaker && beaker.reagents && beaker.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
beakerContents += list(list("name" = R.name, "volume" = R.volume))
|
||||
data["beakerContents"] = beakerContents
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
if(on)
|
||||
on = FALSE
|
||||
else if(!state_open)
|
||||
on = TRUE
|
||||
. = TRUE
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine()
|
||||
. = TRUE
|
||||
if("autoeject")
|
||||
autoeject = !autoeject
|
||||
. = TRUE
|
||||
if("ejectbeaker")
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(Adjacent(usr) && !issilicon(usr))
|
||||
usr.put_in_hands(beaker)
|
||||
beaker = null
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
|
||||
return // we don't see the pipe network while inside cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user)
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_crawl_through()
|
||||
return // can't ventcrawl in or out of cryo.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/can_see_pipes()
|
||||
return 0 // you can't see the pipe network when inside a cryo cell.
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/return_temperature()
|
||||
var/datum/gas_mixture/G = airs[1]
|
||||
|
||||
if(G.total_moles() > 10)
|
||||
return G.temperature
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/wrench/W)
|
||||
. = ..()
|
||||
if(.)
|
||||
SetInitDirections()
|
||||
var/obj/machinery/atmospherics/node = nodes[1]
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
nodes[1] = null
|
||||
nullifyPipenet(parents[1])
|
||||
atmosinit()
|
||||
node = nodes[1]
|
||||
if(node)
|
||||
node.atmosinit()
|
||||
node.addMember(src)
|
||||
build_network()
|
||||
|
||||
#undef CRYOMOBS
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 30)
|
||||
layer = OBJ_LAYER
|
||||
circuit = /obj/item/circuitboard/machine/thermomachine
|
||||
ui_x = 300
|
||||
ui_y = 230
|
||||
|
||||
pipe_flags = PIPING_ONE_PER_TURF
|
||||
|
||||
@@ -128,7 +126,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "thermomachine", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, ui_key, "thermomachine", name, 400, 240, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/ui_data(mob/user)
|
||||
@@ -219,15 +217,13 @@
|
||||
min_temperature = max(T0C - (initial(min_temperature) + L * 15), TCMB) //73.15K with T1 stock parts
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/freezer/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
target_temperature = min_temperature
|
||||
target_temperature = min_temperature
|
||||
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
message_admins("[src.name] was minimized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/heater
|
||||
name = "heater"
|
||||
@@ -251,7 +247,6 @@
|
||||
max_temperature = T20C + (initial(max_temperature) * L) //573.15K with T1 stock parts
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/thermomachine/heater/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
var/area/A = get_area(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
|
||||
@@ -259,4 +254,3 @@
|
||||
target_temperature = max_temperature
|
||||
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
|
||||
message_admins("[src.name] was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
|
||||
return TRUE
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
if(item.parent)
|
||||
var/static/pipenetwarnings = 10
|
||||
if(pipenetwarnings > 0)
|
||||
log_mapping("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) Nearby: ([item.x], [item.y], [item.z]).")
|
||||
warning("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) Nearby: ([item.x], [item.y], [item.z])")
|
||||
pipenetwarnings -= 1
|
||||
if(pipenetwarnings == 0)
|
||||
log_mapping("build_pipeline(): further messages about pipenets will be suppressed")
|
||||
warning("build_pipeline(): further messages about pipenets will be suppressed")
|
||||
members += item
|
||||
possible_expansions += item
|
||||
|
||||
|
||||
@@ -1,147 +1,147 @@
|
||||
/obj/machinery/meter
|
||||
name = "gas flow meter"
|
||||
desc = "It measures something."
|
||||
icon = 'icons/obj/atmospherics/pipes/meter.dmi'
|
||||
icon_state = "meterX"
|
||||
layer = GAS_PUMP_LAYER
|
||||
power_channel = ENVIRON
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
max_integrity = 150
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 40, "acid" = 0)
|
||||
var/frequency = 0
|
||||
var/atom/target
|
||||
var/id_tag
|
||||
var/target_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/machinery/meter/atmos
|
||||
frequency = FREQ_ATMOS_STORAGE
|
||||
|
||||
/obj/machinery/meter/atmos/atmos_waste_loop
|
||||
name = "waste loop gas flow meter"
|
||||
id_tag = ATMOS_GAS_MONITOR_LOOP_ATMOS_WASTE
|
||||
|
||||
/obj/machinery/meter/atmos/distro_loop
|
||||
name = "distribution loop gas flow meter"
|
||||
id_tag = ATMOS_GAS_MONITOR_LOOP_DISTRIBUTION
|
||||
|
||||
/obj/machinery/meter/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/Initialize(mapload, new_piping_layer)
|
||||
if(!isnull(new_piping_layer))
|
||||
target_layer = new_piping_layer
|
||||
SSair.atmos_machinery += src
|
||||
if(!target)
|
||||
reattach_to_layer()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/proc/reattach_to_layer()
|
||||
var/obj/machinery/atmospherics/candidate
|
||||
for(var/obj/machinery/atmospherics/pipe/pipe in loc)
|
||||
if(pipe.piping_layer == target_layer)
|
||||
candidate = pipe
|
||||
if(pipe.level == 2)
|
||||
break
|
||||
if(candidate)
|
||||
target = candidate
|
||||
setAttachLayer(candidate.piping_layer)
|
||||
|
||||
/obj/machinery/meter/proc/setAttachLayer(new_layer)
|
||||
target_layer = new_layer
|
||||
PIPING_LAYER_DOUBLE_SHIFT(src, target_layer)
|
||||
|
||||
/obj/machinery/meter/process_atmos()
|
||||
if(!(target?.flags_1 & INITIALIZED_1))
|
||||
icon_state = "meterX"
|
||||
return 0
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "meter0"
|
||||
return 0
|
||||
|
||||
use_power(5)
|
||||
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(!environment)
|
||||
icon_state = "meterX"
|
||||
return 0
|
||||
|
||||
var/env_pressure = environment.return_pressure()
|
||||
if(env_pressure <= 0.15*ONE_ATMOSPHERE)
|
||||
icon_state = "meter0"
|
||||
else if(env_pressure <= 1.8*ONE_ATMOSPHERE)
|
||||
var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5)
|
||||
icon_state = "meter1_[val]"
|
||||
else if(env_pressure <= 30*ONE_ATMOSPHERE)
|
||||
var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1
|
||||
icon_state = "meter2_[val]"
|
||||
else if(env_pressure <= 59*ONE_ATMOSPHERE)
|
||||
var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1
|
||||
icon_state = "meter3_[val]"
|
||||
else
|
||||
icon_state = "meter4"
|
||||
|
||||
if(frequency)
|
||||
var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency)
|
||||
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new(list(
|
||||
"id_tag" = id_tag,
|
||||
"device" = "AM",
|
||||
"pressure" = round(env_pressure),
|
||||
"sigtype" = "status"
|
||||
))
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/machinery/meter/proc/status()
|
||||
if (target)
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(environment)
|
||||
. = "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)] K ([round(environment.temperature-T0C,0.01)]°C)."
|
||||
else
|
||||
. = "The sensor error light is blinking."
|
||||
else
|
||||
. = "The connect error light is blinking."
|
||||
|
||||
/obj/machinery/meter/examine(mob/user)
|
||||
. = ..()
|
||||
. += status()
|
||||
|
||||
/obj/machinery/meter/wrench_act(mob/user, obj/item/I)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (I.use_tool(src, user, 40, volume=50))
|
||||
user.visible_message(
|
||||
"[user] unfastens \the [src].",
|
||||
"<span class='notice'>You unfasten \the [src].</span>",
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/meter/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
new /obj/item/pipe_meter(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/meter/interact(mob/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
else
|
||||
to_chat(user, status())
|
||||
|
||||
/obj/machinery/meter/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct()
|
||||
|
||||
// TURF METER - REPORTS A TILE'S AIR CONTENTS
|
||||
// why are you yelling?
|
||||
/obj/machinery/meter/turf
|
||||
|
||||
/obj/machinery/meter/turf/reattach_to_layer()
|
||||
target = loc
|
||||
/obj/machinery/meter
|
||||
name = "gas flow meter"
|
||||
desc = "It measures something."
|
||||
icon = 'icons/obj/atmospherics/pipes/meter.dmi'
|
||||
icon_state = "meterX"
|
||||
layer = GAS_PUMP_LAYER
|
||||
power_channel = ENVIRON
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
max_integrity = 150
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 40, "acid" = 0)
|
||||
var/frequency = 0
|
||||
var/atom/target
|
||||
var/id_tag
|
||||
var/target_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/machinery/meter/atmos
|
||||
frequency = FREQ_ATMOS_STORAGE
|
||||
|
||||
/obj/machinery/meter/atmos/atmos_waste_loop
|
||||
name = "waste loop gas flow meter"
|
||||
id_tag = ATMOS_GAS_MONITOR_LOOP_ATMOS_WASTE
|
||||
|
||||
/obj/machinery/meter/atmos/distro_loop
|
||||
name = "distribution loop gas flow meter"
|
||||
id_tag = ATMOS_GAS_MONITOR_LOOP_DISTRIBUTION
|
||||
|
||||
/obj/machinery/meter/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/Initialize(mapload, new_piping_layer)
|
||||
if(!isnull(new_piping_layer))
|
||||
target_layer = new_piping_layer
|
||||
SSair.atmos_machinery += src
|
||||
if(!target)
|
||||
reattach_to_layer()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/proc/reattach_to_layer()
|
||||
var/obj/machinery/atmospherics/candidate
|
||||
for(var/obj/machinery/atmospherics/pipe/pipe in loc)
|
||||
if(pipe.piping_layer == target_layer)
|
||||
candidate = pipe
|
||||
if(pipe.level == 2)
|
||||
break
|
||||
if(candidate)
|
||||
target = candidate
|
||||
setAttachLayer(candidate.piping_layer)
|
||||
|
||||
/obj/machinery/meter/proc/setAttachLayer(new_layer)
|
||||
target_layer = new_layer
|
||||
PIPING_LAYER_DOUBLE_SHIFT(src, target_layer)
|
||||
|
||||
/obj/machinery/meter/process_atmos()
|
||||
if(!target)
|
||||
icon_state = "meterX"
|
||||
return 0
|
||||
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "meter0"
|
||||
return 0
|
||||
|
||||
use_power(5)
|
||||
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(!environment)
|
||||
icon_state = "meterX"
|
||||
return 0
|
||||
|
||||
var/env_pressure = environment.return_pressure()
|
||||
if(env_pressure <= 0.15*ONE_ATMOSPHERE)
|
||||
icon_state = "meter0"
|
||||
else if(env_pressure <= 1.8*ONE_ATMOSPHERE)
|
||||
var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5)
|
||||
icon_state = "meter1_[val]"
|
||||
else if(env_pressure <= 30*ONE_ATMOSPHERE)
|
||||
var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1
|
||||
icon_state = "meter2_[val]"
|
||||
else if(env_pressure <= 59*ONE_ATMOSPHERE)
|
||||
var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1
|
||||
icon_state = "meter3_[val]"
|
||||
else
|
||||
icon_state = "meter4"
|
||||
|
||||
if(frequency)
|
||||
var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency)
|
||||
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new(list(
|
||||
"id_tag" = id_tag,
|
||||
"device" = "AM",
|
||||
"pressure" = round(env_pressure),
|
||||
"sigtype" = "status"
|
||||
))
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/machinery/meter/proc/status()
|
||||
if (target)
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(environment)
|
||||
. = "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)] K ([round(environment.temperature-T0C,0.01)]°C)."
|
||||
else
|
||||
. = "The sensor error light is blinking."
|
||||
else
|
||||
. = "The connect error light is blinking."
|
||||
|
||||
/obj/machinery/meter/examine(mob/user)
|
||||
. = ..()
|
||||
. += status()
|
||||
|
||||
/obj/machinery/meter/wrench_act(mob/user, obj/item/I)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (I.use_tool(src, user, 40, volume=50))
|
||||
user.visible_message(
|
||||
"[user] unfastens \the [src].",
|
||||
"<span class='notice'>You unfasten \the [src].</span>",
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/meter/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
new /obj/item/pipe_meter(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/meter/interact(mob/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
else
|
||||
to_chat(user, status())
|
||||
|
||||
/obj/machinery/meter/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct()
|
||||
|
||||
// TURF METER - REPORTS A TILE'S AIR CONTENTS
|
||||
// why are you yelling?
|
||||
/obj/machinery/meter/turf
|
||||
|
||||
/obj/machinery/meter/turf/reattach_to_layer()
|
||||
target = loc
|
||||
|
||||
@@ -1,156 +1,154 @@
|
||||
/obj/machinery/portable_atmospherics
|
||||
name = "portable_atmospherics"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
use_power = NO_POWER_USE
|
||||
max_integrity = 250
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 60, "acid" = 30)
|
||||
anchored = FALSE
|
||||
|
||||
var/datum/gas_mixture/air_contents
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/connected_port
|
||||
var/obj/item/tank/holding
|
||||
|
||||
var/volume = 0
|
||||
|
||||
var/maximum_pressure = 90 * ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/portable_atmospherics/New()
|
||||
..()
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
air_contents = new
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
disconnect()
|
||||
qdel(air_contents)
|
||||
air_contents = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/process_atmos()
|
||||
if(!connected_port) // Pipe network handles reactions if connected.
|
||||
air_contents.react(src)
|
||||
else
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/components/unary/portables_connector/new_port)
|
||||
//Make sure not already connected to something else
|
||||
if(connected_port || !new_port || new_port.connected_device)
|
||||
return FALSE
|
||||
|
||||
//Make sure are close enough for a valid connection
|
||||
if(new_port.loc != get_turf(src))
|
||||
return FALSE
|
||||
|
||||
//Perform the connection
|
||||
connected_port = new_port
|
||||
connected_port.connected_device = src
|
||||
var/datum/pipeline/connected_port_parent = connected_port.parents[1]
|
||||
connected_port_parent.reconcile_air()
|
||||
|
||||
anchored = TRUE //Prevent movement
|
||||
pixel_x = new_port.pixel_x
|
||||
pixel_y = new_port.pixel_y
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
disconnect()
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/disconnect()
|
||||
if(!connected_port)
|
||||
return FALSE
|
||||
anchored = FALSE
|
||||
connected_port.connected_device = null
|
||||
connected_port = null
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, !ismonkey(user)))
|
||||
return
|
||||
if(holding)
|
||||
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
|
||||
replace_tank(user, TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(holding)
|
||||
. += "<span class='notice'>\The [src] contains [holding]. Alt-click [src] to remove it.</span>"
|
||||
. += "<span class='notice'>Click [src] with another gas tank to hot swap [holding].</span>"
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(holding)
|
||||
if(new_tank)
|
||||
holding = new_tank
|
||||
else
|
||||
holding = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank))
|
||||
if(!(stat & BROKEN))
|
||||
var/obj/item/tank/T = W
|
||||
if(!user.transferItemToLoc(T, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
|
||||
replace_tank(user, FALSE, T)
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
if(!(stat & BROKEN))
|
||||
if(connected_port)
|
||||
disconnect()
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] disconnects [src].", \
|
||||
"<span class='notice'>You unfasten [src] from the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
|
||||
if(!possible_port)
|
||||
to_chat(user, "<span class='notice'>Nothing happens.</span>")
|
||||
return
|
||||
if(!connect(possible_port))
|
||||
to_chat(user, "<span class='notice'>[name] failed to connect to the port.</span>")
|
||||
return
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] connects [src].", \
|
||||
"<span class='notice'>You fasten [src] to the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/analyzer_act(mob/living/user, obj/item/I)
|
||||
atmosanalyzer_scan(air_contents, user, src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/attacked_by(obj/item/I, mob/user)
|
||||
if(I.force < 10 && !(stat & BROKEN))
|
||||
take_damage(0)
|
||||
else
|
||||
investigate_log("was smacked with \a [I] by [key_name(user)].", INVESTIGATE_ATMOS)
|
||||
add_fingerprint(user)
|
||||
..()
|
||||
/obj/machinery/portable_atmospherics
|
||||
name = "portable_atmospherics"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
use_power = NO_POWER_USE
|
||||
max_integrity = 250
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 60, "acid" = 30)
|
||||
anchored = FALSE
|
||||
|
||||
var/datum/gas_mixture/air_contents
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/connected_port
|
||||
var/obj/item/tank/holding
|
||||
|
||||
var/volume = 0
|
||||
|
||||
var/maximum_pressure = 90 * ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/portable_atmospherics/New()
|
||||
..()
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
air_contents = new
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
|
||||
disconnect()
|
||||
qdel(air_contents)
|
||||
air_contents = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/process_atmos()
|
||||
if(!connected_port) // Pipe network handles reactions if connected.
|
||||
air_contents.react(src)
|
||||
else
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/components/unary/portables_connector/new_port)
|
||||
//Make sure not already connected to something else
|
||||
if(connected_port || !new_port || new_port.connected_device)
|
||||
return FALSE
|
||||
|
||||
//Make sure are close enough for a valid connection
|
||||
if(new_port.loc != get_turf(src))
|
||||
return FALSE
|
||||
|
||||
//Perform the connection
|
||||
connected_port = new_port
|
||||
connected_port.connected_device = src
|
||||
var/datum/pipeline/connected_port_parent = connected_port.parents[1]
|
||||
connected_port_parent.reconcile_air()
|
||||
|
||||
anchored = TRUE //Prevent movement
|
||||
pixel_x = new_port.pixel_x
|
||||
pixel_y = new_port.pixel_y
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/Move()
|
||||
. = ..()
|
||||
if(.)
|
||||
disconnect()
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/disconnect()
|
||||
if(!connected_port)
|
||||
return FALSE
|
||||
anchored = FALSE
|
||||
connected_port.connected_device = null
|
||||
connected_port = null
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, !ismonkey(user)))
|
||||
return
|
||||
if(holding)
|
||||
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
|
||||
replace_tank(user, TRUE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/examine(mob/user)
|
||||
. = ..()
|
||||
if(holding)
|
||||
. += "<span class='notice'>\The [src] contains [holding]. Alt-click [src] to remove it.</span>"
|
||||
. += "<span class='notice'>Click [src] with another gas tank to hot swap [holding].</span>"
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
user.put_in_hands(holding)
|
||||
if(new_tank)
|
||||
holding = new_tank
|
||||
else
|
||||
holding = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank))
|
||||
if(!(stat & BROKEN))
|
||||
var/obj/item/tank/T = W
|
||||
if(!user.transferItemToLoc(T, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
|
||||
replace_tank(user, FALSE, T)
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
if(!(stat & BROKEN))
|
||||
if(connected_port)
|
||||
disconnect()
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] disconnects [src].", \
|
||||
"<span class='notice'>You unfasten [src] from the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate(/obj/machinery/atmospherics/components/unary/portables_connector) in loc
|
||||
if(!possible_port)
|
||||
to_chat(user, "<span class='notice'>Nothing happens.</span>")
|
||||
return
|
||||
if(!connect(possible_port))
|
||||
to_chat(user, "<span class='notice'>[name] failed to connect to the port.</span>")
|
||||
return
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] connects [src].", \
|
||||
"<span class='notice'>You fasten [src] to the port.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/analyzer_act(mob/living/user, obj/item/I)
|
||||
atmosanalyzer_scan(air_contents, user, src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/attacked_by(obj/item/I, mob/user)
|
||||
if(I.force < 10 && !(stat & BROKEN))
|
||||
take_damage(0)
|
||||
else
|
||||
investigate_log("was smacked with \a [I] by [key_name(user)].", INVESTIGATE_ATMOS)
|
||||
add_fingerprint(user)
|
||||
..()
|
||||
|
||||
@@ -84,14 +84,14 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "portable_pump", name, 300, 315, master_ui, state)
|
||||
ui = new(user, src, ui_key, "portable_pump", name, 420, 415, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = on
|
||||
data["direction"] = direction == PUMP_IN ? TRUE : FALSE
|
||||
data["connected"] = connected_port ? TRUE : FALSE
|
||||
data["direction"] = direction
|
||||
data["connected"] = connected_port ? 1 : 0
|
||||
data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
data["target_pressure"] = round(pump.target_pressure ? pump.target_pressure : 0)
|
||||
data["default_pressure"] = round(PUMP_DEFAULT_PRESSURE)
|
||||
@@ -102,8 +102,6 @@
|
||||
data["holding"] = list()
|
||||
data["holding"]["name"] = holding.name
|
||||
data["holding"]["pressure"] = round(holding.air_contents.return_pressure())
|
||||
else
|
||||
data["holding"] = null
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_act(action, params)
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "portable_scrubber", name, 320, 335, master_ui, state)
|
||||
ui = new(user, src, ui_key, "portable_scrubber", name, 420, 435, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_data()
|
||||
@@ -85,8 +85,6 @@
|
||||
data["holding"] = list()
|
||||
data["holding"]["name"] = holding.name
|
||||
data["holding"]["pressure"] = round(holding.air_contents.return_pressure())
|
||||
else
|
||||
data["holding"] = null
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_act(action, params)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
dat += "Locked on<BR>"
|
||||
dat += "<B>Charge progress: [reload]/[reload_cooldown]:</B><BR>"
|
||||
dat += "<A href='byond://?src=[REF(src)];fire=1'>Open Fire</A><BR>"
|
||||
dat += "Deployment of weapon authorized by <br>Kinaris Naval Command<br><br>Remember, friendly fire is grounds for termination of your contract and life.<HR>"
|
||||
dat += "Deployment of weapon authorized by <br>Nanotrasen Naval Command<br><br>Remember, friendly fire is grounds for termination of your contract and life.<HR>"
|
||||
user << browse(dat, "window=scroll")
|
||||
onclose(user, "scroll")
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
var/death = TRUE //Kill the mob
|
||||
var/roundstart = TRUE //fires on initialize
|
||||
var/instant = FALSE //fires on New
|
||||
var/short_desc = "The mapper forgot to set this!"
|
||||
var/flavour_text = ""
|
||||
var/important_info = ""
|
||||
var/flavour_text = "The mapper forgot to set this!"
|
||||
var/faction = null
|
||||
var/permanent = FALSE //If true, the spawner will not disappear upon running out of uses.
|
||||
var/random = FALSE //Don't set a name or gender, just go random
|
||||
@@ -120,12 +118,7 @@
|
||||
if(ckey)
|
||||
M.ckey = ckey
|
||||
if(show_flavour)
|
||||
var/output_message = "<span class='big bold'>[short_desc]</span>"
|
||||
if(flavour_text != "")
|
||||
output_message += "\n<span class='bold'>[flavour_text]</span>"
|
||||
if(important_info != "")
|
||||
output_message += "\n<span class='userdanger'>[important_info]</span>"
|
||||
to_chat(M, output_message)
|
||||
to_chat(M, "[flavour_text]")
|
||||
var/datum/mind/MM = M.mind
|
||||
if(objectives)
|
||||
for(var/objective in objectives)
|
||||
@@ -352,7 +345,7 @@
|
||||
name = "sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
short_desc = "You are a space doctor!"
|
||||
flavour_text = "<span class='big bold'>You are a space doctor!</span>"
|
||||
assignedrole = "Space Doctor"
|
||||
job_description = "Off-station Doctor"
|
||||
|
||||
@@ -409,8 +402,7 @@
|
||||
name = "bartender sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
short_desc = "You are a space bartender!"
|
||||
flavour_text = "Time to mix drinks and change lives. Smoking space drugs makes it easier to understand your patrons' odd dialect."
|
||||
flavour_text = "<span class='big bold'>You are a space bartender!</span><b> Time to mix drinks and change lives. Smoking space drugs makes it easier to understand your patrons' odd dialect.</b>"
|
||||
assignedrole = "Space Bartender"
|
||||
id_job = "Bartender"
|
||||
mirrorcanloadappearance = TRUE
|
||||
@@ -437,8 +429,7 @@
|
||||
name = "beach bum sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
short_desc = "You're a spunky lifeguard!"
|
||||
flavour_text = "It's up to you to make sure nobody drowns or gets eaten by sharks and stuff."
|
||||
flavour_text = "<span class='big bold'>You're, like, totally a dudebro, bruh.</span><b> Ch'yea. You came here, like, on spring break, hopin' to pick up some bangin' hot chicks, y'knaw?</b>"
|
||||
assignedrole = "Beach Bum"
|
||||
|
||||
/obj/effect/mob_spawn/human/beach/alive/lifeguard
|
||||
@@ -527,7 +518,7 @@
|
||||
name = "sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
short_desc = "You are a Nanotrasen Commander!"
|
||||
flavour_text = "<span class='big bold'>You are a Nanotrasen Commander!</span>"
|
||||
|
||||
/obj/effect/mob_spawn/human/nanotrasensoldier/alive
|
||||
death = FALSE
|
||||
@@ -538,7 +529,7 @@
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
faction = "nanotrasenprivate"
|
||||
short_desc = "You are a Nanotrasen Private Security Officer!"
|
||||
flavour_text = "<span class='big bold'>You are a Nanotrasen Private Security Officer!</span>"
|
||||
|
||||
|
||||
/////////////////Spooky Undead//////////////////////
|
||||
@@ -555,8 +546,7 @@
|
||||
job_description = "Skeleton"
|
||||
icon = 'icons/effects/blood.dmi'
|
||||
icon_state = "remains"
|
||||
short_desc = "By unknown powers, your skeletal remains have been reanimated!"
|
||||
flavour_text = "Walk this mortal plain and terrorize all living adventurers who dare cross your path."
|
||||
flavour_text = "<span class='big bold'>By unknown powers, your skeletal remains have been reanimated!</span><b> Walk this mortal plain and terrorize all living adventurers who dare cross your path.</b>"
|
||||
assignedrole = "Skeleton"
|
||||
|
||||
/obj/effect/mob_spawn/human/zombie
|
||||
@@ -571,9 +561,7 @@
|
||||
job_description = "Zombie"
|
||||
icon = 'icons/effects/blood.dmi'
|
||||
icon_state = "remains"
|
||||
short_desc = "By unknown powers, your rotting remains have been resurrected!"
|
||||
flavour_text = "Walk this mortal plain and terrorize all living adventurers who dare cross your path."
|
||||
|
||||
flavour_text = "<span class='big bold'>By unknown powers, your rotting remains have been resurrected!</span><b> Walk this mortal plain and terrorize all living adventurers who dare cross your path.</b>"
|
||||
|
||||
|
||||
/obj/effect/mob_spawn/human/abductor
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user