Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • openmw openmw
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 831
    • Issues 831
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenMWOpenMW
  • openmwopenmw
  • Merge requests
  • !1116

Overhaul magic effects

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Evil Eye requested to merge Assumeru/openmw:effective_magic into master Aug 09, 2021
  • Overview 42
  • Commits 9
  • Pipelines 37
  • Changes 68

Fixes #1751 (closed), #4297 (closed), #4414 (closed), #5198 (closed), #5207 (closed), #5454 (closed), #5596 (closed), #5621 (closed), #5801 (closed), #5863 (closed), #6087 (closed).

This MR changes magic effects to be tracked in the ActiveSpells class. Previously effects were split between ActiveEffects (temporary effects), Spells (abilities, diseases), and InventoryStore (CE enchantments).

Magic effects are now applied using a function that is called every frame, and a function that is called when the effect is removed. Effects with the AppliedOnce flag do nothing except in the first frame. Effects without the flag have their magnitudes recalculated every frame.

Corprus was also overhauled (for the third time now?) because it didn't work for effects other than Fortify/Drain Attribute. As mentioned on the research page of the wiki, Corprus should reapply every AppliedOnce effect. I confirmed Morrowind.exe behaves this way by modifying the disease to apply Blind and Summon Ancestor Ghost (the latter summons an additional ghost every 24 hours and only despawns one when cured.)

Summons now store their actor ID in the effect that spawned them (reusing mArg which was previously used only for attributes and skills). This allowed me to simplify the summons map by removing redundant data.

Some progress was made towards #4508 by storing the inventory slot of the enchanted item, but it's not possible to implement the feature satisfactory without assigning a (persistent) unique identifier to magic items. Potentially ties in with #6148. Fixing these issues is left to future MRs as this one was getting plenty big already.

Most of the interesting code is in the new spelleffects.cpp file.

Edited Sep 21, 2021 by Evil Eye
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: effective_magic