From: xangelo Date: Wed, 13 Mar 2024 17:32:53 +0000 (-0400) Subject: fix: give players max vigor on character creation X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=d0a0de2de9e92c17e2da7b7ee855abbf2ca50da4;p=risinglegends.git fix: give players max vigor on character creation --- diff --git a/src/server/player.ts b/src/server/player.ts index b957969..82118e1 100644 --- a/src/server/player.ts +++ b/src/server/player.ts @@ -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 { 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('*'); const player = res.pop();