Implement devotee loyalty and morale mechanics with cap based on reputation tier #221
Labels
No labels
Blocked
Duplicate
MoSCoW/Could Have
MoSCoW/Must Have
MoSCoW/Should Have
Points/1
Points/13
Points/2
Points/21
Points/3
Points/5
Points/8
Priority/Backlog
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
State/Completed
State/In progress
State/In review
State/Paused
State/Unverified
State/Verified
State/Wont Do
Type/Bug
Type/Epic
Type/Feature
Type/Legendary
Type/Task
Type/Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#203 Epic: Devotee System
aethyr/Aethyr
Reference: aethyr/Aethyr#221
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
feature/m4-devotee-loyalty-morale-mechanicsImplement devotee loyalty and morale mechanics with cap based on reputation tier (#221)Background and Context
Devotees are not mindless automatons — they have loyalty and morale that fluctuate based on player actions and conditions. Loyalty represents a devotee's commitment to the player, while morale represents their current emotional state and willingness to work.
Loyalty increases slowly when devotees successfully complete tasks (+1 per day of active work) and decreases when the player's reputation with the devotee's original faction drops. Morale decreases when devotees are left idle without assignments or when conditions are poor, and increases when assigned meaningful work.
If either loyalty or morale drops below 10, the devotee deserts — they leave the player's service permanently. This creates a management challenge and rewards attentive players.
The number of devotees a player can maintain is capped based on their highest relevant reputation tier:
Expected Behavior
player.info["devotees"].Acceptance Criteria
Subtasks
lib/aethyr/core/reputation/devotee_mechanics.rbwith the loyalty/morale engine.:reputation_changedfor dynamic loyalty/cap updates.tests/unit/devotee_mechanics.featurecovering loyalty gain/loss, morale gain/loss, desertion trigger, desertion notification, cap enforcement, and cap-drop desertion.tests/integration/for multi-day devotee lifecycle including loyalty/morale changes, desertion, and cap enforcement.bundle exec rake unit_profileand verify no performance regressions.bundle exec rake unit. If coverage is <97% then review the current unit test coverage report atbuild/tests/unit/coverage/and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerunbundle exec rake unitto verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.bundle exec rake(default task: unit tests with coverage) andbundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.Definition of Done
This issue is complete when:
master, reviewed, and merged before this issue is marked done.