Unlucky trait (#18463)

* this compiles

* more edits

* Upports OP21's immovable rod

Makes it NOT shit.

* actually enable this lol

* CLANG

* we all fall down

* break it

* stairs

* bye async

* makes doorcrushes less lethal

* more unluck!

* dice and stumble vore

* major version

* Update clang.dm

* More tweaks. BS Cracker

Makes bluespace cracker better code quality too

* Cut down on lists here

* Adds the traits

* glass shapnel

* Update unlucky.dm

* Modular Shock

* Charger and thrown

* Defib nat 1

* Gravity Falls

* gibby

* no longer gib, just hurt a LOT

* Better Washer

* Update washing_machine.dm

* Even less jank

* Moves some stuff around

* linters

* Update unlucky.dm

* Table stubbing

* fixes mirror break, evil only

* PIPEBOMB

* Update negative.dm

* Update mail.dm

* glasses fly off your face if you fall

* Update unlucky.dm

* evil beaker and spooky events in the dark

* Evil beaker spilling

* Unlucky people have custom maint loot

* Get sick while searching

* Update _lootable.dm

* whoop

* Update _lootable.dm

* washer will always wash

* Lowered to 5

* ash

* Update areas.dm

* get knocked

* picking up items

* Dice

* Update unlucky.dm

* Update code/game/objects/items/devices/defib.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/modules/economy/vending.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/game/area/areas.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Nicer damage

* these

* this

* mini DCS update

* Excludes

* Proper inherit

* Update unlucky.dm

* Update code/datums/components/traits/unlucky.dm

* These

* thes too

* user

* no hardrefs

* only these 2

---------

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-10-04 03:13:12 -04:00
committed by GitHub
parent 0befda8668
commit 7f4de78573
44 changed files with 1123 additions and 182 deletions
+1 -1
View File
@@ -322,7 +322,7 @@
if(!H.lying || H.handcuffed || arrest_type)
cuff = FALSE
if(!cuff)
H.stun_effect_act(0, stun_strength, null)
H.stun_effect_act(0, stun_strength, null, electric = TRUE)
playsound(src, 'sound/weapons/egloves.ogg', 50, 1, -1)
do_attack_animation(H)
busy = TRUE
+3 -2
View File
@@ -388,13 +388,14 @@
return
/mob/living/carbon/slip(var/slipped_on,stun_duration=8)
SEND_SIGNAL(src, COMSIG_ON_CARBON_SLIP, slipped_on, stun_duration)
if(buckled)
return 0
return FALSE
stop_pulling()
to_chat(src, span_warning("You slipped on [slipped_on]!"))
playsound(src, 'sound/misc/slip.ogg', 50, 1, -3)
Weaken(FLOOR(stun_duration/2, 1))
return 1
return TRUE
/mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1)
if(effect in chem_effects)
@@ -1506,12 +1506,12 @@
if(lying)
playsound(src, 'sound/misc/slip.ogg', 25, 1, -1)
drop_both_hands()
return 0
return FALSE
if((species.flags & NO_SLIP && !footcoverage_check) || (shoes && (shoes.item_flags & NOSLIP))) //Footwear negates a species' natural traction.
return 0
return FALSE
if(..(slipped_on,stun_duration))
drop_both_hands()
return 1
return TRUE
/mob/living/carbon/human/proc/relocate()
set category = "Object"
@@ -58,7 +58,7 @@ emp_act
return (..(P , def_zone))
/mob/living/carbon/human/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone)
/mob/living/carbon/human/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null, var/electric = FALSE)
var/obj/item/organ/external/affected = get_organ(check_zone(def_zone))
var/siemens_coeff = get_siemens_coefficient_organ(affected)
if(fire_stacks < 0) // Water makes you more conductive.
@@ -87,7 +87,7 @@ emp_act
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
automatic_custom_emote(VISIBLE_MESSAGE, "[affected.organ_can_feel_pain() ? "" : emote_scream] drops what they were holding in their [affected.name]!", check_stat = TRUE)
..(stun_amount, agony_amount, def_zone)
..(stun_amount, agony_amount, def_zone, used_weapon, electric)
/mob/living/carbon/human/getarmor(var/def_zone, var/type)
var/armorval = 0
@@ -433,8 +433,8 @@ emp_act
return
if(in_throw_mode && speed <= THROWFORCE_SPEED_DIVISOR) //empty active hand and we're in throw mode
if(canmove && !restrained() && !src.is_incorporeal())
if(isturf(O.loc))
if(can_catch(O))
if(isturf(O.loc) && can_catch(O))
if(!SEND_SIGNAL(src, COMSIG_HUMAN_ON_CATCH_THROW, source, speed))
put_in_active_hand(O)
visible_message(span_warning("[src] catches [O]!"))
throw_mode_off()
@@ -828,3 +828,26 @@
addiction = REAGENT_ID_ASUSTENANCE
custom_only = FALSE
hidden = TRUE //Disabled on Virgo
/datum/trait/negative/unlucky
name = "Unlucky"
desc = "You are naturally unlucky and ill-events often befall you."
cost = -2
is_genetrait = FALSE
hidden = FALSE
custom_only = FALSE
added_component_path = /datum/component/omen/trait
excludes = list(/datum/trait/negative/unlucky/major)
/datum/trait/negative/unlucky/major
name = "Unlucky, Major"
desc = "Your luck is extremely awful and potentially fatal."
cost = -5
tutorial = "You should avoid disposal bins."
is_genetrait = TRUE
hidden = FALSE
added_component_path = /datum/component/omen/trait/major
excludes = list(/datum/trait/negative/unlucky)
activation_message= span_cult(span_bold("What a terrible night to have a curse!"))
primitive_expression_messages=list("unluckily stubs their toe!")
@@ -117,7 +117,7 @@
// Getting hurt in VR doesn't damage the physical body, but you still got hurt.
if(ishuman(vr_holder) && total_damage)
var/mob/living/carbon/human/V = vr_holder
V.stun_effect_act(0, total_damage*2/3, null) // 200 damage leaves the user in paincrit for several seconds, agony reaches 0 after around 2m.
V.stun_effect_act(0, total_damage*2/3, null, electric = FALSE) // 200 damage leaves the user in paincrit for several seconds, agony reaches 0 after around 2m.
to_chat(vr_holder, span_warning("Pain from your time in VR lingers.")) // 250 damage leaves the user unconscious for several seconds in addition to paincrit
// Maintain a link with the mob, but don't use teleop
+3 -2
View File
@@ -126,7 +126,7 @@
//Stun Beams
if(P.taser_effect)
stun_effect_act(0, P.agony, def_zone, P)
stun_effect_act(0, P.agony, def_zone, P, electric = TRUE)
if(!P.nodamage)
apply_damage(P.damage, P.damage_type, def_zone, absorb, soaked, 0, sharp=proj_sharp, edge=proj_edge, used_weapon=P, projectile=TRUE)
qdel(P)
@@ -146,8 +146,9 @@
// return absorb
//Handles the effects of "stun" weapons
/mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null)
/mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null, var/electric = FALSE)
flash_pain()
SEND_SIGNAL(src, COMSIG_STUN_EFFECT_ACT, stun_amount, agony_amount, def_zone, used_weapon, electric)
if (stun_amount)
Stun(stun_amount)
+1 -1
View File
@@ -91,7 +91,7 @@
to_chat(src, span_danger("Warning: Electromagnetic pulse detected."))
..()
/mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount)
/mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null, var/electric = FALSE)
return //immune
/mob/living/silicon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 0.0, var/def_zone = null, var/stun = 1)
@@ -190,9 +190,8 @@
. = min(., 1.0)
// Electricity
/mob/living/simple_mob/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null)
var/zap = min((1-get_shock_protection()), siemens_coeff)
shock_damage *= zap
/mob/living/simple_mob/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, var/stun = 1)
shock_damage *= siemens_coeff
if(shock_damage < 1)
return 0
@@ -217,7 +216,7 @@
. = min(., 1.0)
// Shot with taser/stunvolver
/mob/living/simple_mob/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null)
/mob/living/simple_mob/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null, var/electric = FALSE)
if(taser_kill)
var/stunDam = 0
var/agonyDam = 0
@@ -44,7 +44,7 @@
adjust_discipline(2) // Justified.
// Shocked grilles don't hurt slimes, and in fact give them charge.
/mob/living/simple_mob/slime/xenobio/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, def_zone = null)
/mob/living/simple_mob/slime/xenobio/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, def_zone = null, stun = 1)
power_charge = between(0, power_charge + round(shock_damage / 10), 10)
to_chat(src, span_notice("\The [source] shocks you, and it charges you."))