-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathftl_spool.txt
128 lines (98 loc) · 3.38 KB
/
ftl_spool.txt
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
@name Wave Motion Engine Spool
@inputs Warp Destination:vector AngleOffset:angle Drive:wirelink DriveTransit WMESpeed ForceWarp
@outputs DesiredSpeed ConfirmSpeed SpeedRequired DT:string
@persist DT:string SpoolWait DriveType DriveCheck Transitting
#include "Novas-Public-E2s/library/nova_lib"
#To use this, wire Warp and Destination to the warp chip, and unwire the warp chip from any warp drives,
#Wire Drive to either a drive, or a drive selector
if(first() | dupefinished()){
DesiredSpeed = 100 #Idle Speed
Transitting = 0
}
if(~Warp & Warp == 1){
DT = Drive:entity():type()
if(DT == "sg_hyperdrive" | DT == "quantum_slipstream_drive" | DT == "st_warp_drive"){
printColor(ZeiaOng,"[WME] ",ZeiaWht,"Transit Drive ",ZeiaTBlu,"selected. Waiting for ",ZeiaMBlu,"Wave Motion Engine",ZeiaTBlu," to spool to ",ZeiaWht,"150%")
Drive["Destination",vector] = Destination
Drive["Angle Offset",angle] = AngleOffset
SpoolWait = 1
DriveType = 1
DriveCheck = 1
SpeedRequired = 150
}
if(DT == "bsg_drive" | DT == "ship_drive" | DT == "spore_drive"){
printColor(ZeiaOng,"[WME] ",ZeiaWht,"Jump Drive ",ZeiaTBlu,"selected. Waiting for ",ZeiaMBlu,"Wave Motion Engine",ZeiaTBlu," to spool to ",ZeiaWht,"200%")
Drive["Destination",vector] = Destination
Drive["Angle Offset",angle] = AngleOffset
SpoolWait = 1
DriveType = 2
DriveCheck = 1
SpeedRequired = 200
}
if(DriveCheck == 0){
printColor(ZeiaOng,"[WME] ",ZeiaTBlu,"Unrecognized Drive: [",ZeiaWht,DT,ZeiaTBlu,"] Cannot warp.")
}
else{
DriveCheck = 0
}
}
if(~WMESpeed & SpoolWait == 1){
if(DriveType == 1){
if(WMESpeed >= 150){
SpoolWait = 0
printColor(ZeiaOng,"[WME] ",ZeiaMBlu,"Wave Motion Engine ",ZeiaTBlu,"Spooled to",ZeiaWht," 150% ",ZeiaTBlu,"Activating Drive")
timer("spooled",1)
}
}
if(DriveType == 2){
if(WMESpeed >= 200){
SpoolWait = 0
printColor(ZeiaOng,"[WME] ",ZeiaMBlu,"Wave Motion Engine ",ZeiaTBlu,"Spooled to",ZeiaWht," 200% ",ZeiaTBlu,"Activating Drive")
timer("spooled",1)
}
}
}
if(clk("spooled")){
Drive["Activate",number] = 1
timer("checktransit",5000)
}
if(clk("checktransit")){
if(DriveTransit == 0 & Transitting == 0){
printColor(ZeiaOng,"[WME] ",ZeiaTBlu,"The Drive failed to activate!")
DesiredSpeed = 99.5
timer("reset",10)
}
}
if(~DriveTransit){
Transitting = 1
if(DriveTransit == 0){
DesiredSpeed = 99.5
timer("reset",1000)
}
}
if(clk("reset")){
DesiredSpeed = 100
ConfirmSpeed = 1
Drive["Destination",vector] = vec()
Drive["Activate",number] = 0
timer("confirmoff",10)
timer("angreset",11000)
}
if(clk("confirmoff")){
ConfirmSpeed = 0
}
if(clk("angreset")){
Drive["Angle Offset",angle] = ang()
Transitting = 0
}
if(~ForceWarp & ForceWarp == 1){
timer("spooled",10)
}
event chat(Ply:entity,Said:string,_){
if(Ply == owner()){
if(Said:lower():explode(" ")[1,string] == "/forcewarp"){
timer("spooled",10)
printColor(ZeiaOng,"[FTL] ",ZeiaTBlu,"ForceWarp initated, Activating ",ZeiaMBlu,"Wave Motion Engine")
}
}
}