Fix cooldown abilities never running

This commit is contained in:
Elizabeth Lavenza
2024-04-13 18:16:49 -04:00
parent 174aca4b01
commit 9043920b69
6 changed files with 16 additions and 37 deletions

View File

@@ -50,6 +50,7 @@
// click.dm <--- Where we can take over mouse clicks
// spells.dm /add_ranged_ability() <--- How we take over the mouse click to use a power on a target.
// TODO: Refactor this to use /Activate().
/datum/action/cooldown/bloodsucker/Trigger()
// Active? DEACTIVATE AND END!
if(active && CheckCanDeactivate(TRUE))
@@ -179,6 +180,7 @@
bs_proc_holder = new ()
bs_proc_holder.linked_power = src
// TODO: Refactor this to use /Activate() and click_to_activate = TRUE.
// Click power: Begin Aim
/datum/action/cooldown/bloodsucker/targeted/Trigger()
if(active && CheckCanDeactivate(TRUE))

View File

@@ -169,9 +169,7 @@ new /datum/disease_ability/symptom/powerful/youth
desc = "Force the host you are following to cough with extra force, spreading your infection to those within two meters of your host even if your transmissibility is low.<br>Cooldown: 10 seconds"
cooldown_time = 100
/datum/action/cooldown/disease_cough/Trigger()
if(!..())
return FALSE
/datum/action/cooldown/disease_cough/Activate()
var/mob/camera/disease/D = owner
var/mob/living/L = D.following_host
if(!L)
@@ -201,9 +199,7 @@ new /datum/disease_ability/symptom/powerful/youth
desc = "Force the host you are following to sneeze with extra force, spreading your infection to any victims in a 4 meter cone in front of your host even if your transmissibility is low.<br>Cooldown: 20 seconds"
cooldown_time = 200
/datum/action/cooldown/disease_sneeze/Trigger()
if(!..())
return FALSE
/datum/action/cooldown/disease_sneeze/Activate()
var/mob/camera/disease/D = owner
var/mob/living/L = D.following_host
if(!L)
@@ -237,9 +233,7 @@ new /datum/disease_ability/symptom/powerful/youth
desc = "Cause the host you are following to excrete an infective substance from their pores, causing all objects touching their skin to transmit your infection to anyone who touches them for the next 30 seconds.<br>Cooldown: 40 seconds"
cooldown_time = 400
/datum/action/cooldown/disease_infect/Trigger()
if(!..())
return FALSE
/datum/action/cooldown/disease_infect/Activate()
var/mob/camera/disease/D = owner
var/mob/living/carbon/human/H = D.following_host
if(!H)

View File

@@ -226,19 +226,11 @@
/// The family antagonist datum of the "owner" of this action.
var/datum/antagonist/gang/my_gang_datum
/datum/action/cooldown/spawn_induction_package/Trigger()
if(!..())
return FALSE
if(!IsAvailable())
return FALSE
/datum/action/cooldown/spawn_induction_package/Activate()
if(!my_gang_datum)
return FALSE
if(!istype(owner, /mob/living/carbon/human))
if(!ishuman(owner))
return FALSE
var/mob/living/carbon/human/H = owner
if(H.stat)
return FALSE
var/obj/item/slapper/secret_handshake/secret_handshake_item = new(owner)
if(owner.put_in_hands(secret_handshake_item))
to_chat(owner, span_notice("You ready your secret handshake."))
@@ -248,14 +240,15 @@
return FALSE
owner.visible_message(span_notice("[owner] is offering to induct people into the Family."),
span_notice("You offer to induct people into the Family."), null, 2)
if(H.has_status_effect(STATUS_EFFECT_HANDSHAKE))
var/mob/living/living_owner = owner
if(living_owner.has_status_effect(STATUS_EFFECT_HANDSHAKE))
return FALSE
if(!(locate(/mob/living/carbon) in orange(1, owner)))
owner.visible_message(span_danger("[owner] offers to induct people into the Family, but nobody was around."), \
span_warning("You offer to induct people into the Family, but nobody is around."), null, 2)
return FALSE
H.apply_status_effect(STATUS_EFFECT_HANDSHAKE, secret_handshake_item)
living_owner.apply_status_effect(STATUS_EFFECT_HANDSHAKE, secret_handshake_item)
StartCooldown()
return TRUE

View File

@@ -87,10 +87,7 @@
button_icon_state = "slam"
cooldown_time = 45 SECONDS
/datum/action/cooldown/slam/Trigger()
. = ..()
if(!.)
return
/datum/action/cooldown/slam/Activate()
var/mob/living/simple_animal/slaughter/user = owner
user.slam_mode = !user.slam_mode
to_chat(user, user.slam_mode ? "Ready to slam!" : "Maybe not now.")

View File

@@ -167,10 +167,7 @@ GLOBAL_LIST_EMPTY(plague_rats)
button_icon_state = "coffer"
cooldown_time = 50
/datum/action/cooldown/scavenge/Trigger()
. = ..()
if(!.)
return
/datum/action/cooldown/scavenge/Activate()
var/turf/T = get_turf(owner)
var/loot = rand(1,100)
switch(loot)

View File

@@ -87,11 +87,9 @@
background_icon_state = "bg_clock"
button_icon_state = "coffer"
cooldown_time = 50
check_flags = AB_CHECK_CONSCIOUS
/datum/action/cooldown/coffer/Trigger()
. = ..()
if(!. || owner.stat != CONSCIOUS)
return
/datum/action/cooldown/coffer/Activate()
var/turf/T = get_turf(owner)
var/loot = rand(1,100)
switch(loot)
@@ -131,12 +129,10 @@
button_icon_state = "riot"
background_icon_state = "bg_clock"
cooldown_time = 80
check_flags = AB_CHECK_CONSCIOUS
///Checks to see if there are any nearby mice. Does not count Rats.
/datum/action/cooldown/riot/Trigger()
. = ..()
if(!. || owner.stat != CONSCIOUS)
return
/datum/action/cooldown/riot/Activate()
var/cap = CONFIG_GET(number/ratcap)
var/something_from_nothing = FALSE
for(var/mob/living/simple_animal/mouse/M in oview(owner, 5))