# Tabletop RPG Mechanics Engine AI Agent Connect

> Deterministic mathematical resolution for TTRPG mechanics like D&D 5e.

## Overview
- **Category:** gaming
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_uQTR4sOxoVg9l8aL7VFhn6ul3n3TlnmJljmLF7A7/ai-agent-connect
- **Tags:** ttrpg, dnd5e, dice, mechanics, math

## Description

A precise mathematical engine for tabletop roleplaying games. It provides deterministic calculations for ability modifiers using `resolve_ability_check`, simulates d20 outcomes with `simulate_roll_outcome`, calculates damage with `calculate_damage`, and manages resource depletion via `update_spell_slots`. It handles complex rules including resistance, vulnerability, and proficiency scaling.

## Tools

### calculate_damage
Resolves the final damage value of an attack or spell

### simulate_roll_outcome
Determines the outcome of a d20 roll, accounting for advantage or disadvantage

### update_spell_slots
Manages the consumption of spell resources

### resolve_ability_check
Calculates the total modifier and the resulting proficiency bonus for a specific action

## Prompt Examples

**Prompt:** 
```
Calculate the total modifier for an ability score of 16 at level 5 with proficiency.
```

**Response:** 
```
The ability modifier is +3 and the proficiency bonus is +3, resulting in a total modifier of +6.
```

**Prompt:** 
```
What is the damage for 2d6+3 against a target with resistance?
```

**Response:** 
```
The damage range is 5 to 15, with an average of 10. With resistance, the final damage is 2 to 7.
```

**Prompt:** 
```
Simulate a d20 roll with advantage.
```

**Response:** 
```
The roll result is 17.
```

## Frequently Asked Questions

**How does the engine handle advantage and disadvantage?**
The `simulate_roll_outcome` tool calculates the result by picking the highest value for advantage or the lowest value for disadvantage from two d20 rolls.

**Can I calculate damage with resistances?**
Yes, the `calculate_damage` tool allows you to specify if a target has resistance or vulnerability to adjust the final damage value.

**How are proficiency bonuses determined?**
Proficiency bonuses are determined by character level through the `resolve_ability_check` tool.
