-
Notifications
You must be signed in to change notification settings - Fork 1
/
dignityHuman.js
37 lines (29 loc) · 982 Bytes
/
dignityHuman.js
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
function DignityHuman() {
DignityAIBase.call(this);
this.senseEnemySpeed = 0;
this.isFindCover = false;
this.fearEnemyLevel = 0;
};
DignityHuman.prototype = Object.create(DignityAIBase.prototype);
DignityHuman.prototype.constructor = DignityHuman;
DignityHuman.prototype.detectedFriend = function(entity) {
console.log('human detectedFriend action');
};
DignityHuman.prototype.detectedEnemy = function(entity) {
console.log('human detectedEnemy action');
this.bullets = this.appContext.root.getChildren()[0].script.bullets;
this.shoot(this.bullets, entity);
};
DignityHuman.prototype.detectedOther = function(entity) {
console.log('detectedOther action base');
var name = result.entity.getName();
if(this.isFindCover) {
if(name.indexOf('cover') >= 0) {
this.coverObject(entity);
}
}
};
DignityHuman.prototype.coverObject = function(entity) {
console.log("human cover object");
this.speed = 0;
};