Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master220' into mhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDawnFox committed Jan 22, 2024
2 parents 3ebedfa + e166388 commit aa0ee90
Show file tree
Hide file tree
Showing 138 changed files with 7,799 additions and 4,116 deletions.
3,887 changes: 1,980 additions & 1,907 deletions _maps/map_files/Delta/delta.dmm

Large diffs are not rendered by default.

419 changes: 244 additions & 175 deletions _maps/map_files/cerestation/cerestation.dmm

Large diffs are not rendered by default.

2,633 changes: 1,481 additions & 1,152 deletions _maps/map_files/cyberiad/cyberiad.dmm

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions code/__DEFINES/cargo_quests.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define QUEST_DIFFICULTY_EASY (1<<0)
#define QUEST_DIFFICULTY_NORMAL (1<<1)
#define QUEST_DIFFICULTY_HARD (1<<2)
#define QUEST_DIFFICULTY_VERY_HARD (1<<3)
1 change: 1 addition & 0 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#define BLOCK_CAPSAICIN 262144 // Prevents from passing capsaicin onto human

#define NOSHARPENING 524288 // Prevents from sharpening item with whetstone

// Update flags for [/atom/proc/update_appearance]
/// Update the atom's name
Expand Down
5 changes: 3 additions & 2 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
#define INIT_ORDER_TICKETS -11
#define INIT_ORDER_LIGHTING -21
#define INIT_ORDER_SHUTTLE -22
#define INIT_ORDER_NIGHTSHIFT -23
#define INIT_ORDER_NANOMOB -24
#define INIT_ORDER_CARGO_QUESTS -23
#define INIT_ORDER_NIGHTSHIFT -24
#define INIT_ORDER_NANOMOB -25
#define INIT_ORDER_PATH -50
#define INIT_ORDER_PERSISTENCE -95

Expand Down
14 changes: 9 additions & 5 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,17 @@
return 0

//Checks for specific types in a list
/proc/is_type_in_list(atom/A, list/L)
/proc/is_type_in_list(atom/A, list/L, include_children = TRUE)
if(!L || !L.len || !A)
return 0
return FALSE
for(var/type in L)
if(istype(A, type))
return 1
return 0
if(include_children)
if(istype(A, type))
return TRUE
else
if(A.type == type)
return TRUE
return FALSE

//Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches')
/proc/is_type_in_typecache(atom/A, list/L)
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/lists/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ GLOBAL_LIST_EMPTY(looping_sounds)
/// List of ckeys that have seen a blurb of a given key.
GLOBAL_LIST_EMPTY(blurb_witnesses)

/// List of cargo consoles that print reports on completed/expired orders
GLOBAL_LIST_EMPTY(cargo_announcers)
5 changes: 3 additions & 2 deletions code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
linked_action.Trigger(left_click = TRUE)
linked_action.UpdateButtonIcon()
transform = transform.Scale(0.8, 0.8)
alpha = 200
animate(src, transform = matrix(), time = 0.3 SECONDS, alpha = 255)
var/prev_alpha = alpha
alpha = clamp(prev_alpha - 55, 0, 200)
animate(src, transform = matrix(), time = 0.3 SECONDS, alpha = prev_alpha)
return TRUE


Expand Down
14 changes: 6 additions & 8 deletions code/_onclick/hud/parallax.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@
var/animate_time = 0
for(var/thing in C.parallax_layers)
var/obj/screen/parallax_layer/L = thing
L.icon_state = initial(L.icon_state)
if(istype(L, /obj/screen/parallax_layer/planet) && SSmapping.lavaland_theme?.planet_icon_state)
L.icon_state = SSmapping.lavaland_theme.planet_icon_state
else
L.icon_state = initial(L.icon_state)
L.update_o(C.view)
var/T = PARALLAX_LOOP_TIME / L.speed
if(T > animate_time)
Expand Down Expand Up @@ -339,13 +342,8 @@

/obj/screen/parallax_layer/planet/Initialize(mapload)
. = ..()
switch(SSmapping.lavaland_theme)
if(/turf/simulated/floor/plating/lava/smooth/lava_land_surface)
icon_state = "planet"
if(/turf/simulated/floor/plating/lava/smooth/lava_land_surface/plasma)
icon_state = "planet_plasma"
if(/turf/simulated/floor/chasm/straight_down/lava_land_surface)
icon_state = "planet_canyon"
if(SSmapping.lavaland_theme?.planet_icon_state)
icon_state = SSmapping.lavaland_theme.planet_icon_state

/obj/screen/parallax_layer/planet/update_status(mob/M)
var/turf/T = get_turf(M)
Expand Down
155 changes: 155 additions & 0 deletions code/controllers/subsystem/non-firing/cargo_quests.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#define NUMBER_OF_CC_QUEST 8
#define NUMBER_OF_CORP_QUEST 4
#define NUMBER_OF_PLASMA_QUEST 1

SUBSYSTEM_DEF(cargo_quests)
name = "Cargo Quests"
flags = SS_NO_FIRE
cpu_display = SS_CPUDISPLAY_LOW
ss_id = "cargo_quests"
init_order = INIT_ORDER_CARGO_QUESTS

var/list/centcomm_departaments = list()
var/list/corporations = list()
var/list/plasma_departaments = list()
var/list/quest_storages = list()
var/list/plasma_quests = list()
var/list/difficulties = list()

/datum/controller/subsystem/cargo_quests/Initialize()

for(var/typepath in subtypesof(/datum/quest_customer/centcomm))
var/datum/quest_customer/departament = new typepath()
if(!departament.departament_name)
continue
centcomm_departaments += departament

for(var/typepath in subtypesof(/datum/quest_customer/corp))
var/datum/quest_customer/corp/corp = new typepath()
if(!corp.departament_name)
continue
corporations += corp

for(var/typepath in subtypesof(/datum/quest_customer/plasma))
var/datum/quest_customer/plasma/plasma_dep = new typepath()
if(!plasma_dep.departament_name)
continue
plasma_departaments += plasma_dep

for(var/typepath in subtypesof(/datum/quest_difficulty))
var/datum/quest_difficulty/quest_difficulty = new typepath()
if(!quest_difficulty.weight)
continue
difficulties += quest_difficulty
difficulties[quest_difficulty] = quest_difficulty.weight


for(var/I = 1 to NUMBER_OF_CC_QUEST)
create_new_quest(pick(centcomm_departaments))
for(var/I = 1 to NUMBER_OF_CORP_QUEST)
create_new_quest(pick(corporations))
for(var/I = 1 to NUMBER_OF_PLASMA_QUEST)
create_new_quest(pick(plasma_departaments))

/datum/controller/subsystem/cargo_quests/proc/get_customer_list(datum/quest_customer/customer)
if(customer in centcomm_departaments)
return centcomm_departaments
if(customer in corporations)
return corporations
if(customer in plasma_departaments)
return plasma_departaments

/datum/controller/subsystem/cargo_quests/proc/remove_quest(quest_uid, reroll, complete, list/modificators, old_reward)
var/datum/cargo_quests_storage/quest = locateUID(quest_uid)
if(!istype(quest))
return
if(QDELETED(quest))
return
old_reward = old_reward || quest.reward
quest_storages.Remove(quest)
if(quest.quest_check_timer)
deltimer(quest.quest_check_timer)
quest.quest_check_timer = null
if(!reroll && quest.active)
for(var/obj/machinery/computer/supplyquest/workers/cargo_announcer in GLOB.cargo_announcers)
cargo_announcer.print_report(quest, complete, modificators)

if(!reroll && (quest.customer in plasma_departaments))
addtimer(CALLBACK(src, PROC_REF(create_new_quest), pick(get_customer_list(quest.customer))), 25 MINUTES)
else
create_new_quest(pick(get_customer_list(quest.customer)), reroll, quest.quest_difficulty)
qdel(quest)

/datum/controller/subsystem/cargo_quests/proc/create_new_quest(customer, reroll, old_difficulty)
var/datum/cargo_quests_storage/new_quest = new()
new_quest.customer = customer
if(reroll)
new_quest.quest_difficulty = old_difficulty
new_quest.can_reroll = FALSE
new_quest.generate()
quest_storages += new_quest

return new_quest

/datum/controller/subsystem/cargo_quests/proc/check_delivery(obj/structure/bigDelivery/delivery)
for(var/order in quest_storages)
var/datum/cargo_quests_storage/storage = order
if(!storage.active)
continue
var/reward = storage.check_quest_completion(delivery)
if(!reward)
continue
if(storage.customer.send_reward(reward))
return
return reward

/datum/controller/subsystem/cargo_quests/proc/remove_bfl_quests(count)
for(var/I = 1 to count)
var/datum/cargo_quests_storage/quest = pick_n_take(plasma_quests)
quest_storages.Remove(quest)
if(quest.quest_check_timer)
deltimer(quest.quest_check_timer)
quest.quest_check_timer = null
qdel(quest)


/datum/quest_difficulty
var/diff_flag
var/weight
var/min_quest_time
var/max_quest_time

/datum/quest_difficulty/proc/generate_timer(datum/cargo_quests_storage/q_storage)
q_storage.time_start = world.time
q_storage.quest_time = rand(min_quest_time, max_quest_time) MINUTES
q_storage.quest_check_timer = addtimer(CALLBACK(SScargo_quests, TYPE_PROC_REF(/datum/controller/subsystem/cargo_quests, remove_quest), q_storage.UID()), q_storage.quest_time, TIMER_STOPPABLE)
q_storage.fast_check_timer = addtimer(VARSET_CALLBACK(q_storage, fast_failed, TRUE), 0.4 * q_storage.quest_time, TIMER_STOPPABLE)

/datum/quest_difficulty/easy
diff_flag = QUEST_DIFFICULTY_EASY
weight = 45
min_quest_time = 15
max_quest_time = 25

/datum/quest_difficulty/normal
diff_flag = QUEST_DIFFICULTY_NORMAL
weight = 35
min_quest_time = 20
max_quest_time = 30

/datum/quest_difficulty/hard
diff_flag = QUEST_DIFFICULTY_HARD
weight = 15
min_quest_time = 30
max_quest_time = 40

/datum/quest_difficulty/very_hard
diff_flag = QUEST_DIFFICULTY_VERY_HARD
weight = 5
min_quest_time = 30
max_quest_time = 60


#undef NUMBER_OF_CC_QUEST
#undef NUMBER_OF_CORP_QUEST
#undef NUMBER_OF_PLASMA_QUEST
16 changes: 6 additions & 10 deletions code/controllers/subsystem/non-firing/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SUBSYSTEM_DEF(mapping)
/// Waht map to fallback
var/datum/map/fallback_map = new /datum/map/delta
///What do we have as the lavaland theme today?
var/turf/simulated/floor/lavaland_theme
var/datum/lavaland_theme/lavaland_theme
///What primary cave theme we have picked for cave generation today.
var/cave_theme

Expand Down Expand Up @@ -38,7 +38,9 @@ SUBSYSTEM_DEF(mapping)
F << next_map.type

/datum/controller/subsystem/mapping/Initialize()
lavaland_theme = pick(/turf/simulated/floor/plating/lava/smooth/lava_land_surface, /turf/simulated/floor/plating/lava/smooth/lava_land_surface/plasma, /turf/simulated/floor/chasm/straight_down/lava_land_surface)
var/datum/lavaland_theme/lavaland_theme_type = pick(subtypesof(/datum/lavaland_theme))
ASSERT(lavaland_theme_type)
lavaland_theme = new lavaland_theme_type
log_startup_progress("We're in the mood for [initial(lavaland_theme.name)] today...") //We load this first. In the event some nerd ever makes a surface map, and we don't have it in lavaland in the event lavaland is disabled.
cave_theme = pick(BLOCKED_BURROWS, CLASSIC_CAVES, DEADLY_DEEPROCK)
log_startup_progress("We feel like [cave_theme] today...")
Expand Down Expand Up @@ -70,14 +72,8 @@ SUBSYSTEM_DEF(mapping)
log_startup_progress("Populating lavaland...")
var/lavaland_setup_timer = start_watch()
seedRuins(list(level_name_to_num(MINING)), CONFIG_GET(number/lavaland_budget), /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates)
switch(lavaland_theme)
if(/turf/simulated/floor/plating/lava/smooth/lava_land_surface)
spawn_rivers(level_name_to_num(MINING)) //Default spawn, no tweaks needed
if(/turf/simulated/floor/plating/lava/smooth/lava_land_surface/plasma) //More rivers, smaller
spawn_rivers(level_name_to_num(MINING), nodes = 2)
spawn_rivers(level_name_to_num(MINING), nodes = 2)
if(/turf/simulated/floor/chasm/straight_down/lava_land_surface) //Thiner chasms, bridges, reaches to edge of map.
spawn_rivers(level_name_to_num(MINING), nodes = 6, turf_type = /turf/simulated/floor/plating/lava/smooth/mapping_lava, whitelist_area = /area/lavaland/surface/outdoors, min_x = 50, min_y = 7, max_x = 250, max_y = 225, prob = 10, prob_loss = 5)
if(lavaland_theme)
lavaland_theme.setup()
var/time_spent = stop_watch(lavaland_setup_timer)
log_startup_progress("Successfully populated lavaland in [time_spent]s.")
if(time_spent >= 10)
Expand Down
7 changes: 1 addition & 6 deletions code/controllers/subsystem/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,12 @@ SUBSYSTEM_DEF(shuttle)
var/obj/docking_port/mobile/supply/supply
var/ordernum = 1 //order number given to next order
var/points = 50 //number of trade-points we have
var/points_per_decisecond = 0.005 //points gained every decisecond
var/points_per_decisecond = 0.0025 //points gained every decisecond
var/points_per_slip = 2 //points gained per slip returned
var/points_per_crate = 5 //points gained per crate returned
var/points_per_intel = 250 //points gained per intel returned
var/points_per_plasma = 5 //points gained per plasma returned
var/points_per_design = 25 //points gained per research design returned
var/points_per_gem = 100 //points gained per gem returned
var/centcom_message = null //Remarks from Centcom on how well you checked the last order.
var/list/discoveredPlants = list() //Typepaths for unusual plants we've already sent CentComm, associated with their potencies
var/list/techLevels = list()
var/list/researchDesigns = list()
var/list/shoppinglist = list()
var/list/requestlist = list()
var/list/supply_packs = list()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/cache/crew.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new())

if(C.sensor_mode >= SUIT_SENSOR_TRACKING)
var/area/A = get_area(H)
crewmemberData["area"] = sanitize(A.name)
crewmemberData["area"] = A.name
crewmemberData["x"] = pos.x
crewmemberData["y"] = pos.y

Expand Down
48 changes: 48 additions & 0 deletions code/datums/components/sharpening.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Sharpening component
*
* Makes an item sharpenable with a whetstone
*
*/
/datum/component/sharpening
dupe_mode = COMPONENT_DUPE_UNIQUE
var/damage_increase

/datum/component/sharpening/Initialize(damage_increase = 0)
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE
src.damage_increase = damage_increase

/datum/component/sharpening/RegisterWithParent()
RegisterSignal(parent, COMSIG_ITEM_SHARPEN_ACT, PROC_REF(on_sharpen))

/datum/component/sharpening/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_ITEM_SHARPEN_ACT))

/datum/component/sharpening/proc/on_sharpen(obj/item/item, amount, max_amount)
SIGNAL_HANDLER

if(!item || HAS_TRAIT(item, TRAIT_WIELDED))
return COMPONENT_BLOCK_SHARPEN_BLOCKED

if(amount <= damage_increase)
return COMPONENT_BLOCK_SHARPEN_ALREADY
// Already sharpened items can only be sharpened with the best whetstone on the difference between them
amount -= damage_increase

var/force = item.force
var/datum/component/two_handed/TH_component = item.GetComponent(/datum/component/two_handed)
if(TH_component)
force = TH_component.force_wielded

var/obj/item/clothing/gloves/color/black/razorgloves/razorgloves = item
if(istype(razorgloves))
force = razorgloves.razor_damage_high

if(force >= max_amount || item.throwforce >= max_amount || item.flags & NOSHARPENING)
return COMPONENT_BLOCK_SHARPEN_MAXED

damage_increase = min(damage_increase + amount, (max_amount - force))
item.sharpen_act(damage_increase)

return COMPONENT_BLOCK_SHARPEN_APPLIED
Loading

0 comments on commit aa0ee90

Please sign in to comment.