StupidAI.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "../../lib/BattleHex.h"
  3. class CStupidAI : public CBattleGameInterface
  4. {
  5. int side;
  6. CBattleCallback *cb;
  7. void print(const std::string &text) const;
  8. public:
  9. CStupidAI(void);
  10. ~CStupidAI(void);
  11. void init(CBattleCallback * CB) OVERRIDE;
  12. void actionFinished(const BattleAction *action) OVERRIDE;//occurs AFTER every action taken by any stack or by the hero
  13. void actionStarted(const BattleAction *action) OVERRIDE;//occurs BEFORE every action taken by any stack or by the hero
  14. BattleAction activeStack(const CStack * stack) OVERRIDE; //called when it's turn of that stack
  15. void battleAttack(const BattleAttack *ba) OVERRIDE; //called when stack is performing attack
  16. void battleStacksAttacked(const std::vector<BattleStackAttacked> & bsa) OVERRIDE; //called when stack receives damage (after battleAttack())
  17. void battleEnd(const BattleResult *br) OVERRIDE;
  18. //void battleResultsApplied() OVERRIDE; //called when all effects of last battle are applied
  19. void battleNewRoundFirst(int round) OVERRIDE; //called at the beginning of each turn before changes are applied;
  20. void battleNewRound(int round) OVERRIDE; //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
  21. void battleStackMoved(const CStack * stack, std::vector<BattleHex> dest, int distance) OVERRIDE;
  22. void battleSpellCast(const BattleSpellCast *sc) OVERRIDE;
  23. void battleStacksEffectsSet(const SetStackEffect & sse) OVERRIDE;//called when a specific effect is set to stacks
  24. //void battleTriggerEffect(const BattleTriggerEffect & bte) OVERRIDE;
  25. void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side) OVERRIDE; //called by engine when battle starts; side=0 - left, side=1 - right
  26. void battleStacksHealedRes(const std::vector<std::pair<ui32, ui32> > & healedStacks, bool lifeDrain, bool tentHeal, si32 lifeDrainFrom) OVERRIDE; //called when stacks are healed / resurrected first element of pair - stack id, second - healed hp
  27. void battleNewStackAppeared(const CStack * stack) OVERRIDE; //not called at the beginning of a battle or by resurrection; called eg. when elemental is summoned
  28. void battleObstaclesRemoved(const std::set<si32> & removedObstacles) OVERRIDE; //called when a certain set of obstacles is removed from batlefield; IDs of them are given
  29. void battleCatapultAttacked(const CatapultAttack & ca) OVERRIDE; //called when catapult makes an attack
  30. void battleStacksRemoved(const BattleStacksRemoved & bsr) OVERRIDE; //called when certain stack is completely removed from battlefield
  31. BattleAction goTowards(const CStack * stack, BattleHex hex );
  32. };