diff --git a/baystation12.dme b/baystation12.dme index 0695839aea3..ec5a6267ce1 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -16,7 +16,6 @@ #include "code\setup.dm" #include "code\stylesheet.dm" #include "code\world.dm" -#include "code\__HELPERS\bygex.dm" #include "code\__HELPERS\files.dm" #include "code\__HELPERS\game.dm" #include "code\__HELPERS\global_lists.dm" @@ -178,9 +177,14 @@ #include "code\game\area\ai_monitored.dm" #include "code\game\area\areas.dm" #include "code\game\area\Space Station 13 areas.dm" -#include "code\game\dna\dna.dm" -#include "code\game\dna\dna_misc.dm" +#include "code\game\dna\dna2.dm" +#include "code\game\dna\dna2_domutcheck.dm" +#include "code\game\dna\dna2_helpers.dm" #include "code\game\dna\dna_modifier.dm" +#include "code\game\dna\genes\disabilities.dm" +#include "code\game\dna\genes\gene.dm" +#include "code\game\dna\genes\monkey.dm" +#include "code\game\dna\genes\powers.dm" #include "code\game\gamemodes\events.dm" #include "code\game\gamemodes\factions.dm" #include "code\game\gamemodes\game_mode.dm" @@ -267,6 +271,7 @@ #include "code\game\machinery\cloning.dm" #include "code\game\machinery\constructable_frame.dm" #include "code\game\machinery\cryo.dm" +#include "code\game\machinery\cryopod.dm" #include "code\game\machinery\deployable.dm" #include "code\game\machinery\door_control.dm" #include "code\game\machinery\doppler_array.dm" @@ -781,6 +786,7 @@ #include "code\modules\economy\TradeDestinations.dm" #include "code\modules\events\alien_infestation.dm" #include "code\modules\events\blob.dm" +#include "code\modules\events\borers.dm" #include "code\modules\events\brand_intelligence.dm" #include "code\modules\events\carp_migration.dm" #include "code\modules\events\comms_blackout.dm" @@ -834,6 +840,7 @@ #include "code\modules\mining\money_bag.dm" #include "code\modules\mining\ores_coins.dm" #include "code\modules\mining\satchel_ore_boxdm.dm" +#include "code\modules\mob\abilities.dm" #include "code\modules\mob\death.dm" #include "code\modules\mob\emote.dm" #include "code\modules\mob\inventory.dm" @@ -1299,6 +1306,7 @@ #include "code\WorkInProgress\Cael_Aislinn\Supermatter\LaserComputer.dm" #include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm" #include "code\WorkInProgress\Chinsky\ashtray.dm" +#include "code\WorkInProgress\Chinsky\guestpass.dm" #include "code\WorkInProgress\Cib\MedicalSideEffects.dm" #include "code\WorkInProgress\kilakk\fax.dm" #include "code\WorkInProgress\Mini\atmos_control.dm" diff --git a/bygex.dll b/bygex.dll deleted file mode 100644 index e7bdd9f9a78..00000000000 Binary files a/bygex.dll and /dev/null differ diff --git a/code/WorkInProgress/Chinsky/ashtray.dm b/code/WorkInProgress/Chinsky/ashtray.dm index ab3a6362515..5ec88ac8bdf 100644 --- a/code/WorkInProgress/Chinsky/ashtray.dm +++ b/code/WorkInProgress/Chinsky/ashtray.dm @@ -17,35 +17,34 @@ /obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob) if (health < 1) return - if (istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match)) - if(user) - if (contents.len >= max_butts) - user << "This ashtray is full." - return - user.u_equip(W) - W.loc = src - if ((user.client && user.s_active != src)) - user.client.screen -= W + if (istype(W,/obj/item/weapon/cigbutt) || istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match)) + if (contents.len >= max_butts) + user << "This ashtray is full." + return + user.u_equip(W) + W.loc = src + + if (istype(W,/obj/item/clothing/mask/cigarette)) var/obj/item/clothing/mask/cigarette/cig = W if (cig.lit == 1) src.visible_message("[user] crushes [cig] in [src], putting it out.") - cig.smoketime = 0 + processing_objects.Remove(cig) + var/obj/item/butt = new cig.type_butt(src) + cig.transfer_fingerprints_to(butt) + del(cig) else if (cig.lit == 0) - if(istype(cig, /obj/item/weapon/match)) - user << "You place [cig] in [src] without even lighting it. Why would you do that?" - else - user << "You place [cig] in [src] without even smoking it. Why would you do that?" - else if (cig.lit == -1) - src.visible_message("[user] places [cig] in [src].") - user.update_inv_l_hand() - user.update_inv_r_hand() - add_fingerprint(user) - if (contents.len == max_butts) - icon_state = icon_full - desc = empty_desc + " It's stuffed full." - else if (contents.len > max_butts/2) - icon_state = icon_half - desc = empty_desc + " It's half-filled." + user << "You place [cig] in [src] without even smoking it. Why would you do that?" + + src.visible_message("[user] places [W] in [src].") + user.update_inv_l_hand() + user.update_inv_r_hand() + add_fingerprint(user) + if (contents.len == max_butts) + icon_state = icon_full + desc = empty_desc + " It's stuffed full." + else if (contents.len > max_butts/2) + icon_state = icon_half + desc = empty_desc + " It's half-filled." else health = max(0,health - W.force) user << "You hit [src] with [W]." @@ -62,7 +61,6 @@ if (contents.len) src.visible_message("\red [src] slams into [hit_atom] spilling its contents!") for (var/obj/item/clothing/mask/cigarette/O in contents) - contents -= O O.loc = src.loc icon_state = icon_empty return ..() @@ -70,7 +68,6 @@ /obj/item/ashtray/proc/die() src.visible_message("\red [src] shatters spilling its contents!") for (var/obj/item/clothing/mask/cigarette/O in contents) - contents -= O O.loc = src.loc icon_state = icon_broken diff --git a/code/WorkInProgress/Chinsky/guestpass.dm b/code/WorkInProgress/Chinsky/guestpass.dm new file mode 100644 index 00000000000..8a959c5b76a --- /dev/null +++ b/code/WorkInProgress/Chinsky/guestpass.dm @@ -0,0 +1,186 @@ +///////////////////////////////////////////// +//Guest pass //////////////////////////////// +///////////////////////////////////////////// +/obj/item/weapon/card/id/guest + name = "guest pass" + desc = "Allows temporary access to station areas." + icon_state = "guest" + + var/temp_access = list() //to prevent agent cards stealing access as permanent + var/expiration_time = 0 + var/reason = "NOT SPECIFIED" + +/obj/item/weapon/card/id/guest/GetAccess() + if (world.time > expiration_time) + return access + else + return temp_access + +/obj/item/weapon/card/id/guest/examine() + ..() + if (world.time < expiration_time) + usr << "\blue This pass expires at [worldtime2text(expiration_time)]." + else + usr << "\red It expired at [worldtime2text(expiration_time)]." + +/obj/item/weapon/card/id/guest/read() + if (world.time > expiration_time) + usr << "This pass expired at [worldtime2text(expiration_time)]." + else + usr << "This pass expires at [worldtime2text(expiration_time)]." + + usr << "It grants access to following areas:" + for (var/A in temp_access) + usr << "[get_access_desc(A)]." + usr << "Issuing reason: [reason]." + return + +///////////////////////////////////////////// +//Guest pass terminal//////////////////////// +///////////////////////////////////////////// + +/obj/machinery/computer/guestpass + name = "guest pass terminal" + icon_state = "guest" + density = 0 + + + var/obj/item/weapon/card/id/giver + var/list/accesses = list() + var/giv_name = "NOT SPECIFIED" + var/reason = "NOT SPECIFIED" + var/duration = 0 + + var/list/internal_log = list() + var/mode = 0 // 0 - making pass, 1 - viewing logs + +/obj/machinery/computer/guestpass/New() + ..() + uid = "[rand(100,999)]-G[rand(10,99)]" + +/obj/machinery/computer/guestpass/attackby(obj/O, mob/user) + if(istype(O, /obj/item/weapon/card/id)) + user.drop_item() + O.loc = src + giver = O + updateUsrDialog() + +/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob) + return attack_hand(user) + +/obj/machinery/computer/guestpass/attack_paw(var/mob/user as mob) + return attack_hand(user) + +/obj/machinery/computer/guestpass/attack_hand(var/mob/user as mob) + if(..()) + return + + user.set_machine(src) + var/dat + + if (mode == 1) //Logs + dat += "

Activity log


" + for (var/entry in internal_log) + dat += "[entry]

" + dat += "Print
" + dat += "Back
" + else + dat += "

Guest pass terminal #[uid]


" + dat += "View activity log

" + dat += "Issuing ID: [giver]
" + dat += "Issued to: [giv_name]
" + dat += "Reason: [reason]
" + dat += "Duration (minutes): [duration] m
" + dat += "Access to areas:
" + if (giver && giver.access) + for (var/A in giver.access) + var/area = get_access_desc(A) + if (A in accesses) + area = "[area]" + dat += "[area]
" + dat += "
Issue pass
" + + user << browse(dat, "window=guestpass;size=400x520") + onclose(user, "guestpass") + + +/obj/machinery/computer/guestpass/Topic(href, href_list) + if(..()) + return + usr.set_machine(src) + if (href_list["mode"]) + mode = text2num(href_list["mode"]) + + if (href_list["choice"]) + switch(href_list["choice"]) + if ("giv_name") + var/nam = input("Person pass is issued to", "Name", name) + if (nam) + giv_name = nam + if ("reason") + var/reas = input("Reason why pass is issued", "Reason", reason) + reason = reas + if ("duration") + var/dur = input("Duration (in minutes) during which pass is valid.", "Duration") as num + if (dur > 0 && dur < 30) + duration = dur + else + usr << "\red Invalid duration." + if ("access") + var/A = text2num(href_list["access"]) + if (A in accesses) + accesses.Remove(A) + else + accesses.Add(A) + if (href_list["action"]) + switch(href_list["action"]) + if ("id") + if (giver) + if(ishuman(usr)) + giver.loc = usr.loc + if(!usr.get_active_hand()) + usr.put_in_hands(giver) + giver = null + else + giver.loc = src.loc + giver = null + else + var/obj/item/I = usr.get_active_hand() + if (istype(I, /obj/item/weapon/card/id)) + usr.drop_item() + I.loc = src + giver = I + updateUsrDialog() + + if ("print") + var/dat = "

Activity log of guest pass terminal #[uid]


" + for (var/entry in internal_log) + dat += "[entry]

" + //usr << "Printing the log, standby..." + //sleep(50) + var/obj/item/weapon/paper/P = new/obj/item/weapon/paper( loc ) + P.name = "activity log" + P.info = dat + + if ("issue") + if (giver) + var/number = add_zero("[rand(0,9999)]", 4) + var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: " + for (var/i=1 to accesses.len) + var/A = accesses[i] + if (A) + var/area = get_access_desc(A) + entry += "[i > 1 ? ", [area]" : "[area]"]" + entry += ". Expires at [worldtime2text(world.time + duration*10*60)]." + internal_log.Add(entry) + + var/obj/item/weapon/card/id/guest/pass = new(src.loc) + pass.temp_access = accesses.Copy() + pass.registered_name = giv_name + pass.expiration_time = world.time + duration*10*60 + pass.reason = reason + pass.name = "guest pass #[number]" + else + usr << "\red Cannot issue pass without issuing ID." + updateUsrDialog() + return \ No newline at end of file diff --git a/code/WorkInProgress/Yinadele/Supermatter.dm b/code/WorkInProgress/Yinadele/Supermatter.dm index 39759ff4946..aba28a7d5b2 100644 --- a/code/WorkInProgress/Yinadele/Supermatter.dm +++ b/code/WorkInProgress/Yinadele/Supermatter.dm @@ -202,6 +202,9 @@ /obj/machinery/power/supermatter/attack_robot(mob/user as mob) return attack_hand(user) +/obj/machinery/power/supermatter/attack_ai(mob/user as mob) + user << "You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update." + /obj/machinery/power/supermatter/attack_hand(mob/user as mob) user.visible_message("\The [user] reaches out and touches \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.",\ diff --git a/code/WorkInProgress/carn/master_controller_semi-seq.dm b/code/WorkInProgress/carn/master_controller_semi-seq.dm index 96e7eacda6e..0f9b4f666d9 100644 --- a/code/WorkInProgress/carn/master_controller_semi-seq.dm +++ b/code/WorkInProgress/carn/master_controller_semi-seq.dm @@ -50,7 +50,7 @@ datum/controller/game_controller/New() if(!syndicate_code_response) syndicate_code_response = generate_code_phrase() if(!ticker) ticker = new /datum/controller/gameticker() if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle() - + if(artifact_spawn) artifact_spawning_turfs = artifact_spawn datum/controller/game_controller/proc/setup() world.tick_lag = config.Ticklag diff --git a/code/WorkInProgress/kilakk/fax.dm b/code/WorkInProgress/kilakk/fax.dm index 76bcc0baa40..0d8f4cdde1f 100644 --- a/code/WorkInProgress/kilakk/fax.dm +++ b/code/WorkInProgress/kilakk/fax.dm @@ -109,10 +109,13 @@ var/list/alldepartments = list("Central Command") if(href_list["remove"]) if(tofax) - tofax.loc = usr.loc - usr.put_in_hands(tofax) - usr << "You take the paper out of \the [src]." - tofax = null + if(!ishuman(usr)) + usr << "You can't do it." + else + tofax.loc = usr.loc + usr.put_in_hands(tofax) + usr << "You take the paper out of \the [src]." + tofax = null if(href_list["scan"]) if (scan) diff --git a/code/__HELPERS/bygex.dm b/code/__HELPERS/bygex.dm deleted file mode 100644 index 0955b107508..00000000000 --- a/code/__HELPERS/bygex.dm +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef LIBREGEX_LIBRARY - #define LIBREGEX_LIBRARY "bygex" -#endif - -proc - regEx_compare(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_compare")(str, exp)) - - regex_compare(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_compare")(str, exp)) - - regEx_find(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_find")(str, exp)) - - regex_find(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_find")(str, exp)) - - regEx_replaceall(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regEx_replaceall")(str, exp, fmt) - - regex_replaceall(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regex_replaceall")(str, exp, fmt) - - replacetextEx(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regEx_replaceallliteral")(str, exp, fmt) - - replacetext(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regex_replaceallliteral")(str, exp, fmt) - - regEx_replace(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regEx_replace")(str, exp, fmt) - - regex_replace(str, exp, fmt) - return call(LIBREGEX_LIBRARY, "regex_replace")(str, exp, fmt) - - regEx_findall(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_findall")(str, exp)) - - regex_findall(str, exp) - return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_findall")(str, exp)) - - -//upon calling a regex match or search, a /datum/regex object is created with str(haystack) and exp(needle) variables set -//it also contains a list(matches) of /datum/match objects, each of which holds the position and length of the match -//matched strings are not returned from the dll, in order to save on memory allocation for large numbers of strings -//instead, you can use regex.str(matchnum) to fetch this string as needed. -//likewise you can also use regex.pos(matchnum) and regex.len(matchnum) as shorthands -/datum/regex - var/str - var/exp - var/error - var/anchors = 0 - var/list/matches = list() - - New(str, exp, results) - src.str = str - src.exp = exp - - if(findtext(results, "Err", 1, 4)) //error message - src.error = results - else - var/list/L = params2list(results) - var/list/M - var{i;j} - for(i in L) - M = L[i] - for(j=2, j<=M.len, j+=2) - matches += new /datum/match(text2num(M[j-1]),text2num(M[j])) - anchors = (j-2)/2 - return matches - - proc - str(i) - if(!i) return str - var/datum/match/M = matches[i] - return copytext(str, M.pos, M.pos+M.len) - - pos(i) - if(!i) return 1 - var/datum/match/M = matches[i] - return M.pos - - len(i) - if(!i) return length(str) - var/datum/match/M = matches[i] - return M.len - - end(i) - if(!i) return length(str) - var/datum/match/M = matches[i] - return M.pos + M.len - - report() //debug tool - . = ":: RESULTS ::\n:: str :: [html_encode(str)]\n:: exp :: [html_encode(exp)]\n:: anchors :: [anchors]" - if(error) - . += "\n[error]" - return - for(var/i=1, i<=matches.len, ++i) - . += "\nMatch[i]\n\t[html_encode(str(i))]\n\tpos=[pos(i)] len=[len(i)]" - -/datum/match - var/pos - var/len - - New(pos, len) - src.pos = pos - src.len = len diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index d33f976fe76..a493aa9d080 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -194,7 +194,35 @@ proc/checkhtml(var/t) /* * Text modification */ - //Adds 'u' number of zeros ahead of the text 't' +/proc/replacetext(text, find, replacement) + var/find_len = length(find) + if(find_len < 1) return text + . = "" + var/last_found = 1 + while(1) + var/found = findtext(text, find, last_found, 0) + . += copytext(text, last_found, found) + if(found) + . += replacement + last_found = found + find_len + continue + return . + +/proc/replacetextEx(text, find, replacement) + var/find_len = length(find) + if(find_len < 1) return text + . = "" + var/last_found = 1 + while(1) + var/found = findtextEx(text, find, last_found, 0) + . += copytext(text, last_found, found) + if(found) + . += replacement + last_found = found + find_len + continue + return . + +//Adds 'u' number of zeros ahead of the text 't' /proc/add_zero(t, u) while (length(t) < u) t = "0[t]" diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index e180f2092d6..20eb15d6af0 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -261,4 +261,5 @@ proc/tg_list2text(list/list, glue=",") switch(ui_style) if("old") return 'icons/mob/screen1_old.dmi' if("Orange") return 'icons/mob/screen1_Orange.dmi' - else return 'icons/mob/screen1_Midnight.dmi' + if("Midnight") return 'icons/mob/screen1_Midnight.dmi' + else return 'icons/mob/screen1_White.dmi' diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 5ce15be96e7..fd0b658aa0b 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -291,7 +291,7 @@ // Simple helper to face what you clicked on, in case it should be needed in more than one place /mob/proc/face_atom(var/atom/A) - if( buckled || !A || !x || !y || !A.x || !A.y ) return + if( stat || buckled || !A || !x || !y || !A.x || !A.y ) return var/dx = A.x - x var/dy = A.y - y if(!dx && !dy) return diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 618858d5438..88ac1b70e2c 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -166,9 +166,11 @@ datum/hud/New(mob/owner) if(!ismob(mymob)) return 0 if(!mymob.client) return 0 var/ui_style = ui_style2icon(mymob.client.prefs.UI_style) + var/ui_color = mymob.client.prefs.UI_style_color + var/ui_alpha = mymob.client.prefs.UI_style_alpha if(ishuman(mymob)) - human_hud(ui_style) // Pass the player the UI style chosen in preferences + human_hud(ui_style, ui_color, ui_alpha) // Pass the player the UI style chosen in preferences else if(ismonkey(mymob)) monkey_hud(ui_style) else if(isbrain(mymob)) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 3d97018352a..ca053f86e6b 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -1,4 +1,4 @@ -/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi') +/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255) src.adding = list() src.other = list() @@ -73,6 +73,8 @@ using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi using.layer = 20 + using.color = ui_color + using.alpha = ui_alpha src.adding += using move_intent = using @@ -82,6 +84,8 @@ using.icon_state = "act_drop" using.screen_loc = ui_drop_throw using.layer = 19 + using.color = ui_color + using.alpha = ui_alpha src.hotkeybuttons += using inv_box = new /obj/screen/inventory() @@ -92,6 +96,8 @@ inv_box.icon_state = "center" inv_box.screen_loc = ui_iclothing inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -102,6 +108,8 @@ inv_box.icon_state = "equip" inv_box.screen_loc = ui_oclothing inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -114,6 +122,9 @@ inv_box.screen_loc = ui_rhand inv_box.slot_id = slot_r_hand inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha + src.r_hand_hud_object = inv_box src.adding += inv_box @@ -127,6 +138,8 @@ inv_box.screen_loc = ui_lhand inv_box.slot_id = slot_l_hand inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.l_hand_hud_object = inv_box src.adding += inv_box @@ -137,6 +150,8 @@ using.icon_state = "hand1" using.screen_loc = ui_swaphand1 using.layer = 19 + using.color = ui_color + using.alpha = ui_alpha src.adding += using using = new /obj/screen/inventory() @@ -146,6 +161,8 @@ using.icon_state = "hand2" using.screen_loc = ui_swaphand2 using.layer = 19 + using.color = ui_color + using.alpha = ui_alpha src.adding += using inv_box = new /obj/screen/inventory() @@ -156,6 +173,8 @@ inv_box.screen_loc = ui_id inv_box.slot_id = slot_wear_id inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.adding += inv_box inv_box = new /obj/screen/inventory() @@ -166,6 +185,8 @@ inv_box.screen_loc = ui_mask inv_box.slot_id = slot_wear_mask inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -176,6 +197,8 @@ inv_box.screen_loc = ui_back inv_box.slot_id = slot_back inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.adding += inv_box inv_box = new /obj/screen/inventory() @@ -185,6 +208,8 @@ inv_box.screen_loc = ui_storage1 inv_box.slot_id = slot_l_store inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.adding += inv_box inv_box = new /obj/screen/inventory() @@ -194,6 +219,8 @@ inv_box.screen_loc = ui_storage2 inv_box.slot_id = slot_r_store inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.adding += inv_box inv_box = new /obj/screen/inventory() @@ -204,6 +231,8 @@ inv_box.screen_loc = ui_sstore1 inv_box.slot_id = slot_s_store inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.adding += inv_box using = new /obj/screen() @@ -212,6 +241,8 @@ using.icon_state = "act_resist" using.screen_loc = ui_pull_resist using.layer = 19 + using.color = ui_color + using.alpha = ui_alpha src.hotkeybuttons += using using = new /obj/screen() @@ -220,6 +251,8 @@ using.icon_state = "other" using.screen_loc = ui_inventory using.layer = 20 + using.color = ui_color + using.alpha = ui_alpha src.adding += using using = new /obj/screen() @@ -228,6 +261,8 @@ using.icon_state = "act_equip" using.screen_loc = ui_equip using.layer = 20 + using.color = ui_color + using.alpha = ui_alpha src.adding += using inv_box = new /obj/screen/inventory() @@ -237,6 +272,8 @@ inv_box.screen_loc = ui_gloves inv_box.slot_id = slot_gloves inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -246,6 +283,8 @@ inv_box.screen_loc = ui_glasses inv_box.slot_id = slot_glasses inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -255,6 +294,8 @@ inv_box.screen_loc = ui_l_ear inv_box.slot_id = slot_l_ear inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -264,6 +305,8 @@ inv_box.screen_loc = ui_r_ear inv_box.slot_id = slot_r_ear inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -273,6 +316,8 @@ inv_box.screen_loc = ui_head inv_box.slot_id = slot_head inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -282,6 +327,8 @@ inv_box.screen_loc = ui_shoes inv_box.slot_id = slot_shoes inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.other += inv_box inv_box = new /obj/screen/inventory() @@ -291,6 +338,8 @@ inv_box.screen_loc = ui_belt inv_box.slot_id = slot_belt inv_box.layer = 19 + inv_box.color = ui_color + inv_box.alpha = ui_alpha src.adding += inv_box mymob.throw_icon = new /obj/screen() @@ -298,6 +347,8 @@ mymob.throw_icon.icon_state = "act_throw_off" mymob.throw_icon.name = "throw" mymob.throw_icon.screen_loc = ui_drop_throw + mymob.throw_icon.color = ui_color + mymob.throw_icon.alpha = ui_alpha src.hotkeybuttons += mymob.throw_icon mymob.oxygen = new /obj/screen() @@ -382,6 +433,8 @@ mymob.zone_sel = new /obj/screen/zone_sel( null ) mymob.zone_sel.icon = ui_style + mymob.zone_sel.color = ui_color + mymob.zone_sel.alpha = ui_alpha mymob.zone_sel.overlays.Cut() mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 4ca8f9f5d75..ed054ae6c8a 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -276,37 +276,79 @@ C << "You are not wearing a mask." return 1 else - if(istype(C.l_hand, /obj/item/weapon/tank)) - C << "You are now running on internals from the [C.l_hand] on your left hand." - C.internal = C.l_hand - else if(istype(C.r_hand, /obj/item/weapon/tank)) - C << "You are now running on internals from the [C.r_hand] on your right hand." - C.internal = C.r_hand - else if(ishuman(C)) + var/list/nicename = null + var/list/tankcheck = null + var/breathes = "oxygen" //default, we'll check later + var/list/contents = list() + + if(ishuman(C)) var/mob/living/carbon/human/H = C - if(istype(H.s_store, /obj/item/weapon/tank)) - H << "You are now running on internals from the [H.s_store] on your [H.wear_suit]." - H.internal = H.s_store - else if(istype(H.belt, /obj/item/weapon/tank)) - H << "You are now running on internals from the [H.belt] on your belt." - H.internal = H.belt - else if(istype(H.l_store, /obj/item/weapon/tank)) - H << "You are now running on internals from the [H.l_store] in your left pocket." - H.internal = H.l_store - else if(istype(H.r_store, /obj/item/weapon/tank)) - H << "You are now running on internals from the [H.r_store] in your right pocket." - H.internal = H.r_store + breathes = H.species.breath_type + nicename = list ("suit", "back", "belt", "right hand", "left hand", "left pocket", "right pocket") + tankcheck = list (H.s_store, C.back, H.belt, C.r_hand, C.l_hand, H.l_store, H.r_store) - //Seperate so CO2 jetpacks are a little less cumbersome. - if(!C.internal && istype(C.back, /obj/item/weapon/tank)) - C << "You are now running on internals from the [C.back] on your back." - C.internal = C.back + else + nicename = list("Right Hand", "Left Hand", "Back") + tankcheck = list(C.r_hand, C.l_hand, C.back) + + for(var/i=1, i bestcontents) + best = i + bestcontents = contents[i] + + + //We've determined the best container now we set it as our internals + + if(best) + C << "You are now running on internals from [tankcheck[best]] on your [nicename[best]]." + C.internal = tankcheck[best] + + if(C.internal) if(C.internals) C.internals.icon_state = "internal1" else - C << "You don't have an oxygen tank." + C << "You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank." if("act_intent") usr.a_intent_change("right") if("help") diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index f2b5f01ce36..b5b6cf74233 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -62,6 +62,9 @@ var/automute_on = 0 //enables automuting/spam prevention var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. + var/disable_player_mice = 0 + var/uneducated_mice = 0 //Set to 1 to prevent newly-spawned mice from understanding human speech + var/usealienwhitelist = 0 var/limitalienplayers = 0 var/alien_to_human_ratio = 0.5 @@ -425,6 +428,12 @@ if("ghost_interaction") config.ghost_interaction = 1 + if("disable_player_mice") + config.disable_player_mice = 1 + + if("uneducated_mice") + config.uneducated_mice = 1 + if("comms_password") config.comms_password = value diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 2be4c6e82a1..d4e92584229 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -107,13 +107,13 @@ var/datum/data/record/L = new() L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") L.fields["name"] = H.real_name - L.fields["rank"] = H.mind.assigned_role + L.fields["rank"] = H.mind.assigned_role L.fields["age"] = H.age L.fields["sex"] = H.gender L.fields["b_type"] = H.b_type L.fields["b_dna"] = H.dna.unique_enzymes - L.fields["enzymes"] = H.dna.struc_enzymes - L.fields["identity"] = H.dna.uni_identity + L.fields["enzymes"] = H.dna.SE // Used in respawning + L.fields["identity"] = H.dna.UI // " L.fields["image"] = getFlatIcon(H,0) //This is god-awful locked += L return diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index 16b4008fef0..502ce1e7346 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -45,7 +45,7 @@ H.op_stage.appendix = 2.0 var/datum/organ/external/groin = H.get_organ("groin") - var/datum/wound/W = new /datum/wound/internal_bleeding(25) + var/datum/wound/W = new /datum/wound/internal_bleeding(20) H.adjustToxLoss(25) groin.wounds += W src.cure() diff --git a/code/datums/diseases/dna_spread.dm b/code/datums/diseases/dna_spread.dm index c7c5f812122..69a8eb6500f 100644 --- a/code/datums/diseases/dna_spread.dm +++ b/code/datums/diseases/dna_spread.dm @@ -39,13 +39,13 @@ //Save original dna for when the disease is cured. src.original_dna["name"] = affected_mob.real_name - src.original_dna["UI"] = affected_mob.dna.uni_identity - src.original_dna["SE"] = affected_mob.dna.struc_enzymes + src.original_dna["UI"] = affected_mob.dna.UI + src.original_dna["SE"] = affected_mob.dna.SE affected_mob << "\red You don't feel like yourself.." - affected_mob.dna.uni_identity = strain_data["UI"] - updateappearance(affected_mob, affected_mob.dna.uni_identity) - affected_mob.dna.struc_enzymes = strain_data["SE"] + affected_mob.UpdateAppearance(strain_data["UI"]) + affected_mob.dna.SE = strain_data["SE"] + affected_mob.dna.UpdateSE() affected_mob.real_name = strain_data["name"] domutcheck(affected_mob) @@ -56,9 +56,9 @@ /datum/disease/dnaspread/Del() if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"])) - affected_mob.dna.uni_identity = original_dna["UI"] - updateappearance(affected_mob, affected_mob.dna.uni_identity) - affected_mob.dna.struc_enzymes = original_dna["SE"] + affected_mob.UpdateAppearance(original_dna["UI"]) + affected_mob.dna.SE = original_dna["SE"] + affected_mob.dna.UpdateSE() affected_mob.real_name = original_dna["name"] affected_mob << "\blue You feel more like yourself." diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 511731195e4..7cebf4f6bac 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -726,7 +726,7 @@ datum/mind else current.dna = changeling.absorbed_dna[1] current.real_name = current.dna.real_name - updateappearance(current, current.dna.uni_identity) + current.UpdateAppearance() domutcheck(current, null) else if (href_list["nuclear"]) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 6c6269d301e..3e066989043 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -51,122 +51,194 @@ //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). var/locked[] = list() - proc/get_manifest(monochrome, OOC) - var/list/heads = new() - var/list/sec = new() - var/list/eng = new() - var/list/med = new() - var/list/sci = new() - var/list/civ = new() - var/list/bot = new() - var/list/misc = new() - var/list/isactive = new() - var/dat = {" - - - - "} - var/even = 0 - - // sort mobs - for(var/datum/data/record/t in data_core.general) - var/name = t.fields["name"] - var/rank = t.fields["rank"] - var/real_rank = t.fields["real_rank"] - if(OOC) - var/active = 0 - for(var/mob/M in player_list) - if(M.real_name == name && M.client && M.client.inactivity <= 10 * 60 * 10) - active = 1 - break - isactive[name] = active ? "Active" : "Inactive" - else - isactive[name] = t.fields["p_stat"] - +/obj/effect/datacore/proc/get_manifest(monochrome, OOC) + var/list/heads = new() + var/list/sec = new() + var/list/eng = new() + var/list/med = new() + var/list/sci = new() + var/list/civ = new() + var/list/bot = new() + var/list/misc = new() + var/list/isactive = new() + var/dat = {" + +
NameRankActivity
+ + "} + var/even = 0 + // sort mobs + for(var/datum/data/record/t in data_core.general) + var/name = t.fields["name"] + var/rank = t.fields["rank"] + var/real_rank = t.fields["real_rank"] + if(OOC) + var/active = 0 + for(var/mob/M in player_list) + if(M.real_name == name && M.client && M.client.inactivity <= 10 * 60 * 10) + active = 1 + break + isactive[name] = active ? "Active" : "Inactive" + else + isactive[name] = t.fields["p_stat"] //world << "[name]: [rank]" - //cael - to prevent multiple appearances of a player/job combination, add a continue after each line - var/department = 0 - if(real_rank in command_positions) - heads[name] = rank - department = 1 - if(real_rank in security_positions) - sec[name] = rank - department = 1 - if(real_rank in engineering_positions) - eng[name] = rank - department = 1 - if(real_rank in medical_positions) - med[name] = rank - department = 1 - if(real_rank in science_positions) - sci[name] = rank - department = 1 - if(real_rank in civilian_positions) - civ[name] = rank - department = 1 - if(real_rank in nonhuman_positions) - bot[name] = rank - department = 1 + var/department = 0 + if(real_rank in command_positions) + heads[name] = rank + department = 1 + if(real_rank in security_positions) + sec[name] = rank + department = 1 + if(real_rank in engineering_positions) + eng[name] = rank + department = 1 + if(real_rank in medical_positions) + med[name] = rank + department = 1 + if(real_rank in science_positions) + sci[name] = rank + department = 1 + if(real_rank in civilian_positions) + civ[name] = rank + department = 1 + if(real_rank in nonhuman_positions) + bot[name] = rank + department = 1 + if(!department && !(name in heads)) + misc[name] = rank + if(heads.len > 0) + dat += "" + for(name in heads) + dat += "" + even = !even + if(sec.len > 0) + dat += "" + for(name in sec) + dat += "" + even = !even + if(eng.len > 0) + dat += "" + for(name in eng) + dat += "" + even = !even + if(med.len > 0) + dat += "" + for(name in med) + dat += "" + even = !even + if(sci.len > 0) + dat += "" + for(name in sci) + dat += "" + even = !even + if(civ.len > 0) + dat += "" + for(name in civ) + dat += "" + even = !even + // in case somebody is insane and added them to the manifest, why not + if(bot.len > 0) + dat += "" + for(name in bot) + dat += "" + even = !even + // misc guys + if(misc.len > 0) + dat += "" + for(name in misc) + dat += "" + even = !even - if(!department && !(name in heads)) - misc[name] = rank - - if(heads.len > 0) - dat += "" - for(name in heads) - dat += "" - even = !even - if(sec.len > 0) - dat += "" - for(name in sec) - dat += "" - even = !even - if(eng.len > 0) - dat += "" - for(name in eng) - dat += "" - even = !even - if(med.len > 0) - dat += "" - for(name in med) - dat += "" - even = !even - if(sci.len > 0) - dat += "" - for(name in sci) - dat += "" - even = !even - if(civ.len > 0) - dat += "" - for(name in civ) - dat += "" - even = !even - // in case somebody is insane and added them to the manifest, why not - if(bot.len > 0) - dat += "" - for(name in bot) - dat += "" - even = !even - // misc guys - if(misc.len > 0) - dat += "" - for(name in misc) - dat += "" - even = !even + dat += "
NameRankActivity
Heads
[name][heads[name]][isactive[name]]
Security
[name][sec[name]][isactive[name]]
Engineering
[name][eng[name]][isactive[name]]
Medical
[name][med[name]][isactive[name]]
Science
[name][sci[name]][isactive[name]]
Civilian
[name][civ[name]][isactive[name]]
Silicon
[name][bot[name]][isactive[name]]
Miscellaneous
[name][misc[name]][isactive[name]]
Heads
[name][heads[name]][isactive[name]]
Security
[name][sec[name]][isactive[name]]
Engineering
[name][eng[name]][isactive[name]]
Medical
[name][med[name]][isactive[name]]
Science
[name][sci[name]][isactive[name]]
Civilian
[name][civ[name]][isactive[name]]
Silicon
[name][bot[name]][isactive[name]]
Miscellaneous
[name][misc[name]][isactive[name]]
" + dat = replacetext(dat, "\n", "") // so it can be placed on paper correctly + dat = replacetext(dat, "\t", "") + return dat + + +/* +We can't just insert in HTML into the nanoUI so we need the raw data to play with. +*/ + +/obj/effect/datacore/proc/get_manifest_json() + var/heads[0] + var/sec[0] + var/eng[0] + var/med[0] + var/sci[0] + var/civ[0] + var/bot[0] + var/misc[0] + for(var/datum/data/record/t in data_core.general) + var/name = t.fields["name"] + var/rank = t.fields["rank"] + var/real_rank = t.fields["real_rank"] + var/isactive = t.fields["p_stat"] + var/department = 0 + var/depthead = 0 // Department Heads will be placed at the top of their lists. + if(real_rank in command_positions) + heads[++heads.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + depthead = 1 + if(rank=="Captain" && heads.len != 1) + heads.Swap(1,heads.len) + + if(real_rank in security_positions) + sec[++sec.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + if(depthead && sec.len != 1) + sec.Swap(1,sec.len) + + if(real_rank in engineering_positions) + eng[++eng.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + if(depthead && eng.len != 1) + eng.Swap(1,eng.len) + + if(real_rank in medical_positions) + med[++med.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + if(depthead && med.len != 1) + med.Swap(1,med.len) + + if(real_rank in science_positions) + sci[++sci.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + if(depthead && sci.len != 1) + sci.Swap(1,sci.len) + + if(real_rank in civilian_positions) + civ[++civ.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + if(depthead && civ.len != 1) + civ.Swap(1,civ.len) + + if(real_rank in nonhuman_positions) + bot[++bot.len] = list("name" = name, "rank" = rank, "active" = isactive) + department = 1 + + if(!department && !(name in heads)) + misc[++misc.len] = list("name" = name, "rank" = rank, "active" = isactive) + + return list(\ + "heads" = heads,\ + "sec" = sec,\ + "eng" = eng,\ + "med" = med,\ + "sci" = sci,\ + "civ" = civ,\ + "bot" = bot,\ + "misc" = misc\ + ) - dat += "" - dat = replacetext(dat, "\n", "") // so it can be placed on paper correctly - dat = replacetext(dat, "\t", "") - return dat /obj/effect/laser name = "laser" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index b84388f5838..d48e2e10c6f 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -325,6 +325,13 @@ icon = 'icons/obj/wizard.dmi' icon_state = "broom" +/obj/item/weapon/staff/gentcane + name = "Gentlemans Cane" + desc = "An ebony can with an ivory tip." + icon = 'icons/obj/weapons.dmi' + icon_state = "cane" + item_state = "stick" + /obj/item/weapon/staff/stick name = "stick" desc = "A great tool to drag someone else's drinks across the bar." diff --git a/code/game/communications.dm b/code/game/communications.dm index 3bc3ee70092..4f13277a31d 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -103,16 +103,16 @@ var/list/radiochannels = list( "Medical" = 1355, "Engineering" = 1357, "Security" = 1359, - "Response Team" = 1443, - "Deathsquad" = 1441, + "Response Team" = 1345, + "Deathsquad" = 1341, "Syndicate" = 1213, "Supply" = 1347, ) //depenging helpers -var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1443, 1441, 1347) +var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1345, 1341, 1347) // central command channels, i.e deathsquid & response teams -var/list/CENT_FREQS = list(1441, 1443) +var/list/CENT_FREQS = list(1345, 1341) var/const/COMM_FREQ = 1353 //command, colored gold in chat window var/const/SYND_FREQ = 1213 diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm new file mode 100644 index 00000000000..6b06dc57f68 --- /dev/null +++ b/code/game/dna/dna2.dm @@ -0,0 +1,356 @@ +/** +* DNA 2: The Spaghetti Strikes Back +* +* @author N3X15 +*/ + +// What each index means: +#define DNA_OFF_LOWERBOUND 0 +#define DNA_OFF_UPPERBOUND 1 +#define DNA_ON_LOWERBOUND 2 +#define DNA_ON_UPPERBOUND 3 + +// Define block bounds (off-low,off-high,on-low,on-high) +// Used in setupgame.dm +#define DNA_DEFAULT_BOUNDS list(1,2049,2050,4095) +#define DNA_HARDER_BOUNDS list(1,3049,3050,4095) +#define DNA_HARD_BOUNDS list(1,3490,3500,4095) + +// Defines which values mean "on" or "off". +// This is to make some of the more OP superpowers a larger PITA to activate, +// and to tell our new DNA datum which values to set in order to turn something +// on or off. +var/global/list/dna_activity_bounds[STRUCDNASIZE] + +// Used to determine what each block means (admin hax and species stuff on /vg/, mostly) +var/global/list/assigned_blocks[STRUCDNASIZE] + +var/global/list/datum/dna/gene/dna_genes[0] + +// UI Indices (can change to mutblock style, if desired) +#define DNA_UI_HAIR_R 1 +#define DNA_UI_HAIR_G 2 +#define DNA_UI_HAIR_B 3 +#define DNA_UI_BEARD_R 4 +#define DNA_UI_BEARD_G 5 +#define DNA_UI_BEARD_B 6 +#define DNA_UI_SKIN_TONE 7 +#define DNA_UI_EYES_R 8 +#define DNA_UI_EYES_G 9 +#define DNA_UI_EYES_B 10 +#define DNA_UI_GENDER 11 +#define DNA_UI_BEARD_STYLE 12 +#define DNA_UI_HAIR_STYLE 13 +#define DNA_UI_LENGTH 13 // Update this when you add something, or you WILL break shit. + +///////////////// +// GENE DEFINES +///////////////// + +// Skip checking if it's already active. +// Used for genes that check for value rather than a binary on/off. +#define GENE_ALWAYS_ACTIVATE 1 + +/* Note RE: unassigned blocks + + Many genes in baycode are currently sitting unused + (compare setupgame.dm to the number of *BLOCK variables). + + This datum will return 0 (or equivalent) if asked about + a block 0 (which means the gene was unassigned). Setters + will silently return without performing any action. + + I have code to assign these genes in a streamlined manner, + but in order to avoid breaking things, I've left the + existing setupgame.dm intact. Please let me know if you + need this behavior changed. + */ + +/datum/dna + // READ-ONLY, GETS OVERWRITTEN + // DO NOT FUCK WITH THESE OR BYOND WILL EAT YOUR FACE + var/uni_identity="" // Encoded UI + var/struc_enzymes="" // Encoded SE + var/unique_enzymes="" // MD5 of player name + + // Internal dirtiness checks + var/dirtyUI=0 + var/dirtySE=0 + + // Okay to read, but you're an idiot if you do. + // BLOCK = VALUE + var/list/SE[STRUCDNASIZE] + var/list/UI[DNA_UI_LENGTH] + + // From old dna. + var/b_type = "A+" // Should probably change to an integer => string map but I'm lazy. + var/mutantrace = null // The type of mutant race the player is, if applicable (i.e. potato-man) + var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings, + + // New stuff + var/species = "Human" + +/////////////////////////////////////// +// UNIQUE IDENTITY +/////////////////////////////////////// + +// Create random UI. +/datum/dna/proc/ResetUI(var/defer=0) + for(var/i=1,i<=DNA_UI_LENGTH,i++) + switch(i) + if(DNA_UI_SKIN_TONE) + SetUIValueRange(DNA_UI_SKIN_TONE,rand(1,220),220,1) // Otherwise, it gets fucked + else + UI[i]=rand(0,4095) + if(!defer) + UpdateUI() + +/datum/dna/proc/ResetUIFrom(var/mob/living/carbon/human/character) + // INITIALIZE! + ResetUI(1) + // Hair + // FIXME: Species-specific defaults pls + if(!character.h_style) + character.h_style = "Skinhead" + var/hair = hair_styles_list.Find(character.h_style) + + // Facial Hair + if(!character.f_style) + character.f_style = "Shaved" + var/beard = facial_hair_styles_list.Find(character.f_style) + + SetUIValueRange(DNA_UI_HAIR_R, character.r_hair, 255, 1) + SetUIValueRange(DNA_UI_HAIR_G, character.g_hair, 255, 1) + SetUIValueRange(DNA_UI_HAIR_B, character.b_hair, 255, 1) + + SetUIValueRange(DNA_UI_BEARD_R, character.r_facial, 255, 1) + SetUIValueRange(DNA_UI_BEARD_G, character.g_facial, 255, 1) + SetUIValueRange(DNA_UI_BEARD_B, character.b_facial, 255, 1) + + SetUIValueRange(DNA_UI_BEARD_R, character.r_eyes, 255, 1) + SetUIValueRange(DNA_UI_BEARD_G, character.g_eyes, 255, 1) + SetUIValueRange(DNA_UI_BEARD_B, character.b_eyes, 255, 1) + + SetUIValueRange(DNA_UI_SKIN_TONE, 35-character.s_tone, 220, 1) // Value can be negative. + + SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1) + + SetUIValueRange(DNA_UI_HAIR_STYLE, hair, hair_styles_list.len, 1) + SetUIValueRange(DNA_UI_BEARD_STYLE, beard, facial_hair_styles_list.len,1) + + UpdateUI() + +// Set a DNA UI block's raw value. +/datum/dna/proc/SetUIValue(var/block,var/value,var/defer=0) + if (block<=0) return + ASSERT(value>=0) + ASSERT(value<=4095) + UI[block]=value + dirtyUI=1 + if(!defer) + UpdateUI() + +// Get a DNA UI block's raw value. +/datum/dna/proc/GetUIValue(var/block) + if (block<=0) return 0 + return UI[block] + +// Set a DNA UI block's value, given a value and a max possible value. +// Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list) +/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue) + if (block<=0) return + ASSERT(maxvalue<=4095) + var/range = round(4095 / maxvalue) + if(value) + SetUIValue(block,value * range - rand(1,range-1)) + +// Getter version of above. +/datum/dna/proc/GetUIValueRange(var/block,var/maxvalue) + if (block<=0) return 0 + var/value = GetUIValue(block) + return round(1 +(value / 4096)*maxvalue) + +// Is the UI gene "on" or "off"? +// For UI, this is simply a check of if the value is > 2050. +/datum/dna/proc/GetUIState(var/block) + if (block<=0) return + return UI[block] > 2050 + + +// Set UI gene "on" (1) or "off" (0) +/datum/dna/proc/SetUIState(var/block,var/on,var/defer=0) + if (block<=0) return + var/val + if(on) + val=rand(2050,4095) + else + val=rand(1,2049) + SetUIValue(block,val,defer) + +// Get a hex-encoded UI block. +/datum/dna/proc/GetUIBlock(var/block) + return EncodeDNABlock(GetUIValue(block)) + +// Do not use this unless you absolutely have to. +// Set a block from a hex string. This is inefficient. If you can, use SetUIValue(). +// Used in DNA modifiers. +/datum/dna/proc/SetUIBlock(var/block,var/value,var/defer=0) + if (block<=0) return + return SetUIValue(block,hex2num(value),defer) + +// Get a sub-block from a block. +/datum/dna/proc/GetUISubBlock(var/block,var/subBlock) + return copytext(GetUIBlock(block),subBlock,subBlock+1) + +// Do not use this unless you absolutely have to. +// Set a block from a hex string. This is inefficient. If you can, use SetUIValue(). +// Used in DNA modifiers. +/datum/dna/proc/SetUISubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0) + if (block<=0) return + var/oldBlock=GetUIBlock(block) + var/newBlock="" + for(var/i=1, i<=length(oldBlock), i++) + if(i==subBlock) + newBlock+=newSubBlock + else + newBlock+=copytext(oldBlock,i,i+1) + SetUIBlock(block,newBlock,defer) + +/////////////////////////////////////// +// STRUCTURAL ENZYMES +/////////////////////////////////////// + +// "Zeroes out" all of the blocks. +/datum/dna/proc/ResetSE() + for(var/i = 1, i <= STRUCDNASIZE, i++) + SetSEValue(i,rand(1,1024),1) + UpdateSE() + +// Set a DNA SE block's raw value. +/datum/dna/proc/SetSEValue(var/block,var/value,var/defer=0) + //testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]") + if (block<=0) return + ASSERT(value>=0) + ASSERT(value<=4095) + SE[block]=value + dirtySE=1 + if(!defer) + UpdateSE() + +// Get a DNA SE block's raw value. +/datum/dna/proc/GetSEValue(var/block) + if (block<=0) return 0 + return SE[block] + +// Set a DNA SE block's value, given a value and a max possible value. +// Might be used for species? +/datum/dna/proc/SetSEValueRange(var/block,var/value,var/maxvalue) + if (block<=0) return + ASSERT(maxvalue<=4095) + var/range = round(4095 / maxvalue) + if(value) + SetSEValue(block, value * range - rand(1,range-1)) + +// Getter version of above. +/datum/dna/proc/GetSEValueRange(var/block,var/maxvalue) + if (block<=0) return 0 + var/value = GetSEValue(block) + return round(1 +(value / 4096)*maxvalue) + +// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.) +/datum/dna/proc/GetSEState(var/block) + if (block<=0) return 0 + var/list/BOUNDS=GetDNABounds(block) + var/value=GetSEValue(block) + return (value > BOUNDS[DNA_ON_LOWERBOUND]) + +// Set a block "on" or "off". +/datum/dna/proc/SetSEState(var/block,var/on,var/defer=0) + if (block<=0) return + var/list/BOUNDS=GetDNABounds(block) + var/val + if(on) + val=rand(BOUNDS[DNA_ON_LOWERBOUND],BOUNDS[DNA_ON_UPPERBOUND]) + else + val=rand(BOUNDS[DNA_OFF_LOWERBOUND],BOUNDS[DNA_OFF_UPPERBOUND]) + SetSEValue(block,val,defer) + +// Get hex-encoded SE block. +/datum/dna/proc/GetSEBlock(var/block) + return EncodeDNABlock(GetSEValue(block)) + +// Do not use this unless you absolutely have to. +// Set a block from a hex string. This is inefficient. If you can, use SetUIValue(). +// Used in DNA modifiers. +/datum/dna/proc/SetSEBlock(var/block,var/value,var/defer=0) + if (block<=0) return + var/nval=hex2num(value) + //testing("SetSEBlock([block],[value],[defer]): [value] -> [nval]") + return SetSEValue(block,nval,defer) + +/datum/dna/proc/GetSESubBlock(var/block,var/subBlock) + return copytext(GetSEBlock(block),subBlock,subBlock+1) + +// Do not use this unless you absolutely have to. +// Set a sub-block from a hex character. This is inefficient. If you can, use SetUIValue(). +// Used in DNA modifiers. +/datum/dna/proc/SetSESubBlock(var/block,var/subBlock, var/newSubBlock, var/defer=0) + if (block<=0) return + var/oldBlock=GetSEBlock(block) + var/newBlock="" + for(var/i=1, i<=length(oldBlock), i++) + if(i==subBlock) + newBlock+=newSubBlock + else + newBlock+=copytext(oldBlock,i,i+1) + //testing("SetSESubBlock([block],[subBlock],[newSubBlock],[defer]): [oldBlock] -> [newBlock]") + SetSEBlock(block,newBlock,defer) + + +/proc/EncodeDNABlock(var/value) + return add_zero2(num2hex(value,1), 3) + +/datum/dna/proc/UpdateUI() + src.uni_identity="" + for(var/block in UI) + uni_identity += EncodeDNABlock(block) + //testing("New UI: [uni_identity]") + dirtyUI=0 + +/datum/dna/proc/UpdateSE() + //var/oldse=struc_enzymes + struc_enzymes="" + for(var/block in SE) + struc_enzymes += EncodeDNABlock(block) + //testing("Old SE: [oldse]") + //testing("New SE: [struc_enzymes]") + dirtySE=0 + +// BACK-COMPAT! +// Just checks our character has all the crap it needs. +/datum/dna/proc/check_integrity(var/mob/living/carbon/human/character) + if(character) + if(UI.len != DNA_UI_LENGTH) + ResetUIFrom(character) + + if(length(struc_enzymes)!= 3*STRUCDNASIZE) + ResetSE() + + if(length(unique_enzymes) != 32) + unique_enzymes = md5(character.real_name) + else + if(length(uni_identity) != 3*DNA_UI_LENGTH) + uni_identity = "00600200A00E0110148FC01300B0095BD7FD3F4" + if(length(struc_enzymes)!= 3*STRUCDNASIZE) + struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6" + +// BACK-COMPAT! +// Initial DNA setup. I'm kind of wondering why the hell this doesn't just call the above. +/datum/dna/proc/ready_dna(mob/living/carbon/human/character) + ResetUIFrom(character) + + ResetSE() + + unique_enzymes = md5(character.real_name) + reg_dna[unique_enzymes] = character.real_name + diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm new file mode 100644 index 00000000000..c9b75118de2 --- /dev/null +++ b/code/game/dna/dna2_domutcheck.dm @@ -0,0 +1,355 @@ +// (Re-)Apply mutations. +// TODO: Turn into a /mob proc, change inj to a bitflag for various forms of differing behavior. +// M: Mob to mess with +// connected: Machine we're in, type unchecked so I doubt it's used beyond monkeying +// flags: See below, bitfield. +#define MUTCHK_FORCED 1 +/proc/domutcheck(var/mob/living/M, var/connected=null, var/flags=0) + for(var/datum/dna/gene/gene in dna_genes) + if(!M) + return + if(!gene.block) + continue + + // Sanity checks, don't skip. + if(!gene.can_activate(M,flags)) + //testing("[M] - Failed to activate [gene.name] (can_activate fail).") + continue + + // Current state + var/gene_active = (gene.flags & GENE_ALWAYS_ACTIVATE) + if(!gene_active) + gene_active = M.dna.GetSEState(gene.block) + + // Prior state + var/gene_prior_status = (gene.type in M.active_genes) + + if((gene_active && !gene_prior_status) || (gene.flags & GENE_ALWAYS_ACTIVATE)) + //testing("[gene.name] activated!") + gene.activate(M,connected,flags) + if(M) + if(!(gene.flags & GENE_ALWAYS_ACTIVATE)) + M.active_genes |= gene.type + M.update_icon=1 + else if(!gene_active && gene_prior_status) + //testing("[gene.name] deactivated!") + gene.deactivate(M,connected,flags) + if(M) + M.active_genes -= gene.type + M.update_icon = 1 + //else + // testing("[M] - Failed to activate [gene.name] - [gene_active?"+":"-"]active, [gene_prior_status?"+":"-"]prior") + +/* Old, inflexibile +/proc/domutcheck(var/mob/living/M, var/connected, var/flags) + if (!M) return + + M.dna.check_integrity() + + M.disabilities = 0 + M.sdisabilities = 0 + var/old_mutations = M.mutations + M.mutations = list() + M.pass_flags = 0 +// M.see_in_dark = 2 +// M.see_invisible = 0 + + if(PLANT in old_mutations) + M.mutations.Add(PLANT) + if(SKELETON in old_mutations) + M.mutations.Add(SKELETON) + if(FAT in old_mutations) + M.mutations.Add(FAT) + if(HUSK in old_mutations) + M.mutations.Add(HUSK) + + var/inj = (flags & MUTCHK_FROM_INJECTOR) == MUTCHK_FROM_INJECTOR + var/forced = (flags & MUTCHK_FORCED) == MUTCHK_FORCED + + if(M.dna.GetSEState(NOBREATHBLOCK)) + if(forced || probinj(45,inj) || (mNobreath in old_mutations)) + M << "\blue You feel no need to breathe." + M.mutations.Add(mNobreath) + if(M.dna.GetSEState(REMOTEVIEWBLOCK)) + if(forced || probinj(45,inj) || (mRemote in old_mutations)) + M << "\blue Your mind expands" + M.mutations.Add(mRemote) + M.verbs += /mob/living/carbon/human/proc/remoteobserve + if(M.dna.GetSEState(REGENERATEBLOCK)) + if(forced || probinj(45,inj) || (mRegen in old_mutations)) + M << "\blue You feel better" + M.mutations.Add(mRegen) + if(M.dna.GetSEState(INCREASERUNBLOCK)) + if(forced || probinj(45,inj) || (mRun in old_mutations)) + M << "\blue Your leg muscles pulsate." + M.mutations.Add(mRun) + if(M.dna.GetSEState(REMOTETALKBLOCK)) + if(forced || probinj(45,inj) || (mRemotetalk in old_mutations)) + M << "\blue You expand your mind outwards" + M.mutations.Add(mRemotetalk) + M.verbs += /mob/living/carbon/human/proc/remotesay + if(M.dna.GetSEState(MORPHBLOCK)) + if(forced || probinj(45,inj) || (mMorph in old_mutations)) + M.mutations.Add(mMorph) + M << "\blue Your skin feels strange" + M.verbs += /mob/living/carbon/human/proc/morph + if(M.dna.GetSEState(COLDBLOCK)) + if(!(COLD_RESISTANCE in old_mutations)) + if(forced || probinj(15,inj) || (mHeatres in old_mutations)) + M.mutations.Add(mHeatres) + M << "\blue Your skin is icy to the touch" + else + if(forced || probinj(5,inj) || (mHeatres in old_mutations)) + M.mutations.Add(mHeatres) + M << "\blue Your skin is icy to the touch" + if(M.dna.GetSEState(HALLUCINATIONBLOCK)) + if(forced || probinj(45,inj) || (mHallucination in old_mutations)) + M.mutations.Add(mHallucination) + M << "\red Your mind says 'Hello'" + if(M.dna.GetSEState(NOPRINTSBLOCK)) + if(forced || probinj(45,inj) || (mFingerprints in old_mutations)) + M.mutations.Add(mFingerprints) + M << "\blue Your fingers feel numb" + if(M.dna.GetSEState(SHOCKIMMUNITYBLOCK)) + if(forced || probinj(45,inj) || (mShock in old_mutations)) + M.mutations.Add(mShock) + M << "\blue Your skin feels strange" + if(M.dna.GetSEState(SMALLSIZEBLOCK)) + if(forced || probinj(45,inj) || (mSmallsize in old_mutations)) + M << "\blue Your skin feels rubbery" + M.mutations.Add(mSmallsize) + M.pass_flags |= 1 + + + + if (M.dna.GetSEState(HULKBLOCK)) + if(forced || probinj(5,inj) || (HULK in old_mutations)) + M << "\blue Your muscles hurt." + M.mutations.Add(HULK) + if (M.dna.GetSEState(HEADACHEBLOCK)) + M.disabilities |= EPILEPSY + M << "\red You get a headache." + if (M.dna.GetSEState(FAKEBLOCK)) + M << "\red You feel strange." + if (prob(95)) + if(prob(50)) + randmutb(M) + else + randmuti(M) + else + randmutg(M) + if (M.dna.GetSEState(COUGHBLOCK)) + M.disabilities |= COUGHING + M << "\red You start coughing." + if (M.dna.GetSEState(CLUMSYBLOCK)) + M << "\red You feel lightheaded." + M.mutations.Add(CLUMSY) + if (M.dna.GetSEState(TWITCHBLOCK)) + M.disabilities |= TOURETTES + M << "\red You twitch." + if (M.dna.GetSEState(XRAYBLOCK)) + if(forced || probinj(30,inj) || (XRAY in old_mutations)) + M << "\blue The walls suddenly disappear." +// M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) +// M.see_in_dark = 8 +// M.see_invisible = 2 + M.mutations.Add(XRAY) + if (M.dna.GetSEState(NERVOUSBLOCK)) + M.disabilities |= NERVOUS + M << "\red You feel nervous." + if (M.dna.GetSEState(FIREBLOCK)) + if(!(mHeatres in old_mutations)) + if(forced || probinj(30,inj) || (COLD_RESISTANCE in old_mutations)) + M << "\blue Your body feels warm." + M.mutations.Add(COLD_RESISTANCE) + else + if(forced || probinj(5,inj) || (COLD_RESISTANCE in old_mutations)) + M << "\blue Your body feels warm." + M.mutations.Add(COLD_RESISTANCE) + if (M.dna.GetSEState(BLINDBLOCK)) + M.sdisabilities |= BLIND + M << "\red You can't seem to see anything." + if (M.dna.GetSEState(TELEBLOCK)) + if(forced || probinj(15,inj) || (TK in old_mutations)) + M << "\blue You feel smarter." + M.mutations.Add(TK) + if (M.dna.GetSEState(DEAFBLOCK)) + M.sdisabilities |= DEAF + M.ear_deaf = 1 + M << "\red Its kinda quiet.." + if (M.dna.GetSEState(GLASSESBLOCK)) + M.disabilities |= NEARSIGHTED + M << "Your eyes feel weird..." + + /* If you want the new mutations to work, UNCOMMENT THIS. + if(istype(M, /mob/living/carbon)) + for (var/datum/mutations/mut in global_mutations) + mut.check_mutation(M) + */ + +//////////////////////////////////////////////////////////// Monkey Block + if (M.dna.GetSEState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) + // human > monkey + var/mob/living/carbon/human/H = M + H.monkeyizing = 1 + var/list/implants = list() //Try to preserve implants. + for(var/obj/item/weapon/implant/W in H) + implants += W + W.loc = null + + if(!connected) + for(var/obj/item/W in (H.contents-implants)) + if (W==H.w_uniform) // will be teared + continue + H.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("h2monkey", animation) + sleep(48) + del(animation) + + + var/mob/living/carbon/monkey/O = null + if(H.species.primitive) + O = new H.species.primitive(src) + else + H.gib() //Trying to change the species of a creature with no primitive var set is messy. + return + + if(M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + + for(var/obj/T in (M.contents-implants)) + del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the cute little monkey + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) + O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss() + 20) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + O.a_intent = "hurt" + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return + + if (!M.dna.GetSEState(MONKEYBLOCK) && !istype(M, /mob/living/carbon/human)) + // monkey > human, + var/mob/living/carbon/monkey/Mo = M + Mo.monkeyizing = 1 + var/list/implants = list() //Still preserving implants + for(var/obj/item/weapon/implant/W in Mo) + implants += W + W.loc = null + if(!connected) + for(var/obj/item/W in (Mo.contents-implants)) + Mo.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("monkey2h", animation) + sleep(48) + del(animation) + + var/mob/living/carbon/human/O = new( src ) + if(Mo.greaterform) + O.set_species(Mo.greaterform) + + if (M.dna.GetUIState(DNA_UI_GENDER)) + O.gender = FEMALE + else + O.gender = MALE + + if (M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + //for(var/obj/T in M) + // del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the human + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + + var/i + while (!i) + var/randomname + if (O.gender == MALE) + randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names))) + else + randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names))) + if (findname(randomname)) + continue + else + O.real_name = randomname + i++ + O.UpdateAppearance() + O.take_overall_damage(M.getBruteLoss(), M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss()) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return +//////////////////////////////////////////////////////////// Monkey Block + if(M) + M.update_icon = 1 //queue a full icon update at next life() call + return null +/////////////////////////// DNA MISC-PROCS +*/ \ No newline at end of file diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm new file mode 100644 index 00000000000..6f180993fb8 --- /dev/null +++ b/code/game/dna/dna2_helpers.dm @@ -0,0 +1,172 @@ +///////////////////////////// +// Helpers for DNA2 +///////////////////////////// + +// Pads 0s to t until length == u +/proc/add_zero2(t, u) + var/temp1 + while (length(t) < u) + t = "0[t]" + temp1 = t + if (length(t) > u) + temp1 = copytext(t,2,u+1) + return temp1 + +// DNA Gene activation boundaries, see dna2.dm. +// Returns a list object with 4 numbers. +/proc/GetDNABounds(var/block) + var/list/BOUNDS=dna_activity_bounds[block] + if(!istype(BOUNDS)) + return DNA_DEFAULT_BOUNDS + return BOUNDS + +// Give Random Bad Mutation to M +/proc/randmutb(var/mob/living/M) + if(!M) return + M.dna.check_integrity() + var/block = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK) + M.dna.SetSEState(block, 1) + +// Give Random Good Mutation to M +/proc/randmutg(var/mob/living/M) + if(!M) return + M.dna.check_integrity() + var/block = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK) + M.dna.SetSEState(block, 1) + +// Random Appearance Mutation +/proc/randmuti(var/mob/living/M) + if(!M) return + M.dna.check_integrity() + M.dna.SetUIValue(rand(1,UNIDNASIZE),rand(1,4095)) + +// Scramble UI or SE. +/proc/scramble(var/UI, var/mob/M, var/prob) + if(!M) return + M.dna.check_integrity() + if(UI) + for(var/i = 1, i <= DNA_UI_LENGTH-1, i++) + if(prob(prob)) + M.dna.SetUIValue(i,rand(1,4095),1) + M.dna.UpdateUI() + M.UpdateAppearance() + + else + for(var/i = 1, i <= STRUCDNASIZE-1, i++) + if(prob(prob)) + M.dna.SetSEValue(i,rand(1,4095),1) + M.dna.UpdateSE() + domutcheck(M, null) + return + +// I haven't yet figured out what the fuck this is supposed to do. +/proc/miniscramble(input,rs,rd) + var/output + output = null + if (input == "C" || input == "D" || input == "E" || input == "F") + output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"6",prob((rs*10));"7",prob((rs*5)+(rd));"0",prob((rs*5)+(rd));"1",prob((rs*10)-(rd));"2",prob((rs*10)-(rd));"3") + if (input == "8" || input == "9" || input == "A" || input == "B") + output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3") + if (input == "4" || input == "5" || input == "6" || input == "7") + output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3") + if (input == "0" || input == "1" || input == "2" || input == "3") + output = pick(prob((rs*10));"8",prob((rs*10));"9",prob((rs*10));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C",prob((rs*10)-(rd));"D",prob((rs*5)+(rd));"E",prob((rs*5)+(rd));"F") + if (!output) output = "5" + return output + +// HELLO I MAKE BELL CURVES AROUND YOUR DESIRED TARGET +// So a shitty way of replacing gaussian noise. +// input: YOUR TARGET +// rs: RAD STRENGTH +// rd: DURATION +/proc/miniscrambletarget(input,rs,rd) + var/output = null + switch(input) + if("0") + output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10));"2",prob((rs*10)-(rd));"3") + if("1") + output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10));"3",prob((rs*10)-(rd));"4") + if("2") + output = pick(prob((rs*10));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10));"4",prob((rs*10)-(rd));"5") + if("3") + output = pick(prob((rs*10)-(rd));"0",prob((rs*10));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10));"5",prob((rs*10)-(rd));"6") + if("4") + output = pick(prob((rs*10)-(rd));"1",prob((rs*10));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10));"6",prob((rs*10)-(rd));"7") + if("5") + output = pick(prob((rs*10)-(rd));"2",prob((rs*10));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10));"7",prob((rs*10)-(rd));"8") + if("6") + output = pick(prob((rs*10)-(rd));"3",prob((rs*10));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10));"8",prob((rs*10)-(rd));"9") + if("7") + output = pick(prob((rs*10)-(rd));"4",prob((rs*10));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10));"9",prob((rs*10)-(rd));"A") + if("8") + output = pick(prob((rs*10)-(rd));"5",prob((rs*10));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10));"A",prob((rs*10)-(rd));"B") + if("9") + output = pick(prob((rs*10)-(rd));"6",prob((rs*10));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C") + if("10")//A + output = pick(prob((rs*10)-(rd));"7",prob((rs*10));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10));"C",prob((rs*10)-(rd));"D") + if("11")//B + output = pick(prob((rs*10)-(rd));"8",prob((rs*10));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10));"D",prob((rs*10)-(rd));"E") + if("12")//C + output = pick(prob((rs*10)-(rd));"9",prob((rs*10));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10));"E",prob((rs*10)-(rd));"F") + if("13")//D + output = pick(prob((rs*10)-(rd));"A",prob((rs*10));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10));"F") + if("14")//E + output = pick(prob((rs*10)-(rd));"B",prob((rs*10));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") + if("15")//F + output = pick(prob((rs*10)-(rd));"C",prob((rs*10));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F") + + if(!input || !output) //How did this happen? + output = "8" + + return output + +// /proc/updateappearance has changed behavior, so it's been removed +// Use mob.UpdateAppearance() instead. + +// Simpler. Don't specify UI in order for the mob to use its own. +/mob/proc/UpdateAppearance(var/list/UI=null) + if(istype(src, /mob/living/carbon/human)) + if(UI!=null) + src.dna.UI=UI + src.dna.UpdateUI() + dna.check_integrity() + var/mob/living/carbon/human/H = src + H.r_hair = dna.GetUIValueRange(DNA_UI_HAIR_R, 255) + H.g_hair = dna.GetUIValueRange(DNA_UI_HAIR_G, 255) + H.b_hair = dna.GetUIValueRange(DNA_UI_HAIR_B, 255) + + H.r_facial = dna.GetUIValueRange(DNA_UI_BEARD_R, 255) + H.g_facial = dna.GetUIValueRange(DNA_UI_BEARD_G, 255) + H.b_facial = dna.GetUIValueRange(DNA_UI_BEARD_B, 255) + + H.r_eyes = dna.GetUIValueRange(DNA_UI_EYES_R, 255) + H.g_eyes = dna.GetUIValueRange(DNA_UI_EYES_G, 255) + H.b_eyes = dna.GetUIValueRange(DNA_UI_EYES_B, 255) + + H.s_tone = 35 - dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220) // Value can be negative. + + if (dna.GetUIState(DNA_UI_GENDER)) + H.gender = FEMALE + else + H.gender = MALE + + //Hair + var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE,hair_styles_list.len) + if((0 < hair) && (hair <= hair_styles_list.len)) + H.h_style = hair_styles_list[hair] + + //Facial Hair + var/beard = dna.GetUIValueRange(DNA_UI_BEARD_STYLE,facial_hair_styles_list.len) + if((0 < beard) && (beard <= facial_hair_styles_list.len)) + H.f_style = facial_hair_styles_list[beard] + + H.update_body(0) + H.update_hair() + + return 1 + else + return 0 + +// Used below, simple injection modifier. +/proc/probinj(var/pr, var/inj) + return prob(pr+inj*pr) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 28598b175bb..6be58f811d7 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -1,5 +1,37 @@ #define DNA_BLOCK_SIZE 3 +// Buffer datatype flags. +#define DNA2_BUF_UI 1 +#define DNA2_BUF_UE 2 +#define DNA2_BUF_SE 4 + +//list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0), +/datum/dna2/record + var/datum/dna/dna = null + var/types=0 + var/name="Empty" + + // Stuff for cloners + var/id=null + var/implant=null + var/ckey=null + var/mind=null + +/datum/dna2/record/proc/GetData() + var/list/ser=list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0) + ser["ue"] = (types & DNA2_BUF_UE) == DNA2_BUF_UE + if(types & DNA2_BUF_SE) + ser["data"] = dna.SE + else + ser["data"] = dna.UI + ser["owner"] = src.dna.real_name + ser["label"] = name + if(types & DNA2_BUF_UI) + ser["type"] = "ui" + else + ser["type"] = "se" + return ser + /////////////////////////// DNA MACHINES /obj/machinery/dna_scannernew name = "\improper DNA modifier" @@ -14,6 +46,7 @@ var/locked = 0 var/mob/living/carbon/occupant = null var/obj/item/weapon/reagent_containers/glass/beaker = null + var/opened = 0 /obj/machinery/dna_scannernew/New() ..() @@ -80,12 +113,6 @@ usr.loc = src src.occupant = usr src.icon_state = "scanner_1" - /* - for(var/obj/O in src) // THIS IS P. STUPID -- LOVE, DOOHL - //O = null - del(O) - //Foreach goto(124) - */ src.add_fingerprint(usr) return @@ -111,7 +138,12 @@ if (G.affecting.abiotic()) user << "\blue Subject cannot have abiotic items on." return - var/mob/M = G.affecting + put_in(G.affecting) + src.add_fingerprint(user) + del(G) + return + +/obj/machinery/dna_scannernew/proc/put_in(var/mob/M) if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src @@ -119,8 +151,6 @@ src.occupant = M src.icon_state = "scanner_1" - src.add_fingerprint(user) - // search for ghosts, if the corpse is empty and the scanner is connected to a cloner if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \ || locate(/obj/machinery/computer/cloning, get_step(src, SOUTH)) \ @@ -132,19 +162,11 @@ if(ghost.mind == M.mind) ghost << "Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned! (Verbs -> Ghost -> Re-enter corpse)" break - del(G) return /obj/machinery/dna_scannernew/proc/go_out() if ((!( src.occupant ) || src.locked)) return -/* -// it's like this was -just- here to break constructed dna scanners -Pete -// if that's not the case, slap my shit and uncomment this. -// for(var/obj/O in src) -// O.loc = src.loc -*/ - //Foreach goto(30) if (src.occupant.client) src.occupant.client.eye = src.occupant.client.mob src.occupant.client.perspective = MOB_PERSPECTIVE @@ -205,11 +227,7 @@ var/selected_ui_target_hex = 1 var/radiation_duration = 2.0 var/radiation_intensity = 1.0 - var/list/buffers = list( - list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0), - list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0), - list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0) - ) + var/list/datum/dna2/record/buffers[3] var/irradiating = 0 var/injector_ready = 0 //Quick fix for issue 286 (screwdriver the screen twice to restore injector) -Pete var/obj/machinery/dna_scannernew/connected = null @@ -219,6 +237,7 @@ use_power = 1 idle_power_usage = 10 active_power_usage = 400 + var/waiting_for_user_input=0 // Fix for #274 (Mash create block injector without answering dialog to make unlimited injectors) - N3X /obj/machinery/computer/scan_consolenew/attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/weapon/screwdriver)) @@ -302,19 +321,19 @@ return return -/obj/machinery/computer/scan_consolenew/proc/all_dna_blocks(var/buffer) +/obj/machinery/computer/scan_consolenew/proc/all_dna_blocks(var/list/buffer) var/list/arr = list() - for(var/i = 1, i <= length(buffer)/3, i++) - arr += "[i]:[copytext(buffer,i*3-2,i*3+1)]" + for(var/i = 1, i <= buffer.len, i++) + arr += "[i]:[EncodeDNABlock(buffer[i])]" return arr -/obj/machinery/computer/scan_consolenew/proc/setInjectorBlock(var/obj/item/weapon/dnainjector/I, var/blk, var/buffer) +/obj/machinery/computer/scan_consolenew/proc/setInjectorBlock(var/obj/item/weapon/dnainjector/I, var/blk, var/datum/dna2/record/buffer) var/pos = findtext(blk,":") if(!pos) return 0 var/id = text2num(copytext(blk,1,pos)) if(!id) return 0 I.block = id - I.dna = copytext(buffer,id*3-2,id*3+1) + I.buf = buffer return 1 /obj/machinery/computer/scan_consolenew/attackby(obj/item/W as obj, mob/user as mob) @@ -336,6 +355,7 @@ ui_interact(user) /obj/machinery/computer/scan_consolenew/attack_ai(user as mob) + src.add_hiddenprint(user) ui_interact(user) /obj/machinery/computer/scan_consolenew/attack_hand(user as mob) @@ -363,27 +383,26 @@ data["selectedMenuKey"] = selected_menu_key data["locked"] = src.connected.locked data["hasOccupant"] = connected.occupant ? 1 : 0 - + data["isInjectorReady"] = injector_ready data["hasDisk"] = disk ? 1 : 0 var/diskData[0] - if (!disk) + if (!disk || !disk.buf) diskData["data"] = null diskData["owner"] = null diskData["label"] = null diskData["type"] = null diskData["ue"] = null else - diskData["data"] = disk.data - diskData["owner"] = disk.owner - diskData["label"] = disk.name - diskData["type"] = disk.data_type - diskData["ue"] = disk.ue + diskData = disk.buf.GetData() data["disk"] = diskData - data["buffers"] = buffers + var/list/new_buffers = list() + for(var/datum/dna2/record/buf in buffers) + new_buffers.Add(buf.GetData()) + data["buffers"]=new_buffers data["radiationIntensity"] = radiation_intensity data["radiationDuration"] = radiation_duration @@ -571,10 +590,7 @@ return 1 // return 1 forces an update to all Nano uis attached to src if (href_list["pulseUIRadiation"]) - var/block - var/newblock - var/tstructure2 - block = getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),src.selected_ui_subblock,1) + var/block = src.connected.occupant.dna.GetUISubBlock(src.selected_ui_block,src.selected_ui_subblock) irradiating = src.radiation_duration var/lock_state = src.connected.locked @@ -590,13 +606,8 @@ if (prob((80 + (src.radiation_duration / 2)))) block = miniscrambletarget(num2text(selected_ui_target), src.radiation_intensity, src.radiation_duration) - newblock = null - if (src.selected_ui_subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),2,1) + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),3,1) - if (src.selected_ui_subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),1,1) + block + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),3,1) - if (src.selected_ui_subblock == 3) newblock = getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),1,1) + getblock(getblock(src.connected.occupant.dna.uni_identity,src.selected_ui_block,DNA_BLOCK_SIZE),2,1) + block - tstructure2 = setblock(src.connected.occupant.dna.uni_identity, src.selected_ui_block, newblock,DNA_BLOCK_SIZE) - src.connected.occupant.dna.uni_identity = tstructure2 - updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) + src.connected.occupant.dna.SetUISubBlock(src.selected_ui_block,src.selected_ui_subblock,block) + src.connected.occupant.UpdateAppearance() src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration) else if (prob(20+src.radiation_intensity)) @@ -604,7 +615,7 @@ domutcheck(src.connected.occupant,src.connected) else randmuti(src.connected.occupant) - updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) + src.connected.occupant.UpdateAppearance() src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration) src.connected.locked = lock_state return 1 // return 1 forces an update to all Nano uis attached to src @@ -632,15 +643,13 @@ src.selected_se_block = select_block if ((select_subblock <= DNA_BLOCK_SIZE) && (select_subblock >= 1)) src.selected_se_subblock = select_subblock + //testing("User selected block [selected_se_block] (sent [select_block]), subblock [selected_se_subblock] (sent [select_block]).") return 1 // return 1 forces an update to all Nano uis attached to src if (href_list["pulseSERadiation"]) - var/block - var/newblock - var/tstructure2 - var/oldblock - - block = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),src.selected_se_subblock,1) + var/block = src.connected.occupant.dna.GetSESubBlock(src.selected_se_block,src.selected_se_subblock) + //var/original_block=block + //testing("Irradiating SE block [src.selected_se_block]:[src.selected_se_subblock] ([block])...") irradiating = src.radiation_duration var/lock_state = src.connected.locked @@ -653,47 +662,37 @@ if(src.connected.occupant) if (prob((80 + (src.radiation_duration / 2)))) - if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20)) - oldblock = src.selected_se_block - block = miniscramble(block, src.radiation_intensity, src.radiation_duration) - newblock = null + // FIXME: Find out what these corresponded to and change them to the WHATEVERBLOCK they need to be. + //if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20)) + var/real_SE_block=selected_se_block + block = miniscramble(block, src.radiation_intensity, src.radiation_duration) + if(prob(20)) if (src.selected_se_block > 1 && src.selected_se_block < STRUCDNASIZE/2) - src.selected_se_block++ + real_SE_block++ else if (src.selected_se_block > STRUCDNASIZE/2 && src.selected_se_block < STRUCDNASIZE) - src.selected_se_block-- - if (src.selected_se_subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1) - if (src.selected_se_subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1) - if (src.selected_se_subblock == 3) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + block - tstructure2 = setblock(src.connected.occupant.dna.struc_enzymes, src.selected_se_block, newblock,DNA_BLOCK_SIZE) - src.connected.occupant.dna.struc_enzymes = tstructure2 - domutcheck(src.connected.occupant,src.connected) - src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration) - src.selected_se_block = oldblock - else - // - block = miniscramble(block, src.radiation_intensity, src.radiation_duration) - newblock = null - if (src.selected_se_subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1) - if (src.selected_se_subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),3,1) - if (src.selected_se_subblock == 3) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),1,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.selected_se_block,DNA_BLOCK_SIZE),2,1) + block - tstructure2 = setblock(src.connected.occupant.dna.struc_enzymes, src.selected_se_block, newblock,DNA_BLOCK_SIZE) - src.connected.occupant.dna.struc_enzymes = tstructure2 - domutcheck(src.connected.occupant,src.connected) - src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration) + real_SE_block-- + + //testing("Irradiated SE block [real_SE_block]:[src.selected_se_subblock] ([original_block] now [block]) [(real_SE_block!=selected_se_block) ? "(SHIFTED)":""]!") + connected.occupant.dna.SetSESubBlock(real_SE_block,selected_se_subblock,block) + src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration) + domutcheck(src.connected.occupant,src.connected) else + src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration) if (prob(80-src.radiation_duration)) + //testing("Random bad mut!") randmutb(src.connected.occupant) domutcheck(src.connected.occupant,src.connected) else randmuti(src.connected.occupant) - updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) - src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration) + //testing("Random identity mut!") + src.connected.occupant.UpdateAppearance() src.connected.locked = lock_state return 1 // return 1 forces an update to all Nano uis attached to src if(href_list["ejectBeaker"]) if(connected.beaker) - connected.beaker.loc = connected.loc + var/obj/item/weapon/reagent_containers/glass/B = connected.beaker + B.loc = connected.loc connected.beaker = null return 1 @@ -704,18 +703,14 @@ // Transfer Buffer Management if(href_list["bufferOption"]) var/bufferOption = href_list["bufferOption"] - + // These bufferOptions do not require a bufferId if (bufferOption == "wipeDisk") if ((isnull(src.disk)) || (src.disk.read_only)) //src.temphtml = "Invalid disk. Please try again." return 0 - src.disk.data = null - src.disk.data_type = null - src.disk.ue = null - src.disk.owner = null - src.disk.name = null + src.disk.buf=null //src.temphtml = "Data saved." return 1 @@ -724,12 +719,12 @@ return src.disk.loc = get_turf(src) src.disk = null - return 1 - + return 1 + // All bufferOptions from here on require a bufferId if (!href_list["bufferId"]) return 0 - + var/bufferId = text2num(href_list["bufferId"]) if (bufferId < 1 || bufferId > 3) @@ -737,56 +732,46 @@ if (bufferOption == "saveUI") if(src.connected.occupant && src.connected.occupant.dna) - src.buffers[bufferId]["ue"] = 0 - src.buffers[bufferId]["data"] = src.connected.occupant.dna.uni_identity - if (!istype(src.connected.occupant,/mob/living/carbon/human)) - src.buffers[bufferId]["owner"] = src.connected.occupant.name - else - src.buffers[bufferId]["owner"] = src.connected.occupant.real_name - src.buffers[bufferId]["label"] = "Unique Identifier" - src.buffers[bufferId]["type"] = "ui" + var/datum/dna2/record/databuf=new + databuf.types = DNA2_BUF_UE + databuf.dna = src.connected.occupant.dna + databuf.name = "Unique Identifier" + src.buffers[bufferId] = databuf return 1 if (bufferOption == "saveUIAndUE") if(src.connected.occupant && src.connected.occupant.dna) - src.buffers[bufferId]["data"] = src.connected.occupant.dna.uni_identity - if (!istype(src.connected.occupant,/mob/living/carbon/human)) - src.buffers[bufferId]["owner"] = src.connected.occupant.name - else - src.buffers[bufferId]["owner"] = src.connected.occupant.real_name - src.buffers[bufferId]["label"] = "Unique Identifier + Unique Enzymes" - src.buffers[bufferId]["type"] = "ui" - src.buffers[bufferId]["ue"] = 1 + var/datum/dna2/record/databuf=new + databuf.types = DNA2_BUF_UI|DNA2_BUF_UE + databuf.dna = src.connected.occupant.dna + databuf.name = "Unique Identifier + Unique Enzymes" + src.buffers[bufferId] = databuf return 1 if (bufferOption == "saveSE") if(src.connected.occupant && src.connected.occupant.dna) - src.buffers[bufferId]["ue"] = 0 - src.buffers[bufferId]["data"] = src.connected.occupant.dna.struc_enzymes - if (!istype(src.connected.occupant,/mob/living/carbon/human)) - src.buffers[bufferId]["owner"] = src.connected.occupant.name - else - src.buffers[bufferId]["owner"] = src.connected.occupant.real_name - src.buffers[bufferId]["label"] = "Structural Enzymes" - src.buffers[bufferId]["type"] = "se" + var/datum/dna2/record/databuf=new + databuf.types = DNA2_BUF_SE + databuf.dna = src.connected.occupant.dna + databuf.name = "Structural Enzymes" + src.buffers[bufferId] = databuf return 1 if (bufferOption == "clear") - src.buffers[bufferId]["data"] = null - src.buffers[bufferId]["owner"] = null - src.buffers[bufferId]["label"] = null - src.buffers[bufferId]["ue"] = null + src.buffers[bufferId]=null return 1 if (bufferOption == "changeLabel") - var/label = src.buffers[bufferId]["label"] ? src.buffers[bufferId]["label"] : "New Label" - src.buffers[bufferId]["label"] = sanitize(input("New Label:", "Edit Label", label)) + var/datum/dna2/record/buf = src.buffers[bufferId] + buf.name = buf.name ? src.buffers[bufferId]["label"] : "New Label" + buf.name = sanitize(input("New Label:", "Edit Label", buf.name)) + src.buffers[bufferId] = buf return 1 if (bufferOption == "transfer") if (!src.connected.occupant || (NOCLONE in src.connected.occupant.mutations) || !src.connected.occupant.dna) return - + irradiating = 2 var/lock_state = src.connected.locked src.connected.locked = 1//lock it @@ -796,33 +781,37 @@ irradiating = 0 src.connected.locked = lock_state - - if (src.buffers[bufferId]["type"] == "ui") - if (src.buffers[bufferId]["ue"]) - src.connected.occupant.real_name = src.buffers[bufferId]["owner"] - src.connected.occupant.name = src.buffers[bufferId]["owner"] - src.connected.occupant.dna.uni_identity = src.buffers[bufferId]["data"] - updateappearance(src.connected.occupant,src.connected.occupant.dna.uni_identity) - else if (src.buffers[bufferId]["type"] == "se") - src.connected.occupant.dna.struc_enzymes = src.buffers[bufferId]["data"] + + var/datum/dna2/record/buf = src.buffers[bufferId] + + if ((buf.types & DNA2_BUF_UI)) + if ((buf.types & DNA2_BUF_UE)) + src.connected.occupant.real_name = buf.dna.real_name + src.connected.occupant.name = buf.dna.real_name + src.connected.occupant.UpdateAppearance(buf.dna.UI) + else if (buf.types & DNA2_BUF_SE) + src.connected.occupant.dna.SE = buf.dna.SE + src.connected.occupant.dna.UpdateSE() domutcheck(src.connected.occupant,src.connected) src.connected.occupant.radiation += rand(20,50) return 1 if (bufferOption == "createInjector") - if (src.injector_ready) + if (src.injector_ready || waiting_for_user_input) + var/success = 1 var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector - I.dnatype = src.buffers[bufferId]["type"] + var/datum/dna2/record/buf = src.buffers[bufferId] if(href_list["createBlockInjector"]) - var/blk = input(usr,"Select Block","Block") in all_dna_blocks(src.buffers[bufferId]["data"]) - success = setInjectorBlock(I,blk,src.buffers[bufferId]["data"]) + waiting_for_user_input=1 + var/blk = input(usr,"Select Block","Block") in all_dna_blocks(buf.GetData()) + success = setInjectorBlock(I,blk,buf) else - I.dna = src.buffers[bufferId]["data"] + I.buf = buf + waiting_for_user_input=0 if(success) I.loc = src.loc - I.name += " ([src.buffers[bufferId]["label"]])" - if (src.buffers[bufferId]["ue"]) I.ue = src.buffers[bufferId]["owner"] //lazy haw haw + I.name += " ([buf.name])" //src.temphtml = "Injector created." src.injector_ready = 0 spawn(300) @@ -834,14 +823,11 @@ return 1 if (bufferOption == "loadDisk") - if ((isnull(src.disk)) || (!src.disk.data) || (src.disk.data == "")) + if ((isnull(src.disk)) || (!src.disk.buf)) //src.temphtml = "Invalid disk. Please try again." return 0 - src.buffers[bufferId]["data"] = src.disk.data - src.buffers[bufferId]["type"] = src.disk.data_type - src.buffers[bufferId]["ue"] = src.disk.ue - src.buffers[bufferId]["owner"] = src.disk.owner + src.buffers[bufferId]=src.disk.buf //src.temphtml = "Data loaded." return 1 @@ -850,13 +836,12 @@ //src.temphtml = "Invalid disk. Please try again." return 0 - src.disk.data = buffers[bufferId]["data"] - src.disk.data_type = src.buffers[bufferId]["type"] - src.disk.ue = src.buffers[bufferId]["ue"] - src.disk.owner = src.buffers[bufferId]["owner"] - src.disk.name = "data disk - '[src.buffers[bufferId]["owner"]]'" + var/datum/dna2/record/buf = src.buffers[bufferId] + + src.disk.buf = buf + src.disk.name = "data disk - '[buf.dna.real_name]'" //src.temphtml = "Data saved." - return 1 + return 1 /////////////////////////// DNA MACHINES diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm new file mode 100644 index 00000000000..e312111f6f3 --- /dev/null +++ b/code/game/dna/genes/disabilities.dm @@ -0,0 +1,125 @@ +///////////////////// +// DISABILITY GENES +// +// These activate either a mutation, disability, or sdisability. +// +// Gene is always activated. +///////////////////// + +/datum/dna/gene/disability + name="DISABILITY" + + // Mutation to give (or 0) + var/mutation=0 + + // Disability to give (or 0) + var/disability=0 + + // SDisability to give (or 0) + var/sdisability=0 + + // Activation message + var/activation_message="" + + // Yay, you're no longer growing 3 arms + var/deactivation_message="" + +/datum/dna/gene/disability/can_activate(var/mob/M,var/flags) + return 1 // Always set! + +/datum/dna/gene/disability/activate(var/mob/M, var/connected, var/flags) + if(mutation && !(mutation in M.mutations)) + M.mutations.Add(mutation) + if(disability) + M.disabilities|=disability + if(sdisability) + M.sdisabilities|=sdisability + if(activation_message) + M << "\red [activation_message]" + +/datum/dna/gene/disability/deactivate(var/mob/M, var/connected, var/flags) + if(mutation && (mutation in M.mutations)) + M.mutations.Remove(mutation) + if(disability) + M.disabilities &= ~disability + if(sdisability) + M.sdisabilities &= ~sdisability + if(deactivation_message) + M << "\red [deactivation_message]" + +// Note: Doesn't seem to do squat, at the moment. +/datum/dna/gene/disability/hallucinate + name="Hallucinate" + activation_message="Your mind says 'Hello'." + mutation=mHallucination + + New() + block=HALLUCINATIONBLOCK + +/datum/dna/gene/disability/epilepsy + name="Epilepsy" + activation_message="You get a headache." + disability=EPILEPSY + + New() + block=HEADACHEBLOCK + +/datum/dna/gene/disability/cough + name="Coughing" + activation_message="You start coughing." + disability=COUGHING + + New() + block=COUGHBLOCK + +/datum/dna/gene/disability/clumsy + name="Clumsiness" + activation_message="You feel lightheaded." + mutation=CLUMSY + + New() + block=CLUMSYBLOCK + +/datum/dna/gene/disability/tourettes + name="Tourettes" + activation_message="You twitch." + disability=TOURETTES + + New() + block=TWITCHBLOCK + +/datum/dna/gene/disability/nervousness + name="Nervousness" + activation_message="You feel nervous." + disability=NERVOUS + + New() + block=NERVOUSBLOCK + +/datum/dna/gene/disability/blindness + name="Blindness" + activation_message="You can't seem to see anything." + sdisability=BLIND + + New() + block=BLINDBLOCK + +/datum/dna/gene/disability/deaf + name="Deafness" + activation_message="It's kinda quiet." + sdisability=DEAF + + New() + block=DEAFBLOCK + + activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.ear_deaf = 1 + +/datum/dna/gene/disability/nearsighted + name="Nearsightedness" + activation_message="Your eyes feel weird..." + disability=NEARSIGHTED + + New() + block=GLASSESBLOCK \ No newline at end of file diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm new file mode 100644 index 00000000000..3bf5b5e5f75 --- /dev/null +++ b/code/game/dna/genes/gene.dm @@ -0,0 +1,88 @@ +/** +* Gene Datum +* +* domutcheck was getting pretty hairy. This is the solution. +* +* All genes are stored in a global variable to cut down on memory +* usage. +* +* @author N3X15 +*/ + +/datum/dna/gene + // Display name + var/name="BASE GENE" + + // Probably won't get used but why the fuck not + var/desc="Oh god who knows what this does." + + // Set in initialize()! + // What gene activates this? + var/block=0 + + // Any of a number of GENE_ flags. + var/flags=0 + +// Return 1 if we can activate. +// HANDLE MUTCHK_FORCED HERE! +/datum/dna/gene/proc/can_activate(var/mob/M, var/flags) + return 0 + +// Called when the gene activates. Do your magic here. +/datum/dna/gene/proc/activate(var/mob/M, var/connected, var/flags) + return + +// Called when the gene deactivates. Undo your magic here. +// Only called when the block is deactivated. +/datum/dna/gene/proc/deactivate(var/mob/M, var/connected, var/flags) + return + + +///////////////////// +// BASIC GENES +// +// These just chuck in a mutation and display a message. +// +// Gene is activated: +// 1. If mutation already exists in mob +// 2. If the probability roll succeeds +// 3. Activation is forced (done in domutcheck) +///////////////////// + + +/datum/dna/gene/basic + name="BASIC GENE" + + // Mutation to give + var/mutation=0 + + // Activation probability + var/activation_prob=45 + + // Possible activation messages + var/list/activation_messages=list() + + // Possible deactivation messages + var/list/deactivation_messages=list() + +/datum/dna/gene/basic/can_activate(var/mob/M,var/flags) + if(mutation==0) + return 0 + + // Probability check + if(flags & MUTCHK_FORCED || probinj(activation_prob,(flags&MUTCHK_FORCED))) + return 1 + + return 0 + +/datum/dna/gene/basic/activate(var/mob/M) + M.mutations.Add(mutation) + if(activation_messages.len) + var/msg = pick(activation_messages) + M << "\blue [msg]" + +/datum/dna/gene/basic/deactivate(var/mob/M) + M.mutations.Remove(mutation) + if(deactivation_messages.len) + var/msg = pick(deactivation_messages) + M << "\red [msg]" \ No newline at end of file diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm new file mode 100644 index 00000000000..952f7df0f48 --- /dev/null +++ b/code/game/dna/genes/monkey.dm @@ -0,0 +1,170 @@ +/datum/dna/gene/monkey + name="Monkey" + +/datum/dna/gene/monkey/New() + block=MONKEYBLOCK + +/datum/dna/gene/monkey/can_activate(var/mob/M,var/flags) + return istype(M, /mob/living/carbon/human) || istype(M,/mob/living/carbon/monkey) + +/datum/dna/gene/monkey/activate(var/mob/living/M, var/connected, var/flags) + if(!istype(M,/mob/living/carbon/human)) + return + var/mob/living/carbon/human/H = M + H.monkeyizing = 1 + var/list/implants = list() //Try to preserve implants. + for(var/obj/item/weapon/implant/W in H) + implants += W + W.loc = null + + if(!connected) + for(var/obj/item/W in (H.contents-implants)) + if (W==H.w_uniform) // will be teared + continue + H.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("h2monkey", animation) + sleep(48) + del(animation) + + + var/mob/living/carbon/monkey/O = null + if(H.species.primitive) + O = new H.species.primitive(src) + else + H.gib() //Trying to change the species of a creature with no primitive var set is messy. + return + + if(M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + + for(var/obj/T in (M.contents-implants)) + del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the cute little monkey + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6)) + O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss() + 20) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + O.a_intent = "hurt" + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return + +/datum/dna/gene/monkey/deactivate(var/mob/living/M, var/connected, var/flags) + if(!istype(M,/mob/living/carbon/monkey)) + return + var/mob/living/carbon/monkey/Mo = M + Mo.monkeyizing = 1 + var/list/implants = list() //Still preserving implants + for(var/obj/item/weapon/implant/W in Mo) + implants += W + W.loc = null + if(!connected) + for(var/obj/item/W in (Mo.contents-implants)) + Mo.drop_from_inventory(W) + M.monkeyizing = 1 + M.canmove = 0 + M.icon = null + M.invisibility = 101 + var/atom/movable/overlay/animation = new( M.loc ) + animation.icon_state = "blank" + animation.icon = 'icons/mob/mob.dmi' + animation.master = src + flick("monkey2h", animation) + sleep(48) + del(animation) + + var/mob/living/carbon/human/O = new( src ) + if(Mo.greaterform) + O.set_species(Mo.greaterform) + + if (M.dna.GetUIState(DNA_UI_GENDER)) + O.gender = FEMALE + else + O.gender = MALE + + if (M) + if (M.dna) + O.dna = M.dna + M.dna = null + + if (M.suiciding) + O.suiciding = M.suiciding + M.suiciding = null + + for(var/datum/disease/D in M.viruses) + O.viruses += D + D.affected_mob = O + M.viruses -= D + + //for(var/obj/T in M) + // del(T) + + O.loc = M.loc + + if(M.mind) + M.mind.transfer_to(O) //transfer our mind to the human + + if (connected) //inside dna thing + var/obj/machinery/dna_scannernew/C = connected + O.loc = C + C.occupant = O + connected = null + + var/i + while (!i) + var/randomname + if (O.gender == MALE) + randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names))) + else + randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names))) + if (findname(randomname)) + continue + else + O.real_name = randomname + i++ + O.UpdateAppearance() + O.take_overall_damage(M.getBruteLoss(), M.getFireLoss()) + O.adjustToxLoss(M.getToxLoss()) + O.adjustOxyLoss(M.getOxyLoss()) + O.stat = M.stat + for (var/obj/item/weapon/implant/I in implants) + I.loc = O + I.implanted = O +// O.update_icon = 1 //queue a full icon update at next life() call + del(M) + return \ No newline at end of file diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm new file mode 100644 index 00000000000..a8a9eefee7d --- /dev/null +++ b/code/game/dna/genes/powers.dm @@ -0,0 +1,167 @@ +/////////////////////////////////// +// POWERS +/////////////////////////////////// + +/datum/dna/gene/basic/nobreath + name="No Breathing" + activation_messages=list("You feel no need to breathe.") + mutation=mNobreath + + New() + block=NOBREATHBLOCK + +/datum/dna/gene/basic/remoteview + name="Remote Viewing" + activation_messages=list("Your mind expands.") + mutation=mRemote + + New() + block=REMOTEVIEWBLOCK + + activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.verbs += /mob/living/carbon/human/proc/remoteobserve + +/datum/dna/gene/basic/regenerate + name="Regenerate" + activation_messages=list("You feel better.") + mutation=mRegen + + New() + block=REGENERATEBLOCK + +/datum/dna/gene/basic/increaserun + name="Super Speed" + activation_messages=list("Your leg muscles pulsate.") + mutation=mRun + + New() + block=INCREASERUNBLOCK + +/datum/dna/gene/basic/remotetalk + name="Telepathy" + activation_messages=list("You expand your mind outwards.") + mutation=mRemotetalk + + New() + block=REMOTETALKBLOCK + + activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.verbs += /mob/living/carbon/human/proc/remotesay + +/datum/dna/gene/basic/morph + name="Morph" + activation_messages=list("Your skin feels strange.") + mutation=mMorph + + New() + block=MORPHBLOCK + + activate(var/mob/M) + ..(M) + M.verbs += /mob/living/carbon/human/proc/morph + +/* Not used on bay +/datum/dna/gene/basic/heat_resist + name="Heat Resistance" + activation_messages=list("Your skin is icy to the touch.") + mutation=mHeatres + + New() + block=COLDBLOCK + + can_activate(var/mob/M,var/flags) + // Probability check + var/_prob = 15 + if(COLD_RESISTANCE in M.mutations) + _prob=5 + if(probinj(_prob,(flags&MUTCHK_FORCED))) + return 1 +*/ + +/datum/dna/gene/basic/cold_resist + name="Cold Resistance" + activation_messages=list("Your body is filled with warmth.") + mutation=COLD_RESISTANCE + + New() + block=FIREBLOCK + + can_activate(var/mob/M,var/flags) + + // Probability check + var/_prob=30 + //if(mHeatres in M.mutations) + // _prob=5 + if(probinj(_prob,(flags&MUTCHK_FORCED))) + return 1 + +/datum/dna/gene/basic/noprints + name="No Prints" + activation_messages=list("Your fingers feel numb.") + mutation=mFingerprints + + New() + block=NOPRINTSBLOCK + +/datum/dna/gene/basic/noshock + name="Shock Immunity" + activation_messages=list("Your skin feels strange.") + mutation=mShock + + New() + block=SHOCKIMMUNITYBLOCK + +/datum/dna/gene/basic/midget + name="Midget" + activation_messages=list("Your skin feels rubbery.") + mutation=mSmallsize + + New() + block=SMALLSIZEBLOCK + + can_activate(var/mob/M,var/flags) + // Can't be big and small. + if(HULK in M.mutations) + return 0 + return ..(M,flags) + + activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.pass_flags |= 1 + + deactivate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.pass_flags &= ~1 //This may cause issues down the track, but offhand I can't think of any other way for humans to get passtable short of varediting so it should be fine. ~Z + +/datum/dna/gene/basic/hulk + name="Hulk" + activation_messages=list("Your muscles hurt.") + mutation=HULK + + New() + block=HULKBLOCK + + can_activate(var/mob/M,var/flags) + // Can't be big and small. + if(mSmallsize in M.mutations) + return 0 + return ..(M,flags) + +/datum/dna/gene/basic/xray + name="X-Ray Vision" + activation_messages=list("The walls suddenly disappear.") + mutation=XRAY + + New() + block=XRAYBLOCK + +/datum/dna/gene/basic/tk + name="Telekenesis" + activation_messages=list("You feel smarter.") + mutation=TK + activation_prob=15 + + New() + block=TELEBLOCK \ No newline at end of file diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index e66aed88b87..a552ac1cd74 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -187,7 +187,7 @@ src.dna = chosen_dna src.real_name = chosen_dna.real_name src.flavor_text = "" - updateappearance(src, src.dna.uni_identity) + src.UpdateAppearance() domutcheck(src, null) src.verbs -= /mob/proc/changeling_transform @@ -205,6 +205,10 @@ var/datum/changeling/changeling = changeling_power(1,0,0) if(!changeling) return + if(src.has_brain_worms()) + src << "We cannot perform this ability at the present time!" + return + var/mob/living/carbon/C = src changeling.chem_charges-- C.remove_changeling_powers() @@ -314,7 +318,7 @@ W.layer = initial(W.layer) var/mob/living/carbon/human/O = new /mob/living/carbon/human( src ) - if (isblockon(getblock(C.dna.uni_identity, 11,3),11)) + if (C.dna.GetUIState(DNA_UI_GENDER)) O.gender = FEMALE else O.gender = MALE @@ -327,7 +331,7 @@ O.loc = C.loc - updateappearance(O,O.dna.uni_identity) + O.UpdateAppearance() domutcheck(O, null) O.setToxLoss(C.getToxLoss()) O.adjustBruteLoss(C.getBruteLoss()) @@ -370,24 +374,24 @@ if(changeling_power(20,1,100,DEAD)) // charge the changeling chemical cost for stasis changeling.chem_charges -= 20 - + // restore us to health C.rejuvenate() - + // remove our fake death flag C.status_flags &= ~(FAKEDEATH) - + // let us move again C.update_canmove() - + // re-add out changeling powers - C.make_changeling() - + C.make_changeling() + // sending display messages C << "We have regenerated." C.visible_message("[src] appears to wake from the dead, having healed all wounds.") - - + + feedback_add_details("changeling_powers","FD") return 1 @@ -719,7 +723,7 @@ var/list/datum/dna/hivemind_bank = list() T.visible_message("[T] transforms!") T.dna = chosen_dna T.real_name = chosen_dna.real_name - updateappearance(T, T.dna.uni_identity) + T.UpdateAppearance() domutcheck(T, null) feedback_add_details("changeling_powers","TS") return 1 diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index b9f68fb143c..5b1b1494b59 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -163,8 +163,8 @@ continue var/datum/disease/dnaspread/D = new D.strain_data["name"] = H.real_name - D.strain_data["UI"] = H.dna.uni_identity - D.strain_data["SE"] = H.dna.struc_enzymes + D.strain_data["UI"] = H.dna.UI + D.strain_data["SE"] = H.dna.SE D.carrier = 1 D.holder = H D.affected_mob = H diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index be688554147..f9a237b083d 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -209,9 +209,7 @@ synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform) synd_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(synd_mob), slot_shoes) - synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(synd_mob), slot_wear_suit) synd_mob.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(synd_mob), slot_gloves) - synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(synd_mob), slot_head) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/card/id/syndicate(synd_mob), slot_wear_id) if(synd_mob.backbag == 2) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(synd_mob), slot_back) if(synd_mob.backbag == 3) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(synd_mob), slot_back) @@ -221,6 +219,26 @@ synd_mob.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), slot_in_backpack) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/c20r(synd_mob), slot_belt) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(synd_mob.back), slot_in_backpack) + + if(synd_mob.species) + var/race = synd_mob.species.name + + if(race == "Unathi") + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/unathi(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/unathi(synd_mob), slot_head) + else if(race == "Tajaran") + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/tajara(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/tajara(synd_mob), slot_head) + else if(race == "Skrell") + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/skrell(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/skrell(synd_mob), slot_head) + else + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/human(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/human(synd_mob), slot_head) + else + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi/human(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi/human(synd_mob), slot_head) + var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob) E.imp_in = synd_mob E.implanted = 1 diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 53d90a7e98c..813bbbabf2c 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -1,10 +1,27 @@ +///////////////////////// +// (mostly) DNA2 SETUP +///////////////////////// + +// Randomize block, assign a reference name, and optionally define difficulty (by making activation zone smaller or bigger) +// The name is used on /vg/ for species with predefined genetic traits, +// and for the DNA panel in the player panel. +/proc/getAssignedBlock(var/name,var/list/blocksLeft, var/activity_bounds=DNA_DEFAULT_BOUNDS) + var/assigned = pick(blocksLeft) + blocksLeft.Remove(assigned) + assigned_blocks[assigned]=name + dna_activity_bounds[assigned]=activity_bounds + //testing("[name] assigned to block #[assigned].") + return assigned + /proc/setupgenetics() if (prob(50)) + // Currently unused. Will revisit. - N3X BLOCKADD = rand(-300,300) if (prob(75)) DIFFMUT = rand(0,20) + /* Old, for reference (so I don't accidentally activate something) - N3X var/list/avnums = new/list() var/tempnum @@ -41,11 +58,62 @@ tempnum = pick(avnums) avnums.Remove(tempnum) BLINDBLOCK = tempnum + */ + var/list/numsToAssign=new() + for(var/i=1;i