Skip to content

Commit

Permalink
Marker obj and door opening for simple animals (currently only necrom…
Browse files Browse the repository at this point in the history
…orphs) (#10742)

* Marker obj and door opening for simple animals (currently only xenomorphs)

* typo fixes, changelog

* more fixing, observer signup

* fin

* fin really

* objective complete, payload secured

* whoops
  • Loading branch information
gbasood committed Jun 28, 2016
1 parent 1ebca9a commit 0b38588
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 4 deletions.
11 changes: 11 additions & 0 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ var/list/all_doors = list()

if(allowed(user))
open()
else if(isanimal(user))
var/mob/living/simple_animal/SA = user
if(SA.can_open_doors)
open()
else if(!operating)
playsound(src.loc, 'sound/machines/denied.ogg', 50, 1)
door_animate("deny")
Expand All @@ -129,6 +133,9 @@ var/list/all_doors = list()
attack_hand(user)
return

/obj/machinery/door/attack_animal(mob/user as mob)
attack_hand(user)

/obj/machinery/door/attack_hand(mob/user as mob)
if (prob(HEADBUTT_PROBABILITY) && density && ishuman(user))
var/mob/living/carbon/human/H = user
Expand Down Expand Up @@ -181,6 +188,10 @@ var/list/all_doors = list()
return close()
else
return open()
else if(isanimal(user))
var/mob/living/simple_animal/SA = user
if(SA.can_open_doors)
open()

playsound(src.loc, 'sound/machines/denied.ogg', 50, 1)
if(density) //Why are we playing a denied animation on an OPEN DOOR
Expand Down
11 changes: 8 additions & 3 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ var/global/list/alert_overlays_global = list()
/obj/machinery/door/firedoor/attack_hand(mob/user as mob)
return attackby(null, user)

/obj/machinery/door/firedoor/attack_animal(mob/user as mob)
return attackby(null, user)

/obj/machinery/door/firedoor/attackby(obj/item/weapon/C as obj, mob/user as mob)
add_fingerprint(user)
if(operating)
Expand Down Expand Up @@ -266,9 +269,6 @@ var/global/list/alert_overlays_global = list()
if(check_access(ID))
access_granted = 1

var/answer = "Yes"
if(answer == "No")
return
if(user.locked_to)
if(!istype(user.locked_to, /obj/structure/bed/chair/vehicle))
to_chat(user, "Sorry, you must remain able bodied and close to \the [src] in order to use it.")
Expand All @@ -277,6 +277,11 @@ var/global/list/alert_overlays_global = list()
to_chat(user, "Sorry, you must remain able bodied and close to \the [src] in order to use it.")
return

if(isanimal(user))
var/mob/living/simple_animal/SA = user
if(SA.can_open_doors)
access_granted = 1

if(alarmed && density && lockdown && !access_granted/* && !( users_name in users_to_open ) */)
// Too many shitters on /vg/ for the honor system to work.
to_chat(user, "<span class='warning'>Access denied. Please wait for authorities to arrive, or for the alert to clear.</span>")
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/simple_animal/hostile/necro.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
minbodytemp = 0

environment_smash = 1
can_open_doors = 1

/mob/living/simple_animal/hostile/necro/New(loc, mob/living/Owner, datum/mind/Controller)
..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
var/life_tick = 0
var/list/colourmatrix = list()

var/can_open_doors = 0

/mob/living/simple_animal/apply_beam_damage(var/obj/effect/beam/B)
var/lastcheck=last_beamchecks["\ref[B]"]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#define NECROMARKER_MIN_WHISPER_INTERVAL 200
#define NECROMARKER_MAX_WHISPER_INTERVAL 450
/obj/machinery/necromarker
name = "mysterious sculpture"
desc = "A mysterious scultpure of spiral spines, covered in runes."
icon = 'icons/xenoarch_icons/necromarker.dmi'
icon_state = "black"
density = 1

var/ticks_not_whispered = 0
var/next_whisper = 300
var/whispers = list("...bring us flesh...", "...make us whole...", "...we must be whole...", "...join us in unity...", "...one mind, one soul, one flesh...", "...MAKE US WHOLE...")
var/list/mob/dead/observer/candidates = list()

machine_flags = WRENCHMOVE

/obj/machinery/necromarker/New()
. = ..()

/obj/machinery/necromarker/MouseDrop_T(mob/M as mob, mob/user as mob)
if(!istype(M) || isobserver(user))
return
if(Adjacent(user))
Consume(M)

/obj/machinery/necromarker/proc/Consume(mob/M as mob, mob/user as mob)
if(anchored && ismob(M) && Adjacent(M) && iscarbon(M) && !istype(M, /mob/living/simple_animal/hostile/monster/necromorph/))
var/mob/living/simple_animal/hostile/monster/necromorph/Z = new(src.loc)
if(M.ckey)
// Z.ckey = M.ckey
if(M.mind)
M.mind.transfer_to(Z)
else
for(var/mob/dead/observer/O in candidates)
if(O && O.mind && O.ckey)
O.mind.transfer_to(Z)
Z.ckey = O.ckey // Because ghosts don't get key changes
candidates -= O
break
else
candidates -= O
visible_message("<span class='warning'>[src] spins the flesh and bone of [M] into a hellish monstrosity!</span>")
M.gib()
if(user)
message_admins("[user]/[user.ckey] forcefully turned [M]/[M.ckey] into a necromorph. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[loc.x];Y=[loc.y];Z=[loc.z]'>JMP</A>)")
log_game("[user]/[user.ckey] forcefully turned [M]/[M.ckey] into a necromorph.")
else
message_admins("[M]/[M.ckey] turned into a necromorph via a marker. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[loc.x];Y=[loc.y];Z=[loc.z]'>JMP</A>)")
log_game("[M]/[M.ckey] turned into a necromorph.")

/obj/machinery/necromarker/wrenchAnchor(var/mob/user)
var/wasanchored = anchored
. = ..()
if(anchored == wasanchored)
return //Nothing changed so change nothing
if(anchored)
icon_state = "red"
visible_message("<span class='warning'>[src] begins to glow an ominous shade of red...</span>")
if(!anchored)
icon_state = "black"
visible_message("<span class='info'>[src]'s glow slowly diminishes.'</span>")

/obj/machinery/necromarker/attack_hand(mob/user)
if(!isobserver(user) && !issilicon(user))
if(Adjacent(user))
Consume(user)
else
if(user in candidates)
candidates -= user
to_chat(user, "<span class='info'>You will no longer spawn as a necromorph.</span>")
else
to_chat(user, "<span class='info'>You have been signed up to take control of the next mindless necromorph that the marker spawns. Click again to revoke this.</span>")
candidates += user

/obj/machinery/necromarker/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = W
if(ismob(G.affecting))
Consume(G.affecting)
return //Mission complete, everyone get the fuck out
..()


/obj/machinery/necromarker/process()
if(ticks_not_whispered > next_whisper)
ticks_not_whispered = 0
visible_message("[pick(whispers)]")
next_whisper = rand(NECROMARKER_MIN_WHISPER_INTERVAL, NECROMARKER_MAX_WHISPER_INTERVAL)
else
ticks_not_whispered++

/obj/machinery/necromarker/Destroy()
candidates = null
..()
6 changes: 5 additions & 1 deletion html/changelogs/Sood.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
author: Sood
changes: []
changes:
- rscadd: Adds a marker. The necromorph kind. Currently admin spawn only.
- rscadd: Players can click on the marker with their bare hand to become a necromorph, or drag another mob onto it to turn it into a necromorph.
- rscadd: Ghosts can sign up to be a necromorph by clicking on the marker. They will take control of the next mindless necromorph to spawn.
- tweak: Player necromorphs can now open doors.
Binary file added icons/xenoarch_icons/necromarker.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions vgstation13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,7 @@
#include "code\modules\research\xenoarchaeology\artifact\artifact_crystal.dm"
#include "code\modules\research\xenoarchaeology\artifact\artifact_gigadrill.dm"
#include "code\modules\research\xenoarchaeology\artifact\artifact_hoverpod.dm"
#include "code\modules\research\xenoarchaeology\artifact\artifact_necromarker.dm"
#include "code\modules\research\xenoarchaeology\artifact\artifact_replicator.dm"
#include "code\modules\research\xenoarchaeology\artifact\artifact_unknown.dm"
#include "code\modules\research\xenoarchaeology\artifact\effect.dm"
Expand Down

0 comments on commit 0b38588

Please sign in to comment.