Skip to content

Commit

Permalink
Map Wall Decorations + Door/Step Triggered Mobspawns + 2 New Rooms (#…
Browse files Browse the repository at this point in the history
…1493)

Triggered Mobspawners + Some new Files

Creates some map objects to add flavor to randomly generated rooms. Also creates 3 new files to contain effect, lootspawners, and structures.
Creates lootspawners to randomize loot drops.
3 cosmetic structures and effects.

Update lc13_spawners.dm
  • Loading branch information
InsightfulParasite authored Nov 12, 2023
1 parent 2716887 commit b6b0b3f
Show file tree
Hide file tree
Showing 9 changed files with 434 additions and 56 deletions.
Binary file modified ModularTegustation/Teguicons/32x48.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/lc13_structures.dmi
Binary file not shown.
5 changes: 5 additions & 0 deletions ModularTegustation/lc13_effects.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//Cosmetic Effects
/obj/effect/wall_vent
name = "wall vent"
icon = 'ModularTegustation/Teguicons/lc13_structures.dmi'
icon_state = "wall_vent"
56 changes: 0 additions & 56 deletions ModularTegustation/lc13_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,59 +129,3 @@
if(C.linked_console)
LAZYADD(abnormalities, "[C.AbnormalityInfo()]: [C.relative_location]")
sortList(abnormalities)

//Spreading Structures Code
//Stolen and edited from alien weed code. I wanted a spreading structure that doesnt have the atmospheric element attached to its root.
/obj/structure/spreading
name = "spreading structure"
desc = "This thing seems to spread when supplied with a outside signal."
max_integrity = 15
anchored = TRUE
density = FALSE
layer = TURF_LAYER
plane = FLOOR_PLANE
var/conflict_damage = 10
var/last_expand = 0 //last world.time this weed expanded
var/expand_cooldown = 1.5 SECONDS
var/can_expand = TRUE
var/static/list/blacklisted_turfs

/obj/structure/spreading/Initialize()
. = ..()

if(!blacklisted_turfs)
blacklisted_turfs = typecacheof(list(
/turf/open/space,
/turf/open/chasm,
/turf/open/lava,
/turf/open/openspace))

/obj/structure/spreading/proc/expand(bypasscooldown = FALSE)
if(!can_expand)
return

if(!bypasscooldown)
last_expand = world.time + expand_cooldown

var/turf/U = get_turf(src)
if(is_type_in_typecache(U, blacklisted_turfs))
qdel(src)
return FALSE

var/list/spread_turfs = U.GetAtmosAdjacentTurfs()
shuffle_inplace(spread_turfs)
for(var/turf/T in spread_turfs)
if(locate(/obj/structure/spreading) in T)
var/obj/structure/spreading/S = locate(/obj/structure/spreading) in T
if(S.type != type) //if it is not another of the same spreading structure.
S.take_damage(conflict_damage, BRUTE, "melee", 1)
break
last_expand += (0.6 SECONDS) //if you encounter another of the same then the delay increases
continue

if(is_type_in_typecache(T, blacklisted_turfs))
continue

new type(T)
break
return TRUE
93 changes: 93 additions & 0 deletions ModularTegustation/lc13_spawners.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* LoR13 Lootspawners
Dependant on the spawners lootdrop.dm and any file the contents may belong in. */
/obj/effect/spawner/lootdrop/chaotic_random
name = "chaotic random"
lootcount = 3
lootdoubles = TRUE
/* Uses pickweight chances. Higher is more likely. May change this later on
because due to the nature of pickweight. If you had one item that had 1000 chance
and one item with 100 chance you would have a 1/11 chance of getting the rarer item.
if you had 3 of the 1000 chance items that would then become a 1/31 chance since the
total is the max amount of chances... */
loot = list(
//Medical
/obj/item/stack/medical/aloe = 1,
/obj/item/stack/medical/suture/emergency = 1,
/obj/item/stack/medical/suture = 1,
//Money
/obj/item/storage/wallet/random = 1,
/obj/item/stack/spacecash/c1 = 1,
//Misc
/obj/item/organ/liver/fly = 1,
/obj/item/storage/book = 1,
/obj/item/lipstick/random = 1,
/obj/item/kitchen/knife/shiv = 1,
/obj/item/toy/plush/lizardplushie = 1,
/obj/item/toy/plush/blank = 1,
/obj/item/bedsheet/dorms = 1,
//Food
/obj/item/food/deadmouse = 1,
/obj/item/food/egg = 1,
/obj/item/food/boiledegg = 1,
/obj/item/food/honeybar = 1,
/obj/item/food/soup/stew = 1,
/obj/item/food/chewable/gumball = 1,
/obj/item/food/branrequests = 1,
/obj/item/food/tinychocolate = 1,
/obj/item/food/canned/peaches = 1,
/obj/item/food/canned/beans = 1,
/obj/item/storage/cans/sixsoda = 1,
/obj/item/storage/cans/sixbeer = 1,
/obj/item/food/candy = 1,
)

//Pseudo Group Spawners
/obj/effect/spawner/scatter/shrimp
name = "shrimp squad spawn"
max_spawns = 5
loot_table = list(/mob/living/simple_animal/hostile/shrimp = 1,
/mob/living/simple_animal/hostile/shrimp_soldier = 1)

// Dependant on step_triggers.dm
/obj/effect/step_trigger/place_atom
mobs_only = TRUE
//If we only trigger on creatures that have a C.key
var/ckey_only = FALSE
/* In the map editor just copy paste the type path of the thing.
If you edit the atom_path variable in the map editor then
If anything happens to that mob code you will need to change it
in the map editor.*/
var/atom_path
var/atom_rename
var/spawn_flavor_text
var/happens_once = TRUE
//Cords are offset from current position.
var/spawn_dist_x = 0
var/spawn_dist_y = 0

/obj/effect/step_trigger/place_atom/Trigger(atom/movable/A)
//This code might be a bit sloppy. -IP
if(ismob(A))
var/mob/M = A
if(ckey_only && !M.client)
return

//Remotely finds the turf where we spawn the thing.
var/checkturf = get_turf(locate(x + spawn_dist_x, y + spawn_dist_y, z))
if(checkturf)
CreateThing(checkturf)
if(happens_once)
qdel(src)

/obj/effect/step_trigger/place_atom/proc/CreateThing(turf/T)
if(atom_path)
var/atom/movable/M = new atom_path(T)
//The thing has somehow failed to spawn.
if(!M)
return
//TECHNICALLY you could spawn a single turf with this? -IP
if(atom_rename && !iseffect(M))
M.name = atom_rename
if(spawn_flavor_text)
M.visible_message("<span class='danger'>[M] [spawn_flavor_text].</span>")
return M
73 changes: 73 additions & 0 deletions ModularTegustation/lc13_structures.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* Spreading Structures Code
Stolen and edited from alien weed code. I wanted a spreading
structure that doesnt have the atmospheric element attached to its root. */
/obj/structure/spreading
name = "spreading structure"
desc = "This thing seems to spread when supplied with a outside signal."
max_integrity = 15
anchored = TRUE
density = FALSE
layer = TURF_LAYER
plane = FLOOR_PLANE
var/conflict_damage = 10
var/last_expand = 0 //last world.time this weed expanded
var/expand_cooldown = 1.5 SECONDS
var/can_expand = TRUE
var/static/list/blacklisted_turfs

/obj/structure/spreading/Initialize()
. = ..()

if(!blacklisted_turfs)
blacklisted_turfs = typecacheof(list(
/turf/open/space,
/turf/open/chasm,
/turf/open/lava,
/turf/open/openspace))

/obj/structure/spreading/proc/expand(bypasscooldown = FALSE)
if(!can_expand)
return

if(!bypasscooldown)
last_expand = world.time + expand_cooldown

var/turf/U = get_turf(src)
if(is_type_in_typecache(U, blacklisted_turfs))
qdel(src)
return FALSE

var/list/spread_turfs = U.GetAtmosAdjacentTurfs()
shuffle_inplace(spread_turfs)
for(var/turf/T in spread_turfs)
if(locate(/obj/structure/spreading) in T)
var/obj/structure/spreading/S = locate(/obj/structure/spreading) in T
if(S.type != type) //if it is not another of the same spreading structure.
S.take_damage(conflict_damage, BRUTE, "melee", 1)
break
last_expand += (0.6 SECONDS) //if you encounter another of the same then the delay increases
continue

if(is_type_in_typecache(T, blacklisted_turfs))
continue

new type(T)
break
return TRUE

//Cosmetic Structures
/obj/structure/cavein_floor
name = "blocked off floor entrance"
desc = "An entrance to some underground facility that has been caved in."
icon = 'ModularTegustation/Teguicons/lc13_structures.dmi'
icon_state = "cavein_floor"
anchored = TRUE

/obj/structure/cavein_door
name = "blocked off facility entrance"
desc = "A entrance to somewhere that has been blocked off with rubble."
icon = 'ModularTegustation/Teguicons/32x48.dmi'
icon_state = "cavein_door"
pixel_y = -8
base_pixel_y = -8
anchored = TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@
name = "Sweeper Pen - Medium West"
room_id = "sweeper_pen"
mappath = "_maps/RandomRooms/backstreets/medium_west/sweeper_pen.dmm"

/datum/map_template/random_room/backstreets/medium_west/lcorp_office
name = "LCorp Office - Medium West"
room_id = "lcorp_office_me"
mappath = "_maps/RandomRooms/backstreets/medium_west/lcorp_office.dmm"
Loading

0 comments on commit b6b0b3f

Please sign in to comment.