Skip to content

Commit

Permalink
Merge branch 'master' into Music-player
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelkitty286 authored Sep 26, 2023
2 parents 22b0e83 + 2e223ea commit 9072181
Show file tree
Hide file tree
Showing 122 changed files with 9,188 additions and 8,226 deletions.
1 change: 1 addition & 0 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3178,6 +3178,7 @@
#include "code\modules\materials\definitions\misc\snow.dm"
#include "code\modules\materials\definitions\misc\wax.dm"
#include "code\modules\materials\definitions\organic\bone.dm"
#include "code\modules\materials\definitions\organic\chitin.dm"
#include "code\modules\materials\definitions\organic\cotton.dm"
#include "code\modules\materials\definitions\organic\diona.dm"
#include "code\modules\materials\definitions\organic\flesh.dm"
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/unobserved_actor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@
view_size = world.view

// We aren't in darkness, loop for viewers.
for(var/mob/living/mob_target as anything in oviewers(my_turf, view_size)) // They probably cannot see us if we cannot see them... can they?
for(var/mob/living/mob_target in oviewers(my_turf, view_size)) // They probably cannot see us if we cannot see them... can they?
if(mob_target.client && !mob_target.is_blind() && !mob_target.silicon_privileges && !HAS_TRAIT(mob_target, TRAIT_UNOBSERVANT))
return TRUE
for(var/obj/vehicle/vehicle_target in oview(my_turf, view_size))
for(var/mob/vehicle_mob_target as anything in vehicle_target.occupants)
for(var/mob/vehicle_mob_target in vehicle_target.occupants)
if(vehicle_mob_target.client && !vehicle_mob_target.is_blind() && !HAS_TRAIT(vehicle_mob_target, TRAIT_UNOBSERVANT))
return TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/datums/recipe/crafting_recipes/recipes_primal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
result = /obj/item/saddle/stormdrifter
time = 60
reqs = list(/obj/item/stack/material/bone = 10,
/obj/item/stack/chitin = 5,
/obj/item/stack/material/chitin = 5,
/obj/item/stack/sinew = 10,
/obj/item/stack/animalhide/goliath_hide = 5
)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/recipe/material_recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
/datum/stack_recipe/material/check(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return ..()

/datum/stack_recipe/material/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
return ..()
24 changes: 16 additions & 8 deletions code/datums/recipe/material_recipes/furniture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,40 @@
exclusitivity = /obj/structure/bed
cost = 2

/datum/stack_recipe/material/furniture/bed/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return new /obj/structure/bed(where, stack.material)
/datum/stack_recipe/material/furniture/bed/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
created += new /obj/structure/bed(where, stack.material)
return TRUE

/datum/stack_recipe/material/furniture/double_bed
name = "double bed"
result_type = /obj/structure/bed/double
exclusitivity = /obj/structure/bed
cost = 3

/datum/stack_recipe/material/furniture/double_bed/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return new /obj/structure/bed/double(where, stack.material)
/datum/stack_recipe/material/furniture/double_bed/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
created += new /obj/structure/bed/double(where, stack.material)
return TRUE

/datum/stack_recipe/material/furniture/stool
name = "stool"
result_type = /obj/item/stool
exclusitivity = /obj/item/stool
cost = 3

/datum/stack_recipe/material/furniture/stool/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return new /obj/item/stool(where, stack.material)
/datum/stack_recipe/material/furniture/stool/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
created += new /obj/item/stool(where, stack.material)
return TRUE

/datum/stack_recipe/material/furniture/chair
name = "chair"
result_type = /obj/structure/bed/chair
exclusitivity = /obj/structure/bed
cost = 3

/datum/stack_recipe/material/furniture/chair/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return new /obj/structure/bed/chair(where, stack.material)
/datum/stack_recipe/material/furniture/chair/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
created += new /obj/structure/bed/chair(where, stack.material)
return TRUE
25 changes: 15 additions & 10 deletions code/datums/recipe/material_recipes/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,47 @@
result_type = /obj/structure/simple_door
cost = 5

/datum/stack_recipe/material/structure/door/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/structure/door/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
new /obj/structure/simple_door(where, stack.material)
created += new /obj/structure/simple_door(where, stack.material)
return TRUE

/datum/stack_recipe/material/structure/barricade
name = "barricade"
result_type = /obj/structure/barricade
cost = 5

/datum/stack_recipe/material/structure/barricade/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/structure/barricade/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
new /obj/structure/barricade(where, stack.material)
created += new /obj/structure/barricade(where, stack.material)
return TRUE

/datum/stack_recipe/material/structure/girder
name = "girder"
result_type = /obj/structure/girder
cost = 2

/datum/stack_recipe/material/structure/girder/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/structure/girder/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
new /obj/structure/girder(where, stack.material)
created += new /obj/structure/girder(where, stack.material)
return TRUE

/datum/stack_recipe/material/structure/low_wall
name = "low walls"
result_type = /obj/structure/wall_frame
cost = 2

/datum/stack_recipe/material/structure/low_wall/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/structure/low_wall/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
new /obj/structure/wall_frame(where, stack.material)
created += new /obj/structure/wall_frame(where, stack.material)
return TRUE

/datum/stack_recipe/material/structure/sculpting_block
name = "sculpting block"
result_type = /obj/structure/sculpting_block
cost = 15

/datum/stack_recipe/material/structure/sculpting_block/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/structure/sculpting_block/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
new /obj/structure/sculpting_block(where, stack.material)
created += new /obj/structure/sculpting_block(where, stack.material)
return TRUE
17 changes: 11 additions & 6 deletions code/datums/recipe/material_recipes/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,31 @@
result_type = /obj/item/clothing/gloves/ring/material
cost = 1

/datum/stack_recipe/material/tools/ring/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return new /obj/item/clothing/gloves/ring/material(where, stack.material)
/datum/stack_recipe/material/tools/ring/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
created += new /obj/item/clothing/gloves/ring/material(where, stack.material)
return TRUE

/datum/stack_recipe/material/tools/braclet
name = "ring"
result_type = /obj/item/clothing/accessory/bracelet/material
cost = 1

/datum/stack_recipe/material/tools/ring/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
return new /obj/item/clothing/accessory/bracelet/material(where, stack.material)
/datum/stack_recipe/material/tools/ring/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
for(var/i in 1 to amount)
created += new /obj/item/clothing/accessory/bracelet/material(where, stack.material)
return TRUE

/**
* for the /obj/item/material path
*/
/datum/stack_recipe/material/tools/simple
abstract_type = /datum/stack_recipe/material/tools/simple

/datum/stack_recipe/material/tools/simple/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir)
/datum/stack_recipe/material/tools/simple/make(atom/where, amount, obj/item/stack/material/stack, mob/user, silent, use_dir, list/created = list())
ASSERT(ispath(result_type, /obj/item/material))
return new result_type(where, stack.material)
new result_type(where, stack.material)
return TRUE

/datum/stack_recipe/material/tools/simple/baseball_bat
name = "baseball bat"
Expand Down
15 changes: 10 additions & 5 deletions code/datums/recipe/stack_recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,33 @@
* this is past point of no return
* shouldn't cancel under any circumstances
*
* * When overriding this proc you **must** ensure list/created has a = list() in the args, if it doesn't call ..() first. Otherwise, the pattern being used will runtime.
*
* @params
* * where - where to spawn result
* * amount - amount
* * stack - stack used
* * user - (optional) person crafting
* * silent - (optional) suppress feedback to user
* * use_dir - (optional) override dir if no user to get it from
* * creating - (optional) list will be populated of objects created. supply a list so you can read it, or don't to ignore.
*/
/datum/stack_recipe/proc/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir)
/datum/stack_recipe/proc/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir, list/created = list())
if(result_is_stack)
var/obj/item/stack/casted = result_type
var/max_amount = initial(casted.max_amount)
var/safety = 50
while(amount)
if(!--safety)
CRASH("safety hit")
var/obj/item/stack/created = new result_type(where, min(amount, max_amount))
amount -= created.amount
var/obj/item/stack/creating = new result_type(where, min(amount, max_amount))
amount -= creating.amount
created += creating
else
for(var/i in 1 to min(amount, 50))
var/atom/movable/created = new result_type(where)
created.setDir(use_dir)
var/atom/movable/creating = new result_type(where)
creating.setDir(use_dir)
created += creating
return TRUE

/**
Expand Down
28 changes: 16 additions & 12 deletions code/datums/recipe/stack_recipes/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,60 @@
result_type = /obj/item/oar
cost = 2

/datum/stack_recipe/oar/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir)
/datum/stack_recipe/oar/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir, list/created = list())
var/obj/item/stack/material/material_stack = stack
if(istype(material_stack))
for(var/i in 1 to amount)
new result_type(where, material_stack.material)
created += new result_type(where, material_stack.material)
else
for(var/i in 1 to amount)
new result_type(where)
created += new result_type(where)
return TRUE

/datum/stack_recipe/boat
name = "boat"
result_type = /obj/vehicle/ridden/boat
cost = 15

/datum/stack_recipe/boat/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir)
/datum/stack_recipe/boat/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir, list/created = list())
var/obj/item/stack/material/material_stack = stack
if(istype(material_stack))
for(var/i in 1 to amount)
new result_type(where, material_stack.material)
created += new result_type(where, material_stack.material)
else
for(var/i in 1 to amount)
new result_type(where)
created += new result_type(where)
return TRUE

/datum/stack_recipe/dragon_boat
name = "dragon boat"
result_type = /obj/vehicle/ridden/boat/dragon
cost = 25

/datum/stack_recipe/dragon_boat/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir)
/datum/stack_recipe/dragon_boat/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir, list/created = list())
var/obj/item/stack/material/material_stack = stack
if(istype(material_stack))
for(var/i in 1 to amount)
new result_type(where, material_stack.material)
created += new result_type(where, material_stack.material)
else
for(var/i in 1 to amount)
new result_type(where)
created += new result_type(where)
return TRUE

/datum/stack_recipe/pew
abstract_type = /datum/stack_recipe/pew
exclusitivity = /obj/structure/bed
cost = 1

/datum/stack_recipe/pew/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir)
/datum/stack_recipe/pew/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir, list/created = list())
var/obj/item/stack/material/material_stack = stack
if(istype(material_stack))
for(var/i in 1 to amount)
new result_type(where, material_stack.material)
created += new result_type(where, material_stack.material)
else
for(var/i in 1 to amount)
new result_type(where)
created += new result_type(where)
return TRUE

/datum/stack_recipe/pew/middle
name = "pew (middle)"
Expand Down
10 changes: 6 additions & 4 deletions code/datums/recipe/stack_recipes/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
return FALSE
return TRUE

/datum/stack_recipe/railing/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir = user?.dir)
/datum/stack_recipe/railing/make(atom/where, amount, obj/item/stack/stack, mob/user, silent, use_dir = user?.dir, list/created = list())
if(isnull(use_dir))
return
var/obj/structure/railing/built = new(where, TRUE)
built.setDir(use_dir)
return built
for(var/i in 1 to amount)
var/obj/structure/railing/built = new(where, TRUE)
built.setDir(use_dir)
created += built
return TRUE
17 changes: 12 additions & 5 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
CB.apply_default_parts(src)
RefreshParts()

// todo: this is fucked, refactor
/obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/storage/part_replacer/R)
if(!istype(R))
return 0
Expand All @@ -418,23 +419,29 @@
if(panel_open || !R.panel_req)
var/obj/item/circuitboard/CB = circuit
var/P
for(var/obj/item/stock_parts/A in component_parts)
for(var/obj/item/A in component_parts)
var/our_rating = A.rped_rating()
if(isnull(our_rating))
continue
for(var/T in CB.req_components)
if(ispath(A.type, T))
P = T
break
for(var/obj/item/stock_parts/B in R.contents)
for(var/obj/item/B in R.contents)
var/their_rating = B.rped_rating()
if(isnull(their_rating))
continue
if(istype(B, P) && istype(A, P))
if(B.rating > A.rating)
if(their_rating > our_rating)
R.remove_from_storage(B, src)
R.handle_item_insertion(A, null, TRUE)
component_parts -= A
component_parts += B
B.loc = null
to_chat(user, "<span class='notice'>[A.name] replaced with [B.name].</span>")
break
update_appearance()
RefreshParts()
update_appearance()
RefreshParts()
return 1

// todo: refactor
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/arcade/orion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ GLOBAL_LIST_INIT(orion_events, generate_orion_events())
src.audible_message("<b>\The [src]</b> says, 'Oh, God! Code Eight! CODE EIGHT! IT'S GONNA BL-'")
sleep(3.6)
src.visible_message(SPAN_DANGER("[src] explodes!"))
explosion(src.loc, 1,2,4)
explosion(src.loc, 0,0,2)
qdel(src)

#undef ORION_TRAIL_WINTURN
Loading

0 comments on commit 9072181

Please sign in to comment.