Dragons and dungeons

State: On hold

Overview

The main challenge here is the mix of an rpg battle that is far from trivial and the fact the system need to be widely open to changes as we have small to no definitive features from start aside from the fact that it will be a turn-by-turn battle. It was an awesome experience, unfortunally the owner decided to set the project on hold after some months of work.

Inventory / Equipment

Requisites:

  • Each character should have their own inventory
  • Drag and drop
  • Dropping into equipment will cause a gear change and if it does all other possible actions must be disable, so this will be a “change gear” turn
  • Changing gear should be reflected into player sprite
  • Each item should have a detail info when right clicking it

Combat log

Requisites:

  • Expandable log for all combat actions
  • Custom messages for unique types of actions

For custom message I’m using inheritance with string interpolation to create message templates

public class CastSkillCombatLog : CombatLogEntry
{
    public sealed override string MessageTemplate => "<color={0}>{1}</color> used skill <color={2}>{3}</color>";
​
    public CastSkillCombatLog(BattleActor actor, Skill skill)
    {
        var actorColor = CombatLogUtilities.GetBattleActorRichTextColor(actor);
        var skillColor = CombatLogUtilities.GetSkillRichColor();
​
        Message = string.Format(MessageTemplate, actorColor, actor.name, skillColor, skill.name);
    }
}

This way the log caller (the point in the code that actually triggered the action) could call it as simple as

GameEvents.Battle.RaiseCombatLogAction(new CastSkillCombatLog(this, skill));

Its a good approach because we can easily expand and as the template is happening a single place changing it is quite simple


Skills and mana pool

Requisites:

  • Active and passive skills
  • Skills come from gear
  • Skills has a mana cost
  • Skills could have requisites as minimum inteligente to cast
  • Mana is generated at turn start
  • Mana is separated in groups, each skills will have a specific amount of cost for each group

This is the weapon view that you can edit as a designer. This staff has 2 active skills:
A. Heal skill that will be always avaliable
B. Heal II that will only be avaliable if caster has 10 intelligence (big intelligence in this case) and a 2 strenght (small strenght in this case)

And a passive skill that will always be active

This is the skill windows, here we can select the skill target, some custom modifier to apply when cast and the skill cost


Battle dialog

Requisites:

  • Some enemies should have custom dialogs
  • These dialogs can happen on start, end or when some custom events happen (like using a fire magic)
Death dialog for Chutchulu

To add/remove or change the conversation event is pretty simple

For custom events we have an extra field to act as key to find the dialog at runtime