The documentation is out of date
This will need over a week of work, which in real time will require several weeks of work.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
--NOTE: This is the outline for the final combat system
|
||||
|
||||
--enumeration
|
||||
hitType = { MISS = 1, HIT = 2, CRITICAL = 3 }
|
||||
attackType = { PHYSICAL = 1, MAGICAL = 2 }
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
## Server
|
||||
|
||||
#### UserAccounts
|
||||
* userAccountID primary key
|
||||
* username unique
|
||||
* password --stored in the database (hashed)?
|
||||
* blacklisted {false, true}
|
||||
* whitelisted {true, false}
|
||||
|
||||
-------------------------
|
||||
|
||||
## Items
|
||||
|
||||
#### Notes
|
||||
* These are static; they're immutable during runtime
|
||||
|
||||
#### GlobalItemList
|
||||
* globalItemListID primary key
|
||||
* itemName unique
|
||||
* itemImage
|
||||
* type {mundane, consumable, equipment, etc.}
|
||||
* maxStackSize {1-max; -1 for false}
|
||||
* maxUniqueCopies {1-max; -1 for unlimited}
|
||||
|
||||
#### MundaneItems
|
||||
* mundaneItemID primary key
|
||||
* globalItemListID foreign key -> GlobalItemList.globalItemListID
|
||||
* TODO: attributes
|
||||
|
||||
#### Consumables
|
||||
* consumableID primary key
|
||||
* globalItemListID foreign key -> GlobalItemList.globalItemListID
|
||||
* TODO: attributes
|
||||
|
||||
#### Equipment
|
||||
* equipmentID primary key
|
||||
* globalItemListID foreign key -> GlobalItemList.globalItemListID
|
||||
* TODO: attributes
|
||||
|
||||
-------------------------
|
||||
|
||||
## Player
|
||||
|
||||
#### Notes
|
||||
* These change as the character progresses and grows
|
||||
|
||||
#### PlayerCharacters
|
||||
* characterID primary key
|
||||
* name unique
|
||||
|
||||
#### Player Statistics
|
||||
* currentLevel
|
||||
* currentExperience
|
||||
* maxHealth
|
||||
* maxMana
|
||||
* currentHealth
|
||||
* currentMana
|
||||
* attack
|
||||
* defence
|
||||
* etc.
|
||||
|
||||
#### Player Equipment
|
||||
* weapon foreign key -> Equipment.equipmentID
|
||||
* helmet foreign key -> Equipment.equipmentID
|
||||
* armour foreign key -> Equipment.equipmentID
|
||||
* TODO: etc.
|
||||
|
||||
#### PlayerInventoryItems
|
||||
* characterID foreign key -> PlayerCharacter.characterID
|
||||
* globalItemListID foreign key -> GlobalItemList.globalItemListID
|
||||
|
||||
|
||||
-------------------------
|
||||
|
||||
#### TODO
|
||||
|
||||
* customizable sprite
|
||||
@@ -1,14 +0,0 @@
|
||||
Entity: //the basic unit that is being stored in the primary container
|
||||
enum Type type //this mimics the NetworkPacket pattern a bit, I wonder if it's a good idea or not
|
||||
position //will always need to know it's location, because of the big maps
|
||||
motion //probably not necessary for anything other than the players. Still might as well include it, since I'm using pretty much everything else
|
||||
box //bounding box, because of reasons?
|
||||
id //the unique entity ID. can be used to lookup an instance in a different container
|
||||
|
||||
entities include:
|
||||
|
||||
* Players
|
||||
* Combat portals
|
||||
* item drops? I don't know if these are visible in the world
|
||||
* chests
|
||||
* dungeon doors?
|
||||
@@ -1,3 +1,5 @@
|
||||
--NOTE: I don't actually remember what this is
|
||||
|
||||
function CalcExp(base, mod, level)
|
||||
return math.floor(base * mod ^ level)
|
||||
end
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace std;
|
||||
|
||||
union Foo {
|
||||
enum class Type {
|
||||
INT,
|
||||
FLOAT
|
||||
}type;
|
||||
struct {
|
||||
Type type;
|
||||
int i;
|
||||
}i;
|
||||
struct {
|
||||
Type type;
|
||||
float f;
|
||||
}f;
|
||||
};
|
||||
|
||||
void serialize(Foo* f, void* buffer) {
|
||||
int len = 0;
|
||||
memcpy((void*)((int)buffer + len), &f->type, sizeof(Foo::Type));
|
||||
len += sizeof(Foo::Type);
|
||||
switch(f->type) {
|
||||
case Foo::Type::INT:
|
||||
memcpy((void*)((int)buffer + len), &f->i.i, sizeof(int));
|
||||
len += sizeof(int);
|
||||
break;
|
||||
case Foo::Type::FLOAT:
|
||||
memcpy((void*)((int)buffer + len), &f->f.f, sizeof(float));
|
||||
len += sizeof(float);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void deserialize(Foo* f, void* buffer) {
|
||||
int len = 0;
|
||||
memcpy(&f->type, (void*)((int)buffer + len), sizeof(Foo::Type));
|
||||
len += sizeof(Foo::Type);
|
||||
switch(f->type) {
|
||||
case Foo::Type::INT:
|
||||
memcpy(&f->i.i, (void*)((int)buffer + len), sizeof(int));
|
||||
len += sizeof(int);
|
||||
break;
|
||||
case Foo::Type::FLOAT:
|
||||
memcpy(&f->f.f, (void*)((int)buffer + len), sizeof(float));
|
||||
len += sizeof(float);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
Foo f;
|
||||
f.type = Foo::Type::FLOAT;
|
||||
f.f.f = 3.14;
|
||||
Foo i;
|
||||
i.type = Foo::Type::INT;
|
||||
i.i.i = 42;
|
||||
|
||||
char buffer[sizeof(Foo)];
|
||||
serialize(&f, buffer);
|
||||
deserialize(&i, buffer);
|
||||
|
||||
switch(i.type) {
|
||||
case Foo::Type::INT:
|
||||
cout << i.i.i << endl;
|
||||
break;
|
||||
case Foo::Type::FLOAT:
|
||||
cout << i.f.f << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user