Merge remote-tracking branch 'origin/master' into perlin-genny

This commit is contained in:
LetterN
2021-03-20 20:36:56 +08:00
267 changed files with 109865 additions and 107683 deletions
+70 -14
View File
@@ -112,32 +112,87 @@
user_insert(I, user) //, mat_container_flags)
/// Proc used for when player inserts materials
/datum/component/material_container/proc/user_insert(obj/item/I, mob/living/user)
/datum/component/material_container/proc/user_insert(obj/item/I, mob/living/user, datum/component/remote_materials/remote = null)
set waitfor = FALSE
var/requested_amount
var/active_held = user.get_active_held_item() // differs from I when using TK
if(istype(I, /obj/item/stack) && precise_insertion)
var/atom/current_parent = parent
var/inserted = 0
//handle stacks specially
if(istype(I, /obj/item/stack))
var/atom/current_parent = remote ? remote.parent : parent //is the user using a remote materials component?
var/obj/item/stack/S = I
requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null
//try to get ammount to use
var/requested_amount
if(precise_insertion)
requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null
else
requested_amount= S.amount
if(isnull(requested_amount) || (requested_amount <= 0))
return
if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || user.physical_can_use_topic(current_parent) < UI_INTERACTIVE || user.get_active_held_item() != active_held)
if(QDELETED(I) || QDELETED(user) || QDELETED(src) || user.get_active_held_item() != active_held)
return
if(!user.temporarilyRemoveItemFromInventory(I))
to_chat(user, "<span class='warning'>[I] is stuck to you and cannot be placed into [parent].</span>")
return
var/inserted = insert_item(I, stack_amt = requested_amount)//, breakdown_flags= mat_container_flags)
//are we still in range after the user input?
if((remote ? remote.parent : parent) != current_parent || user.physical_can_use_topic(current_parent) < UI_INTERACTIVE)
return
inserted = insert_stack(S, requested_amount)
else
if(!user.temporarilyRemoveItemFromInventory(I))
to_chat(user, "<span class='warning'>[I] is stuck to you and cannot be placed into [parent].</span>")
return
inserted = insert_item(I)
qdel(I)
if(inserted)
to_chat(user, "<span class='notice'>You insert a material total of [inserted] into [parent].</span>")
qdel(I)
if(after_insert)
after_insert.Invoke(I, last_inserted_id, inserted)
else if(I == active_held)
user.put_in_active_hand(I)
if(remote && remote.after_insert)
remote.after_insert.Invoke(I, last_inserted_id, inserted)
//Inserts a number of sheets from a stack, returns the amount of sheets used.
/datum/component/material_container/proc/insert_stack(obj/item/stack/S, amt, multiplier = 1)
if(isnull(amt))
amt = S.amount
if(amt <= 0)
return FALSE
if(amt > S.amount)
amt = S.amount
var/material_amt = get_item_material_amount(S)
if(!material_amt)
return FALSE
//get max number of sheets we have room to add
var/mat_per_sheet = material_amt/S.amount
amt = min(amt, round((max_amount - total_amount) / (mat_per_sheet)))
if(!amt)
return FALSE
//add the mats and keep track of how much was added
var/starting_total = total_amount
for(var/MAT in materials)
materials[MAT] += S.mats_per_unit[MAT] * amt * multiplier
total_amount += S.mats_per_unit[MAT] * amt * multiplier
var/total_added = total_amount - starting_total
//update last_inserted_id with mat making up majority of the stack
var/primary_mat
var/max_mat_value = 0
for(var/MAT in materials)
if(S.mats_per_unit[MAT] > max_mat_value)
max_mat_value = S.mats_per_unit[MAT]
primary_mat = MAT
last_inserted_id = primary_mat
S.use(amt)
return total_added
/// Proc specifically for inserting items, returns the amount of materials entered.
/datum/component/material_container/proc/insert_item(obj/item/I, var/multiplier = 1, stack_amt)
/datum/component/material_container/proc/insert_item(obj/item/I, var/multiplier = 1)
if(QDELETED(I))
return FALSE
@@ -198,6 +253,7 @@
var/total_amount_saved = total_amount
if(mat)
materials[mat] += amt
total_amount += amt
else
for(var/i in materials)
materials[i] += amt
+6
View File
@@ -33,6 +33,8 @@
RegisterSignal(parent, COMSIG_LIVING_REVIVE, .proc/on_revive)
RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/modify_hud)
RegisterSignal(parent, COMSIG_MOB_DEATH, .proc/stop_processing)
RegisterSignal(parent, COMSIG_VOID_MASK_ACT, .proc/direct_sanity_drain)
if(owner.hud_used)
modify_hud()
@@ -377,6 +379,10 @@
remove_temp_moods()
setSanity(initial(sanity))
///Causes direct drain of someone's sanity, call it with a numerical value corresponding how badly you want to hurt their sanity
/datum/component/mood/proc/direct_sanity_drain(datum/source, amount)
setSanity(sanity + amount)
#undef ECSTATIC_SANITY_PEN
#undef SLIGHT_INSANITY_PEN
#undef MINOR_INSANITY_PEN
+5 -3
View File
@@ -15,13 +15,15 @@ handles linking back and forth.
var/category
var/allow_standalone
var/local_size = INFINITY
var/datum/callback/after_insert
/datum/component/remote_materials/Initialize(category, mapload, allow_standalone = TRUE, force_connect = FALSE)
/datum/component/remote_materials/Initialize(category, mapload, allow_standalone = TRUE, force_connect = FALSE, _after_insert)
if (!isatom(parent))
return COMPONENT_INCOMPATIBLE
src.category = category
src.allow_standalone = allow_standalone
after_insert = _after_insert
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
@@ -67,7 +69,7 @@ handles linking back and forth.
/datum/material/plastic,
)
mat_container = parent.AddComponent(/datum/component/material_container, allowed_mats, local_size, allowed_types=/obj/item/stack)
mat_container = parent.AddComponent(/datum/component/material_container, allowed_mats, local_size, allowed_types=/obj/item/stack, _after_insert = after_insert)
/datum/component/remote_materials/proc/set_local_size(size)
local_size = size
@@ -103,7 +105,7 @@ handles linking back and forth.
return COMPONENT_NO_AFTERATTACK
else if(silo && istype(I, /obj/item/stack))
if(silo.remote_attackby(parent, user, I))
if(silo.remote_attackby(parent, user, I, src))
return COMPONENT_NO_AFTERATTACK
/datum/component/remote_materials/proc/on_hold()
@@ -97,3 +97,11 @@
. = ..()
can_hold = typecacheof(list(/obj/item/reagent_containers/glass/bottle,
/obj/item/ammo_box/a762))
/datum/component/storage/concrete/pockets/void_cloak
quickdraw = TRUE
max_items = 3
/datum/component/storage/concrete/pockets/void_cloak/Initialize()
. = ..()
var/static/list/exception_cache = typecacheof(list(/obj/item/living_heart,/obj/item/forbidden_book))
+9
View File
@@ -45,3 +45,12 @@
start_length = 130
end_sound = 'sound/weather/ashstorm/inside/weak_end.ogg'
volume = 30
/datum/looping_sound/void_loop
mid_sounds = list('sound/ambience/VoidsEmbrace.ogg'=1)
mid_length = 1669 // exact length of the music in ticks
volume = 100
extra_range = 30
/datum/looping_sound/void_loop/start(atom/add_thing)
. = ..()
+4 -3
View File
@@ -97,7 +97,7 @@
D.visible_message("<span class='warning'>[A] locks [D] into a restraining position!</span>", \
"<span class='userdanger'>[A] locks you into a restraining position!</span>")
D.apply_damage(damage, STAMINA)
D.Stun(100)
D.Stun(10)
restraining = TRUE
addtimer(VARSET_CALLBACK(src, restraining, FALSE), 50, TIMER_UNIQUE)
return TRUE
@@ -196,7 +196,8 @@
log_combat(A, D, "knocked out (Chokehold)(CQC)")
D.visible_message("<span class='danger'>[A] puts [D] into a chokehold!</span>", \
"<span class='userdanger'>[A] puts you into a chokehold!</span>")
D.SetSleeping(400)
if(D.silent <= 10)
D.silent = clamp(D.silent + 10, 0, 10)
restraining = FALSE
if(A.grab_state < GRAB_NECK)
A.setGrabState(GRAB_NECK)
@@ -213,7 +214,7 @@
to_chat(usr, "<span class='notice'>Slam</span>: Grab Harm. Slam opponent into the ground, knocking them down.")
to_chat(usr, "<span class='notice'>CQC Kick</span>: Harm Harm. Knocks opponent away. Knocks out stunned or knocked down opponents.")
to_chat(usr, "<span class='notice'>Restrain</span>: Grab Grab. Locks opponents into a restraining position, disarm to knock them out with a chokehold.")
to_chat(usr, "<span class='notice'>Restrain</span>: Grab Grab. Locks opponents into a restraining position, disarm to mute them with a chokehold.")
to_chat(usr, "<span class='notice'>Pressure</span>: Disarm Grab. Decent stamina damage.")
to_chat(usr, "<span class='notice'>Consecutive CQC</span>: Disarm Disarm Harm. Mainly offensive move, huge damage and decent stamina damage.")
+3
View File
@@ -34,3 +34,6 @@
/datum/skill_modifier/job/level/wiring/basic
level_mod = JOB_SKILL_BASIC
/datum/skill_modifier/job/level/dwarfy/blacksmithing
target_skills = /datum/skill/level/dwarfy/blacksmithing
+95
View File
@@ -768,3 +768,98 @@
M.dna.species.punchdamagelow -= damageboost
M.dna.species.punchwoundbonus -= woundboost
to_chat(M, "<span class='notice'>You calm yourself, and your unnatural strength dissipates.</span>")
/datum/status_effect/crucible_soul
id = "Blessing of Crucible Soul"
status_type = STATUS_EFFECT_REFRESH
duration = 15 SECONDS
examine_text = "<span class='notice'>They don't seem to be all here.</span>"
alert_type = /obj/screen/alert/status_effect/crucible_soul
var/turf/location
/datum/status_effect/crucible_soul/on_apply()
. = ..()
to_chat(owner,"<span class='notice'>You phase through reality, nothing is out of bounds!</span>")
owner.alpha = 180
owner.pass_flags |= PASSCLOSEDTURF | PASSGLASS | PASSGRILLE | PASSTABLE | PASSMOB
location = get_turf(owner)
/datum/status_effect/crucible_soul/on_remove()
to_chat(owner,"<span class='notice'>You regain your physicality, returning you to your original location...</span>")
owner.alpha = initial(owner.alpha)
owner.pass_flags &= ~(PASSCLOSEDTURF | PASSGLASS | PASSGRILLE | PASSTABLE | PASSMOB)
owner.forceMove(location)
location = null
return ..()
/datum/status_effect/duskndawn
id = "Blessing of Dusk and Dawn"
status_type = STATUS_EFFECT_REFRESH
duration = 60 SECONDS
alert_type =/obj/screen/alert/status_effect/duskndawn
/datum/status_effect/duskndawn/on_apply()
. = ..()
ADD_TRAIT(owner,TRAIT_XRAY_VISION,type)
owner.update_sight()
/datum/status_effect/duskndawn/on_remove()
REMOVE_TRAIT(owner,TRAIT_XRAY_VISION,type)
owner.update_sight()
return ..()
/datum/status_effect/marshal
id = "Blessing of Wounded Soldier"
status_type = STATUS_EFFECT_REFRESH
duration = 60 SECONDS
tick_interval = 1 SECONDS
alert_type = /obj/screen/alert/status_effect/marshal
/datum/status_effect/marshal/on_apply()
. = ..()
ADD_TRAIT(owner,TRAIT_IGNOREDAMAGESLOWDOWN,type)
/datum/status_effect/marshal/on_remove()
. = ..()
REMOVE_TRAIT(owner,TRAIT_IGNOREDAMAGESLOWDOWN,type)
/datum/status_effect/marshal/tick()
. = ..()
if(!iscarbon(owner))
return
var/mob/living/carbon/carbie = owner
for(var/BP in carbie.bodyparts)
var/obj/item/bodypart/part = BP
for(var/W in part.wounds)
var/datum/wound/wound = W
var/heal_amt = 0
switch(wound.severity)
if(WOUND_SEVERITY_MODERATE)
heal_amt = 1
if(WOUND_SEVERITY_SEVERE)
heal_amt = 3
if(WOUND_SEVERITY_CRITICAL)
heal_amt = 6
if(wound.wound_type == WOUND_BURN)
carbie.adjustFireLoss(-heal_amt)
else
carbie.adjustBruteLoss(-heal_amt)
carbie.blood_volume += carbie.blood_volume >= BLOOD_VOLUME_NORMAL ? 0 : heal_amt*3
/obj/screen/alert/status_effect/crucible_soul
name = "Blessing of Crucible Soul"
desc = "You phased through the reality, you are halfway to your final destination..."
icon_state = "crucible"
/obj/screen/alert/status_effect/duskndawn
name = "Blessing of Dusk and Dawn"
desc = "Many things hide beyond the horizon, with Owl's help i managed to slip past sun's guard and moon's watch."
icon_state = "duskndawn"
/obj/screen/alert/status_effect/marshal
name = "Blessing of Wounded Soldier"
desc = "Some people seek power through redemption, one thing many people don't know is that battle is the ultimate redemption and wounds let you bask in eternal glory."
icon_state = "wounded_soldier"
+34 -2
View File
@@ -117,6 +117,12 @@
desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are."
icon_state = "asleep"
/datum/status_effect/grouped/stasis
id = "stasis"
duration = -1
tick_interval = 10
var/last_dead_time
/datum/status_effect/no_combat_mode
id = "no_combat_mode"
alert_type = null
@@ -498,6 +504,32 @@
I.take_damage(100)
return ..()
/datum/status_effect/eldritch/void
id = "void_mark"
effect_sprite = "emark4"
/datum/status_effect/eldritch/void/on_effect()
var/turf/open/turfie = get_turf(owner)
turfie.TakeTemperature(-40)
owner.adjust_bodytemperature(-60)
return ..()
/datum/status_effect/domain
id = "domain"
alert_type = null
var/movespeed_mod = /datum/movespeed_modifier/status_effect/domain
/datum/status_effect/domain/on_creation(mob/living/new_owner, set_duration)
if(isliving(owner))
var/mob/living/carbon/C = owner
C.add_movespeed_modifier(movespeed_mod)
/datum/status_effect/electrode/on_remove()
if(isliving(owner))
var/mob/living/carbon/C = owner
C.remove_movespeed_modifier(movespeed_mod)
. = ..()
/datum/status_effect/corrosion_curse
id = "corrosion_curse"
status_type = STATUS_EFFECT_REPLACE
@@ -506,7 +538,7 @@
/datum/status_effect/corrosion_curse/on_creation(mob/living/new_owner, ...)
. = ..()
to_chat(owner, "<span class='danger'>Your feel your body starting to break apart...</span>")
to_chat(owner, "<span class='danger'>You feel your body starting to break apart...</span>")
/datum/status_effect/corrosion_curse/tick()
. = ..()
@@ -577,7 +609,7 @@
/datum/status_effect/amok/on_apply(mob/living/afflicted)
. = ..()
to_chat(owner, "<span class='boldwarning'>Your feel filled with a rage that is not your own!</span>")
to_chat(owner, "<span class='boldwarning'>You feel filled with a rage that is not your own!</span>")
/datum/status_effect/amok/tick()
. = ..()
-16
View File
@@ -219,19 +219,3 @@
/datum/quirk/night_vision/on_spawn()
var/mob/living/carbon/human/H = quirk_holder
H.update_sight()
/datum/quirk/multilingual
name = "Multi-Lingual"
desc = "You spent a portion of your life learning to understand an additional language. You may or may not be able to speak it based on your anatomy."
value = 1
mob_trait = TRAIT_MULTILINGUAL
gain_text = "You've learned an extra language!"
lose_text = "You've forgotten your extra language."
/datum/quirk/multilingual/post_add()
var/mob/living/carbon/human/H = quirk_holder
H.grant_language(H.client.prefs.language, TRUE, TRUE, LANGUAGE_MULTILINGUAL)
/datum/quirk/multilingual/remove()
var/mob/living/carbon/human/H = quirk_holder
H.remove_language(H.client.prefs.language, TRUE, TRUE, LANGUAGE_MULTILINGUAL)
+1 -1
View File
@@ -153,7 +153,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
name = "Light Sensitivity"
desc = "Bright lights irritate you. Your eyes start to water, your skin feels itchy against the photon radiation, and your hair gets dry and frizzy. Maybe it's a medical condition. If only Nanotrasen was more considerate of your needs..."
value = -1
gain_text = "<span class='danger'>The safty of light feels off...</span>"
gain_text = "<span class='danger'>Bright lights seem irritating.</span>"
lose_text = "<span class='notice'>Enlightening.</span>"
medical_record_text = "Despite my warnings, the patient refuses turn on the lights, only to end up rolling down a full flight of stairs and into the cellar."
+8 -5
View File
@@ -58,13 +58,13 @@
/// The list of z-levels that this weather is actively affecting
var/impacted_z_levels
/// Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
var/overlay_layer = AREA_LAYER
/// Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
var/overlay_layer = AREA_LAYER
/// Plane for the overlay
var/overlay_plane = BLACKNESS_PLANE
/// If the weather has no purpose but aesthetics.
/// If the weather has no purpose but aesthetics.
var/aesthetic = FALSE
/// Used by mobs to prevent them from being affected by the weather
/// Used by mobs to prevent them from being affected by the weather
var/immunity_type = "storm"
/// The stage of the weather, from 1-4
@@ -79,6 +79,8 @@
var/barometer_predictable = FALSE
/// For barometers to know when the next storm will hit
var/next_hit_time = 0
/// This causes the weather to only end if forced to
var/perpetual = FALSE
/datum/weather/New(z_levels)
..()
@@ -140,7 +142,8 @@
to_chat(M, weather_message)
if(weather_sound)
SEND_SOUND(M, sound(weather_sound))
addtimer(CALLBACK(src, .proc/wind_down), weather_duration)
if(!perpetual)
addtimer(CALLBACK(src, .proc/wind_down), weather_duration)
/**
* Weather enters the winding down phase, stops effects
@@ -0,0 +1,31 @@
/datum/weather/void_storm
name = "void storm"
desc = "A rare and highly anomalous event often accompanied by unknown entities shredding spacetime continouum. We'd advise you to start running."
telegraph_duration = 2 SECONDS
telegraph_overlay = "void"
weather_message = "<span class='danger'><i>You feel air around you getting colder... and void's sweet embrace...</i></span>"
weather_overlay = "void_storm"
weather_duration_lower = 60 SECONDS
weather_duration_upper = 120 SECONDS
end_duration = 10 SECONDS
area_type = /area
protect_indoors = FALSE
target_trait = ZTRAIT_VOIDSTORM
immunity_type = "void"
barometer_predictable = FALSE
perpetual = TRUE
/datum/weather/void_storm/weather_act(mob/living/L)
if(IS_HERETIC(L) || IS_HERETIC_MONSTER(L))
return
L.adjustOxyLoss(rand(1,3))
L.adjustFireLoss(rand(1,3))
L.adjust_blurriness(rand(0,1))
L.adjust_bodytemperature(-rand(5,15))