forked from miki151/keeperrl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdestroy_action.cpp
More file actions
68 lines (58 loc) · 1.51 KB
/
destroy_action.cpp
File metadata and controls
68 lines (58 loc) · 1.51 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stdafx.h"
#include "destroy_action.h"
#include "sound.h"
SERIALIZE_DEF(DestroyAction, type)
SERIALIZATION_CONSTRUCTOR_IMPL(DestroyAction)
DestroyAction::DestroyAction(Type t) : type(t) {
}
const char* DestroyAction::getVerbSecondPerson() const {
switch (type) {
case Type::BOULDER: return "destroy";
case Type::BASH: return "bash";
case Type::CUT: return "cut";
case Type::DIG: return "dig into";
}
}
const char* DestroyAction::getVerbThirdPerson() const {
switch (type) {
case Type::BASH: return "bashes";
case Type::BOULDER: return "destroys";
case Type::CUT: return "cuts";
case Type::DIG: return "digs into";
}
}
const char*DestroyAction::getIsDestroyed() const {
switch (type) {
case Type::BASH:
case Type::BOULDER: return "is destroyed";
case Type::CUT: return "falls";
case Type::DIG: return "is dug out";
}
}
const char* DestroyAction::getSoundText() const {
switch (type) {
case Type::BASH: return "BANG!";
case Type::BOULDER:
case Type::CUT: return "CRASH!";
case Type::DIG: return "";
}
}
Sound DestroyAction::getSound() const {
switch (type) {
case Type::BASH:
case Type::BOULDER: return SoundId::BANG_DOOR;
case Type::CUT: return SoundId::TREE_CUTTING;
case Type::DIG: return SoundId::DIGGING;
}
}
DestroyAction::Type DestroyAction::getType() const {
return type;
}
bool DestroyAction::canDestroyFriendly() const {
switch (type) {
case Type::BASH:
return false;
default:
return true;
}
}