Files
GS13NG/code/game/gamemodes/cult/cult_structures.dm
2017-05-18 16:38:09 -05:00

240 lines
9.4 KiB
Plaintext

/obj/structure/destructible/cult
density = 1
anchored = 1
icon = 'icons/obj/cult.dmi'
var/cooldowntime = 0
break_sound = 'sound/hallucinations/veryfar_noise.ogg'
debris = list(/obj/item/stack/sheet/runed_metal = 1)
/obj/structure/destructible/cult/examine(mob/user)
..()
to_chat(user, "<span class='notice'>\The [src] is [anchored ? "":"not "]secured to the floor.</span>")
if((iscultist(user) || isobserver(user)) && cooldowntime > world.time)
to_chat(user, "<span class='cultitalic'>The magic in [src] is too weak, [p_they()] will be ready to use again in [getETA()].</span>")
/obj/structure/destructible/cult/examine_status(mob/user)
if(iscultist(user) || isobserver(user))
var/t_It = p_they(TRUE)
var/t_is = p_are()
return "<span class='cult'>[t_It] [t_is] at <b>[round(obj_integrity * 100 / max_integrity)]%</b> stability.</span>"
return ..()
/obj/structure/destructible/cult/attack_animal(mob/living/simple_animal/M)
if(istype(M, /mob/living/simple_animal/hostile/construct/builder))
if(obj_integrity < max_integrity)
M.changeNext_move(CLICK_CD_MELEE)
obj_integrity = min(max_integrity, obj_integrity + 5)
Beam(M, icon_state="sendbeam", time=4)
M.visible_message("<span class='danger'>[M] repairs \the <b>[src]</b>.</span>", \
"<span class='cult'>You repair <b>[src]</b>, leaving [p_they()] at <b>[round(obj_integrity * 100 / max_integrity)]%</b> stability.</span>")
else
to_chat(M, "<span class='cult'>You cannot repair [src], as [p_they()] [p_are()] undamaged!</span>")
else
..()
/obj/structure/destructible/cult/attackby(obj/I, mob/user, params)
if(istype(I, /obj/item/weapon/tome) && iscultist(user))
anchored = !anchored
to_chat(user, "<span class='notice'>You [anchored ? "":"un"]secure \the [src] [anchored ? "to":"from"] the floor.</span>")
if(!anchored)
icon_state = "[initial(icon_state)]_off"
else
icon_state = initial(icon_state)
else
return ..()
/obj/structure/destructible/cult/ratvar_act()
if(take_damage(rand(25, 50), BURN) && src) //if we still exist
var/previouscolor = color
color = "#FAE48C"
animate(src, color = previouscolor, time = 8)
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 8)
/obj/structure/destructible/cult/proc/getETA()
var/time = (cooldowntime - world.time)/600
var/eta = "[round(time, 1)] minutes"
if(time <= 1)
time = (cooldowntime - world.time)*0.1
eta = "[round(time, 1)] seconds"
return eta
/obj/structure/destructible/cult/talisman
name = "altar"
desc = "A bloodstained altar dedicated to Nar-Sie."
icon_state = "talismanaltar"
break_message = "<span class='warning'>The altar shatters, leaving only the wailing of the damned!</span>"
/obj/structure/destructible/cult/talisman/attack_hand(mob/living/user)
if(!iscultist(user))
to_chat(user, "<span class='warning'>You're pretty sure you know exactly what this is used for and you can't seem to touch it.</span>")
return
if(!anchored)
to_chat(user, "<span class='cultitalic'>You need to anchor [src] to the floor with a tome first.</span>")
return
if(cooldowntime > world.time)
to_chat(user, "<span class='cultitalic'>The magic in [src] is weak, it will be ready to use again in [getETA()].</span>")
return
var/choice = alert(user,"You study the schematics etched into the forge...",,"Eldritch Whetstone","Zealot's Blindfold","Flask of Unholy Water")
var/pickedtype
switch(choice)
if("Eldritch Whetstone")
pickedtype = /obj/item/weapon/sharpener/cult
if("Zealot's Blindfold")
pickedtype = /obj/item/clothing/glasses/night/cultblind
if("Flask of Unholy Water")
pickedtype = /obj/item/weapon/reagent_containers/food/drinks/bottle/unholywater
if(src && !QDELETED(src) && anchored && pickedtype && Adjacent(user) && !user.incapacitated() && iscultist(user) && cooldowntime <= world.time)
cooldowntime = world.time + 2400
var/obj/item/N = new pickedtype(get_turf(src))
to_chat(user, "<span class='cultitalic'>You kneel before the altar and your faith is rewarded with an [N]!</span>")
/obj/structure/destructible/cult/forge
name = "daemon forge"
desc = "A forge used in crafting the unholy weapons used by the armies of Nar-Sie."
icon_state = "forge"
light_range = 3
light_color = LIGHT_COLOR_LAVA
break_message = "<span class='warning'>The force breaks apart into shards with a howling scream!</span>"
/obj/structure/destructible/cult/forge/attack_hand(mob/living/user)
if(!iscultist(user))
to_chat(user, "<span class='warning'>The heat radiating from [src] pushes you back.</span>")
return
if(!anchored)
to_chat(user, "<span class='cultitalic'>You need to anchor [src] to the floor with a tome first.</span>")
return
if(cooldowntime > world.time)
to_chat(user, "<span class='cultitalic'>The magic in [src] is weak, it will be ready to use again in [getETA()].</span>")
return
var/choice = alert(user,"You study the schematics etched into the forge...",,"Shielded Robe","Flagellant's Robe","Nar-Sien Hardsuit")
var/pickedtype
switch(choice)
if("Shielded Robe")
pickedtype = /obj/item/clothing/suit/hooded/cultrobes/cult_shield
if("Flagellant's Robe")
pickedtype = /obj/item/clothing/suit/hooded/cultrobes/berserker
if("Nar-Sien Hardsuit")
pickedtype = /obj/item/clothing/suit/space/hardsuit/cult
if(src && !QDELETED(src) && anchored && pickedtype && Adjacent(user) && !user.incapacitated() && iscultist(user) && cooldowntime <= world.time)
cooldowntime = world.time + 2400
var/obj/item/N = new pickedtype(get_turf(src))
to_chat(user, "<span class='cultitalic'>You work the forge as dark knowledge guides your hands, creating [N]!</span>")
/obj/structure/destructible/cult/pylon
name = "pylon"
desc = "A floating crystal that slowly heals those faithful to Nar'Sie."
icon_state = "pylon"
light_range = 5
light_color = LIGHT_COLOR_RED
break_sound = 'sound/effects/Glassbr2.ogg'
break_message = "<span class='warning'>The blood-red crystal falls to the floor and shatters!</span>"
var/heal_delay = 25
var/last_heal = 0
var/corrupt_delay = 50
var/last_corrupt = 0
/obj/structure/destructible/cult/pylon/New()
START_PROCESSING(SSfastprocess, src)
..()
/obj/structure/destructible/cult/pylon/Destroy()
STOP_PROCESSING(SSfastprocess, src)
return ..()
/obj/structure/destructible/cult/pylon/process()
if(!anchored)
return
if(last_heal <= world.time)
last_heal = world.time + heal_delay
for(var/mob/living/L in range(5, src))
if(iscultist(L) || isshade(L) || isconstruct(L))
if(L.health != L.maxHealth)
new /obj/effect/temp_visual/heal(get_turf(src), "#960000")
if(ishuman(L))
L.adjustBruteLoss(-1, 0)
L.adjustFireLoss(-1, 0)
L.updatehealth()
if(isshade(L) || isconstruct(L))
var/mob/living/simple_animal/M = L
if(M.health < M.maxHealth)
M.adjustHealth(-1)
if(ishuman(L) && L.blood_volume < BLOOD_VOLUME_NORMAL)
L.blood_volume += 1.0
CHECK_TICK
if(last_corrupt <= world.time)
var/list/validturfs = list()
var/list/cultturfs = list()
for(var/T in circleviewturfs(src, 5))
if(istype(T, /turf/open/floor/engine/cult))
cultturfs |= T
continue
var/static/list/blacklisted_pylon_turfs = typecacheof(list(
/turf/closed,
/turf/open/floor/engine/cult,
/turf/open/space,
/turf/open/floor/plating/lava,
/turf/open/chasm))
if(is_type_in_typecache(T, blacklisted_pylon_turfs))
continue
else
validturfs |= T
last_corrupt = world.time + corrupt_delay
var/turf/T = safepick(validturfs)
if(T)
T.ChangeTurf(/turf/open/floor/engine/cult)
else
var/turf/open/floor/engine/cult/F = safepick(cultturfs)
if(F)
new /obj/effect/temp_visual/cult/turf/floor(F)
else
// Are we in space or something? No cult turfs or
// convertable turfs?
last_corrupt = world.time + corrupt_delay*2
/obj/structure/destructible/cult/tome
name = "archives"
desc = "A desk covered in arcane manuscripts and tomes in unknown languages. Looking at the text makes your skin crawl."
icon_state = "tomealtar"
light_range = 1.4
light_color = LIGHT_COLOR_FIRE
break_message = "<span class='warning'>The books and tomes of the archives burn into ash as the desk shatters!</span>"
/obj/structure/destructible/cult/tome/attack_hand(mob/living/user)
if(!iscultist(user))
to_chat(user, "<span class='warning'>All of these books seem to be gibberish.</span>")
return
if(!anchored)
to_chat(user, "<span class='cultitalic'>You need to anchor [src] to the floor with a tome first.</span>")
return
if(cooldowntime > world.time)
to_chat(user, "<span class='cultitalic'>The magic in [src] is weak, it will be ready to use again in [getETA()].</span>")
return
var/choice = alert(user,"You flip through the black pages of the archives...",,"Supply Talisman","Shuttle Curse","Veil Walker Set")
var/list/pickedtype = list()
switch(choice)
if("Supply Talisman")
pickedtype += /obj/item/weapon/paper/talisman/supply/weak
if("Shuttle Curse")
pickedtype += /obj/item/device/shuttle_curse
if("Veil Walker Set")
pickedtype += /obj/item/device/cult_shift
pickedtype += /obj/item/device/flashlight/flare/culttorch
if(src && !QDELETED(src) && anchored && pickedtype.len && Adjacent(user) && !user.incapacitated() && iscultist(user) && cooldowntime <= world.time)
cooldowntime = world.time + 2400
for(var/N in pickedtype)
var/obj/item/D = new N(get_turf(src))
to_chat(user, "<span class='cultitalic'>You summon [D] from the archives!</span>")
/obj/effect/gateway
name = "gateway"
desc = "You're pretty sure that abyss is staring back."
icon = 'icons/obj/cult.dmi'
icon_state = "hole"
density = 1
anchored = 1