Adds Trait Genetics (#16921)

* Adds Trait Genetics from Outpost21

Adds trait genetics from Outpost 21
- Tried to update each file it touched to be equivalent to their Chomp specific variants in order to maintain functionality and make sure no oddities would happen due to code differences. (Some things like the eardeaf loop were left there but commented out)

* Morph trait

* Fixes a server crashing bug with flip

aa

* flip

* Makes morph superpower better

- Makes it use the appearance_changer instead of 1000 different  procs

- Makes cocoon weaver able to change eye and skin color.

I did NOT select you. BAD

* begone

* fix dna modifier

* Fixes massive memory leak

* Brain Runtime Fix

* There was no reason for this to be a spawn(0)

And no I didn't spawn with no blood - https://i.imgur.com/vPizqCD.png

* revert

revert the dna changes there

* Deconf

* gets rid of unused proc vars that did nothing

* expects enough free slots

* glob

* fixed and added two other tests

* another few tests

* this is a list

* fixed bad injector

* lets wrap these for sanity

* better feedback

* wrong name

* don't allow multiple occupants into the dna pod

* future traits will have activation levels instead of binary on/off

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Willburd <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-02-11 02:01:27 -05:00
committed by GitHub
co-authored by Kashargul Willburd
parent 408b765def
commit cdafe425a5
108 changed files with 3805 additions and 2014 deletions
+23 -9
View File
@@ -141,15 +141,33 @@ var/global/floorIsLava = 0
body += "<br><br>"
body += "<b>DNA Blocks:</b><br><table border='0'><tr><th>&nbsp;</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th>"
var/bname
for(var/block=1;block<=DNA_SE_LENGTH;block++)
var/list/output_list = list()
// Traitgenes more reliable way to check gene states
for(var/setup_block=1;setup_block<=DNA_SE_LENGTH;setup_block++)
output_list["[setup_block]"] = null
for(var/datum/gene/gene in GLOB.dna_genes) // Traitgenes Genes accessible by global VV. Removed /dna/ from path
output_list["[gene.block]"] = gene
for(var/block=1;block<=DNA_SE_LENGTH;block++) // Traitgenes more reliable way to check gene states
var/datum/gene/gene = output_list["[block]"] // Traitgenes Removed /dna/ from path
if(((block-1)%5)==0)
body += "</tr><tr><th>[block-1]</th>"
bname = assigned_blocks[block]
// Traitgenes more reliable way to check gene states
if(gene)
bname = gene.name
else
bname = ""
body += "<td>"
if(bname)
var/bstate=M.dna.GetSEState(block)
var/bstate=(bname in M.active_genes) // Traitgenes more reliable way to check gene states
// Traitgenes show trait linked names on mouseover
var/tname = bname
if(istype(gene,/datum/gene/trait))
var/datum/gene/trait/T = gene
tname = T.get_name()
var/bcolor="[(bstate)?"#006600":"#ff0000"]"
body += "<A href='byond://?src=\ref[src];[HrefToken()];togmutate=\ref[M];block=[block]' style='color:[bcolor];'>[bname]</A><sub>[block]</sub>"
if(!bstate && M.dna.GetSEState(block)) // Gene isn't active, but the dna says it is... Was blocked by another gene!
bcolor="#d88d00"
body += "<A href='byond://?src=\ref[src];[HrefToken()];togmutate=\ref[M];block=[block]' style='color:[bcolor];' title='[tname]'>[bname]</A><sub>[block]</sub>" // Traitgenes edit - show trait linked names on mouseover
else
body += "[block]"
body+="</td>"
@@ -627,7 +645,7 @@ var/global/floorIsLava = 0
if(!check_rights(R_SERVER,0))
message = sanitize(message, 500, extra = 0)
message = replacetext(message, "\n", "<br>") // required since we're putting it in a <p> tag
to_world(span_notice(span_bold("[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:") + "<p style='text-indent: 50px'>[message]</p>"))
send_ooc_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]")
log_admin("Announce: [key_name(usr)] : [message]")
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -903,10 +921,6 @@ var/datum/announcement/minor/admin_min_announcer = new
set desc="Whether persistent data will be saved from now on."
set name="Toggle Persistent Data"
CONFIG_SET(flag/persistence_disabled, !CONFIG_GET(flag/persistence_disabled))
if(!CONFIG_GET(flag/persistence_disabled))
to_world(span_world("Persistence is now enabled."))
else
to_world(span_world("Persistence is no longer enabled."))
message_admins(span_blue("[key_name_admin(usr)] toggled persistence to [CONFIG_GET(flag/persistence_disabled) ? "Off" : "On"]."), 1)
log_admin("[key_name(usr)] toggled persistence to [CONFIG_GET(flag/persistence_disabled) ? "Off" : "On"].")
world.update_status()
+15 -19
View File
@@ -9,8 +9,8 @@
return
for(var/obj/item/W in M)
if(istype(W, /obj/item/implant/backup) || istype(W, /obj/item/nif)) //VOREStation Edit - There's basically no reason to remove either of these
continue //VOREStation Edit
if(istype(W, /obj/item/implant/backup) || istype(W, /obj/item/nif)) //There's basically no reason to remove either of these
continue
M.drop_from_inventory(W)
log_admin("[key_name(usr)] made [key_name(M)] drop everything!")
@@ -432,8 +432,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
if(samejob == "Yes")
charjob = record_found.fields["real_rank"]
else if(samejob == JOB_ALT_VISITOR) //VOREStation Edit - Visitor not Assistant
charjob = JOB_ALT_VISITOR //VOREStation Edit - Visitor not Assistant
else if(samejob == JOB_ALT_VISITOR)
charjob = JOB_ALT_VISITOR
else
records = tgui_alert(src,"No data core entry detected. Would you like add them to the manifest, and sec/med/HR records?","Records",list("No", "Yes", "Cancel"))
if(!records || records == "Cancel")
@@ -465,10 +465,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
//For logging later
var/admin = key_name_admin(src)
var/player_key = picked_client.key
//VOREStation Add - Needed for persistence
var/picked_ckey = picked_client.ckey
var/picked_slot = picked_client.prefs.default_slot
//VOREStation Add End
var/mob/living/carbon/human/new_character
var/spawnloc
@@ -517,6 +515,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
picked_client.prefs.copy_to(new_character)
if(new_character.dna)
new_character.dna.ResetUIFrom(new_character)
new_character.sync_dna_traits(TRUE) // Traitgenes Sync traits to genetics if needed
new_character.sync_organ_dna()
if(inhabit)
new_character.key = player_key
@@ -527,11 +526,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
antag_data.add_antagonist(new_character.mind)
antag_data.place_mob(new_character)
//VOREStation Add - Required for persistence
if(new_character.mind)
new_character.mind.loaded_from_ckey = picked_ckey
new_character.mind.loaded_from_slot = picked_slot
//VOREStation Add End
for(var/lang in picked_client.prefs.alternate_languages)
var/datum/language/chosen_language = GLOB.all_languages[lang]
@@ -546,7 +543,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(new_character.mind)
new_character.mind.assigned_role = charjob
new_character.mind.role_alt_title = job_master.GetPlayerAltTitle(new_character, charjob)
//equip_custom_items(new_character) //VOREStation Removal
//If desired, add records.
if(records)
@@ -555,7 +551,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
//A redraw for good measure
new_character.regenerate_icons()
new_character.update_transform() //VOREStation Edit
new_character.update_transform()
//If we're announcing their arrival
if(announce)
@@ -700,7 +696,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Fun.Do Not"
set name = "Explosion"
if(!check_rights(R_DEBUG|R_FUN)) return //VOREStation Edit
if(!check_rights(R_DEBUG|R_FUN)) return
var/devastation = tgui_input_number(usr, "Range of total devastation. -1 to none", text("Input"), min_value=-1)
if(devastation == null) return
@@ -728,7 +724,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Fun.Do Not"
set name = "EM Pulse"
if(!check_rights(R_DEBUG|R_FUN)) return //VOREStation Edit
if(!check_rights(R_DEBUG|R_FUN)) return
var/heavy = tgui_input_number(usr, "Range of heavy pulse.", text("Input"))
if(heavy == null) return
@@ -754,7 +750,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Fun.Do Not"
set name = "Gib"
if(!check_rights(R_ADMIN|R_FUN)) return //VOREStation Edit
if(!check_rights(R_ADMIN|R_FUN)) return
var/confirm = tgui_alert(src, "You sure?", "Confirm", list("Yes", "No"))
if(confirm != "Yes") return
@@ -855,7 +851,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
/client/proc/cmd_admin_check_contents(mob/living/M as mob in mob_list)
set category = "Admin.Investigate"
set name = "Check Contents"
set popup_menu = FALSE //VOREStation Edit - Declutter.
set popup_menu = FALSE
if(!holder)
return
@@ -912,7 +908,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
mob.set_viewsize(view)
log_admin("[key_name(usr)] changed their view range to [view].")
//message_admins("<font color='blue'>[key_name_admin(usr)] changed their view range to [view].</font>", 1) //why? removed by order of XSI
message_admins("<font color='blue'>[key_name_admin(usr)] changed their view range to [view].</font>", 1)
feedback_add_details("admin_verb","CVRA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -923,7 +919,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if ((!( ticker ) || !emergency_shuttle.location()))
return
if(!check_rights(R_ADMIN)) return //VOREStation Edit
if(!check_rights(R_ADMIN)) return
var/confirm = tgui_alert(src, "You sure?", "Confirm", list("Yes", "No"))
if(confirm != "Yes") return
@@ -952,7 +948,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Admin.Events"
set name = "Cancel Shuttle"
if(!check_rights(R_ADMIN)) return //VOREStation Edit
if(!check_rights(R_ADMIN|R_FUN)) return
if(tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return
@@ -973,7 +969,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if (!ticker)
return
if(!check_rights(R_ADMIN)) return //VOREStation Edit
if(!check_rights(R_ADMIN)) return
emergency_shuttle.deny_shuttle = !emergency_shuttle.deny_shuttle
@@ -1029,7 +1025,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set name = "Toggle random events on/off"
set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off"
if(!check_rights(R_SERVER)) return //VOREStation Edit
if(!check_rights(R_SERVER)) return
if(!CONFIG_GET(flag/allow_random_events))
CONFIG_SET(flag/allow_random_events, TRUE)