mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-sync
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
/obj/structure/cannon/Initialize(mapload)
|
||||
. = ..()
|
||||
create_reagents(charge_size)
|
||||
AddComponent(/datum/component/simple_rotation)
|
||||
|
||||
/obj/structure/cannon/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
return
|
||||
move_delay = TRUE
|
||||
var/oldloc = loc
|
||||
try_step_multiz(direction);
|
||||
try_step_multiz(direction)
|
||||
user.setDir(dir)
|
||||
if(oldloc != loc)
|
||||
addtimer(CALLBACK(src, PROC_REF(ResetMoveDelay)), CONFIG_GET(number/movedelay/walk_delay) * move_speed_multiplier)
|
||||
else
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
new /obj/item/ammo_box/magazine/m50(src)
|
||||
new /obj/item/gun/ballistic/automatic/pistol/deagle(src)
|
||||
else
|
||||
new /obj/item/ammo_box/a357(src)
|
||||
new /obj/item/ammo_box/a357(src)
|
||||
new /obj/item/ammo_box/speedloader/c357(src)
|
||||
new /obj/item/ammo_box/speedloader/c357(src)
|
||||
new /obj/item/gun/ballistic/revolver/mateba(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/ert_com/populate_contents_immediate()
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if(!istype(item, /obj/item/syndicrate_key) || created_items)
|
||||
return ..()
|
||||
created_items = TRUE
|
||||
for(var/item_path as anything in unlock_contents)
|
||||
for(var/item_path in unlock_contents)
|
||||
new item_path(src)
|
||||
unlock_contents = list()
|
||||
qdel(item)
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
var/turf/turfloc = loc
|
||||
. = ..()
|
||||
if(isturf(turfloc))
|
||||
for(var/thing_that_falls as anything in turfloc) // as anything because turfloc can only contain movables
|
||||
turfloc.zFall((thing_that_falls))
|
||||
for(var/thing_that_falls in turfloc)
|
||||
turfloc.zFall(thing_that_falls)
|
||||
|
||||
/obj/structure/lattice/proc/deconstruction_hints(mob/user)
|
||||
return span_notice("The rods look like they could be <b>cut</b>. There's space for more <i>rods</i> or a <i>tile</i>.")
|
||||
@@ -154,28 +154,30 @@
|
||||
desc = "A heavily reinforced catwalk used to build bridges in hostile environments. It doesn't look like anything could make this budge."
|
||||
resistance_flags = INDESTRUCTIBLE
|
||||
|
||||
/obj/structure/lattice/catwalk/mining/attackby(obj/item/C, mob/user, list/modifiers, list/attack_modifiers)
|
||||
// Allow cable placement even though we're indestructible
|
||||
if(istype(C, /obj/item/stack/cable_coil))
|
||||
var/turf/T = get_turf(src)
|
||||
return T.attackby(C, user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/lattice/catwalk/mining/deconstruction_hints(mob/user)
|
||||
return
|
||||
|
||||
/obj/structure/lattice/lava
|
||||
name = "heatproof support lattice"
|
||||
desc = "A specialized support beam for building across lava. Watch your step."
|
||||
/obj/structure/lattice/catwalk/lava
|
||||
name = "heatproof catwalk"
|
||||
desc = "A specialized catwalk for building across lava. Watch your step."
|
||||
icon = 'icons/obj/smooth_structures/catwalk.dmi'
|
||||
icon_state = "catwalk-0"
|
||||
base_icon_state = "catwalk"
|
||||
number_of_mats = 1
|
||||
color = "#5286b9ff"
|
||||
smoothing_flags = SMOOTH_BITMASK
|
||||
smoothing_groups = SMOOTH_GROUP_LATTICE + SMOOTH_GROUP_OPEN_FLOOR
|
||||
canSmoothWith = SMOOTH_GROUP_LATTICE
|
||||
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP
|
||||
resistance_flags = FIRE_PROOF | LAVA_PROOF
|
||||
give_turf_traits = list(TRAIT_LAVA_STOPPED, TRAIT_CHASM_STOPPED, TRAIT_IMMERSE_STOPPED, TRAIT_HYPERSPACE_STOPPED)
|
||||
|
||||
/obj/structure/lattice/lava/deconstruction_hints(mob/user)
|
||||
/obj/structure/lattice/catwalk/lava/deconstruction_hints(mob/user)
|
||||
return span_notice("The rods look like they could be <b>cut</b>, but the <i>heat treatment will shatter off</i>. There's space for a <i>tile</i>.")
|
||||
|
||||
/obj/structure/lattice/lava/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
|
||||
/obj/structure/lattice/catwalk/lava/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
|
||||
. = ..()
|
||||
if(!ismetaltile(attacking_item))
|
||||
return
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#define OVERLAY_OFFSET_START 0
|
||||
#define OVERLAY_OFFSET_EACH 5
|
||||
#define MINERALS_PER_BOULDER 3
|
||||
#define MAX_MINERAL_PICK_ATTEMPTS 10
|
||||
|
||||
/obj/structure/ore_vent
|
||||
name = "ore vent"
|
||||
@@ -171,26 +172,37 @@
|
||||
/obj/structure/ore_vent/proc/generate_mineral_breakdown(new_minerals = MINERAL_TYPE_OPTIONS_RANDOM, map_loading = FALSE)
|
||||
if(new_minerals < 1)
|
||||
CRASH("generate_mineral_breakdown called with new_minerals < 1.")
|
||||
var/list/available_mats = difflist(first = SSore_generation.ore_vent_minerals, second = mineral_breakdown, skiprep = 1)
|
||||
for(var/i in 1 to new_minerals)
|
||||
if(!length(SSore_generation.ore_vent_minerals) && map_loading)
|
||||
// We should prevent this from happening in SSore_generation, but if not then we crash here
|
||||
CRASH("No minerals left to pick from! We may have spawned too many ore vents in init, or the map config in seedRuins may not have enough resources for the mineral budget.")
|
||||
var/datum/material/new_material
|
||||
if(map_loading)
|
||||
if(length(available_mats))
|
||||
new_material = pick(GLOB.ore_vent_minerals_lavaland)
|
||||
var/datum/material/surrogate_mat = pick(SSore_generation.ore_vent_minerals)
|
||||
available_mats -= surrogate_mat
|
||||
SSore_generation.ore_vent_minerals -= surrogate_mat
|
||||
else
|
||||
new_material = pick(available_mats)
|
||||
available_mats -= new_material
|
||||
SSore_generation.ore_vent_minerals -= new_material
|
||||
else
|
||||
new_material = pick(GLOB.ore_vent_minerals_lavaland)
|
||||
mineral_breakdown[new_material] = rand(1, 4)
|
||||
|
||||
//should have enough minerals for the vent during round start
|
||||
var/list/available_minerals = SSore_generation.ore_vent_minerals
|
||||
if(map_loading && available_minerals.len < new_minerals)
|
||||
CRASH("No minerals left to pick from! We may have spawned too many ore vents in init, or the map config in seedRuins may not have enough resources for the mineral budget.")
|
||||
|
||||
var/list/datum/material/picked_minerals = list()
|
||||
for(var/_ in 1 to new_minerals)
|
||||
var/datum/material/mineral
|
||||
|
||||
//pick an unique mineral but try only MAX_MINERAL_PICK_ATTEMPTS times before giving up else we could be stuck here forever
|
||||
var/attempts = 0
|
||||
do
|
||||
mineral = length(mineral_breakdown) ? pick_weight(mineral_breakdown) : null
|
||||
if(map_loading)
|
||||
if(!mineral || !available_minerals.Find(mineral))
|
||||
mineral = pick(available_minerals)
|
||||
else
|
||||
mineral = mineral || pick_weight(GLOB.ore_vent_minerals_lavaland)
|
||||
attempts += 1
|
||||
while(attempts < MAX_MINERAL_PICK_ATTEMPTS && picked_minerals.Find(mineral))
|
||||
|
||||
//register the picked mineral, removing it from the round start available minerals if nessassary
|
||||
if(map_loading)
|
||||
available_minerals -= mineral
|
||||
picked_minerals |= mineral
|
||||
|
||||
//assign random weights to picked minerals
|
||||
mineral_breakdown.Cut()
|
||||
for(var/datum/material/mineral as anything in picked_minerals)
|
||||
mineral_breakdown[mineral] = rand(1, new_minerals)
|
||||
|
||||
/**
|
||||
* Returns the quantity of mineral sheets in each ore vent's boulder contents roll.
|
||||
@@ -201,7 +213,7 @@
|
||||
* @params ore_floor The number of minerals already rolled. Used to scale the logarithmic function.
|
||||
*/
|
||||
/obj/structure/ore_vent/proc/ore_quantity_function(ore_floor)
|
||||
return SHEET_MATERIAL_AMOUNT * round(boulder_size * (log(rand(1 + ore_floor, 4 + ore_floor)) ** -1))
|
||||
return SHEET_MATERIAL_AMOUNT * max(round(boulder_size * (log(rand(1 + ore_floor, 4 + ore_floor)) ** -1)), 1)
|
||||
|
||||
/**
|
||||
* This confirms that the user wants to start the wave defense event, and that they can start it.
|
||||
@@ -472,8 +484,8 @@
|
||||
unique_vent = TRUE
|
||||
boulder_size = BOULDER_SIZE_SMALL
|
||||
mineral_breakdown = list(
|
||||
/datum/material/iron = 50,
|
||||
/datum/material/glass = 50,
|
||||
/datum/material/iron = 1,
|
||||
/datum/material/glass = 1,
|
||||
)
|
||||
|
||||
/obj/structure/ore_vent/random
|
||||
@@ -614,3 +626,4 @@
|
||||
#undef OVERLAY_OFFSET_START
|
||||
#undef OVERLAY_OFFSET_EACH
|
||||
#undef MINERALS_PER_BOULDER
|
||||
#undef MAX_MINERAL_PICK_ATTEMPTS
|
||||
|
||||
@@ -292,6 +292,7 @@
|
||||
return
|
||||
if(!can_rotate)
|
||||
user.balloon_alert(user, "can't rotate!")
|
||||
ui?.close()
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
|
||||
Reference in New Issue
Block a user