-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic.py
216 lines (168 loc) · 4.6 KB
/
static.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#at the >>> prompt type the following:
#execfile("script.py")
"""
Little script to load basic data into database after the need to rebuild it.
"""
from elements.models import Faction, FactionLike, Origin, GuildCategory
from elements.models import Portrait
from elements.models import GeneralGameStats, Attribute, SkillCategory
# Main Factions
# Add Factions, origins
def add_factions():
#Input
allfactions = [
'Aramore---Flavortext',
'Harmstead---Flavortext',
'Solaris---Flavortext',
'Warnwick---Flavortext',
]
for faction in allfactions:
new = faction.split('---')
new_faction = Faction(
name = new[0],
flavor = new[1],
)
new_faction.save()
def add_faction_likes():
faction_standings = (
('Aramore', 'Harmstead', 'Solaris'),
('Solaris', 'Warnwick', 'Aramore'),
('Harmstead', 'Aramore', 'Warnwick'),
('Warnwick', 'Solaris', 'Harmstead'),
)
for fact_standing in faction_standings:
the_faction = Faction.objects.get(name=fact_standing[0])
faction_likes = Faction.objects.get(name=fact_standing[1])
faction_hates = Faction.objects.get(name=fact_standing[2])
likes = FactionLike(
faction = the_faction,
likes_faction = faction_likes,
hates_faction = faction_hates,
)
likes.save()
def add_origins():
allorigins = (
('Therino', 1, 'Flavortext'),
('Merri', 1, 'Flavortext'),
('Belwyn', 1, 'Flavortext'),
('Risbel', 1, 'Flavortext'),
('Lealom', 2, 'Flavortext'),
('Vesemm', 2,'Flavortext'),
('larangha', 2, 'Flavortext'),
('Hedgeki', 2, 'Flavortext'),
('Tainy', 3, 'Flavortext'),
('Poln', 3, 'Flavortext'),
('Etys', 3, 'Flavortext'),
('Torpol', 3, 'Flavortext'),
('Leraldo', 4, 'Flavortext'),
('Bany', 4, 'Flavortext'),
('Isaen', 4, 'Flavortext'),
('Igaro', 4, 'Flavortext'),
)
for origin in allorigins:
faction = Faction.objects.get(id=origin[1])
new_origin = Origin(
faction = faction,
name = origin[0],
flavor = origin[2]
)
new_origin.save()
# Add general game stats
def add_generalgamestats():
generalstats = GeneralGameStats(
#character statistics
maximum_characters = 3,
character_protection = 14,
default_attribute = 20,
minimum_attribute = 15,
maximum_attribute = 27,
# skills
basic_skill_points = 150,
default_multiplier = 2.3,
primary_multiplier = 1.2,
secundary_multiplier = 0.6,
#Reputation statistics
is_faction = 1.000,
likes_faction = 0.250,
hates_faction = -0.500,
)
generalstats.save()
def add_attributes():
allattributes = (
('Strength'),
('Constitution'),
('Dexterity'),
('Intelligence'),
('Wisdom'),
('Charisma'),
)
for attribute in allattributes:
new_attribute = Attribute(
name = attribute,
)
new_attribute.save()
#def add_portraits():
def add_portraits():
allportraits = (
('Ajantis', '/home/ikke/panda/realbuahto/media/ajantis.jpg'),
('Alora', '/home/ikke/panda/realbuahto/media/alora.jpg'),
('Branwen', '/home/ikke/panda/realbuahto/media/branwen.jpg'),
('Coran', '/home/ikke/panda/realbuahto/media/coran.jpg'),
('Dynaheir', '/home/ikke/panda/realbuahto/media/dynaheir.jpg'),
('Edwin', '/home/ikke/panda/realbuahto/media/edwin.jpg'),
('Eldoth', '/home/ikke/panda/realbuahto/media/eldoth.jpg'),
('Faldorn', '/home/ikke/panda/realbuahto/media/faldorn.jpg'),
('Garrick', '/home/ikke/panda/realbuahto/media/garrick.jpg'),
('Imoen', '/home/ikke/panda/realbuahto/media/imoen.jpg'),
)
for port in allportraits:
new_port = Portrait(
name = port[0],
portrait = port[1]
)
new_port.save()
# Add all guild categories
def add_guildcategories():
allcategories = [
'Combat',
'Logistics',
'Industry',
'Warfare',
]
for cate in allcategories:
new_category = GuildCategory(name=cate)
new_category.save()
def add_skillcategories():
all_categories = (
('Archery', 'flavor text'),
('Armor', 'flavor text'),
('Elixers', 'flavor text'),
('Endurance', 'flavor text'),
('Exploration', 'flavor text'),
('Guild Management', 'flavor text'),
('Mercenaries', 'flavor text'),
('Navigation', 'flavor text'),
('Production', 'flavor text'),
('Resource Processing', 'flavor text'),
('Science', 'flavor text'),
('Social', 'flavor text'),
('Tactics', 'flavor text'),
('Town management', 'flavor text'),
('Trade', 'flavor text'),
('Travel', 'flavor text'),
('Weapons', 'flavor text'),
)
for category in all_categories:
new_category = SkillCategory(
name=category[0],
flavor=category[1],
)
new_category.save()
add_factions()
add_faction_likes()
add_origins()
add_generalgamestats()
add_attributes()
add_guildcategories()
add_portraits()
add_skillcategories()