Skip to content

Commit

Permalink
Merge pull request NebulaSS13#4109 from MistakeNot4892/fix/dev
Browse files Browse the repository at this point in the history
Various fixes from dev testing.
  • Loading branch information
out-of-phaze authored Jun 18, 2024
2 parents 0fb6384 + 86bdecd commit c48e5da
Show file tree
Hide file tree
Showing 44 changed files with 136 additions and 58 deletions.
20 changes: 14 additions & 6 deletions code/controllers/subsystems/event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ SUBSYSTEM_DEF(event)

//Subsystem procs
/datum/controller/subsystem/event/Initialize()
if(!all_events)
all_events = subtypesof(/datum/event)

if(!event_containers)
event_containers = list(
EVENT_LEVEL_MUNDANE = new/datum/event_container/mundane,
EVENT_LEVEL_MODERATE = new/datum/event_container/moderate,
EVENT_LEVEL_MAJOR = new/datum/event_container/major
)
EVENT_LEVEL_MUNDANE = new global.using_map.event_container_mundane,
EVENT_LEVEL_MODERATE = new global.using_map.event_container_moderate,
EVENT_LEVEL_MAJOR = new global.using_map.event_container_major
)
all_events = null

if(!all_events)
all_events = list()
for(var/datum/event_container/container in event_containers)
for(var/datum/event_meta/event in container.available_events)
if(event.event_type)
all_events |= event.event_type

global.using_map.populate_overmap_events()
. = ..()

Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms_damage.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/atom/proc/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/atom/proc/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
return
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
take_damage(Proj.damage, Proj.atom_damage_type)
..()

/obj/effect/cultwall/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/effect/cultwall/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
current_health -= damage
if(current_health <= 0)
visible_message("<span class='warning'>\The [src] dissipates.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/_machines_base/machinery_damage.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/machinery/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent = FALSE)
/obj/machinery/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
//Let's not bother initializing all the components for nothing
if(damage <= 0)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
// RefreshParts has been called, likely meaning other componenets were added/removed.
/obj/item/stock_parts/proc/on_refresh(var/obj/machinery/machine)

/obj/item/stock_parts/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/item/stock_parts/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(damage_type in ignore_damage_types)
return
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/_door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
return TRUE
return FALSE

/obj/machinery/door/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent = FALSE)
/obj/machinery/door/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(!current_health)
..(damage, damage_type)
update_icon()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ About the new airlock wires panel:
return

// Braces can act as an extra layer of armor - they will take damage first.
/obj/machinery/door/airlock/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent = FALSE)
/obj/machinery/door/airlock/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(brace)
brace.take_damage(damage)
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

return TRUE

/obj/machinery/door/window/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent = FALSE)
/obj/machinery/door/window/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
current_health = max(0, current_health - damage)
if (current_health <= 0)
shatter()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ var/global/list/turret_icons
enabled = 1 //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here
return 1

/obj/machinery/porta_turret/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent = FALSE)
/obj/machinery/porta_turret/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(!raised && !raising)
damage = damage / 8
if(damage < 5)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/_item_damage.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**Basic damage handling for items. Returns the amount of damage taken after armor if the item was damaged.*/
/obj/item/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/item/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(!can_take_damage()) // This object does not take damage.
return 0 //Must return a number
if(damage < 0)
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/weapons/material/stick.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

if(!sharp && (istype(W, /obj/item/stack/material/bolt) || istype(W, /obj/item/stack/material/bundle)))

// Ugly way to check for dried grass vs regular grass.
var/obj/item/stack/material/fuel = W
if(!fuel.special_crafting_check())
return ..()

if(fuel.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need at least five units of flammable material to create a torch."))
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/wall_mirror.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
. = ..()
flick("mirror_open",src)

/obj/structure/mirror/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/structure/mirror/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(prob(damage))
visible_message(SPAN_WARNING("[src] shatters!"))
shatter()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/__structure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
set waitfor = FALSE
return FALSE

/obj/structure/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/structure/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(current_health == -1) // This object does not take damage.
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/defensive_barrier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

. = ..()

/obj/structure/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/structure/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(damage)
playsound(src.loc, 'sound/effects/bang.ogg', 75, 1)
damage = round(damage * 0.5)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/flora/tree.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
for(var/turf/T in turfs_to_update)
T.update_ambient_light_from_z_or_area()

/obj/structure/flora/tree/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/structure/flora/tree/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
. = ..()
if(!QDELETED(src) && damage >= 5)
shake()
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
SHOULD_CALL_PARENT(FALSE)
. = shatter()

/obj/structure/window/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/structure/window/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
. = ..()
if(. && damage_type == BRUTE)
playsound(loc, "glasscrack", 100, 1)
Expand Down Expand Up @@ -569,7 +569,7 @@
SHOULD_CALL_PARENT(FALSE)
return FALSE

/obj/structure/window/reinforced/crescent/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/structure/window/reinforced/crescent/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
return

/obj/structure/window/reinforced/crescent/shatter()
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/floors/floor_attackby.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
if(!C || !user)
return 0

if(IS_COIL(C) || (flooring && istype(C, /obj/item/stack/material/rods)))
return ..(C, user)
if(istype(C, /obj/item/stack/tile/roof) || IS_COIL(C) || (flooring && istype(C, /obj/item/stack/material/rods)))
return ..()

if(!(IS_SCREWDRIVER(C) && flooring && (flooring.flags & TURF_REMOVE_SCREWDRIVER)) && try_graffiti(user, C))
return TRUE
Expand Down
11 changes: 5 additions & 6 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -500,18 +500,17 @@
// We have a weather system and we are exposed to it; update our vis contents.
if(istype(new_weather) && is_outside())
if(weather != new_weather)
if(weather)
remove_vis_contents(weather.vis_contents_additions)
weather = new_weather
add_vis_contents(weather.vis_contents_additions)
. = TRUE

// We are indoors or there is no local weather system, clear our vis contents.
else if(weather)
remove_vis_contents(weather.vis_contents_additions)
weather = null
. = TRUE

if(.)
update_vis_contents()

// Propagate our weather downwards if we permit it.
if(force_update_below || (is_open() && .))
var/turf/below = GetBelow(src)
Expand Down Expand Up @@ -605,8 +604,8 @@
var/air_graphic = get_air_graphic()
if(length(air_graphic))
LAZYDISTINCTADD(., air_graphic)
if(weather)
LAZYADD(., weather)
if(length(weather?.vis_contents_additions))
LAZYADD(., weather.vis_contents_additions)
if(flooded)
var/flood_object = get_flood_overlay(flooded)
if(flood_object)
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/walls/_wall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ var/global/list/wall_fullblend_objects = list(
F.icon_state = "wall_thermite"
visible_message(SPAN_DANGER("\The [src] spontaneously combusts!"))

/turf/wall/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/turf/wall/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(damage)
src.damage = max(0, src.damage + damage)
update_damage()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/blob/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
return
attempt_attack(global.alldirs)

/obj/effect/blob/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/effect/blob/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
current_health -= damage
if(current_health < 0)
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/dresses/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
body_parts_covered = SLOT_UPPER_BODY|SLOT_LOWER_BODY|SLOT_LEGS|SLOT_ARMS

/obj/item/clothing/dress/gown
name = "silk gown"
desc = "A long silky sleeveless gown with a flared hem."
name = "gown"
desc = "A long sleeveless gown with a flared hem."
icon = 'icons/clothing/dresses/dress_gown.dmi'
5 changes: 5 additions & 0 deletions code/modules/crafting/stack_recipes/recipes_grass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
craft_stack_types = /obj/item/stack/material/bundle
category = "woven items"

/decl/stack_recipe/woven/can_be_made_from(stack_type, tool_type, decl/material/mat, decl/material/reinf_mat)
if((istype(mat) ? mat.type : mat) == /decl/material/solid/organic/plantmatter/grass)
return FALSE
return ..()

/decl/stack_recipe/woven/basket
result_type = /obj/item/basket

Expand Down
2 changes: 1 addition & 1 deletion code/modules/emotes/definitions/audible_whistle.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/decl/emote/audible/whistle
key = "whistle"
emote_message_1p = "You whistle a tune."
emote_message_3p = "whistles a tune."
emote_message_3p = "$USER$ whistles a tune."
emote_message_muffled = "$USER$ makes a light spitting noise, a poor attempt at a whistle."
emote_message_synthetic_1p = "You whistle a robotic tune."
emote_message_synthetic_3p = "$USER$ whistles a robotic tune."
Expand Down
6 changes: 6 additions & 0 deletions code/modules/fishing/fishing_rod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@
if(!new_line || !is_type_in_list(new_line, valid_line_types))
return FALSE

// TODO: better solution for grass vs dried grass
if(istype(new_line, /obj/item/stack/material))
var/obj/item/stack/material/stack = new_line
if(!stack.special_crafting_check())
return FALSE

if(!new_line.material?.tensile_strength)
to_chat(user, SPAN_WARNING("\The [new_line] isn't suitable for the rigors of fishing."))
return TRUE
Expand Down
3 changes: 3 additions & 0 deletions code/modules/materials/_material_stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
LAZYSET(matter, reinf_material.type, MATTER_AMOUNT_REINFORCEMENT) // No matter_multiplier as this is applied in parent.
..()

/obj/item/stack/material/proc/special_crafting_check()
return TRUE

/obj/item/stack/material/proc/update_strings()
var/prefix_name = name_modifier ? "[name_modifier] " : ""
if(amount>1)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/materials/material_stack_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@
craft_verb = "weave"
craft_verbing = "weaving"

// Hacky fix for grass crafting.
/obj/item/stack/material/bundle/special_crafting_check()
return !dried_type || drying_wetness <= 0

/obj/item/stack/material/strut
name = "struts"
singular_name = "strut"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
if(!affecting)
affecting = get_organ(def_zone)

if(affecting && supplied_wound?.is_open() && dtype == BRUTE) // Can't embed in a small bruise.
if(affecting && istype(supplied_wound) && supplied_wound.is_open() && dtype == BRUTE) // Can't embed in a small bruise.
var/obj/item/I = O
var/sharp = is_sharp(I)
embed_damage *= (1 - get_blocked_ratio(def_zone, BRUTE, O.damage_flags(), O.armor_penetration, I.force))
Expand All @@ -223,7 +223,7 @@
//Sharp objects will always embed if they do enough damage.
//Thrown sharp objects have some momentum already and have a small chance to embed even if the damage is below the threshold
if((sharp && prob(sharp_embed_chance)) || (embed_damage > embed_threshold && prob(embed_chance)))
affecting.embed_in_organ(I, supplied_wound = supplied_wound)
affecting.embed_in_organ(I, supplied_wound = (istype(supplied_wound) ? supplied_wound : null))
I.has_embedded(src)
. = TRUE

Expand Down
14 changes: 7 additions & 7 deletions code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,17 @@ var/global/list/simplemob_icon_bitflag_cache = list()
if(!.)
var/dealt_damage = harm_intent_damage
var/harm_verb = response_harm
var/damageflags
var/damagetype
var/damage_flags
var/damage_type
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/decl/natural_attack/attack = H.get_unarmed_attack(src)
if(istype(attack))
dealt_damage = attack.damage <= dealt_damage ? dealt_damage : attack.damage
harm_verb = pick(attack.attack_verb)
damageflags = attack.get_damage_flags()
damagetype = attack.get_damage_type()
take_damage(dealt_damage, damagetype, damageflags, user)
damage_flags = attack.get_damage_flags()
damage_type = attack.get_damage_type()
take_damage(dealt_damage, damage_type, damage_flags = damage_flags, inflicter = user)
user.visible_message(SPAN_DANGER("\The [user] [harm_verb] \the [src]!"))
user.do_attack_animation(src)
return TRUE
Expand Down Expand Up @@ -385,9 +385,9 @@ var/global/list/simplemob_icon_bitflag_cache = list()

return 1

/mob/living/simple_animal/take_damage(damage, damagetype, def_zone, damage_flags, obj/item/used_weapon, armor_pen, silent, do_update_health)
/mob/living/simple_animal/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
. = ..()
if((damagetype == BRUTE) && damage_flags & (DAM_EDGE | DAM_SHARP | DAM_BULLET)) // damage flags that should cause bleeding
if((damage_type == BRUTE) && (damage_flags & (DAM_EDGE | DAM_SHARP | DAM_BULLET))) // damage flags that should cause bleeding
adjustBleedTicks(damage)

/mob/living/simple_animal/get_movement_delay(var/travel_dir)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//if(ELECTROCUTE)
return 0

/mob/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, do_update_health)
/mob/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
switch(damage_type)
if(BRUTE)
return adjustBruteLoss(damage, do_update_health)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/shield_generators/shield.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
// The closer we are to impact site, the longer it takes for shield to come back up.
S.fail(-(-range + get_dist(src, S)) * 2)

/obj/effect/shield/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0)
/obj/effect/shield/take_damage(damage, damage_type = BRUTE, damage_flags, inflicter, armor_pen = 0, silent, do_update_health)
if(!gen)
qdel(src)
return
Expand Down
3 changes: 2 additions & 1 deletion code/modules/weather/_weather.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
for(var/tz in affecting_zs)
for(var/turf/T as anything in block(locate(1, 1, tz), locate(world.maxx, world.maxy, tz)))
if(T.weather == src)
T.remove_vis_contents(vis_contents_additions)
T.weather = null
T.update_vis_contents()
vis_contents_additions.Cut()
SSweather.unregister_weather_system(src)
QDEL_NULL(lightning_overlay)
Expand Down Expand Up @@ -99,3 +99,4 @@
alpha = 0
invisibility = INVISIBILITY_NONE
is_spawnable_type = FALSE
appearance_flags = RESET_COLOR | KEEP_APART
Loading

0 comments on commit c48e5da

Please sign in to comment.