@maka/maka-cli 5.390.0 → 5.392.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/bundle/typescript/package.json +1 -1
  2. package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js +1 -1
  3. package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +60 -1
  4. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +1 -1
  5. package/bundle/typescript/src/commands/game/sideQuest/commands/breach.js +5 -2
  6. package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js +8 -2
  7. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +4 -2
  8. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +16 -150
  9. package/bundle/typescript/src/commands/game/sideQuest/commands/crack.js +76 -0
  10. package/bundle/typescript/src/commands/game/sideQuest/commands/disable.js +42 -6
  11. package/bundle/typescript/src/commands/game/sideQuest/commands/disarm.js +64 -0
  12. package/bundle/typescript/src/commands/game/sideQuest/commands/dispel.js +23 -46
  13. package/bundle/typescript/src/commands/game/sideQuest/commands/download.js +23 -6
  14. package/bundle/typescript/src/commands/game/sideQuest/commands/edit-file.js +15 -3
  15. package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +55 -17
  16. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +15 -1
  17. package/bundle/typescript/src/commands/game/sideQuest/commands/leap.js +23 -0
  18. package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +40 -0
  19. package/bundle/typescript/src/commands/game/sideQuest/commands/move.js +16 -15
  20. package/bundle/typescript/src/commands/game/sideQuest/commands/tap.js +13 -3
  21. package/bundle/typescript/src/commands/game/sideQuest/engine-version.js +17 -1
  22. package/bundle/typescript/src/commands/game/sideQuest/factories/authored-run.js +632 -0
  23. package/bundle/typescript/src/commands/game/sideQuest/factories/catalog-item-seed.js +78 -0
  24. package/bundle/typescript/src/commands/game/sideQuest/factories/job-order.js +7 -44
  25. package/bundle/typescript/src/commands/game/sideQuest/factories/repro-scene.js +8 -10
  26. package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js +12 -0
  27. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +30 -52
  28. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +112 -0
  29. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +123 -3
  30. package/bundle/typescript/src/commands/game/sideQuest/factories/seed-migration.js +52 -4
  31. package/bundle/typescript/src/commands/game/sideQuest/game.js +17 -4
  32. package/bundle/typescript/src/commands/game/sideQuest/models/camera.js +8 -0
  33. package/bundle/typescript/src/commands/game/sideQuest/models/device.js +14 -21
  34. package/bundle/typescript/src/commands/game/sideQuest/models/host.js +8 -0
  35. package/bundle/typescript/src/commands/game/sideQuest/models/item.js +14 -0
  36. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +62 -9
  37. package/bundle/typescript/src/commands/game/sideQuest/models/player.js +11 -0
  38. package/bundle/typescript/src/commands/game/sideQuest/models/room.js +141 -3
  39. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +3 -0
  40. package/bundle/typescript/src/commands/game/sideQuest/utilities/affordances.js +18 -11
  41. package/bundle/typescript/src/commands/game/sideQuest/utilities/alarmed-staff.js +3 -0
  42. package/bundle/typescript/src/commands/game/sideQuest/utilities/ar.js +4 -2
  43. package/bundle/typescript/src/commands/game/sideQuest/utilities/astral-move.js +7 -2
  44. package/bundle/typescript/src/commands/game/sideQuest/utilities/barrier-combat.js +1 -1
  45. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-turn.js +9 -0
  46. package/bundle/typescript/src/commands/game/sideQuest/utilities/district-plane.js +109 -27
  47. package/bundle/typescript/src/commands/game/sideQuest/utilities/door-watch.js +70 -0
  48. package/bundle/typescript/src/commands/game/sideQuest/utilities/falling.js +27 -0
  49. package/bundle/typescript/src/commands/game/sideQuest/utilities/file-guard.js +120 -0
  50. package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-names.js +10 -1
  51. package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-view.js +12 -3
  52. package/bundle/typescript/src/commands/game/sideQuest/utilities/host-combat.js +23 -5
  53. package/bundle/typescript/src/commands/game/sideQuest/utilities/ic.js +29 -2
  54. package/bundle/typescript/src/commands/game/sideQuest/utilities/ledge-jump.js +86 -0
  55. package/bundle/typescript/src/commands/game/sideQuest/utilities/map-view.js +2 -1
  56. package/bundle/typescript/src/commands/game/sideQuest/utilities/npc-combat-brain.js +29 -0
  57. package/bundle/typescript/src/commands/game/sideQuest/utilities/owner-guard.js +77 -0
  58. package/bundle/typescript/src/commands/game/sideQuest/utilities/path-run.js +4 -2
  59. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +3 -1
  60. package/bundle/typescript/src/commands/game/sideQuest/utilities/room-grid.js +66 -3
  61. package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.js +8 -1
  62. package/bundle/typescript/src/commands/game/sideQuest/utilities/spider.js +50 -0
  63. package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js +20 -6
  64. package/bundle/typescript/src/commands/game/sideQuest/utilities/surveillance.js +193 -8
  65. package/bundle/typescript/src/commands/game/sideQuest/utilities/use-target.js +1 -1
  66. package/bundle/typescript/src/commands/game/sideQuest/utilities/verb-index.js +2 -2
  67. package/bundle/typescript/src/commands/game/sideQuest/utilities/wards.js +116 -0
  68. package/package.json +1 -1
@@ -0,0 +1,116 @@
1
+ import { rollPool, formatRoll } from './dice.js';
2
+ import { astralLimit } from './limits.js';
3
+ import { pierces } from './barrier-geometry.js';
4
+ /** Does this room's ward stop this form? Not its creator, and not the
5
+ * form holding a pass it just pressed for. */
6
+ export function wardHolds(room, actor) {
7
+ if (!room?.warded)
8
+ return false;
9
+ if (room.wardCreator !== undefined && room.wardCreator === actor.name)
10
+ return false;
11
+ return actor.wardPass !== room.name;
12
+ }
13
+ /** The ward an astral form crosses going from one room to another --
14
+ * entering `to`'s, or leaving `from`'s -- or undefined. */
15
+ export function wardBetween(from, to, actor) {
16
+ if (from === to)
17
+ return undefined;
18
+ if (wardHolds(to, actor))
19
+ return to;
20
+ if (wardHolds(from, actor))
21
+ return from;
22
+ return undefined;
23
+ }
24
+ /**
25
+ * PRESS THROUGH (p.316): Magic + Charisma [Astral] v. Force x 2. Any net
26
+ * hits and the form is through -- it holds a pass for THIS ward until
27
+ * the crossing is made. A breach is something the creator knows (p.357).
28
+ */
29
+ export function pressThroughWard(scene, logger, actor, ward) {
30
+ const press = rollPool(actor.magic + actor.charisma, astralLimit(actor));
31
+ const hold = rollPool(ward.wardForce * 2);
32
+ const meta = `Press through the ward (p.316): Magic + Charisma ${formatRoll(press)} v. Force ${ward.wardForce} x 2 ${formatRoll(hold)}`;
33
+ if (press.hits - hold.hits <= 0) {
34
+ actor.performAction('is stopped by a ward', ward.name);
35
+ return { through: false, meta };
36
+ }
37
+ actor.wardPass = ward.name;
38
+ actor.performAction('presses through a ward', ward.name);
39
+ alertWard(scene, logger, ward, actor, 'breached');
40
+ return { through: true, meta };
41
+ }
42
+ /** Spend the pass once the crossing it bought is made. */
43
+ export function spendWardPass(actor) {
44
+ actor.wardPass = undefined;
45
+ }
46
+ /**
47
+ * THE CREATOR KNOWS (p.316, p.357): "will know when it has been
48
+ * breached, attacked, or destroyed and will inform whoever is to be
49
+ * contacted in the protected organization". The site goes on alert the
50
+ * way a tripped device puts it there; a creator on site hears it.
51
+ */
52
+ export function alertWard(scene, logger, ward, actor, how) {
53
+ scene.raiseAlarm(`the ward over ${ward.name} was ${how}`);
54
+ scene.addWorldEvent(`The ward over ${ward.name} was ${how} -- whoever raised it knows.`);
55
+ const creator = ward.wardCreator ? scene.getPlayers().find(p => p.name === ward.wardCreator) : undefined;
56
+ if (creator && creator !== actor) {
57
+ logger?.log(`Your ward over ${ward.name} has been ${how}${how === 'attacked' ? ` (${ward.wardDamage}/${ward.wardForce})` : ''} (p.316).`, { actor: creator.name });
58
+ }
59
+ }
60
+ /**
61
+ * HITTING A WARD from the astral (p.316, "Getting Around Mana Barriers"):
62
+ * the same unopposed shape as a mana barrier spell -- the attack's hits
63
+ * add to the DV, a DV that does not exceed Armor does nothing (p.197),
64
+ * the rest is resisted with Structure + Armor, both equal to the Force.
65
+ * Structure filled is a ward torn down, for the rest of the run.
66
+ */
67
+ export function resolveWardStrike(scene, logger, attacker, ward) {
68
+ const world = [];
69
+ const meta = [];
70
+ const force = ward.wardForce;
71
+ const profile = attacker.getWeaponProfile();
72
+ const roll = rollPool(attacker.getAttackPool(), attacker.getAttackLimit(null));
73
+ meta.push(`Attack on the ward over ${ward.name} (unopposed, p.197): ${formatRoll(roll)}`);
74
+ attacker.sneaking = false;
75
+ if (roll.criticalGlitch) {
76
+ world.push(`${attacker.name} goes for the ward over ${ward.name} -- and it goes catastrophically wrong.`);
77
+ return { world, meta, destroyed: false };
78
+ }
79
+ const dv = profile.damage + roll.hits;
80
+ const ap = profile.armorPen ?? 0;
81
+ meta.push(` DV ${profile.damage} + ${roll.hits} = ${dv} v. Armor ${force} (Force, p.316)`);
82
+ if (!pierces(dv, force, ap)) {
83
+ world.push(`${attacker.name} strikes the ward over ${ward.name} -- the lattice drinks it. Too weak to mark it (DV ${dv} against Armor ${force}, p.197).`);
84
+ alertWard(scene, logger, ward, attacker, 'attacked');
85
+ return { world, meta, destroyed: false };
86
+ }
87
+ const armor = Math.max(0, force + ap);
88
+ const soak = rollPool(force + armor);
89
+ const dealt = Math.max(0, dv - soak.hits);
90
+ meta.push(` Resist: Structure ${force} + Armor ${armor}: ${formatRoll(soak)} -- ${dealt} box${dealt === 1 ? '' : 'es'} through`);
91
+ ward.wardDamage += dealt;
92
+ logger.write(`${attacker.name} dealt ${dealt} boxes to the ward over ${ward.name} (${ward.wardDamage}/${force}).`);
93
+ if (ward.wardDamage < force) {
94
+ world.push(`${attacker.name} strikes the ward over ${ward.name} -- ${dealt > 0 ? `${dealt} box${dealt === 1 ? '' : 'es'}` : 'it holds, unmarked'}. (${ward.wardDamage}/${force})`);
95
+ alertWard(scene, logger, ward, attacker, 'attacked');
96
+ return { world, meta, destroyed: false };
97
+ }
98
+ ward.warded = false;
99
+ ward.wardDamage = 0;
100
+ world.push(`${attacker.name} tears the ward over ${ward.name} apart -- the lattice frays to nothing, and the astral there is open ground.`);
101
+ alertWard(scene, logger, ward, attacker, 'destroyed');
102
+ scene.addWorldEvent(`${attacker.name} brought down the ward over ${ward.name}.`);
103
+ return { world, meta, destroyed: true };
104
+ }
105
+ /** End of a Combat Turn: every standing ward is whole again (p.316). */
106
+ export function mendWards(rooms) {
107
+ const mended = [];
108
+ for (const r of rooms) {
109
+ if (!r.warded || r.wardDamage <= 0)
110
+ continue;
111
+ r.wardDamage = 0;
112
+ mended.push(r);
113
+ }
114
+ return mended;
115
+ }
116
+ //# sourceMappingURL=wards.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maka/maka-cli",
3
- "version": "5.390.0",
3
+ "version": "5.392.0",
4
4
  "type": "module",
5
5
  "summary": "A command line tool for scaffolding Meteor 3.x applications using either React.",
6
6
  "description": "A command line tool for scaffolding Meteor 3.x applications using React.",