Adds script hook to change choice speed when determining turn order
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -22,12 +22,8 @@ public:
|
||||
if (aPriority != bPriority)
|
||||
return aPriority > bPriority;
|
||||
}
|
||||
auto aUser = a->GetUser();
|
||||
auto bUser = b->GetUser();
|
||||
auto aSpeed = aUser->GetBoostedStat(Library::Statistic::Speed);
|
||||
auto bSpeed = bUser->GetBoostedStat(Library::Statistic::Speed);
|
||||
if (aSpeed != bSpeed)
|
||||
return aSpeed > bSpeed;
|
||||
if (a->__GetSpeed() != b->__GetSpeed())
|
||||
return a->__GetSpeed() > b->__GetSpeed();
|
||||
|
||||
return a->__GetRandomValue() > b->__GetRandomValue();
|
||||
}
|
||||
@@ -43,6 +39,10 @@ void TurnOrdering::OrderChoices(std::vector<std::shared_ptr<BaseTurnChoice>>& ve
|
||||
HOOK(ChangePriority, attackChoice, attackChoice.get(), &priority);
|
||||
attackChoice->SetPriority(priority);
|
||||
}
|
||||
|
||||
auto speed = item->GetUser()->GetBoostedStat(Library::Statistic::Speed);
|
||||
HOOK(ChangeSpeed, item, item.get(), &speed);
|
||||
item->__SetSpeed(speed);
|
||||
}
|
||||
std::sort(vec.begin(), vec.end(), ChoiceCompare());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user