Files
Bubberstation/code/datums/actions/mobs/transform_weapon.dm
SkyratBot f372b2df2d [MIRROR] Legion Mob Abilities (#26256)
* Legion Mob Abilities (#81082)

## About The Pull Request

Converts legions hardcoded abilities to the cooldown action / mob
abilities system.

I also took the liberty of converting the hacky 360 second cooldowns in
a lot of the mob actions into simply disabling other abilities while the
ability is active, this will make it easier to have bosses without
everything on a shared cooldown and also not allow abilities to be used
simultaneously.

## Why It's Good For The Game

Paving the way for basic megafauna.

## Changelog

🆑
refactor: Legions abilities have been changed into actions that can be
added to any mob.
/🆑

---------

Co-authored-by: Changelogs <action@ github.com>

* Legion Mob Abilities

---------

Co-authored-by: Whoneedspacee <yougotreallyowned@gmail.com>
Co-authored-by: Changelogs <action@ github.com>
2024-01-28 00:00:32 -05:00

28 lines
1.2 KiB
Plaintext

/datum/action/cooldown/mob_cooldown/transform_weapon
name = "Transform Weapon"
button_icon = 'icons/obj/mining_zones/artefacts.dmi'
button_icon_state = "cleaving_saw"
desc = "Transform weapon into a different state."
cooldown_time = 5 SECONDS
shared_cooldown = MOB_SHARED_COOLDOWN_2
/// The max possible cooldown, cooldown is random between the default cooldown time and this
var/max_cooldown_time = 10 SECONDS
/datum/action/cooldown/mob_cooldown/transform_weapon/Activate(atom/target_atom)
disable_cooldown_actions()
do_transform(target_atom)
StartCooldown(rand(cooldown_time, max_cooldown_time), 0)
enable_cooldown_actions()
return TRUE
/datum/action/cooldown/mob_cooldown/transform_weapon/proc/do_transform(atom/target)
if(!istype(owner, /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner))
return
var/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/BDM = owner
var/obj/item/melee/cleaving_saw/miner/miner_saw = BDM.miner_saw
miner_saw.attack_self(owner)
var/saw_open = HAS_TRAIT(miner_saw, TRAIT_TRANSFORM_ACTIVE)
BDM.rapid_melee = saw_open ? 3 : 5
BDM.icon_state = "miner[saw_open ? "_transformed":""]"
BDM.icon_living = "miner[saw_open ? "_transformed":""]"