From b1d6e5a314a74ff6259e331b6e52a6a0ce519549 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 16 May 2014 02:05:52 +1000 Subject: [PATCH] Mostly planning --- server/character_data.hpp | 15 ++++++++++--- server/combat_instance.hpp | 7 ++++++ server/enemy_data.hpp | 12 ++++++++-- todo.txt | 45 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/server/character_data.hpp b/server/character_data.hpp index df7aaf9..3a49689 100644 --- a/server/character_data.hpp +++ b/server/character_data.hpp @@ -38,9 +38,8 @@ struct CharacterData { int mapIndex = 0; Vector2 position = {0.0,0.0}; Vector2 motion = {0.0,0.0}; - BBox bbox = {0,0,0,0}; - //statistics + //base statistics int level = 0; int exp = 0; int maxHP = 0; @@ -55,7 +54,17 @@ struct CharacterData { float evasion = 0.0; float luck = 0.0; - //TODO: equipment and items + //TODO: equipment + //TODO: items + //TODO: buffs + //TODO: debuffs + + //active gameplay members + //NOTE: these are lost when unloaded + BBox bbox = {0,0,0,0}; + bool inCombat = false; + int atbGauge = 0; + //TODO: stored command }; #endif diff --git a/server/combat_instance.hpp b/server/combat_instance.hpp index 78ba16c..2507bb3 100644 --- a/server/combat_instance.hpp +++ b/server/combat_instance.hpp @@ -28,6 +28,13 @@ #include struct CombatInstance { + //TODO: metadata + + //world position + int mapIndex = 0; + Vector2 position = {0.0,0.0}; + Vector2 motion = {0.0,0.0}; + std::list characterList; std::list enemyList; diff --git a/server/enemy_data.hpp b/server/enemy_data.hpp index 1e90d68..0045444 100644 --- a/server/enemy_data.hpp +++ b/server/enemy_data.hpp @@ -29,8 +29,6 @@ struct EnemyData { std::string handle; std::string avatar; - //TODO: attached lua scripts - //statistics int level = 0; int exp = 0; @@ -45,6 +43,16 @@ struct EnemyData { float accuracy = 0.0; float evasion = 0.0; float luck = 0.0; + + //TODO: equipment + //TODO: items + //TODO: buffs + //TODO: debuffs + + //active gameplay members + //NOTE: these are lost when unloaded + int tableIndex; + int atbGauge = 0; }; #endif diff --git a/todo.txt b/todo.txt index a3d260d..8237afa 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,7 @@ * I need to keep the documentation up to date. Namely, the GDD is getting out of date. * How many lookups is the map system using? * Add the serial packet to the network utility +* I completely forgot about status ailments --Naming conventions-- @@ -38,3 +39,47 @@ Room: EnemyFactory enemyFactory --this takes information on the room's data early in the room's construction list +--Requirements-- + +The enemies need AI scripts +The scripts need to be able to generate other enemies (frog king). +The characters need a flag to show if they're in a combat instance or not, to signify of they should be unloaded client-side +On each game loop, the server should envoke each combat instance's update function + Each combat instance invokes each enemy's and character's update functions + These update functions increase the ATB guagues + if an ATB guage is full + than the stored command is executed + the players issue their commands during the build up + if there isn't a command ready, then the player is still choosing + for the enemies, the stored commands are driven by scripts, so when the enemies need to attack, their attached scripts are called. + after the commands are called, the ATB is reset to 0. + etc... + +--Enemy Tables-- + +enemyTables: The global store of enemy tables. Only accessed by C++ code (unless you want to break something). + +table.logic: the AI logic. If null, simply attack +table.ref: reference to the enemy itself, for use by API functions, set by constructor? + + + + + + + +--NOTE: useful for copying tables +function deepcopy(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy +end \ No newline at end of file