whitevo
Feeling good, thats what I do.
When it comes to figuring out what to change in sourcecode I'm worse than complete noob.
Can anyone translate what does this function do?
What must be changed so diagonal movements won't take more time to travel trough?
I don't like the way diagonal moving works, I want it to go with no penalty or with very small downside.
Can anyone translate what does this function do?
What must be changed so diagonal movements won't take more time to travel trough?
I don't like the way diagonal moving works, I want it to go with no penalty or with very small downside.
Code:
int64_t Creature::getStepDuration() const
{
if (isRemoved()) {
return 0;
}
uint32_t calculatedStepSpeed;
uint32_t groundSpeed;
int32_t stepSpeed = getStepSpeed();
if (stepSpeed > -Creature::speedB) {
calculatedStepSpeed = floor((Creature::speedA * log((stepSpeed / 2) + Creature::speedB) + Creature::speedC) + 0.5);
if (calculatedStepSpeed <= 0) {
calculatedStepSpeed = 1;
}
} else {
calculatedStepSpeed = 1;
}
Item* ground = _tile->getGround();
if (ground) {
groundSpeed = Item::items[ground->getID()].speed;
if (groundSpeed == 0) {
groundSpeed = 150;
}
} else {
groundSpeed = 150;
}
double duration = std::floor(1000 * groundSpeed / calculatedStepSpeed);
int64_t stepDuration = std::ceil(duration / 50) * 50;
const Monster* monster = getMonster();
if (monster && monster->isTargetNearby() && !monster->isFleeing() && !monster->getMaster()) {
stepDuration *= 2;
}
return stepDuration;
}