mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-23 13:18:09 +01:00
[MIRROR] Adds Trait Genetics (#10142)
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Cameron Lennox
Kashargul
parent
d81e145924
commit
7bfffc808d
+23
-11
@@ -141,15 +141,33 @@ var/global/floorIsLava = 0
|
||||
body += "<br><br>"
|
||||
body += "<b>DNA Blocks:</b><br><table border='0'><tr><th> </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
|
||||
send_ooc_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]") // CHOMPEdit
|
||||
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,12 +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))
|
||||
/* CHOMP Edit: the entire world doesn't need to know.
|
||||
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()
|
||||
|
||||
@@ -617,7 +617,7 @@
|
||||
if(istype(M, /mob/living/carbon))
|
||||
M.dna.SetSEState(block,!M.dna.GetSEState(block))
|
||||
domutcheck(M,null,MUTCHK_FORCED)
|
||||
M.update_mutations()
|
||||
M.UpdateAppearance()
|
||||
var/state="[M.dna.GetSEState(block)?"on":"off"]"
|
||||
var/blockname=assigned_blocks[block]
|
||||
message_admins("[key_name_admin(src)] has toggled [M.key]'s [blockname] block [state]!")
|
||||
|
||||
@@ -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,7 +515,9 @@ 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()
|
||||
new_character.initialize_vessel()
|
||||
if(inhabit)
|
||||
new_character.key = player_key
|
||||
//Were they any particular special role? If so, copy.
|
||||
@@ -527,11 +527,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]
|
||||
@@ -555,7 +553,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 +698,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 +726,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 +752,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 +853,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 +910,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) //CHOMPEdit - Uncommented this.
|
||||
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 +921,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 +950,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|R_FUN)) return // CHOMPstation edit: Lets anyone cancel the shuttle.
|
||||
if(!check_rights(R_ADMIN|R_FUN)) return
|
||||
|
||||
if(tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return
|
||||
|
||||
@@ -973,7 +971,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 +1027,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)
|
||||
|
||||
Reference in New Issue
Block a user