fix: give players max vigor on character creation
authorxangelo <me@xangelo.ca>
Wed, 13 Mar 2024 17:32:53 +0000 (13:32 -0400)
committerxangelo <me@xangelo.ca>
Wed, 13 Mar 2024 17:32:53 +0000 (13:32 -0400)
src/server/player.ts

index b9579698ab9fc9fa6a0eade540d0fd22886c4f4e..82118e19f5f219bbf362f1820294b8e1b0ad60ad 100644 (file)
@@ -1,5 +1,5 @@
 import { db } from './lib/db';
-import {Player, maxHp} from "../shared/player";
+import {Player, maxHp, maxVigor} from "../shared/player";
 import { random } from 'lodash';
 import { Skills } from '../shared/skills';
 import {Profession} from 'shared/profession';
@@ -64,9 +64,11 @@ export async function createPlayer(): Promise<Player> {
     constitution: random(3, 5),
     dexterity: random(3, 5),
     intelligence: random(3, 5),
+    stat_points: 4
   };
 
   raw.hp = maxHp(raw.constitution, 1);
+  raw.vigor = maxVigor(raw.constitution, 1);
 
   const res  = await db('players').insert(raw).returning<Player[]>('*');
   const player = res.pop();