mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge remote-tracking branch 'upstream/dev' into boolit
This commit is contained in:
@@ -40,6 +40,9 @@
|
||||
canister_color = "blue"
|
||||
can_label = 0
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen/prechilled
|
||||
name = "Canister: \[O2 (Cryo)\]"
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/phoron
|
||||
name = "Canister \[Phoron\]"
|
||||
icon_state = "orange"
|
||||
@@ -374,6 +377,14 @@ update_flag
|
||||
src.update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen/prechilled/New()
|
||||
..()
|
||||
|
||||
src.air_contents.adjust_gas("oxygen", MolesForPressure())
|
||||
src.air_contents.temperature = 80
|
||||
src.update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/sleeping_agent/New()
|
||||
..()
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/obj/machinery/driver_button
|
||||
name = "mass driver button"
|
||||
/obj/machinery/button
|
||||
name = "button"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
desc = "A remote control switch for a mass driver."
|
||||
desc = "A remote control switch for something."
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
@@ -10,38 +10,10 @@
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/machinery/ignition_switch
|
||||
name = "ignition switch"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
desc = "A remote control switch for a mounted igniter."
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
/obj/machinery/button/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/flasher_button
|
||||
name = "flasher button"
|
||||
desc = "A remote control switch for a mounted flasher."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "launcherbtt"
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
|
||||
/obj/machinery/crema_switch
|
||||
desc = "Burn baby burn!"
|
||||
name = "crematorium igniter"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "crema_switch"
|
||||
anchored = 1.0
|
||||
req_access = list(access_crematorium)
|
||||
var/on = 0
|
||||
var/area/area = null
|
||||
var/otherarea = null
|
||||
var/id = 1
|
||||
/obj/machinery/button/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
return
|
||||
return src.attack_hand(user)
|
||||
@@ -127,6 +127,10 @@
|
||||
//don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras.
|
||||
if(isAI(user))
|
||||
var/mob/living/silicon/ai/A = user
|
||||
// Only allow non-carded AIs to view because the interaction with the eye gets all wonky otherwise.
|
||||
if(!A.is_in_chassis())
|
||||
return 0
|
||||
|
||||
A.eyeobj.setLoc(get_turf(C))
|
||||
A.client.eye = A.eyeobj
|
||||
return 1
|
||||
|
||||
@@ -148,30 +148,20 @@
|
||||
else
|
||||
icon_state = "doorctrl0"
|
||||
|
||||
/obj/machinery/driver_button/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/button/driver
|
||||
name = "mass driver button"
|
||||
desc = "A remote control switch for a mass driver."
|
||||
|
||||
/obj/machinery/driver_button/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
/obj/machinery/button/driver/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/driver_button/attack_hand(mob/user as mob)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(active)
|
||||
return
|
||||
add_fingerprint(user)
|
||||
|
||||
use_power(5)
|
||||
|
||||
active = 1
|
||||
icon_state = "launcheract"
|
||||
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.open()
|
||||
@@ -179,13 +169,13 @@
|
||||
|
||||
sleep(20)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if(M.id == src.id)
|
||||
M.drive()
|
||||
|
||||
sleep(50)
|
||||
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.close()
|
||||
|
||||
@@ -119,17 +119,13 @@
|
||||
user.show_message(text("\red [src] is now secured."))
|
||||
src.overlays += "[base_state]-s"
|
||||
|
||||
/obj/machinery/flasher_button/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/button/flasher
|
||||
name = "flasher button"
|
||||
desc = "A remote control switch for a mounted flasher."
|
||||
|
||||
/obj/machinery/flasher_button/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/button/flasher/attack_hand(mob/user as mob)
|
||||
|
||||
/obj/machinery/flasher_button/attack_hand(mob/user as mob)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(active)
|
||||
if(..())
|
||||
return
|
||||
|
||||
use_power(5)
|
||||
|
||||
@@ -32,42 +32,23 @@
|
||||
on_icon = "surgery"
|
||||
////////////////////SWITCH///////////////////////////////////////
|
||||
|
||||
/obj/machinery/holosign_switch
|
||||
/obj/machinery/button/holosign
|
||||
name = "holosign switch"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "light1"
|
||||
desc = "A remote control switch for holosign."
|
||||
var/id = null
|
||||
var/active = 0
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 4
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "crema_switch"
|
||||
|
||||
/obj/machinery/holosign_switch/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/
|
||||
|
||||
/obj/machinery/holosign_switch/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
return
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/holosign_switch/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
/obj/machinery/button/holosign/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
add_fingerprint(user)
|
||||
|
||||
use_power(5)
|
||||
|
||||
active = !active
|
||||
if(active)
|
||||
icon_state = "light1"
|
||||
else
|
||||
icon_state = "light0"
|
||||
icon_state = "light[active]"
|
||||
|
||||
for(var/obj/machinery/holosign/M in world)
|
||||
for(var/obj/machinery/holosign/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.toggle()
|
||||
|
||||
@@ -115,17 +115,13 @@
|
||||
ignite()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/ignition_switch/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/button/ignition
|
||||
name = "ignition switch"
|
||||
desc = "A remote control switch for a mounted igniter."
|
||||
|
||||
/obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/button/ignition/attack_hand(mob/user as mob)
|
||||
|
||||
/obj/machinery/ignition_switch/attack_hand(mob/user as mob)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(active)
|
||||
if(..())
|
||||
return
|
||||
|
||||
use_power(5)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/obj/machinery/light_switch/New()
|
||||
..()
|
||||
spawn(5)
|
||||
src.area = src.loc.loc
|
||||
src.area = get_area(src)
|
||||
|
||||
if(otherarea)
|
||||
src.area = locate(text2path("/area/[otherarea]"))
|
||||
@@ -32,10 +32,7 @@
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "light-p"
|
||||
else
|
||||
if(on)
|
||||
icon_state = "light1"
|
||||
else
|
||||
icon_state = "light0"
|
||||
icon_state = "light[on]"
|
||||
|
||||
/obj/machinery/light_switch/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
|
||||
@@ -187,63 +187,9 @@ Class Procs:
|
||||
/obj/machinery/Topic(href, href_list, var/nowindow = 0, var/checkrange = 1)
|
||||
if(..())
|
||||
return 1
|
||||
if(!can_be_used_by(usr, be_close = checkrange))
|
||||
return 1
|
||||
add_fingerprint(usr)
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/can_be_used_by(mob/user, be_close = 1)
|
||||
if(!interact_offline && stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
if(!user.canUseTopic(src, be_close))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/mob/proc/canUseTopic(atom/movable/M, be_close = 1)
|
||||
return
|
||||
|
||||
/mob/dead/observer/canUseTopic(atom/movable/M, be_close = 1)
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
return
|
||||
|
||||
/mob/living/canUseTopic(atom/movable/M, be_close = 1, no_dextery = 0)
|
||||
if(no_dextery)
|
||||
src << "<span class='notice'>You don't have the dexterity to do this!</span>"
|
||||
return 0
|
||||
return be_close && !in_range(M, src)
|
||||
|
||||
/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close = 1)
|
||||
if(restrained() || lying || stat || stunned || weakened)
|
||||
return
|
||||
if(be_close && !in_range(M, src))
|
||||
if(TK in mutations)
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H.l_hand, /obj/item/tk_grab) || istype(H.r_hand, /obj/item/tk_grab))
|
||||
return 1
|
||||
return
|
||||
if(!isturf(M.loc) && M.loc != src)
|
||||
return
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/canUseTopic(atom/movable/M)
|
||||
if(stat)
|
||||
return
|
||||
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
|
||||
// unless it's on the same level as the object it's interacting with.
|
||||
if(!(z == M.z || M.z in config.player_levels))
|
||||
return
|
||||
//stop AIs from leaving windows open and using then after they lose vision
|
||||
//apc_override is needed here because AIs use their own APC when powerless
|
||||
if(cameranet && !cameranet.checkTurfVis(get_turf(M)) && !apc_override)
|
||||
return
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/canUseTopic(atom/movable/M)
|
||||
if(stat || lockcharge || stunned || weakened)
|
||||
return
|
||||
return 1
|
||||
return 1
|
||||
return 0
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -108,6 +108,9 @@ datum/nano_item_lists
|
||||
return pick(random_items)
|
||||
|
||||
/obj/item/device/uplink/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["buy_item"] == "random")
|
||||
var/datum/uplink_item/UI = chooseRandomItem()
|
||||
href_list["buy_item"] = UI.reference
|
||||
@@ -208,10 +211,10 @@ datum/nano_item_lists
|
||||
// The purchasing code.
|
||||
/obj/item/device/uplink/hidden/Topic(href, href_list)
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
return 1
|
||||
|
||||
if (!( istype(usr, /mob/living/carbon/human)))
|
||||
return 0
|
||||
return 1
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
if ((usr.contents.Find(src.loc) || (in_range(src.loc, usr) && istype(src.loc.loc, /turf))))
|
||||
|
||||
@@ -16,11 +16,14 @@
|
||||
var/damtype = "brute"
|
||||
var/force = 0
|
||||
|
||||
/obj/Topic(href, href_list, var/nowindow = 0)
|
||||
/obj/Topic(href, href_list, var/nowindow = 0, var/checkrange = 1)
|
||||
// Calling Topic without a corresponding window open causes runtime errors
|
||||
if(nowindow)
|
||||
return 0
|
||||
return ..()
|
||||
if(!nowindow && ..())
|
||||
return 1
|
||||
if(usr.can_interact_with_interface(src, checkrange) != STATUS_INTERACTIVE)
|
||||
return 1
|
||||
add_fingerprint(usr)
|
||||
return 0
|
||||
|
||||
/obj/item/proc/is_used_on(obj/O, mob/user)
|
||||
|
||||
|
||||
@@ -379,12 +379,21 @@
|
||||
//Foreach goto(99)
|
||||
return
|
||||
|
||||
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
|
||||
/obj/machinery/button/crematorium
|
||||
name = "crematorium igniter"
|
||||
desc = "Burn baby burn!"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "crema_switch"
|
||||
req_access = list(access_crematorium)
|
||||
id = 1
|
||||
|
||||
/obj/machinery/button/crematorium/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(src.allowed(usr))
|
||||
for (var/obj/structure/crematorium/C in world)
|
||||
if (C.id == id)
|
||||
if (!C.cremating)
|
||||
C.cremate(user)
|
||||
else
|
||||
usr << "\red Access denied."
|
||||
return
|
||||
usr << "<span class='warning'>Access denied.</span>"
|
||||
|
||||
@@ -470,3 +470,38 @@
|
||||
|
||||
update_icon() //icon_state has to be set manually
|
||||
return
|
||||
|
||||
/obj/structure/window/reinforced/polarized
|
||||
name = "electrochromic window"
|
||||
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
|
||||
var/id
|
||||
|
||||
/obj/structure/window/reinforced/polarized/proc/toggle()
|
||||
if(opacity)
|
||||
animate(src, color="#FFFFFF", time=5)
|
||||
SetOpacity(0)
|
||||
else
|
||||
animate(src, color="#222222", time=5)
|
||||
SetOpacity(1)
|
||||
|
||||
/obj/machinery/button/windowtint
|
||||
name = "window tint control"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "light1"
|
||||
desc = "A remote control switch for polarized windows."
|
||||
var/range = 7
|
||||
|
||||
/obj/machinery/button/windowtint/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
use_power(5)
|
||||
|
||||
active = !active
|
||||
icon_state = "light[active]"
|
||||
|
||||
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
|
||||
if (W.id == src.id || !W.id)
|
||||
spawn( 0 )
|
||||
W.toggle()
|
||||
return
|
||||
|
||||
@@ -46,7 +46,7 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/cmd_admin_create_centcom_report,
|
||||
/client/proc/check_words, /*displays cult-words*/
|
||||
/client/proc/check_ai_laws, /*shows AI and borg laws*/
|
||||
/client/proc/rename_ai, /*properly renames the AI*/
|
||||
/client/proc/rename_silicon, /*properly renames silicons*/
|
||||
/client/proc/check_antagonists,
|
||||
/client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/
|
||||
/client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/
|
||||
@@ -108,7 +108,8 @@ var/list/admin_verbs_fun = list(
|
||||
)
|
||||
var/list/admin_verbs_spawn = list(
|
||||
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
|
||||
/client/proc/respawn_character
|
||||
/client/proc/respawn_character,
|
||||
/client/proc/virus2_editor
|
||||
)
|
||||
var/list/admin_verbs_server = list(
|
||||
/client/proc/Set_Holiday,
|
||||
@@ -693,15 +694,15 @@ var/list/admin_verbs_mentor = list(
|
||||
if(holder)
|
||||
src.holder.output_ai_laws()
|
||||
|
||||
/client/proc/rename_ai(mob/living/silicon/ai/AI in world)
|
||||
set name = "Rename AI"
|
||||
/client/proc/rename_silicon(mob/living/silicon/S in world)
|
||||
set name = "Rename Silicon"
|
||||
set category = "Admin"
|
||||
|
||||
if(holder)
|
||||
var/new_name = trim_strip_input(src, "Enter new AI name. Leave blank or as is to cancel.", "Enter new AI Name", AI.name)
|
||||
if(new_name && new_name != AI.name)
|
||||
admin_log_and_message_admins("has renamed the AI '[AI.name]' to '[new_name]'")
|
||||
AI.SetName(new_name)
|
||||
var/new_name = trim_strip_input(src, "Enter new name. Leave blank or as is to cancel.", "Enter new silicon name", S.real_name)
|
||||
if(new_name && new_name != S.real_name)
|
||||
admin_log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
|
||||
S.SetName(new_name)
|
||||
feedback_add_details("admin_verb","RAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
|
||||
@@ -269,8 +269,8 @@
|
||||
name = "fertilizer bottle"
|
||||
desc = "A small glass bottle. Can hold up to 10 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
flags = OPENCONTAINER
|
||||
icon_state = "bottle-4"
|
||||
flags = 0
|
||||
possible_transfer_amounts = null
|
||||
w_class = 2.0
|
||||
|
||||
@@ -288,20 +288,21 @@
|
||||
|
||||
if(fertilizer)
|
||||
reagents.add_reagent(fertilizer,10)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/fertilizer/ez
|
||||
name = "bottle of E-Z-Nutrient"
|
||||
icon_state = "bottle16"
|
||||
icon_state = "bottle-4"
|
||||
fertilizer = "eznutrient"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/fertilizer/l4z
|
||||
name = "bottle of Left 4 Zed"
|
||||
icon_state = "bottle18"
|
||||
icon_state = "bottle-4"
|
||||
fertilizer = "left4zed"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/fertilizer/rh
|
||||
name = "bottle of Robust Harvest"
|
||||
icon_state = "bottle15"
|
||||
icon_state = "bottle-4"
|
||||
fertilizer = "robustharvest"
|
||||
|
||||
//Hatchets and things to kill kudzu
|
||||
|
||||
@@ -67,13 +67,19 @@
|
||||
src << "<span class='name'>[speaker_name]</span>[alt_name] talks but you cannot hear \him."
|
||||
else
|
||||
if(language)
|
||||
src << "<span class='game say'><span class='name'>[speaker_name]</span>[alt_name] [track][language.format_message(message, verb)]</span>"
|
||||
on_hear_say("<span class='game say'><span class='name'>[speaker_name]</span>[alt_name] [track][language.format_message(message, verb)]</span>")
|
||||
else
|
||||
src << "<span class='game say'><span class='name'>[speaker_name]</span>[alt_name] [track][verb], <span class='message'><span class='body'>\"[message]\"</span></span></span>"
|
||||
on_hear_say("<span class='game say'><span class='name'>[speaker_name]</span>[alt_name] [track][verb], <span class='message'><span class='body'>\"[message]\"</span></span></span>")
|
||||
if (speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
|
||||
var/turf/source = speaker? get_turf(speaker) : get_turf(src)
|
||||
src.playsound_local(source, speech_sound, sound_vol, 1)
|
||||
|
||||
/mob/proc/on_hear_say(var/message)
|
||||
src << message
|
||||
|
||||
/mob/living/silicon/on_hear_say(var/message)
|
||||
var/time = say_timestamp()
|
||||
src << "[time] [message]"
|
||||
|
||||
/mob/proc/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="")
|
||||
|
||||
@@ -124,7 +130,6 @@
|
||||
var/changed_voice
|
||||
|
||||
if(istype(src, /mob/living/silicon/ai) && !hard_to_hear)
|
||||
part_a = "<span class='say_quote'>\[[worldtime2text()]\]</span>" + part_a
|
||||
var/jobname // the mob's "job"
|
||||
var/mob/living/carbon/human/impersonating //The crew member being impersonated, if any.
|
||||
|
||||
@@ -185,10 +190,22 @@
|
||||
if(sdisabilities & DEAF || ear_deaf)
|
||||
if(prob(20))
|
||||
src << "<span class='warning'>You feel your headset vibrate but can hear nothing from it!</span>"
|
||||
else if(track)
|
||||
src << "[part_a][track][part_b][formatted]</span></span>"
|
||||
else
|
||||
src << "[part_a][speaker_name][part_b][formatted]</span></span>"
|
||||
on_hear_radio(part_a, speaker_name, track, part_b, formatted)
|
||||
|
||||
/proc/say_timestamp()
|
||||
return "<span class='say_quote'>\[[worldtime2text()]\]</span>"
|
||||
|
||||
/mob/proc/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
|
||||
src << "[part_a][speaker_name][part_b][formatted]</span></span>"
|
||||
|
||||
/mob/living/silicon/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
|
||||
var/time = say_timestamp()
|
||||
src << "[time][part_a][speaker_name][part_b][formatted]</span></span>"
|
||||
|
||||
/mob/living/silicon/ai/on_hear_radio(part_a, speaker_name, track, part_b, formatted)
|
||||
var/time = say_timestamp()
|
||||
src << "[time][part_a][track][part_b][formatted]</span></span>"
|
||||
|
||||
/mob/proc/hear_signlang(var/message, var/verb = "gestures", var/datum/language/language, var/mob/speaker = null)
|
||||
if(!client)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/mob/living/carbon/Life()
|
||||
..()
|
||||
|
||||
handle_viruses()
|
||||
|
||||
// Increase germ_level regularly
|
||||
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
|
||||
germ_level++
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
var/datum/species/species //Contains icon generation and language information, set during New().
|
||||
var/list/stomach_contents = list()
|
||||
var/list/datum/disease2/disease/virus2 = list()
|
||||
var/antibodies = 0
|
||||
var/list/antibodies = list()
|
||||
var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm
|
||||
|
||||
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
if (bodytemperature < 283.222)
|
||||
tally += (283.222 - bodytemperature) / 10 * 1.75
|
||||
|
||||
tally += 2*stance_damage //damaged/missing feet or legs is slow
|
||||
tally += max(2 * stance_damage, 0) //damaged/missing feet or legs is slow
|
||||
|
||||
if(mRun in mutations)
|
||||
tally = 0
|
||||
|
||||
@@ -93,8 +93,6 @@
|
||||
//Random events (vomiting etc)
|
||||
handle_random_events()
|
||||
|
||||
handle_virus_updates()
|
||||
|
||||
//stuff in the stomach
|
||||
handle_stomach()
|
||||
|
||||
@@ -1460,47 +1458,6 @@
|
||||
if(!currentTurf.lighting_lumcount)
|
||||
playsound_local(src,pick(scarySounds),50, 1, -1)
|
||||
|
||||
proc/handle_virus_updates()
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
if(bodytemperature > 406)
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
for (var/ID in virus2)
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
V.cure(src)
|
||||
if(life_tick % 3) //don't spam checks over all objects in view every tick.
|
||||
for(var/obj/effect/decal/cleanable/O in view(1,src))
|
||||
if(istype(O,/obj/effect/decal/cleanable/blood))
|
||||
var/obj/effect/decal/cleanable/blood/B = O
|
||||
if(B.virus2.len)
|
||||
for (var/ID in B.virus2)
|
||||
var/datum/disease2/disease/V = B.virus2[ID]
|
||||
infect_virus2(src,V.getcopy())
|
||||
|
||||
else if(istype(O,/obj/effect/decal/cleanable/mucus))
|
||||
var/obj/effect/decal/cleanable/mucus/M = O
|
||||
if(M.virus2.len)
|
||||
for (var/ID in M.virus2)
|
||||
var/datum/disease2/disease/V = M.virus2[ID]
|
||||
infect_virus2(src,V.getcopy())
|
||||
|
||||
|
||||
if(virus2.len)
|
||||
for (var/ID in virus2)
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
if(isnull(V)) // Trying to figure out a runtime error that keeps repeating
|
||||
CRASH("virus2 nulled before calling activate()")
|
||||
else
|
||||
V.activate(src)
|
||||
// activate may have deleted the virus
|
||||
if(!V) continue
|
||||
|
||||
// check if we're immune
|
||||
if(V.antigen & src.antibodies)
|
||||
V.dead = 1
|
||||
|
||||
return
|
||||
|
||||
proc/handle_stomach()
|
||||
spawn(0)
|
||||
for(var/mob/living/M in stomach_contents)
|
||||
|
||||
@@ -44,9 +44,6 @@
|
||||
//Disabilities
|
||||
handle_disabilities()
|
||||
|
||||
//Virus updates, duh
|
||||
handle_virus_updates()
|
||||
|
||||
//Apparently, the person who wrote this code designed it so that
|
||||
//blinded get reset each cycle and then get activated later in the
|
||||
//code. Very ugly. I dont care. Moving this stuff here so its easy
|
||||
@@ -155,47 +152,6 @@
|
||||
domutcheck(src,null)
|
||||
emote("gasp")
|
||||
|
||||
proc/handle_virus_updates()
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
if(bodytemperature > 406)
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
for (var/ID in virus2)
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
V.cure(src)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/O in view(1,src))
|
||||
if(istype(O,/obj/effect/decal/cleanable/blood))
|
||||
var/obj/effect/decal/cleanable/blood/B = O
|
||||
if(B.virus2.len)
|
||||
for (var/ID in B.virus2)
|
||||
var/datum/disease2/disease/V = B.virus2[ID]
|
||||
infect_virus2(src,V)
|
||||
|
||||
else if(istype(O,/obj/effect/decal/cleanable/mucus))
|
||||
var/obj/effect/decal/cleanable/mucus/M = O
|
||||
|
||||
if(M.virus2.len)
|
||||
for (var/ID in M.virus2)
|
||||
var/datum/disease2/disease/V = M.virus2[ID]
|
||||
infect_virus2(src,V)
|
||||
|
||||
if(virus2.len)
|
||||
for (var/ID in virus2)
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
if(isnull(V)) // Trying to figure out a runtime error that keeps repeating
|
||||
CRASH("virus2 nulled before calling activate()")
|
||||
else
|
||||
V.activate(src)
|
||||
// activate may have deleted the virus
|
||||
if(!V) continue
|
||||
|
||||
// check if we're immune
|
||||
if(V.antigen & src.antibodies)
|
||||
V.dead = 1
|
||||
|
||||
return
|
||||
|
||||
proc/breathe()
|
||||
if(reagents)
|
||||
|
||||
|
||||
43
code/modules/mob/living/carbon/viruses.dm
Normal file
43
code/modules/mob/living/carbon/viruses.dm
Normal file
@@ -0,0 +1,43 @@
|
||||
/mob/living/carbon/proc/handle_viruses()
|
||||
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
|
||||
if(bodytemperature > 406)
|
||||
for(var/datum/disease/D in viruses)
|
||||
D.cure()
|
||||
for (var/ID in virus2)
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
V.cure(src)
|
||||
|
||||
if(life_tick % 3) //don't spam checks over all objects in view every tick.
|
||||
for(var/obj/effect/decal/cleanable/O in view(1,src))
|
||||
if(istype(O,/obj/effect/decal/cleanable/blood))
|
||||
var/obj/effect/decal/cleanable/blood/B = O
|
||||
if(B.virus2.len)
|
||||
for (var/ID in B.virus2)
|
||||
var/datum/disease2/disease/V = B.virus2[ID]
|
||||
infect_virus2(src,V)
|
||||
|
||||
else if(istype(O,/obj/effect/decal/cleanable/mucus))
|
||||
var/obj/effect/decal/cleanable/mucus/M = O
|
||||
if(M.virus2.len)
|
||||
for (var/ID in M.virus2)
|
||||
var/datum/disease2/disease/V = M.virus2[ID]
|
||||
infect_virus2(src,V)
|
||||
|
||||
if(virus2.len)
|
||||
for (var/ID in virus2)
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
if(isnull(V)) // Trying to figure out a runtime error that keeps repeating
|
||||
CRASH("virus2 nulled before calling activate()")
|
||||
else
|
||||
V.activate(src)
|
||||
// activate may have deleted the virus
|
||||
if(!V) continue
|
||||
|
||||
// check if we're immune
|
||||
var/list/common_antibodies = V.antigen & src.antibodies
|
||||
if(common_antibodies.len)
|
||||
V.dead = 1
|
||||
|
||||
return
|
||||
@@ -211,9 +211,8 @@ var/list/ai_verbs_default = list(
|
||||
else
|
||||
stat(null, text("Systems nonfunctional"))
|
||||
|
||||
/mob/living/silicon/ai/proc/SetName(pickedName as text)
|
||||
real_name = pickedName
|
||||
name = pickedName
|
||||
/mob/living/silicon/ai/SetName(pickedName as text)
|
||||
..()
|
||||
announcement.announcer = pickedName
|
||||
if(eyeobj)
|
||||
eyeobj.name = "[pickedName] (AI Eye)"
|
||||
@@ -766,5 +765,8 @@ var/list/ai_verbs_default = list(
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/ai/proc/is_in_chassis()
|
||||
return istype(loc, /turf)
|
||||
|
||||
#undef AI_CHECK_WIRELESS
|
||||
#undef AI_CHECK_RADIO
|
||||
|
||||
@@ -89,26 +89,29 @@
|
||||
else
|
||||
|
||||
//stage = 6
|
||||
src.blind.screen_loc = "1,1 to 15,15"
|
||||
if (src.blind.layer!=18)
|
||||
src.blind.layer = 18
|
||||
src.sight = src.sight&~SEE_TURFS
|
||||
src.sight = src.sight&~SEE_MOBS
|
||||
src.sight = src.sight&~SEE_OBJS
|
||||
src.see_in_dark = 0
|
||||
src.see_invisible = SEE_INVISIBLE_LIVING
|
||||
|
||||
if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item))
|
||||
var/area/current_area = get_area(src)
|
||||
|
||||
if (((!loc.master.power_equip) && current_area.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item))
|
||||
//If our area lacks equipment power, and is not magically powered (i.e. centcom), or if we are in space and not carded, lose power.
|
||||
if (src:aiRestorePowerRoutine==0)
|
||||
src:aiRestorePowerRoutine = 1
|
||||
|
||||
//Blind the AI
|
||||
|
||||
src.blind.screen_loc = "1,1 to 15,15"
|
||||
if (src.blind.layer!=18)
|
||||
src.blind.layer = 18
|
||||
src.sight = src.sight&~SEE_TURFS
|
||||
src.sight = src.sight&~SEE_MOBS
|
||||
src.sight = src.sight&~SEE_OBJS
|
||||
src.see_in_dark = 0
|
||||
src.see_invisible = SEE_INVISIBLE_LIVING
|
||||
|
||||
//Now to tell the AI why they're blind and dying slowly.
|
||||
|
||||
src << "You've lost power!"
|
||||
// world << "DEBUG CODE TIME! [loc] is the area the AI is sucking power from"
|
||||
if (!is_special_character(src))
|
||||
src.set_zeroth_law("")
|
||||
//src.clear_supplied_laws() // Don't reset our laws.
|
||||
//var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
//lawchanges.Add("[time] <b>:</b> [src.name]'s noncore laws have been reset due to power failure")
|
||||
|
||||
spawn(20)
|
||||
src << "Backup battery online. Scanners, camera, and radio interface offline. Beginning fault-detection."
|
||||
sleep(50)
|
||||
@@ -129,17 +132,10 @@
|
||||
src << "Connection verified. Searching for APC in power network."
|
||||
sleep(50)
|
||||
var/obj/machinery/power/apc/theAPC = null
|
||||
/*
|
||||
for (var/something in loc)
|
||||
if (istype(something, /obj/machinery/power/apc))
|
||||
if (!(something:stat & BROKEN))
|
||||
theAPC = something
|
||||
break
|
||||
*/
|
||||
var/PRP //like ERP with the code, at least this stuff is no more 4x sametext
|
||||
|
||||
var/PRP
|
||||
for (PRP=1, PRP<=4, PRP++)
|
||||
var/area/AIarea = get_area(src)
|
||||
for(var/area/A in AIarea.master.related)
|
||||
for(var/area/A in current_area.master.related)
|
||||
for (var/obj/machinery/power/apc/APC in A)
|
||||
if (!(APC.stat & BROKEN))
|
||||
theAPC = APC
|
||||
|
||||
@@ -77,6 +77,11 @@
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
|
||||
//Redefining some robot procs...
|
||||
/mob/living/silicon/robot/drone/SetName(pickedName as text)
|
||||
// Would prefer to call the grandparent proc but this isn't possible, so..
|
||||
real_name = pickedName
|
||||
name = real_name
|
||||
|
||||
/mob/living/silicon/robot/drone/updatename()
|
||||
real_name = "maintenance drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
|
||||
@@ -185,6 +185,10 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
|
||||
|
||||
/mob/living/silicon/robot/SetName(pickedName as text)
|
||||
custom_name = pickedName
|
||||
updatename()
|
||||
|
||||
/mob/living/silicon/robot/proc/sync()
|
||||
if(lawupdate && connected_ai)
|
||||
lawsync()
|
||||
@@ -1277,16 +1281,6 @@ var/list/robot_verbs_default = list(
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/syndicate/canUseTopic(atom/movable/M)
|
||||
if(stat || lockcharge || stunned || weakened)
|
||||
return
|
||||
if(z in config.admin_levels)
|
||||
return 1
|
||||
if(istype(M, /obj/machinery))
|
||||
var/obj/machinery/Machine = M
|
||||
return Machine.emagged
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/proc/notify_ai(var/notifytype, var/oldname, var/newname)
|
||||
if(!connected_ai)
|
||||
return
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
..()
|
||||
add_language("Galactic Common")
|
||||
|
||||
/mob/living/silicon/proc/SetName(pickedName as text)
|
||||
real_name = pickedName
|
||||
name = real_name
|
||||
|
||||
/mob/living/silicon/proc/show_laws()
|
||||
return
|
||||
|
||||
|
||||
@@ -6,11 +6,6 @@ nanoui class (or whatever Byond calls classes)
|
||||
nanoui is used to open and update nano browser uis
|
||||
**********************************************************/
|
||||
|
||||
|
||||
#define STATUS_INTERACTIVE 2 // GREEN Visability
|
||||
#define STATUS_UPDATE 1 // ORANGE Visability
|
||||
#define STATUS_DISABLED 0 // RED Visability
|
||||
|
||||
/datum/nanoui
|
||||
// the user who opened this ui
|
||||
var/mob/user
|
||||
@@ -59,9 +54,6 @@ nanoui is used to open and update nano browser uis
|
||||
|
||||
var/cached_data = null
|
||||
|
||||
// Only allow users with a certain user.stat to get updates. Defaults to 0 (concious)
|
||||
var/allowed_user_stat = 0 // -1 = ignore, 0 = alive, 1 = unconcious or alive, 2 = dead concious or alive
|
||||
|
||||
/**
|
||||
* Create a new nanoui instance.
|
||||
*
|
||||
@@ -140,37 +132,110 @@ nanoui is used to open and update nano browser uis
|
||||
* @return nothing
|
||||
*/
|
||||
/datum/nanoui/proc/update_status(var/push_update = 0)
|
||||
if (istype(user, /mob/dead/observer))
|
||||
/* Ghosts see updates but can't interact */
|
||||
set_status(STATUS_UPDATE, push_update)
|
||||
else if (istype(user, /mob/living/silicon/ai) || (get_dist(get_turf(user),get_turf(src_object)) <= 1))
|
||||
set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility)
|
||||
else if (istype(user, /mob/living/silicon/robot))
|
||||
if (src_object in view(7, user)) // robots can see and interact with things they can see within 7 tiles
|
||||
set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility)
|
||||
else
|
||||
set_status(STATUS_DISABLED, push_update) // no updates, completely disabled (red visibility)
|
||||
var/status = user.can_interact_with_interface(src_object)
|
||||
if(status == STATUS_CLOSE)
|
||||
close()
|
||||
else
|
||||
var/dist = get_dist(src_object, user)
|
||||
set_status(status, push_update)
|
||||
|
||||
if (dist > 4)
|
||||
close()
|
||||
return
|
||||
/*
|
||||
Procs called by update_status()
|
||||
*/
|
||||
|
||||
if ((allowed_user_stat > -1) && (user.stat > allowed_user_stat))
|
||||
set_status(STATUS_DISABLED, push_update) // no updates, completely disabled (red visibility)
|
||||
else if (user.restrained() || user.lying)
|
||||
set_status(STATUS_UPDATE, push_update) // update only (orange visibility)
|
||||
else if (istype(src_object, /obj/item/device/uplink/hidden)) // You know what if they have the uplink open let them use the UI
|
||||
set_status(STATUS_INTERACTIVE, push_update) // Will build in distance checks on the topics for sanity.
|
||||
else if (!(src_object in view(4, user))) // If the src object is not in visable, set status to 0
|
||||
set_status(STATUS_DISABLED, push_update) // interactive (green visibility)
|
||||
else if (dist <= 1)
|
||||
set_status(STATUS_INTERACTIVE, push_update) // interactive (green visibility)
|
||||
else if (dist <= 2)
|
||||
set_status(STATUS_UPDATE, push_update) // update only (orange visibility)
|
||||
else if (dist <= 4)
|
||||
set_status(STATUS_DISABLED, push_update) // no updates, completely disabled (red visibility)
|
||||
/mob/proc/can_interact_with_interface(var/src_object)
|
||||
return STATUS_CLOSE // By default no mob can do anything with NanoUI
|
||||
|
||||
/mob/dead/observer/can_interact_with_interface()
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
return STATUS_INTERACTIVE // Admins are more equal
|
||||
return STATUS_UPDATE // Ghosts can view updates
|
||||
|
||||
/mob/living/silicon/robot/can_interact_with_interface(var/src_object)
|
||||
if(stat || !client)
|
||||
return STATUS_CLOSE
|
||||
if(lockcharge || stunned || weakened)
|
||||
return STATUS_DISABLED
|
||||
if (src_object in view(client.view, src)) // robots can see and interact with things they can see within their view range
|
||||
return STATUS_INTERACTIVE // interactive (green visibility)
|
||||
return STATUS_DISABLED // no updates, completely disabled (red visibility)
|
||||
|
||||
/mob/living/silicon/robot/syndicate/can_interact_with_interface(var/src_object)
|
||||
. = ..()
|
||||
if(. != STATUS_INTERACTIVE)
|
||||
return
|
||||
|
||||
if(z in config.admin_levels) // Syndicate borgs can interact with everything on the admin level
|
||||
return STATUS_INTERACTIVE
|
||||
if(istype(get_area(src), /area/syndicate_station)) // If elsewhere, they can interact with everything on the syndicate shuttle
|
||||
return STATUS_INTERACTIVE
|
||||
if(istype(src_object, /obj/machinery)) // Otherwise they can only interact with emagged machinery
|
||||
var/obj/machinery/Machine = src_object
|
||||
if(Machine.emagged)
|
||||
return STATUS_INTERACTIVE
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/silicon/ai/can_interact_with_interface(var/src_object)
|
||||
if(stat || !client)
|
||||
return STATUS_CLOSE
|
||||
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
|
||||
// unless it's on the same level as the object it's interacting with.
|
||||
var/turf/T = get_turf(src_object)
|
||||
if(!T || !(z == T.z || (T.z in config.player_levels)))
|
||||
return STATUS_CLOSE
|
||||
|
||||
// If an object is in view then we can interact with it
|
||||
if(src_object in view(client.view, src))
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
// If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view
|
||||
if(is_in_chassis())
|
||||
//stop AIs from leaving windows open and using then after they lose vision
|
||||
//apc_override is needed here because AIs use their own APC when powerless
|
||||
if(cameranet && !cameranet.checkTurfVis(get_turf(src_object)))
|
||||
return apc_override ? STATUS_INTERACTIVE : STATUS_CLOSE
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/proc/shared_living_nano_interaction(var/src_object)
|
||||
if (src.stat != CONSCIOUS)
|
||||
return STATUS_CLOSE // no updates, close the interface
|
||||
else if (restrained() || lying || stat || stunned || weakened)
|
||||
return STATUS_UPDATE // update only (orange visibility)
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
/mob/living/proc/shared_living_nano_distance(var/atom/movable/src_object)
|
||||
if(!isturf(src_object.loc))
|
||||
if(src_object.loc == src) // Item in the inventory
|
||||
return STATUS_INTERACTIVE
|
||||
if(src.contents.Find(src_object.loc)) // A hidden uplink inside an item
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
if (!(src_object in view(4, src))) // If the src object is not in visable, disable updates
|
||||
return STATUS_CLOSE
|
||||
|
||||
var/dist = get_dist(src_object, src)
|
||||
if (dist <= 1)
|
||||
return STATUS_INTERACTIVE // interactive (green visibility)
|
||||
else if (dist <= 2)
|
||||
return STATUS_UPDATE // update only (orange visibility)
|
||||
else if (dist <= 4)
|
||||
return STATUS_DISABLED // no updates, completely disabled (red visibility)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/can_interact_with_interface(var/src_object, var/be_close = 1)
|
||||
. = shared_living_nano_interaction(src_object)
|
||||
if(. == STATUS_INTERACTIVE && be_close)
|
||||
. = shared_living_nano_distance(src_object)
|
||||
if(STATUS_INTERACTIVE)
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/carbon/human/can_interact_with_interface(var/src_object, var/be_close = 1)
|
||||
. = shared_living_nano_interaction(src_object)
|
||||
if(. == STATUS_INTERACTIVE && be_close)
|
||||
. = shared_living_nano_distance(src_object)
|
||||
if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction.
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
/**
|
||||
* Set the ui to auto update (every master_controller tick)
|
||||
|
||||
@@ -31,7 +31,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
|
||||
for(var/datum/reagent/blood/B in vessel.reagent_list)
|
||||
if(B.id == "blood")
|
||||
B.data = list( "donor"=src,"viruses"=null,"species"=species.name,"blood_DNA"=dna.unique_enzymes,"blood_colour"= species.blood_color,"blood_type"=dna.b_type, \
|
||||
"resistances"=null,"trace_chem"=null, "virus2" = null, "antibodies" = null)
|
||||
"resistances"=null,"trace_chem"=null, "virus2" = null, "antibodies" = list())
|
||||
B.color = B.data["blood_colour"]
|
||||
|
||||
// Takes care blood loss and regeneration
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#define CHEM_DISPENSER_ENERGY_COST 0.1 //How many energy points do we use per unit of chemical?
|
||||
|
||||
#define BOTTLE_SPRITES list("bottle-1", "bottle-2", "bottle-3", "bottle-4") //list of available bottle sprites
|
||||
|
||||
/obj/machinery/chem_dispenser
|
||||
name = "chem dispenser"
|
||||
density = 1
|
||||
@@ -262,7 +264,7 @@
|
||||
var/condi = 0
|
||||
var/useramount = 30 // Last used amount
|
||||
var/pillamount = 10
|
||||
var/bottlesprite = "1" //yes, strings
|
||||
var/bottlesprite = "bottle-1" //yes, strings
|
||||
var/pillsprite = "1"
|
||||
var/client/has_sprites = list()
|
||||
var/max_pill_count = 20
|
||||
@@ -442,7 +444,7 @@
|
||||
P.name = "[name] bottle"
|
||||
P.pixel_x = rand(-7, 7) //random position
|
||||
P.pixel_y = rand(-7, 7)
|
||||
P.icon_state = "bottle-"+bottlesprite
|
||||
P.icon_state = bottlesprite
|
||||
reagents.trans_to(P,60)
|
||||
P.update_icon()
|
||||
else
|
||||
@@ -457,10 +459,9 @@
|
||||
usr << browse(dat, "window=chem_master")
|
||||
return
|
||||
else if(href_list["change_bottle"])
|
||||
#define MAX_BOTTLE_SPRITE 4 //max icon state of the bottle sprites
|
||||
var/dat = "<table>"
|
||||
for(var/i = 1 to MAX_BOTTLE_SPRITE)
|
||||
dat += "<tr><td><a href=\"?src=\ref[src]&bottle_sprite=[i]\"><img src=\"bottle-[i].png\" /></a></td></tr>"
|
||||
for(var/sprite in BOTTLE_SPRITES)
|
||||
dat += "<tr><td><a href=\"?src=\ref[src]&bottle_sprite=[sprite]\"><img src=\"[sprite].png\" /></a></td></tr>"
|
||||
dat += "</table>"
|
||||
usr << browse(dat, "window=chem_master")
|
||||
return
|
||||
@@ -484,8 +485,8 @@
|
||||
has_sprites += user.client
|
||||
for(var/i = 1 to MAX_PILL_SPRITE)
|
||||
usr << browse_rsc(icon('icons/obj/chemical.dmi', "pill" + num2text(i)), "pill[i].png")
|
||||
for(var/i = 1 to MAX_BOTTLE_SPRITE)
|
||||
usr << browse_rsc(icon('icons/obj/chemical.dmi', "bottle-" + num2text(i)), "bottle-[i].png")
|
||||
for(var/sprite in BOTTLE_SPRITES)
|
||||
usr << browse_rsc(icon('icons/obj/chemical.dmi', sprite), "[sprite].png")
|
||||
var/dat = ""
|
||||
if(!beaker)
|
||||
dat = "Please insert beaker.<BR>"
|
||||
@@ -529,7 +530,7 @@
|
||||
if(!condi)
|
||||
dat += "<HR><BR><A href='?src=\ref[src];createpill=1'>Create pill (60 units max)</A><a href=\"?src=\ref[src]&change_pill=1\"><img src=\"pill[pillsprite].png\" /></a><BR>"
|
||||
dat += "<A href='?src=\ref[src];createpill_multiple=1'>Create multiple pills</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];createbottle=1'>Create bottle (60 units max)<a href=\"?src=\ref[src]&change_bottle=1\"><img src=\"bottle-[bottlesprite].png\" /></A>"
|
||||
dat += "<A href='?src=\ref[src];createbottle=1'>Create bottle (60 units max)<a href=\"?src=\ref[src]&change_bottle=1\"><img src=\"[bottlesprite].png\" /></A>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];createbottle=1'>Create bottle (50 units max)</A>"
|
||||
if(!condi)
|
||||
@@ -635,7 +636,7 @@
|
||||
else if (href_list["create_virus_culture"])
|
||||
if(!wait)
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
B.icon_state = "bottle3"
|
||||
B.icon_state = "bottle-1"
|
||||
var/type = text2path(href_list["create_virus_culture"])//the path is received as string - converting
|
||||
var/datum/disease/D = null
|
||||
if(!type)
|
||||
@@ -651,6 +652,7 @@
|
||||
B.name = "[name] culture bottle"
|
||||
B.desc = "A small bottle. Contains [D.agent] culture in synthblood medium."
|
||||
B.reagents.add_reagent("blood",20,data)
|
||||
B.update_icon()
|
||||
src.updateUsrDialog()
|
||||
wait = 1
|
||||
spawn(1000)
|
||||
|
||||
@@ -98,7 +98,7 @@ datum
|
||||
|
||||
|
||||
blood
|
||||
data = new/list("donor"=null,"viruses"=null,"species"="Human","blood_DNA"=null,"blood_type"=null,"blood_colour"= "#A10808","resistances"=null,"trace_chem"=null, "antibodies" = null)
|
||||
data = new/list("donor"=null,"viruses"=null,"species"="Human","blood_DNA"=null,"blood_type"=null,"blood_colour"= "#A10808","resistances"=null,"trace_chem"=null, "antibodies" = list())
|
||||
name = "Blood"
|
||||
id = "blood"
|
||||
reagent_state = LIQUID
|
||||
@@ -665,15 +665,13 @@ datum
|
||||
for (var/ID in C.virus2)
|
||||
var/datum/disease2/disease/V = C.virus2[ID]
|
||||
if(prob(5))
|
||||
M:antibodies |= V.antigen
|
||||
C.antibodies |= V.antigen
|
||||
if(prob(50))
|
||||
M.radiation += 50 // curing it that way may kill you instead
|
||||
var/absorbed
|
||||
if(istype(C,/mob/living/carbon))
|
||||
var/mob/living/carbon/H = C
|
||||
var/datum/organ/internal/diona/nutrients/rad_organ = locate() in H.internal_organs
|
||||
if(rad_organ && !rad_organ.is_broken())
|
||||
absorbed = 1
|
||||
var/datum/organ/internal/diona/nutrients/rad_organ = locate() in C.internal_organs
|
||||
if(rad_organ && !rad_organ.is_broken())
|
||||
absorbed = 1
|
||||
if(!absorbed)
|
||||
M.adjustToxLoss(100)
|
||||
..()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
item_state = "atoxinbottle"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60)
|
||||
flags = OPENCONTAINER
|
||||
flags = 0
|
||||
volume = 60
|
||||
|
||||
on_reagent_change()
|
||||
@@ -30,7 +30,7 @@
|
||||
New()
|
||||
..()
|
||||
if(!icon_state)
|
||||
icon_state = "bottle-[rand(1.4)]"
|
||||
icon_state = "bottle-[rand(1,4)]"
|
||||
|
||||
update_icon()
|
||||
overlays.Cut()
|
||||
@@ -59,186 +59,203 @@
|
||||
name = "inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
icon_state = "bottle-4"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("inaprovaline", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/toxin
|
||||
name = "toxin bottle"
|
||||
desc = "A small bottle of toxins. Do not drink, it is poisonous."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle12"
|
||||
icon_state = "bottle-3"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("toxin", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/cyanide
|
||||
name = "cyanide bottle"
|
||||
desc = "A small bottle of cyanide. Bitter almonds?"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle12"
|
||||
icon_state = "bottle-3"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("cyanide", 60)
|
||||
reagents.add_reagent("cyanide", 30) //volume changed to match chloral
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/stoxin
|
||||
name = "soporific bottle"
|
||||
desc = "A small bottle of soporific. Just the fumes make you sleepy."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle20"
|
||||
icon_state = "bottle-3"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("stoxin", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/chloralhydrate
|
||||
name = "Chloral Hydrate Bottle"
|
||||
desc = "A small bottle of Choral Hydrate. Mickey's Favorite!"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle20"
|
||||
icon_state = "bottle-3"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("chloralhydrate", 30) //Intentionally low since it is so strong. Still enough to knock someone out.
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/antitoxin
|
||||
name = "dylovene bottle"
|
||||
desc = "A small bottle of dylovene. Counters poisons, and repairs damage. A wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
icon_state = "bottle-4"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("anti_toxin", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/mutagen
|
||||
name = "unstable mutagen bottle"
|
||||
desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle20"
|
||||
icon_state = "bottle-1"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("mutagen", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/ammonia
|
||||
name = "ammonia bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle20"
|
||||
icon_state = "bottle-1"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("ammonia", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/diethylamine
|
||||
name = "diethylamine bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
icon_state = "bottle-4"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("diethylamine", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/flu_virion
|
||||
name = "Flu virion culture bottle"
|
||||
desc = "A small bottle. Contains H13N1 flu virion culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/advance/flu(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/epiglottis_virion
|
||||
name = "Epiglottis virion culture bottle"
|
||||
desc = "A small bottle. Contains Epiglottis virion culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/advance/voice_change(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/liver_enhance_virion
|
||||
name = "Liver enhancement virion culture bottle"
|
||||
desc = "A small bottle. Contains liver enhancement virion culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/advance/heal(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/hullucigen_virion
|
||||
name = "Hullucigen virion culture bottle"
|
||||
desc = "A small bottle. Contains hullucigen virion culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/advance/hullucigen(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pierrot_throat
|
||||
name = "Pierrot's Throat culture bottle"
|
||||
desc = "A small bottle. Contains H0NI<42 virion culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/pierrot_throat(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/cold
|
||||
name = "Rhinovirus culture bottle"
|
||||
desc = "A small bottle. Contains XY-rhinovirus culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/advance/F = new /datum/disease/advance/cold(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/random
|
||||
name = "Random culture bottle"
|
||||
desc = "A small bottle. Contains a random disease."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/advance/F = new(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/retrovirus
|
||||
name = "Retrovirus culture bottle"
|
||||
desc = "A small bottle. Contains a retrovirus culture in a synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/dna_retrovirus(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/gbs
|
||||
name = "GBS culture bottle"
|
||||
desc = "A small bottle. Contains Gravitokinetic Bipotential SADS+ culture in synthblood medium."//Or simply - General BullShit
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
amount_per_transfer_from_this = 5
|
||||
|
||||
New()
|
||||
@@ -248,23 +265,25 @@
|
||||
var/datum/disease/F = new /datum/disease/gbs
|
||||
var/list/data = list("virus"= F)
|
||||
R.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/fake_gbs
|
||||
name = "GBS culture bottle"
|
||||
desc = "A small bottle. Contains Gravitokinetic Bipotential SADS- culture in synthblood medium."//Or simply - General BullShit
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/fake_gbs(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/rhumba_beat
|
||||
name = "Rhumba Beat culture bottle"
|
||||
desc = "A small bottle. Contains The Rhumba Beat culture in synthblood medium."//Or simply - General BullShit
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
amount_per_transfer_from_this = 5
|
||||
|
||||
New()
|
||||
@@ -280,44 +299,48 @@
|
||||
name = "Brainrot culture bottle"
|
||||
desc = "A small bottle. Contains Cryptococcus Cosmosis culture in synthblood medium."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/brainrot(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/magnitis
|
||||
name = "Magnitis culture bottle"
|
||||
desc = "A small bottle. Contains a small dosage of Fukkos Miracos."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/magnitis(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/wizarditis
|
||||
name = "Wizarditis culture bottle"
|
||||
desc = "A small bottle. Contains a sample of Rincewindus Vulgaris."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
var/datum/disease/F = new /datum/disease/wizarditis(0)
|
||||
var/list/data = list("viruses"= list(F))
|
||||
reagents.add_reagent("blood", 20, data)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pacid
|
||||
name = "Polytrinic Acid Bottle"
|
||||
desc = "A small bottle. Contains a small amount of Polytrinic Acid"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("pacid", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/adminordrazine
|
||||
name = "Adminordrazine Bottle"
|
||||
@@ -327,21 +350,24 @@
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("adminordrazine", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/capsaicin
|
||||
name = "Capsaicin Bottle"
|
||||
desc = "A small bottle. Contains hot sauce."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle3"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("capsaicin", 60)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/frostoil
|
||||
name = "Frost Oil Bottle"
|
||||
desc = "A small bottle. Contains cold sauce."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
icon_state = "bottle-4"
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("frostoil", 60)
|
||||
reagents.add_reagent("frostoil", 60)
|
||||
update_icon()
|
||||
|
||||
@@ -11,23 +11,24 @@
|
||||
name = "internal inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
icon_state = "bottle-4"
|
||||
reagent = "inaprovaline"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("inaprovaline", 60)
|
||||
return
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin
|
||||
name = "internal anti-toxin bottle"
|
||||
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
icon_state = "bottle-4"
|
||||
reagent = "anti_toxin"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("anti_toxin", 60)
|
||||
return
|
||||
update_icon()
|
||||
|
||||
|
||||
200
code/modules/virus2/admin.dm
Normal file
200
code/modules/virus2/admin.dm
Normal file
@@ -0,0 +1,200 @@
|
||||
/datum/disease2/disease/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(.) return
|
||||
|
||||
if(href_list["info"])
|
||||
// spawn or admin privileges to see info about viruses
|
||||
if(!check_rights(R_ADMIN|R_SPAWN)) return
|
||||
|
||||
usr << "Infection chance: [infectionchance]; Speed: [speed]; Spread type: [spreadtype]"
|
||||
usr << "Affected species: [english_list(affected_species)]"
|
||||
usr << "Effects:"
|
||||
for(var/datum/disease2/effectholder/E in effects)
|
||||
usr << "[E.stage]: [E.effect.name]; chance=[E.chance]; multiplier=[E.multiplier]"
|
||||
usr << "Antigens: [antigens2string(antigen)]"
|
||||
|
||||
return 1
|
||||
|
||||
/datum/admins/var/datum/virus2_editor/virus2_editor_datum = new
|
||||
/client/proc/virus2_editor()
|
||||
set name = "Virus Editor"
|
||||
set category = "Admin"
|
||||
if(!holder || !check_rights(R_SPAWN)) return // spawn privileges to create viruses
|
||||
|
||||
holder.virus2_editor_datum.show_ui(src)
|
||||
|
||||
/datum/virus2_editor
|
||||
var/list/s = list(/datum/disease2/effect/invisible,/datum/disease2/effect/invisible,/datum/disease2/effect/invisible,/datum/disease2/effect/invisible)
|
||||
var/list/s_chance = list(1,1,1,1)
|
||||
var/list/s_multiplier = list(1,1,1,1)
|
||||
var/species = list()
|
||||
var/infectionchance = 70
|
||||
var/spreadtype = "Contact"
|
||||
var/list/antigens = list()
|
||||
var/speed = 1
|
||||
var/mob/living/carbon/infectee = null
|
||||
|
||||
// this holds spawned viruses so that the "Info" links work after the proc exits
|
||||
var/list/spawned_viruses = list()
|
||||
|
||||
proc/select(mob/user, stage)
|
||||
if(stage < 1 || stage > 4) return
|
||||
|
||||
var/list/L = list()
|
||||
|
||||
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
|
||||
var/datum/disease2/effect/f = e
|
||||
if(initial(f.stage) <= stage)
|
||||
L[initial(f.name)] = e
|
||||
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
|
||||
var/C = input("Select effect for stage [stage]:", "Stage [stage]", initial(Eff.name)) as null|anything in L
|
||||
if(!C) return
|
||||
return L[C]
|
||||
|
||||
proc/show_ui(mob/user)
|
||||
var/H = {"
|
||||
<center><h3>Virus2 Virus Editor</h3></center><br />
|
||||
<b>Effects:</b><br />
|
||||
"}
|
||||
for(var/i = 1 to 4)
|
||||
var/datum/disease2/effect/Eff = s[i]
|
||||
H += {"
|
||||
<a href='?src=\ref[src];what=effect;stage=[i];effect=1'>[initial(Eff.name)]</a>
|
||||
Chance: <a href='?src=\ref[src];what=effect;stage=[i];chance=1'>[s_chance[i]]</a>
|
||||
Multiplier: <a href='?src=\ref[src];what=effect;stage=[i];multiplier=1'>[s_multiplier[i]]</a>
|
||||
<br />
|
||||
"}
|
||||
H += {"
|
||||
<br />
|
||||
<b>Infectable Species:</b><br />
|
||||
"}
|
||||
var/f = 1
|
||||
for(var/k in all_species)
|
||||
var/datum/species/S = all_species[k]
|
||||
if(!(S.flags & IS_SYNTHETIC))
|
||||
if(!f) H += " | "
|
||||
else f = 0
|
||||
H += "<a href='?src=\ref[src];what=species;toggle=[k]' style='color:[(k in species) ? "#006600" : "#ff0000"]'>[k]</a>"
|
||||
H += {"
|
||||
<a href="?src=\ref[src];what=species;reset=1" style="color:#0000aa">Reset</a>
|
||||
<br />
|
||||
<b>Infection Chance:</b> <a href="?src=\ref[src];what=ichance">[infectionchance]</a><br />
|
||||
<b>Spread Type:</b> <a href="?src=\ref[src];what=stype">[spreadtype]</a><br />
|
||||
<b>Speed:</b> <a href="?src=\ref[src];what=speed">[speed]</a><br />
|
||||
<br />
|
||||
"}
|
||||
f = 1
|
||||
for(var/k in ALL_ANTIGENS)
|
||||
if(!f) H += " | "
|
||||
else f = 0
|
||||
H += "<a href='?src=\ref[src];what=antigen;toggle=[k]' style='color:[(k in antigens) ? "#006600" : "#ff0000"]'>[k]</a>"
|
||||
H += {"
|
||||
<a href="?src=\ref[src];what=antigen;reset=1" style="color:#0000aa">Reset</a>
|
||||
<br />
|
||||
<hr />
|
||||
<b>Initial infectee:</b> <a href="?src=\ref[src];what=infectee">[infectee ? infectee : "(choose)"]</a>
|
||||
<a href="?src=\ref[src];what=go" style="color:#ff0000">RELEASE</a>
|
||||
"}
|
||||
|
||||
user << browse(H, "window=virus2edit")
|
||||
|
||||
Topic(href, href_list)
|
||||
switch(href_list["what"])
|
||||
if("effect")
|
||||
var/stage = text2num(href_list["stage"])
|
||||
if(href_list["effect"])
|
||||
var/datum/disease2/effect/E = select(usr,stage)
|
||||
if(!E) return
|
||||
s[stage] = E
|
||||
// set a default chance and multiplier of half the maximum (roughly average)
|
||||
s_chance[stage] = max(1, round(initial(E.chance_maxm)/2))
|
||||
s_multiplier[stage] = max(1, round(initial(E.maxm)/2))
|
||||
else if(href_list["chance"])
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
var/I = input("Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage]) as null|num
|
||||
if(I == null || I < 0 || I > initial(Eff.chance_maxm)) return
|
||||
s_chance[stage] = I
|
||||
else if(href_list["multiplier"])
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
var/I = input("Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage]) as null|num
|
||||
if(I == null || I < 1 || I > initial(Eff.maxm)) return
|
||||
s_multiplier[stage] = I
|
||||
if("species")
|
||||
if(href_list["toggle"])
|
||||
var/T = href_list["toggle"]
|
||||
if(T in species)
|
||||
species -= T
|
||||
else
|
||||
species |= T
|
||||
else if(href_list["reset"])
|
||||
species = list()
|
||||
if(infectee)
|
||||
if(!infectee.species || !(infectee.species.name in species))
|
||||
infectee = null
|
||||
if("ichance")
|
||||
var/I = input("Input infection chance", "Infection Chance", infectionchance) as null|num
|
||||
if(!I) return
|
||||
infectionchance = I
|
||||
if("stype")
|
||||
var/S = alert("Which spread type?", "Spread Type", "Cancel", "Contact", "Airborne")
|
||||
if(!S || S == "Cancel") return
|
||||
spreadtype = S
|
||||
if("speed")
|
||||
var/S = input("Input speed", "Speed", speed) as null|num
|
||||
if(!S) return
|
||||
speed = S
|
||||
if("antigen")
|
||||
if(href_list["toggle"])
|
||||
var/T = href_list["toggle"]
|
||||
if(length(T) != 1) return
|
||||
if(T in antigens)
|
||||
antigens -= T
|
||||
else
|
||||
antigens |= T
|
||||
else if(href_list["reset"])
|
||||
antigens = list()
|
||||
if("infectee")
|
||||
var/list/candidates = list()
|
||||
for(var/mob/living/carbon/G in living_mob_list)
|
||||
if(G.stat != DEAD && G.species)
|
||||
if(G.species.name in species)
|
||||
candidates["[G.name][G.client ? "" : " (no client)"]"] = G
|
||||
else
|
||||
candidates["[G.name] ([G.species.name])[G.client ? "" : " (no client)"]"] = G
|
||||
if(!candidates.len) usr << "No possible candidates found!"
|
||||
|
||||
var/I = input("Choose initial infectee", "Infectee", infectee) as null|anything in candidates
|
||||
if(!I || !candidates[I]) return
|
||||
infectee = candidates[I]
|
||||
species |= infectee.species.name
|
||||
if("go")
|
||||
if(!antigens.len)
|
||||
var/a = alert("This disease has no antigens; it will be impossible to permanently immunise anyone without them.\
|
||||
It is strongly recommended to set at least one antigen. Do you want to go back and edit your virus?", "Antigens", "Yes", "Yes", "No")
|
||||
if(a == "Yes") return
|
||||
var/datum/disease2/disease/D = new
|
||||
D.infectionchance = infectionchance
|
||||
D.spreadtype = spreadtype
|
||||
D.antigen = antigens
|
||||
D.affected_species = species
|
||||
D.speed = speed
|
||||
for(var/i in 1 to 4)
|
||||
var/datum/disease2/effectholder/E = new
|
||||
var/Etype = s[i]
|
||||
E.effect = new Etype()
|
||||
E.effect.generate()
|
||||
E.chance = s_chance[i]
|
||||
E.multiplier = s_multiplier[i]
|
||||
E.stage = i
|
||||
|
||||
D.effects += E
|
||||
|
||||
spawned_viruses += D
|
||||
|
||||
message_admins("<span class='danger'>[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus (<a href='?src=\ref[D];info=1'>Info</a>)</span>")
|
||||
log_admin("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus!")
|
||||
infect_virus2(infectee, D, forced=1)
|
||||
|
||||
show_ui(usr)
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/disease2/diseaseanalyser
|
||||
name = "Disease Analyser"
|
||||
name = "disease analyser"
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
@@ -43,7 +43,9 @@
|
||||
<hr>
|
||||
<u>Additional Notes:</u>
|
||||
"}
|
||||
dish.basic_info = dish.virus2.get_basic_info()
|
||||
dish.info = r
|
||||
dish.name = "[initial(dish.name)] ([dish.virus2.name()])"
|
||||
dish.analysed = 1
|
||||
dish.loc = src.loc
|
||||
dish = null
|
||||
|
||||
@@ -1,37 +1,55 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
/*
|
||||
// reserving some numbers for later special antigens
|
||||
var/global/const/ANTIGEN_A = 1
|
||||
var/global/const/ANTIGEN_B = 2
|
||||
var/global/const/ANTIGEN_RH = 4
|
||||
var/global/const/ANTIGEN_Q = 8
|
||||
var/global/const/ANTIGEN_U = 16
|
||||
var/global/const/ANTIGEN_V = 32
|
||||
var/global/const/ANTIGEN_X = 64
|
||||
var/global/const/ANTIGEN_Y = 128
|
||||
var/global/const/ANTIGEN_Z = 256
|
||||
var/global/const/ANTIGEN_M = 512
|
||||
var/global/const/ANTIGEN_N = 1024
|
||||
var/global/const/ANTIGEN_P = 2048
|
||||
var/global/const/ANTIGEN_O = 4096
|
||||
var/global/const/ANTIGEN_C = 4
|
||||
var/global/const/ANTIGEN_D = 8
|
||||
var/global/const/ANTIGEN_E = 16
|
||||
var/global/const/ANTIGEN_M = 32
|
||||
var/global/const/ANTIGEN_N = 64
|
||||
var/global/const/ANTIGEN_O = 128
|
||||
var/global/const/ANTIGEN_P = 256
|
||||
var/global/const/ANTIGEN_Q = 512
|
||||
var/global/const/ANTIGEN_U = 1024
|
||||
var/global/const/ANTIGEN_V = 2048
|
||||
var/global/const/ANTIGEN_W = 4096
|
||||
var/global/const/ANTIGEN_X = 8192
|
||||
var/global/const/ANTIGEN_Y = 16384
|
||||
var/global/const/ANTIGEN_Z = 32768
|
||||
|
||||
var/global/list/ANTIGENS = list(
|
||||
"[ANTIGEN_A]" = "A",
|
||||
"[ANTIGEN_B]" = "B",
|
||||
"[ANTIGEN_RH]" = "RH",
|
||||
"[ANTIGEN_C]" = "C",
|
||||
"[ANTIGEN_E]" = "E",
|
||||
"[ANTIGEN_D]" = "D",
|
||||
"[ANTIGEN_M]" = "M",
|
||||
"[ANTIGEN_N]" = "N",
|
||||
"[ANTIGEN_O]" = "O",
|
||||
"[ANTIGEN_P]" = "P",
|
||||
"[ANTIGEN_Q]" = "Q",
|
||||
"[ANTIGEN_U]" = "U",
|
||||
"[ANTIGEN_V]" = "V",
|
||||
"[ANTIGEN_Z]" = "Z",
|
||||
"[ANTIGEN_M]" = "M",
|
||||
"[ANTIGEN_N]" = "N",
|
||||
"[ANTIGEN_P]" = "P",
|
||||
"[ANTIGEN_O]" = "O"
|
||||
"[ANTIGEN_W]" = "W",
|
||||
"[ANTIGEN_X]" = "X",
|
||||
"[ANTIGEN_Y]" = "Y",
|
||||
"[ANTIGEN_Z]" = "Z"
|
||||
)
|
||||
*/
|
||||
|
||||
var/global/list/ALL_ANTIGENS = list(
|
||||
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
|
||||
)
|
||||
|
||||
/hook/startup/proc/randomise_antigens_order()
|
||||
ALL_ANTIGENS = shuffle(ALL_ANTIGENS)
|
||||
return 1
|
||||
|
||||
// pure concentrated antibodies
|
||||
datum/reagent/antibodies
|
||||
data = list("antibodies"=0)
|
||||
data = list("antibodies"=list())
|
||||
name = "Antibodies"
|
||||
id = "antibodies"
|
||||
reagent_state = LIQUID
|
||||
@@ -39,14 +57,26 @@ datum/reagent/antibodies
|
||||
|
||||
reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
|
||||
if(istype(M,/mob/living/carbon))
|
||||
var/mob/living/carbon/C = M
|
||||
if(src.data && method == INGEST)
|
||||
if(M:virus2) if(src.data["antibodies"] & M:virus2.antigen)
|
||||
M:virus2.dead = 1
|
||||
M:antibodies |= src.data["antibodies"]
|
||||
//if(C.virus2) if(src.data["antibodies"] & C.virus2.antigen)
|
||||
// C.virus2.dead = 1
|
||||
C.antibodies |= src.data["antibodies"]
|
||||
return
|
||||
|
||||
// iterate over the list of antigens and see what matches
|
||||
/proc/antigens2string(var/antigens)
|
||||
/proc/antigens2string(list/antigens, none="None")
|
||||
if(!istype(antigens))
|
||||
CRASH("Illegal type!")
|
||||
if(!antigens.len)
|
||||
return none
|
||||
|
||||
var/code = ""
|
||||
for(var/V in ANTIGENS) if(text2num(V) & antigens) code += ANTIGENS[V]
|
||||
return code
|
||||
for(var/V in ALL_ANTIGENS)
|
||||
if(V in antigens)
|
||||
code += V
|
||||
|
||||
if(!code)
|
||||
return none
|
||||
|
||||
return code
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/computer/centrifuge
|
||||
name = "Isolation Centrifuge"
|
||||
name = "isolation centrifuge"
|
||||
desc = "Used to separate things with different weight. Spin 'em round, round, right round."
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "centrifuge"
|
||||
@@ -54,7 +54,7 @@
|
||||
if (sample)
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (B)
|
||||
data["antibodies"] = B.data["antibodies"] ? antigens2string(B.data["antibodies"]) : null
|
||||
data["antibodies"] = antigens2string(B.data["antibodies"], none=null)
|
||||
|
||||
var/list/pathogens[0]
|
||||
var/list/virus = B.data["virus2"]
|
||||
@@ -67,7 +67,8 @@
|
||||
|
||||
else
|
||||
var/datum/reagent/antibodies/A = locate(/datum/reagent/antibodies) in sample.reagents.reagent_list
|
||||
data["antibodies"] = A && A.data["antibodies"] ? antigens2string(A.data["antibodies"]) : null
|
||||
if(A)
|
||||
data["antibodies"] = antigens2string(A.data["antibodies"], none=null)
|
||||
data["is_antibody_sample"] = 1
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
@@ -186,7 +187,7 @@
|
||||
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
|
||||
if (B)
|
||||
P.info += "<u>Antibodies:</u> "
|
||||
P.info += B.data["antibodies"] ? antigens2string(B.data["antibodies"]) : "None"
|
||||
P.info += antigens2string(B.data["antibodies"])
|
||||
P.info += "<br>"
|
||||
|
||||
var/list/virus = B.data["virus2"]
|
||||
@@ -202,7 +203,7 @@
|
||||
var/datum/reagent/antibodies/A = locate(/datum/reagent/antibodies) in sample.reagents.reagent_list
|
||||
if (A)
|
||||
P.info += "The following antibodies have been isolated from the blood sample: "
|
||||
P.info += A.data["antibodies"] ? antigens2string(A.data["antibodies"]) : "None"
|
||||
P.info += antigens2string(A.data["antibodies"])
|
||||
P.info += "<br>"
|
||||
|
||||
P.info += {"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/computer/curer
|
||||
name = "Cure Research Machine"
|
||||
name = "cure research machine"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "dna"
|
||||
circuit = /obj/item/weapon/circuitboard/curefab
|
||||
@@ -22,7 +22,7 @@
|
||||
return
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc)
|
||||
|
||||
var/list/data = list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=null,"resistances"=null,"trace_chem"=null,"virus2"=list(),"antibodies"=0)
|
||||
var/list/data = list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=null,"resistances"=null,"trace_chem"=null,"virus2"=list(),"antibodies"=list())
|
||||
data["virus2"] |= I:virus2
|
||||
product.reagents.add_reagent("blood",30,data)
|
||||
|
||||
@@ -52,9 +52,7 @@
|
||||
|
||||
if(B)
|
||||
dat = "Blood sample inserted."
|
||||
var/code = ""
|
||||
for(var/V in ANTIGENS) if(text2num(V) & B.data["antibodies"]) code += ANTIGENS[V]
|
||||
dat += "<BR>Antibodies: [code]"
|
||||
dat += "<BR>Antibodies: [antigens2string(B.data["antibodies"])]"
|
||||
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
|
||||
else
|
||||
dat += "<BR>Please check container contents."
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
var/clicks = 0
|
||||
var/uniqueID = 0
|
||||
var/list/datum/disease2/effectholder/effects = list()
|
||||
var/antigen = 0 // 16 bits describing the antigens, when one bit is set, a cure with that bit can dock here
|
||||
var/antigen = list() // 16 bits describing the antigens, when one bit is set, a cure with that bit can dock here
|
||||
var/max_stage = 4
|
||||
var/list/affected_species = list("Human","Unathi","Skrell","Tajara")
|
||||
|
||||
@@ -17,10 +17,12 @@
|
||||
..()
|
||||
|
||||
/datum/disease2/disease/proc/makerandom(var/severity=1)
|
||||
var/list/excludetypes = list()
|
||||
for(var/i=1 ; i <= max_stage ; i++ )
|
||||
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
|
||||
holder.stage = i
|
||||
holder.getrandomeffect(severity)
|
||||
holder.getrandomeffect(severity, excludetypes)
|
||||
excludetypes += holder.effect.type
|
||||
effects += holder
|
||||
uniqueID = rand(0,10000)
|
||||
switch(severity)
|
||||
@@ -31,8 +33,8 @@
|
||||
else
|
||||
infectionchance = rand(60,90)
|
||||
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
antigen = list(pick(ALL_ANTIGENS))
|
||||
antigen |= pick(ALL_ANTIGENS)
|
||||
spreadtype = prob(70) ? "Airborne" : "Contact"
|
||||
|
||||
if(all_species.len)
|
||||
@@ -79,13 +81,18 @@
|
||||
mob.reagents.remove_reagent("virusfood",0.1)
|
||||
clicks += 10
|
||||
|
||||
if(prob(1) && prob(stage)) // Increasing chance of curing as the virus progresses
|
||||
src.cure(mob)
|
||||
mob.antibodies |= src.antigen
|
||||
|
||||
//Moving to the next stage
|
||||
if(clicks > max(stage*100, 200) && prob(10))
|
||||
if(stage == max_stage)
|
||||
if((stage <= max_stage) && prob(20)) // ~60% of viruses will be cured by the end of S4 with this
|
||||
src.cure(mob)
|
||||
mob.antibodies |= src.antigen
|
||||
stage++
|
||||
clicks = 0
|
||||
|
||||
//Do nasty effects
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
if(prob(33))
|
||||
@@ -98,7 +105,7 @@
|
||||
infect_virus2(M,src)
|
||||
|
||||
//fever
|
||||
mob.bodytemperature = max(mob.bodytemperature, min(310+5*stage ,mob.bodytemperature+5*stage))
|
||||
mob.bodytemperature = max(mob.bodytemperature, min(310+5*min(stage,max_stage) ,mob.bodytemperature+5*min(stage,max_stage)))
|
||||
clicks+=speed
|
||||
|
||||
/datum/disease2/disease/proc/cure(var/mob/living/carbon/mob)
|
||||
@@ -116,10 +123,14 @@
|
||||
/datum/disease2/disease/proc/majormutate()
|
||||
uniqueID = rand(0,10000)
|
||||
var/datum/disease2/effectholder/holder = pick(effects)
|
||||
holder.majormutate()
|
||||
var/list/exclude = list()
|
||||
for(var/datum/disease2/effectholder/D in effects)
|
||||
if(D != holder)
|
||||
exclude += D.effect.type
|
||||
holder.majormutate(exclude)
|
||||
if (prob(5))
|
||||
antigen = text2num(pick(ANTIGENS))
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
antigen = list(pick(ALL_ANTIGENS))
|
||||
antigen |= pick(ALL_ANTIGENS)
|
||||
if (prob(5) && all_species.len)
|
||||
affected_species = get_infectable_species()
|
||||
|
||||
@@ -134,6 +145,7 @@
|
||||
for(var/datum/disease2/effectholder/holder in effects)
|
||||
var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder
|
||||
newholder.effect = new holder.effect.type
|
||||
newholder.effect.generate(holder.effect.data)
|
||||
newholder.chance = holder.chance
|
||||
newholder.cure = holder.cure
|
||||
newholder.multiplier = holder.multiplier
|
||||
@@ -176,6 +188,12 @@ var/global/list/virusDB = list()
|
||||
var/datum/data/record/V = virusDB["[uniqueID]"]
|
||||
.= V.fields["name"]
|
||||
|
||||
/datum/disease2/disease/proc/get_basic_info()
|
||||
var/t = ""
|
||||
for(var/datum/disease2/effectholder/E in effects)
|
||||
t += ", [E.effect.name]"
|
||||
return "[name()] ([copytext(t,3)])"
|
||||
|
||||
/datum/disease2/disease/proc/get_info()
|
||||
var/r = {"
|
||||
<small>Analysis determined the existence of a GNAv2-based viral lifeform.</small><br>
|
||||
@@ -237,3 +255,10 @@ proc/virology_letterhead(var/report_name)
|
||||
<center><small><i>[station_name()] Virology Lab</i></small></center>
|
||||
<hr>
|
||||
"}
|
||||
|
||||
/datum/disease2/disease/proc/can_add_symptom(type)
|
||||
for(var/datum/disease2/effectholder/H in effects)
|
||||
if(H.effect.type == type)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/computer/diseasesplicer
|
||||
name = "Disease Splicer"
|
||||
name = "disease splicer"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "crew"
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
data["affected_species"] = null
|
||||
|
||||
if (memorybank)
|
||||
data["buffer"] = list("name" = (analysed ? memorybank.effect.name : "Unknown Symptom"), "stage" = memorybank.stage)
|
||||
data["buffer"] = list("name" = (analysed ? memorybank.effect.name : "Unknown Symptom"), "stage" = memorybank.effect.stage)
|
||||
if (species_buffer)
|
||||
data["species_buffer"] = analysed ? list2text(species_buffer, ", ") : "Unknown Species"
|
||||
|
||||
@@ -160,14 +160,26 @@
|
||||
|
||||
if(href_list["splice"])
|
||||
if(dish)
|
||||
if (memorybank)
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == memorybank.stage)
|
||||
e.effect = memorybank.effect
|
||||
var/target = text2num(href_list["splice"]) // target = 1 to 4 for effects, 5 for species
|
||||
if(memorybank && 0 < target && target <= 4)
|
||||
if(target < memorybank.effect.stage) return // too powerful, catching this for href exploit prevention
|
||||
|
||||
if (species_buffer)
|
||||
var/datum/disease2/effectholder/target_holder
|
||||
var/list/illegal_types = list()
|
||||
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
if(e.stage == target)
|
||||
target_holder = e
|
||||
else
|
||||
illegal_types += e.effect.type
|
||||
if(memorybank.effect.type in illegal_types) return
|
||||
target_holder.effect = memorybank.effect
|
||||
|
||||
else if(species_buffer && target == 5)
|
||||
dish.virus2.affected_species = species_buffer
|
||||
|
||||
else
|
||||
return
|
||||
|
||||
splicing = 10
|
||||
dish.virus2.uniqueID = rand(0,10000)
|
||||
return 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/disease2/incubator/
|
||||
name = "Pathogenic incubator"
|
||||
name = "pathogenic incubator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
@@ -108,6 +108,7 @@
|
||||
dish.virus2.majormutate()
|
||||
if(dish.info)
|
||||
dish.info = "OUTDATED : [dish.info]"
|
||||
dish.basic_info = "OUTDATED: [dish.basic_info]"
|
||||
dish.analysed = 0
|
||||
ping("\The [src] pings, \"Mutant viral strain detected.\"")
|
||||
else if(prob(5))
|
||||
|
||||
@@ -13,15 +13,19 @@
|
||||
if(happensonce == 1)
|
||||
happensonce = -1
|
||||
|
||||
/datum/disease2/effectholder/proc/getrandomeffect(var/badness = 1)
|
||||
/datum/disease2/effectholder/proc/getrandomeffect(var/badness = 1, exclude_types=list())
|
||||
var/list/datum/disease2/effect/list = list()
|
||||
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
|
||||
var/datum/disease2/effect/f = new e
|
||||
if (f.badness > badness) //we don't want such strong effects
|
||||
var/datum/disease2/effect/f = e
|
||||
if(e in exclude_types)
|
||||
continue
|
||||
if(f.stage == src.stage)
|
||||
if(initial(f.badness) > badness) //we don't want such strong effects
|
||||
continue
|
||||
if(initial(f.stage) <= src.stage)
|
||||
list += f
|
||||
effect = pick(list)
|
||||
var/type = pick(list)
|
||||
effect = new type()
|
||||
effect.generate()
|
||||
chance = rand(0,effect.chance_maxm)
|
||||
multiplier = rand(1,effect.maxm)
|
||||
|
||||
@@ -32,8 +36,8 @@
|
||||
if(2)
|
||||
multiplier = rand(1,effect.maxm)
|
||||
|
||||
/datum/disease2/effectholder/proc/majormutate()
|
||||
getrandomeffect(3)
|
||||
/datum/disease2/effectholder/proc/majormutate(exclude_types=list())
|
||||
getrandomeffect(3, exclude_types)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
////////////////////////EFFECTS/////////////////////////////////
|
||||
@@ -45,8 +49,11 @@
|
||||
var/stage = 4
|
||||
var/maxm = 1
|
||||
var/badness = 1
|
||||
var/data = null // For semi-procedural effects; this should be generated in generate() if used
|
||||
|
||||
proc/activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
proc/deactivate(var/mob/living/carbon/mob)
|
||||
proc/generate(copy_data) // copy_data will be non-null if this is a copy; it should be used to initialise the data for this effect if present
|
||||
|
||||
/datum/disease2/effect/invisible
|
||||
name = "Waiting Syndrome"
|
||||
@@ -67,7 +74,23 @@
|
||||
stage = 4
|
||||
badness = 3
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.gib()
|
||||
// Probabilities have been tweaked to kill in ~2-3 minutes, giving 5-10 messages.
|
||||
// Probably needs more balancing, but it's better than LOL U GIBBED NOW, especially now that viruses can potentially have no signs up until Gibbingtons.
|
||||
mob.adjustBruteLoss(10*multiplier)
|
||||
if(istype(mob, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mob
|
||||
var/datum/organ/external/O = pick(H.organs)
|
||||
if(prob(25))
|
||||
mob << "<span class='warning'>Your [O.display_name] feels as if it might fall off!</span>"
|
||||
if(prob(10))
|
||||
spawn(50)
|
||||
if(O)
|
||||
O.droplimb(1)
|
||||
else
|
||||
if(prob(75))
|
||||
mob << "<span class='warning'>Your whole body feels like it might fall apart!</span>"
|
||||
if(prob(10))
|
||||
mob.adjustBruteLoss(25*multiplier)
|
||||
|
||||
/datum/disease2/effect/radian
|
||||
name = "Radian's Syndrome"
|
||||
@@ -257,6 +280,26 @@
|
||||
chance_maxm = 25
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
mob.say("*groan")
|
||||
|
||||
/datum/disease2/effect/chem_synthesis
|
||||
name = "Chemical Synthesis"
|
||||
stage = 3
|
||||
chance_maxm = 25
|
||||
|
||||
generate(c_data)
|
||||
if(c_data)
|
||||
data = c_data
|
||||
else
|
||||
data = pick("bicaridine", "kelotane", "dylovene", "inaprovaline", "space_drugs", "sugar",
|
||||
"tramadol", "dexalin", "cryptobiolin", "impedrezene", "hyperzine", "ethylredoxrazine",
|
||||
"mindbreaker", "nutriment")
|
||||
var/datum/reagent/R = chemical_reagents_list[data]
|
||||
name = "[initial(name)] ([initial(R.name)])"
|
||||
|
||||
activate(var/mob/living/carbon/mob,var/multiplier)
|
||||
if (mob.reagents.get_reagent_amount(data) < 5)
|
||||
mob.reagents.add_reagent(data, 2)
|
||||
|
||||
////////////////////////STAGE 2/////////////////////////////////
|
||||
|
||||
/datum/disease2/effect/scream
|
||||
|
||||
@@ -76,14 +76,15 @@ proc/airborne_can_reach(turf/source, turf/target)
|
||||
if ("[disease.uniqueID]" in M.virus2)
|
||||
return
|
||||
// if one of the antibodies in the mob's body matches one of the disease's antigens, don't infect
|
||||
if((M.antibodies & disease.antigen) != 0)
|
||||
var/list/antibodies_in_common = M.antibodies & disease.antigen
|
||||
if(antibodies_in_common.len)
|
||||
return
|
||||
if(M.reagents.has_reagent("spaceacillin"))
|
||||
return
|
||||
|
||||
|
||||
if(!disease.affected_species.len)
|
||||
return
|
||||
|
||||
|
||||
if (!(M.species.name in disease.affected_species))
|
||||
if (forced)
|
||||
disease.affected_species[1] = M.species.name
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#define ENTRY "entry"
|
||||
|
||||
/obj/machinery/disease2/isolator/
|
||||
name = "Pathogenic Isolator"
|
||||
name = "pathogenic isolator"
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
///////////////ANTIBODY SCANNER///////////////
|
||||
|
||||
/obj/item/device/antibody_scanner
|
||||
name = "\improper Antibody Scanner"
|
||||
name = "antibody scanner"
|
||||
desc = "Scans living beings for antibodies in their blood."
|
||||
icon_state = "health"
|
||||
w_class = 2.0
|
||||
@@ -20,7 +20,7 @@
|
||||
report("Scan aborted: The target does not have blood.", user)
|
||||
return
|
||||
|
||||
if(!C.antibodies)
|
||||
if(!C.antibodies.len)
|
||||
report("Scan Complete: No antibodies detected.", user)
|
||||
return
|
||||
|
||||
@@ -36,11 +36,12 @@
|
||||
///////////////VIRUS DISH///////////////
|
||||
|
||||
/obj/item/weapon/virusdish
|
||||
name = "virus containment/growth dish"
|
||||
name = "virus dish"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "implantcase-b"
|
||||
var/datum/disease2/disease/virus2 = null
|
||||
var/growth = 0
|
||||
var/basic_info = null
|
||||
var/info = 0
|
||||
var/analysed = 0
|
||||
|
||||
@@ -66,10 +67,17 @@
|
||||
del src
|
||||
|
||||
/obj/item/weapon/virusdish/examine(mob/user)
|
||||
user << "This is a virus containment dish."
|
||||
if(src.info)
|
||||
user << "It has the following information about its contents:"
|
||||
user << src.info
|
||||
..()
|
||||
if(basic_info)
|
||||
user << "[basic_info] : <a href='?src=\ref[src];info=1'>More Information</a>"
|
||||
|
||||
/obj/item/weapon/virusdish/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(.) return
|
||||
|
||||
if(href_list["info"])
|
||||
usr << browse(info, "window=info_\ref[src]")
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/ruinedvirusdish
|
||||
name = "ruined virus sample"
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#define GAS_CRITICAL_TEMPERATURE 132.65 // K. The critical point temperature for air.
|
||||
|
||||
/*
|
||||
The pipe looks to be thin vertically and wide horizontally, so we'll assume that it's
|
||||
three centimeters thick, one meter wide, and only explosed to the sun 3 degrees off of edge-on.
|
||||
Since the radiatior is uniform along it's length, the ratio of surface area touched by sunlight
|
||||
The pipe looks to be thin vertically and wide horizontally, so we'll assume that it's
|
||||
three centimeters thick, one meter wide, and only explosed to the sun 3 degrees off of edge-on.
|
||||
Since the radiatior is uniform along it's length, the ratio of surface area touched by sunlight
|
||||
to the total surface area is the same as the ratio of the perimeter of the cross-section.
|
||||
*/
|
||||
#define RADIATOR_EXPOSED_SURFACE_AREA_RATIO 0.04 // (3 cm + 100 cm * sin(3deg))/(2*(3+100 cm)). Unitless ratio.
|
||||
@@ -775,3 +775,10 @@ var/list/be_special_flags = list(
|
||||
#define SUIT_SENSOR_BINARY 1
|
||||
#define SUIT_SENSOR_VITAL 2
|
||||
#define SUIT_SENSOR_TRACKING 3
|
||||
|
||||
// NanoUI flags
|
||||
#define STATUS_INTERACTIVE 2 // GREEN Visability
|
||||
#define STATUS_UPDATE 1 // ORANGE Visability
|
||||
#define STATUS_DISABLED 0 // RED Visability
|
||||
#define STATUS_CLOSE -1 // Close the interface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user