Files
Bubberstation/code/game/objects/structures/holosign.dm
Emmett Gaines 456cd10d94 Radiation rework and subsystem (#30909)
* radiation rework and subsystem

* moves a few things to initialize and adds radiation insulation

* adds a radiation contamination mechanic and makes requested changes

I'm terrified by the possibilities from this

* radiated objects give off light

and hopefuly contamination is balanced

* fixes runtimes and an mc crash kek

removed the lighting part of contaminated objects
attempted some more balancing

* Collectors output power in process() gradualy

And some more balancing tweaks

* Excludes a bunch of things from becoming radioactive

* Ready for testmerge balancing

* Inverse square law was swapped

* testmerge balancing

fixes the geiger counter
buffs collector power gen
nerfs sm radiation
slightly buffs rad insulation
nerfs rad damage (and its burn)
raised the minimum radiation

* disabling the radiation subsystem won't build up rad wave datums forever

* rewrites how mobs handle radiation

upgrades geiger counter functionality
and more balance tweaks

* cleans up stuff and removes debug message

* Slight contamination buff

* Major rad wave performance boost

Also improves rad insulation
Buffs contamination, again

* Fixes insulation runtime

More balance and performance tweaks

* fixes rad collectors not receiving power

* The final balance commit

Fixes a major bug causing radiation to underperform
More geiger counter changes that will be changed more to add sounds

* Monkey business

* Geiger counter sounds

* cleanup and move components to their own initialize

* Some code cleanup

And forgotten changes

* Cleans up some trailing returns

* Mapping changes
2017-10-13 10:22:00 -04:00

133 lines
4.0 KiB
Plaintext

//holographic signs and barriers
/obj/structure/holosign
name = "holo sign"
icon = 'icons/effects/effects.dmi'
anchored = TRUE
max_integrity = 1
armor = list(melee = 0, bullet = 50, laser = 50, energy = 50, bomb = 0, bio = 0, rad = 0, fire = 20, acid = 20)
var/obj/item/holosign_creator/projector
/obj/structure/holosign/New(loc, source_projector)
if(source_projector)
projector = source_projector
projector.signs += src
..()
/obj/structure/holosign/Destroy()
if(projector)
projector.signs -= src
projector = null
return ..()
/obj/structure/holosign/attack_hand(mob/living/user)
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
user.changeNext_move(CLICK_CD_MELEE)
take_damage(5 , BRUTE, "melee", 1)
/obj/structure/holosign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
playsound(loc, 'sound/weapons/egloves.ogg', 80, 1)
if(BURN)
playsound(loc, 'sound/weapons/egloves.ogg', 80, 1)
/obj/structure/holosign/wetsign
name = "wet floor sign"
desc = "The words flicker as if they mean nothing."
icon = 'icons/effects/effects.dmi'
icon_state = "holosign"
/obj/structure/holosign/barrier
name = "holo barrier"
desc = "A short holographic barrier which can only be passed by walking."
icon_state = "holosign_sec"
pass_flags = LETPASSTHROW
density = TRUE
max_integrity = 20
var/allow_walk = 1 //can we pass through it on walk intent
/obj/structure/holosign/barrier/CanPass(atom/movable/mover, turf/target)
if(!density)
return 1
if(mover.pass_flags & (PASSGLASS|PASSTABLE|PASSGRILLE))
return 1
if(iscarbon(mover))
var/mob/living/carbon/C = mover
if(allow_walk && C.m_intent == MOVE_INTENT_WALK)
return 1
/obj/structure/holosign/barrier/engineering
icon_state = "holosign_engi"
/obj/structure/holosign/barrier/engineering/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_LIGHT_INSULATION)
/obj/structure/holosign/barrier/atmos
name = "holo firelock"
desc = "A holographic barrier resembling a firelock. Though it does not prevent solid objects from passing through, gas is kept out."
icon_state = "holo_firelock"
density = FALSE
layer = ABOVE_MOB_LAYER
anchored = TRUE
CanAtmosPass = ATMOS_PASS_NO
layer = ABOVE_MOB_LAYER
alpha = 150
/obj/structure/holosign/barrier/atmos/Initialize()
. = ..()
air_update_turf(TRUE)
/obj/structure/holosign/barrier/atmos/Destroy()
var/turf/T = get_turf(src)
. = ..()
T.air_update_turf(TRUE)
/obj/structure/holosign/barrier/cyborg
name = "Energy Field"
desc = "A fragile energy field that blocks movement. Excels at blocking lethal projectiles."
density = TRUE
max_integrity = 10
allow_walk = 0
/obj/structure/holosign/barrier/cyborg/bullet_act(obj/item/projectile/P)
take_damage((P.damage / 5) , BRUTE, "melee", 1) //Doesn't really matter what damage flag it is.
if(istype(P, /obj/item/projectile/energy/electrode))
take_damage(10, BRUTE, "melee", 1) //Tasers aren't harmful.
if(istype(P, /obj/item/projectile/beam/disabler))
take_damage(5, BRUTE, "melee", 1) //Disablers aren't harmful.
/obj/structure/holosign/barrier/cyborg/hacked
name = "Charged Energy Field"
desc = "A powerful energy field that blocks movement. Energy arcs off it."
max_integrity = 20
var/shockcd = 0
/obj/structure/holosign/barrier/cyborg/hacked/bullet_act(obj/item/projectile/P)
take_damage(P.damage, BRUTE, "melee", 1) //Yeah no this doesn't get projectile resistance.
/obj/structure/holosign/barrier/cyborg/hacked/proc/cooldown()
shockcd = FALSE
/obj/structure/holosign/barrier/cyborg/hacked/attack_hand(mob/living/user)
if(!shockcd)
if(ismob(user))
var/mob/living/M = user
M.electrocute_act(15,"Energy Barrier", safety=1)
shockcd = TRUE
addtimer(CALLBACK(src, .proc/cooldown), 5)
/obj/structure/holosign/barrier/cyborg/hacked/CollidedWith(atom/movable/AM)
if(shockcd)
return
if(!ismob(AM))
return
var/mob/living/M = AM
M.electrocute_act(15,"Energy Barrier", safety=1)
shockcd = TRUE
addtimer(CALLBACK(src, .proc/cooldown), 5)