CleverRaven / CleverRaven/Cataclysm-DDA
Artifacts recharge at twice the speed and can spawn with an invalid recharge type
- Dominant language
- C++
- Stars
- 13.1k
- Forks
- 4.6k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 205
Description
# Describe the bug
Two bugs:
1. Artifacts can spawn with an invalid recharge type
2. Artifacts recharge at twice the speed
# Steps To Reproduce
Reproducing 1st bug:
1. Go to the spawning section of the debug menu.
2. Spawn an artifact with `"Spawn clairvoyance artifact"`.
3. Wield the artifact and open it in your save file.
4. Notice how artifact recharge type is `3` which correspondes to `relic_recharge::num`.
This bug also extends to some artifacts spawned with `"Spawn artifact"`, but I don't know if it happens with naturally spawned artifacts.
Reproducing 2nd bug:
1. Keep spawning random artifacts until you find one with with charges and a periodic recharge time.
2. Use one charge if artifact is at max charges.
3. Wield the artifact and check in your `.sav` file the recharge time ( `"time"` field ).
4. Optionally set it to 1 hour ( `3600` ) for easier testing.
5. Wait half the amount of turns in the `"time"` field, artifact recharges.
# Expected behavior
1st bug:
Artifact recharge type should be `relic_recharge::none` instead of `relic_recharge::num`.
2nd bug:
Artifact recharges after waiting the exact amount of time.
# Screenshots
None
# Versions and configuration
- OS: Linux
- OS Version:
- Game Version: 0.E-9884-g2f0f0585b4 [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Bionic Professions [package_bionic_professions],
Magiclysm [magiclysm]
]
# Additional context
None
Contributor guide
Research direction
Start by tracing the debug-menu artifact spawning path and the code that serializes artifact recharge fields, focusing on the `recharge type` and `time` values described in the reproduction steps. Done means spawned artifacts use `relic_recharge::none` where expected and periodic recharge occurs after the full saved interval, verified through the listed save-file checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100