#pragma once #include #include #include #include #include using AniFlag = std::variant< int, float, SDL_Point, SDL_FPoint, std::string, std::vector, std::vector>; struct AniFrame { std::string Img_Path; // img路径 int Img_Index; // img索引 SDL_Point Img_Pos; // img位置 std::vector> AttackBox; // 攻击框 std::vector> DamageBox; // 受击框 std::unordered_map Flag; // Frame特效数据 int Delay; // 延迟 }; struct AniInfo { std::vector Img_List; // img列表 std::vector Frame; // ani列表 std::unordered_map Flag; // ani特效数据 }; namespace AniScriptParser { static std::string Get_Ani_Flag(int data) { switch (data) { case 0: return "LOOP"; case 1: return "SHADOW"; case 3: return "COORD"; case 7: return "IMAGE_RATE"; case 8: return "IMAGE_ROTATE"; case 9: return "RGBA"; case 10: return "INTERPOLATION"; case 11: return "GRAPHIC_EFFECT"; case 12: return "DELAY"; case 13: return "DAMAGE_TYPE"; case 14: return "DAMAGE_BOX"; case 15: return "ATTACK_BOX"; case 16: return "PLAY_SOUND"; case 17: return "PRELOAD"; case 18: return "SPECTRUM"; case 23: return "SET_FLAG"; case 24: return "FLIP_TYPE"; case 25: return "LOOP_START"; case 26: return "LOOP_END"; case 27: return "CLIP"; case 28: return "OPERATION"; default: return ""; } } static std::string Get_Ani_Effect_Type(int data) { switch (data) { case 0: return "NONE"; case 1: return "DODGE"; case 2: return "LINEARDODGE"; case 3: return "DARK"; case 4: return "XOR"; case 5: return "MONOCHROME"; case 6: return "SPACEDISTORT"; default: return ""; } }; static std::string Get_Ani_Flip_Type(int data) { switch (data) { case 1: return "HORIZON"; case 2: return "VERTICAL"; case 3: return "ALL"; default: return ""; } }; static std::string Get_Ani_Damage_Type(int data) { switch (data) { case 0: return "NORMAL"; case 1: return "SUPERARMOR"; case 2: return "UNBREAKABLE"; default: return ""; } }; };