d k daunkey kaung

This commit is contained in:
SandPoot
2024-01-03 22:42:03 -03:00
parent cb2251ea37
commit 7eaef36e11
106 changed files with 1683 additions and 936 deletions

View File

@@ -59,7 +59,7 @@
H.update_inv_wear_suit()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/clothing/suit/armor/abductor/vest/item_action_slot_check(slot, mob/user, datum/action/A)
if(slot == ITEM_SLOT_OCLOTHING) //we only give the mob the ability to activate the vest if he's actually wearing it.

View File

@@ -216,7 +216,7 @@
return
// Disable Powers: Masquerade * NOTE * This should happen as a FLAW!
//if (stat >= UNCONSCIOUS)
// for (var/datum/action/bloodsucker/masquerade/P in powers)
// for (var/datum/action/cooldown/bloodsucker/masquerade/P in powers)
// P.Deactivate()
// TEMP DEATH
var/total_brute = owner.current.getBruteLoss_nonProsthetic()
@@ -252,7 +252,7 @@
owner.current.update_sight()
owner.current.reload_fullscreen()
// Disable ALL Powers
for(var/datum/action/bloodsucker/power in powers)
for(var/datum/action/cooldown/bloodsucker/power in powers)
if(power.active && !power.can_use_in_torpor)
power.DeactivatePower()
if(owner.current.suiciding)

View File

@@ -1,22 +1,26 @@
/datum/action/bloodsucker
/datum/action/cooldown/bloodsucker
name = "Vampiric Gift"
desc = "A vampiric gift."
button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon
background_icon_state = "vamp_power_off" //And this is the state for the background icon
var/background_icon_state_on = "vamp_power_on" // FULP: Our "ON" icon alternative.
var/background_icon_state_off = "vamp_power_off" // FULP: Our "OFF" icon alternative.
icon_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the ACTION icon
button_icon_state = "power_feed" //And this is the state for the action icon
buttontooltipstyle = "cult"
transparent_when_unavailable = TRUE
/// Cooldown you'll have to wait between each use, decreases depending on level.
cooldown_time = 2 SECONDS
///Background icon when the Power is active.
var/background_icon_state_on = "vamp_power_on"
///Background icon when the Power is NOT active.
var/background_icon_state_off = "vamp_power_off"
// Action-Related
//var/amPassive = FALSE // REMOVED: Just made it its own kind. // Am I just "on" at all times? (aka NO ICON)
var/amTargetted = FALSE // Am I asked to choose a target when enabled? (Shows as toggled ON when armed)
var/amToggle = FALSE // Can I be actively turned on and off?
var/amSingleUse = FALSE // Am I removed after a single use?
var/active = FALSE
var/cooldown = 20 // 10 ticks, 1 second.
var/cooldownUntil = 0 // From action.dm: next_use_time = world.time + cooldown_time
// Power-Related
var/level_current = 0 // Can increase to yield new abilities. Each power goes up in strength each Rank.
//var/level_max = 1 //
@@ -32,7 +36,7 @@
//var/not_bloodsucker = FALSE // This goes to Vassals or Hunters, but NOT bloodsuckers.
var/must_be_concious = TRUE //Can't use this ability while unconcious.
/datum/action/bloodsucker/New()
/datum/action/cooldown/bloodsucker/New()
if(bloodcost > 0)
desc += "<br><br><b>COST:</b> [bloodcost] Blood" // Modify description to add cost.
if(warn_constant_cost)
@@ -46,7 +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.
/datum/action/bloodsucker/Trigger()
/datum/action/cooldown/bloodsucker/Trigger()
// Active? DEACTIVATE AND END!
if(active && CheckCanDeactivate(TRUE))
DeactivatePower()
@@ -56,7 +60,7 @@
PayCost()
if(amToggle)
active = !active
UpdateButtonIcon()
UpdateButtons()
if(!amToggle || !active)
StartCooldown() // Must come AFTER UpdateButton(), otherwise icon will revert.
ActivatePower() // NOTE: ActivatePower() freezes this power in place until it ends.
@@ -65,13 +69,13 @@
if(amSingleUse)
RemoveAfterUse()
/datum/action/bloodsucker/proc/CheckCanPayCost(display_error)
/datum/action/cooldown/bloodsucker/proc/CheckCanPayCost(display_error)
if(!owner || !owner.mind)
return FALSE
// Cooldown?
if(cooldownUntil > world.time)
if(next_use_time > world.time)
if(display_error)
to_chat(owner, "[src] is unavailable. Wait [(cooldownUntil - world.time) / 10] seconds.")
to_chat(owner, "[src] is unavailable. Wait [(next_use_time - world.time) / 10] seconds.")
return FALSE
// Have enough blood?
var/mob/living/L = owner
@@ -81,7 +85,7 @@
return FALSE
return TRUE
/datum/action/bloodsucker/proc/CheckCanUse(display_error) // These checks can be scanned every frame while a ranged power is on.
/datum/action/cooldown/bloodsucker/proc/CheckCanUse(display_error) // These checks can be scanned every frame while a ranged power is on.
if(!owner || !owner.mind)
return FALSE
// Torpor?
@@ -123,79 +127,43 @@
return FALSE
return TRUE
/datum/action/bloodsucker/proc/StartCooldown()
set waitfor = FALSE
// Alpha Out
button.color = rgb(128,0,0,128)
button.alpha = 100
// Calculate Cooldown (by power's level)
var/this_cooldown = (cooldown_static || amSingleUse) ? cooldown : max(cooldown / 2, cooldown - (cooldown / 16 * (level_current-1)))
// NOTE: With this formula, you'll hit half cooldown at level 8 for that power.
// Wait for cooldown
cooldownUntil = world.time + this_cooldown
spawn(this_cooldown)
// Alpha In
button.color = rgb(255,255,255,255)
button.alpha = 255
/datum/action/bloodsucker/proc/CheckCanDeactivate(display_error)
/datum/action/cooldown/bloodsucker/proc/CheckCanDeactivate(display_error)
return TRUE
/datum/action/bloodsucker/UpdateButtonIcon(force = FALSE)
/datum/action/cooldown/bloodsucker/UpdateButton(atom/movable/screen/movable/action_button/button, force = FALSE)
background_icon_state = active? background_icon_state_on : background_icon_state_off
..()//UpdateButtonIcon()
..()//UpdateButton()
/datum/action/bloodsucker/proc/PayCost()
/datum/action/cooldown/bloodsucker/proc/PayCost()
// owner for actions is the mob, not mind.
var/mob/living/L = owner
L.blood_volume -= bloodcost
/datum/action/bloodsucker/proc/ActivatePower()
/datum/action/cooldown/bloodsucker/proc/ActivatePower()
/datum/action/bloodsucker/proc/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/proc/DeactivatePower(mob/living/user = owner, mob/living/target)
active = FALSE
UpdateButtonIcon()
UpdateButtons()
StartCooldown()
/datum/action/bloodsucker/proc/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active.
/datum/action/cooldown/bloodsucker/proc/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active.
return active && user && (!warn_constant_cost || user.blood_volume > 0)
/datum/action/bloodsucker/proc/RemoveAfterUse()
/datum/action/cooldown/bloodsucker/proc/RemoveAfterUse()
// Un-Learn Me! (GO HOME
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
if (istype(bloodsuckerdatum))
bloodsuckerdatum.powers -= src
Remove(owner)
/datum/action/bloodsucker/proc/Upgrade()
/datum/action/cooldown/bloodsucker/proc/Upgrade()
level_current ++
/////////////////////////////////// PASSIVE POWERS ///////////////////////////////////
// New Type: Passive (Always on, no button)
/datum/action/bloodsucker/passive
/datum/action/bloodsucker/passive/New()
// REMOVED: DO NOTHBING!
..()
// Don't Display Button! (it doesn't do anything anyhow)
button.screen_loc = DEFAULT_BLOODSPELLS
button.moved = DEFAULT_BLOODSPELLS
button.ordered = FALSE
/datum/action/bloodsucker/passive/Destroy()
if(owner)
Remove(owner)
target = null
return ..()
/////////////////////////////////// TARGETTED POWERS ///////////////////////////////////
/datum/action/bloodsucker/targeted
/datum/action/cooldown/bloodsucker/targeted
// NOTE: All Targeted spells are Toggles! We just don't bother checking here.
var/target_range = 99
var/message_Trigger = "Select a target."
@@ -204,7 +172,7 @@
var/power_in_use = FALSE // Is this power LOCKED due to being used?
/datum/action/bloodsucker/targeted/New(Target)
/datum/action/cooldown/bloodsucker/targeted/New(Target)
desc += "<br>\[<i>Targeted Power</i>\]" // Modify description to add notice that this is aimed.
..()
// Create Proc Holder for intercepting clicks
@@ -212,7 +180,7 @@
bs_proc_holder.linked_power = src
// Click power: Begin Aim
/datum/action/bloodsucker/targeted/Trigger()
/datum/action/cooldown/bloodsucker/targeted/Trigger()
if(active && CheckCanDeactivate(TRUE))
DeactivateRangedAbility()
DeactivatePower()
@@ -220,7 +188,7 @@
if(!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE))
return
active = !active
UpdateButtonIcon()
UpdateButtons()
// Create & Link Targeting Proc
var/mob/living/L = owner
if(L.ranged_ability)
@@ -230,7 +198,7 @@
if(message_Trigger != "")
to_chat(owner, "<span class='announce'>[message_Trigger]</span>")
/datum/action/bloodsucker/targeted/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/targeted/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -238,21 +206,21 @@
return FALSE // doesn't let you remove powers if you're not there. So, let's just cancel the power entirely.
return TRUE
/datum/action/bloodsucker/targeted/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/targeted/DeactivatePower(mob/living/user = owner, mob/living/target)
// Don't run ..(), we don't want to engage the cooldown until we USE this power!
active = FALSE
UpdateButtonIcon()
UpdateButtons()
/datum/action/bloodsucker/targeted/proc/DeactivateRangedAbility()
/datum/action/cooldown/bloodsucker/targeted/proc/DeactivateRangedAbility()
// Only Turned off when CLICK is disabled...aka, when you successfully clicked (or
bs_proc_holder.remove_ranged_ability()
// Check if target is VALID (wall, turf, or character?)
/datum/action/bloodsucker/targeted/proc/CheckValidTarget(atom/A)
/datum/action/cooldown/bloodsucker/targeted/proc/CheckValidTarget(atom/A)
return FALSE // FALSE targets nothing.
// Check if valid target meets conditions
/datum/action/bloodsucker/targeted/proc/CheckCanTarget(atom/A, display_error)
/datum/action/cooldown/bloodsucker/targeted/proc/CheckCanTarget(atom/A, display_error)
// Out of Range
if(!(A in view(target_range, owner)))
if(display_error && target_range > 1) // Only warn for range if it's greater than 1. Brawn doesn't need to announce itself.
@@ -261,7 +229,7 @@
return istype(A)
// Click Target
/datum/action/bloodsucker/targeted/proc/ClickWithPower(atom/A)
/datum/action/cooldown/bloodsucker/targeted/proc/ClickWithPower(atom/A)
// CANCEL RANGED TARGET check
if(power_in_use || !CheckValidTarget(A))
return FALSE
@@ -276,21 +244,21 @@
power_in_use = FALSE
return TRUE
/datum/action/bloodsucker/targeted/proc/FireTargetedPower(atom/A)
/datum/action/cooldown/bloodsucker/targeted/proc/FireTargetedPower(atom/A)
// Like ActivatePower, but specific to Targeted (and takes an atom input). We don't use ActivatePower for targeted.
/datum/action/bloodsucker/targeted/proc/PowerActivatedSuccessfully()
/datum/action/cooldown/bloodsucker/targeted/proc/PowerActivatedSuccessfully()
// The power went off! We now pay the cost of the power.
PayCost()
DeactivateRangedAbility()
DeactivatePower()
StartCooldown() // Do AFTER UpdateIcon() inside of DeactivatePower. Otherwise icon just gets wiped.
/datum/action/bloodsucker/targeted/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active.
/datum/action/cooldown/bloodsucker/targeted/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active.
return ..()
// Target Proc Holder
/obj/effect/proc_holder/bloodsucker
var/datum/action/bloodsucker/targeted/linked_power
var/datum/action/cooldown/bloodsucker/targeted/linked_power
/obj/effect/proc_holder/bloodsucker/remove_ranged_ability(msg)
..()

View File

@@ -55,8 +55,8 @@
bloodsuckerdatum.warn_sun_locker = FALSE
bloodsuckerdatum.warn_sun_burn = FALSE
// Remove Dawn Powers
for(var/datum/action/bloodsucker/P in bloodsuckerdatum.powers)
if(istype(P, /datum/action/bloodsucker/gohome))
for(var/datum/action/cooldown/bloodsucker/P in bloodsuckerdatum.powers)
if(istype(P, /datum/action/cooldown/bloodsucker/gohome))
bloodsuckerdatum.powers -= P
P.Remove(M.current)
nighttime_duration += 100 //Each day makes the night a minute longer.
@@ -149,5 +149,5 @@
if(!istype(M) || !istype(M.current))
continue
var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
if(istype(bloodsuckerdatum) && bloodsuckerdatum.lair && !(locate(/datum/action/bloodsucker/gohome) in bloodsuckerdatum.powers))
bloodsuckerdatum.BuyPower(new /datum/action/bloodsucker/gohome)
if(istype(bloodsuckerdatum) && bloodsuckerdatum.lair && !(locate(/datum/action/cooldown/bloodsucker/gohome) in bloodsuckerdatum.powers))
bloodsuckerdatum.BuyPower(new /datum/action/cooldown/bloodsucker/gohome)

View File

@@ -14,7 +14,7 @@
dat += "<HR>"
// Step One: Decide powers you CAN buy.
for(var/pickedpower in typesof(/datum/action/bloodsucker))
for(var/pickedpower in typesof(/datum/action/cooldown/bloodsucker))
var/obj/effect/proc_holder/spell/bloodsucker/power = pickedpower
// NAME
dat += "<A href='byond://?src=[REF(src)];[module.mod_pick_name]=1'>[power.name]</A>"

View File

@@ -168,7 +168,7 @@
return fullname
/datum/antagonist/bloodsucker/proc/BuyPower(datum/action/bloodsucker/power)//(obj/effect/proc_holder/spell/power)
/datum/antagonist/bloodsucker/proc/BuyPower(datum/action/cooldown/bloodsucker/power)//(obj/effect/proc_holder/spell/power)
powers += power
power.Grant(owner.current)// owner.AddSpell(power)
@@ -177,9 +177,9 @@
add_hud()
update_hud(TRUE) // Set blood value, current rank
// Powers
BuyPower(new /datum/action/bloodsucker/feed)
BuyPower(new /datum/action/bloodsucker/masquerade)
BuyPower(new /datum/action/bloodsucker/veil)
BuyPower(new /datum/action/cooldown/bloodsucker/feed)
BuyPower(new /datum/action/cooldown/bloodsucker/masquerade)
BuyPower(new /datum/action/cooldown/bloodsucker/veil)
// Traits
for(var/T in defaultTraits)
ADD_TRAIT(owner.current, T, BLOODSUCKER_TRAIT)
@@ -221,7 +221,7 @@
remove_hud()
// Powers
while(powers.len)
var/datum/action/bloodsucker/power = pick(powers)
var/datum/action/cooldown/bloodsucker/power = pick(powers)
powers -= power
power.Remove(owner.current)
// owner.RemoveSpell(power)
@@ -267,7 +267,7 @@
to_chat(owner, "<span class='announce'>Bloodsucker Tip: If you cannot find or steal a coffin to use, you can build one from wooden planks.</span><br>")
/datum/antagonist/bloodsucker/proc/LevelUpPowers()
for(var/datum/action/bloodsucker/power in powers)
for(var/datum/action/cooldown/bloodsucker/power in powers)
power.level_current ++
/datum/antagonist/bloodsucker/proc/SpendRank()
@@ -281,8 +281,8 @@
//TODO: Make this into a radial, or perhaps a tgui next UI
// Purchase Power Prompt
var/list/options = list()
for(var/pickedpower in typesof(/datum/action/bloodsucker))
var/datum/action/bloodsucker/power = pickedpower
for(var/pickedpower in typesof(/datum/action/cooldown/bloodsucker))
var/datum/action/cooldown/bloodsucker/power = pickedpower
// If I don't own it, and I'm allowed to buy it.
if(!(locate(power) in powers) && initial(power.bloodsucker_can_buy))
options[initial(power.name)] = power // TESTING: After working with TGUI, it seems you can use initial() to view the variables inside a path?
@@ -303,7 +303,7 @@
to_chat(owner.current, "<span class='warning'>You dont have enough blood to thicken your blood, you need [level_bloodcost - L.blood_volume] units more!</span>")
return
// Buy New Powers
var/datum/action/bloodsucker/P = options[choice]
var/datum/action/cooldown/bloodsucker/P = options[choice]
AddBloodVolume(-level_bloodcost)
BuyPower(new P)
to_chat(owner.current, "<span class='notice'>You have used [level_bloodcost] units of blood and learned [initial(P.name)]!</span>")

View File

@@ -26,7 +26,7 @@
//owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition)
// Give Hunter Power
var/datum/action/P = new /datum/action/bloodsucker/trackvamp
var/datum/action/P = new /datum/action/cooldown/bloodsucker/trackvamp
P.Grant(owner.current)
// Give Hunter Martial Arts
@@ -69,7 +69,7 @@
// Take Hunter Power
if (owner.current)
for (var/datum/action/bloodsucker/P in owner.current.actions)
for (var/datum/action/cooldown/bloodsucker/P in owner.current.actions)
P.Remove(owner.current)
// Take Hunter Martial Arts
@@ -166,7 +166,7 @@
/*
/datum/action/bloodsucker/trackvamp/
/datum/action/cooldown/bloodsucker/trackvamp/
name = "Track Monster"//"Cellular Emporium"
desc = "Take a moment to look for clues of any nearby monsters.<br>These creatures are slippery, and often look like the crew."
button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon
@@ -177,7 +177,7 @@
cooldown = 300 // 10 ticks, 1 second.
bloodcost = 0
/datum/action/bloodsucker/trackvamp/ActivatePower()
/datum/action/cooldown/bloodsucker/trackvamp/ActivatePower()
var/mob/living/user = owner
to_chat(user, "<span class='notice'>You look around, scanning your environment and discerning signs of any filthy, wretched affronts to the natural order.</span>")
@@ -192,7 +192,7 @@
// NOTE: DON'T DEACTIVATE!
//DeactivatePower()
/datum/action/bloodsucker/trackvamp/proc/display_proximity()
/datum/action/cooldown/bloodsucker/trackvamp/proc/display_proximity()
// Pick target
var/turf/my_loc = get_turf(owner)
//var/list/mob/living/carbon/vamps = list()

View File

@@ -38,7 +38,7 @@
// Master Pinpointer
owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/vassal_edition)
// Powers
var/datum/action/bloodsucker/vassal/recuperate/new_Recuperate = new ()
var/datum/action/cooldown/bloodsucker/vassal/recuperate/new_Recuperate = new ()
new_Recuperate.Grant(owner.current)
powers += new_Recuperate
// Give Vassal Objective

View File

@@ -1,11 +1,11 @@
/datum/action/bloodsucker/targeted/brawn
/datum/action/cooldown/bloodsucker/targeted/brawn
name = "Brawn"
desc = "Snap restraints with ease, or deal terrible damage with your bare hands."
button_icon_state = "power_strength"
bloodcost = 10
cooldown = 90
cooldown_time = 90
target_range = 1
power_activates_immediately = TRUE
message_Trigger = ""//"Whom will you subvert to your will?"
@@ -16,7 +16,7 @@
var/upgrade_canLocker = FALSE
var/upgrade_canDoor = FALSE
/datum/action/bloodsucker/targeted/brawn/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/targeted/brawn/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -38,10 +38,10 @@
// NOTE: We use . = FALSE so that we can break cuffs AND throw off our attacker in one use!
//return TRUE
/datum/action/bloodsucker/targeted/brawn/CheckValidTarget(atom/A)
/datum/action/cooldown/bloodsucker/targeted/brawn/CheckValidTarget(atom/A)
return isliving(A) || istype(A, /obj/machinery/door)
/datum/action/bloodsucker/targeted/brawn/CheckCanTarget(atom/A, display_error)
/datum/action/cooldown/bloodsucker/targeted/brawn/CheckCanTarget(atom/A, display_error)
// DEFAULT CHECKS (Distance)
if(!..()) // Disable range notice for Brawn.
return FALSE
@@ -59,7 +59,7 @@
return TRUE
return ..() // yes, FALSE! You failed if you got here! BAD TARGET
/datum/action/bloodsucker/targeted/brawn/FireTargetedPower(atom/A)
/datum/action/cooldown/bloodsucker/targeted/brawn/FireTargetedPower(atom/A)
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
var/mob/living/carbon/target = A
var/mob/living/user = owner
@@ -97,7 +97,7 @@
D.open(2) // open(2) is like a crowbar or jaws of life.
// Target Type: Closet
/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakRestraints()
/datum/action/cooldown/bloodsucker/targeted/brawn/proc/CheckBreakRestraints()
if(!iscarbon(owner)) // || !owner.restrained()
return FALSE
// (NOTE: Just like biodegrade.dm, we only remove one thing per use //
@@ -131,7 +131,7 @@
return TRUE
return FALSE
/datum/action/bloodsucker/targeted/brawn/proc/CheckEscapePuller()
/datum/action/cooldown/bloodsucker/targeted/brawn/proc/CheckEscapePuller()
if(!owner.pulledby)// || owner.pulledby.grab_state <= GRAB_PASSIVE)
return FALSE
var/mob/M = owner.pulledby
@@ -153,7 +153,7 @@
owner.pulledby = null // It's already done, but JUST IN CASE.
return TRUE
/* Doesnt work
/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakLocker()
/datum/action/cooldown/bloodsucker/targeted/brawn/proc/CheckBreakLocker()
if(!istype(owner.loc, /obj/structure/closet))
return FALSE
playsound(get_turf(owner), 'sound/machines/airlock_alien_prying.ogg', 40, 1, -1)

View File

@@ -1,11 +1,11 @@
/datum/action/bloodsucker/cloak
/datum/action/cooldown/bloodsucker/cloak
name = "Cloak of Darkness"
desc = "Blend into the shadows and become invisible to the untrained eye. Movement is slowed in brightly lit areas, and you cannot dissapear while mortals watch you."
button_icon_state = "power_cloak"
bloodcost = 5
cooldown = 50
cooldown_time = 50
bloodsucker_can_buy = TRUE
amToggle = TRUE
warn_constant_cost = TRUE
@@ -14,7 +14,7 @@
var/walk_threshold = 0.4 // arbitrary number, to be changed. edit in last commit: this is fine after testing on box station for a bit
var/lum
/datum/action/bloodsucker/cloak/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/cloak/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -24,7 +24,7 @@
return FALSE
return TRUE
/datum/action/bloodsucker/cloak/ActivatePower()
/datum/action/cooldown/bloodsucker/cloak/ActivatePower()
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
var/mob/living/user = owner
@@ -52,7 +52,7 @@
sleep(5) // Check every few ticks
/datum/action/bloodsucker/cloak/ContinueActive(mob/living/user, mob/living/target)
/datum/action/cooldown/bloodsucker/cloak/ContinueActive(mob/living/user, mob/living/target)
if (!..())
return FALSE
if(user.stat == !CONSCIOUS) // Must be CONSCIOUS
@@ -60,7 +60,7 @@
return FALSE
return TRUE
/datum/action/bloodsucker/cloak/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/cloak/DeactivatePower(mob/living/user = owner, mob/living/target)
..()
REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness")
user.alpha = 255

View File

@@ -1,12 +1,12 @@
/datum/action/bloodsucker/feed
/datum/action/cooldown/bloodsucker/feed
name = "Feed"
desc = "Draw the heartsblood of living victims in your grasp.<br><b>None/Passive:</b> Feed silently and unnoticed by your victim.<br><b>Aggressive: </b>Subdue your target quickly."
button_icon_state = "power_feed"
bloodcost = 0
cooldown = 30
cooldown_time = 30
amToggle = TRUE
bloodsucker_can_buy = TRUE
can_be_staked = TRUE
@@ -16,7 +16,7 @@
var/mob/living/feed_target // So we can validate more than just the guy we're grappling.
var/target_grappled = FALSE // If you started grappled, then ending it will end your Feed.
/datum/action/bloodsucker/feed/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/feed/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -33,7 +33,7 @@
// DONE!
return TRUE
/datum/action/bloodsucker/feed/proc/ValidateTarget(mob/living/target, display_error) // Called twice: validating a subtle victim, or validating your grapple victim.
/datum/action/cooldown/bloodsucker/feed/proc/ValidateTarget(mob/living/target, display_error) // Called twice: validating a subtle victim, or validating your grapple victim.
// Bloodsuckers + Animals MUST be grabbed aggressively!
if(!owner.pulling || target == owner.pulling && owner.grab_state < GRAB_AGGRESSIVE)
// NOTE: It's OKAY that we are checking if(!target) below, AFTER animals here. We want passive check vs animal to warn you first, THEN the standard warning.
@@ -76,7 +76,7 @@
return TRUE
// If I'm not grabbing someone, find me someone nearby.
/datum/action/bloodsucker/feed/proc/FindMyTarget(display_error)
/datum/action/cooldown/bloodsucker/feed/proc/FindMyTarget(display_error)
// Default
feed_target = null
target_grappled = FALSE
@@ -132,7 +132,7 @@
feed_target = pick(targets_valid)//targets[1]
return TRUE
/datum/action/bloodsucker/feed/ActivatePower()
/datum/action/cooldown/bloodsucker/feed/ActivatePower()
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up Activate(), so Deactivate() can happen after.
var/mob/living/target = feed_target // Stored during CheckCanUse(). Can be a grabbed OR adjecent character.
var/mob/living/user = owner
@@ -302,16 +302,16 @@
CheckKilledTarget(user,target)
/datum/action/bloodsucker/feed/proc/CheckKilledTarget(mob/living/user, mob/living/target)
/datum/action/cooldown/bloodsucker/feed/proc/CheckKilledTarget(mob/living/user, mob/living/target)
// Bad Bloodsucker. You shouldn't do that.
if(target && target.stat >= DEAD && ishuman(target))
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankkilled", /datum/mood_event/drankkilled) // BAD // in bloodsucker_life.dm
/datum/action/bloodsucker/feed/ContinueActive(mob/living/user, mob/living/target)
/datum/action/cooldown/bloodsucker/feed/ContinueActive(mob/living/user, mob/living/target)
return ..() && target && (!target_grappled || user.pulling == target) && blood_sucking_checks(target, TRUE, TRUE) // Active, and still antag,
// NOTE: We only care about pulling if target started off that way. Mostly only important for Aggressive feed.
/datum/action/bloodsucker/feed/proc/ApplyVictimEffects(mob/living/target)
/datum/action/cooldown/bloodsucker/feed/proc/ApplyVictimEffects(mob/living/target)
// Bloodsuckers not affected by "the Kiss" of another vampire
if(!target.mind || !target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
target.Unconscious(50,0)
@@ -320,7 +320,7 @@
if(ishuman(target))
target.adjustStaminaLoss(5, forced = TRUE)// Base Stamina Damage
/datum/action/bloodsucker/feed/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/feed/DeactivatePower(mob/living/user = owner, mob/living/target)
..() // activate = FALSE
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
// No longer Feeding

View File

@@ -2,12 +2,12 @@
/datum/action/bloodsucker/fortitude
/datum/action/cooldown/bloodsucker/fortitude
name = "Fortitude"
desc = "Withstand egregious physical wounds and walk away from attacks that would stun, pierce, and dismember lesser beings. You cannot run while active."
button_icon_state = "power_fortitude"
bloodcost = 30
cooldown = 80
cooldown_time = 80
bloodsucker_can_buy = TRUE
amToggle = TRUE
warn_constant_cost = TRUE
@@ -15,7 +15,7 @@
var/fortitude_resist // So we can raise and lower your brute resist based on what your level_current WAS.
/datum/action/bloodsucker/fortitude/ActivatePower()
/datum/action/cooldown/bloodsucker/fortitude/ActivatePower()
var/datum/antagonist/bloodsucker/B = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
var/mob/living/user = owner
to_chat(user, "<span class='notice'>Your flesh, skin, and muscles become as steel.</span>")
@@ -47,8 +47,8 @@
B.AddBloodVolume(-0.5)
sleep(20) // Check every few ticks that we haven't disabled this power
// Return to Running (if you were before)
/datum/action/bloodsucker/fortitude/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/fortitude/DeactivatePower(mob/living/user = owner, mob/living/target)
..()
// Restore Traits & Effects
REMOVE_TRAIT(user, TRAIT_PIERCEIMMUNE, "fortitude")

View File

@@ -1,6 +1,6 @@
/datum/action/bloodsucker/gohome
/datum/action/cooldown/bloodsucker/gohome
name = "Vanishing Act"
desc = "As dawn aproaches, disperse into mist and return directly to your Lair.<br><b>WARNING:</b> You will drop <b>ALL</b> of your possessions if observed by mortals."
button_icon_state = "power_gohome"
@@ -8,7 +8,7 @@
background_icon_state_off = "vamp_power_off_oneshot"
bloodcost = 100
cooldown = 99999 // It'll never come back.
cooldown_time = 99999 // It'll never come back.
amToggle = FALSE
amSingleUse = TRUE
@@ -18,7 +18,7 @@
can_be_immobilized = TRUE
must_be_concious = FALSE
/datum/action/bloodsucker/gohome/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/gohome/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -30,12 +30,12 @@
return FALSE
return TRUE
/datum/action/bloodsucker/gohome/proc/flicker_lights(var/flicker_range, var/beat_volume)
/datum/action/cooldown/bloodsucker/gohome/proc/flicker_lights(var/flicker_range, var/beat_volume)
for(var/obj/machinery/light/L in view(flicker_range, get_turf(owner)))
playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', beat_volume, 1)
/datum/action/bloodsucker/gohome/ActivatePower()
/datum/action/cooldown/bloodsucker/gohome/ActivatePower()
var/mob/living/carbon/user = owner
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
// IMPORTANT: Check for lair at every step! It might get destroyed.

View File

@@ -3,12 +3,12 @@
// Level 2: Dodge Bullets
// Level 3: Stun People Passed
/datum/action/bloodsucker/targeted/haste
/datum/action/cooldown/bloodsucker/targeted/haste
name = "Immortal Haste"
desc = "Dash somewhere with supernatural speed. Those nearby may be knocked away, stunned, or left empty-handed."
button_icon_state = "power_speed"
bloodcost = 6
cooldown = 120
cooldown_time = 120
target_range = 15
power_activates_immediately = TRUE
message_Trigger = ""//"Whom will you subvert to your will?"
@@ -18,7 +18,7 @@
/// If set, uses this speed in deciseconds instead of world.tick_lag
var/speed_override
/datum/action/bloodsucker/targeted/haste/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/targeted/haste/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -33,10 +33,10 @@
return FALSE
return TRUE
/datum/action/bloodsucker/targeted/haste/CheckValidTarget(atom/A)
/datum/action/cooldown/bloodsucker/targeted/haste/CheckValidTarget(atom/A)
return isturf(A) || A.loc != owner.loc // Anything will do, if it's not me or my square
/datum/action/bloodsucker/targeted/haste/CheckCanTarget(atom/A, display_error)
/datum/action/cooldown/bloodsucker/targeted/haste/CheckCanTarget(atom/A, display_error)
// DEFAULT CHECKS (Distance)
if (!..())
return FALSE
@@ -45,7 +45,7 @@
// return FALSE
return TRUE
/datum/action/bloodsucker/targeted/haste/FireTargetedPower(atom/A)
/datum/action/cooldown/bloodsucker/targeted/haste/FireTargetedPower(atom/A)
// This is a non-async proc to make sure the power is "locked" until this finishes.
hit = list()
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, .proc/on_move)
@@ -78,11 +78,11 @@
hit = null
user.update_mobility()
/datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target)
..() // activate = FALSE
user.update_mobility()
/datum/action/bloodsucker/targeted/haste/proc/on_move()
/datum/action/cooldown/bloodsucker/targeted/haste/proc/on_move()
for(var/mob/living/L in dview(1, get_turf(owner)))
if(!hit[L] && (L != owner))
hit[L] = TRUE

View File

@@ -1,25 +1,25 @@
/datum/action/bloodsucker/lunge
/datum/action/cooldown/bloodsucker/lunge
name = "Predatory Lunge"
desc = "Prepare the strenght to grapple your prey."
button_icon_state = "power_lunge"
bloodcost = 10
cooldown = 30
cooldown_time = 30
bloodsucker_can_buy = TRUE
warn_constant_cost = TRUE
amToggle = TRUE
var/leap_skill_mod = 5
/datum/action/bloodsucker/lunge/New()
/datum/action/cooldown/bloodsucker/lunge/New()
. = ..()
/datum/action/bloodsucker/lunge/Destroy()
/datum/action/cooldown/bloodsucker/lunge/Destroy()
. = ..()
UnregisterSignal(owner, COMSIG_CARBON_TACKLED)
/datum/action/bloodsucker/lunge/ActivatePower()
/datum/action/cooldown/bloodsucker/lunge/ActivatePower()
var/mob/living/carbon/user = owner
var/datum/antagonist/bloodsucker/B = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
var/datum/component/tackler/T = user.LoadComponent(/datum/component/tackler)
@@ -37,10 +37,10 @@
sleep(5)
//Without this, the leap component would get removed too early, causing the normal crash into effects.
/datum/action/bloodsucker/lunge/proc/DelayedDeactivatePower()
/datum/action/cooldown/bloodsucker/lunge/proc/DelayedDeactivatePower()
addtimer(CALLBACK(src, .proc/DeactivatePower), 1 SECONDS, TIMER_UNIQUE)
/datum/action/bloodsucker/lunge/DeactivatePower(mob/living/user = owner)
/datum/action/cooldown/bloodsucker/lunge/DeactivatePower(mob/living/user = owner)
. = ..()
qdel(user.GetComponent(/datum/component/tackler))
UnregisterSignal(user, COMSIG_CARBON_TACKLED)

View File

@@ -16,12 +16,12 @@
// -
/datum/action/bloodsucker/masquerade
/datum/action/cooldown/bloodsucker/masquerade
name = "Masquerade"
desc = "Feign the vital signs of a mortal, and escape both casual and medical notice as the monster you truly are."
button_icon_state = "power_human"
bloodcost = 10
cooldown = 50
cooldown_time = 50
amToggle = TRUE
bloodsucker_can_buy = TRUE
warn_constant_cost = TRUE
@@ -31,7 +31,7 @@
// NOTE: Firing off vulgar powers disables your Masquerade!
/*/datum/action/bloodsucker/masquerade/CheckCanUse(display_error)
/*/datum/action/cooldown/bloodsucker/masquerade/CheckCanUse(display_error)
if(!..(display_error))// DEFAULT CHECKS
return FALSE
// DONE!
@@ -39,7 +39,7 @@
*/
/datum/action/bloodsucker/masquerade/ActivatePower()
/datum/action/cooldown/bloodsucker/masquerade/ActivatePower()
var/mob/living/user = owner
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)
@@ -78,14 +78,14 @@
sleep(20) // Check every few ticks that we haven't disabled this power
/datum/action/bloodsucker/masquerade/ContinueActive(mob/living/user)
/datum/action/cooldown/bloodsucker/masquerade/ContinueActive(mob/living/user)
// Disable if unable to use power anymore.
//if (user.stat == DEAD || user.blood_volume <= 0) // not conscious or soft critor uncon, just dead
// return FALSE
return ..() // Active, and still Antag
/datum/action/bloodsucker/masquerade/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/masquerade/DeactivatePower(mob/living/user = owner, mob/living/target)
..() // activate = FALSE
var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)

View File

@@ -5,12 +5,12 @@
// FOLLOW: Target follows you, spouting random phrases from their history (or maybe Polly's or NPC's vocab?)
// ATTACK: Target finds a nearby non-Bloodsucker victim to attack.
/datum/action/bloodsucker/targeted/mesmerize
/datum/action/cooldown/bloodsucker/targeted/mesmerize
name = "Mesmerize"
desc = "Dominate the mind of a mortal who can see your eyes."
button_icon_state = "power_mez"
bloodcost = 30
cooldown = 300
cooldown_time = 300
target_range = 2
power_activates_immediately = TRUE
message_Trigger = "Whom will you subvert to your will?"
@@ -18,7 +18,7 @@
bloodsucker_can_buy = TRUE
var/success
/datum/action/bloodsucker/targeted/mesmerize/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -34,10 +34,10 @@
return FALSE
return TRUE
/datum/action/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/A)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/A)
return iscarbon(A)
/datum/action/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/A,display_error)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/A,display_error)
// Check: Self
if(A == owner)
return FALSE
@@ -88,7 +88,7 @@
return FALSE
return TRUE
/datum/action/bloodsucker/targeted/mesmerize/proc/ContinueTarget(atom/A)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/proc/ContinueTarget(atom/A)
var/mob/living/carbon/target = A
var/mob/living/L = owner
@@ -103,7 +103,7 @@
to_chat(L, "<span class='warning'>[target] has escaped your gaze!</span>")
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
/datum/action/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A)
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
var/mob/living/carbon/target = A
var/mob/living/L = owner
@@ -118,7 +118,7 @@
// 5 second windup
addtimer(CALLBACK(src, .proc/apply_effects, L, target, power_time), 6 SECONDS)
/datum/action/bloodsucker/targeted/mesmerize/proc/apply_effects(aggressor, victim, power_time)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/proc/apply_effects(aggressor, victim, power_time)
var/mob/living/carbon/target = victim
var/mob/living/L = aggressor
if(!success)
@@ -135,5 +135,5 @@
to_chat(L, "<span class='warning'>[target] has snapped out of their trance.</span>")
/datum/action/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target)
return ..() && CheckCanUse() && CheckCanTarget(target)

View File

@@ -1,12 +1,12 @@
/datum/action/bloodsucker/vassal/recuperate
/datum/action/cooldown/bloodsucker/vassal/recuperate
name = "Sanguine Recuperation"
desc = "Slowly heal brute damage while active. This process is exhausting, and requires some of your tainted blood."
button_icon_state = "power_recup"
amToggle = TRUE
bloodcost = 5
cooldown = 100
cooldown_time = 100
/datum/action/bloodsucker/vassal/recuperate/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/vassal/recuperate/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -14,7 +14,7 @@
return FALSE
return TRUE
/datum/action/bloodsucker/vassal/recuperate/ActivatePower()
/datum/action/cooldown/bloodsucker/vassal/recuperate/ActivatePower()
to_chat(owner, "<span class='notice'>Your muscles clench and your skin crawls as your master's immortal blood knits your wounds and gives you stamina.</span>")
var/mob/living/carbon/C = owner
var/mob/living/carbon/human/H
@@ -35,5 +35,5 @@
// DONE!
//DeactivatePower(owner)
/datum/action/bloodsucker/vassal/recuperate/ContinueActive(mob/living/user, mob/living/target)
/datum/action/cooldown/bloodsucker/vassal/recuperate/ContinueActive(mob/living/user, mob/living/target)
return ..() && user.stat <= DEAD && user.blood_volume > 500

View File

@@ -1,12 +1,12 @@
/datum/action/bloodsucker/targeted/trespass
/datum/action/cooldown/bloodsucker/targeted/trespass
name = "Trespass"
desc = "Become mist and advance two tiles in one direction, ignoring all obstacles except for walls. Useful for skipping past doors and barricades."
button_icon_state = "power_tres"
bloodcost = 10
cooldown = 80
cooldown_time = 80
amToggle = FALSE
//target_range = 2
@@ -16,7 +16,7 @@
var/turf/target_turf // We need to decide where we're going based on where we clicked. It's not actually the tile we clicked.
/datum/action/bloodsucker/targeted/trespass/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/targeted/trespass/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -26,7 +26,7 @@
return TRUE
/datum/action/bloodsucker/targeted/trespass/CheckValidTarget(atom/A)
/datum/action/cooldown/bloodsucker/targeted/trespass/CheckValidTarget(atom/A)
// Can't target my tile
if(A == get_turf(owner) || get_turf(A) == get_turf(owner))
return FALSE
@@ -34,7 +34,7 @@
return TRUE // All we care about is destination. Anything you click is fine.
/datum/action/bloodsucker/targeted/trespass/CheckCanTarget(atom/A, display_error)
/datum/action/cooldown/bloodsucker/targeted/trespass/CheckCanTarget(atom/A, display_error)
// NOTE: Do NOT use ..()! We don't want to check distance or anything.
// Get clicked tile
@@ -60,7 +60,7 @@
return TRUE
/datum/action/bloodsucker/targeted/trespass/FireTargetedPower(atom/A)
/datum/action/cooldown/bloodsucker/targeted/trespass/FireTargetedPower(atom/A)
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
// Find target turf, at or below Atom
@@ -87,7 +87,7 @@
user.invisibility = INVISIBILITY_MAXIMUM
// LOSE CUFFS
// Wait...
sleep(mist_delay / 2)

View File

@@ -1,10 +1,10 @@
/datum/action/bloodsucker/veil
/datum/action/cooldown/bloodsucker/veil
name = "Veil of Many Faces"
desc = "Disguise yourself in the illusion of another identity."
button_icon_state = "power_veil"
bloodcost = 15
cooldown = 100
cooldown_time = 100
amToggle = TRUE
bloodsucker_can_buy = TRUE
warn_constant_cost = TRUE
@@ -29,7 +29,7 @@
var/list/prev_features // For lizards and such
/datum/action/bloodsucker/veil/CheckCanUse(display_error)
/datum/action/cooldown/bloodsucker/veil/CheckCanUse(display_error)
. = ..()
if(!.)
return
@@ -37,7 +37,7 @@
return TRUE
/datum/action/bloodsucker/veil/ActivatePower()
/datum/action/cooldown/bloodsucker/veil/ActivatePower()
cast_effect() // POOF
@@ -47,14 +47,14 @@
Disguise_FaceName()
/datum/action/bloodsucker/veil/proc/Disguise_Outfit()
/datum/action/cooldown/bloodsucker/veil/proc/Disguise_Outfit()
// Step One: Back up original items
/datum/action/bloodsucker/veil/proc/Disguise_FaceName()
/datum/action/cooldown/bloodsucker/veil/proc/Disguise_FaceName()
// Change Name/Voice
var/mob/living/carbon/human/H = owner
@@ -112,7 +112,7 @@
sleep(50)
/datum/action/bloodsucker/veil/DeactivatePower(mob/living/user = owner, mob/living/target)
/datum/action/cooldown/bloodsucker/veil/DeactivatePower(mob/living/user = owner, mob/living/target)
..()
if (ishuman(user))
var/mob/living/carbon/human/H = user
@@ -149,7 +149,7 @@
cast_effect() // POOF
// CAST EFFECT // // General effect (poof, splat, etc) when you cast. Doesn't happen automatically!
/datum/action/bloodsucker/veil/proc/cast_effect()
/datum/action/cooldown/bloodsucker/veil/proc/cast_effect()
// Effect
playsound(get_turf(owner), 'sound/magic/smoke.ogg', 20, 1)
var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/()

View File

@@ -80,7 +80,6 @@
/datum/action/innate/cellular_emporium/New(our_target)
. = ..()
button.name = name
if(istype(our_target, /datum/cellular_emporium))
cellular_emporium = our_target
else

View File

@@ -44,7 +44,7 @@
name = "Reviving Stasis"
desc = "We fall into a stasis, allowing us to regenerate and trick our enemies. Costs 15 chemicals."
button_icon_state = "fake_death"
UpdateButtonIcon()
UpdateButtons()
chemical_cost = 15
to_chat(user, "<span class='notice'>We have revived ourselves.</span>")
@@ -56,7 +56,7 @@
name = "Revive"
desc = "We arise once more."
button_icon_state = "revive"
UpdateButtonIcon()
UpdateButtons()
chemical_cost = 0
revive_ready = TRUE

View File

@@ -411,6 +411,6 @@
Q.name = "[quickbind_slot.name] ([Q.scripture_index])"
Q.desc = quickbind_slot.quickbind_desc
Q.button_icon_state = quickbind_slot.name
Q.UpdateButtonIcon()
Q.UpdateButtons()
if(isliving(loc))
Q.Grant(loc)

View File

@@ -2,16 +2,11 @@
name = "Prepare Blood Magic"
button_icon_state = "carve"
desc = "Prepare blood magic by carving runes into your flesh. This rite is most effective with an <b>empowering rune</b>"
default_button_position = DEFAULT_BLOODSPELLS
var/list/spells = list()
var/channeling = FALSE
var/holy_dispel = FALSE
/datum/action/innate/cult/blood_magic/Grant()
..()
button.screen_loc = DEFAULT_BLOODSPELLS
button.moved = DEFAULT_BLOODSPELLS
button.ordered = FALSE
/datum/action/innate/cult/blood_magic/Remove()
for(var/X in spells)
qdel(X)
@@ -23,15 +18,21 @@
return ..()
/datum/action/innate/cult/blood_magic/proc/Positioning()
var/list/screen_loc_split = splittext(button.screen_loc,",")
var/list/screen_loc_X = splittext(screen_loc_split[1],":")
var/list/screen_loc_Y = splittext(screen_loc_split[2],":")
var/pix_X = text2num(screen_loc_X[2])
for(var/datum/action/innate/cult/blood_spell/B in spells)
if(B.button.locked)
var/order = pix_X+spells.Find(B)*31
B.button.screen_loc = "[screen_loc_X[1]]:[order],[screen_loc_Y[1]]:[screen_loc_Y[2]]"
B.button.moved = B.button.screen_loc
for(var/datum/hud/hud as anything in viewers)
var/our_view = hud.mymob?.client?.view || "15x15"
var/atom/movable/screen/movable/action_button/button = viewers[hud]
var/position = screen_loc_to_offset(button.screen_loc)
var/spells_iterated = 0
for(var/datum/action/innate/cult/blood_spell/blood_spell in spells)
spells_iterated += 1
if(blood_spell.positioned)
continue
var/atom/movable/screen/movable/action_button/moving_button = blood_spell.viewers[hud]
if(!moving_button)
continue
var/our_x = position[1] + spells_iterated * world.icon_size // Offset any new buttons into our list
hud.position_action(moving_button, offset_to_screen_loc(our_x, position[2], our_view))
blood_spell.positioned = TRUE
/datum/action/innate/cult/blood_magic/Activate()
if(holy_dispel)
@@ -99,6 +100,8 @@
var/base_desc //To allow for updating tooltips
var/invocation
var/health_cost = 0
/// Have we already been positioned into our starting location?
var/positioned = FALSE
/datum/action/innate/cult/blood_spell/Grant(mob/living/owner, datum/action/innate/cult/blood_magic/BM)
if(health_cost)
@@ -106,9 +109,7 @@
base_desc = desc
desc += "<br><b><u>Has [charges] use\s remaining</u></b>."
all_magic = BM
..()
button.locked = TRUE
button.ordered = FALSE
return ..()
/datum/action/innate/cult/blood_spell/Remove()
if(all_magic)
@@ -273,7 +274,7 @@
attached_action.charges--
attached_action.desc = attached_action.base_desc
attached_action.desc += "<br><b><u>Has [attached_action.charges] use\s remaining</u></b>."
attached_action.UpdateButtonIcon()
attached_action.UpdateButtons()
if(attached_action.charges <= 0)
remove_ranged_ability("<span class='cult'>You have exhausted the spell's power!</span>")
qdel(src)
@@ -325,7 +326,7 @@
qdel(src)
desc = base_desc
desc += "<br><b><u>Has [charges] use\s remaining</u></b>."
UpdateButtonIcon()
UpdateButtons()
/datum/action/innate/cult/blood_spell/manipulation
name = "Blood Rites"
@@ -373,7 +374,7 @@
source.charges = uses
source.desc = source.base_desc
source.desc += "<br><b><u>Has [uses] use\s remaining</u></b>."
source.UpdateButtonIcon()
source.UpdateButtons()
..()
/obj/item/melee/blood_magic/attack_self(mob/living/user)
@@ -400,7 +401,7 @@
else if(source)
source.desc = source.base_desc
source.desc += "<br><b><u>Has [uses] use\s remaining</u></b>."
source.UpdateButtonIcon()
source.UpdateButtons()
//Stun
/obj/item/melee/blood_magic/stun

View File

@@ -795,14 +795,13 @@
desc = "Call the blood spear back to your hand!"
background_icon_state = "bg_demon"
button_icon_state = "bloodspear"
default_button_position = "6:157,4:-2"
var/obj/item/cult_spear/spear
var/cooldown = 0
/datum/action/innate/cult/spear/Grant(mob/user, obj/blood_spear)
. = ..()
spear = blood_spear
button.screen_loc = "6:157,4:-2"
button.moved = "6:157,4:-2"
/datum/action/innate/cult/spear/Activate()
if(owner == spear.loc || cooldown > world.time)

View File

@@ -176,7 +176,7 @@
user.reveal(reveal)
user.stun(stun)
if(action)
action.UpdateButtonIcon()
action.UpdateButtons()
return TRUE
//Overload Light: Breaks a light that's online and sends out lightning bolts to all nearby people.

View File

@@ -33,9 +33,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
/datum/action/innate/ai/New()
..()
if(uses > 1)
desc = "[desc] It has [uses] use\s remaining."
button.desc = desc
desc = "[desc] It has [uses] use\s remaining."
/datum/action/innate/ai/Grant(mob/living/L)
. = ..()
@@ -63,7 +61,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
if(!silent)
to_chat(owner, "<span class='notice'>[name] now has <b>[uses]</b> use[uses > 1 ? "s" : ""] remaining.</span>")
desc = "[initial(desc)] It has [uses] use\s remaining."
UpdateButtonIcon()
UpdateButtons()
return
if(initial(uses) > 1) //no need to tell 'em if it was one-use anyway!
to_chat(owner, "<span class='warning'>[name] has run out of uses!</span>")
@@ -92,7 +90,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
if(!silent)
to_chat(owner, "<span class='notice'>[name] now has <b>[uses]</b> use[uses > 1 ? "s" : ""] remaining.</span>")
desc = "[initial(desc)] It has [uses] use\s remaining."
UpdateButtonIcon()
UpdateButtons()
return
if(initial(uses) > 1) //no need to tell 'em if it was one-use anyway!
to_chat(owner, "<span class='warning'>[name] has run out of uses!</span>")
@@ -203,7 +201,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
else //Adding uses to an existing module
action.uses += initial(action.uses)
action.desc = "[initial(action.desc)] It has [action.uses] use\s remaining."
action.UpdateButtonIcon()
action.UpdateButtons()
temp = "Additional use[action.uses > 1 ? "s" : ""] added to [action.name]!"
processing_time -= AM.cost
@@ -759,6 +757,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
uses = 3
auto_use_uses = FALSE
/datum/action/innate/ai/blackout/New()
..()
desc = "[desc] It has [uses] use\s remaining."
/datum/action/innate/ai/blackout/Activate()
for(var/obj/machinery/power/apc/apc in GLOB.apcs_list)
if(prob(30 * apc.overload))
@@ -768,7 +770,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
to_chat(owner, "<span class='notice'>Overcurrent applied to the powernet.</span>")
owner.playsound_local(owner, "sparks", 50, 0)
adjust_uses(-1)
if(QDELETED(src) || uses) //Not sure if not having src here would cause a runtime, so it's here to be safe
return
desc = "[initial(desc)] It has [uses] use\s remaining."
UpdateButtons()
//Disable Emergency Lights
/datum/AI_Module/small/emergency_lights
@@ -816,6 +821,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
auto_use_uses = FALSE
cooldown_period = 30
/datum/action/innate/ai/reactivate_cameras/New()
..()
desc = "[desc] It has [uses] use\s remaining."
/datum/action/innate/ai/reactivate_cameras/Activate()
var/fixed_cameras = 0
for(var/V in GLOB.cameranet.cameras)
@@ -830,7 +839,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
to_chat(owner, "<span class='notice'>Diagnostic complete! Cameras reactivated: <b>[fixed_cameras]</b>. Reactivations remaining: <b>[uses]</b>.</span>")
owner.playsound_local(owner, 'sound/items/wirecutter.ogg', 50, 0)
adjust_uses(0, TRUE) //Checks the uses remaining
if(QDELETED(src) || !uses) //Not sure if not having src here would cause a runtime, so it's here to be safe
return
desc = "[initial(desc)] It has [uses] use\s remaining."
UpdateButtons()
//Upgrade Camera Network: EMP-proofs all cameras, in addition to giving them X-ray vision.
/datum/AI_Module/large/upgrade_cameras