我正在 Django 中做一个基于文本的多人纸牌游戏,其中每张牌都允许每个玩家做出一些标准动作(抽更多牌,获得金币,获得积分等),也许还有一些其他能力(比如摧毁一张牌)从对手手中,给对手减分等等)。
我创建了一个 Card 类:
class Card(models.Model):
name = models.CharField(max_length=255, verbose_name="Name")
description = models.TextField(verbose_name="Description")
victory = models.BooleanField("Victory Card")
action = models.BooleanField("Action Card")
reaction = models.BooleanField("Reaction Card")
treasure = models.BooleanField("Treasure Card")
attack = models.BooleanField("Attack Card")
plus_action = models.IntegerField(max_length=2, verbose_name="Plus actions", null=True, blank=True)
plus_card = models.IntegerField(max_length=2, verbose_name="Plus cards", null=True, blank=True)
plus_buy = models.IntegerField(max_length=2, verbose_name="Plus buy", null=True, blank=True)
plus_gold = models.IntegerField(max_length=2, verbose_name="Plus gold", null=True, blank=True)
plus_victory = models.IntegerField(max_length=2, verbose_name="Plus victory", null=True, blank=True)
cost = models.IntegerField(max_length=2, verbose_name="Cost")
我的问题是我不知道如何表示其他能力。我已经考虑过属性,但我不确定这是要走的路还是如何去做。
你们有什么建议吗?提前致谢!
问候,
安德里