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

'G'rab grabs furniture if vehicle is not present, for a friendlier oh-shit-monsters-block-the-door UI experience. #3563

Merged
merged 10 commits into from Oct 12, 2013

Conversation

Projects
None yet
3 participants
@atomicdryad
Copy link
Contributor

commented Oct 10, 2013

After 'G'rab grabs a qualified furniture, it can be moved until pushed out of the way or let go of. Similar to cart grabbing, moving towards the furniture pushes it and the player forward a tile, and away pulls it and the player backwards a tile. Unlike cart grabbing, this is:

  • Much more noisy and expensive, timewise
  • Unless pushing or pulling, directional keys move the -furniture- while the player stays still, just like in the construction menu.
  • Grab releases if the furniture is moved a tile away from the player (ie, furniture is North East and player pushes North);

atomicdryad added some commits Oct 9, 2013

add object_type enum to provide a consistent method of stating what a…
…n in-game object's class is.

add obj_type_name and obj_type_id for saving object_type as string
map::can_move_furniture(x,y,player*) returns true if player can move …
…furniture

map::combined_movecost; add optional modifier argument to +/- result (ex simulate cost-without-furniture)
game::grab, game::plmove: support grabbing and moving furniture. Move…
… keys will push,

pull, or shift furniture position (as in construction menu)
@atomicdryad

This comment has been minimized.

Copy link
Owner Author

commented on savegame_json.cpp in e9096a8 Oct 10, 2013

Hrm, well this was part of a local branch that got merged before I could push. Out of context, but null check = good.

return;
} else if ( ! m.can_move_furniture( fpos.x, fpos.y, &u ) ) {
add_msg(_("The %s is too heavy for you to budge!"), furntype.name.c_str() );
u.moves -= 100; // time spent straining and going 'hnngh!'

This comment has been minimized.

Copy link
@kevingranade

kevingranade Oct 10, 2013

Member

I think "hnngh!" should go in the log message ^_^

This comment has been minimized.

Copy link
@atomicdryad

atomicdryad Oct 10, 2013

Author Contributor

if (one_in(1000)) donttempme()

This comment has been minimized.

Copy link
@KA101

KA101 Oct 11, 2013

Contributor

<gets that d1000 a'rollin'>

"Hnnngh! The %s is too heavy!"

@kevingranade

This comment has been minimized.

Copy link
Member

commented Oct 10, 2013

Awesome! One nit, the thing holding me up when I did vehicle grabs was the fact that furniture accumulates (and potentially destroys? there's an issue that indicates it can) items that you move it over, since items aren't actually tied to the furniture itself, so contents just move with the furniture unconditionally.
The only sensible thing I could come up with other than making furniture actually contain the items (not a TERRIBLE idea, but will require a lot of changes I think) or tag items as "contained in furniture" (also not the worst thing ever, but messy) is to have it displace any items on the square it's moving into, preferring forward, then to the sides, and as a final resort to the rear, since that's guaranteed to be available since the furniture was just there.
Also feel free to nuke the "move furniture" construction task, it's a terrible hack and I'm ashamed of it :P

@atomicdryad

This comment has been minimized.

Copy link
Contributor Author

commented Oct 10, 2013

This (#3188) was partially (or totally) my fault; construction move used add_items, not add_items_or_charges as a player initiated action. Fixed. With extra fixage. As before, moving furniture hoovers up items, unlike before, only if it's a container (items will block moving beds, or spill from them), and no silent destruction on failure.)

Can change hoovering to have items always block for all furniture if that's better. Shove aside instead of block requires more sleep

atomicdryad added some commits Oct 10, 2013

@kevingranade

This comment has been minimized.

Copy link
Member

commented Oct 11, 2013

FYI I'm not sitting on this waiting for additional improvements, I've just been extraordinarily short on time recently.

@kevingranade kevingranade merged commit 8d12212 into CleverRaven:master Oct 12, 2013

1 check passed

default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.