Capitalised Class Names Now

This commit is contained in:
Tom Crossley FEARNLEY 2020-04-16 20:12:02 +01:00
parent ba03fd80b4
commit 842de65210
4 changed files with 397 additions and 97 deletions

View File

@ -1,41 +1,41 @@
from django.contrib import admin from django.contrib import admin
from .models import * from .models import *
admin.site.register(rollConfiguration) admin.site.register(RollConfiguration)
admin.site.register(modifierAttribute) admin.site.register(ModifierAttribute)
admin.site.register(modifierAbility) admin.site.register(ModifierAbility)
admin.site.register(modifierStatic) admin.site.register(ModifierStatic)
admin.site.register(item) admin.site.register(Item)
admin.site.register(itemWeaponMelee) admin.site.register(ItemWeaponMelee)
admin.site.register(itemWeaponRanged) admin.site.register(ItemWeaponRanged)
admin.site.register(itemArmor) admin.site.register(ItemArmor)
admin.site.register(charmSolar) admin.site.register(CharmSolar)
admin.site.register(charmLunar) admin.site.register(CharmLunar)
admin.site.register(charmLunarShape) admin.site.register(CharmLunarShape)
admin.site.register(charmEvocation) admin.site.register(CharmEvocation)
admin.site.register(charmMartialArt) admin.site.register(CharmMartialArt)
admin.site.register(merit) admin.site.register(Merit)
admin.site.register(speciality) admin.site.register(Speciality)
admin.site.register(intimacyTie) admin.site.register(IntimacyTie)
admin.site.register(intimacyPrincipal) admin.site.register(IntimacyPrincipal)
admin.site.register(characterMortal) admin.site.register(CharacterMortal)
admin.site.register(characterExaltSolar) admin.site.register(CharacterExaltSolar)
admin.site.register(characterExaltLunar) admin.site.register(CharacterExaltLunar)
admin.site.register(ownershipItem) admin.site.register(OwnershipItem)
admin.site.register(ownershipItemWeapon) admin.site.register(OwnershipItemWeapon)
admin.site.register(ownershipItemArmor) admin.site.register(OwnershipItemArmor)
admin.site.register(ownershipCharmMartialArt) admin.site.register(OwnershipCharmMartialArt)
admin.site.register(ownershipCharmEvocation) admin.site.register(OwnershipCharmEvocation)
admin.site.register(ownershipCharmSolar) admin.site.register(OwnershipCharmSolar)
admin.site.register(ownershipCharmLunar) admin.site.register(OwnershipCharmLunar)
admin.site.register(ownershipCharmLunarShape) admin.site.register(OwnershipCharmLunarShape)
admin.site.register(ownershipMerit) admin.site.register(OwnershipMerit)
admin.site.register(ownershipSpeciality) admin.site.register(OwnershipSpeciality)

View File

@ -0,0 +1,300 @@
# Generated by Django 3.0.5 on 2020-04-16 19:11
import app.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0002_auto_20200415_2109'),
]
operations = [
migrations.AlterField(
model_name='characterexaltbase',
name='characterbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterBase'),
),
migrations.AlterField(
model_name='characterexaltlunar',
name='characterexaltbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterExaltBase'),
),
migrations.AlterField(
model_name='characterexaltsolar',
name='characterexaltbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterExaltBase'),
),
migrations.AlterField(
model_name='charactermortal',
name='characterbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharacterBase'),
),
migrations.AlterField(
model_name='charmbase',
name='effectbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
),
migrations.AlterField(
model_name='charmevocation',
name='charmbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
),
migrations.AlterField(
model_name='charmevocation',
name='key',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.ItemBase', verbose_name='Artifact'),
),
migrations.AlterField(
model_name='charmlunar',
name='charmbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
),
migrations.AlterField(
model_name='charmlunarshape',
name='charmbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
),
migrations.AlterField(
model_name='charmmartialart',
name='charmbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
),
migrations.AlterField(
model_name='charmsolar',
name='charmbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.CharmBase'),
),
migrations.AlterField(
model_name='effectbase',
name='modifiers',
field=app.models.NamedManyToManyField(blank=True, to='app.ModifierBase', verbose_name='Modifiers'),
),
migrations.AlterField(
model_name='effectbase',
name='rollConfiguration',
field=app.models.NamedManyToManyField(blank=True, to='app.RollConfiguration', verbose_name='Roll Configurations'),
),
migrations.AlterField(
model_name='intimacybase',
name='character',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='intimacy_set', to='app.CharacterBase', verbose_name='Character'),
),
migrations.AlterField(
model_name='intimacyprincipal',
name='intimacybase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.IntimacyBase'),
),
migrations.AlterField(
model_name='intimacytie',
name='intimacybase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.IntimacyBase'),
),
migrations.AlterField(
model_name='item',
name='itembase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
),
migrations.AlterField(
model_name='itemarmor',
name='itembase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
),
migrations.AlterField(
model_name='itemweaponbase',
name='itembase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemBase'),
),
migrations.AlterField(
model_name='itemweaponbase',
name='tags',
field=app.models.MultiChoiceField(blank=True, choices=[('General', (('One Handed', 'One Handed'), ('Two Handed', 'Two Handed'), ('Bashing', 'Bashing'), ('Concealable', 'Concealable'), ('Lethal', 'Lethal'), ('Mounted', 'Mounted'), ('Piercing', 'Piercing'), ('Special', 'Special'))), ('Melee', (('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'))), ('Thrown', (('Thrown', 'Thrown'), ('Occult', 'Occult'), ('Cutting', 'Cutting'), ('Poisonable', 'Poisonable'), ('Subtle', 'Subtle'))), ('Archery', (('Archery', 'Archery'), ('Crossbow', 'Crossbow'), ('Flame', 'Flame'), ('Powerful', 'Powerful'), ('Slow', 'Slow')))], max_length=100, verbose_name='Tags'),
),
migrations.AlterField(
model_name='itemweaponmelee',
name='itemweaponbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemWeaponBase'),
),
migrations.AlterField(
model_name='itemweaponranged',
name='itemweaponbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ItemWeaponBase'),
),
migrations.AlterField(
model_name='merit',
name='effectbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
),
migrations.AlterField(
model_name='modifierability',
name='modifierbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
),
migrations.AlterField(
model_name='modifierattribute',
name='modifierbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
),
migrations.AlterField(
model_name='modifierstatic',
name='modifierbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.ModifierBase'),
),
migrations.AlterField(
model_name='ownershipcharmevocation',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmEvocation_set', to='app.CharacterExaltBase', verbose_name='Exalted Owner'),
),
migrations.AlterField(
model_name='ownershipcharmevocation',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipcharmevocation',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmEvocationTarget_set', to='app.CharmEvocation', verbose_name='Evocation'),
),
migrations.AlterField(
model_name='ownershipcharmlunar',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunar_set', to='app.CharacterExaltLunar', verbose_name='Lunar Exalted Owner'),
),
migrations.AlterField(
model_name='ownershipcharmlunar',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipcharmlunar',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarTarget_set', to='app.CharmLunar', verbose_name='Lunar Charm'),
),
migrations.AlterField(
model_name='ownershipcharmlunarshape',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarShape_set', to='app.CharacterExaltLunar', verbose_name='Lunar Exalted Owner'),
),
migrations.AlterField(
model_name='ownershipcharmlunarshape',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipcharmlunarshape',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmLunarShapeTarget_set', to='app.CharmLunarShape', verbose_name='Lunar Shape'),
),
migrations.AlterField(
model_name='ownershipcharmmartialart',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmMartialArt_set', to='app.CharacterExaltBase', verbose_name='Exalted Owner'),
),
migrations.AlterField(
model_name='ownershipcharmmartialart',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipcharmmartialart',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmMartialArtTarget_set', to='app.CharmMartialArt', verbose_name='Martial Arts Charm'),
),
migrations.AlterField(
model_name='ownershipcharmsolar',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmSolar_set', to='app.CharacterExaltSolar', verbose_name='Solar Exalted Owner'),
),
migrations.AlterField(
model_name='ownershipcharmsolar',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipcharmsolar',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipCharmSolarTarget_set', to='app.CharmSolar', verbose_name='Solar Charm'),
),
migrations.AlterField(
model_name='ownershipitem',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItem_set', to='app.CharacterBase', verbose_name='Owner'),
),
migrations.AlterField(
model_name='ownershipitem',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipitem',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemTarget_set', to='app.Item', verbose_name='Item'),
),
migrations.AlterField(
model_name='ownershipitemarmor',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemArmor_set', to='app.CharacterBase', verbose_name='Owner'),
),
migrations.AlterField(
model_name='ownershipitemarmor',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipitemarmor',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemArmorTarget_set', to='app.ItemArmor', verbose_name='Armor'),
),
migrations.AlterField(
model_name='ownershipitemweapon',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemWeapon_set', to='app.CharacterBase', verbose_name='Owner'),
),
migrations.AlterField(
model_name='ownershipitemweapon',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipitemweapon',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipItemWeaponTarget_set', to='app.ItemWeaponBase', verbose_name='Weapon'),
),
migrations.AlterField(
model_name='ownershipmerit',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipMerit_set', to='app.CharacterBase', verbose_name='Owner'),
),
migrations.AlterField(
model_name='ownershipmerit',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipmerit',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipMeritTarget_set', to='app.Merit', verbose_name='Merit'),
),
migrations.AlterField(
model_name='ownershipspeciality',
name='owner',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipSpeciality_set', to='app.CharacterBase', verbose_name='Owner'),
),
migrations.AlterField(
model_name='ownershipspeciality',
name='ownershipbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.OwnershipBase'),
),
migrations.AlterField(
model_name='ownershipspeciality',
name='target',
field=app.models.NamedForeignKeyField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ownershipSpecialityTarget_set', to='app.Speciality', verbose_name='Speciality'),
),
migrations.AlterField(
model_name='speciality',
name='effectbase_ptr',
field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.EffectBase'),
),
]

View File

@ -330,7 +330,7 @@ class NamedOneToOneField(models.OneToOneField):
#==============================================================================# #==============================================================================#
#-------------------------------- DICE ROLLING --------------------------------# #-------------------------------- DICE ROLLING --------------------------------#
#==============================================================================# #==============================================================================#
class rollConfiguration(PolymorphicModel): class RollConfiguration(PolymorphicModel):
def __str__(self): def __str__(self):
return self.name return self.name
name = NameField() name = NameField()
@ -397,22 +397,22 @@ class rollConfiguration(PolymorphicModel):
#==============================================================================# #==============================================================================#
#--------------------------------- MODIFIERS ----------------------------------# #--------------------------------- MODIFIERS ----------------------------------#
#==============================================================================# #==============================================================================#
class modifierBase(PolymorphicModel): class ModifierBase(PolymorphicModel):
value = NamedIntegerField("Modifier Value") value = NamedIntegerField("Modifier Value")
class modifierAttribute(modifierBase): class ModifierAttribute(ModifierBase):
def __str__(self): def __str__(self):
return "{} [{}]".format(self.keyword, self.value) return "{} [{}]".format(self.keyword, self.value)
keyword = SingleChoiceField("Attribute", ATTRIBUTES) keyword = SingleChoiceField("Attribute", ATTRIBUTES)
class modifierAbility(modifierBase): class ModifierAbility(ModifierBase):
def __str__(self): def __str__(self):
return "{} [{}]".format(self.keyword, self.value) return "{} [{}]".format(self.keyword, self.value)
keyword = SingleChoiceField("Ability", ABILITIES) keyword = SingleChoiceField("Ability", ABILITIES)
class modifierStatic(modifierBase): class ModifierStatic(ModifierBase):
def __str__(self): def __str__(self):
return "{} [{}]".format(self.keyword, self.value) return "{} [{}]".format(self.keyword, self.value)
@ -421,7 +421,7 @@ class modifierStatic(modifierBase):
#==============================================================================# #==============================================================================#
#--------------------------------- CHARACTERS ---------------------------------# #--------------------------------- CHARACTERS ---------------------------------#
#==============================================================================# #==============================================================================#
class characterBase(PolymorphicModel): class CharacterBase(PolymorphicModel):
def __str__(self): def __str__(self):
return self.name return self.name
@ -970,7 +970,11 @@ class characterBase(PolymorphicModel):
def disengage(self, mod=0): def disengage(self, mod=0):
return mod + self.attributeDexterity() + self.abilityDodge() + self.effectModifier("DISENGAGE") return mod + self.attributeDexterity() + self.abilityDodge() + self.effectModifier("DISENGAGE")
class characterExaltBase(characterBase): class CharacterMortal(CharacterBase):
def type(self):
return "Mortal"
class CharacterExaltBase(CharacterBase):
anima = models.CharField(verbose_name="Anima", max_length=100) anima = models.CharField(verbose_name="Anima", max_length=100)
#============= MOTES ==============# #============= MOTES ==============#
@ -1017,11 +1021,7 @@ class characterExaltBase(characterBase):
pass pass
return output return output
class characterMortal(characterBase): class CharacterExaltSolar(CharacterExaltBase):
def type(self):
return "Mortal"
class characterExaltSolar(characterExaltBase):
def type(self): def type(self):
return "Solar Exalt" return "Solar Exalt"
@ -1042,7 +1042,7 @@ class characterExaltSolar(characterExaltBase):
abilitySupernal = SingleChoiceField("Supernal Ability", ABILITIES) abilitySupernal = SingleChoiceField("Supernal Ability", ABILITIES)
abilityFavored = MultiChoiceField("Favoured Abilities", ABILITIES) abilityFavored = MultiChoiceField("Favoured Abilities", ABILITIES)
class characterExaltLunar(characterExaltBase): class CharacterExaltLunar(CharacterExaltBase):
def type(self): def type(self):
return "Lunar Exalt" return "Lunar Exalt"
@ -1078,20 +1078,20 @@ class characterExaltLunar(characterExaltBase):
#==============================================================================# #==============================================================================#
#----------------------------------- ITEMS ------------------------------------# #----------------------------------- ITEMS ------------------------------------#
#==============================================================================# #==============================================================================#
class itemBase(PolymorphicModel): class ItemBase(PolymorphicModel):
def __str__(self): def __str__(self):
return self.name return self.name
name = NameField() name = NameField()
description = DescriptionField() description = DescriptionField()
class item(itemBase): class Item(ItemBase):
pass pass
#==============================================================================# #==============================================================================#
#---------------------------------- WEAPONS -----------------------------------# #---------------------------------- WEAPONS -----------------------------------#
#==============================================================================# #==============================================================================#
class itemWeaponBase(itemBase): class ItemWeaponBase(ItemBase):
category = SingleChoiceField("Category", CATEGORIES) category = SingleChoiceField("Category", CATEGORIES)
tags = MultiChoiceField("Tags", TAGS_WEAPONS) tags = MultiChoiceField("Tags", TAGS_WEAPONS)
accuracy = NamedIntegerField("Accuracy") accuracy = NamedIntegerField("Accuracy")
@ -1100,7 +1100,7 @@ class itemWeaponBase(itemBase):
overwhelming = NamedIntegerField("Overwhelming") overwhelming = NamedIntegerField("Overwhelming")
attunement = NamedIntegerField("Attunement") attunement = NamedIntegerField("Attunement")
class itemWeaponMelee(itemWeaponBase): class ItemWeaponMelee(ItemWeaponBase):
def attack(self, ability, mod=0, withering=True): def attack(self, ability, mod=0, withering=True):
if withering: if withering:
return mod + ability + self.dexterity + weapon.accuracy return mod + ability + self.dexterity + weapon.accuracy
@ -1111,7 +1111,7 @@ class itemWeaponMelee(itemWeaponBase):
mod += sum([]) mod += sum([])
return mod + ceil((self.dexterity + ability) / 2) + weapon.defense return mod + ceil((self.dexterity + ability) / 2) + weapon.defense
class itemWeaponRanged(itemWeaponBase): class ItemWeaponRanged(ItemWeaponBase):
rangeClose = NamedIntegerField("Close Range") rangeClose = NamedIntegerField("Close Range")
rangeShort = NamedIntegerField("Short Range") rangeShort = NamedIntegerField("Short Range")
rangeMedium = NamedIntegerField("Medium Range") rangeMedium = NamedIntegerField("Medium Range")
@ -1139,7 +1139,7 @@ class itemWeaponRanged(itemWeaponBase):
#==============================================================================# #==============================================================================#
#----------------------------------- ARMOR ------------------------------------# #----------------------------------- ARMOR ------------------------------------#
#==============================================================================# #==============================================================================#
class itemArmor(itemBase): class ItemArmor(ItemBase):
category = SingleChoiceField("Category", CATEGORIES) category = SingleChoiceField("Category", CATEGORIES)
tags = MultiChoiceField("Tags", TAGS_ARMOR) tags = MultiChoiceField("Tags", TAGS_ARMOR)
soak = NamedIntegerField("Soak") soak = NamedIntegerField("Soak")
@ -1151,14 +1151,14 @@ class itemArmor(itemBase):
#---------------------------------- EFFECTS -----------------------------------# #---------------------------------- EFFECTS -----------------------------------#
#==============================================================================# #==============================================================================#
class effectBase(PolymorphicModel): class EffectBase(PolymorphicModel):
def __str__(self): def __str__(self):
return self.name return self.name
name = NameField() name = NameField()
description = DescriptionField() description = DescriptionField()
rollConfiguration = NamedManyToManyField("Roll Configurations", rollConfiguration) rollConfiguration = NamedManyToManyField("Roll Configurations", RollConfiguration)
modifiers = NamedManyToManyField("Modifiers", modifierBase) modifiers = NamedManyToManyField("Modifiers", ModifierBase)
def modifier(self, keyword): def modifier(self, keyword):
output = 0 output = 0
for modifier in self.modifiers.all(): for modifier in self.modifiers.all():
@ -1169,37 +1169,37 @@ class effectBase(PolymorphicModel):
#==============================================================================# #==============================================================================#
#----------------------------------- CHARMS -----------------------------------# #----------------------------------- CHARMS -----------------------------------#
#==============================================================================# #==============================================================================#
class charmBase(effectBase): class CharmBase(EffectBase):
levelEssence = NamedIntegerField("Essence Level") levelEssence = NamedIntegerField("Essence Level")
charmType = SingleChoiceField("Charm Type", CHARM_TYPES) charmType = SingleChoiceField("Charm Type", CHARM_TYPES)
duration = SingleChoiceField("Charm Duration", CHARM_DURATIONS) duration = SingleChoiceField("Charm Duration", CHARM_DURATIONS)
keywords = MultiChoiceField("Charm Keywords", CHARM_KEYWORDS) keywords = MultiChoiceField("Charm Keywords", CHARM_KEYWORDS)
class charmMartialArt(charmBase): class CharmMartialArt(CharmBase):
def type(self): def type(self):
return "Martial Art" return "Martial Art"
levelKey = NamedIntegerField("Martial Arts Level") levelKey = NamedIntegerField("Martial Arts Level")
key = None key = None
class charmEvocation(charmBase): class CharmEvocation(CharmBase):
def type(self): def type(self):
return "Evocation" return "Evocation"
levelKey = 0 levelKey = 0
key = NamedForeignKeyField("Artifact", itemBase) key = NamedForeignKeyField("Artifact", ItemBase)
class charmSolar(charmBase): class CharmSolar(CharmBase):
def type(self): def type(self):
return "Solar" return "Solar"
levelKey = NamedIntegerField("Ability Level") levelKey = NamedIntegerField("Ability Level")
key = SingleChoiceField("Key Ability", ABILITIES) key = SingleChoiceField("Key Ability", ABILITIES)
class charmLunar(charmBase): class CharmLunar(CharmBase):
def type(self): def type(self):
return "Lunar" return "Lunar"
levelKey = NamedIntegerField("Attribute Level") levelKey = NamedIntegerField("Attribute Level")
key = SingleChoiceField("Key Attribute", ATTRIBUTES) key = SingleChoiceField("Key Attribute", ATTRIBUTES)
class charmLunarShape(charmBase): class CharmLunarShape(CharmBase):
levelKey = 0 levelKey = 0
def type(self): def type(self):
return "Lunar Shape" return "Lunar Shape"
@ -1210,7 +1210,7 @@ class charmLunarShape(charmBase):
#==============================================================================# #==============================================================================#
#----------------------------------- MERITS -----------------------------------# #----------------------------------- MERITS -----------------------------------#
#==============================================================================# #==============================================================================#
class merit(effectBase): class Merit(EffectBase):
dots = DotField("Dots") dots = DotField("Dots")
def dotsDisplay(self): def dotsDisplay(self):
output = [] output = []
@ -1223,62 +1223,62 @@ class merit(effectBase):
#==============================================================================# #==============================================================================#
#-------------------------------- SPECIALITIES --------------------------------# #-------------------------------- SPECIALITIES --------------------------------#
#==============================================================================# #==============================================================================#
class speciality(effectBase): class Speciality(EffectBase):
pass pass
#==============================================================================# #==============================================================================#
#--------------------------------- INTIMACIES ---------------------------------# #--------------------------------- INTIMACIES ---------------------------------#
#==============================================================================# #==============================================================================#
class intimacyBase(PolymorphicModel): class IntimacyBase(PolymorphicModel):
def __str__(self): def __str__(self):
return "[{}] {}".format(self.description, self.intensity) return "[{}] {}".format(self.description, self.intensity)
description = DescriptionField() description = DescriptionField()
intensity = SingleChoiceField("Intensity", INTENSITIES) intensity = SingleChoiceField("Intensity", INTENSITIES)
character = NamedForeignKeyField("Character", characterBase, related_name="intimacy_set") character = NamedForeignKeyField("Character", CharacterBase, related_name="intimacy_set")
class intimacyTie(intimacyBase): class IntimacyTie(IntimacyBase):
target = NamedCharField("Target") target = NamedCharField("Target")
class intimacyPrincipal(intimacyBase): class IntimacyPrincipal(IntimacyBase):
pass pass
#==============================================================================# #==============================================================================#
#--------------------------------- OWNERSHIP ----------------------------------# #--------------------------------- OWNERSHIP ----------------------------------#
#==============================================================================# #==============================================================================#
class ownershipBase(PolymorphicModel): class OwnershipBase(PolymorphicModel):
notes = models.TextField(verbose_name="Notes", blank=True) notes = models.TextField(verbose_name="Notes", blank=True)
active = NamedBooleanField("Active/Equipped?") active = NamedBooleanField("Active/Equipped?")
class ownershipItem(ownershipBase): class OwnershipItem(OwnershipBase):
target = NamedForeignKeyField("Item", item, related_name="ownershipItemTarget_set") target = NamedForeignKeyField("Item", Item, related_name="ownershipItemTarget_set")
owner = NamedForeignKeyField("Owner", characterBase, related_name="ownershipItem_set") owner = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipItem_set")
class ownershipItemWeapon(ownershipBase): class OwnershipItemWeapon(OwnershipBase):
target = NamedForeignKeyField("Weapon", itemWeaponBase, related_name="ownershipItemWeaponTarget_set") target = NamedForeignKeyField("Weapon", ItemWeaponBase, related_name="ownershipItemWeaponTarget_set")
owner = NamedForeignKeyField("Owner", characterBase, related_name="ownershipItemWeapon_set") owner = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipItemWeapon_set")
class ownershipItemArmor(ownershipBase): class OwnershipItemArmor(OwnershipBase):
target = NamedForeignKeyField("Armor", itemArmor, related_name="ownershipItemArmorTarget_set") target = NamedForeignKeyField("Armor", ItemArmor, related_name="ownershipItemArmorTarget_set")
owner = NamedForeignKeyField("Owner", characterBase, related_name="ownershipItemArmor_set") owner = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipItemArmor_set")
class ownershipCharmMartialArt(ownershipBase): class OwnershipCharmMartialArt(OwnershipBase):
target = NamedForeignKeyField("Martial Arts Charm", charmMartialArt, related_name="ownershipCharmMartialArtTarget_set") target = NamedForeignKeyField("Martial Arts Charm", CharmMartialArt, related_name="ownershipCharmMartialArtTarget_set")
owner = NamedForeignKeyField("Exalted Owner", characterExaltBase, related_name="ownershipCharmMartialArt_set") owner = NamedForeignKeyField("Exalted Owner", CharacterExaltBase, related_name="ownershipCharmMartialArt_set")
class ownershipCharmEvocation(ownershipBase): class OwnershipCharmEvocation(OwnershipBase):
target = NamedForeignKeyField("Evocation", charmEvocation, related_name="ownershipCharmEvocationTarget_set") target = NamedForeignKeyField("Evocation", CharmEvocation, related_name="ownershipCharmEvocationTarget_set")
owner = NamedForeignKeyField("Exalted Owner", characterExaltBase, related_name="ownershipCharmEvocation_set") owner = NamedForeignKeyField("Exalted Owner", CharacterExaltBase, related_name="ownershipCharmEvocation_set")
class ownershipCharmSolar(ownershipBase): class OwnershipCharmSolar(OwnershipBase):
target = NamedForeignKeyField("Solar Charm", charmSolar, related_name="ownershipCharmSolarTarget_set") target = NamedForeignKeyField("Solar Charm", CharmSolar, related_name="ownershipCharmSolarTarget_set")
owner = NamedForeignKeyField("Solar Exalted Owner", characterExaltSolar, related_name="ownershipCharmSolar_set") owner = NamedForeignKeyField("Solar Exalted Owner", CharacterExaltSolar, related_name="ownershipCharmSolar_set")
class ownershipCharmLunar(ownershipBase): class OwnershipCharmLunar(OwnershipBase):
target = NamedForeignKeyField("Lunar Charm", charmLunar, related_name="ownershipCharmLunarTarget_set") target = NamedForeignKeyField("Lunar Charm", CharmLunar, related_name="ownershipCharmLunarTarget_set")
owner = NamedForeignKeyField("Lunar Exalted Owner", characterExaltLunar, related_name="ownershipCharmLunar_set") owner = NamedForeignKeyField("Lunar Exalted Owner", CharacterExaltLunar, related_name="ownershipCharmLunar_set")
class ownershipCharmLunarShape(ownershipBase): class OwnershipCharmLunarShape(OwnershipBase):
target = NamedForeignKeyField("Lunar Shape", charmLunarShape, related_name="ownershipCharmLunarShapeTarget_set") target = NamedForeignKeyField("Lunar Shape", CharmLunarShape, related_name="ownershipCharmLunarShapeTarget_set")
owner = NamedForeignKeyField("Lunar Exalted Owner", characterExaltLunar, related_name="ownershipCharmLunarShape_set") owner = NamedForeignKeyField("Lunar Exalted Owner", CharacterExaltLunar, related_name="ownershipCharmLunarShape_set")
class ownershipMerit(ownershipBase): class OwnershipMerit(OwnershipBase):
target = NamedForeignKeyField("Merit", merit, related_name="ownershipMeritTarget_set") target = NamedForeignKeyField("Merit", Merit, related_name="ownershipMeritTarget_set")
owner = NamedForeignKeyField("Owner", characterBase, related_name="ownershipMerit_set") owner = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipMerit_set")
class ownershipSpeciality(ownershipBase): class OwnershipSpeciality(OwnershipBase):
target = NamedForeignKeyField("Speciality", speciality, related_name="ownershipSpecialityTarget_set") target = NamedForeignKeyField("Speciality", Speciality, related_name="ownershipSpecialityTarget_set")
owner = NamedForeignKeyField("Owner", characterBase, related_name="ownershipSpeciality_set") owner = NamedForeignKeyField("Owner", CharacterBase, related_name="ownershipSpeciality_set")

View File

@ -7,5 +7,5 @@ class HomePageView(TemplateView):
template_name = "home.html" template_name = "home.html"
class CharacterDetailView(DetailView): class CharacterDetailView(DetailView):
model = characterBase model = CharacterBase
template_name = "characterDetail.html" template_name = "characterDetail.html"