1 import {Biome, MonsterType} from '@prisma/client';
2 import { prisma } from '../../src/lib/db';
7 monster_type: [MonsterType.BEAST],
12 time: [{min: 0, max: 30}]
17 time: [{min: 0, max: 24}]
22 time: [{min: 0, max: 24}]
28 monster_type: [MonsterType.FLYING],
33 time: [{min: 0, max: 4}, {min: 20, max: 24}]
38 time: [{min: 0, max: 4}, {min: 20, max: 24}]
43 time: [{min: 0, max: 4}, {min: 20, max: 24}]
49 monster_type: [MonsterType.BEAST],
54 time: [{min: 0, max: 29}]
59 time: [{min: 0, max: 24}]
64 time: [{min: 0, max: 24}]
70 monster_type: [MonsterType.HUMANOID],
75 time: [{min: 0, max: 5}, {min: 16, max: 24}]
80 time: [{min: 0, max: 5}, {min: 16, max: 24}]
85 time: [{min: 0, max: 5}, {min: 16, max: 24}]
91 monster_type: [MonsterType.HUMANOID],
96 time: [{min: 0, max: 5}, {min: 18, max: 24}]
101 time: [{min: 0, max: 5}, {min: 16, max: 24}]
106 time: [{min: 0, max: 5}, {min: 16, max: 24}]
112 monster_type: [MonsterType.INSECT],
117 time: [{min: 8, max: 15}]
122 time: [{min: 8, max: 17}]
128 monster_type: [MonsterType.UNDEAD],
133 time: [{min: 19, max: 24}, {min: 0, max: 3}]
136 type: Biome.WOODLAND,
138 time: [{min: 19, max: 24}, {min: 0, max: 3}]
144 monster_type: [MonsterType.HUMANOID, MonsterType.BEAST],
147 type: Biome.WOODLAND,
149 time: [{min: 0, max: 24}]
154 name: "Giant Scorpion",
155 monster_type: [MonsterType.INSECT, MonsterType.GIANT],
160 time: [{min: 0, max: 24}]
166 onster_type: [MonsterType.BEAST],
169 type: Biome.MOUNTAIN,
171 time: [{min: 0, max: 24}]
176 time: [{min: 0, max: 24}]
182 monster_type: [MonsterType.BEAST],
185 type: Biome.MOUNTAIN,
187 time: [{min: 0, max: 24}]
192 time: [{min: 0, max: 24}]
198 monster_type: [MonsterType.HUMANOID],
201 type: Biome.MOUNTAIN,
203 time: [{min: 0, max: 4}, {min: 20, max: 24}]
208 time: [{min: 0, max: 4}, {min: 20, max: 24}]
215 // wipe all monsters!
216 export async function down() {
217 await prisma.fight.deleteMany();
218 await prisma.monsterBiome.deleteMany();
219 await prisma.monster.deleteMany();
222 export async function up() {
223 monsterList.forEach(async monster => {
224 const createdMonster = await prisma.monster.create({
227 monsterType: monster.monster_type
231 await prisma.monsterBiome.createMany({
232 data: monster.availability.map(availability => {
234 biome: availability.type,
235 monsterId: createdMonster.id,
236 weight: availability.weight,
237 time: availability.time