-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathcollective_control.h
53 lines (43 loc) · 1.78 KB
/
collective_control.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "player_message.h"
#include "furniture_type.h"
#include "view_id.h"
class Creature;
class Collective;
class Tribe;
class CollectiveAttack;
struct TriggerInfo;
class CollectiveControl : public OwnedObject<CollectiveControl> {
public:
CollectiveControl(Collective*);
virtual void update(bool currentlyActive);
virtual void tick();
virtual void onMemberKilledOrStunned(Creature* victim, const Creature* killer);
virtual void onOtherKilled(const Creature* victim, const Creature* killer);
virtual void onMemberAdded(Creature*) {}
virtual void onConquered(Creature* victim, Creature* killer) {}
virtual void addMessage(const PlayerMessage&) {}
virtual void addWindowMessage(ViewIdList, const string&) {}
virtual void addAttack(const CollectiveAttack&) {}
virtual void onConstructed(Position, FurnitureType) {}
virtual void onClaimedSquare(Position) {}
virtual void onDestructed(Position, FurnitureType, const DestroyAction&) {}
virtual void onRansomPaid() {}
virtual bool canPillage(const Collective* by) const { return false; }
virtual void launchAllianceAttack(vector<Collective*> allies) { fail(); }
virtual bool considerVillainAmbush(const vector<Creature*>& travellers) { return false; }
virtual vector<TriggerInfo> getAllTriggers(const Collective* against) const;
vector<TriggerInfo> getTriggers(const Collective* against) const;
virtual bool canPerformAttack() const { fail(); }
enum class DuelAnswer {
ACCEPT,
REJECT,
UNKNOWN
};
virtual DuelAnswer acceptDuel(Creature* attacker) { return DuelAnswer::REJECT; }
SERIALIZATION_DECL(CollectiveControl)
virtual ~CollectiveControl();
static PCollectiveControl idle(Collective*);
const vector<Creature*>& getCreatures() const;
Collective* SERIAL(collective) = nullptr;
};