Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SmiLeYre committed Jan 29, 2025
2 parents c601f70 + 43e47e7 commit 9c5a617
Show file tree
Hide file tree
Showing 39 changed files with 461 additions and 125 deletions.
53 changes: 27 additions & 26 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,32 @@


//Human Overlays Indexes/////////
#define MUTATIONS_LAYER 48 //mutations. Tk headglows, cold resistance glow, etc
#define CLOAK_BEHIND_LAYER 47
#define HANDS_BEHIND_LAYER 46
#define BELT_BEHIND_LAYER 45
#define BACK_BEHIND_LAYER 44
#define BODY_BEHIND_LAYER 43 //certain mutantrace features (tail when looking south) that must appear behind the body parts
#define BODY_UNDER_LAYER 42 // Things under the bodyparts but above the "behind body" layer
#define BODYPARTS_LAYER 41 //Initially "AUGMENTS", this was repurposed to be a catch-all bodyparts flag
#define BODY_ADJ_LAYER 40 //certain mutantrace features (snout, body markings) that must appear above the body parts
#define BODY_LAYER 39 //underwear, undershirts, socks, eyes, lips(makeup)
#define FRONT_MUTATIONS_LAYER 38 //mutations that should appear above body, body_adj and bodyparts layer (e.g. laser eyes)
#define DAMAGE_LAYER 37 //damage indicators (cuts and burns)
#define LEG_PART_LAYER 36
#define PANTS_LAYER 35
#define SHOES_LAYER 34
#define LEG_DAMAGE_LAYER 33
#define LEGSLEEVE_LAYER 32
#define SHOESLEEVE_LAYER 31
#define SHIRT_LAYER 30
#define WRISTS_LAYER 29
#define ARMOR_LAYER 28
#define TABARD_LAYER 27
#define BELT_LAYER 26 //only when looking south
#define UNDER_CLOAK_LAYER 25
#define HANDS_PART_LAYER 24
#define MUTATIONS_LAYER 49 //mutations. Tk headglows, cold resistance glow, etc
#define CLOAK_BEHIND_LAYER 48
#define HANDS_BEHIND_LAYER 47
#define BELT_BEHIND_LAYER 46
#define BACK_BEHIND_LAYER 45
#define BODY_BEHIND_LAYER 44 //certain mutantrace features (tail when looking south) that must appear behind the body parts
#define BODY_UNDER_LAYER 43 // Things under the bodyparts but above the "behind body" layer
#define BODYPARTS_LAYER 42 //Initially "AUGMENTS", this was repurposed to be a catch-all bodyparts flag
#define BODY_ADJ_LAYER 41 //certain mutantrace features (snout, body markings) that must appear above the body parts
#define BODY_LAYER 40 //underwear, undershirts, socks, eyes, lips(makeup)
#define FRONT_MUTATIONS_LAYER 39 //mutations that should appear above body, body_adj and bodyparts layer (e.g. laser eyes)
#define DAMAGE_LAYER 38 //damage indicators (cuts and burns)
#define LEG_PART_LAYER 37
#define PANTS_LAYER 36
#define SHOES_LAYER 35
#define LEG_DAMAGE_LAYER 34
#define LEGSLEEVE_LAYER 33
#define SHOESLEEVE_LAYER 32
#define SHIRT_LAYER 31
#define WRISTS_LAYER 30
#define ARMOR_LAYER 29
#define TABARD_LAYER 28
#define BELT_LAYER 27 //only when looking south
#define UNDER_CLOAK_LAYER 26
#define HANDS_PART_LAYER 25
#define OVER_HANDS_LAYER 24 // A patch to make some clothing with layers from 35 to 24 use "standart" SS13 icon_states and ignore sleeves code.
#define GLOVES_LAYER 23
#define ARM_DAMAGE_LAYER 22
#define SHIRTSLEEVE_LAYER 21
Expand All @@ -61,7 +62,7 @@
#define HALO_LAYER 3 //blood cult ascended halo, because there's currently no better solution for adding/removing
#define FIRE_LAYER 2 //If you're on fire
#define TURF_LAYER 1 //If you're on fire
#define TOTAL_LAYERS 48 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
#define TOTAL_LAYERS 49 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;

#define BACK_CLOAK_SOUTH_LAYER (BODY_BEHIND_LAYER+1)

Expand Down
9 changes: 4 additions & 5 deletions code/controllers/subsystem/nightshift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ SUBSYSTEM_DEF(nightshift)
if(!cmode)
SSdroning.play_area_sound(areal, src.client)
SSdroning.play_loop(areal, src.client)

if(todd == "day")
if(HAS_TRAIT(src, TRAIT_DARKLING) && !HAS_TRAIT(src, TRAIT_NOSTAMINA) && !HAS_TRAIT(src, TRAIT_NOSLEEP))
apply_status_effect(/datum/status_effect/debuff/sleepytime)
add_stress(/datum/stressevent/sleepytime)
if(todd == "dawn")
try_grow_beard()
if(HAS_TRAIT(src, TRAIT_VAMP_DREAMS))
apply_status_effect(/datum/status_effect/debuff/vamp_dreams)
if(HAS_TRAIT(src, TRAIT_DARKLING) && !HAS_TRAIT(src, TRAIT_NOSTAMINA) && !HAS_TRAIT(src, TRAIT_NOSLEEP))
apply_status_effect(/datum/status_effect/debuff/sleepytime)
add_stress(/datum/stressevent/sleepytime)

if(todd == "night")
if(HAS_TRAIT(src, TRAIT_DARKLING))
return ..()
Expand Down
49 changes: 31 additions & 18 deletions code/datums/components/darkling.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/datum/component/darkling
var/current_light_stress = 0 ///Currently accumulated light stress for this darkling component
var/last_light_stress = 0 ///Value of last light stress tick, used for determining blinding effects
var/max_light_stress = 100 ///Maximum allowed light stress that the darkling can accumulate
var/next_blind ///World time when the darkling is able to be blinded again by bright lights

/datum/component/darkling/Initialize(...)
. = ..()
if(!ismob(parent))
if(!iscarbon(parent))
return COMPONENT_INCOMPATIBLE
ADD_TRAIT(parent, TRAIT_DARKLING, TRAIT_GENERIC) //Makes us sleepy during the day, since we're creatures of the dark
RegisterSignal(parent, COMSIG_LIVING_HEALTH_UPDATE, PROC_REF(update_light_stress)) //Light stress accumulation
Expand All @@ -17,59 +18,66 @@
character.put_in_hands(hood, forced = TRUE)

//Proc used for updating light stress, occurs every health update so around once every 2 seconds
/datum/component/darkling/proc/update_light_stress(var/mob/living/darkling)\
/datum/component/darkling/proc/update_light_stress(var/mob/living/carbon/darkling)\
//Closing our eyes or being blind/blindfolded lets us recovery very quickly
if(darkling.eyesclosed || darkling.eye_blind)
src.current_light_stress -= 1.5
if(darkling.IsSleeping())
current_light_stress -= 5 //Sleeping restores us much quicker
src.current_light_stress -= 5 //Sleeping restores us much quicker
return
var/incoming_light_stress = get_light_stress_value(darkling)
src.current_light_stress = clamp(current_light_stress + incoming_light_stress, 0, max_light_stress)
if(incoming_light_stress > 0.5) //Try to blind us if the light is too bright
if(incoming_light_stress > 0.2 && incoming_light_stress - last_light_stress > 0.5) //Checks if we've just barreled into the light
try_blind_darkling(darkling)
src.last_light_stress = incoming_light_stress
apply_stress_effects(darkling)


//Triggers on movement. This is mostly so that getting blinded by lights is more responsive, instead of having to linger beside them
/datum/component/darkling/proc/check_light_on_move(var/mob/living/darkling)
/datum/component/darkling/proc/check_light_on_move(var/mob/living/carbon/darkling)
var/light_stress = get_light_stress_value(darkling)
if(light_stress > 0.5)
if(light_stress > 0.2 && light_stress - last_light_stress > 0.5) //Checks if we've just barreled into the light
try_blind_darkling(darkling)

//Used to blind us when exposed to strong lights. Has a cooldown between blindings.
/datum/component/darkling/proc/try_blind_darkling(var/mob/living/darkling)
//So that we aren't spamming people too much when they're in the light
if(next_blind > world.time)
/datum/component/darkling/proc/try_blind_darkling(var/mob/living/carbon/darkling)
//So that we aren't spamming people too much
if(next_blind > world.time || get_face_covered(darkling))
return
//Gives us a nasty bump in light stress
current_light_stress = clamp(current_light_stress + 5, 0, max_light_stress)
darkling.flash_act()
darkling.blur_eyes(8)
next_blind = world.time + (rand(30 SECONDS, 60 SECONDS) * (darkling.STACON/10)) //Con determines how frequently you can get blinded
to_chat(parent, span_danger("It's too bright! My eyes!"))
to_chat(parent, span_danger("Bright lights, too fast! My eyes couldn't adjust."))

//Applies the effects of our current light stress accumulation threshold
/datum/component/darkling/proc/apply_stress_effects(var/mob/living/darkling)
/datum/component/darkling/proc/apply_stress_effects(var/mob/living/carbon/darkling)
//Small buff when in the dark and fully rested
if(src.current_light_stress == 0)
var/turf/T = get_turf(parent)
var/light_amount = T.get_lumcount()
if(light_amount <= 0.1)
darkling.apply_status_effect(/datum/status_effect/buff/darkling_darkly)
//Eye strain debuff
if(src.current_light_stress > 10)
if(src.current_light_stress > 15)
darkling.add_stress(/datum/stressevent/darkling_toobright)
darkling.apply_status_effect(/datum/status_effect/debuff/darkling_glare)
darkling.blur_eyes(3)
//Migraines
if(src.current_light_stress > 40)
darkling.blur_eyes(6)
if(src.current_light_stress > 50)
darkling.blur_eyes(2)
darkling.overlay_fullscreen("painflash", /atom/movable/screen/fullscreen/painflash)
darkling.overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, 4)
darkling.overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, 1)
darkling.add_stress(/datum/stressevent/darkling_migraine)
darkling.apply_status_effect(/datum/status_effect/debuff/darkling_migraine)

//Calculates incoming light stress based on turf lumcount and character stats
/datum/component/darkling/proc/get_light_stress_value(var/mob/living/darkling)
/datum/component/darkling/proc/get_light_stress_value(var/mob/living/carbon/darkling)
var/turf/T = get_turf(parent)
var/light_amount = T.get_lumcount()
var/resistance_multiplier = 1
resistance_multiplier += darkling.fovangle > 5
resistance_multiplier += get_face_covered(darkling)
resistance_multiplier += darkling.get_eye_protection()
var/light_resistance = (0.6 * (darkling.STAEND/10)) * resistance_multiplier
var/light_multiplier = 1
if(GLOB.tod == "day" && isturf(darkling.loc))
Expand All @@ -78,3 +86,8 @@
light_multiplier += 0.5
var/incoming_light_stress = (light_amount * light_multiplier - light_resistance)
return incoming_light_stress


/datum/component/darkling/proc/get_face_covered(var/mob/living/carbon/darkling)
if((darkling.wear_mask && (darkling.wear_mask.flags_inv & HIDEFACE)) || (darkling.head && (darkling.head.flags_inv & HIDEFACE)))
return 1
7 changes: 6 additions & 1 deletion code/datums/elements/tipped_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@


/datum/element/tipped_item/proc/start_dipping(obj/item/dipper, obj/item/reagent_containers/attacked_container, mob/living/attacker, params)
var/reagentlog = attacked_container.reagents
attacker.visible_message(span_danger("[attacker] is dipping \the [dipper] in [attacked_container]!"), "You dip \the [dipper] in \the [attacked_container]!", vision_distance = 2)
if(!do_after(attacker, 2 SECONDS, target = attacked_container))
return
attacked_container.reagents.trans_to(dipper, 0.5, transfered_by = attacker)
attacker.visible_message(span_danger("[attacker] dips [dipper] in [attacked_container]!"), "You dip [dipper] in [attacked_container]!", vision_distance = 2)
attacker.visible_message(span_danger("[attacker] dips \the [dipper] in \the [attacked_container]!"), "You dip \the [dipper] in \the [attacked_container]!", vision_distance = 2)
log_combat(attacker, dipper, "poisoned", addition="with [reagentlog]")

/datum/element/tipped_item/proc/try_inject(obj/item/source, atom/target, mob/user, proximity_flag, click_parameters)
var/reagentlog2 = source.reagents
if(!proximity_flag)
return
if(isliving(target))
log_combat(user, target, "poisoned", addition="with [reagentlog2]")
source.reagents.trans_to(target, 1, transfered_by = user)

/datum/element/tipped_item/proc/on_examine(atom/movable/source, mob/user, list/examine_list)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/status_effects/rogue/debuff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@
/datum/status_effect/debuff/darkling_migraine
id = "darkling_migraine"
alert_type = /atom/movable/screen/alert/status_effect/debuff/darkling_migraine
effectedstats = list("perception" = -1, "endurance" = -1, "speed" = -1)
duration = 1 MINUTES
effectedstats = list("endurance" = -1, "intelligence" = -1) //Will basically always be stacked with the eye strain penalty
duration = 20 SECONDS

/atom/movable/screen/alert/status_effect/debuff/darkling_migraine
name = "Migraine"
icon_state = "muscles"
desc = "My head is pounding, I need to get away from the light and rest a while!"
desc = "My head is pounding, I can barely think. I need to get away from the light and rest a while!"

/// Strengthen undead debuff
/datum/status_effect/debuff/weaken_living
Expand Down
12 changes: 12 additions & 0 deletions code/datums/status_effects/rogue/roguebuff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,15 @@
name = "Seelie Blessing"
desc = "A nearby Seelie has brought me fortune."
icon_state = "stressg"


/datum/status_effect/buff/darkling_darkly
id = "Darkling"
alert_type = /atom/movable/screen/alert/status_effect/buff/darkling_darkly
effectedstats = list("perception" = 1)
duration = 5 SECONDS

/atom/movable/screen/alert/status_effect/buff/darkling_darkly
name = "Darkling"
desc = "You are at home in the dark. Unbothered. In your lane. Moisturized."
icon_state = "stressg"
1 change: 1 addition & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e
var/can_assin = FALSE //Weapon: Can Assassinate - Special flag for backstabbing weapons (Extra small, like daggers)
var/can_cdg = FALSE //Weapon: Can Coup de Grace - Special flag for weapons that can be wedged under armor in a fight (short and portable)

var/ignore_sleeves_code = FALSE // Use for clothing which has cropped parts for hands and doesn't use sleeved system. They will have layer under gloves
var/sleeved = null
var/sleevetype = null
var/nodismemsleeves = FALSE
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items/rogueweapons/melee/knives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
smeltresult = /obj/item/ingot/iron
can_cdg = TRUE

/obj/item/rogueweapon/huntingknife/Initialize()
. = ..()
AddElement(/datum/element/tipped_item)

/datum/intent/dagger
clickcd = 8
Expand Down
15 changes: 15 additions & 0 deletions code/game/turfs/open/water.dm
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,21 @@
BP.add_embedded_object(I, silent = TRUE)
return .

/turf/open/water/sea
name = "shallows"
desc = "Shallow salty seawater, gentle waves lap across the surface"
water_level = 2
water_color = "#034ea4"
water_reagent = /datum/reagent/water/salty

/turf/open/water/sea/deep
name = "sea"
desc = "Deep salty seawater, who knows what dwells beneath the surface?"
water_level = 3
water_color = "#02014b"
slowdown = 5
swim_skill = TRUE

/turf/open/water/swamp/deep
name = "murk"
desc = "Deep water with several weeds and algae on the surface."
Expand Down
10 changes: 5 additions & 5 deletions code/modules/cargo/packsrogue/apparel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/datum/supply_pack/rogue/apparel/crosses/silver
name = "Silver Cross"
cost = 150
cost = 60
contains = list(/obj/item/clothing/neck/roguetown/psicross/silver)

/datum/supply_pack/rogue/apparel/crosses/psicross
Expand All @@ -57,7 +57,7 @@

/datum/supply_pack/rogue/apparel/gloves/leather
name = "Leather Gloves"
cost = 15
cost = 25
contains = list(
/obj/item/clothing/gloves/roguetown/leather,
/obj/item/clothing/gloves/roguetown/leather,
Expand All @@ -66,7 +66,7 @@

/datum/supply_pack/rogue/apparel/boots/leather
name = "Leather Boots"
cost = 15
cost = 25
contains = list(
/obj/item/clothing/shoes/roguetown/armor/leather,
/obj/item/clothing/shoes/roguetown/armor/leather,
Expand All @@ -75,7 +75,7 @@

/datum/supply_pack/rogue/apparel/trousers/leather
name = "Leather Trousers"
cost = 15
cost = 25
contains = list(
/obj/item/clothing/under/roguetown/trou/leather,
/obj/item/clothing/under/roguetown/trou/leather,
Expand All @@ -92,7 +92,7 @@
)

/datum/supply_pack/rogue/apparel/shirts/tunic
name = "Shirt"
name = "Tunic"
cost = 10
contains = list(
/obj/item/clothing/suit/roguetown/shirt/tunic,
Expand Down
Loading

0 comments on commit 9c5a617

Please sign in to comment.