From 2e283369557bb9cfa2e5e603ed0e75982f27c5de Mon Sep 17 00:00:00 2001 From: 4DPlanner <3combined@gmail.com> Date: Sat, 6 May 2017 03:56:47 +0100 Subject: [PATCH] Updates to use status effects, turns off debug population settings --- code/datums/status_effects/status_effect.dm | 2 + code/game/gamemodes/traitor/double_agents.dm | 52 +++++++++----------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index 3e40aa3072d..f0e2c63c6e4 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -10,6 +10,7 @@ var/status_type = STATUS_EFFECT_UNIQUE //How many of the effect can be on one mob, and what happens when you try to add another var/on_remove_on_mob_delete = FALSE //if we call on_remove() when the mob is deleted var/alert_type = /obj/screen/alert/status_effect //the alert thrown by the status effect, contains name and description + var/obj/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists /datum/status_effect/New(mob/living/new_owner) if(new_owner) @@ -39,6 +40,7 @@ if(alert_type) var/obj/screen/alert/status_effect/A = owner.throw_alert(id, alert_type) A.attached_effect = src //so the alert can reference us, if it needs to + linked_alert = A //so we can reference the alert, if we need to START_PROCESSING(SSfastprocess, src) /datum/status_effect/process() diff --git a/code/game/gamemodes/traitor/double_agents.dm b/code/game/gamemodes/traitor/double_agents.dm index 983fe0f1dc8..fa6b2b68248 100644 --- a/code/game/gamemodes/traitor/double_agents.dm +++ b/code/game/gamemodes/traitor/double_agents.dm @@ -6,8 +6,8 @@ name = "Internal Affairs" config_tag = "internal_affairs" employer = "Internal Affairs" - required_players = 1 - required_enemies = 1 + required_players = 25 + required_enemies = 5 recommended_enemies = 8 reroll_friendly = 0 traitor_name = "Nanotrasen Internal Affairs Agent" @@ -33,43 +33,43 @@ ..() -/datum/action/agent_pinpointer - name = "Internal Affairs Integrated Pinpointer" - desc = "Even stealthier than a normal implant." - icon_icon = 'icons/obj/device.dmi' - button_icon_state = "pinon" +/datum/status_effect/agent_pinpointer + id = "agent_pinpointer" + duration = -1 + tick_interval = PINPOINTER_PING_TIME + alert_type = /obj/screen/alert/status_effect/agent_pinpointer var/minimum_range = PINPOINTER_MINIMUM_RANGE var/mob/scan_target = null -/datum/action/agent_pinpointer/ApplyIcon(obj/screen/movable/action_button/current_button) //overridden to update direction properly - if(icon_icon && button_icon_state) - current_button.cut_overlays(TRUE) - current_button.add_overlay(mutable_appearance(icon_icon, button_icon_state)) - current_button.button_icon_state = button_icon_state +/obj/screen/alert/status_effect/agent_pinpointer + name = "Internal Affairs Integrated Pinpointer" + desc = "Even stealthier than a normal implant." + icon = 'icons/obj/device.dmi' + icon_state = "pinon" -/datum/action/agent_pinpointer/proc/point_to_target() //If we found what we're looking for, show the distance and direction +/datum/status_effect/agent_pinpointer/proc/point_to_target() //If we found what we're looking for, show the distance and direction if(!scan_target) - button_icon_state = "pinonnull" + linked_alert.icon_state = "pinonnull" return var/turf/here = get_turf(owner) var/turf/there = get_turf(scan_target) if(here.z != there.z) - button_icon_state = "pinonnull" + linked_alert.icon_state = "pinonnull" return if(get_dist_euclidian(here,there)<=minimum_range + rand(0, PINPOINTER_EXTRA_RANDOM_RANGE)) - button_icon_state = "pinondirect" + linked_alert.icon_state = "pinondirect" else - button.setDir(get_dir(here, there)) + linked_alert.setDir(get_dir(here, there)) switch(get_dist(here, there)) if(1 to 8) - button_icon_state = "pinonclose" + linked_alert.icon_state = "pinonclose" if(9 to 16) - button_icon_state = "pinonmedium" + linked_alert.icon_state = "pinonmedium" if(16 to INFINITY) - button_icon_state = "pinonfar" - UpdateButtonIcon() + linked_alert.icon_state = "pinonfar" + -/datum/action/agent_pinpointer/proc/scan_for_target() +/datum/status_effect/agent_pinpointer/proc/scan_for_target() scan_target = null if(owner) if(owner.mind) @@ -84,20 +84,16 @@ break -/datum/action/agent_pinpointer/proc/pinpointer_ping_func() +/datum/status_effect/agent_pinpointer/tick() if(!owner) qdel(src) return scan_for_target() point_to_target() - var/datum/callback/C = new(src, .pinpointer_ping_func) - addtimer(C, PINPOINTER_PING_TIME) /proc/give_pinpointer(datum/mind/owner) if(owner && owner.current) - var/datum/action/agent_pinpointer/pinp = new - pinp.Grant(owner.current) - pinp.pinpointer_ping_func() + new/datum/status_effect/agent_pinpointer(owner.current) /datum/internal_agent_state