mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-05 06:13:55 +01:00
fix cap points for prestige
This commit is contained in:
parent
acd0ade1ad
commit
2fec5b32da
4 changed files with 10 additions and 4 deletions
|
@ -25,7 +25,7 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/.ruff_cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.11 (charasheet)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.12 (charasheet)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.11 (charasheet)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (charasheet)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (charasheet)" project-jdk-type="Python SDK" />
|
||||
</project>
|
|
@ -130,7 +130,7 @@ class Capability(DocumentedModel, TimeStampedModel, models.Model):
|
|||
|
||||
@property
|
||||
def capability_points_cost(self) -> int:
|
||||
if self.rank in [1, 2]:
|
||||
if self.path.category == Path.Category.PROFILE and self.rank in [1, 2]:
|
||||
return 1
|
||||
return 2
|
||||
|
||||
|
|
|
@ -413,7 +413,13 @@ class Character(models.Model):
|
|||
|
||||
@property
|
||||
def capability_points_used(self) -> int:
|
||||
return sum(cap.capability_points_cost for cap in self.capabilities.only("rank"))
|
||||
return sum(
|
||||
cap.capability_points_cost
|
||||
for cap in self.capabilities.select_related("path").only(
|
||||
"rank",
|
||||
"path__category",
|
||||
)
|
||||
)
|
||||
|
||||
@property
|
||||
def capability_points_remaining(self) -> int:
|
||||
|
|
Loading…
Reference in a new issue