Skip to content

Commit

Permalink
pulse demon balance (#36587)
Browse files Browse the repository at this point in the history
* pulse demon balance

* saner

* stops a runtime

* Update code/modules/mob/living/simple_animal/hostile/pulse_demon/pulsedemon.dm

Co-authored-by: west3436 <[email protected]>

---------

Co-authored-by: west3436 <[email protected]>
  • Loading branch information
SECBATON-GRIFFON and west3436 committed Jun 8, 2024
1 parent 37b50d0 commit 60861a4
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 19 deletions.
4 changes: 2 additions & 2 deletions code/datums/gamemode/dynamic/dynamic_rulesets_latejoin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
/datum/dynamic_ruleset/latejoin/pulse_demon
name = "Pulse Demon Infiltration"
role_category = /datum/role/pulse_demon
enemy_jobs = list("Station Engineer","Chief Engineer")
required_enemies = list(1,1,1,1,1,1,1,1,1,1)
enemy_jobs = list("Station Engineer","Chief Engineer","Warden","Head of Security","Captain","AI","Cyborg")
required_enemies = list(2,2,2,2,2,2,2,2,2,2)
required_candidates = 1
weight = BASE_RULESET_WEIGHT
weight_category = "Pulse"
Expand Down
4 changes: 2 additions & 2 deletions code/datums/gamemode/dynamic/dynamic_rulesets_midround.dm
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,8 @@
/datum/dynamic_ruleset/midround/from_ghosts/pulse_demon
name = "Pulse Demon Infiltration"
role_category = /datum/role/pulse_demon
enemy_jobs = list("Station Engineer","Chief Engineer")
required_enemies = list(1,1,1,1,1,1,1,1,1,1)
enemy_jobs = list("Station Engineer","Chief Engineer","Warden","Head of Security","Captain","AI","Cyborg")
required_enemies = list(2,2,2,2,2,2,2,2,2,2)
required_candidates = 1
weight = BASE_RULESET_WEIGHT
weight_category = "Pulse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
var/draining = TRUE //For draining power or not
var/move_divide = 16 //when unlocked, ability lets you move out of cables with a BIG slowdown
var/powerloss_alerted = FALSE //Prevent spam notifying
var/health_lock = 0 //Goes down every tick, while this is on it prevents the Pulse Demon from regenerating
var/emp_lock = 0 //Goes down every tick, while this is on it prevents the Pulse Demon from regenerating

//TYPES
var/area/controlling_area // Area controlled from an APC
Expand All @@ -78,6 +78,9 @@
current_cable = locate(/obj/structure/cable) in loc
if(!current_cable)
death()
return
if(current_cable.powernet)
current_cable.powernet.haspulsedemon = TRUE
else
if(istype(current_power,/obj/machinery/power/apc))
controlling_area = get_area(current_power)
Expand Down Expand Up @@ -176,7 +179,7 @@
//TODO add a sound

/mob/living/simple_animal/hostile/pulse_demon/proc/power_restored()
if(!health_lock)
if(!emp_lock)
var/health_to_add = maxHealth - health < health_regen_rate ? maxHealth - health : health_regen_rate
if(health < maxHealth)
health = min(maxHealth, health + health_to_add)
Expand All @@ -187,9 +190,9 @@

/mob/living/simple_animal/hostile/pulse_demon/Life()
update_glow()
if(health_lock)
health_lock = max(--health_lock, 0)
if(!health_lock) //Tell the Pulse Demon it's all good.
if(emp_lock)
emp_lock = max(--emp_lock, 0)
if(!emp_lock) //Tell the Pulse Demon it's all good.
to_chat(src, "<span class='good'>You can regenerate again!</span>")
if(current_cable)
if(current_cable.avail() < amount_per_regen) // Drain our health if powernet is dead, otherwise drain powernet
Expand Down Expand Up @@ -227,6 +230,11 @@
playsound(T,"pd_wail_sound",50,1)
qdel(src) // We vaporise into thin air

/mob/living/simple_animal/hostile/pulse_demon/Destroy()
if(current_cable?.powernet)
current_cable.powernet.haspulsedemon = FALSE
. = ..()

/mob/living/simple_animal/hostile/pulse_demon/proc/is_under_tile()
var/turf/simulated/floor/F = get_turf(src)
return istype(F,/turf/simulated/floor) && F.floor_tile
Expand All @@ -244,6 +252,8 @@
spark(src,rand(2,4))
if(new_power)
current_power = new_power
if(current_cable?.powernet)
current_cable.powernet.haspulsedemon = FALSE
current_cable = null
forceMove(new_power.loc)
playsound(src,'sound/weapons/electriczap.ogg',50, 1)
Expand All @@ -266,6 +276,8 @@
else
if(new_cable)
current_cable = new_cable
if(current_cable?.powernet)
current_cable.powernet.haspulsedemon = TRUE
current_power = null
current_robot = null
current_bot = null
Expand All @@ -277,6 +289,8 @@
if(!moved)
forceMove(NewLoc)
else
if(current_cable?.powernet)
current_cable.powernet.haspulsedemon = FALSE
current_cable = null
current_power = null
current_robot = null
Expand Down Expand Up @@ -352,10 +366,9 @@

// We aren't tangible
/mob/living/simple_animal/hostile/pulse_demon/bullet_act(var/obj/item/projectile/Proj)
if(!is_under_tile())
if(istype(Proj,/obj/item/projectile/ion))
return ..()
visible_message("<span class ='warning'>\the [Proj] goes right through \the [src]!</span>")
if(istype(Proj,/obj/item/projectile/ion))
return ..()
visible_message("<span class ='warning'>\the [Proj] goes right through \the [src]!</span>")

/mob/living/simple_animal/hostile/pulse_demon/vine_protected()
return 1
Expand All @@ -367,7 +380,7 @@
// Unless...
/mob/living/simple_animal/hostile/pulse_demon/Crossed(atom/movable/AM)
. = ..()
if(!is_under_tile() && istype(AM,/obj/item/projectile/ion))
if(istype(AM,/obj/item/projectile/ion))
AM.to_bump(src)

// Dumb moves
Expand Down Expand Up @@ -396,7 +409,7 @@
to_chat(src, "<span class='warning'>You have been blasted by an EMP and cannot regenerate for a while!</span>")
playsound(get_turf(src),"pd_wail_sound",50,1)
health -= round(max(25, round(maxHealth/4)), 1) //Takes 1/4th of max health as damage if health is big enough
health_lock = 5 //EMP prevents the Pulse Demon from regenerating
emp_lock = 5 //EMP prevents the Pulse Demon from regenerating or using powers

// Shock therapy
/mob/living/simple_animal/hostile/pulse_demon/attack_hand(mob/living/carbon/human/M as mob)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@
return FALSE
if(istype(user,/mob/living/simple_animal/hostile/pulse_demon))
var/mob/living/simple_animal/hostile/pulse_demon/PD = user
if (PD.charge < charge_cost) // Custom charge handling
if(PD.emp_lock)
to_chat(PD, "<span class='warning'>You cannot use this ability while unable to regenerate.</span>")
return FALSE
if(PD.charge < charge_cost) // Custom charge handling
to_chat(PD, "<span class='warning'>You are too low on power, this spell needs a charge of [charge_cost]W to cast.</span>")
return FALSE
else //only pulse demons allowed
Expand Down
9 changes: 7 additions & 2 deletions code/modules/power/cable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,13 @@ By design, d1 is the smallest direction and d2 is the highest
src.add_fingerprint(user)

/obj/structure/cable/proc/report_load(mob/user)
if((powernet) && (powernet.avail > 0)) // is it powered?
to_chat(user, "<SPAN CLASS='warning'>Power network status report - Load: [format_watts(powernet.get_load())] - Available: [format_watts(powernet.avail)].</SPAN>")
if(powernet)
if(powernet.avail > 0) // is it powered?
to_chat(user, "<SPAN CLASS='warning'>Power network status report - Load: [format_watts(powernet.get_load())] - Available: [format_watts(powernet.avail)].</SPAN>")
else
to_chat(user, "<SPAN CLASS='notice'>The cable is not powered.</SPAN>")
if(powernet.haspulsedemon)
to_chat(user, "<SPAN CLASS='warning'>Strange malicious pull on load detected, possible sentience.</SPAN>")
else
to_chat(user, "<SPAN CLASS='notice'>The cable is not powered.</SPAN>")

Expand Down
2 changes: 1 addition & 1 deletion code/modules/power/powernet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var/unsatisfied_priority = 1 // First load priority that did not reach full satisfaction last tick. Loads before it are 100% satisfied, loads after are 0% satisfied.
// An unsatisfied_priority of 0 means either there was either no power or more than enough to cover every load, so priorities get the
// same satisfaction (0% for no power, 100% for excess)

var/haspulsedemon = 0

////////////////////////////////////////////
// POWERNET DATUM PROCS
Expand Down

0 comments on commit 60861a4

Please sign in to comment.