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

Items with "POST_UP" use_action can be put up on walls #77903

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

ShnitzelX2
Copy link
Contributor

@ShnitzelX2 ShnitzelX2 commented Nov 16, 2024

Summary

Features "items with POST_UP use_action can be put up on walls "

Purpose of change

I disagree; decoration is something this game needs

Describe the solution

Take an item with the "POST_UP" use_action, stand next to terrain/furniture with the "WALL" flag (functionally only terrain, as far as I'm aware), and put it up on the wall for some nice decoration. The item occupies the terrain's space and can still be taken down with 'g'rab, but not with the advanced inventory manager.

For testing purposes, american_flag was provided with "POST_UP" for this PR. Providing a variant in e.g. gfx\UltimateCataclysm\layering.json for the "WALL" flag like so:

{
  "context": [ "WALL" ],
  "item_variants": [
    {
      "item": "american_flag",
      "sprite": [ { "id": "american_flag_hoisted", "weight": 1 } ],
      "layer": 90,
      "offset_x": 0,
      "offset_y": 0
    }
  ]
},

will let the flag have a different sprite when it's on terrain with the "WALL" flag.

Notes on implementation:

  • There is no error checking for wall orientation. The appearance of a posted item not making sense on a certain wall orientation is contextual to the tileset's POV, not the game. If you don't want a flag on a vertical wall, don't put it there. It goes without saying that this PR doesn't affect ASCII.
  • There is no error checking for which side of the wall you're on when you take down or put up an item because we don't handle "sides" of a single tile (to my knowledge). Because of this, items with the "POST_UP" flag should be mainly cosmetic and not actually something you'd benefit from phasing through a wall.
  • There's an arbitrary limit of 10 items per "WALL" tile.
  • Putting "POST_UP" items up is free, but if we absolutely want a required stapler or something, make a new PR.
  • There isn't a corresponding PR for UltimateCataclysm, but I'll get to it soon.

Describe alternatives you've considered

Testing

  • Passed tests locally (not really applicable here)
  • Put flag up and took it down
  • Put multiple flags up and took them down
  • Made sure flag could only be put on "WALL" terrain
  • Made sure that fields and items still draw

Additional context

Putting up american_flag -- note the sprite difference
flag1
flag2

-can be put on "WALL" ter/furn
-update docs on how to add an iuse function
-tile layering supports ter/furn flag
-deduplicate ter/furn layer drawing
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Items: Armor / Clothing Armor and clothing <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 16, 2024
@Hyperseeker
Copy link
Contributor

Does this change the nature of the item? As in, change anything about the item itself when it's attached to the wall?

I have a few ideas on how to use it in a non-decorative way, so I want to confirm first.

@ShnitzelX2
Copy link
Contributor Author

Does this change the nature of the item? As in, change anything about the item itself when it's attached to the wall?

Nope! All of the difference is handled in the tile drawing code.

@ShnitzelX2 ShnitzelX2 changed the title Items with "POSTABLE" use_action can be put up on walls Items with "POST_UP" use_action can be put up on walls Nov 17, 2024
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 17, 2024
@Night-Pryanik Night-Pryanik merged commit 305d515 into CleverRaven:master Nov 21, 2024
23 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing Items: Armor / Clothing Armor and clothing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hang your flag upon the wall
3 participants