diff --git a/src/modules/game/game.ts b/src/modules/game/game.ts
index 495a904..31eb125 100644
--- a/src/modules/game/game.ts
+++ b/src/modules/game/game.ts
@@ -113,7 +113,7 @@ const onStatus = (_text: string, roomId: string, sender: string) => {
Race: ${race.name}
Location: ${location.name}
Level: ${level.level} - ${level.experienceInLevel}/${level.experienceToNextLevel} exp
- Health: ${entity.health}/${getMaxHealth(entity)} (${getHealthPercentage(entity)}%)
+ Health: ${entity.health.toFixed(0)}/${getMaxHealth(entity)} (${getHealthPercentage(entity).toFixed(0)}%)
Vitality: ${entity.vitality}
Strength: ${entity.strength}
Endurance: ${entity.endurance}
@@ -143,7 +143,7 @@ const onInventory = (text: string, roomId: string, sender: string) => {
const totalStats = getTotalStats(item);
const mapDamage = (stat: IStat): string => {
- return `Damage type: ${stat.damageType}Damage: ${stat.damage}`;
+ return `Damage type: ${stat.damageType}Damage: ${stat.damage.toFixed(0)}`;
};
const mapAbility = (stat: IStat): string => {
@@ -160,8 +160,8 @@ const onInventory = (text: string, roomId: string, sender: string) => {
Value: ${item.value}
Type: ${item.type}
Rarity: ${item.rarity}
- Total damage: ${totalStats.damage}
- Total defence: ${totalStats.defense}
+ Total damage: ${totalStats.damage.toFixed(0)}
+ Total defence: ${totalStats.defense.toFixed(0)}
Damage:
@@ -201,10 +201,10 @@ const onLocation = (_text: string, roomId: string, sender: string) => {
"",
`Location info:
- - X: ${location.X}
- - Y: ${location.Y}
- Location Name: ${location.name}
- Location Description: ${location.description}
+ - Local X: ${location.X}
+ - Local Y: ${location.Y}
`,
);
};
diff --git a/src/services/game/entity.ts b/src/services/game/entity.ts
index 49305c3..b5ba05b 100644
--- a/src/services/game/entity.ts
+++ b/src/services/game/entity.ts
@@ -97,7 +97,9 @@ const getNpc = (id: NPC): INPC => {
};
const getNpcByName = (name: string): INPC => {
- const npc = npcs.find((npc) => npc.id === name);
+ const npc = npcs.find(
+ (npc) => npc.name.toLowerCase() === name.toLowerCase(),
+ );
return npc ? npc : npcBecky;
};
@@ -155,16 +157,16 @@ const getLevel = (experience: number): ILevel => {
};
const getMaxHealth = (entity: IEntity): number => {
- return entity.vitality * 10;
+ return 100 + entity.vitality * 10;
};
const getHealthPercentage = (entity: IPlayer | INPC): number => {
if ("health" in entity) {
- return entity.health / getMaxHealth(entity);
+ return (entity.health / getMaxHealth(entity)) * 100;
}
const npcData = getNpcData(entity.id);
- return npcData.health / getMaxHealth(entity);
+ return (npcData.health / getMaxHealth(entity)) * 100;
};
const getSpeed = (entity: IEntity) => {
diff --git a/src/services/game/structures/entities.ts b/src/services/game/structures/entities.ts
index 12bd594..c3fdec7 100644
--- a/src/services/game/structures/entities.ts
+++ b/src/services/game/structures/entities.ts
@@ -75,7 +75,7 @@ export const npcBecky: INPC = {
export const npcTato: INPC = {
id: NPC.TATO,
name: "Tato",
- description: "A ",
+ description: "A drunk troll",
race: Race.TROLL,
location: Location.HIGHMERE_TAVERN,
inventory: {