blob: aa90954d67bf2a62388525d53f9c589625e23d4b (
plain)
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
|
/*-- Schneeball --*/
#strict
#include ICE1
protected func Hit() {
CastPXS("Snow", 100, 20);
RemoveObject();
return(1);
}
protected func Departure(thrower) {
var proc = GetProcedure(thrower);
var comd = GetComDir(thrower);
// Ablegen -> Abbruch
if (GetPlrDownDouble(GetOwner(thrower)))
// Nur Ablegen in der Luft mit Befehlsrichtung? Luftwurf erlauben!
if (proc ne "FLIGHT" || GetComDir(thrower) == COMD_None)
return(0);
// Ablegen im stehenden Hangeln -> Abbruch
if (proc eq "HANGLE" && comd == COMD_None)
return(0);
// Ablegen im Schwimmen / Klettern -> Abbruch
if (proc eq "SWIM" || proc eq "SCALE")
return(0);
// Wurfrichtung rausfinden
var dir;
// Nach Befehlsrichtung, wenn sinnvolle Werte vorhanden
if (comd == COMD_Left() || comd == COMD_Right()) {
if (comd == COMD_Left()) dir = -1;
if (comd == COMD_Right()) dir = +1;
}
// sonst nach Blickrichtung
else {
if (GetDir(thrower) == DIR_Left()) dir = -1;
else dir = +1;
}
// Wurfgeschwindigkeiten berechnen
var x_dir = dir * GetPhysical("Throw", 0, thrower)/1000 + GetXDir(thrower) / 3;
var y_dir = -30;
if (!x_dir) return(0);
// Position anpassen
SetPosition(GetX() + x_dir / 5, GetY() - 2 + GetYDir(thrower) / 2);
// Geschwindigkeit setzen
SetXDir(x_dir);
SetYDir(y_dir);
Sound("Arrow");
}
func IsAlchemContainer() { return(true); }
func AlchemProcessTime() { return(100); }
|