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

Aftershock: Remove swims flag from terrestrial creatures. #77257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

John-Candlebury
Copy link
Member

Summary

Mods "Aftershock: Remove swims flag from terrestrial creatures."

Purpose of change

Describe the solution

SWIMS flag does slow down monsters in land, which is a balance discussion for another day, but I't doesnt really make sense for this terrestian creatures to have it.

@Karol1223
Copy link
Contributor

Karol1223 commented Oct 22, 2024

SWIMS flag does slow down monsters in land

Seriously? If it actually does, please document this if you can. I was not aware of that.

@John-Candlebury
Copy link
Member Author

John-Candlebury commented Oct 22, 2024

SWIMS flag does slow down monsters in land

Seriously? If it actually does, please document this if you can. I was not aware of that.

Yeah if you check monster::calc_movecost swimming monsters pay the full movecost of their current map tile and the full cost of their destination tile when moving. Normal monsters just pay half of each.

I'm actually not sure if this is the intended behavior or not. It's certainly not documented.

@Karol1223
Copy link
Contributor

I'm actually not sure if this is the intended behavior or not. It's certainly not documented.

It seems not to be, frankly, given the documentation only says they're supposed to treat water as a 50 movecost terrain. Does it at least do as advertised?

@github-actions github-actions bot added Mods Issues related to mods or modding [JSON] Changes (can be) made in JSON Mods: Aftershock Anything to do with the Aftershock mod labels Oct 22, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Oct 22, 2024
@John-Candlebury
Copy link
Member Author

Yeah water to water is exactly 50 cost.

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Oct 22, 2024
@IdleSol
Copy link
Contributor

IdleSol commented Oct 22, 2024

Cataclysm-DDA/src/monmove.cpp

Lines 1522 to 1523 in 8f226e5

const int source_cost = here.move_cost( f );
const int dest_cost = here.move_cost( t );

Cataclysm-DDA/src/monmove.cpp

Lines 1528 to 1538 in 8f226e5

} else if( swims() ) {
if( here.has_flag( ter_furn_flag::TFLAG_SWIMMABLE, f ) ) {
movecost += 25;
} else {
movecost += 50 * here.move_cost( f );
}
if( here.has_flag( ter_furn_flag::TFLAG_SWIMMABLE, t ) ) {
movecost += 25;
} else {
movecost += 50 * here.move_cost( t );
}

If I understand this correctly. For tiles without SWIMMABLE flag, the total move_cost is equal to:

move_cost = 0 + 50 * here.move_cost( f ) + movecost + 50 * here.move_cost( t )

And if it didn't have a SWIMS flag, then:

Cataclysm-DDA/src/monmove.cpp

Lines 1564 to 1566 in 8f226e5

} else {
movecost = ( ( 50 * source_cost ) + ( 50 * dest_cost ) ) / 2.0;
}

P.S. Do we have furniture with the SWIMMABLE flag?

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 [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mods: Aftershock Anything to do with the Aftershock mod Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants