Skip to content

Commit

Permalink
Updates FAN (#1530)
Browse files Browse the repository at this point in the history
adds the actual content

Does some balancing

does meltdown stuff

minor text changes

changes

you can now work to turn off the fan

makes things better

makes requested changes

adds fan sfx

removes destroy
  • Loading branch information
Coxswain-Navigator authored Oct 26, 2023
1 parent de6d9be commit fd0be2e
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 1 deletion.
Binary file modified ModularTegustation/Teguicons/32x48.dmi
Binary file not shown.
Binary file modified ModularTegustation/Teguicons/status_sprites.dmi
Binary file not shown.
120 changes: 120 additions & 0 deletions code/modules/mob/living/simple_animal/abnormality/he/fan.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
maxHealth = 400
health = 400
threat_level = HE_LEVEL
start_qliphoth = 1
work_chances = list(
ABNORMALITY_WORK_INSTINCT = 100,
ABNORMALITY_WORK_INSIGHT = 100,
Expand All @@ -27,8 +28,18 @@
var/list/safe = list()
var/list/warning = list()
var/list/danger = list()
pet_bonus = "powers on" //saves a few lines of code by allowing funpet() to be called by attack_hand()
var/safework = FALSE //Safe if the abnormality was melting
var/successcount
var/turned_off = FALSE


/mob/living/simple_animal/hostile/abnormality/fan/examine(mob/user)
. = ..()
if(turned_off)
. += "<span class='notice'>It looks like it's turned off.</span>"

//Work Mechanics
/mob/living/simple_animal/hostile/abnormality/fan/WorkChance(mob/living/carbon/human/user, chance)
var/newchance = 100 - (successcount*3)
return newchance
Expand All @@ -39,6 +50,10 @@

/mob/living/simple_animal/hostile/abnormality/fan/PostWorkEffect(mob/living/carbon/human/user, work_type, pe, work_time)
if(user in danger)
if(safework)
to_chat(user, "<span class='notice'>You don't feel quite as tempted this time.</span>")
safework = FALSE
return
to_chat(user, "<span class='danger'>Oh.</span>")
user.throw_at(src, 10, 10, user, spin = TRUE, gentle = FALSE, quickstart = TRUE)
SLEEP_CHECK_DEATH(3)
Expand All @@ -56,3 +71,108 @@
else
safe+=user
to_chat(user, "<span class='nicegreen'>You could use some more.</span>")

//Meltdown
/mob/living/simple_animal/hostile/abnormality/fan/AttemptWork(mob/living/carbon/human/user, work_type)
if(turned_off)
to_chat(user, "<span class='nicegreen'>You hit the on switch. Aaah, that feels nice.</span>")
TurnOn()
return FALSE
if(datum_reference.console.meltdown)
safework = TRUE
return ..()

/mob/living/simple_animal/hostile/abnormality/fan/funpet(mob/petter)
if(turned_off)
to_chat(petter, "<span class='nicegreen'>You hit the on switch. Aaah, that feels nice.</span>")
TurnOn()

//Breach
/mob/living/simple_animal/hostile/abnormality/fan/ZeroQliphoth(mob/living/carbon/human/user)
. = ..()
if(!turned_off)
TurnOff()

/mob/living/simple_animal/hostile/abnormality/fan/proc/TurnOn(mob/living/carbon/human/user)
turned_off = FALSE
icon_state = "fan"
playsound(get_turf(src), 'sound/abnormalities/FAN/turnon.ogg', 100, FALSE, 2)
for(var/mob/living/carbon/human/L in GLOB.player_list)
var/datum/status_effect/stacking/fanhot/V = L.has_status_effect(/datum/status_effect/stacking/fanhot)
if(!V)
continue
else
qdel(V)

/mob/living/simple_animal/hostile/abnormality/fan/proc/TurnOff(mob/living/carbon/human/user)
turned_off = TRUE
icon_state = "fan_idle"
playsound(get_turf(src), 'sound/abnormalities/FAN/turnoff.ogg', 100, TRUE, 2)
HeatWave()
sound_to_playing_players_on_level('sound/abnormalities/seasons/summer_idle.ogg', 150, zlevel = z)

/mob/living/simple_animal/hostile/abnormality/fan/proc/HeatWave()
set waitfor = FALSE
if(!turned_off)
datum_reference.qliphoth_change(1)
return
for(var/mob/living/carbon/human/L in GLOB.player_list)
if(z != L.z || L.stat >= HARD_CRIT) // on a different Z level or dead
continue
var/datum/status_effect/stacking/fanhot/V = L.has_status_effect(/datum/status_effect/stacking/fanhot)
if(!V)
L.apply_status_effect(/datum/status_effect/stacking/fanhot)
else
V.add_stacks(1)
V.refresh()
SLEEP_CHECK_DEATH(3 SECONDS)
HeatWave(TRUE)

/datum/status_effect/stacking/fanhot
id = "stacking_fanhot"
status_type = STATUS_EFFECT_UNIQUE
duration = 200 //20 seconds
alert_type = null
stack_decay = 0
tick_interval = 10
stacks = 1
stack_threshold = 33
max_stacks = 35
on_remove_on_mob_delete = TRUE
alert_type = /atom/movable/screen/alert/status_effect/fanhot
consumed_on_threshold = FALSE

/atom/movable/screen/alert/status_effect/fanhot
name = "Hot"
desc = "Someone turn on the AC!"
icon = 'ModularTegustation/Teguicons/status_sprites.dmi'
icon_state = "hot"

/datum/status_effect/stacking/fanhot/on_apply()
. = ..()
to_chat(owner, "<span class='warning'>You're starting to sweat.</span>")
if(owner.client)
owner.add_client_colour(/datum/client_colour/glass_colour/orange)

/datum/status_effect/stacking/fanhot/add_stacks(stacks_added)
. = ..()
if(!stacks_added)
return
if(stacks > 10)
owner.apply_damage((stacks / 5), RED_DAMAGE, null, owner.run_armor_check(null, RED_DAMAGE), spread_damage = TRUE)
owner.playsound_local(owner, 'sound/effects/book_burn.ogg', 25, TRUE)

/datum/status_effect/stacking/fanhot/on_remove()
. = ..()
if(ishuman(owner))
to_chat(owner, "<span class='nicegreen'>Someone turned on the AC! Rejoice!</span>")
if(owner.client)
owner.remove_client_colour(/datum/client_colour/glass_colour/orange)

/datum/status_effect/stacking/fanhot/threshold_cross_effect()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
to_chat(owner, "<span class='warning'>IT'S TOO HOT!</span>")
H.adjust_fire_stacks(15)
H.IgniteMob()
stacks -= 5
3 changes: 2 additions & 1 deletion code/modules/paperwork/records/info/he.dm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@
abno_info = list(
"The inital work with F.A.N. is guaranteed to produce the maximum number of PE-boxes, but the chances decrease with each good work result.",
"Employees who worked on F.A.N. were observed to sit increasingly closer to F.A.N during subsequent work processes.",
"After working on F.A.N. for the fourth time, the employee fell into the fan and was ripped to shreds.")
"After working on F.A.N. for the fourth time, the employee fell into the fan and was ripped to shreds. Luckily, this does not happen during a Qliphoth meltdown.",
"When the Qliphoth counter became zero, the abnormality turned off and the facility began to heat up. Eventually, employees began taking mild RED damage due to overheating. Things turned back to normal when an employee hit the \"ON\" button.")

//680 KHz
/obj/item/paper/fluff/info/he/khz
Expand Down
Binary file added sound/abnormalities/FAN/turnoff.ogg
Binary file not shown.
Binary file added sound/abnormalities/FAN/turnon.ogg
Binary file not shown.

0 comments on commit fd0be2e

Please sign in to comment.