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

Smelling Sweet #34865

Merged
merged 38 commits into from
Dec 2, 2019
Merged

Smelling Sweet #34865

merged 38 commits into from
Dec 2, 2019

Conversation

Fris0uman
Copy link
Contributor

@Fris0uman Fris0uman commented Oct 19, 2019

Summary

SUMMARY: Features "Scents can have a type"

Purpose of change

Instead of every player smelling the same, now mutation can give a specific type of smell and monsters can track a specific smell.

  • scent_type can be defined in json and list the species able to smell them

  • Chloromorph mutation now gives the sc_flower scent that can be perceived by mammals, insects, mollusk and birds.

  • The scent effect of Weak Scent, Strong Scent and Smelly are now defined in json with scent_intensityentry

  • The scent effect of Flowers is now defined in json using scent_mask

  • In My Sweet Cataclysm the Made Of Sugar mutation gives the sc_sugar scent instead of suppressing scent. It can be tracked by mammals, insects and fungi.

Describe the solution

  • Add typescent to the scent_map that describe the type of the smell
    A player can still only produce one scent
  • Add debug option to display that map
  • Use generic factory to add the scent_type class
  • Add new entries to mutations for the jsonisation
  • Add tracked_scent to monster to definde tracked scent per monster on top of the species definition in scent_type.json

Describe alternatives you've considered

Testing

Star a new My Sweet Cataclysm world
Turn on debug scent map
See sc_sugar scent
Make sure that zombie are still not following the scent
Debug Chloromorph scent
Still smell of sc_sugar: mutation that affect scent should be made exclusive
Debug remove Sugar mutation
Smell of sc_flower
Debug invisibility
Zombies are not tracking the scent
Save,Quit,Re-load
The scent map is still the same.

Additional context

image

@ZhilkinSerg ZhilkinSerg added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` labels Oct 19, 2019
@dunstad
Copy link
Contributor

dunstad commented Oct 21, 2019

I was just about to comment on the scent issues with the ignored_by flag, this should help! Good stuff.

@Fris0uman Fris0uman marked this pull request as ready for review November 2, 2019 16:13
src/character.h Outdated Show resolved Hide resolved
Co-Authored-By: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
src/init.cpp Outdated Show resolved Hide resolved
Co-Authored-By: Anton Burmistrov <Night_Pryanik@mail.ru>
src/mutation.h Outdated Show resolved Hide resolved
src/monmove.cpp Outdated Show resolved Hide resolved
src/monmove.cpp Outdated Show resolved Hide resolved
src/monmove.cpp Outdated Show resolved Hide resolved
src/mutation.h Outdated Show resolved Hide resolved
@Fris0uman Fris0uman changed the title Smelling Sweet [WIP] Smelling Sweet Nov 14, 2019
@kevingranade
Copy link
Member

I said something about this, probably on Discord, but I think I was unclear.
You're tracking scent type in a parallel array of values, but AFAICT all you NEED to do is stash "what does the player smell like" in a single value, and update it when the player code writes it's current scent to the map.
Changes in scent type happen so rarely that there's no reason to track the scent type for each square of scent map.
All your interfaces to scent_map will remain unchanged, but just replace the typescent array with a single typescent value and update the various pieces of code in scent_map to do the right thing.

@Fris0uman Fris0uman changed the title [WIP] Smelling Sweet Smelling Sweet Nov 15, 2019
@@ -308,6 +308,8 @@ std::string action_ident( action_id act )
return "debug";
case ACTION_DISPLAY_SCENT:
return "debug_scent";
case ACTION_DISPLAY_SCENT_TYPE:
Copy link
Contributor

Choose a reason for hiding this comment

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

You should probably add an empty keybinding to data/raw/keybinding.json:

  {
    "type": "keybinding",
    "name": "View Scent Type",
    "category": "DEFAULTMODE",
    "id": "debug_scent_type"
  },

@ZhilkinSerg
Copy link
Contributor

Can you resolved conflicts please?

@ZhilkinSerg ZhilkinSerg merged commit c238070 into CleverRaven:master Dec 2, 2019
@Fris0uman Fris0uman deleted the sweet_smell branch December 2, 2019 11:43
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` <Enhancement / Feature> New features, or enhancements on existing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants