CleverRaven / CleverRaven/Cataclysm-DDA

Monster special attacks' cooldown is randomised on first use

Open
#64,907 2 comments 1 reaction 0 assignees View on GitHub
(P4 - Low) (S2 - Confirmed) <Bug> Monsters
Dominant language
C++
Stars
13.2k
Forks
4.6k
Avg merge
2d 1h
Merged PRs (30d)
205

Description

### Describe the bug

When a monster is spawned in, when it first uses it's special attack, the cooldown value appears randomised between 1 and the actual cooldown value specified in the json. Every subsequent special attack is given the correct cooldown value.

### Attach save file

N/A, easily reproducible.

### Steps to reproduce

1. Use debug menu or an EOC function to spawn a monster with a defined special attack.
2. Activate debug mode filtering for MATTACK and check monster cooldown value.

### Expected behavior

The cooldown value should be respected on the first usage by that monster.

### Screenshots

![randomcooldownbug](https://user-images.githubusercontent.com/128114181/230588872-a70b6dd8-59ba-4fb4-ad61-793701411d53.png)

### Versions and configuration

Win 10 64-bit
cdda-windows-tiles-sounds-x64-2023-04-06-1455 (tested across multiple experimentals, this is the latest I have tried)
Graphical Tiles
Default mods, clean install

### Additional context

This was tested with various different monsters with both spell and regular special attack definitions. In the attached screenshot, 9 Vigilant Amalgamations were spawned at the same time within their sight range to me, and one turn has passed. Note also the messages showing some of the monsters attempting to use the special attack multiple times at once.

Contributor guide

Open the contributing guide

Research direction

Start by tracing monster special-attack cooldown handling from the debug menu or EOC spawn path, using MATTACK filtering and the JSON special-attack definitions to reproduce the first-use behavior. Compare the initial cooldown with subsequent attacks across spell and regular specials; done means the defined cooldown is respected on the first use as well as later uses.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.