This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
drones_as_items.dm
47 lines (41 loc) · 1.76 KB
/
drones_as_items.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#define DRONE_MINIMUM_AGE 14
///////////////////
//DRONES AS ITEMS//
///////////////////
//Drone shells
/** Drone Shell: Ghost role item for drones
*
* A simple mob spawner item that transforms into a maintenance drone
* Resepcts drone minimum age
*/
/obj/effect/mob_spawn/drone
name = "drone shell"
mob_name = "drone" //WS Edit - Adding missing var
desc = "A shell of a maintenance drone, an expendable robot built to perform station repairs."
icon = 'icons/mob/drone.dmi'
icon_state = "drone_maint_hat" //yes reuse the _hat state.
layer = BELOW_MOB_LAYER
density = FALSE
death = FALSE
roundstart = FALSE
///Type of drone that will be spawned
mob_type = /mob/living/simple_animal/drone
short_desc = "You are a repair drone. Follow your laws and do not interfere with others." //WS Edit - Adding missing var
/obj/effect/mob_spawn/drone/Initialize()
. = ..()
var/area/A = get_area(src)
if(A)
notify_ghosts("A drone shell has been created in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_DRONE, notify_suiciders = FALSE)
GLOB.poi_list |= src
/obj/effect/mob_spawn/drone/Destroy()
GLOB.poi_list -= src
. = ..()
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/effect/mob_spawn/drone/attack_ghost(mob/user)
if(CONFIG_GET(flag/use_age_restriction_for_jobs))
if(!isnum(user.client.player_age)) //apparently what happens when there's no DB connected. just don't let anybody be a drone without admin intervention
return
if(user.client.player_age < DRONE_MINIMUM_AGE)
to_chat(user, "<span class='danger'>You're too new to play as a drone! Please try again in [DRONE_MINIMUM_AGE - user.client.player_age] days.</span>")
return
. = ..()