mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-12 00:20:55 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -46,6 +46,12 @@
|
||||
|
||||
//begin playsound shenanigans//
|
||||
|
||||
//for big characters, add alittle boom
|
||||
if(LM.size_multiplier > 1.5)
|
||||
var/stompsound = pick( 'sound/effects/footstep/giant1.ogg','sound/effects/footstep/giant2.ogg')
|
||||
var/giantvolume = LM.size_multiplier * 9
|
||||
playsound(T, stompsound, giantvolume)
|
||||
|
||||
//for barefooted non-clawed mobs like monkeys
|
||||
if(isbarefoot(LM))
|
||||
playsound(T, pick(GLOB.barefootstep[T.barefootstep][1]),
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
var/insanity_effect = 0 //is the owner being punished for low mood? If so, how much?
|
||||
var/holdmyinsanityeffect = 0 //before we edit our sanity lets take a look
|
||||
var/obj/screen/mood/screen_obj
|
||||
var/lastupdate = 0
|
||||
|
||||
/datum/component/mood/Initialize()
|
||||
if(!isliving(parent))
|
||||
@@ -91,6 +92,7 @@
|
||||
mood += event.mood_change
|
||||
if(!event.hidden)
|
||||
shown_mood += event.mood_change
|
||||
|
||||
mood *= mood_modifier
|
||||
shown_mood *= mood_modifier
|
||||
|
||||
|
||||
+5
-2
@@ -54,11 +54,12 @@
|
||||
if(ishuman(destination))
|
||||
var/mob/living/carbon/human/H = destination
|
||||
H.give_genitals(TRUE)//This gives the body the genitals of this DNA. Used for any transformations based on DNA
|
||||
destination.flavor_text = destination.dna.features["flavor_text"] //Update the flavor_text to use new dna text
|
||||
destination.ooc_text = destination.dna.features["ooc_text"] //Update the flavor_text to use new dna text
|
||||
if(transfer_SE)
|
||||
destination.dna.mutation_index = mutation_index
|
||||
|
||||
SEND_SIGNAL(destination, COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, src, transfer_SE)
|
||||
|
||||
/datum/dna/proc/copy_dna(datum/dna/new_dna)
|
||||
new_dna.unique_enzymes = unique_enzymes
|
||||
new_dna.mutation_index = mutation_index
|
||||
@@ -356,7 +357,6 @@
|
||||
|
||||
if(newfeatures)
|
||||
dna.features = newfeatures
|
||||
flavor_text = dna.features["flavor_text"] //Update the flavor_text to use new dna text
|
||||
ooc_text = dna.features["ooc_text"] //Update the flavor_text to use new dna text
|
||||
|
||||
if(mrace)
|
||||
@@ -379,6 +379,9 @@
|
||||
dna.mutation_index = mutation_index
|
||||
domutcheck()
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_HUMAN_HARDSET_DNA, ui, newreal_name, newblood_type, mrace, newfeatures)
|
||||
// change to SEND_SIGNAL(src, COMSIG_HUMAN_HARDSET_DNA, ui, se, newreal_name, newblood_type, mrace, newfeatures) if we add structural enzymes.
|
||||
|
||||
if(mrace || newfeatures || ui)
|
||||
update_body()
|
||||
update_hair()
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
|
||||
|
||||
/datum/element/flavor_text
|
||||
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
|
||||
id_arg_index = 3
|
||||
var/flavor_name = "Flavor Text"
|
||||
var/list/texts_by_atom = list()
|
||||
var/addendum = ""
|
||||
var/always_show = FALSE
|
||||
var/max_len = MAX_FLAVOR_LEN
|
||||
var/can_edit = TRUE
|
||||
/// For preference/DNA saving/loading. Null to prevent. Prefs are only loaded from obviously if it exists in preferences.features.
|
||||
var/save_key
|
||||
/// Do not attempt to render a preview on examine. If this is on, it will display as \[flavor_name\]
|
||||
var/examine_no_preview = FALSE
|
||||
var/examineTabOutput = ""
|
||||
|
||||
/datum/element/flavor_text/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key, _examine_no_preview = FALSE)
|
||||
. = ..()
|
||||
|
||||
if(. == ELEMENT_INCOMPATIBLE || !isatom(target)) //no reason why this shouldn't work on atoms too.
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
if(_max_len)
|
||||
max_len = _max_len
|
||||
texts_by_atom[target] = copytext(text, 1, max_len)
|
||||
if(_name)
|
||||
flavor_name = _name
|
||||
if(!isnull(addendum))
|
||||
addendum = _addendum
|
||||
always_show = _always_show
|
||||
can_edit = _edit
|
||||
save_key = _save_key
|
||||
examine_no_preview = _examine_no_preview
|
||||
|
||||
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/show_flavor)
|
||||
|
||||
if(can_edit && ismob(target)) //but only mobs receive the proc/verb for the time being
|
||||
var/mob/M = target
|
||||
LAZYOR(GLOB.mobs_with_editable_flavor_text[M], src)
|
||||
M.verbs |= /mob/proc/manage_flavor_tests
|
||||
|
||||
if(save_key && ishuman(target))
|
||||
RegisterSignal(target, COMSIG_HUMAN_PREFS_COPIED_TO, .proc/update_prefs_flavor_text)
|
||||
|
||||
/datum/element/flavor_text/Detach(atom/A)
|
||||
. = ..()
|
||||
UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_HUMAN_PREFS_COPIED_TO))
|
||||
texts_by_atom -= A
|
||||
if(can_edit && ismob(A))
|
||||
var/mob/M = A
|
||||
LAZYREMOVE(GLOB.mobs_with_editable_flavor_text[M], src)
|
||||
if(!GLOB.mobs_with_editable_flavor_text[M])
|
||||
GLOB.mobs_with_editable_flavor_text -= M
|
||||
M.verbs -= /mob/proc/manage_flavor_tests
|
||||
|
||||
/datum/element/flavor_text/proc/show_flavor(atom/target, mob/user, list/examine_list)
|
||||
if(!always_show && isliving(target))
|
||||
var/mob/living/L = target
|
||||
var/unknown = L.get_visible_name() == "Unknown"
|
||||
if(!unknown && iscarbon(target))
|
||||
var/mob/living/carbon/C = L
|
||||
unknown = (C.wear_mask && (C.wear_mask.flags_inv & HIDEFACE)) || (C.head && (C.head.flags_inv & HIDEFACE))
|
||||
if(unknown)
|
||||
if(!("...?" in examine_list)) //can't think of anything better in case of multiple flavor texts.
|
||||
examine_list += "...?"
|
||||
return
|
||||
var/text = texts_by_atom[target]
|
||||
if(!text)
|
||||
return
|
||||
if(examine_no_preview)
|
||||
examine_list += "<span class='notice'><a href='?src=[REF(src)];show_flavor=[REF(target)]'>\[[flavor_name]\]</a></span>"
|
||||
return
|
||||
var/msg = replacetext(text, "\n", " ")
|
||||
if(length_char(msg) <= 40)
|
||||
examine_list += "<span class='notice'>[msg]</span>"
|
||||
else
|
||||
examine_list += "<span class='notice'>[copytext_char(msg, 1, 37)]... <a href='?src=[REF(src)];show_flavor=[REF(target)]'>More...</span></a>"
|
||||
|
||||
//Examine Tab stuff - Hyperstation
|
||||
examineTabOutput = "<center>"
|
||||
if(ishuman(target)) //user just returned, y'know, the user's own species. dumb.
|
||||
var/mob/living/carbon/human/L = target
|
||||
if(L.gender)
|
||||
examineTabOutput += "[icon2html('hyperstation/icons/chat/gender.dmi', world, L.gender)]"
|
||||
examineTabOutput += "[L.name] "
|
||||
examineTabOutput += "([L.dna.custom_species ? L.dna.custom_species : L.dna.species.name])"
|
||||
examineTabOutput += "</center>"
|
||||
examineTabOutput += "<br>[url_encode(msg)]"
|
||||
if(ismob(target))
|
||||
var/mob/M = target
|
||||
if(M.ooc_text)
|
||||
examineTabOutput += "<br><br><i><b>OOC</b>"
|
||||
examineTabOutput += "<br>[url_encode(M.ooc_text)]"
|
||||
user.client << output(examineTabOutput, "statbrowser:update_examine") //open the examine window
|
||||
user.client << output(null, "statbrowser:create_mobexamine") //open the examine window
|
||||
|
||||
/datum/element/flavor_text/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(href_list["show_flavor"])
|
||||
var/atom/target = locate(href_list["show_flavor"])
|
||||
var/text = texts_by_atom[target]
|
||||
if(text)
|
||||
usr << browse("<HTML><HEAD><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><TITLE>[target.name]</TITLE></HEAD><BODY><TT>[replacetext(texts_by_atom[target], "\n", "<BR>")]</TT></BODY></HTML>", "window=[target.name];size=500x200")
|
||||
onclose(usr, "[target.name]")
|
||||
return TRUE
|
||||
|
||||
/mob/proc/manage_flavor_tests()
|
||||
set name = "Manage Flavor Texts"
|
||||
set desc = "Used to manage your various flavor texts."
|
||||
set category = "IC"
|
||||
|
||||
var/list/L = GLOB.mobs_with_editable_flavor_text[src]
|
||||
|
||||
if(length(L) == 1)
|
||||
var/datum/element/flavor_text/F = L[1]
|
||||
F.set_flavor(src)
|
||||
return
|
||||
|
||||
var/list/choices = list()
|
||||
|
||||
for(var/i in L)
|
||||
var/datum/element/flavor_text/F = i
|
||||
choices[F.flavor_name] = F
|
||||
|
||||
var/chosen = input(src, "Which flavor text would you like to modify?") as null|anything in choices
|
||||
if(!chosen)
|
||||
return
|
||||
var/datum/element/flavor_text/F = choices[chosen]
|
||||
F.set_flavor(src)
|
||||
|
||||
/datum/element/flavor_text/proc/set_flavor(mob/user)
|
||||
if(!(user in texts_by_atom))
|
||||
return FALSE
|
||||
|
||||
var/lower_name = lowertext(flavor_name)
|
||||
var/new_text = stripped_multiline_input(user, "Set the [lower_name] displayed on 'examine'. [addendum]", flavor_name, html_decode(texts_by_atom[usr]), max_len, TRUE)
|
||||
if(!isnull(new_text) && (user in texts_by_atom))
|
||||
texts_by_atom[user] = new_text
|
||||
to_chat(src, "Your [lower_name] has been updated.")
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/element/flavor_text/proc/update_prefs_flavor_text(mob/living/carbon/human/H, datum/preferences/P, icon_updates = TRUE, roundstart_checks = TRUE)
|
||||
if(P.features.Find(save_key))
|
||||
texts_by_atom[H] = P.features[save_key]
|
||||
|
||||
//subtypes with additional hooks for DNA and preferences.
|
||||
/datum/element/flavor_text/carbon
|
||||
//list of antagonists etcetera that should have nothing to do with people's snowflakes.
|
||||
var/static/list/i_dont_even_know_who_you_are = typecacheof(list(/datum/antagonist/abductor, /datum/antagonist/ert,
|
||||
/datum/antagonist/nukeop, /datum/antagonist/wizard))
|
||||
|
||||
/datum/element/flavor_text/carbon/Attach(datum/target, text = "", _name = "Flavor Text", _addendum, _max_len = MAX_FLAVOR_LEN, _always_show = FALSE, _edit = TRUE, _save_key = "flavor_text", _examine_no_preview = FALSE)
|
||||
if(!iscarbon(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
. = ..()
|
||||
if(. == ELEMENT_INCOMPATIBLE)
|
||||
return
|
||||
RegisterSignal(target, COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, .proc/update_dna_flavor_text)
|
||||
RegisterSignal(target, COMSIG_MOB_ANTAG_ON_GAIN, .proc/on_antag_gain)
|
||||
if(ishuman(target))
|
||||
RegisterSignal(target, COMSIG_HUMAN_HARDSET_DNA, .proc/update_dna_flavor_text)
|
||||
RegisterSignal(target, COMSIG_HUMAN_ON_RANDOMIZE, .proc/unset_flavor)
|
||||
|
||||
/datum/element/flavor_text/carbon/Detach(mob/living/carbon/C)
|
||||
. = ..()
|
||||
UnregisterSignal(C, list(COMSIG_CARBON_IDENTITY_TRANSFERRED_TO, COMSIG_MOB_ANTAG_ON_GAIN, COMSIG_HUMAN_PREFS_COPIED_TO, COMSIG_HUMAN_HARDSET_DNA, COMSIG_HUMAN_ON_RANDOMIZE))
|
||||
|
||||
/datum/element/flavor_text/carbon/proc/update_dna_flavor_text(mob/living/carbon/C)
|
||||
texts_by_atom[C] = C.dna.features[save_key]
|
||||
|
||||
/datum/element/flavor_text/carbon/set_flavor(mob/living/carbon/user)
|
||||
. = ..()
|
||||
if(. && user.dna)
|
||||
user.dna.features[save_key] = texts_by_atom[user]
|
||||
|
||||
/datum/element/flavor_text/carbon/proc/unset_flavor(mob/living/carbon/user)
|
||||
texts_by_atom[user] = ""
|
||||
|
||||
|
||||
/datum/element/flavor_text/carbon/proc/on_antag_gain(mob/living/carbon/user, datum/antagonist/antag)
|
||||
if(is_type_in_typecache(antag, i_dont_even_know_who_you_are))
|
||||
texts_by_atom[user] = ""
|
||||
if(user.dna)
|
||||
user.dna.features[save_key] = ""
|
||||
+34
-37
@@ -39,52 +39,49 @@
|
||||
pre_equip(H, visualsOnly)
|
||||
|
||||
//Start with uniform,suit,backpack for additional slots
|
||||
if(uniform)
|
||||
H.equip_to_slot_or_store_and_del(new uniform(H),SLOT_W_UNIFORM)
|
||||
if(suit)
|
||||
H.equip_to_slot_or_store_and_del(new suit(H),SLOT_WEAR_SUIT)
|
||||
if(back)
|
||||
H.equip_to_slot_or_del(new back(H),SLOT_BACK)
|
||||
|
||||
if(!visualsOnly) // Items in pockets or backpack don't show up on mob's icon.
|
||||
if(l_pocket)
|
||||
H.equip_to_slot_or_store_and_del(new l_pocket(H),SLOT_L_STORE)
|
||||
if(r_pocket)
|
||||
H.equip_to_slot_or_store_and_del(new r_pocket(H),SLOT_R_STORE)
|
||||
if(backpack_contents)
|
||||
if(!visualsOnly && backpack_contents) //Keep things organized when we can't equip other stuff by having this first
|
||||
for(var/path in backpack_contents)
|
||||
var/number = backpack_contents[path]
|
||||
if(!isnum(number))//Default to 1
|
||||
number = 1
|
||||
for(var/i in 1 to number)
|
||||
H.equip_to_slot_or_del(new path(H),SLOT_IN_BACKPACK)
|
||||
if(belt)
|
||||
H.equip_to_slot_or_store_and_del(new belt(H),SLOT_BELT)
|
||||
if(gloves)
|
||||
H.equip_to_slot_or_store_and_del(new gloves(H),SLOT_GLOVES)
|
||||
if(shoes)
|
||||
H.equip_to_slot_or_store_and_del(new shoes(H),SLOT_SHOES)
|
||||
if(head)
|
||||
H.equip_to_slot_or_store_and_del(new head(H),SLOT_HEAD)
|
||||
if(mask)
|
||||
H.equip_to_slot_or_store_and_del(new mask(H),SLOT_WEAR_MASK)
|
||||
if(neck)
|
||||
H.equip_to_slot_or_store_and_del(new neck(H),SLOT_NECK)
|
||||
if(ears)
|
||||
H.equip_to_slot_or_store_and_del(new ears(H),SLOT_EARS)
|
||||
if(glasses)
|
||||
H.equip_to_slot_or_store_and_del(new glasses(H),SLOT_GLASSES)
|
||||
if(id)
|
||||
H.equip_to_slot_or_store_and_del(new id(H),SLOT_WEAR_ID)
|
||||
if(suit_store)
|
||||
H.equip_to_slot_or_store_and_del(new suit_store(H),SLOT_S_STORE)
|
||||
|
||||
if(accessory)
|
||||
var/obj/item/clothing/under/U = H.w_uniform
|
||||
if(U)
|
||||
|
||||
if(uniform)
|
||||
var/obj/item/clothing/under/U = new uniform(H)
|
||||
H.equip_to_slot_or_store(U,SLOT_W_UNIFORM)
|
||||
if(accessory)
|
||||
U.attach_accessory(new accessory(H))
|
||||
else
|
||||
WARNING("Unable to equip accessory [accessory] in outfit [name]. No uniform present!")
|
||||
if(suit)
|
||||
H.equip_to_slot_or_store(new suit(H),SLOT_WEAR_SUIT)
|
||||
|
||||
if(!visualsOnly)
|
||||
if(l_pocket)
|
||||
H.equip_to_slot_or_store(new l_pocket(H),SLOT_L_STORE)
|
||||
if(r_pocket)
|
||||
H.equip_to_slot_or_store(new r_pocket(H),SLOT_R_STORE)
|
||||
if(belt)
|
||||
H.equip_to_slot_or_store(new belt(H),SLOT_BELT)
|
||||
if(gloves)
|
||||
H.equip_to_slot_or_store(new gloves(H),SLOT_GLOVES)
|
||||
if(shoes)
|
||||
H.equip_to_slot_or_store(new shoes(H),SLOT_SHOES)
|
||||
if(head)
|
||||
H.equip_to_slot_or_store(new head(H),SLOT_HEAD)
|
||||
if(mask)
|
||||
H.equip_to_slot_or_store(new mask(H),SLOT_WEAR_MASK)
|
||||
if(neck)
|
||||
H.equip_to_slot_or_store(new neck(H),SLOT_NECK)
|
||||
if(ears)
|
||||
H.equip_to_slot_or_store(new ears(H),SLOT_EARS)
|
||||
if(glasses)
|
||||
H.equip_to_slot_or_store(new glasses(H),SLOT_GLASSES)
|
||||
if(id)
|
||||
H.equip_to_slot_or_store(new id(H),SLOT_WEAR_ID)
|
||||
if(suit_store)
|
||||
H.equip_to_slot_or_store(new suit_store(H),SLOT_S_STORE)
|
||||
|
||||
if(l_hand)
|
||||
H.put_in_l_hand(new l_hand(H))
|
||||
|
||||
@@ -312,3 +312,9 @@
|
||||
suffix = "advancedlab.dmm"
|
||||
name = "Abductor Replication Lab"
|
||||
description = "Some scientists tried and almost succeeded to recreate abductor tools. Somewhat slower and a bit less modern than their originals, these tools are the best you can get if you aren't an alien."
|
||||
|
||||
/datum/map_template/ruin/space/wiz_home
|
||||
id = "wizhome"
|
||||
suffix = "wizardden.dmm"
|
||||
name = "Wizards Cabin"
|
||||
description = "The wooden cabin of a wizard in space, it smells like mana in there."
|
||||
|
||||
Reference in New Issue
Block a user