Skip to content

Commit

Permalink
Merge pull request #4761 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Dev update from staging.
  • Loading branch information
MistakeNot4892 authored Jan 19, 2025
2 parents d419f95 + d904c93 commit 6f4f633
Show file tree
Hide file tree
Showing 24 changed files with 152 additions and 117 deletions.
5 changes: 5 additions & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,10 @@
#define RADIAL_LABELS_OFFSET 1
#define RADIAL_LABELS_CENTERED 2

#define CRAYON_DRAW_RUNE "rune"
#define CRAYON_DRAW_GRAFFITI "graffiti"
#define CRAYON_DRAW_LETTER "letter"
#define CRAYON_DRAW_ARROW "arrow"

// Default UI style applied to client prefs.
#define DEFAULT_UI_STYLE /decl/ui_style/midnight
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -996,3 +996,6 @@

/atom/proc/can_drink_from(mob/user)
return ATOM_IS_OPEN_CONTAINER(src) && reagents?.total_volume && user.check_has_mouth()

/atom/proc/immune_to_floor_hazards()
return !simulated
4 changes: 4 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,14 @@
return loc?.take_vaporized_reagent(reagent, amount)
return null

/atom/movable/immune_to_floor_hazards()
return ..() || throwing

// TODO: make everything use this.
/atom/movable/proc/set_anchored(new_anchored)
SHOULD_CALL_PARENT(TRUE)
if(anchored != new_anchored)
anchored = new_anchored
return TRUE
return FALSE

49 changes: 26 additions & 23 deletions code/game/objects/effects/decals/crayon.dm
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
/obj/effect/decal/cleanable/crayon
name = "rune"
desc = "A rune drawn in crayon."
icon = 'icons/obj/rune.dmi'
name = "rune"
desc = "A rune drawn in crayon."
icon = 'icons/effects/crayondecal.dmi'
icon_state = "rune1"
weather_sensitive = FALSE
var/shade_color = COLOR_BLACK

/obj/effect/decal/cleanable/crayon/Initialize(mapload, main = "#ffffff", shade = "#000000", var/type = "rune")
name = type
desc = "\A [type] drawn in crayon."
/obj/effect/decal/cleanable/crayon/Initialize(mapload, _color = COLOR_WHITE, _shade_color = COLOR_BLACK, _drawtype = CRAYON_DRAW_RUNE)
. = ..()
name = _drawtype
desc = "\A [_drawtype], drawn in crayon."
color = _color
shade_color = _shade_color
switch(_drawtype)
if(CRAYON_DRAW_RUNE)
icon_state = "rune[rand(1,6)]"
if(CRAYON_DRAW_GRAFFITI)
icon_state = pick("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa")
else
icon_state = _drawtype
update_icon()

switch(type)
if("rune")
type = "rune[rand(1,6)]"
if("graffiti")
type = pick("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa")

var/icon/mainOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]",2.1)
var/icon/shadeOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]s",2.1)

mainOverlay.Blend(main,ICON_ADD)
shadeOverlay.Blend(shade,ICON_ADD)

overlays += mainOverlay
overlays += shadeOverlay

add_hiddenprint(usr)
. = ..()
/obj/effect/decal/cleanable/crayon/on_update_icon()
. = ..()
if(shade_color)
var/overlay_state = "[icon_state]s"
if(check_state_in_icon(overlay_state, icon))
add_overlay(overlay_image(icon, overlay_state, shade_color, RESET_COLOR))
compile_overlays()
20 changes: 11 additions & 9 deletions code/game/objects/items/weapons/material/shards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,33 @@
if(!isliving(AM))
return

var/mob/living/M = AM
if(M.buckled) //wheelchairs, office chairs, rollerbeds
var/mob/living/victim = AM
if(victim.buckled) //wheelchairs, office chairs, rollerbeds
return
if(victim.immune_to_floor_hazards())
return

playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1) // not sure how to handle metal shards with sounds

var/decl/species/walker_species = M.get_species()
if(walker_species && (walker_species.get_shock_vulnerability(M) < 0.5 || (walker_species.species_flags & (SPECIES_FLAG_NO_EMBED|SPECIES_FLAG_NO_MINOR_CUT)))) //Thick skin.
var/decl/species/walker_species = victim.get_species()
if(walker_species && (walker_species.get_shock_vulnerability(victim) < 0.5 || (walker_species.species_flags & (SPECIES_FLAG_NO_EMBED|SPECIES_FLAG_NO_MINOR_CUT)))) //Thick skin.
return

var/obj/item/shoes = M.get_equipped_item(slot_shoes_str)
var/obj/item/suit = M.get_equipped_item(slot_wear_suit_str)
var/obj/item/shoes = victim.get_equipped_item(slot_shoes_str)
var/obj/item/suit = victim.get_equipped_item(slot_wear_suit_str)
if(shoes || (suit && (suit.body_parts_covered & SLOT_FEET)))
return

var/list/check = list(BP_L_FOOT, BP_R_FOOT)
while(check.len)
var/picked = pick_n_take(check)
var/obj/item/organ/external/affecting = GET_EXTERNAL_ORGAN(M, picked)
var/obj/item/organ/external/affecting = GET_EXTERNAL_ORGAN(victim, picked)
if(!affecting || BP_IS_PROSTHETIC(affecting))
continue
to_chat(M, SPAN_DANGER("You step on \the [src]!"))
to_chat(victim, SPAN_DANGER("You step on \the [src]!"))
affecting.take_external_damage(5, 0)
if(affecting.can_feel_pain())
SET_STATUS_MAX(M, STAT_WEAK, 3)
SET_STATUS_MAX(victim, STAT_WEAK, 3)
return

//Prevent the shard from being allowed to shatter
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/weapons/soap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
add_to_reagents(/decl/material/liquid/cleaner/soap, SOAP_CLEANER_ON_WET)

/obj/item/soap/Crossed(atom/movable/AM)
if(!isliving(AM))
return
var/mob/living/M = AM
M.slip("\the [src]", 3)
var/mob/living/victim = AM
if(istype(victim))
victim.slip("\the [src]", 3)
return ..()

/obj/item/soap/afterattack(atom/target, mob/user, proximity)

Expand Down
90 changes: 47 additions & 43 deletions code/game/objects/items/weapons/traps.dm
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
/obj/item/beartrap
name = "mechanical trap"
throw_speed = 2
throw_range = 1
gender = PLURAL
icon = 'icons/obj/items/beartrap.dmi'
icon_state = "beartrap0"
randpixel = 0
desc = "A mechanically activated leg trap. Low-tech, but reliable. Looks like it could really hurt if you set it off."
w_class = ITEM_SIZE_NORMAL
origin_tech = @'{"materials":1}'
material = /decl/material/solid/metal/steel
can_buckle = 0 //disallow manual un/buckling
var/deployed = 0
name = "mechanical trap"
desc = "A mechanically activated leg trap. Low-tech, but reliable. Looks like it could really hurt if you set it off."
throw_speed = 2
throw_range = 1
gender = PLURAL
icon = 'icons/obj/items/beartrap.dmi'
icon_state = "beartrap0"
randpixel = 0
w_class = ITEM_SIZE_NORMAL
origin_tech = @'{"materials":1}'
material = /decl/material/solid/metal/steel
can_buckle = FALSE //disallow manual un/buckling
var/deployed = FALSE

/obj/item/beartrap/proc/can_use(mob/user)
. = (user.check_dexterity(DEXTERITY_SIMPLE_MACHINES) && !issilicon(user) && !user.stat && !user.restrained())

/obj/item/beartrap/user_unbuckle_mob(mob/user)
if(buckled_mob && can_use(user))
user.visible_message(
"<span class='notice'>\The [user] begins freeing \the [buckled_mob] from \the [src].</span>",
"<span class='notice'>You carefully begin to free \the [buckled_mob] from \the [src].</span>",
"<span class='notice'>You hear metal creaking.</span>"
SPAN_NOTICE("\The [user] begins freeing \the [buckled_mob] from \the [src]."),
SPAN_NOTICE("You carefully begin to free \the [buckled_mob] from \the [src]."),
SPAN_NOTICE("You hear metal creaking.")
)
if(do_after(user, 60, src))
user.visible_message("<span class='notice'>\The [buckled_mob] has been freed from \the [src] by \the [user].</span>")
user.visible_message(SPAN_NOTICE("\The [buckled_mob] has been freed from \the [src] by \the [user]."))
unbuckle_mob()
anchored = FALSE

/obj/item/beartrap/attack_self(mob/user)
..()
if(!deployed && can_use(user))
user.visible_message(
"<span class='danger'>[user] starts to deploy \the [src].</span>",
"<span class='danger'>You begin deploying \the [src]!</span>",
SPAN_DANGER("\The [user] starts to deploy \the [src]."),
SPAN_DANGER("You begin deploying \the [src]!"),
"You hear the slow creaking of a spring."
)
)

if (do_after(user, 60, src) && user.try_unequip(src))
if (do_after(user, 6 SECONDS, src) && user.try_unequip(src))
user.visible_message(
"<span class='danger'>\The [user] has deployed \the [src].</span>",
"<span class='danger'>You have deployed \the [src]!</span>",
SPAN_DANGER("\The [user] has deployed \the [src]."),
SPAN_DANGER("You have deployed \the [src]!"),
"You hear a latch click loudly."
)

deployed = 1
)
deployed = TRUE
update_icon()
anchored = TRUE

Expand All @@ -55,7 +54,7 @@
user_unbuckle_mob(user)
return TRUE
if(!deployed || !can_use(user))
return FALSE
return ..()
user.visible_message(
SPAN_DANGER("\The [user] starts to disarm \the [src]."),
SPAN_NOTICE("You begin disarming \the [src]!"),
Expand All @@ -71,40 +70,45 @@
update_icon()
return TRUE

/obj/item/beartrap/proc/attack_mob(mob/L)
/obj/item/beartrap/proc/attack_mob(mob/victim)

if(victim.immune_to_floor_hazards())
return FALSE

var/target_zone
if(L.current_posture.prone)
if(victim.current_posture.prone)
target_zone = ran_zone()
else
target_zone = pick(BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG)

if(!L.apply_damage(30, BRUTE, target_zone, used_weapon=src))
return 0
if(!victim.apply_damage(30, BRUTE, target_zone, used_weapon=src))
return FALSE

//trap the victim in place
set_dir(L.dir)
buckle_mob(L)
to_chat(L, "<span class='danger'>The steel jaws of \the [src] bite into you, trapping you in place!</span>")
deployed = 0
set_dir(victim.dir)
buckle_mob(victim)
to_chat(victim, SPAN_DANGER("The steel jaws of \the [src] bite into you, trapping you in place!"))
deployed = FALSE
return TRUE

/obj/item/beartrap/Crossed(atom/movable/AM)
..()
if(!deployed || !isliving(AM))
return
var/mob/living/L = AM
if(MOVING_DELIBERATELY(L))
var/mob/living/victim = AM
if(MOVING_DELIBERATELY(victim) || victim.immune_to_floor_hazards())
return
L.visible_message(
SPAN_DANGER("\The [L] steps on \the [src]."),
victim.visible_message(
SPAN_DANGER("\The [victim] steps on \the [src]."),
SPAN_DANGER("You step on \the [src]!"),
"<b>You hear a loud metallic snap!</b>")
attack_mob(L)
"<b>You hear a loud metallic snap!</b>"
)
attack_mob(victim)
if(!buckled_mob)
anchored = FALSE
deployed = 0
deployed = FALSE
update_icon()

/obj/item/beartrap/on_update_icon()
. = ..()
icon_state = "beartrap[deployed == TRUE]"
icon_state = "beartrap[deployed]"
2 changes: 1 addition & 1 deletion code/game/objects/random/subtypes/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/obj/item/pill_bottle/happy = 2,
/obj/item/pill_bottle/zoom = 2,
/obj/item/chems/glass/beaker/vial/random/toxin = 1,
/obj/item/chems/glass/beaker/sulphuric = 1,
/obj/item/chems/glass/beaker/sulfuric = 1,
/obj/item/poster = 5,
/obj/item/butterflyblade = 3,
/obj/item/butterflyhandle = 3,
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/structures/barrels/barrel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
wrenchable = FALSE
storage = /datum/storage/barrel
amount_dispensed = 10
possible_transfer_amounts = @"[10,25,50,100]"
volume = 7500
movable_flags = MOVABLE_FLAG_WHEELED
throwpass = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/flooring/flooring_lava.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var/datum/gas_mixture/environment = target.return_air()
var/pressure = environment?.return_pressure()
for(var/atom/movable/AM as anything in target.get_contained_external_atoms())
if(!AM.is_burnable())
if(!AM.is_burnable() || AM.immune_to_floor_hazards())
continue
. = null
if(isliving(AM))
Expand Down
24 changes: 13 additions & 11 deletions code/modules/clothing/suits/cloaks.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/obj/item/clothing/suit/cloak // A colorable cloak
name = "plain cloak"
desc = "A simple, bland cloak."
icon = 'icons/clothing/suits/cloaks/_cloak.dmi'
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_OVER_BODY
allowed = list(/obj/item/tank/emergency/oxygen)
armor = list(ARMOR_MELEE = 0, ARMOR_BULLET = 0, ARMOR_LASER = 0,ARMOR_ENERGY = 0, ARMOR_BOMB = 0, ARMOR_BIO = 0, ARMOR_RAD = 0)
body_parts_covered = SLOT_UPPER_BODY|SLOT_LOWER_BODY|SLOT_ARMS|SLOT_LEGS
siemens_coefficient = 0.9
accessory_slot = ACCESSORY_SLOT_OVER
// A colorable cloak
/obj/item/clothing/suit/cloak
name = "plain cloak"
desc = "A simple, bland cloak."
icon = 'icons/clothing/suits/cloaks/_cloak.dmi'
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_OVER_BODY
allowed = list(/obj/item/tank/emergency/oxygen)
armor = null
body_parts_covered = SLOT_UPPER_BODY|SLOT_LOWER_BODY|SLOT_ARMS|SLOT_LEGS
siemens_coefficient = 0.9
accessory_slot = ACCESSORY_SLOT_OVER
accessory_visibility = ACCESSORY_VISIBILITY_ATTACHMENT
storage = /datum/storage/pockets/suit

/obj/item/clothing/suit/cloak/on_update_icon()
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/suits/jackets/_jacket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
slot_flags = SLOT_OVER_BODY
w_class = ITEM_SIZE_NORMAL
accessory_slot = ACCESSORY_SLOT_DECOR
storage = /datum/storage/pockets/suit
valid_accessory_slots = list(
ACCESSORY_SLOT_INSIGNIA,
ACCESSORY_SLOT_ARMBAND,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/codex/categories/category_substances.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
else if(mat.dissolves_in <= MAT_SOLVENT_MODERATE)
solvent_needed = "a moderately strong solvent, like acetone"
else if(mat.dissolves_in <= MAT_SOLVENT_STRONG)
solvent_needed = "a strong solvent, like sulphuric acid"
solvent_needed = "a strong solvent, like sulfuric acid"
material_info += "<li>It can be dissolved with [solvent_needed] solvent, producing [english_list(chems)].</li>"
if(mat.radioactivity)
material_info += "<li>It is radioactive.</li>"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/decl/material/liquid/acid
name = "sulphuric acid"
uid = "liquid_sulphuric_acid"
name = "sulfuric acid"
uid = "liquid_sulfuric_acid"
lore_text = "A very corrosive mineral acid with the molecular formula H2SO4."
taste_description = "acid"
color = "#db5008"
Expand Down
9 changes: 8 additions & 1 deletion code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,14 @@ default behaviour is:
/mob/living/proc/has_brain()
return TRUE

/mob/living/proc/slip(var/slipped_on, stun_duration = 8)
// We are jumping, levitating or being thrown.
/mob/living/immune_to_floor_hazards()
. = ..() || is_floating

/mob/living/proc/slip(slipped_on, stun_duration = 8)

if(immune_to_floor_hazards())
return FALSE

var/decl/species/my_species = get_species()
if(my_species?.check_no_slip(src))
Expand Down
Loading

0 comments on commit 6f4f633

Please sign in to comment.