-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
JSON-ify hallucinations #69919
JSON-ify hallucinations #69919
Conversation
my apologies as i misguided you, the effect for kaluptic psychosis are stored in |
Thank you, and there's no need to apologize. Mistakes happen. |
I would like to implement weapon dropping, but the effect for it doesn't currently work. See #69902. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
I'm going to have to keep trying to test this because for some reason it's failed to compile two times in a row on my computer. edit: hahaha figured out why it wasn't compiling. it pulled in changes from another PR I was working on. |
In that case, do you think this is good to go? |
Yeah bleed isn't referenced by anything else in suffer than the things you pulled over weirdly. I'm testing kaluptic right now wish me luck :) |
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
Ok I managed to experience all of the effects except the weapon talking from bleeding so this is close to ready. :) Thank you for doing this! |
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
Quite welcome. I think that weapon bleed talking might have something to do with the global book being defined, it was working when I tested it for development stuff. I'll figure out something for it. |
Do you know of any way to get a name of something, and save it as a string of some form of variable for dialogue with JSON? If not, could the old get.name C++ be hooked up to JSON stuff to make that happen? If it's not possible right now, I'll just use vaguer terms in place of #%$! for now. |
There is no such thing in EoC. Potential solution might be if run_inv_eocs would be able to store found item in variable, but it can't do this at this moment |
Would #69857 make that possible? |
no, this one just allow to pass custom variable for run_eocs/queue_eocs, it doesn't modify run_inv_eocs |
I guess I could put in a feature request for that. |
Alright, that should fix all of the bugs. |
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
data/json/effects_on_condition/npc_eocs/hallucination_eocs.json
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* WIP part 1 * WIP part 2 * WIP part 3 * Delete old C++ * Oops * Bugfix 1 * Bugfix 2 * Bugfix 3 * Update src/player_hardcoded_effects.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Bugfix 4 * Un-inline the EOCs, separate * Fix bleed EOCs and symbol messup * Update hallucination_eocs.json * Update hallucination_eocs.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
if( u.has_trait( trait_SCHIZOPHRENIC ) && !u.has_effect( effect_took_thorazine ) && | ||
one_in( 43200 ) && u.is_avatar() ) { | ||
if( one_in( 2 ) ) { | ||
u.sound_hallu(); | ||
} else { | ||
int max_count = rng( 1, 3 ); | ||
int count = 0; | ||
for( const tripoint &mp : here.points_in_radius( u.pos(), 1 ) ) { | ||
if( mp == u.pos() ) { | ||
continue; | ||
} | ||
if( here.has_flag( ter_furn_flag::TFLAG_FLAT, mp ) && | ||
here.pl_sees( mp, 2 ) ) { | ||
g->spawn_hallucination( mp ); | ||
if( ++count > max_count ) { | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
it.set_duration( 0_turns ); | ||
woke_up = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this part ported to json, because i can't find anything that can spawn hallucinations in the hallucination_eocs.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't port this to JSON, I just used the hallucinating effect to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't hallucination effect is what was jsonified here?
i just tested, applied hallu, and got no hallucinations (aka hallucination of monsters that tries to attack you) at all, and i assume this piece of code respond for it
(i want to expand it a bit, hence the quesion)
Summary
Infrastructure "JSON-ify hallucinations"
Purpose of change
Hallucinations are interesting, and something that could be developed some more. The big issues with that are the barrier to entry on their codebase, as few people here know enough C++ to do something like that. This will also implement #68846.
Describe the solution
Currently, there's a lot of work to do on this:The basic work is done with this, though I would like to expand it some more.
Describe alternatives you've considered
Not doing this.
Testing
Everything works quite well, no observable issues.
Additional context
I've been trying to locate the C++ that controls hallucinations for Kaluptic Psychosis and related effects, but I can't find it yet.Thanks to @GuardianDll for pointing me to the right file.There's more I'd like to do with this, but this PR is already quite large in and of itself. So, that will have to wait.
Also, should hallucinations stemming from portal-related issues get worse during portal storms?