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

Further effects json support (morale, focus) #35882

Closed
I-am-Erk opened this issue Dec 5, 2019 · 13 comments
Closed

Further effects json support (morale, focus) #35882

I-am-Erk opened this issue Dec 5, 2019 · 13 comments
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Good First Issue This is a good first issue for a new contributor [JSON] Changes (can be) made in JSON Mechanics: Effects / Skills / Stats Effects / Skills / Stats (P3 - Medium) Medium (normal) priority

Comments

@I-am-Erk
Copy link
Member

I-am-Erk commented Dec 5, 2019

Is your feature request related to a problem? Please describe.
I was creating an effect that impacts morale over time, and realized it is not possible to define effects that impact morale or focus in JSON. Or, if it is, it is not documented.

Describe the solution you'd like
A json effect flag for "morale_mod" similar to every other effect flag. I don't think morale effects need to be impacted by all the other effect stuff like _min / _max / _tick.

Stretch goal: While in there it might be reasonable to have effects that directly impact Focus as well, since this is a stat that should be impacted by a lot of drugs and things. That would probably need to be a full set of effect flags, focus_amount and focus_min and such.

Describe alternatives you've considered
Hacking together effects in hard code, but no.

Additional context
I need this to make it depressing to eat gross protein bars all the time and I can't :(

I believe this is a fairly simple C++ addition and might be easy for someone trying to learn to JSONify C++ code... I think. Take that with a grain of salt since I cannot in fact code in C++

@I-am-Erk I-am-Erk added Good First Issue This is a good first issue for a new contributor [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Effects / Skills / Stats Effects / Skills / Stats labels Dec 5, 2019
@I-am-Erk I-am-Erk changed the title Further effects json support Further effects json support (morale, focus) Dec 5, 2019
@Davi-DeGanne
Copy link
Contributor

Davi-DeGanne commented Dec 5, 2019

I need this to make it depressing to eat gross protein bars all the time and I can't :(

Errr... way ahead of you? I think? #35813

Nevermind, realized you want it to get worse over time.

@I-am-Erk
Copy link
Member Author

I-am-Erk commented Dec 5, 2019

Yeah, similar need for better granularity but in this case more of a "omg I need to stop living off these terrible protein bars" thing.

@stale
Copy link

stale bot commented Jan 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Jan 4, 2020
@I-am-Erk
Copy link
Member Author

I-am-Erk commented Jan 5, 2020

We're still going to need this for jsonizing drugs and things

@stale stale bot removed the stale Closed for lack of activity, but still valid. label Jan 5, 2020
@I-am-Erk I-am-Erk added (P3 - Medium) Medium (normal) priority stale Closed for lack of activity, but still valid. labels Jan 5, 2020
@stale stale bot removed the stale Closed for lack of activity, but still valid. label Jan 5, 2020
@scrotty
Copy link
Contributor

scrotty commented Jan 10, 2020

I am going to take a stab at this. I am relatively new to the game and very new to its code, but I'm motivated.

@I-am-Erk
Copy link
Member Author

Cool, tag me on the pr

@scrotty
Copy link
Contributor

scrotty commented Jan 12, 2020

@I-am-Erk: I've been looking through the code today and see that the general pattern is to move move control into the json files. But there is still a lot of game behavior in the code.

Given that, I'd want to make sure I implement the functionality you want. Above you state you want "A json effect flag for "morale_mod" similar to every other effect flag". Can you please give me an example of one of these other effect flags you want morale to model? Or put another way, what would you expect the json to look like one the feature is in place.

For example, here is a portion of the json for aspirin:

   "use_action": {
      "type": "consume_drug",
      "activation_message": "You take some aspirin.",
      "effects": [ { "id": "pkill1", "duration": 720 } ]
    }

Which references this effect
  {
    "type": "effect_type",
    "id": "pkill1",
    "max_duration": "4 m",
    "base_mods": { "pkill_tick": [ 42 ], "pkill_min": [ 1 ], "pkill_max_val": [ 15 ] }
  },

Would you want something like?:

   "use_action": {
      "type": "consume",
      "activation_message": "Ugh. The protein bar sits in your stomach like a brick.",
      "effects": [ 
           { "id": "moraledebuff10", "duration": 720 },
       ]
    }

To reference a new effect:
  {
    "type": "effect_type",
    "id": "moraledebuff10",
    "max_duration": "4 m",
    "base_mods": { "moraledebuff10_tick": [ 42 ], "moraledebuff10_min": [ 1 ], "moraledebuff10_max_val": [ 10 ] }
  },

@Maleclypse
Copy link
Member

Do @Ramza13 's effect_on_condition PR's solve this or at least begin work on it?

@actual-nh
Copy link
Contributor

In #48683, Ramza13 stated (admittedly a bit back) that one for morale was waiting on a use case.

@Ramza13
Copy link
Contributor

Ramza13 commented Jul 11, 2021

Yup I have that already written. I'll make a PR.

@I-am-Erk
Copy link
Member Author

Awesome. Pester me when it's done and I'll see about adjusting some drugs.

@Ramza13
Copy link
Contributor

Ramza13 commented Jul 31, 2021

@I-am-Erk There should now be the tools you need to do this in json. Let me know if you need anything else.

@Maleclypse
Copy link
Member

@I-am-Erk Do we need to close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Good First Issue This is a good first issue for a new contributor [JSON] Changes (can be) made in JSON Mechanics: Effects / Skills / Stats Effects / Skills / Stats (P3 - Medium) Medium (normal) priority
Projects
None yet
Development

No branches or pull requests

6 participants