#ifndef CHARACTER_TEMPLATE_CLASS #define CHARACTER_TEMPLATE_CLASS #include #include #include #include "Combat.h" class Rig; class Animation; struct MeshData; class Texture; // A model a fighter always has in hand, riding one of its bones struct HeldModel { const MeshData* mesh = nullptr; // nothing held when nullptr. Its origin goes on the bone. Texture* texture = nullptr; std::string bone = "R_Weapon"; glm::vec3 turn = glm::vec3(0.0f); // degrees around x, y and z on top of the bone's own rotation bool hasMuzzle = false; // shots come out of muzzle rather than the bone glm::vec3 muzzle = glm::vec3(0.0f); // in the model's own space, where its Muzzle empty is float metallic = 0.6f; float roughness = 0.5f; }; // A kind of fighter, like a character select pick in a fighting game: how it stands, walks, takes hits and // what its attacks are. Any number of characters can be made from one, see CharacterManager::CreateCharacter. struct CharacterTemplate { std::string name; std::string displayName; // what the character select calls it bool selectable = true; // shown in the character select, false for ones only NPCs are Rig* rig = nullptr; Animation* idleAnimation = nullptr; // the stance it fights from, always on underneath everything Animation* walkAnimation = nullptr; // faded in on top while walking Animation* jumpAnimation = nullptr; // played from takeoff, its last pose held until it lands float jumpDelay = 0.0f; // real seconds into jumpAnimation it leaves the ground Animation* flinchAnimation = nullptr; // played when it's hit Animation* knockdownAnimation = nullptr; // played when it's knocked down, its last pose held until it's up Animation* dashAnimation = nullptr; // played over everything while it dashes std::vector combo; // left click, in order std::string comboName; // what the moves list calls it std::vector abilities; // on the number keys, the first on 1 HeldModel weapon; // what it carries, like a rifle float walkSpeed = 1.17f; // m/s on flat ground float sprintMultiplier = 1.4f; // times walkSpeed while sprinting float dashDistance = 4.0f; // m covered by a dash float dashDelay = 0.0f; // real seconds into dashAnimation it starts moving float dashTime = 0.4f; // real seconds a dash carries it for, after which it's free to do anything again float dashCooldown = 0.5f; // real seconds after one dash ends before the next float maxHealth = 100.0f; bool healsOnDeath = false; // never goes down, dying puts it back to full health }; #endif