@maka/maka-cli 5.150.0 → 5.151.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maka/maka-cli",
3
- "version": "5.150.0",
3
+ "version": "5.151.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.",
@@ -66,6 +66,30 @@ export class LookCommand extends Command {
66
66
  return this.inspectItem(carried.name, this.actor.inventory);
67
67
  }
68
68
  }
69
+ // AN EXACT NAME BEATS A FUZZY ITEM SUBSTRING (Sjjy52mjSqSdjFGdg:
70
+ // "look Jo" resolved to "Certified Credstick (job payments)" --
71
+ // Inventory.resolveKey does deliberately generous substring
72
+ // matching for item-name typos ("jo" sits inside "job payments"),
73
+ // and that ran before the room's actor list was ever consulted.
74
+ // A present person's EXACT name is a far stronger signal than an
75
+ // incidental item substring, so it wins first; an inexact query
76
+ // still falls through to the item/direction ladder below exactly
77
+ // as before.
78
+ // AN EXACT NAME BEATS A FUZZY ITEM SUBSTRING (Sjjy52mjSqSdjFGdg:
79
+ // "look Jo" resolved to "Certified Credstick (job payments)" --
80
+ // Inventory.resolveKey does deliberately generous substring
81
+ // matching for item-name typos ("jo" sits inside "job payments"),
82
+ // and that ran before the room's actor list was ever consulted.
83
+ // A present person's EXACT name is a far stronger signal than an
84
+ // incidental item substring, so it wins first; an inexact query
85
+ // still falls through to the item/direction ladder below exactly
86
+ // as before.
87
+ const exactActorMatch = this.scene
88
+ .getActorsInRoom(this.actor.currentLocation)
89
+ .find(a => a.name.toLowerCase() === target.toLowerCase() && this.actor.canPerceive(a));
90
+ if (exactActorMatch) {
91
+ return this.inspectActor(exactActorMatch.name);
92
+ }
69
93
  if (this.actor.inventory.hasItem(target)) {
70
94
  this.logger.write(`Looking at item '${target}' in ${this.actor.name} inventory.`);
71
95
  return this.inspectItem(target, this.actor.inventory);
@@ -79,14 +103,9 @@ export class LookCommand extends Command {
79
103
  return this.lookOutside(target);
80
104
  }
81
105
  else {
82
- // Check if it's another player or NPC in the room (that this
83
- // actor's plane can perceive -- see Player.canPerceive)
84
- const actorMatch = this.scene
85
- .getActorsInRoom(this.actor.currentLocation)
86
- .find(a => a.name.toLowerCase() === target.toLowerCase() && this.actor.canPerceive(a));
87
- if (actorMatch) {
88
- return this.inspectActor(actorMatch.name);
89
- }
106
+ // The exact-name actor check above already covers a present
107
+ // person; reaching here means the target is neither an item,
108
+ // a direction, nor anyone in the room by that exact name.
90
109
  return `You cannot see ${target}`;
91
110
  }
92
111
  }
@@ -88,6 +88,10 @@ export class TakeCommand extends Command {
88
88
  taken.push(item.name);
89
89
  }
90
90
  }
91
+ // Same durable-change rule as the loose-floor pickups below
92
+ // (RKLbzxQQRJk8eD8Az) -- only when something actually moved.
93
+ if (taken.length > 0)
94
+ this.game?.requestSave('take');
91
95
  const lines = [taken.length > 0 ? `${prefix}You take ${taken.join(', ')} from the ${container.name}.` : `${prefix}You take nothing from the ${container.name}.`, ...left];
92
96
  return lines.join('\n');
93
97
  }
@@ -100,6 +104,7 @@ export class TakeCommand extends Command {
100
104
  if (!container.inventory.transferItemTo(item.name.toLowerCase(), this.actor.inventory)) {
101
105
  return `${prefix}You can't lift the ${item.name} right now.`;
102
106
  }
107
+ this.game?.requestSave('take');
103
108
  this.actor.performAction('takes', `${item.name} from the ${container.name}`);
104
109
  return `${prefix}You take the ${item.name} from the ${container.name}.`;
105
110
  }
@@ -223,6 +228,14 @@ export class TakeCommand extends Command {
223
228
  }
224
229
  if (tookAnything) {
225
230
  this.scene.updateInventory(this.scene.getPlayer().inventory);
231
+ // A PICKUP IS A DURABLE CHANGE (RKLbzxQQRJk8eD8Az: "I picked up
232
+ // the 'Ferret's ledger Service Log', but I don't see it reflected
233
+ // in the character sheet"). buy.ts's own fix comment named this
234
+ // file as a sibling that never learned the lesson (vR8ajvm3wXdexxdF2)
235
+ // -- the web sheet reads the last SAVED snapshot, and nothing here
236
+ // ever asked for one, so a swept haul sat invisible until the next
237
+ // unrelated save beat (homecoming, rest, a trade).
238
+ this.game?.requestSave('take');
226
239
  }
227
240
  // Win-condition checks run AFTER the sweep summary renders: the check
228
241
  // logs the JOB COMPLETE banner itself, and running it per-item used to
@@ -363,6 +376,15 @@ export class TakeCommand extends Command {
363
376
  room.inventory.removeItem(itemName);
364
377
  room.plainSightItems.delete(item.name.toLowerCase());
365
378
  this.logger.write(`Successfully removed "${itemName}" from ${room.name} room's inventory during 'Take' command.`);
379
+ // A PICKUP IS A DURABLE CHANGE (RKLbzxQQRJk8eD8Az: "I picked up
380
+ // the 'Ferret's ledger Service Log', but I don't see it reflected
381
+ // in the character sheet"). buy.ts's own fix comment named this
382
+ // file as a sibling that never learned the lesson (vR8ajvm3wXdexxdF2)
383
+ // -- the web sheet reads the last SAVED snapshot, and nothing here
384
+ // ever asked for one. Placed after the item has actually changed
385
+ // hands (the try's own catch below handles a too-heavy rollback
386
+ // before this line is ever reached), same rule as buy.ts/unequip.ts.
387
+ this.game?.requestSave('take');
366
388
  // Possession-based win condition: if some OTHER actor ends up with
367
389
  // the item the win condition's target NPC wants, that counts just as
368
390
  // much as the player handing it over directly (emergent delivery).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maka/maka-cli",
3
- "version": "5.150.0",
3
+ "version": "5.151.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.",