Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(content): Add sleepdebt effect #3673

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

RoyalFox2140
Copy link
Collaborator

@RoyalFox2140 RoyalFox2140 commented Nov 15, 2023

Purpose of change

We had no way of using effects to add or remove sleep deprivation, now we do.

Describe the solution

It appears under effect.cpp adding a new "member" for SLEEPDEBT and the relevant json fields happen there, and under character_turn.cpp is the part that hooks into mod_sleep_deprivation to cause the relevant effect to change a players stats.

I don't know the underlying code, this was reworked from the thirst effect and modified to work for sleep.

Describe alternatives you've considered

scream

Testing

I loaded one of my old worlds from 0.4 stable and this change had no related bugs. I have successfully tested it using a spell effect from my mod. You can add the json field "sleepdebt_min": [ -100 ] to any effect you want on testing.

Additional context

Here's some screenshots.

image
image

We need to update all effects documentation. That is out of scope right now.

Checklist

If this is a C++ PR that modifies JSON loading or behavior:

  • Document the changes in the appropriate location in the doc/ folder.

add sleep debt fields for effects idk
what is life without passing our knowledge on?
@github-actions github-actions bot added the src changes related to source code. label Nov 15, 2023
@scarf005 scarf005 self-assigned this Nov 15, 2023
@scarf005 scarf005 added the docs PRs releated to docs page label Nov 15, 2023
@scarf005 scarf005 changed the title feat(content): Add sleepdebt effect + documentation feat(content): Add sleepdebt effect Nov 15, 2023
@github-actions github-actions bot removed the docs PRs releated to docs page label Nov 15, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

  {
    "type": "effect_type",
    "id": "contacts",
    "name": [ "Contact Lenses" ],
    "desc": [ "You are wearing contact lenses." ],
    "apply_message": "You can see more clearly.",
    "remove_message": "Your vision starts to blur.",
    "rating": "good",
    "base_mods": {
      "sleepdebt_min": [ -100 ]
    }
  },
  1. added sleepdebt_min to contact lenses.
  2. debug-added sleep_deprived 100.
  3. wore contact lenses.
  4. sleep_deprived is gone.

code is mostly Copy-Paste from working ones so i think it's good to go.
also fixed CI not labelling docs properly.

@scarf005 scarf005 added this pull request to the merge queue Nov 15, 2023
Merged via the queue into cataclysmbnteam:upload with commit 596a577 Nov 15, 2023
15 of 18 checks passed
@olanti-p olanti-p added the BREAKING-JSON-CHANGES Changes to JSON data format or features label Nov 15, 2023
@RoyalFox2140 RoyalFox2140 deleted the sleep-debt-spell branch December 10, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING-JSON-CHANGES Changes to JSON data format or features src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants