Merge branch 'master' into upstream-merge-36242
This commit is contained in:
@@ -43,6 +43,9 @@
|
||||
|
||||
/datum/brain_trauma/mild/dumbness/on_gain()
|
||||
owner.add_trait(TRAIT_DUMB, TRAUMA_TRAIT)
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
|
||||
if(mood)
|
||||
mood.add_event("dumb", /datum/mood_event/oblivious)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/dumbness/on_life()
|
||||
@@ -56,6 +59,9 @@
|
||||
/datum/brain_trauma/mild/dumbness/on_lose()
|
||||
owner.remove_trait(TRAIT_DUMB, TRAUMA_TRAIT)
|
||||
owner.derpspeech = 0
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
|
||||
if(mood)
|
||||
mood.clear_event("dumb")
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/speech_impediment
|
||||
@@ -211,4 +217,4 @@
|
||||
to_chat(owner, "<span class='warning'>Your arm spasms!</span>")
|
||||
log_attack("[key_name(owner)] threw [I] due to a Muscle Spasm.")
|
||||
owner.throw_item(pick(targets))
|
||||
..()
|
||||
..()
|
||||
|
||||
+21
-17
@@ -223,25 +223,27 @@
|
||||
/datum/browser/modal/listpicker
|
||||
var/valueslist = list()
|
||||
|
||||
/datum/browser/modal/listpicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/values,inputtype="checkbox")
|
||||
/datum/browser/modal/listpicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/values,inputtype="checkbox", width, height, slidecolor)
|
||||
if (!User)
|
||||
return
|
||||
|
||||
var/output = {"<form><input type="hidden" name="src" value="[REF(src)]"><ul class="sparse">"}
|
||||
|
||||
if (inputtype == "checkbox" || inputtype == "radio")
|
||||
for (var/i in values)
|
||||
var/div_slider = slidecolor
|
||||
if(!i["allowed_edit"])
|
||||
div_slider = "locked"
|
||||
output += {"<li>
|
||||
<label class="switch">
|
||||
<input type="[inputtype]" value="1" name="[i["name"]]"[i["checked"] ? " checked" : ""]>
|
||||
<div class="slider"></div>
|
||||
<span>[i["name"]]</span>
|
||||
</label>
|
||||
</li>"}
|
||||
<label class="switch">
|
||||
<input type="[inputtype]" value="1" name="[i["name"]]"[i["checked"] ? " checked" : ""][i["allowed_edit"] ? "" : " onclick='return false' onkeydown='return false'"]>
|
||||
<div class="slider [div_slider ? "[div_slider]" : ""]"></div>
|
||||
<span>[i["name"]]</span>
|
||||
</label>
|
||||
</li>"}
|
||||
else
|
||||
for (var/i in values)
|
||||
output += {"<li><input id="name="[i["name"]]"" style="width: 50px" type="[type]" name="[i["name"]]" value="[i["value"]]">
|
||||
<label for="[i["name"]]">[i["name"]]</label></li>"}
|
||||
<label for="[i["name"]]">[i["name"]]</label></li>"}
|
||||
output += {"</ul><div style="text-align:center">
|
||||
<button type="submit" name="button" value="1" style="font-size:large;float:[( Button2 ? "left" : "right" )]">[Button1]</button>"}
|
||||
|
||||
@@ -252,7 +254,7 @@
|
||||
output += {"<button type="submit" name="button" value="3" style="font-size:large;float:right">[Button3]</button>"}
|
||||
|
||||
output += {"</form></div>"}
|
||||
..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 350, src, StealFocus, Timeout)
|
||||
..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, width, height, src, StealFocus, Timeout)
|
||||
set_content(output)
|
||||
|
||||
/datum/browser/modal/listpicker/Topic(href,href_list)
|
||||
@@ -272,30 +274,32 @@
|
||||
opentime = 0
|
||||
close()
|
||||
|
||||
/proc/presentpicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/values, inputtype = "checkbox")
|
||||
/proc/presentpicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/values, inputtype = "checkbox", width, height, slidecolor)
|
||||
if (!istype(User))
|
||||
if (istype(User, /client/))
|
||||
var/client/C = User
|
||||
User = C.mob
|
||||
else
|
||||
return
|
||||
var/datum/browser/modal/listpicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, values, inputtype)
|
||||
var/datum/browser/modal/listpicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, values, inputtype, width, height, slidecolor)
|
||||
A.open()
|
||||
A.wait()
|
||||
if (A.selectedbutton)
|
||||
return list("button" = A.selectedbutton, "values" = A.valueslist)
|
||||
|
||||
/proc/input_bitfield(var/mob/User, title, bitfield, current_value)
|
||||
/proc/input_bitfield(var/mob/User, title, bitfield, current_value, nwidth = 350, nheight = 350, nslidecolor, allowed_edit_list = null)
|
||||
if (!User || !(bitfield in GLOB.bitfields))
|
||||
return
|
||||
var/list/pickerlist = list()
|
||||
for (var/i in GLOB.bitfields[bitfield])
|
||||
var/can_edit = 1
|
||||
if(!isnull(allowed_edit_list) && !(allowed_edit_list & GLOB.bitfields[bitfield][i]))
|
||||
can_edit = 0
|
||||
if (current_value & GLOB.bitfields[bitfield][i])
|
||||
pickerlist += list(list("checked" = 1, "value" = GLOB.bitfields[bitfield][i], "name" = i))
|
||||
pickerlist += list(list("checked" = 1, "value" = GLOB.bitfields[bitfield][i], "name" = i, "allowed_edit" = can_edit))
|
||||
else
|
||||
pickerlist += list(list("checked" = 0, "value" = GLOB.bitfields[bitfield][i], "name" = i))
|
||||
var/list/result = presentpicker(User, "", title, Button1="Save", Button2 = "Cancel", Timeout=FALSE, values = pickerlist)
|
||||
|
||||
pickerlist += list(list("checked" = 0, "value" = GLOB.bitfields[bitfield][i], "name" = i, "allowed_edit" = can_edit))
|
||||
var/list/result = presentpicker(User, "", title, Button1="Save", Button2 = "Cancel", Timeout=FALSE, values = pickerlist, width = nwidth, height = nheight, slidecolor = nslidecolor)
|
||||
if (islist(result))
|
||||
if (result["button"] == 2) // If the user pressed the cancel button
|
||||
return
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/datum/component/mood
|
||||
var/mood //Real happiness
|
||||
var/shown_mood //Shown happiness, this is what others can see when they try to examine you, prevents antag checking by noticing traitors are always very happy.
|
||||
var/mood_level //To track what stage of moodies they're on
|
||||
var/mood_modifier = 1 //Modifier to allow certain mobs to be less affected by moodlets
|
||||
var/datum/mood_event/list/mood_events = list()
|
||||
var/mob/living/owner
|
||||
|
||||
/datum/component/mood/Initialize()
|
||||
if(!isliving(parent))
|
||||
. = COMPONENT_INCOMPATIBLE
|
||||
CRASH("Some good for nothing loser put a mood component on something that isn't even a living mob.")
|
||||
START_PROCESSING(SSmood, src)
|
||||
owner = parent
|
||||
|
||||
/datum/component/mood/Destroy()
|
||||
STOP_PROCESSING(SSmood, src)
|
||||
return ..()
|
||||
|
||||
/datum/component/mood/proc/print_mood()
|
||||
var/msg = "<span class='info'>*---------*\n<EM>Your current mood</EM>\n"
|
||||
for(var/i in mood_events)
|
||||
var/datum/mood_event/event = mood_events[i]
|
||||
msg += event.description
|
||||
to_chat(owner, msg)
|
||||
|
||||
/datum/component/mood/proc/update_mood() //Called whenever a mood event is added or removed
|
||||
mood = 0
|
||||
shown_mood = 0
|
||||
for(var/i in mood_events)
|
||||
var/datum/mood_event/event = mood_events[i]
|
||||
mood += event.mood_change
|
||||
if(!event.hidden)
|
||||
shown_mood += event.mood_change
|
||||
mood *= mood_modifier
|
||||
shown_mood *= mood_modifier
|
||||
|
||||
switch(mood)
|
||||
if(-INFINITY to MOOD_LEVEL_SAD4)
|
||||
mood_level = 1
|
||||
if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
|
||||
mood_level = 2
|
||||
if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
|
||||
mood_level = 3
|
||||
if(MOOD_LEVEL_SAD2 to MOOD_LEVEL_SAD1)
|
||||
mood_level = 4
|
||||
if(MOOD_LEVEL_SAD1 to MOOD_LEVEL_HAPPY1)
|
||||
mood_level = 5
|
||||
if(MOOD_LEVEL_HAPPY1 to MOOD_LEVEL_HAPPY2)
|
||||
mood_level = 6
|
||||
if(MOOD_LEVEL_HAPPY2 to MOOD_LEVEL_HAPPY3)
|
||||
mood_level = 7
|
||||
if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4)
|
||||
mood_level = 8
|
||||
if(MOOD_LEVEL_HAPPY4 to INFINITY)
|
||||
mood_level = 9
|
||||
|
||||
if(owner.client && owner.hud_used)
|
||||
owner.hud_used.mood.icon_state = "mood[mood_level]"
|
||||
|
||||
/datum/component/mood/process() //Called on SSmood process
|
||||
switch(mood)
|
||||
if(-INFINITY to MOOD_LEVEL_SAD4)
|
||||
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 3)
|
||||
if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
|
||||
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 2)
|
||||
if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
|
||||
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 1)
|
||||
if(MOOD_LEVEL_SAD2 to INFINITY)
|
||||
owner.clear_fullscreen("depression")
|
||||
|
||||
if(owner.has_trait(TRAIT_DEPRESSION))
|
||||
if(prob(0.1))
|
||||
add_event("depression", /datum/mood_event/depression)
|
||||
clear_event("jolly")
|
||||
if(owner.has_trait(TRAIT_JOLLY))
|
||||
if(prob(0.1))
|
||||
add_event("jolly", /datum/mood_event/jolly)
|
||||
clear_event("depression")
|
||||
|
||||
/datum/component/mood/proc/add_event(category, type, param) //Category will override any events in the same category, should be unique unless the event is based on the same thing like hunger.
|
||||
var/datum/mood_event/the_event
|
||||
if(mood_events[category])
|
||||
the_event = mood_events[category]
|
||||
if(the_event.type != type)
|
||||
clear_event(category)
|
||||
return .()
|
||||
else
|
||||
return 0 //Don't have to update the event.
|
||||
else
|
||||
the_event = new type(src, param)
|
||||
|
||||
mood_events[category] = the_event
|
||||
update_mood()
|
||||
|
||||
if(the_event.timeout)
|
||||
addtimer(CALLBACK(src, .proc/clear_event, category), the_event.timeout)
|
||||
|
||||
/datum/component/mood/proc/clear_event(category)
|
||||
var/datum/mood_event/event = mood_events[category]
|
||||
if(!event)
|
||||
return 0
|
||||
|
||||
mood_events -= category
|
||||
qdel(event)
|
||||
update_mood()
|
||||
|
||||
/datum/component/mood/proc/update_beauty(var/area/A)
|
||||
if(A.outdoors) //if we're outside, we don't care.
|
||||
clear_event("area_beauty")
|
||||
return FALSE
|
||||
switch(A.beauty)
|
||||
if(-INFINITY to BEAUTY_LEVEL_HORRID)
|
||||
add_event("area_beauty", /datum/mood_event/disgustingroom)
|
||||
if(BEAUTY_LEVEL_HORRID to BEAUTY_LEVEL_BAD)
|
||||
add_event("area_beauty", /datum/mood_event/grossroom)
|
||||
if(BEAUTY_LEVEL_BAD to BEAUTY_LEVEL_GOOD)
|
||||
clear_event("area_beauty")
|
||||
if(BEAUTY_LEVEL_GOOD to BEAUTY_LEVEL_GREAT)
|
||||
add_event("area_beauty", /datum/mood_event/niceroom)
|
||||
if(BEAUTY_LEVEL_GREAT to INFINITY)
|
||||
add_event("area_beauty", /datum/mood_event/greatroom)
|
||||
@@ -1,59 +1,62 @@
|
||||
//Thing meant for allowing datums and objects to access a NTnet network datum.
|
||||
/datum/proc/ntnet_recieve(datum/netdata/data)
|
||||
return
|
||||
|
||||
/datum/proc/ntnet_send(datum/netdata/data, netid)
|
||||
GET_COMPONENT(NIC, /datum/component/ntnet_interface)
|
||||
if(!NIC)
|
||||
return FALSE
|
||||
return NIC.__network_send(data, netid)
|
||||
|
||||
/datum/component/ntnet_interface
|
||||
var/hardware_id //text
|
||||
var/network_name = "" //text
|
||||
var/list/networks_connected_by_id = list() //id = datum/ntnet
|
||||
|
||||
/datum/component/ntnet_interface/Initialize(force_ID, force_name = "NTNet Device", autoconnect_station_network = TRUE) //Don't force ID unless you know what you're doing!
|
||||
if(!force_ID)
|
||||
hardware_id = "[SSnetworks.assignment_hardware_id++]"
|
||||
else
|
||||
hardware_id = force_ID
|
||||
network_name = force_name
|
||||
SSnetworks.register_interface(src)
|
||||
if(autoconnect_station_network)
|
||||
register_connection(SSnetworks.station_network)
|
||||
|
||||
/datum/component/ntnet_interface/Destroy()
|
||||
unregister_all_connections()
|
||||
SSnetworks.unregister_interface(src)
|
||||
return ..()
|
||||
|
||||
/datum/component/ntnet_interface/proc/__network_recieve(datum/netdata/data) //Do not directly proccall!
|
||||
parent.SendSignal(COMSIG_COMPONENT_NTNET_RECIEVE, data)
|
||||
parent.ntnet_recieve(data)
|
||||
|
||||
/datum/component/ntnet_interface/proc/__network_send(datum/netdata/data, netid) //Do not directly proccall!
|
||||
if(netid)
|
||||
if(networks_connected_by_id[netid])
|
||||
var/datum/ntnet/net = networks_connected_by_id[netid]
|
||||
return net.process_data_transmit(src, data)
|
||||
return FALSE
|
||||
for(var/i in networks_connected_by_id)
|
||||
var/datum/ntnet/net = networks_connected_by_id[i]
|
||||
net.process_data_transmit(src, data)
|
||||
return TRUE
|
||||
|
||||
/datum/component/ntnet_interface/proc/register_connection(datum/ntnet/net)
|
||||
if(net.interface_connect(src))
|
||||
networks_connected_by_id[net.network_id] = net
|
||||
return TRUE
|
||||
|
||||
/datum/component/ntnet_interface/proc/unregister_all_connections()
|
||||
for(var/i in networks_connected_by_id)
|
||||
unregister_connection(networks_connected_by_id[i])
|
||||
return TRUE
|
||||
|
||||
/datum/component/ntnet_interface/proc/unregister_connection(datum/ntnet/net)
|
||||
net.interface_disconnect(src)
|
||||
networks_connected_by_id -= net.network_id
|
||||
return TRUE
|
||||
//Thing meant for allowing datums and objects to access a NTnet network datum.
|
||||
/datum/proc/ntnet_recieve(datum/netdata/data)
|
||||
return
|
||||
|
||||
/datum/proc/ntnet_send(datum/netdata/data, netid)
|
||||
GET_COMPONENT(NIC, /datum/component/ntnet_interface)
|
||||
if(!NIC)
|
||||
return FALSE
|
||||
return NIC.__network_send(data, netid)
|
||||
|
||||
/datum/component/ntnet_interface
|
||||
var/hardware_id //text
|
||||
var/network_name = "" //text
|
||||
var/list/networks_connected_by_id = list() //id = datum/ntnet
|
||||
|
||||
/datum/component/ntnet_interface/Initialize(force_ID, force_name = "NTNet Device", autoconnect_station_network = TRUE) //Don't force ID unless you know what you're doing!
|
||||
if(!force_ID)
|
||||
hardware_id = "[SSnetworks.assignment_hardware_id++]"
|
||||
else
|
||||
hardware_id = force_ID
|
||||
network_name = force_name
|
||||
SSnetworks.register_interface(src)
|
||||
if(autoconnect_station_network)
|
||||
register_connection(SSnetworks.station_network)
|
||||
|
||||
/datum/component/ntnet_interface/Destroy()
|
||||
unregister_all_connections()
|
||||
SSnetworks.unregister_interface(src)
|
||||
return ..()
|
||||
|
||||
/datum/component/ntnet_interface/proc/__network_recieve(datum/netdata/data) //Do not directly proccall!
|
||||
parent.SendSignal(COMSIG_COMPONENT_NTNET_RECIEVE, data)
|
||||
parent.ntnet_recieve(data)
|
||||
|
||||
/datum/component/ntnet_interface/proc/__network_send(datum/netdata/data, netid) //Do not directly proccall!
|
||||
// Process data before sending it
|
||||
data.pre_send(src)
|
||||
|
||||
if(netid)
|
||||
if(networks_connected_by_id[netid])
|
||||
var/datum/ntnet/net = networks_connected_by_id[netid]
|
||||
return net.process_data_transmit(src, data)
|
||||
return FALSE
|
||||
for(var/i in networks_connected_by_id)
|
||||
var/datum/ntnet/net = networks_connected_by_id[i]
|
||||
net.process_data_transmit(src, data)
|
||||
return TRUE
|
||||
|
||||
/datum/component/ntnet_interface/proc/register_connection(datum/ntnet/net)
|
||||
if(net.interface_connect(src))
|
||||
networks_connected_by_id[net.network_id] = net
|
||||
return TRUE
|
||||
|
||||
/datum/component/ntnet_interface/proc/unregister_all_connections()
|
||||
for(var/i in networks_connected_by_id)
|
||||
unregister_connection(networks_connected_by_id[i])
|
||||
return TRUE
|
||||
|
||||
/datum/component/ntnet_interface/proc/unregister_connection(datum/ntnet/net)
|
||||
net.interface_disconnect(src)
|
||||
networks_connected_by_id -= net.network_id
|
||||
return TRUE
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
//Proc to use when you 100% want to try to infect someone (ignoreing protective clothing and such), as long as they aren't immune
|
||||
/mob/living/proc/ForceContractDisease(datum/disease/D, make_copy = TRUE, del_on_fail = FALSE)
|
||||
if(!CanContractDisease(D))
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
A.symptoms += S.Copy()
|
||||
A.properties = properties.Copy()
|
||||
A.id = id
|
||||
A.mutable = mutable
|
||||
//this is a new disease starting over at stage 1, so processing is not copied
|
||||
return A
|
||||
|
||||
@@ -166,13 +167,10 @@
|
||||
|
||||
var/the_id = GetDiseaseID()
|
||||
if(!SSdisease.archive_diseases[the_id])
|
||||
if(new_name)
|
||||
AssignName()
|
||||
SSdisease.archive_diseases[the_id] = src // So we don't infinite loop
|
||||
SSdisease.archive_diseases[the_id] = Copy()
|
||||
|
||||
var/datum/disease/advance/A = SSdisease.archive_diseases[the_id]
|
||||
name = A.name
|
||||
if(new_name)
|
||||
AssignName()
|
||||
|
||||
//Generate disease properties based on the effects. Returns an associated list.
|
||||
/datum/disease/advance/proc/GenerateProperties()
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
var/map_file = "BoxStation.dmm"
|
||||
|
||||
var/traits = null
|
||||
var/space_ruin_levels = 7
|
||||
var/space_empty_levels = 1
|
||||
|
||||
var/minetype = "lavaland"
|
||||
|
||||
@@ -106,6 +108,20 @@
|
||||
log_world("map_config traits is not a list!")
|
||||
return
|
||||
|
||||
var/temp = json["space_ruin_levels"]
|
||||
if (isnum(temp))
|
||||
space_ruin_levels = temp
|
||||
else if (!isnull(temp))
|
||||
log_world("map_config space_ruin_levels is not a number!")
|
||||
return
|
||||
|
||||
temp = json["space_empty_levels"]
|
||||
if (isnum(temp))
|
||||
space_empty_levels = temp
|
||||
else if (!isnull(temp))
|
||||
log_world("map_config space_empty_levels is not a number!")
|
||||
return
|
||||
|
||||
if ("minetype" in json)
|
||||
minetype = json["minetype"]
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/datum/martial_art/mushpunch
|
||||
name = "Mushroom Punch"
|
||||
|
||||
/datum/martial_art/mushpunch/basic_hit(mob/living/carbon/human/A, mob/living/carbon/human/D)
|
||||
var/atk_verb
|
||||
to_chat(A, "<span class='spider'>You begin to wind up an attack...</span>")
|
||||
if(do_after(A, 25, target = D))
|
||||
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
|
||||
atk_verb = pick("punches", "smashes", "ruptures", "cracks")
|
||||
D.visible_message("<span class='danger'>[A] [atk_verb] [D] with inhuman strength, sending [D.p_them()] flying backwards!</span>", \
|
||||
"<span class='userdanger'>[A] [atk_verb] you with inhuman strength, sending you flying backwards!</span>")
|
||||
D.apply_damage(rand(15,30), BRUTE)
|
||||
playsound(get_turf(D), 'sound/effects/meteorimpact.ogg', 25, 1, -1)
|
||||
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
|
||||
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
|
||||
D.Knockdown(20)
|
||||
if(atk_verb)
|
||||
add_logs(A, D, "[atk_verb] (Mushroom Punch)")
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/mushpunch
|
||||
name = "mysterious mushroom"
|
||||
desc = "<I>Sapienza Ophioglossoides</I>:An odd mushroom from the flesh of a mushroom person. it has apparently retained some innate power of it's owner, as it quivers with barely-contained POWER!"
|
||||
icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
|
||||
icon_state = "mycelium-angel"
|
||||
|
||||
/obj/item/mushpunch/attack_self(mob/living/carbon/human/user)
|
||||
if(!istype(user) || !user)
|
||||
return
|
||||
var/message = "<span class='spider'>You devour [src], and a confluence of skill and power from the mushroom enhances your punches! You do need a short moment to charge these powerful punches.</span>"
|
||||
to_chat(user, message)
|
||||
var/datum/martial_art/mushpunch/mush = new(null)
|
||||
mush.teach(user)
|
||||
qdel(src)
|
||||
visible_message("<span class='warning'>[user] devours [src].</span>")
|
||||
@@ -0,0 +1,39 @@
|
||||
/datum/mood_event/drugs/high
|
||||
mood_change = 6
|
||||
description = "<span class='nicegreen'>Woooow duudeeeeee...I'm tripping baaalls...</span>\n"
|
||||
|
||||
/datum/mood_event/drugs/smoked
|
||||
description = "<span class='nicegreen'>I have had a smoke recently.</span>\n"
|
||||
mood_change = 2
|
||||
timeout = 3600
|
||||
|
||||
/datum/mood_event/drugs/overdose
|
||||
mood_change = -8
|
||||
timeout = 3000
|
||||
|
||||
/datum/mood_event/drugs/overdose/add_effects(drug_name)
|
||||
description = "<span class='warning'>I think I took a bit too much of that [drug_name]</span>\n"
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_light
|
||||
mood_change = -2
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_light/add_effects(drug_name)
|
||||
description = "<span class='warning'>I could use some [drug_name]</span>\n"
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_medium
|
||||
mood_change = -5
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_medium/add_effects(drug_name)
|
||||
description = "<span class='warning'>I really need [drug_name]</span>\n"
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_severe
|
||||
mood_change = -8
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_severe/add_effects(drug_name)
|
||||
description = "<span class='boldwarning'>Oh god I need some [drug_name]</span>\n"
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_critical
|
||||
mood_change = -10
|
||||
|
||||
/datum/mood_event/drugs/withdrawal_critical/add_effects(drug_name)
|
||||
description = "<span class='boldwarning'>[drug_name]! [drug_name]! [drug_name]!</span>\n"
|
||||
@@ -0,0 +1,71 @@
|
||||
/datum/mood_event/hug
|
||||
description = "<span class='nicegreen'>Hugs are nice.</span>\n"
|
||||
mood_change = 1
|
||||
timeout = 1200
|
||||
|
||||
/datum/mood_event/arcade
|
||||
description = "<span class='nicegreen'>I beat the arcade game!</span>\n"
|
||||
mood_change = 3
|
||||
timeout = 3000
|
||||
|
||||
/datum/mood_event/blessing
|
||||
description = "<span class='nicegreen'>I've been blessed.</span>\n"
|
||||
mood_change = 3
|
||||
timeout = 3000
|
||||
|
||||
/datum/mood_event/book_nerd
|
||||
description = "<span class='nicegreen'>I have recently read a book.</span>\n"
|
||||
mood_change = 3
|
||||
timeout = 3000
|
||||
|
||||
/datum/mood_event/pet_corgi
|
||||
description = "<span class='nicegreen'>Corgis are adorable! I can't stop petting them!</span>\n"
|
||||
mood_change = 3
|
||||
timeout = 3000
|
||||
|
||||
/datum/mood_event/honk
|
||||
description = "<span class='nicegreen'>Maybe clowns aren't so bad after all. Honk!</span>\n"
|
||||
mood_change = 2
|
||||
timeout = 2400
|
||||
|
||||
/datum/mood_event/perform_cpr
|
||||
description = "<span class='nicegreen'>It feels good to save a life.</span>\n"
|
||||
mood_change = 6
|
||||
timeout = 3000
|
||||
|
||||
/datum/mood_event/oblivious
|
||||
description = "<span class='nicegreen'>What a lovely day.</span>\n"
|
||||
mood_change = 3
|
||||
|
||||
/datum/mood_event/happytable
|
||||
description = "<span class='nicegreen'>They want to play on the table!</span>\n"
|
||||
mood_change = 2
|
||||
timeout = 1200
|
||||
|
||||
/datum/mood_event/jolly
|
||||
description = "<span class='nicegreen'>I feel happy for no particular reason.</span>\n"
|
||||
mood_change = 6
|
||||
timeout = 1200
|
||||
|
||||
/datum/mood_event/focused
|
||||
description = "<span class='nicegreen'>I have a goal, and I will reach it, whatever it takes!</span>\n" //Used for syndies, nukeops etc so they can focus on their goals
|
||||
mood_change = 12
|
||||
hidden = TRUE
|
||||
|
||||
/datum/mood_event/revolution
|
||||
description = "<span class='nicegreen'>VIVA LA REVOLUTION!</span>\n"
|
||||
mood_change = 3
|
||||
hidden = TRUE
|
||||
|
||||
/datum/mood_event/cult
|
||||
description = "<span class='nicegreen'>I have seen the truth, praise the almighty one!</span>\n"
|
||||
mood_change = 40 //maybe being a cultist isnt that bad after all
|
||||
hidden = TRUE
|
||||
|
||||
/datum/mood_event/niceroom
|
||||
description = "<span class='nicegreen'>This room looks really pretty!</span>\n"
|
||||
mood_change = 4
|
||||
|
||||
/datum/mood_event/greatroom
|
||||
description = "<span class='nicegreen'>This room is beautiful!</span>\n"
|
||||
mood_change = 7
|
||||
@@ -0,0 +1,19 @@
|
||||
/datum/mood_event
|
||||
var/description ///For descriptions, use the span classes bold nicegreen, nicegreen, none, warning and boldwarning in order from great to horrible.
|
||||
var/mood_change = 0
|
||||
var/timeout = 0
|
||||
var/hidden = FALSE//Not shown on examine
|
||||
var/mob/owner
|
||||
|
||||
/datum/mood_event/New(mob/M, param)
|
||||
owner = M
|
||||
add_effects(param)
|
||||
|
||||
/datum/mood_event/Destroy()
|
||||
remove_effects()
|
||||
|
||||
/datum/mood_event/proc/add_effects(param)
|
||||
return
|
||||
|
||||
/datum/mood_event/proc/remove_effects()
|
||||
return
|
||||
@@ -0,0 +1,54 @@
|
||||
//nutrition
|
||||
/datum/mood_event/nutrition/fat
|
||||
description = "<span class='warning'><B>I'm so fat..</B></span>\n" //muh fatshaming
|
||||
mood_change = -4
|
||||
|
||||
/datum/mood_event/nutrition/wellfed
|
||||
description = "<span class='nicegreen'>My belly feels round and full.</span>\n"
|
||||
mood_change = 6
|
||||
|
||||
/datum/mood_event/nutrition/fed
|
||||
description = "<span class='nicegreen'>I have recently had some food.</span>\n"
|
||||
mood_change = 3
|
||||
|
||||
/datum/mood_event/nutrition/hungry
|
||||
description = "<span class='warning'>I'm getting a bit hungry.</span>\n"
|
||||
mood_change = -8
|
||||
|
||||
/datum/mood_event/nutrition/starving
|
||||
description = "<span class='boldwarning'>I'm starving!</span>\n"
|
||||
mood_change = -15
|
||||
|
||||
//Disgust
|
||||
/datum/mood_event/disgust/gross
|
||||
description = "<span class='warning'>I saw something gross.</span>\n"
|
||||
mood_change = -2
|
||||
|
||||
/datum/mood_event/disgust/verygross
|
||||
description = "<span class='warning'>I think I'm going to puke...</span>\n"
|
||||
mood_change = -5
|
||||
|
||||
/datum/mood_event/disgust/disgusted
|
||||
description = "<span class='boldwarning'>Oh god that's disgusting...</span>\n"
|
||||
mood_change = -8
|
||||
|
||||
//Generic needs events
|
||||
/datum/mood_event/favorite_food
|
||||
description = "<span class='nicegreen'>I really enjoyed eating that.</span>\n"
|
||||
mood_change = 3
|
||||
timeout = 2400
|
||||
|
||||
/datum/mood_event/gross_food
|
||||
description = "<span class='nicegreen'>I really didn't like that food.</span>\n"
|
||||
mood_change = -2
|
||||
timeout = 2400
|
||||
|
||||
/datum/mood_event/disgusting_food
|
||||
description = "<span class='nicegreen'>That food was disgusting!</span>\n"
|
||||
mood_change = -4
|
||||
timeout = 2400
|
||||
|
||||
/datum/mood_event/nice_shower
|
||||
description = "<span class='nicegreen'>I have recently had a nice shower.</span>\n"
|
||||
mood_change = 2
|
||||
timeout = 1800
|
||||
@@ -11,6 +11,9 @@
|
||||
owner.visible_message("<span class='danger'>[owner] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
|
||||
owner.Unconscious(200)
|
||||
owner.Jitter(1000)
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
|
||||
if(mood)
|
||||
mood.add_event("epilepsy", /datum/mood_event/epilepsy)
|
||||
addtimer(CALLBACK(src, .proc/jitter_less, owner), 90)
|
||||
|
||||
/datum/mutation/human/epilepsy/proc/jitter_less(mob/living/carbon/human/owner)
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
owner.add_trait(TRAIT_STUNIMMUNE, TRAIT_HULK)
|
||||
owner.add_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK)
|
||||
owner.update_body_parts()
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
|
||||
if(mood)
|
||||
mood.add_event("hulk", /datum/mood_event/hulk)
|
||||
|
||||
/datum/mutation/human/hulk/on_attack_hand(mob/living/carbon/human/owner, atom/target, proximity)
|
||||
if(proximity) //no telekinetic hulk attack
|
||||
@@ -30,7 +33,10 @@
|
||||
owner.remove_trait(TRAIT_STUNIMMUNE, TRAIT_HULK)
|
||||
owner.remove_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK)
|
||||
owner.update_body_parts()
|
||||
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
|
||||
if(mood)
|
||||
mood.clear_event("hulk")
|
||||
|
||||
/datum/mutation/human/hulk/say_mod(message)
|
||||
if(message)
|
||||
message = "[uppertext(replacetext(message, ".", "!"))]!!"
|
||||
|
||||
@@ -85,6 +85,8 @@
|
||||
if(backpack_contents)
|
||||
for(var/path in backpack_contents)
|
||||
var/number = backpack_contents[path]
|
||||
if(!isnum(number))//Default to 1
|
||||
number = 1
|
||||
for(var/i=0,i<number,i++)
|
||||
H.equip_to_slot_or_del(new path(H),slot_in_backpack)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
var/mob_trait //if applicable, apply and remove this mob trait
|
||||
var/mob/living/trait_holder
|
||||
|
||||
/datum/trait/New(mob/living/trait_mob)
|
||||
/datum/trait/New(mob/living/trait_mob, spawn_effects)
|
||||
..()
|
||||
if(!trait_mob || (human_only && !ishuman(trait_mob)) || trait_mob.has_trait_datum(type))
|
||||
qdel(src)
|
||||
@@ -23,9 +23,9 @@
|
||||
trait_holder.add_trait(mob_trait, ROUNDSTART_TRAIT)
|
||||
START_PROCESSING(SStraits, src)
|
||||
add()
|
||||
if(!SSticker.HasRoundStarted()) //on roundstart or on latejoin; latejoin code is in new_player.dm
|
||||
if(spawn_effects)
|
||||
on_spawn()
|
||||
addtimer(CALLBACK(src, .proc/post_add), 30)
|
||||
addtimer(CALLBACK(src, .proc/post_add), 30)
|
||||
|
||||
/datum/trait/Destroy()
|
||||
STOP_PROCESSING(SStraits, src)
|
||||
@@ -38,16 +38,25 @@
|
||||
SStraits.trait_objects -= src
|
||||
return ..()
|
||||
|
||||
/datum/trait/proc/transfer_mob(mob/living/to_mob)
|
||||
trait_holder.roundstart_traits -= src
|
||||
to_mob.roundstart_traits += src
|
||||
trait_holder = to_mob
|
||||
on_transfer()
|
||||
|
||||
/datum/trait/proc/add() //special "on add" effects
|
||||
/datum/trait/proc/on_spawn() //these should only trigger when the character is being created for the first time, i.e. roundstart/latejoin
|
||||
/datum/trait/proc/remove() //special "on remove" effects
|
||||
/datum/trait/proc/on_process() //process() has some special checks, so this is the actual process
|
||||
/datum/trait/proc/post_add() //for text, disclaimers etc. given after you spawn in with the trait
|
||||
/datum/trait/proc/on_transfer() //code called when the trait is transferred to a new mob
|
||||
|
||||
/datum/trait/process()
|
||||
if(QDELETED(trait_holder))
|
||||
qdel(src)
|
||||
return
|
||||
if(trait_holder.stat == DEAD)
|
||||
return
|
||||
on_process()
|
||||
|
||||
/mob/living/proc/get_trait_string(medical) //helper string. gets a string of all the traits the mob has
|
||||
@@ -67,6 +76,16 @@
|
||||
return "None"
|
||||
return dat.Join("<br>")
|
||||
|
||||
/mob/living/proc/cleanse_trait_datums() //removes all trait datums
|
||||
for(var/V in roundstart_traits)
|
||||
var/datum/trait/T = V
|
||||
qdel(T)
|
||||
|
||||
/mob/living/proc/transfer_trait_datums(mob/living/to_mob)
|
||||
for(var/V in roundstart_traits)
|
||||
var/datum/trait/T = V
|
||||
T.transfer_mob(to_mob)
|
||||
|
||||
/*
|
||||
|
||||
Commented version of Nearsighted to help you add your own traits
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
desc = "You walk with a gentle step, making stepping on sharp objects quieter and less painful."
|
||||
value = 1
|
||||
mob_trait = TRAIT_LIGHT_STEP
|
||||
gain_text = "<span class='notice'>You walk with a little more lithenessk.</span>"
|
||||
gain_text = "<span class='notice'>You walk with a little more litheness.</span>"
|
||||
lose_text = "<span class='danger'>You start tromping around like a barbarian.</span>"
|
||||
|
||||
|
||||
@@ -81,3 +81,26 @@
|
||||
mob_trait = TRAIT_VORACIOUS
|
||||
gain_text = "<span class='notice'>You feel HONGRY.</span>"
|
||||
lose_text = "<span class='danger'>You no longer feel HONGRY.</span>"
|
||||
|
||||
|
||||
/datum/trait/jolly
|
||||
name = "Jolly"
|
||||
desc = "You sometimes just feel happy, for no reason at all."
|
||||
value = 1
|
||||
mob_trait = TRAIT_JOLLY
|
||||
|
||||
|
||||
/datum/trait/apathetic
|
||||
name = "Apathetic"
|
||||
desc = "You just don't care as much as other people, that's nice to have in a place like this, I guess."
|
||||
value = 1
|
||||
|
||||
/datum/trait/apathetic/add()
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, trait_holder)
|
||||
if(mood)
|
||||
mood.mood_modifier = 0.8
|
||||
|
||||
/datum/trait/apathetic/remove()
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, trait_holder)
|
||||
if(mood)
|
||||
mood.mood_modifier = 1 //Change this once/if species get their own mood modifiers.
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
if(trait_holder.reagents.has_reagent("mindbreaker"))
|
||||
trait_holder.hallucination = 0
|
||||
return
|
||||
if(prob(1)) //we'll all be mad soon enough
|
||||
if(prob(2)) //we'll all be mad soon enough
|
||||
madness()
|
||||
|
||||
/datum/trait/insanity/proc/madness(mad_fools)
|
||||
@@ -154,3 +154,12 @@
|
||||
else if(prob(0.5) && dumb_thing)
|
||||
to_chat(H, "<span class='danger'>You think of a dumb thing you said a long time ago and scream internally.</span>")
|
||||
dumb_thing = FALSE //only once per life
|
||||
|
||||
/datum/trait/depression
|
||||
name = "Depression"
|
||||
desc = "You sometimes just hate life."
|
||||
mob_trait = TRAIT_DEPRESSION
|
||||
value = -1
|
||||
gain_text = "<span class='danger'>You start feeling depressed.</span>"
|
||||
lose_text = "<span class='notice'>You no longer feel depressed.</span>" //if only it were that easy!
|
||||
medical_record_text = "Patient has a severe mood disorder causing them to experience sudden moments of sadness."
|
||||
|
||||
@@ -48,17 +48,15 @@
|
||||
return
|
||||
if(!A.requiresID() || A.check_access(null))
|
||||
if(A.density)
|
||||
A.open()
|
||||
INVOKE_ASYNC(A, /obj/machinery/door/airlock.proc/open)
|
||||
else
|
||||
A.close()
|
||||
INVOKE_ASYNC(A, /obj/machinery/door/airlock.proc/close)
|
||||
if(WIRE_BOLTS) // Pulse to toggle bolts (but only raise if power is on).
|
||||
if(!A.locked)
|
||||
A.bolt()
|
||||
A.audible_message("<span class='italics'>You hear a click from the bottom of the door.</span>", null, 1)
|
||||
else
|
||||
if(A.hasPower())
|
||||
A.unbolt()
|
||||
A.audible_message("<span class='italics'>You hear a click from the bottom of the door.</span>", null, 1)
|
||||
A.update_icon()
|
||||
if(WIRE_IDSCAN) // Pulse to disable emergency access and flash red lights.
|
||||
if(A.hasPower() && A.density)
|
||||
|
||||
Reference in New Issue
Block a user