|
|
@ -2032,13 +2032,13 @@ void Units::subtractActionTimers(color_ostream &out, df::unit *unit, int32_t amo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Units::subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeCategory)
|
|
|
|
void Units::subtractCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeGroup)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CHECK_NULL_POINTER(unit);
|
|
|
|
CHECK_NULL_POINTER(unit);
|
|
|
|
for (auto action : unit->actions) {
|
|
|
|
for (auto action : unit->actions) {
|
|
|
|
auto list = ENUM_ATTR(unit_action_type, group, action->type);
|
|
|
|
auto list = ENUM_ATTR(unit_action_type, group, action->type);
|
|
|
|
for (size_t i = 0; i < list.size; i++) {
|
|
|
|
for (size_t i = 0; i < list.size; i++) {
|
|
|
|
if (list.items[i] == affectedActionTypeCategory) {
|
|
|
|
if (list.items[i] == affectedActionTypeGroup) {
|
|
|
|
mutateActionTimerCore(action, [=](double timerValue){return max(timerValue - amount, 1.0);});
|
|
|
|
mutateActionTimerCore(action, [=](double timerValue){return max(timerValue - amount, 1.0);});
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2065,7 +2065,7 @@ void Units::multiplyActionTimers(color_ostream &out, df::unit *unit, float amoun
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Units::multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionTypeCategory)
|
|
|
|
void Units::multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, float amount, df::unit_action_type_group affectedActionTypeGroup)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CHECK_NULL_POINTER(unit);
|
|
|
|
CHECK_NULL_POINTER(unit);
|
|
|
|
if (!validateMultiplyActionTimerAmount(out, amount))
|
|
|
|
if (!validateMultiplyActionTimerAmount(out, amount))
|
|
|
@ -2073,7 +2073,7 @@ void Units::multiplyCategoryActionTimers(color_ostream &out, df::unit *unit, flo
|
|
|
|
for (auto action : unit->actions) {
|
|
|
|
for (auto action : unit->actions) {
|
|
|
|
auto list = ENUM_ATTR(unit_action_type, group, action->type);
|
|
|
|
auto list = ENUM_ATTR(unit_action_type, group, action->type);
|
|
|
|
for (size_t i = 0; i < list.size; i++) {
|
|
|
|
for (size_t i = 0; i < list.size; i++) {
|
|
|
|
if (list.items[i] == affectedActionTypeCategory) {
|
|
|
|
if (list.items[i] == affectedActionTypeGroup) {
|
|
|
|
mutateActionTimerCore(action, [=](double timerValue){return max(timerValue * amount, 1.0);});
|
|
|
|
mutateActionTimerCore(action, [=](double timerValue){return max(timerValue * amount, 1.0);});
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2100,7 +2100,7 @@ void Units::setActionTimers(color_ostream &out, df::unit *unit, int32_t amount,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Units::setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeCategory)
|
|
|
|
void Units::setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t amount, df::unit_action_type_group affectedActionTypeGroup)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CHECK_NULL_POINTER(unit);
|
|
|
|
CHECK_NULL_POINTER(unit);
|
|
|
|
if (!validateSetActionTimerAmount(out, amount))
|
|
|
|
if (!validateSetActionTimerAmount(out, amount))
|
|
|
@ -2108,7 +2108,7 @@ void Units::setCategoryActionTimers(color_ostream &out, df::unit *unit, int32_t
|
|
|
|
for (auto action : unit->actions) {
|
|
|
|
for (auto action : unit->actions) {
|
|
|
|
auto list = ENUM_ATTR(unit_action_type, group, action->type);
|
|
|
|
auto list = ENUM_ATTR(unit_action_type, group, action->type);
|
|
|
|
for (size_t i = 0; i < list.size; i++) {
|
|
|
|
for (size_t i = 0; i < list.size; i++) {
|
|
|
|
if (list.items[i] == affectedActionTypeCategory) {
|
|
|
|
if (list.items[i] == affectedActionTypeGroup) {
|
|
|
|
mutateActionTimerCore(action, [=](double timerValue){return amount;});
|
|
|
|
mutateActionTimerCore(action, [=](double timerValue){return amount;});
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|