Twerks
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import * as roll from "../utils/dice.js";
|
||||
import * as id from "../utils/id.js";
|
||||
import { Item } from "./item.js";
|
||||
|
||||
/**
|
||||
@@ -68,7 +66,7 @@ export class Character {
|
||||
/**
|
||||
* @param {string} name The name of the character
|
||||
*/
|
||||
constructor(name, initialize) {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ export class Game {
|
||||
const existing = this._itemBlueprints.get(blueprintId);
|
||||
|
||||
if (existing) {
|
||||
console.debug("we tried to create the same item blueprint more than once", blueprintId, attributes);
|
||||
console.warn("we tried to create the same item blueprint more than once", blueprintId, attributes);
|
||||
return existing;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export class ItemBlueprint extends ItemAttributes {
|
||||
|
||||
o.itemSlots = Number(o.itemSlots);
|
||||
|
||||
for (const [key, _] of Object.entries(this)) {
|
||||
for (const [key] in this) {
|
||||
if (o[key] !== "undefied") {
|
||||
this[key] = o[key];
|
||||
}
|
||||
|
||||
@@ -91,6 +91,13 @@ export class CharacterSeeder {
|
||||
c.rangedCombat = roll.d6() + 2;
|
||||
c.skulduggery = roll.d6() + 2;
|
||||
|
||||
this.applyAncestry(c);
|
||||
this.applyFoundation(c);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
applyAncestry(c) {
|
||||
let ancestryId = roll.d8();
|
||||
switch (ancestryId) {
|
||||
case 1:
|
||||
@@ -135,12 +142,6 @@ export class CharacterSeeder {
|
||||
default:
|
||||
throw new Error(`Logic error, ancestry d8() roll of ${ancestryId} was out of scope"`);
|
||||
}
|
||||
|
||||
this.applyFoundation(c);
|
||||
|
||||
console.debug(c);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,7 +234,7 @@ export class CharacterSeeder {
|
||||
// Skills
|
||||
this.addSkillsToCharacter(
|
||||
c, //
|
||||
":perk.two_weapons", // TODO: perks should be their own thing, and not a part of the skill system?
|
||||
":weapon.style.two_weapons",
|
||||
":armor.light",
|
||||
);
|
||||
|
||||
@@ -248,27 +249,40 @@ export class CharacterSeeder {
|
||||
":weapon.light.dagger",
|
||||
);
|
||||
break;
|
||||
case 4:
|
||||
case ":guard":
|
||||
c.foundation = "Guard";
|
||||
|
||||
//
|
||||
// Stats
|
||||
c.maxHitPoints = c.currentHitPoints = 15;
|
||||
c.meleeCombat = Math.max(c.meleeCombat, 10);
|
||||
c.magic = Math.min(c.magic, 10);
|
||||
|
||||
//
|
||||
// Skills
|
||||
this.addSkillsToCharacter(
|
||||
c, //
|
||||
":armor.medium",
|
||||
":weapon.weird.halberd",
|
||||
);
|
||||
|
||||
//
|
||||
// Gear
|
||||
c.silver = 50;
|
||||
c.itemSlots = 5;
|
||||
this.addItemsToCharacter(
|
||||
c, //
|
||||
":armor.medium.breastplate",
|
||||
":weapon.weird.halberd",
|
||||
":lighting.bulls_eye_lantern",
|
||||
":misc.signal_whistle",
|
||||
":maps.area.hvedstad",
|
||||
);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
||||
//
|
||||
//---------------------------------------------------------------------------------------
|
||||
//HEADLINE: Fencer
|
||||
//---------------------------------------------------------------------------------------
|
||||
| {counter:foundation}
|
||||
|
||||
|Fencer
|
||||
|
||||
|[unstyled]
|
||||
* Light Armor
|
||||
|
||||
|[unstyled]
|
||||
* Leather
|
||||
* Rapier
|
||||
* Dagger
|
||||
* 40 Silver Pieces
|
||||
|
||||
|[unstyled]
|
||||
|
||||
//
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
@@ -8,7 +8,7 @@ import { gGame } from "../models/globals.js";
|
||||
// |___|\__\___|_| |_| |_| |_|\___|_| |_| |_| .__/|_|\__,_|\__\___||___/
|
||||
// |_|
|
||||
//
|
||||
// Seed the Game.ItemBlueprint store
|
||||
|
||||
export class ItemSeeder {
|
||||
seed() {
|
||||
// __ __
|
||||
|
||||
41
test.js
Executable file → Normal file
41
test.js
Executable file → Normal file
@@ -1,17 +1,26 @@
|
||||
class Nugga {
|
||||
mufassa = 22;
|
||||
constructor() {
|
||||
this.fjæsing = 22;
|
||||
console.debug(Object.prototype.hasOwnProperty.call(this, "fjæsing"));
|
||||
let cnt = 0;
|
||||
|
||||
let val = Math.floor(Math.random() * 5);
|
||||
|
||||
switch (val) {
|
||||
case cnt++:
|
||||
console.log("zero");
|
||||
break;
|
||||
case cnt++:
|
||||
console.log("one");
|
||||
break;
|
||||
case cnt++:
|
||||
console.log("two");
|
||||
break;
|
||||
case cnt++:
|
||||
console.log("three");
|
||||
break;
|
||||
case cnt++:
|
||||
console.log("four");
|
||||
break;
|
||||
case cnt++:
|
||||
console.log("five");
|
||||
break;
|
||||
default:
|
||||
console.log("waaat", { val });
|
||||
}
|
||||
|
||||
diller(snaps = this.fjæsing) {
|
||||
console.log(snaps);
|
||||
}
|
||||
}
|
||||
|
||||
class Dugga extends Nugga {}
|
||||
|
||||
const n = new Dugga();
|
||||
|
||||
console.log(n, n.diller(), n instanceof Dugga);
|
||||
|
||||
Reference in New Issue
Block a user