Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Ore vents now have countermeasures against walling them off from all sides. #3404

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
/// called when a spawner spawns a mob
#define COMSIG_SPAWNER_SPAWNED "spawner_spawned"

/// Called when a spawner spawns a mob in a turf peel, but we need to use the default case.
#define COMSIG_SPAWNER_SPAWNED_DEFAULT "spawner_spawned_default"

/// called when a ghost clicks a spawner role: (mob/living)
#define COMSIG_GHOSTROLE_SPAWNED "ghostrole_spawned"
3 changes: 3 additions & 0 deletions code/__HELPERS/spatial_info.dm
Original file line number Diff line number Diff line change
Expand Up @@ -468,5 +468,8 @@
if(possible_spawn in inner)
continue
peel += possible_spawn

if(!length(peel))
return center //Offer the center only as a default case when we don't have a valid circle.
return peel

2 changes: 2 additions & 0 deletions code/datums/components/spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
picked_spot = pick(turf_peel(spawn_distance, spawn_distance_exclude, spawner.loc, view_based = TRUE))
if(!picked_spot)
picked_spot = pick(circle_range_turfs(spawner.loc, spawn_distance))
if(picked_spot == spawner.loc)
SEND_SIGNAL(spawner, COMSIG_SPAWNER_SPAWNED_DEFAULT)
created = new chosen_mob_type(picked_spot)
else if (spawn_distance >= 1)
picked_spot = pick(circle_range_turfs(spawner.loc, spawn_distance))
Expand Down
9 changes: 9 additions & 0 deletions code/game/objects/structures/lavaland/ore_vent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
icon_state = icon_state_tapped
update_appearance(UPDATE_ICON_STATE)
add_overlay(mutable_appearance('icons/obj/mining_zones/terrain.dmi', "well", ABOVE_MOB_LAYER))

RegisterSignal(src, COMSIG_SPAWNER_SPAWNED_DEFAULT, PROC_REF(anti_cheese))
return ..()

/obj/structure/ore_vent/Destroy()
Expand Down Expand Up @@ -407,6 +409,13 @@
COOLDOWN_START(src, manual_vent_cooldown, 10 SECONDS)
return new_rock

/**
* When the ore vent cannot spawn a mob due to being blocked from all sides, we cause some MILD, MILD explosions.
* Explosion matches a gibtonite light explosion, as a way to clear neartby solid structures, with a high likelyhood of breaking the NODE drone.
*/
/obj/structure/ore_vent/proc/anti_cheese()
explosion(src, heavy_impact_range = 1, light_impact_range = 3, flame_range = 0, flash_range = 0, adminlog = FALSE)

//comes with the station, and is already tapped.
/obj/structure/ore_vent/starter_resources
name = "active ore vent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
icon_living = "mining_node_active"
icon_dead = "mining_node_active"

maxHealth = 500
health = 500
maxHealth = 300 // We adjust the max health based on the vent size in the arrive() proc.
health = 300
density = TRUE
pass_flags = PASSTABLE|PASSGRILLE|PASSMOB
mob_size = MOB_SIZE_LARGE
Expand Down Expand Up @@ -74,6 +74,8 @@

/mob/living/basic/node_drone/proc/arrive(obj/structure/ore_vent/parent_vent)
attached_vent = parent_vent
maxHealth = 300 + ((attached_vent.boulder_size/BOULDER_SIZE_SMALL) * 100)
health = maxHealth
flying_state = FLY_IN_STATE
update_appearance(UPDATE_ICON_STATE)
pixel_z = 400
Expand Down
Loading