methods for calulating modifiers fucking everywhere

This commit is contained in:
tcaxle 2020-04-11 19:58:07 +01:00
parent c1abed0a0c
commit 894f25f03e
14 changed files with 749 additions and 102 deletions

View File

@ -0,0 +1,20 @@
# Generated by Django 3.0.5 on 2020-04-11 17:14
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0010_auto_20200411_1711'),
]
operations = [
migrations.AddField(
model_name='rollconfiguration',
name='name',
field=app.models.NameField(default='', max_length=100, verbose_name='Name'),
preserve_default=False,
),
]

View File

@ -0,0 +1,19 @@
# Generated by Django 3.0.5 on 2020-04-11 17:17
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0011_rollconfiguration_name'),
]
operations = [
migrations.AddField(
model_name='rollconfiguration',
name='successesAuto',
field=app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Auto-Successes'),
),
]

View File

@ -0,0 +1,40 @@
# Generated by Django 3.0.5 on 2020-04-11 17:27
import app.models
from django.db import migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0012_rollconfiguration_successesauto'),
]
operations = [
migrations.AddField(
model_name='characterexaltlunar',
name='attributeFavored',
field=app.models.MultiChoiceField(blank=True, choices=[('Physical', (('STR', 'Srength'), ('DEX', 'Dexterity'), ('STA', 'Stamina'))), ('Social', (('CHA', 'Charisma'), ('MAN', 'Manipulation'), ('APP', 'Appearance'))), ('Mental', (('PER', 'Perception'), ('INT', 'Intelligence'), ('WIT', 'Wits')))], max_length=100, verbose_name='Favoured Attributes'),
),
migrations.AddField(
model_name='characterexaltsolar',
name='abilityFavored',
field=app.models.MultiChoiceField(blank=True, choices=[('War', (('ARCHERY', 'Archery'), ('ATHLETICS', 'Athletics'), ('AWARENESS', 'Awareness'), ('BRAWL', 'Brawl'), ('DODGE', 'Dodge'), ('INTEGRITY', 'Integrity'), ('MELEE', 'Melee'), ('RESISTANCE', 'Resistance'), ('THROWN', 'Thrown'), ('WAR', 'War'))), ('Life', (('CRAFT', 'Craft'), ('LARCENY', 'Larceny'), ('LINGUISTICS', 'Linguistics'), ('PERFORMANCE', 'Performance'), ('PRESENCE', 'Presence'), ('RIDE', 'Ride'), ('SAIL', 'Sail'), ('SOCIALISE', 'Socialise'), ('STEALTH', 'Stealth'), ('SURVIVAL', 'Survival'))), ('Wisdom', (('BUREAUCRACY', 'Bureaucracy'), ('INVESTIGATION', 'Investigation'), ('LORE', 'Lore'), ('MEDICINE', 'Medicine'), ('OCCULT', 'Occult')))], max_length=100, verbose_name='Favoured Abilities'),
),
migrations.AddField(
model_name='characterexaltsolar',
name='abilitySupernal',
field=app.models.SingleChoiceField(blank=True, choices=[('War', (('ARCHERY', 'Archery'), ('ATHLETICS', 'Athletics'), ('AWARENESS', 'Awareness'), ('BRAWL', 'Brawl'), ('DODGE', 'Dodge'), ('INTEGRITY', 'Integrity'), ('MELEE', 'Melee'), ('RESISTANCE', 'Resistance'), ('THROWN', 'Thrown'), ('WAR', 'War'))), ('Life', (('CRAFT', 'Craft'), ('LARCENY', 'Larceny'), ('LINGUISTICS', 'Linguistics'), ('PERFORMANCE', 'Performance'), ('PRESENCE', 'Presence'), ('RIDE', 'Ride'), ('SAIL', 'Sail'), ('SOCIALISE', 'Socialise'), ('STEALTH', 'Stealth'), ('SURVIVAL', 'Survival'))), ('Wisdom', (('BUREAUCRACY', 'Bureaucracy'), ('INVESTIGATION', 'Investigation'), ('LORE', 'Lore'), ('MEDICINE', 'Medicine'), ('OCCULT', 'Occult')))], max_length=100, verbose_name='Supernal Ability'),
),
migrations.AlterField(
model_name='charmlunar',
name='character',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.characterExaltLunar', verbose_name='Character'),
),
migrations.AlterField(
model_name='charmsolar',
name='character',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.characterExaltSolar', verbose_name='Character'),
),
]

View File

@ -0,0 +1,43 @@
# Generated by Django 3.0.5 on 2020-04-11 18:00
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0013_auto_20200411_1727'),
]
operations = [
migrations.RemoveField(
model_name='speciality',
name='ability',
),
migrations.AddField(
model_name='characterbase',
name='essence',
field=app.models.NamedIntegerField(default=0, help_text=None, verbose_name='Essence'),
),
migrations.AddField(
model_name='merit',
name='active',
field=app.models.NamedBooleanField(default=False, verbose_name='Active?'),
),
migrations.AddField(
model_name='speciality',
name='active',
field=app.models.NamedBooleanField(default=False, verbose_name='Active?'),
),
migrations.AddField(
model_name='speciality',
name='modifierAbility',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierAbility', verbose_name='Abilities Modifiers'),
),
migrations.AddField(
model_name='speciality',
name='modifierStatic',
field=app.models.NamedManyToManyField(blank=True, to='app.modifierStatic', verbose_name='Statics Modifiers'),
),
]

View File

@ -0,0 +1,169 @@
# Generated by Django 3.0.5 on 2020-04-11 18:44
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0014_auto_20200411_1800'),
]
operations = [
migrations.RemoveField(
model_name='characterbase',
name='appearance',
),
migrations.RemoveField(
model_name='characterbase',
name='archery',
),
migrations.RemoveField(
model_name='characterbase',
name='athletics',
),
migrations.RemoveField(
model_name='characterbase',
name='awareness',
),
migrations.RemoveField(
model_name='characterbase',
name='brawl',
),
migrations.RemoveField(
model_name='characterbase',
name='bureaucracy',
),
migrations.RemoveField(
model_name='characterbase',
name='charisma',
),
migrations.RemoveField(
model_name='characterbase',
name='craft',
),
migrations.RemoveField(
model_name='characterbase',
name='dexterity',
),
migrations.RemoveField(
model_name='characterbase',
name='dodge',
),
migrations.RemoveField(
model_name='characterbase',
name='integrity',
),
migrations.RemoveField(
model_name='characterbase',
name='intelligence',
),
migrations.RemoveField(
model_name='characterbase',
name='investigation',
),
migrations.RemoveField(
model_name='characterbase',
name='larceny',
),
migrations.RemoveField(
model_name='characterbase',
name='linguistics',
),
migrations.RemoveField(
model_name='characterbase',
name='lore',
),
migrations.RemoveField(
model_name='characterbase',
name='manipulation',
),
migrations.RemoveField(
model_name='characterbase',
name='martialArts',
),
migrations.RemoveField(
model_name='characterbase',
name='medicine',
),
migrations.RemoveField(
model_name='characterbase',
name='melee',
),
migrations.RemoveField(
model_name='characterbase',
name='occult',
),
migrations.RemoveField(
model_name='characterbase',
name='perception',
),
migrations.RemoveField(
model_name='characterbase',
name='performance',
),
migrations.RemoveField(
model_name='characterbase',
name='presence',
),
migrations.RemoveField(
model_name='characterbase',
name='resistance',
),
migrations.RemoveField(
model_name='characterbase',
name='ride',
),
migrations.RemoveField(
model_name='characterbase',
name='sail',
),
migrations.RemoveField(
model_name='characterbase',
name='socialize',
),
migrations.RemoveField(
model_name='characterbase',
name='stamina',
),
migrations.RemoveField(
model_name='characterbase',
name='stealth',
),
migrations.RemoveField(
model_name='characterbase',
name='strength',
),
migrations.RemoveField(
model_name='characterbase',
name='survival',
),
migrations.RemoveField(
model_name='characterbase',
name='thrown',
),
migrations.RemoveField(
model_name='characterbase',
name='war',
),
migrations.RemoveField(
model_name='characterbase',
name='wits',
),
migrations.AlterField(
model_name='characterexaltlunar',
name='attributeFavored',
field=app.models.MultiChoiceField(blank=True, choices=[('Physical', (('STR', 'Strength'), ('DEX', 'Dexterity'), ('STA', 'Stamina'))), ('Social', (('CHA', 'Charisma'), ('MAN', 'Manipulation'), ('APP', 'Appearance'))), ('Mental', (('PER', 'Perception'), ('INT', 'Intelligence'), ('WIT', 'Wits')))], max_length=100, verbose_name='Favoured Attributes'),
),
migrations.AlterField(
model_name='charmlunar',
name='attribute',
field=app.models.SingleChoiceField(blank=True, choices=[('Physical', (('STR', 'Strength'), ('DEX', 'Dexterity'), ('STA', 'Stamina'))), ('Social', (('CHA', 'Charisma'), ('MAN', 'Manipulation'), ('APP', 'Appearance'))), ('Mental', (('PER', 'Perception'), ('INT', 'Intelligence'), ('WIT', 'Wits')))], max_length=100, verbose_name='Key Attribute'),
),
migrations.AlterField(
model_name='modifierattribute',
name='attribute',
field=app.models.SingleChoiceField(blank=True, choices=[('Physical', (('STR', 'Strength'), ('DEX', 'Dexterity'), ('STA', 'Stamina'))), ('Social', (('CHA', 'Charisma'), ('MAN', 'Manipulation'), ('APP', 'Appearance'))), ('Mental', (('PER', 'Perception'), ('INT', 'Intelligence'), ('WIT', 'Wits')))], max_length=100, verbose_name='Attribute'),
),
]

View File

@ -0,0 +1,189 @@
# Generated by Django 3.0.5 on 2020-04-11 18:51
import app.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0015_auto_20200411_1844'),
]
operations = [
migrations.AddField(
model_name='characterbase',
name='appearance',
field=app.models.DotField(default=0, verbose_name='Apperance'),
),
migrations.AddField(
model_name='characterbase',
name='archery',
field=app.models.DotField(default=0, verbose_name='Archery'),
),
migrations.AddField(
model_name='characterbase',
name='athletics',
field=app.models.DotField(default=0, verbose_name='Athletics'),
),
migrations.AddField(
model_name='characterbase',
name='awareness',
field=app.models.DotField(default=0, verbose_name='Awareness'),
),
migrations.AddField(
model_name='characterbase',
name='brawl',
field=app.models.DotField(default=0, verbose_name='Brawl'),
),
migrations.AddField(
model_name='characterbase',
name='bureaucracy',
field=app.models.DotField(default=0, verbose_name='Bureaucracy'),
),
migrations.AddField(
model_name='characterbase',
name='charisma',
field=app.models.DotField(default=0, verbose_name='Charisma'),
),
migrations.AddField(
model_name='characterbase',
name='craft',
field=app.models.DotField(default=0, verbose_name='Craft'),
),
migrations.AddField(
model_name='characterbase',
name='dexterity',
field=app.models.DotField(default=0, verbose_name='Dexterity'),
),
migrations.AddField(
model_name='characterbase',
name='dodge',
field=app.models.DotField(default=0, verbose_name='Dodge'),
),
migrations.AddField(
model_name='characterbase',
name='integrity',
field=app.models.DotField(default=0, verbose_name='Integrity'),
),
migrations.AddField(
model_name='characterbase',
name='intelligence',
field=app.models.DotField(default=0, verbose_name='Intelligence'),
),
migrations.AddField(
model_name='characterbase',
name='investigation',
field=app.models.DotField(default=0, verbose_name='Investigation'),
),
migrations.AddField(
model_name='characterbase',
name='larceny',
field=app.models.DotField(default=0, verbose_name='Larceny'),
),
migrations.AddField(
model_name='characterbase',
name='linguistics',
field=app.models.DotField(default=0, verbose_name='Linguistics'),
),
migrations.AddField(
model_name='characterbase',
name='lore',
field=app.models.DotField(default=0, verbose_name='Lore'),
),
migrations.AddField(
model_name='characterbase',
name='manipulation',
field=app.models.DotField(default=0, verbose_name='Manipulation'),
),
migrations.AddField(
model_name='characterbase',
name='martialArts',
field=app.models.DotField(default=0, verbose_name='MartialArts'),
),
migrations.AddField(
model_name='characterbase',
name='medicine',
field=app.models.DotField(default=0, verbose_name='Medicine'),
),
migrations.AddField(
model_name='characterbase',
name='melee',
field=app.models.DotField(default=0, verbose_name='Melee'),
),
migrations.AddField(
model_name='characterbase',
name='occult',
field=app.models.DotField(default=0, verbose_name='Occult'),
),
migrations.AddField(
model_name='characterbase',
name='perception',
field=app.models.DotField(default=0, verbose_name='Perception'),
),
migrations.AddField(
model_name='characterbase',
name='performance',
field=app.models.DotField(default=0, verbose_name='Performance'),
),
migrations.AddField(
model_name='characterbase',
name='presence',
field=app.models.DotField(default=0, verbose_name='Presence'),
),
migrations.AddField(
model_name='characterbase',
name='resistance',
field=app.models.DotField(default=0, verbose_name='Resistance'),
),
migrations.AddField(
model_name='characterbase',
name='ride',
field=app.models.DotField(default=0, verbose_name='Ride'),
),
migrations.AddField(
model_name='characterbase',
name='sail',
field=app.models.DotField(default=0, verbose_name='Sail'),
),
migrations.AddField(
model_name='characterbase',
name='socialize',
field=app.models.DotField(default=0, verbose_name='Socialize'),
),
migrations.AddField(
model_name='characterbase',
name='stamina',
field=app.models.DotField(default=0, verbose_name='Stamina'),
),
migrations.AddField(
model_name='characterbase',
name='stealth',
field=app.models.DotField(default=0, verbose_name='Stealth'),
),
migrations.AddField(
model_name='characterbase',
name='strength',
field=app.models.DotField(default=0, verbose_name='Strength'),
),
migrations.AddField(
model_name='characterbase',
name='survival',
field=app.models.DotField(default=0, verbose_name='Survival'),
),
migrations.AddField(
model_name='characterbase',
name='thrown',
field=app.models.DotField(default=0, verbose_name='Thrown'),
),
migrations.AddField(
model_name='characterbase',
name='war',
field=app.models.DotField(default=0, verbose_name='War'),
),
migrations.AddField(
model_name='characterbase',
name='wits',
field=app.models.DotField(default=0, verbose_name='Wits'),
),
]

View File

@ -9,7 +9,7 @@ from math import ceil
ATTRIBUTES = [
(
"Physical", (
("STR", "Srength"),
("STR", "Strength"),
("DEX", "Dexterity"),
("STA", "Stamina"),
),
@ -263,6 +263,10 @@ class NamedOneToOneField(models.OneToOneField):
#-------------------------------- DICE ROLLING --------------------------------#
#==============================================================================#
class rollConfiguration(models.Model):
def __str__(self):
return self.name
name = NameField()
successesAuto = NamedIntegerField("Auto-Successes")
r01 = DieField("1s", 1, ["NONE"])
r02 = DieField("2s", 2, ["NONE"])
r03 = DieField("3s", 3, ["NONE"])
@ -274,7 +278,7 @@ class rollConfiguration(models.Model):
r09 = DieField("9s", 9, ["SUCCESS"])
r10 = DieField("10s", 10, ["SUCCESS", "DOUBLE"])
def roll(self, pool=1):
def roll(self, pool=1, successesStunt=0):
listDice = [
self.r01,
self.r02,
@ -297,7 +301,7 @@ class rollConfiguration(models.Model):
listExplodingDisappearing.append(die.number)
if "SUBTRACTING" in die:
listSubtracting.append(die.number)
successes = 0
successes = self.successesAuto + successesStunt
listExploded, listDisappeared = [], []
listRoll = [0 for die in range(pool)]
while 0 in listRoll:
@ -355,47 +359,158 @@ class characterBase(models.Model):
def __str__(self):
return self.name
#======== 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)
#============ GENERAL =============#
name = NameField()
#=========== ATTRIBUTES ===========#
strength = DotField("Strength")
dexterity = DotField("Dexterity")
stamina = DotField("Stamina")
charisma = DotField("Charisma")
manipulation = DotField("Manipulation")
appearance = DotField("Apperance")
perception = DotField("Perception")
intelligence = DotField("Intelligence")
wits = DotField("Wits")
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")
#=========== ABILITIES ============#
archery = DotField("Archery")
athletics = DotField("Athletics")
awareness = DotField("Awareness")
brawl = DotField("Brawl")
bureaucracy = DotField("Bureaucracy")
craft = DotField("Craft")
dodge = DotField("Dodge")
integrity = DotField("Integrity")
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")
investigation = DotField("Investigation")
larceny = DotField("Larceny")
linguistics = DotField("Linguistics")
lore = DotField("Lore")
martialArts = DotField("MartialArts")
medicine = DotField("Medicine")
melee = DotField("Melee")
occult = DotField("Occult")
performance = DotField("Performance")
presence = DotField("Presence")
resistance = DotField("Resistance")
ride = DotField("Ride")
sail = DotField("Sail")
socialize = DotField("Socialize")
stealth = DotField("Stealth")
survival = DotField("Survival")
thrown = DotField("Thrown")
war = DotField("War")
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")
#============= MERITS =============#
# Reverse relation
@ -418,11 +533,47 @@ class characterBase(models.Model):
#============= ARMOR ==============#
# Reverse relation
# .itemArmor_set.all()
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
#============= ITEMS ==============#
# Reverse relation
# .item_set.all()
#============ ESSENCE =============#
essence = NamedIntegerField("Essence")
#============= HEALTH =============#
health0 = NamedIntegerField("'-0' Health Levels")
health1 = NamedIntegerField("'-1' Health Levels")
@ -435,75 +586,67 @@ class characterBase(models.Model):
#============ STATICS =============#
def resolve(self, speciality=None, mod=0):
if self.charmsActive():
mod += sum([])
if speciality:
mod += specility.modifier
return mod + ceil((self.wits + self.integrity) / 2)
return mod + ceil((self.attributeWits() + self.abilityIntegrity()) / 2) + self.modifierTotal("RESOLVE")
def guile(self, speciality=None, mod=0):
if self.charmsActive():
mod += sum([])
if speciality:
mod += specility.modifier
return mod + ceil((self.manipulation + self.socialize) / 2)
return mod + ceil((self.attributeManipulation() + self.abilitySocialize()) / 2) + self.modifierTotal("GUILE")
def soakNatural(self, mod=0):
if self.charmsActive():
mod += sum([])
return mod + self.stamina
return mod + self.attributeStamina() + self.modifierTotal("SOAK NATURAL")
def soakArmored(self, mod=0):
if self.armorEquipped.all():
mod += sum([])
return mod
return mod + self.armorSoak()
def soakTotal(self, mod=0):
return mod + self.soakNatural() + self.soakArmored()
def hardness(self, mod=0):
if self.armorEquipped.all():
mod += sum([])
if self.charmsActive():
mod += sum([])
return mod
return mod + self.armorHardness() + self.modifierTotal("HARDNESS")
def joinBattle(self, mod=0):
if self.charmsActive():
mod += sum([])
return mod + self.wits + self.awareness + 3
return mod + self.attributeWits() + self.abilityAwareness() + 3 + self.modifierTotal("JOIN BATTLE")
def evasion(self, mod=0):
if self.charmsActive():
mod += sum([])
return mod + ceil((self.dexterity + self.dodge) / 2) - sum([])
return mod + ceil((self.attributeDexterity() + self.abilityDodge()) / 2) - self.armorMobilityPenalty() + self.modifierTotal("EVASION")
def rush(self, mod=0):
if self.charmsActive():
mod += sum([])
return mod + self.dexterity + self.athletics
return mod + self.attributeDexterity() + self.abilityAthletics() + self.modifierTotal("RUSH")
def disengage(self, mod=0):
if self.charmsActive():
mod += sum([])
return mod + self.dexterity + self.dodge
return mod + self.attributeDexterity() + self.abilityDodge() + self.modifierTotal("DISENGAGE")
class characterExaltBase(characterBase):
class Meta:
abstract = True
#============ ESSENCE =============#
#============= MOTES ==============#
#============= LIMIT ==============#
#======= EXALTED EXPERIENCE =======#
#============= CHARMS =============#
pass
class characterExaltSolar(characterExaltBase):
#============ SUPERNAL ============#
#======= SUPERNAL & FAVORED =======#
abilitySupernal = SingleChoiceField("Supernal Ability", ABILITIES)
abilityFavored = MultiChoiceField("Favoured Abilities", ABILITIES)
pass
#============= CHARMS =============#
# Reverse relation
# .charmSolar_set.all()
class characterExaltLunar(characterExaltBase):
#============ FAVORED =============#
attributeFavored = MultiChoiceField("Favoured Attributes", ATTRIBUTES)
#========= SHAPESHIFTING ==========#
pass
#============= CHARMS =============#
# Reverse relation
# .charmLunar_set.all()
#==============================================================================#
#----------------------------------- ITEMS ------------------------------------#
@ -600,6 +743,42 @@ class charmBase(models.Model):
description = DescriptionField()
levelEssence = NamedIntegerField("Essence Level")
levelKey = NamedIntegerField("Key Level")
active = NamedBooleanField("Active?")
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration)
modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute)
modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility)
modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic)
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
class charmSolar(charmBase):
ability = SingleChoiceField("Key Ability", ABILITIES)
character = NamedForeignKeyField("Character", characterExaltSolar)
class charmLunar(charmBase):
attribute = SingleChoiceField("Key Attribute", ATTRIBUTES)
character = NamedForeignKeyField("Character", characterExaltLunar)
#==============================================================================#
#----------------------------------- MERITS -----------------------------------#
#==============================================================================#
class merit(models.Model):
def __str__(self):
return self.name
name = NameField()
description = DescriptionField()
dots = DotField("Dots")
character = NamedForeignKeyField("Character", characterBase)
active = NamedBooleanField("Active?")
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration)
@ -617,41 +796,29 @@ class charmBase(models.Model):
for modifierStatic in self.modifierStatic.all():
if keyword == modifierStatic.static:
output += modifierStatic.value
return
class charmSolar(charmBase):
ability = SingleChoiceField("Key Ability", ABILITIES)
class charmLunar(charmBase):
attribute = SingleChoiceField("Key Attribute", ATTRIBUTES)
#==============================================================================#
#----------------------------------- MERITS -----------------------------------#
#==============================================================================#
class merit(models.Model):
def __str__(self):
return self.name
name = NameField()
description = DescriptionField()
dots = DotField("Dots")
character = NamedForeignKeyField("Character", characterBase)
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration)
modifierAttribute = NamedManyToManyField("Attribute Modifiers", modifierAttribute)
modifierAbility = NamedManyToManyField("Abilities Modifiers", modifierAbility)
modifierStatic = NamedManyToManyField("Statics Modifiers", modifierStatic)
return output
#==============================================================================#
#-------------------------------- SPECIALITIES --------------------------------#
#==============================================================================#
class speciality(models.Model):
def __str__(self):
return "[{}] {}".format(self.ability, self.name)
return self.name
modifier = 2
name = NameField()
ability = SingleChoiceField("Ability", ABILITIES)
character = NamedForeignKeyField("Character", characterBase)
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
#==============================================================================#
#--------------------------------- INTIMACIES ---------------------------------#