-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathscript_1cad5f724f515fe3.gsc
130 lines (124 loc) · 3.02 KB
/
script_1cad5f724f515fe3.gsc
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Decompiled by Serious. Credits to Scoba for his original tool, Cerberus, which I heavily upgraded to support remaining features, other games, and other platforms.
#using script_59f07c660e6710a5;
#using scripts\core_common\ai_shared.gsc;
#namespace blackboard;
/*
Name: bb_getarrivaltype
Namespace: blackboard
Checksum: 0x957A3B85
Offset: 0x178
Size: 0x36
Parameters: 0
Flags: Linked, Private
*/
function private bb_getarrivaltype()
{
if(self ai::get_behavior_attribute("disablearrivals"))
{
return "dont_arrive_at_goal";
}
return "arrive_at_goal";
}
/*
Name: bb_gettacticalarrivalfacingyaw
Namespace: blackboard
Checksum: 0x342C2BCC
Offset: 0x1B8
Size: 0x3A
Parameters: 0
Flags: Linked, Private
*/
function private bb_gettacticalarrivalfacingyaw()
{
return angleclamp180(self.angles[1] - self.node.angles[1]);
}
/*
Name: bb_getlocomotionmovementtype
Namespace: blackboard
Checksum: 0x2BB06922
Offset: 0x200
Size: 0x1B6
Parameters: 0
Flags: Linked, Private
*/
function private bb_getlocomotionmovementtype()
{
if(!ai::getaiattribute(self, "disablesprint"))
{
if(ai::getaiattribute(self, "sprint"))
{
return "human_locomotion_movement_sprint";
}
if(!isdefined(self.nearbyfriendlycheck))
{
self.nearbyfriendlycheck = 0;
}
now = gettime();
if(now >= self.nearbyfriendlycheck)
{
self.nearbyfriendlycount = getactorteamcountradius(self.origin, 120, self.team, #"neutral");
self.nearbyfriendlycheck = now + 500;
}
if(self.nearbyfriendlycount >= 3)
{
return "human_locomotion_movement_default";
}
if(isdefined(self.enemy) && isdefined(self.runandgundist))
{
if(distancesquared(self.origin, self lastknownpos(self.enemy)) > self.runandgundist * self.runandgundist)
{
return "human_locomotion_movement_sprint";
}
}
else if(isdefined(self.goalpos) && isdefined(self.runandgundist))
{
if(distancesquared(self.origin, self.goalpos) > self.runandgundist * self.runandgundist)
{
return "human_locomotion_movement_sprint";
}
}
}
return "human_locomotion_movement_default";
}
/*
Name: bb_getcoverflankability
Namespace: blackboard
Checksum: 0x5FE81FD7
Offset: 0x3C0
Size: 0x1FA
Parameters: 0
Flags: Linked, Private
*/
function private bb_getcoverflankability()
{
if(self asmistransitionrunning())
{
return "unflankable";
}
if(!isdefined(self.node))
{
return "unflankable";
}
covermode = self getblackboardattribute("_cover_mode");
if(isdefined(covermode))
{
covernode = self.node;
if(covermode == "cover_alert" || covermode == "cover_mode_none")
{
return "flankable";
}
if(covernode.type == #"cover pillar")
{
return covermode == "cover_blind";
}
if(covernode.type == #"cover left" || covernode.type == #"cover right")
{
return covermode == "cover_blind" || covermode == "cover_over";
}
if(covernode.type == #"cover stand" || covernode.type == #"conceal stand" || (covernode.type == #"cover crouch" || covernode.type == #"cover crouch window" || covernode.type == #"conceal crouch"))
{
return "flankable";
}
}
return "unflankable";
}