mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 18:14:22 +01:00
[MIRROR] Adds new station traits that gives departments / everyone death rattle implants (#3683)
* Adds new station traits that gives departments / everyone death rattle implants * Update jobs.dm Co-authored-by: Qustinnus <Floydje123@hotmail.com> Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
var/trait_to_give
|
||||
///What traits are incompatible with this one?
|
||||
var/blacklist
|
||||
///Extra flags for station traits such as it being abstract
|
||||
var/trait_flags
|
||||
|
||||
|
||||
/datum/station_trait/New()
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
/datum/station_trait/quick_shuttle
|
||||
name = "Quick Shuttle"
|
||||
trait_type = STATION_TRAIT_NEUTRAL
|
||||
trait_type = STATION_TRAIT_POSITIVE
|
||||
weight = 5
|
||||
show_in_report = TRUE
|
||||
report_message = "Due to proximity to our supply station, the cargo shuttle will have a quicker flight time to your cargo department/"
|
||||
@@ -123,3 +123,97 @@
|
||||
/datum/station_trait/quick_shuttle/on_round_start()
|
||||
. = ..()
|
||||
SSshuttle.supply.callTime *= 0.5
|
||||
|
||||
/datum/station_trait/deathrattle_department
|
||||
name = "deathrattled department"
|
||||
trait_type = STATION_TRAIT_POSITIVE
|
||||
show_in_report = TRUE
|
||||
trait_flags = STATION_TRAIT_ABSTRACT
|
||||
blacklist = list(/datum/station_trait/deathrattle_all)
|
||||
|
||||
var/department_to_apply_to
|
||||
var/department_name = "department"
|
||||
var/datum/deathrattle_group/deathrattle_group
|
||||
|
||||
/datum/station_trait/deathrattle_department/New()
|
||||
. = ..()
|
||||
deathrattle_group = new("[department_name] group")
|
||||
blacklist += subtypesof(/datum/station_trait/deathrattle_department) - type //All but ourselves
|
||||
name = "deathrattled [department_name]"
|
||||
report_message = "All members of [department_name] have received an implant to notify each other if one of them dies. This should help improve job-safety!"
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, .proc/on_job_after_spawn)
|
||||
|
||||
/datum/station_trait/deathrattle_department/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/living_mob, mob/M, joined_late)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!(job.departments & department_to_apply_to))
|
||||
return
|
||||
|
||||
var/obj/item/implant/deathrattle/implant_to_give = new()
|
||||
deathrattle_group.register(implant_to_give)
|
||||
implant_to_give.implant(living_mob, living_mob, TRUE, TRUE)
|
||||
|
||||
|
||||
/datum/station_trait/deathrattle_department/service
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_SERVICE
|
||||
department_name = "Service"
|
||||
|
||||
/datum/station_trait/deathrattle_department/cargo
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_CARGO
|
||||
department_name = "Cargo"
|
||||
|
||||
/datum/station_trait/deathrattle_department/engineering
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_ENGINEERING
|
||||
department_name = "Engineering"
|
||||
|
||||
/datum/station_trait/deathrattle_department/command
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_COMMAND
|
||||
department_name = "Command"
|
||||
|
||||
/datum/station_trait/deathrattle_department/science
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_SCIENCE
|
||||
department_name = "Science"
|
||||
|
||||
/datum/station_trait/deathrattle_department/security
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_SECURITY
|
||||
department_name = "Security"
|
||||
|
||||
/datum/station_trait/deathrattle_department/medical
|
||||
trait_flags = NONE
|
||||
weight = 1
|
||||
department_to_apply_to = DEPARTMENT_MEDICAL
|
||||
department_name = "Medical"
|
||||
|
||||
/datum/station_trait/deathrattle_all
|
||||
name = "deathrattled station"
|
||||
trait_type = STATION_TRAIT_POSITIVE
|
||||
show_in_report = TRUE
|
||||
weight = 1
|
||||
report_message = "All members of the station have received an implant to notify each other if one of them dies. This should help improve job-safety!"
|
||||
var/datum/deathrattle_group/deathrattle_group
|
||||
|
||||
|
||||
/datum/station_trait/deathrattle_all/New()
|
||||
. = ..()
|
||||
deathrattle_group = new("station group")
|
||||
blacklist = subtypesof(/datum/station_trait/deathrattle_department)
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, .proc/on_job_after_spawn)
|
||||
|
||||
/datum/station_trait/deathrattle_all/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/living_mob, mob/M, joined_late)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
var/obj/item/implant/deathrattle/implant_to_give = new()
|
||||
deathrattle_group.register(implant_to_give)
|
||||
implant_to_give.implant(living_mob, living_mob, TRUE, TRUE)
|
||||
|
||||
Reference in New Issue
Block a user