Repathes structures to fluff, traps to their own path

This commit is contained in:
AnturK
2016-09-20 17:36:27 +02:00
parent 93f444fd38
commit 6700f30012
10 changed files with 90 additions and 254 deletions
+14 -212
View File
@@ -1,104 +1,13 @@
/obj/structure/divine
name = "divine construction site"
icon = 'icons/obj/hand_of_god_structures.dmi'
desc = "An unfinished divine building"
anchored = 1
density = 1
var/trap = FALSE
var/side = "neutral" //only used to decide icon states
var/health = 100
var/maxhealth = 100
var/deactivated = 0 //Structures being hidden can't be used. Mainly to prevent invisible defense pylons.
/obj/structure/divine/proc/deactivate()
deactivated = 1
/obj/structure/divine/proc/activate()
deactivated = 0
/obj/structure/divine/proc/update_icons()
icon_state = "[initial(icon_state)]-[side]"
/obj/structure/divine/attacked_by(obj/item/I, mob/living/user)
..()
take_damage(I.force, I.damtype, 1)
/obj/structure/divine/proc/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
health -= damage
if(!health)
visible_message("<span class='danger'>\The [src] was destroyed!</span>")
qdel(src)
/obj/structure/divine/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type, 0)
/obj/structure/divine/attack_alien(mob/living/carbon/alien/humanoid/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
add_hiddenprint(user)
visible_message("<span class='warning'>\The [user] slashes at [src]!</span>")
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
take_damage(20, BRUTE, 0)
/obj/machinery/attack_animal(mob/living/simple_animal/M)
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
if(M.melee_damage_upper > 0 || M.obj_damage)
M.visible_message("<span class='danger'>[M.name] smashes against \the [src.name].</span>",\
"<span class='danger'>You smash against the [src.name].</span>")
if(M.obj_damage)
take_damage(M.obj_damage, M.melee_damage_type, 1)
else
take_damage(rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type, 1)
/obj/structure/divine/nexus
name = "nexus"
desc = "It anchors a deity to this world. It radiates an unusual aura. It looks well protected from explosive shock."
icon_state = "nexus"
health = 500
maxhealth = 500
var/list/powerpylons = list()
/obj/structure/divine/nexus/ex_act()
return
/obj/structure/divine/conduit
name = "conduit"
desc = "It allows a deity to extend their reach. Their powers are just as potent near a conduit as a nexus."
icon_state = "conduit"
health = 150
maxhealth = 150
/obj/structure/divine/convertaltar
name = "conversion altar"
desc = "An altar dedicated to a deity."
icon_state = "convertaltar"
density = 0
can_buckle = 1
/obj/structure/divine/sacrificealtar
/obj/structure/sacrificealtar
name = "sacrificial altar"
desc = "An altar designed to perform blood sacrifice for a deity."
icon = 'icons/obj/hand_of_god_structures.dmi'
icon_state = "sacrificealtar"
anchored = 1
density = 0
can_buckle = 1
/obj/structure/divine/sacrificealtar/attack_hand(mob/living/user)
/obj/structure/sacrificealtar/attack_hand(mob/living/user)
..()
if(!has_buckled_mobs())
return
@@ -109,136 +18,29 @@
L.gib()
message_admins("[key_name_admin(user)] has sacrificed [key_name_admin(L)] on the sacrifical altar.")
/obj/structure/divine/healingfountain
/obj/structure/healingfountain
name = "healing fountain"
desc = "A fountain containing the waters of life... or death, depending on where your allegiances lie."
desc = "A fountain containing the waters of life."
icon = 'icons/obj/hand_of_god_structures.dmi'
icon_state = "fountain"
anchored = 1
density = 1
var/time_between_uses = 1800
var/last_process = 0
var/cult_only = TRUE
/obj/structure/divine/healingfountain/anyone
desc = "A fountain containing the waters of life."
cult_only = FALSE
/obj/structure/divine/healingfountain/attack_hand(mob/living/user)
if(deactivated)
return
/obj/structure/healingfountain/attack_hand(mob/living/user)
if(last_process + time_between_uses > world.time)
user << "<span class='notice'>The fountain appears to be empty.</span>"
return
last_process = world.time
if(!iscultist(user) && cult_only)
user << "<span class='danger'><B>The water burns!</b></spam>"
user.reagents.add_reagent("hell_water",20)
else
user << "<span class='notice'>The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.</span>"
user.reagents.add_reagent("godblood",20)
user << "<span class='notice'>The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.</span>"
user.reagents.add_reagent("godblood",20)
update_icons()
addtimer(src, "update_icons", time_between_uses)
/obj/structure/divine/healingfountain/update_icons()
/obj/structure/healingfountain/proc/update_icons()
if(last_process + time_between_uses > world.time)
icon_state = "fountain"
else
icon_state = "fountain-[side]"
/obj/structure/divine/powerpylon
name = "power pylon"
desc = "A pylon which increases the deity's rate it can influence the world."
icon_state = "powerpylon"
density = 1
health = 30
maxhealth = 30
/obj/structure/divine/defensepylon
name = "defense pylon"
desc = "A pylon which is blessed to withstand many blows, and fire strong bolts at nonbelievers. A god can toggle it."
icon_state = "defensepylon"
health = 150
maxhealth = 150
var/gun_faction = "cult"
var/obj/machinery/porta_turret/defensepylon_internal_turret/pylon_gun
/obj/structure/divine/defensepylon/New()
..()
pylon_gun = new(src)
pylon_gun.base = src
pylon_gun.faction = list(gun_faction)
pylon_gun.side = side
/obj/structure/divine/defensepylon/Destroy()
qdel(pylon_gun) //just in case
return ..()
/obj/structure/divine/defensepylon/examine(mob/user)
..()
user << "<span class='notice'>\The [src] looks [pylon_gun.on ? "on" : "off"].</span>"
/obj/structure/divine/defensepylon/attack_hand(mob/living/user)
if(gun_faction in user.faction)
pylon_gun.on = !pylon_gun.on
icon_state = (pylon_gun.on) ? "defensepylon-[side]" : "defensepylon"
else
. = ..()
/obj/structure/divine/defensepylon/deactivate()
..()
pylon_gun.on = 0
icon_state = (pylon_gun.on) ? "defensepylon-[side]" : "defensepylon"
/obj/structure/divine/defensepylon/activate()
..()
pylon_gun.on = 1
icon_state = (pylon_gun.on) ? "defensepylon-[side]" : "defensepylon"
//This sits inside the defensepylon, to avoid copypasta
/obj/machinery/porta_turret/defensepylon_internal_turret
name = "defense pylon"
desc = "A plyon which is blessed to withstand many blows, and fire strong bolts at nonbelievers."
icon = 'icons/obj/hand_of_god_structures.dmi'
installation = null
always_up = 1
use_power = 0
has_cover = 0
health = 200
projectile = /obj/item/projectile/beam/pylon_bolt
eprojectile = /obj/item/projectile/beam/pylon_bolt
shot_sound = 'sound/weapons/emitter2.ogg'
eshot_sound = 'sound/weapons/emitter2.ogg'
base_icon_state = "defensepylon"
active_state = ""
off_state = ""
faction = null
emp_vunerable = 0
var/side = "neutral"
/obj/machinery/porta_turret/defensepylon_internal_turret/setup()
return
/obj/machinery/porta_turret/defensepylon_internal_turret/shootAt(atom/movable/target)
var/obj/item/projectile/A = ..()
if(A)
A.color = side
/obj/machinery/porta_turret/defensepylon_internal_turret/assess_perp(mob/living/carbon/human/perp)
if(perp.handcuffed) //dishonourable to kill somebody who might be converted.
return 0
var/list/test = faction & perp.faction
if(test.len)
return 0
return 10
/obj/item/projectile/beam/pylon_bolt
name = "divine bolt"
icon_state = "greyscale_bolt"
damage = 15
/obj/structure/divine/shrine
name = "shrine"
desc = "A shrine dedicated to a deity."
icon_state = "shrine"
icon_state = "fountain-red"
+40
View File
@@ -120,3 +120,43 @@
name = "dense stack of papers"
desc = "A stack of various papers, childish scribbles scattered across each page."
icon_state = "paperstack"
/obj/structure/fluff/divine
name = "Miracle"
icon = 'icons/obj/hand_of_god_structures.dmi'
anchored = 1
density = 1
/obj/structure/fluff/divine/nexus
name = "nexus"
desc = "It anchors a deity to this world. It radiates an unusual aura. It looks well protected from explosive shock."
icon_state = "nexus-neutral"
/obj/structure/fluff/divine/conduit
name = "conduit"
desc = "It allows a deity to extend their reach. Their powers are just as potent near a conduit as a nexus."
icon_state = "conduit-neutral"
/obj/structure/fluff/divine/convertaltar
name = "conversion altar"
desc = "An altar dedicated to a deity."
icon_state = "convertaltar-neutral"
density = 0
can_buckle = 1
/obj/structure/fluff/divine/powerpylon
name = "power pylon"
desc = "A pylon which increases the deity's rate it can influence the world."
icon_state = "powerpylon"
can_buckle = 1
/obj/structure/fluff/divine/defensepylon
name = "defense pylon"
desc = "A pylon which is blessed to withstand many blows, and fire strong bolts at nonbelievers. A god can toggle it."
icon_state = "defensepylon"
/obj/structure/fluff/divine/shrine
name = "shrine"
desc = "A shrine dedicated to a deity."
icon_state = "shrine"
+15 -19
View File
@@ -1,18 +1,14 @@
/obj/structure/divine/trap
/obj/structure/trap
name = "IT'S A TARP"
desc = "stepping on me is a guaranteed bad day"
icon = 'icons/obj/hand_of_god_structures.dmi'
icon_state = "trap"
density = 0
alpha = 30 //initially quite hidden when not "recharging"
health = 20
maxhealth = 20
trap = TRUE
var/last_trigger = 0
var/time_between_triggers = 600 //takes a minute to recharge
/obj/structure/divine/trap/Crossed(atom/movable/AM)
/obj/structure/trap/Crossed(atom/movable/AM)
if(last_trigger + time_between_triggers > world.time)
return
alpha = initial(alpha)
@@ -23,7 +19,7 @@
trap_effect(L)
animate(src, alpha = initial(alpha), time = time_between_triggers)
/obj/structure/divine/trap/examine(mob/user)
/obj/structure/trap/examine(mob/user)
..()
if(!isliving(user)) //bad ghosts, stop trying to powergame from beyond the grave
return
@@ -32,15 +28,15 @@
animate(src, alpha = initial(alpha), time = time_between_triggers)
/obj/structure/divine/trap/proc/trap_effect(mob/living/L)
/obj/structure/trap/proc/trap_effect(mob/living/L)
return
/obj/structure/divine/trap/stun
/obj/structure/trap/stun
name = "shock trap"
desc = "A trap that will shock you, it will burn your flesh and render you immobile, You'd better avoid it."
icon_state = "trap-shock"
/obj/structure/divine/trap/stun/trap_effect(mob/living/L)
/obj/structure/trap/stun/trap_effect(mob/living/L)
L << "<span class='danger'><B>You are paralyzed from the intense shock!</B></span>"
L.Weaken(5)
var/turf/Lturf = get_turf(L)
@@ -48,13 +44,13 @@
new /obj/effect/particle_effect/sparks(Lturf)
/obj/structure/divine/trap/fire
/obj/structure/trap/fire
name = "flame trap"
desc = "A trap that will set you ablaze. You'd better avoid it."
icon_state = "trap-fire"
/obj/structure/divine/trap/fire/trap_effect(mob/living/L)
/obj/structure/trap/fire/trap_effect(mob/living/L)
L << "<span class='danger'><B>Spontaneous combustion!</B></span>"
L.Weaken(1)
var/turf/Lturf = get_turf(L)
@@ -62,26 +58,26 @@
new /obj/effect/particle_effect/sparks(Lturf)
/obj/structure/divine/trap/chill
/obj/structure/trap/chill
name = "frost trap"
desc = "A trap that will chill you to the bone. You'd better avoid it."
icon_state = "trap-frost"
/obj/structure/divine/trap/chill/trap_effect(mob/living/L)
/obj/structure/trap/chill/trap_effect(mob/living/L)
L << "<span class='danger'><B>You're frozen solid!</B></span>"
L.Weaken(1)
L.bodytemperature -= 300
new /obj/effect/particle_effect/sparks(get_turf(L))
/obj/structure/divine/trap/damage
/obj/structure/trap/damage
name = "earth trap"
desc = "A trap that will summon a small earthquake, just for you. You'd better avoid it."
icon_state = "trap-earth"
/obj/structure/divine/trap/damage/trap_effect(mob/living/L)
/obj/structure/trap/damage/trap_effect(mob/living/L)
L << "<span class='danger'><B>The ground quakes beneath your feet!</B></span>"
L.Weaken(5)
L.adjustBruteLoss(35)
@@ -90,7 +86,7 @@
new /obj/structure/flora/rock(Lturf)
/obj/structure/divine/trap/ward
/obj/structure/trap/ward
name = "divine ward"
desc = "A divine barrier, It looks like you could destroy it with enough effort, or wait for it to dissipate..."
icon_state = "ward"
@@ -100,6 +96,6 @@
time_between_triggers = 1200 //Exists for 2 minutes
/obj/structure/divine/trap/ward/New()
/obj/structure/trap/ward/New()
..()
QDEL_IN(src, time_between_triggers)