I have a Monsters class, and when an instance is created, it must associate each monster with a weapon. ex. The monster Gryphon should have an attack on griffin 1 and an attack on griffin 2, of course, the name of the attack is TBD, but now it's good to use the attacks of griffin 1 and 2.
Currenly I have it.
#include <vector> typedef enum {Living, Dead, Nature} Race; typedef enum {Gryphon, Oracle, Mercenary,Templar, Satyr,Fallin Angel,ArcAngel,Satan,Grimreaper, Unbaptized Babies,Boggart,Succubus,Meat Wagon, Djinns,Manticore,Water Nymph,Plant Nymph, Mother Nature, Cannibal Tribesmen,Wyvern, Vegetable Lamb, Ent, Lava Worm, Alpha Dragon } MonsterType; typedef enum {gryphon1,Oracle1, Mercenary1,Templar1, Satyr1,Fallin Angel1,ArcAngel1,Satan1,Grimreaper1, Unbaptized Babies1,Boggart1,Succubus1,Meat Wagon1, Djinns1,Manticore1,Water Nymph1,Plant Nymph1, Mother Nature1, Cannibal Tribesmen1,Wyvern1, Vegetable Lamb1, Ent1, Lava Worm1,Alpha Dragon1, Gryphon2, Oracle2, Mercenary2,Templar2, Satyr2,Fallin Angel2,ArcAngel2,Satan2,Grimreaper2, Unbaptized Babies2,Boggart2,Succubus2,Meat Wagon2, Djinns2,Manticore2,Water Nymph2,Plant Nymph2, Mother Nature2, Cannibal Tribesmen2,Wyvern2, Vegetable Lamb2, Ent2, Lava Worm2, Alpha Dragon2 } Weapon; Class Monsters{ protected: MonsterType type; Race race; std::vector<Weapon> weapon_list; public: bool flying; bool lava; bool water; int life; int karmaCost; int move; int crit; int defMagic; int defNonMagic; bool isDead; bool canMove; bool canAttack; bool onFlag; int nextTurn; };
I am not sure about the vector, and if necessary, these were just some of the experiments I was busy with. But what is the best way to link a weapon to a monster? Also note that each weapon has values that go with it, So
gryphon attack 1 { int range = 10 int ticks = 5 bool magical = false int power = 23 bool heals = false } gryphon attack 2 { int range = 5 int ticks = 7 bool magical = true int power = 29 bool heals = true }
actual values are read from ini or the network, so I don’t worry about real values yet, but I need to know that I can add the values gryphon->weapon1->range = 5
I'm still very new to this, so if something seems very wrong, tell me.