# Design - In Practice

## Beyond the example demo

Once you add the Attributes and Vitals components to some Avatar/Agent you have in your game then you can start interacting with the data that they hold. You will need to put formulas somewhere, perhaps inline in your classes that interface with attributes, which will calculate results based on the attributes of some character(s).

Here are some common use cases and how they might work.

### Level Up

Add one level to the character.

```csharp
myAttributesClass.AddLevel(1);
```

### Scale Damage Output By Strength

Multiply some 'base damage' by the current strength. (This is a huge, unrealistic increase)

```csharp
int myDmgOutput = (int)(myBaseDamage * myAttributesClass.GetBase(AttType.Strength));
```

### Scale Damage Input By Endurance

Reduce incoming damage by the Endurance (This is a huge, unrealistic decrease)

```csharp
int reducedDamage = (int)(incomingDamage / myAttributesClass.Get(AttType.Endurance));
```

### Add a Modifier (such as "Weaken: -3 STR for 5 sec")

Requires an `AttributeModifierPreset`. Design an appropriate modifier preset in Vault, then reference it from a class. Feel free to design your own modifiers.

```csharp
public AttributeModifierPreset EffectModifier; // select your "weaken" effect here, for example.

public virtual void Cast(IAttributesUser source, IAttributesUser target)
{
    // simply tell the attributes system to attach it, and it'll do the rest.
    target.Attributes.AttachModifier(EffectModifier, source);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lanefox.gitbook.io/attributes/design/design-in-practice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
