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 all commits
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,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)
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably should add this behavior to attackby as well, so grabbing someone and hitting the thing with them consumes as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean grabbed people? I could do that. It shouldn't do it for anything else though


/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
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is copy pasted below, put it outside the if and remove copy paste + else clause.

break
else
candidates -= O
visible_message("<span class='warning'>[src] spins the flesh and bone of [M] into a hellish monstrosity!</span>")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should have \the

Copy link
Member

@Exxion Exxion Jun 28, 2016

Choose a reason for hiding this comment

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

Isn't \the automatically added by BYOND when you use [src] (rather than [src.name])?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should still use \the IMO.

Copy link
Contributor

@Intigracy Intigracy Jun 28, 2016

Choose a reason for hiding this comment

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

Exxion, no, it's not.

If [src] is capitalized then it won't add a the automatically, it only adds the automatically to \improper named objects (which is automatically true if the word isn't capitalized).

Copy link
Member

Choose a reason for hiding this comment

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

That's exactly how \the works anyway.

Copy link
Member

@Exxion Exxion Jun 28, 2016

Choose a reason for hiding this comment

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

That's wrong, though.
I just tested it.

image

image

There would be no point to \the acting the way you said, as it would be the same as just writing "the"

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

That I was wrong.
\the behaves as I said
It does not show up before things counted as proper nouns

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see pictures now, didn't when I was on my phone.

Just tested myself too, I guess I was wrong.

Does \the even have a use then? I always figured it was just a failsafe and would add a the unless one was being automatically added due to improper nounage.

Using "The [src]" makes it turn into The the light replacer.

Copy link
Member

Choose a reason for hiding this comment

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

\the is only automatically inserted if you put the object reference in directly, so [src] or something similar
NOT if you put in [src.name], etc.

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>)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Again.

log_game("[user]/[user.ckey] forcefully turned [M]/[M.ckey] into a necromorph.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there are procs to handle this in a more clean way, and to make it easier on the admins (talking about the mob / key thing)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not that I know of?
This is how it's done everywhere else I've seen

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe it's like key_name() or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Welp
Must have found some oldcode on accident

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>)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey look!

log_game("[M]/[M.ckey] turned into a necromorph.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Again!


/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>")
Copy link
Contributor

Choose a reason for hiding this comment

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

\the

if(!anchored)
icon_state = "black"
visible_message("<span class='info'>[src]'s glow slowly diminishes.'</span>")
Copy link
Contributor

Choose a reason for hiding this comment

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

\the


/obj/machinery/necromarker/attack_hand(mob/user)
if(!isobserver(user) && !issilicon(user))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do observers even call attack_hand()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

if(Adjacent(user))
Consume(user)
else
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait won't this else trigger for silicons too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consume() has an iscarbon check

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm talking about the else block here.

It looks like silicons will be added to the candidates list if they attack_hand it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

w h o o p s

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++
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be using world time timestamps.


/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 @@ -1751,6 +1751,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