mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Refactors slaughter, shadow, and pulse demons to basic mobs (#30660)
* Refactors slaughter, shadow, and pulse demons to basic mobs * Linters * Fix * Projectile changes * Ensures demons speak common * Update code/modules/mob/living/basic/hostile/demons/demon_powers.dm Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
co-authored by
Burzah
parent
989ff989d6
commit
0cfe0594be
@@ -0,0 +1,52 @@
|
||||
/// A pulse demon requires 1000 watts to regenerate
|
||||
#define DEMON_REQUIRED_POWER 1000
|
||||
|
||||
/datum/event/spawn_pulsedemon
|
||||
var/key_of_pulsedemon
|
||||
|
||||
/datum/event/spawn_pulsedemon/proc/get_pulsedemon()
|
||||
var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a pulse demon?", ROLE_DEMON, FALSE, source = /mob/living/basic/demon/pulse_demon)
|
||||
if(!length(candidates))
|
||||
message_admins("no candidates were found for the pulse demon event.")
|
||||
kill()
|
||||
return
|
||||
|
||||
var/mob/C = pick(candidates)
|
||||
key_of_pulsedemon = C.key
|
||||
dust_if_respawnable(C)
|
||||
|
||||
if(!key_of_pulsedemon)
|
||||
kill()
|
||||
return
|
||||
|
||||
var/datum/mind/player_mind = new /datum/mind(key_of_pulsedemon)
|
||||
player_mind.active = TRUE
|
||||
|
||||
var/turf/spawn_loc = get_spawn_loc(player_mind.current)
|
||||
var/mob/living/basic/demon/pulse_demon/demon = new(spawn_loc)
|
||||
player_mind.transfer_to(demon)
|
||||
message_admins("[key_name_admin(demon)] has been made into a [initial(demon.name)] by an event.")
|
||||
log_game("[key_name_admin(demon)] was spawned as a [initial(demon.name)] by an event.")
|
||||
|
||||
/datum/event/spawn_pulsedemon/proc/get_spawn_loc()
|
||||
var/list/spawn_centers = list()
|
||||
for(var/datum/regional_powernet/P in SSmachines.powernets)
|
||||
for(var/obj/structure/cable/C in P.cables)
|
||||
if(!is_station_level(C.z) || P.available_power < DEMON_REQUIRED_POWER)
|
||||
break // skip iterating over this entire powernet, it's not on station or it has zero available power (so it's not suitable)
|
||||
|
||||
var/turf/simulated/floor/F = get_turf(C)
|
||||
// is a floor, not tiled, on station, in maintenance and cable has power?
|
||||
if(istype(F) && (!F.intact && !F.transparent_floor) && istype(get_area(C), /area/station/maintenance))
|
||||
spawn_centers += F
|
||||
if(!length(spawn_centers))
|
||||
message_admins("no suitable spawn locations were found for the pulse demon event.")
|
||||
log_debug("no suitable spawn locations were found for the pulse demon event.")
|
||||
kill()
|
||||
return
|
||||
return pick(spawn_centers)
|
||||
|
||||
/datum/event/spawn_pulsedemon/start()
|
||||
INVOKE_ASYNC(src, PROC_REF(get_pulsedemon))
|
||||
|
||||
#undef DEMON_REQUIRED_POWER
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "Slaughter Demon"
|
||||
noAutoEnd = TRUE
|
||||
var/key_of_slaughter
|
||||
var/mob/living/simple_animal/demon/demon = /mob/living/simple_animal/demon/slaughter/lesser
|
||||
var/mob/living/basic/demon/demon = /mob/living/basic/demon/slaughter/lesser
|
||||
nominal_severity = EVENT_LEVEL_MAJOR
|
||||
role_weights = list(ASSIGNMENT_SECURITY = 5, ASSIGNMENT_JANITOR = 5, ASSIGNMENT_MEDICAL = 3, ASSIGNMENT_CREW = 0.7)
|
||||
role_requirements = list(ASSIGNMENT_SECURITY = 4, ASSIGNMENT_JANITOR = 1, ASSIGNMENT_MEDICAL = 2, ASSIGNMENT_CREW = 25)
|
||||
@@ -29,7 +29,7 @@
|
||||
dust_if_respawnable(C)
|
||||
var/turf/spawn_loc = get_spawn_loc(player_mind.current)
|
||||
var/obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter(spawn_loc)
|
||||
var/mob/living/simple_animal/demon/S = new demon(holder)
|
||||
var/mob/living/basic/demon/S = new demon(holder)
|
||||
player_mind.transfer_to(S)
|
||||
player_mind.assigned_role = "Demon"
|
||||
player_mind.special_role = SPECIAL_ROLE_DEMON
|
||||
@@ -54,11 +54,11 @@
|
||||
|
||||
/datum/event/spawn_slaughter/greater
|
||||
name = "Greater Slaughter Demon"
|
||||
demon = /mob/living/simple_animal/demon/slaughter
|
||||
demon = /mob/living/basic/demon/slaughter
|
||||
|
||||
/datum/event/spawn_slaughter/shadow
|
||||
name = "Shadow Demon"
|
||||
demon = /mob/living/simple_animal/demon/shadow
|
||||
demon = /mob/living/basic/demon/shadow
|
||||
// Same as slaughter but without Jani
|
||||
role_weights = list(ASSIGNMENT_SECURITY = 5, ASSIGNMENT_MEDICAL = 3, ASSIGNMENT_CREW = 0.7)
|
||||
role_requirements = list(ASSIGNMENT_SECURITY = 4, ASSIGNMENT_MEDICAL = 2, ASSIGNMENT_CREW = 25)
|
||||
|
||||
Reference in New Issue
Block a user