2020-04-11 13:03:48 +01:00
|
|
|
from django.db import models
|
2020-04-11 14:01:52 +01:00
|
|
|
import multiselectfield
|
2020-04-11 14:55:45 +01:00
|
|
|
from random import randint
|
2020-04-11 18:07:22 +01:00
|
|
|
from math import ceil
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
#==============================================================================#
|
|
|
|
#-------------------------------- OPTION LISTS --------------------------------#
|
|
|
|
#==============================================================================#
|
2020-04-11 13:50:56 +01:00
|
|
|
ATTRIBUTES = [
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Physical", (
|
2020-04-11 19:58:07 +01:00
|
|
|
("STR", "Strength"),
|
2020-04-11 13:50:56 +01:00
|
|
|
("DEX", "Dexterity"),
|
|
|
|
("STA", "Stamina"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Social", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("CHA", "Charisma"),
|
|
|
|
("MAN", "Manipulation"),
|
|
|
|
("APP", "Appearance"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Mental", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("PER", "Perception"),
|
|
|
|
("INT", "Intelligence"),
|
|
|
|
("WIT", "Wits"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
ABILITIES = [
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"War", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("ARCHERY", "Archery"),
|
|
|
|
("ATHLETICS", "Athletics"),
|
|
|
|
("AWARENESS", "Awareness"),
|
|
|
|
("BRAWL", "Brawl"),
|
|
|
|
("DODGE", "Dodge"),
|
|
|
|
("INTEGRITY", "Integrity"),
|
|
|
|
("MELEE", "Melee"),
|
|
|
|
("RESISTANCE", "Resistance"),
|
|
|
|
("THROWN", "Thrown"),
|
|
|
|
("WAR", "War"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Life", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("CRAFT", "Craft"),
|
|
|
|
("LARCENY", "Larceny"),
|
|
|
|
("LINGUISTICS", "Linguistics"),
|
|
|
|
("PERFORMANCE", "Performance"),
|
|
|
|
("PRESENCE", "Presence"),
|
|
|
|
("RIDE", "Ride"),
|
|
|
|
("SAIL", "Sail"),
|
|
|
|
("SOCIALISE", "Socialise"),
|
|
|
|
("STEALTH", "Stealth"),
|
|
|
|
("SURVIVAL", "Survival"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Wisdom", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("BUREAUCRACY", "Bureaucracy"),
|
|
|
|
("INVESTIGATION", "Investigation"),
|
|
|
|
("LORE", "Lore"),
|
|
|
|
("MEDICINE", "Medicine"),
|
|
|
|
("OCCULT", "Occult"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
STATICS = [
|
|
|
|
("SOAK NATURAL", "Natural Soak"),
|
|
|
|
("SOAK ARMORED", "Armored Soak"),
|
|
|
|
("SOAK TOTAL", "Total Soak"),
|
|
|
|
("HARDNESS", "Hardness"),
|
|
|
|
("PARRY", "Parry"),
|
|
|
|
("EVASION", "Evasion"),
|
|
|
|
("RESOLVE", "Resolve"),
|
|
|
|
("GUILE", "Guile"),
|
|
|
|
("RUSH", "Rush"),
|
|
|
|
("DISENGAGE", "Disengage"),
|
|
|
|
("JOIN BATTLE", "Join Battle"),
|
|
|
|
]
|
|
|
|
|
|
|
|
CATEGORIES = [
|
|
|
|
("L", "Light"),
|
|
|
|
("M", "Medium"),
|
|
|
|
("H", "Heavy"),
|
|
|
|
]
|
|
|
|
|
2020-04-11 14:01:52 +01:00
|
|
|
TAGS_WEAPONS = [
|
2020-04-11 13:50:56 +01:00
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"General", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("ONE HANDED", "One Handed"),
|
|
|
|
("TWO HANDED", "Two Handed"),
|
|
|
|
("BASHING", "Bashing"),
|
|
|
|
("CONCEALABLE", "Concealable"),
|
|
|
|
("LETHAL", "Lethal"),
|
|
|
|
("MOUNTED", "Mounted"),
|
|
|
|
("PIERCING", "Piercing"),
|
|
|
|
("SPECIAL", "Special"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Melee", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("MELEE", "Melee"),
|
|
|
|
("BALANCED", "Balanced"),
|
|
|
|
("BRAWL", "Brawl"),
|
|
|
|
("CHOPPING", "Chopping"),
|
|
|
|
("DISARMING", "Disarming"),
|
|
|
|
("FLEXIBLE", "Flexible"),
|
|
|
|
("IMPROVISED", "Improvised"),
|
|
|
|
("GRAPPLING", "Grappling"),
|
|
|
|
("MARTIAL ARTS", "Martial Arts"),
|
|
|
|
("NATURAL", "Natural"),
|
|
|
|
("REACHING", "Reaching"),
|
|
|
|
("SHIELD", "Shield"),
|
|
|
|
("SMASHING", "Smashing"),
|
|
|
|
("WORN", "Worn"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Thrown", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("THROWN", "Occult"),
|
|
|
|
("CUTTING", "Cutting"),
|
|
|
|
("POISONABLE", "Poisonable"),
|
|
|
|
("SUBTLE", "Subtle"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2020-04-11 13:56:12 +01:00
|
|
|
"Archery", (
|
2020-04-11 13:50:56 +01:00
|
|
|
("ARCHERY", "Archery"),
|
|
|
|
("CROSSBOW", "Crossbow"),
|
|
|
|
("FLAME", "Flame"),
|
|
|
|
("POWERFUL", "Powerful"),
|
|
|
|
("SLOW", "Slow"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
TAGS_ARMOR = [
|
|
|
|
("BUOYANT", "Buoyant"),
|
|
|
|
("CONCEALABLE", "Concealable"),
|
|
|
|
("SILENT", "Silent"),
|
|
|
|
]
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
INTENSITIES = [
|
|
|
|
("MINOR", "Minor"),
|
|
|
|
("MAJOR", "Major"),
|
|
|
|
("DEFINING", "Defining"),
|
|
|
|
]
|
|
|
|
|
2020-04-11 14:55:45 +01:00
|
|
|
DIE_TYPES = [
|
|
|
|
("NONE", "None"),
|
|
|
|
("SUCCESS", "Success"),
|
|
|
|
("DOUBLE", "Double"),
|
2020-04-11 15:15:05 +01:00
|
|
|
("EXPLODING_DISAPPEARING", "Exploding / Disappearing"),
|
2020-04-11 14:55:45 +01:00
|
|
|
("SUBTRACTING", "Subtracting")
|
|
|
|
]
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
#==============================================================================#
|
|
|
|
#------------------------------- CUSTOM MODELS --------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class NameField(models.CharField):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = "Name"
|
|
|
|
kwargs['blank'] = False
|
|
|
|
kwargs['max_length'] = 100
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class DescriptionField(models.TextField):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = "Description"
|
|
|
|
kwargs['blank'] = True
|
|
|
|
kwargs['max_length'] = 1000
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class DotField(models.IntegerField):
|
|
|
|
def __init__(self, verbose_name, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['blank'] = False
|
|
|
|
kwargs['default'] = 0
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class SingleChoiceField(models.CharField):
|
|
|
|
def __init__(self, verbose_name, choices, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['choices'] = choices
|
|
|
|
kwargs['blank'] = True
|
|
|
|
kwargs['max_length'] = 100
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
2020-04-11 14:01:52 +01:00
|
|
|
class MultiChoiceField(multiselectfield.MultiSelectField):
|
|
|
|
def __init__(self, verbose_name, choices, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['choices'] = choices
|
|
|
|
kwargs['blank'] = True
|
|
|
|
kwargs['max_length'] = 100
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
class NamedIntegerField(models.IntegerField):
|
|
|
|
def __init__(self, verbose_name, desc=None, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['help_text'] = desc
|
|
|
|
kwargs['blank'] = False
|
|
|
|
kwargs['default'] = 0
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class NamedCharField(models.CharField):
|
|
|
|
def __init__(self, verbose_name, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['blank'] = False
|
|
|
|
kwargs['max_length'] = 100
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
2020-04-11 15:15:05 +01:00
|
|
|
class DieField(multiselectfield.MultiSelectField):
|
2020-04-11 14:55:45 +01:00
|
|
|
def __init__(self, verbose_name, number, default, *args, **kwargs):
|
|
|
|
self.number = number
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['default'] = default
|
|
|
|
kwargs['choices'] = DIE_TYPES
|
|
|
|
kwargs['blank'] = False
|
|
|
|
kwargs['max_length'] = 100
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
def deconstruct(self):
|
|
|
|
name, path, args, kwargs = super().deconstruct()
|
|
|
|
kwargs['number'] = self.number
|
|
|
|
return name, path, args, kwargs
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
class NamedBooleanField(models.BooleanField):
|
|
|
|
def __init__(self, verbose_name, default=False, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['default'] = default
|
|
|
|
kwargs['blank'] = False
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class NamedForeignKeyField(models.ForeignKey):
|
2020-04-11 15:29:21 +01:00
|
|
|
def __init__(self, verbose_name, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['on_delete'] = models.CASCADE
|
|
|
|
kwargs['blank'] = True
|
|
|
|
kwargs['null'] = True
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class NamedManyToManyField(models.ManyToManyField):
|
|
|
|
def __init__(self, verbose_name, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['blank'] = True
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
class NamedOneToOneField(models.OneToOneField):
|
|
|
|
def __init__(self, verbose_name, *args, **kwargs):
|
|
|
|
kwargs['verbose_name'] = verbose_name
|
|
|
|
kwargs['on_delete'] = models.CASCADE
|
|
|
|
kwargs['blank'] = True
|
|
|
|
kwargs['null'] = True
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
2020-04-11 14:55:45 +01:00
|
|
|
#==============================================================================#
|
|
|
|
#-------------------------------- DICE ROLLING --------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class rollConfiguration(models.Model):
|
2020-04-11 19:58:07 +01:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
name = NameField()
|
|
|
|
successesAuto = NamedIntegerField("Auto-Successes")
|
2020-04-11 15:15:05 +01:00
|
|
|
r01 = DieField("1s", 1, ["NONE"])
|
|
|
|
r02 = DieField("2s", 2, ["NONE"])
|
|
|
|
r03 = DieField("3s", 3, ["NONE"])
|
|
|
|
r04 = DieField("4s", 4, ["NONE"])
|
|
|
|
r05 = DieField("5s", 5, ["NONE"])
|
|
|
|
r06 = DieField("6s", 6, ["NONE"])
|
|
|
|
r07 = DieField("7s", 7, ["SUCCESS"])
|
|
|
|
r08 = DieField("8s", 8, ["SUCCESS"])
|
|
|
|
r09 = DieField("9s", 9, ["SUCCESS"])
|
|
|
|
r10 = DieField("10s", 10, ["SUCCESS", "DOUBLE"])
|
2020-04-11 14:55:45 +01:00
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
def roll(self, pool=1, successesStunt=0):
|
2020-04-11 14:55:45 +01:00
|
|
|
listDice = [
|
|
|
|
self.r01,
|
|
|
|
self.r02,
|
|
|
|
self.r03,
|
|
|
|
self.r04,
|
|
|
|
self.r05,
|
|
|
|
self.r06,
|
|
|
|
self.r07,
|
|
|
|
self.r08,
|
|
|
|
self.r09,
|
|
|
|
self.r10,
|
|
|
|
]
|
2020-04-11 15:18:32 +01:00
|
|
|
listSuccess, listDouble, listExplodingDisappearing, listSubtracting = [], [], [], []
|
2020-04-11 14:55:45 +01:00
|
|
|
for die in listDice:
|
2020-04-11 15:15:05 +01:00
|
|
|
if "SUCCESS" in die:
|
2020-04-11 14:55:45 +01:00
|
|
|
listSuccess.append(die.number)
|
2020-04-11 15:15:05 +01:00
|
|
|
if "DOUBLE" in die:
|
2020-04-11 14:55:45 +01:00
|
|
|
listDouble.append(die.number)
|
2020-04-11 15:15:05 +01:00
|
|
|
if "EXPLODING_DISAPPEARING" in die:
|
|
|
|
listExplodingDisappearing.append(die.number)
|
|
|
|
if "SUBTRACTING" in die:
|
2020-04-11 14:55:45 +01:00
|
|
|
listSubtracting.append(die.number)
|
2020-04-11 19:58:07 +01:00
|
|
|
successes = self.successesAuto + successesStunt
|
2020-04-11 14:55:45 +01:00
|
|
|
listExploded, listDisappeared = [], []
|
|
|
|
listRoll = [0 for die in range(pool)]
|
|
|
|
while 0 in listRoll:
|
|
|
|
for die in listRoll:
|
|
|
|
if die == 0:
|
|
|
|
die = randint(1, 10)
|
2020-04-11 15:15:05 +01:00
|
|
|
if die in listExplodingDisappearing:
|
|
|
|
if die in listSuccess:
|
|
|
|
listExploded.append(die)
|
|
|
|
else:
|
|
|
|
listDisappeared.append(die)
|
2020-04-11 14:55:45 +01:00
|
|
|
die = 0
|
|
|
|
for die in listRoll + listExploded:
|
|
|
|
if die in listSuccess:
|
|
|
|
successes += 1
|
2020-04-11 15:15:05 +01:00
|
|
|
if die in listDouble:
|
|
|
|
successes += 1
|
|
|
|
if die in listSubtracting:
|
2020-04-11 14:55:45 +01:00
|
|
|
successes -= 1
|
|
|
|
if successes < 0:
|
|
|
|
successes = 0
|
|
|
|
botch = (successes == 0) and (1 in listRoll)
|
|
|
|
return successes, botch, listRoll, listExploded, listDisappeared
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
#==============================================================================#
|
|
|
|
#--------------------------------- MODIFIERS ----------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class modifierBase(models.Model):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
value = NamedIntegerField("Modifier Value")
|
|
|
|
|
|
|
|
class modifierAttribute(modifierBase):
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return "{} [{}]".format(self.attribute, self.value)
|
|
|
|
|
2020-04-11 13:53:32 +01:00
|
|
|
attribute = SingleChoiceField("Attribute", ATTRIBUTES)
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
class modifierAbility(modifierBase):
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return "{} [{}]".format(self.ability, self.value)
|
|
|
|
|
2020-04-11 13:56:12 +01:00
|
|
|
ability = SingleChoiceField("Ability", ABILITIES)
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
class modifierStatic(modifierBase):
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return "{} [{}]".format(self.static, self.value)
|
|
|
|
|
2020-04-11 13:53:32 +01:00
|
|
|
static = SingleChoiceField("Static", STATICS)
|
2020-04-11 13:03:48 +01:00
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
#==============================================================================#
|
|
|
|
#--------------------------------- CHARACTERS ---------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class characterBase(models.Model):
|
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#======== MODIFIER METHODS ========#
|
|
|
|
def modifierCharm(self, keyword):
|
|
|
|
charms = None
|
|
|
|
modifier = 0
|
|
|
|
try:
|
|
|
|
charms = self.charmLunar_set.filter(active=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
charms = self.charmSolar_set.filter(active=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if charms:
|
|
|
|
for charm in charms:
|
|
|
|
modifier += charm.modifier(keyword)
|
|
|
|
return modifier
|
|
|
|
def modifierMerit(self, keyword):
|
|
|
|
merits = None
|
|
|
|
modifier = 0
|
|
|
|
try:
|
|
|
|
merits = self.merit_set.filter(active=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if merits:
|
|
|
|
for merit in merits:
|
|
|
|
modifier += merit.modifier(keyword)
|
|
|
|
return modifier
|
|
|
|
def modifierSpeciality(self, keyword):
|
|
|
|
specialities = None
|
|
|
|
modifier = 0
|
|
|
|
try:
|
|
|
|
specialities = self.speciality_set.filter(active=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if specialities:
|
|
|
|
for speciality in specialities:
|
|
|
|
modifier += speciality.modifier(keyword)
|
|
|
|
return modifier
|
|
|
|
def modifierTotal(self, keyword):
|
|
|
|
return self.modifierCharm(keyword) + self.modifierMerit(keyword) + self.modifierSpeciality(keyword)
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
#============ GENERAL =============#
|
|
|
|
name = NameField()
|
|
|
|
|
|
|
|
#=========== ATTRIBUTES ===========#
|
2020-04-11 19:58:07 +01:00
|
|
|
strength = DotField("Strength")
|
|
|
|
def attributeStrength(self):
|
|
|
|
return self.strength + self.modifierTotal("STRENGTH")
|
|
|
|
dexterity = DotField("Dexterity")
|
|
|
|
def attributeDexterity(self):
|
|
|
|
return self.dexterity + self.modifierTotal("DEXTERITY")
|
|
|
|
stamina = DotField("Stamina")
|
|
|
|
def attributeStamina(self):
|
|
|
|
return self.stamina + self.modifierTotal("STAMINA")
|
|
|
|
charisma = DotField("Charisma")
|
|
|
|
def attributeCharisma(self):
|
|
|
|
return self.charisma + self.modifierTotal("CHARISMA")
|
|
|
|
manipulation = DotField("Manipulation")
|
|
|
|
def attributeManipulation(self):
|
|
|
|
return self.manipulation + self.modifierTotal("MANIPULATION")
|
|
|
|
appearance = DotField("Apperance")
|
|
|
|
def attributeAppearance(self):
|
|
|
|
return self.appearance + self.modifierTotal("APPEARANCE")
|
|
|
|
perception = DotField("Perception")
|
|
|
|
def attributePerception(self):
|
|
|
|
return self.perception + self.modifierTotal("PERCEPTION")
|
|
|
|
intelligence = DotField("Intelligence")
|
|
|
|
def attributeIntelligence(self):
|
|
|
|
return self.intelligence + self.modifierTotal("INTELLIGENCE")
|
|
|
|
wits = DotField("Wits")
|
|
|
|
def attributeWits(self):
|
|
|
|
return self.wits + self.modifierTotal("WITS")
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
#=========== ABILITIES ============#
|
2020-04-11 19:58:07 +01:00
|
|
|
archery = DotField("Archery")
|
|
|
|
def abilityArchery(self):
|
|
|
|
return self.archery + self.modifierTotal("ARCHERY")
|
|
|
|
athletics = DotField("Athletics")
|
|
|
|
def abilityAthletics(self):
|
|
|
|
return self.athletics + self.modifierTotal("ATHLETICS")
|
|
|
|
awareness = DotField("Awareness")
|
|
|
|
def abilityAwareness(self):
|
|
|
|
return self.awareness + self.modifierTotal("AWARENESS")
|
|
|
|
brawl = DotField("Brawl")
|
|
|
|
def abilityBrawl(self):
|
|
|
|
return self.brawl + self.modifierTotal("BRAWL")
|
|
|
|
bureaucracy = DotField("Bureaucracy")
|
|
|
|
def abilityBureaucracy(self):
|
|
|
|
return self.bureaucracy + self.modifierTotal("BUREAUCRACY")
|
|
|
|
craft = DotField("Craft")
|
|
|
|
def abilityCraft(self):
|
|
|
|
return self.craft + self.modifierTotal("CRAFT")
|
|
|
|
dodge = DotField("Dodge")
|
|
|
|
def abilityDodge(self):
|
|
|
|
return self.dodge + self.modifierTotal("DODGE")
|
|
|
|
integrity = DotField("Integrity")
|
|
|
|
def abilityIntegrity(self):
|
|
|
|
return self.integrity + self.modifierTotal("INTEGRITY")
|
2020-04-11 18:07:22 +01:00
|
|
|
investigation = DotField("Investigation")
|
2020-04-11 19:58:07 +01:00
|
|
|
def abilityInvestigation(self):
|
|
|
|
return self.investigation + self.modifierTotal("INVESTIGATION")
|
|
|
|
larceny = DotField("Larceny")
|
|
|
|
def abilityLarceny(self):
|
|
|
|
return self.larceny + self.modifierTotal("LARCENY")
|
|
|
|
linguistics = DotField("Linguistics")
|
|
|
|
def abilityLinguistics(self):
|
|
|
|
return self.linguistics + self.modifierTotal("LINGUISTICS")
|
|
|
|
lore = DotField("Lore")
|
|
|
|
def abilityLore(self):
|
|
|
|
return self.lore + self.modifierTotal("LORE")
|
|
|
|
martialArts = DotField("MartialArts")
|
|
|
|
def abilityMartialArts(self):
|
|
|
|
return self.martialArts + self.modifierTotal("MARTIAL ARTS")
|
|
|
|
medicine = DotField("Medicine")
|
|
|
|
def abilityMedicine(self):
|
|
|
|
return self.medicine + self.modifierTotal("MEDICINE")
|
|
|
|
melee = DotField("Melee")
|
|
|
|
def abilityMelee(self):
|
|
|
|
return self.melee + self.modifierTotal("MELEE")
|
|
|
|
occult = DotField("Occult")
|
|
|
|
def abilityOccult(self):
|
|
|
|
return self.occult + self.modifierTotal("OCCULT")
|
|
|
|
performance = DotField("Performance")
|
|
|
|
def abilityPerformance(self):
|
|
|
|
return self.performance + self.modifierTotal("PERFORMANCE")
|
|
|
|
presence = DotField("Presence")
|
|
|
|
def abilityPresence(self):
|
|
|
|
return self.presence + self.modifierTotal("PRESENCE")
|
|
|
|
resistance = DotField("Resistance")
|
|
|
|
def abilityResistance(self):
|
|
|
|
return self.resistance + self.modifierTotal("RESISTANCE")
|
|
|
|
ride = DotField("Ride")
|
|
|
|
def abilityRide(self):
|
|
|
|
return self.ride + self.modifierTotal("RIDE")
|
|
|
|
sail = DotField("Sail")
|
|
|
|
def abilitySail(self):
|
|
|
|
return self.sail + self.modifierTotal("SAIL")
|
|
|
|
socialize = DotField("Socialize")
|
|
|
|
def abilitySocialize(self):
|
|
|
|
return self.socialize + self.modifierTotal("SOCIALIZE")
|
|
|
|
stealth = DotField("Stealth")
|
|
|
|
def abilityStealth(self):
|
|
|
|
return self.stealth + self.modifierTotal("STEALTH")
|
|
|
|
survival = DotField("Survival")
|
|
|
|
def abilitySurvival(self):
|
|
|
|
return self.survival + self.modifierTotal("SURVIVAL")
|
|
|
|
thrown = DotField("Thrown")
|
|
|
|
def abilityThrown(self):
|
|
|
|
return self.thrown + self.modifierTotal("THROWN")
|
|
|
|
war = DotField("War")
|
|
|
|
def abilityWar(self):
|
|
|
|
return self.war + self.modifierTotal("WAR")
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
#============= MERITS =============#
|
|
|
|
# Reverse relation
|
|
|
|
# .merit_set.all()
|
|
|
|
|
|
|
|
#=========== WILLPOWER ============#
|
|
|
|
willpowerCap = 10
|
|
|
|
willpowerMax = NamedIntegerField("Maximum Willpower")
|
|
|
|
willpower = NamedIntegerField("Current Willpower")
|
|
|
|
|
|
|
|
#=========== EXPERIENCE ===========#
|
|
|
|
experienceTotal = NamedIntegerField("Total Experience")
|
|
|
|
experience = NamedIntegerField("Current Experience")
|
|
|
|
|
|
|
|
#============ WEAPONS =============#
|
|
|
|
# Reverse relation
|
|
|
|
# .itemWeaponMelee_set.all()
|
|
|
|
# .itemWeaponRanged_set.all()
|
|
|
|
|
|
|
|
#============= ARMOR ==============#
|
|
|
|
# Reverse relation
|
|
|
|
# .itemArmor_set.all()
|
2020-04-11 19:58:07 +01:00
|
|
|
def armorSoak(self):
|
|
|
|
armor = None
|
|
|
|
modifier = 0
|
|
|
|
try:
|
|
|
|
armor = self.itemArmor_set.filter(equipped=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if armor:
|
|
|
|
for item in armor:
|
|
|
|
modifier += item.soak
|
|
|
|
return modifier
|
|
|
|
def armorHardness(self):
|
|
|
|
armor = None
|
|
|
|
modifier = 0
|
|
|
|
try:
|
|
|
|
armor = self.itemArmor_set.filter(equipped=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if armor:
|
|
|
|
for item in armor:
|
|
|
|
modifier += item.hardness
|
|
|
|
return modifier
|
|
|
|
def armorMobilityPenalty(self):
|
|
|
|
armor = None
|
|
|
|
modifier = 0
|
|
|
|
try:
|
|
|
|
armor = self.itemArmor_set.filter(equipped=True)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if armor:
|
|
|
|
for item in armor:
|
|
|
|
modifier += item.mobilityPenalty
|
|
|
|
return modifier
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
#============= ITEMS ==============#
|
|
|
|
# Reverse relation
|
|
|
|
# .item_set.all()
|
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#============ ESSENCE =============#
|
|
|
|
essence = NamedIntegerField("Essence")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
#============= HEALTH =============#
|
|
|
|
health0 = NamedIntegerField("'-0' Health Levels")
|
|
|
|
health1 = NamedIntegerField("'-1' Health Levels")
|
|
|
|
health2 = NamedIntegerField("'-2' Health Levels")
|
|
|
|
healthIndex = NamedIntegerField("Health Track Index")
|
|
|
|
def healthTrack(self):
|
|
|
|
return ["Healthy"] + ["-0" for i in range(self.health0)] + ["-1" for i in range(self.health1)] + ["-1" for i in range(self.health1)] + ["-4", "i"]
|
|
|
|
def healthLevel(self):
|
|
|
|
return self.healthTrack()[self.healthIndex]
|
|
|
|
|
|
|
|
#============ STATICS =============#
|
|
|
|
def resolve(self, speciality=None, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + ceil((self.attributeWits() + self.abilityIntegrity()) / 2) + self.modifierTotal("RESOLVE")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def guile(self, speciality=None, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + ceil((self.attributeManipulation() + self.abilitySocialize()) / 2) + self.modifierTotal("GUILE")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def soakNatural(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + self.attributeStamina() + self.modifierTotal("SOAK NATURAL")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def soakArmored(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + self.armorSoak()
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def soakTotal(self, mod=0):
|
|
|
|
return mod + self.soakNatural() + self.soakArmored()
|
2020-04-11 19:58:07 +01:00
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def hardness(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + self.armorHardness() + self.modifierTotal("HARDNESS")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def joinBattle(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + self.attributeWits() + self.abilityAwareness() + 3 + self.modifierTotal("JOIN BATTLE")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def evasion(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + ceil((self.attributeDexterity() + self.abilityDodge()) / 2) - self.armorMobilityPenalty() + self.modifierTotal("EVASION")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def rush(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + self.attributeDexterity() + self.abilityAthletics() + self.modifierTotal("RUSH")
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
def disengage(self, mod=0):
|
2020-04-11 19:58:07 +01:00
|
|
|
return mod + self.attributeDexterity() + self.abilityDodge() + self.modifierTotal("DISENGAGE")
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
class characterExaltBase(characterBase):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#============= MOTES ==============#
|
2020-04-11 23:30:53 +01:00
|
|
|
motesPersonalMax = NamedIntegerField("Maximum Personal Motes")
|
|
|
|
motesPersonal = NamedIntegerField("Current Personal Motes")
|
|
|
|
motesPeripheralMax = NamedIntegerField("Maximum Peripheral Motes")
|
|
|
|
motesPeripheral = NamedIntegerField("Current Peripheral Motes")
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
#============= LIMIT ==============#
|
2020-04-11 23:30:53 +01:00
|
|
|
limitTrigger = models.TextField(verbose_name="Limit Trigger", blank="False", max_length=1000)
|
|
|
|
limitBreak = NamedIntegerField("Limit Break")
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
#======= EXALTED EXPERIENCE =======#
|
2020-04-11 23:30:53 +01:00
|
|
|
experienceExaltedTotal = NamedIntegerField("Total Experience")
|
|
|
|
experienceExalted = NamedIntegerField("Current Experience")
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
class characterExaltSolar(characterExaltBase):
|
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#======= SUPERNAL & FAVORED =======#
|
|
|
|
abilitySupernal = SingleChoiceField("Supernal Ability", ABILITIES)
|
|
|
|
abilityFavored = MultiChoiceField("Favoured Abilities", ABILITIES)
|
2020-04-11 18:07:22 +01:00
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#============= CHARMS =============#
|
|
|
|
# Reverse relation
|
|
|
|
# .charmSolar_set.all()
|
2020-04-11 18:07:22 +01:00
|
|
|
|
|
|
|
class characterExaltLunar(characterExaltBase):
|
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#============ FAVORED =============#
|
|
|
|
attributeFavored = MultiChoiceField("Favoured Attributes", ATTRIBUTES)
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
#========= SHAPESHIFTING ==========#
|
2020-04-11 23:30:53 +01:00
|
|
|
# Reverse relation
|
|
|
|
# .charmLunarShape_set.all()
|
2020-04-11 18:07:22 +01:00
|
|
|
|
2020-04-11 19:58:07 +01:00
|
|
|
#============= CHARMS =============#
|
|
|
|
# Reverse relation
|
|
|
|
# .charmLunar_set.all()
|
2020-04-11 18:07:22 +01:00
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
#==============================================================================#
|
|
|
|
#----------------------------------- ITEMS ------------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class itemBase(models.Model):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
name = NameField()
|
|
|
|
description = DescriptionField()
|
2020-04-11 18:07:22 +01:00
|
|
|
character = NamedForeignKeyField("Character", characterBase)
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
class item(itemBase):
|
|
|
|
pass
|
|
|
|
|
|
|
|
#==============================================================================#
|
|
|
|
#---------------------------------- WEAPONS -----------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class itemWeaponBase(itemBase):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2020-04-11 18:07:22 +01:00
|
|
|
equipped = NamedBooleanField("Equipped?")
|
2020-04-11 14:01:52 +01:00
|
|
|
category = SingleChoiceField("Category", CATEGORIES)
|
|
|
|
tags = MultiChoiceField("Tags", TAGS_WEAPONS)
|
2020-04-11 13:03:48 +01:00
|
|
|
accuracy = NamedIntegerField("Accuracy")
|
|
|
|
damage = NamedIntegerField("Damage")
|
|
|
|
defense = NamedIntegerField("Defense")
|
|
|
|
overwhelming = NamedIntegerField("Overwhelming")
|
|
|
|
attunement = NamedIntegerField("Attunement")
|
|
|
|
|
|
|
|
class itemWeaponMelee(itemWeaponBase):
|
2020-04-11 18:07:22 +01:00
|
|
|
def attack(self, ability, mod=0, withering=True):
|
|
|
|
if withering:
|
|
|
|
return mod + ability + self.dexterity + weapon.accuracy
|
|
|
|
else:
|
|
|
|
return mod + ability + self.dexterity
|
|
|
|
def parry(self, ability, mod=0):
|
|
|
|
if self.character.charmsActive():
|
|
|
|
mod += sum([])
|
|
|
|
return mod + ceil((self.dexterity + ability) / 2) + weapon.defense
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
class itemWeaponRanged(itemWeaponBase):
|
|
|
|
rangeClose = NamedIntegerField("Close Range")
|
|
|
|
rangeShort = NamedIntegerField("Short Range")
|
|
|
|
rangeMedium = NamedIntegerField("Medium Range")
|
|
|
|
rangeLong = NamedIntegerField("Long Range")
|
|
|
|
rangeExtreme = NamedIntegerField("Extreme Range")
|
2020-04-11 18:07:22 +01:00
|
|
|
def attack(self, ability, rangeBand, mod=0, withering=True):
|
|
|
|
rangeBand = rangeBand.lower()
|
|
|
|
if rangeBand == "close" or rangeBand == "c":
|
|
|
|
rangeModifier = self.rangeClose
|
|
|
|
elif rangeBand == "short" or rangeBand == "s":
|
|
|
|
rangeModifier = self.rangeShort
|
|
|
|
elif rangeBand == "medium" or rangeBand == "m":
|
|
|
|
rangeModifier = self.rangeMedium
|
|
|
|
elif rangeBand == "long" or rangeBand == "l":
|
|
|
|
rangeModifier = self.rangeLong
|
|
|
|
elif rangeBand == "extreme" or rangeBand == "e":
|
|
|
|
rangeModifier = self.rangeExtreme
|
|
|
|
else:
|
|
|
|
rangeModifier = 0
|
|
|
|
if withering:
|
|
|
|
return mod + rangeModifier + ability + self.dexterity + weapon.accuracy
|
|
|
|
else:
|
|
|
|
return mod + rangeModifier + ability + self.dexterity
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
#==============================================================================#
|
|
|
|
#----------------------------------- ARMOR ------------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class itemArmor(itemBase):
|
2020-04-11 18:07:22 +01:00
|
|
|
equipped = NamedBooleanField("Equipped?")
|
2020-04-11 14:03:04 +01:00
|
|
|
category = SingleChoiceField("Category", CATEGORIES)
|
|
|
|
tags = MultiChoiceField("Tags", TAGS_ARMOR)
|
2020-04-11 13:03:48 +01:00
|
|
|
soak = NamedIntegerField("Soak")
|
|
|
|
hardness = NamedIntegerField("Hardness")
|
|
|
|
mobilityPenalty = NamedIntegerField("Mobility Penalty")
|
|
|
|
attunement = NamedIntegerField("Attunement")
|
|
|
|
|
|
|
|
#==============================================================================#
|
|
|
|
#----------------------------------- CHARMS -----------------------------------#
|
|
|
|
#==============================================================================#
|
2020-04-11 18:12:05 +01:00
|
|
|
class charmBase(models.Model):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
name = NameField()
|
|
|
|
description = DescriptionField()
|
2020-04-11 18:12:05 +01:00
|
|
|
levelEssence = NamedIntegerField("Essence Level")
|
|
|
|
levelKey = NamedIntegerField("Key Level")
|
2020-04-11 18:07:22 +01:00
|
|
|
active = NamedBooleanField("Active?")
|
2020-04-11 18:12:05 +01:00
|
|
|
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration)
|
2020-04-11 15:29:21 +01:00
|
|
|
modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute)
|
|
|
|
modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility)
|
|
|
|
modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic)
|
2020-04-11 18:07:22 +01:00
|
|
|
def modifier(self, keyword):
|
|
|
|
output = 0
|
|
|
|
for modifierAttribute in self.modifierAttribute.all():
|
|
|
|
if keyword == modifierAttribute.attribute:
|
|
|
|
output += modifierAttribute.value
|
|
|
|
for modifierAbility in self.modifierAbility.all():
|
|
|
|
if keyword == modifierAbility.ability:
|
|
|
|
output += modifierAbility.value
|
|
|
|
for modifierStatic in self.modifierStatic.all():
|
|
|
|
if keyword == modifierStatic.static:
|
|
|
|
output += modifierStatic.value
|
2020-04-11 19:58:07 +01:00
|
|
|
return output
|
2020-04-11 13:03:48 +01:00
|
|
|
|
2020-04-11 18:12:05 +01:00
|
|
|
class charmSolar(charmBase):
|
|
|
|
ability = SingleChoiceField("Key Ability", ABILITIES)
|
2020-04-11 19:58:07 +01:00
|
|
|
character = NamedForeignKeyField("Character", characterExaltSolar)
|
2020-04-11 18:12:05 +01:00
|
|
|
|
|
|
|
class charmLunar(charmBase):
|
|
|
|
attribute = SingleChoiceField("Key Attribute", ATTRIBUTES)
|
2020-04-11 19:58:07 +01:00
|
|
|
character = NamedForeignKeyField("Character", characterExaltLunar)
|
2020-04-11 18:12:05 +01:00
|
|
|
|
2020-04-11 23:30:53 +01:00
|
|
|
class charmLunarShape(charmBase):
|
|
|
|
description = DescriptionField()
|
|
|
|
character = NamedForeignKeyField("Character", characterExaltLunar)
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
#==============================================================================#
|
|
|
|
#----------------------------------- MERITS -----------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class merit(models.Model):
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
name = NameField()
|
|
|
|
description = DescriptionField()
|
|
|
|
dots = DotField("Dots")
|
2020-04-11 18:07:22 +01:00
|
|
|
character = NamedForeignKeyField("Character", characterBase)
|
2020-04-11 19:58:07 +01:00
|
|
|
active = NamedBooleanField("Active?")
|
2020-04-11 18:07:22 +01:00
|
|
|
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration)
|
2020-04-11 15:40:33 +01:00
|
|
|
modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute)
|
|
|
|
modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility)
|
|
|
|
modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic)
|
2020-04-11 19:58:07 +01:00
|
|
|
def modifier(self, keyword):
|
|
|
|
output = 0
|
|
|
|
for modifierAttribute in self.modifierAttribute.all():
|
|
|
|
if keyword == modifierAttribute.attribute:
|
|
|
|
output += modifierAttribute.value
|
|
|
|
for modifierAbility in self.modifierAbility.all():
|
|
|
|
if keyword == modifierAbility.ability:
|
|
|
|
output += modifierAbility.value
|
|
|
|
for modifierStatic in self.modifierStatic.all():
|
|
|
|
if keyword == modifierStatic.static:
|
|
|
|
output += modifierStatic.value
|
|
|
|
return output
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
#==============================================================================#
|
|
|
|
#-------------------------------- SPECIALITIES --------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class speciality(models.Model):
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
2020-04-11 19:58:07 +01:00
|
|
|
return self.name
|
2020-04-11 15:40:33 +01:00
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
name = NameField()
|
2020-04-11 18:07:22 +01:00
|
|
|
character = NamedForeignKeyField("Character", characterBase)
|
2020-04-11 19:58:07 +01:00
|
|
|
active = NamedBooleanField("Active?")
|
|
|
|
modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility)
|
|
|
|
modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic)
|
|
|
|
def modifier(self, keyword):
|
|
|
|
output = 0
|
|
|
|
for modifierAbility in self.modifierAbility.all():
|
|
|
|
if keyword == modifierAbility.ability:
|
|
|
|
output += modifierAbility.value
|
|
|
|
for modifierStatic in self.modifierStatic.all():
|
|
|
|
if keyword == modifierStatic.static:
|
|
|
|
output += modifierStatic.value
|
|
|
|
return output
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
#==============================================================================#
|
|
|
|
#--------------------------------- INTIMACIES ---------------------------------#
|
|
|
|
#==============================================================================#
|
|
|
|
class intimacyBase(models.Model):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2020-04-11 15:40:33 +01:00
|
|
|
def __str__(self):
|
|
|
|
return "[{}] {}".format(self.description, self.intensity)
|
|
|
|
|
2020-04-11 13:03:48 +01:00
|
|
|
description = DescriptionField()
|
|
|
|
intensity = SingleChoiceField("Intensity", INTENSITIES)
|
2020-04-11 18:07:22 +01:00
|
|
|
character = NamedForeignKeyField("Character", characterBase)
|
2020-04-11 13:03:48 +01:00
|
|
|
|
|
|
|
class intimacyTie(intimacyBase):
|
|
|
|
target = NamedCharField("Target")
|
|
|
|
|
|
|
|
class intimacyPrincipal(intimacyBase):
|
|
|
|
pass
|
|
|
|
|