mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00: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:
committed by
GitHub
parent
d81e145924
commit
7bfffc808d
@@ -1,86 +0,0 @@
|
||||
/**
|
||||
* Sends a div formatted chat box announcement
|
||||
*
|
||||
* Formatted like:
|
||||
*
|
||||
* " Server Announcement " (or sender_override)
|
||||
*
|
||||
* " Title "
|
||||
*
|
||||
* " Text "
|
||||
*
|
||||
* Arguments
|
||||
* * text - required, the text to announce
|
||||
* * title - optional, the title of the announcement.
|
||||
* * players - optional, a list of all players to send the message to. defaults to the entire world
|
||||
* * play_sound - if TRUE, play a sound with the announcement (based on player option)
|
||||
* * sound_override - optional, override the default announcement sound
|
||||
* * sender_override - optional, modifies the sender of the announcement
|
||||
* * encode_title - if TRUE, the title will be HTML encoded (escaped)
|
||||
* * encode_text - if TRUE, the text will be HTML encoded (escaped)
|
||||
*/
|
||||
|
||||
/proc/send_ooc_announcement(
|
||||
text,
|
||||
title = "",
|
||||
players,
|
||||
play_sound = TRUE,
|
||||
sound_override = 'modular_chomp/sound/misc/bloop.ogg',
|
||||
sender_override = "Server Admin Announcement",
|
||||
encode_title = TRUE,
|
||||
encode_text = FALSE,
|
||||
)
|
||||
if(isnull(text))
|
||||
return
|
||||
|
||||
var/list/announcement_strings = list()
|
||||
|
||||
if(encode_title && title && length(title) > 0)
|
||||
title = html_encode(title)
|
||||
if(encode_text)
|
||||
text = html_encode(text)
|
||||
if(!length(text))
|
||||
return
|
||||
|
||||
announcement_strings += span_major_announcement_title(sender_override)
|
||||
announcement_strings += span_subheader_announcement_text(title)
|
||||
announcement_strings += span_ooc_announcement_text(text)
|
||||
var/finalized_announcement = create_ooc_announcement_div(jointext(announcement_strings, ""))
|
||||
|
||||
if(islist(players))
|
||||
for(var/mob/target in players)
|
||||
to_chat(target, finalized_announcement)
|
||||
//if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements))
|
||||
if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
|
||||
SEND_SOUND(target, sound(sound_override))
|
||||
else
|
||||
to_chat(world, finalized_announcement)
|
||||
|
||||
if(!play_sound)
|
||||
return
|
||||
|
||||
for(var/mob/player in player_list)
|
||||
//if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements))
|
||||
if(player.client?.prefs.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
|
||||
SEND_SOUND(player, sound(sound_override))
|
||||
|
||||
/**
|
||||
* Inserts a span styled message into an alert box div
|
||||
*
|
||||
*
|
||||
* Arguments
|
||||
* * message - required, the message contents
|
||||
* * color - optional, set a div color other than default
|
||||
*/
|
||||
/proc/create_announcement_div(message, color = "default")
|
||||
return "<div class='chat_alert_[color]'>[message]</div>"
|
||||
|
||||
/**
|
||||
* Inserts a span styled message into an OOC alert style div
|
||||
*
|
||||
*
|
||||
* Arguments
|
||||
* * message - required, the message contents
|
||||
*/
|
||||
/proc/create_ooc_announcement_div(message)
|
||||
return "<div class='ooc_alert'>[message]</div>"
|
||||
@@ -1,4 +0,0 @@
|
||||
#define span_major_announcement_text(str) ("<span class='major_announcement_text'>" + str + "</span>")
|
||||
#define span_major_announcement_title(str) ("<span class='major_announcement_title'>" + str + "</span>")
|
||||
#define span_ooc_announcement_text(str) ("<span class='ooc_announcement_text'>" + str + "</span>")
|
||||
#define span_subheader_announcement_text(str) ("<span class='subheader_announcement_text'>" + str + "</span>")
|
||||
@@ -1,103 +0,0 @@
|
||||
GLOBAL_LIST_EMPTY(mapped_autostrips)
|
||||
GLOBAL_LIST_EMPTY(mapped_autostrips_mob)
|
||||
|
||||
/*
|
||||
This should actually be refactored if it ever needs to be used again into just being
|
||||
an event controller with more graceful solutions.
|
||||
Creating lockers was not graceful, in practice, and creates clutter, for example.
|
||||
Repurpose this idea into a self contained machine in the future that stores and auto-equips someones gear.
|
||||
|
||||
But for now, for what it's been used for, it works.
|
||||
|
||||
*/
|
||||
|
||||
//Admin tool to automatically strip a human victim of all their equipment and genetics powers, and store them in a closet.
|
||||
//Equips Vox/Zaddat survival gear, and a few basic pieces of clothing
|
||||
/obj/effect/step_trigger/autostrip
|
||||
name = "Autostrip trigger. Set the targetid to match the effect/autostriptarget"
|
||||
var/targetid = "Default"
|
||||
var/obj/effect/autostriptarget/target
|
||||
var/obj/effect/autostriptarget/mob/Mtarget
|
||||
var/remove_implants = 0 //Havn't bothered to implement this yet
|
||||
var/remove_mutations = 0
|
||||
|
||||
/obj/effect/step_trigger/autostrip/Initialize(mapload)
|
||||
. = ..()
|
||||
initMappedLink()
|
||||
|
||||
/obj/effect/step_trigger/autostrip/Trigger(mob/living/carbon/human/H as mob)
|
||||
if(!istype(H))
|
||||
return
|
||||
if(!target)
|
||||
if(!initMappedLink())
|
||||
return
|
||||
if(Mtarget)
|
||||
H.forceMove(Mtarget.loc)
|
||||
var/obj/locker = new /obj/structure/closet/secure_closet/mind(target.loc, mind_target = H.mind)
|
||||
for(var/obj/item/W in H)
|
||||
if(istype(W, /obj/item/implant/backup) || istype(W, /obj/item/nif))
|
||||
continue //VOREStation Edit
|
||||
if(H.drop_from_inventory(W))
|
||||
W.forceMove(locker)
|
||||
|
||||
if(remove_mutations)
|
||||
var/needs_update = H.mutations.len > 0
|
||||
for(var/entry in H.mutations)
|
||||
var/mut
|
||||
switch(entry)
|
||||
if(TK)
|
||||
mut = TELEBLOCK
|
||||
if(XRAY)
|
||||
mut = XRAYBLOCK
|
||||
if(HULK)
|
||||
mut = HULKBLOCK
|
||||
if(mRemotetalk)
|
||||
mut = REMOTETALKBLOCK
|
||||
if(COLD_RESISTANCE)
|
||||
mut = FIREBLOCK
|
||||
if(mut)
|
||||
new /obj/item/dnainjector/safe(locker, block_type = mut)
|
||||
H.dna.SetSEState(mut,0)
|
||||
H.mutations = list()
|
||||
H.disabilities = 0
|
||||
H.sdisabilities = 0
|
||||
if(needs_update)
|
||||
domutcheck(H,null,MUTCHK_FORCED)
|
||||
H.update_mutations()
|
||||
if(H.species.name == SPECIES_VOX || SPECIES_ZADDAT) //Species that 'actually' require survival gear to live. The rest don't.
|
||||
H.species.equip_survival_gear(H)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/chameleon(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(H),slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/radio/headset(H),slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/permit(H), slot_l_hand)
|
||||
|
||||
|
||||
/obj/effect/step_trigger/autostrip/proc/initMappedLink()
|
||||
. = FALSE
|
||||
target = GLOB.mapped_autostrips[targetid]
|
||||
Mtarget = GLOB.mapped_autostrips_mob[targetid]
|
||||
if(target)
|
||||
. = TRUE
|
||||
|
||||
/obj/effect/autostriptarget
|
||||
name = "Autostrip target. Link me via targetid to an autostrip trigger."
|
||||
icon = 'icons/mob/screen1.dmi'
|
||||
icon_state = "no_item1"
|
||||
var/targetid = "Default"
|
||||
unacidable = 1
|
||||
layer = 99
|
||||
anchored = 1
|
||||
invisibility = 99
|
||||
|
||||
|
||||
/obj/effect/autostriptarget/Initialize(mapload)
|
||||
. = ..()
|
||||
if(targetid)
|
||||
GLOB.mapped_autostrips[targetid] = src
|
||||
|
||||
/obj/effect/autostriptarget/mob
|
||||
name = "Autostrip target to send mobs to."
|
||||
|
||||
/obj/effect/autostriptarget/mob/Initialize(mapload)
|
||||
if(targetid)
|
||||
GLOB.mapped_autostrips_mob[targetid] = src
|
||||
@@ -1,46 +0,0 @@
|
||||
//Same as regular injector, but without the radiation
|
||||
//Using for events, set the block to the desired gene
|
||||
//Note, genetics code is incredibly scuffed, sometimes blocks just won't activate unless you do it multiple times????
|
||||
/obj/item/dnainjector/safe
|
||||
desc = "A slightly safer DNA injector"
|
||||
datatype = DNA2_BUF_SE
|
||||
value = 0xFFF
|
||||
|
||||
/obj/item/dnainjector/safe/New(var/block_type)
|
||||
block = block_type
|
||||
..()
|
||||
|
||||
/obj/item/dnainjector/safe/inject(mob/M as mob, mob/user as mob)
|
||||
/*
|
||||
if (!(NOCLONE in M.mutations)) // prevents drained people from having their DNA changed
|
||||
if (buf.types & DNA2_BUF_UI)
|
||||
if (!block) //isolated block?
|
||||
M.UpdateAppearance(buf.dna.UI.Copy())
|
||||
if (buf.types & DNA2_BUF_UE) //unique enzymes? yes
|
||||
M.real_name = buf.dna.real_name
|
||||
M.name = buf.dna.real_name
|
||||
uses--
|
||||
else
|
||||
M.dna.SetUIValue(block,src.GetValue())
|
||||
M.UpdateAppearance()
|
||||
uses--
|
||||
if (buf.types & DNA2_BUF_SE)
|
||||
if (!block) //isolated block?
|
||||
M.dna.SE = buf.dna.SE.Copy()
|
||||
M.dna.UpdateSE()
|
||||
else
|
||||
M.dna.SetSEValue(block,src.GetValue())
|
||||
domutcheck(M, null, block!=null)
|
||||
uses--
|
||||
if(prob(5))
|
||||
trigger_side_effect(M)
|
||||
*/
|
||||
M.dna.SetSEState(block,1)
|
||||
domutcheck(M,null,MUTCHK_FORCED)
|
||||
M.update_mutations()
|
||||
|
||||
spawn(0)//this prevents the collapse of space-time continuum
|
||||
if (user)
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
return uses
|
||||
@@ -1,42 +0,0 @@
|
||||
/obj/structure/closet/secure_closet/mind
|
||||
name = "mind secured locker"
|
||||
var/datum/mind/owner
|
||||
var/self_del = 1
|
||||
anchored = 0
|
||||
|
||||
/obj/structure/closet/secure_closet/mind/New(var/datum/mind/mind_target, var/del_self = 1)
|
||||
.=..()
|
||||
self_del = del_self
|
||||
if(mind_target)
|
||||
owner = mind_target
|
||||
name = "Owned by [owner.name]"
|
||||
if(owner.current)
|
||||
var/icon/I = get_flat_icon(owner.current, dir=SOUTH, no_anim=TRUE)
|
||||
var/image/IM = image(I, pixel_x = (32 - I.Width()))
|
||||
//icon2base64(get_flat_icon(owner.current,dir=SOUTH,no_anim=TRUE))
|
||||
/*
|
||||
I.appearance_flags |= (RESET_COLOR|PIXEL_SCALE)
|
||||
I.plane = MOB_PLANE
|
||||
I.layer = MOB_LAYER
|
||||
*/
|
||||
add_overlay(IM)
|
||||
qdel(I)
|
||||
|
||||
/obj/structure/closet/secure_closet/mind/allowed(mob/user)
|
||||
if(user.mind == owner)
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/structure/closet/secure_closet/mind/open()
|
||||
.=..()
|
||||
if(self_del)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/mind/LateInitialize()
|
||||
if(ispath(closet_appearance))
|
||||
closet_appearance = GLOB.closet_appearances[closet_appearance]
|
||||
if(istype(closet_appearance))
|
||||
icon = closet_appearance.icon
|
||||
color = null
|
||||
update_icon()
|
||||
@@ -1,7 +1,5 @@
|
||||
/mob/living/carbon/human
|
||||
var/gender_change_cooldown = 0 // A cooldown for gender and gender indentify changing procs to make it easy to avoid spam of gender change
|
||||
var/loneliness_stage = 0
|
||||
var/next_loneliness_time = 0
|
||||
var/hide_headset = FALSE
|
||||
var/hide_glasses = FALSE
|
||||
var/speech_sound_enabled = TRUE
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
/datum/species
|
||||
var/crit_mod = 1
|
||||
var/list/env_traits = list()
|
||||
var/photosynthesizing = FALSE
|
||||
var/grows = FALSE
|
||||
var/shrinks = FALSE
|
||||
var/rad_levels = list("safe" = 2.5, "danger_1" = 50, "danger_2" = 75, "danger_3" = 150)
|
||||
var/rad_removal_mod = 1
|
||||
var/bite_mod = 1
|
||||
var/grab_resist_divisor_victims = 1
|
||||
var/grab_resist_divisor_self = 1
|
||||
|
||||
Reference in New Issue
Block a user