Add >= 15 value in dist from object enum

This commit is contained in:
Michał Czekański 2020-05-24 18:37:46 +02:00
parent 873bfd0d8e
commit 48560fb3a1
3 changed files with 12 additions and 6 deletions

View File

@ -33,8 +33,10 @@ class DTSurvivalInteractable:
distanceFromPlayer = DistFromObject.LT_3
elif 3 <= distance < 8:
distanceFromPlayer = DistFromObject.GE_3_LT_8
elif distance >= 8:
distanceFromPlayer = DistFromObject.GE_8
elif 8 <= distance < 15:
distanceFromPlayer = DistFromObject.GE_8_LT_15
elif distance >= 15:
distanceFromPlayer = DistFromObject.GE_15
else:
return None

View File

@ -9,4 +9,5 @@ class DistFromObject(Enum):
LT_3 = 0
GE_3_LT_8 = 1
GE_8 = 2
GE_8_LT_15 = 2
GE_15 = 3

View File

@ -29,13 +29,16 @@ class SurvivalAttributesDefinitions:
PlayerStatsValue.THREE_QUARTERS_TO_FULL])
foodDistanceAttrDef = AttributeDefinition(3, "Distance from food",
[DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8])
[DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8_LT_15,
DistFromObject.GE_15])
waterDistanceAttrDef = AttributeDefinition(4, "Distance from water",
[DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8])
[DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8_LT_15,
DistFromObject.GE_15])
restDistanceAttrDef = AttributeDefinition(5, "Distance from rest place",
[DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8])
[DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8_LT_15,
DistFromObject.GE_15])
allAttributesDefinitions = [hungerAttrDef, thirstAttrDef, staminaAttrDef,
foodDistanceAttrDef, waterDistanceAttrDef, restDistanceAttrDef]