-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimals.c
92 lines (77 loc) · 2.28 KB
/
animals.c
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
object Animals;
void CreateAnimals(ref Location)
{
if (!IsEntity(Animals))
CreateEntity(&Animals, "Animals");
float midX, midY, midZ;
SendMessage(Location, "lseee", MSG_LOCATION_EX_MSG, "GetPatchMiddlePos", &midX, &midY, &midZ);
Animals.midY = midY;
aref locator_group;
aref locator;
int n;
int num;
//DumpAttributes(Location);
SendMessage(Animals, "l", MSG_ANIMALS_BUTTERFLIES_HIDE);
SendMessage(Animals, "l", MSG_ANIMALS_FISHSCHOOLS_HIDE);
SendMessage(Animals, "l", MSG_ANIMALS_SEAGULLS_HIDE);
if (!Whr_IsRain() /*&& !Whr_IsNight() && !Whr_IsStorm() && (Location.environment.sea == "true") && (Location.environment.weather == "true")*/)
{
if (!Whr_IsNight())
{
if (!Whr_IsStorm())
{
// seagulls
if(CheckAttribute(Location, "locators") && (Location.environment.weather == "true"))
{
SendMessage(Animals, "l", MSG_ANIMALS_SEAGULLS_SHOW);
if(CheckAttribute(Location, "locators.seagull"))
{
makearef(locator_group, location.locators.seagull);
num = GetAttributesNum(locator_group);
for(n = 0; n < num; n++)
{
locator = GetAttributeN(locator_group, n);
//SendMessage(Animals, "lfff", MSG_ANIMALS_SEAGULLS_ADD, stf(locator.x), stf(locator.y), stf(locator.z));
SendMessage(Animals, "lfff", MSG_ANIMALS_SEAGULLS_ADD, stf(locator.x), stf(locator.y), stf(locator.z));
}
}
}
// butterflies
if(!CheckAttribute(Location, "type")) Log_SetStringToLog("В локации баг, нет типа id=" + Location.id );
if (Location.type == "jungle")
{
SendMessage(Animals, "l", MSG_ANIMALS_BUTTERFLIES_SHOW);
}
}
}
}
}
void CreateSeaAnimals()
{
if (!IsEntity(Animals))
{
CreateEntity(&Animals, "Animals");
LayerAddObject(SEA_EXECUTE, &Animals, 77);
LayerAddObject(SEA_REALIZE, &Animals, 77);
}
Animals.midY = 0.0;
SendMessage(Animals, "l", MSG_ANIMALS_BUTTERFLIES_HIDE);
SendMessage(Animals, "l", MSG_ANIMALS_FISHSCHOOLS_SHOW);
SendMessage(Animals, "l", MSG_ANIMALS_SEAGULLS_HIDE);
if (!Whr_IsRain())
{
if (!Whr_IsNight())
{
if (!Whr_IsStorm())
{
SendMessage(Animals, "l", MSG_ANIMALS_SEAGULLS_SHOW);
SendMessage(Animals, "lfff", MSG_ANIMALS_SEAGULLS_ADD, 0.0, 0.0, 0.0);
}
}
}
}
void DeleteAnimals()
{
if (IsEntity(Animals))
DeleteClass(Animals);
}