Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker obj and door opening for simple animals (currently only necromorphs) #10742

Merged
merged 7 commits into from
Jun 28, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -216,6 +216,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 @@ -267,9 +270,6 @@ var/global/list/alert_overlays_global = list()
if(check_access(ID))
access_granted = 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I found this gem.
Seriously why does this exist

Copy link
Contributor

@Intigracy Intigracy Jun 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably put it in the wrong file and left it unfinished, it reminds me of the AI warning when it attempts to force open a firedoor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like something that used to be an input.

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 @@ -278,6 +278,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
4 changes: 3 additions & 1 deletion 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 Expand Up @@ -720,4 +722,4 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
src.revive()
visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>")

/datum/locking_category/simple_animal
/datum/locking_category/simple_animal
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#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 me flesh...", "...make us whole...", "...we must be whole...", "...join us in unity...", "...one mind, one soul, one flesh...", "...MAKE US WHOLE...")

machine_flags = WRENCHMOVE

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

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

/obj/machinery/necromarker/Consume(mob/M as mob, mob/user as mob)
if(anchored && ismob(M) && Adjacent(M))
M.forceMove(src.loc)
var/mob/living/simple_animal/hostile/necro/zombie/Z = new(src.loc)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This aint a necromorph, this is a zombie

/mob/living/simple_animal/hostile/monster/necromorph is the big scary necromorph

if(M.ckey)
Z.ckey = M.ckey
visible_message("<span class='warning'>[src] spins the flesh and bone of [M] into a hellish monstrosity!</span>")
M.gib()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna do some funny things regarding the brain, similar happens with the staff of necromancy and its gibbing of those shot along with transferring the mind to the undead mob.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going to happen that I don't want and how can I avoid it

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)
. = ..()
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(Adjacent(user) && !isghost(user))
Consume(user)

/obj/machinery/auto_cloner/process()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this process for auto_cloner doing here in machinery/necromarker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

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++
Binary file added icons/xenoarch_icons/necromarker.dmi
Binary file not shown.