fp: Add a basic data plan visualisation

This commit is contained in:
2023-10-06 21:48:05 +11:00
parent cfb4106948
commit b5c8c45769
7 changed files with 69 additions and 11 deletions
+7 -1
View File
@@ -737,12 +737,18 @@ static void FP_Game_EntityTransitionState(FP_Game *game, FP_GameEntity *entity,
{
switch (entity->type) {
case FP_EntityType_Terry: {
if (desired_state == FP_EntityTerryState_Attack) {
if (desired_state == FP_EntityTerryState_Attack ||
desired_state == FP_EntityTerryState_RangeAttack) {
if (!FP_Game_CanEntityAttack(entity, game->clock_ms)) {
// NOTE: Cooldown not met do not transition
return;
}
entity->last_attack_timestamp = game->clock_ms;
if (desired_state == FP_EntityTerryState_RangeAttack) {
if (entity->terry_mobile_data_plan < FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK)
return;
}
}
} break;