# Tactical Combat Overview of the turn-based combat for development purposes. # Grimoire This is a holder item that stores the player's skill cards. A grimoire is limited to 15 skill cards, and can contain duplicates of the same card (up to 3). Todo: Eventually the grimoire UI should be accessible via the hotbar, rather than an actual inventory item. Skill cards would be consumed by interacting with them (left-click) ## UI ![grimoireui](https://hackmd.io/_uploads/By28k-BRyx.png) ### Progression Add a 'Progression' section at the bottom left. This is where quests will appear tied to skill progression, such as Class Selection and Elemental Attunement. ## Skill Cards Skill cards are 'burned/deleted' when added to the grimoire item, permanently listed within that player's skills. ### Skill Card Requirements To add a skill card to the grimoire, some skill cards might have requirements such as * level: player must be this level or higher * class: player must have this affinity/class ## Default The grimoire begins in a complete state, with the following basic skills (3x of each). This allows the player to immediately engage in battle. * Strike: Physical attack, deals 5d. Range of 1. MP of 10 * Dash: Move in any direction for 3. * Mana Blast: Linear projectile, deals 3d. Range of 5, width of 3. MP of 30. * Recover: Heal for 3d. MP of 20. * Essence Shroud: Increase your power stat by 20 for 3 turns. Additional uses may stack. MP of 20. CD of 3. # Battle ![mainui](https://hackmd.io/_uploads/BkTDe-rAyx.png) ## Options * Move: Once per turn you may move, either before or after your skill cast. The distance you can travel is 3, with an additional space * Cast Skill: Once per turn you can cast a skill. The skill is recycled into your grimoire, and the grimoire is shuffled. * Item: currently non-functional... unless? Probably something like item slots (up to 3) * End Turn: The turn should end automatically if the player has both moved and cast a turn, but if they want to do so prematurely this is an option. ### Action Add an 'Action' option beneath Cast Skill. These are optional, and should be unavailable / greyed out unless able to carry out the Action. You can perform as many actions as you want per turn, although some might have individual limits (such as only being able to perform that particular action once per turn). * Retreat: Attempt to retreat from the battle. All incoming damage is doubled. Must travel 30 spaces total to succesfully retreat. Cannot Cast Skill while retreating. * Cancel Retreat: No longer retreating (only displays if retreating, replacing 'Retreat'). Continue with your turn as usual. * Maim: Attempts to maim/defeat an opponent (they cannot recover from incapacitate until the battle ends). The injury options that appear are based on their shared battle log, only able to deal temporary injuries if it's a first encounter. Permanent injuries if it's a second (-5vit), and grievious (up to -10vit) if it's a third or beyond encounter. * Capture: Must have at least three or moreCaptures an incapacitated enemy, leaving them knocked down/vulnerable after the battle concludes. The capture is lost if the captor is incapicated. * Help Up: Must be facing an incapacitated ally. Helps them up, restoring them to 10% HP & MP. Skips your Cast Skill this turn. * Farsight * Music Themes ## Party UI See the existing party system (for realtime combat). This should be integrated into tactical so that players can set up parties as they usually would, and then they're managed in the battle. ## Combatant UI Same as realtime UI, except highlights the indicator if it's that combatant's active turn. Also should list the combatants based on turn order. ## Battle Conditions ### Incapacitated When a player's HP reaches 0, they enter an incapicated state ('dead' icon state) for the remainder of the battle. They cannot move, cast skills, and their turn is skipped. After 3 turns pass, the player recovers and resumes the battle at 10% HP and 10% MP. If incapacitated again, they will not recover and enter the defeated stage (or if maimed or captured). ### Defeated Unable to interact with the battle. Turn is skipped. ### Difficult Terrain Reduces movement range by half. 'Mud' status effect inflicts this, for example. ### Battle Victory Victory is achieved when all opposing enemies are incapacitated. ### Disconnections If a player disconnects from an active tactical battle, the participants should be alerted via onscreen text, "John has disconnected. The battle has paused until their return." with a timer (60s) until their potential return. The state of the battle is paused during this grace period. If they do not return in time then they're removed from the battle. If this leads to a battle outcome (no opposing combatants) then the battle is cancelled. Beneath the timer there should be a button to extend its duration. Clicking it increases the timer by 60s (and it can be done multiple times), but in the case of a group battle the opposing party leader must do so. ## AI Basic AI that moves and casts skills from a pool (with turn cooldowns). Should also be used for ally/summon AI. # Skills ## Skill Database Skills and the respective skill UI should be highly modular. New skill cards can be created and modified, as well as generated as skill cards. ### Database Variables #### Spell icon visuals Each skill type needs to follow a consistent standard for sanity sake, icon-state wise. * Beam: 32x32. start, middle, end * Wave: 32x32. left, middle, right * Linear Projectile: cast_anim, movement, end #### Player icon visuals * Beam: charge_dir (2s) followed by cast_dir (for duration of beam) * Linear projectiles should begin with 1s of 'charge_dir' #### Charge Visual An overlay that appears over the player as the spell is cast, mostly for visual glitz. This applies to beam, wave, projectiles, and lasts for a second. Some skills (such as physical) probably wouldn't time well. ## Skill Types * Linear Projectile * Homing Projectile * Beam * Strike * AoE * Charge * Buff * Summon Ally * Summon Object ## Status Effects Debuffs and buffs typically have different effects depending on their current status level. For example, Light Bleed can progress to Moderate Bleed if the player is dealt bleeding again. Status effects typically have a max duration. So inflicting Bleed on a player that has 3 turns of it left might increases it to the cap of 5 rather than 6. Status effects should display onscreen in 24x24 UI (or whatever looks best/is most practical) besides the combatant's HP/MP display, along with turns remaining. Damage is a multipler of the inflictor's power. 0.5 fire damage at 200 power is 100 fire damage. ### Debuff * Light Bleed: * Moderate Bleed * Heavy Bleed * Light Burn: Deals 0.25 fire damage each space moved. Moving 5 or more spaces (total) reduces the duration by 1. * Moderate Burn: Deals 0.5 fire damage each space moved. Moving 10 or more spaces (total) reduces the duration by 1. * Heavy Burn: Deals 0.5 fire damage each space moved. Must wait out the full duration regardless of movement. * Light Poison: Deals 0.25 poison damage each turn. Increases skill cast MP cost by 10. * Moderate Poison: Deals 0.25 poison damage each turn. Increases skill cast MP cost by 15. * Heavy Poison: Applies 'Paralysis' while Heavy Poison is active. Deals 0.25 poison damage each turn. Increases skill cast MP cost by 20. * Manabane: Increases CD of skill casts by 3. * Silence: Cannot cast a skill while this is active. * Dazed: Reduces movement range by 25%. * Paralysis: Reduces movement range by 75%. * Confusion: Movement direction is scrambled. * Wrath: Allies take friendly fire damage (at a 50% rate). ### Buff Instant buffs (like Restore and Mend) should play an animation on the receiver for five seconds. * Cleanse: * Full Cleanse: * Inspired: * ## Main Attributes * Damage: Multiply the skill damage by the player's power. So 'Strike' deals 1500 if the player has 300 power. * MP: Reduce this amount from the player's mana pool on cast. * Range: The distance the skill travels. * CD: Cooldown. This skill card is inactive, grey, with the # of turns remaining on the card, if re-drawn while on cooldown. This does not extend to copies of the card, only the particular card cast. * Affinity: Referred to as 'element' in the codebase. The type of damage, also reflected in the color of the damage numbers (red for fire f.ex) * Distance: The radius you must be from the target to cast the skill (a skill might require you to be within 3-7 tiles of the target, but not too close or too far f.ex) ## Sound * charge * cast * impact ## Special Attributes ### Counter Some skills can be cast as a reaction to another. This is a 10 second period if the player has a skill that can counter (otherwise skip this phase). Viable counters are highlighted in your hand during the phase. The skill type must match, such as Physical vs. Physical, or Beam vs. Beam. Currently this only supports Projectile vs. Projectile but should also support the following types, * strike * beam If a skill is to be cast as a Counter, the MP and CD cost is increased by 50%. ### Charge This skill must first be charged / made active. This counts as a skill card being played. ## Visuals * Dust clouds: generate excessively whenever the player quickly moves (such as a dash) or there is impact from a skill. # Skill Content ## Level Player level is 1 to 25 (currently this is 1 to 250, let's just remove the 0 for Tactical...) A skill point is gained each level. This allows the player to add a skill card to their grimoire. A signature point is gained at level 20. A stat point is gained at each level. ### Level Up Experience is rewarded the same as it is now, but Tactical Level is different from the standard game level in that it uses a separate formula for the requirements. Realtime combats levels are 1 to 250, but you're sort of speed ran up to 200 quickly. In this it should be more paced/slower, with the overall intention being that the difference between a level 5 and level 15 isn't that much of a gap (whereas in the current system a level 50 vs 150 is no contest) as the pool of stat/skill points for levelling up is lower. Something roughly similar to, Level 2 - 4: 500xp Level 5 - 9: 2000xp Level 10 - 19: 3000xp Level 20: 10000xp (& then +10k to each subsequent requirement) ## Misc / Various Skills ### Mechanics **Free Cast**: This skill is exempt from the 1 skill card per turn, you do not draw after casting the skill. **Combo**: This skill can only be cast if you cast a particular **affinity** this turn, and counts as a free cast ### Affinities Mage Cleric Soldier Rogue Hydromancy Aeromancy Pyromancy Geomancy Blood Magic Arcane Divination Summoning Illusionary ### Skills Focus on skills that won't require huge amounts of dev time / possible complications. These are all optional, we mostly want to get a decent amount of mechanics for playtesting purposes. **Rock Wall** (Geomancy): Change it to be cast as a counter skill against projectiles. **Quickstep** (Rogue): Dash 3 steps, free cast. Generate lots of dust clouds. No charge/delay, just quickly dash/move. **Link Transposition** (Arcane): Select any two combatants within a range of 15. Swap their places. See realtime spell for visual. Some kind of white flash/distortion teleport effect. **Blackhole** (Arcane): Begins small (50% size reduction). Each turn it grows in size & range/damage, pulling enemies towards it. Dust clouds as it pulls/damages. Lasts 3 turns. See realtime spell 'Earthquake' for potential referencing for visuals on damage. blackhole.dmi **Aquabeam** (Hydromancy): Standard beam-type spell, good for adding beam clashing for counter support. Visual handling is how most 'beams' function sprite-wise (start, middle, end, with middle looping, 32x32). Aquabeam.dmi, hydromancy **Recover** (Cleric): Restore 10% HP & draw 2 cards. **Hex** (Arcane): Transfer the status effects of the target to another. See 'Curse' realtime spell for visuals. (Arcane) **Leaping Strike** (Soldier): Leap to the selected area, dealing 3x3 aoe damage on impact, Ssee realtime spell ultrasmash for visuals. A leap/jump dash, and a crater + dust clouds + screen shake on-impact. **Lightspeed**: Teleport anywhere within a range of 8. Free See realtime spell lightspeed for visuals. **Flameshroud** (Pyromancy): Movement leaves fire. Duration of 3 turns. flameshroud.dmi **Formation**: Highlights a triangle shape around you for 5 turns, that also moves with you. While allies are within the shape they gain the 'formation' status buff that grants +20% DR. **Double Strike** (Physical): Combo (via Physical). Single physical strike that deals 3d, range of 1. **Mind Fray** (Illusion): Deals 2d homing dange, range of 5. Deals 'Mind Fray' debuff, next skill played by the opponent is randomized. **Warp Space** (Arcane): Create two portals (portal.dmi) within a range of 15. Linear projectiles, both of enemies and allies, can travel through it. **Marionette** (Blood): Move your target up to 75% of their max range, dealing light Bleed for each space travelled. **Miracle Heal** (Cleric): Restore an incapicated ally within 5 range to 20% HP. **Fortuna - Space** (Divination): Select ally. Cast 'space' big card visual. Swaps your location with theirs, deals an instant 5x5 AoE for damage once (compression.dmi) after locations are swapped. big cards.dmi **Fortuna - Hope** (Divination): Discard a card. Draw 2 cards. big cards.dmi **Wound Reversal** (Divination): Discard your hand. Restore 10 HP for each card discarded. WoundReversal.dmi **Incinerate** (Fire) Similar to 'Blazing Wave' except it doesn't leave burning tiles. If it moves past burning tiles it grows in size and gains +25% damage. Components needed for this effect in general. ## Base Class At level 1 a player may select a base quest via the progression menu. This adds the following skills directly to their skill list. ### Soldier Physical Element **Charge** (3x): Dashes directly forward. Any enemies caught within this are dragged with the player and dealt damage on landing. Deals 'Dazed' for 3 turns. Damage: 5, MP: 20, CD: 10 **Rend**: Physical strike. Visually if a weapon isn't equipped, uses randomized lightpunch or lightkick; otherwise 2slash (precedent for all basic physical attacks) Damage: 5, CD: 1 **Bulwark**: Allies within 5 spaces gain the 'Bulwark' status effect for 3 turns, reducing incoming damage by 20% while within range of the caster. This effect does not stack. MP: 20, CD: 10 ### Mage **Reflect**: For the next 3 turns, incoming damage is mitigated (taking MP damage instead of HP). The 'Reflect' status effect ends either after the turns expire or it's taken over 50% MP. tactical -> reflect.dmi CD: 10 **Mana Cannon**: Charge skill. After cast, the Skill Card remains within the hand. Next turn it glows/is highlighted and can be cast, after which it expires (if not cast) and is recycled to the deck; if it isn't cast it doesn't take MP or a skill card use. Applies 'mana_circle' -> idle while charging. When cast, mana_circle uses 'cast' icon state. Large cannon AoE (mana_beam). Damage: 8, MP: 30, CD: 10 **Mana Blast** Damage: 3, MP: 20, CD: 3 ### Cleric **Mend**: Heal a target by 20% HP. Must be within 1 range. MP: 20, CD: 5 summon_heal.dmi **Restore**: Restores 20% MP to target. Must be within 1 range. CD: 1 Aura2.dmi **Mana Blast** ## Element #### Fire The main theme is using your skills to create fire AoE, by casting Blazing Wave and Flameside for the initial creation, and then Inferno for expanding/renewing them. These inflict the Burn status effect. **Blazing Wave** See blazing wave for realtime example, width of 3. Leaves fire that lingers for 2 of the caster's subsequent turns. Damage: 4, CD: 3, MP: 20 **Flameslide** See flameslide for realtime example, width of 1. Leaves fire that lingers for 2 caster's subsequent turns. Range / dash of 5 spaces. Damage: 6, CD: 8, MP: 30 **Inferno**: Select a 5x5 area. Renews initial duration (2 turns) and also adds 1 duration. Spawns additional 2 turn fire on all sides of the selected lingering AoE. CD: 5, MP: 20 #### Earth Mud status effect reduces range by 50% if the player begins the turn standing on the inflicted space. **Rock Wall**: Place a structure within 5 spaces. This has 50HP and acts as a barricade against incoming projectiles until its destroyed, including friendly fire. Leaves 3x3 'mud' tiles on destruction. Lingers for 10 turns. CD: 3, MP: 10 RockWallH.dmi RockWallV.dmi **Golem**: Converts 3x3 mud tiles into an ally summon (10 HP, 25 power) that uses Strike and Rock Bomb. Max of 3. MP: 20 mandrake.dmi **Mudslide**: See realtime for similar. Linear projectile, 3 width, that leaves lingering mud for 2 of the caster's subsequent turns. Damage: 4, CD: 3, MP: 10 MudSlide.dmi #### Air The main theme is mobility (push backs, movement increases) and area control. #### Water * Bubble of Healing: Place a structure within 5 spaces. It lasts for 3 turns and applies a 2x heal & cleanse status effect to an ally (or the caster) stood on its space. * ## Misc * Ethereal Beam: See EnergyBeam as a realtime example. Basic foundation for beam-type spells (including Counters/a beam clash) * Enchant Weapon * Teleport * Blackhole * Reset * Spiral Bomb * Blood Sacrifice ## Signature Skill At level 20 a player can unlock a signature skill. These are themed in a way an advanced class might be (or a master elementalist). * Assassin * Ruler ## Custom Skills With the modular nature of skills, custom skills (and classes) are possible. Given the TRPG nature of the game the appeal of tailoring skills to a character's story is the goal, once they're established in the world. The custom skill UI should also showcase past skills that have been created (and of course those skills can be reintroduced). Over time, the community will build a strong skill database via spriting/collaboration, and in-game world building. ### Custom Skill UI # Character ## Attributes # Out of Scope Not entirely necessary for a functional release, since the initial focus is the PvP and not the PvE for example. Moreso long-term goals / things to consider. ## Event Support Needs support for dynamic cutscenes / events, and a decent script format for content that's tied into the quest system. This should occur at the start of, during, or at the end of a tactical battle. * camera pans over to the AI when they're prompted for dialogue * conditions for dialogue: turn number, HP amount * post dialogue event: optional follow up on dialogue of casting a particular skill ### Elemental Attunement (Quest) At level 10 this quest is unlocked. They can attune with an Element (Fire, Air, Water, or Earth) and gain the associated skill cards. They attune with the element by locating a runestone of that nature in the world, which then initiates a PvE battle. On completion of the quest they're granted the associated skill card items. # Notes Rogue: Bonus damage if attacking from behind or the flank Evasion skill that allows them to potentially dodge projectiles Quick dash skill (free action) for mobility and positioning Air: Push-back projectile, roaming tornadoes / field hazhards. Grace that increases party movement. Water: Healing bubble construct. Water puddle generation for Flood skill. - bubble of healing: generates water bubble that heals when standing within (including party members), generates puddle when is destroyed or expires - aquabeam: beam, generates splattering of puddles - flood: draws the puddles together, forming a flood AoE. those puddles persist when skill ends Ice: Transform puddles into Winters Talons / Glacier, the latter can be controlled/moved offensively until destroyed. Chronomancy: Skills with hand control mechanics (opponent discarding, drawing, etc) Summon: Three categories (lesser, brave, epic) of creature Summoning runes/magic circles. Summoning Circle - begins small (32x32), grows in size each turn the summoner is within. Max level of 4 (4 turns). Skills scale in power accordingly, unlocks requirements for brave at 2, and epic at 4 Lesser example - hawk that acts as a projectile spell, lingers for 1 turn afterwards Brave - Summons a true unit. Lingers until defeat. Epic - Boss music plays. MISC Hex: Transfer a debuff from one combatant to another, refreshing the duration. # Progress A list of completed milestones and short-term goals, what's currently being worked on. ## April * Garbage Collection (engine) * Traits (engine) * Components (engine) * Weakrefs (engine * Events (engine) * qdel (engine) * Custom skill database * Disconnection handling during combat * Actions content * Various bug fixes / changes * Battle start and end (victory conditions) * Party setup and handling * Party UI * Rudimentary turn tracker ## Current focus * Refactoring skills into components for better customization (engine) * Skill content for Mage, Soldier, Cleric * Skill content for Fire, Water, Earth, Air * Dynamic skill UI that can be edited / set up in-game (to add new trees, edit existing skills, etc all on the live server). Also allows for purchasing of class, element, and custom skills. ## Current Focus * Skill content handling (components) * Mage, Warrior, Cleric class content * Fire, Water, Air,