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

Replace chop logs construction with long action #22939

Merged
merged 2 commits into from Feb 16, 2018

Conversation

boydkr
Copy link
Contributor

@boydkr boydkr commented Feb 14, 2018

Builds on #22730, moving forestry actions to items instead of construction.

Fixes #22931

Time required to chop down a tree depends on tool quality and player's strength:

  • character with 10 str and an axe with tree-cutting 2 will take an hour
  • takes twice as long to chop logs as to cut down the tree (generates 2-3 logs)

const ter_id ter = g->m.ter( dirp );
if( ter == t_trunk ) {
/** @EFFECT_STR reduces time required to chop down a tree */
moves = MINUTES( 70 - p->str_cur ) * 2 / it->get_quality( AXE ) * 100;
Copy link
Contributor Author

@boydkr boydkr Feb 15, 2018

Choose a reason for hiding this comment

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

I think this equation (used here and in chop_tree) could use some balance love.

Strength has a tiny effect (1 minute per cut for each strength). Quality has a massive effect. It could also probably use some randomness to simulate different sized trees

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have something exact in mind?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe move strength to the denominator, something like:
MINUTES( 70 ) / ( ( it->get_quality( AXE ) * 10) + p->str_cur );

@boydkr boydkr changed the title [WIP] Replace chop logs construction with long action Replace chop logs construction with long action Feb 15, 2018
@Night-Pryanik
Copy link
Contributor

You can also add do_turn function to handle messages appearing during the process describing how much time the process will take.

@boydkr
Copy link
Contributor Author

boydkr commented Feb 15, 2018

It reuses the do_turn for tree chopping. It seemed appropriate

@smolbird
Copy link
Contributor

Competes with #22933

void activity_handlers::chop_logs_finish( player_activity *act, player *p ) {
const tripoint &pos = act->placement;

g->m.ter_set( pos, t_dirt );
Copy link
Member

Choose a reason for hiding this comment

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

Not necessary here, but just realized it'd be neat to have a stump item here, might even be useful, it could have the flag for resting a longarm on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants