Fix location share
This commit is contained in:
parent
77f74ccb08
commit
5f168fc067
3 changed files with 13 additions and 11 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue