deal damage now returns the damage amount dealt
change repercuted in server.py attack tool
This commit is contained in:
@@ -97,10 +97,11 @@ async def perform_attack(src_entity_id:str, target_entity_id:str, attack_type:St
|
||||
attack_type: The type of attack being performed using the class Stat, can be Stat.STRENGTH, Stat.INTELLIGENCE, Stat.DEXTERITY which are 0, 1 and 2 respectively
|
||||
"""
|
||||
logging.info(f"Entity {src_entity_id} is performing an attack on {target_entity_id} using {attack_type}")
|
||||
game.deal_damage(src=src_entity_id, target=target_entity_id, roll=Dice.roll(20), stat=attack_type, description=f"Entity {src_entity_id} attacks {target_entity_id} with a {attack_type} based attack.")
|
||||
dmg = game.deal_damage(src=src_entity_id, target=target_entity_id, roll=Dice.roll(20), stat=attack_type, description=f"Entity {src_entity_id} attacks {target_entity_id} with a {attack_type} based attack.")
|
||||
return {
|
||||
"success": True,
|
||||
"msg": f"Attack performed by {src_entity_id} on {target_entity_id} using {attack_type}"
|
||||
"msg": f"Attack performed by {src_entity_id} on {target_entity_id} using {attack_type}",
|
||||
"damage": dmg
|
||||
}
|
||||
|
||||
@mcp.tool()
|
||||
|
||||
Reference in New Issue
Block a user