rebalance armor and hp limits
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user