From a6391f961d0ceca995f191c1235c66269ce72e95 Mon Sep 17 00:00:00 2001 From: Hemithermos Date: Sat, 31 Jan 2026 18:06:15 +0100 Subject: [PATCH] rebalance armor and hp limits --- entities/entity.py | 6 +++--- server.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/entities/entity.py b/entities/entity.py index 96abb29..02f6c23 100644 --- a/entities/entity.py +++ b/entities/entity.py @@ -14,7 +14,7 @@ class Entity(Serializable): self.intelligence = 20 self.wisdom = 20 self.charisma = 20 - self.hp = 100 + self.hp = 20 self.armor = 100 self.speed = 100 @@ -65,7 +65,7 @@ class Entity(Serializable): def get_hp(self): if self.equipped_item and "hp" in self.equipped_item.stat_modifier.keys(): - return self.clamp(self.hp + self.equipped_item.stat_modifier["hp"], 0, 100) + return self.clamp(self.hp + self.equipped_item.stat_modifier["hp"], 0, 40) return self.clamp(self.hp, 0, 100) def get_armor(self): @@ -98,7 +98,7 @@ class Entity(Serializable): self.charisma = self.clamp(value, 0, 20) def set_hp(self, value:int): - self.hp = self.clamp(value, 0, 100) + self.hp = self.clamp(value, 0, 40) def set_armor(self, value:int): self.armor = self.clamp(value, 0, 100) diff --git a/server.py b/server.py index ae80d3b..852497a 100644 --- a/server.py +++ b/server.py @@ -306,7 +306,7 @@ async def toss_coin(): @mcp.tool() async def create_player(name: str, strength: int, dexterity: int, intelligence: int, wisdom: int, charisma: int, hp: int, armor: int, speed: int, item_id:str): """Create a new player. Need all the stats to function properly. Throw a d20 for every stats you don't have, - and a d50 for the armor and speed. + and a d50 for the armor and a d100 for speed. Args: name: Name of the player @@ -330,7 +330,7 @@ async def create_player(name: str, strength: int, dexterity: int, intelligence: charisma=charisma, hp=20 + hp, armor=50 + armor, - speed= 50 + speed, + speed= speed, equipped_item=game.get_item(item_id)) # Check if item exists game.add_item_to_entity(item_id=item_id, entity_id=player_id) player_dict = game.get_player(player_id=player_id).serialize() @@ -349,7 +349,7 @@ async def create_player(name: str, strength: int, dexterity: int, intelligence: @mcp.tool() async def create_npc(name: str, strength: int, dexterity: int, intelligence: int, wisdom: int, charisma: int, hp: int, armor: int, speed: int, item_id:str): """Create a new NPC. Need all the stats to function properly. Throw a d20 for every stats you don't have, - and a d50 for the armor and speed. + and a d50 for the armor and a d100 for speed. Args: name: Name of the NPC @@ -366,7 +366,7 @@ async def create_npc(name: str, strength: int, dexterity: int, intelligence: int logging.info(f"Creating NPC named {name}") try: item = game.get_item(item_id) # Check if item exists - npc_id = game.create_npc(name=name, strength=strength, dexterity=dexterity, intelligence=intelligence, wisdom=wisdom, charisma=charisma, hp=20 + hp, armor=50 + armor, speed=50 + speed, equipped_item=item) + npc_id = game.create_npc(name=name, strength=strength, dexterity=dexterity, intelligence=intelligence, wisdom=wisdom, charisma=charisma, hp=20 + hp, armor=50 + armor, speed= speed, equipped_item=item) game.add_item_to_entity(item_id=item_id, entity_id=npc_id) npc_dict = game.get_npc(npc_id=npc_id).serialize() logging.info(f"Creation of NPC successful")